mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 602787 part.7 Don't implement methods which use Widget*Event in qt/nsWindow.h r=romaxa
This commit is contained in:
parent
23f8864962
commit
79096b1388
@ -2808,6 +2808,14 @@ nsWindow::GetDPI()
|
||||
return float(rootWindow->height()/heightInches);
|
||||
}
|
||||
|
||||
nsEventStatus
|
||||
nsWindow::DispatchEvent(WidgetGUIEvent* aEvent)
|
||||
{
|
||||
nsEventStatus status;
|
||||
DispatchEvent(aEvent, status);
|
||||
return status;
|
||||
}
|
||||
|
||||
void
|
||||
nsWindow::DispatchActivateEvent(void)
|
||||
{
|
||||
@ -3170,3 +3178,37 @@ nsWindow::GetGLFrameBufferFormat()
|
||||
return LOCAL_GL_NONE;
|
||||
}
|
||||
|
||||
void
|
||||
nsWindow::ProcessMotionEvent()
|
||||
{
|
||||
if (mPinchEvent.needDispatch) {
|
||||
double distance = DistanceBetweenPoints(mPinchEvent.centerPoint,
|
||||
mPinchEvent.touchPoint);
|
||||
distance *= 2;
|
||||
mPinchEvent.delta = distance - mPinchEvent.prevDistance;
|
||||
nsIntPoint centerPoint(mPinchEvent.centerPoint.x(),
|
||||
mPinchEvent.centerPoint.y());
|
||||
DispatchGestureEvent(NS_SIMPLE_GESTURE_MAGNIFY_UPDATE,
|
||||
0, mPinchEvent.delta, centerPoint);
|
||||
mPinchEvent.prevDistance = distance;
|
||||
}
|
||||
if (mMoveEvent.needDispatch) {
|
||||
WidgetMouseEvent event(true, NS_MOUSE_MOVE, this,
|
||||
WidgetMouseEvent::eReal);
|
||||
|
||||
event.refPoint.x = nscoord(mMoveEvent.pos.x());
|
||||
event.refPoint.y = nscoord(mMoveEvent.pos.y());
|
||||
|
||||
event.InitBasicModifiers(mMoveEvent.modifiers & Qt::ControlModifier,
|
||||
mMoveEvent.modifiers & Qt::AltModifier,
|
||||
mMoveEvent.modifiers & Qt::ShiftModifier,
|
||||
mMoveEvent.modifiers & Qt::MetaModifier);
|
||||
event.clickCount = 0;
|
||||
|
||||
DispatchEvent(&event);
|
||||
mMoveEvent.needDispatch = false;
|
||||
}
|
||||
|
||||
mTimerStarted = false;
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
#include "nsAutoPtr.h"
|
||||
|
||||
#include "nsBaseWidget.h"
|
||||
#include "mozilla/MouseEvents.h"
|
||||
#include "mozilla/EventForwards.h"
|
||||
|
||||
#include "nsWeakReference.h"
|
||||
|
||||
@ -183,12 +183,7 @@ public:
|
||||
void DispatchDeactivateEventOnTopLevelWindow(void);
|
||||
void DispatchResizeEvent(nsIntRect &aRect, nsEventStatus &aStatus);
|
||||
|
||||
nsEventStatus DispatchEvent(mozilla::WidgetGUIEvent* aEvent)
|
||||
{
|
||||
nsEventStatus status;
|
||||
DispatchEvent(aEvent, status);
|
||||
return status;
|
||||
}
|
||||
nsEventStatus DispatchEvent(mozilla::WidgetGUIEvent* aEvent);
|
||||
|
||||
// Some of the nsIWidget methods
|
||||
virtual bool IsEnabled() const;
|
||||
@ -378,35 +373,7 @@ private:
|
||||
// event (like a keypress or mouse click).
|
||||
void UserActivity();
|
||||
|
||||
inline void ProcessMotionEvent() {
|
||||
if (mPinchEvent.needDispatch) {
|
||||
double distance = DistanceBetweenPoints(mPinchEvent.centerPoint, mPinchEvent.touchPoint);
|
||||
distance *= 2;
|
||||
mPinchEvent.delta = distance - mPinchEvent.prevDistance;
|
||||
nsIntPoint centerPoint(mPinchEvent.centerPoint.x(), mPinchEvent.centerPoint.y());
|
||||
DispatchGestureEvent(NS_SIMPLE_GESTURE_MAGNIFY_UPDATE,
|
||||
0, mPinchEvent.delta, centerPoint);
|
||||
mPinchEvent.prevDistance = distance;
|
||||
}
|
||||
if (mMoveEvent.needDispatch) {
|
||||
WidgetMouseEvent event(true, NS_MOUSE_MOVE, this,
|
||||
WidgetMouseEvent::eReal);
|
||||
|
||||
event.refPoint.x = nscoord(mMoveEvent.pos.x());
|
||||
event.refPoint.y = nscoord(mMoveEvent.pos.y());
|
||||
|
||||
event.InitBasicModifiers(mMoveEvent.modifiers & Qt::ControlModifier,
|
||||
mMoveEvent.modifiers & Qt::AltModifier,
|
||||
mMoveEvent.modifiers & Qt::ShiftModifier,
|
||||
mMoveEvent.modifiers & Qt::MetaModifier);
|
||||
event.clickCount = 0;
|
||||
|
||||
DispatchEvent(&event);
|
||||
mMoveEvent.needDispatch = false;
|
||||
}
|
||||
|
||||
mTimerStarted = false;
|
||||
}
|
||||
inline void ProcessMotionEvent();
|
||||
|
||||
void DispatchMotionToMainThread() {
|
||||
if (!mTimerStarted) {
|
||||
|
Loading…
Reference in New Issue
Block a user