Bug 1238761 - Autogenerate constants for MotionEvent; r=snorp

This patch autogenerates constants for MotionEvent to replace the manual
definitions in AndroidJavaWrappers.
This commit is contained in:
Jim Chen 2016-01-15 13:05:45 -05:00
Родитель 06c79783a7
Коммит 11fce4fc7d
4 изменённых файлов: 11 добавлений и 7 удалений

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

@ -28,6 +28,7 @@ bindings_exports_FILES := \
Bundle.h \
KeyEvent.h \
MediaCodec.h \
MotionEvent.h \
SurfaceTexture.h \
$(NULL)
bindings_exports_DEST = $(DIST)/include

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

@ -0,0 +1 @@
android.view.MotionEvent

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

@ -11,6 +11,7 @@ generated = [
'Bundle',
'KeyEvent',
'MediaCodec',
'MotionEvent',
'SurfaceTexture'
]

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

@ -73,6 +73,7 @@ using mozilla::Unused;
#include "android_npapi.h"
#include "GeneratedJNINatives.h"
#include "KeyEvent.h"
#include "MotionEvent.h"
#include "imgIEncoder.h"
@ -526,23 +527,23 @@ public:
size_t endIndex = pointerId.Length();
switch (aAction) {
case AndroidMotionEvent::ACTION_DOWN:
case AndroidMotionEvent::ACTION_POINTER_DOWN:
case sdk::MotionEvent::ACTION_DOWN:
case sdk::MotionEvent::ACTION_POINTER_DOWN:
type = MultiTouchInput::MULTITOUCH_START;
break;
case AndroidMotionEvent::ACTION_MOVE:
case sdk::MotionEvent::ACTION_MOVE:
type = MultiTouchInput::MULTITOUCH_MOVE;
break;
case AndroidMotionEvent::ACTION_UP:
case AndroidMotionEvent::ACTION_POINTER_UP:
case sdk::MotionEvent::ACTION_UP:
case sdk::MotionEvent::ACTION_POINTER_UP:
// for pointer-up events we only want the data from
// the one pointer that went up
type = MultiTouchInput::MULTITOUCH_END;
startIndex = aActionIndex;
endIndex = aActionIndex + 1;
break;
case AndroidMotionEvent::ACTION_OUTSIDE:
case AndroidMotionEvent::ACTION_CANCEL:
case sdk::MotionEvent::ACTION_OUTSIDE:
case sdk::MotionEvent::ACTION_CANCEL:
type = MultiTouchInput::MULTITOUCH_CANCEL;
break;
default: