Commit dee1ba19c94f64ca3c75d21a090c2b889a747883
1 parent
30b329a7
Exists in
master
and in
5 other branches
Implementando sinal e callback para impressão do conteúdo da tela
Showing
8 changed files
with
73 additions
and
78 deletions
Show diff stats
po/pt_BR.po
@@ -5,8 +5,8 @@ msgid "" | @@ -5,8 +5,8 @@ msgid "" | ||
5 | msgstr "" | 5 | msgstr "" |
6 | "Project-Id-Version: pw3270 5.0\n" | 6 | "Project-Id-Version: pw3270 5.0\n" |
7 | "Report-Msgid-Bugs-To: \n" | 7 | "Report-Msgid-Bugs-To: \n" |
8 | -"POT-Creation-Date: 2013-03-06 09:33-0300\n" | ||
9 | -"PO-Revision-Date: 2013-02-25 14:46-0300\n" | 8 | +"POT-Creation-Date: 2013-03-11 11:24-0300\n" |
9 | +"PO-Revision-Date: 2013-03-11 11:30-0300\n" | ||
10 | "Last-Translator: Perry Werneck <perry.werneck@gmail.com>\n" | 10 | "Last-Translator: Perry Werneck <perry.werneck@gmail.com>\n" |
11 | "Language-Team: Português <>\n" | 11 | "Language-Team: Português <>\n" |
12 | "Language: pt_BR\n" | 12 | "Language: pt_BR\n" |
@@ -38,7 +38,7 @@ msgstr "Ação %s precisa de um valor válido" | @@ -38,7 +38,7 @@ msgstr "Ação %s precisa de um valor válido" | ||
38 | msgid "%s action needs src attribute" | 38 | msgid "%s action needs src attribute" |
39 | msgstr "Ação %s precisa do atributo src" | 39 | msgstr "Ação %s precisa do atributo src" |
40 | 40 | ||
41 | -#: main.c:86 | 41 | +#: main.c:88 |
42 | #, c-format | 42 | #, c-format |
43 | msgid "%s requires GTK version %d.%d.%d" | 43 | msgid "%s requires GTK version %d.%d.%d" |
44 | msgstr "%s requer GTK versão %d.%d.%d" | 44 | msgstr "%s requer GTK versão %d.%d.%d" |
@@ -83,7 +83,7 @@ msgstr "%s: Familia %d é inválida" | @@ -83,7 +83,7 @@ msgstr "%s: Familia %d é inválida" | ||
83 | msgid "%s:%d" | 83 | msgid "%s:%d" |
84 | msgstr "%s:%d" | 84 | msgstr "%s:%d" |
85 | 85 | ||
86 | -#: main.c:318 | 86 | +#: main.c:323 |
87 | msgid "- 3270 Emulator for Gtk" | 87 | msgid "- 3270 Emulator for Gtk" |
88 | msgstr "- Emulador 3270 para GTK" | 88 | msgstr "- Emulador 3270 para GTK" |
89 | 89 | ||
@@ -164,7 +164,7 @@ msgstr "" | @@ -164,7 +164,7 @@ msgstr "" | ||
164 | msgid "<b>SSL state is undefined</b>Unexpected SSL status %ld" | 164 | msgid "<b>SSL state is undefined</b>Unexpected SSL status %ld" |
165 | msgstr "<b>Estado do SSL é indefinido</b>Estado SSL inesperado %ld" | 165 | msgstr "<b>Estado do SSL é indefinido</b>Estado SSL inesperado %ld" |
166 | 166 | ||
167 | -#: main.c:338 | 167 | +#: main.c:343 |
168 | msgid "" | 168 | msgid "" |
169 | "<b>Valid options:</b>\n" | 169 | "<b>Valid options:</b>\n" |
170 | "\n" | 170 | "\n" |
@@ -217,7 +217,7 @@ msgid "An error occurred trying to allocate memory. This should never happen." | @@ -217,7 +217,7 @@ msgid "An error occurred trying to allocate memory. This should never happen." | ||
217 | msgstr "" | 217 | msgstr "" |
218 | "Ocorreu um erro ao tentar alocar memória. Isso nunca deveria acontecer." | 218 | "Ocorreu um erro ao tentar alocar memória. Isso nunca deveria acontecer." |
219 | 219 | ||
220 | -#: main.c:302 main.c:304 | 220 | +#: main.c:304 main.c:306 |
221 | msgid "Application name" | 221 | msgid "Application name" |
222 | msgstr "Nome da aplicação" | 222 | msgstr "Nome da aplicação" |
223 | 223 | ||
@@ -292,15 +292,15 @@ msgstr "Conexão interrompida" | @@ -292,15 +292,15 @@ msgstr "Conexão interrompida" | ||
292 | 292 | ||
293 | #: v3270/security.c:124 | 293 | #: v3270/security.c:124 |
294 | msgid "CRL has expired" | 294 | msgid "CRL has expired" |
295 | -msgstr "CRL has expired" | 295 | +msgstr "CRL expirou" |
296 | 296 | ||
297 | #: v3270/security.c:117 | 297 | #: v3270/security.c:117 |
298 | msgid "CRL is not yet valid" | 298 | msgid "CRL is not yet valid" |
299 | -msgstr "CRL is not yet valid" | 299 | +msgstr "CRL ainda não é válido" |
300 | 300 | ||
301 | #: v3270/security.c:96 | 301 | #: v3270/security.c:96 |
302 | msgid "CRL signature failure" | 302 | msgid "CRL signature failure" |
303 | -msgstr "CRL signature failure" | 303 | +msgstr "Erro na assinatura CRL" |
304 | 304 | ||
305 | #: dialog.c:109 | 305 | #: dialog.c:109 |
306 | msgid "C_haracter Coding:" | 306 | msgid "C_haracter Coding:" |
@@ -430,7 +430,7 @@ msgstr "Não foi possível criar um manipulador de socket" | @@ -430,7 +430,7 @@ msgstr "Não foi possível criar um manipulador de socket" | ||
430 | #: session.c:323 | 430 | #: session.c:323 |
431 | #, c-format | 431 | #, c-format |
432 | msgid "Cannot find charset \"%s\", using defaults" | 432 | msgid "Cannot find charset \"%s\", using defaults" |
433 | -msgstr "Não encontrei codificação \"%s\", usando defaults" | 433 | +msgstr "Não encontrei codificação \"%s\", usando padrão" |
434 | 434 | ||
435 | #: charset.c:660 | 435 | #: charset.c:660 |
436 | #, c-format | 436 | #, c-format |
@@ -443,7 +443,7 @@ msgstr "O certificado expirou" | @@ -443,7 +443,7 @@ msgstr "O certificado expirou" | ||
443 | 443 | ||
444 | #: v3270/security.c:103 | 444 | #: v3270/security.c:103 |
445 | msgid "Certificate is not yet valid" | 445 | msgid "Certificate is not yet valid" |
446 | -msgstr "Certificate is not yet valid" | 446 | +msgstr "O certificado ainda não é válido" |
447 | 447 | ||
448 | #: v3270/security.c:222 | 448 | #: v3270/security.c:222 |
449 | msgid "Certificate not trusted" | 449 | msgid "Certificate not trusted" |
@@ -722,7 +722,7 @@ msgstr "Tela cheia" | @@ -722,7 +722,7 @@ msgstr "Tela cheia" | ||
722 | msgid "Function bar" | 722 | msgid "Function bar" |
723 | msgstr "Barra de funções" | 723 | msgstr "Barra de funções" |
724 | 724 | ||
725 | -#: main.c:90 main.c:379 | 725 | +#: main.c:92 main.c:384 |
726 | msgid "GTK Version mismatch" | 726 | msgid "GTK Version mismatch" |
727 | msgstr "Divergência de versão GTK" | 727 | msgstr "Divergência de versão GTK" |
728 | 728 | ||
@@ -791,11 +791,11 @@ msgstr "Servidor rejeitou o tipo de dispositivo ou requisição" | @@ -791,11 +791,11 @@ msgstr "Servidor rejeitou o tipo de dispositivo ou requisição" | ||
791 | msgid "Host rejected resource(s)" | 791 | msgid "Host rejected resource(s)" |
792 | msgstr "Servidor rejeitou recurso(s)" | 792 | msgstr "Servidor rejeitou recurso(s)" |
793 | 793 | ||
794 | -#: main.c:310 | 794 | +#: main.c:312 |
795 | msgid "Host system type" | 795 | msgid "Host system type" |
796 | msgstr "Tipo do sistema no servidor" | 796 | msgstr "Tipo do sistema no servidor" |
797 | 797 | ||
798 | -#: main.c:308 | 798 | +#: main.c:310 |
799 | msgid "Host to connect" | 799 | msgid "Host to connect" |
800 | msgstr "Servidor a conectar" | 800 | msgstr "Servidor a conectar" |
801 | 801 | ||
@@ -814,7 +814,7 @@ msgstr "IBM S/390" | @@ -814,7 +814,7 @@ msgstr "IBM S/390" | ||
814 | 814 | ||
815 | #: v3270/widget.c:314 | 815 | #: v3270/widget.c:314 |
816 | msgid "Identity not verified" | 816 | msgid "Identity not verified" |
817 | -msgstr "Identity not verified" | 817 | +msgstr "Identidade não verificada" |
818 | 818 | ||
819 | #: ft_cut.c:508 | 819 | #: ft_cut.c:508 |
820 | msgid "Illegal frame length" | 820 | msgid "Illegal frame length" |
@@ -1007,15 +1007,15 @@ msgstr "Laranja" | @@ -1007,15 +1007,15 @@ msgstr "Laranja" | ||
1007 | 1007 | ||
1008 | #: hostdialog.c:44 | 1008 | #: hostdialog.c:44 |
1009 | msgid "Other (TSO)" | 1009 | msgid "Other (TSO)" |
1010 | -msgstr "Other (TSO)" | 1010 | +msgstr "Outro (TSO)" |
1011 | 1011 | ||
1012 | #: hostdialog.c:45 | 1012 | #: hostdialog.c:45 |
1013 | msgid "Other (VM/CMS)" | 1013 | msgid "Other (VM/CMS)" |
1014 | -msgstr "Other (VM/CMS)" | 1014 | +msgstr "Outro (VM/CMS)" |
1015 | 1015 | ||
1016 | #: v3270/security.c:159 | 1016 | #: v3270/security.c:159 |
1017 | msgid "Out of memory" | 1017 | msgid "Out of memory" |
1018 | -msgstr "Out of memory" | 1018 | +msgstr "Memória insuficiente" |
1019 | 1019 | ||
1020 | #: ui/10keypad.xml:138 | 1020 | #: ui/10keypad.xml:138 |
1021 | msgid "PA1" | 1021 | msgid "PA1" |
@@ -1125,7 +1125,7 @@ msgstr "PF8" | @@ -1125,7 +1125,7 @@ msgstr "PF8" | ||
1125 | msgid "PF9" | 1125 | msgid "PF9" |
1126 | msgstr "PF9" | 1126 | msgstr "PF9" |
1127 | 1127 | ||
1128 | -#: main.c:336 | 1128 | +#: main.c:341 |
1129 | msgid "Parse error" | 1129 | msgid "Parse error" |
1130 | msgstr "Erro de interpretação" | 1130 | msgstr "Erro de interpretação" |
1131 | 1131 | ||
@@ -1162,9 +1162,9 @@ msgstr "Colar com margem esquerda" | @@ -1162,9 +1162,9 @@ msgstr "Colar com margem esquerda" | ||
1162 | msgid "Path length constraint exceeded" | 1162 | msgid "Path length constraint exceeded" |
1163 | msgstr "Path length constraint exceeded" | 1163 | msgstr "Path length constraint exceeded" |
1164 | 1164 | ||
1165 | -#: main.c:305 | 1165 | +#: main.c:307 |
1166 | msgid "Path to application data files" | 1166 | msgid "Path to application data files" |
1167 | -msgstr "Path to application data files" | 1167 | +msgstr "Caminho para os arquivos de dados da aplicação" |
1168 | 1168 | ||
1169 | #: colors.c:396 | 1169 | #: colors.c:396 |
1170 | msgid "Pink" | 1170 | msgid "Pink" |
@@ -1565,11 +1565,11 @@ msgstr "Frente da seleção" | @@ -1565,11 +1565,11 @@ msgstr "Frente da seleção" | ||
1565 | 1565 | ||
1566 | #: v3270/security.c:166 | 1566 | #: v3270/security.c:166 |
1567 | msgid "Self signed certificate" | 1567 | msgid "Self signed certificate" |
1568 | -msgstr "Self signed certificate" | 1568 | +msgstr "Certificado auto assinada" |
1569 | 1569 | ||
1570 | #: v3270/security.c:173 | 1570 | #: v3270/security.c:173 |
1571 | msgid "Self signed certificate in certificate chain" | 1571 | msgid "Self signed certificate in certificate chain" |
1572 | -msgstr "Self signed certificate in certificate chain" | 1572 | +msgstr "Certificado auto assinado na cadeia de certificados" |
1573 | 1573 | ||
1574 | #: ui/00default.xml:277 | 1574 | #: ui/00default.xml:277 |
1575 | msgid "Send file" | 1575 | msgid "Send file" |
@@ -1579,7 +1579,7 @@ msgstr "Enviar arquivo" | @@ -1579,7 +1579,7 @@ msgstr "Enviar arquivo" | ||
1579 | msgid "Send file to host" | 1579 | msgid "Send file to host" |
1580 | msgstr "Enviar arquivo para o servidor" | 1580 | msgstr "Enviar arquivo para o servidor" |
1581 | 1581 | ||
1582 | -#: main.c:312 | 1582 | +#: main.c:317 |
1583 | msgid "Send messages to syslog" | 1583 | msgid "Send messages to syslog" |
1584 | msgstr "Send messages to syslog" | 1584 | msgstr "Send messages to syslog" |
1585 | 1585 | ||
@@ -1587,7 +1587,7 @@ msgstr "Send messages to syslog" | @@ -1587,7 +1587,7 @@ msgstr "Send messages to syslog" | ||
1587 | msgid "Send/Receive" | 1587 | msgid "Send/Receive" |
1588 | msgstr "Enviar/Receber" | 1588 | msgstr "Enviar/Receber" |
1589 | 1589 | ||
1590 | -#: main.c:307 | 1590 | +#: main.c:309 |
1591 | msgid "Session name" | 1591 | msgid "Session name" |
1592 | msgstr "Nome da sessão" | 1592 | msgstr "Nome da sessão" |
1593 | 1593 | ||
@@ -1595,10 +1595,18 @@ msgstr "Nome da sessão" | @@ -1595,10 +1595,18 @@ msgstr "Nome da sessão" | ||
1595 | msgid "Set hostname" | 1595 | msgid "Set hostname" |
1596 | msgstr "Selecione servidor" | 1596 | msgstr "Selecione servidor" |
1597 | 1597 | ||
1598 | -#: main.c:309 | 1598 | +#: main.c:311 |
1599 | msgid "Set reported colors (8/16)" | 1599 | msgid "Set reported colors (8/16)" |
1600 | msgstr "Define número de cores informadas (8/16)" | 1600 | msgstr "Define número de cores informadas (8/16)" |
1601 | 1601 | ||
1602 | +#: main.c:314 | ||
1603 | +msgid "Set toggles OFF" | ||
1604 | +msgstr "Desativa toggles" | ||
1605 | + | ||
1606 | +#: main.c:313 | ||
1607 | +msgid "Set toggles ON" | ||
1608 | +msgstr "Ativa toggles" | ||
1609 | + | ||
1602 | #: ui/00default.xml:329 | 1610 | #: ui/00default.xml:329 |
1603 | msgid "Settings" | 1611 | msgid "Settings" |
1604 | msgstr "Configurações" | 1612 | msgstr "Configurações" |
@@ -1874,7 +1882,7 @@ msgstr "" | @@ -1874,7 +1882,7 @@ msgstr "" | ||
1874 | "programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple " | 1882 | "programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple " |
1875 | "Place, Suite 330, Boston, MA, 02111-1307, USA" | 1883 | "Place, Suite 330, Boston, MA, 02111-1307, USA" |
1876 | 1884 | ||
1877 | -#: main.c:375 | 1885 | +#: main.c:380 |
1878 | #, c-format | 1886 | #, c-format |
1879 | msgid "This program requires GTK version %d.%d.%d" | 1887 | msgid "This program requires GTK version %d.%d.%d" |
1880 | msgstr "Este programa precisa do GTK versão %d.%d.%d" | 1888 | msgstr "Este programa precisa do GTK versão %d.%d.%d" |
@@ -2011,7 +2019,7 @@ msgstr "Atributo %s inesperado ou inválido: \"%s\"" | @@ -2011,7 +2019,7 @@ msgstr "Atributo %s inesperado ou inválido: \"%s\"" | ||
2011 | msgid "Unexpected or invalid attribute value \"%s\"" | 2019 | msgid "Unexpected or invalid attribute value \"%s\"" |
2012 | msgstr "Valor de attributo inesperado ou inválido: \"%s\"" | 2020 | msgstr "Valor de attributo inesperado ou inválido: \"%s\"" |
2013 | 2021 | ||
2014 | -#: main.c:191 | 2022 | +#: main.c:193 |
2015 | #, c-format | 2023 | #, c-format |
2016 | msgid "Unexpected or invalid color value \"%s\"" | 2024 | msgid "Unexpected or invalid color value \"%s\"" |
2017 | msgstr "Valor de cor inválido ou inesperado: \"%s\"" | 2025 | msgstr "Valor de cor inválido ou inesperado: \"%s\"" |
src/include/lib3270/session.h
@@ -412,6 +412,7 @@ | @@ -412,6 +412,7 @@ | ||
412 | void (*set_selection)(H3270 *session, unsigned char on); | 412 | void (*set_selection)(H3270 *session, unsigned char on); |
413 | void (*ctlr_done)(H3270 *session); | 413 | void (*ctlr_done)(H3270 *session); |
414 | void (*autostart)(H3270 *session); | 414 | void (*autostart)(H3270 *session); |
415 | + int (*print)(H3270 *session); | ||
415 | 416 | ||
416 | void (*message)(H3270 *session, LIB3270_NOTIFY id , const char *title, const char *message, const char *text); | 417 | void (*message)(H3270 *session, LIB3270_NOTIFY id , const char *title, const char *message, const char *text); |
417 | 418 |
src/lib3270/session.c
@@ -138,6 +138,12 @@ static void set_cursor(H3270 *session, LIB3270_CURSOR id) | @@ -138,6 +138,12 @@ static void set_cursor(H3270 *session, LIB3270_CURSOR id) | ||
138 | { | 138 | { |
139 | } | 139 | } |
140 | 140 | ||
141 | +static int print(H3270 *session) | ||
142 | +{ | ||
143 | + lib3270_write_log(session, "print", "%s", "Printing is unavailable"); | ||
144 | + return -1; | ||
145 | +} | ||
146 | + | ||
141 | static void message(H3270 *session, LIB3270_NOTIFY id , const char *title, const char *msg, const char *text) | 147 | static void message(H3270 *session, LIB3270_NOTIFY id , const char *title, const char *msg, const char *text) |
142 | { | 148 | { |
143 | #ifdef ANDROID | 149 | #ifdef ANDROID |
@@ -203,6 +209,7 @@ static void lib3270_session_init(H3270 *hSession, const char *model) | @@ -203,6 +209,7 @@ static void lib3270_session_init(H3270 *hSession, const char *model) | ||
203 | hSession->update_status = (void (*)(H3270 *, LIB3270_STATUS)) nop_int; | 209 | hSession->update_status = (void (*)(H3270 *, LIB3270_STATUS)) nop_int; |
204 | hSession->autostart = nop; | 210 | hSession->autostart = nop; |
205 | hSession->set_timer = set_timer; | 211 | hSession->set_timer = set_timer; |
212 | + hSession->print = print; | ||
206 | 213 | ||
207 | // Set the defaults. | 214 | // Set the defaults. |
208 | hSession->extended = 1; | 215 | hSession->extended = 1; |
src/lib3270/util.c
@@ -1020,5 +1020,7 @@ int gettimeofday(struct timeval *tv, void *ignored) | @@ -1020,5 +1020,7 @@ int gettimeofday(struct timeval *tv, void *ignored) | ||
1020 | 1020 | ||
1021 | LIB3270_EXPORT int lib3270_print(H3270 *h) | 1021 | LIB3270_EXPORT int lib3270_print(H3270 *h) |
1022 | { | 1022 | { |
1023 | - return -1; | 1023 | + CHECK_SESSION_HANDLE(h); |
1024 | + trace("%s(%p)",__FUNCTION__,h); | ||
1025 | + return h->print(h); | ||
1024 | } | 1026 | } |
src/pw3270/v3270/keyboard.c
@@ -79,10 +79,10 @@ | @@ -79,10 +79,10 @@ | ||
79 | { GDK_KP_Add, GDK_NUMLOCK_MASK, NULL, NULL }, | 79 | { GDK_KP_Add, GDK_NUMLOCK_MASK, NULL, NULL }, |
80 | { GDK_KP_Subtract, GDK_NUMLOCK_MASK, NULL, NULL }, | 80 | { GDK_KP_Subtract, GDK_NUMLOCK_MASK, NULL, NULL }, |
81 | 81 | ||
82 | - { GDK_3270_PrintScreen, 0, NULL, NULL }, | 82 | + { GDK_3270_PrintScreen, 0, lib3270_print, NULL }, |
83 | { GDK_Sys_Req, 0, lib3270_sysreq, NULL }, | 83 | { GDK_Sys_Req, 0, lib3270_sysreq, NULL }, |
84 | 84 | ||
85 | - { GDK_Print, GDK_CONTROL_MASK, NULL, NULL }, | 85 | + { GDK_Print, GDK_CONTROL_MASK, lib3270_print, NULL }, |
86 | { GDK_Print, GDK_SHIFT_MASK, lib3270_sysreq, NULL }, | 86 | { GDK_Print, GDK_SHIFT_MASK, lib3270_sysreq, NULL }, |
87 | { GDK_Control_R, 0, NULL, NULL }, | 87 | { GDK_Control_R, 0, NULL, NULL }, |
88 | { GDK_Control_L, 0, NULL, NULL }, | 88 | { GDK_Control_L, 0, NULL, NULL }, |
src/pw3270/v3270/private.h
src/pw3270/v3270/widget.c
@@ -165,18 +165,6 @@ static gboolean v3270_popup_menu(GtkWidget * widget) | @@ -165,18 +165,6 @@ static gboolean v3270_popup_menu(GtkWidget * widget) | ||
165 | 165 | ||
166 | #if GTK_CHECK_VERSION(3,0,0) | 166 | #if GTK_CHECK_VERSION(3,0,0) |
167 | 167 | ||
168 | -/* | ||
169 | -static GtkSizeRequestMode get_request_mode(GtkWidget *widget) | ||
170 | -{ | ||
171 | - int rows, cols; | ||
172 | - | ||
173 | - lib3270_get_screen_size(GTK_V3270(widget)->host,&rows,&cols); | ||
174 | - | ||
175 | - return rows > cols ? GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT : GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH; | ||
176 | - | ||
177 | -} | ||
178 | -*/ | ||
179 | - | ||
180 | void get_preferred_height(GtkWidget *widget, gint *minimum_height, gint *natural_height) | 168 | void get_preferred_height(GtkWidget *widget, gint *minimum_height, gint *natural_height) |
181 | { | 169 | { |
182 | int height = GTK_V3270(widget)->minimum_height; | 170 | int height = GTK_V3270(widget)->minimum_height; |
@@ -200,31 +188,6 @@ void get_preferred_width(GtkWidget *widget, gint *minimum_width, gint *natural_w | @@ -200,31 +188,6 @@ void get_preferred_width(GtkWidget *widget, gint *minimum_width, gint *natural_w | ||
200 | *natural_width = 600; | 188 | *natural_width = 600; |
201 | } | 189 | } |
202 | 190 | ||
203 | -/* | ||
204 | -void get_preferred_height_for_width(GtkWidget *widget, gint width, gint *minimum_height, gint *natural_height) | ||
205 | -{ | ||
206 | - trace("%s",__FUNCTION__); | ||
207 | - | ||
208 | - if(minimum_height) | ||
209 | - *minimum_height = 10; | ||
210 | - | ||
211 | - if(natural_height) | ||
212 | - *natural_height = 10; | ||
213 | -} | ||
214 | - | ||
215 | -static void get_preferred_width_for_height(GtkWidget *widget,gint height, gint *minimum_width, gint *natural_width) | ||
216 | -{ | ||
217 | - trace("%s",__FUNCTION__); | ||
218 | - | ||
219 | - if(minimum_width) | ||
220 | - *minimum_width = 10; | ||
221 | - | ||
222 | - if(natural_width) | ||
223 | - *natural_width = 10; | ||
224 | - | ||
225 | -} | ||
226 | -*/ | ||
227 | - | ||
228 | #endif // GTK(3,0,0) | 191 | #endif // GTK(3,0,0) |
229 | 192 | ||
230 | void v3270_popup_message(GtkWidget *widget, LIB3270_NOTIFY type , const gchar *title, const gchar *message, const gchar *text) | 193 | void v3270_popup_message(GtkWidget *widget, LIB3270_NOTIFY type , const gchar *title, const gchar *message, const gchar *text) |
@@ -276,14 +239,6 @@ void v3270_popup_message(GtkWidget *widget, LIB3270_NOTIFY type , const gchar *t | @@ -276,14 +239,6 @@ void v3270_popup_message(GtkWidget *widget, LIB3270_NOTIFY type , const gchar *t | ||
276 | 239 | ||
277 | gboolean v3270_query_tooltip(GtkWidget *widget, gint x, gint y, gboolean keyboard_tooltip, GtkTooltip *tooltip) | 240 | gboolean v3270_query_tooltip(GtkWidget *widget, gint x, gint y, gboolean keyboard_tooltip, GtkTooltip *tooltip) |
278 | { | 241 | { |
279 | -/* | ||
280 | - if(!lib3270_connected(GTK_V3270(widget)->host)) | ||
281 | - { | ||
282 | - gtk_tooltip_set_text(tooltip,_( "Disconnected" ) ); | ||
283 | - return TRUE; | ||
284 | - } | ||
285 | -*/ | ||
286 | - | ||
287 | if(y >= GTK_V3270(widget)->oia_rect->y) | 242 | if(y >= GTK_V3270(widget)->oia_rect->y) |
288 | { | 243 | { |
289 | GdkRectangle *rect = GTK_V3270(widget)->oia_rect; | 244 | GdkRectangle *rect = GTK_V3270(widget)->oia_rect; |
@@ -369,8 +324,6 @@ static void v3270_class_init(v3270Class *klass) | @@ -369,8 +324,6 @@ static void v3270_class_init(v3270Class *klass) | ||
369 | 324 | ||
370 | widget_class->get_preferred_height = get_preferred_height; | 325 | widget_class->get_preferred_height = get_preferred_height; |
371 | widget_class->get_preferred_width = get_preferred_width; | 326 | widget_class->get_preferred_width = get_preferred_width; |
372 | -// widget_class->get_preferred_width_for_height = get_preferred_width_for_height; | ||
373 | -// widget_class->get_preferred_height_for_width = get_preferred_height_for_width; | ||
374 | 327 | ||
375 | widget_class->destroy = v3270_destroy; | 328 | widget_class->destroy = v3270_destroy; |
376 | widget_class->draw = v3270_draw; | 329 | widget_class->draw = v3270_draw; |
@@ -589,6 +542,16 @@ static void v3270_class_init(v3270Class *klass) | @@ -589,6 +542,16 @@ static void v3270_class_init(v3270Class *klass) | ||
589 | pw3270_BOOL__VOID_BOOL_UINT_POINTER, | 542 | pw3270_BOOL__VOID_BOOL_UINT_POINTER, |
590 | G_TYPE_BOOLEAN, 3, G_TYPE_BOOLEAN, G_TYPE_UINT, G_TYPE_POINTER); | 543 | G_TYPE_BOOLEAN, 3, G_TYPE_BOOLEAN, G_TYPE_UINT, G_TYPE_POINTER); |
591 | 544 | ||
545 | + | ||
546 | + v3270_widget_signal[SIGNAL_PRINT] = | ||
547 | + g_signal_new( "print", | ||
548 | + G_OBJECT_CLASS_TYPE (gobject_class), | ||
549 | + G_SIGNAL_RUN_FIRST, | ||
550 | + 0, | ||
551 | + NULL, NULL, | ||
552 | + pw3270_VOID__VOID, | ||
553 | + G_TYPE_NONE, 0); | ||
554 | + | ||
592 | } | 555 | } |
593 | 556 | ||
594 | void v3270_update_font_metrics(v3270 *terminal, cairo_t *cr, int width, int height) | 557 | void v3270_update_font_metrics(v3270 *terminal, cairo_t *cr, int width, int height) |
@@ -865,6 +828,12 @@ static void message(H3270 *session, LIB3270_NOTIFY id , const char *title, const | @@ -865,6 +828,12 @@ static void message(H3270 *session, LIB3270_NOTIFY id , const char *title, const | ||
865 | 828 | ||
866 | } | 829 | } |
867 | 830 | ||
831 | +static int emit_print_signal(H3270 *session) | ||
832 | +{ | ||
833 | + g_signal_emit(GTK_WIDGET(session->widget), v3270_widget_signal[SIGNAL_PRINT], 0); | ||
834 | + return 0; | ||
835 | +} | ||
836 | + | ||
868 | static void v3270_init(v3270 *widget) | 837 | static void v3270_init(v3270 *widget) |
869 | { | 838 | { |
870 | widget->host = lib3270_session_new(""); | 839 | widget->host = lib3270_session_new(""); |
@@ -899,6 +868,7 @@ static void v3270_init(v3270 *widget) | @@ -899,6 +868,7 @@ static void v3270_init(v3270 *widget) | ||
899 | widget->host->ctlr_done = ctlr_done; | 868 | widget->host->ctlr_done = ctlr_done; |
900 | widget->host->message = message; | 869 | widget->host->message = message; |
901 | widget->host->update_ssl = v3270_update_ssl; | 870 | widget->host->update_ssl = v3270_update_ssl; |
871 | + widget->host->print = emit_print_signal; | ||
902 | 872 | ||
903 | // Setup input method | 873 | // Setup input method |
904 | widget->input_method = gtk_im_multicontext_new(); | 874 | widget->input_method = gtk_im_multicontext_new(); |
src/pw3270/window.c
@@ -457,6 +457,11 @@ | @@ -457,6 +457,11 @@ | ||
457 | gtk_action_group_set_sensitive(group[ACTION_GROUP_CLIPBOARD],on); | 457 | gtk_action_group_set_sensitive(group[ACTION_GROUP_CLIPBOARD],on); |
458 | } | 458 | } |
459 | 459 | ||
460 | + static void print_all(GtkWidget *widget, GtkWidget *window) | ||
461 | + { | ||
462 | + pw3270_print(widget,G_OBJECT(widget), GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, PW3270_SRC_ALL); | ||
463 | + } | ||
464 | + | ||
460 | static void toggle_changed(GtkWidget *widget, LIB3270_TOGGLE id, gboolean toggled, const gchar *name, GtkWindow *toplevel) | 465 | static void toggle_changed(GtkWidget *widget, LIB3270_TOGGLE id, gboolean toggled, const gchar *name, GtkWindow *toplevel) |
461 | { | 466 | { |
462 | GtkAction **list = (GtkAction **) g_object_get_data(G_OBJECT(widget),"toggle_actions"); | 467 | GtkAction **list = (GtkAction **) g_object_get_data(G_OBJECT(widget),"toggle_actions"); |
@@ -604,6 +609,7 @@ | @@ -604,6 +609,7 @@ | ||
604 | // Connect widget signals | 609 | // Connect widget signals |
605 | g_signal_connect(widget->terminal,"field_clicked",G_CALLBACK(field_clicked),widget); | 610 | g_signal_connect(widget->terminal,"field_clicked",G_CALLBACK(field_clicked),widget); |
606 | g_signal_connect(widget->terminal,"toggle_changed",G_CALLBACK(toggle_changed),widget); | 611 | g_signal_connect(widget->terminal,"toggle_changed",G_CALLBACK(toggle_changed),widget); |
612 | + g_signal_connect(widget->terminal,"print",G_CALLBACK(print_all),widget); | ||
607 | 613 | ||
608 | // Connect window signals | 614 | // Connect window signals |
609 | g_signal_connect(widget,"window_state_event",G_CALLBACK(window_state_event),widget->terminal); | 615 | g_signal_connect(widget,"window_state_event",G_CALLBACK(window_state_event),widget->terminal); |