Added 64bit support to API.
This commit is contained in:
parent
ea41084281
commit
0906483f1c
@ -27,7 +27,7 @@ import com.freerdp.freerdpcore.services.ManualBookmarkGateway;
|
||||
import com.freerdp.freerdpcore.services.QuickConnectHistoryGateway;
|
||||
|
||||
public class GlobalApp extends Application implements LibFreeRDP.EventListener {
|
||||
private static Map<Integer, SessionState> sessionMap;
|
||||
private static Map<Long, SessionState> sessionMap;
|
||||
|
||||
private static final String TAG = "GlobalApp";
|
||||
|
||||
@ -70,7 +70,7 @@ public class GlobalApp extends Application implements LibFreeRDP.EventListener {
|
||||
|
||||
|
||||
public GlobalApp() {
|
||||
sessionMap = Collections.synchronizedMap(new HashMap<Integer, SessionState>());
|
||||
sessionMap = Collections.synchronizedMap(new HashMap<Long, SessionState>());
|
||||
|
||||
LibFreeRDP.setEventListener(this);
|
||||
}
|
||||
@ -126,17 +126,17 @@ public class GlobalApp extends Application implements LibFreeRDP.EventListener {
|
||||
// RDP session handling
|
||||
static public SessionState createSession(BookmarkBase bookmark, Context context) {
|
||||
SessionState session = new SessionState(LibFreeRDP.newInstance(context), bookmark);
|
||||
sessionMap.put(Integer.valueOf(session.getInstance()), session);
|
||||
sessionMap.put(Long.valueOf(session.getInstance()), session);
|
||||
return session;
|
||||
}
|
||||
|
||||
static public SessionState createSession(Uri openUri, Context context) {
|
||||
SessionState session = new SessionState(LibFreeRDP.newInstance(context), openUri);
|
||||
sessionMap.put(Integer.valueOf(session.getInstance()), session);
|
||||
sessionMap.put(Long.valueOf(session.getInstance()), session);
|
||||
return session;
|
||||
}
|
||||
|
||||
static public SessionState getSession(int instance) {
|
||||
static public SessionState getSession(long instance) {
|
||||
return sessionMap.get(instance);
|
||||
}
|
||||
|
||||
@ -145,7 +145,7 @@ public class GlobalApp extends Application implements LibFreeRDP.EventListener {
|
||||
return new ArrayList<SessionState>(sessionMap.values());
|
||||
}
|
||||
|
||||
static public void freeSession(int instance) {
|
||||
static public void freeSession(long instance) {
|
||||
if (GlobalApp.sessionMap.containsKey(instance)) {
|
||||
GlobalApp.sessionMap.remove(instance);
|
||||
LibFreeRDP.freeInstance(instance);
|
||||
@ -153,7 +153,7 @@ public class GlobalApp extends Application implements LibFreeRDP.EventListener {
|
||||
}
|
||||
|
||||
// helper to send FreeRDP notifications
|
||||
private void sendRDPNotification(int type, int param) {
|
||||
private void sendRDPNotification(int type, long param) {
|
||||
// send broadcast
|
||||
Intent intent = new Intent(ACTION_EVENT_FREERDP);
|
||||
intent.putExtra(EVENT_TYPE, type);
|
||||
@ -162,32 +162,32 @@ public class GlobalApp extends Application implements LibFreeRDP.EventListener {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void OnPreConnect(int instance) {
|
||||
public void OnPreConnect(long instance) {
|
||||
Log.v(TAG, "OnPreConnect");
|
||||
}
|
||||
|
||||
// //////////////////////////////////////////////////////////////////////
|
||||
// Implementation of LibFreeRDP.EventListener
|
||||
public void OnConnectionSuccess(int instance) {
|
||||
public void OnConnectionSuccess(long instance) {
|
||||
Log.v(TAG, "OnConnectionSuccess");
|
||||
sendRDPNotification(FREERDP_EVENT_CONNECTION_SUCCESS, instance);
|
||||
}
|
||||
|
||||
public void OnConnectionFailure(int instance) {
|
||||
public void OnConnectionFailure(long instance) {
|
||||
Log.v(TAG, "OnConnectionFailure");
|
||||
|
||||
// send notification to session activity
|
||||
sendRDPNotification(FREERDP_EVENT_CONNECTION_FAILURE, instance);
|
||||
}
|
||||
|
||||
public void OnDisconnecting(int instance) {
|
||||
public void OnDisconnecting(long instance) {
|
||||
Log.v(TAG, "OnDisconnecting");
|
||||
|
||||
// send disconnect notification
|
||||
sendRDPNotification(FREERDP_EVENT_DISCONNECTED, instance);
|
||||
}
|
||||
|
||||
public void OnDisconnected(int instance) {
|
||||
public void OnDisconnected(long instance) {
|
||||
Log.v(TAG, "OnDisconnected");
|
||||
}
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ import com.freerdp.freerdpcore.services.LibFreeRDP;
|
||||
|
||||
public class SessionState implements Parcelable
|
||||
{
|
||||
private int instance;
|
||||
private long instance;
|
||||
private BookmarkBase bookmark;
|
||||
private Uri openUri;
|
||||
private BitmapDrawable surface;
|
||||
@ -28,7 +28,7 @@ public class SessionState implements Parcelable
|
||||
|
||||
public SessionState(Parcel parcel)
|
||||
{
|
||||
instance = parcel.readInt();
|
||||
instance = parcel.readLong();
|
||||
bookmark = parcel.readParcelable(null);
|
||||
openUri = parcel.readParcelable(null);
|
||||
|
||||
@ -36,7 +36,7 @@ public class SessionState implements Parcelable
|
||||
surface = new BitmapDrawable(bitmap);
|
||||
}
|
||||
|
||||
public SessionState(int instance, BookmarkBase bookmark)
|
||||
public SessionState(long instance, BookmarkBase bookmark)
|
||||
{
|
||||
this.instance = instance;
|
||||
this.bookmark = bookmark;
|
||||
@ -44,7 +44,7 @@ public class SessionState implements Parcelable
|
||||
this.uiEventListener = null;
|
||||
}
|
||||
|
||||
public SessionState(int instance, Uri openUri)
|
||||
public SessionState(long instance, Uri openUri)
|
||||
{
|
||||
this.instance = instance;
|
||||
this.bookmark = null;
|
||||
@ -61,7 +61,7 @@ public class SessionState implements Parcelable
|
||||
LibFreeRDP.connect(instance);
|
||||
}
|
||||
|
||||
public int getInstance() {
|
||||
public long getInstance() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
@ -108,7 +108,7 @@ public class SessionState implements Parcelable
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel out, int flags) {
|
||||
out.writeInt(instance);
|
||||
out.writeLong(instance);
|
||||
out.writeParcelable(bookmark, flags);
|
||||
out.writeParcelable(openUri, flags);
|
||||
out.writeParcelable(surface.getBitmap(), flags);
|
||||
|
@ -212,7 +212,7 @@ public class SessionActivity extends ActionBarActivity implements
|
||||
return;
|
||||
|
||||
// is this event for the current session?
|
||||
if (session.getInstance() != intent.getExtras().getInt(
|
||||
if (session.getInstance() != intent.getExtras().getLong(
|
||||
GlobalApp.EVENT_PARAM, -1))
|
||||
return;
|
||||
|
||||
|
@ -52,37 +52,37 @@ public class LibFreeRDP {
|
||||
|
||||
private static native String freerdp_get_build_config();
|
||||
|
||||
private static native int freerdp_new(Context context);
|
||||
private static native long freerdp_new(Context context);
|
||||
|
||||
private static native void freerdp_free(int inst);
|
||||
private static native void freerdp_free(long inst);
|
||||
|
||||
private static native boolean freerdp_parse_arguments(int inst, String[] args);
|
||||
private static native boolean freerdp_parse_arguments(long inst, String[] args);
|
||||
|
||||
private static native boolean freerdp_connect(int inst);
|
||||
private static native boolean freerdp_connect(long inst);
|
||||
|
||||
private static native boolean freerdp_disconnect(int inst);
|
||||
private static native boolean freerdp_disconnect(long inst);
|
||||
|
||||
private static native boolean freerdp_update_graphics(int inst,
|
||||
private static native boolean freerdp_update_graphics(long inst,
|
||||
Bitmap bitmap, int x, int y, int width, int height);
|
||||
|
||||
private static native boolean freerdp_send_cursor_event(int inst, int x, int y, int flags);
|
||||
private static native boolean freerdp_send_cursor_event(long inst, int x, int y, int flags);
|
||||
|
||||
private static native boolean freerdp_send_key_event(int inst, int keycode, boolean down);
|
||||
private static native boolean freerdp_send_key_event(long inst, int keycode, boolean down);
|
||||
|
||||
private static native boolean freerdp_send_unicodekey_event(int inst, int keycode);
|
||||
private static native boolean freerdp_send_unicodekey_event(long inst, int keycode);
|
||||
|
||||
private static native boolean freerdp_send_clipboard_data(int inst, String data);
|
||||
private static native boolean freerdp_send_clipboard_data(long inst, String data);
|
||||
|
||||
public static interface EventListener {
|
||||
void OnPreConnect(int instance);
|
||||
void OnPreConnect(long instance);
|
||||
|
||||
void OnConnectionSuccess(int instance);
|
||||
void OnConnectionSuccess(long instance);
|
||||
|
||||
void OnConnectionFailure(int instance);
|
||||
void OnConnectionFailure(long instance);
|
||||
|
||||
void OnDisconnecting(int instance);
|
||||
void OnDisconnecting(long instance);
|
||||
|
||||
void OnDisconnected(int instance);
|
||||
void OnDisconnected(long instance);
|
||||
}
|
||||
|
||||
public static interface UIEventListener {
|
||||
@ -112,23 +112,23 @@ public class LibFreeRDP {
|
||||
listener = l;
|
||||
}
|
||||
|
||||
public static int newInstance(Context context) {
|
||||
public static long newInstance(Context context) {
|
||||
return freerdp_new(context);
|
||||
}
|
||||
|
||||
public static void freeInstance(int inst) {
|
||||
public static void freeInstance(long inst) {
|
||||
freerdp_free(inst);
|
||||
}
|
||||
|
||||
public static boolean connect(int inst) {
|
||||
public static boolean connect(long inst) {
|
||||
return freerdp_connect(inst);
|
||||
}
|
||||
|
||||
public static boolean disconnect(int inst) {
|
||||
public static boolean disconnect(long inst) {
|
||||
return freerdp_disconnect(inst);
|
||||
}
|
||||
|
||||
public static boolean cancelConnection(int inst) {
|
||||
public static boolean cancelConnection(long inst) {
|
||||
return freerdp_disconnect(inst);
|
||||
}
|
||||
|
||||
@ -139,7 +139,7 @@ public class LibFreeRDP {
|
||||
return "-" + name;
|
||||
}
|
||||
|
||||
public static boolean setConnectionInfo(int inst, BookmarkBase bookmark) {
|
||||
public static boolean setConnectionInfo(long inst, BookmarkBase bookmark) {
|
||||
BookmarkBase.ScreenSettings screenSettings = bookmark.getActiveScreenSettings();
|
||||
BookmarkBase.AdvancedSettings advanced = bookmark.getAdvancedSettings();
|
||||
BookmarkBase.DebugSettings debug = bookmark.getDebugSettings();
|
||||
@ -278,7 +278,7 @@ public class LibFreeRDP {
|
||||
return freerdp_parse_arguments(inst, arrayArgs);
|
||||
}
|
||||
|
||||
public static boolean setConnectionInfo(int inst, Uri openUri) {
|
||||
public static boolean setConnectionInfo(long inst, Uri openUri) {
|
||||
ArrayList<String> args = new ArrayList<String>();
|
||||
|
||||
// Parse URI from query string. Same key overwrite previous one
|
||||
@ -329,52 +329,52 @@ public class LibFreeRDP {
|
||||
return freerdp_parse_arguments(inst, arrayArgs);
|
||||
}
|
||||
|
||||
public static boolean updateGraphics(int inst, Bitmap bitmap, int x, int y, int width, int height) {
|
||||
public static boolean updateGraphics(long inst, Bitmap bitmap, int x, int y, int width, int height) {
|
||||
return freerdp_update_graphics(inst, bitmap, x, y, width, height);
|
||||
}
|
||||
|
||||
public static boolean sendCursorEvent(int inst, int x, int y, int flags) {
|
||||
public static boolean sendCursorEvent(long inst, int x, int y, int flags) {
|
||||
return freerdp_send_cursor_event(inst, x, y, flags);
|
||||
}
|
||||
|
||||
public static boolean sendKeyEvent(int inst, int keycode, boolean down) {
|
||||
public static boolean sendKeyEvent(long inst, int keycode, boolean down) {
|
||||
return freerdp_send_key_event(inst, keycode, down);
|
||||
}
|
||||
|
||||
public static boolean sendUnicodeKeyEvent(int inst, int keycode) {
|
||||
public static boolean sendUnicodeKeyEvent(long inst, int keycode) {
|
||||
return freerdp_send_unicodekey_event(inst, keycode);
|
||||
}
|
||||
|
||||
public static boolean sendClipboardData(int inst, String data) {
|
||||
public static boolean sendClipboardData(long inst, String data) {
|
||||
return freerdp_send_clipboard_data(inst, data);
|
||||
}
|
||||
|
||||
private static void OnConnectionSuccess(int inst) {
|
||||
private static void OnConnectionSuccess(long inst) {
|
||||
if (listener != null)
|
||||
listener.OnConnectionSuccess(inst);
|
||||
}
|
||||
|
||||
private static void OnConnectionFailure(int inst) {
|
||||
private static void OnConnectionFailure(long inst) {
|
||||
if (listener != null)
|
||||
listener.OnConnectionFailure(inst);
|
||||
}
|
||||
|
||||
private static void OnPreConnect(int inst) {
|
||||
private static void OnPreConnect(long inst) {
|
||||
if (listener != null)
|
||||
listener.OnPreConnect(inst);
|
||||
}
|
||||
|
||||
private static void OnDisconnecting(int inst) {
|
||||
private static void OnDisconnecting(long inst) {
|
||||
if (listener != null)
|
||||
listener.OnDisconnecting(inst);
|
||||
}
|
||||
|
||||
private static void OnDisconnected(int inst) {
|
||||
private static void OnDisconnected(long inst) {
|
||||
if (listener != null)
|
||||
listener.OnDisconnected(inst);
|
||||
}
|
||||
|
||||
private static void OnSettingsChanged(int inst, int width, int height, int bpp) {
|
||||
private static void OnSettingsChanged(long inst, int width, int height, int bpp) {
|
||||
SessionState s = GlobalApp.getSession(inst);
|
||||
if (s == null)
|
||||
return;
|
||||
@ -383,7 +383,7 @@ public class LibFreeRDP {
|
||||
uiEventListener.OnSettingsChanged(width, height, bpp);
|
||||
}
|
||||
|
||||
private static boolean OnAuthenticate(int inst, StringBuilder username, StringBuilder domain, StringBuilder password) {
|
||||
private static boolean OnAuthenticate(long inst, StringBuilder username, StringBuilder domain, StringBuilder password) {
|
||||
SessionState s = GlobalApp.getSession(inst);
|
||||
if (s == null)
|
||||
return false;
|
||||
@ -393,7 +393,7 @@ public class LibFreeRDP {
|
||||
return false;
|
||||
}
|
||||
|
||||
private static boolean OnGatewayAuthenticate(int inst, StringBuilder username, StringBuilder
|
||||
private static boolean OnGatewayAuthenticate(long inst, StringBuilder username, StringBuilder
|
||||
domain, StringBuilder password) {
|
||||
SessionState s = GlobalApp.getSession(inst);
|
||||
if (s == null)
|
||||
@ -404,7 +404,7 @@ public class LibFreeRDP {
|
||||
return false;
|
||||
}
|
||||
|
||||
private static int OnVerifyCertificate(int inst, String commonName, String subject,
|
||||
private static int OnVerifyCertificate(long inst, String commonName, String subject,
|
||||
String issuer, String fingerprint, boolean
|
||||
hostMismatch) {
|
||||
SessionState s = GlobalApp.getSession(inst);
|
||||
@ -417,7 +417,7 @@ public class LibFreeRDP {
|
||||
return 0;
|
||||
}
|
||||
|
||||
private static int OnVerifyChangedCertificate(int inst, String commonName, String subject,
|
||||
private static int OnVerifyChangedCertificate(long inst, String commonName, String subject,
|
||||
String issuer, String fingerprint, String oldSubject,
|
||||
String oldIssuer, String oldFingerprint) {
|
||||
SessionState s = GlobalApp.getSession(inst);
|
||||
@ -430,7 +430,7 @@ public class LibFreeRDP {
|
||||
return 0;
|
||||
}
|
||||
|
||||
private static void OnGraphicsUpdate(int inst, int x, int y, int width, int height) {
|
||||
private static void OnGraphicsUpdate(long inst, int x, int y, int width, int height) {
|
||||
SessionState s = GlobalApp.getSession(inst);
|
||||
if (s == null)
|
||||
return;
|
||||
@ -439,7 +439,7 @@ public class LibFreeRDP {
|
||||
uiEventListener.OnGraphicsUpdate(x, y, width, height);
|
||||
}
|
||||
|
||||
private static void OnGraphicsResize(int inst, int width, int height, int bpp) {
|
||||
private static void OnGraphicsResize(long inst, int width, int height, int bpp) {
|
||||
SessionState s = GlobalApp.getSession(inst);
|
||||
if (s == null)
|
||||
return;
|
||||
@ -448,7 +448,7 @@ public class LibFreeRDP {
|
||||
uiEventListener.OnGraphicsResize(width, height, bpp);
|
||||
}
|
||||
|
||||
private static void OnRemoteClipboardChanged(int inst, String data) {
|
||||
private static void OnRemoteClipboardChanged(long inst, String data) {
|
||||
SessionState s = GlobalApp.getSession(inst);
|
||||
if (s == null)
|
||||
return;
|
||||
|
@ -203,7 +203,7 @@ static BOOL android_end_paint(rdpContext* context)
|
||||
y2 = MAX(y2, cinvalid[i].y + cinvalid[i].h);
|
||||
}
|
||||
|
||||
freerdp_callback("OnGraphicsUpdate", "(IIIII)V", context->instance,
|
||||
freerdp_callback("OnGraphicsUpdate", "(JIIII)V", (jlong)context->instance,
|
||||
x1, y1, x2 - x1, y2 - y1);
|
||||
return TRUE;
|
||||
}
|
||||
@ -213,8 +213,8 @@ static BOOL android_desktop_resize(rdpContext* context)
|
||||
if (!context || !context->instance || !context->settings)
|
||||
return FALSE;
|
||||
|
||||
freerdp_callback("OnGraphicsResize", "(IIII)V",
|
||||
context->instance, context->settings->DesktopWidth,
|
||||
freerdp_callback("OnGraphicsResize", "(JIII)V",
|
||||
(jlong)context->instance, context->settings->DesktopWidth,
|
||||
context->settings->DesktopHeight, context->settings->ColorDepth);
|
||||
return TRUE;
|
||||
}
|
||||
@ -287,7 +287,7 @@ static BOOL android_pre_connect(freerdp* instance)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
freerdp_callback("OnPreConnect", "(I)V", instance);
|
||||
freerdp_callback("OnPreConnect", "(J)V", (jlong)instance);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -378,16 +378,16 @@ static BOOL android_post_connect(freerdp* instance)
|
||||
instance->update->EndPaint = android_end_paint;
|
||||
instance->update->DesktopResize = android_desktop_resize;
|
||||
pointer_cache_register_callbacks(update);
|
||||
freerdp_callback("OnSettingsChanged", "(IIII)V", instance,
|
||||
freerdp_callback("OnSettingsChanged", "(JIII)V", (jlong)instance,
|
||||
settings->DesktopWidth, settings->DesktopHeight,
|
||||
settings->ColorDepth);
|
||||
freerdp_callback("OnConnectionSuccess", "(I)V", instance);
|
||||
freerdp_callback("OnConnectionSuccess", "(J)V", (jlong)instance);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void android_post_disconnect(freerdp* instance)
|
||||
{
|
||||
freerdp_callback("OnDisconnecting", "(I)V", instance);
|
||||
freerdp_callback("OnDisconnecting", "(J)V", (jlong)instance);
|
||||
gdi_free(instance);
|
||||
}
|
||||
|
||||
@ -402,10 +402,10 @@ static BOOL android_authenticate_int(freerdp* instance, char** username,
|
||||
jboolean res;
|
||||
res = freerdp_callback_bool_result(
|
||||
cb_name,
|
||||
"(ILjava/lang/StringBuilder;"
|
||||
"(JLjava/lang/StringBuilder;"
|
||||
"Ljava/lang/StringBuilder;"
|
||||
"Ljava/lang/StringBuilder;)Z",
|
||||
instance, jstr1, jstr2, jstr3);
|
||||
(jlong)instance, jstr1, jstr2, jstr3);
|
||||
|
||||
if (res == JNI_TRUE)
|
||||
{
|
||||
@ -458,8 +458,8 @@ static DWORD android_verify_certificate(
|
||||
jstring jstr2 = (*env)->NewStringUTF(env, issuer);
|
||||
jstring jstr3 = (*env)->NewStringUTF(env, fingerprint);
|
||||
jint res = freerdp_callback_int_result("OnVerifyCertificate",
|
||||
"(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Z)I",
|
||||
instance, jstr0, jstr1, jstr2, jstr3, host_mismatch);
|
||||
"(JLjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Z)I",
|
||||
(jlong)instance, jstr0, jstr1, jstr2, jstr3, host_mismatch);
|
||||
|
||||
if (attached == JNI_TRUE)
|
||||
jni_detach_thread();
|
||||
@ -486,9 +486,9 @@ static DWORD android_verify_changed_certificate(freerdp* instance,
|
||||
jstring jstr5 = (*env)->NewStringUTF(env, old_issuer);
|
||||
jstring jstr6 = (*env)->NewStringUTF(env, old_fingerprint);
|
||||
jint res = freerdp_callback_int_result("OnVerifyChangedCertificate",
|
||||
"(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;"
|
||||
"(JLjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;"
|
||||
"Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I",
|
||||
instance, jstr0, jstr1, jstr2, jstr3, jstr4, jstr5, jstr6);
|
||||
(jlong)instance, jstr0, jstr1, jstr2, jstr3, jstr4, jstr5, jstr6);
|
||||
|
||||
if (attached == JNI_TRUE)
|
||||
jni_detach_thread();
|
||||
@ -664,9 +664,9 @@ fail:
|
||||
WLog_DBG(TAG, "Session ended with %08lX", status);
|
||||
|
||||
if (status == CHANNEL_RC_OK)
|
||||
freerdp_callback("OnDisconnected", "(I)V", instance);
|
||||
freerdp_callback("OnDisconnected", "(J)V", (jlong)instance);
|
||||
else
|
||||
freerdp_callback("OnConnectionFailure", "(I)V", instance);
|
||||
freerdp_callback("OnConnectionFailure", "(J)V", (jlong)instance);
|
||||
|
||||
WLog_DBG(TAG, "Quit.");
|
||||
ExitThread(status);
|
||||
@ -716,7 +716,7 @@ static int RdpClientEntry(RDP_CLIENT_ENTRY_POINTS* pEntryPoints)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static jint JNICALL jni_freerdp_new(JNIEnv* env, jclass cls, jobject context)
|
||||
static jlong JNICALL jni_freerdp_new(JNIEnv* env, jclass cls, jobject context)
|
||||
{
|
||||
jclass contextClass;
|
||||
jclass fileClass;
|
||||
@ -739,7 +739,7 @@ static jint JNICALL jni_freerdp_new(JNIEnv* env, jclass cls, jobject context)
|
||||
{
|
||||
WLog_FATAL(TAG, "Failed to load class references %s=%p, %s=%p",
|
||||
JAVA_CONTEXT_CLASS, contextClass, JAVA_FILE_CLASS, fileClass);
|
||||
return (jint)NULL;
|
||||
return (jlong)NULL;
|
||||
}
|
||||
|
||||
getFilesDirID = (*env)->GetMethodID(env, contextClass, "getFilesDir",
|
||||
@ -748,7 +748,7 @@ static jint JNICALL jni_freerdp_new(JNIEnv* env, jclass cls, jobject context)
|
||||
if (!getFilesDirID)
|
||||
{
|
||||
WLog_FATAL(TAG, "Failed to find method ID getFilesDir ()L"JAVA_FILE_CLASS";");
|
||||
return (jint)NULL;
|
||||
return (jlong)NULL;
|
||||
}
|
||||
|
||||
getAbsolutePathID = (*env)->GetMethodID(env, fileClass, "getAbsolutePath",
|
||||
@ -758,7 +758,7 @@ static jint JNICALL jni_freerdp_new(JNIEnv* env, jclass cls, jobject context)
|
||||
{
|
||||
WLog_FATAL(TAG,
|
||||
"Failed to find method ID getAbsolutePath ()Ljava/lang/String;");
|
||||
return (jint)NULL;
|
||||
return (jlong)NULL;
|
||||
}
|
||||
|
||||
filesDirObj = (*env)->CallObjectMethod(env, context, getFilesDirID);
|
||||
@ -766,7 +766,7 @@ static jint JNICALL jni_freerdp_new(JNIEnv* env, jclass cls, jobject context)
|
||||
if (!filesDirObj)
|
||||
{
|
||||
WLog_FATAL(TAG, "Failed to call getFilesDir");
|
||||
return (jint)NULL;
|
||||
return (jlong)NULL;
|
||||
}
|
||||
|
||||
path = (*env)->CallObjectMethod(env, filesDirObj, getAbsolutePathID);
|
||||
@ -774,7 +774,7 @@ static jint JNICALL jni_freerdp_new(JNIEnv* env, jclass cls, jobject context)
|
||||
if (!path)
|
||||
{
|
||||
WLog_FATAL(TAG, "Failed to call getAbsolutePath");
|
||||
return (jint)NULL;
|
||||
return (jlong)NULL;
|
||||
}
|
||||
|
||||
raw = (*env)->GetStringUTFChars(env, path, 0);
|
||||
@ -782,7 +782,7 @@ static jint JNICALL jni_freerdp_new(JNIEnv* env, jclass cls, jobject context)
|
||||
if (!raw)
|
||||
{
|
||||
WLog_FATAL(TAG, "Failed to get C string from java string");
|
||||
return (jint)NULL;
|
||||
return (jlong)NULL;
|
||||
}
|
||||
|
||||
envStr = _strdup(raw);
|
||||
@ -791,26 +791,26 @@ static jint JNICALL jni_freerdp_new(JNIEnv* env, jclass cls, jobject context)
|
||||
if (!envStr)
|
||||
{
|
||||
WLog_FATAL(TAG, "_strdup(%s) failed", raw);
|
||||
return (jint)NULL;
|
||||
return (jlong)NULL;
|
||||
}
|
||||
|
||||
if (setenv("HOME", _strdup(envStr), 1) != 0)
|
||||
{
|
||||
WLog_FATAL(TAG, "Failed to set environemnt HOME=%s %s [%d]",
|
||||
env, strerror(errno), errno);
|
||||
return (jint)NULL;
|
||||
return (jlong)NULL;
|
||||
}
|
||||
|
||||
RdpClientEntry(&clientEntryPoints);
|
||||
ctx = freerdp_client_context_new(&clientEntryPoints);
|
||||
|
||||
if (!ctx)
|
||||
return (jint)NULL;
|
||||
return (jlong)NULL;
|
||||
|
||||
return (jint) ctx->instance;
|
||||
return (jlong) ctx->instance;
|
||||
}
|
||||
|
||||
static void JNICALL jni_freerdp_free(JNIEnv* env, jclass cls, jint instance)
|
||||
static void JNICALL jni_freerdp_free(JNIEnv* env, jclass cls, jlong instance)
|
||||
{
|
||||
freerdp* inst = (freerdp*)instance;
|
||||
|
||||
@ -823,7 +823,7 @@ static void JNICALL jni_freerdp_free(JNIEnv* env, jclass cls, jint instance)
|
||||
}
|
||||
|
||||
static jboolean JNICALL jni_freerdp_parse_arguments(
|
||||
JNIEnv* env, jclass cls, jint instance, jobjectArray arguments)
|
||||
JNIEnv* env, jclass cls, jlong instance, jobjectArray arguments)
|
||||
{
|
||||
freerdp* inst = (freerdp*)instance;
|
||||
int i, count;
|
||||
@ -858,7 +858,7 @@ static jboolean JNICALL jni_freerdp_parse_arguments(
|
||||
}
|
||||
|
||||
static jboolean JNICALL jni_freerdp_connect(JNIEnv* env, jclass cls,
|
||||
jint instance)
|
||||
jlong instance)
|
||||
{
|
||||
freerdp* inst = (freerdp*)instance;
|
||||
androidContext* ctx;
|
||||
@ -883,7 +883,7 @@ static jboolean JNICALL jni_freerdp_connect(JNIEnv* env, jclass cls,
|
||||
}
|
||||
|
||||
static jboolean JNICALL jni_freerdp_disconnect(JNIEnv* env, jclass cls,
|
||||
jint instance)
|
||||
jlong instance)
|
||||
{
|
||||
freerdp* inst = (freerdp*)instance;
|
||||
androidContext* ctx;
|
||||
@ -915,7 +915,7 @@ static jboolean JNICALL jni_freerdp_disconnect(JNIEnv* env, jclass cls,
|
||||
}
|
||||
|
||||
static jboolean JNICALL jni_freerdp_update_graphics(
|
||||
JNIEnv* env, jclass cls, jint instance, jobject bitmap,
|
||||
JNIEnv* env, jclass cls, jlong instance, jobject bitmap,
|
||||
jint x, jint y, jint width, jint height)
|
||||
{
|
||||
UINT32 DstFormat;
|
||||
@ -984,7 +984,7 @@ static jboolean JNICALL jni_freerdp_update_graphics(
|
||||
}
|
||||
|
||||
static jboolean JNICALL jni_freerdp_send_key_event(
|
||||
JNIEnv* env, jclass cls, jint instance,
|
||||
JNIEnv* env, jclass cls, jlong instance,
|
||||
jint keycode, jboolean down)
|
||||
{
|
||||
DWORD scancode;
|
||||
@ -1009,7 +1009,7 @@ static jboolean JNICALL jni_freerdp_send_key_event(
|
||||
}
|
||||
|
||||
static jboolean JNICALL jni_freerdp_send_unicodekey_event(
|
||||
JNIEnv* env, jclass cls, jint instance, jint keycode)
|
||||
JNIEnv* env, jclass cls, jlong instance, jint keycode)
|
||||
{
|
||||
ANDROID_EVENT* event;
|
||||
freerdp* inst = (freerdp*)instance;
|
||||
@ -1029,7 +1029,7 @@ static jboolean JNICALL jni_freerdp_send_unicodekey_event(
|
||||
}
|
||||
|
||||
static jboolean JNICALL jni_freerdp_send_cursor_event(
|
||||
JNIEnv* env, jclass cls, jint instance, jint x, jint y, jint flags)
|
||||
JNIEnv* env, jclass cls, jlong instance, jint x, jint y, jint flags)
|
||||
{
|
||||
ANDROID_EVENT* event;
|
||||
freerdp* inst = (freerdp*)instance;
|
||||
@ -1050,7 +1050,7 @@ static jboolean JNICALL jni_freerdp_send_cursor_event(
|
||||
|
||||
static jboolean JNICALL jni_freerdp_send_clipboard_data(
|
||||
JNIEnv* env, jclass cls,
|
||||
jint instance, jstring jdata)
|
||||
jlong instance, jstring jdata)
|
||||
{
|
||||
ANDROID_EVENT* event;
|
||||
freerdp* inst = (freerdp*)instance;
|
||||
@ -1133,52 +1133,52 @@ static JNINativeMethod methods[] =
|
||||
},
|
||||
{
|
||||
"freerdp_new",
|
||||
"(Landroid/content/Context;)I",
|
||||
"(Landroid/content/Context;)J",
|
||||
&jni_freerdp_new
|
||||
},
|
||||
{
|
||||
"freerdp_free",
|
||||
"(I)V",
|
||||
"(J)V",
|
||||
&jni_freerdp_free
|
||||
},
|
||||
{
|
||||
"freerdp_parse_arguments",
|
||||
"(I[Ljava/lang/String;)Z",
|
||||
"(J[Ljava/lang/String;)Z",
|
||||
&jni_freerdp_parse_arguments
|
||||
},
|
||||
{
|
||||
"freerdp_connect",
|
||||
"(I)Z",
|
||||
"(J)Z",
|
||||
&jni_freerdp_connect
|
||||
},
|
||||
{
|
||||
"freerdp_disconnect",
|
||||
"(I)Z",
|
||||
"(J)Z",
|
||||
&jni_freerdp_disconnect
|
||||
},
|
||||
{
|
||||
"freerdp_update_graphics",
|
||||
"(ILandroid/graphics/Bitmap;IIII)Z",
|
||||
"(JLandroid/graphics/Bitmap;IIII)Z",
|
||||
&jni_freerdp_update_graphics
|
||||
},
|
||||
{
|
||||
"freerdp_send_cursor_event",
|
||||
"(IIII)Z",
|
||||
"(JIII)Z",
|
||||
&jni_freerdp_send_cursor_event
|
||||
},
|
||||
{
|
||||
"freerdp_send_key_event",
|
||||
"(IIZ)Z",
|
||||
"(JIZ)Z",
|
||||
&jni_freerdp_send_key_event
|
||||
},
|
||||
{
|
||||
"freerdp_send_unicodekey_event",
|
||||
"(II)Z",
|
||||
"(JI)Z",
|
||||
&jni_freerdp_send_unicodekey_event
|
||||
},
|
||||
{
|
||||
"freerdp_send_clipboard_data",
|
||||
"(ILjava/lang/String;)Z",
|
||||
"(JLjava/lang/String;)Z",
|
||||
&jni_freerdp_send_clipboard_data
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user