Commit f6f4107149097fb2e8d294f80e34a9bee482cf84
1 parent
e2a66e58
Exists in
master
and in
5 other branches
Atualizando interface libreoffice
Showing
8 changed files
with
60 additions
and
18 deletions
Show diff stats
pw3270.cbp
| @@ -251,19 +251,27 @@ | @@ -251,19 +251,27 @@ | ||
| 251 | <Unit filename="src/lib3270/winversc.h" /> | 251 | <Unit filename="src/lib3270/winversc.h" /> |
| 252 | <Unit filename="src/lib3270/xioc.h" /> | 252 | <Unit filename="src/lib3270/xioc.h" /> |
| 253 | <Unit filename="src/lib3270/xl.h" /> | 253 | <Unit filename="src/lib3270/xl.h" /> |
| 254 | + <Unit filename="src/loffice/Makefile.in" /> | ||
| 255 | + <Unit filename="src/loffice/connect.cc" /> | ||
| 256 | + <Unit filename="src/loffice/description.txt" /> | ||
| 257 | + <Unit filename="src/loffice/description.xml" /> | ||
| 258 | + <Unit filename="src/loffice/description.xml.in" /> | ||
| 259 | + <Unit filename="src/loffice/get.cc" /> | ||
| 260 | + <Unit filename="src/loffice/globals.hpp" /> | ||
| 261 | + <Unit filename="src/loffice/info.cc" /> | ||
| 262 | + <Unit filename="src/loffice/init.cc" /> | ||
| 263 | + <Unit filename="src/loffice/manifest.xml" /> | ||
| 264 | + <Unit filename="src/loffice/manifest.xml.in" /> | ||
| 265 | + <Unit filename="src/loffice/pw3270.idl" /> | ||
| 266 | + <Unit filename="src/loffice/service.cc" /> | ||
| 267 | + <Unit filename="src/loffice/set.cc" /> | ||
| 268 | + <Unit filename="src/loffice/testprogram.cc" /> | ||
| 254 | <Unit filename="src/oxt/Makefile.in" /> | 269 | <Unit filename="src/oxt/Makefile.in" /> |
| 255 | - <Unit filename="src/oxt/actions.cxx" /> | ||
| 256 | - <Unit filename="src/oxt/connection.cxx" /> | ||
| 257 | <Unit filename="src/oxt/description.txt" /> | 270 | <Unit filename="src/oxt/description.txt" /> |
| 258 | <Unit filename="src/oxt/description.xml.in" /> | 271 | <Unit filename="src/oxt/description.xml.in" /> |
| 259 | - <Unit filename="src/oxt/get.cxx" /> | ||
| 260 | <Unit filename="src/oxt/globals.hpp" /> | 272 | <Unit filename="src/oxt/globals.hpp" /> |
| 261 | - <Unit filename="src/oxt/local.cxx" /> | ||
| 262 | - <Unit filename="src/oxt/main.cxx" /> | ||
| 263 | <Unit filename="src/oxt/manifest.xml.in" /> | 273 | <Unit filename="src/oxt/manifest.xml.in" /> |
| 264 | <Unit filename="src/oxt/pw3270.idl" /> | 274 | <Unit filename="src/oxt/pw3270.idl" /> |
| 265 | - <Unit filename="src/oxt/set.cxx" /> | ||
| 266 | - <Unit filename="src/oxt/testprogram.cxx" /> | ||
| 267 | <Unit filename="src/php/Makefile.in" /> | 275 | <Unit filename="src/php/Makefile.in" /> |
| 268 | <Unit filename="src/php/get.cc" /> | 276 | <Unit filename="src/php/get.cc" /> |
| 269 | <Unit filename="src/php/init.cc" /> | 277 | <Unit filename="src/php/init.cc" /> |
src/include/pw3270/class.h
| @@ -134,8 +134,8 @@ | @@ -134,8 +134,8 @@ | ||
| 134 | virtual string get_display_charset(void); | 134 | virtual string get_display_charset(void); |
| 135 | 135 | ||
| 136 | // Connection & Network | 136 | // Connection & Network |
| 137 | - int connect(const char *host, time_t wait = 0); | ||
| 138 | - int set_host(const char *host); | 137 | + int connect(const char *host, time_t wait = 0); |
| 138 | + int set_host(const char *host); | ||
| 139 | virtual int connect(void) = 0; | 139 | virtual int connect(void) = 0; |
| 140 | virtual int set_url(const char *hostname) = 0; | 140 | virtual int set_url(const char *hostname) = 0; |
| 141 | virtual int disconnect(void) = 0; | 141 | virtual int disconnect(void) = 0; |
src/lib3270/connect.c
| @@ -82,9 +82,11 @@ static void net_connected(H3270 *hSession, int fd, LIB3270_IO_FLAG flag, void *d | @@ -82,9 +82,11 @@ static void net_connected(H3270 *hSession, int fd, LIB3270_IO_FLAG flag, void *d | ||
| 82 | int err; | 82 | int err; |
| 83 | socklen_t len = sizeof(err); | 83 | socklen_t len = sizeof(err); |
| 84 | 84 | ||
| 85 | - trace("%s write=%p",__FUNCTION__,hSession->ns_write_id); | ||
| 86 | - lib3270_remove_poll(hSession->ns_write_id); | ||
| 87 | - hSession->ns_write_id = NULL; | 85 | + if(hSession->ns_write_id) { |
| 86 | + trace("%s write=%p",__FUNCTION__,hSession->ns_write_id); | ||
| 87 | + lib3270_remove_poll(hSession->ns_write_id); | ||
| 88 | + hSession->ns_write_id = NULL; | ||
| 89 | + } | ||
| 88 | 90 | ||
| 89 | if(getsockopt(hSession->sock, SOL_SOCKET, SO_ERROR, (char *) &err, &len) < 0) | 91 | if(getsockopt(hSession->sock, SOL_SOCKET, SO_ERROR, (char *) &err, &len) < 0) |
| 90 | { | 92 | { |
src/lib3270/iocalls.c
| @@ -628,6 +628,7 @@ void x_except_on(H3270 *h) | @@ -628,6 +628,7 @@ void x_except_on(H3270 *h) | ||
| 628 | { | 628 | { |
| 629 | int reading = (h->ns_read_id != NULL); | 629 | int reading = (h->ns_read_id != NULL); |
| 630 | 630 | ||
| 631 | + debug("%s",__FUNCTION__); | ||
| 631 | if(h->ns_exception_id) | 632 | if(h->ns_exception_id) |
| 632 | return; | 633 | return; |
| 633 | 634 | ||
| @@ -638,6 +639,7 @@ void x_except_on(H3270 *h) | @@ -638,6 +639,7 @@ void x_except_on(H3270 *h) | ||
| 638 | 639 | ||
| 639 | if(reading) | 640 | if(reading) |
| 640 | h->ns_read_id = lib3270_add_poll_fd(h,h->sock,LIB3270_IO_FLAG_READ,net_input,0); | 641 | h->ns_read_id = lib3270_add_poll_fd(h,h->sock,LIB3270_IO_FLAG_READ,net_input,0); |
| 642 | + debug("%s",__FUNCTION__); | ||
| 641 | 643 | ||
| 642 | } | 644 | } |
| 643 | 645 |
src/loffice/connect.cc
| @@ -37,16 +37,46 @@ | @@ -37,16 +37,46 @@ | ||
| 37 | 37 | ||
| 38 | using namespace pw3270_impl; | 38 | using namespace pw3270_impl; |
| 39 | 39 | ||
| 40 | - ::sal_Int16 SAL_CALL session_impl::Connect() throw (::com::sun::star::uno::RuntimeException) | 40 | +/* |
| 41 | +::sal_Int16 SAL_CALL session_impl::Reconnect() throw (::com::sun::star::uno::RuntimeException) | ||
| 42 | + { | ||
| 43 | + trace("%s: hSession=%p",__FUNCTION__,hSession); | ||
| 44 | + | ||
| 45 | + try | ||
| 46 | + { | ||
| 47 | + if(!hSession) | ||
| 48 | + hSession = h3270::session::get_default(); | ||
| 49 | + | ||
| 50 | + return hSession->connect(); | ||
| 51 | + | ||
| 52 | + } catch(std::exception &e) | ||
| 53 | + { | ||
| 54 | + trace("%s failed: %s",__FUNCTION__,e.what()); | ||
| 55 | + | ||
| 56 | + OUString msg = OUString(e.what(),strlen(e.what()),RTL_TEXTENCODING_UTF8,RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_IGNORE); | ||
| 57 | + | ||
| 58 | + throw css::uno::RuntimeException(msg,static_cast< cppu::OWeakObject * >(this)); | ||
| 59 | + | ||
| 60 | + } | ||
| 61 | + | ||
| 62 | + return -1; | ||
| 63 | + | ||
| 64 | + | ||
| 65 | + } | ||
| 66 | +*/ | ||
| 67 | + | ||
| 68 | + ::sal_Int16 SAL_CALL session_impl::Connect(const ::rtl::OUString& url, ::sal_Bool wait) throw (::com::sun::star::uno::RuntimeException) | ||
| 41 | { | 69 | { |
| 42 | trace("%s: hSession=%p",__FUNCTION__,hSession); | 70 | trace("%s: hSession=%p",__FUNCTION__,hSession); |
| 43 | 71 | ||
| 72 | + OString vlr = rtl::OUStringToOString( url , RTL_TEXTENCODING_UNICODE ); | ||
| 73 | + | ||
| 44 | try | 74 | try |
| 45 | { | 75 | { |
| 46 | if(!hSession) | 76 | if(!hSession) |
| 47 | hSession = h3270::session::get_default(); | 77 | hSession = h3270::session::get_default(); |
| 48 | 78 | ||
| 49 | - return hSession->connect(false); | 79 | + return hSession->connect(vlr.getStr(),wait); |
| 50 | 80 | ||
| 51 | } catch(std::exception &e) | 81 | } catch(std::exception &e) |
| 52 | { | 82 | { |
src/loffice/globals.hpp
| @@ -105,8 +105,7 @@ | @@ -105,8 +105,7 @@ | ||
| 105 | 105 | ||
| 106 | virtual ::sal_Int16 SAL_CALL setSessionName( const ::rtl::OUString& name ) throw (::com::sun::star::uno::RuntimeException); | 106 | virtual ::sal_Int16 SAL_CALL setSessionName( const ::rtl::OUString& name ) throw (::com::sun::star::uno::RuntimeException); |
| 107 | 107 | ||
| 108 | - virtual ::sal_Int16 SAL_CALL setHost( const ::rtl::OUString& url ) throw (::com::sun::star::uno::RuntimeException); | ||
| 109 | - virtual ::sal_Int16 SAL_CALL Connect() throw (::com::sun::star::uno::RuntimeException); | 108 | + virtual ::sal_Int16 SAL_CALL Connect( const ::rtl::OUString& url, ::sal_Bool wait) throw (::com::sun::star::uno::RuntimeException); |
| 110 | virtual ::sal_Int16 SAL_CALL Disconnect() throw (::com::sun::star::uno::RuntimeException); | 109 | virtual ::sal_Int16 SAL_CALL Disconnect() throw (::com::sun::star::uno::RuntimeException); |
| 111 | 110 | ||
| 112 | // State | 111 | // State |
src/loffice/pw3270.idl
| @@ -47,8 +47,7 @@ module pw3270 | @@ -47,8 +47,7 @@ module pw3270 | ||
| 47 | string getRevision(); | 47 | string getRevision(); |
| 48 | 48 | ||
| 49 | // Host definition | 49 | // Host definition |
| 50 | - short setHost([in] string url); | ||
| 51 | - short Connect(); | 50 | + short Connect([in] string url, [in] boolean wait); |
| 52 | short Disconnect(); | 51 | short Disconnect(); |
| 53 | short iterate([in] boolean wait); | 52 | short iterate([in] boolean wait); |
| 54 | 53 |
src/loffice/set.cc
| @@ -100,6 +100,7 @@ | @@ -100,6 +100,7 @@ | ||
| 100 | 100 | ||
| 101 | } | 101 | } |
| 102 | 102 | ||
| 103 | +/* | ||
| 103 | ::sal_Int16 SAL_CALL session_impl::setHost( const ::rtl::OUString& url ) throw (::com::sun::star::uno::RuntimeException) | 104 | ::sal_Int16 SAL_CALL session_impl::setHost( const ::rtl::OUString& url ) throw (::com::sun::star::uno::RuntimeException) |
| 104 | { | 105 | { |
| 105 | if(!hSession) | 106 | if(!hSession) |
| @@ -122,6 +123,7 @@ | @@ -122,6 +123,7 @@ | ||
| 122 | 123 | ||
| 123 | return -1; | 124 | return -1; |
| 124 | } | 125 | } |
| 126 | +*/ | ||
| 125 | 127 | ||
| 126 | ::sal_Int16 SAL_CALL session_impl::setTextAt( ::sal_Int16 row, ::sal_Int16 col, const ::rtl::OUString& str ) throw (::com::sun::star::uno::RuntimeException) | 128 | ::sal_Int16 SAL_CALL session_impl::setTextAt( ::sal_Int16 row, ::sal_Int16 col, const ::rtl::OUString& str ) throw (::com::sun::star::uno::RuntimeException) |
| 127 | { | 129 | { |