OLD | NEW |
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 Loading... |
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, boolean button
Down) { |
| 209 if (!sConnected) { |
| 210 return; |
| 211 } |
| 212 |
| 213 mouseActionNative(x, y, whichButton, buttonDown); |
| 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,
boolean buttonDown); |
212 } | 224 } |
OLD | NEW |