Search
lxdream.org :: lxdream :: r457:af605fd32c0b
lxdream 0.9.1
released Jun 29
Download Now
changeset457:af605fd32c0b
parent456:968df17c4900
child458:cbb2dd12daeb
authornkeynes
dateSun Oct 21 11:38:02 2007 +0000 (12 years ago)
Finish updating debug gui window bits
src/Makefile.am
src/Makefile.in
src/gui/debug_win.c
src/gui/debugcb.c
src/gui/debugcb.h
src/gui/debugif.c
src/gui/debugif.h
src/gui/dump_win.c
src/gui/gtkui.c
src/gui/gtkui.h
src/gui/main_win.c
src/gui/mmio_win.c
1.1 --- a/src/Makefile.am Sun Oct 21 05:31:07 2007 +0000
1.2 +++ b/src/Makefile.am Sun Oct 21 11:38:02 2007 +0000
1.3 @@ -37,8 +37,6 @@
1.4 maple/controller.c maple/controller.h \
1.5 gui/gtkui.c gui/gtkui.h gui/main_win.c gui/gtkcb.c \
1.6 gui/support.c gui/support.h \
1.7 - gui/debugif.c gui/debugif.h \
1.8 - gui/debugcb.c gui/debugcb.h \
1.9 gui/mmio_win.c gui/debug_win.c gui/dump_win.c \
1.10 gui/ctrl_dlg.c gui/path_dlg.c \
1.11 loader.c bootstrap.c util.c \
2.1 --- a/src/Makefile.in Sun Oct 21 05:31:07 2007 +0000
2.2 +++ b/src/Makefile.in Sun Oct 21 11:38:02 2007 +0000
2.3 @@ -171,8 +171,6 @@
2.4 maple/controller.c maple/controller.h \
2.5 gui/gtkui.c gui/gtkui.h gui/main_win.c gui/gtkcb.c \
2.6 gui/support.c gui/support.h \
2.7 - gui/debugif.c gui/debugif.h \
2.8 - gui/debugcb.c gui/debugcb.h \
2.9 gui/mmio_win.c gui/debug_win.c gui/dump_win.c \
2.10 gui/ctrl_dlg.c gui/path_dlg.c \
2.11 loader.c bootstrap.c util.c \
2.12 @@ -238,14 +236,13 @@
2.13 rendbkg.$(OBJEXT) rendsort.$(OBJEXT) texcache.$(OBJEXT) \
2.14 yuv.$(OBJEXT) rendsave.$(OBJEXT) maple.$(OBJEXT) \
2.15 controller.$(OBJEXT) gtkui.$(OBJEXT) main_win.$(OBJEXT) \
2.16 - gtkcb.$(OBJEXT) support.$(OBJEXT) debugif.$(OBJEXT) \
2.17 - debugcb.$(OBJEXT) mmio_win.$(OBJEXT) debug_win.$(OBJEXT) \
2.18 - dump_win.$(OBJEXT) ctrl_dlg.$(OBJEXT) path_dlg.$(OBJEXT) \
2.19 - loader.$(OBJEXT) bootstrap.$(OBJEXT) util.$(OBJEXT) \
2.20 - display.$(OBJEXT) audio_null.$(OBJEXT) audio_esd.$(OBJEXT) \
2.21 - video_null.$(OBJEXT) video_gtk.$(OBJEXT) video_x11.$(OBJEXT) \
2.22 - gl_common.$(OBJEXT) gl_fbo.$(OBJEXT) gl_sl.$(OBJEXT) \
2.23 - gl_slsrc.$(OBJEXT)
2.24 + gtkcb.$(OBJEXT) support.$(OBJEXT) mmio_win.$(OBJEXT) \
2.25 + debug_win.$(OBJEXT) dump_win.$(OBJEXT) ctrl_dlg.$(OBJEXT) \
2.26 + path_dlg.$(OBJEXT) loader.$(OBJEXT) bootstrap.$(OBJEXT) \
2.27 + util.$(OBJEXT) display.$(OBJEXT) audio_null.$(OBJEXT) \
2.28 + audio_esd.$(OBJEXT) video_null.$(OBJEXT) video_gtk.$(OBJEXT) \
2.29 + video_x11.$(OBJEXT) gl_common.$(OBJEXT) gl_fbo.$(OBJEXT) \
2.30 + gl_sl.$(OBJEXT) gl_slsrc.$(OBJEXT)
2.31 lxdream_OBJECTS = $(am_lxdream_OBJECTS)
2.32 lxdream_DEPENDENCIES =
2.33 lxdream_LDFLAGS =
2.34 @@ -274,8 +271,7 @@
2.35 @AMDEP_TRUE@ ./$(DEPDIR)/bootstrap.Po ./$(DEPDIR)/cdi.Po \
2.36 @AMDEP_TRUE@ ./$(DEPDIR)/config.Po ./$(DEPDIR)/controller.Po \
2.37 @AMDEP_TRUE@ ./$(DEPDIR)/ctrl_dlg.Po ./$(DEPDIR)/dcload.Po \
2.38 -@AMDEP_TRUE@ ./$(DEPDIR)/debug_win.Po ./$(DEPDIR)/debugcb.Po \
2.39 -@AMDEP_TRUE@ ./$(DEPDIR)/debugif.Po ./$(DEPDIR)/dis-buf.Po \
2.40 +@AMDEP_TRUE@ ./$(DEPDIR)/debug_win.Po ./$(DEPDIR)/dis-buf.Po \
2.41 @AMDEP_TRUE@ ./$(DEPDIR)/dis-init.Po ./$(DEPDIR)/display.Po \
2.42 @AMDEP_TRUE@ ./$(DEPDIR)/dmac.Po ./$(DEPDIR)/dreamcast.Po \
2.43 @AMDEP_TRUE@ ./$(DEPDIR)/dump_win.Po ./$(DEPDIR)/eventq.Po \
2.44 @@ -394,8 +390,6 @@
2.45 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ctrl_dlg.Po@am__quote@
2.46 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dcload.Po@am__quote@
2.47 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debug_win.Po@am__quote@
2.48 -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debugcb.Po@am__quote@
2.49 -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debugif.Po@am__quote@
2.50 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dis-buf.Po@am__quote@
2.51 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dis-init.Po@am__quote@
2.52 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/display.Po@am__quote@
2.53 @@ -1536,50 +1530,6 @@
2.54 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2.55 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o support.obj `if test -f 'gui/support.c'; then $(CYGPATH_W) 'gui/support.c'; else $(CYGPATH_W) '$(srcdir)/gui/support.c'; fi`
2.56
2.57 -debugif.o: gui/debugif.c
2.58 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT debugif.o -MD -MP -MF "$(DEPDIR)/debugif.Tpo" \
2.59 -@am__fastdepCC_TRUE@ -c -o debugif.o `test -f 'gui/debugif.c' || echo '$(srcdir)/'`gui/debugif.c; \
2.60 -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/debugif.Tpo" "$(DEPDIR)/debugif.Po"; \
2.61 -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/debugif.Tpo"; exit 1; \
2.62 -@am__fastdepCC_TRUE@ fi
2.63 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gui/debugif.c' object='debugif.o' libtool=no @AMDEPBACKSLASH@
2.64 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/debugif.Po' tmpdepfile='$(DEPDIR)/debugif.TPo' @AMDEPBACKSLASH@
2.65 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2.66 -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o debugif.o `test -f 'gui/debugif.c' || echo '$(srcdir)/'`gui/debugif.c
2.67 -
2.68 -debugif.obj: gui/debugif.c
2.69 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT debugif.obj -MD -MP -MF "$(DEPDIR)/debugif.Tpo" \
2.70 -@am__fastdepCC_TRUE@ -c -o debugif.obj `if test -f 'gui/debugif.c'; then $(CYGPATH_W) 'gui/debugif.c'; else $(CYGPATH_W) '$(srcdir)/gui/debugif.c'; fi`; \
2.71 -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/debugif.Tpo" "$(DEPDIR)/debugif.Po"; \
2.72 -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/debugif.Tpo"; exit 1; \
2.73 -@am__fastdepCC_TRUE@ fi
2.74 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gui/debugif.c' object='debugif.obj' libtool=no @AMDEPBACKSLASH@
2.75 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/debugif.Po' tmpdepfile='$(DEPDIR)/debugif.TPo' @AMDEPBACKSLASH@
2.76 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2.77 -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o debugif.obj `if test -f 'gui/debugif.c'; then $(CYGPATH_W) 'gui/debugif.c'; else $(CYGPATH_W) '$(srcdir)/gui/debugif.c'; fi`
2.78 -
2.79 -debugcb.o: gui/debugcb.c
2.80 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT debugcb.o -MD -MP -MF "$(DEPDIR)/debugcb.Tpo" \
2.81 -@am__fastdepCC_TRUE@ -c -o debugcb.o `test -f 'gui/debugcb.c' || echo '$(srcdir)/'`gui/debugcb.c; \
2.82 -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/debugcb.Tpo" "$(DEPDIR)/debugcb.Po"; \
2.83 -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/debugcb.Tpo"; exit 1; \
2.84 -@am__fastdepCC_TRUE@ fi
2.85 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gui/debugcb.c' object='debugcb.o' libtool=no @AMDEPBACKSLASH@
2.86 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/debugcb.Po' tmpdepfile='$(DEPDIR)/debugcb.TPo' @AMDEPBACKSLASH@
2.87 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2.88 -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o debugcb.o `test -f 'gui/debugcb.c' || echo '$(srcdir)/'`gui/debugcb.c
2.89 -
2.90 -debugcb.obj: gui/debugcb.c
2.91 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT debugcb.obj -MD -MP -MF "$(DEPDIR)/debugcb.Tpo" \
2.92 -@am__fastdepCC_TRUE@ -c -o debugcb.obj `if test -f 'gui/debugcb.c'; then $(CYGPATH_W) 'gui/debugcb.c'; else $(CYGPATH_W) '$(srcdir)/gui/debugcb.c'; fi`; \
2.93 -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/debugcb.Tpo" "$(DEPDIR)/debugcb.Po"; \
2.94 -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/debugcb.Tpo"; exit 1; \
2.95 -@am__fastdepCC_TRUE@ fi
2.96 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gui/debugcb.c' object='debugcb.obj' libtool=no @AMDEPBACKSLASH@
2.97 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/debugcb.Po' tmpdepfile='$(DEPDIR)/debugcb.TPo' @AMDEPBACKSLASH@
2.98 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2.99 -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o debugcb.obj `if test -f 'gui/debugcb.c'; then $(CYGPATH_W) 'gui/debugcb.c'; else $(CYGPATH_W) '$(srcdir)/gui/debugcb.c'; fi`
2.100 -
2.101 mmio_win.o: gui/mmio_win.c
2.102 @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mmio_win.o -MD -MP -MF "$(DEPDIR)/mmio_win.Tpo" \
2.103 @am__fastdepCC_TRUE@ -c -o mmio_win.o `test -f 'gui/mmio_win.c' || echo '$(srcdir)/'`gui/mmio_win.c; \
3.1 --- a/src/gui/debug_win.c Sun Oct 21 05:31:07 2007 +0000
3.2 +++ b/src/gui/debug_win.c Sun Oct 21 11:38:02 2007 +0000
3.3 @@ -1,5 +1,5 @@
3.4 /**
3.5 - * $Id: debug_win.c,v 1.25 2007-10-21 05:21:35 nkeynes Exp $
3.6 + * $Id: debug_win.c,v 1.26 2007-10-21 11:38:02 nkeynes Exp $
3.7 * This file is responsible for the main debugger gui frame.
3.8 *
3.9 * Copyright (c) 2005 Nathan Keynes.
3.10 @@ -44,7 +44,7 @@
3.11 GdkEvent *event, gpointer user_data);
3.12 void on_disasm_list_unselect_row (GtkCList *clist, gint row, gint column,
3.13 GdkEvent *event, gpointer user_data);
3.14 -
3.15 +gboolean on_debug_delete_event(GtkWidget *widget, GdkEvent event, gpointer user_data);
3.16
3.17 struct debug_window_info {
3.18 int disasm_from;
3.19 @@ -79,7 +79,6 @@
3.20 GtkWidget *hpaned = gtk_hpaned_new ();
3.21 gtk_paned_set_position (GTK_PANED (hpaned), 800);
3.22
3.23 -
3.24 GtkWidget *disasm_box = gtk_vbox_new(FALSE,0);
3.25 gtk_paned_pack1 (GTK_PANED (hpaned), disasm_box, TRUE, TRUE);
3.26
3.27 @@ -152,6 +151,9 @@
3.28 g_signal_connect ((gpointer) data->disasm_list, "unselect_row",
3.29 G_CALLBACK (on_disasm_list_unselect_row),
3.30 data);
3.31 + g_signal_connect ((gpointer) data->window, "delete_event",
3.32 + G_CALLBACK (on_debug_delete_event),
3.33 + data);
3.34
3.35 data->disasm_from = -1;
3.36 data->disasm_to = -1;
3.37 @@ -442,3 +444,9 @@
3.38 gtk_gui_enable_action( "SetBreakpoint", FALSE );
3.39 gtk_gui_enable_action( "RunTo", FALSE );
3.40 }
3.41 +
3.42 +gboolean on_debug_delete_event(GtkWidget *widget, GdkEvent event, gpointer user_data)
3.43 +{
3.44 + gtk_widget_hide( widget );
3.45 + return TRUE;
3.46 +}
4.1 --- a/src/gui/debugcb.c Sun Oct 21 05:31:07 2007 +0000
4.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
4.3 @@ -1,58 +0,0 @@
4.4 -/**
4.5 - * $Id: debugcb.c,v 1.3 2007-10-21 05:21:35 nkeynes Exp $
4.6 - *
4.7 - * All GTK callbacks go here (stubs are autogenerated by Glade)
4.8 - *
4.9 - * Copyright (c) 2005 Nathan Keynes.
4.10 - *
4.11 - * This program is free software; you can redistribute it and/or modify
4.12 - * it under the terms of the GNU General Public License as published by
4.13 - * the Free Software Foundation; either version 2 of the License, or
4.14 - * (at your option) any later version.
4.15 - *
4.16 - * This program is distributed in the hope that it will be useful,
4.17 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
4.18 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4.19 - * GNU General Public License for more details.
4.20 - */
4.21 -
4.22 -#include <gnome.h>
4.23 -
4.24 -#include "config.h"
4.25 -#include "gui/debugcb.h"
4.26 -#include "gui/debugif.h"
4.27 -#include "gui/gtkui.h"
4.28 -#include "gdrom/gdrom.h"
4.29 -#include "mem.h"
4.30 -#include "mmio.h"
4.31 -#include "dreamcast.h"
4.32 -#include "loader.h"
4.33 -#include "pvr2/pvr2.h"
4.34 -
4.35 -void on_trace_button_toggled (GtkToggleButton *button,
4.36 - gpointer user_data)
4.37 -{
4.38 - struct mmio_region *io_rgn = (struct mmio_region *)user_data;
4.39 - gboolean isActive = gtk_toggle_button_get_active(button);
4.40 - if( io_rgn != NULL ) {
4.41 - io_rgn->trace_flag = isActive ? 1 : 0;
4.42 - }
4.43 -}
4.44 -
4.45 -
4.46 -gboolean
4.47 -on_mmr_win_delete_event (GtkWidget *widget,
4.48 - GdkEvent *event,
4.49 - gpointer user_data)
4.50 -{
4.51 - mmr_close_win();
4.52 - return TRUE;
4.53 -}
4.54 -
4.55 -
4.56 -void
4.57 -on_mmr_close_clicked (GtkButton *button,
4.58 - gpointer user_data)
4.59 -{
4.60 - mmr_close_win();
4.61 -}
5.1 --- a/src/gui/debugcb.h Sun Oct 21 05:31:07 2007 +0000
5.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
5.3 @@ -1,209 +0,0 @@
5.4 -/**
5.5 - * $Id: debugcb.h,v 1.1 2007-10-10 11:02:04 nkeynes Exp $
5.6 - *
5.7 - * GTK callback declarations (stubs are autogenerated by Glade)
5.8 - *
5.9 - * Copyright (c) 2005 Nathan Keynes.
5.10 - *
5.11 - * This program is free software; you can redistribute it and/or modify
5.12 - * it under the terms of the GNU General Public License as published by
5.13 - * the Free Software Foundation; either version 2 of the License, or
5.14 - * (at your option) any later version.
5.15 - *
5.16 - * This program is distributed in the hope that it will be useful,
5.17 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
5.18 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5.19 - * GNU General Public License for more details.
5.20 - */
5.21 -#include <gnome.h>
5.22 -
5.23 -void
5.24 -on_new_file1_activate (GtkMenuItem *menuitem,
5.25 - gpointer user_data);
5.26 -
5.27 -void
5.28 -on_open1_activate (GtkMenuItem *menuitem,
5.29 - gpointer user_data);
5.30 -
5.31 -void
5.32 -on_save1_activate (GtkMenuItem *menuitem,
5.33 - gpointer user_data);
5.34 -
5.35 -void
5.36 -on_save_as1_activate (GtkMenuItem *menuitem,
5.37 - gpointer user_data);
5.38 -
5.39 -void
5.40 -on_save_next_scene_activate (GtkMenuItem *menuitem,
5.41 - gpointer user_data);
5.42 -
5.43 -void
5.44 -on_exit1_activate (GtkMenuItem *menuitem,
5.45 - gpointer user_data);
5.46 -
5.47 -void
5.48 -on_preferences1_activate (GtkMenuItem *menuitem,
5.49 - gpointer user_data);
5.50 -
5.51 -void
5.52 -on_about1_activate (GtkMenuItem *menuitem,
5.53 - gpointer user_data);
5.54 -
5.55 -void
5.56 -on_load_btn_clicked (GtkButton *button,
5.57 - gpointer user_data);
5.58 -
5.59 -void
5.60 -on_reset_btn_clicked (GtkButton *button,
5.61 - gpointer user_data);
5.62 -
5.63 -void
5.64 -on_stop_btn_clicked (GtkButton *button,
5.65 - gpointer user_data);
5.66 -
5.67 -void
5.68 -on_step_btn_clicked (GtkButton *button,
5.69 - gpointer user_data);
5.70 -
5.71 -void
5.72 -on_run_btn_clicked (GtkButton *button,
5.73 - gpointer user_data);
5.74 -
5.75 -void
5.76 -on_runto_btn_clicked (GtkButton *button,
5.77 - gpointer user_data);
5.78 -
5.79 -void
5.80 -on_break_btn_clicked (GtkButton *button,
5.81 - gpointer user_data);
5.82 -
5.83 -void
5.84 -on_trace_button_toggled (GtkToggleButton *button,
5.85 - gpointer user_data);
5.86 -
5.87 -gboolean
5.88 -on_debug_win_delete_event (GtkWidget *widget,
5.89 - GdkEvent *event,
5.90 - gpointer user_data);
5.91 -
5.92 -void
5.93 -on_disasm_list_select_row (GtkCList *clist,
5.94 - gint row,
5.95 - gint column,
5.96 - GdkEvent *event,
5.97 - gpointer user_data);
5.98 -
5.99 -void
5.100 -on_disasm_list_unselect_row (GtkCList *clist,
5.101 - gint row,
5.102 - gint column,
5.103 - GdkEvent *event,
5.104 - gpointer user_data);
5.105 -
5.106 -void
5.107 -on_mem_mapped_regs1_activate (GtkMenuItem *menuitem,
5.108 - gpointer user_data);
5.109 -
5.110 -void
5.111 -on_mmu_reglist_select_row (GtkCList *clist,
5.112 - gint row,
5.113 - gint column,
5.114 - GdkEvent *event,
5.115 - gpointer user_data);
5.116 -
5.117 -void
5.118 -on_mmu_regclose_clicked (GtkButton *button,
5.119 - gpointer user_data);
5.120 -
5.121 -gboolean
5.122 -on_mmr_win_delete_event (GtkWidget *widget,
5.123 - GdkEvent *event,
5.124 - gpointer user_data);
5.125 -
5.126 -void
5.127 -on_mmr_close_clicked (GtkButton *button,
5.128 - gpointer user_data);
5.129 -
5.130 -void
5.131 -on_page_field_changed (GtkEditable *editable,
5.132 - gpointer user_data);
5.133 -
5.134 -void
5.135 -on_mode_field_changed (GtkEditable *editable,
5.136 - gpointer user_data);
5.137 -
5.138 -void
5.139 -on_disasm_list_select_row (GtkCList *clist,
5.140 - gint row,
5.141 - gint column,
5.142 - GdkEvent *event,
5.143 - gpointer user_data);
5.144 -
5.145 -void
5.146 -on_disasm_list_unselect_row (GtkCList *clist,
5.147 - gint row,
5.148 - gint column,
5.149 - GdkEvent *event,
5.150 - gpointer user_data);
5.151 -
5.152 -void
5.153 -on_page_locked_btn_toggled (GtkToggleButton *togglebutton,
5.154 - gpointer user_data);
5.155 -
5.156 -gboolean
5.157 -on_page_field_key_press_event (GtkWidget *widget,
5.158 - GdkEventKey *event,
5.159 - gpointer user_data);
5.160 -
5.161 -void
5.162 -on_output_list_select_row (GtkCList *clist,
5.163 - gint row,
5.164 - gint column,
5.165 - GdkEvent *event,
5.166 - gpointer user_data);
5.167 -
5.168 -void
5.169 -on_jump_pc_btn_clicked (GtkButton *button,
5.170 - gpointer user_data);
5.171 -
5.172 -void
5.173 -on_memory1_activate (GtkMenuItem *menuitem,
5.174 - gpointer user_data);
5.175 -
5.176 -gboolean
5.177 -on_memory_win_delete_event (GtkWidget *widget,
5.178 - GdkEvent *event,
5.179 - gpointer user_data);
5.180 -
5.181 -void
5.182 -button_view_clicked (GtkButton *button,
5.183 - gpointer user_data);
5.184 -
5.185 -void
5.186 -on_button_add_watch_clicked (GtkButton *button,
5.187 - gpointer user_data);
5.188 -
5.189 -void
5.190 -on_button_clear_all_clicked (GtkButton *button,
5.191 - gpointer user_data);
5.192 -
5.193 -void
5.194 -on_button_close_clicked (GtkButton *button,
5.195 - gpointer user_data);
5.196 -
5.197 -gboolean
5.198 -on_dump_win_delete_event (GtkWidget *widget,
5.199 - GdkEvent *event,
5.200 - gpointer user_data);
5.201 -
5.202 -void
5.203 -on_view_memory_activate (GtkMenuItem *menuitem,
5.204 - gpointer user_data);
5.205 -
5.206 -void
5.207 -on_loadstate_button_clicked (GtkToolButton *toolbutton,
5.208 - gpointer user_data);
5.209 -
5.210 -void
5.211 -on_savestate_button_clicked (GtkToolButton *toolbutton,
5.212 - gpointer user_data);
6.1 --- a/src/gui/debugif.c Sun Oct 21 05:31:07 2007 +0000
6.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
6.3 @@ -1,164 +0,0 @@
6.4 -/*
6.5 - * DO NOT EDIT THIS FILE - it is generated by Glade.
6.6 - */
6.7 -
6.8 -#ifdef HAVE_CONFIG_H
6.9 -# include <config.h>
6.10 -#endif
6.11 -
6.12 -#include <sys/types.h>
6.13 -#include <sys/stat.h>
6.14 -#include <unistd.h>
6.15 -#include <string.h>
6.16 -#include <stdio.h>
6.17 -
6.18 -#include <bonobo.h>
6.19 -#include <gnome.h>
6.20 -
6.21 -#include "debugcb.h"
6.22 -#include "debugif.h"
6.23 -#include "support.h"
6.24 -
6.25 -#define GLADE_HOOKUP_OBJECT(component,widget,name) \
6.26 - g_object_set_data_full (G_OBJECT (component), name, \
6.27 - gtk_widget_ref (widget), (GDestroyNotify) gtk_widget_unref)
6.28 -
6.29 -#define GLADE_HOOKUP_OBJECT_NO_REF(component,widget,name) \
6.30 - g_object_set_data (G_OBJECT (component), name, widget)
6.31 -
6.32 -GtkWidget*
6.33 -create_mmr_win (void)
6.34 -{
6.35 - GtkWidget *mmr_win;
6.36 - GtkWidget *vbox1;
6.37 - GtkWidget *mmr_notebook;
6.38 - GtkWidget *empty_notebook_page;
6.39 - GtkWidget *label16;
6.40 - GtkWidget *hbuttonbox1;
6.41 - GtkWidget *mmr_close;
6.42 -
6.43 - mmr_win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
6.44 - gtk_window_set_title (GTK_WINDOW (mmr_win), _("lxDream! - Memory-Mapped Registers"));
6.45 - gtk_window_set_default_size (GTK_WINDOW (mmr_win), 600, 600);
6.46 -
6.47 - vbox1 = gtk_vbox_new (FALSE, 0);
6.48 - gtk_widget_show (vbox1);
6.49 - gtk_container_add (GTK_CONTAINER (mmr_win), vbox1);
6.50 -
6.51 - mmr_notebook = gtk_notebook_new ();
6.52 - gtk_widget_show (mmr_notebook);
6.53 - gtk_box_pack_start (GTK_BOX (vbox1), mmr_notebook, TRUE, TRUE, 0);
6.54 - gtk_notebook_set_tab_pos (GTK_NOTEBOOK (mmr_notebook), GTK_POS_LEFT);
6.55 -
6.56 - empty_notebook_page = gtk_vbox_new (FALSE, 0);
6.57 - gtk_widget_show (empty_notebook_page);
6.58 - gtk_container_add (GTK_CONTAINER (mmr_notebook), empty_notebook_page);
6.59 -
6.60 - label16 = gtk_label_new (_("label16"));
6.61 - gtk_widget_show (label16);
6.62 - gtk_notebook_set_tab_label (GTK_NOTEBOOK (mmr_notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (mmr_notebook), 0), label16);
6.63 - gtk_label_set_justify (GTK_LABEL (label16), GTK_JUSTIFY_CENTER);
6.64 -
6.65 - hbuttonbox1 = gtk_hbutton_box_new ();
6.66 - gtk_widget_show (hbuttonbox1);
6.67 - gtk_box_pack_start (GTK_BOX (vbox1), hbuttonbox1, FALSE, TRUE, 0);
6.68 - gtk_box_set_spacing (GTK_BOX (hbuttonbox1), 30);
6.69 -
6.70 - mmr_close = gtk_button_new_with_mnemonic (_("Close"));
6.71 - gtk_widget_show (mmr_close);
6.72 - gtk_container_add (GTK_CONTAINER (hbuttonbox1), mmr_close);
6.73 - GTK_WIDGET_SET_FLAGS (mmr_close, GTK_CAN_DEFAULT);
6.74 -
6.75 - g_signal_connect ((gpointer) mmr_win, "delete_event",
6.76 - G_CALLBACK (on_mmr_win_delete_event),
6.77 - NULL);
6.78 - g_signal_connect ((gpointer) mmr_close, "clicked",
6.79 - G_CALLBACK (on_mmr_close_clicked),
6.80 - NULL);
6.81 -
6.82 - /* Store pointers to all widgets, for use by lookup_widget(). */
6.83 - GLADE_HOOKUP_OBJECT_NO_REF (mmr_win, mmr_win, "mmr_win");
6.84 - GLADE_HOOKUP_OBJECT (mmr_win, vbox1, "vbox1");
6.85 - GLADE_HOOKUP_OBJECT (mmr_win, mmr_notebook, "mmr_notebook");
6.86 - GLADE_HOOKUP_OBJECT (mmr_win, label16, "label16");
6.87 - GLADE_HOOKUP_OBJECT (mmr_win, hbuttonbox1, "hbuttonbox1");
6.88 - GLADE_HOOKUP_OBJECT (mmr_win, mmr_close, "mmr_close");
6.89 -
6.90 - return mmr_win;
6.91 -}
6.92 -
6.93 -GtkWidget*
6.94 -create_dump_win (void)
6.95 -{
6.96 - GtkWidget *dump_win;
6.97 - GtkWidget *vbox3;
6.98 - GtkWidget *hbox2;
6.99 - GtkWidget *label34;
6.100 - GtkWidget *dump_from;
6.101 - GtkWidget *label35;
6.102 - GtkWidget *dump_to;
6.103 - GtkWidget *dump_view_button;
6.104 - GtkWidget *label36;
6.105 - GtkWidget *scrolledwindow9;
6.106 - GtkWidget *dump_text;
6.107 -
6.108 - dump_win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
6.109 - gtk_window_set_title (GTK_WINDOW (dump_win), _("Memory dump"));
6.110 -
6.111 - vbox3 = gtk_vbox_new (FALSE, 0);
6.112 - gtk_widget_show (vbox3);
6.113 - gtk_container_add (GTK_CONTAINER (dump_win), vbox3);
6.114 -
6.115 - hbox2 = gtk_hbox_new (FALSE, 0);
6.116 - gtk_widget_show (hbox2);
6.117 - gtk_box_pack_start (GTK_BOX (vbox3), hbox2, FALSE, TRUE, 3);
6.118 -
6.119 - label34 = gtk_label_new (_(" From "));
6.120 - gtk_widget_show (label34);
6.121 - gtk_box_pack_start (GTK_BOX (hbox2), label34, FALSE, FALSE, 0);
6.122 -
6.123 - dump_from = gtk_entry_new ();
6.124 - gtk_widget_show (dump_from);
6.125 - gtk_box_pack_start (GTK_BOX (hbox2), dump_from, FALSE, TRUE, 0);
6.126 -
6.127 - label35 = gtk_label_new (_(" To "));
6.128 - gtk_widget_show (label35);
6.129 - gtk_box_pack_start (GTK_BOX (hbox2), label35, FALSE, FALSE, 0);
6.130 -
6.131 - dump_to = gtk_entry_new ();
6.132 - gtk_widget_show (dump_to);
6.133 - gtk_box_pack_start (GTK_BOX (hbox2), dump_to, FALSE, TRUE, 0);
6.134 -
6.135 - dump_view_button = gtk_button_new_with_mnemonic (_("View"));
6.136 - gtk_widget_show (dump_view_button);
6.137 - gtk_box_pack_start (GTK_BOX (hbox2), dump_view_button, FALSE, FALSE, 0);
6.138 -
6.139 - label36 = gtk_label_new (_(" "));
6.140 - gtk_widget_show (label36);
6.141 - gtk_box_pack_start (GTK_BOX (hbox2), label36, TRUE, TRUE, 0);
6.142 -
6.143 - scrolledwindow9 = gtk_scrolled_window_new (NULL, NULL);
6.144 - gtk_widget_show (scrolledwindow9);
6.145 - gtk_box_pack_start (GTK_BOX (vbox3), scrolledwindow9, TRUE, TRUE, 0);
6.146 - gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow9), GTK_SHADOW_IN);
6.147 -
6.148 - dump_text = gtk_text_view_new ();
6.149 - gtk_widget_show (dump_text);
6.150 - gtk_container_add (GTK_CONTAINER (scrolledwindow9), dump_text);
6.151 -
6.152 - /* Store pointers to all widgets, for use by lookup_widget(). */
6.153 - GLADE_HOOKUP_OBJECT_NO_REF (dump_win, dump_win, "dump_win");
6.154 - GLADE_HOOKUP_OBJECT (dump_win, vbox3, "vbox3");
6.155 - GLADE_HOOKUP_OBJECT (dump_win, hbox2, "hbox2");
6.156 - GLADE_HOOKUP_OBJECT (dump_win, label34, "label34");
6.157 - GLADE_HOOKUP_OBJECT (dump_win, dump_from, "dump_from");
6.158 - GLADE_HOOKUP_OBJECT (dump_win, label35, "label35");
6.159 - GLADE_HOOKUP_OBJECT (dump_win, dump_to, "dump_to");
6.160 - GLADE_HOOKUP_OBJECT (dump_win, dump_view_button, "dump_view_button");
6.161 - GLADE_HOOKUP_OBJECT (dump_win, label36, "label36");
6.162 - GLADE_HOOKUP_OBJECT (dump_win, scrolledwindow9, "scrolledwindow9");
6.163 - GLADE_HOOKUP_OBJECT (dump_win, dump_text, "dump_text");
6.164 -
6.165 - return dump_win;
6.166 -}
6.167 -
7.1 --- a/src/gui/debugif.h Sun Oct 21 05:31:07 2007 +0000
7.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
7.3 @@ -1,9 +0,0 @@
7.4 -/*
7.5 - * DO NOT EDIT THIS FILE - it is generated by Glade.
7.6 - */
7.7 -
7.8 -GtkWidget* create_debug_win (void);
7.9 -GtkWidget* create_mmr_win (void);
7.10 -GtkWidget* create_about_win (void);
7.11 -GtkWidget* create_dump_win (void);
7.12 -GtkWidget* create_watch_win (void);
8.1 --- a/src/gui/dump_win.c Sun Oct 21 05:31:07 2007 +0000
8.2 +++ b/src/gui/dump_win.c Sun Oct 21 11:38:02 2007 +0000
8.3 @@ -1,5 +1,5 @@
8.4 /**
8.5 - * $Id: dump_win.c,v 1.5 2007-10-21 05:21:35 nkeynes Exp $
8.6 + * $Id: dump_win.c,v 1.6 2007-10-21 11:38:02 nkeynes Exp $
8.7 *
8.8 * Implements the memory dump window.
8.9 *
8.10 @@ -21,67 +21,99 @@
8.11 #include <assert.h>
8.12 #include "mem.h"
8.13 #include "gui/gtkui.h"
8.14 -#include "gui/debugif.h"
8.15
8.16 #define MAX_DUMP_SIZE 4096
8.17
8.18 -#define DUMP_DATA_TAG 0xD4B9DA7A
8.19 +#define DUMP_WINDOW_TAG 0xD4B9DA7A
8.20
8.21 -typedef struct dump_data {
8.22 +struct dump_window_info {
8.23 uint32_t _tag;
8.24 uint32_t start;
8.25 uint32_t end;
8.26 int flags;
8.27 unsigned char *data;
8.28
8.29 - GtkEntry *fromInput, *toInput;
8.30 - GtkTextView *textArea;
8.31 + GtkWidget *window;
8.32 + GtkWidget *fromInput, *toInput;
8.33 + GtkWidget *textArea;
8.34 GtkTextTag *changedTag;
8.35 GtkTextBuffer *textBuffer;
8.36 - struct dump_data *next;
8.37 -} *dump_data_t;
8.38 + struct dump_window_info *next;
8.39 +};
8.40
8.41 -static dump_data_t dump_list_head = NULL;
8.42 +static dump_window_t dump_list_head = NULL;
8.43
8.44 gboolean on_dump_window_delete_event( GtkWidget *widget, GdkEvent *event,
8.45 gpointer user_data );
8.46 void on_dump_window_button_view_clicked( GtkWidget *widget, gpointer user_data );
8.47 -void dump_window_set_text( dump_data_t data, unsigned char *old_data, unsigned char *new_data );
8.48 +void dump_window_set_text( dump_window_t data, unsigned char *old_data, unsigned char *new_data );
8.49
8.50
8.51 -void dump_window_new( const gchar *title ) {
8.52 - GtkWidget *win = create_dump_win();
8.53 - GtkWidget *dump_view_button = (GtkWidget *)g_object_get_data(G_OBJECT(win), "dump_view_button");
8.54 - dump_data_t data = malloc( sizeof(struct dump_data) );
8.55 - data->_tag = DUMP_DATA_TAG;
8.56 - data->fromInput = (GtkEntry *)g_object_get_data(G_OBJECT(win), "dump_from");
8.57 - data->toInput = (GtkEntry *)g_object_get_data(G_OBJECT(win), "dump_to");
8.58 - data->textArea = (GtkTextView *)g_object_get_data(G_OBJECT(win), "dump_text");
8.59 - data->next = dump_list_head;
8.60 - dump_list_head = data;
8.61 - data->data = NULL;
8.62 - data->start = 0;
8.63 - data->end = 0;
8.64 - gtk_entry_set_text( data->fromInput, "" );
8.65 - gtk_entry_set_text( data->toInput, "" );
8.66 - data->textBuffer = gtk_text_buffer_new(NULL);
8.67 - data->changedTag = gtk_text_buffer_create_tag(data->textBuffer, "changed",
8.68 - "foreground", "blue",
8.69 - NULL);
8.70 - gtk_text_view_set_buffer(data->textArea, data->textBuffer);
8.71 - gtk_text_view_set_editable(data->textArea, FALSE);
8.72 - gtk_widget_modify_font(GTK_WIDGET(data->textArea),gui_fixed_font);
8.73 +dump_window_t dump_window_new( const gchar *title )
8.74 +{
8.75 + GtkWidget *vbox3;
8.76 + GtkWidget *hbox2;
8.77 + GtkWidget *dump_view_button;
8.78 + GtkWidget *scrolledwindow9;
8.79 +
8.80 + dump_window_t dump = g_malloc0( sizeof( struct dump_window_info ) );
8.81 +
8.82 + dump->_tag = DUMP_WINDOW_TAG;
8.83 + dump->next = dump_list_head;
8.84 + dump_list_head = dump;
8.85 + dump->data = NULL;
8.86 + dump->start = 0;
8.87 + dump->end = 0;
8.88 + dump->window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
8.89 + gtk_window_set_title (GTK_WINDOW (dump->window), _("Memory dump"));
8.90 +
8.91 + vbox3 = gtk_vbox_new (FALSE, 0);
8.92 + gtk_container_add (GTK_CONTAINER (dump->window), vbox3);
8.93 +
8.94 + hbox2 = gtk_hbox_new (FALSE, 0);
8.95 + dump->fromInput = gtk_entry_new ();
8.96 + gtk_entry_set_text( GTK_ENTRY(dump->fromInput), "" );
8.97 + dump->toInput = gtk_entry_new ();
8.98 + gtk_entry_set_text( GTK_ENTRY(dump->toInput), "" );
8.99 + dump_view_button = gtk_button_new_with_mnemonic (_("View"));
8.100 +
8.101 + gtk_box_pack_start (GTK_BOX (hbox2), gtk_label_new(_(" From ")), FALSE, FALSE, 0);
8.102 + gtk_box_pack_start (GTK_BOX (hbox2), dump->fromInput, FALSE, TRUE, 0);
8.103 + gtk_box_pack_start (GTK_BOX (hbox2), gtk_label_new(_(" To ")), FALSE, FALSE, 0);
8.104 + gtk_box_pack_start (GTK_BOX (hbox2), dump->toInput, FALSE, TRUE, 0);
8.105 + gtk_box_pack_start (GTK_BOX (hbox2), dump_view_button, FALSE, FALSE, 0);
8.106 + gtk_box_pack_start (GTK_BOX (hbox2), gtk_label_new (_(" ")), TRUE, TRUE, 0);
8.107 + gtk_box_pack_start (GTK_BOX (vbox3), hbox2, FALSE, TRUE, 3);
8.108 +
8.109 + dump->textArea = gtk_text_view_new ();
8.110 + dump->textBuffer = gtk_text_buffer_new(NULL);
8.111 + dump->changedTag = gtk_text_buffer_create_tag(dump->textBuffer, "changed",
8.112 + "foreground", "blue", NULL);
8.113 + gtk_widget_modify_font(GTK_WIDGET(dump->textArea),gui_fixed_font);
8.114 + gtk_text_view_set_editable(GTK_TEXT_VIEW(dump->textArea), FALSE);
8.115 + gtk_text_view_set_buffer(GTK_TEXT_VIEW(dump->textArea), dump->textBuffer);
8.116 + scrolledwindow9 = gtk_scrolled_window_new (NULL, NULL);
8.117 + gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow9), GTK_SHADOW_IN);
8.118 + gtk_container_add (GTK_CONTAINER (scrolledwindow9), dump->textArea);
8.119 + gtk_box_pack_start (GTK_BOX (vbox3), scrolledwindow9, TRUE, TRUE, 0);
8.120
8.121 - g_signal_connect ((gpointer) win, "delete_event",
8.122 + g_signal_connect (dump->window, "delete_event",
8.123 G_CALLBACK (on_dump_window_delete_event),
8.124 - data);
8.125 - g_signal_connect ((gpointer) dump_view_button, "clicked",
8.126 + dump);
8.127 + g_signal_connect (dump_view_button, "clicked",
8.128 G_CALLBACK (on_dump_window_button_view_clicked),
8.129 - data);
8.130 - gtk_widget_show( GTK_WIDGET(win) );
8.131 + dump);
8.132 + gtk_widget_show_all( dump->window );
8.133 +
8.134 + return dump;
8.135 }
8.136
8.137 -
8.138 +void gtk_entry_set_hex_value( GtkEntry *entry, uint32_t value )
8.139 +{
8.140 + char buf[10];
8.141 + sprintf( buf, "%08X", value );
8.142 + gtk_entry_set_text( entry, buf );
8.143 +}
8.144
8.145 uint32_t gtk_entry_get_hex_value( GtkEntry *entry, uint32_t defaultValue )
8.146 {
8.147 @@ -97,21 +129,13 @@
8.148 return value;
8.149 }
8.150
8.151 -void gtk_entry_set_hex_value( GtkEntry *entry, uint32_t value )
8.152 -{
8.153 - char buf[10];
8.154 - sprintf( buf, "%08X", value );
8.155 - gtk_entry_set_text( entry, buf );
8.156 -}
8.157 -
8.158 -
8.159 gboolean on_dump_window_delete_event( GtkWidget *widget, GdkEvent *event,
8.160 gpointer user_data )
8.161 {
8.162 - dump_data_t data = (dump_data_t)user_data;
8.163 + dump_window_t data = (dump_window_t)user_data;
8.164 if( data->data != NULL )
8.165 free( data->data );
8.166 - dump_data_t node = dump_list_head;
8.167 + dump_window_t node = dump_list_head;
8.168 if( node == data )
8.169 dump_list_head = data->next;
8.170 else {
8.171 @@ -127,14 +151,14 @@
8.172
8.173 void on_dump_window_button_view_clicked( GtkWidget *widget, gpointer user_data )
8.174 {
8.175 - dump_data_t data = (dump_data_t)user_data;
8.176 + dump_window_t data = (dump_window_t)user_data;
8.177 uint32_t startVal, endVal;
8.178
8.179 assert( data != NULL );
8.180 - assert( data->_tag == DUMP_DATA_TAG );
8.181 + assert( data->_tag == DUMP_WINDOW_TAG );
8.182
8.183 - startVal = gtk_entry_get_hex_value(data->fromInput, data->start);
8.184 - endVal = gtk_entry_get_hex_value(data->toInput, data->end);
8.185 + startVal = gtk_entry_get_hex_value(GTK_ENTRY(data->fromInput), data->start);
8.186 + endVal = gtk_entry_get_hex_value(GTK_ENTRY(data->toInput), data->end);
8.187 if( startVal != data->start || endVal != data->end ) {
8.188 if( startVal > endVal ) {
8.189 int tmp = endVal;
8.190 @@ -144,8 +168,8 @@
8.191 if( endVal > startVal + MAX_DUMP_SIZE )
8.192 endVal = startVal + MAX_DUMP_SIZE;
8.193
8.194 - gtk_entry_set_hex_value(data->fromInput,startVal);
8.195 - gtk_entry_set_hex_value(data->toInput,endVal);
8.196 + gtk_entry_set_hex_value(GTK_ENTRY(data->fromInput),startVal);
8.197 + gtk_entry_set_hex_value(GTK_ENTRY(data->toInput),endVal);
8.198 data->start = startVal;
8.199 data->end = endVal;
8.200
8.201 @@ -161,7 +185,7 @@
8.202 }
8.203 }
8.204
8.205 -void dump_window_update( dump_data_t data )
8.206 +void dump_window_update( dump_window_t data )
8.207 {
8.208 if( data->data == NULL )
8.209 return;
8.210 @@ -174,14 +198,14 @@
8.211
8.212 void dump_window_update_all( )
8.213 {
8.214 - dump_data_t node = dump_list_head;
8.215 + dump_window_t node = dump_list_head;
8.216 while( node != NULL ) {
8.217 dump_window_update(node);
8.218 node = node->next;
8.219 }
8.220 }
8.221
8.222 -void dump_window_set_text( dump_data_t data, unsigned char *old_data, unsigned char *new_data )
8.223 +void dump_window_set_text( dump_window_t data, unsigned char *old_data, unsigned char *new_data )
8.224 {
8.225 GtkTextBuffer *buf = data->textBuffer;
8.226 GtkTextTag *changedTag = data->changedTag;
9.1 --- a/src/gui/gtkui.c Sun Oct 21 05:31:07 2007 +0000
9.2 +++ b/src/gui/gtkui.c Sun Oct 21 11:38:02 2007 +0000
9.3 @@ -1,5 +1,5 @@
9.4 /**
9.5 - * $Id: gtkui.c,v 1.5 2007-10-21 05:21:35 nkeynes Exp $
9.6 + * $Id: gtkui.c,v 1.6 2007-10-21 11:38:02 nkeynes Exp $
9.7 *
9.8 * Core GTK-based user interface
9.9 *
9.10 @@ -322,7 +322,7 @@
9.11 debug_window_update(debug_win);
9.12 }
9.13 if( mmio_win ) {
9.14 - mmio_win_update(mmio_win);
9.15 + mmio_window_update(mmio_win);
9.16 }
9.17 dump_window_update_all();
9.18 }
10.1 --- a/src/gui/gtkui.h Sun Oct 21 05:31:07 2007 +0000
10.2 +++ b/src/gui/gtkui.h Sun Oct 21 11:38:02 2007 +0000
10.3 @@ -1,5 +1,5 @@
10.4 /**
10.5 - * $Id: gtkui.h,v 1.5 2007-10-21 05:21:35 nkeynes Exp $
10.6 + * $Id: gtkui.h,v 1.6 2007-10-21 11:38:02 nkeynes Exp $
10.7 *
10.8 * Core GTK-based user interface
10.9 *
10.10 @@ -28,6 +28,7 @@
10.11 typedef struct main_window_info *main_window_t;
10.12 typedef struct debug_window_info *debug_window_t;
10.13 typedef struct mmio_window_info *mmio_window_t;
10.14 +typedef struct dump_window_info *dump_window_t;
10.15
10.16 /**
10.17 * Construct and show the main window, returning an
10.18 @@ -54,7 +55,7 @@
10.19 mmio_window_t mmio_window_new( const gchar *title );
10.20 void mmio_window_show( mmio_window_t win, gboolean show );
10.21
10.22 -void dump_window_new( const gchar *title );
10.23 +dump_window_t dump_window_new( const gchar *title );
10.24
10.25 void maple_dialog_run();
10.26 void path_dialog_run();
11.1 --- a/src/gui/main_win.c Sun Oct 21 05:31:07 2007 +0000
11.2 +++ b/src/gui/main_win.c Sun Oct 21 11:38:02 2007 +0000
11.3 @@ -1,5 +1,5 @@
11.4 /**
11.5 - * $Id: main_win.c,v 1.6 2007-10-21 05:21:35 nkeynes Exp $
11.6 + * $Id: main_win.c,v 1.7 2007-10-21 11:38:02 nkeynes Exp $
11.7 *
11.8 * Define the main (emu) GTK window, along with its menubars,
11.9 * toolbars, etc.
11.10 @@ -38,6 +38,11 @@
11.11 GtkActionGroup *actions;
11.12 };
11.13
11.14 +gboolean on_main_window_deleted( GtkWidget *widget, GdkEvent event, gpointer user_data )
11.15 +{
11.16 + exit(0);
11.17 +}
11.18 +
11.19 main_window_t main_window_new( const gchar *title, GtkWidget *menubar, GtkWidget *toolbar,
11.20 GtkAccelGroup *accel_group )
11.21 {
11.22 @@ -70,6 +75,8 @@
11.23 gtk_widget_grab_focus( win->video );
11.24
11.25 gtk_statusbar_push( GTK_STATUSBAR(win->statusbar), 1, "Stopped" );
11.26 + g_signal_connect( win->window, "delete_event",
11.27 + G_CALLBACK(on_main_window_deleted), win );
11.28 return win;
11.29 }
11.30
12.1 --- a/src/gui/mmio_win.c Sun Oct 21 05:31:07 2007 +0000
12.2 +++ b/src/gui/mmio_win.c Sun Oct 21 11:38:02 2007 +0000
12.3 @@ -1,5 +1,5 @@
12.4 /**
12.5 - * $Id: mmio_win.c,v 1.8 2007-10-21 05:21:35 nkeynes Exp $
12.6 + * $Id: mmio_win.c,v 1.9 2007-10-21 11:38:02 nkeynes Exp $
12.7 *
12.8 * Implements the MMIO register viewing window
12.9 *
12.10 @@ -18,14 +18,15 @@
12.11
12.12 #include <stdint.h>
12.13 #include <gnome.h>
12.14 -#include "debugif.h"
12.15 -#include "debugcb.h"
12.16 #include "gui/gtkui.h"
12.17 #include "mem.h"
12.18 #include "mmio.h"
12.19
12.20 -GtkWidget *mmr_win;
12.21 -GtkNotebook *mmr_book;
12.22 +
12.23 +struct mmio_window_info {
12.24 + GtkWidget *window;
12.25 + GtkWidget *notebook;
12.26 +};
12.27
12.28 static void printbits( char *out, int nbits, uint32_t value )
12.29 {
12.30 @@ -56,8 +57,36 @@
12.31 *out = '\0';
12.32 }
12.33
12.34 -
12.35 -static GtkCList *create_mmr_page( char *name, struct mmio_region *io_rgn )
12.36 +
12.37 +
12.38 +
12.39 +gboolean
12.40 +on_mmio_delete_event (GtkWidget *widget,
12.41 + GdkEvent *event,
12.42 + gpointer user_data)
12.43 +{
12.44 + gtk_widget_hide(widget);
12.45 + return TRUE;
12.46 +}
12.47 +
12.48 +
12.49 +void on_mmio_close_clicked( GtkButton *button, gpointer user_data)
12.50 +{
12.51 + gtk_widget_hide( ((mmio_window_t)user_data)->window );
12.52 +}
12.53 +
12.54 +
12.55 +void on_trace_button_toggled (GtkToggleButton *button,
12.56 + gpointer user_data)
12.57 +{
12.58 + struct mmio_region *io_rgn = (struct mmio_region *)user_data;
12.59 + gboolean isActive = gtk_toggle_button_get_active(button);
12.60 + if( io_rgn != NULL ) {
12.61 + io_rgn->trace_flag = isActive ? 1 : 0;
12.62 + }
12.63 +}
12.64 +
12.65 +static GtkCList *mmio_window_add_page( mmio_window_t mmio, char *name, struct mmio_region *io_rgn )
12.66 {
12.67 GtkCList *list;
12.68 GtkWidget *scroll;
12.69 @@ -66,7 +95,6 @@
12.70 GtkVBox *vbox;
12.71
12.72 scroll = gtk_scrolled_window_new(NULL, NULL);
12.73 - gtk_widget_show( scroll );
12.74 gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW(scroll),
12.75 GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS );
12.76 list = GTK_CLIST(gtk_clist_new(5));
12.77 @@ -85,38 +113,95 @@
12.78 gtk_clist_set_column_title(list, 4, "Description");
12.79 gtk_clist_column_titles_show(list);
12.80 gtk_widget_modify_font( GTK_WIDGET(list), gui_fixed_font );
12.81 - gtk_widget_show( GTK_WIDGET(list) );
12.82 tab = gtk_label_new(_(name));
12.83 - gtk_widget_show( tab );
12.84 gtk_container_add( GTK_CONTAINER(scroll), GTK_WIDGET(list) );
12.85
12.86 vbox = GTK_VBOX(gtk_vbox_new( FALSE, 0 ));
12.87 - gtk_widget_show( GTK_WIDGET(vbox) );
12.88 gtk_container_add( GTK_CONTAINER(vbox), GTK_WIDGET(scroll) );
12.89
12.90 trace_button = GTK_CHECK_BUTTON(gtk_check_button_new_with_label("Trace access"));
12.91 - gtk_widget_show( GTK_WIDGET(trace_button) );
12.92 gtk_container_add( GTK_CONTAINER(vbox), GTK_WIDGET(trace_button) );
12.93 gtk_box_set_child_packing( GTK_BOX(vbox), GTK_WIDGET(trace_button),
12.94 FALSE, FALSE, 0, GTK_PACK_START );
12.95 - gtk_notebook_append_page( mmr_book, GTK_WIDGET(vbox), tab );
12.96 - gtk_object_set_data( GTK_OBJECT(mmr_win), name, list );
12.97 + gtk_notebook_append_page( GTK_NOTEBOOK(mmio->notebook), GTK_WIDGET(vbox), tab );
12.98 + gtk_object_set_data( GTK_OBJECT(mmio->window), name, list );
12.99 g_signal_connect ((gpointer) trace_button, "toggled",
12.100 G_CALLBACK (on_trace_button_toggled),
12.101 io_rgn);
12.102 return list;
12.103 }
12.104
12.105 -void mmio_win_update( mmio_window_t win )
12.106 +
12.107 +
12.108 +mmio_window_t mmio_window_new( const gchar *title )
12.109 +{
12.110 + mmio_window_t mmio = g_malloc0( sizeof(struct mmio_window_info) );
12.111 +
12.112 + int i, j;
12.113 + GtkCList *all_list;
12.114 + GtkWidget *vbox1;
12.115 + GtkWidget *hbuttonbox1;
12.116 + GtkWidget *mmr_close;
12.117 +
12.118 + mmio->window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
12.119 + gtk_window_set_title (GTK_WINDOW (mmio->window), title);
12.120 + gtk_window_set_default_size (GTK_WINDOW (mmio->window), 600, 600);
12.121 +
12.122 + vbox1 = gtk_vbox_new (FALSE, 0);
12.123 + gtk_container_add (GTK_CONTAINER (mmio->window), vbox1);
12.124 +
12.125 + mmio->notebook = gtk_notebook_new ();
12.126 + gtk_box_pack_start (GTK_BOX (vbox1), mmio->notebook, TRUE, TRUE, 0);
12.127 + gtk_notebook_set_tab_pos (GTK_NOTEBOOK (mmio->notebook), GTK_POS_LEFT);
12.128 +
12.129 + hbuttonbox1 = gtk_hbutton_box_new ();
12.130 + gtk_box_pack_start (GTK_BOX (vbox1), hbuttonbox1, FALSE, TRUE, 0);
12.131 + gtk_box_set_spacing (GTK_BOX (hbuttonbox1), 30);
12.132 +
12.133 + mmr_close = gtk_button_new_with_mnemonic (_("Close"));
12.134 + gtk_container_add (GTK_CONTAINER (hbuttonbox1), mmr_close);
12.135 + GTK_WIDGET_SET_FLAGS (mmr_close, GTK_CAN_DEFAULT);
12.136 +
12.137 + /* Add the mmio register data */
12.138 + all_list = mmio_window_add_page( mmio, "All", NULL );
12.139 + for( i=0; i < num_io_rgns; i++ ) {
12.140 + GtkCList *list = mmio_window_add_page( mmio, io_rgn[i]->id, io_rgn[i] );
12.141 + for( j=0; io_rgn[i]->ports[j].id != NULL; j++ ) {
12.142 + int sz = io_rgn[i]->ports[j].width;
12.143 + char addr[10], data[10], bits[40];
12.144 + char *arr[] = { addr, io_rgn[i]->ports[j].id, data, bits,
12.145 + io_rgn[i]->ports[j].desc };
12.146 + sprintf( addr, "%08X",
12.147 + io_rgn[i]->base + io_rgn[i]->ports[j].offset );
12.148 + printhex( data, sz, *io_rgn[i]->ports[j].val );
12.149 + printbits( bits, io_rgn[i]->ports[j].width,
12.150 + *io_rgn[i]->ports[j].val );
12.151 + gtk_clist_append( list, arr );
12.152 + gtk_clist_append( all_list, arr );
12.153 + }
12.154 + }
12.155 +
12.156 + g_signal_connect ((gpointer) mmio->window, "delete_event",
12.157 + G_CALLBACK (on_mmio_delete_event),
12.158 + NULL);
12.159 + g_signal_connect ((gpointer) mmr_close, "clicked",
12.160 + G_CALLBACK (on_mmio_close_clicked),
12.161 + mmio);
12.162 +
12.163 + gtk_widget_show_all( mmio->window );
12.164 + return mmio;
12.165 +}
12.166 +
12.167 +void mmio_window_update( mmio_window_t mmio )
12.168 {
12.169 int i,j, count = 0;
12.170 GtkCList *page, *all_page;
12.171 char data[10], bits[40];
12.172
12.173 - all_page = GTK_CLIST(gtk_object_get_data( GTK_OBJECT(mmr_win), "All" ));
12.174 + all_page = GTK_CLIST(gtk_object_get_data( GTK_OBJECT(mmio->window), "All" ));
12.175
12.176 for( i=0; i < num_io_rgns; i++ ) {
12.177 - page = GTK_CLIST(gtk_object_get_data( GTK_OBJECT(mmr_win),
12.178 + page = GTK_CLIST(gtk_object_get_data( GTK_OBJECT(mmio->window),
12.179 io_rgn[i]->id ));
12.180 for( j=0; io_rgn[i]->ports[j].id != NULL; j++ ) {
12.181 if( *io_rgn[i]->ports[j].val !=
12.182 @@ -144,49 +229,12 @@
12.183 }
12.184 }
12.185
12.186 -void init_mmr_win( void )
12.187 +void mmio_window_show( mmio_window_t mmio, gboolean show )
12.188 {
12.189 - int i, j;
12.190 - GtkCList *all_list;
12.191 - mmr_win = create_mmr_win();
12.192 - mmr_book = GTK_NOTEBOOK( gtk_object_get_data( GTK_OBJECT(mmr_win), "mmr_notebook" ));
12.193 -
12.194 - /* kill the dummy page glade insists on adding */
12.195 - gtk_notebook_remove_page( mmr_book, 0 );
12.196 -
12.197 - all_list = create_mmr_page( "All", NULL );
12.198 - for( i=0; i < num_io_rgns; i++ ) {
12.199 - GtkCList *list = create_mmr_page( io_rgn[i]->id, io_rgn[i] );
12.200 -
12.201 - for( j=0; io_rgn[i]->ports[j].id != NULL; j++ ) {
12.202 - int sz = io_rgn[i]->ports[j].width;
12.203 - char addr[10], data[10], bits[40];
12.204 - char *arr[] = { addr, io_rgn[i]->ports[j].id, data, bits,
12.205 - io_rgn[i]->ports[j].desc };
12.206 - sprintf( addr, "%08X",
12.207 - io_rgn[i]->base + io_rgn[i]->ports[j].offset );
12.208 - printhex( data, sz, *io_rgn[i]->ports[j].val );
12.209 - printbits( bits, io_rgn[i]->ports[j].width,
12.210 - *io_rgn[i]->ports[j].val );
12.211 - gtk_clist_append( list, arr );
12.212 - gtk_clist_append( all_list, arr );
12.213 - }
12.214 + if( show ) {
12.215 + gtk_widget_show( mmio->window );
12.216 + } else {
12.217 + gtk_widget_hide( mmio->window );
12.218 }
12.219 }
12.220
12.221 -mmio_window_t mmio_window_new( const gchar *title )
12.222 -{
12.223 - init_mmr_win();
12.224 - gtk_widget_show( mmr_win );
12.225 - return NULL;
12.226 -}
12.227 -
12.228 -void mmio_window_show( mmio_window_t mmio, gboolean show )
12.229 -{
12.230 - gtk_widget_show( mmr_win );
12.231 -}
12.232 -
12.233 -void mmr_close_win( void )
12.234 -{
12.235 - gtk_widget_hide( mmr_win );
12.236 -}
.