/* Display registers window */ GtkWidget* dbgheap_create_window(void) { GtkWidget *dbox; GtkWidget *data; xml = glade_xml_new (tilp_paths_build_glade("dbg_heap-2.glade"), "dbgheap_window", PACKAGE); if (!xml) g_error(_("%s: GUI loading failed !\n"), __FILE__); glade_xml_signal_autoconnect(xml); dbox = glade_xml_get_widget(xml, "dbgheap_window"); gtk_window_set_transient_for(GTK_WINDOW(dbox), GTK_WINDOW(main_wnd)); data = glade_xml_get_widget(xml, "treeview1"); store = clist_create(data); clist_populate(store); gtk_tree_view_expand_all(GTK_TREE_VIEW(data)); already_open = !0; return wnd = dbox; }
/* Display registers window */ GtkWidget* display_dbgpclog_window(void) { GladeXML *xml; GtkWidget *dbox; GtkWidget *data; xml = glade_xml_new (tilp_paths_build_glade("dbg_pclog-2.glade"), "dbgpclog_window", PACKAGE); if (!xml) g_error(_("%s: GUI loading failed !\n"), __FILE__); glade_xml_signal_autoconnect(xml); dbox = glade_xml_get_widget(xml, "dbgpclog_window"); data = glade_xml_get_widget(xml, "treeview1"); store = clist_create(data); clist_populate(store); gtk_tree_view_expand_all(GTK_TREE_VIEW(data)); gtk_widget_show(data); gtk_window_resize(GTK_WINDOW(dbox), options3.pclog.w, options3.pclog.h); gtk_window_move(GTK_WINDOW(dbox), options3.pclog.x, options3.pclog.y); gtk_widget_show(GTK_WIDGET(dbox)); already_open = !0; return dbox; }
static void notebook_add_page(GtkWidget *notebook, const char* tab_name) { GtkListStore *store; GtkWidget *label; GtkWidget *child; GtkNotebook *nb = GTK_NOTEBOOK(notebook); gint page = gtk_notebook_get_current_page(nb); uint32_t addr; label = gtk_label_new(tab_name); gtk_widget_show(label); child = clist_create(&store); // display normal sscanf(tab_name, "%06x", &addr); clist_populate(store, addr, DUMP_SIZE); gtk_widget_show(child); gtk_notebook_insert_page(nb, child, label, page); gtk_notebook_set_current_page(nb, page); gtk_widget_grab_focus(child); }
// note: user_data data passing ha been manually added to Glade file GLADE_CB void on_go_to_address1_activate (GtkMenuItem *menuitem, gpointer user_data) { uint32_t addr; display_dbgmem_dbox(&addr); gtk_list_store_clear(store); clist_populate(store, addr); }
GtkWidget* refresh_dbgpclog_window(void) { static GtkWidget *wnd = NULL; if(!already_open) wnd = display_dbgpclog_window(); gtk_list_store_clear(store); clist_populate(store); return wnd; }
/* Display source code window */ GtkWidget* display_dbgcode_window(void) { GladeXML *xml; GtkWidget *dbox; GtkWidget *data; xml = glade_xml_new (tilp_paths_build_glade("dbg_code-2.glade"), "dbgcode_window", PACKAGE); if (!xml) g_error(_("%s: GUI loading failed !\n"), __FILE__); glade_xml_signal_autoconnect(xml); dbox = glade_xml_get_widget(xml, "dbgcode_window"); tb.b1 = glade_xml_get_widget(xml, "button1"); tb.b2 = glade_xml_get_widget(xml, "button2"); tb.b3 = glade_xml_get_widget(xml, "button3"); tb.b4 = glade_xml_get_widget(xml, "button4"); tb.b5 = glade_xml_get_widget(xml, "button5"); tb.b6 = glade_xml_get_widget(xml, "button6"); list = glade_xml_get_widget(xml, "treeview1"); data = glade_xml_get_widget(xml, "treeview1"); store = clist_create(data); clist_populate(store, ti68k_debug_get_pc()); gtk_tree_view_expand_all(GTK_TREE_VIEW(data)); gtk_widget_show(data); gtk_window_resize(GTK_WINDOW(dbox), options3.code.w, options3.code.h); gtk_window_move(GTK_WINDOW(dbox), options3.code.x, options3.code.y); gtk_widget_show(GTK_WIDGET(dbox)); already_open = !0; return dbox; }
gint dbgvectors_display_dbox(void) { GladeXML *xml; GtkWidget *dbox; GtkWidget *data; gint result; xml = glade_xml_new (tilp_paths_build_glade("dbg_vectors-2.glade"), "dbgvectors_dbox", PACKAGE); if (!xml) g_error(_("%s: GUI loading failed !\n"), __FILE__); glade_xml_signal_autoconnect(xml); dbox = glade_xml_get_widget(xml, "dbgvectors_dbox"); gtk_window_resize(GTK_WINDOW(dbox), 320, 240); data = glade_xml_get_widget(xml, "treeview1"); clist_create(data); clist_populate(data); result = gtk_dialog_run(GTK_DIALOG(dbox)); switch (result) { case GTK_RESPONSE_OK: clist_get_selection(data); dbgbkpts_refresh_window(); break; default: break; } gtk_widget_destroy(dbox); return 0; }
gint display_romversion_dbox(gboolean file_only) { GladeXML *xml; GtkWidget *data; gint result; GtkListStore *store; xml = glade_xml_new (tilp_paths_build_glade("romversion-2.glade"), "romversion_dbox", PACKAGE); if (!xml) g_error(_("%s: GUI loading failed!\n"), __FILE__); glade_xml_signal_autoconnect(xml); // display list box dbox = glade_xml_get_widget(xml, "romversion_dbox"); gtk_dialog_set_alternative_button_order(GTK_DIALOG(dbox), GTK_RESPONSE_OK, GTK_RESPONSE_CANCEL,-1); data = glade_xml_get_widget(xml, "clist1"); store = clist_create(data); clist_populate(store); // run main box gtk_dialog_set_response_sensitive(GTK_DIALOG(dbox), GTK_RESPONSE_OK, FALSE); result = gtk_dialog_run(GTK_DIALOG(dbox)); gtk_widget_destroy(dbox); switch (result) { case GTK_RESPONSE_OK: if(chosen_file == NULL) break; if(!ti68k_is_a_img_file(chosen_file)) break; // Remove previous tib file g_free(params.tib_file); params.tib_file = g_strconcat("", NULL); // Set new image g_free(params.rom_file); params.rom_file = g_strconcat(inst_paths.img_dir, chosen_file, NULL); g_free(chosen_file); chosen_file = NULL; if(file_only) return 0; // Restart engine by exiting the GTK loop g_free(params.sav_file); params.sav_file = g_strdup(""); while(gtk_events_pending()) gtk_main_iteration(); gtk_main_quit(); break; default: if(file_only) return -1; break; } return 0; }
static void clist_refresh(GtkListStore *store) { gtk_list_store_clear(store); clist_populate(store); }
void dbgromcall_refresh_window(void) { //gtk_list_store_clear(store); clist_populate(store); }
static void clist_refresh(GtkListStore *store) { GtkTreeModel *model = GTK_TREE_MODEL(store); gboolean valid; GtkTreeIter iter; uint32_t addr; uint32_t pc; int found = 0; pc = ti68k_debug_get_pc(); // check for refresh for(valid = gtk_tree_model_get_iter_first(model, &iter); valid; valid = gtk_tree_model_iter_next(model, &iter)) { gchar *str; gtk_tree_model_get(model, &iter, COL_ADDR, &str, -1); sscanf(str, "%x", &addr); if(addr == pc) found = !0; g_free(str); } if(!found) { gtk_list_store_clear(store); clist_populate(store, ti68k_debug_get_pc()); } // look for pc and matching bkpt for(valid = gtk_tree_model_get_iter_first(model, &iter); valid; valid = gtk_tree_model_iter_next(model, &iter)) { GdkPixbuf *pix; gchar *str; gtk_tree_model_get(model, &iter, COL_ADDR, &str, -1); sscanf(str, "%x", &addr); if(addr == pc) { pix = create_pixbuf("run.xpm"); } else if(g_list_find(bkpts.code, GINT_TO_POINTER(addr)) != NULL) { pix = create_pixbuf("bkpt.xpm"); } else { pix = create_pixbuf("void.xpm"); } gtk_list_store_set(store, &iter, COL_ICON, pix, -1); g_free(str); } }
static void clist_refresh(GtkListStore *store, uint32_t start, int length) { gtk_list_store_clear(store); clist_populate(store, start, length); }