Commit 267a658cfa8a627d8ffed17871d13fb2af384cbe
1 parent
fd5506b1
Exists in
master
and in
5 other branches
Incluindo set_unlock_delay na API java.
Showing
3 changed files
with
26 additions
and
5 deletions
Show diff stats
src/classlib/local.cc
@@ -260,18 +260,14 @@ | @@ -260,18 +260,14 @@ | ||
260 | { | 260 | { |
261 | session::lock(); | 261 | session::lock(); |
262 | 262 | ||
263 | - debug("%s(%p,%p)",__FUNCTION__,this,this->hSession); | ||
264 | if(is_connected()) { | 263 | if(is_connected()) { |
265 | disconnect(); | 264 | disconnect(); |
266 | } | 265 | } |
267 | 266 | ||
268 | - debug("%s(%p,%p)",__FUNCTION__,this,this->hSession); | ||
269 | try | 267 | try |
270 | { | 268 | { |
271 | static void (*session_free)(H3270 *h) = (void (*)(H3270 *)) get_symbol("lib3270_session_free"); | 269 | static void (*session_free)(H3270 *h) = (void (*)(H3270 *)) get_symbol("lib3270_session_free"); |
272 | 270 | ||
273 | - debug("%s(%p,%p)",__FUNCTION__,this,this->hSession); | ||
274 | - | ||
275 | if(session_free && this->hSession) | 271 | if(session_free && this->hSession) |
276 | session_free(this->hSession); | 272 | session_free(this->hSession); |
277 | 273 |
src/java/getset.cc
@@ -218,8 +218,20 @@ JNIEXPORT jboolean JNICALL Java_pw3270_terminal_is_1ready(JNIEnv *env, jobject o | @@ -218,8 +218,20 @@ JNIEXPORT jboolean JNICALL Java_pw3270_terminal_is_1ready(JNIEnv *env, jobject o | ||
218 | 218 | ||
219 | } | 219 | } |
220 | 220 | ||
221 | - | ||
222 | return rc; | 221 | return rc; |
223 | 222 | ||
224 | } | 223 | } |
225 | 224 | ||
225 | +JNIEXPORT void JNICALL Java_pw3270_terminal_set_1unlock_1delay(JNIEnv *env, jobject obj, jint ms) { | ||
226 | + | ||
227 | + try { | ||
228 | + | ||
229 | + java::getHandle(env,obj)->set_unlock_delay((unsigned short) ms); | ||
230 | + | ||
231 | + } catch(std::exception &e) { | ||
232 | + | ||
233 | + env->ThrowNew(env->FindClass("java/lang/Exception"), e.what()); | ||
234 | + | ||
235 | + } | ||
236 | + | ||
237 | +} |
src/java/terminal.java
@@ -431,6 +431,19 @@ public class terminal | @@ -431,6 +431,19 @@ public class terminal | ||
431 | public native boolean is_connected(); | 431 | public native boolean is_connected(); |
432 | public native boolean is_ready(); | 432 | public native boolean is_ready(); |
433 | 433 | ||
434 | + /** | ||
435 | + * Set unlock delay in milliseconds. | ||
436 | + * | ||
437 | + * Overrides the default value for the unlock delay (the delay between the host unlocking the | ||
438 | + * keyboard and lib3270 actually performing the unlock). | ||
439 | + * | ||
440 | + * The value is in milliseconds; use 0 to turn off the delay completely. | ||
441 | + * | ||
442 | + * @param ms Delay in milliseconds. | ||
443 | + * | ||
444 | + */ | ||
445 | + public native void set_unlock_delay(int ms); | ||
446 | + | ||
434 | public native void log(String msg); | 447 | public native void log(String msg); |
435 | 448 | ||
436 | /** | 449 | /** |