From: Hugo Villeneuve Date: Mon, 21 Oct 2013 00:46:07 +0000 (-0400) Subject: Use single function to refresh all windows X-Git-Tag: v2.0.0~123 X-Git-Url: http://gitweb.hugovil.com/?a=commitdiff_plain;h=7e70fab3bd42fd167252edef062ff359633550b4;p=emu8051.git Use single function to refresh all windows Use emugtk_UpdateDisplay() to replace individual calls to these functions: regwin_Show(); memwin_DumpD(); pgmwin_Disasm(); --- diff --git a/src/emugtk.c b/src/emugtk.c index de5d48b..0711248 100644 --- a/src/emugtk.c +++ b/src/emugtk.c @@ -55,6 +55,15 @@ GtkWidget *mainwin; extern struct app_config_t *cfg; extern struct options_t options; +void +emugtk_UpdateDisplay(void) +{ + log_debug("UpdateDisplay()"); + regwin_Show(); + pgmwin_Disasm(); + memwin_DumpD(INT_MEM_ID); +} + /* Step out of running state */ static void emugtk_stop_running() @@ -63,9 +72,7 @@ emugtk_stop_running() log_info("StopRunning()"); g_source_remove(running_function_tag); running = 0; - regwin_Show(); - pgmwin_Disasm(); - memwin_DumpD(); + emugtk_UpdateDisplay(); } } @@ -116,9 +123,7 @@ static void emugtk_Reset(void) { cpu8051_Reset(); - regwin_Show(); - pgmwin_Disasm(); - memwin_DumpD(); + emugtk_UpdateDisplay(); } /* Signal ResetEvent (ResetButton) */ @@ -135,9 +140,7 @@ static void emugtk_Step(void) { cpu8051_Exec(); - regwin_Show(); - pgmwin_Disasm(); - memwin_DumpD(); + emugtk_UpdateDisplay(); } /* Signal RunEvent (RunButton) */ @@ -383,15 +386,6 @@ emugtk_window_init(void) gtk_widget_show_all(mainwin); } -static void -emugtk_UpdateDisplay(void) -{ - log_debug("UpdateDisplay()"); - regwin_Show(); - pgmwin_Disasm(); - memwin_DumpD(); -} - void AddMenuSeparator(GtkWidget *menu) { diff --git a/src/emugtk.h b/src/emugtk.h index 75714be..35ac1e4 100644 --- a/src/emugtk.h +++ b/src/emugtk.h @@ -30,4 +30,7 @@ AddMenuSeparator(GtkWidget *menu); void emugtk_new_file(char *file); +void +emugtk_UpdateDisplay(void); + #endif /* EMUGTK_H */ diff --git a/src/regwin.c b/src/regwin.c index e3b79d7..aaa006b 100644 --- a/src/regwin.c +++ b/src/regwin.c @@ -33,6 +33,7 @@ #include "pgmwin.h" #include "instructions_8051.h" #include "hexfile.h" +#include "emugtk.h" static GtkWidget *reglist; @@ -387,9 +388,7 @@ regwin_cell_edited(GtkCellRendererText *cell, gchar *path_string, * Make sure to update all windows. * For example, R0-R7 values depends on internal memory values. */ - regwin_Show(); - memwin_DumpD(); - pgmwin_Disasm(); + emugtk_UpdateDisplay(); }; static void