Bug 839641 - Implement handling for APZC-reported gestures. r=Cwiiis
This commit is contained in:
@@ -34,6 +34,7 @@
|
|||||||
#include "nsIDOMClientRect.h"
|
#include "nsIDOMClientRect.h"
|
||||||
#include "StrongPointer.h"
|
#include "StrongPointer.h"
|
||||||
#include "mozilla/ClearOnShutdown.h"
|
#include "mozilla/ClearOnShutdown.h"
|
||||||
|
#include "nsPrintfCString.h"
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
#define ALOG_BRIDGE(args...) ALOG(args)
|
#define ALOG_BRIDGE(args...) ALOG(args)
|
||||||
@@ -2724,19 +2725,25 @@ AndroidBridge::RequestContentRepaint(const mozilla::layers::FrameMetrics& aFrame
|
|||||||
void
|
void
|
||||||
AndroidBridge::HandleDoubleTap(const nsIntPoint& aPoint)
|
AndroidBridge::HandleDoubleTap(const nsIntPoint& aPoint)
|
||||||
{
|
{
|
||||||
// FIXME implement this
|
nsCString data = nsPrintfCString("{ \"x\": %d, \"y\": %d }", aPoint.x, aPoint.y);
|
||||||
|
nsAppShell::gAppShell->PostEvent(AndroidGeckoEvent::MakeBroadcastEvent(
|
||||||
|
NS_LITERAL_CSTRING("Gesture:DoubleTap"), data));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AndroidBridge::HandleSingleTap(const nsIntPoint& aPoint)
|
AndroidBridge::HandleSingleTap(const nsIntPoint& aPoint)
|
||||||
{
|
{
|
||||||
// FIXME implement this
|
nsCString data = nsPrintfCString("{ \"x\": %d, \"y\": %d }", aPoint.x, aPoint.y);
|
||||||
|
nsAppShell::gAppShell->PostEvent(AndroidGeckoEvent::MakeBroadcastEvent(
|
||||||
|
NS_LITERAL_CSTRING("Gesture:SingleTap"), data));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AndroidBridge::HandleLongTap(const nsIntPoint& aPoint)
|
AndroidBridge::HandleLongTap(const nsIntPoint& aPoint)
|
||||||
{
|
{
|
||||||
// FIXME implement this
|
nsCString data = nsPrintfCString("{ \"x\": %d, \"y\": %d }", aPoint.x, aPoint.y);
|
||||||
|
nsAppShell::gAppShell->PostEvent(AndroidGeckoEvent::MakeBroadcastEvent(
|
||||||
|
NS_LITERAL_CSTRING("Gesture:LongPress"), data));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
@@ -516,6 +516,14 @@ public:
|
|||||||
return event;
|
return event;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static AndroidGeckoEvent* MakeBroadcastEvent(const nsCString& topic, const nsCString& data) {
|
||||||
|
AndroidGeckoEvent* event = new AndroidGeckoEvent();
|
||||||
|
event->Init(BROADCAST);
|
||||||
|
CopyUTF8toUTF16(topic, event->mCharacters);
|
||||||
|
CopyUTF8toUTF16(data, event->mCharactersExtra);
|
||||||
|
return event;
|
||||||
|
}
|
||||||
|
|
||||||
int Action() { return mAction; }
|
int Action() { return mAction; }
|
||||||
int Type() { return mType; }
|
int Type() { return mType; }
|
||||||
bool AckNeeded() { return mAckNeeded; }
|
bool AckNeeded() { return mAckNeeded; }
|
||||||
|
|||||||
Reference in New Issue
Block a user