Commit bc9c1724bd4682ae1cd2548cda95154bb67e58ad
1 parent
95896b8c
Exists in
master
and in
5 other branches
Tentando identificar falha na inicialização da jni em windows
Showing
4 changed files
with
49 additions
and
10 deletions
Show diff stats
pw3270.cbp
| ... | ... | @@ -110,6 +110,11 @@ |
| 110 | 110 | <Option target="Debug" /> |
| 111 | 111 | <Option target="Release" /> |
| 112 | 112 | </Unit> |
| 113 | + <Unit filename="src/java/call.c"> | |
| 114 | + <Option compilerVar="CC" /> | |
| 115 | + <Option target="Debug" /> | |
| 116 | + <Option target="Release" /> | |
| 117 | + </Unit> | |
| 113 | 118 | <Unit filename="src/java/clipboard.cc"> |
| 114 | 119 | <Option target="Debug" /> |
| 115 | 120 | <Option target="Release" /> | ... | ... |
src/java/Makefile.in
| ... | ... | @@ -83,7 +83,7 @@ CXXFLAGS=@CFLAGS@ @CXXFLAGS@ @DLL_CFLAGS@ @JNI_CPPFLAGS@ -I../include |
| 83 | 83 | # PW3270_LIBS ?= -L../../.bin/Debug@DLLDIR@ -l3270 -lpw3270 |
| 84 | 84 | PW3270_CFLAGS ?= -I../include |
| 85 | 85 | |
| 86 | -PLUGIN_CFLAGS=@CXXFLAGS@ @DLL_CFLAGS@ @JNI_CPPFLAGS@ -DJNIDIR="\"$(jnidir)\"" \ | |
| 86 | +PLUGIN_CFLAGS=@CXXFLAGS@ -Wno-deprecated-declarations @DLL_CFLAGS@ @JNI_CPPFLAGS@ -DJNIDIR="\"$(jnidir)\"" \ | |
| 87 | 87 | -DJARDIR="\"$(jvmjardir)\"" @GTK_CFLAGS@ @GTKMAC_CFLAGS@ $(PW3270_CFLAGS) |
| 88 | 88 | |
| 89 | 89 | PLUGIN_LIBS=@GTK_LIBS@ @GTKMAC_LIBS@ @JVM_LIBS@ |
| ... | ... | @@ -204,6 +204,7 @@ $(BINRLS)/plugins/j3270@DLLEXT@: \ |
| 204 | 204 | $(CLASS_LIBS) \ |
| 205 | 205 | $(PLUGIN_LIBS) \ |
| 206 | 206 | -L../../.bin/Release@DLLDIR@ -l3270 -lpw3270 \ |
| 207 | + -L$(BINDBG)@DLLDIR@ -ljni3270 | |
| 207 | 208 | |
| 208 | 209 | #---[ Debug targets ]---------------------------------------------------------- |
| 209 | 210 | ... | ... |
src/java/plugin.cc
| ... | ... | @@ -342,6 +342,9 @@ extern "C" { |
| 342 | 342 | return 0; |
| 343 | 343 | } |
| 344 | 344 | |
| 345 | +extern "C" | |
| 346 | +{ | |
| 347 | + | |
| 345 | 348 | void call_java_program(GtkAction *action, GtkWidget *widget, const gchar *filename) |
| 346 | 349 | { |
| 347 | 350 | |
| ... | ... | @@ -423,21 +426,26 @@ extern "C" { |
| 423 | 426 | g_free(myDir); |
| 424 | 427 | g_free(exports); |
| 425 | 428 | |
| 426 | -#elif defined(DEBUG) | |
| 429 | + rc = JNI_CreateJavaVM(&jvm,(void **)&env,&vm_args); | |
| 427 | 430 | |
| 431 | +#else | |
| 432 | + | |
| 433 | +#if defined(DEBUG) | |
| 428 | 434 | options[vm_args.nOptions++].optionString = g_strdup_printf("-Djava.library.path=%s:.bin/Debug:.bin/Debug/lib",JNIDIR); |
| 429 | 435 | options[vm_args.nOptions++].optionString = g_strdup_printf("-Djava.class.path=%s:%s:./src/java/.bin/java",JARDIR,dirname); |
| 430 | - | |
| 431 | 436 | #else |
| 432 | - | |
| 433 | 437 | options[vm_args.nOptions++].optionString = g_strdup_printf("-Djava.library.path=%s",JNIDIR); |
| 434 | 438 | options[vm_args.nOptions++].optionString = g_strdup_printf("-Djava.class.path=%s:%s",JARDIR,dirname); |
| 435 | - | |
| 436 | 439 | #endif // JNIDIR |
| 437 | 440 | |
| 441 | + rc = JNI_CreateJavaVM(&jvm,(void **)&env,&vm_args); | |
| 442 | + | |
| 443 | +#endif // _WIn32 | |
| 444 | + | |
| 445 | + debug("JNI_CreateJavaVM exits with rc=%d",rc); | |
| 446 | + | |
| 438 | 447 | g_free(dirname); |
| 439 | 448 | |
| 440 | - rc = JNI_CreateJavaVM(&jvm,(void **)&env,&vm_args); | |
| 441 | 449 | |
| 442 | 450 | // Release options |
| 443 | 451 | for(int f=0;f<vm_args.nOptions;f++) { |
| ... | ... | @@ -536,9 +544,6 @@ extern "C" { |
| 536 | 544 | |
| 537 | 545 | } |
| 538 | 546 | |
| 539 | - | |
| 540 | -extern "C" | |
| 541 | -{ | |
| 542 | 547 | LIB3270_EXPORT void pw3270_action_java_activated(GtkAction *action, GtkWidget *widget) |
| 543 | 548 | { |
| 544 | 549 | gchar *filename = (gchar *) g_object_get_data(G_OBJECT(action),"src"); | ... | ... |
src/pw3270/v3270/widget.c
| ... | ... | @@ -665,7 +665,16 @@ static void update_toggle(H3270 *session, LIB3270_TOGGLE ix, unsigned char value |
| 665 | 665 | switch(ix) |
| 666 | 666 | { |
| 667 | 667 | case LIB3270_TOGGLE_CURSOR_POS: |
| 668 | + case LIB3270_TOGGLE_MONOCASE: | |
| 669 | + case LIB3270_TOGGLE_LINE_WRAP: | |
| 668 | 670 | case LIB3270_TOGGLE_CROSSHAIR: |
| 671 | + case LIB3270_TOGGLE_BLANK_FILL: | |
| 672 | + case LIB3270_TOGGLE_MARGINED_PASTE: | |
| 673 | + case LIB3270_TOGGLE_SHOW_TIMING: | |
| 674 | + case LIB3270_TOGGLE_RECTANGLE_SELECT: | |
| 675 | + case LIB3270_TOGGLE_UNDERLINE: | |
| 676 | + case LIB3270_TOGGLE_VIEW_FIELD: | |
| 677 | + case LIB3270_TOGGLE_ALTSCREEN: | |
| 669 | 678 | v3270_reload(GTK_WIDGET(session->user_data)); |
| 670 | 679 | gtk_widget_queue_draw(GTK_WIDGET(session->user_data)); |
| 671 | 680 | break; |
| ... | ... | @@ -689,6 +698,25 @@ static void update_toggle(H3270 *session, LIB3270_TOGGLE ix, unsigned char value |
| 689 | 698 | gtk_window_fullscreen(GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(session->user_data)))); |
| 690 | 699 | else |
| 691 | 700 | gtk_window_unfullscreen(GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(session->user_data)))); |
| 701 | + | |
| 702 | + break; | |
| 703 | + | |
| 704 | + case LIB3270_TOGGLE_DS_TRACE: | |
| 705 | + case LIB3270_TOGGLE_SCREEN_TRACE: | |
| 706 | + case LIB3270_TOGGLE_EVENT_TRACE: | |
| 707 | + case LIB3270_TOGGLE_RECONNECT: | |
| 708 | + case LIB3270_TOGGLE_SMART_PASTE: | |
| 709 | + case LIB3270_TOGGLE_KEEP_SELECTED: | |
| 710 | + case LIB3270_TOGGLE_CONNECT_ON_STARTUP: | |
| 711 | + case LIB3270_TOGGLE_KP_ALTERNATIVE: | |
| 712 | + case LIB3270_TOGGLE_NETWORK_TRACE: | |
| 713 | + case LIB3270_TOGGLE_BEEP: | |
| 714 | + case LIB3270_TOGGLE_KEEP_ALIVE: | |
| 715 | + break; | |
| 716 | + | |
| 717 | + case LIB3270_TOGGLE_COUNT: | |
| 718 | + break; | |
| 719 | + | |
| 692 | 720 | } |
| 693 | 721 | #if GTK_CHECK_VERSION(2,26,0) |
| 694 | 722 | g_object_notify_by_pspec(G_OBJECT(session->user_data), v3270_properties[PROP_TOGGLE+ix]); |
| ... | ... | @@ -885,7 +913,7 @@ static int emit_print_signal(H3270 *session) |
| 885 | 913 | |
| 886 | 914 | static gboolean activity_tick(v3270 *widget) |
| 887 | 915 | { |
| 888 | - trace("idle=%d (%d) timeout=%d",time(0) - widget->activity.timestamp,((time(0) - widget->activity.timestamp)/60),widget->activity.disconnect); | |
| 916 | +// trace("idle=%d (%d) timeout=%d",(int) (time(0) - widget->activity.timestamp),(int) (((time(0) - widget->activity.timestamp)/60),widget->activity.disconnect)); | |
| 889 | 917 | |
| 890 | 918 | if(widget->activity.disconnect && lib3270_is_connected(widget->host) && ((time(0) - widget->activity.timestamp)/60) >= widget->activity.disconnect) |
| 891 | 919 | lib3270_disconnect(widget->host); | ... | ... |