diff --git a/src/oxt/Makefile.in b/src/oxt/Makefile.in index 6dcb6c6..b51bd44 100644 --- a/src/oxt/Makefile.in +++ b/src/oxt/Makefile.in @@ -1,7 +1,7 @@ PACKAGE=@PACKAGE_NAME@ -SOURCES=main.cxx local.cxx connection.cxx get.cxx set.cxx actions.cxx +SOURCES=main.cxx local.cxx connection.cxx get.cxx set.cxx actions.cxx remote.cxx prefix=/usr exec_prefix=@exec_prefix@ diff --git a/src/oxt/globals.hpp b/src/oxt/globals.hpp index 49d77b5..4d90fe0 100644 --- a/src/oxt/globals.hpp +++ b/src/oxt/globals.hpp @@ -29,10 +29,10 @@ /*---[ Debug macros ]--------------------------------------------------------------------------------------*/ #ifdef DEBUG - #define trace(fmt, ... ) fprintf(stderr, "%s(%d) " fmt "\n", __FILE__, __LINE__, __VA_ARGS__ ); fflush(stderr); + #define trace(fmt, ... ) fprintf(stderr, "%s(%d) " fmt "\n", __FILE__, __LINE__, __VA_ARGS__ ); fflush(stderr); #else #define trace( fmt, ... ) /* fmt __VA_ARGS__ */ - #endif + #endif /*---[ Object implementation ]-----------------------------------------------------------------------------*/ @@ -128,6 +128,31 @@ }; + class ipc3270_session : public session + { + public: + ipc3270_session(const char *name); + virtual ~ipc3270_session(); + virtual int get_revision(void); + virtual LIB3270_MESSAGE get_state(void); + virtual char * get_text_at(int row, int col, int len); + virtual int set_text_at(int row, int col, const char *text); + virtual int cmp_text_at(int row, int col, const char *text); + virtual void set_toggle(LIB3270_TOGGLE toggle, bool state); + + virtual int connect(const char *uri); + virtual int disconnect(void); + virtual bool connected(void); + + virtual int enter(void); + virtual int pfkey(int key); + virtual int pakey(int key); + virtual bool in_tn3270e(); + virtual void mem_free(void *); + + }; + + class uno_impl : public ::cppu::WeakImplHelper3< br::com::bb::pw3270intf, com::sun::star::lang::XServiceInfo, com::sun::star::lang::XInitialization > { public: @@ -163,6 +188,7 @@ virtual ::sal_Int16 SAL_CALL waitForReady( ::sal_Int16 seconds ) throw (::com::sun::star::uno::RuntimeException); virtual ::sal_Int16 SAL_CALL dsTrace( ::sal_Bool state ) throw (::com::sun::star::uno::RuntimeException); virtual ::sal_Int16 SAL_CALL screenTrace( ::sal_Bool state ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int16 SAL_CALL setSession( const ::rtl::OUString& name ) throw (::com::sun::star::uno::RuntimeException); private: diff --git a/src/oxt/main.cxx b/src/oxt/main.cxx index 49f3167..00fb3c6 100644 --- a/src/oxt/main.cxx +++ b/src/oxt/main.cxx @@ -79,13 +79,13 @@ static Reference< XInterface > SAL_CALL CreateInstance( const Reference< XCompon * i.e. has special context */ extern "C" void SAL_CALL component_getImplementationEnvironment(const sal_Char ** ppEnvTypeName, uno_Environment ** ppEnv) -{ -#ifdef LANGUAGE_BINDING_NAME +{ +#ifdef LANGUAGE_BINDING_NAME trace("%s set envtype to %s\n",__FUNCTION__,LANGUAGE_BINDING_NAME); - *ppEnvTypeName = LANGUAGE_BINDING_NAME; -#else - trace("%s set envtype to %s\n",__FUNCTION__,"msci"); - *ppEnvTypeName = "msci"; + *ppEnvTypeName = LANGUAGE_BINDING_NAME; +#else + trace("%s set envtype to %s\n",__FUNCTION__,"msci"); + *ppEnvTypeName = "msci"; #endif } @@ -115,10 +115,10 @@ extern "C" void SAL_CALL component_getImplementationEnvironment(const sal_Char * * @return true if everything went fine */ extern "C" sal_Bool SAL_CALL component_writeInfo(void * pServiceManager, void * pRegistryKey) -{ - sal_Bool result = sal_False; - - trace("%s",__FUNCTION__); +{ + sal_Bool result = sal_False; + + trace("%s",__FUNCTION__); if (pRegistryKey) { @@ -141,8 +141,8 @@ extern "C" sal_Bool SAL_CALL component_writeInfo(void * pServiceManager, void * // we should not ignore exceptions } } - - return result; + + return result; } /********************************************************* @@ -171,7 +171,7 @@ extern "C" void * SAL_CALL component_getFactory(const sal_Char * pImplName, void void * pRet = 0; trace("%s",__FUNCTION__); - + if(pServiceManager && rtl_str_compare( pImplName, IMPLNAME ) == 0) { Reference< XSingleComponentFactory > xFactory( ::cppu::createSingleComponentFactory( @@ -184,7 +184,7 @@ extern "C" void * SAL_CALL component_getFactory(const sal_Char * pImplName, void pRet = xFactory.get(); } } - + return pRet; } @@ -285,3 +285,12 @@ void pw3270::session::log(const char *fmt, const char *msg) #endif // HAVE_SYSLOG } +::sal_Int16 SAL_CALL pw3270::uno_impl::setSession( const ::rtl::OUString& name ) throw (::com::sun::star::uno::RuntimeException) +{ + OString str = rtl::OUStringToOString( name , hSession->get_encoding() ); + + delete this->hSession; + this->hSession = new ipc3270_session(str.getStr()); + + return 0; +} diff --git a/src/oxt/pw3270.idl b/src/oxt/pw3270.idl index 78b5b84..ada7293 100644 --- a/src/oxt/pw3270.idl +++ b/src/oxt/pw3270.idl @@ -74,6 +74,7 @@ module br short pakey([in] short keycode); /* Misc */ + short setSession([in] string name); short getRevision(); string getVersion(); short log([in] string msg); @@ -83,8 +84,8 @@ module br short waitForReady([in] short seconds); // short waitForTextAt(in] short row, [in] short col, [in] string text, [in] short seconds); boolean isConnected(); - short dsTrace([in] boolean mode); - short screenTrace([in] boolean mode); + short dsTrace([in] boolean mode); + short screenTrace([in] boolean mode); }; diff --git a/src/oxt/pw3270OXT.cbp b/src/oxt/pw3270OXT.cbp index 44d32a5..699cf5b 100644 --- a/src/oxt/pw3270OXT.cbp +++ b/src/oxt/pw3270OXT.cbp @@ -42,6 +42,7 @@ + diff --git a/src/oxt/remote.cxx b/src/oxt/remote.cxx new file mode 100644 index 0000000..e3ff8a2 --- /dev/null +++ b/src/oxt/remote.cxx @@ -0,0 +1,228 @@ +/* + * "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 remote.cxx e possui - linhas de código. + * + * Contatos: + * + * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) + * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) + * licinio@bb.com.br (Licínio Luis Branco) + * kraucer@bb.com.br (Kraucer Fernandes Mazuco) + * + */ + + #include "globals.hpp" + #include + #include + +/*---[ Statics ]-------------------------------------------------------------------------------------------*/ + + +/*---[ Implement ]-----------------------------------------------------------------------------------------*/ + +pw3270::ipc3270_session::ipc3270_session(const char *name) : pw3270::session() +{ +#ifdef HAVE_DBUS + +#else + +#endif // HAVE_DBUS +} + +pw3270::ipc3270_session::~ipc3270_session() +{ +#ifdef HAVE_DBUS + +#endif // HAVE_DBUS +} + +int pw3270::ipc3270_session::get_revision(void) +{ +#ifdef HAVE_DBUS + + return -1; + +#else + + return -1; + +#endif // HAVE_DBUS +} + +LIB3270_MESSAGE pw3270::ipc3270_session::get_state(void) +{ +#ifdef HAVE_DBUS + + return (LIB3270_MESSAGE) -1; + +#else + + return (LIB3270_MESSAGE) -1; + +#endif // HAVE_DBUS +} + +char * pw3270::ipc3270_session::get_text_at(int row, int col, int len) +{ +#ifdef HAVE_DBUS + + return NULL; + +#else + + return NULL; + +#endif // HAVE_DBUS +} + +int pw3270::ipc3270_session::set_text_at(int row, int col, const char *text) +{ +#ifdef HAVE_DBUS + + return -1; + +#else + + return -1; + +#endif // HAVE_DBUS +} + +int pw3270::ipc3270_session::cmp_text_at(int row, int col, const char *text) +{ +#ifdef HAVE_DBUS + + return -1; + +#else + + return -1; + +#endif // HAVE_DBUS +} + +void pw3270::ipc3270_session::set_toggle(LIB3270_TOGGLE toggle, bool state) +{ +} + +int pw3270::ipc3270_session::connect(const char *uri) +{ +#ifdef HAVE_DBUS + + return -1; + +#else + + return -1; + +#endif // HAVE_DBUS +} + +int pw3270::ipc3270_session::disconnect(void) +{ +#ifdef HAVE_DBUS + + return -1; + +#else + + return -1; + +#endif // HAVE_DBUS +} + +bool pw3270::ipc3270_session::connected(void) +{ +#ifdef HAVE_DBUS + + return false; + +#else + + return false; + +#endif // HAVE_DBUS +} + +int pw3270::ipc3270_session::enter(void) +{ +#ifdef HAVE_DBUS + + return -1; + +#else + + return -1; + +#endif // HAVE_DBUS +} + +int pw3270::ipc3270_session::pfkey(int key) +{ +#ifdef HAVE_DBUS + + return -1; + +#else + + return -1; + +#endif // HAVE_DBUS +} + +int pw3270::ipc3270_session::pakey(int key) +{ +#ifdef HAVE_DBUS + + return -1; + +#else + + return -1; + +#endif // HAVE_DBUS +} + +bool pw3270::ipc3270_session::in_tn3270e() +{ +#ifdef HAVE_DBUS + + return false; + +#else + + return false; + +#endif // HAVE_DBUS +} + +void pw3270::ipc3270_session::mem_free(void *ptr) +{ +#ifdef HAVE_DBUS + + +#else + + +#endif // HAVE_DBUS +} + + -- libgit2 0.21.2