Commit d5af298c926decb44a6e928050c90bf6c50ac930
1 parent
4baad403
Exists in
master
and in
5 other branches
Incluindo suporte a macros no widget do emulador
Showing
9 changed files
with
126 additions
and
166 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-01-14 09:39-0200\n" | |
| 8 | +"POT-Creation-Date: 2013-01-30 10:26-0200\n" | |
| 9 | 9 | "PO-Revision-Date: 2013-01-14 09:49-0200\n" |
| 10 | 10 | "Last-Translator: Perry Werneck <perry.werneck@gmail.com>\n" |
| 11 | 11 | "Language-Team: Português <>\n" | ... | ... |
pw3270.cbp
| ... | ... | @@ -266,9 +266,6 @@ |
| 266 | 266 | <Unit filename="src/pw3270/hostdialog.c"> |
| 267 | 267 | <Option compilerVar="CC" /> |
| 268 | 268 | </Unit> |
| 269 | - <Unit filename="src/pw3270/macros.c"> | |
| 270 | - <Option compilerVar="CC" /> | |
| 271 | - </Unit> | |
| 272 | 269 | <Unit filename="src/pw3270/main.c"> |
| 273 | 270 | <Option compilerVar="CC" /> |
| 274 | 271 | </Unit> |
| ... | ... | @@ -348,6 +345,9 @@ |
| 348 | 345 | <Unit filename="src/pw3270/v3270/keyboard.c"> |
| 349 | 346 | <Option compilerVar="CC" /> |
| 350 | 347 | </Unit> |
| 348 | + <Unit filename="src/pw3270/v3270/macros.c"> | |
| 349 | + <Option compilerVar="CC" /> | |
| 350 | + </Unit> | |
| 351 | 351 | <Unit filename="src/pw3270/v3270/mouse.c"> |
| 352 | 352 | <Option compilerVar="CC" /> |
| 353 | 353 | </Unit> | ... | ... |
src/include/pw3270.h
| ... | ... | @@ -75,8 +75,6 @@ |
| 75 | 75 | |
| 76 | 76 | LIB3270_EXPORT gboolean pw3270_get_boolean(GtkWidget *widget, const gchar *group, const gchar *key, gboolean def); |
| 77 | 77 | |
| 78 | - LIB3270_EXPORT int pw3270_run_macro(GtkWidget *widget, int argc, const char **argv); | |
| 79 | - | |
| 80 | 78 | typedef enum pw3270_src |
| 81 | 79 | { |
| 82 | 80 | PW3270_SRC_ALL, /**< Screen contents */ | ... | ... |
src/pw3270/Makefile.in
| ... | ... | @@ -59,7 +59,7 @@ include uiparser/sources.mak |
| 59 | 59 | APP_SOURCES= main.c @APP_GUI_SRC@ |
| 60 | 60 | |
| 61 | 61 | LIB_SOURCES= window.c actions.c fonts.c dialog.c hostdialog.c print.c colors.c \ |
| 62 | - filetransfer.c tools.c plugin.c macros.c \ | |
| 62 | + filetransfer.c tools.c plugin.c \ | |
| 63 | 63 | $(foreach SRC, $(UI_PARSER_SRC), uiparser/$(SRC)) \ |
| 64 | 64 | $(foreach SRC, $(V3270_SRC), v3270/$(SRC)) \ |
| 65 | 65 | $(foreach SRC, $(COMMON_SRC), common/$(SRC)) | ... | ... |
src/pw3270/actions.c
| ... | ... | @@ -863,43 +863,6 @@ GtkAction * ui_get_action(GtkWidget *widget, const gchar *name, GHashTable *hash |
| 863 | 863 | static void action_text_script(GtkAction *action, GtkWidget *widget) |
| 864 | 864 | { |
| 865 | 865 | v3270_run_script(widget,g_object_get_data(G_OBJECT(action),"script_text")); |
| 866 | - | |
| 867 | -/* | |
| 868 | - gchar **ln = g_strsplit(g_object_get_data(G_OBJECT(action),"script_text"),"\n",-1); | |
| 869 | - int f; | |
| 870 | - H3270 * hSession = v3270_get_session(widget); | |
| 871 | - | |
| 872 | - lib3270_trace_event(v3270_get_session(widget),"Action %s activated on widget %p\n",gtk_action_get_name(action),widget); | |
| 873 | - | |
| 874 | - for(f=0;ln[f];f++) | |
| 875 | - { | |
| 876 | - GError * error = NULL; | |
| 877 | - gint argc = 0; | |
| 878 | - gchar **argv = NULL; | |
| 879 | - | |
| 880 | - if(g_shell_parse_argv(g_strstrip(ln[f]),&argc,&argv,&error)) | |
| 881 | - { | |
| 882 | - if(pw3270_run_macro(widget, argc,(const gchar **) argv) < 0) | |
| 883 | - { | |
| 884 | - gchar *rsp = lib3270_run_macro(hSession,(const gchar **) argv); | |
| 885 | - if(rsp) | |
| 886 | - g_free(rsp); | |
| 887 | - } | |
| 888 | - } | |
| 889 | - else | |
| 890 | - { | |
| 891 | - g_warning("Error parsing \"%s\": %s",g_strstrip(ln[f]),error->message); | |
| 892 | - g_error_free(error); | |
| 893 | - } | |
| 894 | - | |
| 895 | - if(argv) | |
| 896 | - g_strfreev(argv); | |
| 897 | - | |
| 898 | - } | |
| 899 | - | |
| 900 | - | |
| 901 | - g_strfreev(ln); | |
| 902 | -*/ | |
| 903 | 866 | } |
| 904 | 867 | |
| 905 | 868 | void ui_connect_text_script(GtkWidget *widget, GtkAction *action, const gchar *script_text, GError **error) | ... | ... |
src/pw3270/macros.c
| ... | ... | @@ -1,80 +0,0 @@ |
| 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., 51 Franklin | |
| 19 | - * St, Fifth Floor, Boston, MA 02110-1301 USA | |
| 20 | - * | |
| 21 | - * Este programa está nomeado como macros.c 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 | - * licinio@bb.com.br (Licínio Luis Branco) | |
| 28 | - * kraucer@bb.com.br (Kraucer Fernandes Mazuco) | |
| 29 | - * macmiranda@bb.com.br (Marco Aurélio Caldas Miranda) | |
| 30 | - * | |
| 31 | - */ | |
| 32 | - | |
| 33 | - #include "globals.h" | |
| 34 | - #include <pw3270/v3270.h> | |
| 35 | - | |
| 36 | - | |
| 37 | - | |
| 38 | -/*--[ Implement ]------------------------------------------------------------------------------------*/ | |
| 39 | - | |
| 40 | - static int pw3270_macro_copy(GtkWidget *widget, int argc, const char **argv) | |
| 41 | - { | |
| 42 | - trace("%s",__FUNCTION__); | |
| 43 | - v3270_copy(widget, V3270_SELECT_TEXT, FALSE); | |
| 44 | - return 0; | |
| 45 | - } | |
| 46 | - | |
| 47 | - static int pw3270_macro_append(GtkWidget *widget, int argc, const char **argv) | |
| 48 | - { | |
| 49 | - trace("%s",__FUNCTION__); | |
| 50 | - v3270_copy_append(widget); | |
| 51 | - return 0; | |
| 52 | - } | |
| 53 | - | |
| 54 | - LIB3270_EXPORT int pw3270_run_macro(GtkWidget *widget, int argc, const char **argv) | |
| 55 | - { | |
| 56 | - #define PW3270_MACRO( name ) { #name, pw3270_macro_ ## name } | |
| 57 | - | |
| 58 | - static const struct _list | |
| 59 | - { | |
| 60 | - const char *name; | |
| 61 | - int (*exec)(GtkWidget *widget, int argc, const char **argv); | |
| 62 | - } list[] = | |
| 63 | - { | |
| 64 | - PW3270_MACRO( copy ), | |
| 65 | - PW3270_MACRO( append ), | |
| 66 | - }; | |
| 67 | - int f; | |
| 68 | - | |
| 69 | - trace("<%s>",argv[0]); | |
| 70 | - | |
| 71 | - for(f=0;f<G_N_ELEMENTS(list);f++) | |
| 72 | - { | |
| 73 | - if(!g_strcasecmp(argv[0],list[f].name)) | |
| 74 | - return list[f].exec(widget,argc,argv); | |
| 75 | - } | |
| 76 | - | |
| 77 | - trace("<%s>",argv[0]); | |
| 78 | - | |
| 79 | - return -1; | |
| 80 | - } |
| ... | ... | @@ -0,0 +1,120 @@ |
| 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., 51 Franklin | |
| 19 | + * St, Fifth Floor, Boston, MA 02110-1301 USA | |
| 20 | + * | |
| 21 | + * Este programa está nomeado como macros.c 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 | + * licinio@bb.com.br (Licínio Luis Branco) | |
| 28 | + * kraucer@bb.com.br (Kraucer Fernandes Mazuco) | |
| 29 | + * macmiranda@bb.com.br (Marco Aurélio Caldas Miranda) | |
| 30 | + * | |
| 31 | + */ | |
| 32 | + | |
| 33 | + #include "private.h" | |
| 34 | + #include <lib3270/macros.h> | |
| 35 | + | |
| 36 | +/*--[ Implement ]------------------------------------------------------------------------------------*/ | |
| 37 | + | |
| 38 | + static int v3270_macro_copy(GtkWidget *widget, int argc, const char **argv) | |
| 39 | + { | |
| 40 | + v3270_copy(widget, V3270_SELECT_TEXT, FALSE); | |
| 41 | + return 0; | |
| 42 | + } | |
| 43 | + | |
| 44 | + static int v3270_macro_append(GtkWidget *widget, int argc, const char **argv) | |
| 45 | + { | |
| 46 | + v3270_copy_append(widget); | |
| 47 | + return 0; | |
| 48 | + } | |
| 49 | + | |
| 50 | + static int run_macro(GtkWidget *widget, int argc, const char **argv) | |
| 51 | + { | |
| 52 | + #define V3270_MACRO( name ) { #name, v3270_macro_ ## name } | |
| 53 | + | |
| 54 | + static const struct _list | |
| 55 | + { | |
| 56 | + const char *name; | |
| 57 | + int (*exec)(GtkWidget *widget, int argc, const char **argv); | |
| 58 | + } list[] = | |
| 59 | + { | |
| 60 | + V3270_MACRO( copy ), | |
| 61 | + V3270_MACRO( append ), | |
| 62 | + }; | |
| 63 | + | |
| 64 | + int f; | |
| 65 | + gchar *rsp; | |
| 66 | + | |
| 67 | + for(f=0;f<G_N_ELEMENTS(list);f++) | |
| 68 | + { | |
| 69 | + if(!g_ascii_strcasecmp(argv[0],list[f].name)) | |
| 70 | + return list[f].exec(widget,argc,argv); | |
| 71 | + } | |
| 72 | + | |
| 73 | + rsp = lib3270_run_macro(GTK_V3270(widget)->host,argv); | |
| 74 | + if(rsp) | |
| 75 | + { | |
| 76 | + g_free(rsp); | |
| 77 | + return 0; | |
| 78 | + } | |
| 79 | + | |
| 80 | + return -1; | |
| 81 | + } | |
| 82 | + | |
| 83 | + int v3270_run_script(GtkWidget *widget, const gchar *script) | |
| 84 | +{ | |
| 85 | + gchar **ln; | |
| 86 | + int f; | |
| 87 | + | |
| 88 | + if(!script) | |
| 89 | + return 0; | |
| 90 | + | |
| 91 | + g_return_val_if_fail(GTK_IS_V3270(widget),EINVAL); | |
| 92 | + | |
| 93 | + ln = g_strsplit(script,"\n",-1); | |
| 94 | + | |
| 95 | + for(f=0;ln[f];f++) | |
| 96 | + { | |
| 97 | + GError * error = NULL; | |
| 98 | + gint argc = 0; | |
| 99 | + gchar **argv = NULL; | |
| 100 | + | |
| 101 | + if(g_shell_parse_argv(g_strstrip(ln[f]),&argc,&argv,&error)) | |
| 102 | + { | |
| 103 | + run_macro(widget, argc, (const char **) argv); | |
| 104 | + } | |
| 105 | + else | |
| 106 | + { | |
| 107 | + g_warning("Error parsing \"%s\": %s",g_strstrip(ln[f]),error->message); | |
| 108 | + g_error_free(error); | |
| 109 | + } | |
| 110 | + | |
| 111 | + if(argv) | |
| 112 | + g_strfreev(argv); | |
| 113 | + | |
| 114 | + } | |
| 115 | + | |
| 116 | + g_strfreev(ln); | |
| 117 | + | |
| 118 | + return 0; | |
| 119 | +} | |
| 120 | + | ... | ... |
src/pw3270/v3270/sources.mak
src/pw3270/v3270/widget.c
| ... | ... | @@ -1544,44 +1544,3 @@ gboolean v3270_is_connected(GtkWidget *widget) |
| 1544 | 1544 | return lib3270_connected(GTK_V3270(widget)->host) ? TRUE : FALSE; |
| 1545 | 1545 | } |
| 1546 | 1546 | |
| 1547 | -int v3270_run_script(GtkWidget *widget, const gchar *script) | |
| 1548 | -{ | |
| 1549 | - gchar **ln; | |
| 1550 | - int f; | |
| 1551 | - H3270 * hSession; | |
| 1552 | - | |
| 1553 | - if(!script) | |
| 1554 | - return 0; | |
| 1555 | - | |
| 1556 | - g_return_val_if_fail(GTK_IS_V3270(widget),EINVAL); | |
| 1557 | - | |
| 1558 | - hSession = v3270_get_session(widget); | |
| 1559 | - ln = g_strsplit(script,"\n",-1); | |
| 1560 | - | |
| 1561 | - for(f=0;ln[f];f++) | |
| 1562 | - { | |
| 1563 | - GError * error = NULL; | |
| 1564 | - gint argc = 0; | |
| 1565 | - gchar **argv = NULL; | |
| 1566 | - | |
| 1567 | - if(g_shell_parse_argv(g_strstrip(ln[f]),&argc,&argv,&error)) | |
| 1568 | - { | |
| 1569 | - gchar *rsp = lib3270_run_macro(hSession,(const gchar **) argv); | |
| 1570 | - if(rsp) | |
| 1571 | - g_free(rsp); | |
| 1572 | - } | |
| 1573 | - else | |
| 1574 | - { | |
| 1575 | - g_warning("Error parsing \"%s\": %s",g_strstrip(ln[f]),error->message); | |
| 1576 | - g_error_free(error); | |
| 1577 | - } | |
| 1578 | - | |
| 1579 | - if(argv) | |
| 1580 | - g_strfreev(argv); | |
| 1581 | - | |
| 1582 | - } | |
| 1583 | - | |
| 1584 | - g_strfreev(ln); | |
| 1585 | - | |
| 1586 | - return 0; | |
| 1587 | -} | ... | ... |