From ecf3f0c57df2333548e7cf89aa71ec1e8bfafa0e Mon Sep 17 00:00:00 2001 From: perry.werneck@gmail.com Date: Wed, 27 Feb 2013 13:08:47 +0000 Subject: [PATCH] Implementando funções na extensão LibreOffice --- po/pt_BR.po | 270 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------------------------------------------------------------------------------------------- src/include/lib3270.h | 2 ++ src/lib3270/api.h | 2 +- src/lib3270/host.c | 2 +- src/lib3270/state.c | 7 +++++++ src/lib3270/telnet.c | 2 +- src/oxt/globals.hpp | 31 +++++++++++++++++++++++++++++-- src/oxt/local.cxx | 128 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---- src/oxt/main.cxx | 4 ++++ 9 files changed, 302 insertions(+), 146 deletions(-) diff --git a/po/pt_BR.po b/po/pt_BR.po index 2e1028d..50b057e 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: pw3270 5.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-02-26 19:13-0300\n" +"POT-Creation-Date: 2013-02-27 07:14-0300\n" "PO-Revision-Date: 2013-02-25 14:46-0300\n" "Last-Translator: Perry Werneck \n" "Language-Team: Português <>\n" @@ -83,7 +83,7 @@ msgstr "%s: Familia %d é inválida" msgid "%s:%d" msgstr "%s:%d" -#: main.c:330 +#: main.c:318 msgid "- 3270 Emulator for Gtk" msgstr "- Emulador 3270 para GTK" @@ -164,7 +164,7 @@ msgstr "" msgid "SSL state is undefinedUnexpected SSL status %ld" msgstr "Estado do SSL é indefinidoEstado SSL inesperado %ld" -#: main.c:350 +#: main.c:338 msgid "" "Valid options:\n" "\n" @@ -200,7 +200,7 @@ msgstr "Sobre a segurança" msgid "Action failed" msgstr "Ação falhou" -#: ui/00default.xml:64 +#: ui/00default.xml:286 msgid "Add to copy" msgstr "Adicionar à cópia" @@ -208,7 +208,7 @@ msgstr "Adicionar à cópia" msgid "Add/Remove _CR at end of line" msgstr "Adicionar/Remover _CR no final da linha" -#: ui/00default.xml:132 +#: ui/00default.xml:354 msgid "Alert sound" msgstr "Aviso sonoro" @@ -217,11 +217,11 @@ msgid "An error occurred trying to allocate memory. This should never happen." msgstr "" "Ocorreu um erro ao tentar alocar memória. Isso nunca deveria acontecer." -#: main.c:314 main.c:316 +#: main.c:302 main.c:304 msgid "Application name" msgstr "Nome da aplicação" -#: ui/10keypad.xml:467 +#: ui/10keypad.xml:155 msgid "Attn" msgstr "Attn" @@ -238,7 +238,7 @@ msgstr "Authority and issuer serial number mismatch" msgid "Authority and subject key identifier mismatch" msgstr "Authority and subject key identifier mismatch" -#: ui/00default.xml:127 +#: ui/00default.xml:349 msgid "Auto-Reconnect" msgstr "Reconectar automaticamente" @@ -262,11 +262,11 @@ msgstr "Versão winsock inválida" msgid "Black" msgstr "Preto" -#: ui/00default.xml:125 +#: ui/00default.xml:347 msgid "Blank Fill" msgstr "Completar com espaços" -#: ui/00default.xml:118 +#: ui/00default.xml:340 msgid "Blinking Cursor" msgstr "Cursor piscante" @@ -274,7 +274,7 @@ msgstr "Cursor piscante" msgid "Blue" msgstr "Azul" -#: ui/00default.xml:128 +#: ui/00default.xml:350 msgid "Bold" msgstr "Negrito" @@ -282,7 +282,7 @@ msgstr "Negrito" msgid "Brazilian Public Software Portal" msgstr "Portal do Software Público Brasileiro" -#: ui/10keypad.xml:468 +#: ui/10keypad.xml:156 msgid "Break" msgstr "Break" @@ -474,7 +474,7 @@ msgstr "Tabela de tradução tem %d entradas, precisa de 256" msgid "Charset has more than 256 entries" msgstr "Tabela de tradução tem mais de 256 caracteres" -#: ui/00default.xml:79 +#: ui/10keypad.xml:147 msgid "Clear" msgstr "Limpar" @@ -486,7 +486,7 @@ msgstr "Tema de cores:" msgid "Color setup" msgstr "Configuração de cores" -#: ui/00default.xml:107 +#: ui/00default.xml:329 msgid "Colors" msgstr "Cores" @@ -494,7 +494,7 @@ msgstr "Cores" msgid "Complete" msgstr "Completo" -#: ui/00default.xml:117 +#: ui/00default.xml:339 msgid "Connect on startup" msgstr "Conectar ao iniciar" @@ -502,19 +502,19 @@ msgstr "Conectar ao iniciar" msgid "Connection reset by peer" msgstr "Conexão foi cancelada pelo servidor" -#: ui/00default.xml:61 +#: ui/00default.xml:283 msgid "Copy" msgstr "Copiar" -#: ui/99debug.xml:566 +#: ui/99debug.xml:200 msgid "Copy as HTML" msgstr "Copiar como HTML" -#: ui/00default.xml:62 +#: ui/00default.xml:284 msgid "Copy as table" msgstr "Copiar como tabela" -#: colors.c:418 ui/00default.xml:124 +#: colors.c:418 ui/00default.xml:346 msgid "Cross hair cursor" msgstr "Cursor mira" @@ -527,7 +527,7 @@ msgstr "Atual (%s)" msgid "Custom colors" msgstr "Cores personalizadas" -#: ui/00default.xml:65 +#: ui/00default.xml:287 msgid "Cut" msgstr "Recortar" @@ -539,7 +539,7 @@ msgstr "Cilindros" msgid "DFT B_uffer size:" msgstr "Tamanho do b_uffer DFT:" -#: ui/99debug.xml:571 +#: ui/99debug.xml:205 msgid "DS Trace" msgstr "DS Trace" @@ -555,11 +555,11 @@ msgstr "Verde Escuro" msgid "Data conversion error" msgstr "Erro na conversão de dados" -#: ui/99debug.xml:579 +#: ui/99debug.xml:213 msgid "Debug" msgstr "Depuração" -#: ui/99debug.xml:581 +#: ui/99debug.xml:215 msgid "Debug window updates" msgstr "Mostrar atualizações de janela" @@ -567,7 +567,7 @@ msgstr "Mostrar atualizações de janela" msgid "Default" msgstr "Padrão" -#: ui/00default.xml:81 +#: ui/00default.xml:303 msgid "Delete field" msgstr "Apagar campo" @@ -599,7 +599,7 @@ msgstr "Nome do servidor em branco" msgid "Empty port name" msgstr "Porta em branco" -#: ui/10keypad.xml:463 +#: ui/10keypad.xml:151 msgid "" "Erase\n" "EOF" @@ -607,7 +607,7 @@ msgstr "" "Apagar\n" "Campo" -#: ui/10keypad.xml:464 +#: ui/10keypad.xml:152 msgid "" "Erase\n" "Input" @@ -615,15 +615,15 @@ msgstr "" "Apagar\n" "Campos" -#: ui/00default.xml:80 +#: ui/00default.xml:302 msgid "Erase input" msgstr "Apagar campos" -#: ui/00default.xml:82 +#: ui/00default.xml:304 msgid "Erase to end of field" msgstr "Apagar até o final do campo" -#: ui/00default.xml:83 +#: ui/00default.xml:305 msgid "Erase to end of line" msgstr "Apagar até o final da linha" @@ -666,7 +666,7 @@ msgstr "Erro lendo %s" msgid "Error resolving %s: %s" msgstr "Erro ao resolver %s: %s" -#: ui/99debug.xml:573 +#: ui/99debug.xml:207 msgid "Event Trace" msgstr "Trace de eventos" @@ -714,15 +714,15 @@ msgstr "Format error in certificate's notAfter field" msgid "Format error in certificate's notBefore field" msgstr "Format error in certificate's notBefore field" -#: ui/00default.xml:121 +#: ui/00default.xml:343 msgid "Full Screen" msgstr "Tela cheia" -#: ui/10functions.xml:347 +#: ui/10functions.xml:35 msgid "Function bar" msgstr "Barra de funções" -#: main.c:90 main.c:391 +#: main.c:90 main.c:379 msgid "GTK Version mismatch" msgstr "Divergência de versão GTK" @@ -763,7 +763,7 @@ msgstr "HTTP Proxy: EOF inesperado" msgid "HTTP Proxy: unrecognized reply" msgstr "HTTP Proxy: Resposta desconhecida" -#: ui/00default.xml:142 +#: ui/00default.xml:364 msgid "Help" msgstr "Ajuda" @@ -791,11 +791,11 @@ msgstr "Servidor rejeitou o tipo de dispositivo ou requisição" msgid "Host rejected resource(s)" msgstr "Servidor rejeitou recurso(s)" -#: main.c:322 +#: main.c:310 msgid "Host system type" msgstr "Tipo do sistema no servidor" -#: main.c:320 +#: main.c:308 msgid "Host to connect" msgstr "Servidor a conectar" @@ -824,7 +824,7 @@ msgstr "Comprimento de frame inválido" msgid "Informations" msgstr "Informações" -#: ui/00default.xml:137 +#: ui/00default.xml:359 msgid "Input method" msgstr "Método de entrada" @@ -871,7 +871,7 @@ msgstr "Sintaxe de proxy inválida" msgid "Invalid proxy type '%.*s'" msgstr "Tipo de proxy invalido '%.*s'" -#: ui/00default.xml:130 +#: ui/00default.xml:352 msgid "Keep selected" msgstr "Manter selecionado" @@ -887,7 +887,7 @@ msgstr "Teclado está bloqueado" msgid "LRECL:" msgstr "LRECL:" -#: ui/10keypad.xml:413 +#: ui/10keypad.xml:101 msgid "Lateral keypad" msgstr "Barra lateral" @@ -904,7 +904,7 @@ msgstr "Faltando ']'" msgid "Model %d (%s)" msgstr "Modelo %d (%s)" -#: ui/00default.xml:119 +#: ui/00default.xml:341 msgid "Monocase" msgstr "Só Maiúsculas" @@ -940,7 +940,7 @@ msgstr "Erro de rede" msgid "Network startup error" msgstr "Erro ao iniciar a rede" -#: ui/00default.xml:189 +#: ui/00default.xml:411 msgid "Next field" msgstr "Próximo campo" @@ -1017,115 +1017,115 @@ msgstr "Other (VM/CMS)" msgid "Out of memory" msgstr "Out of memory" -#: ui/10keypad.xml:450 +#: ui/10keypad.xml:138 msgid "PA1" msgstr "PA1" -#: ui/10keypad.xml:451 +#: ui/10keypad.xml:139 msgid "PA2" msgstr "PA2" -#: ui/10keypad.xml:452 +#: ui/10keypad.xml:140 msgid "PA3" msgstr "PA3" -#: ui/10functions.xml:348 +#: ui/10functions.xml:36 msgid "PF1" msgstr "PF1" -#: ui/10functions.xml:357 +#: ui/10functions.xml:45 msgid "PF10" msgstr "PF10" -#: ui/10functions.xml:358 +#: ui/10functions.xml:46 msgid "PF11" msgstr "PF11" -#: ui/10functions.xml:359 +#: ui/10functions.xml:47 msgid "PF12" msgstr "PF12" -#: ui/10functions.xml:362 +#: ui/10functions.xml:50 msgid "PF13" msgstr "PF13" -#: ui/10functions.xml:363 +#: ui/10functions.xml:51 msgid "PF14" msgstr "PF14" -#: ui/10functions.xml:364 +#: ui/10functions.xml:52 msgid "PF15" msgstr "PF15" -#: ui/10functions.xml:365 +#: ui/10functions.xml:53 msgid "PF16" msgstr "PF16" -#: ui/10functions.xml:366 +#: ui/10functions.xml:54 msgid "PF17" msgstr "PF17" -#: ui/10functions.xml:367 +#: ui/10functions.xml:55 msgid "PF18" msgstr "PF18" -#: ui/10functions.xml:368 +#: ui/10functions.xml:56 msgid "PF19" msgstr "PF19" -#: ui/10functions.xml:349 +#: ui/10functions.xml:37 msgid "PF2" msgstr "PF2" -#: ui/10functions.xml:369 +#: ui/10functions.xml:57 msgid "PF20" msgstr "PF20" -#: ui/10functions.xml:370 +#: ui/10functions.xml:58 msgid "PF21" msgstr "PF21" -#: ui/10functions.xml:371 +#: ui/10functions.xml:59 msgid "PF22" msgstr "PF22" -#: ui/10functions.xml:372 +#: ui/10functions.xml:60 msgid "PF23" msgstr "PF23" -#: ui/10functions.xml:373 +#: ui/10functions.xml:61 msgid "PF24" msgstr "PF24" -#: ui/10functions.xml:350 +#: ui/10functions.xml:38 msgid "PF3" msgstr "PF3" -#: ui/10functions.xml:351 +#: ui/10functions.xml:39 msgid "PF4" msgstr "PF4" -#: ui/10functions.xml:352 +#: ui/10functions.xml:40 msgid "PF5" msgstr "PF5" -#: ui/10functions.xml:353 +#: ui/10functions.xml:41 msgid "PF6" msgstr "PF6" -#: ui/10functions.xml:354 +#: ui/10functions.xml:42 msgid "PF7" msgstr "PF7" -#: ui/10functions.xml:355 +#: ui/10functions.xml:43 msgid "PF8" msgstr "PF8" -#: ui/10functions.xml:356 +#: ui/10functions.xml:44 msgid "PF9" msgstr "PF9" -#: main.c:348 +#: main.c:336 msgid "Parse error" msgstr "Erro de interpretação" @@ -1138,15 +1138,15 @@ msgstr "Erro de interpretação em %s" msgid "Passthru Proxy: send error" msgstr "Passthru Proxy: Erro ao enviar" -#: ui/00default.xml:66 +#: ui/00default.xml:288 msgid "Paste" msgstr "Colar" -#: ui/00default.xml:67 +#: ui/00default.xml:289 msgid "Paste next" msgstr "Colar próximo" -#: ui/00default.xml:70 +#: ui/00default.xml:292 msgid "Paste text file" msgstr "Colar arquivo texto" @@ -1154,7 +1154,7 @@ msgstr "Colar arquivo texto" msgid "Paste text file contents" msgstr "Colar conteúdo de arquivo texto" -#: ui/00default.xml:123 +#: ui/00default.xml:345 msgid "Paste with left margin" msgstr "Colar com margem esquerda" @@ -1162,7 +1162,7 @@ msgstr "Colar com margem esquerda" msgid "Path length constraint exceeded" msgstr "Path length constraint exceeded" -#: main.c:317 +#: main.c:305 msgid "Path to application data files" msgstr "Path to application data files" @@ -1170,7 +1170,7 @@ msgstr "Path to application data files" msgid "Pink" msgstr "Rosa" -#: ui/00default.xml:188 +#: ui/00default.xml:410 msgid "Previous field" msgstr "Campo anterior" @@ -1178,11 +1178,11 @@ msgstr "Campo anterior" msgid "Primary space:" msgstr "Primary space:" -#: ui/00default.xml:49 +#: ui/00default.xml:271 msgid "Print" msgstr "Imprimir" -#: ui/00default.xml:51 +#: ui/00default.xml:273 msgid "Print copy" msgstr "Imprimir cópia" @@ -1190,7 +1190,7 @@ msgstr "Imprimir cópia" msgid "Print operation failed" msgstr "Operação de impressão falhou" -#: ui/00default.xml:50 +#: ui/00default.xml:272 msgid "Print selected" msgstr "Imprimir seleção" @@ -1198,7 +1198,7 @@ msgstr "Imprimir seleção" msgid "Print selection box" msgstr "Imprimir marca de seleção" -#: print.c:743 ui/00default.xml:108 +#: print.c:743 ui/00default.xml:330 msgid "Print settings" msgstr "Configurações de impressão" @@ -1286,7 +1286,7 @@ msgstr "RPQ: can't resolve '%s': %s" msgid "RPQ: gethostbyname error" msgstr "RPQ: Erro em gethostbyname" -#: ui/00default.xml:54 +#: ui/00default.xml:276 msgid "Receive file" msgstr "Receber arquivo" @@ -1302,27 +1302,27 @@ msgstr "Formato de registro" msgid "Red" msgstr "Vermelho" -#: ui/99debug.xml:580 +#: ui/99debug.xml:214 msgid "Reload buffer contents" msgstr "Recarregar conteúdo do buffer" -#: ui/00default.xml:75 +#: ui/00default.xml:297 msgid "Remove selection" msgstr "Remover seleção" -#: ui/00default.xml:76 +#: ui/00default.xml:298 msgid "Reselect" msgstr "Reselecionar" -#: ui/10keypad.xml:460 +#: ui/10keypad.xml:148 msgid "Reset" msgstr "Reset" -#: ui/00default.xml:122 +#: ui/00default.xml:344 msgid "Resize on alternate screen" msgstr "Mudar tamanho do terminal em tela alternativa" -#: ui/00default.xml:190 +#: ui/00default.xml:412 msgid "Return" msgstr "Return" @@ -1483,7 +1483,7 @@ msgstr "" "SSL_write:\n" "%s" -#: ui/00default.xml:46 +#: ui/00default.xml:268 msgid "Save copy" msgstr "Salvar cópia" @@ -1491,7 +1491,7 @@ msgstr "Salvar cópia" msgid "Save copy to file" msgstr "Salvar cópia para arquivo" -#: ui/00default.xml:44 +#: ui/00default.xml:266 msgid "Save screen" msgstr "Salvar tela" @@ -1499,7 +1499,7 @@ msgstr "Salvar tela" msgid "Save screen to file" msgstr "Salvar tela para arquivo" -#: ui/00default.xml:45 +#: ui/00default.xml:267 msgid "Save selected" msgstr "Salvar seleção" @@ -1507,20 +1507,15 @@ msgstr "Salvar seleção" msgid "Save selection to file" msgstr "Salvar seleção para arquivo" -#: ui/99debug.xml:572 +#: ui/99debug.xml:206 msgid "Screen Trace" msgstr "Trace de tela" -#: ui/00default.xml:114 +#: ui/00default.xml:336 msgid "Screen size" msgstr "Tamanho da tela" -#: ui/09scripts.xml:297 -#, fuzzy -msgid "Script" -msgstr "Scripts" - -#: ui/00default.xml:89 +#: ui/00default.xml:311 msgid "Scripts" msgstr "Scripts" @@ -1532,15 +1527,15 @@ msgstr "Secondary space:" msgid "Secure connection was successful." msgstr "Conexão segura efetuada com sucesso." -#: ui/00default.xml:74 +#: ui/00default.xml:296 msgid "Select Field" msgstr "Selecionar campo" -#: ui/00default.xml:73 +#: ui/00default.xml:295 msgid "Select all" msgstr "Selecionar tudo" -#: ui/00default.xml:126 +#: ui/00default.xml:348 msgid "Select by rectangles" msgstr "Seleção retangular" @@ -1552,7 +1547,7 @@ msgstr "Selecione arquivo a receber" msgid "Select file to send" msgstr "Selecione arquivo a enviar" -#: ui/00default.xml:111 +#: ui/00default.xml:333 msgid "Select font" msgstr "Selecione fonte" @@ -1576,7 +1571,7 @@ msgstr "Self signed certificate" msgid "Self signed certificate in certificate chain" msgstr "Self signed certificate in certificate chain" -#: ui/00default.xml:55 +#: ui/00default.xml:277 msgid "Send file" msgstr "Enviar arquivo" @@ -1584,39 +1579,39 @@ msgstr "Enviar arquivo" msgid "Send file to host" msgstr "Enviar arquivo para o servidor" -#: main.c:324 +#: main.c:312 msgid "Send messages to syslog" msgstr "Send messages to syslog" -#: ui/00default.xml:54 +#: ui/00default.xml:276 msgid "Send/Receive" msgstr "Enviar/Receber" -#: main.c:319 +#: main.c:307 msgid "Session name" msgstr "Nome da sessão" -#: ui/00default.xml:92 +#: ui/00default.xml:314 msgid "Set hostname" msgstr "Selecione servidor" -#: main.c:321 +#: main.c:309 msgid "Set reported colors (8/16)" msgstr "Define número de cores informadas (8/16)" -#: ui/00default.xml:107 +#: ui/00default.xml:329 msgid "Settings" msgstr "Configurações" -#: ui/00default.xml:129 +#: ui/00default.xml:351 msgid "Show Underline" msgstr "Mostrar sublinhado" -#: ui/99debug.xml:579 +#: ui/99debug.xml:213 msgid "Show test pattern" msgstr "Mostrar padrão de teste" -#: ui/00default.xml:131 +#: ui/00default.xml:353 msgid "Smart paste" msgstr "Colar inteligente" @@ -1664,18 +1659,6 @@ msgstr "T_otal" msgid "Terminal colors" msgstr "Cores do terminal" -#: ui/09scripts.xml:298 -msgid "Teste01" -msgstr "Teste01" - -#: ui/09scripts.xml:302 -msgid "Teste02" -msgstr "Teste02" - -#: ui/09scripts.xml:306 -msgid "Teste03" -msgstr "Teste03" - #: host.c:216 msgid "Text before '['" msgstr "Texto antes de '['" @@ -1891,7 +1874,7 @@ msgstr "" "programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple " "Place, Suite 330, Boston, MA, 02111-1307, USA" -#: main.c:387 +#: main.c:375 #, c-format msgid "This program requires GTK version %d.%d.%d" msgstr "Este programa precisa do GTK versão %d.%d.%d" @@ -1902,15 +1885,15 @@ msgid "" "This version of %s was built without support for secure sockets layer (SSL)." msgstr "Esta versão do %s foi gerada sem suporte para conexões seguras (SSL)." -#: ui/00default.xml:148 +#: ui/00default.xml:370 msgid "Toolbar" msgstr "Barra de ferramentas" -#: ui/99debug.xml:571 +#: ui/99debug.xml:205 msgid "Trace" msgstr "Trace" -#: ui/00default.xml:120 +#: ui/00default.xml:342 msgid "Track Cursor" msgstr "Mostrar posição do cursor" @@ -2117,7 +2100,7 @@ msgstr "Unsupported passthru host session" msgid "Unsupported socks 4 proxy" msgstr "Unsupported socks 4 proxy" -#: ui/00default.xml:133 +#: ui/00default.xml:355 msgid "Use +/- for field navigation" msgstr "Usar teclas +/- para navegar por campos" @@ -2130,7 +2113,7 @@ msgstr "Variável" msgid "Version %s - Revision %s" msgstr "Versão %s - Revisão %s" -#: ui/99debug.xml:574 +#: ui/99debug.xml:208 msgid "View Field Delimiters" msgstr "Mostrar delimitadores de campo" @@ -2158,7 +2141,7 @@ msgstr "Europa ocidental (ISO 8859-1)" msgid "White" msgstr "Branco" -#: ui/00default.xml:159 +#: ui/00default.xml:381 msgid "Window" msgstr "Janela" @@ -2226,19 +2209,19 @@ msgstr "_Procurar" msgid "_Color table:" msgstr "Tabela de cores:" -#: ui/00default.xml:102 +#: ui/00default.xml:324 msgid "_Connect" msgstr "_Conectar" -#: ui/00default.xml:103 +#: ui/00default.xml:325 msgid "_Disconnect" msgstr "_Desconectar" -#: ui/00default.xml:61 +#: ui/99debug.xml:200 msgid "_Edit" msgstr "_Editar" -#: ui/00default.xml:36 +#: ui/00default.xml:258 msgid "_File" msgstr "_Arquivo" @@ -2266,11 +2249,11 @@ msgstr "Nome do _Host:" msgid "_Local file name:" msgstr "Arquivo _local:" -#: ui/00default.xml:92 +#: ui/00default.xml:314 msgid "_Network" msgstr "_Rede" -#: ui/00default.xml:117 +#: ui/00default.xml:339 msgid "_Options" msgstr "_Opções" @@ -2298,7 +2281,7 @@ msgstr "Arquivo _texto" msgid "_To" msgstr "_Para" -#: ui/00default.xml:87 +#: ui/00default.xml:309 msgid "_View" msgstr "_Exibir" @@ -2345,6 +2328,19 @@ msgid "unknown error" msgstr "Erro desconhecido" #, fuzzy +#~ msgid "Script" +#~ msgstr "Scripts" + +#~ msgid "Teste01" +#~ msgstr "Teste01" + +#~ msgid "Teste02" +#~ msgstr "Teste02" + +#~ msgid "Teste03" +#~ msgstr "Teste03" + +#, fuzzy #~ msgid "Cross hair Cursor" #~ msgstr "Cursor mira" diff --git a/src/include/lib3270.h b/src/include/lib3270.h index 65ba1d7..6f4250f 100644 --- a/src/include/lib3270.h +++ b/src/include/lib3270.h @@ -494,6 +494,7 @@ */ LIB3270_EXPORT int lib3270_set_string(H3270 *h, const unsigned char *str); + #define lib3270_set_text_at(h,r,c,t) lib3270_set_string_at(h,r,c,t) LIB3270_EXPORT int lib3270_set_string_at(H3270 *h, int row, int col, const unsigned char *str); LIB3270_EXPORT void lib3270_input_string(H3270 *hSession, const unsigned char *str); @@ -689,6 +690,7 @@ LIB3270_EXPORT int lib3270_pconnected(H3270 *h); LIB3270_EXPORT int lib3270_half_connected(H3270 *h); LIB3270_EXPORT int lib3270_connected(H3270 *h); + LIB3270_EXPORT int lib3270_disconnected(H3270 *h); LIB3270_EXPORT int lib3270_in_neither(H3270 *h); LIB3270_EXPORT int lib3270_in_ansi(H3270 *h); LIB3270_EXPORT int lib3270_in_3270(H3270 *h); diff --git a/src/lib3270/api.h b/src/lib3270/api.h index 7bd33cf..1fb1403 100644 --- a/src/lib3270/api.h +++ b/src/lib3270/api.h @@ -119,7 +119,7 @@ /** connection state */ #define cstate LIB3270_CSTATE - #define NOT_CONNECTED LIB3270_NOT_CONNECTED +// #define NOT_CONNECTED LIB3270_NOT_CONNECTED #define RESOLVING LIB3270_RESOLVING #define PENDING LIB3270_PENDING #define CONNECTED_INITIAL LIB3270_CONNECTED_INITIAL diff --git a/src/lib3270/host.c b/src/lib3270/host.c index 10a5d8b..616691f 100644 --- a/src/lib3270/host.c +++ b/src/lib3270/host.c @@ -556,7 +556,7 @@ void lib3270_set_disconnected(H3270 *hSession) { CHECK_SESSION_HANDLE(hSession); - hSession->cstate = NOT_CONNECTED; + hSession->cstate = LIB3270_NOT_CONNECTED; hSession->starting = 0; set_status(hSession,OIA_FLAG_UNDERA,False); diff --git a/src/lib3270/state.c b/src/lib3270/state.c index d47aa44..8522b6c 100644 --- a/src/lib3270/state.c +++ b/src/lib3270/state.c @@ -55,6 +55,13 @@ LIB3270_EXPORT int lib3270_connected(H3270 *h) return ((int) h->cstate >= (int)CONNECTED_INITIAL); } +LIB3270_EXPORT int lib3270_disconnected(H3270 *h) +{ + CHECK_SESSION_HANDLE(h); + return ((int) h->cstate == (int)LIB3270_NOT_CONNECTED); +} + + LIB3270_EXPORT int lib3270_in_neither(H3270 *h) { CHECK_SESSION_HANDLE(h); diff --git a/src/lib3270/telnet.c b/src/lib3270/telnet.c index 695b75f..c06f46a 100644 --- a/src/lib3270/telnet.c +++ b/src/lib3270/telnet.c @@ -2430,7 +2430,7 @@ static void do_lnext(H3270 *hSession, char c) */ static void check_in3270(H3270 *hSession) { - LIB3270_CSTATE new_cstate = NOT_CONNECTED; + LIB3270_CSTATE new_cstate = LIB3270_NOT_CONNECTED; #if defined(X3270_TRACE) /*[*/ static const char *state_name[] = diff --git a/src/oxt/globals.hpp b/src/oxt/globals.hpp index 72a0f76..51048e9 100644 --- a/src/oxt/globals.hpp +++ b/src/oxt/globals.hpp @@ -51,7 +51,15 @@ public: session(); virtual ~session(); - virtual int get_revision(void) = 0; + virtual int get_revision(void) = 0; + virtual int connect(const char *uri) = 0; + virtual int disconnect(void) = 0; + virtual bool connected(void) = 0; + virtual int enter(void) = 0; + virtual int pfkey(int key) = 0; + virtual int pakey(int key) = 0; + + rtl_TextEncoding getEncoding(); }; @@ -61,14 +69,33 @@ lib3270_session(); virtual ~lib3270_session(); - virtual int get_revision(void); + virtual int get_revision(void); + 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); private: + bool enabled; oslModule hModule; + oslThread hThread; void * hSession; + /* Internal calls */ + static void start_connect(lib3270_session *session); + void network_loop(void); + /* lib3270 entry points */ const char * (* _get_revision)(void); + char * (* _get_text_at)(void *,int,int,int); + int (* _set_text_at)(void *,int,int,const unsigned char *); + int (* _cmp_text_at)(void *,int,int,const char *); + int (* _enter)(void *); + int (* _pfkey)(void *, int); + int (* _pakey)(void *, int); + }; diff --git a/src/oxt/local.cxx b/src/oxt/local.cxx index 34076cf..30b2b9a 100644 --- a/src/oxt/local.cxx +++ b/src/oxt/local.cxx @@ -30,9 +30,12 @@ */ #include "globals.hpp" + #include -// osl_createEmptySocketAddr -// osl_connectSocketTo +/* + * NOTE: Take a better look at osl_createEmptySocketAddr() & osl_connectSocketTo() to see if there's + * a way to use this calls to connect with the host for better performance. + */ /*---[ Statics ]-------------------------------------------------------------------------------------------*/ @@ -41,15 +44,34 @@ pw3270::lib3270_session::lib3270_session() { + struct _call + { + void **entry; + const char * name; + } call[] = + { + { (void **) & _get_revision, "lib3270_get_revision" }, + { (void **) & _get_text_at, "lib3270_get_text_at" }, + { (void **) & _set_text_at, "lib3270_set_string_at" }, + { (void **) & _cmp_text_at, "lib3270_cmp_text_at" }, + { (void **) & _enter, "lib3270_enter" }, + { (void **) & _pfkey, "lib3270_pfkey" }, + { (void **) & _pakey, "lib3270_pakey" } + + }; + void * (*lib3270_new)(const char *); + hThread = NULL; + hSession = NULL; + trace("%s",__FUNCTION__); hModule = osl_loadModuleAscii("lib3270.so",SAL_LOADMODULE_NOW); if(!hModule) return; - _get_revision = (const char * (*)(void)) osl_getAsciiFunctionSymbol(hModule,"lib3270_get_revision"); - + for(int f = 0; f < (sizeof (call) / sizeof ((call)[0]));f++) + *call[f].entry = (void *) osl_getAsciiFunctionSymbol(hModule,call[f].name); /* Get lib3270 session handle */ lib3270_new = (void * (*)(const char *)) osl_getAsciiFunctionSymbol(hModule,"lib3270_session_new"); @@ -62,6 +84,8 @@ trace("%s hModule=%p hSession=%p",__FUNCTION__,hModule,hSession); + disconnect(); + if(hModule) { if(hSession) @@ -81,3 +105,99 @@ return atoi(_get_revision()); } + int pw3270::lib3270_session::connect(const char *uri) + { + const char * (*set_host)(void *h, const char *n); + + if(!(hModule && hSession)) + return EINVAL; + + if(hThread) + return EBUSY; + + set_host = (const char * (*)(void *,const char *)) osl_getAsciiFunctionSymbol(hModule,"lib3270_set_host"); + if(!set_host) + return EINVAL; + + set_host(hSession,uri); + + enabled = true; + hThread = osl_createThread((oslWorkerFunction) pw3270::lib3270_session::start_connect, this); + + osl_yieldThread(); + + if(!hThread) + return -1; + + osl_yieldThread(); + + return 0; + } + + int pw3270::lib3270_session::disconnect(void) + { + enabled = false; + return 0; + } + + void pw3270::lib3270_session::start_connect(lib3270_session *session) + { + session->network_loop(); + session->hThread = NULL; + session->enabled = false; + } + + void pw3270::lib3270_session::network_loop(void) + { + /* Lib3270 entry points */ + void (* _disconnect)(void *h) = + (void (*)(void *)) osl_getAsciiFunctionSymbol(hModule,"lib3270_disconnect"); + + int (* _connect)(void *h,const char *n, int wait) = + (int (*)(void *,const char *,int)) osl_getAsciiFunctionSymbol(hModule,"lib3270_connect"); + + int (* _status)(void *h) = + (int (*)(void *)) osl_getAsciiFunctionSymbol(hModule,"lib3270_disconnected"); + + void (*_iterate)(void *h, int wait) = + (void (*)(void *, int)) osl_getAsciiFunctionSymbol(hModule,"lib3270_main_iterate"); + + _connect(hSession,NULL,1); + + while(enabled && !_status(hSession)) + { + osl_yieldThread(); + _iterate(hSession,1); + } + + osl_yieldThread(); + + _disconnect(hSession); + + } + + bool pw3270::lib3270_session::connected(void) + { + return enabled; + } + + int pw3270::lib3270_session::enter(void) + { + if(!hSession) + return EINVAL; + return _enter(hSession); + } + + int pw3270::lib3270_session::pfkey(int key) + { + if(!hSession) + return EINVAL; + return _pfkey(hSession,key); + } + + int pw3270::lib3270_session::pakey(int key) + { + if(!hSession) + return EINVAL; + return _pakey(hSession,key); + } diff --git a/src/oxt/main.cxx b/src/oxt/main.cxx index 9d8423a..08173dc 100644 --- a/src/oxt/main.cxx +++ b/src/oxt/main.cxx @@ -231,3 +231,7 @@ pw3270::session::~session() trace("%s",__FUNCTION__); } +rtl_TextEncoding pw3270::session::getEncoding() +{ + return RTL_TEXTENCODING_ISO_8859_1; +} -- libgit2 0.21.2