Commit 5b9b55e09ee8661c74df2ec1cc6233c234e2d4a7

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

Incluindo mais métodos na extensão .oxt

po/pt_BR.po
... ... @@ -5,7 +5,7 @@ msgid ""
5 5 msgstr ""
6 6 "Project-Id-Version: pw3270 5.0\n"
7 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 9 "PO-Revision-Date: 2013-02-25 14:46-0300\n"
10 10 "Last-Translator: Perry Werneck <perry.werneck@gmail.com>\n"
11 11 "Language-Team: Português <>\n"
... ... @@ -43,32 +43,32 @@ msgstr &quot;Ação %s precisa do atributo src&quot;
43 43 msgid "%s requires GTK version %d.%d.%d"
44 44 msgstr "%s requer GTK versão %d.%d.%d"
45 45  
46   -#: kybd.c:2689
  46 +#: kybd.c:2691
47 47 #, c-format
48 48 msgid "%s: Bell not supported"
49 49 msgstr "%s: Alerta sonoro não suportado"
50 50  
51   -#: kybd.c:2848
  51 +#: kybd.c:2850
52 52 #, c-format
53 53 msgid "%s: Missing hex digits after \\x"
54 54 msgstr "%s: Faltando dígitos hexadecimais após \\x"
55 55  
56   -#: kybd.c:2788
  56 +#: kybd.c:2790
57 57 #, c-format
58 58 msgid "%s: Unknown character after \\p"
59 59 msgstr "%s: Caractere desconhecido depois de \\p"
60 60  
61   -#: kybd.c:2824
  61 +#: kybd.c:2826
62 62 #, c-format
63 63 msgid "%s: Unknown character after \\pa"
64 64 msgstr "%s: Caractere desconhecido depois de \\pa"
65 65  
66   -#: kybd.c:2802
  66 +#: kybd.c:2804
67 67 #, c-format
68 68 msgid "%s: Unknown character after \\pf"
69 69 msgstr "%s: Caractere desconhecido depois de \\pf"
70 70  
71   -#: kybd.c:2740
  71 +#: kybd.c:2742
72 72 #, c-format
73 73 msgid "%s: Vertical tab not supported"
74 74 msgstr "%s: Tabulação verticao não suportada"
... ... @@ -2046,12 +2046,12 @@ msgstr &quot;Unknown 3270 Data Stream command: 0x%X&quot;
2046 2046 msgid "Unknown FT control code from host"
2047 2047 msgstr "Servidor enviou código de controle FT desconhecido"
2048 2048  
2049   -#: kybd.c:2438
  2049 +#: kybd.c:2440
2050 2050 #, c-format
2051 2051 msgid "Unknown PA key %d"
2052 2052 msgstr "PA %d desconhecida"
2053 2053  
2054   -#: kybd.c:2453
  2054 +#: kybd.c:2455
2055 2055 #, c-format
2056 2056 msgid "Unknown PF key %d"
2057 2057 msgstr "PF %d desconhecida"
... ...
pw3270.cbp
... ... @@ -262,6 +262,7 @@
262 262 <Option compilerVar="CC" />
263 263 </Unit>
264 264 <Unit filename="src/plugins/remotectl/remotectl.h" />
  265 + <Unit filename="src/plugins/remotectl/server.h" />
265 266 <Unit filename="src/plugins/remotectl/testprogram.c">
266 267 <Option compilerVar="CC" />
267 268 </Unit>
... ...
src/oxt/Makefile.in
1 1  
2 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 6 prefix=/usr
7 7 exec_prefix=@exec_prefix@
... ...
src/oxt/actions.cxx 0 → 100644
... ... @@ -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 51 public:
52 52 session();
53 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 69 void sleep(int seconds = 1);
70 70  
... ... @@ -90,6 +90,7 @@
90 90 virtual int pakey(int key);
91 91  
92 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 95 virtual void mem_free(void *ptr);
95 96  
... ... @@ -139,6 +140,10 @@
139 140 virtual ::sal_Int16 SAL_CALL getConnectionState( ) throw (::com::sun::star::uno::RuntimeException);
140 141 virtual ::sal_Int16 SAL_CALL sleep( ::sal_Int16 seconds ) throw (::com::sun::star::uno::RuntimeException);
141 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 148 private:
144 149  
... ...
src/oxt/local.cxx
... ... @@ -228,3 +228,11 @@
228 228 return NULL;
229 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 64 /* Get */
65 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 75 /* Misc */
68 76 short getRevision();
69 77 short sleep([in] short seconds);
... ...
src/oxt/pw3270OXT.cbp
... ... @@ -33,12 +33,14 @@
33 33 <Add option="-Wall" />
34 34 </Compiler>
35 35 <Unit filename="Makefile.in" />
  36 + <Unit filename="actions.cxx" />
36 37 <Unit filename="connection.cxx" />
37 38 <Unit filename="get.cxx" />
38 39 <Unit filename="globals.hpp" />
39 40 <Unit filename="local.cxx" />
40 41 <Unit filename="main.cxx" />
41 42 <Unit filename="pw3270.idl" />
  43 + <Unit filename="set.cxx" />
42 44 <Unit filename="testprogram.cxx" />
43 45 <Extensions>
44 46 <code_completion />
... ...
src/oxt/set.cxx 0 → 100644
... ... @@ -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 118 str = OUStringToOString( srv->getTextAt(1,1,2000),RTL_TEXTENCODING_UTF8);
119 119 printf("ContentsAt(1,1):\n%s\n",str.pData->buffer);
120 120  
121   - srv->Disconnect();
122   - srv->sleep(2);
123 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 131 printf("waitForStringAt(SISBB) returned %d\n",srv->waitForStringAt(20,39,OUString::createFromAscii("SISBB"),20));
... ...