Bug 879562 - WinMouseScrollHandler should use nsWindowBase so winrt widgets can use it. r=masayuki

This commit is contained in:
Jim Mathies 2013-08-09 05:12:38 -05:00
Родитель 20af71bdf0
Коммит 58a0e5123e
2 изменённых файлов: 80 добавлений и 80 удалений

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

@ -149,7 +149,7 @@ MouseScrollHandler::~MouseScrollHandler()
/* static */
bool
MouseScrollHandler::ProcessMessage(nsWindow* aWindow, UINT msg,
MouseScrollHandler::ProcessMessage(nsWindowBase* aWidget, UINT msg,
WPARAM wParam, LPARAM lParam,
MSGResult& aResult)
{
@ -169,7 +169,7 @@ MouseScrollHandler::ProcessMessage(nsWindow* aWindow, UINT msg,
case WM_MOUSEWHEEL:
case WM_MOUSEHWHEEL:
GetInstance()->
ProcessNativeMouseWheelMessage(aWindow, msg, wParam, lParam);
ProcessNativeMouseWheelMessage(aWidget, msg, wParam, lParam);
sInstance->mSynthesizingEvent->NotifyNativeMessageHandlingFinished();
// We don't need to call next wndproc for WM_MOUSEWHEEL and
// WM_MOUSEHWHEEL. We should consume them always. If the messages
@ -182,14 +182,14 @@ MouseScrollHandler::ProcessMessage(nsWindow* aWindow, UINT msg,
case WM_HSCROLL:
case WM_VSCROLL:
aResult.mConsumed =
GetInstance()->ProcessNativeScrollMessage(aWindow, msg, wParam, lParam);
GetInstance()->ProcessNativeScrollMessage(aWidget, msg, wParam, lParam);
sInstance->mSynthesizingEvent->NotifyNativeMessageHandlingFinished();
aResult.mResult = 0;
return true;
case MOZ_WM_MOUSEVWHEEL:
case MOZ_WM_MOUSEHWHEEL:
GetInstance()->HandleMouseWheelMessage(aWindow, msg, wParam, lParam);
GetInstance()->HandleMouseWheelMessage(aWidget, msg, wParam, lParam);
sInstance->mSynthesizingEvent->NotifyInternalMessageHandlingFinished();
// Doesn't need to call next wndproc for internal wheel message.
aResult.mConsumed = true;
@ -198,7 +198,7 @@ MouseScrollHandler::ProcessMessage(nsWindow* aWindow, UINT msg,
case MOZ_WM_HSCROLL:
case MOZ_WM_VSCROLL:
GetInstance()->
HandleScrollMessageAsMouseWheelMessage(aWindow, msg, wParam, lParam);
HandleScrollMessageAsMouseWheelMessage(aWidget, msg, wParam, lParam);
sInstance->mSynthesizingEvent->NotifyInternalMessageHandlingFinished();
// Doesn't need to call next wndproc for internal scroll message.
aResult.mConsumed = true;
@ -207,13 +207,13 @@ MouseScrollHandler::ProcessMessage(nsWindow* aWindow, UINT msg,
case WM_KEYDOWN:
case WM_KEYUP:
PR_LOG(gMouseScrollLog, PR_LOG_ALWAYS,
("MouseScroll::ProcessMessage(): aWindow=%p, "
("MouseScroll::ProcessMessage(): aWidget=%p, "
"msg=%s(0x%04X), wParam=0x%02X, ::GetMessageTime()=%d",
aWindow, msg == WM_KEYDOWN ? "WM_KEYDOWN" :
aWidget, msg == WM_KEYDOWN ? "WM_KEYDOWN" :
msg == WM_KEYUP ? "WM_KEYUP" : "Unknown", msg, wParam,
::GetMessageTime()));
LOG_KEYSTATE();
if (Device::Elantech::HandleKeyMessage(aWindow, msg, wParam)) {
if (Device::Elantech::HandleKeyMessage(aWidget, msg, wParam)) {
aResult.mResult = 0;
aResult.mConsumed = true;
return true;
@ -227,7 +227,7 @@ MouseScrollHandler::ProcessMessage(nsWindow* aWindow, UINT msg,
/* static */
nsresult
MouseScrollHandler::SynthesizeNativeMouseScrollEvent(nsWindow* aWindow,
MouseScrollHandler::SynthesizeNativeMouseScrollEvent(nsWindowBase* aWidget,
const nsIntPoint& aPoint,
uint32_t aNativeMessage,
int32_t aDelta,
@ -302,18 +302,18 @@ MouseScrollHandler::SynthesizeNativeMouseScrollEvent(nsWindow* aWindow,
/* static */
bool
MouseScrollHandler::DispatchEvent(nsWindow* aWindow, nsGUIEvent& aEvent)
MouseScrollHandler::DispatchEvent(nsWindowBase* aWidget, nsGUIEvent& aEvent)
{
return aWindow->DispatchWindowEvent(&aEvent);
return aWidget->DispatchWindowEvent(&aEvent);
}
/* static */
void
MouseScrollHandler::InitEvent(nsWindow* aWindow,
MouseScrollHandler::InitEvent(nsWindowBase* aWidget,
nsGUIEvent& aEvent,
nsIntPoint* aPoint)
{
NS_ENSURE_TRUE_VOID(aWindow);
NS_ENSURE_TRUE_VOID(aWidget);
nsIntPoint point;
if (aPoint) {
point = *aPoint;
@ -322,11 +322,11 @@ MouseScrollHandler::InitEvent(nsWindow* aWindow,
POINT pt;
pt.x = pts.x;
pt.y = pts.y;
::ScreenToClient(aWindow->GetWindowHandle(), &pt);
::ScreenToClient(aWidget->GetWindowHandle(), &pt);
point.x = pt.x;
point.y = pt.y;
}
aWindow->InitEvent(aEvent, &point);
aWidget->InitEvent(aEvent, &point);
}
/* static */
@ -364,22 +364,22 @@ MouseScrollHandler::ComputeMessagePos(UINT aMessage,
}
void
MouseScrollHandler::ProcessNativeMouseWheelMessage(nsWindow* aWindow,
MouseScrollHandler::ProcessNativeMouseWheelMessage(nsWindowBase* aWidget,
UINT aMessage,
WPARAM aWParam,
LPARAM aLParam)
{
if (SynthesizingEvent::IsSynthesizing()) {
mSynthesizingEvent->NativeMessageReceived(aWindow, aMessage,
mSynthesizingEvent->NativeMessageReceived(aWidget, aMessage,
aWParam, aLParam);
}
POINT point = ComputeMessagePos(aMessage, aWParam, aLParam);
PR_LOG(gMouseScrollLog, PR_LOG_ALWAYS,
("MouseScroll::ProcessNativeMouseWheelMessage: aWindow=%p, "
("MouseScroll::ProcessNativeMouseWheelMessage: aWidget=%p, "
"aMessage=%s, wParam=0x%08X, lParam=0x%08X, point: { x=%d, y=%d }",
aWindow, aMessage == WM_MOUSEWHEEL ? "WM_MOUSEWHEEL" :
aWidget, aMessage == WM_MOUSEWHEEL ? "WM_MOUSEWHEEL" :
aMessage == WM_MOUSEHWHEEL ? "WM_MOUSEHWHEEL" :
aMessage == WM_VSCROLL ? "WM_VSCROLL" : "WM_HSCROLL",
aWParam, aLParam, point.x, point.y));
@ -440,7 +440,7 @@ MouseScrollHandler::ProcessNativeMouseWheelMessage(nsWindow* aWindow,
// cause accessing the plugin. Therefore, we should unlock the plugin
// process by using PostMessage().
if (destWindow->GetWindowType() == eWindowType_plugin) {
destWindow = destWindow->GetParentWindow(false);
destWindow = destWindow->GetParentWindowBase(false);
if (!destWindow) {
PR_LOG(gMouseScrollLog, PR_LOG_ALWAYS,
("MouseScroll::ProcessNativeMouseWheelMessage: "
@ -478,9 +478,9 @@ MouseScrollHandler::ProcessNativeMouseWheelMessage(nsWindow* aWindow,
// it on parent window. However, note that the DOM event may cause accessing
// the plugin. Therefore, we should unlock the plugin process by using
// PostMessage().
if (aWindow->GetWindowType() == eWindowType_plugin &&
aWindow->GetWindowHandle() == pluginWnd) {
nsWindow* destWindow = aWindow->GetParentWindow(false);
if (aWidget->GetWindowType() == eWindowType_plugin &&
aWidget->GetWindowHandle() == pluginWnd) {
nsWindowBase* destWindow = aWidget->GetParentWindowBase(false);
if (!destWindow) {
PR_LOG(gMouseScrollLog, PR_LOG_ALWAYS,
("MouseScroll::ProcessNativeMouseWheelMessage: Our normal window which "
@ -507,7 +507,7 @@ MouseScrollHandler::ProcessNativeMouseWheelMessage(nsWindow* aWindow,
}
bool
MouseScrollHandler::ProcessNativeScrollMessage(nsWindow* aWindow,
MouseScrollHandler::ProcessNativeScrollMessage(nsWindowBase* aWidget,
UINT aMessage,
WPARAM aWParam,
LPARAM aLParam)
@ -515,25 +515,25 @@ MouseScrollHandler::ProcessNativeScrollMessage(nsWindow* aWindow,
if (aLParam || mUserPrefs.IsScrollMessageHandledAsWheelMessage()) {
// Scroll message generated by Thinkpad Trackpoint Driver or similar
// Treat as a mousewheel message and scroll appropriately
ProcessNativeMouseWheelMessage(aWindow, aMessage, aWParam, aLParam);
ProcessNativeMouseWheelMessage(aWidget, aMessage, aWParam, aLParam);
// Always consume the scroll message if we try to emulate mouse wheel
// action.
return true;
}
if (SynthesizingEvent::IsSynthesizing()) {
mSynthesizingEvent->NativeMessageReceived(aWindow, aMessage,
mSynthesizingEvent->NativeMessageReceived(aWidget, aMessage,
aWParam, aLParam);
}
PR_LOG(gMouseScrollLog, PR_LOG_ALWAYS,
("MouseScroll::ProcessNativeScrollMessage: aWindow=%p, "
("MouseScroll::ProcessNativeScrollMessage: aWidget=%p, "
"aMessage=%s, wParam=0x%08X, lParam=0x%08X",
aWindow, aMessage == WM_VSCROLL ? "WM_VSCROLL" : "WM_HSCROLL",
aWidget, aMessage == WM_VSCROLL ? "WM_VSCROLL" : "WM_HSCROLL",
aWParam, aLParam));
// Scroll message generated by external application
nsContentCommandEvent commandEvent(true, NS_CONTENT_COMMAND_SCROLL, aWindow);
nsContentCommandEvent commandEvent(true, NS_CONTENT_COMMAND_SCROLL, aWidget);
commandEvent.mScroll.mIsHorizontal = (aMessage == WM_HSCROLL);
@ -567,12 +567,12 @@ MouseScrollHandler::ProcessNativeScrollMessage(nsWindow* aWindow,
}
// XXX If this is a plugin window, we should dispatch the event from
// parent window.
DispatchEvent(aWindow, commandEvent);
DispatchEvent(aWidget, commandEvent);
return true;
}
void
MouseScrollHandler::HandleMouseWheelMessage(nsWindow* aWindow,
MouseScrollHandler::HandleMouseWheelMessage(nsWindowBase* aWidget,
UINT aMessage,
WPARAM aWParam,
LPARAM aLParam)
@ -583,14 +583,14 @@ MouseScrollHandler::HandleMouseWheelMessage(nsWindow* aWindow,
"MOZ_WM_MOUSEVWHEEL or MOZ_WM_MOUSEHWHEEL");
PR_LOG(gMouseScrollLog, PR_LOG_ALWAYS,
("MouseScroll::HandleMouseWheelMessage: aWindow=%p, "
("MouseScroll::HandleMouseWheelMessage: aWidget=%p, "
"aMessage=MOZ_WM_MOUSE%sWHEEL, aWParam=0x%08X, aLParam=0x%08X",
aWindow, aMessage == MOZ_WM_MOUSEVWHEEL ? "V" : "H",
aWidget, aMessage == MOZ_WM_MOUSEVWHEEL ? "V" : "H",
aWParam, aLParam));
mIsWaitingInternalMessage = false;
EventInfo eventInfo(aWindow, WinUtils::GetNativeMessage(aMessage),
EventInfo eventInfo(aWidget, WinUtils::GetNativeMessage(aMessage),
aWParam, aLParam);
if (!eventInfo.CanDispatchWheelEvent()) {
PR_LOG(gMouseScrollLog, PR_LOG_ALWAYS,
@ -611,15 +611,15 @@ MouseScrollHandler::HandleMouseWheelMessage(nsWindow* aWindow,
ModifierKeyState modKeyState = GetModifierKeyState(aMessage);
// Grab the widget, it might be destroyed by a DOM event handler.
nsRefPtr<nsWindow> kungFuDethGrip(aWindow);
nsRefPtr<nsWindowBase> kungFuDethGrip(aWidget);
WheelEvent wheelEvent(true, NS_WHEEL_WHEEL, aWindow);
if (mLastEventInfo.InitWheelEvent(aWindow, wheelEvent, modKeyState)) {
WheelEvent wheelEvent(true, NS_WHEEL_WHEEL, aWidget);
if (mLastEventInfo.InitWheelEvent(aWidget, wheelEvent, modKeyState)) {
PR_LOG(gMouseScrollLog, PR_LOG_ALWAYS,
("MouseScroll::HandleMouseWheelMessage: dispatching "
"NS_WHEEL_WHEEL event"));
DispatchEvent(aWindow, wheelEvent);
if (aWindow->Destroyed()) {
DispatchEvent(aWidget, wheelEvent);
if (aWidget->Destroyed()) {
PR_LOG(gMouseScrollLog, PR_LOG_ALWAYS,
("MouseScroll::HandleMouseWheelMessage: The window was destroyed "
"by NS_WHEEL_WHEEL event"));
@ -637,7 +637,7 @@ MouseScrollHandler::HandleMouseWheelMessage(nsWindow* aWindow,
}
void
MouseScrollHandler::HandleScrollMessageAsMouseWheelMessage(nsWindow* aWindow,
MouseScrollHandler::HandleScrollMessageAsMouseWheelMessage(nsWindowBase* aWidget,
UINT aMessage,
WPARAM aWParam,
LPARAM aLParam)
@ -651,7 +651,7 @@ MouseScrollHandler::HandleScrollMessageAsMouseWheelMessage(nsWindow* aWindow,
ModifierKeyState modKeyState = GetModifierKeyState(aMessage);
WheelEvent wheelEvent(true, NS_WHEEL_WHEEL, aWindow);
WheelEvent wheelEvent(true, NS_WHEEL_WHEEL, aWidget);
double& delta =
(aMessage == MOZ_WM_VSCROLL) ? wheelEvent.deltaY : wheelEvent.deltaX;
int32_t& lineOrPageDelta =
@ -683,15 +683,15 @@ MouseScrollHandler::HandleScrollMessageAsMouseWheelMessage(nsWindow* aWindow,
// XXX Current mouse position may not be same as when the original message
// is received. We need to know the actual mouse cursor position when
// the original message was received.
InitEvent(aWindow, wheelEvent);
InitEvent(aWidget, wheelEvent);
PR_LOG(gMouseScrollLog, PR_LOG_ALWAYS,
("MouseScroll::HandleScrollMessageAsMouseWheelMessage: aWindow=%p, "
("MouseScroll::HandleScrollMessageAsMouseWheelMessage: aWidget=%p, "
"aMessage=MOZ_WM_%sSCROLL, aWParam=0x%08X, aLParam=0x%08X, "
"wheelEvent { refPoint: { x: %d, y: %d }, deltaX: %f, deltaY: %f, "
"lineOrPageDeltaX: %d, lineOrPageDeltaY: %d, "
"isShift: %s, isControl: %s, isAlt: %s, isMeta: %s }",
aWindow, (aMessage == MOZ_WM_VSCROLL) ? "V" : "H", aWParam, aLParam,
aWidget, (aMessage == MOZ_WM_VSCROLL) ? "V" : "H", aWParam, aLParam,
wheelEvent.refPoint.x, wheelEvent.refPoint.y,
wheelEvent.deltaX, wheelEvent.deltaY,
wheelEvent.lineOrPageDeltaX, wheelEvent.lineOrPageDeltaY,
@ -700,7 +700,7 @@ MouseScrollHandler::HandleScrollMessageAsMouseWheelMessage(nsWindow* aWindow,
GetBoolName(wheelEvent.IsAlt()),
GetBoolName(wheelEvent.IsMeta())));
DispatchEvent(aWindow, wheelEvent);
DispatchEvent(aWidget, wheelEvent);
}
/******************************************************************************
@ -709,7 +709,7 @@ MouseScrollHandler::HandleScrollMessageAsMouseWheelMessage(nsWindow* aWindow,
*
******************************************************************************/
MouseScrollHandler::EventInfo::EventInfo(nsWindow* aWindow,
MouseScrollHandler::EventInfo::EventInfo(nsWindowBase* aWidget,
UINT aMessage,
WPARAM aWParam, LPARAM aLParam)
{
@ -722,7 +722,7 @@ MouseScrollHandler::EventInfo::EventInfo(nsWindow* aWindow,
mIsPage = MouseScrollHandler::sInstance->
mSystemSettings.IsPageScroll(mIsVertical);
mDelta = (short)HIWORD(aWParam);
mWnd = aWindow->GetWindowHandle();
mWnd = aWidget->GetWindowHandle();
mTimeStamp = TimeStamp::Now();
}
@ -804,7 +804,7 @@ MouseScrollHandler::LastEventInfo::RoundDelta(double aDelta)
bool
MouseScrollHandler::LastEventInfo::InitWheelEvent(
nsWindow* aWindow,
nsWindowBase* aWidget,
WheelEvent& aWheelEvent,
const ModifierKeyState& aModKeyState)
{
@ -813,7 +813,7 @@ MouseScrollHandler::LastEventInfo::InitWheelEvent(
// XXX Why don't we use lParam value? We should use lParam value because
// our internal message is always posted by original message handler.
// So, GetMessagePos() may return different cursor position.
InitEvent(aWindow, aWheelEvent);
InitEvent(aWidget, aWheelEvent);
aModKeyState.InitInputEvent(aWheelEvent);
@ -841,12 +841,12 @@ MouseScrollHandler::LastEventInfo::InitWheelEvent(
lineOrPageDelta * orienter * RoundDelta(nativeDeltaPerUnit);
PR_LOG(gMouseScrollLog, PR_LOG_ALWAYS,
("MouseScroll::LastEventInfo::InitWheelEvent: aWindow=%p, "
("MouseScroll::LastEventInfo::InitWheelEvent: aWidget=%p, "
"aWheelEvent { refPoint: { x: %d, y: %d }, deltaX: %f, deltaY: %f, "
"lineOrPageDeltaX: %d, lineOrPageDeltaY: %d, "
"isShift: %s, isControl: %s, isAlt: %s, isMeta: %s }, "
"mAccumulatedDelta: %d",
aWindow, aWheelEvent.refPoint.x, aWheelEvent.refPoint.y,
aWidget, aWheelEvent.refPoint.x, aWheelEvent.refPoint.y,
aWheelEvent.deltaX, aWheelEvent.deltaY,
aWheelEvent.lineOrPageDeltaX, aWheelEvent.lineOrPageDeltaY,
GetBoolName(aWheelEvent.IsShift()),
@ -1170,7 +1170,7 @@ MouseScrollHandler::Device::Elantech::IsHelperWindow(HWND aWnd)
/* static */
bool
MouseScrollHandler::Device::Elantech::HandleKeyMessage(nsWindow* aWindow,
MouseScrollHandler::Device::Elantech::HandleKeyMessage(nsWindowBase* aWidget,
UINT aMsg,
WPARAM aWParam)
{
@ -1204,9 +1204,9 @@ MouseScrollHandler::Device::Elantech::HandleKeyMessage(nsWindow* aWindow,
aWParam == VK_NEXT ? "Forward" : "Back"));
nsCommandEvent commandEvent(true, nsGkAtoms::onAppCommand,
(aWParam == VK_NEXT) ? nsGkAtoms::Forward : nsGkAtoms::Back, aWindow);
InitEvent(aWindow, commandEvent);
MouseScrollHandler::DispatchEvent(aWindow, commandEvent);
(aWParam == VK_NEXT) ? nsGkAtoms::Forward : nsGkAtoms::Back, aWidget);
InitEvent(aWidget, commandEvent);
MouseScrollHandler::DispatchEvent(aWidget, commandEvent);
}
#ifdef PR_LOGGING
else {
@ -1484,7 +1484,7 @@ MouseScrollHandler::SynthesizingEvent::Synthesize(const POINTS& aCursorPoint,
}
void
MouseScrollHandler::SynthesizingEvent::NativeMessageReceived(nsWindow* aWindow,
MouseScrollHandler::SynthesizingEvent::NativeMessageReceived(nsWindowBase* aWidget,
UINT aMessage,
WPARAM aWParam,
LPARAM aLParam)
@ -1492,12 +1492,12 @@ MouseScrollHandler::SynthesizingEvent::NativeMessageReceived(nsWindow* aWindow,
if (mStatus == SENDING_MESSAGE && mMessage == aMessage &&
mWParam == aWParam && mLParam == aLParam) {
mStatus = NATIVE_MESSAGE_RECEIVED;
if (aWindow && aWindow->GetWindowHandle() == mWnd) {
if (aWidget && aWidget->GetWindowHandle() == mWnd) {
return;
}
// If the target window is not ours and received window is our plugin
// window, it comes from child window of the plugin.
if (aWindow && aWindow->GetWindowType() == eWindowType_plugin &&
if (aWidget && aWidget->GetWindowType() == eWindowType_plugin &&
!WinUtils::GetNSWindowBasePtr(mWnd)) {
return;
}
@ -1506,9 +1506,9 @@ MouseScrollHandler::SynthesizingEvent::NativeMessageReceived(nsWindow* aWindow,
PR_LOG(gMouseScrollLog, PR_LOG_ALWAYS,
("MouseScrollHandler::SynthesizingEvent::NativeMessageReceived(): "
"aWindow=%p, aWindow->GetWindowHandle()=0x%X, mWnd=0x%X, "
"aWidget=%p, aWidget->GetWindowHandle()=0x%X, mWnd=0x%X, "
"aMessage=0x%04X, aWParam=0x%08X, aLParam=0x%08X, mStatus=%s",
aWindow, aWindow ? aWindow->GetWindowHandle() : 0, mWnd,
aWidget, aWidget ? aWidget->GetWindowHandle() : 0, mWnd,
aMessage, aWParam, aLParam, GetStatusName()));
// We failed to receive our sent message, we failed to do the job.

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

@ -13,7 +13,7 @@
#include "mozilla/TimeStamp.h"
#include <windows.h>
class nsWindow;
class nsWindowBase;
class nsGUIEvent;
struct nsIntPoint;
@ -32,7 +32,7 @@ public:
static void Initialize();
static void Shutdown();
static bool ProcessMessage(nsWindow* aWindow,
static bool ProcessMessage(nsWindowBase* aWidget,
UINT msg,
WPARAM wParam,
LPARAM lParam,
@ -42,7 +42,7 @@ public:
* See nsIWidget::SynthesizeNativeMouseScrollEvent() for the detail about
* this method.
*/
static nsresult SynthesizeNativeMouseScrollEvent(nsWindow* aWindow,
static nsresult SynthesizeNativeMouseScrollEvent(nsWindowBase* aWidget,
const nsIntPoint& aPoint,
uint32_t aNativeMessage,
int32_t aDelta,
@ -68,17 +68,17 @@ private:
static MouseScrollHandler* sInstance;
/**
* DispatchEvent() dispatches aEvent on aWindow.
* DispatchEvent() dispatches aEvent on aWidget.
*
* @return TRUE if the event was consumed. Otherwise, FALSE.
*/
static bool DispatchEvent(nsWindow* aWindow, nsGUIEvent& aEvent);
static bool DispatchEvent(nsWindowBase* aWidget, nsGUIEvent& aEvent);
/**
* InitEvent() initializes the aEvent. If aPoint is null, the result of
* GetCurrentMessagePos() will be used.
*/
static void InitEvent(nsWindow* aWindow,
static void InitEvent(nsWindowBase* aWidget,
nsGUIEvent& aEvent,
nsIntPoint* aPoint = nullptr);
@ -107,13 +107,13 @@ private:
* MOZ_WM_VSCROLL or MOZ_WM_HSCROLL if we need to dispatch mouse scroll
* events. That avoids deadlock with plugin process.
*
* @param aWindow A window which receives the message.
* @param aWidget A window which receives the message.
* @param aMessage WM_MOUSEWHEEL, WM_MOUSEHWHEEL, WM_VSCROLL or
* WM_HSCROLL.
* @param aWParam The wParam value of the message.
* @param aLParam The lParam value of the message.
*/
void ProcessNativeMouseWheelMessage(nsWindow* aWindow,
void ProcessNativeMouseWheelMessage(nsWindowBase* aWidget,
UINT aMessage,
WPARAM aWParam,
LPARAM aLParam);
@ -124,13 +124,13 @@ private:
* processed as mouse wheel message. Otherwise, dispatches a content
* command event.
*
* @param aWindow A window which receives the message.
* @param aWidget A window which receives the message.
* @param aMessage WM_VSCROLL or WM_HSCROLL.
* @param aWParam The wParam value of the message.
* @param aLParam The lParam value of the message.
* @return TRUE if the message is processed. Otherwise, FALSE.
*/
bool ProcessNativeScrollMessage(nsWindow* aWindow,
bool ProcessNativeScrollMessage(nsWindowBase* aWidget,
UINT aMessage,
WPARAM aWParam,
LPARAM aLParam);
@ -140,12 +140,12 @@ private:
* MOZ_WM_MOUSEHWHEEL which are posted when one of our windows received
* WM_MOUSEWHEEL or WM_MOUSEHWHEEL for avoiding deadlock with OOPP.
*
* @param aWindow A window which receives the wheel message.
* @param aWidget A window which receives the wheel message.
* @param aMessage MOZ_WM_MOUSEWHEEL or MOZ_WM_MOUSEHWHEEL.
* @param aWParam The wParam value of the original message.
* @param aLParam The lParam value of the original message.
*/
void HandleMouseWheelMessage(nsWindow* aWindow,
void HandleMouseWheelMessage(nsWindowBase* aWidget,
UINT aMessage,
WPARAM aWParam,
LPARAM aLParam);
@ -156,12 +156,12 @@ private:
* WM_VSCROLL or WM_HSCROLL and user wants them to emulate mouse wheel
* message's behavior.
*
* @param aWindow A window which receives the scroll message.
* @param aWidget A window which receives the scroll message.
* @param aMessage MOZ_WM_VSCROLL or MOZ_WM_HSCROLL.
* @param aWParam The wParam value of the original message.
* @param aLParam The lParam value of the original message.
*/
void HandleScrollMessageAsMouseWheelMessage(nsWindow* aWindow,
void HandleScrollMessageAsMouseWheelMessage(nsWindowBase* aWidget,
UINT aMessage,
WPARAM aWParam,
LPARAM aLParam);
@ -184,10 +184,10 @@ private:
class EventInfo {
public:
/**
* @param aWindow An nsWindow which is handling the event.
* @param aWidget An nsWindow which is handling the event.
* @param aMessage Must be WM_MOUSEWHEEL or WM_MOUSEHWHEEL.
*/
EventInfo(nsWindow* aWindow, UINT aMessage, WPARAM aWParam, LPARAM aLParam);
EventInfo(nsWindowBase* aWidget, UINT aMessage, WPARAM aWParam, LPARAM aLParam);
bool CanDispatchWheelEvent() const;
@ -252,14 +252,14 @@ private:
* This must be called only once during handling a message and after
* RecordEvent() is called.
*
* @param aWindow A window which will dispatch the event.
* @param aWidget A window which will dispatch the event.
* @param aWheelEvent An NS_WHEEL_WHEEL event, this will be
* initialized.
* @param aModKeyState Current modifier key state.
* @return TRUE if the event is ready to dispatch.
* Otherwise, FALSE.
*/
bool InitWheelEvent(nsWindow* aWindow,
bool InitWheelEvent(nsWindowBase* aWidget,
WheelEvent& aWheelEvent,
const ModifierKeyState& aModKeyState);
@ -365,7 +365,7 @@ private:
UINT aMessage, WPARAM aWParam, LPARAM aLParam,
const BYTE (&aKeyStates)[256]);
void NativeMessageReceived(nsWindow* aWindow, UINT aMessage,
void NativeMessageReceived(nsWindowBase* aWidget, UINT aMessage,
WPARAM aWParam, LPARAM aLParam);
void NotifyNativeMessageHandlingFinished();
@ -435,7 +435,7 @@ public:
* Key message handler for Elantech's hack. Returns TRUE if the message
* is consumed by this handler. Otherwise, FALSE.
*/
static bool HandleKeyMessage(nsWindow* aWindow,
static bool HandleKeyMessage(nsWindowBase* aWidget,
UINT aMsg,
WPARAM aWParam);