From 6ac153bd2447b5570493dcf782b32e5cd0585d1c Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Wed, 18 Jan 2017 15:43:00 -0200 Subject: [PATCH] Removendo fontes que foram movidos para projetos separados. --- .gitignore | 3 ++- src/java/Makefile.in | 339 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- src/java/actions.cc | 171 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- src/java/call.cc | 165 --------------------------------------------------------------------------------------------------------------------------------------------------------------------- src/java/clipboard.cc | 120 ------------------------------------------------------------------------------------------------------------------------ src/java/connect.cc | 73 ------------------------------------------------------------------------- src/java/cursor.cc | 95 ----------------------------------------------------------------------------------------------- src/java/dialog.cc | 92 -------------------------------------------------------------------------------------------- src/java/field.cc | 132 ------------------------------------------------------------------------------------------------------------------------------------ src/java/getset.cc | 237 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- src/java/info.cc | 75 --------------------------------------------------------------------------- src/java/jni3270.cbp | 76 ---------------------------------------------------------------------------- src/java/keyboard.cc | 93 --------------------------------------------------------------------------------------------- src/java/main.cc | 167 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- src/java/plugin.cc | 147 --------------------------------------------------------------------------------------------------------------------------------------------------- src/java/private.h | 83 ----------------------------------------------------------------------------------- src/java/run.sh | 7 ------- src/java/sample/efglobe.java | 26 -------------------------- src/java/sample/except.java | 11 ----------- src/java/sample/out.java | 9 --------- src/java/sample/popup.java | 23 ----------------------- src/java/sample/prot.java | 26 -------------------------- src/java/startstop.cc | 419 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- src/java/terminal.java | 479 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- src/java/testprogram.java | 54 ------------------------------------------------------ src/loffice/Makefile.in | 263 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- src/loffice/connect.cc | 175 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- src/loffice/description.txt | 2 -- src/loffice/description.xml.in | 30 ------------------------------ src/loffice/get.cc | 156 ------------------------------------------------------------------------------------------------------------------------------------------------------------ src/loffice/globals.hpp | 151 ------------------------------------------------------------------------------------------------------------------------------------------------------- src/loffice/info.cc | 58 ---------------------------------------------------------- src/loffice/init.cc | 121 ------------------------------------------------------------------------------------------------------------------------- src/loffice/loffice3270.cbp | 64 ---------------------------------------------------------------- src/loffice/manifest.xml.in | 6 ------ src/loffice/pw3270.idl | 97 ------------------------------------------------------------------------------------------------- src/loffice/research.sh | 44 -------------------------------------------- src/loffice/service.cc | 98 -------------------------------------------------------------------------------------------------- src/loffice/set.cc | 246 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ src/loffice/testmacros.odt | Bin 10094 -> 0 bytes src/loffice/testprogram.cc | 148 ---------------------------------------------------------------------------------------------------------------------------------------------------- src/php/Makefile.in | 124 ---------------------------------------------------------------------------------------------------------------------------- src/php/get.cc | 108 ------------------------------------------------------------------------------------------------------------ src/php/init.cc | 86 -------------------------------------------------------------------------------------- src/php/main.cc | 151 ------------------------------------------------------------------------------------------------------------------------------------------------------- src/php/misc.cc | 139 ------------------------------------------------------------------------------------------------------------------------------------------- src/php/php.ini | 2 -- src/php/php3270.cbp | 65 ----------------------------------------------------------------- src/php/php3270.h.in | 87 --------------------------------------------------------------------------------------- src/php/sample.php | 28 ---------------------------- src/php/set.cc | 88 ---------------------------------------------------------------------------------------- src/python/Makefile.in | 144 ------------------------------------------------------------------------------------------------------------------------------------------------ src/python/actions.cc | 129 --------------------------------------------------------------------------------------------------------------------------------- src/python/get.cc | 154 ---------------------------------------------------------------------------------------------------------------------------------------------------------- src/python/init.cc | 87 --------------------------------------------------------------------------------------- src/python/misc.cc | 134 -------------------------------------------------------------------------------------------------------------------------------------- src/python/private.h | 87 --------------------------------------------------------------------------------------- src/python/py3270.cbp | 70 ---------------------------------------------------------------------- src/python/py3270.cc | 162 ------------------------------------------------------------------------------------------------------------------------------------------------------------------ src/python/sample.py | 31 ------------------------------- src/python/set.cc | 86 -------------------------------------------------------------------------------------- src/python/test.sh | 6 ------ 62 files changed, 2 insertions(+), 6747 deletions(-) delete mode 100644 src/java/Makefile.in delete mode 100644 src/java/actions.cc delete mode 100644 src/java/call.cc delete mode 100644 src/java/clipboard.cc delete mode 100644 src/java/connect.cc delete mode 100644 src/java/cursor.cc delete mode 100644 src/java/dialog.cc delete mode 100644 src/java/field.cc delete mode 100644 src/java/getset.cc delete mode 100644 src/java/info.cc delete mode 100644 src/java/jni3270.cbp delete mode 100644 src/java/keyboard.cc delete mode 100644 src/java/main.cc delete mode 100644 src/java/plugin.cc delete mode 100644 src/java/private.h delete mode 100755 src/java/run.sh delete mode 100755 src/java/sample/efglobe.java delete mode 100644 src/java/sample/except.java delete mode 100755 src/java/sample/out.java delete mode 100755 src/java/sample/popup.java delete mode 100755 src/java/sample/prot.java delete mode 100644 src/java/startstop.cc delete mode 100644 src/java/terminal.java delete mode 100644 src/java/testprogram.java delete mode 100644 src/loffice/Makefile.in delete mode 100644 src/loffice/connect.cc delete mode 100644 src/loffice/description.txt delete mode 100644 src/loffice/description.xml.in delete mode 100644 src/loffice/get.cc delete mode 100644 src/loffice/globals.hpp delete mode 100644 src/loffice/info.cc delete mode 100644 src/loffice/init.cc delete mode 100644 src/loffice/loffice3270.cbp delete mode 100644 src/loffice/manifest.xml.in delete mode 100644 src/loffice/pw3270.idl delete mode 100755 src/loffice/research.sh delete mode 100644 src/loffice/service.cc delete mode 100644 src/loffice/set.cc delete mode 100644 src/loffice/testmacros.odt delete mode 100644 src/loffice/testprogram.cc delete mode 100644 src/php/Makefile.in delete mode 100644 src/php/get.cc delete mode 100644 src/php/init.cc delete mode 100644 src/php/main.cc delete mode 100644 src/php/misc.cc delete mode 100644 src/php/php.ini delete mode 100644 src/php/php3270.cbp delete mode 100644 src/php/php3270.h.in delete mode 100644 src/php/sample.php delete mode 100644 src/php/set.cc delete mode 100644 src/python/Makefile.in delete mode 100644 src/python/actions.cc delete mode 100644 src/python/get.cc delete mode 100644 src/python/init.cc delete mode 100644 src/python/misc.cc delete mode 100644 src/python/private.h delete mode 100644 src/python/py3270.cbp delete mode 100644 src/python/py3270.cc delete mode 100644 src/python/sample.py delete mode 100644 src/python/set.cc delete mode 100755 src/python/test.sh diff --git a/.gitignore b/.gitignore index e945672..af67c9d 100644 --- a/.gitignore +++ b/.gitignore @@ -27,7 +27,6 @@ aclocal.m4 configure autom4te.cache makegtkruntime.sh -pw3270.spec revision revision.m4 stamp-h1 @@ -35,5 +34,7 @@ marshal.c marshal.h fallbacks.c version.c +config.h +mkversion.sh diff --git a/src/java/Makefile.in b/src/java/Makefile.in deleted file mode 100644 index cb3ee6f..0000000 --- a/src/java/Makefile.in +++ /dev/null @@ -1,339 +0,0 @@ -# -# "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 -# (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a -# aplicativos mainframe. Registro no INPI sob o nome G3270. -# -# Copyright (C) <2008> -# -# Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob -# os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela -# Free Software Foundation. -# -# Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER -# GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO -# A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para -# obter mais detalhes. -# -# Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este -# programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple -# Place, Suite 330, Boston, MA, 02111-1307, USA -# -# Contatos: -# -# perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) -# erico.mendonca@gmail.com (Erico Mascarenhas de Mendonça) -# - -PACKAGE_NAME=@PACKAGE_NAME@ -SOURCES=main.cc info.cc connect.cc getset.cc cursor.cc keyboard.cc actions.cc field.cc dialog.cc clipboard.cc -PLUGIN_SRC=plugin.cc startstop.cc call.cc - -#---[ Paths ]------------------------------------------------------------------ - -prefix=@prefix@ -exec_prefix=@exec_prefix@ -bindir=@bindir@ -sbindir=@sbindir@ -libdir=@libdir@ -datadir=@datadir@ -includedir=@includedir@ -sysconfdir=@sysconfdir@ -jnidir=@jnidir@ -jvmjardir=@jvmjardir@ -javadocdir=@javadocdir@ - -#---[ Tools ]------------------------------------------------------------------ - -CXX=@CXX@ -MKDIR=@MKDIR_P@ -INSTALL=@INSTALL@ -INSTALL_DATA=@INSTALL_DATA@ -INSTALL_PROGRAM=@INSTALL_PROGRAM@ -JAVAC=@JAVAC@ -JAVAH=@JAVAH@ -JAR=@JAR@ -JAVADOC=@JAVADOC@ -JDK_HOME=@JDK_HOME@ -JRE_HOME=@JRE_HOME@ -JVMDIR=@JVMDIR@ - -#---[ Paths ]------------------------------------------------------------------ - -ROOTDIR ?= . -OBJDIR ?= $(ROOTDIR)/.obj -BINDIR ?= $(ROOTDIR)/.bin - -BINDBG ?= $(BINDIR)/Debug -BINRLS ?= $(BINDIR)/Release - -OBJDBG ?= $(OBJDIR)/Debug -OBJRLS ?= $(OBJDIR)/Release - -#---[ lib3270 common class ]--------------------------------------------------- - -DEBUG_CFLAGS=-DDEBUG=1 -g -Wall -CLASSLIBDIR=../classlib -include $(CLASSLIBDIR)/class.mak - -#---[ Build options ]---------------------------------------------------------- - -LIB3270_LIBS=@LIB3270_LIBS@ -PW3270_LIBS=@PW3270_LIBS@ - -PLUGIN_CFLAGS=@CXXFLAGS@ -DPW3270_PLUGIN -Wno-deprecated-declarations @DLL_CFLAGS@ @JNI_CPPFLAGS@ -DJNIDIR="\"$(jnidir)\"" \ - -DJARDIR="\"$(jvmjardir)\"" @GTK_CFLAGS@ @GTKMAC_CFLAGS@ \ - @PW3270_CFLAGS@ @LIB3270_CFLAGS@ - -CXXFLAGS=@CFLAGS@ @CXXFLAGS@ @DLL_CFLAGS@ @JNI_CPPFLAGS@ @PW3270_CFLAGS@ - - -PLUGIN_LIBS=@GTK_LIBS@ @GTKMAC_LIBS@ @INTL_LIBS@ @JVM_LIBS@ @PW3270_LIBS@ @LIB3270_LIBS@ - -#---[ Rules ]------------------------------------------------------------------ - -$(OBJDBG)/%.o: %.cc Makefile private.h jni3270.h - @echo " CC `basename $@`" - @mkdir -p `dirname $@` - @$(CXX) -DDEBUG=1 $(CXXFLAGS) -o $@ -c $< - -$(OBJDBG)/j3270/%.o: %.cc Makefile private.h - @echo " CC `basename $@`" - @mkdir -p `dirname $@` - @$(CXX) -DDEBUG=1 $(PLUGIN_CFLAGS) -o $@ -c $< - -$(OBJRLS)/%.o: %.cc Makefile private.h jni3270.h - @echo " CC `basename $@`" - @mkdir -p `dirname $@` - @$(CXX) -DNDEBUG=1 $(CXXFLAGS) -o $@ -c $< - -$(OBJRLS)/j3270/%.o: %.cc Makefile private.h - @echo " CC `basename $@`" - @mkdir -p `dirname $@` - @$(CXX) -DNDEBUG=1 $(PLUGIN_CFLAGS) -o $@ -c $< - -$(BINDIR)/java/%.class: \ - %.java \ - $(BINDIR)/java/pw3270/terminal.class - - @echo $< ... - @mkdir -p `dirname $@` - @$(JAVAC) -encoding utf-8 -cp $(BINDIR)/java -d $(BINDIR)/java $< - -$(BINDIR)/java/%.class: \ - sample/%.java \ - $(BINDIR)/java/pw3270/terminal.class - - @echo $< ... - @mkdir -p `dirname $@` - @$(JAVAC) -encoding utf-8 -cp $(BINDIR)/java -d $(BINDIR)/java $< - -$(BINDIR)/%.class: \ - sample/%.java \ - $(BINDIR)/java/pw3270/terminal.class - - @echo $< ... - @mkdir -p `dirname $@` - @$(JAVAC) -encoding utf-8 -cp $(BINDIR)/java -d $(BINDIR)/java $< - -%.class: \ - sample/%.java \ - $(BINDIR)/java/pw3270/terminal.class - - @echo $< ... - @mkdir -p `dirname $@` - @$(JAVAC) -encoding utf-8 -cp $(BINDIR)/java -d `dirname $@` $< - -$(BINDIR)/java/pw3270/%.class: \ - %.java - - @echo $< ... - @mkdir -p `dirname $@` - @$(JAVAC) -encoding utf-8 -d $(BINDIR)/java $^ - -$(BINRLS)/pw3270.jar: \ - $(BINDIR)/java/pw3270/terminal.class - - @echo $@ ... - @mkdir -p `dirname $@` - @$(JAR) -cvf "$@" -C "$(BINDIR)/java" "pw3270" - -#---[ Release targets ]-------------------------------------------------------- - -all: \ - @PACKAGE_NAME@-java-@PACKAGE_VERSION@.@PACKAGE_REVISION@.@jvm_arch@.zip - -Release: \ - $(BINRLS)@DLLDIR@/@DLLPREFIX@jni3270@DLLEXT@ \ - $(BINDIR)/java/testprogram.class \ - $(BINRLS)/plugins/j3270@DLLEXT@ - -zip: \ - jni3270-@PACKAGE_VERSION@.@PACKAGE_REVISION@.@jvm_arch@.zip - -@PACKAGE_NAME@-java-@PACKAGE_VERSION@.@PACKAGE_REVISION@.@jvm_arch@.zip: \ - $(BINRLS)@DLLDIR@/@DLLPREFIX@jni3270@DLLEXT@ \ - $(BINRLS)/plugins/j3270@DLLEXT@ \ - $(BINRLS)/pw3270.jar \ - javadoc - - @rm -f $@ - - @rm -fr jvm-exports - @mkdir jvm-exports - @cp $(BINRLS)/pw3270.jar jvm-exports/pw3270.jar - @zip -9 -m -r $@ jvm-exports - @rm -fr jvm-exports - - @rm -fr ui - @mkdir ui - @cp ../../ui/*java*.xml ui - @zip -9 -m -r $@ ui - @rm -fr ui - - @rm -fr plugins - @mkdir plugins - @cp $(BINRLS)/plugins/j3270@DLLEXT@ plugins - @zip -9 -m -r $@ plugins - @rm -fr plugins - - @zip -9 -j $@ \ - $(BINRLS)@DLLDIR@/@DLLPREFIX@jni3270@DLLEXT@ - - @zip -9 -r $@ \ - javadoc sample/efglobe.java sample/popup.java - - -jni3270-@PACKAGE_VERSION@.@PACKAGE_REVISION@.@jvm_arch@.zip: \ - $(BINRLS)@DLLDIR@/@DLLPREFIX@jni3270@DLLEXT@ \ - $(BINRLS)/pw3270.jar \ - testprogram.java \ - javadoc \ - Makefile - - @rm -f $@ - - @rm -fr jvm-exports - @mkdir jvm-exports - @cp $(BINRLS)/pw3270.jar jvm-exports/pw3270.jar - @zip -9 -m -r $@ jvm-exports - @rm -fr jvm-exports - - @rm -fr ui - @mkdir ui - @cp ../../ui/*java*.xml ui - @zip -9 -m -r $@ ui - @rm -fr ui - - @zip -9 -j $@ $(BINRLS)@DLLDIR@/@DLLPREFIX@jni3270@DLLEXT@ - @zip -9 -r $@ javadoc sample/efglobe.java sample/popup.java - -javadoc: terminal.java - @$(JAVADOC) -encoding utf-8 -d $@ $^ - -$(BINRLS)@DLLDIR@/@DLLPREFIX@jni3270@DLLEXT@: \ - $(foreach SRC, $(basename $(SOURCES)), $(OBJRLS)/$(SRC)@OBJEXT@) \ - $(CLASS_RELEASE_OBJECTS) - - @echo " LD `basename $@`" - @$(MKDIR) `dirname $@` - @$(CXX) @SYSDLL_FLAGS@ $(LDFLAGS) -Wl,-soname,`basename $@` -o $@ $^ $(CLASS_LIBS) @INTL_LIBS@ - -$(BINRLS)/plugins/j3270@DLLEXT@: \ - ../../.bin/Release@DLLDIR@/lib3270@DLLEXT@ \ - $(foreach SRC, $(basename $(PLUGIN_SRC)), $(OBJRLS)/j3270/$(SRC)@OBJEXT@) \ - $(CLASS_RELEASE_OBJECTS) - - @echo " LD `basename $@`" - @$(MKDIR) `dirname $@` - @$(CXX) @SYSDLL_FLAGS@ \ - -Wl,--rpath,$(jnidir) $(LDFLAGS) -Wl,-soname,`basename $@` \ - -o $@ $^ \ - $(CLASS_LIBS) \ - $(PLUGIN_LIBS) \ - -L$(BINRLS)@DLLDIR@ -ljni3270 - -../../.bin/Release@DLLDIR@/lib3270@DLLEXT@: - make -C ../.. .bin/Release@DLLDIR@/lib3270@DLLEXT@ - -#---[ Debug targets ]---------------------------------------------------------- - -Debug: $(BINDBG)@DLLDIR@/@DLLPREFIX@jni3270@DLLEXT@ \ - $(BINDIR)/java/testprogram.class \ - $(BINDBG)/plugins/j3270@DLLEXT@ - -$(BINDBG)@DLLDIR@/@DLLPREFIX@jni3270@DLLEXT@: \ - $(foreach SRC, $(basename $(SOURCES)), $(OBJDBG)/$(SRC)@OBJEXT@) \ - $(CLASS_DEBUG_OBJECTS) - - @echo " LD `basename $@`" - @$(MKDIR) `dirname $@` - @$(CXX) @SYSDLL_FLAGS@ $(LDFLAGS) -Wl,-soname,`basename $@` -o $@ $^ $(CLASS_LIBS) @INTL_LIBS@ - -$(BINDBG)/plugins/j3270@DLLEXT@: \ - $(BINDBG)@DLLDIR@/@DLLPREFIX@jni3270@DLLEXT@ \ - $(foreach SRC, $(basename $(PLUGIN_SRC)), $(OBJDBG)/j3270/$(SRC)@OBJEXT@) \ - $(CLASS_DEBUG_OBJECTS) - - @echo " LD `basename $@`" - @$(MKDIR) `dirname $@` - - @$(CXX) @SYSDLL_FLAGS@ \ - -Wl,--rpath,.bin/Debug@DLLDIR@ $(LDFLAGS) -Wl,-soname,`basename $@` \ - -o $@ $^ \ - $(CLASS_LIBS) \ - $(PLUGIN_LIBS) \ - -L$(BINDBG)@DLLDIR@ -ljni3270 - -run: \ - $(BINDBG)@DLLDIR@/@DLLPREFIX@jni3270@DLLEXT@ \ - $(BINDIR)/java/testprogram.class - - @LD_LIBRARY_PATH=../../.bin/Debug@DLLDIR@/ java -Djava.library.path=$(BINDBG)@DLLDIR@ -cp .bin/java/ testprogram - -#---[ Misc targets ]----------------------------------------------------------- - -install-plugin: \ - $(BINRLS)/plugins/j3270@DLLEXT@ - - @$(MKDIR) $(DESTDIR)$(libdir)/$(PACKAGE_NAME)-plugins - @$(INSTALL_PROGRAM) $(BINRLS)/plugins/j3270@DLLEXT@ $(DESTDIR)$(libdir)/$(PACKAGE_NAME)-plugins - -install-extension: \ - $(BINRLS)@DLLDIR@/@DLLPREFIX@jni3270@DLLEXT@ \ - $(BINRLS)/pw3270.jar \ - - @$(MKDIR) $(DESTDIR)/$(jnidir) - @$(INSTALL_PROGRAM) $(BINRLS)@DLLDIR@/@DLLPREFIX@jni3270@DLLEXT@ $(DESTDIR)/$(jnidir) - - @mkdir -p $(DESTDIR)/$(jvmjardir) - @$(INSTALL_DATA) $(BINRLS)/pw3270.jar $(DESTDIR)/$(jvmjardir) - -install-doc: \ - javadoc - - @echo "javadocdir=$(javadocdir)" - - @$(MKDIR) $(DESTDIR)/$(javadocdir)/$(PACKAGE_NAME) - @cp -r javadoc/* $(DESTDIR)/$(javadocdir)/$(PACKAGE_NAME) - @find $(DESTDIR)/$(javadocdir)/$(PACKAGE_NAME) -type f -exec chmod 644 {} \; - @find $(DESTDIR)/$(javadocdir)/$(PACKAGE_NAME) -type d -exec chmod 755 {} \; - -install: \ - install-extension \ - install-plugin \ - install-doc - -jni3270.h: \ - $(BINDIR)/java/pw3270/terminal.class - - @echo $< ... - @mkdir -p `dirname $@` - @$(JAVAH) -o $@ -classpath $(BINDIR)/java pw3270.terminal - -cleanDebug: clean - -clean: - @rm -fr $(OBJDIR) - @rm -fr $(BINDIR) - @rm -fr javadoc - @rm -f jni3270.h diff --git a/src/java/actions.cc b/src/java/actions.cc deleted file mode 100644 index bb07239..0000000 --- a/src/java/actions.cc +++ /dev/null @@ -1,171 +0,0 @@ -/* - * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 - * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a - * aplicativos mainframe. Registro no INPI sob o nome G3270. - * - * Copyright (C) <2008> - * - * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob - * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela - * Free Software Foundation. - * - * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER - * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO - * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para - * obter mais detalhes. - * - * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este - * programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA, 02111-1307, USA - * - * Este programa está nomeado como actions.cc e possui - linhas de código. - * - * Contatos: - * - * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) - * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) - * - */ - - #include "jni3270.h" - #include "private.h" - -/*---[ Implement ]----------------------------------------------------------------------------------*/ - -using namespace PW3270_NAMESPACE; - -JNIEXPORT jint JNICALL Java_pw3270_terminal_quit(JNIEnv *env, jobject obj) { - - jint rc = -1; - - try { - - rc = java::getHandle(env,obj)->quit(); - - } catch(std::exception &e) { - - env->ThrowNew(env->FindClass("java/lang/Exception"), e.what()); - return -1; - - } - - return rc; - -} - -JNIEXPORT jint JNICALL Java_pw3270_terminal_erase_1eof(JNIEnv *env, jobject obj) { - - jint rc = -1; - - try { - - rc = java::getHandle(env,obj)->erase_eof(); - - } catch(std::exception &e) { - - env->ThrowNew(env->FindClass("java/lang/Exception"), e.what()); - return -1; - - } - - return rc; - -} - -JNIEXPORT jint JNICALL Java_pw3270_terminal_erase(JNIEnv *env, jobject obj) { - - jint rc = -1; - - try { - - rc = java::getHandle(env,obj)->erase(); - - } catch(std::exception &e) { - - env->ThrowNew(env->FindClass("java/lang/Exception"), e.what()); - return -1; - - } - - return rc; - -} -JNIEXPORT jint JNICALL Java_pw3270_terminal_erase_1eol(JNIEnv *env, jobject obj) { - - jint rc = -1; - - try { - - rc = java::getHandle(env,obj)->erase_eol(); - - } catch(std::exception &e) { - - env->ThrowNew(env->FindClass("java/lang/Exception"), e.what()); - return -1; - - } - - return rc; - -} - -JNIEXPORT jint JNICALL Java_pw3270_terminal_erase_1input(JNIEnv *env, jobject obj) { - - jint rc = -1; - - try { - - rc = java::getHandle(env,obj)->erase_input(); - - } catch(std::exception &e) { - - env->ThrowNew(env->FindClass("java/lang/Exception"), e.what()); - return -1; - - } - - return rc; - -} - - -JNIEXPORT jint JNICALL Java_pw3270_terminal_print(JNIEnv *env, jobject obj) { - - jint rc = -1; - - try { - - rc = java::getHandle(env,obj)->print(); - - } catch(std::exception &e) { - - env->ThrowNew(env->FindClass("java/lang/Exception"), e.what()); - return -1; - - } - - return rc; - -} - -JNIEXPORT jint JNICALL Java_pw3270_terminal_action(JNIEnv *env, jobject obj, jstring j_name) { - - jint rc = -1; - const char * name = env->GetStringUTFChars(j_name, 0); - - try { - - rc = java::getHandle(env,obj)->action(name); - - } catch(std::exception &e) { - - env->ReleaseStringUTFChars( j_name, name); - env->ThrowNew(env->FindClass("java/lang/Exception"), e.what()); - return -1; - - } - - env->ReleaseStringUTFChars( j_name, name); - return rc; - -} diff --git a/src/java/call.cc b/src/java/call.cc deleted file mode 100644 index cb93b20..0000000 --- a/src/java/call.cc +++ /dev/null @@ -1,165 +0,0 @@ -/* - * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 - * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a - * aplicativos mainframe. Registro no INPI sob o nome G3270. - * - * Copyright (C) <2008> - * - * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob - * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela - * Free Software Foundation. - * - * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER - * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO - * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para - * obter mais detalhes. - * - * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este - * programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA, 02111-1307, USA - * - * Este programa está nomeado como call.cc e possui - linhas de código. - * - * Contatos: - * - * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) - * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) - * - */ - - - #include "private.h" - #include - #include - #include - - -/*---[ Implement ]----------------------------------------------------------------------------------*/ - -namespace PW3270_NAMESPACE { - - - void java::call(GtkWidget *widget, const char *classname) { - - debug("%s(%s)",__FUNCTION__,classname); - - if(!trylock()) { - - failed(widget, _( "Can't access java virtual machine" ), "%s", strerror(EBUSY)); - return; - - } - - if(jvm || load_jvm(widget)) { - - v3270_set_script(widget,'J',TRUE); - - try { - - jclass cls; - jmethodID mid; - - /* - - DONT WORK!! - http://stackoverflow.com/questions/271506/why-cant-system-setproperty-change-the-classpath-at-runtime - - // Atualizar o classpath - cls = env->FindClass("java/lang/System"); - if(!cls) { - throw exception( _( "Can't find class %s" ), "java/lang/System"); - } - - mid = env->GetStaticMethodID(cls, "setProperty", "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;"); - if(!mid) { - throw exception( _( "Can't find method %s/%s" ), "java/lang/System","setProperty"); - } - - lib3270_trace_event(v3270_get_session(widget),"java.class.path=%s\n",classpath); - - jstring name = env->NewStringUTF("java.class.path"); - jstring path = env->NewStringUTF(classpath); - - jstring rc = (jstring) env->CallObjectMethod(cls,mid,name,path); - - env->DeleteLocalRef(name); - env->DeleteLocalRef(path); - env->DeleteLocalRef(rc); - */ - - // Get application entry point. - cls = env->FindClass(classname); - if(!cls) { - throw exception( _( "Can't find class %s" ), classname); - } - - mid = env->GetStaticMethodID(cls, "main", "([Ljava/lang/String;)V"); - if(!mid) { - throw exception( _( "Can't find method %s/%s" ), classname, "main"); - } - - // Build arguments - jobjectArray args = env->NewObjectArray(0, env->FindClass("java/lang/String"), env->NewStringUTF("")); - - // Call main() - env->CallStaticVoidMethod(cls, mid, args); - - // Check for exception - jthrowable exc = env->ExceptionOccurred(); - env->ExceptionClear(); - - if (exc) { - jclass throwable_class = env->FindClass("java/lang/Throwable"); - - jmethodID jni_getMessage = env->GetMethodID(throwable_class,"getMessage","()Ljava/lang/String;"); - jstring j_msg = (jstring) env->CallObjectMethod(exc,jni_getMessage); - - GtkWidget *dialog = gtk_message_dialog_new( GTK_WINDOW(gtk_widget_get_toplevel(widget)), - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_OK_CANCEL, - _( "Java application \"%s\" has failed." ), classname ); - - gtk_window_set_title(GTK_WINDOW(dialog), _( "Java error" )); - - if(!env->IsSameObject(j_msg,NULL)) { - - const char * msg = env->GetStringUTFChars(j_msg, 0); - - gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog),"%s",msg); - - env->ReleaseStringUTFChars( j_msg, msg); - } - - if(gtk_dialog_run(GTK_DIALOG (dialog)) == GTK_RESPONSE_CANCEL) - gtk_main_quit(); - gtk_widget_destroy(dialog); - - - } - - // And finish - env->DeleteLocalRef(args); - - } catch(std::exception &e) { - - failed(widget,_("Can't start java application"),"%s", e.what()); - - } - -/* - g_free(dirname); - g_free(classname); - g_free(classpath); -*/ - - v3270_set_script(widget,'J',FALSE); - - } - - unlock(); - - - } - -} diff --git a/src/java/clipboard.cc b/src/java/clipboard.cc deleted file mode 100644 index d94f3d6..0000000 --- a/src/java/clipboard.cc +++ /dev/null @@ -1,120 +0,0 @@ -/* - * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 - * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a - * aplicativos mainframe. Registro no INPI sob o nome G3270. - * - * Copyright (C) <2008> - * - * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob - * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela - * Free Software Foundation. - * - * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER - * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO - * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para - * obter mais detalhes. - * - * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este - * programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA, 02111-1307, USA - * - * Este programa está nomeado como dialog.cc e possui - linhas de código. - * - * Contatos: - * - * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) - * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) - * - */ - - #include "jni3270.h" - #include "private.h" - -/*---[ Implement ]----------------------------------------------------------------------------------*/ - -using namespace std; -using namespace PW3270_NAMESPACE::java; - -JNIEXPORT jint JNICALL Java_pw3270_terminal_set_1copy(JNIEnv *env, jobject obj, jstring j_str) { - - const char * str = env->GetStringUTFChars(j_str, 0); - jint rc = -1; - - try { - - rc = getHandle(env,obj)->set_copy(str); - - } catch(std::exception &e) { - - env->ReleaseStringUTFChars( j_str, str); - env->ThrowNew(env->FindClass("java/lang/Exception"), e.what()); - return -1; - - } - - env->ReleaseStringUTFChars( j_str, str); - return rc; - -} - -JNIEXPORT jstring JNICALL Java_pw3270_terminal_get_1copy(JNIEnv *env, jobject obj) { - - string str; - - try { - - str = getHandle(env,obj)->get_copy(); - - - } catch(std::exception &e) { - - env->ThrowNew(env->FindClass("java/lang/Exception"), e.what()); - - } - - return env->NewStringUTF(str.c_str()); - - -} - -JNIEXPORT jstring JNICALL Java_pw3270_terminal_get_1clipboard(JNIEnv *env, jobject obj) { - - string str; - - try { - - str = getHandle(env,obj)->get_clipboard(); - - - } catch(std::exception &e) { - - env->ThrowNew(env->FindClass("java/lang/Exception"), e.what()); - - } - - return env->NewStringUTF(str.c_str()); - -} - -JNIEXPORT jint JNICALL Java_pw3270_terminal_set_1clipboard(JNIEnv *env, jobject obj, jstring j_str) { - - const char * str = env->GetStringUTFChars(j_str, 0); - jint rc = -1; - - try { - - rc = getHandle(env,obj)->set_clipboard(str); - - } catch(std::exception &e) { - - env->ReleaseStringUTFChars( j_str, str); - env->ThrowNew(env->FindClass("java/lang/Exception"), e.what()); - return -1; - - } - - env->ReleaseStringUTFChars( j_str, str); - return rc; - - -} diff --git a/src/java/connect.cc b/src/java/connect.cc deleted file mode 100644 index fd4a5ba..0000000 --- a/src/java/connect.cc +++ /dev/null @@ -1,73 +0,0 @@ -/* - * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 - * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a - * aplicativos mainframe. Registro no INPI sob o nome G3270. - * - * Copyright (C) <2008> - * - * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob - * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela - * Free Software Foundation. - * - * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER - * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO - * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para - * obter mais detalhes. - * - * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este - * programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA, 02111-1307, USA - * - * Este programa está nomeado como info.cc e possui - linhas de código. - * - * Contatos: - * - * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) - * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) - * - */ - - #include "jni3270.h" - #include "private.h" - -/*---[ Implement ]----------------------------------------------------------------------------------*/ - -using namespace PW3270_NAMESPACE; - -JNIEXPORT jint JNICALL Java_pw3270_terminal_connect(JNIEnv *env, jobject obj, jstring j_host, jint seconds) { - - const char * host = env->GetStringUTFChars(j_host, 0); - jint rc = -1; - - try { - - rc = java::getHandle(env,obj)->connect(host,(time_t) seconds); - - } catch(std::exception &e) { - - env->ReleaseStringUTFChars( j_host, host); - env->ThrowNew(env->FindClass("java/lang/Exception"), e.what()); - return -1; - - } - - env->ReleaseStringUTFChars( j_host, host); - return rc; - -} - -JNIEXPORT jint JNICALL Java_pw3270_terminal_disconnect(JNIEnv *env, jobject obj) { - - try { - - return (jint) java::getHandle(env,obj)->disconnect(); - - } catch(std::exception &e) { - - env->ThrowNew(env->FindClass("java/lang/Exception"), e.what()); - - } - - return -1; - -} diff --git a/src/java/cursor.cc b/src/java/cursor.cc deleted file mode 100644 index 2b75fc7..0000000 --- a/src/java/cursor.cc +++ /dev/null @@ -1,95 +0,0 @@ -/* - * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 - * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a - * aplicativos mainframe. Registro no INPI sob o nome G3270. - * - * Copyright (C) <2008> - * - * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob - * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela - * Free Software Foundation. - * - * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER - * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO - * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para - * obter mais detalhes. - * - * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este - * programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA, 02111-1307, USA - * - * Este programa está nomeado como cursor.cc e possui - linhas de código. - * - * Contatos: - * - * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) - * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) - * - */ - - #include "jni3270.h" - #include "private.h" - -/*---[ Implement ]----------------------------------------------------------------------------------*/ - -using namespace PW3270_NAMESPACE; - -JNIEXPORT jint JNICALL Java_pw3270_terminal_set_1cursor_1position(JNIEnv *env, jobject obj, jint row, jint col) { - - jint rc = -1; - - try { - - rc = java::getHandle(env,obj)->set_cursor_position((int) row, (int) col); - - } catch(std::exception &e) { - - env->ThrowNew(env->FindClass("java/lang/Exception"), e.what()); - return -1; - - } - - return rc; - -} - -JNIEXPORT jint JNICALL Java_pw3270_terminal_set_1cursor_1addr(JNIEnv *env, jobject obj, jint addr) { - - jint rc = -1; - - try { - - rc = java::getHandle(env,obj)->set_cursor_addr((int) addr); - - } catch(std::exception &e) { - - env->ThrowNew(env->FindClass("java/lang/Exception"), e.what()); - return -1; - - } - - return rc; - - -} - -JNIEXPORT jint JNICALL Java_pw3270_terminal_get_1cursor_1addr(JNIEnv *env, jobject obj) { - - jint rc = -1; - - try { - - rc = java::getHandle(env,obj)->get_cursor_addr(); - - } catch(std::exception &e) { - - env->ThrowNew(env->FindClass("java/lang/Exception"), e.what()); - return -1; - - } - - return rc; - -} - - diff --git a/src/java/dialog.cc b/src/java/dialog.cc deleted file mode 100644 index cf92dc2..0000000 --- a/src/java/dialog.cc +++ /dev/null @@ -1,92 +0,0 @@ -/* - * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 - * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a - * aplicativos mainframe. Registro no INPI sob o nome G3270. - * - * Copyright (C) <2008> - * - * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob - * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela - * Free Software Foundation. - * - * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER - * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO - * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para - * obter mais detalhes. - * - * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este - * programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA, 02111-1307, USA - * - * Este programa está nomeado como dialog.cc e possui - linhas de código. - * - * Contatos: - * - * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) - * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) - * - */ - - #include "jni3270.h" - #include "private.h" - -/*---[ Implement ]----------------------------------------------------------------------------------*/ - -using namespace PW3270_NAMESPACE; - -JNIEXPORT jint JNICALL Java_pw3270_terminal_popup_1dialog(JNIEnv *env, jobject obj, jint id, jstring j_title, jstring j_message, jstring j_secondary) { - - const char * title = env->GetStringUTFChars(j_title, 0); - const char * message = env->GetStringUTFChars(j_message, 0); - const char * secondary = env->GetStringUTFChars(j_secondary, 0); - jint rc = -1; - - try { - - rc = (jint) java::getHandle(env,obj)->popup_dialog((LIB3270_NOTIFY) id, title, message, secondary); - - } catch(std::exception &e) { - - env->ReleaseStringUTFChars( j_title, title); - env->ReleaseStringUTFChars( j_message, message); - env->ReleaseStringUTFChars( j_secondary, secondary); - env->ThrowNew(env->FindClass("java/lang/Exception"), e.what()); - - } - - env->ReleaseStringUTFChars( j_title, title); - env->ReleaseStringUTFChars( j_message, message); - env->ReleaseStringUTFChars( j_secondary, secondary); - - return rc; - -} - -JNIEXPORT jstring JNICALL Java_pw3270_terminal_file_1chooser_1dialog(JNIEnv *env, jobject obj, jint action, jstring j_title, jstring j_extension, jstring j_filename) { - - string str; - const char * title = env->GetStringUTFChars(j_title, 0); - const char * extension = env->GetStringUTFChars(j_extension, 0); - const char * filename = env->GetStringUTFChars(j_filename, 0); - - try { - - str = java::getHandle(env,obj)->file_chooser_dialog((int) action, title, extension, filename); - - } catch(std::exception &e) { - - env->ReleaseStringUTFChars( j_title, title); - env->ReleaseStringUTFChars( j_extension, extension); - env->ReleaseStringUTFChars( j_filename, filename); - env->ThrowNew(env->FindClass("java/lang/Exception"), e.what()); - - } - - env->ReleaseStringUTFChars( j_title, title); - env->ReleaseStringUTFChars( j_extension, extension); - env->ReleaseStringUTFChars( j_filename, filename); - - return env->NewStringUTF(str.c_str()); - - -} diff --git a/src/java/field.cc b/src/java/field.cc deleted file mode 100644 index f486509..0000000 --- a/src/java/field.cc +++ /dev/null @@ -1,132 +0,0 @@ -/* - * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 - * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a - * aplicativos mainframe. Registro no INPI sob o nome G3270. - * - * Copyright (C) <2008> - * - * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob - * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela - * Free Software Foundation. - * - * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER - * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO - * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para - * obter mais detalhes. - * - * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este - * programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA, 02111-1307, USA - * - * Este programa está nomeado como field.cc e possui - linhas de código. - * - * Contatos: - * - * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) - * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) - * - */ - - #include "jni3270.h" - #include "private.h" - -/*---[ Implement ]----------------------------------------------------------------------------------*/ - -using namespace PW3270_NAMESPACE; - -JNIEXPORT jint JNICALL Java_pw3270_terminal_get_1field_1start (JNIEnv *env, jobject obj, jint baddr) { - - jint rc = -1; - - try { - - rc = java::getHandle(env,obj)->get_field_start((int) baddr); - - - } catch(std::exception &e) { - - env->ThrowNew(env->FindClass("java/lang/Exception"), e.what()); - - } - - return rc; - -} - -JNIEXPORT jint JNICALL Java_pw3270_terminal_get_1field_1len (JNIEnv *env, jobject obj, jint baddr) { - - jint rc = -1; - - try { - - rc = java::getHandle(env,obj)->get_field_len((int) baddr); - - - } catch(std::exception &e) { - - env->ThrowNew(env->FindClass("java/lang/Exception"), e.what()); - - } - - return rc; - -} - -JNIEXPORT jint JNICALL Java_pw3270_terminal_get_1next_1unprotected(JNIEnv *env, jobject obj, jint baddr) { - - jint rc = -1; - - try { - - rc = java::getHandle(env,obj)->get_next_unprotected((int) baddr); - - - } catch(std::exception &e) { - - env->ThrowNew(env->FindClass("java/lang/Exception"), e.what()); - - } - - return rc; - - -} - -JNIEXPORT jint JNICALL Java_pw3270_terminal_get_1is_1protected(JNIEnv *env, jobject obj, jint baddr) { - - jint rc = -1; - - try { - - rc = java::getHandle(env,obj)->get_is_protected((int) baddr); - - - } catch(std::exception &e) { - - env->ThrowNew(env->FindClass("java/lang/Exception"), e.what()); - - } - - return rc; - - -} - -JNIEXPORT jint JNICALL Java_pw3270_terminal_get_1is_1protected_1at(JNIEnv *env, jobject obj, jint row, jint col) { - - jint rc = -1; - - try { - - rc = java::getHandle(env,obj)->get_is_protected_at((int) row, (int) col); - - } catch(std::exception &e) { - - env->ThrowNew(env->FindClass("java/lang/Exception"), e.what()); - - } - - return rc; - - -} diff --git a/src/java/getset.cc b/src/java/getset.cc deleted file mode 100644 index 12ca130..0000000 --- a/src/java/getset.cc +++ /dev/null @@ -1,237 +0,0 @@ -/* - * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 - * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a - * aplicativos mainframe. Registro no INPI sob o nome G3270. - * - * Copyright (C) <2008> - * - * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob - * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela - * Free Software Foundation. - * - * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER - * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO - * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para - * obter mais detalhes. - * - * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este - * programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA, 02111-1307, USA - * - * Este programa está nomeado como info.cc e possui - linhas de código. - * - * Contatos: - * - * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) - * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) - * - */ - - #include "jni3270.h" - #include "private.h" - -/*---[ Implement ]----------------------------------------------------------------------------------*/ - -using namespace std; -using namespace PW3270_NAMESPACE; - -JNIEXPORT jstring JNICALL Java_pw3270_terminal_toString(JNIEnv *env, jobject obj) { - - string str; - - try { - - str = java::getHandle(env,obj)->get_string(); - - } catch(std::exception &e) { - - env->ThrowNew(env->FindClass("java/lang/Exception"), e.what()); - - } - - return env->NewStringUTF(str.c_str()); - -} - -JNIEXPORT jstring JNICALL Java_pw3270_terminal_get_1string(JNIEnv *env, jobject obj, jint baddr, jint len) { - - string str; - - try { - - str = java::getHandle(env,obj)->get_string((int) baddr, (int) len); - - - } catch(std::exception &e) { - - env->ThrowNew(env->FindClass("java/lang/Exception"), e.what()); - - } - - return env->NewStringUTF(str.c_str()); - -} - -JNIEXPORT jstring JNICALL Java_pw3270_terminal_get_1string_1at(JNIEnv *env, jobject obj, jint row, jint col, jint sz) { - - string str; - - try { - - str = java::getHandle(env,obj)->get_string_at((int) row, (int) col, (int) sz); - - - } catch(std::exception &e) { - - env->ThrowNew(env->FindClass("java/lang/Exception"), e.what()); - - } - - return env->NewStringUTF(str.c_str()); - -} - -JNIEXPORT jint JNICALL Java_pw3270_terminal_set_1string_1at(JNIEnv *env, jobject obj, jint row, jint col, jstring j_str) { - - const char * str = env->GetStringUTFChars(j_str, 0); - jint rc = -1; - - try { - - rc = java::getHandle(env,obj)->set_string_at((int) row, (int) col, str); - - } catch(std::exception &e) { - - env->ReleaseStringUTFChars( j_str, str); - env->ThrowNew(env->FindClass("java/lang/Exception"), e.what()); - return -1; - - } - - env->ReleaseStringUTFChars( j_str, str); - return rc; - - -} - -JNIEXPORT jint JNICALL Java_pw3270_terminal_cmp_1string_1at(JNIEnv *env, jobject obj, jint row, jint col, jstring j_str) { - - const char * str = env->GetStringUTFChars(j_str, 0); - jint rc = -1; - - try { - - rc = java::getHandle(env,obj)->cmp_string_at((int) row, (int) col, str); - - } catch(std::exception &e) { - - env->ReleaseStringUTFChars( j_str, str); - env->ThrowNew(env->FindClass("java/lang/Exception"), e.what()); - return -1; - - } - - trace("cmp_string_at(%d,%d,\"%s\") = %d",(int) row, (int) col, str, (int) rc); - - env->ReleaseStringUTFChars( j_str, str); - return rc; - -} - -JNIEXPORT jint JNICALL Java_pw3270_terminal_wait_1for_1string_1at(JNIEnv *env, jobject obj, jint row, jint col, jstring j_str, jint timeout) { - - const char * str = env->GetStringUTFChars(j_str, 0); - jint rc = -1; - - try { - - rc = java::getHandle(env,obj)->wait_for_string_at((int) row, (int) col, str, timeout); - - } catch(std::exception &e) { - - env->ReleaseStringUTFChars( j_str, str); - env->ThrowNew(env->FindClass("java/lang/Exception"), e.what()); - return -1; - - } - - env->ReleaseStringUTFChars( j_str, str); - return rc; - - -} - -JNIEXPORT jint JNICALL Java_pw3270_terminal_input_1string(JNIEnv *env, jobject obj, jstring j_str) { - - const char * str = env->GetStringUTFChars(j_str, 0); - jint rc = -1; - - try { - - rc = java::getHandle(env,obj)->input_string(str); - - } catch(std::exception &e) { - - env->ReleaseStringUTFChars( j_str, str); - env->ThrowNew(env->FindClass("java/lang/Exception"), e.what()); - return -1; - - } - - env->ReleaseStringUTFChars( j_str, str); - return rc; - -} - -JNIEXPORT jboolean JNICALL Java_pw3270_terminal_is_1connected(JNIEnv *env, jobject obj) { - - jboolean rc = false; - - try { - - rc = java::getHandle(env,obj)->is_connected(); - - } catch(std::exception &e) { - - env->ThrowNew(env->FindClass("java/lang/Exception"), e.what()); - return rc; - - } - - - return rc; - -} - -JNIEXPORT jboolean JNICALL Java_pw3270_terminal_is_1ready(JNIEnv *env, jobject obj) { - - jboolean rc = false; - - try { - - rc = java::getHandle(env,obj)->is_ready(); - - } catch(std::exception &e) { - - env->ThrowNew(env->FindClass("java/lang/Exception"), e.what()); - return rc; - - } - - 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/info.cc b/src/java/info.cc deleted file mode 100644 index 9cd7f04..0000000 --- a/src/java/info.cc +++ /dev/null @@ -1,75 +0,0 @@ -/* - * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 - * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a - * aplicativos mainframe. Registro no INPI sob o nome G3270. - * - * Copyright (C) <2008> - * - * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob - * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela - * Free Software Foundation. - * - * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER - * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO - * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para - * obter mais detalhes. - * - * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este - * programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA, 02111-1307, USA - * - * Este programa está nomeado como info.cc e possui - linhas de código. - * - * Contatos: - * - * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) - * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) - * - */ - - #include "jni3270.h" - #include "private.h" - - -/*---[ Implement ]----------------------------------------------------------------------------------*/ - -using namespace PW3270_NAMESPACE; - -JNIEXPORT jstring JNICALL Java_pw3270_terminal_get_1version (JNIEnv *env, jobject obj) { - - session *s = java::getHandle(env,obj); - return env->NewStringUTF(s->get_version().c_str()); - -} - -JNIEXPORT jstring JNICALL Java_pw3270_terminal_get_1revision(JNIEnv *env, jobject obj) { - - session *s = java::getHandle(env,obj); - return env->NewStringUTF(s->get_revision().c_str()); - -} - -JNIEXPORT jstring JNICALL Java_pw3270_terminal_get_1encoding(JNIEnv *env, jobject obj) { - - session *s = java::getHandle(env,obj); - return env->NewStringUTF(s->get_encoding()); - -} - -JNIEXPORT jint JNICALL Java_pw3270_terminal_get_1secure(JNIEnv *env, jobject obj) { - - jint rc = -1; - - try { - - rc = java::getHandle(env,obj)->get_secure(); - - } catch(std::exception &e) { - - env->ThrowNew(env->FindClass("java/lang/Exception"), e.what()); - - } - - return rc; - -} diff --git a/src/java/jni3270.cbp b/src/java/jni3270.cbp deleted file mode 100644 index 8a70c83..0000000 --- a/src/java/jni3270.cbp +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - diff --git a/src/java/keyboard.cc b/src/java/keyboard.cc deleted file mode 100644 index 2be700b..0000000 --- a/src/java/keyboard.cc +++ /dev/null @@ -1,93 +0,0 @@ -/* - * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 - * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a - * aplicativos mainframe. Registro no INPI sob o nome G3270. - * - * Copyright (C) <2008> - * - * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob - * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela - * Free Software Foundation. - * - * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER - * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO - * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para - * obter mais detalhes. - * - * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este - * programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA, 02111-1307, USA - * - * Este programa está nomeado como keyboard.cc e possui - linhas de código. - * - * Contatos: - * - * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) - * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) - * - */ - - #include "jni3270.h" - #include "private.h" - -/*---[ Implement ]----------------------------------------------------------------------------------*/ - -using namespace PW3270_NAMESPACE; - -JNIEXPORT jint JNICALL Java_pw3270_terminal_enter(JNIEnv *env, jobject obj) { - - jint rc = -1; - - try { - - rc = java::getHandle(env,obj)->enter(); - - } catch(std::exception &e) { - - env->ThrowNew(env->FindClass("java/lang/Exception"), e.what()); - return -1; - - } - - return rc; - -} - -JNIEXPORT jint JNICALL Java_pw3270_terminal_pfkey(JNIEnv *env, jobject obj, jint key) { - - jint rc = -1; - - try { - - rc = java::getHandle(env,obj)->pfkey((int) key); - - } catch(std::exception &e) { - - env->ThrowNew(env->FindClass("java/lang/Exception"), e.what()); - return -1; - - } - - return rc; - -} - -JNIEXPORT jint JNICALL Java_pw3270_terminal_pakey(JNIEnv *env, jobject obj, jint key) { - - jint rc = -1; - - try { - - rc = java::getHandle(env,obj)->pakey((int) key); - - } catch(std::exception &e) { - - env->ThrowNew(env->FindClass("java/lang/Exception"), e.what()); - return -1; - - } - - return rc; - -} - diff --git a/src/java/main.cc b/src/java/main.cc deleted file mode 100644 index c618e7d..0000000 --- a/src/java/main.cc +++ /dev/null @@ -1,167 +0,0 @@ -/* - * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 - * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a - * aplicativos mainframe. Registro no INPI sob o nome G3270. - * - * Copyright (C) <2008> - * - * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob - * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela - * Free Software Foundation. - * - * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER - * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO - * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para - * obter mais detalhes. - * - * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este - * programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA, 02111-1307, USA - * - * Este programa está nomeado como main.cc e possui - linhas de código. - * - * Contatos: - * - * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) - * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) - * - */ - - #include "jni3270.h" - #include "private.h" - -/*---[ Implement ]----------------------------------------------------------------------------------*/ - -namespace PW3270_NAMESPACE { - - jfieldID java::getHandleField(JNIEnv *env, jobject obj) { - jclass c = env->GetObjectClass(obj); - // J is the type signature for long: - return env->GetFieldID(c, "nativeHandle", "J"); - } - - session * java::getHandle(JNIEnv *env, jobject obj) { - jlong handle = env->GetLongField(obj, getHandleField(env, obj)); - return reinterpret_cast(handle); - } - -} - -using namespace PW3270_NAMESPACE; -using namespace PW3270_NAMESPACE::java; - -JNIEXPORT jint JNICALL Java_pw3270_terminal_init__(JNIEnv *env, jobject obj) { - - trace("%s",__FUNCTION__); - - try { - - jlong handle = reinterpret_cast(session::create()); - env->SetLongField(obj, getHandleField(env, obj), handle); - - } catch(std::exception &e) { - - trace("%s: %s",__FUNCTION__,e.what()); - env->ThrowNew(env->FindClass("java/lang/Exception"), e.what()); - - } - - return 0; -} - - -JNIEXPORT jint JNICALL Java_pw3270_terminal_init__Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring j_id) { - - const char * id = env->GetStringUTFChars(j_id, 0); - - try { - - jlong handle = reinterpret_cast(session::create(id)); - env->SetLongField(obj, getHandleField(env, obj), handle); - env->ReleaseStringUTFChars( j_id, id); - - } catch(std::exception &e) { - - env->ReleaseStringUTFChars( j_id, id); - env->ThrowNew(env->FindClass("java/lang/Exception"), e.what()); - - } - - - return 0; -} - -JNIEXPORT jint JNICALL Java_pw3270_terminal_deinit(JNIEnv *env, jobject obj) { - - try { - - session *s = getHandle(env,obj); - - if(s) { - delete s; - } - - env->SetLongField(obj, getHandleField(env, obj), 0); - - - } catch(std::exception &e) { - - env->ThrowNew(env->FindClass("java/lang/Exception"), e.what()); - - } - - return 0; -} - -JNIEXPORT jint JNICALL Java_pw3270_terminal_wait_1for_1ready(JNIEnv *env, jobject obj, jint seconds) { - - try { - - return getHandle(env,obj)->wait_for_ready((int) seconds); - - } catch(std::exception &e) { - - env->ThrowNew(env->FindClass("java/lang/Exception"), e.what()); - - } - - return 0; - -} - -JNIEXPORT jint JNICALL Java_pw3270_terminal_wait(JNIEnv *env, jobject obj, jint seconds) { - - try { - - return getHandle(env,obj)->wait((int) seconds); - - } catch(std::exception &e) { - - env->ThrowNew(env->FindClass("java/lang/Exception"), e.what()); - - } - - return 0; - -} - - -JNIEXPORT void JNICALL Java_pw3270_terminal_log(JNIEnv *env, jobject obj, jstring j_str) { - - const char * str = env->GetStringUTFChars(j_str, 0); - - try { - - getHandle(env,obj)->log("%s", str); - - } catch(std::exception &e) { - - env->ReleaseStringUTFChars( j_str, str); - env->ThrowNew(env->FindClass("java/lang/Exception"), e.what()); - return; - - } - - env->ReleaseStringUTFChars( j_str, str); - -} diff --git a/src/java/plugin.cc b/src/java/plugin.cc deleted file mode 100644 index b19a724..0000000 --- a/src/java/plugin.cc +++ /dev/null @@ -1,147 +0,0 @@ -/* - * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 - * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a - * aplicativos mainframe. Registro no INPI sob o nome G3270. - * - * Copyright (C) <2008> - * - * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob - * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela - * Free Software Foundation. - * - * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER - * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO - * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para - * obter mais detalhes. - * - * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este - * programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA, 02111-1307, USA - * - * Este programa está nomeado como plugin.cc e possui - linhas de código. - * - * Contatos: - * - * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) - * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) - * - */ - -#if defined WIN32 - - // http://msdn.microsoft.com/en-us/library/windows/desktop/ms684179(v=vs.85).aspx - #ifndef LOAD_LIBRARY_SEARCH_DEFAULT_DIRS - #define LOAD_LIBRARY_SEARCH_DEFAULT_DIRS 0x00001000 - #endif // LOAD_LIBRARY_SEARCH_DEFAULT_DIRS - - #ifndef LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR - #define LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR 0x00000100 - #endif // LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR - - #include - -#endif - - #include "private.h" - - #include - #include - #include - #include - - #include - #include - #include - #include - #include - #include - #include - #include - #include - - -/*--[ Globals ]--------------------------------------------------------------------------------------*/ - -#if GTK_CHECK_VERSION(2,32,0) - static GMutex mutex; -#else - static GStaticMutex mutex = G_STATIC_MUTEX_INIT; -#endif // GTK_CHECK_VERSION - - using namespace std; - - -/*---[ Implement ]----------------------------------------------------------------------------------*/ - -namespace PW3270_NAMESPACE { - - void java::lock() { -#if GTK_CHECK_VERSION(2,32,0) - g_mutex_lock(&mutex); -#else - g_static_mutex_lock(&mutex); -#endif // GTK_CHECK_VERSION - } - - void java::unlock() { -#if GTK_CHECK_VERSION(2,32,0) - g_mutex_unlock(&mutex); -#else - g_static_mutex_unlock(&mutex); -#endif // GTK_CHECK_VERSION - } - - bool java::trylock() { -#if GTK_CHECK_VERSION(2,32,0) - return g_mutex_trylock(&mutex); -#else - return g_static_mutex_trylock(&mutex); -#endif // GTK_CHECK_VERSION - } - -} - -using namespace PW3270_NAMESPACE; - -extern "C" { - - static PW3270_NAMESPACE::session * factory(const char *name) { - return session::create_local(lib3270_get_default_session_handle()); - } - - LIB3270_EXPORT int pw3270_plugin_start(GtkWidget *window, GtkWidget *terminal) { - - trace("JAVA: %s",__FUNCTION__); - - #if GTK_CHECK_VERSION(2,32,0) - g_mutex_init(&mutex); - #endif // GTK_CHECK_VERSION - - session::set_plugin(factory); - - return 0; - } - - LIB3270_EXPORT int pw3270_plugin_stop(GtkWidget *window, GtkWidget *terminal) { - - java::lock(); - - if(java::jvm) { - java::jvm->DestroyJavaVM(); - java::jvm = NULL; - } - - java::unlock(); - - #if GTK_CHECK_VERSION(2,32,0) - g_mutex_clear(&mutex); - #endif // GTK_CHECK_VERSION - - trace("JAVA: %s",__FUNCTION__); - - return 0; - } - - -} - diff --git a/src/java/private.h b/src/java/private.h deleted file mode 100644 index a7e04e5..0000000 --- a/src/java/private.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 - * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a - * aplicativos mainframe. Registro no INPI sob o nome G3270. - * - * Copyright (C) <2008> - * - * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob - * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela - * Free Software Foundation. - * - * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER - * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO - * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para - * obter mais detalhes. - * - * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este - * programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA, 02111-1307, USA - * - * Este programa está nomeado como private.h e possui - linhas de código. - * - * Contatos: - * - * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) - * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) - * - * Referências: - * - * http://thebreakfastpost.com/2012/01/26/wrapping-a-c-library-with-jni-part-2/ - * - */ -#ifndef PRIVATE_H_INCLUDED - - #define PRIVATE_H_INCLUDED - - #include - #include - - #include - #include - -#ifdef PW3270_PLUGIN - #include - #include -#endif // PW3270_PLUGIN - - namespace PW3270_NAMESPACE { - - namespace java { - -#ifdef _WIN32 - extern HMODULE hModule; -#endif // WIN32 - - extern JavaVM * jvm; - extern JNIEnv * env; - - PW3270_NAMESPACE::session * getHandle(JNIEnv *env, jobject obj); - jfieldID getHandleField(JNIEnv *env, jobject obj); - - void lock(); - void unlock(); - bool trylock(); - -#ifdef PW3270_PLUGIN - bool load_jvm(GtkWidget *widget); - void call(GtkWidget *widget, const char *filename); - void failed(GtkWidget *widget, const char *msg, const char *format, ...); -#endif // PW3270_PLUGIN - - - - - } - - - } - - - - -#endif // PRIVATE_H_INCLUDED diff --git a/src/java/run.sh b/src/java/run.sh deleted file mode 100755 index 2c1e584..0000000 --- a/src/java/run.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -make -C ../.. Debug -make Debug -make .bin/java/${1}.class - -LD_LIBRARY_PATH=../../.bin/Debug/lib/ java -Djava.library.path=/usr/local/lib64/java:.bin/Debug/lib -cp .bin/java/ ${1} - diff --git a/src/java/sample/efglobe.java b/src/java/sample/efglobe.java deleted file mode 100755 index 20d1108..0000000 --- a/src/java/sample/efglobe.java +++ /dev/null @@ -1,26 +0,0 @@ - -import pw3270.*; - -public class efglobe -{ - public static void main (String[] args) - { - try - { - terminal host = new terminal(); - - host.connect("tn3270://zos.efglobe.com:telnet",10); - - host.wait_for_ready(10); - - System.out.println("Read: [" + host.get_string_at(14,19,38)+"]"); - - host.disconnect(); - - } - catch( Exception e ) - { - System.err.println(e); - } - } -}; diff --git a/src/java/sample/except.java b/src/java/sample/except.java deleted file mode 100644 index 40d2ced..0000000 --- a/src/java/sample/except.java +++ /dev/null @@ -1,11 +0,0 @@ -public class except -{ - public static void main (String[] args) throws Exception - { - throw new Exception("Testing exceptions"); - } -}; - - - - diff --git a/src/java/sample/out.java b/src/java/sample/out.java deleted file mode 100755 index ee4d1c3..0000000 --- a/src/java/sample/out.java +++ /dev/null @@ -1,9 +0,0 @@ - -public class out -{ - public static void main (String[] args) - { - System.out.println("Test out"); - System.err.println("Test err"); - } -}; diff --git a/src/java/sample/popup.java b/src/java/sample/popup.java deleted file mode 100755 index 1db45fb..0000000 --- a/src/java/sample/popup.java +++ /dev/null @@ -1,23 +0,0 @@ - -import pw3270.*; - -public class popup -{ - public static void main (String[] args) - { - System.out.println("Begin"); - - try { - - terminal host = new terminal(); - System.out.println("Output: " + host.popup_dialog(0,"Title","This is a popup message", "And this is a secondary and more detailed text")); - - } catch( Exception e ) { - - System.out.println("Error: " + e); - - } - - System.out.println("End"); - } -}; diff --git a/src/java/sample/prot.java b/src/java/sample/prot.java deleted file mode 100755 index fae4073..0000000 --- a/src/java/sample/prot.java +++ /dev/null @@ -1,26 +0,0 @@ - -import pw3270.*; - -public class prot -{ - public static void main (String[] args) - { - System.out.println("Begin"); - - try { - - terminal host = new terminal(); - - host.popup_dialog(0,"19,39","Testing","Position 19,39 is " + (host.get_is_protected_at(19,39) == 0 ? "un" : "") + "protected"); - host.popup_dialog(0,"20,39","Testing","Position 19,39 is " + (host.get_is_protected_at(20,39) == 0 ? "un" : "") + "protected"); - - - } catch( Exception e ) { - - System.out.println("Error: " + e); - - } - - System.out.println("End"); - } -}; diff --git a/src/java/startstop.cc b/src/java/startstop.cc deleted file mode 100644 index 67a75c6..0000000 --- a/src/java/startstop.cc +++ /dev/null @@ -1,419 +0,0 @@ -/* - * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 - * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a - * aplicativos mainframe. Registro no INPI sob o nome G3270. - * - * Copyright (C) <2008> - * - * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob - * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela - * Free Software Foundation. - * - * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER - * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO - * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para - * obter mais detalhes. - * - * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este - * programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA, 02111-1307, USA - * - * Este programa está nomeado como startstop.cc e possui - linhas de código. - * - * Contatos: - * - * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) - * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) - * - */ - -#if defined WIN32 - - // http://msdn.microsoft.com/en-us/library/windows/desktop/ms684179(v=vs.85).aspx - #ifndef LOAD_LIBRARY_SEARCH_DEFAULT_DIRS - #define LOAD_LIBRARY_SEARCH_DEFAULT_DIRS 0x00001000 - #endif // LOAD_LIBRARY_SEARCH_DEFAULT_DIRS - - #ifndef LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR - #define LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR 0x00000100 - #endif // LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR - - #include - -#else - - #include - -#endif - - #include "private.h" - - #include - #include - #include - #include - #include - #include - #include - #include - #include - -/*---[ Implement ]----------------------------------------------------------------------------------*/ - -using namespace PW3270_NAMESPACE::java; - -extern "C" { - - static void trace_cleanup(GtkWidget *widget, GtkWidget **window) { - *window = NULL; - } - - static jint JNICALL jni_vfprintf(FILE *fp, const char *fmt, va_list args) { - - char * msg = NULL; - static GtkWidget * trace = NULL; - - if(vasprintf(&msg,fmt,args) < 1) { - lib3270_write_log(lib3270_get_default_session_handle(),"java","vasprintf() error on \"%s\"",fmt); - return 0; - } - - fprintf(fp,"%s",msg); - lib3270_write_log(lib3270_get_default_session_handle(),"java","%s",msg); - - if(!trace) { - // Cria janela de trace. - trace = pw3270_trace_new(); - g_signal_connect(G_OBJECT(trace), "destroy",G_CALLBACK(trace_cleanup), &trace); - - pw3270_trace_set_destroy_on_close(trace,TRUE); - - // gtk_window_set_transient_for(GTK_WINDOW(trace),GTK_WINDOW(gtk_widget_get_toplevel(widget))); - gtk_window_set_destroy_with_parent(GTK_WINDOW(trace),TRUE); - - gtk_window_set_default_size(GTK_WINDOW(trace),590,430); - gtk_widget_show_all(trace); - - pw3270_trace_printf(trace,"%s",msg); - - free(msg); - } - - return 0; - } - - LIB3270_EXPORT void pw3270_action_java_activated(GtkAction *action, GtkWidget *widget) { - - gchar *classname = (gchar *) g_object_get_data(G_OBJECT(action),"src"); - - lib3270_trace_event(v3270_get_session(widget),"Action %s activated on widget %p\n",gtk_action_get_name(action),widget); - - if(classname) - { - // Has filename, call it directly - call(widget,classname); - } - else - { -/* - // No classname, ask user - filename = pw3270_file_chooser(GTK_FILE_CHOOSER_ACTION_OPEN, "java", _( "Select script to run" ), "", "class"); - - if(filename) - { - call(widget,filename); - g_free(filename); - } -*/ - } - - } - } - - - namespace PW3270_NAMESPACE { - - JavaVM * java::jvm = NULL; - JNIEnv * java::env = NULL; -#ifdef _WIN32 - HMODULE java::hModule = NULL; -#endif // _WIN32 - - void java::failed(GtkWidget *widget, const char *msg, const char *format, ...) { - - GtkWidget *dialog = gtk_message_dialog_new( GTK_WINDOW(gtk_widget_get_toplevel(widget)), - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_OK_CANCEL, - "%s", msg ); - - gtk_window_set_title(GTK_WINDOW(dialog), _( "Java error" )); - - if(format) { - - va_list arg_ptr; - va_start(arg_ptr, format); - gchar *msg = g_strdup_vprintf(format,arg_ptr); - va_end(arg_ptr); - gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog),"%s",msg); - g_free(msg); - - } - - if(gtk_dialog_run(GTK_DIALOG (dialog)) == GTK_RESPONSE_CANCEL) - gtk_main_quit(); - gtk_widget_destroy(dialog); - - } - - -#ifdef WIN32 - - bool java::load_jvm(GtkWidget *widget) { - - if(jvm != NULL) { - return true; - } - - // Dynamically load jvm library to avoid naming and path problems. - HMODULE kernel; - HANDLE WINAPI (*AddDllDirectory)(PCWSTR NewDirectory); - BOOL WINAPI (*RemoveDllDirectory)(HANDLE Cookie); - - struct _dlldir { - const gchar * env; - const gchar * path; - HANDLE cookie; - } dlldir[] = { - { "JRE_HOME", "bin\\client", 0 }, - { "JDK_HOME", "jre\\bin\\client", 0 } - }; - - kernel = LoadLibrary("kernel32.dll"); - - if(kernel) { - - AddDllDirectory = (HANDLE WINAPI (*)(PCWSTR)) GetProcAddress(kernel,"AddDllDirectory"); - if(AddDllDirectory) { - - // Acrescenta mais caminhos para achar a dll - for(size_t f = 0; f < G_N_ELEMENTS(dlldir); f++) { - - const char *env = getenv(dlldir[f].env); - - debug("%s=\"%s\"",dlldir[f].env,env); - - if(env) { - - gchar *p = g_build_filename(env,dlldir[f].path,NULL); - - lib3270_trace_event(v3270_get_session(widget),"Adding \"%s\" to DLL search path",p); - - wchar_t *path = (wchar_t *) malloc(4096*sizeof(wchar_t)); - mbstowcs(path, p, 4095); - dlldir[f].cookie = AddDllDirectory(path); - free(path); - - g_free(p); - - } - } - - } else { - - lib3270_trace_event(v3270_get_session(widget),"Can't find %s: %s","AddDllDirectory",session::win32_strerror(GetLastError()).c_str()); - - } - - } else { - - lib3270_trace_event(v3270_get_session(widget),"Can't load %s: %s\n","kernel32.dll",session::win32_strerror(GetLastError()).c_str()); - - } - - hModule = LoadLibrary("jvm.dll"); - if(!hModule) { - lib3270_trace_event(v3270_get_session(widget),"Can't load %s\n","jvm.dll",session::win32_strerror(GetLastError()).c_str()); - - for(size_t f = 0; !hModule && f < G_N_ELEMENTS(dlldir); f++) { - - const char *env = getenv(dlldir[f].env); - - debug("%s=\"%s\"",dlldir[f].env,env); - - if(env) { - - gchar *p = g_build_filename(env,dlldir[f].path,"jvm.dll",NULL); - hModule = LoadLibrary(p); - if(!hModule) { - lib3270_trace_event(v3270_get_session(widget),"Can't load %s: %s\n",p,session::win32_strerror(GetLastError()).c_str()); - } - g_free(p); - - } - } - } - - if(!hModule) { - failed(widget, _( "Can't load java virtual machine" ), "%s", session::win32_strerror(GetLastError()).c_str()); - } - - if(kernel) { - - RemoveDllDirectory = (BOOL WINAPI (*)(HANDLE)) GetProcAddress(kernel,"RemoveDllDirectory"); - if(RemoveDllDirectory) { - - for(size_t f = 0; f < G_N_ELEMENTS(dlldir); f++) { - - if(dlldir[f].cookie) { - - RemoveDllDirectory(dlldir[f].cookie); - - } - } - - } - - FreeLibrary(kernel); - - } - - if(!hModule) { - return false; - } - - // Consegui carregar a JVM, obtenho o método de controle - jint JNICALL (*CreateJavaVM)(JavaVM **, void **, void *) = (jint JNICALL (*)(JavaVM **, void **, void *)) GetProcAddress(hModule,"JNI_CreateJavaVM"); - - if(!CreateJavaVM) { - failed(widget, _( "Can't load java virtual machine creation method" ), "%s", session::win32_strerror(GetLastError()).c_str()); - return false; - } - - // Crio a JVM - JavaVMInitArgs vm_args; - JavaVMOption options[5]; - - jint rc = 0; - - memset(&vm_args,0,sizeof(vm_args)); - memset(options,0,sizeof(options)); - - vm_args.version = JNI_VERSION_1_4; - vm_args.nOptions = 0; - vm_args.options = options; - vm_args.ignoreUnrecognized = JNI_FALSE; - - options[vm_args.nOptions].optionString = g_strdup("vfprintf"); - options[vm_args.nOptions].extraInfo = (void *) jni_vfprintf; - vm_args.nOptions++; - - gchar * exports = NULL; - char buffer[1024]; - gchar * myDir; - - if(GetModuleFileName(NULL,buffer,sizeof(buffer)) < sizeof(buffer)) { - - gchar * ptr = strrchr(buffer,G_DIR_SEPARATOR); - if(ptr) { - *ptr = 0; - myDir = g_strdup(buffer); - } else { - myDir = g_strdup("."); - } - - - } else { - - myDir = g_strdup("."); - - } - - debug("myDir=%s",myDir); - - exports = g_build_filename(myDir,"jvm-exports",NULL); - g_mkdir_with_parents(exports,0777); - - lib3270_trace_event(v3270_get_session(widget),"java.class.path=%s",exports); - lib3270_trace_event(v3270_get_session(widget),"java.library.path=%s",myDir); - - options[vm_args.nOptions++].optionString = g_strdup_printf("-Djava.class.path=%s",exports); - options[vm_args.nOptions++].optionString = g_strdup_printf("-Djava.library.path=%s",myDir); - - g_free(myDir); - g_free(exports); - - rc = CreateJavaVM(&jvm,(void **)&env,&vm_args); - if(rc < 0) { - failed(widget, _( "Can't create java VM" ), _( "The error code was %d" ), (int) rc); - jvm = NULL; - } - - for(int f=0;f - * - * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob - * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela - * Free Software Foundation. - * - * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER - * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO - * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para - * obter mais detalhes. - * - * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este - * programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA, 02111-1307, USA - * - * Este programa está nomeado como terminal.java e possui - linhas de código. - * - * Contatos: - * - * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) - * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) - * - */ - -package pw3270; - -public class terminal -{ - // Is native library loaded? - private static boolean loaded = false; - - // lib3270's session handle - private long nativeHandle; - - // Init/Deinit - private native int init(); - private native int init(String id); - private native int deinit(); - - /** - * Wait for an specified amount of time. - *

- * Wait for the specified time keeping the main loop active. - * - * @param seconds Number of seconds to wait. - * - */ - public native int wait(int seconds); - - /** - * Wait for terminal negociation. - *

- * Wait on a loop until the terminal contents are - * ready for reading. - * - * @param seconds Maximum time (in seconds) to wait for. - * - * @return 0 for success, error code if not. - * - */ - public native int wait_for_ready(int seconds); - - /** - * Wait for text at defined position - * - * @param row Row for text to compare. - * @param col Column for text to compare. - * @param text String to compare. - * @param seconds Maximum time (in seconds) to wait for. - * - * @return 0 for success, error code if not. - * - */ - public native int wait_for_string_at(int row, int col, String text, int seconds); - - /** - * Get the current lib3270 version. - * - * @return String with the current lib3270 version. - * - */ - public native String get_version(); - - /** - * Get the current lib3270 revision. - * - * @return String with the current lib3270 revision. - * - */ - public native String get_revision(); - - /** - * Get the current lib3270 encoding. - * - * @return String with the current lib3270 encoding (ISO-8859-1). - * - */ - public native String get_encoding(); - - // Get/Set/Text with charset translation - - /** - * Get terminal contents starting at desired address. - * - * @param baddr Address of the beginning of the string. - * @param len Length of the string. - * - * @return Terminal contents with "len" bytes starting at "baddr" position. - * - */ - public native String get_string(int baddr, int len); - - /** - * Get terminal contents starting at row, col. - * - * @param row Row of the text. - * @param col Column of the text. - * @param sz Size to read. - * - * @return Contents of terminal at row, col with sz bytes. - * - */ - public native String get_string_at(int row, int col, int sz); - - /** - * Set terminal contents at position. - * - * @param row Row for starting of change. - * @param col Column for starting of change. - * @param str Text to set. - * - * @return 0 if ok, error code if not. - * - */ - public native int set_string_at(int row, int col, String str); - - /** - * Compare terminal contents. - * - * @param row Row for text to compare. - * @param col Column for text to compare. - * @param text String to compare. - * - * @return result of strcmp() from text and terminal contents. - * - */ - public native int cmp_string_at(int row, int col, String text); - - - public native int input_string(String str); - - // Cursor management - - /** - * Move cursor to selected position. - * - * @param row Row of the new cursor position. - * @param col Column of the new cursor position. - * - * @return Address of current cursor position. - * - */ - public native int set_cursor_position(int row, int col); - - /** - * Set cursor offset in the terminal buffer. - * - * @param addr New cursor offset. - * - * @return Original cursor offset. - * - */ - public native int set_cursor_addr(int addr); - - /** - * Get cursor offset - * - * @return Current cursor offset. - * - */ - public native int get_cursor_addr(); - - // Keyboard actions - - /** - * Send an "ENTER" action. - * - * @return reserved. - * - */ - public native int enter(); - - /** - * Send a pfkey to host. - * - * @param key PFkey number. - * - * @return reserved. - * - */ - public native int pfkey(int key); - - /** - * Send a pakey to host. - * - * @param key PFkey number. - * - * @return reserved. - * - */ - public native int pakey(int key); - - // Actions - - /** - * quit remote pw3270 window. - *

- * Only valid if connected to a remote window - * - * @return reserved. - * - */ - public native int quit(); - - public native int erase(); - public native int erase_eol(); - public native int erase_input(); - - - /** - * Erase from cursor position until the end of the field. - * - * @return reserved. - * - */ - public native int erase_eof(); - - - /** - * Open print dialog. - *

- * Only valid if connected to a remote window - * - * @return reserved - * - */ - public native int print(); - - // Connect/Disconnect - - /** - * Connect to 3270 host. - *

- * Connect to the 3270 host - *

- * URI formats: - *

    - *
  • tn3270://[HOSTNAME]:[HOSTPORT] for non SSL connections.
  • - *
  • tn3270s://[HOSTNAME]:[HOSTPORT] for ssl connection.
  • - *
- * - * @param host Host URI. - * @param seconds How many seconds to wait for a connection. - * - * @return 0 if ok, error code if not. - * - */ - public native int connect(String host, int seconds); - - /** - * Disconnect from host. - * - * @return 0 if ok, error code if not. - * - */ - public native int disconnect(); - - /** - * Load native module. - * - */ - private synchronized void load() { - - if(!loaded) { - System.loadLibrary("jni3270"); - loaded = true; - } - - } - - /** - * Creates a tn3270 terminal without associating it - * with any pw3270 window. - * - */ - public terminal() { - - load(); - init(); - - } - - /** - * Get the field start address. - * - * @param baddr address of the field. - * - * @return Address of current field start. - * - */ - public native int get_field_start(int baddr); - - /** - * Get the current field start address. - * - * @return Current field start address. - * - */ - public int get_field_start() { - return get_field_start(-1); - } - - /** - * Get the field length. - * - * @param baddr Address of the field. - * - * @return Field length. - * - */ - public native int get_field_len(int baddr); - - /** - * Get the current field length. - * - * @return Current field length. - * - */ - public int get_field_len() { - return get_field_len(-1); - } - - /** - * Get next field address from informed position. - * - * @param baddr Field address. - * - * @return Address of the next field. - * - */ - public native int get_next_unprotected(int baddr); - - /** - * Check if the address is protected. - * - * @param baddr Field address. - * - * @return Protect state. - * - */ - public native int get_is_protected(int baddr); - - /** - * Check if the address is protected. - * - * @param row Screen row. - * @param col Screen col. - * - * @return Protect state. - * - */ - public native int get_is_protected_at(int row, int col); - - /** - * Get next field address. - * - * @return Address of the next field. - * - */ - public int get_next_unprotected() { - return get_next_unprotected(-1); - } - - /** - * Open popup dialog. - * - * @param id Dialog type. - * @param title Window title. - * @param message Dialog message. - * @param secondary Dialog secondary text. - * - * @return reserved. - * - */ - public native int popup_dialog(int id, String title, String message, String secondary); - - /** - * Launch a lib3270 action by name. - * - * @param name Name of the action to fire. - * - * @return Return code of the action call. - * - */ - public native int action(String name); - - /** - * File selection dialog. - * - * @param action Dialog action. - * @param title Window title. - * @param extension File extension. - * @param filename Default file name; - * - * @return Selected file name. - * - */ - public native String file_chooser_dialog(int action, String title, String extension, String filename); - - public native int set_copy(String text); - public native String get_copy(); - - public native String get_clipboard(); - public native int set_clipboard(String text); - - 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); - - /** - * Get Screen contents. - * - */ - public native String toString(); - - /** - * Get connection SSL state - * - * @return State of SSL connection (0 = Unsafe, 1 = Valid CA, 2 = Invalid CA or self-signed, 3 = Negotiating, 4 = Undefined) - * - */ - public native int get_secure(); - - /** - * Creates a tn3270 terminal associated with a - * pw3270 window. - * - * @param id String identifying the target window ("pw3270:a") or "" to run without window. - * - */ - public terminal(String id) { - load(); - init(id); - } - - protected void finalize( ) throws Throwable { - deinit(); - } - -}; diff --git a/src/java/testprogram.java b/src/java/testprogram.java deleted file mode 100644 index 29e7228..0000000 --- a/src/java/testprogram.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 - * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a - * aplicativos mainframe. Registro no INPI sob o nome G3270. - * - * Copyright (C) <2008> - * - * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob - * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela - * Free Software Foundation. - * - * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER - * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO - * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para - * obter mais detalhes. - * - * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este - * programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA, 02111-1307, USA - * - * Este programa está nomeado como lib3270.java e possui - linhas de código. - * - * Contatos: - * - * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) - * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) - * - */ - -import pw3270.*; - -public class testprogram -{ - public static void main (String[] args) - { - try - { - System.err.println("Begin"); - - terminal host = new terminal(); - - host.log("Sample message"); - - System.err.println("pw3270 version " + host.get_version() + " revision " + host.get_revision() + " encoding " + host.get_encoding()); - System.err.println("SSL state is " + host.get_secure()); - - System.err.println("End"); - } - catch( Exception e ) - { - System.err.println(e); - } - } -}; diff --git a/src/loffice/Makefile.in b/src/loffice/Makefile.in deleted file mode 100644 index c84646a..0000000 --- a/src/loffice/Makefile.in +++ /dev/null @@ -1,263 +0,0 @@ -# -# "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 -# (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a -# aplicativos mainframe. Registro no INPI sob o nome G3270. -# -# Copyright (C) <2008> -# -# Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob -# os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela -# Free Software Foundation. -# -# Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER -# GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO -# A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para -# obter mais detalhes. -# -# Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este -# programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple -# Place, Suite 330, Boston, MA, 02111-1307, USA -# -# Contatos: -# -# perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) -# erico.mendonca@gmail.com (Erico Mascarenhas de Mendonça) -# - -PACKAGE_NAME=@PACKAGE_NAME@ -SOURCES=info.cc get.cc set.cc service.cc init.cc connect.cc - -UNO_CLASSES= /com/sun/star/uno/XWeak \ - /com/sun/star/uno/RuntimeException \ - /com/sun/star/lang/WrappedTargetException - - -#---[ LibreOffice SDK ]-------------------------------------------------------- - -OO_SDK_HOME=@OO_SDK_HOME@ -OO_SDK_URE_HOME=@OO_SDK_URE_HOME@ - -UNO=@UNO@ -UNOPKG=@UNOPKG@ -IDLC=@IDLC@ -REGMERGE=@REGMERGE@ -CPPUMAKER=@CPPUMAKER@ -CONVERT=@CONVERT@ -ZIP=@ZIP@ - -TYPES_RDB=@OO_TYPES@ - -#---[ Paths ]------------------------------------------------------------------ - -prefix=@prefix@ -exec_prefix=@exec_prefix@ -bindir=@bindir@ -sbindir=@sbindir@ -libdir=@libdir@ -includedir=@includedir@ -instdir=$(DESTDIR)/$(libdir)/libreoffice/share/extensions/$(PACKAGE_NAME) - -#---[ Tools ]------------------------------------------------------------------ - -CXX=@CXX@ -MKDIR=@MKDIR_P@ -INSTALL=@INSTALL@ -INSTALL_DATA=@INSTALL_DATA@ -INSTALL_PROGRAM=@INSTALL_PROGRAM@ - -#---[ Paths ]------------------------------------------------------------------ - -OBJDIR ?= .obj -BINDIR ?= .bin -RDBDIR ?= .rdb -URDDIR ?= .urd - -OBJDBG ?= $(OBJDIR)/Debug -BINDBG ?= $(BINDIR)/Debug - -OBJRLS ?= $(OBJDIR)/Release -BINRLS ?= $(BINDIR)/Release - -#---[ lib3270 common class ]--------------------------------------------------- - -DEBUG_CFLAGS=-DDEBUG=1 -g -Wall -PW3270_CFLAGS=-I../include -CLASSLIBDIR=../classlib -include $(CLASSLIBDIR)/class.mak - -#---[ Build options ]---------------------------------------------------------- - -CXXFLAGS=@CXXFLAGS@ @OO_CXXFLAGS@ -I../include -I./include -DLANGUAGE_BINDING_NAME=\"gcc3\" - -OO_LDFLAGS=-L$(OO_SDK_HOME)/lib -L$(OO_SDK_URE_HOME)/lib \ - -Wl,-rpath-link=$(OO_SDK_URE_HOME)/lib,-rpath=$(OO_SDK_URE_HOME)/lib \ - @OO_LDFLAGS@ - -#---[ Rules ]------------------------------------------------------------------ - -$(URDDIR)/%.urd: %.idl - @echo " IDLC `basename $@`" - @$(MKDIR) `dirname $@` - @$(IDLC) -w -C -I$(OO_SDK_HOME)/idl -O`dirname $@` $< - -$(URDDIR)/%.urd: @IDLDIR@/%.idl - @echo " IDLC `basename $@`" - @$(MKDIR) `dirname $@` - @$(IDLC) -w -C -I$(OO_SDK_HOME)/idl -O`dirname $@` $< - -$(RDBDIR)/%.rdb: $(URDDIR)/%.urd - @echo " REGM `basename $@`" - @$(MKDIR) `dirname $@` - @$(REGMERGE) $@ /UCR $< - -include/%.hpp: $(RDBDIR)/%.rdb - @echo " CPPU `basename $@`" - @$(MKDIR) `dirname $@` - @$(CPPUMAKER) -O./include $(TYPES_RDB) $< - -$(OBJDBG)/%.o: %.cc include/$(PACKAGE_NAME)/lib3270.hpp \ - $(foreach CLS, $(UNO_CLASSES), include/$(CLS).hpp) \ - globals.hpp \ - Makefile - @echo " CC `basename $@`" - @mkdir -p `dirname $@` - @$(CXX) -DDEBUG=1 $(CXXFLAGS) -o $@ -c $< - -$(OBJRLS)/%.o: %.cc include/$(PACKAGE_NAME)/lib3270.hpp \ - $(foreach CLS, $(UNO_CLASSES), include/$(CLS).hpp) \ - globals.hpp \ - Makefile - @echo " CC `basename $@`" - @mkdir -p `dirname $@` - @$(CXX) -DNDEBUG=1 $(CXXFLAGS) -o $@ -c $< - -#---[ UNO targets ]------------------------------------------------------------ - -include/$(PACKAGE_NAME)/lib3270.hpp: $(RDBDIR)/$(PACKAGE_NAME).rdb - @echo " CPPU `basename $@`" - @$(MKDIR) `dirname $@` - @$(CPPUMAKER) -O./include -T$(PACKAGE_NAME).lib3270 $(TYPES_RDB) $< - -#---[ Release targets ]-------------------------------------------------------- - -all: $(BINDIR)/$(PACKAGE_NAME).oxt - -Release: include/$(PACKAGE_NAME)/lib3270.hpp \ - $(foreach CLS, $(UNO_CLASSES), include/$(CLS).hpp) \ - $(RDBDIR)/$(PACKAGE_NAME).rdb \ - $(BINDIR)/$(PACKAGE_NAME).oxt - -install: $(BINRLS)/$(PACKAGE_NAME).uno@DLLEXT@ \ - $(RDBDIR)/$(PACKAGE_NAME).rdb \ - description.xml \ - manifest.xml \ - description.txt - @$(MKDIR) $(instdir) - @$(MKDIR) $(instdir)/META-INF - @$(INSTALL_DATA) manifest.xml $(instdir)/META-INF - - @$(INSTALL_DATA) description.xml $(instdir) - @$(INSTALL_DATA) description.txt $(instdir) - - @$(INSTALL_PROGRAM) $(BINRLS)/$(PACKAGE_NAME).uno@DLLEXT@ $(instdir) - @$(INSTALL_DATA) $(RDBDIR)/$(PACKAGE_NAME).rdb $(instdir) - - @$(CONVERT) ../$(PACKAGE_NAME)/pixmaps/$(PACKAGE_NAME).svg --format=png > $(instdir)/$(PACKAGE_NAME).png - @chmod 644 $(instdir)/$(PACKAGE_NAME).png - -$(BINDIR)/$(PACKAGE_NAME).oxt: \ - $(BINRLS)/$(PACKAGE_NAME).uno@DLLEXT@ \ - $(RDBDIR)/$(PACKAGE_NAME).rdb \ - description.xml \ - manifest.xml \ - description.txt - @rm -f $@ - @$(MKDIR) `dirname $@` - - @$(MKDIR) $(BINRLS)/$(PACKAGE).oxt.tmp - - @cp $(RDBDIR)/$(PACKAGE_NAME).rdb $(BINRLS)/$(PACKAGE).oxt.tmp - @cp $(BINRLS)/$(PACKAGE_NAME).uno@DLLEXT@ $(BINRLS)/$(PACKAGE).oxt.tmp - - @$(MKDIR) $(BINRLS)/$(PACKAGE).oxt.tmp/META-INF - @cp manifest.xml $(BINRLS)/$(PACKAGE).oxt.tmp/META-INF - - @cp description.xml $(BINRLS)/$(PACKAGE).oxt.tmp - @cp description.txt $(BINRLS)/$(PACKAGE).oxt.tmp - - @$(CONVERT) ../$(PACKAGE_NAME)/pixmaps/$(PACKAGE_NAME).svg --format=png > $(BINRLS)/$(PACKAGE).oxt.tmp/$(PACKAGE_NAME).png - - @cd $(BINRLS)/$(PACKAGE).oxt.tmp ; $(ZIP) -r -m ../$(PACKAGE_NAME).oxt . - @rm -fr $(BINRLS)/$(PACKAGE).oxt.tmp - @echo $@ Ok. - -$(BINRLS)/$(PACKAGE_NAME).uno@DLLEXT@: \ - $(foreach SRC, $(basename $(SOURCES)), $(OBJRLS)/$(SRC)@OBJEXT@) \ - $(CLASS_RELEASE_OBJECTS) - @echo " LD `basename $@`" - @$(MKDIR) `dirname $@` - @$(CXX) @SYSDLL_FLAGS@ $(LDFLAGS) $(OO_LDFLAGS) $(CLASS_LIBS) -o $@ $^ - - -#---[ Debug targets ]---------------------------------------------------------- - -Debug: $(BINDBG)/$(PACKAGE_NAME).oxt - -run: $(BINDBG)/$(PACKAGE_NAME).oxt - @SHARED=false $(UNOPKG) add --verbose --force $(BINDBG)/$(PACKAGE_NAME).oxt - @libreoffice testmacros.odt - @SHARED=false $(UNOPKG) remove $(PACKAGE_NAME) - -add: $(BINDBG)/$(PACKAGE_NAME).oxt - @SHARED=false $(UNOPKG) add --verbose --force $(BINDBG)/$(PACKAGE_NAME).oxt - -$(BINDBG)/$(PACKAGE_NAME).uno@DLLEXT@: \ - $(foreach SRC, $(basename $(SOURCES)), $(OBJDBG)/$(SRC)@OBJEXT@) \ - $(CLASS_DEBUG_OBJECTS) - @echo " LD `basename $@`" - @$(MKDIR) `dirname $@` - @$(CXX) @SYSDLL_FLAGS@ $(LDFLAGS) $(OO_LDFLAGS) $(CLASS_LIBS) -o $@ $^ - - -$(BINDBG)/$(PACKAGE_NAME).oxt: \ - $(BINDBG)/$(PACKAGE_NAME).uno@DLLEXT@ \ - $(RDBDIR)/$(PACKAGE_NAME).rdb \ - description.xml \ - manifest.xml \ - description.txt - @rm -f $@ - @$(MKDIR) `dirname $@` - - @$(MKDIR) $(BINDBG)/$(PACKAGE).oxt.tmp - - @cp $(RDBDIR)/$(PACKAGE_NAME).rdb $(BINDBG)/$(PACKAGE).oxt.tmp - @cp $(BINDBG)/$(PACKAGE_NAME).uno@DLLEXT@ $(BINDBG)/$(PACKAGE).oxt.tmp - - @$(MKDIR) $(BINDBG)/$(PACKAGE).oxt.tmp/META-INF - @cp manifest.xml $(BINDBG)/$(PACKAGE).oxt.tmp/META-INF - - @cp description.xml $(BINDBG)/$(PACKAGE).oxt.tmp - @cp description.txt $(BINDBG)/$(PACKAGE).oxt.tmp - - @$(CONVERT) ../$(PACKAGE_NAME)/pixmaps/$(PACKAGE_NAME).svg --format=png > $(BINDBG)/$(PACKAGE).oxt.tmp/$(PACKAGE_NAME).png - - @cp $(BINDBG)/$(PACKAGE_NAME).uno@DLLEXT@ $(BINDBG)/$(PACKAGE_NAME).oxt.tmp - @cd $(BINDBG)/$(PACKAGE).oxt.tmp ; $(ZIP) -r -m ../$(PACKAGE_NAME).oxt . - @rm -fr $(BINDBG)/$(PACKAGE).oxt.tmp - @echo $@ Ok. - - -#---[ Misc targets ]----------------------------------------------------------- - -cleanDebug: clean - -clean: - @rm -f *.urd - @rm -fr $(RDBDIR) - @rm -fr $(URDDIR) - @rm -fr include - @rm -f *.rdb - @rm -fr $(OBJDIR) - @rm -fr $(BINDIR) - - diff --git a/src/loffice/connect.cc b/src/loffice/connect.cc deleted file mode 100644 index 5e34d29..0000000 --- a/src/loffice/connect.cc +++ /dev/null @@ -1,175 +0,0 @@ -/* - * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 - * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a - * aplicativos mainframe. Registro no INPI sob o nome G3270. - * - * Copyright (C) <2008> - * - * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob - * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela - * Free Software Foundation. - * - * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER - * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO - * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para - * obter mais detalhes. - * - * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este - * programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA, 02111-1307, USA - * - * Este programa está nomeado como connect.cc e possui - linhas de código. - * - * Contatos: - * - * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) - * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) - * - * - */ - - #include "globals.hpp" - #include "pw3270/lib3270.hpp" - #include - #include - -/*---[ Implement ]-----------------------------------------------------------------------------------------*/ - - using namespace pw3270_impl; - -/* -::sal_Int16 SAL_CALL session_impl::Reconnect() throw (::com::sun::star::uno::RuntimeException) - { - trace("%s: hSession=%p",__FUNCTION__,hSession); - - try - { - if(!hSession) - hSession = h3270::session::get_default(); - - return hSession->connect(); - - } catch(std::exception &e) - { - trace("%s failed: %s",__FUNCTION__,e.what()); - - OUString msg = OUString(e.what(),strlen(e.what()),RTL_TEXTENCODING_UTF8,RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_IGNORE); - - throw css::uno::RuntimeException(msg,static_cast< cppu::OWeakObject * >(this)); - - } - - return -1; - - - } -*/ - - ::sal_Int16 SAL_CALL session_impl::Connect(const ::rtl::OUString& url, ::sal_Bool wait) throw (::com::sun::star::uno::RuntimeException) - { - trace("%s: hSession=%p",__FUNCTION__,hSession); - - OString vlr = rtl::OUStringToOString( url , RTL_TEXTENCODING_UNICODE ); - - try - { - if(!hSession) - hSession = h3270::session::get_default(); - - return hSession->connect(vlr.getStr(),wait); - - } catch(std::exception &e) - { - trace("%s failed: %s",__FUNCTION__,e.what()); - - OUString msg = OUString(e.what(),strlen(e.what()),RTL_TEXTENCODING_UTF8,RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_IGNORE); - - throw css::uno::RuntimeException(msg,static_cast< cppu::OWeakObject * >(this)); - - } - - return -1; - - - } - - ::sal_Int16 SAL_CALL session_impl::Disconnect() throw (::com::sun::star::uno::RuntimeException) - { - try - { - CHECK_SESSION_HANDLE - - return hSession->disconnect(); - - } catch(std::exception &e) - { - OUString msg = OUString(e.what(),strlen(e.what()),RTL_TEXTENCODING_UTF8,RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_IGNORE); - - throw css::uno::RuntimeException(msg,static_cast< cppu::OWeakObject * >(this)); - - } - - return -1; - - } - - ::sal_Bool SAL_CALL session_impl::isConnected() throw (::com::sun::star::uno::RuntimeException) - { - try - { - CHECK_SESSION_HANDLE - - return hSession->is_connected(); - - } catch(std::exception &e) - { - OUString msg = OUString(e.what(),strlen(e.what()),RTL_TEXTENCODING_UTF8,RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_IGNORE); - - throw css::uno::RuntimeException(msg,static_cast< cppu::OWeakObject * >(this)); - - } - - return -1; - } - - ::sal_Bool SAL_CALL session_impl::isReady() throw (::com::sun::star::uno::RuntimeException) - { - try - { - CHECK_SESSION_HANDLE - - return hSession->is_ready(); - - } catch(std::exception &e) - { - OUString msg = OUString(e.what(),strlen(e.what()),RTL_TEXTENCODING_UTF8,RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_IGNORE); - - throw css::uno::RuntimeException(msg,static_cast< cppu::OWeakObject * >(this)); - - } - - return -1; - - } - - ::sal_Int16 SAL_CALL session_impl::waitForReady( ::sal_Int16 seconds ) throw (::com::sun::star::uno::RuntimeException) - { - try - { - CHECK_SESSION_HANDLE - - return hSession->wait_for_ready(seconds); - - } catch(std::exception &e) - { - OUString msg = OUString(e.what(),strlen(e.what()),RTL_TEXTENCODING_UTF8,RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_IGNORE); - - throw css::uno::RuntimeException(msg,static_cast< cppu::OWeakObject * >(this)); - - } - - return -1; - - } - - diff --git a/src/loffice/description.txt b/src/loffice/description.txt deleted file mode 100644 index a163cab..0000000 --- a/src/loffice/description.txt +++ /dev/null @@ -1,2 +0,0 @@ -Uno/OpenOffice library allowing 3270 access from StarBasic - diff --git a/src/loffice/description.xml.in b/src/loffice/description.xml.in deleted file mode 100644 index 327d444..0000000 --- a/src/loffice/description.xml.in +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - 3270 access extension - - - - - - - - - - - - - diff --git a/src/loffice/get.cc b/src/loffice/get.cc deleted file mode 100644 index ceb4a0d..0000000 --- a/src/loffice/get.cc +++ /dev/null @@ -1,156 +0,0 @@ -/* - * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 - * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a - * aplicativos mainframe. Registro no INPI sob o nome G3270. - * - * Copyright (C) <2008> - * - * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob - * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela - * Free Software Foundation. - * - * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER - * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO - * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para - * obter mais detalhes. - * - * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este - * programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA, 02111-1307, USA - * - * Este programa está nomeado como get.cc e possui - linhas de código. - * - * Contatos: - * - * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) - * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) - * - * Referência: - * - * https://wiki.openoffice.org/wiki/Documentation/DevGuide/WritingUNO/C%2B%2B/Class_Definition_with_Helper_Template_Classes - * - */ - - #include "globals.hpp" - #include - #include "pw3270/lib3270.hpp" - -/*---[ Implement ]-----------------------------------------------------------------------------------------*/ - - using namespace pw3270_impl; - - ::rtl::OUString session_impl::getVersion() throw (RuntimeException) - { - trace("%s: hSession=%p",__FUNCTION__,hSession); - return OUString( RTL_CONSTASCII_USTRINGPARAM(PACKAGE_VERSION) ); - } - - ::rtl::OUString session_impl::getRevision() throw (RuntimeException) - { - trace("%s: hSession=%p",__FUNCTION__,hSession); - return OUString( RTL_CONSTASCII_USTRINGPARAM(PACKAGE_REVISION) ); - } - - ::rtl::OUString SAL_CALL session_impl::getTextAt( ::sal_Int16 row, ::sal_Int16 col, ::sal_Int16 size ) throw (::com::sun::star::uno::RuntimeException) - { - string s; - - try - { - CHECK_SESSION_HANDLE - s = hSession->get_text_at(row,col,size); - - } catch(std::exception &e) - { - OUString msg = OUString(e.what(),strlen(e.what()),RTL_TEXTENCODING_UTF8,RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_IGNORE); - throw css::uno::RuntimeException(msg,static_cast< cppu::OWeakObject * >(this)); - } - - return OUString(s.c_str(), s.length(), encoding, RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_IGNORE); - } - - ::sal_Int16 SAL_CALL session_impl::waitForTextAt( ::sal_Int16 row, ::sal_Int16 col, const ::rtl::OUString& str, ::sal_Int16 seconds ) throw (::com::sun::star::uno::RuntimeException) - { - try - { - CHECK_SESSION_HANDLE - OString vlr = rtl::OUStringToOString(str,encoding); - return hSession->wait_for_text_at(row,col,vlr.getStr(),seconds); - - } catch(std::exception &e) - { - OUString msg = OUString(e.what(),strlen(e.what()),RTL_TEXTENCODING_UTF8,RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_IGNORE); - throw css::uno::RuntimeException(msg,static_cast< cppu::OWeakObject * >(this)); - } - - return -1; - - } - - ::sal_Int32 SAL_CALL session_impl::getCursorAddress() throw (::com::sun::star::uno::RuntimeException) - { - try - { - CHECK_SESSION_HANDLE - return hSession->get_cursor_addr(); - - } catch(std::exception &e) - { - OUString msg = OUString(e.what(),strlen(e.what()),RTL_TEXTENCODING_UTF8,RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_IGNORE); - throw css::uno::RuntimeException(msg,static_cast< cppu::OWeakObject * >(this)); - } - - return -1; - - } - - ::sal_Int32 SAL_CALL session_impl::getFieldStart( ::sal_Int32 addr ) throw (::com::sun::star::uno::RuntimeException) - { - try - { - CHECK_SESSION_HANDLE - return hSession->get_field_start(addr); - - } catch(std::exception &e) - { - OUString msg = OUString(e.what(),strlen(e.what()),RTL_TEXTENCODING_UTF8,RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_IGNORE); - throw css::uno::RuntimeException(msg,static_cast< cppu::OWeakObject * >(this)); - } - - return -1; - - } - - ::sal_Int32 SAL_CALL session_impl::getFieldLen( ::sal_Int32 addr ) throw (::com::sun::star::uno::RuntimeException) - { - try - { - CHECK_SESSION_HANDLE - return hSession->get_field_len(addr); - - } catch(std::exception &e) - { - OUString msg = OUString(e.what(),strlen(e.what()),RTL_TEXTENCODING_UTF8,RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_IGNORE); - throw css::uno::RuntimeException(msg,static_cast< cppu::OWeakObject * >(this)); - } - - return -1; - - } - - ::sal_Int32 SAL_CALL session_impl::getNextUnprotected( ::sal_Int32 addr ) throw (::com::sun::star::uno::RuntimeException) - { - try - { - CHECK_SESSION_HANDLE - return hSession->get_next_unprotected(addr); - - } catch(std::exception &e) - { - OUString msg = OUString(e.what(),strlen(e.what()),RTL_TEXTENCODING_UTF8,RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_IGNORE); - throw css::uno::RuntimeException(msg,static_cast< cppu::OWeakObject * >(this)); - } - - return -1; - - } diff --git a/src/loffice/globals.hpp b/src/loffice/globals.hpp deleted file mode 100644 index 5c15c45..0000000 --- a/src/loffice/globals.hpp +++ /dev/null @@ -1,151 +0,0 @@ -/* - * "Software PW3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 - * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a - * aplicativos mainframe. Registro no INPI sob o nome G3270. - * - * Copyright (C) <2008> - * - * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob - * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela - * Free Software Foundation. - * - * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER - * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO - * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para - * obter mais detalhes. - * - * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este - * programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA, 02111-1307, USA - * - * Este programa está nomeado como globals.hpp e possui - linhas de código. - * - * Contatos: - * - * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) - * erico.mendonca@gmail.com (Erico Mascarenhas de Mendonça) - * - * Referências: - * - * https://wiki.openoffice.org/wiki/Documentation/DevGuide/WritingUNO/C%2B%2B/C%2B%2B_Component - * - * - */ - -#ifndef PW3270_OXT_GLOBALS_HPP_INCLUDED - - #define PW3270_OXT_GLOBALS_HPP_INCLUDED 1 - - #define CPPUENV "gcc3" - - #ifdef _WIN32 - #define SAL_W32 - #else - #define UNX 1 - #define GCC 1 - #define LINUX 1 - #define HAVE_GCC_VISIBILITY_FEATURE 1 - #endif - - - #include - #include - #include - #include - #include - - #include - - #ifdef DEBUG - #include - #define trace( fmt, ... ) fprintf(stderr, "%s(%d) " fmt "\n", __FILE__, __LINE__, __VA_ARGS__ ); fflush(stderr); - #else - #define trace(x, ...) // __VA_ARGS__ - #endif - - #include - #include - - #define DLL_PUBLIC __attribute__((visibility("default"))) - - #define CHECK_SESSION_HANDLE if(!hSession) hSession = h3270::session::get_default(); - - - using namespace ::rtl; // for OUString - using namespace ::com::sun::star; // for sdk interfaces - using namespace ::com::sun::star::lang; // for sdk interfaces - using namespace ::com::sun::star::uno; // for basic types - using namespace PW3270_NAMESPACE; - - namespace pw3270_impl - { - // https://wiki.openoffice.org/wiki/Documentation/DevGuide/WritingUNO/C%2B%2B/Class_Definition_with_Helper_Template_Classes - class DLL_PUBLIC session_impl : public ::cppu::WeakImplHelper4< ::pw3270::lib3270, XServiceInfo, XMain, XInitialization > - { - public: - - session_impl(); - virtual ~session_impl(); - - // XMain - virtual ::sal_Int32 SAL_CALL run( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aArguments ) throw (Exception); - - // XInitialization will be called upon createInstanceWithArguments[AndContext]() - virtual void SAL_CALL initialize( Sequence< Any > const & args ) throw (Exception); - - // XServiceInfo - virtual OUString SAL_CALL getImplementationName() throw (RuntimeException); - virtual sal_Bool SAL_CALL supportsService( OUString const & serviceName ) throw (RuntimeException); - virtual Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (RuntimeException); - - // lib3270 - virtual ::rtl::OUString SAL_CALL getVersion() throw (RuntimeException); - virtual ::rtl::OUString SAL_CALL getRevision() throw (RuntimeException); - virtual ::sal_Int16 SAL_CALL iterate( ::sal_Bool wait ) throw (::com::sun::star::uno::RuntimeException); - - virtual ::sal_Int16 SAL_CALL setSessionName( const ::rtl::OUString& name ) throw (::com::sun::star::uno::RuntimeException); - - virtual ::sal_Int16 SAL_CALL Connect( const ::rtl::OUString& url, ::sal_Bool wait) throw (::com::sun::star::uno::RuntimeException); - virtual ::sal_Int16 SAL_CALL Disconnect() throw (::com::sun::star::uno::RuntimeException); - - // State - virtual ::sal_Bool SAL_CALL isConnected() throw (::com::sun::star::uno::RuntimeException); - virtual ::sal_Bool SAL_CALL isReady() throw (::com::sun::star::uno::RuntimeException); - - // Screen contents - virtual ::rtl::OUString SAL_CALL getTextAt( ::sal_Int16 row, ::sal_Int16 col, ::sal_Int16 size ) throw (::com::sun::star::uno::RuntimeException); - virtual ::sal_Int16 SAL_CALL setTextAt( ::sal_Int16 row, ::sal_Int16 col, const ::rtl::OUString& str ) throw (::com::sun::star::uno::RuntimeException); - virtual ::sal_Int32 SAL_CALL getFieldStart( ::sal_Int32 addr ) throw (::com::sun::star::uno::RuntimeException); - virtual ::sal_Int32 SAL_CALL getFieldLen( ::sal_Int32 addr ) throw (::com::sun::star::uno::RuntimeException); - virtual ::sal_Int32 SAL_CALL getNextUnprotected( ::sal_Int32 addr ) throw (::com::sun::star::uno::RuntimeException); - - // Wait - virtual ::sal_Int16 SAL_CALL waitForReady( ::sal_Int16 seconds ) throw (::com::sun::star::uno::RuntimeException); - virtual ::sal_Int16 SAL_CALL waitForTextAt( ::sal_Int16 row, ::sal_Int16 col, const ::rtl::OUString& str, ::sal_Int16 seconds ) throw (::com::sun::star::uno::RuntimeException); - - // Actions - virtual ::sal_Int16 SAL_CALL enter() throw (::com::sun::star::uno::RuntimeException); - virtual ::sal_Int16 SAL_CALL pfkey( ::sal_Int16 key ) throw (::com::sun::star::uno::RuntimeException); - virtual ::sal_Int16 SAL_CALL pakey( ::sal_Int16 key ) throw (::com::sun::star::uno::RuntimeException); - virtual ::sal_Int16 SAL_CALL quit() throw (::com::sun::star::uno::RuntimeException); - virtual ::sal_Int16 SAL_CALL eraseEOF() throw (::com::sun::star::uno::RuntimeException); - - // Cursor - virtual ::sal_Int32 SAL_CALL setCursorAt( ::sal_Int16 row, ::sal_Int16 col ) throw (::com::sun::star::uno::RuntimeException); - virtual ::sal_Int32 SAL_CALL setCursorAddress( ::sal_Int32 addr ) throw (::com::sun::star::uno::RuntimeException); - virtual ::sal_Int32 SAL_CALL getCursorAddress() throw (::com::sun::star::uno::RuntimeException); - - private: - h3270::session * hSession; - rtl_TextEncoding encoding; - - }; - - extern Sequence< OUString > SAL_CALL getSupportedServiceNames_session_impl(); - extern OUString SAL_CALL getImplementationName_session_impl(); - extern Reference< XInterface > SAL_CALL create_session_impl(Reference< XComponentContext > const & xContext ) SAL_THROW( () ); - - }; - - -#endif // PW3270_OXT_GLOBALS_HPP_INCLUDED diff --git a/src/loffice/info.cc b/src/loffice/info.cc deleted file mode 100644 index b47503c..0000000 --- a/src/loffice/info.cc +++ /dev/null @@ -1,58 +0,0 @@ -/* - * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 - * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a - * aplicativos mainframe. Registro no INPI sob o nome G3270. - * - * Copyright (C) <2008> - * - * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob - * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela - * Free Software Foundation. - * - * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER - * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO - * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para - * obter mais detalhes. - * - * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este - * programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA, 02111-1307, USA - * - * Este programa está nomeado como info.cc e possui - linhas de código. - * - * Contatos: - * - * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) - * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) - * - * Referência: - * - * https://wiki.openoffice.org/wiki/Documentation/DevGuide/WritingUNO/C%2B%2B/Class_Definition_with_Helper_Template_Classes - * - */ - - #include "globals.hpp" - #include "pw3270/lib3270.hpp" - -/*---[ Implement ]-----------------------------------------------------------------------------------------*/ - -using namespace pw3270_impl; - -// XServiceInfo implementation -OUString session_impl::getImplementationName() throw (RuntimeException) -{ - // unique implementation name - return OUString( RTL_CONSTASCII_USTRINGPARAM("pw3270.pw3270_impl.session") ); -} - -sal_Bool session_impl::supportsService( OUString const & serviceName ) throw (RuntimeException) -{ - // this object only supports one service, so the test is simple - return serviceName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("pw3270.session") ); -} - -Sequence< OUString > session_impl::getSupportedServiceNames() throw (RuntimeException) -{ - return getSupportedServiceNames_session_impl(); -} - diff --git a/src/loffice/init.cc b/src/loffice/init.cc deleted file mode 100644 index 4a171fd..0000000 --- a/src/loffice/init.cc +++ /dev/null @@ -1,121 +0,0 @@ -/* - * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 - * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a - * aplicativos mainframe. Registro no INPI sob o nome G3270. - * - * Copyright (C) <2008> - * - * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob - * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela - * Free Software Foundation. - * - * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER - * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO - * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para - * obter mais detalhes. - * - * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este - * programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA, 02111-1307, USA - * - * Este programa está nomeado como init.cc e possui - linhas de código. - * - * Contatos: - * - * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) - * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) - * - * Referência: - * - * https://wiki.openoffice.org/wiki/Documentation/DevGuide/WritingUNO/C%2B%2B/Create_Instance_with_Arguments - * - */ - - #include "globals.hpp" - #include - #include "pw3270/lib3270.hpp" - -/*---[ Implement ]-----------------------------------------------------------------------------------------*/ - -using namespace pw3270_impl; - - -session_impl::session_impl() -{ - this->hSession = NULL; - this->encoding = RTL_TEXTENCODING_ISO_8859_1; -} - -session_impl::~session_impl() -{ - if(this->hSession) - delete this->hSession; -} - - -// XInitialization implementation -void session_impl::initialize( Sequence< Any > const & args ) throw (Exception) -{ - /* - if (1 != args.getLength()) - { - throw lang::IllegalArgumentException( - OUString( RTL_CONSTASCII_USTRINGPARAM("give a string instanciating this component!") ), - (::cppu::OWeakObject *)this, - 0 ); - } - */ - - trace("%s args=%d",__FUNCTION__,(int) args.getLength()); - - // Process arguments - for(int f = 0; f < args.getLength();f++) - { - trace("Arg(%d) is %s",f,args[f].getValueType().getTypeName().getStr()); - - } - - -} - -// XMain -::sal_Int32 SAL_CALL session_impl::run( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aArguments ) throw (Exception) -{ - - - return 0; -} - -::sal_Int16 SAL_CALL session_impl::iterate( ::sal_Bool wait ) throw (::com::sun::star::uno::RuntimeException) -{ - try - { - CHECK_SESSION_HANDLE - return hSession->iterate(wait); - - } catch(std::exception &e) - { - OUString msg = OUString(e.what(),strlen(e.what()),RTL_TEXTENCODING_UTF8,RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_IGNORE); - throw css::uno::RuntimeException(msg,static_cast< cppu::OWeakObject * >(this)); - } - return -1; -} - - ::sal_Int16 SAL_CALL session_impl::quit() throw (::com::sun::star::uno::RuntimeException) - { - try - { - CHECK_SESSION_HANDLE - return hSession->quit(); - } catch(std::exception &e) - { - OUString msg = OUString(e.what(),strlen(e.what()),RTL_TEXTENCODING_UTF8,RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_IGNORE); - throw css::uno::RuntimeException(msg,static_cast< cppu::OWeakObject * >(this)); - } - - return -1; - - } - - - diff --git a/src/loffice/loffice3270.cbp b/src/loffice/loffice3270.cbp deleted file mode 100644 index 3d11352..0000000 --- a/src/loffice/loffice3270.cbp +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - diff --git a/src/loffice/manifest.xml.in b/src/loffice/manifest.xml.in deleted file mode 100644 index 8908827..0000000 --- a/src/loffice/manifest.xml.in +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/src/loffice/pw3270.idl b/src/loffice/pw3270.idl deleted file mode 100644 index 3ea59f3..0000000 --- a/src/loffice/pw3270.idl +++ /dev/null @@ -1,97 +0,0 @@ -/* - * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 - * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a - * aplicativos mainframe. Registro no INPI sob o nome G3270. - * - * Copyright (C) <2008> - * - * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob - * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela - * Free Software Foundation. - * - * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER - * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO - * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para - * obter mais detalhes. - * - * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este - * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin - * St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Este programa está nomeado como pw3270.idl e possui - linhas de código. - * - * Contatos: - * - * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) - * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) - * - * Referências: - * - * https://wiki.openoffice.org/wiki/Documentation/DevGuide/WritingUNO/C++/C++_Component - * - */ - -#include -#include -#include - -module pw3270 -{ - /* - * Interface to lib3270 - */ - interface lib3270 : com::sun::star::uno::XInterface - { - // Constants - string getVersion(); - string getRevision(); - - // Host definition - short Connect([in] string url, [in] boolean wait); - short Disconnect(); - short iterate([in] boolean wait); - - // Screen contents - string getTextAt([in] short row, [in] short col, [in] short size); - short setTextAt([in] short row, [in] short col, [in] string str); - short waitForTextAt([in] short row, [in] short col, [in] string str, [in] short seconds); - - // Cursor - long setCursorAt([in] short row, [in] short col); - long setCursorAddress([in] long addr); - long getCursorAddress(); - - // Field positioning - long getFieldStart([in] long addr); - long getFieldLen([in] long addr); - long getNextUnprotected([in] long addr); - - // Keyboard actions - short enter(); - short pfkey([in] short key); - short pakey([in] short key); - - // Misc actions - short quit(); - short eraseEOF(); - - // Misc Settings - short setSessionName([in] string name); - - // State - boolean isConnected(); - boolean isReady(); - - // Waiting - short waitForReady([in] short seconds); - - }; - - service session - { - interface lib3270; - interface com::sun::star::lang::XInitialization; - interface com::sun::star::lang::XMain; - }; -}; - diff --git a/src/loffice/research.sh b/src/loffice/research.sh deleted file mode 100755 index 4bb9ad0..0000000 --- a/src/loffice/research.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash - -OO_SDK_HOME=/usr/lib64/libreoffice/sdk -IDLC=/usr/lib64/libreoffice/sdk/bin/idlc -CPPUMAKER=/usr/lib64/libreoffice/sdk/bin/cppumaker -TYPES_RDB=/usr/lib64/libreoffice/ure/share/misc/types.rdb -REGMERGE=/usr/lib64/libreoffice/ure/bin/regmerge - -$IDLC -C -I$OO_SDK_HOME/idl -O. pw3270.idl -if [ "$?" != "0" ]; then - exit -1 -fi - - -$REGMERGE pw3270.rdb /UCR pw3270.urd -if [ "$?" != "0" ]; then - exit -1 -fi - - -$CPPUMAKER -O./include -Tpw3270.lib3270 $TYPES_RDB pw3270.rdb -if [ "$?" != "0" ]; then - exit -1 -fi - -# XWeak -$IDLC -C -I$OO_SDK_HOME/idl -O. /usr/share/idl/libreoffice/com/sun/star/uno/XWeak.idl -if [ "$?" != "0" ]; then - exit -1 -fi - -$REGMERGE XWeak.rdb /UCR XWeak.urd -if [ "$?" != "0" ]; then - exit -1 -fi - -$CPPUMAKER -O./include $TYPES_RDB XWeak.rdb -if [ "$?" != "0" ]; then - exit -1 -fi - - -echo ok - diff --git a/src/loffice/service.cc b/src/loffice/service.cc deleted file mode 100644 index 275fbd5..0000000 --- a/src/loffice/service.cc +++ /dev/null @@ -1,98 +0,0 @@ -/* - * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 - * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a - * aplicativos mainframe. Registro no INPI sob o nome G3270. - * - * Copyright (C) <2008> - * - * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob - * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela - * Free Software Foundation. - * - * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER - * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO - * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para - * obter mais detalhes. - * - * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este - * programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA, 02111-1307, USA - * - * Este programa está nomeado como info.cc e possui - linhas de código. - * - * Contatos: - * - * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) - * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) - * - * Referência: - * - * https://wiki.openoffice.org/wiki/Documentation/DevGuide/WritingUNO/C%2B%2B/Providing_a_Single_Factory_Using_a_Helper_Method - * - */ - - #include "globals.hpp" - #include - #include "pw3270/lib3270.hpp" - -/*---[ Implement ]-----------------------------------------------------------------------------------------*/ - -namespace pw3270_impl -{ - Sequence< OUString > SAL_CALL getSupportedServiceNames_session_impl() - { - Sequence names(1); - names[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("pw3270.session")); - return names; - } - - OUString SAL_CALL getImplementationName_session_impl() - { - return OUString( RTL_CONSTASCII_USTRINGPARAM("pw3270.lib3270.session") ); - } - - Reference< XInterface > SAL_CALL create_session_impl(Reference< XComponentContext > const & xContext ) SAL_THROW( () ) - { - return static_cast< lang::XTypeProvider * >( new session_impl() ); - } - - static struct ::cppu::ImplementationEntry s_component_entries [] = - { - { - create_session_impl, - getImplementationName_session_impl, - getSupportedServiceNames_session_impl, - ::cppu::createSingleComponentFactory, - 0, - 0 - }, - { - 0, - 0, - 0, - 0, - 0, - 0 - } - }; - -} - -extern "C" -{ - DLL_PUBLIC void * SAL_CALL component_getFactory(sal_Char const * implName, lang::XMultiServiceFactory * xMgr,registry::XRegistryKey * xRegistry ) - { - return ::cppu::component_getFactoryHelper(implName, xMgr, xRegistry, ::pw3270_impl::s_component_entries ); - } - - DLL_PUBLIC sal_Bool SAL_CALL component_writeInfo(lang::XMultiServiceFactory * xMgr, registry::XRegistryKey * xRegistry ) - { - return ::cppu::component_writeInfoHelper(xMgr, xRegistry, ::pw3270_impl::s_component_entries ); - } - - DLL_PUBLIC void SAL_CALL component_getImplementationEnvironment(sal_Char const ** ppEnvTypeName, uno_Environment ** ppEnv ) - { - * ppEnvTypeName = LANGUAGE_BINDING_NAME; - } - -} diff --git a/src/loffice/set.cc b/src/loffice/set.cc deleted file mode 100644 index fdfb1e9..0000000 --- a/src/loffice/set.cc +++ /dev/null @@ -1,246 +0,0 @@ -/* - * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 - * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a - * aplicativos mainframe. Registro no INPI sob o nome G3270. - * - * Copyright (C) <2008> - * - * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob - * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela - * Free Software Foundation. - * - * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER - * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO - * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para - * obter mais detalhes. - * - * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este - * programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA, 02111-1307, USA - * - * Este programa está nomeado como get.cc e possui - linhas de código. - * - * Contatos: - * - * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) - * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) - * - * Referência: - * - * https://wiki.openoffice.org/wiki/Documentation/DevGuide/WritingUNO/C%2B%2B/Class_Definition_with_Helper_Template_Classes - * - */ - - #include "globals.hpp" - #include - #include - #include - #include "pw3270/lib3270.hpp" - -/*---[ Implement ]-----------------------------------------------------------------------------------------*/ - - using namespace pw3270_impl; - using namespace com::sun::star::uno; - - ::sal_Int16 SAL_CALL session_impl::setSessionName( const ::rtl::OUString& name ) throw (::com::sun::star::uno::RuntimeException) - { - if(hSession) - { - // Remove old session - delete hSession; - hSession = NULL; - } - - OString vlr = rtl::OUStringToOString( name , RTL_TEXTENCODING_UNICODE ); - - trace("%s(\"%s\")",__FUNCTION__,vlr.getStr()); - - try - { - string charset; - - hSession = h3270::session::create(((const char *) vlr.getStr())); - - trace("%s: hSession(\"%s\"=%p",__FUNCTION__,vlr.getStr(),hSession); - - } catch(std::exception &e) - { - OUString msg = OUString(e.what(),strlen(e.what()),RTL_TEXTENCODING_UTF8,RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_IGNORE); - - throw css::uno::RuntimeException(msg,static_cast< cppu::OWeakObject * >(this)); - - return -1; - - } - - string charset = hSession->get_display_charset(); - - trace("Charset=\"%s\"",charset.c_str()); - - if(!charset.compare("ISO-8859-1")) - { - encoding = RTL_TEXTENCODING_ISO_8859_1; - } - else if(!charset.compare("UTF-8")) - { - encoding = RTL_TEXTENCODING_UTF8; - } - else - { - string s = "Unable to convert the host's display charset " + charset + "."; - - throw lang::IllegalArgumentException( - OUString( RTL_CONSTASCII_USTRINGPARAM(s.c_str()) ), - (::cppu::OWeakObject *)this, - 0 ); - - } - - return 0; - - } - -/* - ::sal_Int16 SAL_CALL session_impl::setHost( const ::rtl::OUString& url ) throw (::com::sun::star::uno::RuntimeException) - { - if(!hSession) - hSession = h3270::session::get_default(); - - OString vlr = rtl::OUStringToOString( url , RTL_TEXTENCODING_UNICODE ); - - try - { - - return hSession->set_url(vlr.getStr()); - - } catch(std::exception &e) - { - OUString msg = OUString(e.what(),strlen(e.what()),RTL_TEXTENCODING_UTF8,RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_IGNORE); - - throw css::uno::RuntimeException(msg,static_cast< cppu::OWeakObject * >(this)); - - } - - return -1; - } -*/ - - ::sal_Int16 SAL_CALL session_impl::setTextAt( ::sal_Int16 row, ::sal_Int16 col, const ::rtl::OUString& str ) throw (::com::sun::star::uno::RuntimeException) - { - try - { - CHECK_SESSION_HANDLE - OString vlr = rtl::OUStringToOString(str,encoding); - return hSession->set_text_at(row,col,vlr.getStr()); - - } catch(std::exception &e) - { - OUString msg = OUString(e.what(),strlen(e.what()),RTL_TEXTENCODING_UTF8,RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_IGNORE); - throw css::uno::RuntimeException(msg,static_cast< cppu::OWeakObject * >(this)); - } - - return -1; - - } - - ::sal_Int16 SAL_CALL session_impl::enter() throw (::com::sun::star::uno::RuntimeException) - { - try - { - CHECK_SESSION_HANDLE - return hSession->enter(); - - } catch(std::exception &e) - { - OUString msg = OUString(e.what(),strlen(e.what()),RTL_TEXTENCODING_UTF8,RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_IGNORE); - throw css::uno::RuntimeException(msg,static_cast< cppu::OWeakObject * >(this)); - } - - return -1; - - } - - ::sal_Int16 SAL_CALL session_impl::pfkey( ::sal_Int16 key ) throw (::com::sun::star::uno::RuntimeException) - { - try - { - CHECK_SESSION_HANDLE - return hSession->pfkey(key); - - } catch(std::exception &e) - { - OUString msg = OUString(e.what(),strlen(e.what()),RTL_TEXTENCODING_UTF8,RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_IGNORE); - throw css::uno::RuntimeException(msg,static_cast< cppu::OWeakObject * >(this)); - } - - return -1; - - } - - ::sal_Int16 SAL_CALL session_impl::pakey( ::sal_Int16 key ) throw (::com::sun::star::uno::RuntimeException) - { - try - { - CHECK_SESSION_HANDLE - return hSession->pakey(key); - - } catch(std::exception &e) - { - OUString msg = OUString(e.what(),strlen(e.what()),RTL_TEXTENCODING_UTF8,RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_IGNORE); - throw css::uno::RuntimeException(msg,static_cast< cppu::OWeakObject * >(this)); - } - - return -1; - - } - -::sal_Int32 SAL_CALL session_impl::setCursorAt( ::sal_Int16 row, ::sal_Int16 col ) throw (::com::sun::star::uno::RuntimeException) - { - try - { - CHECK_SESSION_HANDLE - return hSession->set_cursor_position(row,col); - - } catch(std::exception &e) - { - OUString msg = OUString(e.what(),strlen(e.what()),RTL_TEXTENCODING_UTF8,RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_IGNORE); - throw css::uno::RuntimeException(msg,static_cast< cppu::OWeakObject * >(this)); - } - - return -1; - - } - - ::sal_Int32 SAL_CALL session_impl::setCursorAddress( ::sal_Int32 addr ) throw (::com::sun::star::uno::RuntimeException) - { - try - { - CHECK_SESSION_HANDLE - return hSession->set_cursor_addr(addr); - - } catch(std::exception &e) - { - OUString msg = OUString(e.what(),strlen(e.what()),RTL_TEXTENCODING_UTF8,RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_IGNORE); - throw css::uno::RuntimeException(msg,static_cast< cppu::OWeakObject * >(this)); - } - - return -1; - - } - - ::sal_Int16 SAL_CALL session_impl::eraseEOF() throw (::com::sun::star::uno::RuntimeException) - { - try - { - CHECK_SESSION_HANDLE - return hSession->erase_eof(); - - } catch(std::exception &e) - { - OUString msg = OUString(e.what(),strlen(e.what()),RTL_TEXTENCODING_UTF8,RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_IGNORE); - throw css::uno::RuntimeException(msg,static_cast< cppu::OWeakObject * >(this)); - } - - return -1; - - } diff --git a/src/loffice/testmacros.odt b/src/loffice/testmacros.odt deleted file mode 100644 index 5e4c238..0000000 Binary files a/src/loffice/testmacros.odt and /dev/null differ diff --git a/src/loffice/testprogram.cc b/src/loffice/testprogram.cc deleted file mode 100644 index 6885e1d..0000000 --- a/src/loffice/testprogram.cc +++ /dev/null @@ -1,148 +0,0 @@ -/* - * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 - * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a - * aplicativos mainframe. Registro no INPI sob o nome G3270. - * - * Copyright (C) <2008> - * - * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob - * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela - * Free Software Foundation. - * - * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER - * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO - * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para - * obter mais detalhes. - * - * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este - * programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA, 02111-1307, USA - * - * Este programa está nomeado como testprogram.cc e possui - linhas de código. - * - * Contatos: - * - * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) - * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) - * - */ - - #include "globals.hpp" - - #include - #include - #include - - #include "pw3270/lib3270.hpp" - -/*---[ Implement ]-----------------------------------------------------------------------------------------*/ - -using namespace com::sun::star::uno; -using namespace com::sun::star::lang; -using namespace com::sun::star::bridge; -using namespace rtl; -using namespace cppu; - -int SAL_CALL main(int argc, char **argv) -{ - Reference< XComponentContext > rComponentContext = defaultBootstrap_InitialComponentContext(); - OSL_ENSURE( xContext.is(), "### cannot creage intial component context!" ); - -/* - Reference< XSimpleRegistry > xReg = DefaultRegistry(); - - Reference< XSimpleRegistry > xReg = createSimpleRegistry(); - - OSL_ENSURE( xReg.is(), "### cannot get service instance of \"SimpleRegistry\"!" ); - - xReg->open(OUString::createFromAscii("pw3270.rdb"), sal_False, sal_False); - - OSL_ENSURE( xReg->isValid(), "### cannot open test registry \"pw3270.rdb\"!" ); - - - TRACE("%s","Calling bootstrap_InitialComponentContext"); - Reference< XComponentContext > xContext = bootstrap_InitialComponentContext(xReg); - OSL_ENSURE( xContext.is(), "### cannot creage intial component context!" ); - - TRACE("%s","Calling getServiceManager\n"); - Reference< XMultiComponentFactory > xMgr = xContext->getServiceManager(); - OSL_ENSURE( xMgr.is(), "### cannot get initial service manager!" ); - - // register my component - TRACE("%s","Calling createInstanceWithContext"); - - Reference< XImplementationRegistration > xImplReg( - xMgr->createInstanceWithContext(OUString::createFromAscii("com.sun.star.registry.ImplementationRegistration"), xContext), UNO_QUERY); - OSL_ENSURE( xImplReg.is(), "### cannot get service instance of \"com.sun.star.registry.ImplementationRegistration\"!" ); - - if (xImplReg.is()) - { - const char *libname = LIBNAME; - - TRACE("Loading %s",libname); - - xImplReg->registerImplementation( - OUString::createFromAscii("com.sun.star.loader.SharedLibrary"), // loader for component - OUString::createFromAscii(libname), // component location - Reference< XSimpleRegistry >() // registry omitted, - // defaulting to service manager registry used - ); - - // get an object instance - printf("Calling createInstanceWithContext(%s)\n",IMPLNAME); - - Reference< XInterface > xx ; - xx = xMgr->createInstanceWithContext(OUString::createFromAscii(IMPLNAME), xContext); - - printf("Instance: %p\n",&xx); - - Reference< pw3270intf > srv( xx, UNO_QUERY ); - - OSL_ENSURE( srv.is(), "### cannot get service instance!"); - - printf("object.is(): %d\n",srv.is()); - - if(srv.is()) - { - // Wait for commands - OString str; - char buffer[80]; - printf("getConnectionState: %d\n", srv->getConnectionState()); - - str = OUStringToOString( srv->getVersion(),RTL_TEXTENCODING_UTF8); - printf("Version:\t%s\n",str.pData->buffer); - - str = OUStringToOString( srv->getRevision(),RTL_TEXTENCODING_UTF8); - printf("Revision:\t%s\n",str.pData->buffer); - - printf("Connect(): %d\n" , srv->Connect(OUString::createFromAscii("L:3270.df.bb:9023"),10)); - - sleep(5); - - //str = OUStringToOString( srv->getScreenContentAt(20,39,5),RTL_TEXTENCODING_UTF8); - //Trace("ContentsAt(20,39): \"%s\"",str.pData->buffer); - printf("waitForStringAt(SISBB) returned %d\n",srv->waitForStringAt(20,39,OUString::createFromAscii("SISBB"),20)); - printf("sendEnterKey() returned %d\n",srv->sendEnterKey()); - printf("waitForStringAt(Senha) returned %d\n",srv->waitForStringAt(14,2,OUString::createFromAscii("Senha"),20)); - printf("setStringAt returned %d\n",srv->setStringAt(13,21,OUString::createFromAscii("c1103788"))); - - str = OUStringToOString( srv->getScreenContent(),RTL_TEXTENCODING_UTF8); - printf("Entire screen:\n%s\n",str.pData->buffer); - - printf("Enter to exit...\n"); - fgets(buffer,80,stdin); - - printf("Disconnect(): %d\n" , srv->Disconnect()); - - sleep(5); - - } - } - - - Reference< XComponent >::query( xContext )->dispose(); - -*/ - - return 0; -} diff --git a/src/php/Makefile.in b/src/php/Makefile.in deleted file mode 100644 index f7cf343..0000000 --- a/src/php/Makefile.in +++ /dev/null @@ -1,124 +0,0 @@ -# -# "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 -# (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a -# aplicativos mainframe. Registro no INPI sob o nome G3270. -# -# Copyright (C) <2008> -# -# Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob -# os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela -# Free Software Foundation. -# -# Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER -# GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO -# A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para -# obter mais detalhes. -# -# Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este -# programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple -# Place, Suite 330, Boston, MA, 02111-1307, USA -# -# Contatos: -# -# perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) -# erico.mendonca@gmail.com (Erico Mascarenhas de Mendonça) -# - -PACKAGE_NAME=@PACKAGE_NAME@ -SOURCES=get.cc init.cc main.cc misc.cc set.cc - -#---[ Paths ]------------------------------------------------------------------ - -prefix=@prefix@ -exec_prefix=@exec_prefix@ -bindir=@bindir@ -sbindir=@sbindir@ -libdir=@libdir@ -includedir=@includedir@ -sysconfdir=@sysconfdir@ - -#---[ Tools ]------------------------------------------------------------------ - -CXX=@CXX@ -MKDIR=@MKDIR_P@ -INSTALL=@INSTALL@ -INSTALL_DATA=@INSTALL_DATA@ -INSTALL_PROGRAM=@INSTALL_PROGRAM@ -PHPCONFIG=@PHPCONFIG@ - -#---[ Paths ]------------------------------------------------------------------ - -OBJDIR = .obj -BINDIR = .bin - -OBJDBG = $(OBJDIR)/Debug -BINDBG = $(BINDIR)/Debug - -OBJRLS = $(OBJDIR)/Release -BINRLS = $(BINDIR)/Release - -#---[ lib3270 common class ]--------------------------------------------------- - -DEBUG_CFLAGS=-DDEBUG=1 -g -Wall -PW3270_CFLAGS=-I../include -CLASSLIBDIR=../classlib -include $(CLASSLIBDIR)/class.mak - -#---[ Build options ]---------------------------------------------------------- - -CXXFLAGS=@CXXFLAGS@ @DLL_CFLAGS@ `$(PHPCONFIG) --includes` -I../include - -#---[ Rules ]------------------------------------------------------------------ - -$(OBJDBG)/%.o: %.cc php3270.h Makefile - @echo " CC `basename $@`" - @mkdir -p `dirname $@` - @$(CXX) -DDEBUG=1 $(CXXFLAGS) -o $@ -c $< - -$(OBJRLS)/%.o: %.cc php3270.h Makefile - @echo " CC `basename $@`" - @mkdir -p `dirname $@` - @$(CXX) -DNDEBUG=1 $(CXXFLAGS) -o $@ -c $< - -#---[ Release targets ]-------------------------------------------------------- - -all: $(BINRLS)/php3270@DLLEXT@ - -Release: $(BINRLS)/php3270@DLLEXT@ - -$(BINRLS)/php3270@DLLEXT@: $(foreach SRC, $(basename $(SOURCES)), $(OBJRLS)/$(SRC)@OBJEXT@) \ - $(CLASS_RELEASE_OBJECTS) - @echo " LD `basename $@`" - @$(MKDIR) `dirname $@` - @$(CXX) @SYSDLL_FLAGS@ $(LDFLAGS) $(OO_LDFLAGS) -o $@ $^ $(CLASS_LIBS) - - -#---[ Debug targets ]---------------------------------------------------------- - -Debug: $(BINDBG)/php3270@DLLEXT@ - -$(BINDBG)/php3270@DLLEXT@: $(foreach SRC, $(basename $(SOURCES)), $(OBJDBG)/$(SRC)@OBJEXT@) \ - $(CLASS_DEBUG_OBJECTS) - @echo " LD `basename $@`" - @$(MKDIR) `dirname $@` - @$(CXX) @SYSDLL_FLAGS@ $(LDFLAGS) $(OO_LDFLAGS) -o $@ $^ $(CLASS_LIBS) - - -run: $(BINDBG)/php3270@DLLEXT@ - php -d extension=$(BINDBG)/php3270@DLLEXT@ sample.php - -#---[ Misc targets ]----------------------------------------------------------- - -install: $(BINRLS)/php3270@DLLEXT@ - @$(MKDIR) $(DESTDIR)/`$(PHPCONFIG) --extension-dir` - @$(INSTALL_PROGRAM) $(BINRLS)/php3270@DLLEXT@ $(DESTDIR)/`$(PHPCONFIG) --extension-dir`/tn3270@DLLEXT@ - - @$(MKDIR) $(DESTDIR)/@PHPCONFDIR@ - @$(INSTALL_DATA) php.ini $(DESTDIR)/@PHPCONFDIR@/tn3270.ini - -cleanDebug: clean - -clean: - @rm -fr $(OBJDIR) - @rm -fr $(BINDIR) - diff --git a/src/php/get.cc b/src/php/get.cc deleted file mode 100644 index 94c7093..0000000 --- a/src/php/get.cc +++ /dev/null @@ -1,108 +0,0 @@ -/* - * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 - * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a - * aplicativos mainframe. Registro no INPI sob o nome G3270. - * - * Copyright (C) <2008> - * - * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob - * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela - * Free Software Foundation. - * - * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER - * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO - * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para - * obter mais detalhes. - * - * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este - * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin - * St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Este programa está nomeado como get.cc e possui - linhas de código. - * - * Contatos: - * - * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) - * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) - * - * Referências: - * - * http://devzone.zend.com/1435/wrapping-c-classes-in-a-php-extension/ - * - */ - - #include "php3270.h" - -/*--[ Implement ]--------------------------------------------------------------------------------------------------*/ - -PHP_METHOD(tn3270, isconnected) -{ - tn3270_object * obj = (tn3270_object *) zend_object_store_get_object(getThis() TSRMLS_CC); - RETURN_BOOL(obj->hSession->is_connected()); -} - -PHP_METHOD(tn3270, isready) -{ - tn3270_object * obj = (tn3270_object *) zend_object_store_get_object(getThis() TSRMLS_CC); - RETURN_BOOL(obj->hSession->is_ready()); -} - -PHP_METHOD(tn3270, getstringat) -{ - tn3270_object * obj = (tn3270_object *) zend_object_store_get_object(getThis() TSRMLS_CC); - long row; - long col; - long sz; - - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll", &row, &col, &sz) == FAILURE) - RETURN_NULL(); - - string str = obj->hSession->get_string_at(row,col,sz); - - trace("String = [%s]",str.c_str()); - RETURN_STRING(str.c_str(),1); -} - -PHP_METHOD(tn3270, cmpstringat) -{ - tn3270_object * obj = (tn3270_object *) zend_object_store_get_object(getThis() TSRMLS_CC); - long row; - long col; - const char * text; - int szText; - - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lls", &row, &col, &text, &szText) == FAILURE) - RETURN_NULL(); - - if(!szText) - RETURN_NULL(); - - char buffer[szText+1]; - memcpy(buffer,text,szText); - buffer[szText] = 0; - - RETURN_LONG(obj->hSession->cmp_string_at(row,col,buffer)); -} - -PHP_METHOD(tn3270, getisprotected) -{ - tn3270_object * obj = (tn3270_object *) zend_object_store_get_object(getThis() TSRMLS_CC); - long baddr; - - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &baddr) == FAILURE) - RETURN_NULL(); - - RETURN_LONG(obj->hSession->get_is_protected(baddr)); -} - -PHP_METHOD(tn3270, getisprotectedat) -{ - tn3270_object * obj = (tn3270_object *) zend_object_store_get_object(getThis() TSRMLS_CC); - long row; - long col; - - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &row, &col) == FAILURE) - RETURN_NULL(); - - RETURN_LONG(obj->hSession->get_is_protected_at(row,col)); -} diff --git a/src/php/init.cc b/src/php/init.cc deleted file mode 100644 index 03f92af..0000000 --- a/src/php/init.cc +++ /dev/null @@ -1,86 +0,0 @@ -/* - * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 - * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a - * aplicativos mainframe. Registro no INPI sob o nome G3270. - * - * Copyright (C) <2008> - * - * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob - * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela - * Free Software Foundation. - * - * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER - * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO - * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para - * obter mais detalhes. - * - * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este - * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin - * St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Este programa está nomeado como init.cc e possui - linhas de código. - * - * Contatos: - * - * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) - * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) - * - * Referências: - * - * http://devzone.zend.com/1435/wrapping-c-classes-in-a-php-extension/ - * - */ - - #include "php3270.h" - #include - -/*--[ Implement ]--------------------------------------------------------------------------------------------------*/ - -PHP_METHOD(tn3270, __construct) -{ - char * name; - int szName = 0; - char * url; - int szURL = 0; - tn3270_object * obj = (tn3270_object *) zend_object_store_get_object(getThis() TSRMLS_CC); - - trace("%s %d",__FUNCTION__,ZEND_NUM_ARGS()); - - // http://www.php.net/manual/pt_BR/internals2.funcs.php - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sss", &name, &szName, &url, &szURL) == FAILURE) - RETURN_NULL(); - - trace("szName=%d",szName); - - try - { - - if(szName) - { - char text[szName+1]; - strncpy(text,name,szName); - text[szName] = 0; - trace("session_name=\"%s\"",text); - obj->hSession = session::start(text); - } - else - { - obj->hSession = session::start(); - } - - if(szURL) - { - char text[szURL+1]; - strncpy(text,url,szURL); - text[szURL] = 0; - obj->hSession->set_url(text); - } - - } - catch(std::exception &e) - { - zend_throw_error_exception(zend_exception_get_default(), (char *) e.what(), 0, 0 TSRMLS_DC); - } - -} - diff --git a/src/php/main.cc b/src/php/main.cc deleted file mode 100644 index e509379..0000000 --- a/src/php/main.cc +++ /dev/null @@ -1,151 +0,0 @@ -/* - * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 - * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a - * aplicativos mainframe. Registro no INPI sob o nome G3270. - * - * Copyright (C) <2008> - * - * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob - * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela - * Free Software Foundation. - * - * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER - * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO - * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para - * obter mais detalhes. - * - * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este - * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin - * St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Este programa está nomeado como main.cc e possui - linhas de código. - * - * Contatos: - * - * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) - * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) - * - * Referências: - * - * http://devzone.zend.com/1435/wrapping-c-classes-in-a-php-extension/ - * - */ - - #include "php3270.h" - -/*--[ Globals ]----------------------------------------------------------------------------------------------------*/ - -static zend_class_entry * tn3270_ce = NULL; -static zend_object_handlers tn3270_object_handlers; - -/*--[ Implement ]--------------------------------------------------------------------------------------------------*/ - -zend_function_entry tn3270_methods[] = -{ - PHP_ME( tn3270, __construct, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - - PHP_ME( tn3270, connect, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - PHP_ME( tn3270, disconnect, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - - PHP_ME( tn3270, isconnected, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - PHP_ME( tn3270, isready, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - - PHP_ME( tn3270, waitforready, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - PHP_ME( tn3270, wait, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - PHP_ME( tn3270, iterate, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - - PHP_ME( tn3270, pfkey, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - PHP_ME( tn3270, pakey, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - PHP_ME( tn3270, enter, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - - PHP_ME( tn3270, getstringat, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - PHP_ME( tn3270, setstringat, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - PHP_ME( tn3270, cmpstringat, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - - PHP_ME( tn3270, getisprotected, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - PHP_ME( tn3270, getisprotectedat, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - - PHP_ME( tn3270, action, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - - {NULL, NULL, NULL} -}; - -void tn3270_free_storage(void *object TSRMLS_DC) -{ - tn3270_object *obj = (tn3270_object *)object; - - trace("%s",__FUNCTION__); - - zend_object_std_dtor(&obj->std TSRMLS_CC); - delete obj->hSession; - - efree(obj); -} - -zend_object_value tn3270_create_handler(zend_class_entry *type TSRMLS_DC) -{ - zend_object_value retval; - tn3270_object * obj = (tn3270_object *) emalloc(sizeof(tn3270_object)); - - trace("%s",__FUNCTION__); - - memset(obj, 0, sizeof(tn3270_object)); - - zend_object_std_init( &(obj->std), type TSRMLS_CC ); - - // http://stackoverflow.com/questions/14105529/writing-a-c-extension-for-php-5-4-example-code-is-obsolete - // object_properties_init((zend_object*) &(obj->std), type); -#if PHP_VERSION_ID < 50399 - zend_hash_copy(obj->std.properties, &(type->default_properties),(copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval*)); -#else - object_properties_init(&obj->std, type); -#endif - - retval.handle = zend_objects_store_put(obj, NULL, tn3270_free_storage, NULL TSRMLS_CC); - retval.handlers = &tn3270_object_handlers; - - return retval; -} - -PHP_MINIT_FUNCTION(tn3270) -{ - zend_class_entry ce; - - trace("%s",__FUNCTION__); - - INIT_CLASS_ENTRY(ce, "tn3270", tn3270_methods); - - tn3270_ce = zend_register_internal_class(&ce TSRMLS_CC); - tn3270_ce->create_object = tn3270_create_handler; - - memcpy(&tn3270_object_handlers,zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - tn3270_object_handlers.clone_obj = NULL; - - return SUCCESS; -} - -zend_module_entry lib3270_module_entry = -{ -#if ZEND_MODULE_API_NO >= 20010901 - STANDARD_MODULE_HEADER, -#endif - PHP3270_EXTNAME, - NULL, /* Functions */ - PHP_MINIT(tn3270), - NULL, /* MSHUTDOWN */ - NULL, /* RINIT */ - NULL, /* RSHUTDOWN */ - NULL, /* MINFO */ -#if ZEND_MODULE_API_NO >= 20010901 - PHP3270_EXTVER, -#endif - STANDARD_MODULE_PROPERTIES -}; - -// #ifdef COMPILE_DL_LIB3270 -extern "C" -{ - ZEND_GET_MODULE(lib3270) -} -// #endif - diff --git a/src/php/misc.cc b/src/php/misc.cc deleted file mode 100644 index 2a2fbe3..0000000 --- a/src/php/misc.cc +++ /dev/null @@ -1,139 +0,0 @@ -/* - * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 - * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a - * aplicativos mainframe. Registro no INPI sob o nome G3270. - * - * Copyright (C) <2008> - * - * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob - * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela - * Free Software Foundation. - * - * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER - * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO - * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para - * obter mais detalhes. - * - * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este - * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin - * St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Este programa está nomeado como main.cc e possui - linhas de código. - * - * Contatos: - * - * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) - * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) - * - * Referências: - * - * http://devzone.zend.com/1435/wrapping-c-classes-in-a-php-extension/ - * - */ - - #include "php3270.h" - -/*--[ Implement ]--------------------------------------------------------------------------------------------------*/ - -PHP_METHOD(tn3270, connect) -{ - const char * host; - int szHost; - zend_bool wait = 0; - int rc = 0; - tn3270_object * obj = (tn3270_object *) zend_object_store_get_object(getThis() TSRMLS_CC); - - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sb", &host, &szHost, &wait) == FAILURE) - RETURN_NULL(); - - if(szHost) - { - char text[szHost+1]; - strncpy(text,host,szHost); - text[szHost] = 0; - rc = obj->hSession->connect(text,wait); - } - else - { - rc = obj->hSession->connect(); - } - - RETURN_LONG(rc); -} - -PHP_METHOD(tn3270, disconnect) -{ - tn3270_object * obj = (tn3270_object *) zend_object_store_get_object(getThis() TSRMLS_CC); - RETURN_LONG(obj->hSession->disconnect()); -} - -PHP_METHOD(tn3270, waitforready) -{ - long seconds; - tn3270_object * obj = (tn3270_object *) zend_object_store_get_object(getThis() TSRMLS_CC); - - // http://www.php.net/manual/pt_BR/internals2.funcs.php - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &seconds) == FAILURE) - RETURN_NULL(); - - RETURN_LONG(obj->hSession->wait_for_ready((int) seconds)); -} - -PHP_METHOD(tn3270, waity) -{ - long seconds; - tn3270_object * obj = (tn3270_object *) zend_object_store_get_object(getThis() TSRMLS_CC); - - // http://www.php.net/manual/pt_BR/internals2.funcs.php - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &seconds) == FAILURE) - RETURN_NULL(); - - RETURN_LONG(obj->hSession->wait((int) seconds)); -} - -PHP_METHOD(tn3270, wait) -{ - long seconds; - tn3270_object * obj = (tn3270_object *) zend_object_store_get_object(getThis() TSRMLS_CC); - - // http://www.php.net/manual/pt_BR/internals2.funcs.php - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &seconds) == FAILURE) - RETURN_NULL(); - - RETURN_LONG(obj->hSession->wait((int) seconds)); -} - - -PHP_METHOD(tn3270, iterate) -{ - zend_bool wait = 0; - tn3270_object * obj = (tn3270_object *) zend_object_store_get_object(getThis() TSRMLS_CC); - - // http://www.php.net/manual/pt_BR/internals2.funcs.php - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "b", &wait) == FAILURE) - RETURN_NULL(); - - RETURN_LONG(obj->hSession->iterate(wait)); -} - -PHP_METHOD(tn3270, action) -{ - - tn3270_object * obj = (tn3270_object *) zend_object_store_get_object(getThis() TSRMLS_CC); - - const char * text; - int szText; - - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &text, &szText) == FAILURE) - RETURN_NULL(); - - if(!szText) - RETURN_NULL(); - - char buffer[szText+1]; - memcpy(buffer,text,szText); - buffer[szText] = 0; - - RETURN_LONG(obj->hSession->action(buffer)); - -} diff --git a/src/php/php.ini b/src/php/php.ini deleted file mode 100644 index b3f0094..0000000 --- a/src/php/php.ini +++ /dev/null @@ -1,2 +0,0 @@ -; comment out next line to disable pdo extension in php -extension=tn3270.so diff --git a/src/php/php3270.cbp b/src/php/php3270.cbp deleted file mode 100644 index 1bbe3dd..0000000 --- a/src/php/php3270.cbp +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - diff --git a/src/php/php3270.h.in b/src/php/php3270.h.in deleted file mode 100644 index 75d138b..0000000 --- a/src/php/php3270.h.in +++ /dev/null @@ -1,87 +0,0 @@ -/* - * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 - * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a - * aplicativos mainframe. Registro no INPI sob o nome G3270. - * - * Copyright (C) <2008> - * - * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob - * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela - * Free Software Foundation. - * - * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER - * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO - * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para - * obter mais detalhes. - * - * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este - * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin - * St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Este programa está nomeado como php3270.h e possui - linhas de código. - * - * Contatos: - * - * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) - * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) - * - * Referências: - * - * http://devzone.zend.com/1435/wrapping-c-classes-in-a-php-extension/ - * - */ - -#ifndef PHP3270_INCLUDED - - #define PHP3270_INCLUDED 1 - - #define PHP3270_EXTNAME "@PACKAGE_NAME@" - #define PHP3270_EXTVER "@PACKAGE_VERSION@" - - extern "C" - { - #include "php.h" - } - - extern zend_module_entry lib3270_module_entry; - #define phpext_lib3270_ptr &lib3270_module_entry; - - // 3270 session methods - PHP_METHOD(tn3270,__construct); - PHP_METHOD(tn3270,connect); - PHP_METHOD(tn3270,disconnect); - PHP_METHOD(tn3270,isconnected); - PHP_METHOD(tn3270,isready); - PHP_METHOD(tn3270,waitforready); - PHP_METHOD(tn3270,wait); - PHP_METHOD(tn3270,iterate); - - PHP_METHOD(tn3270,pfkey); - PHP_METHOD(tn3270,pakey); - PHP_METHOD(tn3270,enter); - - PHP_METHOD(tn3270,getstringat); - PHP_METHOD(tn3270,setstringat); - PHP_METHOD(tn3270,cmpstringat); - - PHP_METHOD(tn3270,getisprotected); - PHP_METHOD(tn3270,getisprotectedat); - - PHP_METHOD(tn3270,action); - - #undef PACKAGE_NAME - #undef PACKAGE_VERSION - #undef HAVE_MALLOC_H - #include - - // PHP object - using namespace PW3270_NAMESPACE; - - struct tn3270_object - { - zend_object std; - session * hSession; - }; - - -#endif // PHP_LIB3270_INCLUDED diff --git a/src/php/sample.php b/src/php/sample.php deleted file mode 100644 index 734e5a4..0000000 --- a/src/php/sample.php +++ /dev/null @@ -1,28 +0,0 @@ -connect(); - print("connect() exits with rc=" . $rc . "\n"); - - $rc = $host->waitforready(10); - print("waitforready() exits with rc=" . $rc . "\n"); - - $str = $host->getstringat(3,2,14); - print("Getstring(3,2,14) saiu com \"" . $str . "\"\n"); - - $rc = $host->getisprotectedat(19,39); - print("GetIsprotectedAt(19,39) saiu com \"" . $rc . "\"\n"); - - $rc = $host->getisprotectedat(20,39); - print("GetIsprotectedAt(20,39) saiu com \"" . $rc . "\"\n"); - - $rc = $host->action("clear"); - print("Action(\"clear\") saiu com \"" . $rc . "\"\n"); - - $rc = $host->disconnect(); - print("disconnect() exits with rc=" . $rc . "\n"); - -?> diff --git a/src/php/set.cc b/src/php/set.cc deleted file mode 100644 index 9cbdbeb..0000000 --- a/src/php/set.cc +++ /dev/null @@ -1,88 +0,0 @@ -/* - * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 - * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a - * aplicativos mainframe. Registro no INPI sob o nome G3270. - * - * Copyright (C) <2008> - * - * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob - * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela - * Free Software Foundation. - * - * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER - * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO - * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para - * obter mais detalhes. - * - * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este - * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin - * St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Este programa está nomeado como set.cc e possui - linhas de código. - * - * Contatos: - * - * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) - * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) - * - * Referências: - * - * http://devzone.zend.com/1435/wrapping-c-classes-in-a-php-extension/ - * - */ - - #include "php3270.h" - -/*--[ Implement ]--------------------------------------------------------------------------------------------------*/ - -PHP_METHOD(tn3270, pfkey) -{ - long id; - tn3270_object * obj = (tn3270_object *) zend_object_store_get_object(getThis() TSRMLS_CC); - - // http://www.php.net/manual/pt_BR/internals2.funcs.php - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &id) == FAILURE) - RETURN_NULL(); - - RETURN_LONG(obj->hSession->pfkey((int) id)); -} - -PHP_METHOD(tn3270, pakey) -{ - long id; - tn3270_object * obj = (tn3270_object *) zend_object_store_get_object(getThis() TSRMLS_CC); - - // http://www.php.net/manual/pt_BR/internals2.funcs.php - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &id) == FAILURE) - RETURN_NULL(); - - RETURN_LONG(obj->hSession->pakey((int) id)); -} - -PHP_METHOD(tn3270, enter) -{ - tn3270_object * obj = (tn3270_object *) zend_object_store_get_object(getThis() TSRMLS_CC); - RETURN_LONG(obj->hSession->enter()); -} - -PHP_METHOD(tn3270, setstringat) -{ - tn3270_object * obj = (tn3270_object *) zend_object_store_get_object(getThis() TSRMLS_CC); - long row; - long col; - const char * text; - int szText; - - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lls", &row, &col, &text, &szText) == FAILURE) - RETURN_NULL(); - - if(!szText) - RETURN_NULL(); - - char buffer[szText+1]; - memcpy(buffer,text,szText); - buffer[szText] = 0; - - RETURN_LONG(obj->hSession->set_string_at(row,col,buffer)); -} - diff --git a/src/python/Makefile.in b/src/python/Makefile.in deleted file mode 100644 index 5b48b5d..0000000 --- a/src/python/Makefile.in +++ /dev/null @@ -1,144 +0,0 @@ - - -# -# "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 -# (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a -# aplicativos mainframe. Registro no INPI sob o nome G3270. -# -# Copyright (C) <2008> -# -# Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob -# os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela -# Free Software Foundation. -# -# Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER -# GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO -# A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para -# obter mais detalhes. -# -# Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este -# programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple -# Place, Suite 330, Boston, MA, 02111-1307, USA -# -# Contatos: -# -# perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) -# erico.mendonca@gmail.com (Erico Mascarenhas de Mendonça) -# - -PACKAGE_NAME=@PACKAGE_NAME@ -SOURCES=py3270.cc actions.cc get.cc init.cc misc.cc set.cc - -#---[ Paths ]------------------------------------------------------------------ - -prefix=@prefix@ -exec_prefix=@exec_prefix@ -bindir=@bindir@ -sbindir=@sbindir@ -libdir=@libdir@ -includedir=@includedir@ -sysconfdir=@sysconfdir@ -PYTHONLIBPATH=`python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"` - -#---[ Tools ]------------------------------------------------------------------ - -CXX=@CXX@ -MKDIR=@MKDIR_P@ -INSTALL=@INSTALL@ -INSTALL_DATA=@INSTALL_DATA@ -INSTALL_PROGRAM=@INSTALL_PROGRAM@ -ZIP=@ZIP@ - -#---[ Paths ]------------------------------------------------------------------ - -OBJDIR = .obj -BINDIR = .bin - -OBJDBG = $(OBJDIR)/Debug -BINDBG = $(BINDIR)/Debug - -OBJRLS = $(OBJDIR)/Release -BINRLS = $(BINDIR)/Release - -#---[ lib3270 common class ]--------------------------------------------------- - -DEBUG_CFLAGS=-DDEBUG=1 -g -Wall -PW3270_CFLAGS=-I../include -CLASSLIBDIR=../classlib -include $(CLASSLIBDIR)/class.mak - -#---[ Build options ]---------------------------------------------------------- - -CXXFLAGS=@PYTHON_CFLAGS@ @DLL_CFLAGS@ -I../include - -#---[ Rules ]------------------------------------------------------------------ - -$(OBJRLS)/%.o: \ - %.cc private.h Makefile - - @echo " CC `basename $@`" - @mkdir -p `dirname $@` - @$(CXX) -DNDEBUG=1 $(CXXFLAGS) -o $@ -c $< - -$(OBJDBG)/%.o: \ - %.cc private.h Makefile - - @echo " CC `basename $@`" - @mkdir -p `dirname $@` - @$(CXX) -DDEBUG=1 $(CXXFLAGS) -o $@ -c $< - -#---[ Release targets ]-------------------------------------------------------- - -all: $(BINRLS)/py3270@DLLEXT@ - -Release: $(BINRLS)/py3270@DLLEXT@ - -$(BINRLS)/py3270@DLLEXT@: \ - $(foreach SRC, $(basename $(SOURCES)), $(OBJRLS)/$(SRC)@OBJEXT@) \ - $(CLASS_RELEASE_OBJECTS) - - @echo " LD `basename $@`" - @$(MKDIR) `dirname $@` - @$(CXX) @SYSDLL_FLAGS@ $(LDFLAGS) $(OO_LDFLAGS) -o $@ $^ $(CLASS_LIBS) @PYTHON_LIBS@ - - -#---[ Debug targets ]---------------------------------------------------------- - -Debug: $(BINDBG)/py3270@DLLEXT@ - -$(BINDBG)/py3270@DLLEXT@: \ - $(foreach SRC, $(basename $(SOURCES)), $(OBJDBG)/$(SRC)@OBJEXT@) \ - $(CLASS_DEBUG_OBJECTS) - - @echo " LD `basename $@`" - @$(MKDIR) `dirname $@` - @$(CXX) @SYSDLL_FLAGS@ $(LDFLAGS) $(OO_LDFLAGS) -o $@ $^ $(CLASS_LIBS) @PYTHON_LIBS@ - - -run: $(BINDBG)/py3270@DLLEXT@ - -#---[ Misc targets ]----------------------------------------------------------- - -install: \ - $(BINRLS)/py3270@DLLEXT@ - - @$(MKDIR) $(DESTDIR)/$(PYTHONLIBPATH) - @$(INSTALL_PROGRAM) $(BINRLS)/py3270@DLLEXT@ $(DESTDIR)/$(PYTHONLIBPATH)/py3270@DLLEXT@ - -zip: \ - py3270-@PACKAGE_VERSION@.@PACKAGE_REVISION@.@host_cpu@.zip - -py3270-@PACKAGE_VERSION@.@PACKAGE_REVISION@.@host_cpu@.zip: \ - Makefile \ - $(BINRLS)/py3270@DLLEXT@ - - @rm -f $@ - @zip -9 -j $@ $(BINRLS)/py3270@DLLEXT@ - - -cleanDebug: clean - -clean: - @rm -fr $(OBJDIR) - @rm -fr $(BINDIR) - diff --git a/src/python/actions.cc b/src/python/actions.cc deleted file mode 100644 index 5d8aebe..0000000 --- a/src/python/actions.cc +++ /dev/null @@ -1,129 +0,0 @@ -/* - * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 - * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a - * aplicativos mainframe. Registro no INPI sob o nome G3270. - * - * Copyright (C) <2008> - * - * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob - * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela - * Free Software Foundation. - * - * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER - * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO - * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para - * obter mais detalhes. - * - * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este - * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin - * St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Este programa está nomeado como actions.cc e possui - linhas de código. - * - * Contatos - * - * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) - * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) - * - * Referências: - * - * - * - * - */ - - #include "private.h" - - -/*---[ Implement ]----------------------------------------------------------------------------------*/ - - PyObject * terminal_pfkey(PyObject *self, PyObject *args) { - - int rc, key; - - if (!PyArg_ParseTuple(args, "i", &key)) { - PyErr_SetString(terminalError, strerror(EINVAL)); - return NULL; - } - - try { - - rc = ((pw3270_TerminalObject *) self)->session->pfkey(key); - - } catch(std::exception &e) { - - PyErr_SetString(terminalError, e.what()); - return NULL; - } - - return PyLong_FromLong(rc); - - } - - PyObject * terminal_pakey(PyObject *self, PyObject *args) { - - int rc, key; - - if (!PyArg_ParseTuple(args, "i", &key)) { - PyErr_SetString(terminalError, strerror(EINVAL)); - return NULL; - } - - try { - - rc = ((pw3270_TerminalObject *) self)->session->pakey(key); - - } catch(std::exception &e) { - - PyErr_SetString(terminalError, e.what()); - return NULL; - } - - return PyLong_FromLong(rc); - - } - - PyObject * terminal_enter(PyObject *self, PyObject *args) { - - int rc; - - try { - - rc = ((pw3270_TerminalObject *) self)->session->enter(); - - } catch(std::exception &e) { - - PyErr_SetString(terminalError, e.what()); - return NULL; - } - - return PyLong_FromLong(rc); - - - } - - PyObject * terminal_action(PyObject *self, PyObject *args) { - - int rc; - const char *name; - - if (!PyArg_ParseTuple(args, "s", &name)) { - PyErr_SetString(terminalError, strerror(EINVAL)); - return NULL; - } - - try { - - rc = ((pw3270_TerminalObject *) self)->session->action(name); - - } catch(std::exception &e) { - - PyErr_SetString(terminalError, e.what()); - return NULL; - } - - return PyLong_FromLong(rc); - - - } - diff --git a/src/python/get.cc b/src/python/get.cc deleted file mode 100644 index d3ea909..0000000 --- a/src/python/get.cc +++ /dev/null @@ -1,154 +0,0 @@ -/* - * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 - * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a - * aplicativos mainframe. Registro no INPI sob o nome G3270. - * - * Copyright (C) <2008> - * - * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob - * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela - * Free Software Foundation. - * - * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER - * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO - * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para - * obter mais detalhes. - * - * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este - * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin - * St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Este programa está nomeado como get.cc e possui - linhas de código. - * - * Contatos: - * - * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) - * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) - * - * Referências: - * - * - * - * - */ - - #include "private.h" - - -/*---[ Implement ]----------------------------------------------------------------------------------*/ - -PyObject * terminal_get_version(PyObject *self, PyObject *args) { - - return PyString_FromString( ((pw3270_TerminalObject *) self)->session->get_version().c_str() ); - -} - -PyObject * terminal_get_revision(PyObject *self, PyObject *args) { - - return PyString_FromString( ((pw3270_TerminalObject *) self)->session->get_revision().c_str() ); - -} - -PyObject * terminal_is_connected(PyObject *self, PyObject *args) { - - return PyBool_FromLong( ((pw3270_TerminalObject *) self)->session->is_connected() ); - -} - -PyObject * terminal_is_ready(PyObject *self, PyObject *args) { - - return PyBool_FromLong( ((pw3270_TerminalObject *) self)->session->is_ready() ); - -} - -PyObject * terminal_is_protected_at(PyObject *self, PyObject *args) { - - int rc, row, col; - - if (!PyArg_ParseTuple(args, "ii", &row, &col)) { - PyErr_SetString(terminalError, strerror(EINVAL)); - return NULL; - } - - try { - - rc = ((pw3270_TerminalObject *) self)->session->get_is_protected_at(row,col); - - } catch(std::exception &e) { - - PyErr_SetString(terminalError, e.what()); - return NULL; - } - - return PyBool_FromLong( rc ); - -} - - -PyObject * terminal_cmp_string_at(PyObject *self, PyObject *args) { - - int row, col, rc; - const char *text; - - if (!PyArg_ParseTuple(args, "iis", &row, &col, &text)) { - PyErr_SetString(terminalError, strerror(EINVAL)); - return NULL; - } - - try { - - rc = ((pw3270_TerminalObject *) self)->session->cmp_string_at(row,col,text); - - } catch(std::exception &e) { - - PyErr_SetString(terminalError, e.what()); - return NULL; - } - - return PyLong_FromLong(rc); - -} - -PyObject * terminal_get_string_at(PyObject *self, PyObject *args) { - - int row, col, sz; - string rc; - - if (!PyArg_ParseTuple(args, "iii", &row, &col, &sz)) { - PyErr_SetString(terminalError, strerror(EINVAL)); - return NULL; - } - - try { - - rc = ((pw3270_TerminalObject *) self)->session->get_string_at(row,col,sz); - - } catch(std::exception &e) { - - PyErr_SetString(terminalError, e.what()); - return NULL; - } - - return PyString_FromString(rc.c_str()); - -} - -PyObject * terminal_get_contents(PyObject *self) { - - string rc; - - try { - - rc = ((pw3270_TerminalObject *) self)->session->get_string(); - - } catch(std::exception &e) { - - PyErr_SetString(terminalError, e.what()); - return NULL; - } - - return PyString_FromString(rc.c_str()); - - - -} diff --git a/src/python/init.cc b/src/python/init.cc deleted file mode 100644 index 34b9662..0000000 --- a/src/python/init.cc +++ /dev/null @@ -1,87 +0,0 @@ -/* - * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 - * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a - * aplicativos mainframe. Registro no INPI sob o nome G3270. - * - * Copyright (C) <2008> - * - * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob - * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela - * Free Software Foundation. - * - * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER - * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO - * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para - * obter mais detalhes. - * - * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este - * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin - * St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Este programa está nomeado como py3270.cc e possui - linhas de código. - * - * Contatos: - * - * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) - * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) - * - * Implementa métodos básicos inicio/final do objeto python - * - * Referências: - * - * - * - * - */ - - #include "private.h" - - -/*---[ Implement ]----------------------------------------------------------------------------------*/ - -PyObject * terminal_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { - - PW3270_NAMESPACE::session * session; - const char *id = ""; - - if (!PyArg_ParseTuple(args, "s", &id)) { - id = ""; - } - - trace("%s(%s)",__FUNCTION__,id); - - try { - - session = PW3270_NAMESPACE::session::create(id); - - } catch(std::exception &e) { - - trace("%s failed: %s",__FUNCTION__,e.what()); - PyErr_SetString(terminalError, e.what()); - return NULL; - - } - - pw3270_TerminalObject *self = (pw3270_TerminalObject *) type->tp_alloc(type, 0); - - self->session = session; - - return (PyObject *)self; -} - - -int terminal_init(pw3270_TerminalObject *self, PyObject *args, PyObject *kwds) { - - return 0; - -} - -void terminal_dealloc(pw3270_TerminalObject * self) { - - trace("%s",__FUNCTION__); - - delete self->session; - - self->ob_type->tp_free((PyObject*)self); - -} diff --git a/src/python/misc.cc b/src/python/misc.cc deleted file mode 100644 index d9ccb8c..0000000 --- a/src/python/misc.cc +++ /dev/null @@ -1,134 +0,0 @@ -/* - * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 - * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a - * aplicativos mainframe. Registro no INPI sob o nome G3270. - * - * Copyright (C) <2008> - * - * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob - * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela - * Free Software Foundation. - * - * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER - * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO - * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para - * obter mais detalhes. - * - * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este - * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin - * St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Este programa está nomeado como misc.cc e possui - linhas de código. - * - * Contatos: - * - * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) - * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) - * - * Implementa métodos básicos inicio/final do objeto python - * - * Referências: - * - * - * - * - */ - - #include "private.h" - - -/*---[ Implement ]----------------------------------------------------------------------------------*/ - - PyObject * terminal_connect(PyObject *self, PyObject *args) { - - int rc = -1; - int wait = 60; - const char * host = ""; - - if (!PyArg_ParseTuple(args, "s|i", &host, &wait)) { - PyErr_SetString(terminalError, "connect requires a host URL"); - return NULL; - } - - try { - - rc = ((pw3270_TerminalObject *) self)->session->connect(host,wait); - - } catch(std::exception &e) { - - PyErr_SetString(terminalError, e.what()); - return NULL; - } - - return PyLong_FromLong(rc); - - } - - PyObject * terminal_disconnect(PyObject *self, PyObject *args) { - - int rc = -1; - - try { - - rc = ((pw3270_TerminalObject *) self)->session->disconnect(); - - } catch(std::exception &e) { - - PyErr_SetString(terminalError, e.what()); - return NULL; - } - - return PyLong_FromLong(rc); - - } - - PyObject * terminal_wait_for_ready(PyObject *self, PyObject *args) { - - int rc; - int timeout = 60; - - if (!PyArg_ParseTuple(args, "|i", &timeout)) { - PyErr_SetString(terminalError, strerror(EINVAL)); - return NULL; - } - - try { - - rc = ((pw3270_TerminalObject *) self)->session->wait_for_ready(timeout); - - } catch(std::exception &e) { - - PyErr_SetString(terminalError, e.what()); - return NULL; - } - - return PyLong_FromLong(rc); - - } - - - PyObject * terminal_wait_for_string_at(PyObject *self, PyObject *args) { - - int row, col, rc; - int timeout = 10; - const char *text; - - if (!PyArg_ParseTuple(args, "iis|i", &row, &col, &text, &timeout)) { - PyErr_SetString(terminalError, strerror(EINVAL)); - return NULL; - } - - try { - - rc = ((pw3270_TerminalObject *) self)->session->wait_for_string_at(row,col,text,timeout); - - } catch(std::exception &e) { - - PyErr_SetString(terminalError, e.what()); - return NULL; - } - - return PyLong_FromLong(rc); - - } - diff --git a/src/python/private.h b/src/python/private.h deleted file mode 100644 index 4ee6733..0000000 --- a/src/python/private.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 - * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a - * aplicativos mainframe. Registro no INPI sob o nome G3270. - * - * Copyright (C) <2008> - * - * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob - * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela - * Free Software Foundation. - * - * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER - * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO - * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para - * obter mais detalhes. - * - * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este - * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin - * St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Este programa está nomeado como private.h e possui - linhas de código. - * - * Contatos: - * - * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) - * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) - * - */ - -#ifndef PRIVATE_H_INCLUDED - - #define PRIVATE_H_INCLUDED - - // http://stackoverflow.com/questions/28683358/error-hypot-has-not-been-declared-in-cmath-while-trying-to-embed-python - #include - - #include - - #include - #include - - using namespace std; - - typedef struct { - - PyObject_HEAD - - PW3270_NAMESPACE::session * session; - - } pw3270_TerminalObject; - - extern PyObject * terminalError; - - extern "C" { - - PyObject * terminal_new(PyTypeObject *type, PyObject *args, PyObject *kwds); - int terminal_init(pw3270_TerminalObject *self, PyObject *args, PyObject *kwds); - void terminal_dealloc(pw3270_TerminalObject * self); - - PyObject * terminal_get_version(PyObject *self, PyObject *args); - PyObject * terminal_get_revision(PyObject *self, PyObject *args); - - PyObject * terminal_is_connected(PyObject *self, PyObject *args); - PyObject * terminal_is_ready(PyObject *self, PyObject *args); - - PyObject * terminal_connect(PyObject *self, PyObject *args); - PyObject * terminal_disconnect(PyObject *self, PyObject *args); - - PyObject * terminal_get_string_at(PyObject *self, PyObject *args); - PyObject * terminal_get_contents(PyObject *self); - PyObject * terminal_set_string_at(PyObject *self, PyObject *args); - PyObject * terminal_cmp_string_at(PyObject *self, PyObject *args); - - PyObject * terminal_pfkey(PyObject *self, PyObject *args); - PyObject * terminal_pakey(PyObject *self, PyObject *args); - PyObject * terminal_enter(PyObject *self, PyObject *args); - PyObject * terminal_action(PyObject *self, PyObject *args); - - PyObject * terminal_is_protected_at(PyObject *self, PyObject *args); - PyObject * terminal_set_cursor_at(PyObject *self, PyObject *args); - - PyObject * terminal_wait_for_ready(PyObject *self, PyObject *args); - PyObject * terminal_wait_for_string_at(PyObject *self, PyObject *args); - - } - -#endif // PRIVATE_H_INCLUDED diff --git a/src/python/py3270.cbp b/src/python/py3270.cbp deleted file mode 100644 index 37aabf6..0000000 --- a/src/python/py3270.cbp +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - diff --git a/src/python/py3270.cc b/src/python/py3270.cc deleted file mode 100644 index 7347da8..0000000 --- a/src/python/py3270.cc +++ /dev/null @@ -1,162 +0,0 @@ -/* - * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 - * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a - * aplicativos mainframe. Registro no INPI sob o nome G3270. - * - * Copyright (C) <2008> - * - * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob - * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela - * Free Software Foundation. - * - * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER - * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO - * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para - * obter mais detalhes. - * - * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este - * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin - * St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Este programa está nomeado como py3270.cc e possui - linhas de código. - * - * Contatos: - * - * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) - * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) - * - * Implementa métodos básicos para a extensão python. - * - * Referências: - * - * - * - * - */ - - #include "private.h" - -/*---[ Globals ]------------------------------------------------------------------------------------*/ - - PyObject * terminalError = NULL; - -/*---[ Implement ]----------------------------------------------------------------------------------*/ - -static PyObject * get_revision(PyObject *self, PyObject *args) { - - return PyLong_FromLong(atoi(PACKAGE_REVISION)); - -} - -static PyMethodDef terminal_methods[] = { - - { "Version", terminal_get_version, METH_NOARGS, "Get the lib3270 version string." }, - { "Revision", terminal_get_revision, METH_NOARGS, "Get the lib3270 revision number." }, - - { "IsConnected", terminal_is_connected, METH_NOARGS, "True if the terminal is connected to the host." }, - { "IsReady", terminal_is_ready, METH_NOARGS, "True if the terminal has finished network activity." }, - { "IsProtected", terminal_is_protected_at, METH_VARARGS, "True if the position is read-only." }, - - { "SetCursorPosition", terminal_set_cursor_at, METH_VARARGS, "Set cursor position." }, - - { "WaitForStringAt", terminal_wait_for_string_at, METH_VARARGS, "Wait for string at position" }, - { "WaitForReady", terminal_wait_for_ready, METH_VARARGS, "Wait for network communication to finish" }, - - { "Connect", terminal_connect, METH_VARARGS, "Connect to the host." }, - { "Disconnect", terminal_disconnect, METH_NOARGS, "Disconnect from host." }, - - { "CmpStringAt", terminal_cmp_string_at, METH_VARARGS, "Compare string with terminal buffer at the position." }, - { "GetStringAt", terminal_get_string_at, METH_VARARGS, "Get string from terminal buffer." }, - { "SetStringAt", terminal_set_string_at, METH_VARARGS, "Set string in terminal buffer." }, - - { "PFKey", terminal_pfkey, METH_VARARGS, "Send PF key." }, - { "PAKey", terminal_pakey, METH_VARARGS, "Send PA key." }, - { "Enter", terminal_enter, METH_NOARGS, "Send Enter Key." }, - { "Action", terminal_action, METH_VARARGS, "Send Action by name." }, - - {NULL} // Sentinel - -}; - -/* -static PyMemberDef terminal_members[] = { - - { NULL } // Sentinel - -}; -*/ - -static PyTypeObject pw3270_TerminalType = { - PyObject_HEAD_INIT(NULL) - 0, /*ob_size*/ - "py3270.terminal", /*tp_name*/ - sizeof(pw3270_TerminalObject), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - (destructor) terminal_dealloc, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - 0, /*tp_compare*/ - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash */ - 0, /*tp_call*/ - terminal_get_contents, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/ - "3270 terminal object", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - terminal_methods, /* tp_methods */ - 0, // terminal_members, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc) terminal_init, /* tp_init */ - 0, /* tp_alloc */ - terminal_new, /* tp_new */ - -}; - -static PyMethodDef MyMethods[] = { - - { "Revision", get_revision, METH_VARARGS, "Get module revision." }, - - {NULL, NULL, 0, NULL} /* Sentinel */ - -}; - -PyMODINIT_FUNC initpy3270(void) { - - // Cria o módulo - - PyObject *m = Py_InitModule("py3270", MyMethods); - - if (m == NULL) - return; - - // Adiciona objeto para tratamento de erros. - terminalError = PyErr_NewException((char *) "py3270.error", NULL, NULL); - - (void) Py_INCREF(terminalError); - PyModule_AddObject(m, "error", terminalError); - - // Adiciona terminal - if(PyType_Ready(&pw3270_TerminalType) < 0) - return - - (void) Py_INCREF(&pw3270_TerminalType); - PyModule_AddObject(m, "Terminal", (PyObject *)&pw3270_TerminalType); - -} diff --git a/src/python/sample.py b/src/python/sample.py deleted file mode 100644 index c7b682a..0000000 --- a/src/python/sample.py +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/python -#-*- coding: utf-8 - -import py3270 - -print "Teste extensão pw3270" - -print py3270.Revision() - -term = py3270.Terminal("") - -print "Using pw3270 version " + term.Version() + " revision " + term.Revision() - -term.Connect("tn3270://zos.efglobe.com:telnet",10); - -print term.IsConnected() -print term.IsReady() - -print term.GetStringAt(14,19,38) - -print "-----------------------------------------------------------------------" -print term -print "-----------------------------------------------------------------------" - - - - - - - - diff --git a/src/python/set.cc b/src/python/set.cc deleted file mode 100644 index 759495d..0000000 --- a/src/python/set.cc +++ /dev/null @@ -1,86 +0,0 @@ -/* - * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 - * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a - * aplicativos mainframe. Registro no INPI sob o nome G3270. - * - * Copyright (C) <2008> - * - * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob - * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela - * Free Software Foundation. - * - * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER - * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO - * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para - * obter mais detalhes. - * - * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este - * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin - * St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Este programa está nomeado como set.cc e possui - linhas de código. - * - * Contatos - * - * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) - * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) - * - * Referências: - * - * - * - * - */ - - #include "private.h" - - -/*---[ Implement ]----------------------------------------------------------------------------------*/ - - PyObject * terminal_set_string_at(PyObject *self, PyObject *args) { - - int row, col, rc; - const char *text; - - if (!PyArg_ParseTuple(args, "iis", &row, &col, &text)) { - PyErr_SetString(terminalError, strerror(EINVAL)); - return NULL; - } - - try { - - rc = ((pw3270_TerminalObject *) self)->session->set_string_at(row,col,text); - - } catch(std::exception &e) { - - PyErr_SetString(terminalError, e.what()); - return NULL; - } - - return PyLong_FromLong(rc); - - } - - PyObject * terminal_set_cursor_at(PyObject *self, PyObject *args) { - - int row, col, rc; - - if (!PyArg_ParseTuple(args, "ii", &row, &col)) { - PyErr_SetString(terminalError, strerror(EINVAL)); - return NULL; - } - - try { - - rc = ((pw3270_TerminalObject *) self)->session->set_cursor_position(row,col); - - } catch(std::exception &e) { - - PyErr_SetString(terminalError, e.what()); - return NULL; - } - - return PyLong_FromLong(rc); - - } - diff --git a/src/python/test.sh b/src/python/test.sh deleted file mode 100755 index fe87a6a..0000000 --- a/src/python/test.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -export PYTHONPATH=${PWD}/.bin/Debug:${PYTHONPATH} - -python ./sample.py - -- libgit2 0.21.2