Commit a6878485db50fbd4f5f593caf96eb5c775b6bba3
1 parent
5636dd03
Exists in
master
and in
5 other branches
Implementando sinal quando algum elemento da OIA receb um click, incluindo trata…
…mento de ponteiros ao movimentar o mouse sobre a OIA
Showing
8 changed files
with
222 additions
and
98 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: 2012-12-27 15:43-0200\n" | |
8 | +"POT-Creation-Date: 2013-01-03 17:05-0200\n" | |
9 | 9 | "PO-Revision-Date: 2012-12-26 10:36-0200\n" |
10 | 10 | "Last-Translator: Perry Werneck <perry.werneck@gmail.com>\n" |
11 | 11 | "Language-Team: Português <>\n" |
... | ... | @@ -78,7 +78,7 @@ msgstr "%s: Tabulação verticao não suportada" |
78 | 78 | msgid "%s: unknown family %d" |
79 | 79 | msgstr "%s: Familia %d é inválida" |
80 | 80 | |
81 | -#: telnet.c:1146 | |
81 | +#: telnet.c:1164 | |
82 | 82 | #, c-format |
83 | 83 | msgid "%s:%d" |
84 | 84 | msgstr "%s:%d" |
... | ... | @@ -135,7 +135,7 @@ msgstr "<%s> precisa do atributo %s" |
135 | 135 | msgid "<%s> should be on toplevel" |
136 | 136 | msgstr "<%s> deve estar no primeiro nível" |
137 | 137 | |
138 | -#: telnet.c:3237 | |
138 | +#: telnet.c:3255 | |
139 | 139 | #, c-format |
140 | 140 | msgid "" |
141 | 141 | "<b>Connection state:</b> %s\n" |
... | ... | @@ -206,7 +206,7 @@ msgstr "Avblock" |
206 | 206 | msgid "BLKSIZE:" |
207 | 207 | msgstr "BLKSIZE:" |
208 | 208 | |
209 | -#: colors.c:376 | |
209 | +#: colors.c:393 | |
210 | 210 | msgid "Background" |
211 | 211 | msgstr "Fundo" |
212 | 212 | |
... | ... | @@ -214,7 +214,7 @@ msgstr "Fundo" |
214 | 214 | msgid "Bad winsock version" |
215 | 215 | msgstr "Versão winsock inválida" |
216 | 216 | |
217 | -#: colors.c:384 | |
217 | +#: colors.c:401 | |
218 | 218 | msgid "Black" |
219 | 219 | msgstr "Preto" |
220 | 220 | |
... | ... | @@ -226,7 +226,7 @@ msgstr "Completar com espaços" |
226 | 226 | msgid "Blinking Cursor" |
227 | 227 | msgstr "Cursor piscante" |
228 | 228 | |
229 | -#: colors.c:377 | |
229 | +#: colors.c:394 | |
230 | 230 | msgid "Blue" |
231 | 231 | msgstr "Azul" |
232 | 232 | |
... | ... | @@ -242,7 +242,7 @@ msgstr "Portal do Software Público Brasileiro" |
242 | 242 | msgid "Break" |
243 | 243 | msgstr "Break" |
244 | 244 | |
245 | -#: telnet.c:2112 | |
245 | +#: telnet.c:2130 | |
246 | 246 | msgid "Broken pipe" |
247 | 247 | msgstr "Conexão interrompida" |
248 | 248 | |
... | ... | @@ -398,11 +398,11 @@ msgstr "Tabela de tradução tem mais de 256 caracteres" |
398 | 398 | msgid "Clear" |
399 | 399 | msgstr "Limpar" |
400 | 400 | |
401 | -#: colors.c:507 | |
401 | +#: colors.c:525 | |
402 | 402 | msgid "Color scheme:" |
403 | 403 | msgstr "Tema de cores:" |
404 | 404 | |
405 | -#: colors.c:413 | |
405 | +#: colors.c:431 | |
406 | 406 | msgid "Color setup" |
407 | 407 | msgstr "Configuração de cores" |
408 | 408 | |
... | ... | @@ -418,7 +418,7 @@ msgstr "Completo" |
418 | 418 | msgid "Connect on startup" |
419 | 419 | msgstr "Conectar ao iniciar" |
420 | 420 | |
421 | -#: telnet.c:2116 | |
421 | +#: telnet.c:2134 | |
422 | 422 | msgid "Connection reset by peer" |
423 | 423 | msgstr "Conexão foi cancelada pelo servidor" |
424 | 424 | |
... | ... | @@ -438,7 +438,7 @@ msgstr "Copiar como tabela" |
438 | 438 | msgid "Cross Hair Cursor" |
439 | 439 | msgstr "Cursor mira" |
440 | 440 | |
441 | -#: colors.c:401 | |
441 | +#: colors.c:418 | |
442 | 442 | msgid "Cross hair cursor" |
443 | 443 | msgstr "Cursor mira" |
444 | 444 | |
... | ... | @@ -447,7 +447,7 @@ msgstr "Cursor mira" |
447 | 447 | msgid "Current (%s)" |
448 | 448 | msgstr "Atual (%s)" |
449 | 449 | |
450 | -#: colors.c:294 | |
450 | +#: colors.c:311 | |
451 | 451 | msgid "Custom colors" |
452 | 452 | msgstr "Cores personalizadas" |
453 | 453 | |
... | ... | @@ -467,11 +467,11 @@ msgstr "Tamanho do b_uffer DFT:" |
467 | 467 | msgid "DS Trace" |
468 | 468 | msgstr "DS Trace" |
469 | 469 | |
470 | -#: colors.c:385 | |
470 | +#: colors.c:402 | |
471 | 471 | msgid "Dark Blue" |
472 | 472 | msgstr "Azul Escuro" |
473 | 473 | |
474 | -#: colors.c:388 | |
474 | +#: colors.c:405 | |
475 | 475 | msgid "Dark Green" |
476 | 476 | msgstr "Verde Escuro" |
477 | 477 | |
... | ... | @@ -495,7 +495,7 @@ msgstr "Padrão" |
495 | 495 | msgid "Delete field" |
496 | 496 | msgstr "Apagar campo" |
497 | 497 | |
498 | -#: telnet.c:1787 | |
498 | +#: telnet.c:1805 | |
499 | 499 | msgid "Device type rejected" |
500 | 500 | msgstr "Tipo de dispositivo rejeitado" |
501 | 501 | |
... | ... | @@ -503,7 +503,7 @@ msgstr "Tipo de dispositivo rejeitado" |
503 | 503 | msgid "Disconnected from host" |
504 | 504 | msgstr "Desconectado do servidor" |
505 | 505 | |
506 | -#: telnet.c:1362 | |
506 | +#: telnet.c:1380 | |
507 | 507 | msgid "EOR received when not in 3270 mode, ignored." |
508 | 508 | msgstr "EOR recebido fora do modo 3270, ignorado." |
509 | 509 | |
... | ... | @@ -570,12 +570,12 @@ msgstr "Erro \"%s\" gravando arquivo local (rc=%d)" |
570 | 570 | msgid "Error %d resolving %s" |
571 | 571 | msgstr "Erro %d resolvendo %s" |
572 | 572 | |
573 | -#: telnet.c:3100 telnet.c:3111 | |
573 | +#: telnet.c:3118 telnet.c:3129 | |
574 | 574 | #, c-format |
575 | 575 | msgid "Error in fcntl(%s) when setting non blocking mode" |
576 | 576 | msgstr "Erro em fcntl(%s) ao ativar o modo não blocante" |
577 | 577 | |
578 | -#: telnet.c:3090 | |
578 | +#: telnet.c:3108 | |
579 | 579 | #, c-format |
580 | 580 | msgid "Error in ioctl(%s) when setting no blocking mode" |
581 | 581 | msgstr "Erro em ioctl(%s) ao ativar o modo não blocante" |
... | ... | @@ -598,7 +598,7 @@ msgstr "Trace de eventos" |
598 | 598 | msgid "Extra CGCSGID(s), ignoring" |
599 | 599 | msgstr "Extra CGCSGID(s), ignoring" |
600 | 600 | |
601 | -#: colors.c:370 | |
601 | +#: colors.c:387 | |
602 | 602 | msgid "Field colors" |
603 | 603 | msgstr "Cor dos campos" |
604 | 604 | |
... | ... | @@ -634,11 +634,11 @@ msgstr "Barra de funções" |
634 | 634 | msgid "GTK Version mismatch" |
635 | 635 | msgstr "Divergência de versão GTK" |
636 | 636 | |
637 | -#: colors.c:391 | |
637 | +#: colors.c:408 | |
638 | 638 | msgid "Gray" |
639 | 639 | msgstr "Cinza" |
640 | 640 | |
641 | -#: colors.c:380 | |
641 | +#: colors.c:397 | |
642 | 642 | msgid "Green" |
643 | 643 | msgstr "Verde" |
644 | 644 | |
... | ... | @@ -679,7 +679,7 @@ msgstr "Ajuda" |
679 | 679 | msgid "Host disconnected, transfer cancelled" |
680 | 680 | msgstr "Servidor desconectou, transferência cancelada" |
681 | 681 | |
682 | -#: telnet.c:1845 | |
682 | +#: telnet.c:1863 | |
683 | 683 | msgid "Host illegally added function(s)" |
684 | 684 | msgstr "Host illegally added function(s)" |
685 | 685 | |
... | ... | @@ -691,11 +691,11 @@ msgstr "Servidor é AS_400" |
691 | 691 | msgid "Host is TSO" |
692 | 692 | msgstr "Servidor é TSO" |
693 | 693 | |
694 | -#: telnet.c:1770 | |
694 | +#: telnet.c:1788 | |
695 | 695 | msgid "Host rejected device type or request type" |
696 | 696 | msgstr "Servidor rejeitou o tipo de dispositivo ou requisição" |
697 | 697 | |
698 | -#: telnet.c:1783 | |
698 | +#: telnet.c:1801 | |
699 | 699 | msgid "Host rejected resource(s)" |
700 | 700 | msgstr "Servidor rejeitou recurso(s)" |
701 | 701 | |
... | ... | @@ -732,11 +732,11 @@ msgstr "Informações" |
732 | 732 | msgid "Input method" |
733 | 733 | msgstr "Método de entrada" |
734 | 734 | |
735 | -#: colors.c:396 | |
735 | +#: colors.c:413 | |
736 | 736 | msgid "Intensified/Protected" |
737 | 737 | msgstr "Intensificado/Protegido" |
738 | 738 | |
739 | -#: colors.c:394 | |
739 | +#: colors.c:411 | |
740 | 740 | msgid "Intensified/Unprotected" |
741 | 741 | msgstr "Intensificado/Desprotegido" |
742 | 742 | |
... | ... | @@ -787,7 +787,7 @@ msgstr "LRECL:" |
787 | 787 | msgid "Lateral keypad" |
788 | 788 | msgstr "Barra lateral" |
789 | 789 | |
790 | -#: colors.c:371 | |
790 | +#: colors.c:388 | |
791 | 791 | msgid "Misc colors" |
792 | 792 | msgstr "Cores diversas" |
793 | 793 | |
... | ... | @@ -820,7 +820,7 @@ msgstr "Múltiplos nomes de porta" |
820 | 820 | msgid "Must specify port for telnet proxy" |
821 | 821 | msgstr "Proxy telnet precisa de porta" |
822 | 822 | |
823 | -#: colors.c:390 | |
823 | +#: colors.c:407 | |
824 | 824 | msgid "Mustard" |
825 | 825 | msgstr "Mostarda" |
826 | 826 | |
... | ... | @@ -840,11 +840,11 @@ msgstr "Erro ao iniciar a rede" |
840 | 840 | msgid "Next field" |
841 | 841 | msgstr "Próximo campo" |
842 | 842 | |
843 | -#: colors.c:395 | |
843 | +#: colors.c:412 | |
844 | 844 | msgid "Normal/Protected" |
845 | 845 | msgstr "Normal/Protegido" |
846 | 846 | |
847 | -#: colors.c:393 | |
847 | +#: colors.c:410 | |
848 | 848 | msgid "Normal/Unprotected" |
849 | 849 | msgstr "Normal/Desprotegido" |
850 | 850 | |
... | ... | @@ -856,23 +856,28 @@ msgstr "Não disponível" |
856 | 856 | msgid "Not in 3270 mode, transfer cancelled" |
857 | 857 | msgstr "Não está no modo 3270, transferência cancelada" |
858 | 858 | |
859 | -#: colors.c:404 | |
859 | +#: colors.c:425 | |
860 | +#, fuzzy | |
861 | +msgid "OIA Warning" | |
862 | +msgstr "Alerta 3270" | |
863 | + | |
864 | +#: colors.c:421 | |
860 | 865 | msgid "OIA background" |
861 | 866 | msgstr "Fundo da OIA" |
862 | 867 | |
863 | -#: colors.c:405 | |
868 | +#: colors.c:422 | |
864 | 869 | msgid "OIA foreground" |
865 | 870 | msgstr "Frente da OIA" |
866 | 871 | |
867 | -#: colors.c:406 | |
872 | +#: colors.c:423 | |
868 | 873 | msgid "OIA separator" |
869 | 874 | msgstr "Separador da OIA" |
870 | 875 | |
871 | -#: colors.c:408 | |
876 | +#: colors.c:426 | |
872 | 877 | msgid "OIA status invalid" |
873 | 878 | msgstr "Estado inválido na OIA" |
874 | 879 | |
875 | -#: colors.c:407 | |
880 | +#: colors.c:424 | |
876 | 881 | msgid "OIA status ok" |
877 | 882 | msgstr "Estado normal na OIA" |
878 | 883 | |
... | ... | @@ -885,7 +890,7 @@ msgstr "Opção não suportada: '%c:'" |
885 | 890 | msgid "Options" |
886 | 891 | msgstr "Opções" |
887 | 892 | |
888 | -#: colors.c:386 | |
893 | +#: colors.c:403 | |
889 | 894 | msgid "Orange" |
890 | 895 | msgstr "Laranja" |
891 | 896 | |
... | ... | @@ -1042,7 +1047,7 @@ msgstr "Colar com margem esquerda" |
1042 | 1047 | msgid "Path to application data files" |
1043 | 1048 | msgstr "Path to application data files" |
1044 | 1049 | |
1045 | -#: colors.c:379 | |
1050 | +#: colors.c:396 | |
1046 | 1051 | msgid "Pink" |
1047 | 1052 | msgstr "Rosa" |
1048 | 1053 | |
... | ... | @@ -1082,7 +1087,7 @@ msgstr "Configurações de impressão" |
1082 | 1087 | msgid "Progress" |
1083 | 1088 | msgstr "Progresso" |
1084 | 1089 | |
1085 | -#: colors.c:387 | |
1090 | +#: colors.c:404 | |
1086 | 1091 | msgid "Purple" |
1087 | 1092 | msgstr "Púrpura" |
1088 | 1093 | |
... | ... | @@ -1174,7 +1179,7 @@ msgstr "Receber arquivo do servidor" |
1174 | 1179 | msgid "Record format" |
1175 | 1180 | msgstr "Formato de registro" |
1176 | 1181 | |
1177 | -#: colors.c:378 | |
1182 | +#: colors.c:395 | |
1178 | 1183 | msgid "Red" |
1179 | 1184 | msgstr "Vermelho" |
1180 | 1185 | |
... | ... | @@ -1326,15 +1331,15 @@ msgstr "SOCKS5 Proxy: xmit version 5 nmethods 1 (no auth)\n" |
1326 | 1331 | msgid "SOCKS5 proxy: %s/%u: %s" |
1327 | 1332 | msgstr "SOCKS5 proxy: %s/%u: %s" |
1328 | 1333 | |
1329 | -#: telnet.c:3235 | |
1334 | +#: telnet.c:3253 | |
1330 | 1335 | msgid "SSL Connect error" |
1331 | 1336 | msgstr "Erro na conexão SSL" |
1332 | 1337 | |
1333 | -#: telnet.c:1129 | |
1338 | +#: telnet.c:1147 | |
1334 | 1339 | msgid "SSL Error" |
1335 | 1340 | msgstr "Erro SSL" |
1336 | 1341 | |
1337 | -#: telnet.c:1129 | |
1342 | +#: telnet.c:1147 | |
1338 | 1343 | msgid "SSL Read error" |
1339 | 1344 | msgstr "Erro de leitura SSL" |
1340 | 1345 | |
... | ... | @@ -1354,7 +1359,7 @@ msgstr "Inicialização SSL falhou" |
1354 | 1359 | msgid "SSL_set_fd failed!" |
1355 | 1360 | msgstr "SSL_set_fd falhou!" |
1356 | 1361 | |
1357 | -#: telnet.c:2102 | |
1362 | +#: telnet.c:2120 | |
1358 | 1363 | #, c-format |
1359 | 1364 | msgid "" |
1360 | 1365 | "SSL_write:\n" |
... | ... | @@ -1431,11 +1436,11 @@ msgstr "Selecione fonte" |
1431 | 1436 | msgid "Select hostname" |
1432 | 1437 | msgstr "Selecione host" |
1433 | 1438 | |
1434 | -#: colors.c:398 | |
1439 | +#: colors.c:415 | |
1435 | 1440 | msgid "Selection background" |
1436 | 1441 | msgstr "Fundo da seleção" |
1437 | 1442 | |
1438 | -#: colors.c:399 | |
1443 | +#: colors.c:416 | |
1439 | 1444 | msgid "Selection foreground" |
1440 | 1445 | msgstr "Frente da seleção" |
1441 | 1446 | |
... | ... | @@ -1479,11 +1484,11 @@ msgstr "Mostrar padrão de teste" |
1479 | 1484 | msgid "Smart paste" |
1480 | 1485 | msgstr "Colar inteligente" |
1481 | 1486 | |
1482 | -#: telnet.c:1150 | |
1487 | +#: telnet.c:1168 | |
1483 | 1488 | msgid "Socket read error" |
1484 | 1489 | msgstr "Erro ao ler dados da rede" |
1485 | 1490 | |
1486 | -#: telnet.c:2123 | |
1491 | +#: telnet.c:2141 | |
1487 | 1492 | msgid "Socket write error" |
1488 | 1493 | msgstr "Erro ao enviar dados para a rede" |
1489 | 1494 | |
... | ... | @@ -1507,7 +1512,7 @@ msgstr "Tipo de servidor:" |
1507 | 1512 | msgid "TELNET Proxy: send error" |
1508 | 1513 | msgstr "TELNET Proxy: send error" |
1509 | 1514 | |
1510 | -#: telnet.c:3284 | |
1515 | +#: telnet.c:3302 | |
1511 | 1516 | msgid "TLS negotiation failure" |
1512 | 1517 | msgstr "Negociação TLS falhou" |
1513 | 1518 | |
... | ... | @@ -1515,7 +1520,7 @@ msgstr "Negociação TLS falhou" |
1515 | 1520 | msgid "T_otal" |
1516 | 1521 | msgstr "T_otal" |
1517 | 1522 | |
1518 | -#: colors.c:369 | |
1523 | +#: colors.c:386 | |
1519 | 1524 | msgid "Terminal colors" |
1520 | 1525 | msgstr "Cores do terminal" |
1521 | 1526 | |
... | ... | @@ -1603,7 +1608,7 @@ msgstr "Opções de transferência" |
1603 | 1608 | msgid "Transmission error" |
1604 | 1609 | msgstr "Erro de transmissão" |
1605 | 1610 | |
1606 | -#: colors.c:381 colors.c:389 | |
1611 | +#: colors.c:398 colors.c:406 | |
1607 | 1612 | msgid "Turquoise" |
1608 | 1613 | msgstr "Turquesa" |
1609 | 1614 | |
... | ... | @@ -1778,7 +1783,7 @@ msgstr "Aguardando resposta do pedido de upload" |
1778 | 1783 | msgid "Western Europe (ISO 8859-1)" |
1779 | 1784 | msgstr "Europa ocidental (ISO 8859-1)" |
1780 | 1785 | |
1781 | -#: colors.c:383 | |
1786 | +#: colors.c:400 | |
1782 | 1787 | msgid "White" |
1783 | 1788 | msgstr "Branco" |
1784 | 1789 | |
... | ... | @@ -1790,51 +1795,51 @@ msgstr "Janela" |
1790 | 1795 | msgid "Windows Western languages (CP1252)" |
1791 | 1796 | msgstr "Windows ocidental (CP1252)" |
1792 | 1797 | |
1793 | -#: v3270/oia.c:411 v3270/oia.c:435 v3270/oia.c:439 | |
1798 | +#: v3270/oia.c:420 v3270/oia.c:444 v3270/oia.c:448 | |
1794 | 1799 | msgid "X" |
1795 | 1800 | msgstr "X" |
1796 | 1801 | |
1797 | -#: v3270/oia.c:415 | |
1802 | +#: v3270/oia.c:424 | |
1798 | 1803 | msgid "X -f" |
1799 | 1804 | msgstr "X -f" |
1800 | 1805 | |
1801 | -#: v3270/oia.c:447 | |
1806 | +#: v3270/oia.c:456 | |
1802 | 1807 | msgid "X Connecting" |
1803 | 1808 | msgstr "X Conectando" |
1804 | 1809 | |
1805 | -#: v3270/oia.c:431 | |
1810 | +#: v3270/oia.c:440 | |
1806 | 1811 | msgid "X Inhibit" |
1807 | 1812 | msgstr "X Inibido" |
1808 | 1813 | |
1809 | -#: v3270/oia.c:407 | |
1814 | +#: v3270/oia.c:416 | |
1810 | 1815 | msgid "X Not Connected" |
1811 | 1816 | msgstr "X Desconectado" |
1812 | 1817 | |
1813 | -#: v3270/oia.c:423 | |
1818 | +#: v3270/oia.c:432 | |
1814 | 1819 | msgid "X Numeric" |
1815 | 1820 | msgstr "X Numérico" |
1816 | 1821 | |
1817 | -#: v3270/oia.c:427 | |
1822 | +#: v3270/oia.c:436 | |
1818 | 1823 | msgid "X Overflow" |
1819 | 1824 | msgstr "X Estouro" |
1820 | 1825 | |
1821 | -#: v3270/oia.c:419 | |
1826 | +#: v3270/oia.c:428 | |
1822 | 1827 | msgid "X Protected" |
1823 | 1828 | msgstr "X Protegido" |
1824 | 1829 | |
1825 | -#: v3270/oia.c:443 | |
1830 | +#: v3270/oia.c:452 | |
1826 | 1831 | msgid "X Resolving" |
1827 | 1832 | msgstr "X Resolvendo" |
1828 | 1833 | |
1829 | -#: v3270/oia.c:395 | |
1834 | +#: v3270/oia.c:404 | |
1830 | 1835 | msgid "X System" |
1831 | 1836 | msgstr "X Sistema" |
1832 | 1837 | |
1833 | -#: v3270/oia.c:399 | |
1838 | +#: v3270/oia.c:408 | |
1834 | 1839 | msgid "X Wait" |
1835 | 1840 | msgstr "X Aguarde" |
1836 | 1841 | |
1837 | -#: colors.c:382 | |
1842 | +#: colors.c:399 | |
1838 | 1843 | msgid "Yellow" |
1839 | 1844 | msgstr "Amarelo" |
1840 | 1845 | |
... | ... | @@ -1964,7 +1969,7 @@ msgstr "socket" |
1964 | 1969 | msgid "translator-credits" |
1965 | 1970 | msgstr "translator-credits" |
1966 | 1971 | |
1967 | -#: telnet.c:1125 | |
1972 | +#: telnet.c:1143 | |
1968 | 1973 | msgid "unknown error" |
1969 | 1974 | msgstr "Erro desconhecido" |
1970 | 1975 | ... | ... |
src/include/pw3270/v3270.h
src/pw3270/v3270/genmarshal
src/pw3270/v3270/mouse.c
... | ... | @@ -128,28 +128,49 @@ void v3270_emit_popup(v3270 *widget, int baddr, GdkEventButton *event) |
128 | 128 | gdk_beep(); |
129 | 129 | } |
130 | 130 | |
131 | -gboolean v3270_button_press_event(GtkWidget *widget, GdkEventButton *event) | |
131 | +static V3270_OIA_FIELD get_field_from_event(v3270 *widget, GdkEventButton *event) | |
132 | 132 | { |
133 | - int baddr = v3270_get_offset_at_point(GTK_V3270(widget),event->x,event->y); | |
133 | + if(event->y >= widget->oia_rect->y) | |
134 | + { | |
135 | + V3270_OIA_FIELD f; | |
134 | 136 | |
135 | - if(baddr < 0) | |
136 | - return FALSE; | |
137 | + for(f=0;f<V3270_OIA_FIELD_COUNT;f++) | |
138 | + { | |
139 | + if(event->x >= widget->oia_rect[f].x && event->x <= (widget->oia_rect[f].x+widget->oia_rect[f].width)) | |
140 | + return f; | |
141 | + } | |
142 | + } | |
137 | 143 | |
138 | -// trace("%s button=%d type=%d",__FUNCTION__,event->button,event->type); | |
144 | + return V3270_OIA_FIELD_INVALID; | |
145 | +} | |
139 | 146 | |
140 | - switch(event->button) | |
147 | +gboolean v3270_button_press_event(GtkWidget *widget, GdkEventButton *event) | |
148 | +{ | |
149 | + int baddr = v3270_get_offset_at_point(GTK_V3270(widget),event->x,event->y); | |
150 | + | |
151 | + if(baddr >= 0) | |
141 | 152 | { |
142 | - case 1: // Left button | |
143 | - button_1_press(widget,event->type,baddr); | |
144 | - break; | |
153 | + GTK_V3270(widget)->selected_field = V3270_OIA_FIELD_INVALID; | |
145 | 154 | |
146 | - case 3: // Right button | |
147 | - if(event->type == GDK_BUTTON_PRESS) | |
148 | - v3270_emit_popup(GTK_V3270(widget),baddr,event); | |
149 | - break; | |
155 | + switch(event->button) | |
156 | + { | |
157 | + case 1: // Left button | |
158 | + button_1_press(widget,event->type,baddr); | |
159 | + break; | |
150 | 160 | |
151 | - default: | |
152 | - trace("%s button=%d type=%d",__FUNCTION__,event->button,event->type); | |
161 | + case 3: // Right button | |
162 | + if(event->type == GDK_BUTTON_PRESS) | |
163 | + v3270_emit_popup(GTK_V3270(widget),baddr,event); | |
164 | + break; | |
165 | + | |
166 | + default: | |
167 | + trace("%s button=%d type=%d",__FUNCTION__,event->button,event->type); | |
168 | + } | |
169 | + } | |
170 | + else if(event->button == 1 && event->type == GDK_BUTTON_PRESS) | |
171 | + { | |
172 | + GTK_V3270(widget)->selected_field = get_field_from_event(GTK_V3270(widget),event); | |
173 | + trace("%s field=%d",__FUNCTION__,GTK_V3270(widget)->selected_field); | |
153 | 174 | } |
154 | 175 | |
155 | 176 | return FALSE; |
... | ... | @@ -163,24 +184,44 @@ gboolean v3270_button_release_event(GtkWidget *widget, GdkEventButton*event) |
163 | 184 | GTK_V3270(widget)->selecting = 0; |
164 | 185 | GTK_V3270(widget)->moving = 0; |
165 | 186 | GTK_V3270(widget)->resizing = 0; |
187 | + | |
188 | + if(GTK_V3270(widget)->selected_field != V3270_OIA_FIELD_INVALID && GTK_V3270(widget)->selected_field == get_field_from_event(GTK_V3270(widget),event)) | |
189 | + { | |
190 | + gboolean handled = FALSE; | |
191 | + | |
192 | + trace("%s field %d was clicked event=%p",__FUNCTION__,GTK_V3270(widget)->selected_field,event); | |
193 | + | |
194 | + g_signal_emit(widget, v3270_widget_signal[SIGNAL_FIELD], 0, | |
195 | + lib3270_connected(GTK_V3270(widget)->host) ? TRUE : FALSE, | |
196 | + GTK_V3270(widget)->selected_field, | |
197 | + event, | |
198 | + &handled); | |
199 | + | |
200 | + trace("Handled: %s",handled ? "Yes": "No"); | |
201 | + | |
202 | + if(!handled) | |
203 | + gdk_beep(); | |
204 | + | |
205 | + } | |
206 | + | |
207 | + GTK_V3270(widget)->selected_field = V3270_OIA_FIELD_INVALID; | |
208 | + | |
166 | 209 | break; |
167 | 210 | |
168 | 211 | default: |
169 | 212 | trace("%s button=%d type=%d",__FUNCTION__,event->button,event->type); |
170 | 213 | } |
171 | 214 | |
172 | - | |
173 | 215 | return FALSE; |
174 | 216 | } |
175 | 217 | |
176 | - | |
177 | 218 | static void update_mouse_pointer(GtkWidget *widget, int baddr) |
178 | 219 | { |
179 | - v3270 *terminal = GTK_V3270(widget); | |
220 | + v3270 * terminal = GTK_V3270(widget); | |
221 | + int id = terminal->pointer; | |
180 | 222 | |
181 | 223 | if(baddr >= 0 && terminal->pointer_id == LIB3270_CURSOR_EDITABLE) |
182 | 224 | { |
183 | - int id = terminal->pointer; | |
184 | 225 | |
185 | 226 | switch(lib3270_get_selection_flags(terminal->host,baddr) & 0x8f) |
186 | 227 | { |
... | ... | @@ -225,9 +266,10 @@ static void update_mouse_pointer(GtkWidget *widget, int baddr) |
225 | 266 | |
226 | 267 | } |
227 | 268 | |
228 | - gdk_window_set_cursor(gtk_widget_get_window(widget),v3270_cursor[id]); | |
229 | 269 | } |
230 | 270 | |
271 | + gdk_window_set_cursor(gtk_widget_get_window(widget),v3270_cursor[id]); | |
272 | + | |
231 | 273 | } |
232 | 274 | |
233 | 275 | void v3270_update_mouse_pointer(GtkWidget *widget) |
... | ... | @@ -244,11 +286,20 @@ void v3270_update_mouse_pointer(GtkWidget *widget) |
244 | 286 | |
245 | 287 | gboolean v3270_motion_notify_event(GtkWidget *widget, GdkEventMotion *event) |
246 | 288 | { |
247 | - v3270 * terminal = GTK_V3270(widget); | |
248 | - int baddr = v3270_get_offset_at_point(terminal,event->x,event->y); | |
289 | + v3270 * terminal = GTK_V3270(widget); | |
290 | + int baddr; | |
291 | + | |
292 | + if(!lib3270_connected(terminal->host)) | |
293 | + { | |
294 | + gdk_window_set_cursor(gtk_widget_get_window(widget),v3270_cursor[V3270_CURSOR_PROTECTED]); | |
295 | + return FALSE; | |
296 | + } | |
297 | + | |
298 | + baddr = v3270_get_offset_at_point(terminal,event->x,event->y); | |
249 | 299 | |
250 | 300 | if(baddr >= 0) |
251 | 301 | { |
302 | + | |
252 | 303 | if(terminal->selecting) // Select region |
253 | 304 | { |
254 | 305 | lib3270_select_to(terminal->host,baddr); |
... | ... | @@ -263,6 +314,37 @@ gboolean v3270_motion_notify_event(GtkWidget *widget, GdkEventMotion *event) |
263 | 314 | update_mouse_pointer(widget,baddr); |
264 | 315 | } |
265 | 316 | } |
317 | + else if(event->y >= terminal->oia_rect->y) | |
318 | + { | |
319 | + int id = V3270_CURSOR_PROTECTED; | |
320 | + | |
321 | + if(event->x >= terminal->oia_rect[V3270_OIA_SSL].x && event->x <= (terminal->oia_rect[V3270_OIA_SSL].x + terminal->oia_rect[V3270_OIA_SSL].width)) | |
322 | + { | |
323 | + switch(lib3270_get_secure(terminal->host)) | |
324 | + { | |
325 | + case LIB3270_SSL_UNSECURE: /**< No secure connection */ | |
326 | + id = V3270_CURSOR_QUESTION; | |
327 | + break; | |
328 | + | |
329 | + case LIB3270_SSL_NEGOTIATING: /**< Negotiating SSL */ | |
330 | + id = V3270_CURSOR_WAITING; | |
331 | + break; | |
332 | + | |
333 | + case LIB3270_SSL_NEGOTIATED: /**< Connection secure, no CA or self-signed */ | |
334 | + id = V3270_CURSOR_QUESTION; | |
335 | + break; | |
336 | + | |
337 | + case LIB3270_SSL_SECURE: /**< Connection secure with CA check */ | |
338 | + id = V3270_CURSOR_QUESTION; | |
339 | + break; | |
340 | + | |
341 | + default: | |
342 | + id = V3270_CURSOR_LOCKED; | |
343 | + } | |
344 | + } | |
345 | + | |
346 | + gdk_window_set_cursor(gtk_widget_get_window(widget),v3270_cursor[id]); | |
347 | + } | |
266 | 348 | |
267 | 349 | return FALSE; |
268 | 350 | } | ... | ... |
src/pw3270/v3270/oia.c
... | ... | @@ -335,6 +335,13 @@ void v3270_draw_ssl_status(cairo_t *cr, H3270 *host, struct v3270_metrics *metri |
335 | 335 | bits = (unsigned char *) unlocked_bits; |
336 | 336 | break; |
337 | 337 | |
338 | + case LIB3270_SSL_NEGOTIATING: /**< Negotiating SSL */ | |
339 | + gdk_cairo_set_source_color(cr,color+V3270_COLOR_OIA_STATUS_WARNING); | |
340 | + width = unlocked_width; | |
341 | + height = unlocked_height; | |
342 | + bits = (unsigned char *) unlocked_bits; | |
343 | + break; | |
344 | + | |
338 | 345 | case LIB3270_SSL_NEGOTIATED: /**< Connection secure, no CA or self-signed */ |
339 | 346 | gdk_cairo_set_source_color(cr,color+V3270_COLOR_OIA_STATUS_WARNING); |
340 | 347 | width = negotiated_width; |
... | ... | @@ -342,7 +349,6 @@ void v3270_draw_ssl_status(cairo_t *cr, H3270 *host, struct v3270_metrics *metri |
342 | 349 | bits = (unsigned char *) negotiated_bits; |
343 | 350 | break; |
344 | 351 | |
345 | - | |
346 | 352 | case LIB3270_SSL_SECURE: /**< Connection secure with CA check */ |
347 | 353 | gdk_cairo_set_source_color(cr,color+V3270_COLOR_OIA_STATUS_OK); |
348 | 354 | width = locked_width; |
... | ... | @@ -350,19 +356,11 @@ void v3270_draw_ssl_status(cairo_t *cr, H3270 *host, struct v3270_metrics *metri |
350 | 356 | bits = (unsigned char *) locked_bits; |
351 | 357 | break; |
352 | 358 | |
353 | - case LIB3270_SSL_NEGOTIATING: /**< Negotiating SSL */ | |
354 | - gdk_cairo_set_source_color(cr,color+V3270_COLOR_OIA_STATUS_WARNING); | |
355 | - width = unlocked_width; | |
356 | - height = unlocked_height; | |
357 | - bits = (unsigned char *) unlocked_bits; | |
358 | - break; | |
359 | - | |
360 | 359 | default: |
361 | 360 | return; |
362 | 361 | |
363 | 362 | } |
364 | 363 | |
365 | - | |
366 | 364 | icon = cairo_image_surface_create_for_data( bits, |
367 | 365 | CAIRO_FORMAT_A1, |
368 | 366 | width,height, | ... | ... |
src/pw3270/v3270/private.h
... | ... | @@ -81,10 +81,12 @@ G_BEGIN_DECLS |
81 | 81 | SIGNAL_CLIPBOARD, |
82 | 82 | SIGNAL_CHANGED, |
83 | 83 | SIGNAL_MESSAGE, |
84 | + SIGNAL_FIELD, | |
84 | 85 | |
85 | 86 | LAST_SIGNAL |
86 | 87 | }; |
87 | 88 | |
89 | + | |
88 | 90 | /*--[ Globals ]--------------------------------------------------------------------------------------*/ |
89 | 91 | |
90 | 92 | #define V3270_CURSOR_UNPROTECTED LIB3270_CURSOR_EDITABLE |
... | ... | @@ -101,8 +103,9 @@ G_BEGIN_DECLS |
101 | 103 | #define V3270_CURSOR_SELECTION_BOTTOM LIB3270_CURSOR_USER+7 |
102 | 104 | #define V3270_CURSOR_SELECTION_LEFT LIB3270_CURSOR_USER+8 |
103 | 105 | #define V3270_CURSOR_SELECTION_RIGHT LIB3270_CURSOR_USER+9 |
106 | + #define V3270_CURSOR_QUESTION LIB3270_CURSOR_USER+10 | |
104 | 107 | |
105 | - #define V3270_CURSOR_COUNT LIB3270_CURSOR_USER+10 | |
108 | + #define V3270_CURSOR_COUNT LIB3270_CURSOR_USER+11 | |
106 | 109 | |
107 | 110 | |
108 | 111 | struct v3270_metrics |
... | ... | @@ -144,8 +147,10 @@ G_BEGIN_DECLS |
144 | 147 | gchar * clipboard; /**< Clipboard contents (text only) */ |
145 | 148 | |
146 | 149 | LIB3270_CURSOR pointer_id; |
147 | - unsigned char pointer; /** Mouse pointer ID */ | |
148 | - int selection_addr; /** Selection addr */ | |
150 | + unsigned char pointer; /**< Mouse pointer ID */ | |
151 | + int selection_addr; /**< Selection addr */ | |
152 | + | |
153 | + V3270_OIA_FIELD selected_field; /**< Clicked OIA field */ | |
149 | 154 | |
150 | 155 | // Font info |
151 | 156 | gchar * font_family; | ... | ... |
src/pw3270/v3270/widget.c
... | ... | @@ -333,6 +333,8 @@ static void v3270_class_init(v3270Class *klass) |
333 | 333 | // Cursors |
334 | 334 | { |
335 | 335 | #ifdef WIN32 |
336 | + // http://git.gnome.org/browse/gtk+/tree/gdk/win32/gdkcursor-win32.c | |
337 | + // http://www.functionx.com/win32/Lesson02b.htm | |
336 | 338 | static const gchar * cr[V3270_CURSOR_COUNT] = |
337 | 339 | { |
338 | 340 | "ibeam", // V3270_CURSOR_UNPROTECTED |
... | ... | @@ -348,6 +350,7 @@ static void v3270_class_init(v3270Class *klass) |
348 | 350 | "sizens", // V3270_CURSOR_SELECTION_BOTTOM |
349 | 351 | "sizewe", // V3270_CURSOR_SELECTION_LEFT |
350 | 352 | "sizewe", // V3270_CURSOR_SELECTION_RIGHT |
353 | + "help", // V3270_CURSOR_QUESTION | |
351 | 354 | }; |
352 | 355 | #else |
353 | 356 | static const int cr[V3270_CURSOR_COUNT] = |
... | ... | @@ -365,6 +368,7 @@ static void v3270_class_init(v3270Class *klass) |
365 | 368 | GDK_BOTTOM_SIDE, // V3270_CURSOR_SELECTION_BOTTOM |
366 | 369 | GDK_LEFT_SIDE, // V3270_CURSOR_SELECTION_LEFT |
367 | 370 | GDK_RIGHT_SIDE, // V3270_CURSOR_SELECTION_RIGHT |
371 | + GDK_QUESTION_ARROW, // V3270_CURSOR_QUESTION | |
368 | 372 | }; |
369 | 373 | #endif // WIN32 |
370 | 374 | |
... | ... | @@ -516,6 +520,15 @@ static void v3270_class_init(v3270Class *klass) |
516 | 520 | pw3270_VOID__VOID_UINT_POINTER_POINTER_POINTER, |
517 | 521 | G_TYPE_NONE, 4, G_TYPE_UINT, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING); |
518 | 522 | |
523 | + v3270_widget_signal[SIGNAL_FIELD] = | |
524 | + g_signal_new( "field_clicked", | |
525 | + G_OBJECT_CLASS_TYPE (gobject_class), | |
526 | + G_SIGNAL_RUN_LAST, | |
527 | + 0, | |
528 | + NULL, NULL, | |
529 | + pw3270_BOOL__VOID_BOOL_UINT_POINTER, | |
530 | + G_TYPE_BOOLEAN, 3, G_TYPE_BOOLEAN, G_TYPE_UINT, G_TYPE_POINTER); | |
531 | + | |
519 | 532 | } |
520 | 533 | |
521 | 534 | void v3270_update_font_metrics(v3270 *terminal, cairo_t *cr, int width, int height) | ... | ... |
src/pw3270/window.c
... | ... | @@ -471,6 +471,23 @@ |
471 | 471 | |
472 | 472 | } |
473 | 473 | |
474 | + static gboolean field_clicked(GtkWidget *terminal, gboolean connected, V3270_OIA_FIELD field, GdkEventButton *event) | |
475 | + { | |
476 | + trace("%s: %s field=%d event=%p",__FUNCTION__,connected ? "Connected" : "Disconnected", field, event); | |
477 | + | |
478 | + if(!connected) | |
479 | + return FALSE; | |
480 | + | |
481 | + if(field == V3270_OIA_SSL) | |
482 | + { | |
483 | + trace("%s: Show SSL connection info dialog",__FUNCTION__); | |
484 | + return TRUE; | |
485 | + } | |
486 | + | |
487 | + | |
488 | + return FALSE; | |
489 | + } | |
490 | + | |
474 | 491 | static void pw3270_init(pw3270 *widget) |
475 | 492 | { |
476 | 493 | static const UI_WIDGET_SETUP widget_setup[] = |
... | ... | @@ -576,6 +593,7 @@ |
576 | 593 | } |
577 | 594 | |
578 | 595 | // Connect widget signals |
596 | + g_signal_connect(widget->terminal,"field_clicked",G_CALLBACK(field_clicked),widget); | |
579 | 597 | g_signal_connect(widget->terminal,"toggle_changed",G_CALLBACK(toggle_changed),widget); |
580 | 598 | |
581 | 599 | // Connect window signals | ... | ... |