diff --git a/browser/components/shell/src/nsWindowsShellService.cpp b/browser/components/shell/src/nsWindowsShellService.cpp index d094b5bd9891..0cfc16531841 100644 --- a/browser/components/shell/src/nsWindowsShellService.cpp +++ b/browser/components/shell/src/nsWindowsShellService.cpp @@ -336,7 +336,6 @@ nsWindowsShellService::ShortcutMaintenance() bool nsWindowsShellService::IsDefaultBrowserVista(bool* aIsDefaultBrowser) { -#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN IApplicationAssociationRegistration* pAAR; HRESULT hr = CoCreateInstance(CLSID_ApplicationAssociationRegistration, @@ -355,7 +354,6 @@ nsWindowsShellService::IsDefaultBrowserVista(bool* aIsDefaultBrowser) pAAR->Release(); return true; } -#endif return false; } diff --git a/configure.in b/configure.in index 11b6ddef5ad6..f138a914d756 100644 --- a/configure.in +++ b/configure.in @@ -979,8 +979,6 @@ EOF AC_DEFINE_UNQUOTED(MOZ_WINSDK_TARGETVER,0x$MOZ_WINSDK_TARGETVER) # Definitions matching sdkddkver.h - AC_DEFINE_UNQUOTED(MOZ_NTDDI_WS03, 0x05020000) - AC_DEFINE_UNQUOTED(MOZ_NTDDI_LONGHORN, 0x06000000) AC_DEFINE_UNQUOTED(MOZ_NTDDI_WIN7, 0x06010000) ;; esac diff --git a/dom/plugins/ipc/PluginModuleChild.cpp b/dom/plugins/ipc/PluginModuleChild.cpp index dd7faf5ec036..6adcca96ec6d 100644 --- a/dom/plugins/ipc/PluginModuleChild.cpp +++ b/dom/plugins/ipc/PluginModuleChild.cpp @@ -625,7 +625,7 @@ PluginModuleChild::AnswerNP_Shutdown(NPError *rv) { AssertPluginThread(); -#if defined XP_WIN && MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN +#if defined XP_WIN mozilla::widget::StopAudioSession(); #endif @@ -689,7 +689,7 @@ PluginModuleChild::RecvSetAudioSessionData(const nsID& aId, const nsString& aDisplayName, const nsString& aIconPath) { -#if !defined XP_WIN || MOZ_WINSDK_TARGETVER < MOZ_NTDDI_LONGHORN +#if !defined XP_WIN NS_RUNTIMEABORT("Not Reached!"); return false; #else diff --git a/dom/plugins/ipc/PluginModuleParent.cpp b/dom/plugins/ipc/PluginModuleParent.cpp index b14714b8c39d..952a8b80aae1 100644 --- a/dom/plugins/ipc/PluginModuleParent.cpp +++ b/dom/plugins/ipc/PluginModuleParent.cpp @@ -776,7 +776,7 @@ PluginModuleParent::NP_Initialize(NPNetscapeFuncs* bFuncs, NPError* error) if (!CallNP_Initialize(error)) return NS_ERROR_FAILURE; -#if defined XP_WIN && MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN +#if defined XP_WIN // Send the info needed to join the chrome process's audio session to the // plugin process nsID id; diff --git a/hal/windows/WindowsBattery.cpp b/hal/windows/WindowsBattery.cpp index c958fea9bac6..72ff41cad051 100644 --- a/hal/windows/WindowsBattery.cpp +++ b/hal/windows/WindowsBattery.cpp @@ -50,7 +50,6 @@ namespace hal_impl { static nsCOMPtr sUpdateTimer; -#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN /* Power Event API is Vista or later */ typedef HPOWERNOTIFY (WINAPI *REGISTERPOWERSETTINGNOTIFICATION) (HANDLE, LPCGUID, DWORD); typedef BOOL (WINAPI *UNREGISTERPOWERSETTINGNOTIFICATION) (HPOWERNOTIFY); @@ -59,8 +58,6 @@ static UNREGISTERPOWERSETTINGNOTIFICATION sUnregisterPowerSettingNotification = static HPOWERNOTIFY sPowerHandle = nsnull; static HPOWERNOTIFY sCapacityHandle = nsnull; static HWND sHWnd = nsnull; -#endif - static bool IsVistaOrLater() @@ -91,7 +88,6 @@ UpdateHandler(nsITimer* aTimer, void* aClosure) { } } -#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN static LRESULT CALLBACK BatteryWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { @@ -107,12 +103,10 @@ BatteryWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { hal::NotifyBatteryChange(currentInfo); return TRUE; } -#endif void EnableBatteryNotifications() { -#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN if (IsVistaOrLater()) { // RegisterPowerSettingNotification is from Vista or later. // Use this API if available. @@ -163,7 +157,6 @@ EnableBatteryNotifications() &GUID_BATTERY_PERCENTAGE_REMAINING, DEVICE_NOTIFY_WINDOW_HANDLE); } else -#endif { // for Windows 2000 and Windwos XP. If we remove Windows XP support, // we should remove timer-based power notification @@ -181,7 +174,6 @@ EnableBatteryNotifications() void DisableBatteryNotifications() { -#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN if (IsVistaOrLater()) { if (sPowerHandle) { sUnregisterPowerSettingNotification(sPowerHandle); @@ -198,7 +190,6 @@ DisableBatteryNotifications() sHWnd = nsnull; } } else -#endif { if (sUpdateTimer) { sUpdateTimer->Cancel(); diff --git a/image/decoders/icon/win/nsIconChannel.cpp b/image/decoders/icon/win/nsIconChannel.cpp index 29f5bf544b60..0787296887db 100644 --- a/image/decoders/icon/win/nsIconChannel.cpp +++ b/image/decoders/icon/win/nsIconChannel.cpp @@ -60,12 +60,10 @@ #include "nsCExternalHandlerService.h" #include "nsDirectoryServiceDefs.h" -#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN #ifdef _WIN32_WINNT #undef _WIN32_WINNT #endif #define _WIN32_WINNT 0x0600 -#endif // we need windows.h to read out registry information... #include @@ -93,7 +91,6 @@ struct ICONENTRY { PRUint32 ieFileOffset; }; -#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN typedef HRESULT (WINAPI*SHGetStockIconInfoPtr) (SHSTOCKICONID siid, UINT uFlags, SHSTOCKICONINFO *psii); // Match stock icons with names @@ -105,7 +102,6 @@ static SHSTOCKICONID GetStockIconIDForName(const nsACString &aStockName) return SIID_INVALID; } -#endif // nsIconChannel methods nsIconChannel::nsIconChannel() @@ -383,7 +379,6 @@ nsresult nsIconChannel::GetHIconFromFile(HICON *hIcon) return rv; } -#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN nsresult nsIconChannel::GetStockHIcon(nsIMozIconURI *aIconURI, HICON *hIcon) { nsresult rv = NS_OK; @@ -426,7 +421,6 @@ nsresult nsIconChannel::GetStockHIcon(nsIMozIconURI *aIconURI, HICON *hIcon) return rv; } -#endif // Given a BITMAPINFOHEADER, returns the size of the color table. static int GetColorTableSize(BITMAPINFOHEADER* aHeader) @@ -500,7 +494,6 @@ nsresult nsIconChannel::MakeInputStream(nsIInputStream** _retval, bool nonBlocki // GetDIBits does not exist on windows mobile. HICON hIcon = NULL; -#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN nsCOMPtr iconURI(do_QueryInterface(mUrl, &rv)); NS_ENSURE_SUCCESS(rv, rv); @@ -509,7 +502,6 @@ nsresult nsIconChannel::MakeInputStream(nsIInputStream** _retval, bool nonBlocki if (!stockIcon.IsEmpty()) rv = GetStockHIcon(iconURI, &hIcon); else -#endif rv = GetHIconFromFile(&hIcon); NS_ENSURE_SUCCESS(rv, rv); diff --git a/image/decoders/icon/win/nsIconChannel.h b/image/decoders/icon/win/nsIconChannel.h index cec44005119c..d5fffd0a0f0c 100644 --- a/image/decoders/icon/win/nsIconChannel.h +++ b/image/decoders/icon/win/nsIconChannel.h @@ -87,10 +87,8 @@ protected: nsresult MakeInputStream(nsIInputStream** _retval, bool nonBlocking); // Functions specific to Vista and above -#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN protected: nsresult GetStockHIcon(nsIMozIconURI *aIconURI, HICON *hIcon); -#endif }; #endif /* nsIconChannel_h___ */ diff --git a/js/src/configure.in b/js/src/configure.in index 3e07282cd909..1f7f48b810cc 100644 --- a/js/src/configure.in +++ b/js/src/configure.in @@ -935,8 +935,6 @@ EOF AC_DEFINE_UNQUOTED(MOZ_WINSDK_TARGETVER,0x$MOZ_WINSDK_TARGETVER) # Definitions matching sdkddkver.h - AC_DEFINE_UNQUOTED(MOZ_NTDDI_WS03, 0x05020000) - AC_DEFINE_UNQUOTED(MOZ_NTDDI_LONGHORN, 0x06000000) AC_DEFINE_UNQUOTED(MOZ_NTDDI_WIN7, 0x06010000) ;; esac diff --git a/toolkit/components/downloads/nsDownloadManager.h b/toolkit/components/downloads/nsDownloadManager.h index 2750db9fd341..16a861e25eea 100644 --- a/toolkit/components/downloads/nsDownloadManager.h +++ b/toolkit/components/downloads/nsDownloadManager.h @@ -44,7 +44,7 @@ #ifndef downloadmanager___h___ #define downloadmanager___h___ -#if defined(XP_WIN) && (MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN) +#if defined(XP_WIN) #define DOWNLOAD_SCANNER #endif diff --git a/toolkit/components/downloads/nsDownloadScanner.cpp b/toolkit/components/downloads/nsDownloadScanner.cpp index 95906e3bd463..aed9123dd2a2 100644 --- a/toolkit/components/downloads/nsDownloadScanner.cpp +++ b/toolkit/components/downloads/nsDownloadScanner.cpp @@ -37,8 +37,6 @@ * * ***** END LICENSE BLOCK ***** */ -#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN - #include "nsDownloadScanner.h" #include #include @@ -760,5 +758,3 @@ nsDownloadScannerWatchdog::WatchdogThread(void *p) { _endthreadex(0); return 0; } - -#endif // MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN diff --git a/toolkit/components/downloads/nsDownloadScanner.h b/toolkit/components/downloads/nsDownloadScanner.h index 0830938592ea..b46a7c69e151 100644 --- a/toolkit/components/downloads/nsDownloadScanner.h +++ b/toolkit/components/downloads/nsDownloadScanner.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: se cin sw=2 ts=2 et : */ -#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN #ifndef nsDownloadScanner_h_ #define nsDownloadScanner_h_ @@ -121,4 +120,3 @@ private: }; #endif -#endif // MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN diff --git a/toolkit/crashreporter/nsExceptionHandler.cpp b/toolkit/crashreporter/nsExceptionHandler.cpp index dbcd4d783752..770c4d3189d1 100644 --- a/toolkit/crashreporter/nsExceptionHandler.cpp +++ b/toolkit/crashreporter/nsExceptionHandler.cpp @@ -770,7 +770,6 @@ nsresult SetExceptionHandler(nsILocalFile* aXREDirectory, #ifdef XP_WIN32 MINIDUMP_TYPE minidump_type = MiniDumpNormal; -#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN // Try to determine what version of dbghelp.dll we're using. // MinidumpWithFullMemoryInfo is only available in 6.1.x or newer. @@ -793,7 +792,6 @@ nsresult SetExceptionHandler(nsILocalFile* aXREDirectory, } } } -#endif // MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN #endif // XP_WIN32 // now set the exception handler diff --git a/uriloader/exthandler/win/nsOSHelperAppService.cpp b/uriloader/exthandler/win/nsOSHelperAppService.cpp index 679a76d0fa8c..5b06fe41242e 100644 --- a/uriloader/exthandler/win/nsOSHelperAppService.cpp +++ b/uriloader/exthandler/win/nsOSHelperAppService.cpp @@ -68,25 +68,19 @@ static nsresult GetExtensionFromWindowsMimeDatabase(const nsACString& aMimeType, nsOSHelperAppService::nsOSHelperAppService() : nsExternalHelperAppService() -#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN , mAppAssoc(nsnull) -#endif { -#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN CoInitialize(NULL); CoCreateInstance(CLSID_ApplicationAssociationRegistration, NULL, CLSCTX_INPROC, IID_IApplicationAssociationRegistration, (void**)&mAppAssoc); -#endif } nsOSHelperAppService::~nsOSHelperAppService() { -#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN if (mAppAssoc) mAppAssoc->Release(); mAppAssoc = nsnull; CoUninitialize(); -#endif } // The windows registry provides a mime database key which lists a set of mime types and corresponding "Extension" values. @@ -159,7 +153,6 @@ nsresult nsOSHelperAppService::OSProtocolHandlerExists(const char * aProtocolSch *aHandlerExists = false; if (aProtocolScheme && *aProtocolScheme) { -#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN // Vista: use new application association interface if (mAppAssoc) { PRUnichar * pResult = nsnull; @@ -174,7 +167,6 @@ nsresult nsOSHelperAppService::OSProtocolHandlerExists(const char * aProtocolSch } return NS_OK; } -#endif HKEY hKey; LONG err = ::RegOpenKeyExW(HKEY_CLASSES_ROOT, @@ -203,7 +195,6 @@ NS_IMETHODIMP nsOSHelperAppService::GetApplicationDescription(const nsACString& NS_ConvertASCIItoUTF16 buf(aScheme); -#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN // Vista: use new application association interface if (mAppAssoc) { PRUnichar * pResult = nsnull; @@ -220,7 +211,6 @@ NS_IMETHODIMP nsOSHelperAppService::GetApplicationDescription(const nsACString& } return NS_ERROR_NOT_AVAILABLE; } -#endif nsCOMPtr app; GetDefaultAppInfo(buf, _retval, getter_AddRefs(app)); @@ -555,7 +545,6 @@ already_AddRefed nsOSHelperAppService::GetByExtension(const nsAFl nsAutoString appInfo; bool found; -#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN // Retrieve the default application for this extension if (mAppAssoc) { // Vista: use the new application association COM interfaces @@ -575,7 +564,6 @@ already_AddRefed nsOSHelperAppService::GetByExtension(const nsAFl } } else -#endif { found = NS_SUCCEEDED(regKey->ReadStringValue(EmptyString(), appInfo)); diff --git a/uriloader/exthandler/win/nsOSHelperAppService.h b/uriloader/exthandler/win/nsOSHelperAppService.h index e7ad3c42a545..6023a05a3c51 100644 --- a/uriloader/exthandler/win/nsOSHelperAppService.h +++ b/uriloader/exthandler/win/nsOSHelperAppService.h @@ -94,9 +94,7 @@ protected: static bool typeFromExtEquals(const PRUnichar* aExt, const char *aType); private: -#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN IApplicationAssociationRegistration* mAppAssoc; -#endif }; #endif // nsOSHelperAppService_h__ diff --git a/widget/windows/AudioSession.cpp b/widget/windows/AudioSession.cpp index e4cfa2c81e87..26fcc8aaa956 100644 --- a/widget/windows/AudioSession.cpp +++ b/widget/windows/AudioSession.cpp @@ -36,8 +36,6 @@ * * ***** END LICENSE BLOCK ***** */ -#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN - #include #include #include @@ -478,5 +476,3 @@ AudioSession::OnStateChanged(AudioSessionState aState) } // namespace widget } // namespace mozilla - -#endif // MOZ_NTDDI_LONGHORN diff --git a/widget/windows/AudioSession.h b/widget/windows/AudioSession.h index f9245d0b48b4..203803bf9e9a 100644 --- a/widget/windows/AudioSession.h +++ b/widget/windows/AudioSession.h @@ -36,8 +36,6 @@ * * ***** END LICENSE BLOCK ***** */ -#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN - namespace mozilla { namespace widget { @@ -60,5 +58,3 @@ nsresult StopAudioSession(); } // namespace widget } // namespace mozilla - -#endif // MOZ_WINSK_TARGETVER >= MOZ_NTDDI_LONGHORN diff --git a/widget/windows/nsAppShell.cpp b/widget/windows/nsAppShell.cpp index c3fb941503b7..5dd3138dcd24 100644 --- a/widget/windows/nsAppShell.cpp +++ b/widget/windows/nsAppShell.cpp @@ -249,17 +249,13 @@ nsAppShell::Run(void) memset(modules, 0, sizeof(modules)); sLoadedModules = modules; -#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN // Ignore failure; failing to start the application is not exactly an // appropriate response to failing to start an audio session. mozilla::widget::StartAudioSession(); -#endif nsresult rv = nsBaseAppShell::Run(); -#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN mozilla::widget::StopAudioSession(); -#endif // Don't forget to null this out! sLoadedModules = nsnull; diff --git a/widget/windows/nsFilePicker.cpp b/widget/windows/nsFilePicker.cpp index e377e7556582..0fa53457d05d 100644 --- a/widget/windows/nsFilePicker.cpp +++ b/widget/windows/nsFilePicker.cpp @@ -1243,15 +1243,11 @@ nsFilePicker::AppendXPFilter(const nsAString& aTitle, const nsAString& aFilter) NS_IMETHODIMP nsFilePicker::AppendFilter(const nsAString& aTitle, const nsAString& aFilter) { -#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN if (WinUtils::GetWindowsVersion() >= WinUtils::VISTA_VERSION) { mComFilterList.Append(aTitle, aFilter); } else { AppendXPFilter(aTitle, aFilter); } -#else - AppendXPFilter(aTitle, aFilter); -#endif return NS_OK; } diff --git a/widget/windows/nsNativeThemeWin.cpp b/widget/windows/nsNativeThemeWin.cpp index be3002e90d58..2377e0a628b3 100644 --- a/widget/windows/nsNativeThemeWin.cpp +++ b/widget/windows/nsNativeThemeWin.cpp @@ -1220,7 +1220,6 @@ nsNativeThemeWin::DrawWidgetBackground(nsRenderingContext* aContext, if (!nsUXThemeData::drawThemeBG) return NS_ERROR_FAILURE; -#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN // ^^ without the right sdk, assume xp theming and fall through. if (nsUXThemeData::CheckForCompositor()) { switch (aWidgetType) { @@ -1249,7 +1248,6 @@ nsNativeThemeWin::DrawWidgetBackground(nsRenderingContext* aContext, break; } } -#endif // MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN PRInt32 part, state; nsresult rv = GetThemePartAndState(aFrame, aWidgetType, part, state); @@ -1794,11 +1792,9 @@ nsNativeThemeWin::GetWidgetPadding(nsDeviceContext* aContext, aWidgetType == NS_THEME_WINDOW_BUTTON_BOX_MAXIMIZED) { aResult->SizeTo(0, 0, 0, 0); -#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN // aero glass doesn't display custom buttons if (nsUXThemeData::CheckForCompositor()) return true; -#endif // button padding for standard windows if (aWidgetType == NS_THEME_WINDOW_BUTTON_BOX) { diff --git a/widget/windows/nsUXThemeData.cpp b/widget/windows/nsUXThemeData.cpp index b4ea9d7761a7..f0988e4c89a7 100644 --- a/widget/windows/nsUXThemeData.cpp +++ b/widget/windows/nsUXThemeData.cpp @@ -52,20 +52,16 @@ using namespace mozilla::widget; const PRUnichar nsUXThemeData::kThemeLibraryName[] = L"uxtheme.dll"; -#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN const PRUnichar nsUXThemeData::kDwmLibraryName[] = L"dwmapi.dll"; -#endif HANDLE nsUXThemeData::sThemes[eUXNumClasses]; HMODULE nsUXThemeData::sThemeDLL = NULL; -#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN HMODULE nsUXThemeData::sDwmDLL = NULL; -#endif BOOL nsUXThemeData::sFlatMenus = FALSE; @@ -89,7 +85,6 @@ nsUXThemeData::GetCurrentThemeNamePtr nsUXThemeData::getCurrentThemeName = NULL; nsUXThemeData::GetThemeSysColorPtr nsUXThemeData::getThemeSysColor = NULL; nsUXThemeData::IsThemeBackgroundPartiallyTransparentPtr nsUXThemeData::isThemeBackgroundPartiallyTransparent = NULL; -#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN nsUXThemeData::DwmExtendFrameIntoClientAreaProc nsUXThemeData::dwmExtendFrameIntoClientAreaPtr = NULL; nsUXThemeData::DwmIsCompositionEnabledProc nsUXThemeData::dwmIsCompositionEnabledPtr = NULL; nsUXThemeData::DwmSetIconicThumbnailProc nsUXThemeData::dwmSetIconicThumbnailPtr = NULL; @@ -98,17 +93,14 @@ nsUXThemeData::DwmGetWindowAttributeProc nsUXThemeData::dwmGetWindowAttributePtr nsUXThemeData::DwmSetWindowAttributeProc nsUXThemeData::dwmSetWindowAttributePtr = NULL; nsUXThemeData::DwmInvalidateIconicBitmapsProc nsUXThemeData::dwmInvalidateIconicBitmapsPtr = NULL; nsUXThemeData::DwmDefWindowProcProc nsUXThemeData::dwmDwmDefWindowProcPtr = NULL; -#endif void nsUXThemeData::Teardown() { Invalidate(); if(sThemeDLL) FreeLibrary(sThemeDLL); -#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN if(sDwmDLL) FreeLibrary(sDwmDLL); -#endif } void @@ -133,7 +125,6 @@ nsUXThemeData::Initialize() getThemeSysColor = (GetThemeSysColorPtr)GetProcAddress(sThemeDLL, "GetThemeSysColor"); isThemeBackgroundPartiallyTransparent = (IsThemeBackgroundPartiallyTransparentPtr)GetProcAddress(sThemeDLL, "IsThemeBackgroundPartiallyTransparent"); } -#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN if (GetDwmDLL()) { dwmExtendFrameIntoClientAreaPtr = (DwmExtendFrameIntoClientAreaProc)::GetProcAddress(sDwmDLL, "DwmExtendFrameIntoClientArea"); dwmIsCompositionEnabledPtr = (DwmIsCompositionEnabledProc)::GetProcAddress(sDwmDLL, "DwmIsCompositionEnabled"); @@ -145,7 +136,6 @@ nsUXThemeData::Initialize() dwmDwmDefWindowProcPtr = (DwmDefWindowProcProc)::GetProcAddress(sDwmDLL, "DwmDefWindowProc"); CheckForCompositor(true); } -#endif Invalidate(); } @@ -182,14 +172,12 @@ nsUXThemeData::GetThemeDLL() { return sThemeDLL; } -#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN HMODULE nsUXThemeData::GetDwmDLL() { if (!sDwmDLL && WinUtils::GetWindowsVersion() >= WinUtils::VISTA_VERSION) sDwmDLL = ::LoadLibraryW(kDwmLibraryName); return sDwmDLL; } -#endif const wchar_t *nsUXThemeData::GetClassName(nsUXThemeClass cls) { switch(cls) { @@ -267,7 +255,6 @@ nsUXThemeData::UpdateTitlebarInfo(HWND aWnd) if (!aWnd) return; -#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN if (!sTitlebarInfoPopulatedAero && nsUXThemeData::CheckForCompositor()) { RECT captionButtons; if (SUCCEEDED(nsUXThemeData::dwmGetWindowAttributePtr(aWnd, @@ -279,7 +266,6 @@ nsUXThemeData::UpdateTitlebarInfo(HWND aWnd) sTitlebarInfoPopulatedAero = true; } } -#endif if (sTitlebarInfoPopulatedThemed) return; diff --git a/widget/windows/nsUXThemeData.h b/widget/windows/nsUXThemeData.h index 1e6026dd8126..856739b103ae 100644 --- a/widget/windows/nsUXThemeData.h +++ b/widget/windows/nsUXThemeData.h @@ -45,9 +45,7 @@ #include "nscore.h" #include "mozilla/LookAndFeel.h" -#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN #include -#endif #include "nsWindowDefs.h" @@ -62,10 +60,8 @@ #define WM_DWMSENDICONICLIVEPREVIEWBITMAP 0x0326 #endif -#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN #define DWMWA_FORCE_ICONIC_REPRESENTATION 7 #define DWMWA_HAS_ICONIC_BITMAP 10 -#endif enum nsUXThemeClass { eUXButton = 0, @@ -115,18 +111,14 @@ enum WindowsThemeColor { class nsUXThemeData { static HMODULE sThemeDLL; -#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN static HMODULE sDwmDLL; -#endif static HANDLE sThemes[eUXNumClasses]; static const wchar_t *GetClassName(nsUXThemeClass); public: static const PRUnichar kThemeLibraryName[]; -#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN static const PRUnichar kDwmLibraryName[]; -#endif static BOOL sFlatMenus; static bool sTitlebarInfoPopulatedAero; static bool sTitlebarInfoPopulatedThemed; @@ -139,9 +131,7 @@ public: static void Invalidate(); static HANDLE GetTheme(nsUXThemeClass cls); static HMODULE GetThemeDLL(); -#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN static HMODULE GetDwmDLL(); -#endif // nsWindow calls this to update desktop settings info static void InitTitlebarInfo(); @@ -209,7 +199,6 @@ public: static GetThemeSysColorPtr getThemeSysColor; static IsThemeBackgroundPartiallyTransparentPtr isThemeBackgroundPartiallyTransparent; -#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN // dwmapi.dll function typedefs and declarations typedef HRESULT (WINAPI*DwmExtendFrameIntoClientAreaProc)(HWND hWnd, const MARGINS *pMarInset); typedef HRESULT (WINAPI*DwmIsCompositionEnabledProc)(BOOL *pfEnabled); @@ -228,7 +217,6 @@ public: static DwmSetWindowAttributeProc dwmSetWindowAttributePtr; static DwmInvalidateIconicBitmapsProc dwmInvalidateIconicBitmapsPtr; static DwmDefWindowProcProc dwmDwmDefWindowProcPtr; -#endif // MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN // This method returns the cached compositor state. Most // callers should call without the argument. The cache @@ -238,11 +226,9 @@ public: // composition transition. static bool CheckForCompositor(bool aUpdateCache = false) { static BOOL sCachedValue = FALSE; -#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN if(aUpdateCache && dwmIsCompositionEnabledPtr) { dwmIsCompositionEnabledPtr(&sCachedValue); } -#endif // MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN return (sCachedValue != FALSE); } }; diff --git a/widget/windows/nsWindow.cpp b/widget/windows/nsWindow.cpp index eeb45fd8727e..e1870dd2922c 100644 --- a/widget/windows/nsWindow.cpp +++ b/widget/windows/nsWindow.cpp @@ -412,9 +412,7 @@ nsWindow::nsWindow() : nsBaseWidget() mTransparentSurface = nsnull; mMemoryDC = nsnull; mTransparencyMode = eTransparencyOpaque; -#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN memset(&mGlassMargins, 0, sizeof mGlassMargins); -#endif // #if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN #endif mBackground = ::GetSysColor(COLOR_BTNFACE); mBrush = ::CreateSolidBrush(NSRGB_2_COLOREF(mBackground)); @@ -606,12 +604,10 @@ nsWindow::Create(nsIWidget *aParent, return NS_ERROR_FAILURE; } -#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN if (mIsRTL && nsUXThemeData::dwmSetWindowAttributePtr) { DWORD dwAttribute = TRUE; nsUXThemeData::dwmSetWindowAttributePtr(mWnd, DWMWA_NONCLIENT_RTL_LAYOUT, &dwAttribute, sizeof dwAttribute); } -#endif if (mWindowType != eWindowType_plugin && mWindowType != eWindowType_invisible && @@ -2510,7 +2506,6 @@ RegionFromArray(const nsTArray& aRects) void nsWindow::UpdateOpaqueRegion(const nsIntRegion &aOpaqueRegion) { -#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN if (!HasGlass() || GetParent()) return; @@ -2554,12 +2549,10 @@ void nsWindow::UpdateOpaqueRegion(const nsIntRegion &aOpaqueRegion) mGlassMargins = margins; UpdateGlass(); } -#endif // #if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN } void nsWindow::UpdateGlass() { -#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN MARGINS margins = mGlassMargins; // DWMNCRP_USEWINDOWSTYLE - The non-client rendering area is @@ -2592,7 +2585,6 @@ void nsWindow::UpdateGlass() nsUXThemeData::dwmExtendFrameIntoClientAreaPtr(mWnd, &margins); nsUXThemeData::dwmSetWindowAttributePtr(mWnd, DWMWA_NCRENDERING_POLICY, &policy, sizeof policy); } -#endif // #if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN } #endif @@ -4550,7 +4542,6 @@ bool nsWindow::ProcessMessage(UINT msg, WPARAM &wParam, LPARAM &lParam, bool result = false; // call the default nsWindow proc *aRetValue = 0; -#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN // Glass hit testing w/custom transparent margins LRESULT dwmHitResult; if (mCustomNonClient && @@ -4559,7 +4550,6 @@ bool nsWindow::ProcessMessage(UINT msg, WPARAM &wParam, LPARAM &lParam, *aRetValue = dwmHitResult; return true; } -#endif // MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN switch (msg) { // WM_QUERYENDSESSION must be handled by all windows. @@ -4751,11 +4741,9 @@ bool nsWindow::ProcessMessage(UINT msg, WPARAM &wParam, LPARAM &lParam, if (!mCustomNonClient) break; -#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN // let the dwm handle nc painting on glass if(nsUXThemeData::CheckForCompositor()) break; -#endif if (wParam == TRUE) { // going active @@ -4787,11 +4775,9 @@ bool nsWindow::ProcessMessage(UINT msg, WPARAM &wParam, LPARAM &lParam, if (!mCustomNonClient) break; -#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN // let the dwm handle nc painting on glass if(nsUXThemeData::CheckForCompositor()) break; -#endif HRGN paintRgn = ExcludeNonClientFromPaintRegion((HRGN)wParam); LRESULT res = CallWindowProcW(GetPrevWindowProc(), mWnd, @@ -5300,7 +5286,6 @@ bool nsWindow::ProcessMessage(UINT msg, WPARAM &wParam, LPARAM &lParam, return true; } -#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN case WM_DWMCOMPOSITIONCHANGED: // First, update the compositor state to latest one. All other methods // should use same state as here for consistency painting. @@ -5313,7 +5298,6 @@ bool nsWindow::ProcessMessage(UINT msg, WPARAM &wParam, LPARAM &lParam, UpdateGlass(); Invalidate(true, true, true); break; -#endif case WM_UPDATEUISTATE: { @@ -8145,10 +8129,8 @@ void nsWindow::SetWindowTranslucencyInner(nsTransparencyMode aMode) ::SetWindowLongPtrW(hWnd, GWL_STYLE, style); ::SetWindowLongPtrW(hWnd, GWL_EXSTYLE, exStyle); -#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN if (HasGlass()) memset(&mGlassMargins, 0, sizeof mGlassMargins); -#endif // #if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN mTransparencyMode = aMode; SetupTranslucentWindowMemoryBitmap(aMode); diff --git a/widget/windows/nsWindow.h b/widget/windows/nsWindow.h index 365c69c61c71..8d0ab4605cab 100644 --- a/widget/windows/nsWindow.h +++ b/widget/windows/nsWindow.h @@ -593,10 +593,8 @@ protected: nsRefPtr mTransparentSurface; HDC mMemoryDC; nsTransparencyMode mTransparencyMode; -#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN nsIntRegion mPossiblyTransparentRegion; MARGINS mGlassMargins; -#endif // #if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN #endif // MOZ_XUL // Win7 Gesture processing and management diff --git a/xpcom/base/nsMemoryReporterManager.cpp b/xpcom/base/nsMemoryReporterManager.cpp index 26a09604ac34..ce735bd9af4c 100644 --- a/xpcom/base/nsMemoryReporterManager.cpp +++ b/xpcom/base/nsMemoryReporterManager.cpp @@ -257,7 +257,6 @@ static PRInt64 GetVsize() return s.ullTotalVirtual - s.ullAvailVirtual; } -#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN static PRInt64 GetPrivate() { PROCESS_MEMORY_COUNTERS_EX pmcex; @@ -278,7 +277,6 @@ NS_MEMORY_REPORTER_IMPLEMENT(Private, "Memory that cannot be shared with other processes, including memory that " "is committed and marked MEM_PRIVATE, data that is not mapped, and " "executable pages that have been written to.") -#endif static PRInt64 GetResident() { @@ -582,7 +580,7 @@ nsMemoryReporterManager::Init() REGISTER(PageFaultsHard); #endif -#if defined(XP_WIN) && MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN +#if defined(XP_WIN) REGISTER(Private); #endif