mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 630811 part.1 Move modifiers from nsMouseEvent_base to nsInputEvent r=smaug
This commit is contained in:
parent
9b4948d031
commit
9d0b39dd4c
@ -696,7 +696,6 @@ NS_METHOD nsDOMEvent::DuplicatePrivateData()
|
||||
mouseEvent->relatedTarget = oldMouseEvent->relatedTarget;
|
||||
mouseEvent->button = oldMouseEvent->button;
|
||||
mouseEvent->buttons = oldMouseEvent->buttons;
|
||||
mouseEvent->modifiers = oldMouseEvent->modifiers;
|
||||
mouseEvent->pressure = oldMouseEvent->pressure;
|
||||
mouseEvent->inputSource = oldMouseEvent->inputSource;
|
||||
newEvent = mouseEvent;
|
||||
@ -715,7 +714,6 @@ NS_METHOD nsDOMEvent::DuplicatePrivateData()
|
||||
dragEvent->relatedTarget = oldDragEvent->relatedTarget;
|
||||
dragEvent->button = oldDragEvent->button;
|
||||
dragEvent->buttons = oldDragEvent->buttons;
|
||||
dragEvent->modifiers = oldDragEvent->modifiers;
|
||||
static_cast<nsMouseEvent*>(dragEvent)->inputSource =
|
||||
static_cast<nsMouseEvent*>(oldDragEvent)->inputSource;
|
||||
newEvent = dragEvent;
|
||||
@ -758,7 +756,6 @@ NS_METHOD nsDOMEvent::DuplicatePrivateData()
|
||||
mouseScrollEvent->relatedTarget = oldMouseScrollEvent->relatedTarget;
|
||||
mouseScrollEvent->button = oldMouseScrollEvent->button;
|
||||
mouseScrollEvent->buttons = oldMouseScrollEvent->buttons;
|
||||
mouseScrollEvent->modifiers = oldMouseScrollEvent->modifiers;
|
||||
static_cast<nsMouseEvent_base*>(mouseScrollEvent)->inputSource =
|
||||
static_cast<nsMouseEvent_base*>(oldMouseScrollEvent)->inputSource;
|
||||
newEvent = mouseScrollEvent;
|
||||
@ -869,7 +866,6 @@ NS_METHOD nsDOMEvent::DuplicatePrivateData()
|
||||
new nsSimpleGestureEvent(false, msg, nsnull, 0, 0.0);
|
||||
NS_ENSURE_TRUE(simpleGestureEvent, NS_ERROR_OUT_OF_MEMORY);
|
||||
isInputEvent = true;
|
||||
simpleGestureEvent->modifiers = oldSimpleGestureEvent->modifiers;
|
||||
simpleGestureEvent->direction = oldSimpleGestureEvent->direction;
|
||||
simpleGestureEvent->delta = oldSimpleGestureEvent->delta;
|
||||
newEvent = simpleGestureEvent;
|
||||
@ -903,7 +899,6 @@ NS_METHOD nsDOMEvent::DuplicatePrivateData()
|
||||
static_cast<nsMozTouchEvent*>(mEvent)->streamId);
|
||||
NS_ENSURE_TRUE(mozTouchEvent, NS_ERROR_OUT_OF_MEMORY);
|
||||
isInputEvent = true;
|
||||
mozTouchEvent->modifiers = oldMozTouchEvent->modifiers;
|
||||
mozTouchEvent->buttons = oldMozTouchEvent->buttons;
|
||||
newEvent = mozTouchEvent;
|
||||
break;
|
||||
@ -928,10 +923,7 @@ NS_METHOD nsDOMEvent::DuplicatePrivateData()
|
||||
if (isInputEvent) {
|
||||
nsInputEvent* oldInputEvent = static_cast<nsInputEvent*>(mEvent);
|
||||
nsInputEvent* newInputEvent = static_cast<nsInputEvent*>(newEvent);
|
||||
newInputEvent->isShift = oldInputEvent->isShift;
|
||||
newInputEvent->isControl = oldInputEvent->isControl;
|
||||
newInputEvent->isAlt = oldInputEvent->isAlt;
|
||||
newInputEvent->isMeta = oldInputEvent->isMeta;
|
||||
newInputEvent->modifiers = oldInputEvent->modifiers;
|
||||
}
|
||||
|
||||
newEvent->target = mEvent->target;
|
||||
|
@ -78,7 +78,7 @@ NS_IMETHODIMP
|
||||
nsDOMKeyboardEvent::GetAltKey(bool* aIsDown)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aIsDown);
|
||||
*aIsDown = ((nsInputEvent*)mEvent)->isAlt;
|
||||
*aIsDown = static_cast<nsInputEvent*>(mEvent)->IsAlt();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -86,7 +86,7 @@ NS_IMETHODIMP
|
||||
nsDOMKeyboardEvent::GetCtrlKey(bool* aIsDown)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aIsDown);
|
||||
*aIsDown = ((nsInputEvent*)mEvent)->isControl;
|
||||
*aIsDown = static_cast<nsInputEvent*>(mEvent)->IsControl();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -94,7 +94,7 @@ NS_IMETHODIMP
|
||||
nsDOMKeyboardEvent::GetShiftKey(bool* aIsDown)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aIsDown);
|
||||
*aIsDown = ((nsInputEvent*)mEvent)->isShift;
|
||||
*aIsDown = static_cast<nsInputEvent*>(mEvent)->IsShift();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -102,7 +102,7 @@ NS_IMETHODIMP
|
||||
nsDOMKeyboardEvent::GetMetaKey(bool* aIsDown)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aIsDown);
|
||||
*aIsDown = ((nsInputEvent*)mEvent)->isMeta;
|
||||
*aIsDown = static_cast<nsInputEvent*>(mEvent)->IsMeta();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -184,10 +184,7 @@ nsDOMKeyboardEvent::InitKeyEvent(const nsAString& aType, bool aCanBubble, bool a
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsKeyEvent* keyEvent = static_cast<nsKeyEvent*>(mEvent);
|
||||
keyEvent->isControl = aCtrlKey;
|
||||
keyEvent->isAlt = aAltKey;
|
||||
keyEvent->isShift = aShiftKey;
|
||||
keyEvent->isMeta = aMetaKey;
|
||||
keyEvent->InitBasicModifiers(aCtrlKey, aAltKey, aShiftKey, aMetaKey);
|
||||
keyEvent->keyCode = aKeyCode;
|
||||
keyEvent->charCode = aCharCode;
|
||||
|
||||
|
@ -125,10 +125,7 @@ nsDOMMouseEvent::InitMouseEvent(const nsAString & aType, bool aCanBubble, bool a
|
||||
static_cast<nsMouseEvent_base*>(mEvent)->relatedTarget = aRelatedTarget;
|
||||
static_cast<nsMouseEvent_base*>(mEvent)->button = aButton;
|
||||
nsInputEvent* inputEvent = static_cast<nsInputEvent*>(mEvent);
|
||||
inputEvent->isControl = aCtrlKey;
|
||||
inputEvent->isAlt = aAltKey;
|
||||
inputEvent->isShift = aShiftKey;
|
||||
inputEvent->isMeta = aMetaKey;
|
||||
inputEvent->InitBasicModifiers(aCtrlKey, aAltKey, aShiftKey, aMetaKey);
|
||||
mClientPoint.x = aClientX;
|
||||
mClientPoint.y = aClientY;
|
||||
inputEvent->refPoint.x = aScreenX;
|
||||
@ -178,7 +175,7 @@ nsDOMMouseEvent::InitMouseEvent(const nsAString& aType,
|
||||
case NS_DRAG_EVENT:
|
||||
case NS_SIMPLE_GESTURE_EVENT:
|
||||
case NS_MOZTOUCH_EVENT:
|
||||
static_cast<nsMouseEvent_base*>(mEvent)->modifiers = modifiers;
|
||||
static_cast<nsInputEvent*>(mEvent)->modifiers = modifiers;
|
||||
return NS_OK;
|
||||
default:
|
||||
MOZ_NOT_REACHED("There is no space to store the modifiers");
|
||||
@ -373,7 +370,7 @@ NS_IMETHODIMP
|
||||
nsDOMMouseEvent::GetAltKey(bool* aIsDown)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aIsDown);
|
||||
*aIsDown = ((nsInputEvent*)mEvent)->isAlt;
|
||||
*aIsDown = static_cast<nsInputEvent*>(mEvent)->IsAlt();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -381,7 +378,7 @@ NS_IMETHODIMP
|
||||
nsDOMMouseEvent::GetCtrlKey(bool* aIsDown)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aIsDown);
|
||||
*aIsDown = ((nsInputEvent*)mEvent)->isControl;
|
||||
*aIsDown = static_cast<nsInputEvent*>(mEvent)->IsControl();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -389,7 +386,7 @@ NS_IMETHODIMP
|
||||
nsDOMMouseEvent::GetShiftKey(bool* aIsDown)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aIsDown);
|
||||
*aIsDown = ((nsInputEvent*)mEvent)->isShift;
|
||||
*aIsDown = static_cast<nsInputEvent*>(mEvent)->IsShift();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -397,7 +394,7 @@ NS_IMETHODIMP
|
||||
nsDOMMouseEvent::GetMetaKey(bool* aIsDown)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aIsDown);
|
||||
*aIsDown = ((nsInputEvent*)mEvent)->isMeta;
|
||||
*aIsDown = static_cast<nsInputEvent*>(mEvent)->IsMeta();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -291,10 +291,8 @@ nsDOMTouchEvent::InitTouchEvent(const nsAString& aType,
|
||||
aDetail);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
static_cast<nsInputEvent*>(mEvent)->isControl = aCtrlKey;
|
||||
static_cast<nsInputEvent*>(mEvent)->isAlt = aAltKey;
|
||||
static_cast<nsInputEvent*>(mEvent)->isShift = aShiftKey;
|
||||
static_cast<nsInputEvent*>(mEvent)->isMeta = aMetaKey;
|
||||
static_cast<nsInputEvent*>(mEvent)->InitBasicModifiers(aCtrlKey, aAltKey,
|
||||
aShiftKey, aMetaKey);
|
||||
mTouches = aTouches;
|
||||
mTargetTouches = aTargetTouches;
|
||||
mChangedTouches = aChangedTouches;
|
||||
@ -383,28 +381,28 @@ nsDOMTouchEvent::GetChangedTouches(nsIDOMTouchList** aChangedTouches)
|
||||
NS_IMETHODIMP
|
||||
nsDOMTouchEvent::GetAltKey(bool* aAltKey)
|
||||
{
|
||||
*aAltKey = static_cast<nsInputEvent*>(mEvent)->isAlt;
|
||||
*aAltKey = static_cast<nsInputEvent*>(mEvent)->IsAlt();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMTouchEvent::GetMetaKey(bool* aMetaKey)
|
||||
{
|
||||
*aMetaKey = static_cast<nsInputEvent*>(mEvent)->isMeta;
|
||||
*aMetaKey = static_cast<nsInputEvent*>(mEvent)->IsMeta();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMTouchEvent::GetCtrlKey(bool* aCtrlKey)
|
||||
{
|
||||
*aCtrlKey = static_cast<nsInputEvent*>(mEvent)->isControl;
|
||||
*aCtrlKey = static_cast<nsInputEvent*>(mEvent)->IsControl();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMTouchEvent::GetShiftKey(bool* aShiftKey)
|
||||
{
|
||||
*aShiftKey = static_cast<nsInputEvent*>(mEvent)->isShift;
|
||||
*aShiftKey = static_cast<nsInputEvent*>(mEvent)->IsShift();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -510,56 +510,42 @@ nsDOMUIEvent::ComputeModifierState(const nsAString& aModifiersList)
|
||||
bool
|
||||
nsDOMUIEvent::GetModifierStateInternal(const nsAString& aKey)
|
||||
{
|
||||
mozilla::widget::Modifiers modifiers = 0;
|
||||
switch(mEvent->eventStructType) {
|
||||
case NS_MOUSE_EVENT:
|
||||
case NS_MOUSE_SCROLL_EVENT:
|
||||
case NS_DRAG_EVENT:
|
||||
case NS_SIMPLE_GESTURE_EVENT:
|
||||
case NS_MOZTOUCH_EVENT:
|
||||
modifiers = static_cast<nsMouseEvent_base*>(mEvent)->modifiers;
|
||||
break;
|
||||
default:
|
||||
MOZ_NOT_REACHED("There is no space to store the modifiers");
|
||||
return false;
|
||||
}
|
||||
|
||||
nsInputEvent* inputEvent = static_cast<nsInputEvent*>(mEvent);
|
||||
if (aKey.EqualsLiteral(NS_DOM_KEYNAME_SHIFT)) {
|
||||
return static_cast<nsInputEvent*>(mEvent)->isShift;
|
||||
return inputEvent->IsShift();
|
||||
}
|
||||
if (aKey.EqualsLiteral(NS_DOM_KEYNAME_CONTROL)) {
|
||||
return static_cast<nsInputEvent*>(mEvent)->isControl;
|
||||
return inputEvent->IsControl();
|
||||
}
|
||||
if (aKey.EqualsLiteral(NS_DOM_KEYNAME_META)) {
|
||||
return static_cast<nsInputEvent*>(mEvent)->isMeta;
|
||||
return inputEvent->IsMeta();
|
||||
}
|
||||
if (aKey.EqualsLiteral(NS_DOM_KEYNAME_ALT)) {
|
||||
return static_cast<nsInputEvent*>(mEvent)->isAlt;
|
||||
return inputEvent->IsAlt();
|
||||
}
|
||||
|
||||
if (aKey.EqualsLiteral(NS_DOM_KEYNAME_ALTGRAPH)) {
|
||||
return (modifiers & widget::MODIFIER_ALTGRAPH) != 0;
|
||||
return inputEvent->IsAltGraph();
|
||||
}
|
||||
if (aKey.EqualsLiteral(NS_DOM_KEYNAME_WIN)) {
|
||||
return (modifiers & widget::MODIFIER_WIN) != 0;
|
||||
return inputEvent->IsWin();
|
||||
}
|
||||
|
||||
|
||||
if (aKey.EqualsLiteral(NS_DOM_KEYNAME_CAPSLOCK)) {
|
||||
return (modifiers & widget::MODIFIER_CAPSLOCK) != 0;
|
||||
return inputEvent->IsCapsLocked();
|
||||
}
|
||||
if (aKey.EqualsLiteral(NS_DOM_KEYNAME_NUMLOCK)) {
|
||||
return (modifiers & widget::MODIFIER_NUMLOCK) != 0;
|
||||
return inputEvent->IsNumLocked();
|
||||
}
|
||||
|
||||
if (aKey.EqualsLiteral(NS_DOM_KEYNAME_FN)) {
|
||||
return (modifiers & widget::MODIFIER_FN) != 0;
|
||||
return inputEvent->IsFn();
|
||||
}
|
||||
if (aKey.EqualsLiteral(NS_DOM_KEYNAME_SCROLL)) {
|
||||
return (modifiers & widget::MODIFIER_SCROLL) != 0;
|
||||
return inputEvent->IsScrollLocked();
|
||||
}
|
||||
if (aKey.EqualsLiteral(NS_DOM_KEYNAME_SYMBOLLOCK)) {
|
||||
return (modifiers & widget::MODIFIER_SYMBOLLOCK) != 0;
|
||||
return inputEvent->IsSymbolLocked();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -79,7 +79,7 @@ NS_IMETHODIMP
|
||||
nsDOMXULCommandEvent::GetAltKey(bool* aIsDown)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aIsDown);
|
||||
*aIsDown = Event()->isAlt;
|
||||
*aIsDown = Event()->IsAlt();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -87,7 +87,7 @@ NS_IMETHODIMP
|
||||
nsDOMXULCommandEvent::GetCtrlKey(bool* aIsDown)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aIsDown);
|
||||
*aIsDown = Event()->isControl;
|
||||
*aIsDown = Event()->IsControl();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -95,7 +95,7 @@ NS_IMETHODIMP
|
||||
nsDOMXULCommandEvent::GetShiftKey(bool* aIsDown)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aIsDown);
|
||||
*aIsDown = Event()->isShift;
|
||||
*aIsDown = Event()->IsShift();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -103,7 +103,7 @@ NS_IMETHODIMP
|
||||
nsDOMXULCommandEvent::GetMetaKey(bool* aIsDown)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aIsDown);
|
||||
*aIsDown = Event()->isMeta;
|
||||
*aIsDown = Event()->IsMeta();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -128,11 +128,7 @@ nsDOMXULCommandEvent::InitCommandEvent(const nsAString& aType,
|
||||
aView, aDetail);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsInputEvent *event = Event();
|
||||
event->isControl = aCtrlKey;
|
||||
event->isAlt = aAltKey;
|
||||
event->isShift = aShiftKey;
|
||||
event->isMeta = aMetaKey;
|
||||
Event()->InitBasicModifiers(aCtrlKey, aAltKey, aShiftKey, aMetaKey);
|
||||
mSourceEvent = aSourceEvent;
|
||||
|
||||
return NS_OK;
|
||||
|
@ -821,7 +821,7 @@ protected:
|
||||
nsInputEvent(bool isTrusted, PRUint32 msg, nsIWidget *w,
|
||||
PRUint8 structType)
|
||||
: nsGUIEvent(isTrusted, msg, w, structType),
|
||||
isShift(false), isControl(false), isAlt(false), isMeta(false)
|
||||
modifiers(0)
|
||||
{
|
||||
}
|
||||
|
||||
@ -832,18 +832,91 @@ protected:
|
||||
public:
|
||||
nsInputEvent(bool isTrusted, PRUint32 msg, nsIWidget *w)
|
||||
: nsGUIEvent(isTrusted, msg, w, NS_INPUT_EVENT),
|
||||
isShift(false), isControl(false), isAlt(false), isMeta(false)
|
||||
modifiers(0)
|
||||
{
|
||||
}
|
||||
|
||||
/// true indicates the shift key is down
|
||||
bool isShift;
|
||||
/// true indicates the control key is down
|
||||
bool isControl;
|
||||
/// true indicates the alt key is down
|
||||
bool isAlt;
|
||||
/// true indicates the meta key is down (or, on Mac, the Command key)
|
||||
bool isMeta;
|
||||
// true indicates the shift key is down
|
||||
bool IsShift() const
|
||||
{
|
||||
return ((modifiers & mozilla::widget::MODIFIER_SHIFT) != 0);
|
||||
}
|
||||
// true indicates the control key is down
|
||||
bool IsControl() const
|
||||
{
|
||||
return ((modifiers & mozilla::widget::MODIFIER_CONTROL) != 0);
|
||||
}
|
||||
// true indicates the alt key is down
|
||||
bool IsAlt() const
|
||||
{
|
||||
return ((modifiers & mozilla::widget::MODIFIER_ALT) != 0);
|
||||
}
|
||||
// true indicates the meta key is down (or, on Mac, the Command key)
|
||||
bool IsMeta() const
|
||||
{
|
||||
return ((modifiers & mozilla::widget::MODIFIER_META) != 0);
|
||||
}
|
||||
// true indicates the win key is down (or, on Linux, the Super or Hyper key)
|
||||
bool IsWin() const
|
||||
{
|
||||
return ((modifiers & mozilla::widget::MODIFIER_WIN) != 0);
|
||||
}
|
||||
// true indicates the alt graph key is down
|
||||
// NOTE: on Mac, the option key press causes both IsAlt() and IsAltGrpah()
|
||||
// return true.
|
||||
bool IsAltGraph() const
|
||||
{
|
||||
return ((modifiers & mozilla::widget::MODIFIER_ALTGRAPH) != 0);
|
||||
}
|
||||
// true indeicates the CapLock LED is turn on.
|
||||
bool IsCapsLocked() const
|
||||
{
|
||||
return ((modifiers & mozilla::widget::MODIFIER_CAPSLOCK) != 0);
|
||||
}
|
||||
// true indeicates the NumLock LED is turn on.
|
||||
bool IsNumLocked() const
|
||||
{
|
||||
return ((modifiers & mozilla::widget::MODIFIER_NUMLOCK) != 0);
|
||||
}
|
||||
// true indeicates the ScrollLock LED is turn on.
|
||||
bool IsScrollLocked() const
|
||||
{
|
||||
return ((modifiers & mozilla::widget::MODIFIER_SCROLL) != 0);
|
||||
}
|
||||
|
||||
// true indeicates the Fn key is down, but this is not supported by native
|
||||
// key event on any platform.
|
||||
bool IsFn() const
|
||||
{
|
||||
return ((modifiers & mozilla::widget::MODIFIER_FN) != 0);
|
||||
}
|
||||
// true indeicates the ScrollLock LED is turn on.
|
||||
bool IsSymbolLocked() const
|
||||
{
|
||||
return ((modifiers & mozilla::widget::MODIFIER_SYMBOLLOCK) != 0);
|
||||
}
|
||||
|
||||
void InitBasicModifiers(bool aCtrlKey,
|
||||
bool aAltKey,
|
||||
bool aShiftKey,
|
||||
bool aMetaKey)
|
||||
{
|
||||
modifiers = 0;
|
||||
if (aCtrlKey) {
|
||||
modifiers |= mozilla::widget::MODIFIER_CONTROL;
|
||||
}
|
||||
if (aAltKey) {
|
||||
modifiers |= mozilla::widget::MODIFIER_ALT;
|
||||
}
|
||||
if (aShiftKey) {
|
||||
modifiers |= mozilla::widget::MODIFIER_SHIFT;
|
||||
}
|
||||
if (aMetaKey) {
|
||||
modifiers |= mozilla::widget::MODIFIER_META;
|
||||
}
|
||||
}
|
||||
|
||||
mozilla::widget::Modifiers modifiers;
|
||||
};
|
||||
|
||||
/**
|
||||
@ -864,15 +937,13 @@ public:
|
||||
|
||||
nsMouseEvent_base(bool isTrusted, PRUint32 msg, nsIWidget *w, PRUint8 type)
|
||||
: nsInputEvent(isTrusted, msg, w, type), button(0), buttons(0),
|
||||
modifiers(0), pressure(0),
|
||||
inputSource(nsIDOMMouseEvent::MOZ_SOURCE_MOUSE) {}
|
||||
pressure(0), inputSource(nsIDOMMouseEvent::MOZ_SOURCE_MOUSE) {}
|
||||
|
||||
/// The possible related target
|
||||
nsCOMPtr<nsISupports> relatedTarget;
|
||||
|
||||
PRInt16 button;
|
||||
PRInt16 buttons;
|
||||
mozilla::widget::Modifiers modifiers;
|
||||
|
||||
// Finger or touch pressure of event
|
||||
// ranges between 0.0 and 1.0
|
||||
@ -1575,10 +1646,7 @@ public:
|
||||
aEvent->widget,
|
||||
NS_TOUCH_EVENT)
|
||||
{
|
||||
isShift = aEvent->isShift;
|
||||
isControl = aEvent->isControl;
|
||||
isMeta = aEvent->isMeta;
|
||||
isAlt = aEvent->isAlt;
|
||||
modifiers = aEvent->modifiers;
|
||||
time = aEvent->time;
|
||||
touches.AppendElements(aEvent->touches);
|
||||
MOZ_COUNT_CTOR(nsTouchEvent);
|
||||
|
@ -93,19 +93,13 @@ struct ParamTraits<nsInputEvent>
|
||||
static void Write(Message* aMsg, const paramType& aParam)
|
||||
{
|
||||
WriteParam(aMsg, static_cast<nsGUIEvent>(aParam));
|
||||
WriteParam(aMsg, aParam.isShift);
|
||||
WriteParam(aMsg, aParam.isControl);
|
||||
WriteParam(aMsg, aParam.isAlt);
|
||||
WriteParam(aMsg, aParam.isMeta);
|
||||
WriteParam(aMsg, aParam.modifiers);
|
||||
}
|
||||
|
||||
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
|
||||
{
|
||||
return ReadParam(aMsg, aIter, static_cast<nsGUIEvent*>(aResult)) &&
|
||||
ReadParam(aMsg, aIter, &aResult->isShift) &&
|
||||
ReadParam(aMsg, aIter, &aResult->isControl) &&
|
||||
ReadParam(aMsg, aIter, &aResult->isAlt) &&
|
||||
ReadParam(aMsg, aIter, &aResult->isMeta);
|
||||
ReadParam(aMsg, aIter, &aResult->modifiers);
|
||||
}
|
||||
};
|
||||
|
||||
@ -119,7 +113,6 @@ struct ParamTraits<nsMouseEvent_base>
|
||||
WriteParam(aMsg, static_cast<nsInputEvent>(aParam));
|
||||
WriteParam(aMsg, aParam.button);
|
||||
WriteParam(aMsg, aParam.buttons);
|
||||
WriteParam(aMsg, aParam.modifiers);
|
||||
WriteParam(aMsg, aParam.pressure);
|
||||
WriteParam(aMsg, aParam.inputSource);
|
||||
}
|
||||
@ -129,7 +122,6 @@ struct ParamTraits<nsMouseEvent_base>
|
||||
return ReadParam(aMsg, aIter, static_cast<nsInputEvent*>(aResult)) &&
|
||||
ReadParam(aMsg, aIter, &aResult->button) &&
|
||||
ReadParam(aMsg, aIter, &aResult->buttons) &&
|
||||
ReadParam(aMsg, aIter, &aResult->modifiers) &&
|
||||
ReadParam(aMsg, aIter, &aResult->pressure) &&
|
||||
ReadParam(aMsg, aIter, &aResult->inputSource);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user