Commit dcac0b94fd39340e36b4c3c1584b2910b2337ad2
1 parent
ef6656b0
Exists in
master
Reimplementando plugin e extensão java.
Showing
9 changed files
with
64 additions
and
18 deletions
Show diff stats
Makefile.in
pw3270-java.cbp
| @@ -33,6 +33,7 @@ | @@ -33,6 +33,7 @@ | ||
| 33 | <Add option="-Wall" /> | 33 | <Add option="-Wall" /> |
| 34 | </Compiler> | 34 | </Compiler> |
| 35 | <Unit filename="src/include/config.h" /> | 35 | <Unit filename="src/include/config.h" /> |
| 36 | + <Unit filename="src/include/java3270.h" /> | ||
| 36 | <Unit filename="src/jni/Makefile.in" /> | 37 | <Unit filename="src/jni/Makefile.in" /> |
| 37 | <Unit filename="src/jni/actions.cc" /> | 38 | <Unit filename="src/jni/actions.cc" /> |
| 38 | <Unit filename="src/jni/call.cc" /> | 39 | <Unit filename="src/jni/call.cc" /> |
| @@ -0,0 +1,50 @@ | @@ -0,0 +1,50 @@ | ||
| 1 | +/* | ||
| 2 | + * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 | ||
| 3 | + * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a | ||
| 4 | + * aplicativos mainframe. Registro no INPI sob o nome G3270. | ||
| 5 | + * | ||
| 6 | + * Copyright (C) <2008> <Banco do Brasil S.A.> | ||
| 7 | + * | ||
| 8 | + * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob | ||
| 9 | + * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela | ||
| 10 | + * Free Software Foundation. | ||
| 11 | + * | ||
| 12 | + * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER | ||
| 13 | + * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO | ||
| 14 | + * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para | ||
| 15 | + * obter mais detalhes. | ||
| 16 | + * | ||
| 17 | + * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este | ||
| 18 | + * programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple | ||
| 19 | + * Place, Suite 330, Boston, MA, 02111-1307, USA | ||
| 20 | + * | ||
| 21 | + * Este programa está nomeado como private.h e possui - linhas de código. | ||
| 22 | + * | ||
| 23 | + * Contatos: | ||
| 24 | + * | ||
| 25 | + * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) | ||
| 26 | + * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) | ||
| 27 | + * | ||
| 28 | + */ | ||
| 29 | + | ||
| 30 | +#ifndef JAVA3270_H_INCLUDED | ||
| 31 | + | ||
| 32 | + #define JAVA3270_H_INCLUDED 1 | ||
| 33 | + | ||
| 34 | + #include <config.h> | ||
| 35 | + #include <pw3270cpp.h> | ||
| 36 | + #include <jni.h> | ||
| 37 | + | ||
| 38 | +/*--[ 3270 Session ]-----------------------------------------------------------------------------------------*/ | ||
| 39 | + | ||
| 40 | +#ifdef __cplusplus | ||
| 41 | + extern "C" { | ||
| 42 | +#endif | ||
| 43 | + | ||
| 44 | + LIB3270_EXPORT void java3270_set_session(H3270 *session); | ||
| 45 | + | ||
| 46 | +#ifdef __cplusplus | ||
| 47 | + } | ||
| 48 | +#endif | ||
| 49 | + | ||
| 50 | +#endif // JAVA3270_H_INCLUDED |
src/jni/Makefile.in
| @@ -44,7 +44,7 @@ libdir=@libdir@ | @@ -44,7 +44,7 @@ libdir=@libdir@ | ||
| 44 | BASEDIR=@BASEDIR@ | 44 | BASEDIR=@BASEDIR@ |
| 45 | SRCDIR=$(BASEDIR)/.src/$(PACKAGE_TARNAME)-$(PACKAGE_VERSION) | 45 | SRCDIR=$(BASEDIR)/.src/$(PACKAGE_TARNAME)-$(PACKAGE_VERSION) |
| 46 | 46 | ||
| 47 | -OBJDIR=$(BASEDIR)/.obj | 47 | +OBJDIR=$(BASEDIR)/.obj/jni |
| 48 | OBJDBG=$(OBJDIR)/Debug | 48 | OBJDBG=$(OBJDIR)/Debug |
| 49 | OBJRLS=$(OBJDIR)/Release | 49 | OBJRLS=$(OBJDIR)/Release |
| 50 | 50 | ||
| @@ -68,7 +68,7 @@ JAVAH=@JAVAH@ | @@ -68,7 +68,7 @@ JAVAH=@JAVAH@ | ||
| 68 | JAVAC=@JAVAC@ | 68 | JAVAC=@JAVAC@ |
| 69 | 69 | ||
| 70 | LIBS=-lpw3270cpp @LIBS@ @LIBICONV@ | 70 | LIBS=-lpw3270cpp @LIBS@ @LIBICONV@ |
| 71 | -CXXFLAGS=@CXXFLAGS@ | 71 | +CXXFLAGS=@CXXFLAGS@ -I../include |
| 72 | LDFLAGS=@LDFLAGS@ | 72 | LDFLAGS=@LDFLAGS@ |
| 73 | 73 | ||
| 74 | #---[ Rules ]---------------------------------------------------------------------------- | 74 | #---[ Rules ]---------------------------------------------------------------------------- |
src/jni/private.h
| @@ -31,9 +31,8 @@ | @@ -31,9 +31,8 @@ | ||
| 31 | 31 | ||
| 32 | #define PRIVATE_H_INCLUDED | 32 | #define PRIVATE_H_INCLUDED |
| 33 | 33 | ||
| 34 | - #include <pw3270cpp.h> | ||
| 35 | - #include <jni.h> | ||
| 36 | - #include "jni3270.h" | 34 | + #include <java3270.h> |
| 35 | + #include "jni3270.h" | ||
| 37 | 36 | ||
| 38 | extern PW3270_NAMESPACE::session * getHandle(JNIEnv *env, jobject obj); | 37 | extern PW3270_NAMESPACE::session * getHandle(JNIEnv *env, jobject obj); |
| 39 | extern jfieldID getHandleField(JNIEnv *env, jobject obj); | 38 | extern jfieldID getHandleField(JNIEnv *env, jobject obj); |
src/plugin/Makefile.in
| @@ -68,7 +68,7 @@ CC=@CC@ | @@ -68,7 +68,7 @@ CC=@CC@ | ||
| 68 | LD=@CXX@ | 68 | LD=@CXX@ |
| 69 | 69 | ||
| 70 | LIBS=-lpw3270cpp @LIBS@ @GTK_LIBS@ | 70 | LIBS=-lpw3270cpp @LIBS@ @GTK_LIBS@ |
| 71 | -CXXFLAGS=@CXXFLAGS@ @GTK_CFLAGS@ | 71 | +CXXFLAGS=@CXXFLAGS@ @GTK_CFLAGS@ -I../include |
| 72 | LDFLAGS=@LDFLAGS@ | 72 | LDFLAGS=@LDFLAGS@ |
| 73 | 73 | ||
| 74 | #---[ Rules ]---------------------------------------------------------------------------- | 74 | #---[ Rules ]---------------------------------------------------------------------------- |
src/plugin/call.cc
| @@ -34,6 +34,7 @@ | @@ -34,6 +34,7 @@ | ||
| 34 | #include <lib3270/log.h> | 34 | #include <lib3270/log.h> |
| 35 | #include <pw3270/v3270.h> | 35 | #include <pw3270/v3270.h> |
| 36 | 36 | ||
| 37 | + using j3270::exception; | ||
| 37 | 38 | ||
| 38 | /*---[ Implement ]----------------------------------------------------------------------------------*/ | 39 | /*---[ Implement ]----------------------------------------------------------------------------------*/ |
| 39 | 40 |
src/plugin/plugin.cc
| @@ -104,19 +104,15 @@ using namespace PW3270_NAMESPACE; | @@ -104,19 +104,15 @@ using namespace PW3270_NAMESPACE; | ||
| 104 | 104 | ||
| 105 | extern "C" { | 105 | extern "C" { |
| 106 | 106 | ||
| 107 | - static PW3270_NAMESPACE::session * factory(const char *name) { | ||
| 108 | - return session::create_local(lib3270_get_default_session_handle()); | ||
| 109 | - } | ||
| 110 | - | ||
| 111 | LIB3270_EXPORT int pw3270_plugin_start(GtkWidget *window, GtkWidget *terminal) { | 107 | LIB3270_EXPORT int pw3270_plugin_start(GtkWidget *window, GtkWidget *terminal) { |
| 112 | 108 | ||
| 113 | trace("JAVA: %s",__FUNCTION__); | 109 | trace("JAVA: %s",__FUNCTION__); |
| 114 | 110 | ||
| 115 | - #if GTK_CHECK_VERSION(2,32,0) | ||
| 116 | - g_mutex_init(&mutex); | ||
| 117 | - #endif // GTK_CHECK_VERSION | 111 | +#if GTK_CHECK_VERSION(2,32,0) |
| 112 | + g_mutex_init(&mutex); | ||
| 113 | +#endif // GTK_CHECK_VERSION | ||
| 118 | 114 | ||
| 119 | - session::set_plugin(factory); | 115 | + java3270_set_session(lib3270_get_default_session_handle()); |
| 120 | 116 | ||
| 121 | return 0; | 117 | return 0; |
| 122 | } | 118 | } |
src/plugin/private.h
| @@ -34,10 +34,10 @@ | @@ -34,10 +34,10 @@ | ||
| 34 | 34 | ||
| 35 | #define PRIVATE_H_INCLUDED | 35 | #define PRIVATE_H_INCLUDED |
| 36 | 36 | ||
| 37 | + #include <java3270.h> | ||
| 38 | + #include <string> | ||
| 37 | #include <jni.h> | 39 | #include <jni.h> |
| 38 | 40 | ||
| 39 | - #include <exception> | ||
| 40 | - | ||
| 41 | #include <malloc.h> | 41 | #include <malloc.h> |
| 42 | #include <libintl.h> | 42 | #include <libintl.h> |
| 43 | 43 | ||
| @@ -54,6 +54,5 @@ | @@ -54,6 +54,5 @@ | ||
| 54 | G_GNUC_INTERNAL bool trylock(); | 54 | G_GNUC_INTERNAL bool trylock(); |
| 55 | G_GNUC_INTERNAL void failed(GtkWidget *widget, const char *msg, const char *format, ...); | 55 | G_GNUC_INTERNAL void failed(GtkWidget *widget, const char *msg, const char *format, ...); |
| 56 | 56 | ||
| 57 | - using namespace std; | ||
| 58 | 57 | ||
| 59 | #endif // PRIVATE_H_INCLUDED | 58 | #endif // PRIVATE_H_INCLUDED |