Commit 2d35de355ea9f8f2437bc15fccb64321c7c530d5

Authored by perry.werneck@gmail.com
1 parent 6958a2c1

Reorganizando classes de apoio ao rexx

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-04-08 16:21-0300\n"
  8 +"POT-Creation-Date: 2013-04-10 09:20-0300\n"
9 9 "PO-Revision-Date: 2013-04-01 10:06-0300\n"
10 10 "Last-Translator: Perry Werneck <perry.werneck@gmail.com>\n"
11 11 "Language-Team: Português <>\n"
... ... @@ -200,7 +200,7 @@ msgstr &quot;Sobre a segurança&quot;
200 200 msgid "Action failed"
201 201 msgstr "Ação falhou"
202 202  
203   -#: ui/00default.xml:327
  203 +#: ui/00default.xml:328
204 204 msgid "Add to copy"
205 205 msgstr "Adicionar à cópia"
206 206  
... ... @@ -208,7 +208,7 @@ msgstr &quot;Adicionar à cópia&quot;
208 208 msgid "Add/Remove _CR at end of line"
209 209 msgstr "Adicionar/Remover _CR no final da linha"
210 210  
211   -#: ui/00default.xml:395
  211 +#: ui/00default.xml:396
212 212 msgid "Alert sound"
213 213 msgstr "Aviso sonoro"
214 214  
... ... @@ -238,7 +238,7 @@ msgstr &quot;Divergência nos números de série da autoridade e emissor &quot;
238 238 msgid "Authority and subject key identifier mismatch"
239 239 msgstr "Authority and subject key identifier mismatch"
240 240  
241   -#: ui/00default.xml:390
  241 +#: ui/00default.xml:391
242 242 msgid "Auto-Reconnect"
243 243 msgstr "Reconectar automaticamente"
244 244  
... ... @@ -262,11 +262,11 @@ msgstr &quot;Versão winsock inválida&quot;
262 262 msgid "Black"
263 263 msgstr "Preto"
264 264  
265   -#: ui/00default.xml:388
  265 +#: ui/00default.xml:389
266 266 msgid "Blank Fill"
267 267 msgstr "Completar com espaços"
268 268  
269   -#: ui/00default.xml:381
  269 +#: ui/00default.xml:382
270 270 msgid "Blinking Cursor"
271 271 msgstr "Cursor piscante"
272 272  
... ... @@ -274,7 +274,7 @@ msgstr &quot;Cursor piscante&quot;
274 274 msgid "Blue"
275 275 msgstr "Azul"
276 276  
277   -#: ui/00default.xml:391
  277 +#: ui/00default.xml:392
278 278 msgid "Bold"
279 279 msgstr "Negrito"
280 280  
... ... @@ -486,7 +486,7 @@ msgstr &quot;Tema de cores:&quot;
486 486 msgid "Color setup"
487 487 msgstr "Configuração de cores"
488 488  
489   -#: ui/00default.xml:370
  489 +#: ui/00default.xml:371
490 490 msgid "Colors"
491 491 msgstr "Cores"
492 492  
... ... @@ -494,7 +494,7 @@ msgstr &quot;Cores&quot;
494 494 msgid "Complete"
495 495 msgstr "Completo"
496 496  
497   -#: ui/00default.xml:380
  497 +#: ui/00default.xml:381
498 498 msgid "Connect on startup"
499 499 msgstr "Conectar ao iniciar"
500 500  
... ... @@ -502,7 +502,7 @@ msgstr &quot;Conectar ao iniciar&quot;
502 502 msgid "Connection reset by peer"
503 503 msgstr "Conexão foi cancelada pelo servidor"
504 504  
505   -#: ui/00default.xml:324
  505 +#: ui/00default.xml:325
506 506 msgid "Copy"
507 507 msgstr "Copiar"
508 508  
... ... @@ -510,11 +510,11 @@ msgstr &quot;Copiar&quot;
510 510 msgid "Copy as HTML"
511 511 msgstr "Copiar como HTML"
512 512  
513   -#: ui/00default.xml:325
  513 +#: ui/00default.xml:326
514 514 msgid "Copy as table"
515 515 msgstr "Copiar como tabela"
516 516  
517   -#: colors.c:418 ui/00default.xml:387
  517 +#: colors.c:418 ui/00default.xml:388
518 518 msgid "Cross hair cursor"
519 519 msgstr "Cursor mira"
520 520  
... ... @@ -527,7 +527,7 @@ msgstr &quot;Atual (%s)&quot;
527 527 msgid "Custom colors"
528 528 msgstr "Cores personalizadas"
529 529  
530   -#: ui/00default.xml:328
  530 +#: ui/00default.xml:329
531 531 msgid "Cut"
532 532 msgstr "Recortar"
533 533  
... ... @@ -567,7 +567,7 @@ msgstr &quot;Mostrar atualizações de janela&quot;
567 567 msgid "Default"
568 568 msgstr "Padrão"
569 569  
570   -#: ui/00default.xml:344
  570 +#: ui/00default.xml:345
571 571 msgid "Delete field"
572 572 msgstr "Apagar campo"
573 573  
... ... @@ -615,15 +615,15 @@ msgstr &quot;&quot;
615 615 "Apagar\n"
616 616 "Campos"
617 617  
618   -#: ui/00default.xml:343
  618 +#: ui/00default.xml:344
619 619 msgid "Erase input"
620 620 msgstr "Apagar campos"
621 621  
622   -#: ui/00default.xml:345
  622 +#: ui/00default.xml:346
623 623 msgid "Erase to end of field"
624 624 msgstr "Apagar até o final do campo"
625 625  
626   -#: ui/00default.xml:346
  626 +#: ui/00default.xml:347
627 627 msgid "Erase to end of line"
628 628 msgstr "Apagar até o final da linha"
629 629  
... ... @@ -670,7 +670,7 @@ msgstr &quot;Erro ao resolver %s: %s&quot;
670 670 msgid "Event Trace"
671 671 msgstr "Trace de eventos"
672 672  
673   -#: ui/rexx.xml:259
  673 +#: ui/rexx.xml:260
674 674 msgid "External Rexx script"
675 675 msgstr "External Rexx script"
676 676  
... ... @@ -718,7 +718,7 @@ msgstr &quot;Format error in certificate&#39;s notAfter field&quot;
718 718 msgid "Format error in certificate's notBefore field"
719 719 msgstr "Format error in certificate's notBefore field"
720 720  
721   -#: ui/00default.xml:384
  721 +#: ui/00default.xml:385
722 722 msgid "Full Screen"
723 723 msgstr "Tela cheia"
724 724  
... ... @@ -767,7 +767,7 @@ msgstr &quot;HTTP Proxy: EOF inesperado&quot;
767 767 msgid "HTTP Proxy: unrecognized reply"
768 768 msgstr "HTTP Proxy: Resposta desconhecida"
769 769  
770   -#: ui/00default.xml:405
  770 +#: ui/00default.xml:406
771 771 msgid "Help"
772 772 msgstr "Ajuda"
773 773  
... ... @@ -828,7 +828,7 @@ msgstr &quot;Comprimento de frame inválido&quot;
828 828 msgid "Informations"
829 829 msgstr "Informações"
830 830  
831   -#: ui/00default.xml:400
  831 +#: ui/00default.xml:401
832 832 msgid "Input method"
833 833 msgstr "Método de entrada"
834 834  
... ... @@ -875,7 +875,7 @@ msgstr &quot;Sintaxe de proxy inválida&quot;
875 875 msgid "Invalid proxy type '%.*s'"
876 876 msgstr "Tipo de proxy invalido '%.*s'"
877 877  
878   -#: ui/00default.xml:393
  878 +#: ui/00default.xml:394
879 879 msgid "Keep selected"
880 880 msgstr "Manter selecionado"
881 881  
... ... @@ -908,7 +908,7 @@ msgstr &quot;Faltando &#39;]&#39;&quot;
908 908 msgid "Model %d (%s)"
909 909 msgstr "Modelo %d (%s)"
910 910  
911   -#: ui/00default.xml:382
  911 +#: ui/00default.xml:383
912 912 msgid "Monocase"
913 913 msgstr "Só Maiúsculas"
914 914  
... ... @@ -944,7 +944,7 @@ msgstr &quot;Erro de rede&quot;
944 944 msgid "Network startup error"
945 945 msgstr "Erro ao iniciar a rede"
946 946  
947   -#: ui/00default.xml:452
  947 +#: ui/00default.xml:453
948 948 msgid "Next field"
949 949 msgstr "Próximo campo"
950 950  
... ... @@ -1142,15 +1142,15 @@ msgstr &quot;Erro de interpretação em %s&quot;
1142 1142 msgid "Passthru Proxy: send error"
1143 1143 msgstr "Passthru Proxy: Erro ao enviar"
1144 1144  
1145   -#: ui/00default.xml:329
  1145 +#: ui/00default.xml:330
1146 1146 msgid "Paste"
1147 1147 msgstr "Colar"
1148 1148  
1149   -#: ui/00default.xml:330
  1149 +#: ui/00default.xml:331
1150 1150 msgid "Paste next"
1151 1151 msgstr "Colar próximo"
1152 1152  
1153   -#: ui/00default.xml:333
  1153 +#: ui/00default.xml:334
1154 1154 msgid "Paste text file"
1155 1155 msgstr "Colar arquivo texto"
1156 1156  
... ... @@ -1158,7 +1158,7 @@ msgstr &quot;Colar arquivo texto&quot;
1158 1158 msgid "Paste text file contents"
1159 1159 msgstr "Colar conteúdo de arquivo texto"
1160 1160  
1161   -#: ui/00default.xml:386
  1161 +#: ui/00default.xml:387
1162 1162 msgid "Paste with left margin"
1163 1163 msgstr "Colar com margem esquerda"
1164 1164  
... ... @@ -1174,7 +1174,7 @@ msgstr &quot;Caminho para os arquivos de dados da aplicação&quot;
1174 1174 msgid "Pink"
1175 1175 msgstr "Rosa"
1176 1176  
1177   -#: ui/00default.xml:451
  1177 +#: ui/00default.xml:452
1178 1178 msgid "Previous field"
1179 1179 msgstr "Campo anterior"
1180 1180  
... ... @@ -1182,11 +1182,11 @@ msgstr &quot;Campo anterior&quot;
1182 1182 msgid "Primary space:"
1183 1183 msgstr "Primary space:"
1184 1184  
1185   -#: ui/00default.xml:312
  1185 +#: ui/00default.xml:313
1186 1186 msgid "Print"
1187 1187 msgstr "Imprimir"
1188 1188  
1189   -#: ui/00default.xml:314
  1189 +#: ui/00default.xml:315
1190 1190 msgid "Print copy"
1191 1191 msgstr "Imprimir cópia"
1192 1192  
... ... @@ -1194,7 +1194,7 @@ msgstr &quot;Imprimir cópia&quot;
1194 1194 msgid "Print operation failed"
1195 1195 msgstr "Operação de impressão falhou"
1196 1196  
1197   -#: ui/00default.xml:313
  1197 +#: ui/00default.xml:314
1198 1198 msgid "Print selected"
1199 1199 msgstr "Imprimir seleção"
1200 1200  
... ... @@ -1202,7 +1202,7 @@ msgstr &quot;Imprimir seleção&quot;
1202 1202 msgid "Print selection box"
1203 1203 msgstr "Imprimir marca de seleção"
1204 1204  
1205   -#: print.c:754 ui/00default.xml:371
  1205 +#: print.c:754 ui/00default.xml:372
1206 1206 msgid "Print settings"
1207 1207 msgstr "Configurações de impressão"
1208 1208  
... ... @@ -1290,7 +1290,7 @@ msgstr &quot;RPQ: can&#39;t resolve &#39;%s&#39;: %s&quot;
1290 1290 msgid "RPQ: gethostbyname error"
1291 1291 msgstr "RPQ: Erro em gethostbyname"
1292 1292  
1293   -#: ui/00default.xml:317
  1293 +#: ui/00default.xml:318
1294 1294 msgid "Receive file"
1295 1295 msgstr "Receber arquivo"
1296 1296  
... ... @@ -1310,11 +1310,11 @@ msgstr &quot;Vermelho&quot;
1310 1310 msgid "Reload buffer contents"
1311 1311 msgstr "Recarregar conteúdo do buffer"
1312 1312  
1313   -#: ui/00default.xml:338
  1313 +#: ui/00default.xml:339
1314 1314 msgid "Remove selection"
1315 1315 msgstr "Remover seleção"
1316 1316  
1317   -#: ui/00default.xml:339
  1317 +#: ui/00default.xml:340
1318 1318 msgid "Reselect"
1319 1319 msgstr "Reselecionar"
1320 1320  
... ... @@ -1322,11 +1322,11 @@ msgstr &quot;Reselecionar&quot;
1322 1322 msgid "Reset"
1323 1323 msgstr "Reset"
1324 1324  
1325   -#: ui/00default.xml:385
  1325 +#: ui/00default.xml:386
1326 1326 msgid "Resize on alternate screen"
1327 1327 msgstr "Mudar tamanho do terminal em tela alternativa"
1328 1328  
1329   -#: ui/00default.xml:453
  1329 +#: ui/00default.xml:454
1330 1330 msgid "Return"
1331 1331 msgstr "Return"
1332 1332  
... ... @@ -1487,7 +1487,7 @@ msgstr &quot;&quot;
1487 1487 "SSL_write:\n"
1488 1488 "%s"
1489 1489  
1490   -#: ui/00default.xml:309
  1490 +#: ui/00default.xml:310
1491 1491 msgid "Save copy"
1492 1492 msgstr "Salvar cópia"
1493 1493  
... ... @@ -1495,7 +1495,7 @@ msgstr &quot;Salvar cópia&quot;
1495 1495 msgid "Save copy to file"
1496 1496 msgstr "Salvar cópia para arquivo"
1497 1497  
1498   -#: ui/00default.xml:307
  1498 +#: ui/00default.xml:308
1499 1499 msgid "Save screen"
1500 1500 msgstr "Salvar tela"
1501 1501  
... ... @@ -1503,7 +1503,7 @@ msgstr &quot;Salvar tela&quot;
1503 1503 msgid "Save screen to file"
1504 1504 msgstr "Salvar tela para arquivo"
1505 1505  
1506   -#: ui/00default.xml:308
  1506 +#: ui/00default.xml:309
1507 1507 msgid "Save selected"
1508 1508 msgstr "Salvar seleção"
1509 1509  
... ... @@ -1515,11 +1515,11 @@ msgstr &quot;Salvar seleção para arquivo&quot;
1515 1515 msgid "Screen Trace"
1516 1516 msgstr "Trace de tela"
1517 1517  
1518   -#: ui/00default.xml:377
  1518 +#: ui/00default.xml:378
1519 1519 msgid "Screen size"
1520 1520 msgstr "Tamanho da tela"
1521 1521  
1522   -#: ui/rexx.xml:259
  1522 +#: ui/rexx.xml:260
1523 1523 msgid "Scripts"
1524 1524 msgstr "Scripts"
1525 1525  
... ... @@ -1531,15 +1531,15 @@ msgstr &quot;Secondary space:&quot;
1531 1531 msgid "Secure connection was successful."
1532 1532 msgstr "Conexão segura efetuada com sucesso."
1533 1533  
1534   -#: ui/00default.xml:337
  1534 +#: ui/00default.xml:338
1535 1535 msgid "Select Field"
1536 1536 msgstr "Selecionar campo"
1537 1537  
1538   -#: ui/00default.xml:336
  1538 +#: ui/00default.xml:337
1539 1539 msgid "Select all"
1540 1540 msgstr "Selecionar tudo"
1541 1541  
1542   -#: ui/00default.xml:389
  1542 +#: ui/00default.xml:390
1543 1543 msgid "Select by rectangles"
1544 1544 msgstr "Seleção retangular"
1545 1545  
... ... @@ -1551,7 +1551,7 @@ msgstr &quot;Selecione arquivo a receber&quot;
1551 1551 msgid "Select file to send"
1552 1552 msgstr "Selecione arquivo a enviar"
1553 1553  
1554   -#: ui/00default.xml:374
  1554 +#: ui/00default.xml:375
1555 1555 msgid "Select font"
1556 1556 msgstr "Selecione fonte"
1557 1557  
... ... @@ -1575,7 +1575,7 @@ msgstr &quot;Certificado auto assinado&quot;
1575 1575 msgid "Self signed certificate in certificate chain"
1576 1576 msgstr "Certificado auto assinado na cadeia de certificados"
1577 1577  
1578   -#: ui/00default.xml:318
  1578 +#: ui/00default.xml:319
1579 1579 msgid "Send file"
1580 1580 msgstr "Enviar arquivo"
1581 1581  
... ... @@ -1587,7 +1587,7 @@ msgstr &quot;Enviar arquivo para o servidor&quot;
1587 1587 msgid "Send messages to syslog"
1588 1588 msgstr "Enviar mensagens para o log do sistema"
1589 1589  
1590   -#: ui/00default.xml:317
  1590 +#: ui/00default.xml:318
1591 1591 msgid "Send/Receive"
1592 1592 msgstr "Enviar/Receber"
1593 1593  
... ... @@ -1595,7 +1595,7 @@ msgstr &quot;Enviar/Receber&quot;
1595 1595 msgid "Session name"
1596 1596 msgstr "Nome da sessão"
1597 1597  
1598   -#: ui/00default.xml:355
  1598 +#: ui/00default.xml:356
1599 1599 msgid "Set hostname"
1600 1600 msgstr "Selecione servidor"
1601 1601  
... ... @@ -1611,11 +1611,11 @@ msgstr &quot;Desativa toggles&quot;
1611 1611 msgid "Set toggles ON"
1612 1612 msgstr "Ativa toggles"
1613 1613  
1614   -#: ui/00default.xml:370
  1614 +#: ui/00default.xml:371
1615 1615 msgid "Settings"
1616 1616 msgstr "Configurações"
1617 1617  
1618   -#: ui/00default.xml:392
  1618 +#: ui/00default.xml:393
1619 1619 msgid "Show Underline"
1620 1620 msgstr "Mostrar sublinhado"
1621 1621  
... ... @@ -1623,7 +1623,7 @@ msgstr &quot;Mostrar sublinhado&quot;
1623 1623 msgid "Show test pattern"
1624 1624 msgstr "Mostrar padrão de teste"
1625 1625  
1626   -#: ui/00default.xml:394
  1626 +#: ui/00default.xml:395
1627 1627 msgid "Smart paste"
1628 1628 msgstr "Colar inteligente"
1629 1629  
... ... @@ -1902,7 +1902,7 @@ msgid &quot;&quot;
1902 1902 "This version of %s was built without support for secure sockets layer (SSL)."
1903 1903 msgstr "Esta versão do %s foi gerada sem suporte para conexões seguras (SSL)."
1904 1904  
1905   -#: ui/00default.xml:411
  1905 +#: ui/00default.xml:412
1906 1906 msgid "Toolbar"
1907 1907 msgstr "Barra de ferramentas"
1908 1908  
... ... @@ -1910,7 +1910,7 @@ msgstr &quot;Barra de ferramentas&quot;
1910 1910 msgid "Trace"
1911 1911 msgstr "Trace"
1912 1912  
1913   -#: ui/00default.xml:383
  1913 +#: ui/00default.xml:384
1914 1914 msgid "Track Cursor"
1915 1915 msgstr "Mostrar posição do cursor"
1916 1916  
... ... @@ -2117,7 +2117,7 @@ msgstr &quot;Unsupported passthru host session&quot;
2117 2117 msgid "Unsupported socks 4 proxy"
2118 2118 msgstr "Unsupported socks 4 proxy"
2119 2119  
2120   -#: ui/00default.xml:396
  2120 +#: ui/00default.xml:397
2121 2121 msgid "Use +/- for field navigation"
2122 2122 msgstr "Usar teclas +/- para navegar por campos"
2123 2123  
... ... @@ -2158,7 +2158,7 @@ msgstr &quot;Europa ocidental (ISO 8859-1)&quot;
2158 2158 msgid "White"
2159 2159 msgstr "Branco"
2160 2160  
2161   -#: ui/00default.xml:422
  2161 +#: ui/00default.xml:423
2162 2162 msgid "Window"
2163 2163 msgstr "Janela"
2164 2164  
... ... @@ -2226,11 +2226,11 @@ msgstr &quot;_Procurar&quot;
2226 2226 msgid "_Color table:"
2227 2227 msgstr "Tabela de cores:"
2228 2228  
2229   -#: ui/00default.xml:365
  2229 +#: ui/00default.xml:366
2230 2230 msgid "_Connect"
2231 2231 msgstr "_Conectar"
2232 2232  
2233   -#: ui/00default.xml:366
  2233 +#: ui/00default.xml:367
2234 2234 msgid "_Disconnect"
2235 2235 msgstr "_Desconectar"
2236 2236  
... ... @@ -2238,7 +2238,7 @@ msgstr &quot;_Desconectar&quot;
2238 2238 msgid "_Edit"
2239 2239 msgstr "_Editar"
2240 2240  
2241   -#: ui/rexx.xml:255
  2241 +#: ui/rexx.xml:256
2242 2242 msgid "_File"
2243 2243 msgstr "_Arquivo"
2244 2244  
... ... @@ -2266,11 +2266,11 @@ msgstr &quot;Nome do _Host:&quot;
2266 2266 msgid "_Local file name:"
2267 2267 msgstr "Arquivo _local:"
2268 2268  
2269   -#: ui/00default.xml:355
  2269 +#: ui/00default.xml:356
2270 2270 msgid "_Network"
2271 2271 msgstr "_Rede"
2272 2272  
2273   -#: ui/00default.xml:380
  2273 +#: ui/00default.xml:381
2274 2274 msgid "_Options"
2275 2275 msgstr "_Opções"
2276 2276  
... ... @@ -2298,7 +2298,7 @@ msgstr &quot;Arquivo _texto&quot;
2298 2298 msgid "_To"
2299 2299 msgstr "_Para"
2300 2300  
2301   -#: ui/rexx.xml:257
  2301 +#: ui/rexx.xml:258
2302 2302 msgid "_View"
2303 2303 msgstr "_Exibir"
2304 2304  
... ...
pw3270.cbp
... ... @@ -288,6 +288,7 @@
288 288 <Unit filename="src/plugins/rx3270/pluginmain.cc" />
289 289 <Unit filename="src/plugins/rx3270/remote.cc" />
290 290 <Unit filename="src/plugins/rx3270/rexx_methods.cc" />
  291 + <Unit filename="src/plugins/rx3270/rx3270.cc" />
291 292 <Unit filename="src/plugins/rx3270/rx3270.cls" />
292 293 <Unit filename="src/plugins/rx3270/rx3270.h" />
293 294 <Unit filename="src/plugins/rx3270/rxapimain.cc" />
... ...
src/plugins/rx3270/local.cc
... ... @@ -114,69 +114,10 @@
114 114  
115 115 /*--[ Globals ]--------------------------------------------------------------------------------------*/
116 116  
117   - static bool plugin = false;
118   - static rx3270 * defSession = NULL;
119   -
120 117 /*--[ Implement ]------------------------------------------------------------------------------------*/
121 118  
122   -rx3270::rx3270(const char *local, const char *remote)
  119 +rx3270 * rx3270::create_local(void)
123 120 {
124   -#ifdef HAVE_ICONV
125   -
126   - if(strcmp(local,remote))
127   - {
128   - // Local and remote charsets aren't the same, setup conversion
129   - this->conv2Local = iconv_open(local, remote);
130   - this->conv2Host = iconv_open(remote,local);
131   - }
132   - else
133   - {
134   - this->conv2Local = this->conv2Host = (iconv_t)(-1);
135   - }
136   -#endif
137   -
138   - if(!defSession)
139   - defSession = this;
140   -}
141   -
142   -rx3270::~rx3270()
143   -{
144   -#ifdef HAVE_ICONV
145   -
146   - if(conv2Local != (iconv_t) (-1))
147   - iconv_close(conv2Local);
148   -
149   - if(conv2Host != (iconv_t) (-1))
150   - iconv_close(conv2Host);
151   -#endif
152   -
153   -
154   - if(defSession == this)
155   - defSession = NULL;
156   -}
157   -
158   -rx3270 * rx3270::create(const char *name)
159   -{
160   - if(name && *name)
161   - return create_remote(name);
162   - return new dynamic();
163   -}
164   -
165   -char * rx3270::get_version(void)
166   -{
167   - return strdup(PACKAGE_VERSION);
168   -}
169   -
170   -char * rx3270::get_revision(void)
171   -{
172   - return strdup(PACKAGE_REVISION);
173   -}
174   -
175   -rx3270 * rx3270::get_default(void)
176   -{
177   - if(defSession)
178   - return defSession;
179   -
180 121 return new dynamic();
181 122 }
182 123  
... ... @@ -200,12 +141,6 @@ static int get_datadir(LPSTR datadir)
200 141 }
201 142 #endif // WIN32
202 143  
203   -void rx3270::set_plugin(void)
204   -{
205   - trace("%s: Rexx API running as plugin",__FUNCTION__);
206   - plugin = true;
207   -}
208   -
209 144 extern "C"
210 145 {
211 146  
... ...
src/plugins/rx3270/rx3270.cc 0 → 100644
... ... @@ -0,0 +1,159 @@
  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 rx3270.cc 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 + *
  28 + */
  29 +
  30 + /*
  31 + *
  32 + * Reference:
  33 + *
  34 + * http://www.oorexx.org/docs/rexxpg/x2950.htm
  35 + *
  36 + */
  37 +
  38 + #include "rx3270.h"
  39 + #include <time.h>
  40 + #include <lib3270/actions.h>
  41 +
  42 +#ifdef HAVE_SYSLOG
  43 + #include <syslog.h>
  44 +#endif // HAVE_SYSLOG
  45 +
  46 + #include <string.h>
  47 +
  48 +/*--[ Globals ]--------------------------------------------------------------------------------------*/
  49 +
  50 + static bool plugin = false;
  51 + static rx3270 * defSession = NULL;
  52 +
  53 +/*--[ Implement ]------------------------------------------------------------------------------------*/
  54 +
  55 +rx3270::rx3270(const char *local, const char *remote)
  56 +{
  57 +#ifdef HAVE_ICONV
  58 +
  59 + if(strcmp(local,remote))
  60 + {
  61 + // Local and remote charsets aren't the same, setup conversion
  62 + this->conv2Local = iconv_open(local, remote);
  63 + this->conv2Host = iconv_open(remote,local);
  64 + }
  65 + else
  66 + {
  67 + this->conv2Local = this->conv2Host = (iconv_t)(-1);
  68 + }
  69 +#endif
  70 +
  71 + if(!defSession)
  72 + defSession = this;
  73 +}
  74 +
  75 +rx3270::~rx3270()
  76 +{
  77 +#ifdef HAVE_ICONV
  78 +
  79 + if(conv2Local != (iconv_t) (-1))
  80 + iconv_close(conv2Local);
  81 +
  82 + if(conv2Host != (iconv_t) (-1))
  83 + iconv_close(conv2Host);
  84 +#endif
  85 +
  86 +
  87 + if(defSession == this)
  88 + defSession = NULL;
  89 +}
  90 +
  91 +rx3270 * rx3270::create(const char *name)
  92 +{
  93 + if(name && *name)
  94 + return create_remote(name);
  95 + return create_local();
  96 +}
  97 +
  98 +char * rx3270::get_version(void)
  99 +{
  100 + return strdup(PACKAGE_VERSION);
  101 +}
  102 +
  103 +char * rx3270::get_revision(void)
  104 +{
  105 + return strdup(PACKAGE_REVISION);
  106 +}
  107 +
  108 +rx3270 * rx3270::get_default(void)
  109 +{
  110 + if(defSession)
  111 + return defSession;
  112 + return create_local();
  113 +}
  114 +
  115 +void rx3270::log(const char *fmt, ...)
  116 +{
  117 + va_list arg_ptr;
  118 + va_start(arg_ptr, fmt);
  119 + this->logva(fmt,arg_ptr);
  120 + va_end(arg_ptr);
  121 +}
  122 +
  123 +void rx3270::logva(const char *fmt, va_list args)
  124 +{
  125 +#ifdef HAVE_SYSLOG
  126 + openlog(PACKAGE_NAME, LOG_NDELAY, LOG_USER);
  127 + vsyslog(LOG_INFO,fmt,args);
  128 + closelog();
  129 +#else
  130 + vfprintf(stderr,fmt,args);
  131 +#endif
  132 +}
  133 +
  134 +int rx3270::wait_for_text_at(int row, int col, const char *key, int timeout)
  135 +{
  136 + time_t end = time(0)+timeout;
  137 +
  138 + while(time(0) < end)
  139 + {
  140 + if(!is_connected())
  141 + return ENOTCONN;
  142 +
  143 + if(!cmp_text_at(row,col,key))
  144 + return 0;
  145 +
  146 + iterate();
  147 + }
  148 +
  149 + return ETIMEDOUT;
  150 +}
  151 +
  152 +void rx3270::set_plugin(void)
  153 +{
  154 + plugin = true;
  155 +}
  156 +
  157 +
  158 +
  159 +
... ...
src/plugins/rx3270/rx3270.h
... ... @@ -133,6 +133,7 @@
133 133  
134 134 static rx3270 * create(const char *name = NULL);
135 135 static rx3270 * create_remote(const char *name);
  136 + static rx3270 * create_local(void);
136 137 static rx3270 * get_default(void);
137 138  
138 139 static void set_plugin(void);
... ...
src/plugins/rx3270/rxapimain.cc
... ... @@ -171,41 +171,3 @@ LIB3270_EXPORT RexxPackageEntry * RexxEntry RexxGetPackage(void)
171 171 END_EXTERN_C()
172 172  
173 173  
174   -void rx3270::log(const char *fmt, ...)
175   -{
176   - va_list arg_ptr;
177   - va_start(arg_ptr, fmt);
178   - this->logva(fmt,arg_ptr);
179   - va_end(arg_ptr);
180   -}
181   -
182   -void rx3270::logva(const char *fmt, va_list args)
183   -{
184   -#ifdef HAVE_SYSLOG
185   - openlog(PACKAGE_NAME, LOG_NDELAY, LOG_USER);
186   - vsyslog(LOG_INFO,fmt,args);
187   - closelog();
188   -#else
189   - vfprintf(stderr,fmt,args);
190   -#endif
191   -}
192   -
193   -int rx3270::wait_for_text_at(int row, int col, const char *key, int timeout)
194   -{
195   - time_t end = time(0)+timeout;
196   -
197   - while(time(0) < end)
198   - {
199   - if(!is_connected())
200   - return ENOTCONN;
201   -
202   - if(!cmp_text_at(row,col,key))
203   - return 0;
204   -
205   - iterate();
206   - }
207   -
208   - return ETIMEDOUT;
209   -}
210   -
211   -
... ...
src/plugins/rx3270/session.cc 0 → 100644
... ... @@ -0,0 +1,52 @@
  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 session.cc 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 + *
  28 + */
  29 +
  30 + #include <time.h>
  31 + #include <string.h>
  32 +
  33 + #include "rx3270.h"
  34 + #include <lib3270/actions.h>
  35 +
  36 +
  37 +/*--[ Implement ]------------------------------------------------------------------------------------*/
  38 +
  39 +session::session()
  40 +{
  41 + this->hSession = lib3270_get_default_session_handle();
  42 +}
  43 +
  44 +session::~session()
  45 +{
  46 +
  47 +}
  48 +
  49 +const char * session::getVersion(void)
  50 +{
  51 + return lib3270_get_version();
  52 +}
... ...