Bug 950508 - Build widget/windows in unified mode; r=roc
authorEhsan Akhgari <ehsan@mozilla.com>
Sun, 15 Dec 2013 19:00:54 -0500
changeset 170763 7635b9512d86a3d4d3ecbcfd3bd5772264f8bf68
parent 170762 bce074481220fcdde0072a527fd1af2ae73385d7
child 170764 9063babbb51981513aa8d3083a16f46cd95730f9
push id5166
push userlsblakk@mozilla.com
push dateTue, 04 Feb 2014 01:47:54 +0000
treeherdermozilla-aurora@977eb2548b2d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs950508
milestone29.0a1
Bug 950508 - Build widget/windows in unified mode; r=roc
widget/windows/JumpListBuilder.h
widget/windows/JumpListItem.h
widget/windows/TaskbarPreview.h
widget/windows/TaskbarPreviewButton.h
widget/windows/WinTaskbar.h
widget/windows/moz.build
widget/windows/nsFilePicker.h
widget/windows/nsImageClipboard.h
widget/windows/nsNativeDragSource.cpp
widget/windows/nsNativeDragTarget.cpp
widget/windows/nsNativeDragTarget.h
widget/windows/nsNativeThemeWin.h
widget/windows/nsUXThemeConstants.h
--- a/widget/windows/JumpListBuilder.h
+++ b/widget/windows/JumpListBuilder.h
@@ -7,16 +7,17 @@
 #define __JumpListBuilder_h__
 
 #include <windows.h>
 
 #undef NTDDI_VERSION
 #define NTDDI_VERSION NTDDI_WIN7
 // Needed for various com interfaces
 #include <shobjidl.h>
+#undef LogSeverity // SetupAPI.h #defines this as DWORD
 
 #include "nsString.h"
 #include "nsIMutableArray.h"
 
 #include "nsIJumpListBuilder.h"
 #include "nsIJumpListItem.h"
 #include "JumpListItem.h"
 #include "nsIObserver.h"
--- a/widget/windows/JumpListItem.h
+++ b/widget/windows/JumpListItem.h
@@ -3,16 +3,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef __JumpListItem_h__
 #define __JumpListItem_h__
 
 #include <windows.h>
 #include <shobjidl.h>
+#undef LogSeverity // SetupAPI.h #defines this as DWORD
 
 #include "nsIJumpListItem.h"  // defines nsIJumpListItem
 #include "nsIMIMEInfo.h" // defines nsILocalHandlerApp
 #include "nsTArray.h"
 #include "nsIMutableArray.h"
 #include "nsCOMPtr.h"
 #include "nsAutoPtr.h"
 #include "nsIURI.h"
--- a/widget/windows/TaskbarPreview.h
+++ b/widget/windows/TaskbarPreview.h
@@ -5,16 +5,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef __mozilla_widget_TaskbarPreview_h__
 #define __mozilla_widget_TaskbarPreview_h__
 
 #include <windows.h>
 #include <shobjidl.h>
+#undef LogSeverity // SetupAPI.h #defines this as DWORD
 
 #include <nsITaskbarPreview.h>
 #include <nsAutoPtr.h>
 #include <nsString.h>
 #include <nsWeakPtr.h>
 #include <nsIDocShell.h>
 #include "WindowHook.h"
 
--- a/widget/windows/TaskbarPreviewButton.h
+++ b/widget/windows/TaskbarPreviewButton.h
@@ -5,16 +5,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef __mozilla_widget_TaskbarPreviewButton_h__
 #define __mozilla_widget_TaskbarPreviewButton_h__
 
 #include <windows.h>
 #include <shobjidl.h>
+#undef LogSeverity // SetupAPI.h #defines this as DWORD
 
 #include <nsITaskbarPreviewButton.h>
 #include <nsAutoPtr.h>
 #include <nsString.h>
 #include <nsWeakReference.h>
 
 namespace mozilla {
 namespace widget {
--- a/widget/windows/WinTaskbar.h
+++ b/widget/windows/WinTaskbar.h
@@ -5,16 +5,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef __WinTaskbar_h__
 #define __WinTaskbar_h__
 
 #include <windows.h>
 #include <shobjidl.h>
+#undef LogSeverity // SetupAPI.h #defines this as DWORD
 #include "nsIWinTaskbar.h"
 #include "mozilla/Attributes.h"
 
 namespace mozilla {
 namespace widget {
 
 class WinTaskbar MOZ_FINAL : public nsIWinTaskbar
 {
--- a/widget/windows/moz.build
+++ b/widget/windows/moz.build
@@ -14,68 +14,76 @@ EXPORTS += [
     'WindowHook.h',
     'WinUtils.h',
 ]
 
 EXPORTS.mozilla.widget += [
     'AudioSession.h',
 ]
 
-SOURCES += [
+UNIFIED_SOURCES += [
     'AudioSession.cpp',
     'GfxInfo.cpp',
     'IEnumFE.cpp',
-    'JumpListBuilder.cpp',
     'JumpListItem.cpp',
     'KeyboardLayout.cpp',
     'nsAppShell.cpp',
-    'nsBidiKeyboard.cpp',
     'nsClipboard.cpp',
     'nsColorPicker.cpp',
     'nsDataObj.cpp',
     'nsDataObjCollection.cpp',
     'nsDragService.cpp',
-    'nsFilePicker.cpp',
     'nsIdleServiceWin.cpp',
     'nsImageClipboard.cpp',
-    'nsIMM32Handler.cpp',
     'nsLookAndFeel.cpp',
     'nsNativeDragSource.cpp',
     'nsNativeDragTarget.cpp',
     'nsNativeThemeWin.cpp',
     'nsScreenManagerWin.cpp',
     'nsScreenWin.cpp',
     'nsSound.cpp',
     'nsToolkit.cpp',
     'nsUXThemeData.cpp',
-    'nsWidgetFactory.cpp',
     'nsWindow.cpp',
     'nsWindowBase.cpp',
     'nsWindowDbg.cpp',
     'nsWindowGfx.cpp',
     'nsWinGesture.cpp',
     'TaskbarPreview.cpp',
     'TaskbarPreviewButton.cpp',
     'TaskbarTabPreview.cpp',
     'TaskbarWindowPreview.cpp',
     'WidgetTraceEvent.cpp',
     'WindowHook.cpp',
     'WinIMEHandler.cpp',
+    'WinTaskbar.cpp',
+]
+
+# The following files cannot be built in unified mode because they force NSPR logging.
+SOURCES += [
+    'nsIMM32Handler.cpp',
     'WinMouseScrollHandler.cpp',
-    'WinTaskbar.cpp',
     'WinUtils.cpp',
 ]
 
+# The following files cannot be built in unified mode because of name clashes.
+SOURCES += [
+    'JumpListBuilder.cpp',
+    'nsBidiKeyboard.cpp',
+    'nsFilePicker.cpp',
+    'nsWidgetFactory.cpp',
+]
+
 if CONFIG['MOZ_CRASHREPORTER']:
-    SOURCES += [
+    UNIFIED_SOURCES += [
         'LSPAnnotator.cpp',
     ]
 
 if CONFIG['NS_PRINTING']:
-    SOURCES += [
+    UNIFIED_SOURCES += [
         'nsDeviceContextSpecWin.cpp',
         'nsPrintOptionsWin.cpp',
         'nsPrintSettingsWin.cpp',
     ]
 
 if CONFIG['NS_ENABLE_TSF']:
     SOURCES += [
         'nsTextStore.cpp',
--- a/widget/windows/nsFilePicker.h
+++ b/widget/windows/nsFilePicker.h
@@ -25,16 +25,17 @@
 #include "nsISimpleEnumerator.h"
 #include "nsCOMArray.h"
 #include "nsAutoPtr.h"
 #include "nsBaseFilePicker.h"
 #include "nsString.h"
 #include "nsdefs.h"
 #include <commdlg.h>
 #include <shobjidl.h>
+#undef LogSeverity // SetupAPI.h #defines this as DWORD
 
 class nsILoadContext;
 
 class nsBaseWinFilePicker :
   public nsBaseFilePicker
 {
 public:
   NS_IMETHOD GetDefaultString(nsAString& aDefaultString);
--- a/widget/windows/nsImageClipboard.h
+++ b/widget/windows/nsImageClipboard.h
@@ -1,13 +1,16 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
+#ifndef nsImageClipboard_h
+#define nsImageClipboard_h
+
 /* Things To Do 11/8/00
 
 Check image metrics, can we support them? Do we need to?
 Any other render format? HTML?
 
 */
 
 #include "nsError.h"
@@ -81,8 +84,10 @@ public:
 private:
 
   void InvertRows(unsigned char * aInitialBuffer, uint32_t aSizeOfBuffer, uint32_t aNumBytesPerRow);
   nsresult ConvertColorBitMap(unsigned char * aInputBuffer, PBITMAPINFO pBitMapInfo, unsigned char * aOutBuffer);
   void CalcBitmask(uint32_t aMask, uint8_t& aBegin, uint8_t& aLength);
   void CalcBitShift(bitFields * aColorMask);
 
 }; // nsImageFromClipboard
+
+#endif
--- a/widget/windows/nsNativeDragSource.cpp
+++ b/widget/windows/nsNativeDragSource.cpp
@@ -7,18 +7,16 @@
 #include <stdio.h>
 #include "nsISupportsImpl.h"
 #include "nsString.h"
 #include "nsIServiceManager.h"
 #include "nsToolkit.h"
 #include "nsWidgetsCID.h"
 #include "nsIDragService.h"
 
-static NS_DEFINE_IID(kCDragServiceCID,  NS_DRAGSERVICE_CID);
-
 /*
  * class nsNativeDragSource
  */
 nsNativeDragSource::nsNativeDragSource(nsIDOMDataTransfer* aDataTransfer) :
   m_cRef(0),
   m_hCursor(nullptr),
   mUserCancelled(false)
 {
@@ -63,16 +61,18 @@ nsNativeDragSource::Release(void)
 
   delete this;
   return 0;
 }
 
 STDMETHODIMP
 nsNativeDragSource::QueryContinueDrag(BOOL fEsc, DWORD grfKeyState)
 {
+  static NS_DEFINE_IID(kCDragServiceCID,  NS_DRAGSERVICE_CID);
+
   nsCOMPtr<nsIDragService> dragService = do_GetService(kCDragServiceCID);
   if (dragService) {
     DWORD pos = ::GetMessagePos();
     dragService->DragMoved(GET_X_LPARAM(pos), GET_Y_LPARAM(pos));
   }
 
   if (fEsc) {
     mUserCancelled = true;
--- a/widget/windows/nsNativeDragTarget.cpp
+++ b/widget/windows/nsNativeDragTarget.cpp
@@ -17,34 +17,33 @@
 #include "nsClipboard.h"
 #include "KeyboardLayout.h"
 
 #include "mozilla/MouseEvents.h"
 
 using namespace mozilla;
 using namespace mozilla::widget;
 
-/* Define Class IDs */
-static NS_DEFINE_IID(kCDragServiceCID,  NS_DRAGSERVICE_CID);
-
 /* Define Interface IDs */
 static NS_DEFINE_IID(kIDragServiceIID, NS_IDRAGSERVICE_IID);
 
 // This is cached for Leave notification
 static POINTL gDragLastPoint;
 
 /*
  * class nsNativeDragTarget
  */
 nsNativeDragTarget::nsNativeDragTarget(nsIWidget * aWidget)
   : m_cRef(0), 
     mEffectsAllowed(DROPEFFECT_MOVE | DROPEFFECT_COPY | DROPEFFECT_LINK),
     mEffectsPreferred(DROPEFFECT_NONE),
     mTookOwnRef(false), mWidget(aWidget), mDropTargetHelper(nullptr)
 {
+  static NS_DEFINE_IID(kCDragServiceCID,  NS_DRAGSERVICE_CID);
+
   mHWnd = (HWND)mWidget->GetNativeData(NS_NATIVE_WINDOW);
 
   /*
    * Create/Get the DragService that we have implemented
    */
   CallGetService(kCDragServiceCID, &mDragService);
 }
 
--- a/widget/windows/nsNativeDragTarget.h
+++ b/widget/windows/nsNativeDragTarget.h
@@ -7,16 +7,17 @@
 
 #include "nsCOMPtr.h"
 #include "nsIDragSession.h"
 #include <ole2.h>
 #include <shlobj.h>
 
 #ifndef IDropTargetHelper
 #include <shobjidl.h> // Vista drag image interfaces
+#undef LogSeverity // SetupAPI.h #defines this as DWORD
 #endif
 
 #include "mozilla/Attributes.h"
 
 class nsIDragService;
 class nsIWidget;
 
 struct IDataObject;
--- a/widget/windows/nsNativeThemeWin.h
+++ b/widget/windows/nsNativeThemeWin.h
@@ -1,14 +1,17 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  *
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
+#ifndef nsNativeThemeWin_h
+#define nsNativeThemeWin_h
+
 #include "nsITheme.h"
 #include "nsCOMPtr.h"
 #include "nsIAtom.h"
 #include "nsNativeTheme.h"
 #include "gfxTypes.h"
 #include <windows.h>
 #include "mozilla/TimeStamp.h"
 
@@ -113,8 +116,10 @@ protected:
                                int aPart, int aState,
                                RECT* aWidgetRect, RECT* aClipRect,
                                gfxFloat aAppUnits);
 
 private:
   TimeStamp mProgressDeterminateTimeStamp;
   TimeStamp mProgressIndeterminateTimeStamp;
 };
+
+#endif
--- a/widget/windows/nsUXThemeConstants.h
+++ b/widget/windows/nsUXThemeConstants.h
@@ -1,15 +1,18 @@
 /* vim: se cin sw=2 ts=2 et : */
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  *
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
+#ifndef nsUXThemeConstants_h
+#define nsUXThemeConstants_h
+
 /* 
  * The following constants are used to determine how a widget is drawn using
  * Windows' Theme API. For more information on theme parts and states see
  * http://msdn.microsoft.com/en-us/library/bb773210(VS.85).aspx
  */
 
 #include <vssym32.h>
 #include <vsstyle.h>
@@ -239,8 +242,10 @@ enum {
   BS_NORMAL = 1,
   BS_HOT = 2,
   BS_PUSHED = 3,
   BS_DISABLED = 4,
   BS_INACTIVE = 5 /* undocumented, inactive caption button */
 };
 
 }}} // mozilla::widget::themeconst
+
+#endif