Bug 1296993 (part 8) - Streamline nsIWidget::CaptureMouse. r=mstange.

This patch does the following.

- Removes the return value, because none of the call sites check it.

- Removes the empty implementations from several nsIWidget instances, because
  they can use the nsBaseWidget one.

--HG--
extra : rebase_source : 1c42bb32a662f2659c934a245ecd0025045120a5
This commit is contained in:
Nicholas Nethercote 2016-08-25 14:10:02 +10:00
Родитель 346d5f4895
Коммит 5bf56904c4
8 изменённых файлов: 8 добавлений и 17 удалений

Просмотреть файл

@ -180,7 +180,6 @@ public:
void SetNativeData(uint32_t aDataType, uintptr_t aVal) override;
NS_IMETHOD SetTitle(const nsAString& aTitle) override { return NS_OK; }
NS_IMETHOD SetIcon(const nsAString& aIconSpec) override { return NS_OK; }
NS_IMETHOD CaptureMouse(bool aCapture) override { return NS_ERROR_NOT_IMPLEMENTED; }
NS_IMETHOD GetAttention(int32_t aCycleCount) override { return NS_ERROR_NOT_IMPLEMENTED; }
NS_IMETHOD BeginResizeDrag(mozilla::WidgetGUIEvent* aEvent,
int32_t aHorizontal,

Просмотреть файл

@ -1867,16 +1867,16 @@ nsWindow::WidgetToScreenOffset()
return GdkPointToDevicePixels({ x, y });
}
NS_IMETHODIMP
void
nsWindow::CaptureMouse(bool aCapture)
{
LOG(("CaptureMouse %p\n", (void *)this));
if (!mGdkWindow)
return NS_OK;
return;
if (!mContainer)
return NS_ERROR_FAILURE;
return;
if (aCapture) {
gtk_grab_add(GTK_WIDGET(mContainer));
@ -1886,8 +1886,6 @@ nsWindow::CaptureMouse(bool aCapture)
ReleaseGrabs();
gtk_grab_remove(GTK_WIDGET(mContainer));
}
return NS_OK;
}
void

Просмотреть файл

@ -144,7 +144,7 @@ public:
NS_IMETHOD SetIcon(const nsAString& aIconSpec) override;
virtual void SetWindowClass(const nsAString& xulWinType) override;
virtual LayoutDeviceIntPoint WidgetToScreenOffset() override;
NS_IMETHOD CaptureMouse(bool aCapture) override;
virtual void CaptureMouse(bool aCapture) override;
virtual void CaptureRollupEvents(nsIRollupListener *aListener,
bool aDoCapture) override;
NS_IMETHOD GetAttention(int32_t aCycleCount) override;

Просмотреть файл

@ -420,11 +420,6 @@ void nsBaseWidget::BaseCreate(nsIWidget* aParent,
}
}
NS_IMETHODIMP nsBaseWidget::CaptureMouse(bool aCapture)
{
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Accessor functions to get/set the client data

Просмотреть файл

@ -140,7 +140,7 @@ public:
NS_DECL_ISUPPORTS
// nsIWidget interface
NS_IMETHOD CaptureMouse(bool aCapture) override;
virtual void CaptureMouse(bool aCapture) override {}
virtual void CaptureRollupEvents(nsIRollupListener* aListener,
bool aDoCapture) override {}
virtual nsIWidgetListener* GetWidgetListener() override;

Просмотреть файл

@ -1381,7 +1381,7 @@ class nsIWidget : public nsISupports
* @param aCapture true enables mouse capture, false disables mouse capture
*
*/
NS_IMETHOD CaptureMouse(bool aCapture) = 0;
virtual void CaptureMouse(bool aCapture) = 0;
/**
* Classify the window for the window manager. Mostly for X11.

Просмотреть файл

@ -3537,7 +3537,7 @@ nsWindow::EnableDragDrop(bool aEnable)
*
**************************************************************/
NS_IMETHODIMP nsWindow::CaptureMouse(bool aCapture)
void nsWindow::CaptureMouse(bool aCapture)
{
TRACKMOUSEEVENT mTrack;
mTrack.cbSize = sizeof(TRACKMOUSEEVENT);
@ -3552,7 +3552,6 @@ NS_IMETHODIMP nsWindow::CaptureMouse(bool aCapture)
}
sIsInMouseCapture = aCapture;
TrackMouseEvent(&mTrack);
return NS_OK;
}
/**************************************************************

Просмотреть файл

@ -166,7 +166,7 @@ public:
NS_IMETHOD DispatchEvent(mozilla::WidgetGUIEvent* aEvent,
nsEventStatus& aStatus) override;
virtual void EnableDragDrop(bool aEnable) override;
NS_IMETHOD CaptureMouse(bool aCapture) override;
virtual void CaptureMouse(bool aCapture) override;
virtual void CaptureRollupEvents(nsIRollupListener* aListener,
bool aDoCapture) override;
NS_IMETHOD GetAttention(int32_t aCycleCount) override;