Commit 5b9b55e09ee8661c74df2ec1cc6233c234e2d4a7

Authored by perry.werneck@gmail.com
1 parent 801af2ab

Incluindo mais métodos na extensão .oxt

@@ -5,7 +5,7 @@ msgid "" @@ -5,7 +5,7 @@ msgid ""
5 msgstr "" 5 msgstr ""
6 "Project-Id-Version: pw3270 5.0\n" 6 "Project-Id-Version: pw3270 5.0\n"
7 "Report-Msgid-Bugs-To: \n" 7 "Report-Msgid-Bugs-To: \n"
8 -"POT-Creation-Date: 2013-02-28 07:17-0300\n" 8 +"POT-Creation-Date: 2013-03-01 08:21-0300\n"
9 "PO-Revision-Date: 2013-02-25 14:46-0300\n" 9 "PO-Revision-Date: 2013-02-25 14:46-0300\n"
10 "Last-Translator: Perry Werneck <perry.werneck@gmail.com>\n" 10 "Last-Translator: Perry Werneck <perry.werneck@gmail.com>\n"
11 "Language-Team: Português <>\n" 11 "Language-Team: Português <>\n"
@@ -43,32 +43,32 @@ msgstr &quot;Ação %s precisa do atributo src&quot; @@ -43,32 +43,32 @@ msgstr &quot;Ação %s precisa do atributo src&quot;
43 msgid "%s requires GTK version %d.%d.%d" 43 msgid "%s requires GTK version %d.%d.%d"
44 msgstr "%s requer GTK versão %d.%d.%d" 44 msgstr "%s requer GTK versão %d.%d.%d"
45 45
46 -#: kybd.c:2689 46 +#: kybd.c:2691
47 #, c-format 47 #, c-format
48 msgid "%s: Bell not supported" 48 msgid "%s: Bell not supported"
49 msgstr "%s: Alerta sonoro não suportado" 49 msgstr "%s: Alerta sonoro não suportado"
50 50
51 -#: kybd.c:2848 51 +#: kybd.c:2850
52 #, c-format 52 #, c-format
53 msgid "%s: Missing hex digits after \\x" 53 msgid "%s: Missing hex digits after \\x"
54 msgstr "%s: Faltando dígitos hexadecimais após \\x" 54 msgstr "%s: Faltando dígitos hexadecimais após \\x"
55 55
56 -#: kybd.c:2788 56 +#: kybd.c:2790
57 #, c-format 57 #, c-format
58 msgid "%s: Unknown character after \\p" 58 msgid "%s: Unknown character after \\p"
59 msgstr "%s: Caractere desconhecido depois de \\p" 59 msgstr "%s: Caractere desconhecido depois de \\p"
60 60
61 -#: kybd.c:2824 61 +#: kybd.c:2826
62 #, c-format 62 #, c-format
63 msgid "%s: Unknown character after \\pa" 63 msgid "%s: Unknown character after \\pa"
64 msgstr "%s: Caractere desconhecido depois de \\pa" 64 msgstr "%s: Caractere desconhecido depois de \\pa"
65 65
66 -#: kybd.c:2802 66 +#: kybd.c:2804
67 #, c-format 67 #, c-format
68 msgid "%s: Unknown character after \\pf" 68 msgid "%s: Unknown character after \\pf"
69 msgstr "%s: Caractere desconhecido depois de \\pf" 69 msgstr "%s: Caractere desconhecido depois de \\pf"
70 70
71 -#: kybd.c:2740 71 +#: kybd.c:2742
72 #, c-format 72 #, c-format
73 msgid "%s: Vertical tab not supported" 73 msgid "%s: Vertical tab not supported"
74 msgstr "%s: Tabulação verticao não suportada" 74 msgstr "%s: Tabulação verticao não suportada"
@@ -2046,12 +2046,12 @@ msgstr &quot;Unknown 3270 Data Stream command: 0x%X&quot; @@ -2046,12 +2046,12 @@ msgstr &quot;Unknown 3270 Data Stream command: 0x%X&quot;
2046 msgid "Unknown FT control code from host" 2046 msgid "Unknown FT control code from host"
2047 msgstr "Servidor enviou código de controle FT desconhecido" 2047 msgstr "Servidor enviou código de controle FT desconhecido"
2048 2048
2049 -#: kybd.c:2438 2049 +#: kybd.c:2440
2050 #, c-format 2050 #, c-format
2051 msgid "Unknown PA key %d" 2051 msgid "Unknown PA key %d"
2052 msgstr "PA %d desconhecida" 2052 msgstr "PA %d desconhecida"
2053 2053
2054 -#: kybd.c:2453 2054 +#: kybd.c:2455
2055 #, c-format 2055 #, c-format
2056 msgid "Unknown PF key %d" 2056 msgid "Unknown PF key %d"
2057 msgstr "PF %d desconhecida" 2057 msgstr "PF %d desconhecida"
@@ -262,6 +262,7 @@ @@ -262,6 +262,7 @@
262 <Option compilerVar="CC" /> 262 <Option compilerVar="CC" />
263 </Unit> 263 </Unit>
264 <Unit filename="src/plugins/remotectl/remotectl.h" /> 264 <Unit filename="src/plugins/remotectl/remotectl.h" />
  265 + <Unit filename="src/plugins/remotectl/server.h" />
265 <Unit filename="src/plugins/remotectl/testprogram.c"> 266 <Unit filename="src/plugins/remotectl/testprogram.c">
266 <Option compilerVar="CC" /> 267 <Option compilerVar="CC" />
267 </Unit> 268 </Unit>
src/oxt/Makefile.in
1 1
2 PACKAGE=@PACKAGE_NAME@ 2 PACKAGE=@PACKAGE_NAME@
3 3
4 -SOURCES=main.cxx local.cxx connection.cxx get.cxx 4 +SOURCES=main.cxx local.cxx connection.cxx get.cxx set.cxx actions.cxx
5 5
6 prefix=/usr 6 prefix=/usr
7 exec_prefix=@exec_prefix@ 7 exec_prefix=@exec_prefix@
src/oxt/actions.cxx 0 → 100644
@@ -0,0 +1,50 @@ @@ -0,0 +1,50 @@
  1 +/*
  2 + * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270
  3 + * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a
  4 + * aplicativos mainframe. Registro no INPI sob o nome G3270.
  5 + *
  6 + * Copyright (C) <2008> <Banco do Brasil S.A.>
  7 + *
  8 + * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob
  9 + * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela
  10 + * Free Software Foundation.
  11 + *
  12 + * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER
  13 + * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO
  14 + * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para
  15 + * obter mais detalhes.
  16 + *
  17 + * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este
  18 + * programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple
  19 + * Place, Suite 330, Boston, MA, 02111-1307, USA
  20 + *
  21 + * Este programa está nomeado como actions.cxx e possui - linhas de código.
  22 + *
  23 + * Contatos:
  24 + *
  25 + * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck)
  26 + * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça)
  27 + * licinio@bb.com.br (Licínio Luis Branco)
  28 + * kraucer@bb.com.br (Kraucer Fernandes Mazuco)
  29 + *
  30 + */
  31 +
  32 + #include "globals.hpp"
  33 + #include <string.h>
  34 +
  35 +/*---[ Implement ]-----------------------------------------------------------------------------------------*/
  36 +
  37 +::sal_Int16 SAL_CALL pw3270::uno_impl::enter( ) throw (::com::sun::star::uno::RuntimeException)
  38 +{
  39 + return hSession->enter();
  40 +}
  41 +
  42 +::sal_Int16 SAL_CALL pw3270::uno_impl::pfkey( ::sal_Int16 keycode ) throw (::com::sun::star::uno::RuntimeException)
  43 +{
  44 + return hSession->pfkey((int) keycode);
  45 +}
  46 +
  47 +::sal_Int16 SAL_CALL pw3270::uno_impl::pakey( ::sal_Int16 keycode ) throw (::com::sun::star::uno::RuntimeException)
  48 +{
  49 + return hSession->pakey((int) keycode);
  50 +}
src/oxt/globals.hpp
@@ -51,20 +51,20 @@ @@ -51,20 +51,20 @@
51 public: 51 public:
52 session(); 52 session();
53 virtual ~session(); 53 virtual ~session();
54 - virtual int get_revision(void) = 0;  
55 - virtual int get_state(void) = 0;  
56 - virtual char * get_text_at(int row, int col, int len) = 0; 54 + virtual int get_revision(void) = 0;
  55 + virtual int get_state(void) = 0;
  56 + virtual char * get_text_at(int row, int col, int len) = 0;
  57 + virtual int set_text_at(int row, int col, const char *text) = 0;
57 58
  59 + virtual int connect(const char *uri) = 0;
  60 + virtual int disconnect(void) = 0;
  61 + virtual bool connected(void) = 0;
58 62
59 - virtual int connect(const char *uri) = 0;  
60 - virtual int disconnect(void) = 0;  
61 - virtual bool connected(void) = 0; 63 + virtual int enter(void) = 0;
  64 + virtual int pfkey(int key) = 0;
  65 + virtual int pakey(int key) = 0;
62 66
63 - virtual int enter(void) = 0;  
64 - virtual int pfkey(int key) = 0;  
65 - virtual int pakey(int key) = 0;  
66 -  
67 - virtual void mem_free(void *) = 0; 67 + virtual void mem_free(void *) = 0;
68 68
69 void sleep(int seconds = 1); 69 void sleep(int seconds = 1);
70 70
@@ -90,6 +90,7 @@ @@ -90,6 +90,7 @@
90 virtual int pakey(int key); 90 virtual int pakey(int key);
91 91
92 virtual char * get_text_at(int row, int col, int len); 92 virtual char * get_text_at(int row, int col, int len);
  93 + virtual int set_text_at(int row, int col, const char *text);
93 94
94 virtual void mem_free(void *ptr); 95 virtual void mem_free(void *ptr);
95 96
@@ -139,6 +140,10 @@ @@ -139,6 +140,10 @@
139 virtual ::sal_Int16 SAL_CALL getConnectionState( ) throw (::com::sun::star::uno::RuntimeException); 140 virtual ::sal_Int16 SAL_CALL getConnectionState( ) throw (::com::sun::star::uno::RuntimeException);
140 virtual ::sal_Int16 SAL_CALL sleep( ::sal_Int16 seconds ) throw (::com::sun::star::uno::RuntimeException); 141 virtual ::sal_Int16 SAL_CALL sleep( ::sal_Int16 seconds ) throw (::com::sun::star::uno::RuntimeException);
141 virtual ::rtl::OUString SAL_CALL getTextAt( ::sal_Int16 row, ::sal_Int16 col, ::sal_Int16 size ) throw (::com::sun::star::uno::RuntimeException); 142 virtual ::rtl::OUString SAL_CALL getTextAt( ::sal_Int16 row, ::sal_Int16 col, ::sal_Int16 size ) throw (::com::sun::star::uno::RuntimeException);
  143 + virtual ::sal_Int16 SAL_CALL setTextAt( ::sal_Int16 row, ::sal_Int16 col, const ::rtl::OUString& text ) throw (::com::sun::star::uno::RuntimeException);
  144 + virtual ::sal_Int16 SAL_CALL enter( ) throw (::com::sun::star::uno::RuntimeException);
  145 + virtual ::sal_Int16 SAL_CALL pfkey( ::sal_Int16 keycode ) throw (::com::sun::star::uno::RuntimeException);
  146 + virtual ::sal_Int16 SAL_CALL pakey( ::sal_Int16 keycode ) throw (::com::sun::star::uno::RuntimeException);
142 147
143 private: 148 private:
144 149
src/oxt/local.cxx
@@ -228,3 +228,11 @@ @@ -228,3 +228,11 @@
228 return NULL; 228 return NULL;
229 return _get_text_at(hSession,row,col,len); 229 return _get_text_at(hSession,row,col,len);
230 } 230 }
  231 +
  232 + int pw3270::lib3270_session::set_text_at(int row, int col, const char *text)
  233 + {
  234 + if(!hSession)
  235 + return EINVAL;
  236 + return _set_text_at(hSession,row,col,(const unsigned char *) text);
  237 + }
  238 +
src/oxt/pw3270.idl
@@ -64,6 +64,14 @@ module br @@ -64,6 +64,14 @@ module br
64 /* Get */ 64 /* Get */
65 string getTextAt([in] short row, [in] short col, [in] short size); 65 string getTextAt([in] short row, [in] short col, [in] short size);
66 66
  67 + /* Set */
  68 + short setTextAt([in] short row, [in] short col, [in] string text);
  69 +
  70 + /* Actions */
  71 + short enter();
  72 + short pfkey([in] short keycode);
  73 + short pakey([in] short keycode);
  74 +
67 /* Misc */ 75 /* Misc */
68 short getRevision(); 76 short getRevision();
69 short sleep([in] short seconds); 77 short sleep([in] short seconds);
src/oxt/pw3270OXT.cbp
@@ -33,12 +33,14 @@ @@ -33,12 +33,14 @@
33 <Add option="-Wall" /> 33 <Add option="-Wall" />
34 </Compiler> 34 </Compiler>
35 <Unit filename="Makefile.in" /> 35 <Unit filename="Makefile.in" />
  36 + <Unit filename="actions.cxx" />
36 <Unit filename="connection.cxx" /> 37 <Unit filename="connection.cxx" />
37 <Unit filename="get.cxx" /> 38 <Unit filename="get.cxx" />
38 <Unit filename="globals.hpp" /> 39 <Unit filename="globals.hpp" />
39 <Unit filename="local.cxx" /> 40 <Unit filename="local.cxx" />
40 <Unit filename="main.cxx" /> 41 <Unit filename="main.cxx" />
41 <Unit filename="pw3270.idl" /> 42 <Unit filename="pw3270.idl" />
  43 + <Unit filename="set.cxx" />
42 <Unit filename="testprogram.cxx" /> 44 <Unit filename="testprogram.cxx" />
43 <Extensions> 45 <Extensions>
44 <code_completion /> 46 <code_completion />
src/oxt/set.cxx 0 → 100644
@@ -0,0 +1,42 @@ @@ -0,0 +1,42 @@
  1 +/*
  2 + * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270
  3 + * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a
  4 + * aplicativos mainframe. Registro no INPI sob o nome G3270.
  5 + *
  6 + * Copyright (C) <2008> <Banco do Brasil S.A.>
  7 + *
  8 + * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob
  9 + * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela
  10 + * Free Software Foundation.
  11 + *
  12 + * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER
  13 + * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO
  14 + * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para
  15 + * obter mais detalhes.
  16 + *
  17 + * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este
  18 + * programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple
  19 + * Place, Suite 330, Boston, MA, 02111-1307, USA
  20 + *
  21 + * Este programa está nomeado como set.cxx e possui - linhas de código.
  22 + *
  23 + * Contatos:
  24 + *
  25 + * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck)
  26 + * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça)
  27 + * licinio@bb.com.br (Licínio Luis Branco)
  28 + * kraucer@bb.com.br (Kraucer Fernandes Mazuco)
  29 + *
  30 + */
  31 +
  32 + #include "globals.hpp"
  33 + #include <string.h>
  34 +
  35 +/*---[ Implement ]-----------------------------------------------------------------------------------------*/
  36 +
  37 +::sal_Int16 SAL_CALL pw3270::uno_impl::setTextAt( ::sal_Int16 row, ::sal_Int16 col, const ::rtl::OUString& text ) throw (::com::sun::star::uno::RuntimeException)
  38 +{
  39 + return hSession->set_text_at((int) row, (int) col, rtl::OUStringToOString(text,hSession->get_encoding()).getStr());
  40 +}
  41 +
  42 +
src/oxt/testprogram.cxx
@@ -118,12 +118,14 @@ int SAL_CALL main(int argc, char **argv) @@ -118,12 +118,14 @@ int SAL_CALL main(int argc, char **argv)
118 str = OUStringToOString( srv->getTextAt(1,1,2000),RTL_TEXTENCODING_UTF8); 118 str = OUStringToOString( srv->getTextAt(1,1,2000),RTL_TEXTENCODING_UTF8);
119 printf("ContentsAt(1,1):\n%s\n",str.pData->buffer); 119 printf("ContentsAt(1,1):\n%s\n",str.pData->buffer);
120 120
121 - srv->Disconnect();  
122 - srv->sleep(2);  
123 printf("getConnectionState: %d\n", srv->getConnectionState()); 121 printf("getConnectionState: %d\n", srv->getConnectionState());
124 122
125 - srv->sleep(2); 123 + srv->sleep(1);
  124 + srv->enter();
  125 + srv->sleep(1);
126 126
  127 + str = OUStringToOString( srv->getTextAt(1,1,2000),RTL_TEXTENCODING_UTF8);
  128 + printf("ContentsAt(1,1):\n%s\n",str.pData->buffer);
127 129
128 /* 130 /*
129 printf("waitForStringAt(SISBB) returned %d\n",srv->waitForStringAt(20,39,OUString::createFromAscii("SISBB"),20)); 131 printf("waitForStringAt(SISBB) returned %d\n",srv->waitForStringAt(20,39,OUString::createFromAscii("SISBB"),20));