public static GeckoEvent createSizeChangedEvent(int w, int h, int screenw, int screenh) { GeckoEvent event = new GeckoEvent(SIZE_CHANGED); event.mPoints = new Point[2]; event.mPoints[0] = new Point(w, h); event.mPoints[1] = new Point(screenw, screenh); return event; }
public static GeckoEvent createScreenshotEvent( int tabId, int sx, int sy, int sw, int sh, int dx, int dy, int dw, int dh, int bw, int bh, int token, ByteBuffer buffer) { GeckoEvent event = new GeckoEvent(SCREENSHOT); event.mPoints = new Point[5]; event.mPoints[0] = new Point(sx, sy); event.mPoints[1] = new Point(sw, sh); event.mPoints[2] = new Point(dx, dy); event.mPoints[3] = new Point(dw, dh); event.mPoints[4] = new Point(bw, bh); event.mMetaState = tabId; event.mFlags = token; event.mBuffer = buffer; return event; }
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; }