2010-06-04 00:56:36 +04:00
|
|
|
/* -*- Mode: c++; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
|
2012-05-21 15:12:37 +04:00
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2010-06-04 00:56:36 +04:00
|
|
|
|
|
|
|
#ifndef AndroidJavaWrappers_h__
|
|
|
|
#define AndroidJavaWrappers_h__
|
|
|
|
|
|
|
|
#include <jni.h>
|
|
|
|
#include <android/log.h>
|
|
|
|
|
2010-06-05 01:14:43 +04:00
|
|
|
#include "nsGeoPosition.h"
|
2010-06-04 00:56:36 +04:00
|
|
|
#include "nsPoint.h"
|
|
|
|
#include "nsRect.h"
|
|
|
|
#include "nsString.h"
|
2012-05-23 18:51:39 +04:00
|
|
|
#include "mozilla/gfx/Rect.h"
|
2010-06-04 00:56:36 +04:00
|
|
|
|
2010-06-26 04:52:37 +04:00
|
|
|
//#define FORCE_ALOG 1
|
|
|
|
|
2010-06-04 00:56:36 +04:00
|
|
|
#ifndef ALOG
|
2010-06-26 04:52:37 +04:00
|
|
|
#if defined(DEBUG) || defined(FORCE_ALOG)
|
2010-06-04 00:56:36 +04:00
|
|
|
#define ALOG(args...) __android_log_print(ANDROID_LOG_INFO, "Gecko" , ## args)
|
|
|
|
#else
|
2013-01-25 23:33:40 +04:00
|
|
|
#define ALOG(args...) ((void)0)
|
2010-06-04 00:56:36 +04:00
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2012-09-13 01:47:08 +04:00
|
|
|
class nsIAndroidDisplayport;
|
|
|
|
class nsIAndroidViewport;
|
|
|
|
|
2010-06-04 00:56:36 +04:00
|
|
|
namespace mozilla {
|
|
|
|
|
2012-02-22 23:45:44 +04:00
|
|
|
class AndroidGeckoLayerClient;
|
2012-05-04 19:08:47 +04:00
|
|
|
class AutoLocalJNIFrame;
|
2012-02-04 11:31:05 +04:00
|
|
|
|
2010-06-04 00:56:36 +04:00
|
|
|
void InitAndroidJavaWrappers(JNIEnv *jEnv);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Note: do not store global refs to any WrappedJavaObject;
|
|
|
|
* these are live only during a particular JNI method, as
|
|
|
|
* NewGlobalRef is -not- called on the jobject.
|
|
|
|
*
|
|
|
|
* If this is needed, WrappedJavaObject can be extended to
|
|
|
|
* handle it.
|
|
|
|
*/
|
|
|
|
|
2012-06-14 20:08:51 +04:00
|
|
|
class RefCountedJavaObject {
|
|
|
|
public:
|
|
|
|
RefCountedJavaObject(JNIEnv* env, jobject obj) : mRefCnt(0), mObject(env->NewGlobalRef(obj)) {}
|
|
|
|
|
|
|
|
~RefCountedJavaObject();
|
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t AddRef() { return ++mRefCnt; }
|
2012-06-14 20:08:51 +04:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t Release() {
|
|
|
|
int32_t refcnt = --mRefCnt;
|
2012-06-14 20:08:51 +04:00
|
|
|
if (refcnt == 0)
|
|
|
|
delete this;
|
|
|
|
return refcnt;
|
|
|
|
}
|
|
|
|
|
|
|
|
jobject GetObject() { return mObject; }
|
|
|
|
private:
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t mRefCnt;
|
2012-06-14 20:08:51 +04:00
|
|
|
jobject mObject;
|
|
|
|
};
|
|
|
|
|
2010-06-04 00:56:36 +04:00
|
|
|
class WrappedJavaObject {
|
|
|
|
public:
|
|
|
|
WrappedJavaObject() :
|
|
|
|
wrapped_obj(0)
|
|
|
|
{ }
|
|
|
|
|
|
|
|
WrappedJavaObject(jobject jobj) {
|
|
|
|
Init(jobj);
|
|
|
|
}
|
|
|
|
|
|
|
|
void Init(jobject jobj) {
|
|
|
|
wrapped_obj = jobj;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool isNull() const {
|
|
|
|
return wrapped_obj == 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
jobject wrappedObject() const {
|
|
|
|
return wrapped_obj;
|
|
|
|
}
|
|
|
|
|
|
|
|
protected:
|
|
|
|
jobject wrapped_obj;
|
|
|
|
};
|
|
|
|
|
|
|
|
class AndroidPoint : public WrappedJavaObject
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
static void InitPointClass(JNIEnv *jEnv);
|
|
|
|
|
|
|
|
AndroidPoint() { }
|
|
|
|
AndroidPoint(JNIEnv *jenv, jobject jobj) {
|
|
|
|
Init(jenv, jobj);
|
|
|
|
}
|
|
|
|
|
|
|
|
void Init(JNIEnv *jenv, jobject jobj);
|
|
|
|
|
|
|
|
int X() { return mX; }
|
|
|
|
int Y() { return mY; }
|
|
|
|
|
|
|
|
protected:
|
|
|
|
int mX;
|
|
|
|
int mY;
|
|
|
|
|
|
|
|
static jclass jPointClass;
|
|
|
|
static jfieldID jXField;
|
|
|
|
static jfieldID jYField;
|
|
|
|
};
|
|
|
|
|
|
|
|
class AndroidRect : public WrappedJavaObject
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
static void InitRectClass(JNIEnv *jEnv);
|
|
|
|
|
|
|
|
AndroidRect() { }
|
|
|
|
AndroidRect(JNIEnv *jenv, jobject jobj) {
|
|
|
|
Init(jenv, jobj);
|
|
|
|
}
|
|
|
|
|
|
|
|
void Init(JNIEnv *jenv, jobject jobj);
|
|
|
|
|
|
|
|
int Bottom() { return mBottom; }
|
|
|
|
int Left() { return mLeft; }
|
|
|
|
int Right() { return mRight; }
|
|
|
|
int Top() { return mTop; }
|
2012-02-09 21:28:10 +04:00
|
|
|
int Width() { return mRight - mLeft; }
|
|
|
|
int Height() { return mBottom - mTop; }
|
2010-06-04 00:56:36 +04:00
|
|
|
|
|
|
|
protected:
|
|
|
|
int mBottom;
|
|
|
|
int mLeft;
|
|
|
|
int mRight;
|
|
|
|
int mTop;
|
|
|
|
|
|
|
|
static jclass jRectClass;
|
|
|
|
static jfieldID jBottomField;
|
|
|
|
static jfieldID jLeftField;
|
|
|
|
static jfieldID jRightField;
|
|
|
|
static jfieldID jTopField;
|
|
|
|
};
|
|
|
|
|
2012-09-13 01:47:08 +04:00
|
|
|
class AndroidRectF : public WrappedJavaObject
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
static void InitRectFClass(JNIEnv *jEnv);
|
|
|
|
|
|
|
|
AndroidRectF() { }
|
|
|
|
AndroidRectF(JNIEnv *jenv, jobject jobj) {
|
|
|
|
Init(jenv, jobj);
|
|
|
|
}
|
|
|
|
|
|
|
|
void Init(JNIEnv *jenv, jobject jobj);
|
|
|
|
|
|
|
|
float Bottom() { return mBottom; }
|
|
|
|
float Left() { return mLeft; }
|
|
|
|
float Right() { return mRight; }
|
|
|
|
float Top() { return mTop; }
|
|
|
|
float Width() { return mRight - mLeft; }
|
|
|
|
float Height() { return mBottom - mTop; }
|
|
|
|
|
|
|
|
protected:
|
|
|
|
float mBottom;
|
|
|
|
float mLeft;
|
|
|
|
float mRight;
|
|
|
|
float mTop;
|
|
|
|
|
|
|
|
static jclass jRectClass;
|
|
|
|
static jfieldID jBottomField;
|
|
|
|
static jfieldID jLeftField;
|
|
|
|
static jfieldID jRightField;
|
|
|
|
static jfieldID jTopField;
|
|
|
|
};
|
|
|
|
|
2012-02-04 11:31:05 +04:00
|
|
|
class AndroidViewTransform : public WrappedJavaObject {
|
|
|
|
public:
|
|
|
|
static void InitViewTransformClass(JNIEnv *jEnv);
|
|
|
|
|
|
|
|
void Init(jobject jobj);
|
|
|
|
|
|
|
|
AndroidViewTransform() {}
|
|
|
|
AndroidViewTransform(jobject jobj) { Init(jobj); }
|
|
|
|
|
2012-04-24 05:06:41 +04:00
|
|
|
float GetX(JNIEnv *env);
|
|
|
|
float GetY(JNIEnv *env);
|
|
|
|
float GetScale(JNIEnv *env);
|
2012-02-04 11:31:05 +04:00
|
|
|
|
|
|
|
private:
|
|
|
|
static jclass jViewTransformClass;
|
|
|
|
static jfieldID jXField;
|
|
|
|
static jfieldID jYField;
|
|
|
|
static jfieldID jScaleField;
|
|
|
|
};
|
|
|
|
|
2012-10-15 12:33:34 +04:00
|
|
|
class AndroidProgressiveUpdateData : public WrappedJavaObject {
|
|
|
|
public:
|
|
|
|
static void InitProgressiveUpdateDataClass(JNIEnv *jEnv);
|
|
|
|
|
|
|
|
void Init(jobject jobj);
|
|
|
|
|
|
|
|
AndroidProgressiveUpdateData() {}
|
|
|
|
AndroidProgressiveUpdateData(jobject jobj) { Init(jobj); }
|
|
|
|
|
|
|
|
float GetX(JNIEnv *env);
|
|
|
|
float GetY(JNIEnv *env);
|
|
|
|
float GetWidth(JNIEnv *env);
|
|
|
|
float GetHeight(JNIEnv *env);
|
|
|
|
float GetScale(JNIEnv *env);
|
|
|
|
bool GetShouldAbort(JNIEnv *env);
|
|
|
|
|
|
|
|
private:
|
|
|
|
static jclass jProgressiveUpdateDataClass;
|
|
|
|
static jfieldID jXField;
|
|
|
|
static jfieldID jYField;
|
|
|
|
static jfieldID jWidthField;
|
|
|
|
static jfieldID jHeightField;
|
|
|
|
static jfieldID jScaleField;
|
|
|
|
static jfieldID jShouldAbortField;
|
|
|
|
};
|
|
|
|
|
2012-02-10 10:58:18 +04:00
|
|
|
class AndroidLayerRendererFrame : public WrappedJavaObject {
|
|
|
|
public:
|
|
|
|
static void InitLayerRendererFrameClass(JNIEnv *jEnv);
|
|
|
|
|
2012-05-04 19:08:46 +04:00
|
|
|
void Init(JNIEnv *env, jobject jobj);
|
|
|
|
void Dispose(JNIEnv *env);
|
2012-02-10 10:58:18 +04:00
|
|
|
|
2012-05-08 17:35:59 +04:00
|
|
|
bool BeginDrawing(AutoLocalJNIFrame *jniFrame);
|
|
|
|
bool DrawBackground(AutoLocalJNIFrame *jniFrame);
|
|
|
|
bool DrawForeground(AutoLocalJNIFrame *jniFrame);
|
|
|
|
bool EndDrawing(AutoLocalJNIFrame *jniFrame);
|
2012-02-10 10:58:18 +04:00
|
|
|
|
|
|
|
private:
|
|
|
|
static jclass jLayerRendererFrameClass;
|
|
|
|
static jmethodID jBeginDrawingMethod;
|
|
|
|
static jmethodID jDrawBackgroundMethod;
|
|
|
|
static jmethodID jDrawForegroundMethod;
|
|
|
|
static jmethodID jEndDrawingMethod;
|
|
|
|
};
|
|
|
|
|
2012-02-22 23:45:44 +04:00
|
|
|
class AndroidGeckoLayerClient : public WrappedJavaObject {
|
2012-02-04 03:48:26 +04:00
|
|
|
public:
|
2012-02-22 23:45:44 +04:00
|
|
|
static void InitGeckoLayerClientClass(JNIEnv *jEnv);
|
2012-02-04 03:48:26 +04:00
|
|
|
|
|
|
|
void Init(jobject jobj);
|
|
|
|
|
2012-03-14 08:15:11 +04:00
|
|
|
AndroidGeckoLayerClient() {}
|
|
|
|
AndroidGeckoLayerClient(jobject jobj) { Init(jobj); }
|
2012-02-04 11:31:05 +04:00
|
|
|
|
2013-03-04 18:37:43 +04:00
|
|
|
void SetFirstPaintViewport(const nsIntPoint& aOffset, float aZoom, const nsIntRect& aPageRect, const gfx::Rect& aCssPageRect);
|
2012-06-13 21:49:40 +04:00
|
|
|
void SetPageRect(const gfx::Rect& aCssPageRect);
|
2013-03-04 18:37:43 +04:00
|
|
|
void SyncViewportInfo(const nsIntRect& aDisplayPort, float aDisplayResolution, bool aLayersUpdated,
|
2013-03-07 01:11:05 +04:00
|
|
|
nsIntPoint& aScrollOffset, float& aScaleX, float& aScaleY);
|
2012-11-22 02:34:19 +04:00
|
|
|
bool ProgressiveUpdateCallback(bool aHasPendingNewThebesContent, const gfx::Rect& aDisplayPort, float aDisplayResolution, bool aDrawingCritical, gfx::Rect& aViewport, float& aScaleX, float& aScaleY);
|
2012-05-08 17:35:59 +04:00
|
|
|
bool CreateFrame(AutoLocalJNIFrame *jniFrame, AndroidLayerRendererFrame& aFrame);
|
|
|
|
bool ActivateProgram(AutoLocalJNIFrame *jniFrame);
|
|
|
|
bool DeactivateProgram(AutoLocalJNIFrame *jniFrame);
|
2012-09-13 01:47:08 +04:00
|
|
|
void GetDisplayPort(AutoLocalJNIFrame *jniFrame, bool aPageSizeUpdate, bool aIsBrowserContentDisplayed, int32_t tabId, nsIAndroidViewport* metrics, nsIAndroidDisplayport** displayPort);
|
2012-02-04 03:48:26 +04:00
|
|
|
|
2012-02-22 23:45:44 +04:00
|
|
|
protected:
|
|
|
|
static jclass jGeckoLayerClientClass;
|
2012-03-12 19:50:21 +04:00
|
|
|
static jmethodID jSetFirstPaintViewport;
|
2012-05-23 18:51:39 +04:00
|
|
|
static jmethodID jSetPageRect;
|
2012-03-17 19:08:22 +04:00
|
|
|
static jmethodID jSyncViewportInfoMethod;
|
2012-02-10 10:58:18 +04:00
|
|
|
static jmethodID jCreateFrameMethod;
|
2012-02-14 01:55:10 +04:00
|
|
|
static jmethodID jActivateProgramMethod;
|
|
|
|
static jmethodID jDeactivateProgramMethod;
|
2012-09-13 01:47:08 +04:00
|
|
|
static jmethodID jGetDisplayPort;
|
2012-10-15 12:33:34 +04:00
|
|
|
static jmethodID jProgressiveUpdateCallbackMethod;
|
2012-09-13 01:47:08 +04:00
|
|
|
|
|
|
|
public:
|
|
|
|
static jclass jViewportClass;
|
|
|
|
static jclass jDisplayportClass;
|
|
|
|
static jmethodID jViewportCtor;
|
|
|
|
static jfieldID jDisplayportPosition;
|
|
|
|
static jfieldID jDisplayportResolution;
|
2012-02-04 03:48:26 +04:00
|
|
|
};
|
|
|
|
|
2010-06-04 00:56:36 +04:00
|
|
|
class AndroidKeyEvent
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
enum {
|
|
|
|
KEYCODE_UNKNOWN = 0,
|
|
|
|
KEYCODE_SOFT_LEFT = 1,
|
|
|
|
KEYCODE_SOFT_RIGHT = 2,
|
|
|
|
KEYCODE_HOME = 3,
|
|
|
|
KEYCODE_BACK = 4,
|
|
|
|
KEYCODE_CALL = 5,
|
|
|
|
KEYCODE_ENDCALL = 6,
|
|
|
|
KEYCODE_0 = 7,
|
|
|
|
KEYCODE_1 = 8,
|
|
|
|
KEYCODE_2 = 9,
|
|
|
|
KEYCODE_3 = 10,
|
|
|
|
KEYCODE_4 = 11,
|
|
|
|
KEYCODE_5 = 12,
|
|
|
|
KEYCODE_6 = 13,
|
|
|
|
KEYCODE_7 = 14,
|
|
|
|
KEYCODE_8 = 15,
|
|
|
|
KEYCODE_9 = 16,
|
|
|
|
KEYCODE_STAR = 17,
|
|
|
|
KEYCODE_POUND = 18,
|
|
|
|
KEYCODE_DPAD_UP = 19,
|
|
|
|
KEYCODE_DPAD_DOWN = 20,
|
|
|
|
KEYCODE_DPAD_LEFT = 21,
|
|
|
|
KEYCODE_DPAD_RIGHT = 22,
|
|
|
|
KEYCODE_DPAD_CENTER = 23,
|
|
|
|
KEYCODE_VOLUME_UP = 24,
|
|
|
|
KEYCODE_VOLUME_DOWN = 25,
|
|
|
|
KEYCODE_POWER = 26,
|
|
|
|
KEYCODE_CAMERA = 27,
|
|
|
|
KEYCODE_CLEAR = 28,
|
|
|
|
KEYCODE_A = 29,
|
|
|
|
KEYCODE_B = 30,
|
|
|
|
KEYCODE_C = 31,
|
|
|
|
KEYCODE_D = 32,
|
|
|
|
KEYCODE_E = 33,
|
|
|
|
KEYCODE_F = 34,
|
|
|
|
KEYCODE_G = 35,
|
|
|
|
KEYCODE_H = 36,
|
|
|
|
KEYCODE_I = 37,
|
|
|
|
KEYCODE_J = 38,
|
|
|
|
KEYCODE_K = 39,
|
|
|
|
KEYCODE_L = 40,
|
|
|
|
KEYCODE_M = 41,
|
|
|
|
KEYCODE_N = 42,
|
|
|
|
KEYCODE_O = 43,
|
|
|
|
KEYCODE_P = 44,
|
|
|
|
KEYCODE_Q = 45,
|
|
|
|
KEYCODE_R = 46,
|
|
|
|
KEYCODE_S = 47,
|
|
|
|
KEYCODE_T = 48,
|
|
|
|
KEYCODE_U = 49,
|
|
|
|
KEYCODE_V = 50,
|
|
|
|
KEYCODE_W = 51,
|
|
|
|
KEYCODE_X = 52,
|
|
|
|
KEYCODE_Y = 53,
|
|
|
|
KEYCODE_Z = 54,
|
|
|
|
KEYCODE_COMMA = 55,
|
|
|
|
KEYCODE_PERIOD = 56,
|
|
|
|
KEYCODE_ALT_LEFT = 57,
|
|
|
|
KEYCODE_ALT_RIGHT = 58,
|
|
|
|
KEYCODE_SHIFT_LEFT = 59,
|
|
|
|
KEYCODE_SHIFT_RIGHT = 60,
|
|
|
|
KEYCODE_TAB = 61,
|
|
|
|
KEYCODE_SPACE = 62,
|
|
|
|
KEYCODE_SYM = 63,
|
|
|
|
KEYCODE_EXPLORER = 64,
|
|
|
|
KEYCODE_ENVELOPE = 65,
|
|
|
|
KEYCODE_ENTER = 66,
|
|
|
|
KEYCODE_DEL = 67,
|
|
|
|
KEYCODE_GRAVE = 68,
|
|
|
|
KEYCODE_MINUS = 69,
|
|
|
|
KEYCODE_EQUALS = 70,
|
|
|
|
KEYCODE_LEFT_BRACKET = 71,
|
|
|
|
KEYCODE_RIGHT_BRACKET = 72,
|
|
|
|
KEYCODE_BACKSLASH = 73,
|
|
|
|
KEYCODE_SEMICOLON = 74,
|
|
|
|
KEYCODE_APOSTROPHE = 75,
|
|
|
|
KEYCODE_SLASH = 76,
|
|
|
|
KEYCODE_AT = 77,
|
|
|
|
KEYCODE_NUM = 78,
|
|
|
|
KEYCODE_HEADSETHOOK = 79,
|
|
|
|
KEYCODE_FOCUS = 80,
|
|
|
|
KEYCODE_PLUS = 81,
|
|
|
|
KEYCODE_MENU = 82,
|
|
|
|
KEYCODE_NOTIFICATION = 83,
|
|
|
|
KEYCODE_SEARCH = 84,
|
|
|
|
KEYCODE_MEDIA_PLAY_PAUSE = 85,
|
|
|
|
KEYCODE_MEDIA_STOP = 86,
|
|
|
|
KEYCODE_MEDIA_NEXT = 87,
|
|
|
|
KEYCODE_MEDIA_PREVIOUS = 88,
|
|
|
|
KEYCODE_MEDIA_REWIND = 89,
|
|
|
|
KEYCODE_MEDIA_FAST_FORWARD = 90,
|
|
|
|
KEYCODE_MUTE = 91,
|
2012-04-20 00:34:03 +04:00
|
|
|
KEYCODE_PAGE_UP = 92,
|
|
|
|
KEYCODE_PAGE_DOWN = 93,
|
|
|
|
KEYCODE_PICTSYMBOLS = 94,
|
|
|
|
KEYCODE_SWITCH_CHARSET = 95,
|
|
|
|
KEYCODE_BUTTON_A = 96,
|
|
|
|
KEYCODE_BUTTON_B = 97,
|
|
|
|
KEYCODE_BUTTON_C = 98,
|
|
|
|
KEYCODE_BUTTON_X = 99,
|
|
|
|
KEYCODE_BUTTON_Y = 100,
|
|
|
|
KEYCODE_BUTTON_Z = 101,
|
|
|
|
KEYCODE_BUTTON_L1 = 102,
|
|
|
|
KEYCODE_BUTTON_R1 = 103,
|
|
|
|
KEYCODE_BUTTON_L2 = 104,
|
|
|
|
KEYCODE_BUTTON_R2 = 105,
|
|
|
|
KEYCODE_BUTTON_THUMBL = 106,
|
|
|
|
KEYCODE_BUTTON_THUMBR = 107,
|
|
|
|
KEYCODE_BUTTON_START = 108,
|
|
|
|
KEYCODE_BUTTON_SELECT = 109,
|
|
|
|
KEYCODE_BUTTON_MODE = 110,
|
|
|
|
KEYCODE_ESCAPE = 111,
|
|
|
|
KEYCODE_FORWARD_DEL = 112,
|
|
|
|
KEYCODE_CTRL_LEFT = 113,
|
|
|
|
KEYCODE_CTRL_RIGHT = 114,
|
|
|
|
KEYCODE_CAPS_LOCK = 115,
|
|
|
|
KEYCODE_SCROLL_LOCK = 116,
|
|
|
|
KEYCODE_META_LEFT = 117,
|
|
|
|
KEYCODE_META_RIGHT = 118,
|
|
|
|
KEYCODE_FUNCTION = 119,
|
|
|
|
KEYCODE_SYSRQ = 120,
|
|
|
|
KEYCODE_BREAK = 121,
|
|
|
|
KEYCODE_MOVE_HOME = 122,
|
|
|
|
KEYCODE_MOVE_END = 123,
|
|
|
|
KEYCODE_INSERT = 124,
|
|
|
|
KEYCODE_FORWARD = 125,
|
|
|
|
KEYCODE_MEDIA_PLAY = 126,
|
|
|
|
KEYCODE_MEDIA_PAUSE = 127,
|
|
|
|
KEYCODE_MEDIA_CLOSE = 128,
|
|
|
|
KEYCODE_MEDIA_EJECT = 129,
|
|
|
|
KEYCODE_MEDIA_RECORD = 130,
|
|
|
|
KEYCODE_F1 = 131,
|
|
|
|
KEYCODE_F2 = 132,
|
|
|
|
KEYCODE_F3 = 133,
|
|
|
|
KEYCODE_F4 = 134,
|
|
|
|
KEYCODE_F5 = 135,
|
|
|
|
KEYCODE_F6 = 136,
|
|
|
|
KEYCODE_F7 = 137,
|
|
|
|
KEYCODE_F8 = 138,
|
|
|
|
KEYCODE_F9 = 139,
|
|
|
|
KEYCODE_F10 = 140,
|
|
|
|
KEYCODE_F11 = 141,
|
|
|
|
KEYCODE_F12 = 142,
|
|
|
|
KEYCODE_NUM_LOCK = 143,
|
|
|
|
KEYCODE_NUMPAD_0 = 144,
|
|
|
|
KEYCODE_NUMPAD_1 = 145,
|
|
|
|
KEYCODE_NUMPAD_2 = 146,
|
|
|
|
KEYCODE_NUMPAD_3 = 147,
|
|
|
|
KEYCODE_NUMPAD_4 = 148,
|
|
|
|
KEYCODE_NUMPAD_5 = 149,
|
|
|
|
KEYCODE_NUMPAD_6 = 150,
|
|
|
|
KEYCODE_NUMPAD_7 = 151,
|
|
|
|
KEYCODE_NUMPAD_8 = 152,
|
|
|
|
KEYCODE_NUMPAD_9 = 153,
|
|
|
|
KEYCODE_NUMPAD_DIVIDE = 154,
|
|
|
|
KEYCODE_NUMPAD_MULTIPLY = 155,
|
|
|
|
KEYCODE_NUMPAD_SUBTRACT = 156,
|
|
|
|
KEYCODE_NUMPAD_ADD = 157,
|
|
|
|
KEYCODE_NUMPAD_DOT = 158,
|
|
|
|
KEYCODE_NUMPAD_COMMA = 159,
|
|
|
|
KEYCODE_NUMPAD_ENTER = 160,
|
|
|
|
KEYCODE_NUMPAD_EQUALS = 161,
|
|
|
|
KEYCODE_NUMPAD_LEFT_PAREN = 162,
|
|
|
|
KEYCODE_NUMPAD_RIGHT_PAREN = 163,
|
|
|
|
KEYCODE_VOLUME_MUTE = 164,
|
|
|
|
KEYCODE_INFO = 165,
|
|
|
|
KEYCODE_CHANNEL_UP = 166,
|
|
|
|
KEYCODE_CHANNEL_DOWN = 167,
|
|
|
|
KEYCODE_ZOOM_IN = 168,
|
|
|
|
KEYCODE_ZOOM_OUT = 169,
|
|
|
|
KEYCODE_TV = 170,
|
|
|
|
KEYCODE_WINDOW = 171,
|
|
|
|
KEYCODE_GUIDE = 172,
|
|
|
|
KEYCODE_DVR = 173,
|
|
|
|
KEYCODE_BOOKMARK = 174,
|
|
|
|
KEYCODE_CAPTIONS = 175,
|
|
|
|
KEYCODE_SETTINGS = 176,
|
|
|
|
KEYCODE_TV_POWER = 177,
|
|
|
|
KEYCODE_TV_INPUT = 178,
|
|
|
|
KEYCODE_STB_POWER = 179,
|
|
|
|
KEYCODE_STB_INPUT = 180,
|
|
|
|
KEYCODE_AVR_POWER = 181,
|
|
|
|
KEYCODE_AVR_INPUT = 182,
|
|
|
|
KEYCODE_PROG_RED = 183,
|
|
|
|
KEYCODE_PROG_GREEN = 184,
|
|
|
|
KEYCODE_PROG_YELLOW = 185,
|
|
|
|
KEYCODE_PROG_BLUE = 186,
|
|
|
|
KEYCODE_APP_SWITCH = 187,
|
|
|
|
KEYCODE_BUTTON_1 = 188,
|
|
|
|
KEYCODE_BUTTON_2 = 189,
|
|
|
|
KEYCODE_BUTTON_3 = 190,
|
|
|
|
KEYCODE_BUTTON_4 = 191,
|
|
|
|
KEYCODE_BUTTON_5 = 192,
|
|
|
|
KEYCODE_BUTTON_6 = 193,
|
|
|
|
KEYCODE_BUTTON_7 = 194,
|
|
|
|
KEYCODE_BUTTON_8 = 195,
|
|
|
|
KEYCODE_BUTTON_9 = 196,
|
|
|
|
KEYCODE_BUTTON_10 = 197,
|
|
|
|
KEYCODE_BUTTON_11 = 198,
|
|
|
|
KEYCODE_BUTTON_12 = 199,
|
|
|
|
KEYCODE_BUTTON_13 = 200,
|
|
|
|
KEYCODE_BUTTON_14 = 201,
|
|
|
|
KEYCODE_BUTTON_15 = 202,
|
|
|
|
KEYCODE_BUTTON_16 = 203,
|
|
|
|
KEYCODE_LANGUAGE_SWITCH = 204,
|
|
|
|
KEYCODE_MANNER_MODE = 205,
|
|
|
|
KEYCODE_3D_MODE = 206,
|
|
|
|
KEYCODE_CONTACTS = 207,
|
|
|
|
KEYCODE_CALENDAR = 208,
|
|
|
|
KEYCODE_MUSIC = 209,
|
|
|
|
KEYCODE_CALCULATOR = 210,
|
|
|
|
|
2010-06-04 00:56:36 +04:00
|
|
|
ACTION_DOWN = 0,
|
|
|
|
ACTION_UP = 1,
|
|
|
|
ACTION_MULTIPLE = 2,
|
|
|
|
META_ALT_ON = 0x00000002,
|
|
|
|
META_ALT_LEFT_ON = 0x00000010,
|
|
|
|
META_ALT_RIGHT_ON = 0x00000020,
|
2012-04-20 00:34:03 +04:00
|
|
|
META_ALT_MASK = META_ALT_RIGHT_ON | META_ALT_LEFT_ON | META_ALT_ON,
|
2010-06-04 00:56:36 +04:00
|
|
|
META_SHIFT_ON = 0x00000001,
|
|
|
|
META_SHIFT_LEFT_ON = 0x00000040,
|
|
|
|
META_SHIFT_RIGHT_ON = 0x00000080,
|
2012-04-20 00:34:03 +04:00
|
|
|
META_SHIFT_MASK = META_SHIFT_RIGHT_ON | META_SHIFT_LEFT_ON | META_SHIFT_ON,
|
2012-10-17 04:01:50 +04:00
|
|
|
META_CTRL_ON = 0x00001000,
|
|
|
|
META_CTRL_LEFT_ON = 0x00002000,
|
|
|
|
META_CTRL_RIGHT_ON = 0x00004000,
|
|
|
|
META_CTRL_MASK = META_CTRL_RIGHT_ON | META_CTRL_LEFT_ON | META_CTRL_ON,
|
|
|
|
META_META_ON = 0x00010000,
|
|
|
|
META_META_LEFT_ON = 0x00020000,
|
|
|
|
META_META_RIGHT_ON = 0x00040000,
|
|
|
|
META_META_MASK = META_META_RIGHT_ON | META_META_LEFT_ON | META_META_ON,
|
2010-06-04 00:56:36 +04:00
|
|
|
META_SYM_ON = 0x00000004,
|
|
|
|
FLAG_WOKE_HERE = 0x00000001,
|
|
|
|
FLAG_SOFT_KEYBOARD = 0x00000002,
|
|
|
|
FLAG_KEEP_TOUCH_MODE = 0x00000004,
|
|
|
|
FLAG_FROM_SYSTEM = 0x00000008,
|
|
|
|
FLAG_EDITOR_ACTION = 0x00000010,
|
|
|
|
FLAG_CANCELED = 0x00000020,
|
|
|
|
FLAG_VIRTUAL_HARD_KEY = 0x00000040,
|
|
|
|
FLAG_LONG_PRESS = 0x00000080,
|
|
|
|
FLAG_CANCELED_LONG_PRESS = 0x00000100,
|
|
|
|
FLAG_TRACKING = 0x00000200,
|
|
|
|
FLAG_START_TRACKING = 0x40000000,
|
|
|
|
dummy_java_enum_list_end
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
class AndroidMotionEvent
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
enum {
|
|
|
|
ACTION_MASK = 0xff,
|
|
|
|
ACTION_DOWN = 0,
|
|
|
|
ACTION_UP = 1,
|
|
|
|
ACTION_MOVE = 2,
|
|
|
|
ACTION_CANCEL = 3,
|
|
|
|
ACTION_OUTSIDE = 4,
|
|
|
|
ACTION_POINTER_DOWN = 5,
|
|
|
|
ACTION_POINTER_UP = 6,
|
2012-06-16 02:34:22 +04:00
|
|
|
ACTION_HOVER_MOVE = 7,
|
|
|
|
ACTION_HOVER_ENTER = 9,
|
|
|
|
ACTION_HOVER_EXIT = 10,
|
2012-10-03 00:18:21 +04:00
|
|
|
ACTION_MAGNIFY_START = 11,
|
|
|
|
ACTION_MAGNIFY = 12,
|
|
|
|
ACTION_MAGNIFY_END = 13,
|
2010-06-04 00:56:36 +04:00
|
|
|
ACTION_POINTER_ID_MASK = 0xff00,
|
|
|
|
ACTION_POINTER_ID_SHIFT = 8,
|
|
|
|
EDGE_TOP = 0x00000001,
|
|
|
|
EDGE_BOTTOM = 0x00000002,
|
|
|
|
EDGE_LEFT = 0x00000004,
|
|
|
|
EDGE_RIGHT = 0x00000008,
|
|
|
|
SAMPLE_X = 0,
|
|
|
|
SAMPLE_Y = 1,
|
|
|
|
SAMPLE_PRESSURE = 2,
|
|
|
|
SAMPLE_SIZE = 3,
|
|
|
|
NUM_SAMPLE_DATA = 4,
|
|
|
|
dummy_java_enum_list_end
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2010-06-05 01:14:43 +04:00
|
|
|
class AndroidLocation : public WrappedJavaObject
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
static void InitLocationClass(JNIEnv *jEnv);
|
|
|
|
static nsGeoPosition* CreateGeoPosition(JNIEnv *jenv, jobject jobj);
|
|
|
|
static jclass jLocationClass;
|
|
|
|
static jmethodID jGetLatitudeMethod;
|
|
|
|
static jmethodID jGetLongitudeMethod;
|
|
|
|
static jmethodID jGetAltitudeMethod;
|
|
|
|
static jmethodID jGetAccuracyMethod;
|
|
|
|
static jmethodID jGetBearingMethod;
|
|
|
|
static jmethodID jGetSpeedMethod;
|
|
|
|
static jmethodID jGetTimeMethod;
|
|
|
|
};
|
|
|
|
|
2010-06-04 00:56:36 +04:00
|
|
|
class AndroidGeckoEvent : public WrappedJavaObject
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
static void InitGeckoEventClass(JNIEnv *jEnv);
|
|
|
|
|
|
|
|
AndroidGeckoEvent() { }
|
|
|
|
AndroidGeckoEvent(int aType) {
|
|
|
|
Init(aType);
|
|
|
|
}
|
2012-12-05 20:09:56 +04:00
|
|
|
AndroidGeckoEvent(int aType, int aAction) {
|
|
|
|
Init(aType, aAction);
|
|
|
|
}
|
2011-01-19 03:25:20 +03:00
|
|
|
AndroidGeckoEvent(int x1, int y1, int x2, int y2) {
|
|
|
|
Init(x1, y1, x2, y2);
|
2010-06-04 00:56:36 +04:00
|
|
|
}
|
2011-11-15 07:12:14 +04:00
|
|
|
AndroidGeckoEvent(int aType, const nsIntRect &aRect) {
|
|
|
|
Init(aType, aRect);
|
|
|
|
}
|
2010-06-04 00:56:36 +04:00
|
|
|
AndroidGeckoEvent(JNIEnv *jenv, jobject jobj) {
|
|
|
|
Init(jenv, jobj);
|
|
|
|
}
|
2011-08-09 20:08:19 +04:00
|
|
|
AndroidGeckoEvent(AndroidGeckoEvent *aResizeEvent) {
|
|
|
|
Init(aResizeEvent);
|
|
|
|
}
|
2010-06-04 00:56:36 +04:00
|
|
|
|
|
|
|
void Init(JNIEnv *jenv, jobject jobj);
|
|
|
|
void Init(int aType);
|
2012-12-05 20:09:56 +04:00
|
|
|
void Init(int aType, int aAction);
|
2011-01-19 03:25:20 +03:00
|
|
|
void Init(int x1, int y1, int x2, int y2);
|
2011-11-15 07:12:14 +04:00
|
|
|
void Init(int aType, const nsIntRect &aRect);
|
2011-08-09 20:08:19 +04:00
|
|
|
void Init(AndroidGeckoEvent *aResizeEvent);
|
2010-06-04 00:56:36 +04:00
|
|
|
|
|
|
|
int Action() { return mAction; }
|
|
|
|
int Type() { return mType; }
|
|
|
|
int64_t Time() { return mTime; }
|
2012-11-29 20:14:14 +04:00
|
|
|
const nsTArray<nsIntPoint>& Points() { return mPoints; }
|
|
|
|
const nsTArray<int>& PointIndicies() { return mPointIndicies; }
|
|
|
|
const nsTArray<float>& Pressures() { return mPressures; }
|
|
|
|
const nsTArray<float>& Orientations() { return mOrientations; }
|
|
|
|
const nsTArray<nsIntPoint>& PointRadii() { return mPointRadii; }
|
2011-06-20 09:36:17 +04:00
|
|
|
double X() { return mX; }
|
|
|
|
double Y() { return mY; }
|
|
|
|
double Z() { return mZ; }
|
2010-06-04 00:56:36 +04:00
|
|
|
const nsIntRect& Rect() { return mRect; }
|
|
|
|
nsAString& Characters() { return mCharacters; }
|
2011-11-15 07:12:14 +04:00
|
|
|
nsAString& CharactersExtra() { return mCharactersExtra; }
|
2010-06-04 00:56:36 +04:00
|
|
|
int KeyCode() { return mKeyCode; }
|
|
|
|
int MetaState() { return mMetaState; }
|
2012-09-13 04:48:29 +04:00
|
|
|
int DomKeyLocation() { return mDomKeyLocation; }
|
2012-04-20 00:34:03 +04:00
|
|
|
bool IsAltPressed() const { return (mMetaState & AndroidKeyEvent::META_ALT_MASK) != 0; }
|
|
|
|
bool IsShiftPressed() const { return (mMetaState & AndroidKeyEvent::META_SHIFT_MASK) != 0; }
|
2012-10-17 04:01:50 +04:00
|
|
|
bool IsCtrlPressed() const { return (mMetaState & AndroidKeyEvent::META_CTRL_MASK) != 0; }
|
|
|
|
bool IsMetaPressed() const { return (mMetaState & AndroidKeyEvent::META_META_MASK) != 0; }
|
2010-06-04 00:56:36 +04:00
|
|
|
int Flags() { return mFlags; }
|
|
|
|
int UnicodeChar() { return mUnicodeChar; }
|
2012-04-20 00:55:33 +04:00
|
|
|
int RepeatCount() const { return mRepeatCount; }
|
2010-06-04 00:56:36 +04:00
|
|
|
int Count() { return mCount; }
|
2012-11-02 00:11:02 +04:00
|
|
|
int Start() { return mStart; }
|
|
|
|
int End() { return mEnd; }
|
2012-01-25 04:31:33 +04:00
|
|
|
int PointerIndex() { return mPointerIndex; }
|
2010-08-04 23:47:26 +04:00
|
|
|
int RangeType() { return mRangeType; }
|
|
|
|
int RangeStyles() { return mRangeStyles; }
|
2012-12-06 23:35:59 +04:00
|
|
|
int RangeLineStyle() { return mRangeLineStyle; }
|
|
|
|
bool RangeBoldLine() { return mRangeBoldLine; }
|
2010-08-04 23:47:26 +04:00
|
|
|
int RangeForeColor() { return mRangeForeColor; }
|
|
|
|
int RangeBackColor() { return mRangeBackColor; }
|
2012-12-06 23:35:59 +04:00
|
|
|
int RangeLineColor() { return mRangeLineColor; }
|
2010-06-05 01:14:43 +04:00
|
|
|
nsGeoPosition* GeoPosition() { return mGeoPosition; }
|
2012-01-17 22:40:39 +04:00
|
|
|
double Bandwidth() { return mBandwidth; }
|
|
|
|
bool CanBeMetered() { return mCanBeMetered; }
|
2012-03-20 17:09:45 +04:00
|
|
|
short ScreenOrientation() { return mScreenOrientation; }
|
2012-06-14 20:08:51 +04:00
|
|
|
RefCountedJavaObject* ByteBuffer() { return mByteBuffer; }
|
2010-06-04 00:56:36 +04:00
|
|
|
|
|
|
|
protected:
|
|
|
|
int mAction;
|
|
|
|
int mType;
|
|
|
|
int64_t mTime;
|
2012-01-25 04:31:33 +04:00
|
|
|
nsTArray<nsIntPoint> mPoints;
|
|
|
|
nsTArray<nsIntPoint> mPointRadii;
|
|
|
|
nsTArray<int> mPointIndicies;
|
|
|
|
nsTArray<float> mOrientations;
|
|
|
|
nsTArray<float> mPressures;
|
2010-06-04 00:56:36 +04:00
|
|
|
nsIntRect mRect;
|
|
|
|
int mFlags, mMetaState;
|
2012-09-13 04:48:29 +04:00
|
|
|
int mDomKeyLocation;
|
2010-06-04 00:56:36 +04:00
|
|
|
int mKeyCode, mUnicodeChar;
|
2012-04-20 00:55:33 +04:00
|
|
|
int mRepeatCount;
|
2012-11-02 00:11:02 +04:00
|
|
|
int mCount;
|
|
|
|
int mStart, mEnd;
|
2012-12-06 23:35:59 +04:00
|
|
|
int mRangeType, mRangeStyles, mRangeLineStyle;
|
|
|
|
bool mRangeBoldLine;
|
|
|
|
int mRangeForeColor, mRangeBackColor, mRangeLineColor;
|
2011-06-20 09:36:17 +04:00
|
|
|
double mX, mY, mZ;
|
2012-01-25 04:31:33 +04:00
|
|
|
int mPointerIndex;
|
2011-11-15 07:12:14 +04:00
|
|
|
nsString mCharacters, mCharactersExtra;
|
2010-06-05 01:14:43 +04:00
|
|
|
nsRefPtr<nsGeoPosition> mGeoPosition;
|
2012-01-17 22:40:39 +04:00
|
|
|
double mBandwidth;
|
|
|
|
bool mCanBeMetered;
|
2012-03-20 17:09:45 +04:00
|
|
|
short mScreenOrientation;
|
2012-06-14 20:08:51 +04:00
|
|
|
nsRefPtr<RefCountedJavaObject> mByteBuffer;
|
2010-06-04 00:56:36 +04:00
|
|
|
|
2012-01-25 04:31:33 +04:00
|
|
|
void ReadIntArray(nsTArray<int> &aVals,
|
|
|
|
JNIEnv *jenv,
|
|
|
|
jfieldID field,
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t count);
|
2012-01-25 04:31:33 +04:00
|
|
|
void ReadFloatArray(nsTArray<float> &aVals,
|
|
|
|
JNIEnv *jenv,
|
|
|
|
jfieldID field,
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t count);
|
2012-01-25 04:31:33 +04:00
|
|
|
void ReadPointArray(nsTArray<nsIntPoint> &mPoints,
|
|
|
|
JNIEnv *jenv,
|
|
|
|
jfieldID field,
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t count);
|
2010-06-04 00:56:36 +04:00
|
|
|
void ReadRectField(JNIEnv *jenv);
|
|
|
|
void ReadCharactersField(JNIEnv *jenv);
|
2011-11-15 07:12:14 +04:00
|
|
|
void ReadCharactersExtraField(JNIEnv *jenv);
|
2010-06-04 00:56:36 +04:00
|
|
|
|
|
|
|
static jclass jGeckoEventClass;
|
|
|
|
static jfieldID jActionField;
|
|
|
|
static jfieldID jTypeField;
|
|
|
|
static jfieldID jTimeField;
|
2012-01-25 04:31:33 +04:00
|
|
|
static jfieldID jPoints;
|
|
|
|
static jfieldID jPointIndicies;
|
|
|
|
static jfieldID jOrientations;
|
|
|
|
static jfieldID jPressures;
|
|
|
|
static jfieldID jPointRadii;
|
2011-06-20 09:36:17 +04:00
|
|
|
static jfieldID jXField;
|
|
|
|
static jfieldID jYField;
|
|
|
|
static jfieldID jZField;
|
2011-10-29 14:35:29 +04:00
|
|
|
static jfieldID jDistanceField;
|
2010-06-04 00:56:36 +04:00
|
|
|
static jfieldID jRectField;
|
|
|
|
static jfieldID jNativeWindowField;
|
|
|
|
|
|
|
|
static jfieldID jCharactersField;
|
2011-11-15 07:12:14 +04:00
|
|
|
static jfieldID jCharactersExtraField;
|
2010-06-04 00:56:36 +04:00
|
|
|
static jfieldID jKeyCodeField;
|
|
|
|
static jfieldID jMetaStateField;
|
2012-09-13 04:48:29 +04:00
|
|
|
static jfieldID jDomKeyLocationField;
|
2010-06-04 00:56:36 +04:00
|
|
|
static jfieldID jFlagsField;
|
|
|
|
static jfieldID jCountField;
|
2012-11-02 00:11:02 +04:00
|
|
|
static jfieldID jStartField;
|
|
|
|
static jfieldID jEndField;
|
2012-01-25 04:31:33 +04:00
|
|
|
static jfieldID jPointerIndexField;
|
2010-06-04 00:56:36 +04:00
|
|
|
static jfieldID jUnicodeCharField;
|
2012-04-20 00:55:33 +04:00
|
|
|
static jfieldID jRepeatCountField;
|
2010-08-04 23:47:26 +04:00
|
|
|
static jfieldID jRangeTypeField;
|
|
|
|
static jfieldID jRangeStylesField;
|
2012-12-06 23:35:59 +04:00
|
|
|
static jfieldID jRangeLineStyleField;
|
|
|
|
static jfieldID jRangeBoldLineField;
|
2010-08-04 23:47:26 +04:00
|
|
|
static jfieldID jRangeForeColorField;
|
|
|
|
static jfieldID jRangeBackColorField;
|
2012-12-06 23:35:59 +04:00
|
|
|
static jfieldID jRangeLineColorField;
|
2010-06-05 01:14:43 +04:00
|
|
|
static jfieldID jLocationField;
|
2010-06-04 00:56:36 +04:00
|
|
|
|
2012-01-17 22:40:39 +04:00
|
|
|
static jfieldID jBandwidthField;
|
|
|
|
static jfieldID jCanBeMeteredField;
|
|
|
|
|
2012-03-20 17:09:45 +04:00
|
|
|
static jfieldID jScreenOrientationField;
|
2012-06-14 20:08:51 +04:00
|
|
|
static jfieldID jByteBufferField;
|
2012-03-20 17:09:45 +04:00
|
|
|
|
2010-06-04 00:56:36 +04:00
|
|
|
public:
|
|
|
|
enum {
|
|
|
|
NATIVE_POKE = 0,
|
|
|
|
KEY_EVENT = 1,
|
|
|
|
MOTION_EVENT = 2,
|
2012-03-14 03:57:51 +04:00
|
|
|
SENSOR_EVENT = 3,
|
2012-03-21 03:59:24 +04:00
|
|
|
LOCATION_EVENT = 5,
|
|
|
|
IME_EVENT = 6,
|
|
|
|
DRAW = 7,
|
|
|
|
SIZE_CHANGED = 8,
|
|
|
|
ACTIVITY_STOPPING = 9,
|
|
|
|
ACTIVITY_PAUSING = 10,
|
|
|
|
ACTIVITY_SHUTDOWN = 11,
|
|
|
|
LOAD_URI = 12,
|
2013-01-17 23:16:14 +04:00
|
|
|
SURFACE_CREATED = 13, // used by XUL fennec only
|
|
|
|
SURFACE_DESTROYED = 14, // used by XUL fennec only
|
2012-03-21 03:59:24 +04:00
|
|
|
GECKO_EVENT_SYNC = 15,
|
2013-01-17 23:16:14 +04:00
|
|
|
FORCED_RESIZE = 16, // used internally in nsAppShell/nsWindow
|
2012-03-21 03:59:24 +04:00
|
|
|
ACTIVITY_START = 17,
|
|
|
|
BROADCAST = 19,
|
|
|
|
VIEWPORT = 20,
|
|
|
|
VISITED = 21,
|
|
|
|
NETWORK_CHANGED = 22,
|
|
|
|
ACTIVITY_RESUMING = 24,
|
2012-12-15 19:43:52 +04:00
|
|
|
THUMBNAIL = 25,
|
2012-03-21 03:59:24 +04:00
|
|
|
SCREENORIENTATION_CHANGED = 27,
|
2012-03-29 02:00:32 +04:00
|
|
|
COMPOSITOR_PAUSE = 28,
|
|
|
|
COMPOSITOR_RESUME = 29,
|
2012-12-15 19:43:52 +04:00
|
|
|
NATIVE_GESTURE_EVENT = 30,
|
2010-06-04 00:56:36 +04:00
|
|
|
dummy_java_enum_list_end
|
|
|
|
};
|
|
|
|
|
|
|
|
enum {
|
2012-11-02 00:11:02 +04:00
|
|
|
IME_SYNCHRONIZE = 0,
|
|
|
|
IME_REPLACE_TEXT = 1,
|
|
|
|
IME_SET_SELECTION = 2,
|
|
|
|
IME_ADD_COMPOSITION_RANGE = 3,
|
|
|
|
IME_UPDATE_COMPOSITION = 4,
|
2012-11-14 02:27:19 +04:00
|
|
|
IME_REMOVE_COMPOSITION = 5,
|
2012-12-05 20:09:56 +04:00
|
|
|
IME_ACKNOWLEDGE_FOCUS = 6,
|
2013-03-05 19:24:35 +04:00
|
|
|
IME_FLUSH_CHANGES = 7,
|
|
|
|
IME_UPDATE_CONTEXT = 8
|
2010-06-04 00:56:36 +04:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2010-06-14 23:04:16 +04:00
|
|
|
class nsJNIString : public nsString
|
|
|
|
{
|
|
|
|
public:
|
2012-04-17 02:31:05 +04:00
|
|
|
nsJNIString(jstring jstr, JNIEnv *jenv);
|
2010-06-14 23:04:16 +04:00
|
|
|
};
|
|
|
|
|
2010-06-04 00:56:36 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|