Commit 3a46fe564fa0ab920d285323d83b6fd95276a2c2
1 parent
4e8ab8d4
Exists in
master
and in
5 other branches
Implementando metodos no plugin rexx
Showing
17 changed files
with
138 additions
and
41 deletions
Show diff stats
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-06-05 12:32-0300\n" | |
8 | +"POT-Creation-Date: 2013-06-12 09:54-0300\n" | |
9 | 9 | "PO-Revision-Date: 2013-05-08 14:30-0300\n" |
10 | 10 | "Last-Translator: Perry Werneck <perry.werneck@gmail.com>\n" |
11 | 11 | "Language-Team: Português <>\n" |
... | ... | @@ -83,7 +83,7 @@ msgstr "%s: Tabulação vertical não é suportada" |
83 | 83 | msgid "%s: unknown family %d" |
84 | 84 | msgstr "%s: Familia %d é inválida" |
85 | 85 | |
86 | -#: telnet.c:1100 | |
86 | +#: telnet.c:1160 | |
87 | 87 | #, c-format |
88 | 88 | msgid "%s:%d" |
89 | 89 | msgstr "%s:%d" |
... | ... | @@ -291,7 +291,7 @@ msgstr "Portal do Software Público Brasileiro" |
291 | 291 | msgid "Break" |
292 | 292 | msgstr "Break" |
293 | 293 | |
294 | -#: telnet.c:2068 | |
294 | +#: telnet.c:2128 | |
295 | 295 | msgid "Broken pipe" |
296 | 296 | msgstr "Conexão interrompida" |
297 | 297 | |
... | ... | @@ -324,7 +324,7 @@ msgstr "At_ual" |
324 | 324 | msgid "Can't accept unnamed %s" |
325 | 325 | msgstr "Não posso aceitar elemento %s sem nome" |
326 | 326 | |
327 | -#: telnet.c:614 | |
327 | +#: telnet.c:674 | |
328 | 328 | #, c-format |
329 | 329 | msgid "Can't connect to %s:%d" |
330 | 330 | msgstr "Não foi possível conectar a %s:%d" |
... | ... | @@ -333,7 +333,7 @@ msgstr "Não foi possível conectar a %s:%d" |
333 | 333 | msgid "Can't connect to host" |
334 | 334 | msgstr "Não foi possível conectar ao servidor" |
335 | 335 | |
336 | -#: v3270/selection.c:387 | |
336 | +#: v3270/selection.c:425 | |
337 | 337 | #, c-format |
338 | 338 | msgid "Can't convert line %d from %s to %s" |
339 | 339 | msgstr "Não foi possível converter a linha %d de %s para %s" |
... | ... | @@ -428,7 +428,7 @@ msgstr "Não é possível usar a Winsock versão %d.%d" |
428 | 428 | msgid "Cancelled by user" |
429 | 429 | msgstr "Cancelado pelo usuário" |
430 | 430 | |
431 | -#: telnet.c:648 | |
431 | +#: telnet.c:708 | |
432 | 432 | msgid "Cannot create socket handle" |
433 | 433 | msgstr "Não foi possível criar um manipulador de socket" |
434 | 434 | |
... | ... | @@ -466,7 +466,7 @@ msgstr "Certificado revogado" |
466 | 466 | msgid "Certificate signature failure" |
467 | 467 | msgstr "Falha na assinatura do certificado" |
468 | 468 | |
469 | -#: v3270/selection.c:389 | |
469 | +#: v3270/selection.c:427 | |
470 | 470 | msgid "Charset error" |
471 | 471 | msgstr "Erro de codificação de caracteres" |
472 | 472 | |
... | ... | @@ -503,7 +503,7 @@ msgstr "Completo" |
503 | 503 | msgid "Connect on startup" |
504 | 504 | msgstr "Conectar ao iniciar" |
505 | 505 | |
506 | -#: telnet.c:2072 | |
506 | +#: telnet.c:2132 | |
507 | 507 | msgid "Connection reset by peer" |
508 | 508 | msgstr "Conexão foi cancelada pelo servidor" |
509 | 509 | |
... | ... | @@ -576,7 +576,7 @@ msgstr "Padrão" |
576 | 576 | msgid "Delete field" |
577 | 577 | msgstr "Apagar campo" |
578 | 578 | |
579 | -#: telnet.c:1743 | |
579 | +#: telnet.c:1803 | |
580 | 580 | msgid "Device type rejected" |
581 | 581 | msgstr "Tipo de dispositivo rejeitado" |
582 | 582 | |
... | ... | @@ -584,7 +584,7 @@ msgstr "Tipo de dispositivo rejeitado" |
584 | 584 | msgid "Disconnected from host" |
585 | 585 | msgstr "Desconectado do servidor" |
586 | 586 | |
587 | -#: telnet.c:1318 | |
587 | +#: telnet.c:1378 | |
588 | 588 | msgid "EOR received when not in 3270 mode, ignored." |
589 | 589 | msgstr "EOR recebido fora do modo 3270, ignorado." |
590 | 590 | |
... | ... | @@ -632,7 +632,7 @@ msgstr "Apagar até o final do campo" |
632 | 632 | msgid "Erase to end of line" |
633 | 633 | msgstr "Apagar até o final da linha" |
634 | 634 | |
635 | -#: print.c:238 v3270/widget.c:215 util.c:994 | |
635 | +#: print.c:238 v3270/widget.c:215 util.c:1009 | |
636 | 636 | msgid "Error" |
637 | 637 | msgstr "Erro" |
638 | 638 | |
... | ... | @@ -651,12 +651,12 @@ msgstr "Erro \"%s\" gravando arquivo local (rc=%d)" |
651 | 651 | msgid "Error %d resolving %s" |
652 | 652 | msgstr "Erro %d resolvendo %s" |
653 | 653 | |
654 | -#: telnet.c:3056 telnet.c:3067 | |
654 | +#: telnet.c:3116 telnet.c:3127 | |
655 | 655 | #, c-format |
656 | 656 | msgid "Error in fcntl(%s) when setting non blocking mode" |
657 | 657 | msgstr "Erro em fcntl(%s) ao ativar o modo não blocante" |
658 | 658 | |
659 | -#: telnet.c:3046 | |
659 | +#: telnet.c:3106 | |
660 | 660 | #, c-format |
661 | 661 | msgid "Error in ioctl(%s) when setting no blocking mode" |
662 | 662 | msgstr "Erro em ioctl(%s) ao ativar o modo não blocante" |
... | ... | @@ -780,7 +780,7 @@ msgstr "Ajuda" |
780 | 780 | msgid "Host disconnected, transfer cancelled" |
781 | 781 | msgstr "Servidor desconectou, transferência cancelada" |
782 | 782 | |
783 | -#: telnet.c:1801 | |
783 | +#: telnet.c:1861 | |
784 | 784 | msgid "Host illegally added function(s)" |
785 | 785 | msgstr "Host illegally added function(s)" |
786 | 786 | |
... | ... | @@ -792,11 +792,11 @@ msgstr "Servidor é AS_400" |
792 | 792 | msgid "Host is TSO" |
793 | 793 | msgstr "Servidor é TSO" |
794 | 794 | |
795 | -#: telnet.c:1726 | |
795 | +#: telnet.c:1786 | |
796 | 796 | msgid "Host rejected device type or request type" |
797 | 797 | msgstr "Servidor rejeitou o tipo de dispositivo ou requisição" |
798 | 798 | |
799 | -#: telnet.c:1739 | |
799 | +#: telnet.c:1799 | |
800 | 800 | msgid "Host rejected resource(s)" |
801 | 801 | msgstr "Servidor rejeitou recurso(s)" |
802 | 802 | |
... | ... | @@ -946,11 +946,11 @@ msgstr "Mostarda" |
946 | 946 | msgid "N/A" |
947 | 947 | msgstr "N/A" |
948 | 948 | |
949 | -#: telnet.c:359 telnet.c:618 | |
949 | +#: telnet.c:359 telnet.c:678 | |
950 | 950 | msgid "Network error" |
951 | 951 | msgstr "Erro de rede" |
952 | 952 | |
953 | -#: telnet.c:315 telnet.c:326 telnet.c:647 telnet.c:658 | |
953 | +#: telnet.c:315 telnet.c:326 telnet.c:707 telnet.c:718 | |
954 | 954 | msgid "Network startup error" |
955 | 955 | msgstr "Erro ao iniciar a rede" |
956 | 956 | |
... | ... | @@ -1464,15 +1464,15 @@ msgstr "SOCKS5 Proxy: xmit version 5 nmethods 1 (no auth)\n" |
1464 | 1464 | msgid "SOCKS5 proxy: %s/%u: %s" |
1465 | 1465 | msgstr "SOCKS5 proxy: %s/%u: %s" |
1466 | 1466 | |
1467 | -#: telnet.c:1083 | |
1467 | +#: telnet.c:1143 | |
1468 | 1468 | msgid "SSL Error" |
1469 | 1469 | msgstr "Erro SSL" |
1470 | 1470 | |
1471 | -#: telnet.c:1083 | |
1471 | +#: telnet.c:1143 | |
1472 | 1472 | msgid "SSL Read error" |
1473 | 1473 | msgstr "Erro de leitura SSL" |
1474 | 1474 | |
1475 | -#: telnet.c:773 telnet.c:787 | |
1475 | +#: telnet.c:833 telnet.c:847 | |
1476 | 1476 | msgid "SSL connect failed!" |
1477 | 1477 | msgstr "Conexão SSL falhou" |
1478 | 1478 | |
... | ... | @@ -1480,15 +1480,15 @@ msgstr "Conexão SSL falhou" |
1480 | 1480 | msgid "SSL error" |
1481 | 1481 | msgstr "Erro SSL" |
1482 | 1482 | |
1483 | -#: telnet.c:746 | |
1483 | +#: telnet.c:806 | |
1484 | 1484 | msgid "SSL init failed!" |
1485 | 1485 | msgstr "Inicialização SSL falhou" |
1486 | 1486 | |
1487 | -#: telnet.c:755 | |
1487 | +#: telnet.c:815 | |
1488 | 1488 | msgid "SSL_set_fd failed!" |
1489 | 1489 | msgstr "SSL_set_fd falhou!" |
1490 | 1490 | |
1491 | -#: telnet.c:2058 | |
1491 | +#: telnet.c:2118 | |
1492 | 1492 | #, c-format |
1493 | 1493 | msgid "" |
1494 | 1494 | "SSL_write:\n" |
... | ... | @@ -1637,11 +1637,11 @@ msgstr "Mostrar padrão de teste" |
1637 | 1637 | msgid "Smart paste" |
1638 | 1638 | msgstr "Colar inteligente" |
1639 | 1639 | |
1640 | -#: telnet.c:1104 | |
1640 | +#: telnet.c:1164 | |
1641 | 1641 | msgid "Socket read error" |
1642 | 1642 | msgstr "Erro ao ler dados da rede" |
1643 | 1643 | |
1644 | -#: telnet.c:2079 | |
1644 | +#: telnet.c:2139 | |
1645 | 1645 | msgid "Socket write error" |
1646 | 1646 | msgstr "Erro ao enviar dados para a rede" |
1647 | 1647 | |
... | ... | @@ -1669,7 +1669,7 @@ msgstr "Tipo de servidor:" |
1669 | 1669 | msgid "TELNET Proxy: send error" |
1670 | 1670 | msgstr "TELNET Proxy: Erro ao enviar" |
1671 | 1671 | |
1672 | -#: telnet.c:3253 | |
1672 | +#: telnet.c:3313 | |
1673 | 1673 | msgid "TLS negotiation failure" |
1674 | 1674 | msgstr "Negociação TLS falhou" |
1675 | 1675 | |
... | ... | @@ -2070,7 +2070,7 @@ msgstr "Alvo inesperado \"%s\"" |
2070 | 2070 | msgid "Unexpected type %d in typeahead queue" |
2071 | 2071 | msgstr "Tipo inesperado %d na fila de teclado" |
2072 | 2072 | |
2073 | -#: ctlr.c:527 | |
2073 | +#: ctlr.c:583 | |
2074 | 2074 | #, c-format |
2075 | 2075 | msgid "Unknown 3270 Data Stream command: 0x%X" |
2076 | 2076 | msgstr "Unknown 3270 Data Stream command: 0x%X" |
... | ... | @@ -2102,7 +2102,7 @@ msgstr "" |
2102 | 2102 | "Servidor desconhecido:\n" |
2103 | 2103 | "%s" |
2104 | 2104 | |
2105 | -#: telnet.c:489 | |
2105 | +#: telnet.c:549 | |
2106 | 2106 | #, c-format |
2107 | 2107 | msgid "Unknown passthru host: %s" |
2108 | 2108 | msgstr "Servidor \"passthru\" desconhecido: %s" |
... | ... | @@ -2112,7 +2112,7 @@ msgstr "Servidor \"passthru\" desconhecido: %s" |
2112 | 2112 | msgid "Unknown popup type \"%s\"" |
2113 | 2113 | msgstr "Tipo de popup \"%s\" não é conhecido" |
2114 | 2114 | |
2115 | -#: telnet.c:518 resolver.c:147 | |
2115 | +#: telnet.c:578 resolver.c:147 | |
2116 | 2116 | #, c-format |
2117 | 2117 | msgid "Unknown port number or service: %s" |
2118 | 2118 | msgstr "Número de porta ou serviço desconhecido: %s" |
... | ... | @@ -2125,7 +2125,7 @@ msgstr "Unsupported RPQ term" |
2125 | 2125 | msgid "Unsupported certificate purpose" |
2126 | 2126 | msgstr "Finalidade do certificado não é suportada" |
2127 | 2127 | |
2128 | -#: telnet.c:474 | |
2128 | +#: telnet.c:534 | |
2129 | 2129 | msgid "Unsupported passthru host session" |
2130 | 2130 | msgstr "Unsupported passthru host session" |
2131 | 2131 | |
... | ... | @@ -2150,7 +2150,7 @@ msgstr "Versão %s - Revisão %s" |
2150 | 2150 | msgid "View Field Delimiters" |
2151 | 2151 | msgstr "Mostrar delimitadores de campo" |
2152 | 2152 | |
2153 | -#: telnet.c:659 | |
2153 | +#: telnet.c:719 | |
2154 | 2154 | msgid "WSAEventSelect failed" |
2155 | 2155 | msgstr "WSAEventSelect falhou" |
2156 | 2156 | |
... | ... | @@ -2238,7 +2238,7 @@ msgstr "_Acrescentar" |
2238 | 2238 | msgid "_Browse" |
2239 | 2239 | msgstr "_Procurar" |
2240 | 2240 | |
2241 | -#: hostdialog.c:232 | |
2241 | +#: hostdialog.c:250 | |
2242 | 2242 | msgid "_Color table:" |
2243 | 2243 | msgstr "Tabela de cores:" |
2244 | 2244 | |
... | ... | @@ -2343,12 +2343,12 @@ msgstr "um atributo \"action\"" |
2343 | 2343 | msgid "select() failed when dispatching events" |
2344 | 2344 | msgstr "select() failed when dispatching events" |
2345 | 2345 | |
2346 | -#: telnet.c:569 telnet.c:575 telnet.c:582 | |
2346 | +#: telnet.c:629 telnet.c:635 telnet.c:642 | |
2347 | 2347 | #, c-format |
2348 | 2348 | msgid "setsockopt(%s)" |
2349 | 2349 | msgstr "setsockopt(%s)" |
2350 | 2350 | |
2351 | -#: telnet.c:562 | |
2351 | +#: telnet.c:622 | |
2352 | 2352 | msgid "socket" |
2353 | 2353 | msgstr "socket" |
2354 | 2354 | |
... | ... | @@ -2356,7 +2356,7 @@ msgstr "socket" |
2356 | 2356 | msgid "translator-credits" |
2357 | 2357 | msgstr "translator-credits" |
2358 | 2358 | |
2359 | -#: telnet.c:1079 | |
2359 | +#: telnet.c:1139 | |
2360 | 2360 | msgid "unknown error" |
2361 | 2361 | msgstr "Erro desconhecido" |
2362 | 2362 | ... | ... |
pw3270.cbp
... | ... | @@ -242,7 +242,6 @@ |
242 | 242 | <Option compilerVar="CC" /> |
243 | 243 | </Unit> |
244 | 244 | <Unit filename="src/plugins/dbus3270/daemon.h" /> |
245 | - <Unit filename="src/plugins/dbus3270/dbus-glue.h" /> | |
246 | 245 | <Unit filename="src/plugins/dbus3270/globals.h" /> |
247 | 246 | <Unit filename="src/plugins/dbus3270/gobject.c"> |
248 | 247 | <Option compilerVar="CC" /> | ... | ... |
src/include/lib3270.h
... | ... | @@ -872,7 +872,7 @@ |
872 | 872 | * Find the next unprotected field. |
873 | 873 | * |
874 | 874 | * @param hSession Session handle. |
875 | - * @param baddr0 Search start addr. | |
875 | + * @param baddr0 Search start addr (-1 to use current cursor position). | |
876 | 876 | * |
877 | 877 | * @return address following the unprotected attribute byte, or 0 if no nonzero-width unprotected field can be found. |
878 | 878 | * | ... | ... |
src/include/pw3270/ipcpackets.h
src/lib3270/ctlr.c
... | ... | @@ -443,6 +443,11 @@ LIB3270_EXPORT int lib3270_get_next_unprotected(H3270 *hSession, int baddr0) |
443 | 443 | { |
444 | 444 | register int baddr, nbaddr; |
445 | 445 | |
446 | + CHECK_SESSION_HANDLE(hSession); | |
447 | + | |
448 | + if(baddr0 < 0) | |
449 | + baddr0 = hSession->cursor_addr; | |
450 | + | |
446 | 451 | nbaddr = baddr0; |
447 | 452 | do |
448 | 453 | { | ... | ... |
src/plugins/dbus3270/gobject.c
... | ... | @@ -355,8 +355,14 @@ void pw3270_dbus_pa_key(PW3270Dbus *object, int key, DBusGMethodInvocation *cont |
355 | 355 | dbus_g_method_return(context,lib3270_get_field_start(pw3270_dbus_get_session_handle(object),baddr)); |
356 | 356 | } |
357 | 357 | |
358 | -void pw3270_dbus_get_field_length(PW3270Dbus *object, int baddr, DBusGMethodInvocation *context) | |
358 | + void pw3270_dbus_get_field_length(PW3270Dbus *object, int baddr, DBusGMethodInvocation *context) | |
359 | 359 | { |
360 | 360 | trace("%s object=%p context=%p",__FUNCTION__,object,context); |
361 | 361 | dbus_g_method_return(context,lib3270_get_field_len(pw3270_dbus_get_session_handle(object),baddr)); |
362 | 362 | } |
363 | + | |
364 | + void pw3270_dbus_get_next_unprotected(PW3270Dbus *object, int baddr, DBusGMethodInvocation *context) | |
365 | + { | |
366 | + trace("%s object=%p context=%p",__FUNCTION__,object,context); | |
367 | + dbus_g_method_return(context,lib3270_get_next_unprotected(pw3270_dbus_get_session_handle(object),baddr)); | |
368 | + } | ... | ... |
src/plugins/dbus3270/pw3270dbus.xml
... | ... | @@ -93,6 +93,11 @@ |
93 | 93 | <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> |
94 | 94 | <arg type="i" name="addr" direction="out" /> |
95 | 95 | </method> |
96 | + <method name="getNextUnprotected"> | |
97 | + <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> | |
98 | + <arg type="i" name="addr" direction="in" /> | |
99 | + <arg type="i" name="result" direction="out" /> | |
100 | + </method> | |
96 | 101 | <method name="setToggle"> |
97 | 102 | <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> |
98 | 103 | <arg type="i" name="id" direction="in" /> | ... | ... |
src/plugins/dbus3270/service.h
... | ... | @@ -87,6 +87,7 @@ |
87 | 87 | |
88 | 88 | void pw3270_dbus_get_field_start(PW3270Dbus *object, int baddr, DBusGMethodInvocation *context); |
89 | 89 | void pw3270_dbus_get_field_length(PW3270Dbus *object, int baddr, DBusGMethodInvocation *context); |
90 | + void pw3270_dbus_get_next_unprotected(PW3270Dbus *object, int baddr, DBusGMethodInvocation *context); | |
90 | 91 | |
91 | 92 | // Actions |
92 | 93 | void pw3270_dbus_enter(PW3270Dbus *object, DBusGMethodInvocation *context); | ... | ... |
src/plugins/hllapi/pluginmain.c
... | ... | @@ -294,6 +294,11 @@ |
294 | 294 | ((struct hllapi_packet_addr *) source->buffer)->addr)); |
295 | 295 | break; |
296 | 296 | |
297 | + case HLLAPI_PACKET_NEXT_UNPROTECTED: | |
298 | + send_result(source,lib3270_get_next_unprotected(lib3270_get_default_session_handle(), | |
299 | + ((struct hllapi_packet_addr *) source->buffer)->addr)); | |
300 | + break; | |
301 | + | |
297 | 302 | default: |
298 | 303 | send_result(source, EINVAL); |
299 | 304 | g_message("Invalid remote request (id=%d)",source->buffer[0]); | ... | ... |
src/plugins/rx3270/local.cc
... | ... | @@ -86,6 +86,7 @@ |
86 | 86 | |
87 | 87 | int get_field_start(int baddr = -1); |
88 | 88 | int get_field_len(int baddr = -1); |
89 | + int get_next_unprotected(int baddr = -1); | |
89 | 90 | |
90 | 91 | private: |
91 | 92 | |
... | ... | @@ -112,6 +113,7 @@ |
112 | 113 | int (*_set_cursor_addr)(H3270 *h, int addr); |
113 | 114 | int (*_get_cursor_addr)(H3270 *h); |
114 | 115 | int (*_emulate_input)(H3270 *session, const char *s, int len, int pasting); |
116 | + int (*_get_next_unprotected)(H3270 *hSession, int baddr0); | |
115 | 117 | |
116 | 118 | #ifdef WIN32 |
117 | 119 | HMODULE hModule; |
... | ... | @@ -244,6 +246,7 @@ dynamic::dynamic() |
244 | 246 | { (void **) & _set_cursor_addr, "lib3270_set_cursor_address" }, |
245 | 247 | { (void **) & _get_cursor_addr, "lib3270_get_cursor_address" }, |
246 | 248 | { (void **) & _emulate_input, "lib3270_emulate_input" }, |
249 | + { (void **) & _get_next_unprotected, "lib3270_get_next_unprotected" }, | |
247 | 250 | |
248 | 251 | }; |
249 | 252 | |
... | ... | @@ -562,3 +565,10 @@ int dynamic::emulate_input(const char *str) |
562 | 565 | return _emulate_input(hSession,str,-1,1); |
563 | 566 | return -1; |
564 | 567 | } |
568 | + | |
569 | +int dynamic::get_next_unprotected(int baddr) | |
570 | +{ | |
571 | + if(hModule) | |
572 | + return _get_next_unprotected(hSession,baddr); | |
573 | + return -1; | |
574 | +} | ... | ... |
src/plugins/rx3270/pluginmain.cc
... | ... | @@ -99,6 +99,7 @@ |
99 | 99 | |
100 | 100 | int get_field_start(int baddr = -1); |
101 | 101 | int get_field_len(int baddr = -1); |
102 | + int get_next_unprotected(int baddr = -1); | |
102 | 103 | |
103 | 104 | int set_copy(const char *text); |
104 | 105 | char * get_copy(void); |
... | ... | @@ -300,6 +301,11 @@ |
300 | 301 | return lib3270_emulate_input(hSession, str, -1, 1); |
301 | 302 | } |
302 | 303 | |
304 | + int plugin::get_next_unprotected(int baddr) | |
305 | + { | |
306 | + return lib3270_get_next_unprotected(hSession,baddr); | |
307 | + } | |
308 | + | |
303 | 309 | static int REXXENTRY Rexx_IO_exit(RexxExitContext *context, int exitnumber, int subfunction, PEXIT parmBlock) |
304 | 310 | { |
305 | 311 | trace("%s call with ExitNumber: %d Subfunction: %d",__FUNCTION__,(int) exitnumber, (int) subfunction); | ... | ... |
src/plugins/rx3270/remote.cc
... | ... | @@ -81,6 +81,7 @@ |
81 | 81 | |
82 | 82 | int get_field_start(int baddr = -1); |
83 | 83 | int get_field_len(int baddr = -1); |
84 | + int get_next_unprotected(int baddr = -1); | |
84 | 85 | |
85 | 86 | private: |
86 | 87 | #if defined(WIN32) |
... | ... | @@ -1125,3 +1126,32 @@ int remote::get_cursor_addr(void) |
1125 | 1126 | |
1126 | 1127 | #endif |
1127 | 1128 | } |
1129 | + | |
1130 | +int remote::get_next_unprotected(int baddr) | |
1131 | +{ | |
1132 | +#if defined(WIN32) | |
1133 | + | |
1134 | + if(hPipe != INVALID_HANDLE_VALUE) | |
1135 | + { | |
1136 | + struct hllapi_packet_addr query = { HLLAPI_PACKET_NEXT_UNPROTECTED, (unsigned short) baddr }; | |
1137 | + struct hllapi_packet_result response; | |
1138 | + DWORD cbSize = sizeof(query); | |
1139 | + TransactNamedPipe(hPipe,(LPVOID) &query, cbSize, &response, sizeof(response), &cbSize,NULL); | |
1140 | + return response.rc; | |
1141 | + } | |
1142 | + | |
1143 | +#elif defined(HAVE_DBUS) | |
1144 | + | |
1145 | + dbus_int32_t k = (dbus_int32_t) baddr; | |
1146 | + | |
1147 | + DBusMessage * msg = create_message("getNextUnprotected"); | |
1148 | + if(msg) | |
1149 | + { | |
1150 | + dbus_message_append_args(msg, DBUS_TYPE_INT32, &k, DBUS_TYPE_INVALID); | |
1151 | + return get_intval(call(msg)); | |
1152 | + } | |
1153 | + | |
1154 | +#endif | |
1155 | + | |
1156 | + return -1; | |
1157 | +} | ... | ... |
src/plugins/rx3270/rexx_methods.cc
... | ... | @@ -411,6 +411,19 @@ RexxMethod2(int, rx3270_method_get_field_start, CSELF, sessionPtr, OPTIONAL_int, |
411 | 411 | return hSession->get_field_start(baddr)+1; |
412 | 412 | } |
413 | 413 | |
414 | +RexxMethod2(int, rx3270_method_get_next_unprotected, CSELF, sessionPtr, OPTIONAL_int, baddr) | |
415 | +{ | |
416 | + rx3270 *hSession = (rx3270 *) sessionPtr; | |
417 | + if(!hSession) | |
418 | + return -1; | |
419 | + | |
420 | + baddr = hSession->get_next_unprotected(baddr); | |
421 | + if(baddr < 1) | |
422 | + return -1; | |
423 | + | |
424 | + return baddr; | |
425 | +} | |
426 | + | |
414 | 427 | RexxMethod1(RexxStringObject, rx3270_method_get_selection, CSELF, sessionPtr) |
415 | 428 | { |
416 | 429 | rx3270 * hSession = (rx3270 *) sessionPtr; | ... | ... |
src/plugins/rx3270/rx3270.cls
... | ... | @@ -74,6 +74,7 @@ |
74 | 74 | |
75 | 75 | ::METHOD GETFIELDSTART EXTERNAL "LIBRARY rx3270 rx3270_method_get_field_start" |
76 | 76 | ::METHOD GETFIELDLEN EXTERNAL "LIBRARY rx3270 rx3270_method_get_field_len" |
77 | +::METHOD GETNEXTUNPROTECTED EXTERNAL "LIBRARY rx3270 rx3270_method_get_next_unprotected" | |
77 | 78 | |
78 | 79 | ::METHOD GETSELECTION EXTERNAL "LIBRARY rx3270 rx3270_method_get_selection" |
79 | 80 | ::METHOD SETSELECTION EXTERNAL "LIBRARY rx3270 rx3270_method_set_selection" | ... | ... |
src/plugins/rx3270/rx3270.h
... | ... | @@ -109,6 +109,7 @@ |
109 | 109 | REXX_METHOD_PROTOTYPE(rx3270_method_wait_for_text_at); |
110 | 110 | REXX_METHOD_PROTOTYPE(rx3270_method_get_field_len); |
111 | 111 | REXX_METHOD_PROTOTYPE(rx3270_method_get_field_start); |
112 | + REXX_METHOD_PROTOTYPE(rx3270_method_get_next_unprotected); | |
112 | 113 | REXX_METHOD_PROTOTYPE(rx3270_method_get_selection); |
113 | 114 | REXX_METHOD_PROTOTYPE(rx3270_method_set_selection); |
114 | 115 | REXX_METHOD_PROTOTYPE(rx3270_method_get_clipboard); |
... | ... | @@ -188,6 +189,7 @@ |
188 | 189 | |
189 | 190 | virtual int get_field_start(int baddr = -1) = 0; |
190 | 191 | virtual int get_field_len(int baddr = -1) = 0; |
192 | + virtual int get_next_unprotected(int baddr = -1) = 0; | |
191 | 193 | |
192 | 194 | virtual int set_copy(const char *text); |
193 | 195 | virtual char * get_copy(void); | ... | ... |
src/plugins/rx3270/rxapimain.cc
... | ... | @@ -147,6 +147,7 @@ RexxMethodEntry rx3270_methods[] = |
147 | 147 | |
148 | 148 | REXX_METHOD(rx3270_method_get_field_len, rx3270_method_get_field_len ), |
149 | 149 | REXX_METHOD(rx3270_method_get_field_start, rx3270_method_get_field_start ), |
150 | + REXX_METHOD(rx3270_method_get_next_unprotected, rx3270_method_get_next_unprotected ), | |
150 | 151 | REXX_METHOD(rx3270_method_get_selection, rx3270_method_get_selection ), |
151 | 152 | REXX_METHOD(rx3270_method_set_selection, rx3270_method_set_selection ), |
152 | 153 | REXX_METHOD(rx3270_method_get_clipboard, rx3270_method_get_clipboard ), | ... | ... |
src/plugins/rx3270/sample/clipboard.rex
... | ... | @@ -26,10 +26,16 @@ |
26 | 26 | return 0 |
27 | 27 | end |
28 | 28 | |
29 | + cursor = host~GetCursorAddr() | |
30 | + next = cursor | |
31 | + | |
29 | 32 | while text <> "" |
30 | 33 | do |
34 | + addr = host~GetFieldStart(next) | |
35 | + next = host~GetNextUnprotected(addr) | |
36 | + | |
37 | + host~SetCursorAddr(addr) | |
31 | 38 | |
32 | - host~SetCursorAddr(host~GetFieldStart()) | |
33 | 39 | field_len = host~GetFieldLen() |
34 | 40 | |
35 | 41 | if length(text) < field_len then |
... | ... | @@ -64,6 +70,12 @@ |
64 | 70 | |
65 | 71 | say text |
66 | 72 | |
73 | + if next <= cursor then | |
74 | + do | |
75 | + /* Next field is before the original position */ | |
76 | + leave | |
77 | + end | |
78 | + | |
67 | 79 | text = "" |
68 | 80 | end |
69 | 81 | ... | ... |