@Override public void sendMouseEvent(int action, int button, int x, int y) { synchronized (mNativeLock) { if (mCallbackNativeHandle != 0 && (mMouseAction != action || mMouseButton != button || mMouseX != x || mMouseY != y)) nativeOnMouseEvent(mCallbackNativeHandle, action, button, x, y); mMouseAction = action; mMouseButton = button; mMouseX = x; mMouseY = y; } }
@Override public void sendMouseEvent(int action, int button, int x, int y) { synchronized (mNativeLock) { if (mCallbackNativeHandle != 0 && (mMouseAction != action || mMouseButton != button || mMouseX != x || mMouseY != y)) nativeOnMouseEvent(mCallbackNativeHandle, action, button, x, y); mMouseAction = action; mMouseButton = button; mMouseX = x; mMouseY = y; } }
@Override public void sendMouseEvent(int action, int button, int x, int y) { synchronized (mNativeLock) { if (mCallbackNativeHandle != 0 && (mMouseAction != action || mMouseButton != button || mMouseX != x || mMouseY != y)) nativeOnMouseEvent(mCallbackNativeHandle, action, button, x, y); mMouseAction = action; mMouseButton = button; mMouseX = x; mMouseY = y; } }
/** * Set a callback in order to receive {@link #nativeOnMouseEvent} and {@link #nativeOnWindowSize} events. * * @param nativeHandle native Handle passed by {@link #nativeOnMouseEvent} and {@link #nativeOnWindowSize}, cannot be NULL * @return true if callback was successfully registered */ @SuppressWarnings("unused") /* used by JNI */ private int registerNative(long nativeHandle) { if (nativeHandle == 0) throw new IllegalArgumentException("nativeHandle is null"); synchronized (mNativeLock) { if (mCallbackNativeHandle != 0) return AWINDOW_REGISTER_ERROR; mCallbackNativeHandle = nativeHandle; if (mMouseAction != -1) nativeOnMouseEvent(mCallbackNativeHandle, mMouseAction, mMouseButton, mMouseX, mMouseY); if (mWindowWidth != -1 && mWindowHeight != -1) nativeOnWindowSize(mCallbackNativeHandle, mWindowWidth, mWindowHeight); int flags = AWINDOW_REGISTER_FLAGS_SUCCESS; if (mOnNewVideoLayoutListener != null) flags |= AWINDOW_REGISTER_FLAGS_HAS_VIDEO_LAYOUT_LISTENER; return flags; } }
/** * Set a callback in order to receive {@link #nativeOnMouseEvent} and {@link #nativeOnWindowSize} events. * * @param nativeHandle native Handle passed by {@link #nativeOnMouseEvent} and {@link #nativeOnWindowSize}, cannot be NULL * @return true if callback was successfully registered */ @SuppressWarnings("unused") /* used by JNI */ private int registerNative(long nativeHandle) { if (nativeHandle == 0) throw new IllegalArgumentException("nativeHandle is null"); synchronized (mNativeLock) { if (mCallbackNativeHandle != 0) return AWINDOW_REGISTER_ERROR; mCallbackNativeHandle = nativeHandle; if (mMouseAction != -1) nativeOnMouseEvent(mCallbackNativeHandle, mMouseAction, mMouseButton, mMouseX, mMouseY); if (mWindowWidth != -1 && mWindowHeight != -1) nativeOnWindowSize(mCallbackNativeHandle, mWindowWidth, mWindowHeight); int flags = AWINDOW_REGISTER_FLAGS_SUCCESS; if (mOnNewVideoLayoutListener != null) flags |= AWINDOW_REGISTER_FLAGS_HAS_VIDEO_LAYOUT_LISTENER; return flags; } }
/** * Set a callback in order to receive {@link #nativeOnMouseEvent} and {@link #nativeOnWindowSize} events. * * @param nativeHandle native Handle passed by {@link #nativeOnMouseEvent} and {@link #nativeOnWindowSize}, cannot be NULL * @return true if callback was successfully registered */ @SuppressWarnings("unused") /* used by JNI */ private int registerNative(long nativeHandle) { if (nativeHandle == 0) throw new IllegalArgumentException("nativeHandle is null"); synchronized (mNativeLock) { if (mCallbackNativeHandle != 0) return AWINDOW_REGISTER_ERROR; mCallbackNativeHandle = nativeHandle; if (mMouseAction != -1) nativeOnMouseEvent(mCallbackNativeHandle, mMouseAction, mMouseButton, mMouseX, mMouseY); if (mWindowWidth != -1 && mWindowHeight != -1) nativeOnWindowSize(mCallbackNativeHandle, mWindowWidth, mWindowHeight); int flags = AWINDOW_REGISTER_FLAGS_SUCCESS; if (mOnNewVideoLayoutListener != null) flags |= AWINDOW_REGISTER_FLAGS_HAS_VIDEO_LAYOUT_LISTENER; return flags; } }