Commit 34b345e11bf53548073fb110b5fa71e1dc7d9b42
1 parent
9705cef6
Exists in
master
and in
5 other branches
Incluindo testes
Showing
7 changed files
with
21 additions
and
15 deletions
Show diff stats
pw3270.cbp
| @@ -305,7 +305,8 @@ | @@ -305,7 +305,8 @@ | ||
| 305 | </Unit> | 305 | </Unit> |
| 306 | <Unit filename="src/lib3270/xioc.h" /> | 306 | <Unit filename="src/lib3270/xioc.h" /> |
| 307 | <Unit filename="src/lib3270/xl.h" /> | 307 | <Unit filename="src/lib3270/xl.h" /> |
| 308 | - <Unit filename="ui/default.xml" /> | 308 | + <Unit filename="ui/00default.xml" /> |
| 309 | + <Unit filename="ui/99debug.xml" /> | ||
| 309 | <Unit filename="valgrind.suppression" /> | 310 | <Unit filename="valgrind.suppression" /> |
| 310 | <Extensions> | 311 | <Extensions> |
| 311 | <code_completion /> | 312 | <code_completion /> |
src/gtk/actions.c
| @@ -61,12 +61,19 @@ static void activate_action(GtkAction *action, GtkWidget *widget) | @@ -61,12 +61,19 @@ static void activate_action(GtkAction *action, GtkWidget *widget) | ||
| 61 | gtk_widget_activate(widget); | 61 | gtk_widget_activate(widget); |
| 62 | } | 62 | } |
| 63 | 63 | ||
| 64 | +static void reload_action(GtkAction *action, GtkWidget *widget) | ||
| 65 | +{ | ||
| 66 | + trace("Action %s activated on widget %p",gtk_action_get_name(action),widget); | ||
| 67 | + v3270_reload(widget); | ||
| 68 | +} | ||
| 69 | + | ||
| 64 | static void copy_action(GtkAction *action, GtkWidget *widget) | 70 | static void copy_action(GtkAction *action, GtkWidget *widget) |
| 65 | { | 71 | { |
| 66 | trace("Action %s activated on widget %p",gtk_action_get_name(action),widget); | 72 | trace("Action %s activated on widget %p",gtk_action_get_name(action),widget); |
| 67 | v3270_copy_clipboard(GTK_V3270(widget)); | 73 | v3270_copy_clipboard(GTK_V3270(widget)); |
| 68 | } | 74 | } |
| 69 | 75 | ||
| 76 | + | ||
| 70 | void ui_connect_action(GtkAction *action, GtkWidget *widget, const gchar *name, const gchar *id) | 77 | void ui_connect_action(GtkAction *action, GtkWidget *widget, const gchar *name, const gchar *id) |
| 71 | { | 78 | { |
| 72 | #undef DECLARE_LIB3270_ACTION | 79 | #undef DECLARE_LIB3270_ACTION |
| @@ -98,6 +105,7 @@ void ui_connect_action(GtkAction *action, GtkWidget *widget, const gchar *name, | @@ -98,6 +105,7 @@ void ui_connect_action(GtkAction *action, GtkWidget *widget, const gchar *name, | ||
| 98 | gtk_action[] = | 105 | gtk_action[] = |
| 99 | { | 106 | { |
| 100 | { "activate", activate_action }, | 107 | { "activate", activate_action }, |
| 108 | + { "reload", reload_action }, | ||
| 101 | { "connect", connect_action }, | 109 | { "connect", connect_action }, |
| 102 | { "copy", copy_action }, | 110 | { "copy", copy_action }, |
| 103 | { "disconnect", disconnect_action }, | 111 | { "disconnect", disconnect_action }, |
src/gtk/mainwindow.c
| @@ -273,6 +273,10 @@ | @@ -273,6 +273,10 @@ | ||
| 273 | if(lib3270_get_toggle(host,LIB3270_TOGGLE_FULL_SCREEN)) | 273 | if(lib3270_get_toggle(host,LIB3270_TOGGLE_FULL_SCREEN)) |
| 274 | gtk_window_fullscreen(GTK_WINDOW(window)); | 274 | gtk_window_fullscreen(GTK_WINDOW(window)); |
| 275 | 275 | ||
| 276 | +#ifdef DEBUG | ||
| 277 | + lib3270_testpattern(host); | ||
| 278 | +#endif | ||
| 279 | + | ||
| 276 | return window; | 280 | return window; |
| 277 | } | 281 | } |
| 278 | 282 |
src/gtk/uiparser/parser.c
| @@ -211,7 +211,7 @@ static void release_popups(GtkWidget **popup) | @@ -211,7 +211,7 @@ static void release_popups(GtkWidget **popup) | ||
| 211 | int f; | 211 | int f; |
| 212 | for(f=0;popup[f] != ((GtkWidget *) -1);f++) | 212 | for(f=0;popup[f] != ((GtkWidget *) -1);f++) |
| 213 | { | 213 | { |
| 214 | - trace("%s[%d]=%p",__FUNCTION__,f,popup[f]); | 214 | +// trace("%s[%d]=%p",__FUNCTION__,f,popup[f]); |
| 215 | if(popup[f]) | 215 | if(popup[f]) |
| 216 | g_object_unref(popup[f]); | 216 | g_object_unref(popup[f]); |
| 217 | } | 217 | } |
src/gtk/v3270/draw.c
src/lib3270/screen.c
| @@ -72,18 +72,10 @@ | @@ -72,18 +72,10 @@ | ||
| 72 | #define get_color_pair(fg,bg) (((bg&0x0F) << 4) | (fg&0x0F)) | 72 | #define get_color_pair(fg,bg) (((bg&0x0F) << 4) | (fg&0x0F)) |
| 73 | #define DEFCOLOR_MAP(f) ((((f) & FA_PROTECT) >> 4) | (((f) & FA_INT_HIGH_SEL) >> 3)) | 73 | #define DEFCOLOR_MAP(f) ((((f) & FA_PROTECT) >> 4) | (((f) & FA_INT_HIGH_SEL) >> 3)) |
| 74 | 74 | ||
| 75 | -// #if defined(WC3270) | ||
| 76 | -// extern char *profile_name; | ||
| 77 | -// #endif | ||
| 78 | - | ||
| 79 | static int logpopup(H3270 *session, LIB3270_NOTIFY type, const char *title, const char *msg, const char *fmt, va_list arg); | 75 | static int logpopup(H3270 *session, LIB3270_NOTIFY type, const char *title, const char *msg, const char *fmt, va_list arg); |
| 80 | 76 | ||
| 81 | static int (*popup_handler)(H3270 *, LIB3270_NOTIFY, const char *, const char *, const char *, va_list) = logpopup; | 77 | static int (*popup_handler)(H3270 *, LIB3270_NOTIFY, const char *, const char *, const char *, va_list) = logpopup; |
| 82 | 78 | ||
| 83 | -// static const struct lib3270_screen_callbacks *callbacks = NULL; | ||
| 84 | -// static SCRIPT_STATE script_state = SCRIPT_STATE_NONE; | ||
| 85 | - | ||
| 86 | - | ||
| 87 | enum ts { TS_AUTO, TS_ON, TS_OFF }; | 79 | enum ts { TS_AUTO, TS_ON, TS_OFF }; |
| 88 | 80 | ||
| 89 | static void screen_update(H3270 *session, int bstart, int bend); | 81 | static void screen_update(H3270 *session, int bstart, int bend); |
| @@ -755,12 +747,14 @@ LIB3270_ACTION( testpattern ) | @@ -755,12 +747,14 @@ LIB3270_ACTION( testpattern ) | ||
| 755 | }; | 747 | }; |
| 756 | 748 | ||
| 757 | int row = 0; | 749 | int row = 0; |
| 758 | - int max = (hSession->maxROWS * hSession->maxCOLS); | 750 | + int max; |
| 759 | int pos = 0; | 751 | int pos = 0; |
| 760 | int f; | 752 | int f; |
| 761 | int fg = COLOR_BLUE; | 753 | int fg = COLOR_BLUE; |
| 762 | 754 | ||
| 763 | - Trace("%s begins",__FUNCTION__); | 755 | + CHECK_SESSION_HANDLE(hSession); |
| 756 | + | ||
| 757 | + max = (hSession->maxROWS * hSession->maxCOLS); | ||
| 764 | for(f=0;f<max;f++) | 758 | for(f=0;f<max;f++) |
| 765 | { | 759 | { |
| 766 | if(!pat[row].cc[pos]) | 760 | if(!pat[row].cc[pos]) |
| @@ -779,11 +773,8 @@ LIB3270_ACTION( testpattern ) | @@ -779,11 +773,8 @@ LIB3270_ACTION( testpattern ) | ||
| 779 | hSession->ea_buf[f].cc = pat[row].cc[pos++]; | 773 | hSession->ea_buf[f].cc = pat[row].cc[pos++]; |
| 780 | } | 774 | } |
| 781 | 775 | ||
| 782 | - Trace("%s display",__FUNCTION__); | ||
| 783 | - | ||
| 784 | screen_disp(hSession); | 776 | screen_disp(hSession); |
| 785 | 777 | ||
| 786 | - Trace("%s ends",__FUNCTION__); | ||
| 787 | return 0; | 778 | return 0; |
| 788 | } | 779 | } |
| 789 | 780 |
ui/99debug.xml
| @@ -40,6 +40,7 @@ | @@ -40,6 +40,7 @@ | ||
| 40 | 40 | ||
| 41 | <menu name='debugmenu' label='Debug' > | 41 | <menu name='debugmenu' label='Debug' > |
| 42 | <menuitem action='testpattern' group='offline' label='Show test pattern' /> | 42 | <menuitem action='testpattern' group='offline' label='Show test pattern' /> |
| 43 | + <menuitem action='reload' label='Reload buffer contents' /> | ||
| 43 | </menu> | 44 | </menu> |
| 44 | 45 | ||
| 45 | </menubar> | 46 | </menubar> |