Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(393)

Side by Side Diff: remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java

Issue 19500017: Implement basic point-and-touch mouse input for Android client (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.chromoting.jni; 5 package org.chromium.chromoting.jni;
6 6
7 import android.app.Activity; 7 import android.app.Activity;
8 import android.app.AlertDialog; 8 import android.app.AlertDialog;
9 import android.content.Context; 9 import android.content.Context;
10 import android.content.DialogInterface; 10 import android.content.DialogInterface;
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 } 197 }
198 198
199 int[] frame = new int[sWidth * sHeight]; 199 int[] frame = new int[sWidth * sHeight];
200 200
201 sBuffer.order(ByteOrder.LITTLE_ENDIAN); 201 sBuffer.order(ByteOrder.LITTLE_ENDIAN);
202 sBuffer.asIntBuffer().get(frame, 0, frame.length); 202 sBuffer.asIntBuffer().get(frame, 0, frame.length);
203 203
204 return Bitmap.createBitmap(frame, 0, sWidth, sWidth, sHeight, Bitmap.Con fig.ARGB_8888); 204 return Bitmap.createBitmap(frame, 0, sWidth, sWidth, sHeight, Bitmap.Con fig.ARGB_8888);
205 } 205 }
206 206
207 /** Moves the mouse cursor, possibly while clicking. */
208 public static void mouseAction(int x, int y, int whichButton) {
209 if (!sConnected) {
210 return;
211 }
212
213 mouseActionNative(x, y, whichButton);
214 }
215
207 /** Performs the native response to the user's PIN. */ 216 /** Performs the native response to the user's PIN. */
208 private static native void authenticationResponse(String pin); 217 private static native void authenticationResponse(String pin);
209 218
210 /** Schedules a redraw on the native graphics thread. */ 219 /** Schedules a redraw on the native graphics thread. */
211 private static native void scheduleRedrawNative(); 220 private static native void scheduleRedrawNative();
221
222 /** Passes mouse information to the native handling code. */
223 private static native void mouseActionNative(int x, int y, int whichButton);
212 } 224 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698