Bug 721496 - Remove MOZ_WINSDK_TARGETVER ifdefs for pre-Windows 7 SDKs. r=jimm

This commit is contained in:
Mark Capella 2012-02-23 01:33:19 +01:00
parent 506fba2f61
commit 3a0b126058
24 changed files with 5 additions and 122 deletions

View File

@ -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;
}

View File

@ -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

View File

@ -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

View File

@ -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;

View File

@ -50,7 +50,6 @@ namespace hal_impl {
static nsCOMPtr<nsITimer> 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();

View File

@ -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 <windows.h>
@ -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<nsIMozIconURI> 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);

View File

@ -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___ */

View File

@ -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

View File

@ -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

View File

@ -37,8 +37,6 @@
*
* ***** END LICENSE BLOCK ***** */
#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN
#include "nsDownloadScanner.h"
#include <comcat.h>
#include <process.h>
@ -760,5 +758,3 @@ nsDownloadScannerWatchdog::WatchdogThread(void *p) {
_endthreadex(0);
return 0;
}
#endif // MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN

View File

@ -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

View File

@ -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

View File

@ -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<nsIFile> app;
GetDefaultAppInfo(buf, _retval, getter_AddRefs(app));
@ -555,7 +545,6 @@ already_AddRefed<nsMIMEInfoWin> 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<nsMIMEInfoWin> nsOSHelperAppService::GetByExtension(const nsAFl
}
}
else
#endif
{
found = NS_SUCCEEDED(regKey->ReadStringValue(EmptyString(),
appInfo));

View File

@ -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__

View File

@ -36,8 +36,6 @@
*
* ***** END LICENSE BLOCK ***** */
#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN
#include <windows.h>
#include <audiopolicy.h>
#include <mmdeviceapi.h>
@ -478,5 +476,3 @@ AudioSession::OnStateChanged(AudioSessionState aState)
} // namespace widget
} // namespace mozilla
#endif // MOZ_NTDDI_LONGHORN

View File

@ -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

View File

@ -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;

View File

@ -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;
}

View File

@ -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) {

View File

@ -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;

View File

@ -45,9 +45,7 @@
#include "nscore.h"
#include "mozilla/LookAndFeel.h"
#if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN
#include <dwmapi.h>
#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);
}
};

View File

@ -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<nsIntRect>& 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);

View File

@ -593,10 +593,8 @@ protected:
nsRefPtr<gfxASurface> 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

View File

@ -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