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,6 +110,11 @@ | ||
| 110 | <Option target="Debug" /> | 110 | <Option target="Debug" /> |
| 111 | <Option target="Release" /> | 111 | <Option target="Release" /> |
| 112 | </Unit> | 112 | </Unit> |
| 113 | + <Unit filename="src/java/call.c"> | ||
| 114 | + <Option compilerVar="CC" /> | ||
| 115 | + <Option target="Debug" /> | ||
| 116 | + <Option target="Release" /> | ||
| 117 | + </Unit> | ||
| 113 | <Unit filename="src/java/clipboard.cc"> | 118 | <Unit filename="src/java/clipboard.cc"> |
| 114 | <Option target="Debug" /> | 119 | <Option target="Debug" /> |
| 115 | <Option target="Release" /> | 120 | <Option target="Release" /> |
src/java/Makefile.in
| @@ -83,7 +83,7 @@ CXXFLAGS=@CFLAGS@ @CXXFLAGS@ @DLL_CFLAGS@ @JNI_CPPFLAGS@ -I../include | @@ -83,7 +83,7 @@ CXXFLAGS=@CFLAGS@ @CXXFLAGS@ @DLL_CFLAGS@ @JNI_CPPFLAGS@ -I../include | ||
| 83 | # PW3270_LIBS ?= -L../../.bin/Debug@DLLDIR@ -l3270 -lpw3270 | 83 | # PW3270_LIBS ?= -L../../.bin/Debug@DLLDIR@ -l3270 -lpw3270 |
| 84 | PW3270_CFLAGS ?= -I../include | 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 | -DJARDIR="\"$(jvmjardir)\"" @GTK_CFLAGS@ @GTKMAC_CFLAGS@ $(PW3270_CFLAGS) | 87 | -DJARDIR="\"$(jvmjardir)\"" @GTK_CFLAGS@ @GTKMAC_CFLAGS@ $(PW3270_CFLAGS) |
| 88 | 88 | ||
| 89 | PLUGIN_LIBS=@GTK_LIBS@ @GTKMAC_LIBS@ @JVM_LIBS@ | 89 | PLUGIN_LIBS=@GTK_LIBS@ @GTKMAC_LIBS@ @JVM_LIBS@ |
| @@ -204,6 +204,7 @@ $(BINRLS)/plugins/j3270@DLLEXT@: \ | @@ -204,6 +204,7 @@ $(BINRLS)/plugins/j3270@DLLEXT@: \ | ||
| 204 | $(CLASS_LIBS) \ | 204 | $(CLASS_LIBS) \ |
| 205 | $(PLUGIN_LIBS) \ | 205 | $(PLUGIN_LIBS) \ |
| 206 | -L../../.bin/Release@DLLDIR@ -l3270 -lpw3270 \ | 206 | -L../../.bin/Release@DLLDIR@ -l3270 -lpw3270 \ |
| 207 | + -L$(BINDBG)@DLLDIR@ -ljni3270 | ||
| 207 | 208 | ||
| 208 | #---[ Debug targets ]---------------------------------------------------------- | 209 | #---[ Debug targets ]---------------------------------------------------------- |
| 209 | 210 |
src/java/plugin.cc
| @@ -342,6 +342,9 @@ extern "C" { | @@ -342,6 +342,9 @@ extern "C" { | ||
| 342 | return 0; | 342 | return 0; |
| 343 | } | 343 | } |
| 344 | 344 | ||
| 345 | +extern "C" | ||
| 346 | +{ | ||
| 347 | + | ||
| 345 | void call_java_program(GtkAction *action, GtkWidget *widget, const gchar *filename) | 348 | void call_java_program(GtkAction *action, GtkWidget *widget, const gchar *filename) |
| 346 | { | 349 | { |
| 347 | 350 | ||
| @@ -423,21 +426,26 @@ extern "C" { | @@ -423,21 +426,26 @@ extern "C" { | ||
| 423 | g_free(myDir); | 426 | g_free(myDir); |
| 424 | g_free(exports); | 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 | options[vm_args.nOptions++].optionString = g_strdup_printf("-Djava.library.path=%s:.bin/Debug:.bin/Debug/lib",JNIDIR); | 434 | options[vm_args.nOptions++].optionString = g_strdup_printf("-Djava.library.path=%s:.bin/Debug:.bin/Debug/lib",JNIDIR); |
| 429 | options[vm_args.nOptions++].optionString = g_strdup_printf("-Djava.class.path=%s:%s:./src/java/.bin/java",JARDIR,dirname); | 435 | options[vm_args.nOptions++].optionString = g_strdup_printf("-Djava.class.path=%s:%s:./src/java/.bin/java",JARDIR,dirname); |
| 430 | - | ||
| 431 | #else | 436 | #else |
| 432 | - | ||
| 433 | options[vm_args.nOptions++].optionString = g_strdup_printf("-Djava.library.path=%s",JNIDIR); | 437 | options[vm_args.nOptions++].optionString = g_strdup_printf("-Djava.library.path=%s",JNIDIR); |
| 434 | options[vm_args.nOptions++].optionString = g_strdup_printf("-Djava.class.path=%s:%s",JARDIR,dirname); | 438 | options[vm_args.nOptions++].optionString = g_strdup_printf("-Djava.class.path=%s:%s",JARDIR,dirname); |
| 435 | - | ||
| 436 | #endif // JNIDIR | 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 | g_free(dirname); | 447 | g_free(dirname); |
| 439 | 448 | ||
| 440 | - rc = JNI_CreateJavaVM(&jvm,(void **)&env,&vm_args); | ||
| 441 | 449 | ||
| 442 | // Release options | 450 | // Release options |
| 443 | for(int f=0;f<vm_args.nOptions;f++) { | 451 | for(int f=0;f<vm_args.nOptions;f++) { |
| @@ -536,9 +544,6 @@ extern "C" { | @@ -536,9 +544,6 @@ extern "C" { | ||
| 536 | 544 | ||
| 537 | } | 545 | } |
| 538 | 546 | ||
| 539 | - | ||
| 540 | -extern "C" | ||
| 541 | -{ | ||
| 542 | LIB3270_EXPORT void pw3270_action_java_activated(GtkAction *action, GtkWidget *widget) | 547 | LIB3270_EXPORT void pw3270_action_java_activated(GtkAction *action, GtkWidget *widget) |
| 543 | { | 548 | { |
| 544 | gchar *filename = (gchar *) g_object_get_data(G_OBJECT(action),"src"); | 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,7 +665,16 @@ static void update_toggle(H3270 *session, LIB3270_TOGGLE ix, unsigned char value | ||
| 665 | switch(ix) | 665 | switch(ix) |
| 666 | { | 666 | { |
| 667 | case LIB3270_TOGGLE_CURSOR_POS: | 667 | case LIB3270_TOGGLE_CURSOR_POS: |
| 668 | + case LIB3270_TOGGLE_MONOCASE: | ||
| 669 | + case LIB3270_TOGGLE_LINE_WRAP: | ||
| 668 | case LIB3270_TOGGLE_CROSSHAIR: | 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 | v3270_reload(GTK_WIDGET(session->user_data)); | 678 | v3270_reload(GTK_WIDGET(session->user_data)); |
| 670 | gtk_widget_queue_draw(GTK_WIDGET(session->user_data)); | 679 | gtk_widget_queue_draw(GTK_WIDGET(session->user_data)); |
| 671 | break; | 680 | break; |
| @@ -689,6 +698,25 @@ static void update_toggle(H3270 *session, LIB3270_TOGGLE ix, unsigned char value | @@ -689,6 +698,25 @@ static void update_toggle(H3270 *session, LIB3270_TOGGLE ix, unsigned char value | ||
| 689 | gtk_window_fullscreen(GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(session->user_data)))); | 698 | gtk_window_fullscreen(GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(session->user_data)))); |
| 690 | else | 699 | else |
| 691 | gtk_window_unfullscreen(GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(session->user_data)))); | 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 | #if GTK_CHECK_VERSION(2,26,0) | 721 | #if GTK_CHECK_VERSION(2,26,0) |
| 694 | g_object_notify_by_pspec(G_OBJECT(session->user_data), v3270_properties[PROP_TOGGLE+ix]); | 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,7 +913,7 @@ static int emit_print_signal(H3270 *session) | ||
| 885 | 913 | ||
| 886 | static gboolean activity_tick(v3270 *widget) | 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 | if(widget->activity.disconnect && lib3270_is_connected(widget->host) && ((time(0) - widget->activity.timestamp)/60) >= widget->activity.disconnect) | 918 | if(widget->activity.disconnect && lib3270_is_connected(widget->host) && ((time(0) - widget->activity.timestamp)/60) >= widget->activity.disconnect) |
| 891 | lib3270_disconnect(widget->host); | 919 | lib3270_disconnect(widget->host); |