コード例 #1
0
  public static GeckoEvent createNativeGestureEvent(int action, PointF pt, double size) {
    GeckoEvent event = new GeckoEvent(NATIVE_GESTURE_EVENT);
    event.mAction = action;
    event.mCount = 1;
    event.mPoints = new Point[1];

    PointF geckoPoint = new PointF(pt.x, pt.y);
    geckoPoint = GeckoApp.mAppContext.getLayerView().convertViewPointToLayerPoint(geckoPoint);

    if (geckoPoint == null) {
      // This could happen if Gecko isn't ready yet.
      return null;
    }

    event.mPoints[0] = new Point(Math.round(geckoPoint.x), Math.round(geckoPoint.y));

    event.mX = size;
    event.mTime = System.currentTimeMillis();
    return event;
  }