From 0b0e5b0ee94f585653ccfa6cfb3cd4de6b2c5da0 Mon Sep 17 00:00:00 2001 From: perry.werneck@gmail.com Date: Fri, 28 Mar 2014 18:31:27 +0000 Subject: [PATCH] Mudando o nome do módulo oxt para openoffice --- configure.ac | 2 +- src/openoffice/Makefile.in | 141 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/openoffice/get.cc | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/openoffice/globals.hpp | 92 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/openoffice/info.cc | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/openoffice/init.cc | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/openoffice/loffice3270.cbp | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/openoffice/pw3270.idl | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/openoffice/research.sh | 44 ++++++++++++++++++++++++++++++++++++++++++++ src/openoffice/service.cc | 100 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/openoffice/testprogram.cc | 133 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/oxt/Makefile.in | 141 --------------------------------------------------------------------------------------------------------------------------------------------- src/oxt/get.cc | 71 ----------------------------------------------------------------------- src/oxt/globals.hpp | 92 -------------------------------------------------------------------------------------------- src/oxt/info.cc | 58 ---------------------------------------------------------- src/oxt/init.cc | 55 ------------------------------------------------------- src/oxt/loffice3270.cbp | 57 --------------------------------------------------------- src/oxt/pw3270.idl | 54 ------------------------------------------------------ src/oxt/research.sh | 44 -------------------------------------------- src/oxt/service.cc | 100 ---------------------------------------------------------------------------------------------------- src/oxt/testprogram.cc | 133 ------------------------------------------------------------------------------------------------------------------------------------- 21 files changed, 806 insertions(+), 806 deletions(-) create mode 100644 src/openoffice/Makefile.in create mode 100644 src/openoffice/get.cc create mode 100644 src/openoffice/globals.hpp create mode 100644 src/openoffice/info.cc create mode 100644 src/openoffice/init.cc create mode 100644 src/openoffice/loffice3270.cbp create mode 100644 src/openoffice/pw3270.idl create mode 100755 src/openoffice/research.sh create mode 100644 src/openoffice/service.cc create mode 100644 src/openoffice/testprogram.cc delete mode 100644 src/oxt/Makefile.in delete mode 100644 src/oxt/get.cc delete mode 100644 src/oxt/globals.hpp delete mode 100644 src/oxt/info.cc delete mode 100644 src/oxt/init.cc delete mode 100644 src/oxt/loffice3270.cbp delete mode 100644 src/oxt/pw3270.idl delete mode 100755 src/oxt/research.sh delete mode 100644 src/oxt/service.cc delete mode 100644 src/oxt/testprogram.cc diff --git a/configure.ac b/configure.ac index 8a209d1..dfac9a7 100644 --- a/configure.ac +++ b/configure.ac @@ -570,7 +570,7 @@ AC_CONFIG_FILES([ src/lib3270/Makefile src/lib3270/mkversion.sh src/pw3270/Makefile - src/oxt/Makefile + src/openoffice/Makefile src/pw3270/uiparser/Makefile src/tools/Makefile src/plugins/hllapi/Makefile diff --git a/src/openoffice/Makefile.in b/src/openoffice/Makefile.in new file mode 100644 index 0000000..5b29b06 --- /dev/null +++ b/src/openoffice/Makefile.in @@ -0,0 +1,141 @@ +# +# "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) +# + +SOURCES=info.cc get.cc service.cc init.cc + +UNO_CLASSES=XWeak RuntimeException + +#---[ LibreOffice SDK ]-------------------------------------------------------- + +OO_SDK_HOME=@OO_SDK_HOME@ +OO_SDK_URE_HOME=@OO_SDK_URE_HOME@ +IDLC=@IDLC@ +REGMERGE=@REGMERGE@ +CPPUMAKER=@CPPUMAKER@ +TYPES_RDB=@OO_SDK_URE_HOME@/share/misc/types.rdb + +#---[ Paths ]------------------------------------------------------------------ + +prefix=@prefix@ +exec_prefix=@exec_prefix@ +bindir=@bindir@ +sbindir=@sbindir@ +libdir=@libdir@ +includedir=@includedir@ + +#---[ Tools ]------------------------------------------------------------------ + +CXX=@CXX@ +MKDIR=@MKDIR_P@ + +#---[ lib3270 common class ]--------------------------------------------------- + +CLASSLIBDIR=../classlib +include $(CLASSLIBDIR)/class.mak + +#---[ lib3270 common class ]--------------------------------------------------- + +OBJDIR=.obj +BINDIR=.bin + +OBJDBG=$(OBJDIR)/Debug +BINDBG=$(BINDIR)/Debug + +OBJRLS=$(OBJDIR)/Release +BINRLS=$(BINDIR)/Release + +#---[ Build options ]---------------------------------------------------------- + +CPPUENV="gcc3" +CXXFLAGS=@CXXFLAGS@ -fvisibility=hidden @DLL_CFLAGS@ -Wno-strict-aliasing -I./include -I$(includedir)/libreoffice -Wno-strict-aliasing -DCPPU_ENV=$(CPPUENV) -DLANGUAGE_BINDING_NAME=\"$(CPPUENV)\" + +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 \ + -luno_cppu -luno_cppuhelpergcc3 -luno_salhelpergcc3 + +#---[ Rules ]------------------------------------------------------------------ + +%.urd: %.idl + @echo $@ ... + @$(MKDIR) `dirname $@` + @$(IDLC) -C -I$(OO_SDK_HOME)/idl -O`dirname $@` $< + +%.urd: /usr/share/idl/libreoffice/com/sun/star/uno/%.idl + @echo $@ ... + @$(MKDIR) `dirname $@` + @$(IDLC) -C -I$(OO_SDK_HOME)/idl -O`dirname $@` $< + +%.rdb: %.urd + @echo $@ ... + @$(MKDIR) `dirname $@` + @$(REGMERGE) $@ /UCR $< + +$(OBJDBG)/%.o: %.cc include/pw3270/lib3270.hpp \ + $(foreach CLS, $(basename $(UNO_CLASSES)), include/com/sun/star/uno/$(CLS).hpp) \ + *.hpp Makefile + @echo $< ... + @mkdir -p `dirname $@` + $(CXX) -DDEBUG=1 $(CXXFLAGS) -o $@ -c $< +# $(DBG_CFLAGS) $(CXXFLAGS) $(LIB3270_CFLAGS) -DLIBNAME=\"$(BINDBG)/$(PROGRAM_NAME).uno@DLLEXT@\" -o $@ -c $< + + +#---[ UNO targets ]------------------------------------------------------------ + +include/pw3270/lib3270.hpp: pw3270.rdb + @echo $@ ... + @$(MKDIR) `dirname $@` + @$(CPPUMAKER) -O./include -Tpw3270.lib3270 $(TYPES_RDB) $< + +include/com/sun/star/uno/%.hpp: %.rdb + @echo $@ ... + @$(MKDIR) `dirname $@` + @$(CPPUMAKER) -O./include $(TYPES_RDB) $< + + +#---[ Debug targets ]---------------------------------------------------------- + +Debug: $(BINDBG)/pw3270.uno@DLLEXT@ + +cleanDebug: clean + +$(BINDBG)/pw3270.uno@DLLEXT@: $(foreach SRC, $(basename $(SOURCES)), $(OBJDBG)/$(SRC)@OBJEXT@) + @echo $@ ... + @$(MKDIR) `dirname $@` + $(CXX) -shared $(LDFLAGS) $(OO_LDFLAGS) -o $@ $^ + + +#---[ Misc targets ]----------------------------------------------------------- + +all: include/pw3270/lib3270.hpp + +clean: + @rm -f *.urd + @rm -f *.rdb + @rm -fr include + @rm -fr $(OBJDIR) + @rm -fr $(BINDIR) + + diff --git a/src/openoffice/get.cc b/src/openoffice/get.cc new file mode 100644 index 0000000..297a3d5 --- /dev/null +++ b/src/openoffice/get.cc @@ -0,0 +1,71 @@ +/* + * "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) + * + /* + * "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; + + ::rtl::OUString session_impl::getVersion() throw (RuntimeException) + { + return OUString( RTL_CONSTASCII_USTRINGPARAM("Testing") ); + } diff --git a/src/openoffice/globals.hpp b/src/openoffice/globals.hpp new file mode 100644 index 0000000..a33dddb --- /dev/null +++ b/src/openoffice/globals.hpp @@ -0,0 +1,92 @@ +/* + * "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 + #endif + + + #include // "3" implementing three interfaces + #include + #include +// #include + #include + #include + + #include + + + 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 + + + namespace pw3270_impl + { + // https://wiki.openoffice.org/wiki/Documentation/DevGuide/WritingUNO/C%2B%2B/Class_Definition_with_Helper_Template_Classes + class session_impl : public ::cppu::WeakImplHelper3< ::pw3270::lib3270, XServiceInfo, XInitialization > + { + public: + // 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); + + }; + + 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/openoffice/info.cc b/src/openoffice/info.cc new file mode 100644 index 0000000..b47503c --- /dev/null +++ b/src/openoffice/info.cc @@ -0,0 +1,58 @@ +/* + * "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/openoffice/init.cc b/src/openoffice/init.cc new file mode 100644 index 0000000..f4061a9 --- /dev/null +++ b/src/openoffice/init.cc @@ -0,0 +1,55 @@ +/* + * "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; + +// 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 ); + } + + // Initialize + +} diff --git a/src/openoffice/loffice3270.cbp b/src/openoffice/loffice3270.cbp new file mode 100644 index 0000000..2783c49 --- /dev/null +++ b/src/openoffice/loffice3270.cbp @@ -0,0 +1,57 @@ + + + + + + diff --git a/src/openoffice/pw3270.idl b/src/openoffice/pw3270.idl new file mode 100644 index 0000000..a8a084a --- /dev/null +++ b/src/openoffice/pw3270.idl @@ -0,0 +1,54 @@ +/* + * "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 + +module pw3270 +{ + /* + * Interface to lib3270 + */ + interface lib3270 : com::sun::star::uno::XInterface + { + string getVersion(); + }; + + service session + { + interface lib3270; + interface com::sun::star::lang::XInitialization; + }; +}; + diff --git a/src/openoffice/research.sh b/src/openoffice/research.sh new file mode 100755 index 0000000..4bb9ad0 --- /dev/null +++ b/src/openoffice/research.sh @@ -0,0 +1,44 @@ +#!/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/openoffice/service.cc b/src/openoffice/service.cc new file mode 100644 index 0000000..31337f8 --- /dev/null +++ b/src/openoffice/service.cc @@ -0,0 +1,100 @@ +/* + * "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 ]-----------------------------------------------------------------------------------------*/ + +using 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() ); +} + +namespace pw3270_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" +{ + __attribute__((visibility("default"))) 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 ); + } + + __attribute__((visibility("default"))) sal_Bool SAL_CALL component_writeInfo(lang::XMultiServiceFactory * xMgr, registry::XRegistryKey * xRegistry ) + { + return ::cppu::component_writeInfoHelper(xMgr, xRegistry, ::pw3270_impl::s_component_entries ); + } + + __attribute__((visibility("default"))) void SAL_CALL component_getImplementationEnvironment(sal_Char const ** ppEnvTypeName, uno_Environment ** ppEnv ) + { + * ppEnvTypeName = LANGUAGE_BINDING_NAME; + } + +} diff --git a/src/openoffice/testprogram.cc b/src/openoffice/testprogram.cc new file mode 100644 index 0000000..c9cf8c5 --- /dev/null +++ b/src/openoffice/testprogram.cc @@ -0,0 +1,133 @@ +/* + * "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 "pw3270/lib3270.hpp" + +/*---[ Implement ]-----------------------------------------------------------------------------------------*/ + +int SAL_CALL main(int argc, char **argv) +{ +/* + + 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/oxt/Makefile.in b/src/oxt/Makefile.in deleted file mode 100644 index 5b29b06..0000000 --- a/src/oxt/Makefile.in +++ /dev/null @@ -1,141 +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) -# - -SOURCES=info.cc get.cc service.cc init.cc - -UNO_CLASSES=XWeak RuntimeException - -#---[ LibreOffice SDK ]-------------------------------------------------------- - -OO_SDK_HOME=@OO_SDK_HOME@ -OO_SDK_URE_HOME=@OO_SDK_URE_HOME@ -IDLC=@IDLC@ -REGMERGE=@REGMERGE@ -CPPUMAKER=@CPPUMAKER@ -TYPES_RDB=@OO_SDK_URE_HOME@/share/misc/types.rdb - -#---[ Paths ]------------------------------------------------------------------ - -prefix=@prefix@ -exec_prefix=@exec_prefix@ -bindir=@bindir@ -sbindir=@sbindir@ -libdir=@libdir@ -includedir=@includedir@ - -#---[ Tools ]------------------------------------------------------------------ - -CXX=@CXX@ -MKDIR=@MKDIR_P@ - -#---[ lib3270 common class ]--------------------------------------------------- - -CLASSLIBDIR=../classlib -include $(CLASSLIBDIR)/class.mak - -#---[ lib3270 common class ]--------------------------------------------------- - -OBJDIR=.obj -BINDIR=.bin - -OBJDBG=$(OBJDIR)/Debug -BINDBG=$(BINDIR)/Debug - -OBJRLS=$(OBJDIR)/Release -BINRLS=$(BINDIR)/Release - -#---[ Build options ]---------------------------------------------------------- - -CPPUENV="gcc3" -CXXFLAGS=@CXXFLAGS@ -fvisibility=hidden @DLL_CFLAGS@ -Wno-strict-aliasing -I./include -I$(includedir)/libreoffice -Wno-strict-aliasing -DCPPU_ENV=$(CPPUENV) -DLANGUAGE_BINDING_NAME=\"$(CPPUENV)\" - -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 \ - -luno_cppu -luno_cppuhelpergcc3 -luno_salhelpergcc3 - -#---[ Rules ]------------------------------------------------------------------ - -%.urd: %.idl - @echo $@ ... - @$(MKDIR) `dirname $@` - @$(IDLC) -C -I$(OO_SDK_HOME)/idl -O`dirname $@` $< - -%.urd: /usr/share/idl/libreoffice/com/sun/star/uno/%.idl - @echo $@ ... - @$(MKDIR) `dirname $@` - @$(IDLC) -C -I$(OO_SDK_HOME)/idl -O`dirname $@` $< - -%.rdb: %.urd - @echo $@ ... - @$(MKDIR) `dirname $@` - @$(REGMERGE) $@ /UCR $< - -$(OBJDBG)/%.o: %.cc include/pw3270/lib3270.hpp \ - $(foreach CLS, $(basename $(UNO_CLASSES)), include/com/sun/star/uno/$(CLS).hpp) \ - *.hpp Makefile - @echo $< ... - @mkdir -p `dirname $@` - $(CXX) -DDEBUG=1 $(CXXFLAGS) -o $@ -c $< -# $(DBG_CFLAGS) $(CXXFLAGS) $(LIB3270_CFLAGS) -DLIBNAME=\"$(BINDBG)/$(PROGRAM_NAME).uno@DLLEXT@\" -o $@ -c $< - - -#---[ UNO targets ]------------------------------------------------------------ - -include/pw3270/lib3270.hpp: pw3270.rdb - @echo $@ ... - @$(MKDIR) `dirname $@` - @$(CPPUMAKER) -O./include -Tpw3270.lib3270 $(TYPES_RDB) $< - -include/com/sun/star/uno/%.hpp: %.rdb - @echo $@ ... - @$(MKDIR) `dirname $@` - @$(CPPUMAKER) -O./include $(TYPES_RDB) $< - - -#---[ Debug targets ]---------------------------------------------------------- - -Debug: $(BINDBG)/pw3270.uno@DLLEXT@ - -cleanDebug: clean - -$(BINDBG)/pw3270.uno@DLLEXT@: $(foreach SRC, $(basename $(SOURCES)), $(OBJDBG)/$(SRC)@OBJEXT@) - @echo $@ ... - @$(MKDIR) `dirname $@` - $(CXX) -shared $(LDFLAGS) $(OO_LDFLAGS) -o $@ $^ - - -#---[ Misc targets ]----------------------------------------------------------- - -all: include/pw3270/lib3270.hpp - -clean: - @rm -f *.urd - @rm -f *.rdb - @rm -fr include - @rm -fr $(OBJDIR) - @rm -fr $(BINDIR) - - diff --git a/src/oxt/get.cc b/src/oxt/get.cc deleted file mode 100644 index 297a3d5..0000000 --- a/src/oxt/get.cc +++ /dev/null @@ -1,71 +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) - * - /* - * "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; - - ::rtl::OUString session_impl::getVersion() throw (RuntimeException) - { - return OUString( RTL_CONSTASCII_USTRINGPARAM("Testing") ); - } diff --git a/src/oxt/globals.hpp b/src/oxt/globals.hpp deleted file mode 100644 index a33dddb..0000000 --- a/src/oxt/globals.hpp +++ /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 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 - #endif - - - #include // "3" implementing three interfaces - #include - #include -// #include - #include - #include - - #include - - - 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 - - - namespace pw3270_impl - { - // https://wiki.openoffice.org/wiki/Documentation/DevGuide/WritingUNO/C%2B%2B/Class_Definition_with_Helper_Template_Classes - class session_impl : public ::cppu::WeakImplHelper3< ::pw3270::lib3270, XServiceInfo, XInitialization > - { - public: - // 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); - - }; - - 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/oxt/info.cc b/src/oxt/info.cc deleted file mode 100644 index b47503c..0000000 --- a/src/oxt/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/oxt/init.cc b/src/oxt/init.cc deleted file mode 100644 index f4061a9..0000000 --- a/src/oxt/init.cc +++ /dev/null @@ -1,55 +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; - -// 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 ); - } - - // Initialize - -} diff --git a/src/oxt/loffice3270.cbp b/src/oxt/loffice3270.cbp deleted file mode 100644 index 2783c49..0000000 --- a/src/oxt/loffice3270.cbp +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - diff --git a/src/oxt/pw3270.idl b/src/oxt/pw3270.idl deleted file mode 100644 index a8a084a..0000000 --- a/src/oxt/pw3270.idl +++ /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., 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 - -module pw3270 -{ - /* - * Interface to lib3270 - */ - interface lib3270 : com::sun::star::uno::XInterface - { - string getVersion(); - }; - - service session - { - interface lib3270; - interface com::sun::star::lang::XInitialization; - }; -}; - diff --git a/src/oxt/research.sh b/src/oxt/research.sh deleted file mode 100755 index 4bb9ad0..0000000 --- a/src/oxt/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/oxt/service.cc b/src/oxt/service.cc deleted file mode 100644 index 31337f8..0000000 --- a/src/oxt/service.cc +++ /dev/null @@ -1,100 +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 ]-----------------------------------------------------------------------------------------*/ - -using 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() ); -} - -namespace pw3270_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" -{ - __attribute__((visibility("default"))) 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 ); - } - - __attribute__((visibility("default"))) sal_Bool SAL_CALL component_writeInfo(lang::XMultiServiceFactory * xMgr, registry::XRegistryKey * xRegistry ) - { - return ::cppu::component_writeInfoHelper(xMgr, xRegistry, ::pw3270_impl::s_component_entries ); - } - - __attribute__((visibility("default"))) void SAL_CALL component_getImplementationEnvironment(sal_Char const ** ppEnvTypeName, uno_Environment ** ppEnv ) - { - * ppEnvTypeName = LANGUAGE_BINDING_NAME; - } - -} diff --git a/src/oxt/testprogram.cc b/src/oxt/testprogram.cc deleted file mode 100644 index c9cf8c5..0000000 --- a/src/oxt/testprogram.cc +++ /dev/null @@ -1,133 +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 "pw3270/lib3270.hpp" - -/*---[ Implement ]-----------------------------------------------------------------------------------------*/ - -int SAL_CALL main(int argc, char **argv) -{ -/* - - 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; -} -- libgit2 0.21.2