зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1422137 - Rename NativePanZoomController to PanZoomController r=rbarker
MozReview-Commit-ID: DUdekq4OV2e
This commit is contained in:
Родитель
afb1f64a02
Коммит
10d9e4b988
|
@ -9,8 +9,6 @@ import org.mozilla.gecko.annotation.WrapForJNI;
|
|||
import org.mozilla.gecko.mozglue.JNIObject;
|
||||
import org.mozilla.gecko.util.ThreadUtils;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Matrix;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.RectF;
|
||||
|
@ -79,7 +77,7 @@ public class LayerSession {
|
|||
@Override protected native void disposeNative();
|
||||
|
||||
@WrapForJNI(calledFrom = "any", dispatchTo = "gecko")
|
||||
public native void attachNPZC(NativePanZoomController npzc);
|
||||
public native void attachNPZC(PanZoomController npzc);
|
||||
|
||||
@WrapForJNI(calledFrom = "ui", dispatchTo = "gecko")
|
||||
public native void onBoundsChanged(int left, int top, int width, int height);
|
||||
|
@ -159,7 +157,7 @@ public class LayerSession {
|
|||
|
||||
// All fields are accessed on UI thread only.
|
||||
private final GeckoDisplay mDisplay = new GeckoDisplay(this);
|
||||
private NativePanZoomController mNPZC;
|
||||
private PanZoomController mNPZC;
|
||||
private OverscrollEdgeEffect mOverscroll;
|
||||
private DynamicToolbarAnimator mToolbar;
|
||||
private CompositorController mController;
|
||||
|
@ -188,15 +186,15 @@ public class LayerSession {
|
|||
}
|
||||
|
||||
/**
|
||||
* Get the NativePanZoomController instance for this session.
|
||||
* Get the PanZoomController instance for this session.
|
||||
*
|
||||
* @return NativePanZoomController instance.
|
||||
* @return PanZoomController instance.
|
||||
*/
|
||||
public NativePanZoomController getPanZoomController() {
|
||||
public PanZoomController getPanZoomController() {
|
||||
ThreadUtils.assertOnUiThread();
|
||||
|
||||
if (mNPZC == null) {
|
||||
mNPZC = new NativePanZoomController(this);
|
||||
mNPZC = new PanZoomController(this);
|
||||
if (mAttachedCompositor) {
|
||||
mCompositor.attachNPZC(mNPZC);
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ import android.view.InputDevice;
|
|||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public final class NativePanZoomController extends JNIObject {
|
||||
public final class PanZoomController extends JNIObject {
|
||||
private static final String LOGTAG = "GeckoNPZC";
|
||||
private static final int EVENT_SOURCE_SCROLL = 0;
|
||||
private static final int EVENT_SOURCE_MOTION = 1;
|
||||
|
@ -149,7 +149,7 @@ public final class NativePanZoomController extends JNIObject {
|
|||
event.getMetaState(), x, y, event.getButtonState());
|
||||
}
|
||||
|
||||
/* package */ NativePanZoomController(final LayerSession session) {
|
||||
/* package */ PanZoomController(final LayerSession session) {
|
||||
mSession = session;
|
||||
enableEventQueue();
|
||||
}
|
|
@ -9,7 +9,7 @@ package org.mozilla.geckoview;
|
|||
import org.mozilla.gecko.AndroidGamepadManager;
|
||||
import org.mozilla.gecko.EventDispatcher;
|
||||
import org.mozilla.gecko.gfx.DynamicToolbarAnimator;
|
||||
import org.mozilla.gecko.gfx.NativePanZoomController;
|
||||
import org.mozilla.gecko.gfx.PanZoomController;
|
||||
import org.mozilla.gecko.gfx.GeckoDisplay;
|
||||
import org.mozilla.gecko.InputMethods;
|
||||
|
||||
|
@ -259,7 +259,7 @@ public class GeckoView extends FrameLayout {
|
|||
return mSession.getSettings();
|
||||
}
|
||||
|
||||
public NativePanZoomController getPanZoomController() {
|
||||
public PanZoomController getPanZoomController() {
|
||||
return mSession.getPanZoomController();
|
||||
}
|
||||
|
||||
|
|
|
@ -444,33 +444,33 @@ const JNINativeMethod LayerSession::Compositor::Natives<Impl>::methods[] = {
|
|||
};
|
||||
|
||||
template<class Impl>
|
||||
class NativePanZoomController::Natives : public mozilla::jni::NativeImpl<NativePanZoomController, Impl>
|
||||
class PanZoomController::Natives : public mozilla::jni::NativeImpl<PanZoomController, Impl>
|
||||
{
|
||||
public:
|
||||
static const JNINativeMethod methods[5];
|
||||
};
|
||||
|
||||
template<class Impl>
|
||||
const JNINativeMethod NativePanZoomController::Natives<Impl>::methods[] = {
|
||||
const JNINativeMethod PanZoomController::Natives<Impl>::methods[] = {
|
||||
|
||||
mozilla::jni::MakeNativeMethod<NativePanZoomController::DisposeNative_t>(
|
||||
mozilla::jni::NativeStub<NativePanZoomController::DisposeNative_t, Impl>
|
||||
mozilla::jni::MakeNativeMethod<PanZoomController::DisposeNative_t>(
|
||||
mozilla::jni::NativeStub<PanZoomController::DisposeNative_t, Impl>
|
||||
::template Wrap<&Impl::DisposeNative>),
|
||||
|
||||
mozilla::jni::MakeNativeMethod<NativePanZoomController::HandleMotionEvent_t>(
|
||||
mozilla::jni::NativeStub<NativePanZoomController::HandleMotionEvent_t, Impl>
|
||||
mozilla::jni::MakeNativeMethod<PanZoomController::HandleMotionEvent_t>(
|
||||
mozilla::jni::NativeStub<PanZoomController::HandleMotionEvent_t, Impl>
|
||||
::template Wrap<&Impl::HandleMotionEvent>),
|
||||
|
||||
mozilla::jni::MakeNativeMethod<NativePanZoomController::HandleMouseEvent_t>(
|
||||
mozilla::jni::NativeStub<NativePanZoomController::HandleMouseEvent_t, Impl>
|
||||
mozilla::jni::MakeNativeMethod<PanZoomController::HandleMouseEvent_t>(
|
||||
mozilla::jni::NativeStub<PanZoomController::HandleMouseEvent_t, Impl>
|
||||
::template Wrap<&Impl::HandleMouseEvent>),
|
||||
|
||||
mozilla::jni::MakeNativeMethod<NativePanZoomController::HandleScrollEvent_t>(
|
||||
mozilla::jni::NativeStub<NativePanZoomController::HandleScrollEvent_t, Impl>
|
||||
mozilla::jni::MakeNativeMethod<PanZoomController::HandleScrollEvent_t>(
|
||||
mozilla::jni::NativeStub<PanZoomController::HandleScrollEvent_t, Impl>
|
||||
::template Wrap<&Impl::HandleScrollEvent>),
|
||||
|
||||
mozilla::jni::MakeNativeMethod<NativePanZoomController::SetIsLongpressEnabled_t>(
|
||||
mozilla::jni::NativeStub<NativePanZoomController::SetIsLongpressEnabled_t, Impl>
|
||||
mozilla::jni::MakeNativeMethod<PanZoomController::SetIsLongpressEnabled_t>(
|
||||
mozilla::jni::NativeStub<PanZoomController::SetIsLongpressEnabled_t, Impl>
|
||||
::template Wrap<&Impl::SetIsLongpressEnabled>)
|
||||
};
|
||||
|
||||
|
|
|
@ -1345,46 +1345,46 @@ auto LayerSession::Compositor::UpdateRootFrameMetrics(float a0, float a1, float
|
|||
return mozilla::jni::Method<UpdateRootFrameMetrics_t>::Call(Compositor::mCtx, nullptr, a0, a1, a2);
|
||||
}
|
||||
|
||||
const char NativePanZoomController::name[] =
|
||||
"org/mozilla/gecko/gfx/NativePanZoomController";
|
||||
const char PanZoomController::name[] =
|
||||
"org/mozilla/gecko/gfx/PanZoomController";
|
||||
|
||||
constexpr char NativePanZoomController::DisposeNative_t::name[];
|
||||
constexpr char NativePanZoomController::DisposeNative_t::signature[];
|
||||
constexpr char PanZoomController::DisposeNative_t::name[];
|
||||
constexpr char PanZoomController::DisposeNative_t::signature[];
|
||||
|
||||
constexpr char NativePanZoomController::HandleMotionEvent_t::name[];
|
||||
constexpr char NativePanZoomController::HandleMotionEvent_t::signature[];
|
||||
constexpr char PanZoomController::HandleMotionEvent_t::name[];
|
||||
constexpr char PanZoomController::HandleMotionEvent_t::signature[];
|
||||
|
||||
constexpr char NativePanZoomController::HandleMouseEvent_t::name[];
|
||||
constexpr char NativePanZoomController::HandleMouseEvent_t::signature[];
|
||||
constexpr char PanZoomController::HandleMouseEvent_t::name[];
|
||||
constexpr char PanZoomController::HandleMouseEvent_t::signature[];
|
||||
|
||||
constexpr char NativePanZoomController::HandleScrollEvent_t::name[];
|
||||
constexpr char NativePanZoomController::HandleScrollEvent_t::signature[];
|
||||
constexpr char PanZoomController::HandleScrollEvent_t::name[];
|
||||
constexpr char PanZoomController::HandleScrollEvent_t::signature[];
|
||||
|
||||
constexpr char NativePanZoomController::SetIsLongpressEnabled_t::name[];
|
||||
constexpr char NativePanZoomController::SetIsLongpressEnabled_t::signature[];
|
||||
constexpr char PanZoomController::SetIsLongpressEnabled_t::name[];
|
||||
constexpr char PanZoomController::SetIsLongpressEnabled_t::signature[];
|
||||
|
||||
constexpr char NativePanZoomController::SetAttached_t::name[];
|
||||
constexpr char NativePanZoomController::SetAttached_t::signature[];
|
||||
constexpr char PanZoomController::SetAttached_t::name[];
|
||||
constexpr char PanZoomController::SetAttached_t::signature[];
|
||||
|
||||
auto NativePanZoomController::SetAttached(bool a0) const -> void
|
||||
auto PanZoomController::SetAttached(bool a0) const -> void
|
||||
{
|
||||
return mozilla::jni::Method<SetAttached_t>::Call(NativePanZoomController::mCtx, nullptr, a0);
|
||||
return mozilla::jni::Method<SetAttached_t>::Call(PanZoomController::mCtx, nullptr, a0);
|
||||
}
|
||||
|
||||
constexpr char NativePanZoomController::SynthesizeNativeMouseEvent_t::name[];
|
||||
constexpr char NativePanZoomController::SynthesizeNativeMouseEvent_t::signature[];
|
||||
constexpr char PanZoomController::SynthesizeNativeMouseEvent_t::name[];
|
||||
constexpr char PanZoomController::SynthesizeNativeMouseEvent_t::signature[];
|
||||
|
||||
auto NativePanZoomController::SynthesizeNativeMouseEvent(int32_t a0, int32_t a1, int32_t a2) const -> void
|
||||
auto PanZoomController::SynthesizeNativeMouseEvent(int32_t a0, int32_t a1, int32_t a2) const -> void
|
||||
{
|
||||
return mozilla::jni::Method<SynthesizeNativeMouseEvent_t>::Call(NativePanZoomController::mCtx, nullptr, a0, a1, a2);
|
||||
return mozilla::jni::Method<SynthesizeNativeMouseEvent_t>::Call(PanZoomController::mCtx, nullptr, a0, a1, a2);
|
||||
}
|
||||
|
||||
constexpr char NativePanZoomController::SynthesizeNativeTouchPoint_t::name[];
|
||||
constexpr char NativePanZoomController::SynthesizeNativeTouchPoint_t::signature[];
|
||||
constexpr char PanZoomController::SynthesizeNativeTouchPoint_t::name[];
|
||||
constexpr char PanZoomController::SynthesizeNativeTouchPoint_t::signature[];
|
||||
|
||||
auto NativePanZoomController::SynthesizeNativeTouchPoint(int32_t a0, int32_t a1, int32_t a2, int32_t a3, double a4, int32_t a5) const -> void
|
||||
auto PanZoomController::SynthesizeNativeTouchPoint(int32_t a0, int32_t a1, int32_t a2, int32_t a3, double a4, int32_t a5) const -> void
|
||||
{
|
||||
return mozilla::jni::Method<SynthesizeNativeTouchPoint_t>::Call(NativePanZoomController::mCtx, nullptr, a0, a1, a2, a3, a4, a5);
|
||||
return mozilla::jni::Method<SynthesizeNativeTouchPoint_t>::Call(PanZoomController::mCtx, nullptr, a0, a1, a2, a3, a4, a5);
|
||||
}
|
||||
|
||||
const char StackScroller::name[] =
|
||||
|
|
|
@ -3751,7 +3751,7 @@ public:
|
|||
mozilla::jni::Object::Param> Args;
|
||||
static constexpr char name[] = "attachNPZC";
|
||||
static constexpr char signature[] =
|
||||
"(Lorg/mozilla/gecko/gfx/NativePanZoomController;)V";
|
||||
"(Lorg/mozilla/gecko/gfx/PanZoomController;)V";
|
||||
static const bool isStatic = false;
|
||||
static const mozilla::jni::ExceptionMode exceptionMode =
|
||||
mozilla::jni::ExceptionMode::ABORT;
|
||||
|
@ -4154,15 +4154,15 @@ public:
|
|||
template<class Impl> class Natives;
|
||||
};
|
||||
|
||||
class NativePanZoomController : public mozilla::jni::ObjectBase<NativePanZoomController>
|
||||
class PanZoomController : public mozilla::jni::ObjectBase<PanZoomController>
|
||||
{
|
||||
public:
|
||||
static const char name[];
|
||||
|
||||
explicit NativePanZoomController(const Context& ctx) : ObjectBase<NativePanZoomController>(ctx) {}
|
||||
explicit PanZoomController(const Context& ctx) : ObjectBase<PanZoomController>(ctx) {}
|
||||
|
||||
struct DisposeNative_t {
|
||||
typedef NativePanZoomController Owner;
|
||||
typedef PanZoomController Owner;
|
||||
typedef void ReturnType;
|
||||
typedef void SetterType;
|
||||
typedef mozilla::jni::Args<> Args;
|
||||
|
@ -4179,7 +4179,7 @@ public:
|
|||
};
|
||||
|
||||
struct HandleMotionEvent_t {
|
||||
typedef NativePanZoomController Owner;
|
||||
typedef PanZoomController Owner;
|
||||
typedef bool ReturnType;
|
||||
typedef bool SetterType;
|
||||
typedef mozilla::jni::Args<
|
||||
|
@ -4207,7 +4207,7 @@ public:
|
|||
};
|
||||
|
||||
struct HandleMouseEvent_t {
|
||||
typedef NativePanZoomController Owner;
|
||||
typedef PanZoomController Owner;
|
||||
typedef bool ReturnType;
|
||||
typedef bool SetterType;
|
||||
typedef mozilla::jni::Args<
|
||||
|
@ -4230,7 +4230,7 @@ public:
|
|||
};
|
||||
|
||||
struct HandleScrollEvent_t {
|
||||
typedef NativePanZoomController Owner;
|
||||
typedef PanZoomController Owner;
|
||||
typedef bool ReturnType;
|
||||
typedef bool SetterType;
|
||||
typedef mozilla::jni::Args<
|
||||
|
@ -4253,7 +4253,7 @@ public:
|
|||
};
|
||||
|
||||
struct SetIsLongpressEnabled_t {
|
||||
typedef NativePanZoomController Owner;
|
||||
typedef PanZoomController Owner;
|
||||
typedef void ReturnType;
|
||||
typedef void SetterType;
|
||||
typedef mozilla::jni::Args<
|
||||
|
@ -4271,7 +4271,7 @@ public:
|
|||
};
|
||||
|
||||
struct SetAttached_t {
|
||||
typedef NativePanZoomController Owner;
|
||||
typedef PanZoomController Owner;
|
||||
typedef void ReturnType;
|
||||
typedef void SetterType;
|
||||
typedef mozilla::jni::Args<
|
||||
|
@ -4291,7 +4291,7 @@ public:
|
|||
auto SetAttached(bool) const -> void;
|
||||
|
||||
struct SynthesizeNativeMouseEvent_t {
|
||||
typedef NativePanZoomController Owner;
|
||||
typedef PanZoomController Owner;
|
||||
typedef void ReturnType;
|
||||
typedef void SetterType;
|
||||
typedef mozilla::jni::Args<
|
||||
|
@ -4313,7 +4313,7 @@ public:
|
|||
auto SynthesizeNativeMouseEvent(int32_t, int32_t, int32_t) const -> void;
|
||||
|
||||
struct SynthesizeNativeTouchPoint_t {
|
||||
typedef NativePanZoomController Owner;
|
||||
typedef PanZoomController Owner;
|
||||
typedef void ReturnType;
|
||||
typedef void SetterType;
|
||||
typedef mozilla::jni::Args<
|
||||
|
|
|
@ -307,24 +307,24 @@ public:
|
|||
};
|
||||
|
||||
/**
|
||||
* NativePanZoomController handles its native calls on the UI thread, so make
|
||||
* PanZoomController handles its native calls on the UI thread, so make
|
||||
* it separate from GeckoViewSupport.
|
||||
*/
|
||||
class nsWindow::NPZCSupport final
|
||||
: public NativePanZoomController::Natives<NPZCSupport>
|
||||
: public PanZoomController::Natives<NPZCSupport>
|
||||
{
|
||||
using LockedWindowPtr = WindowPtr<NPZCSupport>::Locked;
|
||||
|
||||
static bool sNegateWheelScroll;
|
||||
|
||||
WindowPtr<NPZCSupport> mWindow;
|
||||
NativePanZoomController::GlobalRef mNPZC;
|
||||
PanZoomController::GlobalRef mNPZC;
|
||||
int mPreviousButtons;
|
||||
|
||||
template<typename Lambda>
|
||||
class InputEvent final : public nsAppShell::Event
|
||||
{
|
||||
NativePanZoomController::GlobalRef mNPZC;
|
||||
PanZoomController::GlobalRef mNPZC;
|
||||
Lambda mLambda;
|
||||
|
||||
public:
|
||||
|
@ -339,7 +339,7 @@ class nsWindow::NPZCSupport final
|
|||
|
||||
JNIEnv* const env = jni::GetGeckoThreadEnv();
|
||||
NPZCSupport* npzcSupport = GetNative(
|
||||
NativePanZoomController::LocalRef(env, mNPZC));
|
||||
PanZoomController::LocalRef(env, mNPZC));
|
||||
|
||||
if (!npzcSupport || !npzcSupport->mWindow) {
|
||||
// We already shut down.
|
||||
|
@ -367,10 +367,10 @@ class nsWindow::NPZCSupport final
|
|||
}
|
||||
|
||||
public:
|
||||
typedef NativePanZoomController::Natives<NPZCSupport> Base;
|
||||
typedef PanZoomController::Natives<NPZCSupport> Base;
|
||||
|
||||
NPZCSupport(NativePtr<NPZCSupport>* aPtr, nsWindow* aWindow,
|
||||
const NativePanZoomController::LocalRef& aNPZC)
|
||||
const PanZoomController::LocalRef& aNPZC)
|
||||
: mWindow(aPtr, aWindow)
|
||||
, mNPZC(aNPZC)
|
||||
, mPreviousButtons(0)
|
||||
|
@ -425,12 +425,12 @@ public:
|
|||
// release mWindow until the UI thread is done using it, thus avoiding
|
||||
// the race condition.
|
||||
|
||||
typedef NativePanZoomController::GlobalRef NPZCRef;
|
||||
typedef PanZoomController::GlobalRef NPZCRef;
|
||||
auto callDestroy = [] (const NPZCRef& npzc) {
|
||||
npzc->SetAttached(false);
|
||||
};
|
||||
|
||||
NativePanZoomController::GlobalRef npzc = mNPZC;
|
||||
PanZoomController::GlobalRef npzc = mNPZC;
|
||||
RefPtr<nsThread> uiThread = GetAndroidUiThread();
|
||||
if (!uiThread) {
|
||||
return;
|
||||
|
@ -441,7 +441,7 @@ public:
|
|||
mozilla::Move(npzc)), nsIThread::DISPATCH_NORMAL);
|
||||
}
|
||||
|
||||
const NativePanZoomController::Ref& GetJavaNPZC() const
|
||||
const PanZoomController::Ref& GetJavaNPZC() const
|
||||
{
|
||||
return mNPZC;
|
||||
}
|
||||
|
@ -621,7 +621,7 @@ public:
|
|||
return true;
|
||||
}
|
||||
|
||||
bool HandleMotionEvent(const NativePanZoomController::LocalRef& aInstance,
|
||||
bool HandleMotionEvent(const PanZoomController::LocalRef& aInstance,
|
||||
int32_t aAction, int32_t aActionIndex,
|
||||
int64_t aTime, int32_t aMetaState,
|
||||
jni::IntArray::Param aPointerId,
|
||||
|
@ -903,13 +903,13 @@ public:
|
|||
MOZ_ASSERT(aNPZC);
|
||||
MOZ_ASSERT(!mWindow->mNPZCSupport);
|
||||
|
||||
auto npzc = NativePanZoomController::LocalRef(
|
||||
auto npzc = PanZoomController::LocalRef(
|
||||
jni::GetGeckoThreadEnv(),
|
||||
NativePanZoomController::Ref::From(aNPZC));
|
||||
PanZoomController::Ref::From(aNPZC));
|
||||
mWindow->mNPZCSupport.Attach(npzc, mWindow, npzc);
|
||||
|
||||
DispatchToUiThread("LayerViewSupport::AttachNPZC",
|
||||
[npzc = NativePanZoomController::GlobalRef(npzc)] {
|
||||
[npzc = PanZoomController::GlobalRef(npzc)] {
|
||||
npzc->SetAttached(true);
|
||||
});
|
||||
}
|
||||
|
@ -2164,7 +2164,7 @@ nsWindow::SynthesizeNativeTouchPoint(uint32_t aPointerId,
|
|||
|
||||
DispatchToUiThread(
|
||||
"nsWindow::SynthesizeNativeTouchPoint",
|
||||
[npzc = NativePanZoomController::GlobalRef(npzc),
|
||||
[npzc = PanZoomController::GlobalRef(npzc),
|
||||
aPointerId, eventType, aPoint,
|
||||
aPointerPressure, aPointerOrientation] {
|
||||
npzc->SynthesizeNativeTouchPoint(aPointerId, eventType,
|
||||
|
@ -2191,7 +2191,7 @@ nsWindow::SynthesizeNativeMouseEvent(LayoutDeviceIntPoint aPoint,
|
|||
|
||||
DispatchToUiThread(
|
||||
"nsWindow::SynthesizeNativeMouseEvent",
|
||||
[npzc = NativePanZoomController::GlobalRef(npzc),
|
||||
[npzc = PanZoomController::GlobalRef(npzc),
|
||||
aNativeMessage, aPoint] {
|
||||
npzc->SynthesizeNativeMouseEvent(aNativeMessage,
|
||||
aPoint.x, aPoint.y);
|
||||
|
@ -2213,7 +2213,7 @@ nsWindow::SynthesizeNativeMouseMove(LayoutDeviceIntPoint aPoint,
|
|||
|
||||
DispatchToUiThread(
|
||||
"nsWindow::SynthesizeNativeMouseMove",
|
||||
[npzc = NativePanZoomController::GlobalRef(npzc), aPoint] {
|
||||
[npzc = PanZoomController::GlobalRef(npzc), aPoint] {
|
||||
npzc->SynthesizeNativeMouseEvent(sdk::MotionEvent::ACTION_HOVER_MOVE,
|
||||
aPoint.x, aPoint.y);
|
||||
});
|
||||
|
|
Загрузка…
Ссылка в новой задаче