mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 859951 - Split MotionEvent's action into mask and index in Java rather than in JNI code. r=wesj
This commit is contained in:
parent
14bfbafe0a
commit
3dda6378db
@ -336,11 +336,11 @@ public class GeckoEvent {
|
||||
}
|
||||
|
||||
private void initMotionEvent(MotionEvent m) {
|
||||
mAction = m.getAction();
|
||||
mAction = m.getActionMasked();
|
||||
mTime = (System.currentTimeMillis() - SystemClock.elapsedRealtime()) + m.getEventTime();
|
||||
mMetaState = m.getMetaState();
|
||||
|
||||
switch (mAction & MotionEvent.ACTION_MASK) {
|
||||
switch (mAction) {
|
||||
case MotionEvent.ACTION_CANCEL:
|
||||
case MotionEvent.ACTION_UP:
|
||||
case MotionEvent.ACTION_POINTER_UP:
|
||||
@ -356,7 +356,7 @@ public class GeckoEvent {
|
||||
mOrientations = new float[mCount];
|
||||
mPressures = new float[mCount];
|
||||
mPointRadii = new Point[mCount];
|
||||
mPointerIndex = (mAction & MotionEvent.ACTION_POINTER_INDEX_MASK) >> MotionEvent.ACTION_POINTER_INDEX_SHIFT;
|
||||
mPointerIndex = m.getActionIndex();
|
||||
for (int i = 0; i < mCount; i++) {
|
||||
addMotionPoint(i, i, m);
|
||||
}
|
||||
|
@ -697,8 +697,7 @@ AndroidGeckoEvent::MakeTouchEvent(nsIWidget* widget)
|
||||
int startIndex = 0;
|
||||
int endIndex = Count();
|
||||
|
||||
int action = Action() & AndroidMotionEvent::ACTION_MASK;
|
||||
switch (action) {
|
||||
switch (Action()) {
|
||||
case AndroidMotionEvent::ACTION_DOWN:
|
||||
case AndroidMotionEvent::ACTION_POINTER_DOWN: {
|
||||
type = NS_TOUCH_START;
|
||||
|
@ -546,7 +546,6 @@ class AndroidMotionEvent
|
||||
{
|
||||
public:
|
||||
enum {
|
||||
ACTION_MASK = 0xff,
|
||||
ACTION_DOWN = 0,
|
||||
ACTION_UP = 1,
|
||||
ACTION_MOVE = 2,
|
||||
@ -560,8 +559,6 @@ public:
|
||||
ACTION_MAGNIFY_START = 11,
|
||||
ACTION_MAGNIFY = 12,
|
||||
ACTION_MAGNIFY_END = 13,
|
||||
ACTION_POINTER_ID_MASK = 0xff00,
|
||||
ACTION_POINTER_ID_SHIFT = 8,
|
||||
EDGE_TOP = 0x00000001,
|
||||
EDGE_BOTTOM = 0x00000002,
|
||||
EDGE_LEFT = 0x00000004,
|
||||
|
@ -1128,7 +1128,7 @@ void
|
||||
nsWindow::OnMouseEvent(AndroidGeckoEvent *ae)
|
||||
{
|
||||
uint32_t msg;
|
||||
switch (ae->Action() & AndroidMotionEvent::ACTION_MASK) {
|
||||
switch (ae->Action()) {
|
||||
#ifndef MOZ_ONLY_TOUCH_EVENTS
|
||||
case AndroidMotionEvent::ACTION_DOWN:
|
||||
msg = NS_MOUSE_BUTTON_DOWN;
|
||||
@ -1250,7 +1250,7 @@ nsWindow::OnNativeGestureEvent(AndroidGeckoEvent *ae)
|
||||
double delta = ae->X();
|
||||
int msg = 0;
|
||||
|
||||
switch (ae->Action() & AndroidMotionEvent::ACTION_MASK) {
|
||||
switch (ae->Action()) {
|
||||
case AndroidMotionEvent::ACTION_MAGNIFY_START:
|
||||
msg = NS_SIMPLE_GESTURE_MAGNIFY_START;
|
||||
mStartDist = delta;
|
||||
|
Loading…
Reference in New Issue
Block a user