Bug 1041311 - Fix Qt compilation. r=romaxa
authorTom Schuster <evilpies@gmail.com>
Sun, 20 Jul 2014 12:55:00 -0400
changeset 216009 f5f3d2f7bc4e146228fc822bac3293cffe8588da
parent 216008 b00c22ac9b230810123a0d99bc1f3447465a8b7b
child 216010 030adb40ad1921a88b6ea4e46d97206084dc6147
push id3857
push userraliiev@mozilla.com
push dateTue, 02 Sep 2014 16:39:23 +0000
treeherdermozilla-beta@5638b907b505 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersromaxa
bugs1041311
milestone33.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1041311 - Fix Qt compilation. r=romaxa
image/decoders/icon/qt/nsIconChannel.h
toolkit/components/remote/nsQtRemoteService.cpp
toolkit/components/remote/nsQtRemoteService.h
widget/qt/nsBidiKeyboard.h
widget/qt/nsClipboard.h
widget/qt/nsDeviceContextSpecQt.cpp
widget/qt/nsDeviceContextSpecQt.h
widget/qt/nsPrintDialogQt.h
widget/qt/nsPrintSettingsQt.h
widget/qt/nsScreenManagerQt.cpp
widget/qt/nsScreenManagerQt.h
widget/qt/nsScreenQt.cpp
widget/qt/nsScreenQt.h
widget/qt/nsWindow.h
--- a/image/decoders/icon/qt/nsIconChannel.h
+++ b/image/decoders/icon/qt/nsIconChannel.h
@@ -20,26 +20,27 @@
  * that file to which all calls will be proxied.
  */
 class nsIconChannel MOZ_FINAL : public nsIChannel {
   public:
     NS_DECL_ISUPPORTS
     NS_FORWARD_NSIREQUEST(mRealChannel->)
     NS_FORWARD_NSICHANNEL(mRealChannel->)
 
-    nsIconChannel() {}
-    ~nsIconChannel() {}
+    nsIconChannel() {};
 
     /**
      * Called by nsIconProtocolHandler after it creates this channel.
      * Must be called before calling any other function on this object.
      * If this method fails, no other function must be called on this object.
      */
     nsresult Init(nsIURI* aURI);
   private:
+    ~nsIconChannel() {};
+
     /**
      * The channel to the temp icon file (e.g. to /tmp/2qy9wjqw.html).
      * Will always be non-null after a successful Init.
      */
     nsCOMPtr<nsIChannel> mRealChannel;
 };
 
 #endif
--- a/toolkit/components/remote/nsQtRemoteService.cpp
+++ b/toolkit/components/remote/nsQtRemoteService.cpp
@@ -58,16 +58,20 @@ NS_IMPL_ISUPPORTS(nsQtRemoteService,
                   nsIRemoteService,
                   nsIObserver)
 
 nsQtRemoteService::nsQtRemoteService():
 mServerWindow(0)
 {
 }
 
+nsQtRemoteService::~nsQtRemoteService()
+{
+}
+
 NS_IMETHODIMP
 nsQtRemoteService::Startup(const char* aAppName, const char* aProfileName)
 {
   if (mServerWindow) return NS_ERROR_ALREADY_INITIALIZED;
   NS_ASSERTION(aAppName, "Don't pass a null appname!");
 
   XRemoteBaseStartup(aAppName,aProfileName);
 
--- a/toolkit/components/remote/nsQtRemoteService.h
+++ b/toolkit/components/remote/nsQtRemoteService.h
@@ -16,19 +16,20 @@ class RemoteEventHandlerWidget;
 class nsQtRemoteService : public nsXRemoteService
 {
 public:
   // We will be a static singleton, so don't use the ordinary methods.
   NS_DECL_ISUPPORTS
   NS_DECL_NSIREMOTESERVICE  
 
   nsQtRemoteService();
-  virtual ~nsQtRemoteService() { };
 
 private:
+  virtual ~nsQtRemoteService();
+
   virtual void SetDesktopStartupIDOrTimestamp(const nsACString& aDesktopStartupID,
                                               uint32_t aTimestamp);
 
   void PropertyNotifyEvent(XEvent *evt);
   friend class MozQRemoteEventHandlerWidget;
 
   QWindow *mServerWindow;
 };
--- a/widget/qt/nsBidiKeyboard.h
+++ b/widget/qt/nsBidiKeyboard.h
@@ -11,13 +11,15 @@
 
 class nsBidiKeyboard : public nsIBidiKeyboard
 {
 public:
     NS_DECL_ISUPPORTS
     NS_DECL_NSIBIDIKEYBOARD
 
     nsBidiKeyboard();
+
+protected:
     virtual ~nsBidiKeyboard();
 };
 
 
 #endif // __nsBidiKeyboard
--- a/widget/qt/nsClipboard.h
+++ b/widget/qt/nsClipboard.h
@@ -12,30 +12,30 @@
 
 #include <qclipboard.h>
 
 /* Native Qt Clipboard wrapper */
 class nsClipboard : public nsIClipboard
 {
 public:
     nsClipboard();
-    virtual ~nsClipboard();
 
     //nsISupports
     NS_DECL_ISUPPORTS
 
     // nsIClipboard
     NS_DECL_NSICLIPBOARD
 
 protected:
+    virtual ~nsClipboard();
+
     NS_IMETHOD SetNativeClipboardData(nsITransferable *aTransferable,
                                       QClipboard::Mode cbMode);
     NS_IMETHOD GetNativeClipboardData(nsITransferable *aTransferable,
                                       QClipboard::Mode cbMode);
 
     nsCOMPtr<nsIClipboardOwner> mSelectionOwner;
     nsCOMPtr<nsIClipboardOwner> mGlobalOwner;
     nsCOMPtr<nsITransferable>   mSelectionTransferable;
     nsCOMPtr<nsITransferable>   mGlobalTransferable;
-    nsRefPtr<nsClipboardPrivacyHandler> mPrivacyHandler;
 };
 
 #endif // nsClipboard_h__
--- a/widget/qt/nsDeviceContextSpecQt.cpp
+++ b/widget/qt/nsDeviceContextSpecQt.cpp
@@ -209,16 +209,20 @@ NS_IMETHODIMP nsDeviceContextSpecQt::End
     return NS_OK;
 }
 
 //  Printer Enumerator
 nsPrinterEnumeratorQt::nsPrinterEnumeratorQt()
 {
 }
 
+nsPrinterEnumeratorQt::~nsPrinterEnumeratorQt()
+{
+}
+
 NS_IMPL_ISUPPORTS(nsPrinterEnumeratorQt, nsIPrinterEnumerator)
 
 NS_IMETHODIMP nsPrinterEnumeratorQt::GetPrinterNameList(
         nsIStringEnumerator** aPrinterNameList)
 {
     NS_ENSURE_ARG_POINTER(aPrinterNameList);
     *aPrinterNameList = nullptr;
 
--- a/widget/qt/nsDeviceContextSpecQt.h
+++ b/widget/qt/nsDeviceContextSpecQt.h
@@ -14,17 +14,16 @@
 #include "nsString.h"
 
 #include "nsCRT.h" /* should be <limits.h>? */
 
 class nsDeviceContextSpecQt : public nsIDeviceContextSpec
 {
 public:
     nsDeviceContextSpecQt();
-    virtual ~nsDeviceContextSpecQt();
 
     NS_DECL_ISUPPORTS
 
     NS_IMETHOD GetSurfaceForPrinter(gfxASurface** surface);
 
     NS_IMETHOD Init(nsIWidget* aWidget,
                     nsIPrintSettings* aPS,
                     bool aIsPrintPreview);
@@ -34,26 +33,32 @@ public:
                              int32_t aEndPage);
     NS_IMETHOD EndDocument();
     NS_IMETHOD BeginPage() { return NS_OK; }
     NS_IMETHOD EndPage() { return NS_OK; }
 
     NS_IMETHOD GetPath (const char** aPath);
 
 protected:
+    virtual ~nsDeviceContextSpecQt();
+
     nsCOMPtr<nsIPrintSettings> mPrintSettings;
     bool mToPrinter : 1;      /* If true, print to printer */
     bool mIsPPreview : 1;     /* If true, is print preview */
     char   mPath[PATH_MAX];     /* If toPrinter = false, dest file */
     char   mPrinter[256];       /* Printer name */
     nsCString         mSpoolName;
     nsCOMPtr<nsIFile> mSpoolFile;
 };
 
 class nsPrinterEnumeratorQt : public nsIPrinterEnumerator
 {
 public:
     nsPrinterEnumeratorQt();
     NS_DECL_ISUPPORTS
     NS_DECL_NSIPRINTERENUMERATOR
+
+protected:
+    virtual ~nsPrinterEnumeratorQt();
+
 };
 
 #endif /* !nsDeviceContextSpecQt_h___ */
--- a/widget/qt/nsPrintDialogQt.h
+++ b/widget/qt/nsPrintDialogQt.h
@@ -10,21 +10,23 @@
 #include "nsIPrintDialogService.h"
 
 class nsIPrintSettings;
 
 class nsPrintDialogServiceQt : public nsIPrintDialogService
 {
 public:
     nsPrintDialogServiceQt();
-    virtual ~nsPrintDialogServiceQt();
 
     NS_DECL_ISUPPORTS
 
     NS_IMETHODIMP Init();
     NS_IMETHODIMP Show(nsIDOMWindow* aParent, 
                        nsIPrintSettings* aSettings,
                        nsIWebBrowserPrint* aWebBrowserPrint);
     NS_IMETHODIMP ShowPageSetup(nsIDOMWindow* aParent,
                                 nsIPrintSettings* aSettings);
+
+protected:
+    virtual ~nsPrintDialogServiceQt();
 };
 
 #endif
--- a/widget/qt/nsPrintSettingsQt.h
+++ b/widget/qt/nsPrintSettingsQt.h
@@ -12,20 +12,19 @@
 #define NS_PRINTSETTINGSQT_IID \
 {0x5bc4c746, 0x8970, 0x43a3, {0xbf, 0xb1, 0x5d, 0xe1, 0x74, 0xaf, 0x7c, 0xea}}
 
 class QPrinter;
 class nsPrintSettingsQt : public nsPrintSettings
 {
 public:
     NS_DECL_ISUPPORTS_INHERITED
-        NS_DECLARE_STATIC_IID_ACCESSOR(NS_PRINTSETTINGSQT_IID)
+    NS_DECLARE_STATIC_IID_ACCESSOR(NS_PRINTSETTINGSQT_IID)
 
     nsPrintSettingsQt();
-    virtual ~nsPrintSettingsQt();
 
     NS_IMETHOD GetPrintRange(int16_t* aPrintRange);
     NS_IMETHOD SetPrintRange(int16_t aPrintRange);
 
     NS_IMETHOD GetStartPageRange(int32_t* aStartPageRange);
     NS_IMETHOD SetStartPageRange(int32_t aStartPageRange);
     NS_IMETHOD GetEndPageRange(int32_t* aEndPageRange);
     NS_IMETHOD SetEndPageRange(int32_t aEndPageRange);
@@ -66,16 +65,18 @@ public:
     NS_IMETHOD GetPaperHeight(double* aPaperHeight);
     NS_IMETHOD SetPaperHeight(double aPaperHeight);
 
     NS_IMETHOD SetPaperSizeUnit(int16_t aPaperSizeUnit);
 
     NS_IMETHOD GetEffectivePageSize(double* aWidth, double* aHeight);
 
 protected:
+    virtual ~nsPrintSettingsQt();
+
     nsPrintSettingsQt(const nsPrintSettingsQt& src);
     nsPrintSettingsQt& operator=(const nsPrintSettingsQt& rhs);
 
     virtual nsresult _Clone(nsIPrintSettings** _retval);
     virtual nsresult _Assign(nsIPrintSettings* aPS);
 
     QSharedPointer<QPrinter> mQPrinter;
 };
--- a/widget/qt/nsScreenManagerQt.cpp
+++ b/widget/qt/nsScreenManagerQt.cpp
@@ -64,16 +64,31 @@ nsScreenManagerQt::ScreenForRect(int32_t
             area = a;
         }
     }
 
     NS_IF_ADDREF(*outScreen = screens[best]);
     return NS_OK;
 }
 
+NS_IMETHODIMP
+nsScreenManagerQt::ScreenForId(uint32_t aId, nsIScreen** aOutScreen)
+{
+    if (!mInitialized) {
+        init();
+    }
+
+    if (aId < nScreens) {
+        NS_IF_ADDREF(*aOutScreen = screens[aId]);
+        return NS_OK;
+    }
+
+    return NS_ERROR_FAILURE;
+}
+
 //
 // GetPrimaryScreen
 //
 // The screen with the menubar/taskbar. This shouldn't be needed very
 // often.
 //
 NS_IMETHODIMP
 nsScreenManagerQt::GetPrimaryScreen(nsIScreen **aPrimaryScreen)
--- a/widget/qt/nsScreenManagerQt.h
+++ b/widget/qt/nsScreenManagerQt.h
@@ -12,23 +12,22 @@
 
 //------------------------------------------------------------------------
 class QDesktopWidget;
 
 class nsScreenManagerQt : public nsIScreenManager
 {
 public:
   nsScreenManagerQt ( );
-  virtual ~nsScreenManagerQt();
 
   NS_DECL_ISUPPORTS
   NS_DECL_NSISCREENMANAGER
 
 private:
-
+  virtual ~nsScreenManagerQt();
   void init ();
 
   nsCOMPtr<nsIScreen> *screens;
   QDesktopWidget *desktop;
   int nScreens;
   bool mInitialized;
 };
 
--- a/widget/qt/nsScreenQt.cpp
+++ b/widget/qt/nsScreenQt.cpp
@@ -19,16 +19,23 @@ nsScreenQt::nsScreenQt(int aScreen)
     // has changed.
 }
 
 nsScreenQt::~nsScreenQt()
 {
 }
 
 NS_IMETHODIMP
+nsScreenQt::GetId(uint32_t* aId)
+{
+    *aId = mScreen;
+    return NS_OK;
+}
+
+NS_IMETHODIMP
 nsScreenQt::GetRect(int32_t *outLeft,int32_t *outTop,
                     int32_t *outWidth,int32_t *outHeight)
 {
     QRect r = QGuiApplication::screens()[mScreen]->geometry();
 
     *outTop = r.x();
     *outLeft = r.y();
     *outWidth = r.width();
--- a/widget/qt/nsScreenQt.h
+++ b/widget/qt/nsScreenQt.h
@@ -11,16 +11,17 @@
 //------------------------------------------------------------------------
 
 class nsScreenQt : public nsBaseScreen
 {
 public:
   nsScreenQt (int aScreen);
   virtual ~nsScreenQt();
 
+  NS_IMETHOD GetId(uint32_t* aId);
   NS_IMETHOD GetRect(int32_t* aLeft, int32_t* aTop, int32_t* aWidth, int32_t* aHeight);
   NS_IMETHOD GetAvailRect(int32_t* aLeft, int32_t* aTop, int32_t* aWidth, int32_t* aHeight);
   NS_IMETHOD GetPixelDepth(int32_t* aPixelDepth);
   NS_IMETHOD GetColorDepth(int32_t* aColorDepth);
 
 private:
   int mScreen;
 };
--- a/widget/qt/nsWindow.h
+++ b/widget/qt/nsWindow.h
@@ -80,17 +80,16 @@ class QWheelEvent;
 namespace mozilla {
 namespace widget {
 class MozQWidget;
 class nsWindow : public nsBaseWidget,
                  public nsSupportsWeakReference
 {
 public:
     nsWindow();
-    virtual ~nsWindow();
 
     NS_DECL_ISUPPORTS_INHERITED
 
     //
     // nsIWidget
     //
     NS_IMETHOD Create(nsIWidget        *aParent,
                       nsNativeWidget   aNativeParent,
@@ -167,16 +166,18 @@ public:
     virtual nsEventStatus mouseReleaseEvent(QMouseEvent* aEvent);
     virtual nsEventStatus moveEvent(QMoveEvent* aEvent);
     virtual nsEventStatus resizeEvent(QResizeEvent* aEvent);
     virtual nsEventStatus touchEvent(QTouchEvent* aEvent);
     virtual nsEventStatus wheelEvent(QWheelEvent* aEvent);
     virtual nsEventStatus tabletEvent(QTabletEvent* event);
 
 protected:
+    virtual ~nsWindow();
+
     nsWindow* mParent;
     bool  mVisible;
     InputContext mInputContext;
     nsCOMPtr<nsIIdleServiceInternal> mIdleService;
     MozQWidget* mWidget;
 
 private:
     // event handling code