From 267a658cfa8a627d8ffed17871d13fb2af384cbe Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Tue, 19 Apr 2016 17:54:31 -0300 Subject: [PATCH] Incluindo set_unlock_delay na API java. --- src/classlib/local.cc | 4 ---- src/java/getset.cc | 14 +++++++++++++- src/java/terminal.java | 13 +++++++++++++ 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/src/classlib/local.cc b/src/classlib/local.cc index 3c7df3b..6b0e1ac 100644 --- a/src/classlib/local.cc +++ b/src/classlib/local.cc @@ -260,18 +260,14 @@ { session::lock(); - debug("%s(%p,%p)",__FUNCTION__,this,this->hSession); if(is_connected()) { disconnect(); } - debug("%s(%p,%p)",__FUNCTION__,this,this->hSession); try { static void (*session_free)(H3270 *h) = (void (*)(H3270 *)) get_symbol("lib3270_session_free"); - debug("%s(%p,%p)",__FUNCTION__,this,this->hSession); - if(session_free && this->hSession) session_free(this->hSession); diff --git a/src/java/getset.cc b/src/java/getset.cc index 103bf3d..12ca130 100644 --- a/src/java/getset.cc +++ b/src/java/getset.cc @@ -218,8 +218,20 @@ JNIEXPORT jboolean JNICALL Java_pw3270_terminal_is_1ready(JNIEnv *env, jobject o } - return rc; } +JNIEXPORT void JNICALL Java_pw3270_terminal_set_1unlock_1delay(JNIEnv *env, jobject obj, jint ms) { + + try { + + java::getHandle(env,obj)->set_unlock_delay((unsigned short) ms); + + } catch(std::exception &e) { + + env->ThrowNew(env->FindClass("java/lang/Exception"), e.what()); + + } + +} diff --git a/src/java/terminal.java b/src/java/terminal.java index 8140a74..744721a 100644 --- a/src/java/terminal.java +++ b/src/java/terminal.java @@ -431,6 +431,19 @@ public class terminal public native boolean is_connected(); public native boolean is_ready(); + /** + * Set unlock delay in milliseconds. + * + * Overrides the default value for the unlock delay (the delay between the host unlocking the + * keyboard and lib3270 actually performing the unlock). + * + * The value is in milliseconds; use 0 to turn off the delay completely. + * + * @param ms Delay in milliseconds. + * + */ + public native void set_unlock_delay(int ms); + public native void log(String msg); /** -- libgit2 0.21.2