Search
lxdream.org :: lxdream :: r435:7a5d71e8560b
lxdream 0.9.1
released Jun 29
Download Now
changeset435:7a5d71e8560b
parent434:8af49a412d92
child436:e8c461d2545e
authornkeynes
dateWed Oct 10 11:02:04 2007 +0000 (12 years ago)
First cut of new GUI
src/Makefile.am
src/Makefile.in
src/dream.h
src/drivers/video_gtk.c
src/gui.h
src/gui/callbacks.c
src/gui/callbacks.h
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/gtkcb.c
src/gui/gtkui.c
src/gui/gtkui.h
src/gui/gui.c
src/gui/gui.h
src/gui/interface.c
src/gui/interface.h
src/gui/main_win.c
src/gui/mmio_win.c
src/loader.c
src/main.c
1.1 --- a/src/Makefile.am Tue Oct 09 11:37:36 2007 +0000
1.2 +++ b/src/Makefile.am Wed Oct 10 11:02:04 2007 +0000
1.3 @@ -34,11 +34,11 @@
1.4 pvr2/texcache.c pvr2/yuv.c pvr2/rendsave.c \
1.5 maple/maple.c maple/maple.h \
1.6 maple/controller.c maple/controller.h \
1.7 + gui/gtkui.c gui/gtkui.h gui/main_win.c gui/gtkcb.c \
1.8 gui/support.c gui/support.h \
1.9 - gui/interface.c gui/interface.h \
1.10 - gui/callbacks.c gui/callbacks.h \
1.11 - gui/gui.c gui/gui.h gui/mmr_win.c \
1.12 - gui/debug_win.c gui/dump_win.c \
1.13 + gui/debugif.c gui/debugif.h \
1.14 + gui/debugcb.c gui/debugcb.h \
1.15 + gui/mmr_win.c gui/debug_win.c gui/dump_win.c \
1.16 loader.c bootstrap.c util.c \
1.17 display.c display.h \
1.18 drivers/audio_null.c drivers/audio_esd.c \
2.1 --- a/src/Makefile.in Tue Oct 09 11:37:36 2007 +0000
2.2 +++ b/src/Makefile.in Wed Oct 10 11:02:04 2007 +0000
2.3 @@ -168,11 +168,11 @@
2.4 pvr2/texcache.c pvr2/yuv.c pvr2/rendsave.c \
2.5 maple/maple.c maple/maple.h \
2.6 maple/controller.c maple/controller.h \
2.7 + gui/gtkui.c gui/gtkui.h gui/main_win.c gui/gtkcb.c \
2.8 gui/support.c gui/support.h \
2.9 - gui/interface.c gui/interface.h \
2.10 - gui/callbacks.c gui/callbacks.h \
2.11 - gui/gui.c gui/gui.h gui/mmr_win.c \
2.12 - gui/debug_win.c gui/dump_win.c \
2.13 + gui/debugif.c gui/debugif.h \
2.14 + gui/debugcb.c gui/debugcb.h \
2.15 + gui/mmr_win.c gui/debug_win.c gui/dump_win.c \
2.16 loader.c bootstrap.c util.c \
2.17 display.c display.h \
2.18 drivers/audio_null.c drivers/audio_esd.c \
2.19 @@ -235,13 +235,14 @@
2.20 tacore.$(OBJEXT) render.$(OBJEXT) rendcore.$(OBJEXT) \
2.21 rendbkg.$(OBJEXT) rendsort.$(OBJEXT) texcache.$(OBJEXT) \
2.22 yuv.$(OBJEXT) rendsave.$(OBJEXT) maple.$(OBJEXT) \
2.23 - controller.$(OBJEXT) support.$(OBJEXT) interface.$(OBJEXT) \
2.24 - callbacks.$(OBJEXT) gui.$(OBJEXT) mmr_win.$(OBJEXT) \
2.25 - debug_win.$(OBJEXT) dump_win.$(OBJEXT) loader.$(OBJEXT) \
2.26 - bootstrap.$(OBJEXT) util.$(OBJEXT) display.$(OBJEXT) \
2.27 - audio_null.$(OBJEXT) audio_esd.$(OBJEXT) video_null.$(OBJEXT) \
2.28 - video_gtk.$(OBJEXT) video_x11.$(OBJEXT) gl_common.$(OBJEXT) \
2.29 - gl_fbo.$(OBJEXT) gl_sl.$(OBJEXT) gl_slsrc.$(OBJEXT)
2.30 + controller.$(OBJEXT) gtkui.$(OBJEXT) main_win.$(OBJEXT) \
2.31 + gtkcb.$(OBJEXT) support.$(OBJEXT) debugif.$(OBJEXT) \
2.32 + debugcb.$(OBJEXT) mmr_win.$(OBJEXT) debug_win.$(OBJEXT) \
2.33 + dump_win.$(OBJEXT) loader.$(OBJEXT) bootstrap.$(OBJEXT) \
2.34 + util.$(OBJEXT) display.$(OBJEXT) audio_null.$(OBJEXT) \
2.35 + audio_esd.$(OBJEXT) video_null.$(OBJEXT) video_gtk.$(OBJEXT) \
2.36 + video_x11.$(OBJEXT) gl_common.$(OBJEXT) gl_fbo.$(OBJEXT) \
2.37 + gl_sl.$(OBJEXT) gl_slsrc.$(OBJEXT)
2.38 lxdream_OBJECTS = $(am_lxdream_OBJECTS)
2.39 lxdream_DEPENDENCIES =
2.40 lxdream_LDFLAGS =
2.41 @@ -267,21 +268,22 @@
2.42 @AMDEP_TRUE@ ./$(DEPDIR)/armmem.Po ./$(DEPDIR)/asic.Po \
2.43 @AMDEP_TRUE@ ./$(DEPDIR)/audio.Po ./$(DEPDIR)/audio_esd.Po \
2.44 @AMDEP_TRUE@ ./$(DEPDIR)/audio_null.Po ./$(DEPDIR)/bios.Po \
2.45 -@AMDEP_TRUE@ ./$(DEPDIR)/bootstrap.Po ./$(DEPDIR)/callbacks.Po \
2.46 -@AMDEP_TRUE@ ./$(DEPDIR)/cdi.Po ./$(DEPDIR)/controller.Po \
2.47 -@AMDEP_TRUE@ ./$(DEPDIR)/dcload.Po ./$(DEPDIR)/debug_win.Po \
2.48 -@AMDEP_TRUE@ ./$(DEPDIR)/dis-buf.Po ./$(DEPDIR)/dis-init.Po \
2.49 -@AMDEP_TRUE@ ./$(DEPDIR)/display.Po ./$(DEPDIR)/dmac.Po \
2.50 -@AMDEP_TRUE@ ./$(DEPDIR)/dreamcast.Po ./$(DEPDIR)/dump_win.Po \
2.51 -@AMDEP_TRUE@ ./$(DEPDIR)/eventq.Po ./$(DEPDIR)/gdimage.Po \
2.52 -@AMDEP_TRUE@ ./$(DEPDIR)/gdrom.Po ./$(DEPDIR)/gendec.Po \
2.53 -@AMDEP_TRUE@ ./$(DEPDIR)/genglsl.Po ./$(DEPDIR)/gl_common.Po \
2.54 -@AMDEP_TRUE@ ./$(DEPDIR)/gl_fbo.Po ./$(DEPDIR)/gl_sl.Po \
2.55 -@AMDEP_TRUE@ ./$(DEPDIR)/gl_slsrc.Po ./$(DEPDIR)/gui.Po \
2.56 +@AMDEP_TRUE@ ./$(DEPDIR)/bootstrap.Po ./$(DEPDIR)/cdi.Po \
2.57 +@AMDEP_TRUE@ ./$(DEPDIR)/controller.Po ./$(DEPDIR)/dcload.Po \
2.58 +@AMDEP_TRUE@ ./$(DEPDIR)/debug_win.Po ./$(DEPDIR)/debugcb.Po \
2.59 +@AMDEP_TRUE@ ./$(DEPDIR)/debugif.Po ./$(DEPDIR)/dis-buf.Po \
2.60 +@AMDEP_TRUE@ ./$(DEPDIR)/dis-init.Po ./$(DEPDIR)/display.Po \
2.61 +@AMDEP_TRUE@ ./$(DEPDIR)/dmac.Po ./$(DEPDIR)/dreamcast.Po \
2.62 +@AMDEP_TRUE@ ./$(DEPDIR)/dump_win.Po ./$(DEPDIR)/eventq.Po \
2.63 +@AMDEP_TRUE@ ./$(DEPDIR)/gdimage.Po ./$(DEPDIR)/gdrom.Po \
2.64 +@AMDEP_TRUE@ ./$(DEPDIR)/gendec.Po ./$(DEPDIR)/genglsl.Po \
2.65 +@AMDEP_TRUE@ ./$(DEPDIR)/gl_common.Po ./$(DEPDIR)/gl_fbo.Po \
2.66 +@AMDEP_TRUE@ ./$(DEPDIR)/gl_sl.Po ./$(DEPDIR)/gl_slsrc.Po \
2.67 +@AMDEP_TRUE@ ./$(DEPDIR)/gtkcb.Po ./$(DEPDIR)/gtkui.Po \
2.68 @AMDEP_TRUE@ ./$(DEPDIR)/i386-dis.Po ./$(DEPDIR)/ide.Po \
2.69 @AMDEP_TRUE@ ./$(DEPDIR)/insparse.Po ./$(DEPDIR)/intc.Po \
2.70 -@AMDEP_TRUE@ ./$(DEPDIR)/interface.Po ./$(DEPDIR)/linux.Po \
2.71 -@AMDEP_TRUE@ ./$(DEPDIR)/loader.Po ./$(DEPDIR)/main.Po \
2.72 +@AMDEP_TRUE@ ./$(DEPDIR)/linux.Po ./$(DEPDIR)/loader.Po \
2.73 +@AMDEP_TRUE@ ./$(DEPDIR)/main.Po ./$(DEPDIR)/main_win.Po \
2.74 @AMDEP_TRUE@ ./$(DEPDIR)/maple.Po ./$(DEPDIR)/mem.Po \
2.75 @AMDEP_TRUE@ ./$(DEPDIR)/mmr_win.Po ./$(DEPDIR)/nrg.Po \
2.76 @AMDEP_TRUE@ ./$(DEPDIR)/pvr2.Po ./$(DEPDIR)/pvr2mem.Po \
2.77 @@ -382,11 +384,12 @@
2.78 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audio_null.Po@am__quote@
2.79 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bios.Po@am__quote@
2.80 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bootstrap.Po@am__quote@
2.81 -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/callbacks.Po@am__quote@
2.82 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdi.Po@am__quote@
2.83 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/controller.Po@am__quote@
2.84 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dcload.Po@am__quote@
2.85 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debug_win.Po@am__quote@
2.86 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debugcb.Po@am__quote@
2.87 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debugif.Po@am__quote@
2.88 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dis-buf.Po@am__quote@
2.89 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dis-init.Po@am__quote@
2.90 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/display.Po@am__quote@
2.91 @@ -402,15 +405,16 @@
2.92 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gl_fbo.Po@am__quote@
2.93 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gl_sl.Po@am__quote@
2.94 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gl_slsrc.Po@am__quote@
2.95 -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gui.Po@am__quote@
2.96 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtkcb.Po@am__quote@
2.97 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtkui.Po@am__quote@
2.98 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/i386-dis.Po@am__quote@
2.99 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ide.Po@am__quote@
2.100 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/insparse.Po@am__quote@
2.101 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intc.Po@am__quote@
2.102 -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/interface.Po@am__quote@
2.103 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/linux.Po@am__quote@
2.104 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/loader.Po@am__quote@
2.105 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@
2.106 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main_win.Po@am__quote@
2.107 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maple.Po@am__quote@
2.108 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mem.Po@am__quote@
2.109 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmr_win.Po@am__quote@
2.110 @@ -1437,6 +1441,72 @@
2.111 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2.112 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o controller.obj `if test -f 'maple/controller.c'; then $(CYGPATH_W) 'maple/controller.c'; else $(CYGPATH_W) '$(srcdir)/maple/controller.c'; fi`
2.113
2.114 +gtkui.o: gui/gtkui.c
2.115 +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gtkui.o -MD -MP -MF "$(DEPDIR)/gtkui.Tpo" \
2.116 +@am__fastdepCC_TRUE@ -c -o gtkui.o `test -f 'gui/gtkui.c' || echo '$(srcdir)/'`gui/gtkui.c; \
2.117 +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/gtkui.Tpo" "$(DEPDIR)/gtkui.Po"; \
2.118 +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/gtkui.Tpo"; exit 1; \
2.119 +@am__fastdepCC_TRUE@ fi
2.120 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gui/gtkui.c' object='gtkui.o' libtool=no @AMDEPBACKSLASH@
2.121 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/gtkui.Po' tmpdepfile='$(DEPDIR)/gtkui.TPo' @AMDEPBACKSLASH@
2.122 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2.123 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o gtkui.o `test -f 'gui/gtkui.c' || echo '$(srcdir)/'`gui/gtkui.c
2.124 +
2.125 +gtkui.obj: gui/gtkui.c
2.126 +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gtkui.obj -MD -MP -MF "$(DEPDIR)/gtkui.Tpo" \
2.127 +@am__fastdepCC_TRUE@ -c -o gtkui.obj `if test -f 'gui/gtkui.c'; then $(CYGPATH_W) 'gui/gtkui.c'; else $(CYGPATH_W) '$(srcdir)/gui/gtkui.c'; fi`; \
2.128 +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/gtkui.Tpo" "$(DEPDIR)/gtkui.Po"; \
2.129 +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/gtkui.Tpo"; exit 1; \
2.130 +@am__fastdepCC_TRUE@ fi
2.131 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gui/gtkui.c' object='gtkui.obj' libtool=no @AMDEPBACKSLASH@
2.132 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/gtkui.Po' tmpdepfile='$(DEPDIR)/gtkui.TPo' @AMDEPBACKSLASH@
2.133 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2.134 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o gtkui.obj `if test -f 'gui/gtkui.c'; then $(CYGPATH_W) 'gui/gtkui.c'; else $(CYGPATH_W) '$(srcdir)/gui/gtkui.c'; fi`
2.135 +
2.136 +main_win.o: gui/main_win.c
2.137 +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT main_win.o -MD -MP -MF "$(DEPDIR)/main_win.Tpo" \
2.138 +@am__fastdepCC_TRUE@ -c -o main_win.o `test -f 'gui/main_win.c' || echo '$(srcdir)/'`gui/main_win.c; \
2.139 +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/main_win.Tpo" "$(DEPDIR)/main_win.Po"; \
2.140 +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/main_win.Tpo"; exit 1; \
2.141 +@am__fastdepCC_TRUE@ fi
2.142 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gui/main_win.c' object='main_win.o' libtool=no @AMDEPBACKSLASH@
2.143 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/main_win.Po' tmpdepfile='$(DEPDIR)/main_win.TPo' @AMDEPBACKSLASH@
2.144 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2.145 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o main_win.o `test -f 'gui/main_win.c' || echo '$(srcdir)/'`gui/main_win.c
2.146 +
2.147 +main_win.obj: gui/main_win.c
2.148 +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT main_win.obj -MD -MP -MF "$(DEPDIR)/main_win.Tpo" \
2.149 +@am__fastdepCC_TRUE@ -c -o main_win.obj `if test -f 'gui/main_win.c'; then $(CYGPATH_W) 'gui/main_win.c'; else $(CYGPATH_W) '$(srcdir)/gui/main_win.c'; fi`; \
2.150 +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/main_win.Tpo" "$(DEPDIR)/main_win.Po"; \
2.151 +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/main_win.Tpo"; exit 1; \
2.152 +@am__fastdepCC_TRUE@ fi
2.153 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gui/main_win.c' object='main_win.obj' libtool=no @AMDEPBACKSLASH@
2.154 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/main_win.Po' tmpdepfile='$(DEPDIR)/main_win.TPo' @AMDEPBACKSLASH@
2.155 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2.156 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o main_win.obj `if test -f 'gui/main_win.c'; then $(CYGPATH_W) 'gui/main_win.c'; else $(CYGPATH_W) '$(srcdir)/gui/main_win.c'; fi`
2.157 +
2.158 +gtkcb.o: gui/gtkcb.c
2.159 +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gtkcb.o -MD -MP -MF "$(DEPDIR)/gtkcb.Tpo" \
2.160 +@am__fastdepCC_TRUE@ -c -o gtkcb.o `test -f 'gui/gtkcb.c' || echo '$(srcdir)/'`gui/gtkcb.c; \
2.161 +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/gtkcb.Tpo" "$(DEPDIR)/gtkcb.Po"; \
2.162 +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/gtkcb.Tpo"; exit 1; \
2.163 +@am__fastdepCC_TRUE@ fi
2.164 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gui/gtkcb.c' object='gtkcb.o' libtool=no @AMDEPBACKSLASH@
2.165 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/gtkcb.Po' tmpdepfile='$(DEPDIR)/gtkcb.TPo' @AMDEPBACKSLASH@
2.166 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2.167 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o gtkcb.o `test -f 'gui/gtkcb.c' || echo '$(srcdir)/'`gui/gtkcb.c
2.168 +
2.169 +gtkcb.obj: gui/gtkcb.c
2.170 +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gtkcb.obj -MD -MP -MF "$(DEPDIR)/gtkcb.Tpo" \
2.171 +@am__fastdepCC_TRUE@ -c -o gtkcb.obj `if test -f 'gui/gtkcb.c'; then $(CYGPATH_W) 'gui/gtkcb.c'; else $(CYGPATH_W) '$(srcdir)/gui/gtkcb.c'; fi`; \
2.172 +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/gtkcb.Tpo" "$(DEPDIR)/gtkcb.Po"; \
2.173 +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/gtkcb.Tpo"; exit 1; \
2.174 +@am__fastdepCC_TRUE@ fi
2.175 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gui/gtkcb.c' object='gtkcb.obj' libtool=no @AMDEPBACKSLASH@
2.176 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/gtkcb.Po' tmpdepfile='$(DEPDIR)/gtkcb.TPo' @AMDEPBACKSLASH@
2.177 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2.178 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o gtkcb.obj `if test -f 'gui/gtkcb.c'; then $(CYGPATH_W) 'gui/gtkcb.c'; else $(CYGPATH_W) '$(srcdir)/gui/gtkcb.c'; fi`
2.179 +
2.180 support.o: gui/support.c
2.181 @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT support.o -MD -MP -MF "$(DEPDIR)/support.Tpo" \
2.182 @am__fastdepCC_TRUE@ -c -o support.o `test -f 'gui/support.c' || echo '$(srcdir)/'`gui/support.c; \
2.183 @@ -1459,71 +1529,49 @@
2.184 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2.185 @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.186
2.187 -interface.o: gui/interface.c
2.188 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT interface.o -MD -MP -MF "$(DEPDIR)/interface.Tpo" \
2.189 -@am__fastdepCC_TRUE@ -c -o interface.o `test -f 'gui/interface.c' || echo '$(srcdir)/'`gui/interface.c; \
2.190 -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/interface.Tpo" "$(DEPDIR)/interface.Po"; \
2.191 -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/interface.Tpo"; exit 1; \
2.192 +debugif.o: gui/debugif.c
2.193 +@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.194 +@am__fastdepCC_TRUE@ -c -o debugif.o `test -f 'gui/debugif.c' || echo '$(srcdir)/'`gui/debugif.c; \
2.195 +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/debugif.Tpo" "$(DEPDIR)/debugif.Po"; \
2.196 +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/debugif.Tpo"; exit 1; \
2.197 @am__fastdepCC_TRUE@ fi
2.198 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gui/interface.c' object='interface.o' libtool=no @AMDEPBACKSLASH@
2.199 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/interface.Po' tmpdepfile='$(DEPDIR)/interface.TPo' @AMDEPBACKSLASH@
2.200 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gui/debugif.c' object='debugif.o' libtool=no @AMDEPBACKSLASH@
2.201 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/debugif.Po' tmpdepfile='$(DEPDIR)/debugif.TPo' @AMDEPBACKSLASH@
2.202 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2.203 -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o interface.o `test -f 'gui/interface.c' || echo '$(srcdir)/'`gui/interface.c
2.204 +@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.205
2.206 -interface.obj: gui/interface.c
2.207 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT interface.obj -MD -MP -MF "$(DEPDIR)/interface.Tpo" \
2.208 -@am__fastdepCC_TRUE@ -c -o interface.obj `if test -f 'gui/interface.c'; then $(CYGPATH_W) 'gui/interface.c'; else $(CYGPATH_W) '$(srcdir)/gui/interface.c'; fi`; \
2.209 -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/interface.Tpo" "$(DEPDIR)/interface.Po"; \
2.210 -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/interface.Tpo"; exit 1; \
2.211 +debugif.obj: gui/debugif.c
2.212 +@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.213 +@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.214 +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/debugif.Tpo" "$(DEPDIR)/debugif.Po"; \
2.215 +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/debugif.Tpo"; exit 1; \
2.216 @am__fastdepCC_TRUE@ fi
2.217 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gui/interface.c' object='interface.obj' libtool=no @AMDEPBACKSLASH@
2.218 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/interface.Po' tmpdepfile='$(DEPDIR)/interface.TPo' @AMDEPBACKSLASH@
2.219 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gui/debugif.c' object='debugif.obj' libtool=no @AMDEPBACKSLASH@
2.220 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/debugif.Po' tmpdepfile='$(DEPDIR)/debugif.TPo' @AMDEPBACKSLASH@
2.221 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2.222 -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o interface.obj `if test -f 'gui/interface.c'; then $(CYGPATH_W) 'gui/interface.c'; else $(CYGPATH_W) '$(srcdir)/gui/interface.c'; fi`
2.223 +@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.224
2.225 -callbacks.o: gui/callbacks.c
2.226 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT callbacks.o -MD -MP -MF "$(DEPDIR)/callbacks.Tpo" \
2.227 -@am__fastdepCC_TRUE@ -c -o callbacks.o `test -f 'gui/callbacks.c' || echo '$(srcdir)/'`gui/callbacks.c; \
2.228 -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/callbacks.Tpo" "$(DEPDIR)/callbacks.Po"; \
2.229 -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/callbacks.Tpo"; exit 1; \
2.230 +debugcb.o: gui/debugcb.c
2.231 +@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.232 +@am__fastdepCC_TRUE@ -c -o debugcb.o `test -f 'gui/debugcb.c' || echo '$(srcdir)/'`gui/debugcb.c; \
2.233 +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/debugcb.Tpo" "$(DEPDIR)/debugcb.Po"; \
2.234 +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/debugcb.Tpo"; exit 1; \
2.235 @am__fastdepCC_TRUE@ fi
2.236 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gui/callbacks.c' object='callbacks.o' libtool=no @AMDEPBACKSLASH@
2.237 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/callbacks.Po' tmpdepfile='$(DEPDIR)/callbacks.TPo' @AMDEPBACKSLASH@
2.238 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gui/debugcb.c' object='debugcb.o' libtool=no @AMDEPBACKSLASH@
2.239 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/debugcb.Po' tmpdepfile='$(DEPDIR)/debugcb.TPo' @AMDEPBACKSLASH@
2.240 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2.241 -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o callbacks.o `test -f 'gui/callbacks.c' || echo '$(srcdir)/'`gui/callbacks.c
2.242 +@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.243
2.244 -callbacks.obj: gui/callbacks.c
2.245 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT callbacks.obj -MD -MP -MF "$(DEPDIR)/callbacks.Tpo" \
2.246 -@am__fastdepCC_TRUE@ -c -o callbacks.obj `if test -f 'gui/callbacks.c'; then $(CYGPATH_W) 'gui/callbacks.c'; else $(CYGPATH_W) '$(srcdir)/gui/callbacks.c'; fi`; \
2.247 -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/callbacks.Tpo" "$(DEPDIR)/callbacks.Po"; \
2.248 -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/callbacks.Tpo"; exit 1; \
2.249 +debugcb.obj: gui/debugcb.c
2.250 +@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.251 +@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.252 +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/debugcb.Tpo" "$(DEPDIR)/debugcb.Po"; \
2.253 +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/debugcb.Tpo"; exit 1; \
2.254 @am__fastdepCC_TRUE@ fi
2.255 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gui/callbacks.c' object='callbacks.obj' libtool=no @AMDEPBACKSLASH@
2.256 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/callbacks.Po' tmpdepfile='$(DEPDIR)/callbacks.TPo' @AMDEPBACKSLASH@
2.257 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gui/debugcb.c' object='debugcb.obj' libtool=no @AMDEPBACKSLASH@
2.258 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/debugcb.Po' tmpdepfile='$(DEPDIR)/debugcb.TPo' @AMDEPBACKSLASH@
2.259 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2.260 -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o callbacks.obj `if test -f 'gui/callbacks.c'; then $(CYGPATH_W) 'gui/callbacks.c'; else $(CYGPATH_W) '$(srcdir)/gui/callbacks.c'; fi`
2.261 -
2.262 -gui.o: gui/gui.c
2.263 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gui.o -MD -MP -MF "$(DEPDIR)/gui.Tpo" \
2.264 -@am__fastdepCC_TRUE@ -c -o gui.o `test -f 'gui/gui.c' || echo '$(srcdir)/'`gui/gui.c; \
2.265 -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/gui.Tpo" "$(DEPDIR)/gui.Po"; \
2.266 -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/gui.Tpo"; exit 1; \
2.267 -@am__fastdepCC_TRUE@ fi
2.268 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gui/gui.c' object='gui.o' libtool=no @AMDEPBACKSLASH@
2.269 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/gui.Po' tmpdepfile='$(DEPDIR)/gui.TPo' @AMDEPBACKSLASH@
2.270 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2.271 -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o gui.o `test -f 'gui/gui.c' || echo '$(srcdir)/'`gui/gui.c
2.272 -
2.273 -gui.obj: gui/gui.c
2.274 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gui.obj -MD -MP -MF "$(DEPDIR)/gui.Tpo" \
2.275 -@am__fastdepCC_TRUE@ -c -o gui.obj `if test -f 'gui/gui.c'; then $(CYGPATH_W) 'gui/gui.c'; else $(CYGPATH_W) '$(srcdir)/gui/gui.c'; fi`; \
2.276 -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/gui.Tpo" "$(DEPDIR)/gui.Po"; \
2.277 -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/gui.Tpo"; exit 1; \
2.278 -@am__fastdepCC_TRUE@ fi
2.279 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gui/gui.c' object='gui.obj' libtool=no @AMDEPBACKSLASH@
2.280 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/gui.Po' tmpdepfile='$(DEPDIR)/gui.TPo' @AMDEPBACKSLASH@
2.281 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2.282 -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o gui.obj `if test -f 'gui/gui.c'; then $(CYGPATH_W) 'gui/gui.c'; else $(CYGPATH_W) '$(srcdir)/gui/gui.c'; fi`
2.283 +@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.284
2.285 mmr_win.o: gui/mmr_win.c
2.286 @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mmr_win.o -MD -MP -MF "$(DEPDIR)/mmr_win.Tpo" \
3.1 --- a/src/dream.h Tue Oct 09 11:37:36 2007 +0000
3.2 +++ b/src/dream.h Wed Oct 10 11:02:04 2007 +0000
3.3 @@ -1,5 +1,5 @@
3.4 /**
3.5 - * $Id: dream.h,v 1.13 2007-10-06 08:59:42 nkeynes Exp $
3.6 + * $Id: dream.h,v 1.14 2007-10-10 11:02:04 nkeynes Exp $
3.7 *
3.8 * Miscellaneous application-wide declarations (mainly logging atm)
3.9 *
3.10 @@ -30,6 +30,7 @@
3.11 #endif
3.12
3.13 #define APP_NAME "lxDream"
3.14 +#define APP_VERSION "0.8"
3.15
3.16 /************************ Modules ********************************/
3.17 /**
4.1 --- a/src/drivers/video_gtk.c Tue Oct 09 11:37:36 2007 +0000
4.2 +++ b/src/drivers/video_gtk.c Wed Oct 10 11:02:04 2007 +0000
4.3 @@ -1,5 +1,5 @@
4.4 /**
4.5 - * $Id: video_gtk.c,v 1.12 2007-10-07 05:42:25 nkeynes Exp $
4.6 + * $Id: video_gtk.c,v 1.13 2007-10-10 11:02:04 nkeynes Exp $
4.7 *
4.8 * The PC side of the video support (responsible for actually displaying /
4.9 * rendering frames)
4.10 @@ -23,9 +23,10 @@
4.11 #include "dream.h"
4.12 #include "display.h"
4.13 #include "drivers/video_x11.h"
4.14 +#include "gui/gtkui.h"
4.15
4.16 GdkImage *video_img = NULL;
4.17 -GtkWindow *video_win = NULL;
4.18 +GtkWidget *video_win = NULL;
4.19 GtkWidget *video_area = NULL;
4.20 uint32_t video_width = 640;
4.21 uint32_t video_height = 480;
4.22 @@ -63,17 +64,29 @@
4.23 return TRUE;
4.24 }
4.25
4.26 +gboolean video_gtk_expose_callback(GtkWidget *widget, GdkEventExpose *event, gpointer data )
4.27 +{
4.28 + /* redisplay last frame */
4.29 +}
4.30 +
4.31 gboolean video_gtk_init()
4.32 {
4.33 + /*
4.34 video_win = GTK_WINDOW(gtk_window_new( GTK_WINDOW_TOPLEVEL ));
4.35 gtk_window_set_title( video_win, APP_NAME " - Emulation Window" );
4.36 gtk_window_set_policy( video_win, FALSE, FALSE, FALSE );
4.37 + gtk_window_set_default_size( video_win, video_width, video_height );
4.38 + */
4.39
4.40 + video_win = gtk_gui_get_renderarea();
4.41 +
4.42 g_signal_connect( video_win, "key_press_event",
4.43 G_CALLBACK(video_gtk_keydown_callback), NULL );
4.44 g_signal_connect( video_win, "key_release_event",
4.45 G_CALLBACK(video_gtk_keyup_callback), NULL );
4.46 - gtk_widget_add_events( GTK_WIDGET(video_win),
4.47 + g_signal_connect( video_win, "expose_event",
4.48 + G_CALLBACK(video_gtk_expose_callback), NULL );
4.49 + gtk_widget_add_events( video_win,
4.50 GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK |
4.51 GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK );
4.52 video_area = gtk_image_new();
4.53 @@ -84,7 +97,6 @@
4.54 video_width, video_height );
4.55 gtk_image_set_from_image( GTK_IMAGE(video_area), video_img, NULL );
4.56
4.57 - gtk_window_set_default_size( video_win, video_width, video_height );
4.58
4.59 return video_glx_init( gdk_x11_display_get_xdisplay( gtk_widget_get_display(GTK_WIDGET(video_win))),
4.60 gdk_x11_screen_get_xscreen( gtk_widget_get_screen(GTK_WIDGET(video_win))),
5.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
5.2 +++ b/src/gui.h Wed Oct 10 11:02:04 2007 +0000
5.3 @@ -0,0 +1,56 @@
5.4 +/**
5.5 + * $Id: gui.h,v 1.1 2007-10-10 11:02:04 nkeynes Exp $
5.6 + *
5.7 + * Public GUI declarations (used from elsewhere in the system)
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 +
5.22 +#ifndef __lxdream_gui_H
5.23 +#define __lxdream_gui_H
5.24 +
5.25 +#include <glib/gtypes.h>
5.26 +
5.27 +/**
5.28 + * GUI-provided method to scan the command line for standard arguments,
5.29 + * invoked prior to regular command line processing. The command line
5.30 + * is modified to remove any arguments handled by the UI.
5.31 + * @return TRUE on success, FALSE on failure.
5.32 + */
5.33 +gboolean gui_parse_cmdline( int *argc, char **argv[] );
5.34 +
5.35 +/**
5.36 + * Initialize the GUI system and create any windows needed. This method
5.37 + * should also register the GUI module with the module manager (if the
5.38 + * GUI has one).
5.39 + *
5.40 + * @param debug TRUE if the system should start in debugging mode.
5.41 + */
5.42 +gboolean gui_init( gboolean debug );
5.43 +
5.44 +/**
5.45 + * Enter the GUI main loop. If this method ever returns, the system will
5.46 + * exit normally.
5.47 + */
5.48 +void gui_main_loop(void);
5.49 +
5.50 +typedef enum { IO_IDE, IO_NETWORK } io_activity_type;
5.51 +
5.52 +/**
5.53 + * Notify the GUI of I/O activity.
5.54 + * @param activity the type of IO activity being reported.
5.55 + * @param active TRUE if the I/O device is becoming active, FALSE if inactive.
5.56 + */
5.57 +void gui_update_io_activity( io_activity_type activity, gboolean active );
5.58 +
5.59 +#endif /* __lxdream_gui_H */
6.1 --- a/src/gui/callbacks.c Tue Oct 09 11:37:36 2007 +0000
6.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
6.3 @@ -1,357 +0,0 @@
6.4 -/**
6.5 - * $Id: callbacks.c,v 1.19 2007-01-16 10:36:19 nkeynes Exp $
6.6 - *
6.7 - * All GTK callbacks go here (stubs are autogenerated by Glade)
6.8 - *
6.9 - * Copyright (c) 2005 Nathan Keynes.
6.10 - *
6.11 - * This program is free software; you can redistribute it and/or modify
6.12 - * it under the terms of the GNU General Public License as published by
6.13 - * the Free Software Foundation; either version 2 of the License, or
6.14 - * (at your option) any later version.
6.15 - *
6.16 - * This program is distributed in the hope that it will be useful,
6.17 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
6.18 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
6.19 - * GNU General Public License for more details.
6.20 - */
6.21 -
6.22 -#ifdef HAVE_CONFIG_H
6.23 -# include <config.h>
6.24 -#endif
6.25 -
6.26 -#include <gnome.h>
6.27 -
6.28 -#include "gui/callbacks.h"
6.29 -#include "gui/interface.h"
6.30 -#include "gui/gui.h"
6.31 -#include "gdrom/gdrom.h"
6.32 -#include "mem.h"
6.33 -#include "mmio.h"
6.34 -#include "dreamcast.h"
6.35 -#include "loader.h"
6.36 -#include "pvr2/pvr2.h"
6.37 -
6.38 -int selected_pc = -1;
6.39 -int selected_row = -1;
6.40 -
6.41 -void
6.42 -on_new_file1_activate (GtkMenuItem *menuitem,
6.43 - gpointer user_data)
6.44 -{
6.45 -
6.46 -}
6.47 -
6.48 -
6.49 -void
6.50 -on_open1_activate (GtkMenuItem *menuitem,
6.51 - gpointer user_data)
6.52 -{
6.53 - const gchar *dir = dreamcast_get_config_value(CONFIG_DEFAULT_PATH);
6.54 - open_file_dialog( "Open...", file_load_magic, NULL, NULL, dir );
6.55 -}
6.56 -
6.57 -
6.58 -void
6.59 -on_save1_activate (GtkMenuItem *menuitem,
6.60 - gpointer user_data)
6.61 -{
6.62 -
6.63 -}
6.64 -
6.65 -
6.66 -void
6.67 -on_save_as1_activate (GtkMenuItem *menuitem,
6.68 - gpointer user_data)
6.69 -{
6.70 -
6.71 -}
6.72 -
6.73 -void
6.74 -on_save_next_scene_activate( GtkMenuItem *menuitem,
6.75 - gpointer user_data)
6.76 -{
6.77 - const gchar *dir = dreamcast_get_config_value(CONFIG_SAVE_PATH);
6.78 - save_file_dialog( "Save next scene...", pvr2_save_next_scene, "*.dsc", "lxdream scene file (*.dsc)", dir );
6.79 -}
6.80 -
6.81 -void
6.82 -on_exit1_activate (GtkMenuItem *menuitem,
6.83 - gpointer user_data)
6.84 -{
6.85 - gtk_main_quit();
6.86 -}
6.87 -
6.88 -
6.89 -void
6.90 -on_preferences1_activate (GtkMenuItem *menuitem,
6.91 - gpointer user_data)
6.92 -{
6.93 -
6.94 -}
6.95 -
6.96 -
6.97 -void
6.98 -on_about1_activate (GtkMenuItem *menuitem,
6.99 - gpointer user_data)
6.100 -{
6.101 - GtkWidget *about = create_about_win();
6.102 - gtk_widget_show(about);
6.103 -}
6.104 -
6.105 -
6.106 -void
6.107 -on_load_btn_clicked (GtkButton *button,
6.108 - gpointer user_data)
6.109 -{
6.110 - const gchar *dir = dreamcast_get_config_value(CONFIG_DEFAULT_PATH);
6.111 - open_file_dialog( "Open...", gdrom_mount_image, NULL, NULL, dir );
6.112 -}
6.113 -
6.114 -
6.115 -void
6.116 -on_reset_btn_clicked (GtkButton *button,
6.117 - gpointer user_data)
6.118 -{
6.119 - dreamcast_reset();
6.120 -}
6.121 -
6.122 -
6.123 -void
6.124 -on_stop_btn_clicked (GtkButton *button,
6.125 - gpointer user_data)
6.126 -{
6.127 - dreamcast_stop();
6.128 -}
6.129 -
6.130 -
6.131 -void
6.132 -on_step_btn_clicked (GtkButton *button,
6.133 - gpointer user_data)
6.134 -{
6.135 - debug_info_t data = get_debug_info(GTK_WIDGET(button));
6.136 - debug_win_single_step(data);
6.137 -}
6.138 -
6.139 -
6.140 -void
6.141 -on_run_btn_clicked (GtkButton *button,
6.142 - gpointer user_data)
6.143 -{
6.144 - dreamcast_run();
6.145 -}
6.146 -
6.147 -
6.148 -void
6.149 -on_runto_btn_clicked (GtkButton *button,
6.150 - gpointer user_data)
6.151 -{
6.152 - if( selected_pc == -1 )
6.153 - WARN( "No address selected, so can't run to it", NULL );
6.154 - else {
6.155 - debug_info_t data = get_debug_info(GTK_WIDGET(button));
6.156 - debug_win_set_oneshot_breakpoint( data, selected_row );
6.157 - dreamcast_run();
6.158 - }
6.159 -}
6.160 -
6.161 -
6.162 -void
6.163 -on_break_btn_clicked (GtkButton *button,
6.164 - gpointer user_data)
6.165 -{
6.166 - debug_info_t data = get_debug_info(GTK_WIDGET(button));
6.167 - debug_win_toggle_breakpoint( data, selected_row );
6.168 -}
6.169 -
6.170 -void on_trace_button_toggled (GtkToggleButton *button,
6.171 - gpointer user_data)
6.172 -{
6.173 - struct mmio_region *io_rgn = (struct mmio_region *)user_data;
6.174 - gboolean isActive = gtk_toggle_button_get_active(button);
6.175 - if( io_rgn != NULL ) {
6.176 - io_rgn->trace_flag = isActive ? 1 : 0;
6.177 - }
6.178 -}
6.179 -
6.180 -
6.181 -gboolean
6.182 -on_debug_win_delete_event (GtkWidget *widget,
6.183 - GdkEvent *event,
6.184 - gpointer user_data)
6.185 -{
6.186 - dreamcast_shutdown();
6.187 - gtk_main_quit();
6.188 - return FALSE;
6.189 -}
6.190 -
6.191 -
6.192 -void
6.193 -on_disasm_list_select_row (GtkCList *clist,
6.194 - gint row,
6.195 - gint column,
6.196 - GdkEvent *event,
6.197 - gpointer user_data)
6.198 -{
6.199 - debug_info_t data = get_debug_info(GTK_WIDGET(clist));
6.200 - selected_pc = row_to_address(data, row);
6.201 - selected_row = row;
6.202 -}
6.203 -
6.204 -
6.205 -void
6.206 -on_disasm_list_unselect_row (GtkCList *clist,
6.207 - gint row,
6.208 - gint column,
6.209 - GdkEvent *event,
6.210 - gpointer user_data)
6.211 -{
6.212 - debug_info_t data = get_debug_info(GTK_WIDGET(clist));
6.213 - int pc = row_to_address(data,row);
6.214 - if( selected_pc == pc ) selected_pc = -1;
6.215 -}
6.216 -
6.217 -
6.218 -void
6.219 -on_mem_mapped_regs1_activate (GtkMenuItem *menuitem,
6.220 - gpointer user_data)
6.221 -{
6.222 - mmr_open_win();
6.223 -}
6.224 -
6.225 -
6.226 -gboolean
6.227 -on_mmr_win_delete_event (GtkWidget *widget,
6.228 - GdkEvent *event,
6.229 - gpointer user_data)
6.230 -{
6.231 - mmr_close_win();
6.232 - return TRUE;
6.233 -}
6.234 -
6.235 -
6.236 -void
6.237 -on_mmr_close_clicked (GtkButton *button,
6.238 - gpointer user_data)
6.239 -{
6.240 - mmr_close_win();
6.241 -}
6.242 -
6.243 -
6.244 -void
6.245 -on_mode_field_changed (GtkEditable *editable,
6.246 - gpointer user_data)
6.247 -{
6.248 - const gchar *text = gtk_entry_get_text( GTK_ENTRY(editable) );
6.249 - debug_info_t data = get_debug_info( GTK_WIDGET(editable) );
6.250 - set_disassembly_cpu( data, text );
6.251 -}
6.252 -
6.253 -
6.254 -void
6.255 -on_page_locked_btn_toggled (GtkToggleButton *togglebutton,
6.256 - gpointer user_data)
6.257 -{
6.258 -
6.259 -}
6.260 -
6.261 -
6.262 -gboolean
6.263 -on_page_field_key_press_event (GtkWidget *widget,
6.264 - GdkEventKey *event,
6.265 - gpointer user_data)
6.266 -{
6.267 - if( event->keyval == GDK_Return || event->keyval == GDK_Linefeed ) {
6.268 - debug_info_t data = get_debug_info(widget);
6.269 - const gchar *text = gtk_entry_get_text( GTK_ENTRY(widget) );
6.270 - gchar *endptr;
6.271 - unsigned int val = strtoul( text, &endptr, 16 );
6.272 - if( text == endptr ) { /* invalid input */
6.273 - char buf[10];
6.274 - sprintf( buf, "%08X", row_to_address(data,0) );
6.275 - gtk_entry_set_text( GTK_ENTRY(widget), buf );
6.276 - } else {
6.277 - set_disassembly_region(data, val);
6.278 - }
6.279 - }
6.280 - return FALSE;
6.281 -}
6.282 -
6.283 -
6.284 -void
6.285 -on_output_list_select_row (GtkCList *clist,
6.286 - gint row,
6.287 - gint column,
6.288 - GdkEvent *event,
6.289 - gpointer user_data)
6.290 -{
6.291 - if( event->type == GDK_2BUTTON_PRESS && event->button.button == 1 ) {
6.292 - char *val;
6.293 - gtk_clist_get_text( clist, row, 2, &val );
6.294 - if( val[0] != '\0' ) {
6.295 - int addr = strtoul( val, NULL, 16 );
6.296 - debug_info_t data = get_debug_info( GTK_WIDGET(clist) );
6.297 - jump_to_disassembly( data, addr, TRUE );
6.298 - }
6.299 - }
6.300 -}
6.301 -
6.302 -
6.303 -void
6.304 -on_jump_pc_btn_clicked (GtkButton *button,
6.305 - gpointer user_data)
6.306 -{
6.307 - debug_info_t data = get_debug_info( GTK_WIDGET(button) );
6.308 - jump_to_pc( data, TRUE );
6.309 -}
6.310 -
6.311 -
6.312 -void
6.313 -on_button_add_watch_clicked (GtkButton *button,
6.314 - gpointer user_data)
6.315 -{
6.316 -
6.317 -}
6.318 -
6.319 -
6.320 -void
6.321 -on_button_clear_all_clicked (GtkButton *button,
6.322 - gpointer user_data)
6.323 -{
6.324 -
6.325 -}
6.326 -
6.327 -
6.328 -void
6.329 -on_button_close_clicked (GtkButton *button,
6.330 - gpointer user_data)
6.331 -{
6.332 -
6.333 -}
6.334 -
6.335 -
6.336 -void
6.337 -on_view_memory_activate (GtkMenuItem *menuitem,
6.338 - gpointer user_data)
6.339 -{
6.340 - dump_window_new();
6.341 -}
6.342 -
6.343 -
6.344 -void
6.345 -on_loadstate_button_clicked (GtkToolButton *toolbutton,
6.346 - gpointer user_data)
6.347 -{
6.348 - const gchar *dir = dreamcast_get_config_value(CONFIG_SAVE_PATH);
6.349 - open_file_dialog( "Load state...", dreamcast_load_state, "*.dst", "lxDream Save State (*.dst)", dir );
6.350 -}
6.351 -
6.352 -
6.353 -void
6.354 -on_savestate_button_clicked (GtkToolButton *toolbutton,
6.355 - gpointer user_data)
6.356 -{
6.357 - const gchar *dir = dreamcast_get_config_value(CONFIG_SAVE_PATH);
6.358 - save_file_dialog( "Save state...", dreamcast_save_state, "*.dst", "lxDream Save State (*.dst)", dir );
6.359 -}
6.360 -
7.1 --- a/src/gui/callbacks.h Tue Oct 09 11:37:36 2007 +0000
7.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
7.3 @@ -1,209 +0,0 @@
7.4 -/**
7.5 - * $Id: callbacks.h,v 1.6 2007-01-16 10:36:19 nkeynes Exp $
7.6 - *
7.7 - * GTK callback declarations (stubs are autogenerated by Glade)
7.8 - *
7.9 - * Copyright (c) 2005 Nathan Keynes.
7.10 - *
7.11 - * This program is free software; you can redistribute it and/or modify
7.12 - * it under the terms of the GNU General Public License as published by
7.13 - * the Free Software Foundation; either version 2 of the License, or
7.14 - * (at your option) any later version.
7.15 - *
7.16 - * This program is distributed in the hope that it will be useful,
7.17 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
7.18 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7.19 - * GNU General Public License for more details.
7.20 - */
7.21 -#include <gnome.h>
7.22 -
7.23 -void
7.24 -on_new_file1_activate (GtkMenuItem *menuitem,
7.25 - gpointer user_data);
7.26 -
7.27 -void
7.28 -on_open1_activate (GtkMenuItem *menuitem,
7.29 - gpointer user_data);
7.30 -
7.31 -void
7.32 -on_save1_activate (GtkMenuItem *menuitem,
7.33 - gpointer user_data);
7.34 -
7.35 -void
7.36 -on_save_as1_activate (GtkMenuItem *menuitem,
7.37 - gpointer user_data);
7.38 -
7.39 -void
7.40 -on_save_next_scene_activate (GtkMenuItem *menuitem,
7.41 - gpointer user_data);
7.42 -
7.43 -void
7.44 -on_exit1_activate (GtkMenuItem *menuitem,
7.45 - gpointer user_data);
7.46 -
7.47 -void
7.48 -on_preferences1_activate (GtkMenuItem *menuitem,
7.49 - gpointer user_data);
7.50 -
7.51 -void
7.52 -on_about1_activate (GtkMenuItem *menuitem,
7.53 - gpointer user_data);
7.54 -
7.55 -void
7.56 -on_load_btn_clicked (GtkButton *button,
7.57 - gpointer user_data);
7.58 -
7.59 -void
7.60 -on_reset_btn_clicked (GtkButton *button,
7.61 - gpointer user_data);
7.62 -
7.63 -void
7.64 -on_stop_btn_clicked (GtkButton *button,
7.65 - gpointer user_data);
7.66 -
7.67 -void
7.68 -on_step_btn_clicked (GtkButton *button,
7.69 - gpointer user_data);
7.70 -
7.71 -void
7.72 -on_run_btn_clicked (GtkButton *button,
7.73 - gpointer user_data);
7.74 -
7.75 -void
7.76 -on_runto_btn_clicked (GtkButton *button,
7.77 - gpointer user_data);
7.78 -
7.79 -void
7.80 -on_break_btn_clicked (GtkButton *button,
7.81 - gpointer user_data);
7.82 -
7.83 -void
7.84 -on_trace_button_toggled (GtkToggleButton *button,
7.85 - gpointer user_data);
7.86 -
7.87 -gboolean
7.88 -on_debug_win_delete_event (GtkWidget *widget,
7.89 - GdkEvent *event,
7.90 - gpointer user_data);
7.91 -
7.92 -void
7.93 -on_disasm_list_select_row (GtkCList *clist,
7.94 - gint row,
7.95 - gint column,
7.96 - GdkEvent *event,
7.97 - gpointer user_data);
7.98 -
7.99 -void
7.100 -on_disasm_list_unselect_row (GtkCList *clist,
7.101 - gint row,
7.102 - gint column,
7.103 - GdkEvent *event,
7.104 - gpointer user_data);
7.105 -
7.106 -void
7.107 -on_mem_mapped_regs1_activate (GtkMenuItem *menuitem,
7.108 - gpointer user_data);
7.109 -
7.110 -void
7.111 -on_mmu_reglist_select_row (GtkCList *clist,
7.112 - gint row,
7.113 - gint column,
7.114 - GdkEvent *event,
7.115 - gpointer user_data);
7.116 -
7.117 -void
7.118 -on_mmu_regclose_clicked (GtkButton *button,
7.119 - gpointer user_data);
7.120 -
7.121 -gboolean
7.122 -on_mmr_win_delete_event (GtkWidget *widget,
7.123 - GdkEvent *event,
7.124 - gpointer user_data);
7.125 -
7.126 -void
7.127 -on_mmr_close_clicked (GtkButton *button,
7.128 - gpointer user_data);
7.129 -
7.130 -void
7.131 -on_page_field_changed (GtkEditable *editable,
7.132 - gpointer user_data);
7.133 -
7.134 -void
7.135 -on_mode_field_changed (GtkEditable *editable,
7.136 - gpointer user_data);
7.137 -
7.138 -void
7.139 -on_disasm_list_select_row (GtkCList *clist,
7.140 - gint row,
7.141 - gint column,
7.142 - GdkEvent *event,
7.143 - gpointer user_data);
7.144 -
7.145 -void
7.146 -on_disasm_list_unselect_row (GtkCList *clist,
7.147 - gint row,
7.148 - gint column,
7.149 - GdkEvent *event,
7.150 - gpointer user_data);
7.151 -
7.152 -void
7.153 -on_page_locked_btn_toggled (GtkToggleButton *togglebutton,
7.154 - gpointer user_data);
7.155 -
7.156 -gboolean
7.157 -on_page_field_key_press_event (GtkWidget *widget,
7.158 - GdkEventKey *event,
7.159 - gpointer user_data);
7.160 -
7.161 -void
7.162 -on_output_list_select_row (GtkCList *clist,
7.163 - gint row,
7.164 - gint column,
7.165 - GdkEvent *event,
7.166 - gpointer user_data);
7.167 -
7.168 -void
7.169 -on_jump_pc_btn_clicked (GtkButton *button,
7.170 - gpointer user_data);
7.171 -
7.172 -void
7.173 -on_memory1_activate (GtkMenuItem *menuitem,
7.174 - gpointer user_data);
7.175 -
7.176 -gboolean
7.177 -on_memory_win_delete_event (GtkWidget *widget,
7.178 - GdkEvent *event,
7.179 - gpointer user_data);
7.180 -
7.181 -void
7.182 -button_view_clicked (GtkButton *button,
7.183 - gpointer user_data);
7.184 -
7.185 -void
7.186 -on_button_add_watch_clicked (GtkButton *button,
7.187 - gpointer user_data);
7.188 -
7.189 -void
7.190 -on_button_clear_all_clicked (GtkButton *button,
7.191 - gpointer user_data);
7.192 -
7.193 -void
7.194 -on_button_close_clicked (GtkButton *button,
7.195 - gpointer user_data);
7.196 -
7.197 -gboolean
7.198 -on_dump_win_delete_event (GtkWidget *widget,
7.199 - GdkEvent *event,
7.200 - gpointer user_data);
7.201 -
7.202 -void
7.203 -on_view_memory_activate (GtkMenuItem *menuitem,
7.204 - gpointer user_data);
7.205 -
7.206 -void
7.207 -on_loadstate_button_clicked (GtkToolButton *toolbutton,
7.208 - gpointer user_data);
7.209 -
7.210 -void
7.211 -on_savestate_button_clicked (GtkToolButton *toolbutton,
7.212 - gpointer user_data);
8.1 --- a/src/gui/debug_win.c Tue Oct 09 11:37:36 2007 +0000
8.2 +++ b/src/gui/debug_win.c Wed Oct 10 11:02:04 2007 +0000
8.3 @@ -1,5 +1,5 @@
8.4 /**
8.5 - * $Id: debug_win.c,v 1.22 2007-10-08 11:48:56 nkeynes Exp $
8.6 + * $Id: debug_win.c,v 1.23 2007-10-10 11:02:04 nkeynes Exp $
8.7 * This file is responsible for the main debugger gui frame.
8.8 *
8.9 * Copyright (c) 2005 Nathan Keynes.
8.10 @@ -19,21 +19,27 @@
8.11 #include <stdio.h>
8.12 #include <gnome.h>
8.13 #include <math.h>
8.14 -#include "sh4/sh4dasm.h"
8.15 -#include "gui/gui.h"
8.16 #include "mem.h"
8.17 #include "cpu.h"
8.18 -#include "display.h"
8.19 -#include "pvr2/pvr2.h"
8.20 +#include "debugif.h"
8.21 +#include "gui/gtkui.h"
8.22 +#include "sh4/sh4dasm.h"
8.23 +#include "aica/armdasm.h"
8.24
8.25 -GdkColor *msg_colors[] = { &clrError, &clrError, &clrWarn, &clrNormal,
8.26 - &clrDebug, &clrTrace };
8.27 +GdkColor *msg_colors[] = { &gui_colour_error, &gui_colour_error, &gui_colour_warn,
8.28 + &gui_colour_normal,&gui_colour_debug, &gui_colour_trace };
8.29 char *msg_levels[] = { "FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE" };
8.30 int global_msg_level = EMIT_WARN;
8.31
8.32 -void init_register_list( debug_info_t data );
8.33 +const cpu_desc_t cpu_list[4] = { &sh4_cpu_desc, &arm_cpu_desc, &armt_cpu_desc, NULL };
8.34
8.35 -struct debug_info_struct {
8.36 +void init_register_list( debug_window_t data );
8.37 +uint32_t row_to_address( debug_window_t data, int row );
8.38 +void set_disassembly_pc( debug_window_t data, unsigned int pc, gboolean select );
8.39 +void set_disassembly_region( debug_window_t data, unsigned int page );
8.40 +void set_disassembly_cpu( debug_window_t data, const gchar *cpu );
8.41 +
8.42 +struct debug_window_info {
8.43 int disasm_from;
8.44 int disasm_to;
8.45 int disasm_pc;
8.46 @@ -49,11 +55,12 @@
8.47 char saved_regs[0];
8.48 };
8.49
8.50 -debug_info_t init_debug_win(GtkWidget *win, const cpu_desc_t *cpu_list )
8.51 +debug_window_t debug_window_new( )
8.52 {
8.53 + GtkWidget *win = create_debug_win();
8.54 GnomeAppBar *appbar;
8.55
8.56 - debug_info_t data = g_malloc0( sizeof(struct debug_info_struct) + cpu_list[0]->regs_size );
8.57 + debug_window_t data = g_malloc0( sizeof(struct debug_window_info) + cpu_list[0]->regs_size );
8.58 data->disasm_from = -1;
8.59 data->disasm_to = -1;
8.60 data->disasm_pc = -1;
8.61 @@ -62,7 +69,7 @@
8.62
8.63 data->regs_list= gtk_object_get_data(GTK_OBJECT(win), "reg_list");
8.64 data->win = win;
8.65 - gtk_widget_modify_font( GTK_WIDGET(data->regs_list), fixed_list_font );
8.66 + gtk_widget_modify_font( GTK_WIDGET(data->regs_list), gui_fixed_font );
8.67 init_register_list( data );
8.68 data->msgs_list = gtk_object_get_data(GTK_OBJECT(win), "output_list");
8.69 data->disasm_list = gtk_object_get_data(GTK_OBJECT(win), "disasm_list");
8.70 @@ -75,11 +82,22 @@
8.71
8.72 gtk_object_set_data( GTK_OBJECT(win), "debug_data", data );
8.73 set_disassembly_pc( data, *data->cpu->pc, FALSE );
8.74 - debug_win_set_running( data, FALSE );
8.75 + debug_window_set_running( data, FALSE );
8.76 +
8.77 + gtk_widget_show( win );
8.78 return data;
8.79 }
8.80
8.81 -void init_register_list( debug_info_t data )
8.82 +void debug_window_show( debug_window_t data, gboolean show )
8.83 +{
8.84 + if( show ) {
8.85 + gtk_widget_show( data->win );
8.86 + } else {
8.87 + gtk_widget_hide( data->win );
8.88 + }
8.89 +}
8.90 +
8.91 +void init_register_list( debug_window_t data )
8.92 {
8.93 int i;
8.94 char buf[20];
8.95 @@ -100,7 +118,7 @@
8.96 /*
8.97 * Check for changed registers and update the display
8.98 */
8.99 -void update_registers( debug_info_t data )
8.100 +void debug_window_update( debug_window_t data )
8.101 {
8.102 int i;
8.103 for( i=0; data->cpu->regs_info[i].name != NULL; i++ ) {
8.104 @@ -111,9 +129,9 @@
8.105 char buf[20];
8.106 sprintf( buf, "%08X", *((uint32_t *)data->cpu->regs_info[i].value) );
8.107 gtk_clist_set_text( data->regs_list, i, 1, buf );
8.108 - gtk_clist_set_foreground( data->regs_list, i, &clrChanged );
8.109 + gtk_clist_set_foreground( data->regs_list, i, &gui_colour_changed );
8.110 } else {
8.111 - gtk_clist_set_foreground( data->regs_list, i, &clrNormal );
8.112 + gtk_clist_set_foreground( data->regs_list, i, &gui_colour_normal );
8.113 }
8.114 } else {
8.115 if( *((float *)data->cpu->regs_info[i].value) !=
8.116 @@ -121,9 +139,9 @@
8.117 char buf[20];
8.118 sprintf( buf, "%f", *((float *)data->cpu->regs_info[i].value) );
8.119 gtk_clist_set_text( data->regs_list, i, 1, buf );
8.120 - gtk_clist_set_foreground( data->regs_list, i, &clrChanged );
8.121 + gtk_clist_set_foreground( data->regs_list, i, &gui_colour_changed );
8.122 } else {
8.123 - gtk_clist_set_foreground( data->regs_list, i, &clrNormal );
8.124 + gtk_clist_set_foreground( data->regs_list, i, &gui_colour_normal );
8.125 }
8.126 }
8.127 }
8.128 @@ -132,16 +150,7 @@
8.129 memcpy( data->saved_regs, data->cpu->regs, data->cpu->regs_size );
8.130 }
8.131
8.132 -void update_icount( debug_info_t data )
8.133 -{
8.134 - if( data != NULL ) {
8.135 - // sprintf( data->icounter_text, "%d", *data->cpu->icount );
8.136 - sprintf( data->icounter_text, "%d", pvr2_get_frame_count() );
8.137 - gtk_progress_bar_set_text( data->icounter, data->icounter_text );
8.138 - }
8.139 -}
8.140 -
8.141 -void set_disassembly_region( debug_info_t data, unsigned int page )
8.142 +void set_disassembly_region( debug_window_t data, unsigned int page )
8.143 {
8.144 uint32_t i, posn, next;
8.145 char buf[80];
8.146 @@ -159,29 +168,29 @@
8.147 if( !data->cpu->is_valid_page_func( from ) ) {
8.148 arr[3] = "This page is currently unmapped";
8.149 gtk_clist_append( data->disasm_list, arr );
8.150 - gtk_clist_set_foreground( data->disasm_list, 0, &clrError );
8.151 + gtk_clist_set_foreground( data->disasm_list, 0, &gui_colour_error );
8.152 } else {
8.153 for( i=from; i<to; i = next ) {
8.154 next = data->cpu->disasm_func( i, buf, sizeof(buf), opcode );
8.155 sprintf( addr, "%08X", i );
8.156 posn = gtk_clist_append( data->disasm_list, arr );
8.157 if( buf[0] == '?' )
8.158 - gtk_clist_set_foreground( data->disasm_list, posn, &clrWarn );
8.159 + gtk_clist_set_foreground( data->disasm_list, posn, &gui_colour_warn );
8.160 if( data->cpu->get_breakpoint != NULL ) {
8.161 int type = data->cpu->get_breakpoint( i );
8.162 switch(type) {
8.163 case BREAK_ONESHOT:
8.164 - gtk_clist_set_background( data->disasm_list, posn, &clrTempBreak );
8.165 + gtk_clist_set_background( data->disasm_list, posn, &gui_colour_temp_break );
8.166 break;
8.167 case BREAK_KEEP:
8.168 - gtk_clist_set_background( data->disasm_list, posn, &clrBreak );
8.169 + gtk_clist_set_background( data->disasm_list, posn, &gui_colour_break );
8.170 break;
8.171 }
8.172 }
8.173 }
8.174 if( data->disasm_pc != -1 && data->disasm_pc >= from && data->disasm_pc < to )
8.175 gtk_clist_set_foreground( data->disasm_list, address_to_row(data, data->disasm_pc),
8.176 - &clrPC );
8.177 + &gui_colour_pc );
8.178 }
8.179
8.180 if( page != from ) { /* not a page boundary */
8.181 @@ -191,7 +200,7 @@
8.182 data->disasm_to = to;
8.183 }
8.184
8.185 -void jump_to_disassembly( debug_info_t data, unsigned int addr, gboolean select )
8.186 +void jump_to_disassembly( debug_window_t data, unsigned int addr, gboolean select )
8.187 {
8.188 int row;
8.189
8.190 @@ -207,12 +216,12 @@
8.191 }
8.192 }
8.193
8.194 -void jump_to_pc( debug_info_t data, gboolean select )
8.195 +void jump_to_pc( debug_window_t data, gboolean select )
8.196 {
8.197 jump_to_disassembly( data, *data->cpu->pc, select );
8.198 }
8.199
8.200 -void set_disassembly_pc( debug_info_t data, unsigned int pc, gboolean select )
8.201 +void set_disassembly_pc( debug_window_t data, unsigned int pc, gboolean select )
8.202 {
8.203 int row;
8.204
8.205 @@ -221,13 +230,13 @@
8.206 data->disasm_pc < data->disasm_to )
8.207 gtk_clist_set_foreground( data->disasm_list,
8.208 (data->disasm_pc - data->disasm_from) / data->cpu->instr_size,
8.209 - &clrNormal );
8.210 + &gui_colour_normal );
8.211 row = address_to_row( data, pc );
8.212 - gtk_clist_set_foreground( data->disasm_list, row, &clrPC );
8.213 + gtk_clist_set_foreground( data->disasm_list, row, &gui_colour_pc );
8.214 data->disasm_pc = pc;
8.215 }
8.216
8.217 -void set_disassembly_cpu( debug_info_t data, const gchar *cpu )
8.218 +void set_disassembly_cpu( debug_window_t data, const gchar *cpu )
8.219 {
8.220 int i;
8.221 for( i=0; data->cpu_list[i] != NULL; i++ ) {
8.222 @@ -237,48 +246,47 @@
8.223 data->disasm_from = data->disasm_to = -1; /* Force reload */
8.224 set_disassembly_pc( data, *data->cpu->pc, FALSE );
8.225 init_register_list( data );
8.226 - update_icount( data );
8.227 }
8.228 return;
8.229 }
8.230 }
8.231 }
8.232
8.233 -void debug_win_toggle_breakpoint( debug_info_t data, int row )
8.234 +void debug_win_toggle_breakpoint( debug_window_t data, int row )
8.235 {
8.236 uint32_t pc = row_to_address( data, row );
8.237 int oldType = data->cpu->get_breakpoint( pc );
8.238 if( oldType != BREAK_NONE ) {
8.239 data->cpu->clear_breakpoint( pc, oldType );
8.240 - gtk_clist_set_background( data->disasm_list, row, &clrWhite );
8.241 + gtk_clist_set_background( data->disasm_list, row, &gui_colour_white );
8.242 } else {
8.243 data->cpu->set_breakpoint( pc, BREAK_KEEP );
8.244 - gtk_clist_set_background( data->disasm_list, row, &clrBreak );
8.245 + gtk_clist_set_background( data->disasm_list, row, &gui_colour_break );
8.246 }
8.247 }
8.248
8.249 -void debug_win_set_oneshot_breakpoint( debug_info_t data, int row )
8.250 +void debug_win_set_oneshot_breakpoint( debug_window_t data, int row )
8.251 {
8.252 uint32_t pc = row_to_address( data, row );
8.253 data->cpu->clear_breakpoint( pc, BREAK_ONESHOT );
8.254 data->cpu->set_breakpoint( pc, BREAK_ONESHOT );
8.255 - gtk_clist_set_background( data->disasm_list, row, &clrTempBreak );
8.256 + gtk_clist_set_background( data->disasm_list, row, &gui_colour_temp_break );
8.257 }
8.258
8.259 /**
8.260 * Execute a single instruction using the current CPU mode.
8.261 */
8.262 -void debug_win_single_step( debug_info_t data )
8.263 +void debug_win_single_step( debug_window_t data )
8.264 {
8.265 data->cpu->step_func();
8.266 gtk_gui_update();
8.267 }
8.268
8.269 -uint32_t row_to_address( debug_info_t data, int row ) {
8.270 +uint32_t row_to_address( debug_window_t data, int row ) {
8.271 return data->cpu->instr_size * row + data->disasm_from;
8.272 }
8.273
8.274 -int address_to_row( debug_info_t data, uint32_t address ) {
8.275 +int address_to_row( debug_window_t data, uint32_t address ) {
8.276 if( data->disasm_from > address || data->disasm_to <= address )
8.277 return -1;
8.278 return (address - data->disasm_from) / data->cpu->instr_size;
8.279 @@ -292,11 +300,12 @@
8.280 int posn;
8.281 time_t tm = time(NULL);
8.282 va_list ap;
8.283 - debug_info_t data;
8.284 + debug_window_t data = NULL;
8.285 + /*
8.286 if( ptr == NULL )
8.287 - data = main_debug;
8.288 - else data = (debug_info_t)ptr;
8.289 -
8.290 + data = debug_win;
8.291 + else data = (debug_window_t)ptr;
8.292 + */
8.293 if( level > global_msg_level ) {
8.294 return; // ignored
8.295 }
8.296 @@ -329,21 +338,21 @@
8.297 gtk_main_iteration();
8.298 }
8.299
8.300 -debug_info_t get_debug_info( GtkWidget *widget ) {
8.301 +debug_window_t get_debug_info( GtkWidget *widget ) {
8.302
8.303 GtkWidget *win = gtk_widget_get_toplevel(widget);
8.304 - debug_info_t data = (debug_info_t)gtk_object_get_data( GTK_OBJECT(win), "debug_data" );
8.305 + debug_window_t data = (debug_window_t)gtk_object_get_data( GTK_OBJECT(win), "debug_data" );
8.306 return data;
8.307 }
8.308
8.309 -void debug_win_enable_widget( debug_info_t data, const char *name,
8.310 +void debug_win_enable_widget( debug_window_t data, const char *name,
8.311 gboolean enabled )
8.312 {
8.313 GtkWidget *widget = GTK_WIDGET(gtk_object_get_data(GTK_OBJECT(data->win), name));
8.314 gtk_widget_set_sensitive( widget, enabled );
8.315 }
8.316
8.317 -void debug_win_set_running( debug_info_t data, gboolean isRunning )
8.318 +void debug_window_set_running( debug_window_t data, gboolean isRunning )
8.319 {
8.320 if( data != NULL ) {
8.321 debug_win_enable_widget( data, "stop_btn", isRunning );
9.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
9.2 +++ b/src/gui/debugcb.c Wed Oct 10 11:02:04 2007 +0000
9.3 @@ -0,0 +1,359 @@
9.4 +/**
9.5 + * $Id: debugcb.c,v 1.1 2007-10-10 11:02:04 nkeynes Exp $
9.6 + *
9.7 + * All GTK callbacks go here (stubs are autogenerated by Glade)
9.8 + *
9.9 + * Copyright (c) 2005 Nathan Keynes.
9.10 + *
9.11 + * This program is free software; you can redistribute it and/or modify
9.12 + * it under the terms of the GNU General Public License as published by
9.13 + * the Free Software Foundation; either version 2 of the License, or
9.14 + * (at your option) any later version.
9.15 + *
9.16 + * This program is distributed in the hope that it will be useful,
9.17 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
9.18 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9.19 + * GNU General Public License for more details.
9.20 + */
9.21 +
9.22 +#ifdef HAVE_CONFIG_H
9.23 +# include <config.h>
9.24 +#endif
9.25 +
9.26 +#include <gnome.h>
9.27 +
9.28 +#include "gui/debugcb.h"
9.29 +#include "gui/debugif.h"
9.30 +#include "gui/gtkui.h"
9.31 +#include "gdrom/gdrom.h"
9.32 +#include "mem.h"
9.33 +#include "mmio.h"
9.34 +#include "dreamcast.h"
9.35 +#include "loader.h"
9.36 +#include "pvr2/pvr2.h"
9.37 +
9.38 +int selected_pc = -1;
9.39 +int selected_row = -1;
9.40 +
9.41 +debug_window_t get_debug_info( GtkWidget *widget );
9.42 +
9.43 +void
9.44 +on_new_file1_activate (GtkMenuItem *menuitem,
9.45 + gpointer user_data)
9.46 +{
9.47 +
9.48 +}
9.49 +
9.50 +
9.51 +void
9.52 +on_open1_activate (GtkMenuItem *menuitem,
9.53 + gpointer user_data)
9.54 +{
9.55 + const gchar *dir = dreamcast_get_config_value(CONFIG_DEFAULT_PATH);
9.56 + open_file_dialog( "Open...", file_load_magic, NULL, NULL, dir );
9.57 +}
9.58 +
9.59 +
9.60 +void
9.61 +on_save1_activate (GtkMenuItem *menuitem,
9.62 + gpointer user_data)
9.63 +{
9.64 +
9.65 +}
9.66 +
9.67 +
9.68 +void
9.69 +on_save_as1_activate (GtkMenuItem *menuitem,
9.70 + gpointer user_data)
9.71 +{
9.72 +
9.73 +}
9.74 +
9.75 +void
9.76 +on_save_next_scene_activate( GtkMenuItem *menuitem,
9.77 + gpointer user_data)
9.78 +{
9.79 + const gchar *dir = dreamcast_get_config_value(CONFIG_SAVE_PATH);
9.80 + save_file_dialog( "Save next scene...", pvr2_save_next_scene, "*.dsc", "lxdream scene file (*.dsc)", dir );
9.81 +}
9.82 +
9.83 +void
9.84 +on_exit1_activate (GtkMenuItem *menuitem,
9.85 + gpointer user_data)
9.86 +{
9.87 + gtk_main_quit();
9.88 +}
9.89 +
9.90 +
9.91 +void
9.92 +on_preferences1_activate (GtkMenuItem *menuitem,
9.93 + gpointer user_data)
9.94 +{
9.95 +
9.96 +}
9.97 +
9.98 +
9.99 +void
9.100 +on_about1_activate (GtkMenuItem *menuitem,
9.101 + gpointer user_data)
9.102 +{
9.103 + GtkWidget *about = create_about_win();
9.104 + gtk_widget_show(about);
9.105 +}
9.106 +
9.107 +
9.108 +void
9.109 +on_load_btn_clicked (GtkButton *button,
9.110 + gpointer user_data)
9.111 +{
9.112 + const gchar *dir = dreamcast_get_config_value(CONFIG_DEFAULT_PATH);
9.113 + open_file_dialog( "Open...", gdrom_mount_image, NULL, NULL, dir );
9.114 +}
9.115 +
9.116 +
9.117 +void
9.118 +on_reset_btn_clicked (GtkButton *button,
9.119 + gpointer user_data)
9.120 +{
9.121 + dreamcast_reset();
9.122 +}
9.123 +
9.124 +
9.125 +void
9.126 +on_stop_btn_clicked (GtkButton *button,
9.127 + gpointer user_data)
9.128 +{
9.129 + dreamcast_stop();
9.130 +}
9.131 +
9.132 +
9.133 +void
9.134 +on_step_btn_clicked (GtkButton *button,
9.135 + gpointer user_data)
9.136 +{
9.137 + debug_window_t data = get_debug_info(GTK_WIDGET(button));
9.138 + debug_win_single_step(data);
9.139 +}
9.140 +
9.141 +
9.142 +void
9.143 +on_run_btn_clicked (GtkButton *button,
9.144 + gpointer user_data)
9.145 +{
9.146 + dreamcast_run();
9.147 +}
9.148 +
9.149 +
9.150 +void
9.151 +on_runto_btn_clicked (GtkButton *button,
9.152 + gpointer user_data)
9.153 +{
9.154 + if( selected_pc == -1 )
9.155 + WARN( "No address selected, so can't run to it", NULL );
9.156 + else {
9.157 + debug_window_t data = get_debug_info(GTK_WIDGET(button));
9.158 + debug_win_set_oneshot_breakpoint( data, selected_row );
9.159 + dreamcast_run();
9.160 + }
9.161 +}
9.162 +
9.163 +
9.164 +void
9.165 +on_break_btn_clicked (GtkButton *button,
9.166 + gpointer user_data)
9.167 +{
9.168 + debug_window_t data = get_debug_info(GTK_WIDGET(button));
9.169 + debug_win_toggle_breakpoint( data, selected_row );
9.170 +}
9.171 +
9.172 +void on_trace_button_toggled (GtkToggleButton *button,
9.173 + gpointer user_data)
9.174 +{
9.175 + struct mmio_region *io_rgn = (struct mmio_region *)user_data;
9.176 + gboolean isActive = gtk_toggle_button_get_active(button);
9.177 + if( io_rgn != NULL ) {
9.178 + io_rgn->trace_flag = isActive ? 1 : 0;
9.179 + }
9.180 +}
9.181 +
9.182 +
9.183 +gboolean
9.184 +on_debug_win_delete_event (GtkWidget *widget,
9.185 + GdkEvent *event,
9.186 + gpointer user_data)
9.187 +{
9.188 + dreamcast_shutdown();
9.189 + gtk_main_quit();
9.190 + return FALSE;
9.191 +}
9.192 +
9.193 +
9.194 +void
9.195 +on_disasm_list_select_row (GtkCList *clist,
9.196 + gint row,
9.197 + gint column,
9.198 + GdkEvent *event,
9.199 + gpointer user_data)
9.200 +{
9.201 + debug_window_t data = get_debug_info(GTK_WIDGET(clist));
9.202 + selected_pc = row_to_address(data, row);
9.203 + selected_row = row;
9.204 +}
9.205 +
9.206 +
9.207 +void
9.208 +on_disasm_list_unselect_row (GtkCList *clist,
9.209 + gint row,
9.210 + gint column,
9.211 + GdkEvent *event,
9.212 + gpointer user_data)
9.213 +{
9.214 + debug_window_t data = get_debug_info(GTK_WIDGET(clist));
9.215 + int pc = row_to_address(data,row);
9.216 + if( selected_pc == pc ) selected_pc = -1;
9.217 +}
9.218 +
9.219 +
9.220 +void
9.221 +on_mem_mapped_regs1_activate (GtkMenuItem *menuitem,
9.222 + gpointer user_data)
9.223 +{
9.224 + mmr_open_win();
9.225 +}
9.226 +
9.227 +
9.228 +gboolean
9.229 +on_mmr_win_delete_event (GtkWidget *widget,
9.230 + GdkEvent *event,
9.231 + gpointer user_data)
9.232 +{
9.233 + mmr_close_win();
9.234 + return TRUE;
9.235 +}
9.236 +
9.237 +
9.238 +void
9.239 +on_mmr_close_clicked (GtkButton *button,
9.240 + gpointer user_data)
9.241 +{
9.242 + mmr_close_win();
9.243 +}
9.244 +
9.245 +
9.246 +void
9.247 +on_mode_field_changed (GtkEditable *editable,
9.248 + gpointer user_data)
9.249 +{
9.250 + const gchar *text = gtk_entry_get_text( GTK_ENTRY(editable) );
9.251 + debug_window_t data = get_debug_info( GTK_WIDGET(editable) );
9.252 + set_disassembly_cpu( data, text );
9.253 +}
9.254 +
9.255 +
9.256 +void
9.257 +on_page_locked_btn_toggled (GtkToggleButton *togglebutton,
9.258 + gpointer user_data)
9.259 +{
9.260 +
9.261 +}
9.262 +
9.263 +
9.264 +gboolean
9.265 +on_page_field_key_press_event (GtkWidget *widget,
9.266 + GdkEventKey *event,
9.267 + gpointer user_data)
9.268 +{
9.269 + if( event->keyval == GDK_Return || event->keyval == GDK_Linefeed ) {
9.270 + debug_window_t data = get_debug_info(widget);
9.271 + const gchar *text = gtk_entry_get_text( GTK_ENTRY(widget) );
9.272 + gchar *endptr;
9.273 + unsigned int val = strtoul( text, &endptr, 16 );
9.274 + if( text == endptr ) { /* invalid input */
9.275 + char buf[10];
9.276 + sprintf( buf, "%08X", row_to_address(data,0) );
9.277 + gtk_entry_set_text( GTK_ENTRY(widget), buf );
9.278 + } else {
9.279 + set_disassembly_region(data, val);
9.280 + }
9.281 + }
9.282 + return FALSE;
9.283 +}
9.284 +
9.285 +
9.286 +void
9.287 +on_output_list_select_row (GtkCList *clist,
9.288 + gint row,
9.289 + gint column,
9.290 + GdkEvent *event,
9.291 + gpointer user_data)
9.292 +{
9.293 + if( event->type == GDK_2BUTTON_PRESS && event->button.button == 1 ) {
9.294 + char *val;
9.295 + gtk_clist_get_text( clist, row, 2, &val );
9.296 + if( val[0] != '\0' ) {
9.297 + int addr = strtoul( val, NULL, 16 );
9.298 + debug_window_t data = get_debug_info( GTK_WIDGET(clist) );
9.299 + jump_to_disassembly( data, addr, TRUE );
9.300 + }
9.301 + }
9.302 +}
9.303 +
9.304 +
9.305 +void
9.306 +on_jump_pc_btn_clicked (GtkButton *button,
9.307 + gpointer user_data)
9.308 +{
9.309 + debug_window_t data = get_debug_info( GTK_WIDGET(button) );
9.310 + jump_to_pc( data, TRUE );
9.311 +}
9.312 +
9.313 +
9.314 +void
9.315 +on_button_add_watch_clicked (GtkButton *button,
9.316 + gpointer user_data)
9.317 +{
9.318 +
9.319 +}
9.320 +
9.321 +
9.322 +void
9.323 +on_button_clear_all_clicked (GtkButton *button,
9.324 + gpointer user_data)
9.325 +{
9.326 +
9.327 +}
9.328 +
9.329 +
9.330 +void
9.331 +on_button_close_clicked (GtkButton *button,
9.332 + gpointer user_data)
9.333 +{
9.334 +
9.335 +}
9.336 +
9.337 +
9.338 +void
9.339 +on_view_memory_activate (GtkMenuItem *menuitem,
9.340 + gpointer user_data)
9.341 +{
9.342 + dump_window_new();
9.343 +}
9.344 +
9.345 +
9.346 +void
9.347 +on_loadstate_button_clicked (GtkToolButton *toolbutton,
9.348 + gpointer user_data)
9.349 +{
9.350 + const gchar *dir = dreamcast_get_config_value(CONFIG_SAVE_PATH);
9.351 + open_file_dialog( "Load state...", dreamcast_load_state, "*.dst", "lxDream Save State (*.dst)", dir );
9.352 +}
9.353 +
9.354 +
9.355 +void
9.356 +on_savestate_button_clicked (GtkToolButton *toolbutton,
9.357 + gpointer user_data)
9.358 +{
9.359 + const gchar *dir = dreamcast_get_config_value(CONFIG_SAVE_PATH);
9.360 + save_file_dialog( "Save state...", dreamcast_save_state, "*.dst", "lxDream Save State (*.dst)", dir );
9.361 +}
9.362 +
10.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
10.2 +++ b/src/gui/debugcb.h Wed Oct 10 11:02:04 2007 +0000
10.3 @@ -0,0 +1,209 @@
10.4 +/**
10.5 + * $Id: debugcb.h,v 1.1 2007-10-10 11:02:04 nkeynes Exp $
10.6 + *
10.7 + * GTK callback declarations (stubs are autogenerated by Glade)
10.8 + *
10.9 + * Copyright (c) 2005 Nathan Keynes.
10.10 + *
10.11 + * This program is free software; you can redistribute it and/or modify
10.12 + * it under the terms of the GNU General Public License as published by
10.13 + * the Free Software Foundation; either version 2 of the License, or
10.14 + * (at your option) any later version.
10.15 + *
10.16 + * This program is distributed in the hope that it will be useful,
10.17 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
10.18 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10.19 + * GNU General Public License for more details.
10.20 + */
10.21 +#include <gnome.h>
10.22 +
10.23 +void
10.24 +on_new_file1_activate (GtkMenuItem *menuitem,
10.25 + gpointer user_data);
10.26 +
10.27 +void
10.28 +on_open1_activate (GtkMenuItem *menuitem,
10.29 + gpointer user_data);
10.30 +
10.31 +void
10.32 +on_save1_activate (GtkMenuItem *menuitem,
10.33 + gpointer user_data);
10.34 +
10.35 +void
10.36 +on_save_as1_activate (GtkMenuItem *menuitem,
10.37 + gpointer user_data);
10.38 +
10.39 +void
10.40 +on_save_next_scene_activate (GtkMenuItem *menuitem,
10.41 + gpointer user_data);
10.42 +
10.43 +void
10.44 +on_exit1_activate (GtkMenuItem *menuitem,
10.45 + gpointer user_data);
10.46 +
10.47 +void
10.48 +on_preferences1_activate (GtkMenuItem *menuitem,
10.49 + gpointer user_data);
10.50 +
10.51 +void
10.52 +on_about1_activate (GtkMenuItem *menuitem,
10.53 + gpointer user_data);
10.54 +
10.55 +void
10.56 +on_load_btn_clicked (GtkButton *button,
10.57 + gpointer user_data);
10.58 +
10.59 +void
10.60 +on_reset_btn_clicked (GtkButton *button,
10.61 + gpointer user_data);
10.62 +
10.63 +void
10.64 +on_stop_btn_clicked (GtkButton *button,
10.65 + gpointer user_data);
10.66 +
10.67 +void
10.68 +on_step_btn_clicked (GtkButton *button,
10.69 + gpointer user_data);
10.70 +
10.71 +void
10.72 +on_run_btn_clicked (GtkButton *button,
10.73 + gpointer user_data);
10.74 +
10.75 +void
10.76 +on_runto_btn_clicked (GtkButton *button,
10.77 + gpointer user_data);
10.78 +
10.79 +void
10.80 +on_break_btn_clicked (GtkButton *button,
10.81 + gpointer user_data);
10.82 +
10.83 +void
10.84 +on_trace_button_toggled (GtkToggleButton *button,
10.85 + gpointer user_data);
10.86 +
10.87 +gboolean
10.88 +on_debug_win_delete_event (GtkWidget *widget,
10.89 + GdkEvent *event,
10.90 + gpointer user_data);
10.91 +
10.92 +void
10.93 +on_disasm_list_select_row (GtkCList *clist,
10.94 + gint row,
10.95 + gint column,
10.96 + GdkEvent *event,
10.97 + gpointer user_data);
10.98 +
10.99 +void
10.100 +on_disasm_list_unselect_row (GtkCList *clist,
10.101 + gint row,
10.102 + gint column,
10.103 + GdkEvent *event,
10.104 + gpointer user_data);
10.105 +
10.106 +void
10.107 +on_mem_mapped_regs1_activate (GtkMenuItem *menuitem,
10.108 + gpointer user_data);
10.109 +
10.110 +void
10.111 +on_mmu_reglist_select_row (GtkCList *clist,
10.112 + gint row,
10.113 + gint column,
10.114 + GdkEvent *event,
10.115 + gpointer user_data);
10.116 +
10.117 +void
10.118 +on_mmu_regclose_clicked (GtkButton *button,
10.119 + gpointer user_data);
10.120 +
10.121 +gboolean
10.122 +on_mmr_win_delete_event (GtkWidget *widget,
10.123 + GdkEvent *event,
10.124 + gpointer user_data);
10.125 +
10.126 +void
10.127 +on_mmr_close_clicked (GtkButton *button,
10.128 + gpointer user_data);
10.129 +
10.130 +void
10.131 +on_page_field_changed (GtkEditable *editable,
10.132 + gpointer user_data);
10.133 +
10.134 +void
10.135 +on_mode_field_changed (GtkEditable *editable,
10.136 + gpointer user_data);
10.137 +
10.138 +void
10.139 +on_disasm_list_select_row (GtkCList *clist,
10.140 + gint row,
10.141 + gint column,
10.142 + GdkEvent *event,
10.143 + gpointer user_data);
10.144 +
10.145 +void
10.146 +on_disasm_list_unselect_row (GtkCList *clist,
10.147 + gint row,
10.148 + gint column,
10.149 + GdkEvent *event,
10.150 + gpointer user_data);
10.151 +
10.152 +void
10.153 +on_page_locked_btn_toggled (GtkToggleButton *togglebutton,
10.154 + gpointer user_data);
10.155 +
10.156 +gboolean
10.157 +on_page_field_key_press_event (GtkWidget *widget,
10.158 + GdkEventKey *event,
10.159 + gpointer user_data);
10.160 +
10.161 +void
10.162 +on_output_list_select_row (GtkCList *clist,
10.163 + gint row,
10.164 + gint column,
10.165 + GdkEvent *event,
10.166 + gpointer user_data);
10.167 +
10.168 +void
10.169 +on_jump_pc_btn_clicked (GtkButton *button,
10.170 + gpointer user_data);
10.171 +
10.172 +void
10.173 +on_memory1_activate (GtkMenuItem *menuitem,
10.174 + gpointer user_data);
10.175 +
10.176 +gboolean
10.177 +on_memory_win_delete_event (GtkWidget *widget,
10.178 + GdkEvent *event,
10.179 + gpointer user_data);
10.180 +
10.181 +void
10.182 +button_view_clicked (GtkButton *button,
10.183 + gpointer user_data);
10.184 +
10.185 +void
10.186 +on_button_add_watch_clicked (GtkButton *button,
10.187 + gpointer user_data);
10.188 +
10.189 +void
10.190 +on_button_clear_all_clicked (GtkButton *button,
10.191 + gpointer user_data);
10.192 +
10.193 +void
10.194 +on_button_close_clicked (GtkButton *button,
10.195 + gpointer user_data);
10.196 +
10.197 +gboolean
10.198 +on_dump_win_delete_event (GtkWidget *widget,
10.199 + GdkEvent *event,
10.200 + gpointer user_data);
10.201 +
10.202 +void
10.203 +on_view_memory_activate (GtkMenuItem *menuitem,
10.204 + gpointer user_data);
10.205 +
10.206 +void
10.207 +on_loadstate_button_clicked (GtkToolButton *toolbutton,
10.208 + gpointer user_data);
10.209 +
10.210 +void
10.211 +on_savestate_button_clicked (GtkToolButton *toolbutton,
10.212 + gpointer user_data);
11.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
11.2 +++ b/src/gui/debugif.c Wed Oct 10 11:02:04 2007 +0000
11.3 @@ -0,0 +1,789 @@
11.4 +/*
11.5 + * DO NOT EDIT THIS FILE - it is generated by Glade.
11.6 + */
11.7 +
11.8 +#ifdef HAVE_CONFIG_H
11.9 +# include <config.h>
11.10 +#endif
11.11 +
11.12 +#include <sys/types.h>
11.13 +#include <sys/stat.h>
11.14 +#include <unistd.h>
11.15 +#include <string.h>
11.16 +#include <stdio.h>
11.17 +
11.18 +#include <bonobo.h>
11.19 +#include <gnome.h>
11.20 +
11.21 +#include "debugcb.h"
11.22 +#include "debugif.h"
11.23 +#include "support.h"
11.24 +
11.25 +#define GLADE_HOOKUP_OBJECT(component,widget,name) \
11.26 + g_object_set_data_full (G_OBJECT (component), name, \
11.27 + gtk_widget_ref (widget), (GDestroyNotify) gtk_widget_unref)
11.28 +
11.29 +#define GLADE_HOOKUP_OBJECT_NO_REF(component,widget,name) \
11.30 + g_object_set_data (G_OBJECT (component), name, widget)
11.31 +
11.32 +static GnomeUIInfo file1_menu_uiinfo[] =
11.33 +{
11.34 + GNOMEUIINFO_MENU_NEW_ITEM (N_("_New"), NULL, on_new_file1_activate, NULL),
11.35 + GNOMEUIINFO_MENU_OPEN_ITEM (on_open1_activate, NULL),
11.36 + GNOMEUIINFO_MENU_SAVE_ITEM (on_save1_activate, NULL),
11.37 + GNOMEUIINFO_MENU_SAVE_AS_ITEM (on_save_as1_activate, NULL),
11.38 + {
11.39 + GNOME_APP_UI_ITEM, N_("Save next scene..."),
11.40 + NULL,
11.41 + (gpointer) on_save_next_scene_activate, NULL, NULL,
11.42 + GNOME_APP_PIXMAP_NONE, NULL,
11.43 + 0, (GdkModifierType) 0, NULL
11.44 + },
11.45 + GNOMEUIINFO_SEPARATOR,
11.46 + GNOMEUIINFO_MENU_EXIT_ITEM (on_exit1_activate, NULL),
11.47 + GNOMEUIINFO_END
11.48 +};
11.49 +
11.50 +static GnomeUIInfo view1_menu_uiinfo[] =
11.51 +{
11.52 + {
11.53 + GNOME_APP_UI_ITEM, N_("Memory..."),
11.54 + NULL,
11.55 + (gpointer) on_view_memory_activate, NULL, NULL,
11.56 + GNOME_APP_PIXMAP_NONE, NULL,
11.57 + 0, (GdkModifierType) 0, NULL
11.58 + },
11.59 + {
11.60 + GNOME_APP_UI_ITEM, N_("Mem mapped Regs..."),
11.61 + NULL,
11.62 + (gpointer) on_mem_mapped_regs1_activate, NULL, NULL,
11.63 + GNOME_APP_PIXMAP_NONE, NULL,
11.64 + 0, (GdkModifierType) 0, NULL
11.65 + },
11.66 + GNOMEUIINFO_END
11.67 +};
11.68 +
11.69 +static GnomeUIInfo settings1_menu_uiinfo[] =
11.70 +{
11.71 + GNOMEUIINFO_MENU_PREFERENCES_ITEM (on_preferences1_activate, NULL),
11.72 + GNOMEUIINFO_END
11.73 +};
11.74 +
11.75 +static GnomeUIInfo help1_menu_uiinfo[] =
11.76 +{
11.77 + GNOMEUIINFO_MENU_ABOUT_ITEM (on_about1_activate, NULL),
11.78 + GNOMEUIINFO_END
11.79 +};
11.80 +
11.81 +static GnomeUIInfo menubar1_uiinfo[] =
11.82 +{
11.83 + {
11.84 + GNOME_APP_UI_SUBTREE, N_("_File"),
11.85 + NULL,
11.86 + file1_menu_uiinfo, NULL, NULL,
11.87 + GNOME_APP_PIXMAP_NONE, NULL,
11.88 + 0, (GdkModifierType) 0, NULL
11.89 + },
11.90 + {
11.91 + GNOME_APP_UI_SUBTREE, N_("_View"),
11.92 + NULL,
11.93 + view1_menu_uiinfo, NULL, NULL,
11.94 + GNOME_APP_PIXMAP_NONE, NULL,
11.95 + 0, (GdkModifierType) 0, NULL
11.96 + },
11.97 + {
11.98 + GNOME_APP_UI_SUBTREE, N_("_Settings"),
11.99 + NULL,
11.100 + settings1_menu_uiinfo, NULL, NULL,
11.101 + GNOME_APP_PIXMAP_NONE, NULL,
11.102 + 0, (GdkModifierType) 0, NULL
11.103 + },
11.104 + {
11.105 + GNOME_APP_UI_SUBTREE, N_("_Help"),
11.106 + NULL,
11.107 + help1_menu_uiinfo, NULL, NULL,
11.108 + GNOME_APP_PIXMAP_NONE, NULL,
11.109 + 0, (GdkModifierType) 0, NULL
11.110 + },
11.111 + GNOMEUIINFO_END
11.112 +};
11.113 +
11.114 +GtkWidget*
11.115 +create_debug_win (void)
11.116 +{
11.117 + GtkWidget *debug_win;
11.118 + GtkWidget *dock1;
11.119 + GtkWidget *toolbar1;
11.120 + GtkIconSize tmp_toolbar_icon_size;
11.121 + GtkWidget *tmp_image;
11.122 + GtkWidget *load_btn;
11.123 + GtkWidget *reset_btn;
11.124 + GtkWidget *stop_btn;
11.125 + GtkWidget *step_btn;
11.126 + GtkWidget *run_btn;
11.127 + GtkWidget *runto_btn;
11.128 + GtkWidget *break_btn;
11.129 + GtkWidget *loadstate_button;
11.130 + GtkWidget *savestate_button;
11.131 + GtkWidget *vpaned1;
11.132 + GtkWidget *hpaned1;
11.133 + GtkWidget *vbox2;
11.134 + GtkWidget *hbox1;
11.135 + GtkWidget *label21;
11.136 + GtkWidget *page_field;
11.137 + GtkWidget *page_locked_btn;
11.138 + GtkWidget *jump_pc_btn;
11.139 + GtkWidget *label22;
11.140 + GtkWidget *mode_box;
11.141 + GList *mode_box_items = NULL;
11.142 + GtkWidget *mode_field;
11.143 + GtkWidget *label23;
11.144 + GtkWidget *scrolledwindow7;
11.145 + GtkWidget *disasm_list;
11.146 + GtkWidget *label24;
11.147 + GtkWidget *label27;
11.148 + GtkWidget *label28;
11.149 + GtkWidget *label29;
11.150 + GtkWidget *scrolledwindow4;
11.151 + GtkWidget *reg_list;
11.152 + GtkWidget *label25;
11.153 + GtkWidget *label30;
11.154 + GtkWidget *scrolledwindow8;
11.155 + GtkWidget *output_list;
11.156 + GtkWidget *label26;
11.157 + GtkWidget *label31;
11.158 + GtkWidget *label32;
11.159 + GtkWidget *debug_appbar;
11.160 + GtkTooltips *tooltips;
11.161 +
11.162 + tooltips = gtk_tooltips_new ();
11.163 +
11.164 + debug_win = gnome_app_new ("Dream", _("lxDream! Debugger"));
11.165 + gtk_window_set_default_size (GTK_WINDOW (debug_win), 1000, 700);
11.166 +
11.167 + dock1 = GNOME_APP (debug_win)->dock;
11.168 + gtk_widget_show (dock1);
11.169 +
11.170 + gnome_app_create_menus (GNOME_APP (debug_win), menubar1_uiinfo);
11.171 +
11.172 + toolbar1 = gtk_toolbar_new ();
11.173 + gtk_widget_show (toolbar1);
11.174 + gnome_app_add_toolbar (GNOME_APP (debug_win), GTK_TOOLBAR (toolbar1), "toolbar1",
11.175 + BONOBO_DOCK_ITEM_BEH_EXCLUSIVE,
11.176 + BONOBO_DOCK_TOP, 1, 0, 0);
11.177 + gtk_container_set_border_width (GTK_CONTAINER (toolbar1), 1);
11.178 + gtk_toolbar_set_style (GTK_TOOLBAR (toolbar1), GTK_TOOLBAR_BOTH);
11.179 + tmp_toolbar_icon_size = gtk_toolbar_get_icon_size (GTK_TOOLBAR (toolbar1));
11.180 +
11.181 + tmp_image = gtk_image_new_from_stock ("gtk-cdrom", tmp_toolbar_icon_size);
11.182 + gtk_widget_show (tmp_image);
11.183 + load_btn = (GtkWidget*) gtk_tool_button_new (tmp_image, _("Mount"));
11.184 + gtk_widget_show (load_btn);
11.185 + gtk_container_add (GTK_CONTAINER (toolbar1), load_btn);
11.186 + gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (load_btn), tooltips, _("Mount CD-Rom"), NULL);
11.187 +
11.188 + tmp_image = gtk_image_new_from_stock ("gtk-refresh", tmp_toolbar_icon_size);
11.189 + gtk_widget_show (tmp_image);
11.190 + reset_btn = (GtkWidget*) gtk_tool_button_new (tmp_image, _("Reset"));
11.191 + gtk_widget_show (reset_btn);
11.192 + gtk_container_add (GTK_CONTAINER (toolbar1), reset_btn);
11.193 + gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (reset_btn), tooltips, _("Reset emulator"), NULL);
11.194 +
11.195 + tmp_image = gtk_image_new_from_stock ("gtk-stop", tmp_toolbar_icon_size);
11.196 + gtk_widget_show (tmp_image);
11.197 + stop_btn = (GtkWidget*) gtk_tool_button_new (tmp_image, _("Stop"));
11.198 + gtk_widget_show (stop_btn);
11.199 + gtk_container_add (GTK_CONTAINER (toolbar1), stop_btn);
11.200 + gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (stop_btn), tooltips, _("Stop"), NULL);
11.201 +
11.202 + tmp_image = gtk_image_new_from_stock ("gtk-redo", tmp_toolbar_icon_size);
11.203 + gtk_widget_show (tmp_image);
11.204 + step_btn = (GtkWidget*) gtk_tool_button_new (tmp_image, _("Step"));
11.205 + gtk_widget_show (step_btn);
11.206 + gtk_container_add (GTK_CONTAINER (toolbar1), step_btn);
11.207 + gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (step_btn), tooltips, _("Single step"), NULL);
11.208 +
11.209 + tmp_image = gtk_image_new_from_stock ("gtk-go-forward", tmp_toolbar_icon_size);
11.210 + gtk_widget_show (tmp_image);
11.211 + run_btn = (GtkWidget*) gtk_tool_button_new (tmp_image, _("Run"));
11.212 + gtk_widget_show (run_btn);
11.213 + gtk_container_add (GTK_CONTAINER (toolbar1), run_btn);
11.214 + gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (run_btn), tooltips, _("Run"), NULL);
11.215 +
11.216 + tmp_image = gtk_image_new_from_stock ("gtk-goto-last", tmp_toolbar_icon_size);
11.217 + gtk_widget_show (tmp_image);
11.218 + runto_btn = (GtkWidget*) gtk_tool_button_new (tmp_image, _("Run to"));
11.219 + gtk_widget_show (runto_btn);
11.220 + gtk_container_add (GTK_CONTAINER (toolbar1), runto_btn);
11.221 + gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (runto_btn), tooltips, _("Run to current selection"), NULL);
11.222 +
11.223 + tmp_image = gtk_image_new_from_stock ("gtk-close", tmp_toolbar_icon_size);
11.224 + gtk_widget_show (tmp_image);
11.225 + break_btn = (GtkWidget*) gtk_tool_button_new (tmp_image, _("Break"));
11.226 + gtk_widget_show (break_btn);
11.227 + gtk_container_add (GTK_CONTAINER (toolbar1), break_btn);
11.228 + gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (break_btn), tooltips, _("Set breakpoint"), NULL);
11.229 +
11.230 + tmp_image = gtk_image_new_from_stock ("gtk-open", tmp_toolbar_icon_size);
11.231 + gtk_widget_show (tmp_image);
11.232 + loadstate_button = (GtkWidget*) gtk_tool_button_new (tmp_image, _("Load"));
11.233 + gtk_widget_show (loadstate_button);
11.234 + gtk_container_add (GTK_CONTAINER (toolbar1), loadstate_button);
11.235 + gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (loadstate_button), tooltips, _("Load save-state file"), NULL);
11.236 +
11.237 + tmp_image = gtk_image_new_from_stock ("gtk-save", tmp_toolbar_icon_size);
11.238 + gtk_widget_show (tmp_image);
11.239 + savestate_button = (GtkWidget*) gtk_tool_button_new (tmp_image, _("Save"));
11.240 + gtk_widget_show (savestate_button);
11.241 + gtk_container_add (GTK_CONTAINER (toolbar1), savestate_button);
11.242 + gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (savestate_button), tooltips, _("Save save-state file"), NULL);
11.243 +
11.244 + vpaned1 = gtk_vpaned_new ();
11.245 + gtk_widget_show (vpaned1);
11.246 + gnome_app_set_contents (GNOME_APP (debug_win), vpaned1);
11.247 + gtk_paned_set_position (GTK_PANED (vpaned1), 430);
11.248 +
11.249 + hpaned1 = gtk_hpaned_new ();
11.250 + gtk_widget_show (hpaned1);
11.251 + gtk_paned_pack1 (GTK_PANED (vpaned1), hpaned1, TRUE, TRUE);
11.252 + gtk_paned_set_position (GTK_PANED (hpaned1), 800);
11.253 +
11.254 + vbox2 = gtk_vbox_new (FALSE, 0);
11.255 + gtk_widget_show (vbox2);
11.256 + gtk_paned_pack1 (GTK_PANED (hpaned1), vbox2, FALSE, TRUE);
11.257 +
11.258 + hbox1 = gtk_hbox_new (FALSE, 0);
11.259 + gtk_widget_show (hbox1);
11.260 + gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, FALSE, 3);
11.261 +
11.262 + label21 = gtk_label_new (_("Page"));
11.263 + gtk_widget_show (label21);
11.264 + gtk_box_pack_start (GTK_BOX (hbox1), label21, FALSE, FALSE, 4);
11.265 + gtk_label_set_justify (GTK_LABEL (label21), GTK_JUSTIFY_CENTER);
11.266 +
11.267 + page_field = gtk_entry_new ();
11.268 + gtk_widget_show (page_field);
11.269 + gtk_box_pack_start (GTK_BOX (hbox1), page_field, FALSE, TRUE, 0);
11.270 +
11.271 + page_locked_btn = gtk_check_button_new_with_mnemonic (_("Locked"));
11.272 + gtk_widget_show (page_locked_btn);
11.273 + gtk_box_pack_start (GTK_BOX (hbox1), page_locked_btn, FALSE, FALSE, 5);
11.274 +
11.275 + jump_pc_btn = gtk_button_new_with_mnemonic (_(" Jump to PC "));
11.276 + gtk_widget_show (jump_pc_btn);
11.277 + gtk_box_pack_start (GTK_BOX (hbox1), jump_pc_btn, FALSE, FALSE, 4);
11.278 +
11.279 + label22 = gtk_label_new (_("Mode"));
11.280 + gtk_widget_show (label22);
11.281 + gtk_box_pack_start (GTK_BOX (hbox1), label22, FALSE, FALSE, 5);
11.282 + gtk_label_set_justify (GTK_LABEL (label22), GTK_JUSTIFY_RIGHT);
11.283 + gtk_misc_set_alignment (GTK_MISC (label22), 1, 0.5);
11.284 +
11.285 + mode_box = gtk_combo_new ();
11.286 + g_object_set_data (G_OBJECT (GTK_COMBO (mode_box)->popwin),
11.287 + "GladeParentKey", mode_box);
11.288 + gtk_widget_show (mode_box);
11.289 + gtk_box_pack_start (GTK_BOX (hbox1), mode_box, FALSE, FALSE, 0);
11.290 + mode_box_items = g_list_append (mode_box_items, (gpointer) _("SH4"));
11.291 + mode_box_items = g_list_append (mode_box_items, (gpointer) _("ARM7"));
11.292 + mode_box_items = g_list_append (mode_box_items, (gpointer) _("ARM7T"));
11.293 + gtk_combo_set_popdown_strings (GTK_COMBO (mode_box), mode_box_items);
11.294 + g_list_free (mode_box_items);
11.295 +
11.296 + mode_field = GTK_COMBO (mode_box)->entry;
11.297 + gtk_widget_show (mode_field);
11.298 + gtk_editable_set_editable (GTK_EDITABLE (mode_field), FALSE);
11.299 +
11.300 + label23 = gtk_label_new ("");
11.301 + gtk_widget_show (label23);
11.302 + gtk_box_pack_start (GTK_BOX (hbox1), label23, TRUE, TRUE, 4);
11.303 + gtk_label_set_justify (GTK_LABEL (label23), GTK_JUSTIFY_CENTER);
11.304 +
11.305 + scrolledwindow7 = gtk_scrolled_window_new (NULL, NULL);
11.306 + gtk_widget_show (scrolledwindow7);
11.307 + gtk_box_pack_start (GTK_BOX (vbox2), scrolledwindow7, TRUE, TRUE, 0);
11.308 + GTK_WIDGET_UNSET_FLAGS (scrolledwindow7, GTK_CAN_FOCUS);
11.309 + gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow7), GTK_SHADOW_IN);
11.310 +
11.311 + disasm_list = gtk_clist_new (4);
11.312 + gtk_widget_show (disasm_list);
11.313 + gtk_container_add (GTK_CONTAINER (scrolledwindow7), disasm_list);
11.314 + gtk_clist_set_column_width (GTK_CLIST (disasm_list), 0, 80);
11.315 + gtk_clist_set_column_width (GTK_CLIST (disasm_list), 1, 80);
11.316 + gtk_clist_set_column_width (GTK_CLIST (disasm_list), 2, 80);
11.317 + gtk_clist_set_column_width (GTK_CLIST (disasm_list), 3, 80);
11.318 + gtk_clist_column_titles_hide (GTK_CLIST (disasm_list));
11.319 +
11.320 + label24 = gtk_label_new ("");
11.321 + gtk_widget_show (label24);
11.322 + gtk_clist_set_column_widget (GTK_CLIST (disasm_list), 0, label24);
11.323 +
11.324 + label27 = gtk_label_new ("");
11.325 + gtk_widget_show (label27);
11.326 + gtk_clist_set_column_widget (GTK_CLIST (disasm_list), 1, label27);
11.327 +
11.328 + label28 = gtk_label_new ("");
11.329 + gtk_widget_show (label28);
11.330 + gtk_clist_set_column_widget (GTK_CLIST (disasm_list), 2, label28);
11.331 +
11.332 + label29 = gtk_label_new ("");
11.333 + gtk_widget_show (label29);
11.334 + gtk_clist_set_column_widget (GTK_CLIST (disasm_list), 3, label29);
11.335 +
11.336 + scrolledwindow4 = gtk_scrolled_window_new (NULL, NULL);
11.337 + gtk_widget_show (scrolledwindow4);
11.338 + gtk_paned_pack2 (GTK_PANED (hpaned1), scrolledwindow4, FALSE, TRUE);
11.339 + GTK_WIDGET_UNSET_FLAGS (scrolledwindow4, GTK_CAN_FOCUS);
11.340 + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow4), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
11.341 + gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow4), GTK_SHADOW_IN);
11.342 +
11.343 + reg_list = gtk_clist_new (2);
11.344 + gtk_widget_show (reg_list);
11.345 + gtk_container_add (GTK_CONTAINER (scrolledwindow4), reg_list);
11.346 + gtk_clist_set_column_width (GTK_CLIST (reg_list), 0, 80);
11.347 + gtk_clist_set_column_width (GTK_CLIST (reg_list), 1, 80);
11.348 + gtk_clist_column_titles_hide (GTK_CLIST (reg_list));
11.349 +
11.350 + label25 = gtk_label_new ("");
11.351 + gtk_widget_show (label25);
11.352 + gtk_clist_set_column_widget (GTK_CLIST (reg_list), 0, label25);
11.353 +
11.354 + label30 = gtk_label_new ("");
11.355 + gtk_widget_show (label30);
11.356 + gtk_clist_set_column_widget (GTK_CLIST (reg_list), 1, label30);
11.357 +
11.358 + scrolledwindow8 = gtk_scrolled_window_new (NULL, NULL);
11.359 + gtk_widget_show (scrolledwindow8);
11.360 + gtk_paned_pack2 (GTK_PANED (vpaned1), scrolledwindow8, FALSE, TRUE);
11.361 + GTK_WIDGET_UNSET_FLAGS (scrolledwindow8, GTK_CAN_FOCUS);
11.362 + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow8), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);
11.363 + gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow8), GTK_SHADOW_IN);
11.364 +
11.365 + output_list = gtk_clist_new (4);
11.366 + gtk_widget_show (output_list);
11.367 + gtk_container_add (GTK_CONTAINER (scrolledwindow8), output_list);
11.368 + gtk_clist_set_column_width (GTK_CLIST (output_list), 0, 80);
11.369 + gtk_clist_set_column_width (GTK_CLIST (output_list), 1, 80);
11.370 + gtk_clist_set_column_width (GTK_CLIST (output_list), 2, 80);
11.371 + gtk_clist_set_column_width (GTK_CLIST (output_list), 3, 80);
11.372 + gtk_clist_column_titles_hide (GTK_CLIST (output_list));
11.373 +
11.374 + label26 = gtk_label_new ("");
11.375 + gtk_widget_show (label26);
11.376 + gtk_clist_set_column_widget (GTK_CLIST (output_list), 0, label26);
11.377 +
11.378 + label31 = gtk_label_new ("");
11.379 + gtk_widget_show (label31);
11.380 + gtk_clist_set_column_widget (GTK_CLIST (output_list), 1, label31);
11.381 +
11.382 + label32 = gtk_label_new ("");
11.383 + gtk_widget_show (label32);
11.384 + gtk_clist_set_column_widget (GTK_CLIST (output_list), 2, label32);
11.385 +
11.386 + debug_appbar = gnome_appbar_new (TRUE, TRUE, GNOME_PREFERENCES_NEVER);
11.387 + gtk_widget_show (debug_appbar);
11.388 + gnome_app_set_statusbar (GNOME_APP (debug_win), debug_appbar);
11.389 +
11.390 + g_signal_connect ((gpointer) debug_win, "delete_event",
11.391 + G_CALLBACK (on_debug_win_delete_event),
11.392 + NULL);
11.393 + gnome_app_install_menu_hints (GNOME_APP (debug_win), menubar1_uiinfo);
11.394 + g_signal_connect ((gpointer) load_btn, "clicked",
11.395 + G_CALLBACK (on_load_btn_clicked),
11.396 + NULL);
11.397 + g_signal_connect ((gpointer) reset_btn, "clicked",
11.398 + G_CALLBACK (on_reset_btn_clicked),
11.399 + NULL);
11.400 + g_signal_connect ((gpointer) stop_btn, "clicked",
11.401 + G_CALLBACK (on_stop_btn_clicked),
11.402 + NULL);
11.403 + g_signal_connect ((gpointer) step_btn, "clicked",
11.404 + G_CALLBACK (on_step_btn_clicked),
11.405 + NULL);
11.406 + g_signal_connect ((gpointer) run_btn, "clicked",
11.407 + G_CALLBACK (on_run_btn_clicked),
11.408 + NULL);
11.409 + g_signal_connect ((gpointer) runto_btn, "clicked",
11.410 + G_CALLBACK (on_runto_btn_clicked),
11.411 + NULL);
11.412 + g_signal_connect ((gpointer) break_btn, "clicked",
11.413 + G_CALLBACK (on_break_btn_clicked),
11.414 + NULL);
11.415 + g_signal_connect ((gpointer) loadstate_button, "clicked",
11.416 + G_CALLBACK (on_loadstate_button_clicked),
11.417 + NULL);
11.418 + g_signal_connect ((gpointer) savestate_button, "clicked",
11.419 + G_CALLBACK (on_savestate_button_clicked),
11.420 + NULL);
11.421 + g_signal_connect ((gpointer) page_field, "key_press_event",
11.422 + G_CALLBACK (on_page_field_key_press_event),
11.423 + NULL);
11.424 + g_signal_connect ((gpointer) page_locked_btn, "toggled",
11.425 + G_CALLBACK (on_page_locked_btn_toggled),
11.426 + NULL);
11.427 + g_signal_connect ((gpointer) jump_pc_btn, "clicked",
11.428 + G_CALLBACK (on_jump_pc_btn_clicked),
11.429 + NULL);
11.430 + g_signal_connect ((gpointer) mode_field, "changed",
11.431 + G_CALLBACK (on_mode_field_changed),
11.432 + NULL);
11.433 + g_signal_connect ((gpointer) disasm_list, "select_row",
11.434 + G_CALLBACK (on_disasm_list_select_row),
11.435 + NULL);
11.436 + g_signal_connect ((gpointer) disasm_list, "unselect_row",
11.437 + G_CALLBACK (on_disasm_list_unselect_row),
11.438 + NULL);
11.439 + g_signal_connect ((gpointer) output_list, "select_row",
11.440 + G_CALLBACK (on_output_list_select_row),
11.441 + NULL);
11.442 +
11.443 + /* Store pointers to all widgets, for use by lookup_widget(). */
11.444 + GLADE_HOOKUP_OBJECT_NO_REF (debug_win, debug_win, "debug_win");
11.445 + GLADE_HOOKUP_OBJECT (debug_win, dock1, "dock1");
11.446 + GLADE_HOOKUP_OBJECT (debug_win, menubar1_uiinfo[0].widget, "file1");
11.447 + GLADE_HOOKUP_OBJECT (debug_win, file1_menu_uiinfo[0].widget, "new_file1");
11.448 + GLADE_HOOKUP_OBJECT (debug_win, file1_menu_uiinfo[1].widget, "open1");
11.449 + GLADE_HOOKUP_OBJECT (debug_win, file1_menu_uiinfo[2].widget, "save1");
11.450 + GLADE_HOOKUP_OBJECT (debug_win, file1_menu_uiinfo[3].widget, "save_as1");
11.451 + GLADE_HOOKUP_OBJECT (debug_win, file1_menu_uiinfo[4].widget, "separator1");
11.452 + GLADE_HOOKUP_OBJECT (debug_win, file1_menu_uiinfo[5].widget, "exit1");
11.453 + GLADE_HOOKUP_OBJECT (debug_win, menubar1_uiinfo[1].widget, "view1");
11.454 + GLADE_HOOKUP_OBJECT (debug_win, view1_menu_uiinfo[0].widget, "view_memory");
11.455 + GLADE_HOOKUP_OBJECT (debug_win, view1_menu_uiinfo[1].widget, "mem_mapped_regs1");
11.456 + GLADE_HOOKUP_OBJECT (debug_win, menubar1_uiinfo[2].widget, "settings1");
11.457 + GLADE_HOOKUP_OBJECT (debug_win, settings1_menu_uiinfo[0].widget, "preferences1");
11.458 + GLADE_HOOKUP_OBJECT (debug_win, menubar1_uiinfo[3].widget, "help1");
11.459 + GLADE_HOOKUP_OBJECT (debug_win, help1_menu_uiinfo[0].widget, "about1");
11.460 + GLADE_HOOKUP_OBJECT (debug_win, toolbar1, "toolbar1");
11.461 + GLADE_HOOKUP_OBJECT (debug_win, load_btn, "load_btn");
11.462 + GLADE_HOOKUP_OBJECT (debug_win, reset_btn, "reset_btn");
11.463 + GLADE_HOOKUP_OBJECT (debug_win, stop_btn, "stop_btn");
11.464 + GLADE_HOOKUP_OBJECT (debug_win, step_btn, "step_btn");
11.465 + GLADE_HOOKUP_OBJECT (debug_win, run_btn, "run_btn");
11.466 + GLADE_HOOKUP_OBJECT (debug_win, runto_btn, "runto_btn");
11.467 + GLADE_HOOKUP_OBJECT (debug_win, break_btn, "break_btn");
11.468 + GLADE_HOOKUP_OBJECT (debug_win, loadstate_button, "loadstate_button");
11.469 + GLADE_HOOKUP_OBJECT (debug_win, savestate_button, "savestate_button");
11.470 + GLADE_HOOKUP_OBJECT (debug_win, vpaned1, "vpaned1");
11.471 + GLADE_HOOKUP_OBJECT (debug_win, hpaned1, "hpaned1");
11.472 + GLADE_HOOKUP_OBJECT (debug_win, vbox2, "vbox2");
11.473 + GLADE_HOOKUP_OBJECT (debug_win, hbox1, "hbox1");
11.474 + GLADE_HOOKUP_OBJECT (debug_win, label21, "label21");
11.475 + GLADE_HOOKUP_OBJECT (debug_win, page_field, "page_field");
11.476 + GLADE_HOOKUP_OBJECT (debug_win, page_locked_btn, "page_locked_btn");
11.477 + GLADE_HOOKUP_OBJECT (debug_win, jump_pc_btn, "jump_pc_btn");
11.478 + GLADE_HOOKUP_OBJECT (debug_win, label22, "label22");
11.479 + GLADE_HOOKUP_OBJECT (debug_win, mode_box, "mode_box");
11.480 + GLADE_HOOKUP_OBJECT (debug_win, mode_field, "mode_field");
11.481 + GLADE_HOOKUP_OBJECT (debug_win, label23, "label23");
11.482 + GLADE_HOOKUP_OBJECT (debug_win, scrolledwindow7, "scrolledwindow7");
11.483 + GLADE_HOOKUP_OBJECT (debug_win, disasm_list, "disasm_list");
11.484 + GLADE_HOOKUP_OBJECT (debug_win, label24, "label24");
11.485 + GLADE_HOOKUP_OBJECT (debug_win, label27, "label27");
11.486 + GLADE_HOOKUP_OBJECT (debug_win, label28, "label28");
11.487 + GLADE_HOOKUP_OBJECT (debug_win, label29, "label29");
11.488 + GLADE_HOOKUP_OBJECT (debug_win, scrolledwindow4, "scrolledwindow4");
11.489 + GLADE_HOOKUP_OBJECT (debug_win, reg_list, "reg_list");
11.490 + GLADE_HOOKUP_OBJECT (debug_win, label25, "label25");
11.491 + GLADE_HOOKUP_OBJECT (debug_win, label30, "label30");
11.492 + GLADE_HOOKUP_OBJECT (debug_win, scrolledwindow8, "scrolledwindow8");
11.493 + GLADE_HOOKUP_OBJECT (debug_win, output_list, "output_list");
11.494 + GLADE_HOOKUP_OBJECT (debug_win, label26, "label26");
11.495 + GLADE_HOOKUP_OBJECT (debug_win, label31, "label31");
11.496 + GLADE_HOOKUP_OBJECT (debug_win, label32, "label32");
11.497 + GLADE_HOOKUP_OBJECT (debug_win, debug_appbar, "debug_appbar");
11.498 + GLADE_HOOKUP_OBJECT_NO_REF (debug_win, tooltips, "tooltips");
11.499 +
11.500 + return debug_win;
11.501 +}
11.502 +
11.503 +GtkWidget*
11.504 +create_mmr_win (void)
11.505 +{
11.506 + GtkWidget *mmr_win;
11.507 + GtkWidget *vbox1;
11.508 + GtkWidget *mmr_notebook;
11.509 + GtkWidget *empty_notebook_page;
11.510 + GtkWidget *label16;
11.511 + GtkWidget *hbuttonbox1;
11.512 + GtkWidget *mmr_close;
11.513 +
11.514 + mmr_win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
11.515 + gtk_window_set_title (GTK_WINDOW (mmr_win), _("lxDream! - Memory-Mapped Registers"));
11.516 + gtk_window_set_default_size (GTK_WINDOW (mmr_win), 600, 600);
11.517 +
11.518 + vbox1 = gtk_vbox_new (FALSE, 0);
11.519 + gtk_widget_show (vbox1);
11.520 + gtk_container_add (GTK_CONTAINER (mmr_win), vbox1);
11.521 +
11.522 + mmr_notebook = gtk_notebook_new ();
11.523 + gtk_widget_show (mmr_notebook);
11.524 + gtk_box_pack_start (GTK_BOX (vbox1), mmr_notebook, TRUE, TRUE, 0);
11.525 + gtk_notebook_set_tab_pos (GTK_NOTEBOOK (mmr_notebook), GTK_POS_LEFT);
11.526 +
11.527 + empty_notebook_page = gtk_vbox_new (FALSE, 0);
11.528 + gtk_widget_show (empty_notebook_page);
11.529 + gtk_container_add (GTK_CONTAINER (mmr_notebook), empty_notebook_page);
11.530 +
11.531 + label16 = gtk_label_new (_("label16"));
11.532 + gtk_widget_show (label16);
11.533 + gtk_notebook_set_tab_label (GTK_NOTEBOOK (mmr_notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (mmr_notebook), 0), label16);
11.534 + gtk_label_set_justify (GTK_LABEL (label16), GTK_JUSTIFY_CENTER);
11.535 +
11.536 + hbuttonbox1 = gtk_hbutton_box_new ();
11.537 + gtk_widget_show (hbuttonbox1);
11.538 + gtk_box_pack_start (GTK_BOX (vbox1), hbuttonbox1, FALSE, TRUE, 0);
11.539 + gtk_box_set_spacing (GTK_BOX (hbuttonbox1), 30);
11.540 +
11.541 + mmr_close = gtk_button_new_with_mnemonic (_("Close"));
11.542 + gtk_widget_show (mmr_close);
11.543 + gtk_container_add (GTK_CONTAINER (hbuttonbox1), mmr_close);
11.544 + GTK_WIDGET_SET_FLAGS (mmr_close, GTK_CAN_DEFAULT);
11.545 +
11.546 + g_signal_connect ((gpointer) mmr_win, "delete_event",
11.547 + G_CALLBACK (on_mmr_win_delete_event),
11.548 + NULL);
11.549 + g_signal_connect ((gpointer) mmr_close, "clicked",
11.550 + G_CALLBACK (on_mmr_close_clicked),
11.551 + NULL);
11.552 +
11.553 + /* Store pointers to all widgets, for use by lookup_widget(). */
11.554 + GLADE_HOOKUP_OBJECT_NO_REF (mmr_win, mmr_win, "mmr_win");
11.555 + GLADE_HOOKUP_OBJECT (mmr_win, vbox1, "vbox1");
11.556 + GLADE_HOOKUP_OBJECT (mmr_win, mmr_notebook, "mmr_notebook");
11.557 + GLADE_HOOKUP_OBJECT (mmr_win, label16, "label16");
11.558 + GLADE_HOOKUP_OBJECT (mmr_win, hbuttonbox1, "hbuttonbox1");
11.559 + GLADE_HOOKUP_OBJECT (mmr_win, mmr_close, "mmr_close");
11.560 +
11.561 + return mmr_win;
11.562 +}
11.563 +
11.564 +GtkWidget*
11.565 +create_about_win (void)
11.566 +{
11.567 + const gchar *authors[] = {
11.568 + "Nathan Keynes",
11.569 + NULL
11.570 + };
11.571 + const gchar *documenters[] = { NULL };
11.572 + /* TRANSLATORS: Replace this string with your names, one name per line. */
11.573 + gchar *translators = _("translator_credits");
11.574 + GdkPixbuf *about_win_logo_pixbuf;
11.575 + GtkWidget *about_win;
11.576 +
11.577 + if (!strcmp (translators, "translator_credits"))
11.578 + translators = NULL;
11.579 + about_win_logo_pixbuf = create_pixbuf ("dream/dcemu.gif");
11.580 + about_win = gnome_about_new ("Dream", VERSION,
11.581 + _("Copyright(c) 2002 Nathan Keynes"),
11.582 + "",
11.583 + authors,
11.584 + documenters,
11.585 + translators,
11.586 + about_win_logo_pixbuf);
11.587 + gtk_container_set_border_width (GTK_CONTAINER (about_win), 1);
11.588 + gtk_window_set_type_hint (GTK_WINDOW (about_win), GDK_WINDOW_TYPE_HINT_DIALOG);
11.589 +
11.590 + /* Store pointers to all widgets, for use by lookup_widget(). */
11.591 + GLADE_HOOKUP_OBJECT_NO_REF (about_win, about_win, "about_win");
11.592 +
11.593 + return about_win;
11.594 +}
11.595 +
11.596 +GtkWidget*
11.597 +create_dump_win (void)
11.598 +{
11.599 + GtkWidget *dump_win;
11.600 + GtkWidget *vbox3;
11.601 + GtkWidget *hbox2;
11.602 + GtkWidget *label34;
11.603 + GtkWidget *dump_from;
11.604 + GtkWidget *label35;
11.605 + GtkWidget *dump_to;
11.606 + GtkWidget *dump_view_button;
11.607 + GtkWidget *label36;
11.608 + GtkWidget *scrolledwindow9;
11.609 + GtkWidget *dump_text;
11.610 +
11.611 + dump_win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
11.612 + gtk_window_set_title (GTK_WINDOW (dump_win), _("Memory dump"));
11.613 +
11.614 + vbox3 = gtk_vbox_new (FALSE, 0);
11.615 + gtk_widget_show (vbox3);
11.616 + gtk_container_add (GTK_CONTAINER (dump_win), vbox3);
11.617 +
11.618 + hbox2 = gtk_hbox_new (FALSE, 0);
11.619 + gtk_widget_show (hbox2);
11.620 + gtk_box_pack_start (GTK_BOX (vbox3), hbox2, FALSE, TRUE, 3);
11.621 +
11.622 + label34 = gtk_label_new (_(" From "));
11.623 + gtk_widget_show (label34);
11.624 + gtk_box_pack_start (GTK_BOX (hbox2), label34, FALSE, FALSE, 0);
11.625 +
11.626 + dump_from = gtk_entry_new ();
11.627 + gtk_widget_show (dump_from);
11.628 + gtk_box_pack_start (GTK_BOX (hbox2), dump_from, FALSE, TRUE, 0);
11.629 +
11.630 + label35 = gtk_label_new (_(" To "));
11.631 + gtk_widget_show (label35);
11.632 + gtk_box_pack_start (GTK_BOX (hbox2), label35, FALSE, FALSE, 0);
11.633 +
11.634 + dump_to = gtk_entry_new ();
11.635 + gtk_widget_show (dump_to);
11.636 + gtk_box_pack_start (GTK_BOX (hbox2), dump_to, FALSE, TRUE, 0);
11.637 +
11.638 + dump_view_button = gtk_button_new_with_mnemonic (_("View"));
11.639 + gtk_widget_show (dump_view_button);
11.640 + gtk_box_pack_start (GTK_BOX (hbox2), dump_view_button, FALSE, FALSE, 0);
11.641 +
11.642 + label36 = gtk_label_new (_(" "));
11.643 + gtk_widget_show (label36);
11.644 + gtk_box_pack_start (GTK_BOX (hbox2), label36, TRUE, TRUE, 0);
11.645 +
11.646 + scrolledwindow9 = gtk_scrolled_window_new (NULL, NULL);
11.647 + gtk_widget_show (scrolledwindow9);
11.648 + gtk_box_pack_start (GTK_BOX (vbox3), scrolledwindow9, TRUE, TRUE, 0);
11.649 + gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow9), GTK_SHADOW_IN);
11.650 +
11.651 + dump_text = gtk_text_view_new ();
11.652 + gtk_widget_show (dump_text);
11.653 + gtk_container_add (GTK_CONTAINER (scrolledwindow9), dump_text);
11.654 +
11.655 + /* Store pointers to all widgets, for use by lookup_widget(). */
11.656 + GLADE_HOOKUP_OBJECT_NO_REF (dump_win, dump_win, "dump_win");
11.657 + GLADE_HOOKUP_OBJECT (dump_win, vbox3, "vbox3");
11.658 + GLADE_HOOKUP_OBJECT (dump_win, hbox2, "hbox2");
11.659 + GLADE_HOOKUP_OBJECT (dump_win, label34, "label34");
11.660 + GLADE_HOOKUP_OBJECT (dump_win, dump_from, "dump_from");
11.661 + GLADE_HOOKUP_OBJECT (dump_win, label35, "label35");
11.662 + GLADE_HOOKUP_OBJECT (dump_win, dump_to, "dump_to");
11.663 + GLADE_HOOKUP_OBJECT (dump_win, dump_view_button, "dump_view_button");
11.664 + GLADE_HOOKUP_OBJECT (dump_win, label36, "label36");
11.665 + GLADE_HOOKUP_OBJECT (dump_win, scrolledwindow9, "scrolledwindow9");
11.666 + GLADE_HOOKUP_OBJECT (dump_win, dump_text, "dump_text");
11.667 +
11.668 + return dump_win;
11.669 +}
11.670 +
11.671 +GtkWidget*
11.672 +create_watch_win (void)
11.673 +{
11.674 + GtkWidget *watch_win;
11.675 + GtkWidget *vbox4;
11.676 + GtkWidget *hbox4;
11.677 + GtkWidget *label37;
11.678 + GtkWidget *watch_start_addr;
11.679 + GtkWidget *label38;
11.680 + GtkWidget *watch_end_addr;
11.681 + GtkWidget *label39;
11.682 + GtkWidget *combo1;
11.683 + GtkWidget *watch_type;
11.684 + GtkWidget *button_add_watch;
11.685 + GtkWidget *scrolledwindow10;
11.686 + GtkWidget *treeview1;
11.687 + GtkWidget *hbox5;
11.688 + GtkWidget *label40;
11.689 + GtkWidget *button_clear_all;
11.690 + GtkWidget *button_close;
11.691 +
11.692 + watch_win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
11.693 + gtk_window_set_title (GTK_WINDOW (watch_win), _("Watchpoints"));
11.694 +
11.695 + vbox4 = gtk_vbox_new (FALSE, 0);
11.696 + gtk_widget_show (vbox4);
11.697 + gtk_container_add (GTK_CONTAINER (watch_win), vbox4);
11.698 +
11.699 + hbox4 = gtk_hbox_new (FALSE, 0);
11.700 + gtk_widget_show (hbox4);
11.701 + gtk_box_pack_start (GTK_BOX (vbox4), hbox4, FALSE, TRUE, 3);
11.702 +
11.703 + label37 = gtk_label_new (_("Start addr "));
11.704 + gtk_widget_show (label37);
11.705 + gtk_box_pack_start (GTK_BOX (hbox4), label37, FALSE, FALSE, 3);
11.706 +
11.707 + watch_start_addr = gtk_entry_new ();
11.708 + gtk_widget_show (watch_start_addr);
11.709 + gtk_box_pack_start (GTK_BOX (hbox4), watch_start_addr, FALSE, TRUE, 0);
11.710 +
11.711 + label38 = gtk_label_new (_("End addr"));
11.712 + gtk_widget_show (label38);
11.713 + gtk_box_pack_start (GTK_BOX (hbox4), label38, FALSE, FALSE, 3);
11.714 +
11.715 + watch_end_addr = gtk_entry_new ();
11.716 + gtk_widget_show (watch_end_addr);
11.717 + gtk_box_pack_start (GTK_BOX (hbox4), watch_end_addr, FALSE, TRUE, 0);
11.718 +
11.719 + label39 = gtk_label_new (_("Type"));
11.720 + gtk_widget_show (label39);
11.721 + gtk_box_pack_start (GTK_BOX (hbox4), label39, FALSE, FALSE, 3);
11.722 +
11.723 + combo1 = gtk_combo_new ();
11.724 + g_object_set_data (G_OBJECT (GTK_COMBO (combo1)->popwin),
11.725 + "GladeParentKey", combo1);
11.726 + gtk_widget_show (combo1);
11.727 + gtk_box_pack_start (GTK_BOX (hbox4), combo1, TRUE, TRUE, 0);
11.728 +
11.729 + watch_type = GTK_COMBO (combo1)->entry;
11.730 + gtk_widget_show (watch_type);
11.731 +
11.732 + button_add_watch = gtk_button_new_with_mnemonic (_("Add Watch"));
11.733 + gtk_widget_show (button_add_watch);
11.734 + gtk_box_pack_start (GTK_BOX (hbox4), button_add_watch, FALSE, FALSE, 3);
11.735 +
11.736 + scrolledwindow10 = gtk_scrolled_window_new (NULL, NULL);
11.737 + gtk_widget_show (scrolledwindow10);
11.738 + gtk_box_pack_start (GTK_BOX (vbox4), scrolledwindow10, TRUE, TRUE, 0);
11.739 +
11.740 + treeview1 = gtk_tree_view_new ();
11.741 + gtk_widget_show (treeview1);
11.742 + gtk_container_add (GTK_CONTAINER (scrolledwindow10), treeview1);
11.743 + gtk_tree_view_set_enable_search (GTK_TREE_VIEW (treeview1), FALSE);
11.744 +
11.745 + hbox5 = gtk_hbox_new (FALSE, 0);
11.746 + gtk_widget_show (hbox5);
11.747 + gtk_box_pack_start (GTK_BOX (vbox4), hbox5, FALSE, TRUE, 3);
11.748 +
11.749 + label40 = gtk_label_new ("");
11.750 + gtk_widget_show (label40);
11.751 + gtk_box_pack_start (GTK_BOX (hbox5), label40, TRUE, TRUE, 0);
11.752 +
11.753 + button_clear_all = gtk_button_new_with_mnemonic (_("Clear all"));
11.754 + gtk_widget_show (button_clear_all);
11.755 + gtk_box_pack_start (GTK_BOX (hbox5), button_clear_all, FALSE, FALSE, 3);
11.756 +
11.757 + button_close = gtk_button_new_with_mnemonic (_("Close"));
11.758 + gtk_widget_show (button_close);
11.759 + gtk_box_pack_start (GTK_BOX (hbox5), button_close, FALSE, FALSE, 5);
11.760 +
11.761 + g_signal_connect ((gpointer) button_add_watch, "clicked",
11.762 + G_CALLBACK (on_button_add_watch_clicked),
11.763 + NULL);
11.764 + g_signal_connect ((gpointer) button_clear_all, "clicked",
11.765 + G_CALLBACK (on_button_clear_all_clicked),
11.766 + NULL);
11.767 + g_signal_connect ((gpointer) button_close, "clicked",
11.768 + G_CALLBACK (on_button_close_clicked),
11.769 + NULL);
11.770 +
11.771 + /* Store pointers to all widgets, for use by lookup_widget(). */
11.772 + GLADE_HOOKUP_OBJECT_NO_REF (watch_win, watch_win, "watch_win");
11.773 + GLADE_HOOKUP_OBJECT (watch_win, vbox4, "vbox4");
11.774 + GLADE_HOOKUP_OBJECT (watch_win, hbox4, "hbox4");
11.775 + GLADE_HOOKUP_OBJECT (watch_win, label37, "label37");
11.776 + GLADE_HOOKUP_OBJECT (watch_win, watch_start_addr, "watch_start_addr");
11.777 + GLADE_HOOKUP_OBJECT (watch_win, label38, "label38");
11.778 + GLADE_HOOKUP_OBJECT (watch_win, watch_end_addr, "watch_end_addr");
11.779 + GLADE_HOOKUP_OBJECT (watch_win, label39, "label39");
11.780 + GLADE_HOOKUP_OBJECT (watch_win, combo1, "combo1");
11.781 + GLADE_HOOKUP_OBJECT (watch_win, watch_type, "watch_type");
11.782 + GLADE_HOOKUP_OBJECT (watch_win, button_add_watch, "button_add_watch");
11.783 + GLADE_HOOKUP_OBJECT (watch_win, scrolledwindow10, "scrolledwindow10");
11.784 + GLADE_HOOKUP_OBJECT (watch_win, treeview1, "treeview1");
11.785 + GLADE_HOOKUP_OBJECT (watch_win, hbox5, "hbox5");
11.786 + GLADE_HOOKUP_OBJECT (watch_win, label40, "label40");
11.787 + GLADE_HOOKUP_OBJECT (watch_win, button_clear_all, "button_clear_all");
11.788 + GLADE_HOOKUP_OBJECT (watch_win, button_close, "button_close");
11.789 +
11.790 + return watch_win;
11.791 +}
11.792 +
12.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
12.2 +++ b/src/gui/debugif.h Wed Oct 10 11:02:04 2007 +0000
12.3 @@ -0,0 +1,9 @@
12.4 +/*
12.5 + * DO NOT EDIT THIS FILE - it is generated by Glade.
12.6 + */
12.7 +
12.8 +GtkWidget* create_debug_win (void);
12.9 +GtkWidget* create_mmr_win (void);
12.10 +GtkWidget* create_about_win (void);
12.11 +GtkWidget* create_dump_win (void);
12.12 +GtkWidget* create_watch_win (void);
13.1 --- a/src/gui/dump_win.c Tue Oct 09 11:37:36 2007 +0000
13.2 +++ b/src/gui/dump_win.c Wed Oct 10 11:02:04 2007 +0000
13.3 @@ -1,5 +1,5 @@
13.4 /**
13.5 - * $Id: dump_win.c,v 1.3 2007-10-08 12:06:01 nkeynes Exp $
13.6 + * $Id: dump_win.c,v 1.4 2007-10-10 11:02:04 nkeynes Exp $
13.7 *
13.8 * Implements the memory dump window.
13.9 *
13.10 @@ -19,9 +19,9 @@
13.11 #include <gnome.h>
13.12 #include <ctype.h>
13.13 #include <assert.h>
13.14 -#include "gui.h"
13.15 -#include "interface.h"
13.16 #include "mem.h"
13.17 +#include "gui/gtkui.h"
13.18 +#include "gui/debugif.h"
13.19
13.20 #define MAX_DUMP_SIZE 4096
13.21
13.22 @@ -70,7 +70,7 @@
13.23 NULL);
13.24 gtk_text_view_set_buffer(data->textArea, data->textBuffer);
13.25 gtk_text_view_set_editable(data->textArea, FALSE);
13.26 - gtk_widget_modify_font(GTK_WIDGET(data->textArea),fixed_list_font);
13.27 + gtk_widget_modify_font(GTK_WIDGET(data->textArea),gui_fixed_font);
13.28
13.29 g_signal_connect ((gpointer) win, "delete_event",
13.30 G_CALLBACK (on_dump_win_delete_event),
13.31 @@ -82,6 +82,28 @@
13.32 }
13.33
13.34
13.35 +
13.36 +uint32_t gtk_entry_get_hex_value( GtkEntry *entry, uint32_t defaultValue )
13.37 +{
13.38 + const gchar *text = gtk_entry_get_text(entry);
13.39 + if( text == NULL )
13.40 + return defaultValue;
13.41 + gchar *endptr;
13.42 + uint32_t value = strtoul( text, &endptr, 16 );
13.43 + if( text == endptr ) { /* invalid input */
13.44 + value = defaultValue;
13.45 + gtk_entry_set_hex_value( entry, value );
13.46 + }
13.47 + return value;
13.48 +}
13.49 +
13.50 +void gtk_entry_set_hex_value( GtkEntry *entry, uint32_t value )
13.51 +{
13.52 + char buf[10];
13.53 + sprintf( buf, "%08X", value );
13.54 + gtk_entry_set_text( entry, buf );
13.55 +}
13.56 +
13.57
13.58 gboolean on_dump_win_delete_event( GtkWidget *widget, GdkEvent *event,
13.59 gpointer user_data )
14.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
14.2 +++ b/src/gui/gtkcb.c Wed Oct 10 11:02:04 2007 +0000
14.3 @@ -0,0 +1,181 @@
14.4 +/**
14.5 + * $Id: gtkcb.c,v 1.1 2007-10-10 11:02:04 nkeynes Exp $
14.6 + *
14.7 + * Action callbacks from the main window
14.8 + *
14.9 + * Copyright (c) 2005 Nathan Keynes.
14.10 + *
14.11 + * This program is free software; you can redistribute it and/or modify
14.12 + * it under the terms of the GNU General Public License as published by
14.13 + * the Free Software Foundation; either version 2 of the License, or
14.14 + * (at your option) any later version.
14.15 + *
14.16 + * This program is distributed in the hope that it will be useful,
14.17 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
14.18 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14.19 + * GNU General Public License for more details.
14.20 + */
14.21 +
14.22 +#include "dream.h"
14.23 +#include "dreamcast.h"
14.24 +#include "gdrom/gdrom.h"
14.25 +#include "gui/gtkui.h"
14.26 +
14.27 +typedef gboolean (*file_callback_t)( const gchar *filename );
14.28 +
14.29 +static gboolean dreamcast_paused = FALSE;
14.30 +
14.31 +void dreamcast_pause()
14.32 +{
14.33 + if( dreamcast_is_running() ) {
14.34 + dreamcast_paused = TRUE;
14.35 + dreamcast_stop();
14.36 + }
14.37 +}
14.38 +
14.39 +void dreamcast_unpause()
14.40 +{
14.41 + if( dreamcast_paused ) {
14.42 + dreamcast_paused = FALSE;
14.43 + if( !dreamcast_is_running() ) {
14.44 + dreamcast_run();
14.45 + }
14.46 + }
14.47 +}
14.48 +
14.49 +
14.50 +void open_file_callback(GtkWidget *btn, gint result, gpointer user_data) {
14.51 + GtkFileChooser *file = GTK_FILE_CHOOSER(user_data);
14.52 + if( result == GTK_RESPONSE_ACCEPT ) {
14.53 + gchar *filename =gtk_file_chooser_get_filename(
14.54 + GTK_FILE_CHOOSER(file) );
14.55 + file_callback_t action = (file_callback_t)gtk_object_get_data( GTK_OBJECT(file), "file_action" );
14.56 + gtk_widget_destroy(GTK_WIDGET(file));
14.57 + action( filename );
14.58 + g_free(filename);
14.59 + } else {
14.60 + gtk_widget_destroy(GTK_WIDGET(file));
14.61 + }
14.62 + dreamcast_unpause();
14.63 +}
14.64 +
14.65 +static void add_file_pattern( GtkFileChooser *chooser, char *pattern, char *patname )
14.66 +{
14.67 + if( pattern != NULL ) {
14.68 + GtkFileFilter *filter = gtk_file_filter_new();
14.69 + gtk_file_filter_add_pattern( filter, pattern );
14.70 + gtk_file_filter_set_name( filter, patname );
14.71 + gtk_file_chooser_add_filter( chooser, filter );
14.72 + filter = gtk_file_filter_new();
14.73 + gtk_file_filter_set_name( filter, "All files" );
14.74 + gtk_file_filter_add_pattern( filter, "*" );
14.75 + gtk_file_chooser_add_filter( chooser, filter );
14.76 + }
14.77 +}
14.78 +
14.79 +void open_file_dialog( char *title, file_callback_t action, char *pattern, char *patname,
14.80 + gchar const *initial_dir )
14.81 +{
14.82 + GtkWidget *file;
14.83 + dreamcast_pause();
14.84 + file = gtk_file_chooser_dialog_new( title, NULL,
14.85 + GTK_FILE_CHOOSER_ACTION_OPEN,
14.86 + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
14.87 + GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
14.88 + NULL );
14.89 + add_file_pattern( GTK_FILE_CHOOSER(file), pattern, patname );
14.90 + g_signal_connect( GTK_OBJECT(file), "response",
14.91 + GTK_SIGNAL_FUNC(open_file_callback), file );
14.92 + gtk_object_set_data( GTK_OBJECT(file), "file_action", action );
14.93 + gtk_file_chooser_set_current_folder( GTK_FILE_CHOOSER(file), initial_dir );
14.94 + gtk_window_set_modal( GTK_WINDOW(file), TRUE );
14.95 + gtk_widget_show( file );
14.96 +}
14.97 +
14.98 +void save_file_dialog( char *title, file_callback_t action, char *pattern, char *patname,
14.99 + gchar const *initial_dir )
14.100 +{
14.101 + GtkWidget *file;
14.102 + dreamcast_pause();
14.103 + file = gtk_file_chooser_dialog_new( title, NULL,
14.104 + GTK_FILE_CHOOSER_ACTION_SAVE,
14.105 + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
14.106 + GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
14.107 + NULL );
14.108 + add_file_pattern( GTK_FILE_CHOOSER(file), pattern, patname );
14.109 + g_signal_connect( GTK_OBJECT(file), "response",
14.110 + GTK_SIGNAL_FUNC(open_file_callback), file );
14.111 + gtk_object_set_data( GTK_OBJECT(file), "file_action", action );
14.112 + gtk_file_chooser_set_current_folder( GTK_FILE_CHOOSER(file), initial_dir );
14.113 + gtk_window_set_modal( GTK_WINDOW(file), TRUE );
14.114 + gtk_widget_show( file );
14.115 +}
14.116 +
14.117 +void mount_action_callback( GtkAction *action, gpointer user_data)
14.118 +{
14.119 + const gchar *dir = dreamcast_get_config_value(CONFIG_DEFAULT_PATH);
14.120 + open_file_dialog( "Open...", gdrom_mount_image, NULL, NULL, dir );
14.121 +}
14.122 +void reset_action_callback( GtkAction *action, gpointer user_data)
14.123 +{
14.124 + dreamcast_reset();
14.125 +}
14.126 +
14.127 +void pause_action_callback( GtkAction *action, gpointer user_data)
14.128 +{
14.129 + dreamcast_stop();
14.130 +}
14.131 +
14.132 +void resume_action_callback( GtkAction *action, gpointer user_data)
14.133 +{
14.134 + dreamcast_run();
14.135 +}
14.136 +
14.137 +void load_state_action_callback( GtkAction *action, gpointer user_data)
14.138 +{
14.139 + const gchar *dir = dreamcast_get_config_value(CONFIG_SAVE_PATH);
14.140 + open_file_dialog( "Load state...", dreamcast_load_state, "*.dst", "lxDream Save State (*.dst)", dir );
14.141 +}
14.142 +void save_state_action_callback( GtkAction *action, gpointer user_data)
14.143 +{
14.144 + const gchar *dir = dreamcast_get_config_value(CONFIG_SAVE_PATH);
14.145 + save_file_dialog( "Save state...", dreamcast_save_state, "*.dst", "lxDream Save State (*.dst)", dir );
14.146 +}
14.147 +void about_action_callback( GtkAction *action, gpointer user_data)
14.148 +{
14.149 +
14.150 + GtkWidget *dialog = g_object_new (GTK_TYPE_ABOUT_DIALOG,
14.151 + "name", APP_NAME,
14.152 + "version", APP_VERSION,
14.153 + "copyright", "(C) 2003-2007 Nathan Keynes",
14.154 + NULL);
14.155 + gtk_window_set_modal(GTK_WINDOW(dialog), TRUE);
14.156 + gtk_widget_show(dialog);
14.157 +
14.158 +}
14.159 +
14.160 +void exit_action_callback( GtkAction *action, gpointer user_data)
14.161 +{
14.162 + exit(0);
14.163 +}
14.164 +
14.165 +
14.166 +void audio_settings_callback( GtkAction *action, gpointer user_data)
14.167 +{
14.168 +}
14.169 +
14.170 +void controller_settings_callback( GtkAction *action, gpointer user_data)
14.171 +{
14.172 +}
14.173 +
14.174 +void network_settings_callback( GtkAction *action, gpointer user_data)
14.175 +{
14.176 +}
14.177 +
14.178 +void video_settings_callback( GtkAction *action, gpointer user_data)
14.179 +{
14.180 +}
14.181 +
14.182 +void fullscreen_toggle_callback( GtkToggleAction *action, gpointer user_data)
14.183 +{
14.184 +}
15.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
15.2 +++ b/src/gui/gtkui.c Wed Oct 10 11:02:04 2007 +0000
15.3 @@ -0,0 +1,181 @@
15.4 +/**
15.5 + * $Id: gtkui.c,v 1.1 2007-10-10 11:02:04 nkeynes Exp $
15.6 + *
15.7 + * Core GTK-based user interface
15.8 + *
15.9 + * Copyright (c) 2005 Nathan Keynes.
15.10 + *
15.11 + * This program is free software; you can redistribute it and/or modify
15.12 + * it under the terms of the GNU General Public License as published by
15.13 + * the Free Software Foundation; either version 2 of the License, or
15.14 + * (at your option) any later version.
15.15 + *
15.16 + * This program is distributed in the hope that it will be useful,
15.17 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
15.18 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15.19 + * GNU General Public License for more details.
15.20 + */
15.21 +
15.22 +#include "dream.h"
15.23 +#include "dreamcast.h"
15.24 +#include "gui/gtkui.h"
15.25 +
15.26 +
15.27 +void gtk_gui_update( void );
15.28 +void gtk_gui_start( void );
15.29 +void gtk_gui_stop( void );
15.30 +void gtk_gui_alloc_resources ( void );
15.31 +uint32_t gtk_gui_run_slice( uint32_t nanosecs );
15.32 +
15.33 +struct dreamcast_module gtk_gui_module = { "gui", NULL,
15.34 + gtk_gui_update,
15.35 + gtk_gui_start,
15.36 + gtk_gui_run_slice,
15.37 + gtk_gui_stop,
15.38 + NULL, NULL };
15.39 +
15.40 +/**
15.41 + * Single-instance windows (at most one)
15.42 + */
15.43 +static main_window_t main_win = NULL;
15.44 +static debug_window_t debug_win = NULL;
15.45 +static mmio_window_t mmio_win = NULL;
15.46 +
15.47 +/**
15.48 + * Count of running nanoseconds - used to cut back on the GUI runtime
15.49 + */
15.50 +static uint32_t gtk_gui_nanos = 0;
15.51 +
15.52 +
15.53 +gboolean gui_parse_cmdline( int *argc, char **argv[] )
15.54 +{
15.55 + return gtk_init_check( argc, argv );
15.56 +}
15.57 +
15.58 +gboolean gui_init( gboolean withDebug )
15.59 +{
15.60 + dreamcast_register_module( &gtk_gui_module );
15.61 + gtk_gui_alloc_resources();
15.62 + if( withDebug ) {
15.63 + debug_win = debug_window_new();
15.64 + }
15.65 + main_win = main_window_new( APP_NAME " " APP_VERSION );
15.66 + return TRUE;
15.67 +}
15.68 +
15.69 +void gui_main_loop(void)
15.70 +{
15.71 + gtk_main();
15.72 +}
15.73 +
15.74 +void gui_update_io_activity( io_activity_type io, gboolean active )
15.75 +{
15.76 +
15.77 +}
15.78 +
15.79 +void gtk_gui_show_debugger()
15.80 +{
15.81 + if( debug_win ) {
15.82 + debug_window_show(debug_win, TRUE);
15.83 + } else {
15.84 + debug_win = debug_window_new();
15.85 + }
15.86 +}
15.87 +
15.88 +GtkWidget *gtk_gui_get_renderarea()
15.89 +{
15.90 + return main_window_get_renderarea(main_win);
15.91 +}
15.92 +
15.93 +/**
15.94 + * Hook called when DC starts running. Just disables the run/step buttons
15.95 + * and enables the stop button.
15.96 + */
15.97 +void gtk_gui_start( void )
15.98 +{
15.99 + main_window_set_running( main_win, TRUE );
15.100 + if( debug_win != NULL ) {
15.101 + debug_window_set_running( debug_win, TRUE );
15.102 + }
15.103 +}
15.104 +
15.105 +/**
15.106 + * Hook called when DC stops running. Enables the run/step buttons
15.107 + * and disables the stop button.
15.108 + */
15.109 +void gtk_gui_stop( void )
15.110 +{
15.111 + main_window_set_running( main_win, FALSE );
15.112 + gtk_gui_update();
15.113 +}
15.114 +
15.115 +void gtk_gui_update( void )
15.116 +{
15.117 + if( debug_win ) {
15.118 + debug_window_set_running( debug_win, FALSE );
15.119 + debug_window_update(debug_win);
15.120 + }
15.121 + if( mmio_win ) {
15.122 + mmio_win_update(mmio_win);
15.123 + }
15.124 + dump_win_update_all();
15.125 +}
15.126 +
15.127 +/**
15.128 + * Module run-slice. Because UI processing is fairly expensive, only
15.129 + * run the processing about 10 times a second while we're emulating.
15.130 + */
15.131 +uint32_t gtk_gui_run_slice( uint32_t nanosecs )
15.132 +{
15.133 + gtk_gui_nanos += nanosecs;
15.134 + if( gtk_gui_nanos > 100000000 ) {
15.135 + gtk_gui_nanos = 0;
15.136 + while( gtk_events_pending() )
15.137 + gtk_main_iteration();
15.138 + // main_window_set_framerate( main_win, pvr2_get_frame_rate() );
15.139 + }
15.140 + return nanosecs;
15.141 +}
15.142 +
15.143 +
15.144 +PangoFontDescription *gui_fixed_font;
15.145 +GdkColor gui_colour_normal, gui_colour_changed, gui_colour_error;
15.146 +GdkColor gui_colour_warn, gui_colour_pc, gui_colour_debug;
15.147 +GdkColor gui_colour_trace, gui_colour_break, gui_colour_temp_break;
15.148 +GdkColor gui_colour_white;
15.149 +
15.150 +void gtk_gui_alloc_resources() {
15.151 + GdkColormap *map;
15.152 +
15.153 + gui_colour_normal.red = gui_colour_normal.green = gui_colour_normal.blue = 0;
15.154 + gui_colour_changed.red = gui_colour_changed.green = 64*256;
15.155 + gui_colour_changed.blue = 154*256;
15.156 + gui_colour_error.red = 65535;
15.157 + gui_colour_error.green = gui_colour_error.blue = 64*256;
15.158 + gui_colour_pc.red = 32*256;
15.159 + gui_colour_pc.green = 170*256;
15.160 + gui_colour_pc.blue = 52*256;
15.161 + gui_colour_warn = gui_colour_changed;
15.162 + gui_colour_trace.red = 156*256;
15.163 + gui_colour_trace.green = 78*256;
15.164 + gui_colour_trace.blue = 201*256;
15.165 + gui_colour_debug = gui_colour_pc;
15.166 + gui_colour_break.red = 65535;
15.167 + gui_colour_break.green = gui_colour_break.blue = 192*256;
15.168 + gui_colour_temp_break.red = gui_colour_temp_break.green = 128*256;
15.169 + gui_colour_temp_break.blue = 32*256;
15.170 + gui_colour_white.red = gui_colour_white.green = gui_colour_white.blue = 65535;
15.171 +
15.172 + map = gdk_colormap_new(gdk_visual_get_best(), TRUE);
15.173 + gdk_colormap_alloc_color(map, &gui_colour_normal, TRUE, TRUE);
15.174 + gdk_colormap_alloc_color(map, &gui_colour_changed, TRUE, TRUE);
15.175 + gdk_colormap_alloc_color(map, &gui_colour_error, TRUE, TRUE);
15.176 + gdk_colormap_alloc_color(map, &gui_colour_warn, TRUE, TRUE);
15.177 + gdk_colormap_alloc_color(map, &gui_colour_pc, TRUE, TRUE);
15.178 + gdk_colormap_alloc_color(map, &gui_colour_debug, TRUE, TRUE);
15.179 + gdk_colormap_alloc_color(map, &gui_colour_trace, TRUE, TRUE);
15.180 + gdk_colormap_alloc_color(map, &gui_colour_break, TRUE, TRUE);
15.181 + gdk_colormap_alloc_color(map, &gui_colour_temp_break, TRUE, TRUE);
15.182 + gdk_colormap_alloc_color(map, &gui_colour_white, TRUE, TRUE);
15.183 + gui_fixed_font = pango_font_description_from_string("Courier 10");
15.184 +}
16.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
16.2 +++ b/src/gui/gtkui.h Wed Oct 10 11:02:04 2007 +0000
16.3 @@ -0,0 +1,80 @@
16.4 +/**
16.5 + * $Id: gtkui.h,v 1.1 2007-10-10 11:02:04 nkeynes Exp $
16.6 + *
16.7 + * Core GTK-based user interface
16.8 + *
16.9 + * Copyright (c) 2005 Nathan Keynes.
16.10 + *
16.11 + * This program is free software; you can redistribute it and/or modify
16.12 + * it under the terms of the GNU General Public License as published by
16.13 + * the Free Software Foundation; either version 2 of the License, or
16.14 + * (at your option) any later version.
16.15 + *
16.16 + * This program is distributed in the hope that it will be useful,
16.17 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
16.18 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16.19 + * GNU General Public License for more details.
16.20 + */
16.21 +
16.22 +#ifndef __lxdream_gtkui_H
16.23 +#define __lxdream_gtkui_H
16.24 +
16.25 +#include <gtk/gtk.h>
16.26 +#include "gui.h"
16.27 +#include "cpu.h"
16.28 +
16.29 +/********************* Top-level windows *********************/
16.30 +
16.31 +typedef struct main_window_info *main_window_t;
16.32 +typedef struct debug_window_info *debug_window_t;
16.33 +typedef struct mmio_window_info *mmio_window_t;
16.34 +
16.35 +/**
16.36 + * Construct and show the main window, returning an
16.37 + * opaque pointer to the window.
16.38 + */
16.39 +main_window_t main_window_new( const gchar *title );
16.40 +
16.41 +GtkWidget *main_window_get_renderarea( main_window_t win );
16.42 +void main_window_set_running( main_window_t win, gboolean running );
16.43 +void main_window_set_framerate( main_window_t win, float rate );
16.44 +
16.45 +debug_window_t debug_window_new();
16.46 +
16.47 +void debug_window_show( debug_window_t win, gboolean show );
16.48 +void debug_window_set_running( debug_window_t win, gboolean running );
16.49 +void debug_window_update(debug_window_t win);
16.50 +
16.51 +mmio_window_t mmio_window_new();
16.52 +
16.53 +void mmio_window_show( mmio_window_t win, gboolean show );
16.54 +
16.55 +/******************** Video driver hooks *********************/
16.56 +
16.57 +GtkWidget *gtk_gui_get_renderarea();
16.58 +
16.59 +/******************* Callback declarations *******************/
16.60 +
16.61 +void mount_action_callback( GtkAction *action, gpointer user_data);
16.62 +void reset_action_callback( GtkAction *action, gpointer user_data);
16.63 +void pause_action_callback( GtkAction *action, gpointer user_data);
16.64 +void resume_action_callback( GtkAction *action, gpointer user_data);
16.65 +void load_state_action_callback( GtkAction *action, gpointer user_data);
16.66 +void save_state_action_callback( GtkAction *action, gpointer user_data);
16.67 +void about_action_callback( GtkAction *action, gpointer user_data);
16.68 +void exit_action_callback( GtkAction *action, gpointer user_data);
16.69 +
16.70 +void audio_settings_callback( GtkAction *action, gpointer user_data);
16.71 +void controller_settings_callback( GtkAction *action, gpointer user_data);
16.72 +void network_settings_callback( GtkAction *action, gpointer user_data);
16.73 +void video_settings_callback( GtkAction *action, gpointer user_data);
16.74 +void fullscreen_toggle_callback( GtkToggleAction *action, gpointer user_data);
16.75 +
16.76 +/*************** Constant colour/font values *****************/
16.77 +extern PangoFontDescription *gui_fixed_font;
16.78 +extern GdkColor gui_colour_normal, gui_colour_changed, gui_colour_error;
16.79 +extern GdkColor gui_colour_warn, gui_colour_pc, gui_colour_debug;
16.80 +extern GdkColor gui_colour_trace, gui_colour_break, gui_colour_temp_break;
16.81 +extern GdkColor gui_colour_white;
16.82 +
16.83 +#endif /* __lxdream_gtkui_H */
17.1 --- a/src/gui/gui.c Tue Oct 09 11:37:36 2007 +0000
17.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
17.3 @@ -1,223 +0,0 @@
17.4 -/**
17.5 - * $Id: gui.c,v 1.15 2007-10-08 11:48:56 nkeynes Exp $
17.6 - *
17.7 - * Top-level GUI (GTK2) module.
17.8 - *
17.9 - * Copyright (c) 2005 Nathan Keynes.
17.10 - *
17.11 - * This program is free software; you can redistribute it and/or modify
17.12 - * it under the terms of the GNU General Public License as published by
17.13 - * the Free Software Foundation; either version 2 of the License, or
17.14 - * (at your option) any later version.
17.15 - *
17.16 - * This program is distributed in the hope that it will be useful,
17.17 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
17.18 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17.19 - * GNU General Public License for more details.
17.20 - */
17.21 -
17.22 -#include <stdlib.h>
17.23 -#include <stdarg.h>
17.24 -#include <gnome.h>
17.25 -#include <math.h>
17.26 -#include "dream.h"
17.27 -#include "dreamcast.h"
17.28 -#include "mem.h"
17.29 -#include "sh4/sh4dasm.h"
17.30 -#include "aica/armdasm.h"
17.31 -#include "gui/gui.h"
17.32 -
17.33 -#define REGISTER_FONT "-*-fixed-medium-r-normal--12-*-*-*-*-*-iso8859-1"
17.34 -
17.35 -GdkColor clrNormal, clrChanged, clrError, clrWarn, clrPC, clrDebug, clrTrace;
17.36 -GdkColor clrBreak, clrTempBreak, clrWhite;
17.37 -PangoFontDescription *fixed_list_font;
17.38 -
17.39 -debug_info_t main_debug = NULL;
17.40 -
17.41 -void open_file_callback(GtkWidget *btn, gint result, gpointer user_data);
17.42 -
17.43 -void gtk_gui_init( void );
17.44 -void gtk_gui_update( void );
17.45 -void gtk_gui_start( void );
17.46 -void gtk_gui_stop( void );
17.47 -uint32_t gtk_gui_run_slice( uint32_t nanosecs );
17.48 -
17.49 -struct dreamcast_module gtk_gui_module = { "Debugger", gtk_gui_init,
17.50 - gtk_gui_update, gtk_gui_start,
17.51 - gtk_gui_run_slice,
17.52 - gtk_gui_stop,
17.53 - NULL, NULL };
17.54 -
17.55 -const cpu_desc_t cpu_descs[4] = { &sh4_cpu_desc, &arm_cpu_desc, &armt_cpu_desc, NULL };
17.56 -
17.57 -
17.58 -void gtk_gui_init() {
17.59 - GdkColormap *map;
17.60 -
17.61 - clrNormal.red = clrNormal.green = clrNormal.blue = 0;
17.62 - clrChanged.red = clrChanged.green = 64*256;
17.63 - clrChanged.blue = 154*256;
17.64 - clrError.red = 65535;
17.65 - clrError.green = clrError.blue = 64*256;
17.66 - clrPC.red = 32*256;
17.67 - clrPC.green = 170*256;
17.68 - clrPC.blue = 52*256;
17.69 - clrWarn = clrChanged;
17.70 - clrTrace.red = 156*256;
17.71 - clrTrace.green = 78*256;
17.72 - clrTrace.blue = 201*256;
17.73 - clrDebug = clrPC;
17.74 - clrBreak.red = 65535;
17.75 - clrBreak.green = clrBreak.blue = 192*256;
17.76 - clrTempBreak.red = clrTempBreak.green = 128*256;
17.77 - clrTempBreak.blue = 32*256;
17.78 - clrWhite.red = clrWhite.green = clrWhite.blue = 65535;
17.79 -
17.80 - map = gdk_colormap_new(gdk_visual_get_best(), TRUE);
17.81 - gdk_colormap_alloc_color(map, &clrNormal, TRUE, TRUE);
17.82 - gdk_colormap_alloc_color(map, &clrChanged, TRUE, TRUE);
17.83 - gdk_colormap_alloc_color(map, &clrError, TRUE, TRUE);
17.84 - gdk_colormap_alloc_color(map, &clrWarn, TRUE, TRUE);
17.85 - gdk_colormap_alloc_color(map, &clrPC, TRUE, TRUE);
17.86 - gdk_colormap_alloc_color(map, &clrDebug, TRUE, TRUE);
17.87 - gdk_colormap_alloc_color(map, &clrTrace, TRUE, TRUE);
17.88 - gdk_colormap_alloc_color(map, &clrBreak, TRUE, TRUE);
17.89 - gdk_colormap_alloc_color(map, &clrTempBreak, TRUE, TRUE);
17.90 - gdk_colormap_alloc_color(map, &clrWhite, TRUE, TRUE);
17.91 - fixed_list_font = pango_font_description_from_string("Courier 10");
17.92 -}
17.93 -
17.94 -void gtk_gui_show_debugger()
17.95 -{
17.96 - GtkWidget *debug_win = create_debug_win ();
17.97 - main_debug = init_debug_win(debug_win, cpu_descs);
17.98 - init_mmr_win();
17.99 -
17.100 - gtk_widget_show (debug_win);
17.101 -}
17.102 -
17.103 -/**
17.104 - * Hook called when DC starts running. Just disables the run/step buttons
17.105 - * and enables the stop button.
17.106 - */
17.107 -void gtk_gui_start( void )
17.108 -{
17.109 - debug_win_set_running( main_debug, TRUE );
17.110 -}
17.111 -
17.112 -/**
17.113 - * Hook called when DC stops running. Enables the run/step buttons
17.114 - * and disables the stop button.
17.115 - */
17.116 -void gtk_gui_stop( void )
17.117 -{
17.118 - debug_win_set_running( main_debug, FALSE );
17.119 - gtk_gui_update();
17.120 -}
17.121 -
17.122 -uint32_t gtk_gui_nanos = 0;
17.123 -
17.124 -uint32_t gtk_gui_run_slice( uint32_t nanosecs )
17.125 -{
17.126 - gtk_gui_nanos += nanosecs;
17.127 - if( gtk_gui_nanos > 10000000 ) { /* About 10/sec */
17.128 - gtk_gui_nanos = 0;
17.129 - while( gtk_events_pending() )
17.130 - gtk_main_iteration();
17.131 - update_icount(main_debug);
17.132 - }
17.133 - return nanosecs;
17.134 -}
17.135 -
17.136 -void gtk_gui_update(void) {
17.137 - if( main_debug != NULL ) {
17.138 - update_registers(main_debug);
17.139 - update_icount(main_debug);
17.140 - update_mmr_win();
17.141 - dump_win_update_all();
17.142 - }
17.143 -}
17.144 -
17.145 -void open_file_callback(GtkWidget *btn, gint result, gpointer user_data) {
17.146 - GtkFileChooser *file = GTK_FILE_CHOOSER(user_data);
17.147 - if( result == GTK_RESPONSE_ACCEPT ) {
17.148 - gchar *filename =gtk_file_chooser_get_filename(
17.149 - GTK_FILE_CHOOSER(file) );
17.150 - file_callback_t action = (file_callback_t)gtk_object_get_data( GTK_OBJECT(file), "file_action" );
17.151 - gtk_widget_destroy(GTK_WIDGET(file));
17.152 - action( filename );
17.153 - g_free(filename);
17.154 - } else {
17.155 - gtk_widget_destroy(GTK_WIDGET(file));
17.156 - }
17.157 -}
17.158 -
17.159 -static void add_file_pattern( GtkFileChooser *chooser, char *pattern, char *patname )
17.160 -{
17.161 - if( pattern != NULL ) {
17.162 - GtkFileFilter *filter = gtk_file_filter_new();
17.163 - gtk_file_filter_add_pattern( filter, pattern );
17.164 - gtk_file_filter_set_name( filter, patname );
17.165 - gtk_file_chooser_add_filter( chooser, filter );
17.166 - filter = gtk_file_filter_new();
17.167 - gtk_file_filter_set_name( filter, "All files" );
17.168 - gtk_file_filter_add_pattern( filter, "*" );
17.169 - gtk_file_chooser_add_filter( chooser, filter );
17.170 - }
17.171 -}
17.172 -
17.173 -void open_file_dialog( char *title, file_callback_t action, char *pattern, char *patname,
17.174 - gchar const *initial_dir )
17.175 -{
17.176 - GtkWidget *file;
17.177 - file = gtk_file_chooser_dialog_new( title, NULL,
17.178 - GTK_FILE_CHOOSER_ACTION_OPEN,
17.179 - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
17.180 - GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
17.181 - NULL );
17.182 - add_file_pattern( GTK_FILE_CHOOSER(file), pattern, patname );
17.183 - g_signal_connect( GTK_OBJECT(file), "response",
17.184 - GTK_SIGNAL_FUNC(open_file_callback), file );
17.185 - gtk_object_set_data( GTK_OBJECT(file), "file_action", action );
17.186 - gtk_file_chooser_set_current_folder( GTK_FILE_CHOOSER(file), initial_dir );
17.187 - gtk_widget_show( file );
17.188 -}
17.189 -
17.190 -void save_file_dialog( char *title, file_callback_t action, char *pattern, char *patname,
17.191 - gchar const *initial_dir )
17.192 -{
17.193 - GtkWidget *file;
17.194 - file = gtk_file_chooser_dialog_new( title, NULL,
17.195 - GTK_FILE_CHOOSER_ACTION_SAVE,
17.196 - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
17.197 - GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
17.198 - NULL );
17.199 - add_file_pattern( GTK_FILE_CHOOSER(file), pattern, patname );
17.200 - g_signal_connect( GTK_OBJECT(file), "response",
17.201 - GTK_SIGNAL_FUNC(open_file_callback), file );
17.202 - gtk_object_set_data( GTK_OBJECT(file), "file_action", action );
17.203 - gtk_file_chooser_set_current_folder( GTK_FILE_CHOOSER(file), initial_dir );
17.204 - gtk_widget_show( file );
17.205 -}
17.206 -
17.207 -uint32_t gtk_entry_get_hex_value( GtkEntry *entry, uint32_t defaultValue )
17.208 -{
17.209 - const gchar *text = gtk_entry_get_text(entry);
17.210 - if( text == NULL )
17.211 - return defaultValue;
17.212 - gchar *endptr;
17.213 - uint32_t value = strtoul( text, &endptr, 16 );
17.214 - if( text == endptr ) { /* invalid input */
17.215 - value = defaultValue;
17.216 - gtk_entry_set_hex_value( entry, value );
17.217 - }
17.218 - return value;
17.219 -}
17.220 -
17.221 -void gtk_entry_set_hex_value( GtkEntry *entry, uint32_t value )
17.222 -{
17.223 - char buf[10];
17.224 - sprintf( buf, "%08X", value );
17.225 - gtk_entry_set_text( entry, buf );
17.226 -}
18.1 --- a/src/gui/gui.h Tue Oct 09 11:37:36 2007 +0000
18.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
18.3 @@ -1,80 +0,0 @@
18.4 -/**
18.5 - * $Id: gui.h,v 1.17 2007-10-08 11:48:56 nkeynes Exp $
18.6 - *
18.7 - * General GUI definitions
18.8 - *
18.9 - * Copyright (c) 2005 Nathan Keynes.
18.10 - *
18.11 - * This program is free software; you can redistribute it and/or modify
18.12 - * it under the terms of the GNU General Public License as published by
18.13 - * the Free Software Foundation; either version 2 of the License, or
18.14 - * (at your option) any later version.
18.15 - *
18.16 - * This program is distributed in the hope that it will be useful,
18.17 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
18.18 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18.19 - * GNU General Public License for more details.
18.20 - */
18.21 -
18.22 -#ifndef dream_gui_H
18.23 -#define dream_gui_H 1
18.24 -
18.25 -#include <gnome.h>
18.26 -#include "dream.h"
18.27 -#include "cpu.h"
18.28 -#include "gui/interface.h"
18.29 -
18.30 -#ifdef __cplusplus
18.31 -extern "C" {
18.32 -#if 0
18.33 -}
18.34 -#endif
18.35 -#endif
18.36 -
18.37 -void gtk_gui_init(void);
18.38 -void gtk_gui_show_debugger(void);
18.39 -void gtk_gui_update(void);
18.40 -extern struct dreamcast_module gtk_gui_module;
18.41 -
18.42 -typedef struct debug_info_struct *debug_info_t;
18.43 -extern debug_info_t main_debug;
18.44 -
18.45 -typedef gboolean (*file_callback_t)( const gchar *filename );
18.46 -void open_file_dialog( char *title, file_callback_t file_handler, char *pattern, char *patname, const gchar *initial_dir );
18.47 -void save_file_dialog( char *title, file_callback_t file_handler, char *pattern, char *patname, const gchar *initial_dir );
18.48 -
18.49 -void update_mmr_win( void );
18.50 -void init_mmr_win( void );
18.51 -
18.52 -debug_info_t init_debug_win(GtkWidget *, const cpu_desc_t *cpu );
18.53 -debug_info_t get_debug_info(GtkWidget *widget);
18.54 -void update_registers( debug_info_t debug );
18.55 -void update_icount( debug_info_t debug );
18.56 -void dump_win_update_all();
18.57 -void set_disassembly_region( debug_info_t debug, unsigned int page );
18.58 -void set_disassembly_pc( debug_info_t debug, unsigned int pc, gboolean select );
18.59 -void set_disassembly_cpu( debug_info_t debug, const gchar *cpu_name );
18.60 -void jump_to_disassembly( debug_info_t debug, unsigned int addr, gboolean select );
18.61 -void jump_to_pc( debug_info_t debug, gboolean select );
18.62 -void debug_win_set_running( debug_info_t debug, gboolean isRunning );
18.63 -void debug_win_single_step( debug_info_t debug );
18.64 -void debug_win_toggle_breakpoint( debug_info_t debug, int row );
18.65 -void debug_win_set_oneshot_breakpoint( debug_info_t debug, int row );
18.66 -uint32_t row_to_address( debug_info_t debug, int row );
18.67 -int address_to_row( debug_info_t debug, uint32_t address );
18.68 -
18.69 -extern PangoFontDescription *fixed_list_font;
18.70 -extern GdkColor clrNormal, clrChanged, clrError, clrWarn,
18.71 - clrPC, clrDebug, clrTrace, clrBreak, clrTempBreak, clrWhite;
18.72 -
18.73 -void mmr_open_win( void );
18.74 -void mmr_close_win( void );
18.75 -uint32_t gtk_entry_get_hex_value( GtkEntry *entry, uint32_t defaultValue );
18.76 -void gtk_entry_set_hex_value( GtkEntry *entry, uint32_t value );
18.77 -
18.78 -void dump_window_new( void );
18.79 -
18.80 -#ifdef __cplusplus
18.81 -}
18.82 -#endif
18.83 -#endif
19.1 --- a/src/gui/interface.c Tue Oct 09 11:37:36 2007 +0000
19.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
19.3 @@ -1,789 +0,0 @@
19.4 -/*
19.5 - * DO NOT EDIT THIS FILE - it is generated by Glade.
19.6 - */
19.7 -
19.8 -#ifdef HAVE_CONFIG_H
19.9 -# include <config.h>
19.10 -#endif
19.11 -
19.12 -#include <sys/types.h>
19.13 -#include <sys/stat.h>
19.14 -#include <unistd.h>
19.15 -#include <string.h>
19.16 -#include <stdio.h>
19.17 -
19.18 -#include <bonobo.h>
19.19 -#include <gnome.h>
19.20 -
19.21 -#include "callbacks.h"
19.22 -#include "interface.h"
19.23 -#include "support.h"
19.24 -
19.25 -#define GLADE_HOOKUP_OBJECT(component,widget,name) \
19.26 - g_object_set_data_full (G_OBJECT (component), name, \
19.27 - gtk_widget_ref (widget), (GDestroyNotify) gtk_widget_unref)
19.28 -
19.29 -#define GLADE_HOOKUP_OBJECT_NO_REF(component,widget,name) \
19.30 - g_object_set_data (G_OBJECT (component), name, widget)
19.31 -
19.32 -static GnomeUIInfo file1_menu_uiinfo[] =
19.33 -{
19.34 - GNOMEUIINFO_MENU_NEW_ITEM (N_("_New"), NULL, on_new_file1_activate, NULL),
19.35 - GNOMEUIINFO_MENU_OPEN_ITEM (on_open1_activate, NULL),
19.36 - GNOMEUIINFO_MENU_SAVE_ITEM (on_save1_activate, NULL),
19.37 - GNOMEUIINFO_MENU_SAVE_AS_ITEM (on_save_as1_activate, NULL),
19.38 - {
19.39 - GNOME_APP_UI_ITEM, N_("Save next scene..."),
19.40 - NULL,
19.41 - (gpointer) on_save_next_scene_activate, NULL, NULL,
19.42 - GNOME_APP_PIXMAP_NONE, NULL,
19.43 - 0, (GdkModifierType) 0, NULL
19.44 - },
19.45 - GNOMEUIINFO_SEPARATOR,
19.46 - GNOMEUIINFO_MENU_EXIT_ITEM (on_exit1_activate, NULL),
19.47 - GNOMEUIINFO_END
19.48 -};
19.49 -
19.50 -static GnomeUIInfo view1_menu_uiinfo[] =
19.51 -{
19.52 - {
19.53 - GNOME_APP_UI_ITEM, N_("Memory..."),
19.54 - NULL,
19.55 - (gpointer) on_view_memory_activate, NULL, NULL,
19.56 - GNOME_APP_PIXMAP_NONE, NULL,
19.57 - 0, (GdkModifierType) 0, NULL
19.58 - },
19.59 - {
19.60 - GNOME_APP_UI_ITEM, N_("Mem mapped Regs..."),
19.61 - NULL,
19.62 - (gpointer) on_mem_mapped_regs1_activate, NULL, NULL,
19.63 - GNOME_APP_PIXMAP_NONE, NULL,
19.64 - 0, (GdkModifierType) 0, NULL
19.65 - },
19.66 - GNOMEUIINFO_END
19.67 -};
19.68 -
19.69 -static GnomeUIInfo settings1_menu_uiinfo[] =
19.70 -{
19.71 - GNOMEUIINFO_MENU_PREFERENCES_ITEM (on_preferences1_activate, NULL),
19.72 - GNOMEUIINFO_END
19.73 -};
19.74 -
19.75 -static GnomeUIInfo help1_menu_uiinfo[] =
19.76 -{
19.77 - GNOMEUIINFO_MENU_ABOUT_ITEM (on_about1_activate, NULL),
19.78 - GNOMEUIINFO_END
19.79 -};
19.80 -
19.81 -static GnomeUIInfo menubar1_uiinfo[] =
19.82 -{
19.83 - {
19.84 - GNOME_APP_UI_SUBTREE, N_("_File"),
19.85 - NULL,
19.86 - file1_menu_uiinfo, NULL, NULL,
19.87 - GNOME_APP_PIXMAP_NONE, NULL,
19.88 - 0, (GdkModifierType) 0, NULL
19.89 - },
19.90 - {
19.91 - GNOME_APP_UI_SUBTREE, N_("_View"),
19.92 - NULL,
19.93 - view1_menu_uiinfo, NULL, NULL,
19.94 - GNOME_APP_PIXMAP_NONE, NULL,
19.95 - 0, (GdkModifierType) 0, NULL
19.96 - },
19.97 - {
19.98 - GNOME_APP_UI_SUBTREE, N_("_Settings"),
19.99 - NULL,
19.100 - settings1_menu_uiinfo, NULL, NULL,
19.101 - GNOME_APP_PIXMAP_NONE, NULL,
19.102 - 0, (GdkModifierType) 0, NULL
19.103 - },
19.104 - {
19.105 - GNOME_APP_UI_SUBTREE, N_("_Help"),
19.106 - NULL,
19.107 - help1_menu_uiinfo, NULL, NULL,
19.108 - GNOME_APP_PIXMAP_NONE, NULL,
19.109 - 0, (GdkModifierType) 0, NULL
19.110 - },
19.111 - GNOMEUIINFO_END
19.112 -};
19.113 -
19.114 -GtkWidget*
19.115 -create_debug_win (void)
19.116 -{
19.117 - GtkWidget *debug_win;
19.118 - GtkWidget *dock1;
19.119 - GtkWidget *toolbar1;
19.120 - GtkIconSize tmp_toolbar_icon_size;
19.121 - GtkWidget *tmp_image;
19.122 - GtkWidget *load_btn;
19.123 - GtkWidget *reset_btn;
19.124 - GtkWidget *stop_btn;
19.125 - GtkWidget *step_btn;
19.126 - GtkWidget *run_btn;
19.127 - GtkWidget *runto_btn;
19.128 - GtkWidget *break_btn;
19.129 - GtkWidget *loadstate_button;
19.130 - GtkWidget *savestate_button;
19.131 - GtkWidget *vpaned1;
19.132 - GtkWidget *hpaned1;
19.133 - GtkWidget *vbox2;
19.134 - GtkWidget *hbox1;
19.135 - GtkWidget *label21;
19.136 - GtkWidget *page_field;
19.137 - GtkWidget *page_locked_btn;
19.138 - GtkWidget *jump_pc_btn;
19.139 - GtkWidget *label22;
19.140 - GtkWidget *mode_box;
19.141 - GList *mode_box_items = NULL;
19.142 - GtkWidget *mode_field;
19.143 - GtkWidget *label23;
19.144 - GtkWidget *scrolledwindow7;
19.145 - GtkWidget *disasm_list;
19.146 - GtkWidget *label24;
19.147 - GtkWidget *label27;
19.148 - GtkWidget *label28;
19.149 - GtkWidget *label29;
19.150 - GtkWidget *scrolledwindow4;
19.151 - GtkWidget *reg_list;
19.152 - GtkWidget *label25;
19.153 - GtkWidget *label30;
19.154 - GtkWidget *scrolledwindow8;
19.155 - GtkWidget *output_list;
19.156 - GtkWidget *label26;
19.157 - GtkWidget *label31;
19.158 - GtkWidget *label32;
19.159 - GtkWidget *debug_appbar;
19.160 - GtkTooltips *tooltips;
19.161 -
19.162 - tooltips = gtk_tooltips_new ();
19.163 -
19.164 - debug_win = gnome_app_new ("Dream", _("lxDream! Debugger"));
19.165 - gtk_window_set_default_size (GTK_WINDOW (debug_win), 1000, 700);
19.166 -
19.167 - dock1 = GNOME_APP (debug_win)->dock;
19.168 - gtk_widget_show (dock1);
19.169 -
19.170 - gnome_app_create_menus (GNOME_APP (debug_win), menubar1_uiinfo);
19.171 -
19.172 - toolbar1 = gtk_toolbar_new ();
19.173 - gtk_widget_show (toolbar1);
19.174 - gnome_app_add_toolbar (GNOME_APP (debug_win), GTK_TOOLBAR (toolbar1), "toolbar1",
19.175 - BONOBO_DOCK_ITEM_BEH_EXCLUSIVE,
19.176 - BONOBO_DOCK_TOP, 1, 0, 0);
19.177 - gtk_container_set_border_width (GTK_CONTAINER (toolbar1), 1);
19.178 - gtk_toolbar_set_style (GTK_TOOLBAR (toolbar1), GTK_TOOLBAR_BOTH);
19.179 - tmp_toolbar_icon_size = gtk_toolbar_get_icon_size (GTK_TOOLBAR (toolbar1));
19.180 -
19.181 - tmp_image = gtk_image_new_from_stock ("gtk-cdrom", tmp_toolbar_icon_size);
19.182 - gtk_widget_show (tmp_image);
19.183 - load_btn = (GtkWidget*) gtk_tool_button_new (tmp_image, _("Mount"));
19.184 - gtk_widget_show (load_btn);
19.185 - gtk_container_add (GTK_CONTAINER (toolbar1), load_btn);
19.186 - gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (load_btn), tooltips, _("Mount CD-Rom"), NULL);
19.187 -
19.188 - tmp_image = gtk_image_new_from_stock ("gtk-refresh", tmp_toolbar_icon_size);
19.189 - gtk_widget_show (tmp_image);
19.190 - reset_btn = (GtkWidget*) gtk_tool_button_new (tmp_image, _("Reset"));
19.191 - gtk_widget_show (reset_btn);
19.192 - gtk_container_add (GTK_CONTAINER (toolbar1), reset_btn);
19.193 - gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (reset_btn), tooltips, _("Reset emulator"), NULL);
19.194 -
19.195 - tmp_image = gtk_image_new_from_stock ("gtk-stop", tmp_toolbar_icon_size);
19.196 - gtk_widget_show (tmp_image);
19.197 - stop_btn = (GtkWidget*) gtk_tool_button_new (tmp_image, _("Stop"));
19.198 - gtk_widget_show (stop_btn);
19.199 - gtk_container_add (GTK_CONTAINER (toolbar1), stop_btn);
19.200 - gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (stop_btn), tooltips, _("Stop"), NULL);
19.201 -
19.202 - tmp_image = gtk_image_new_from_stock ("gtk-redo", tmp_toolbar_icon_size);
19.203 - gtk_widget_show (tmp_image);
19.204 - step_btn = (GtkWidget*) gtk_tool_button_new (tmp_image, _("Step"));
19.205 - gtk_widget_show (step_btn);
19.206 - gtk_container_add (GTK_CONTAINER (toolbar1), step_btn);
19.207 - gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (step_btn), tooltips, _("Single step"), NULL);
19.208 -
19.209 - tmp_image = gtk_image_new_from_stock ("gtk-go-forward", tmp_toolbar_icon_size);
19.210 - gtk_widget_show (tmp_image);
19.211 - run_btn = (GtkWidget*) gtk_tool_button_new (tmp_image, _("Run"));
19.212 - gtk_widget_show (run_btn);
19.213 - gtk_container_add (GTK_CONTAINER (toolbar1), run_btn);
19.214 - gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (run_btn), tooltips, _("Run"), NULL);
19.215 -
19.216 - tmp_image = gtk_image_new_from_stock ("gtk-goto-last", tmp_toolbar_icon_size);
19.217 - gtk_widget_show (tmp_image);
19.218 - runto_btn = (GtkWidget*) gtk_tool_button_new (tmp_image, _("Run to"));
19.219 - gtk_widget_show (runto_btn);
19.220 - gtk_container_add (GTK_CONTAINER (toolbar1), runto_btn);
19.221 - gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (runto_btn), tooltips, _("Run to current selection"), NULL);
19.222 -
19.223 - tmp_image = gtk_image_new_from_stock ("gtk-close", tmp_toolbar_icon_size);
19.224 - gtk_widget_show (tmp_image);
19.225 - break_btn = (GtkWidget*) gtk_tool_button_new (tmp_image, _("Break"));
19.226 - gtk_widget_show (break_btn);
19.227 - gtk_container_add (GTK_CONTAINER (toolbar1), break_btn);
19.228 - gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (break_btn), tooltips, _("Set breakpoint"), NULL);
19.229 -
19.230 - tmp_image = gtk_image_new_from_stock ("gtk-open", tmp_toolbar_icon_size);
19.231 - gtk_widget_show (tmp_image);
19.232 - loadstate_button = (GtkWidget*) gtk_tool_button_new (tmp_image, _("Load"));
19.233 - gtk_widget_show (loadstate_button);
19.234 - gtk_container_add (GTK_CONTAINER (toolbar1), loadstate_button);
19.235 - gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (loadstate_button), tooltips, _("Load save-state file"), NULL);
19.236 -
19.237 - tmp_image = gtk_image_new_from_stock ("gtk-save", tmp_toolbar_icon_size);
19.238 - gtk_widget_show (tmp_image);
19.239 - savestate_button = (GtkWidget*) gtk_tool_button_new (tmp_image, _("Save"));
19.240 - gtk_widget_show (savestate_button);
19.241 - gtk_container_add (GTK_CONTAINER (toolbar1), savestate_button);
19.242 - gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (savestate_button), tooltips, _("Save save-state file"), NULL);
19.243 -
19.244 - vpaned1 = gtk_vpaned_new ();
19.245 - gtk_widget_show (vpaned1);
19.246 - gnome_app_set_contents (GNOME_APP (debug_win), vpaned1);
19.247 - gtk_paned_set_position (GTK_PANED (vpaned1), 430);
19.248 -
19.249 - hpaned1 = gtk_hpaned_new ();
19.250 - gtk_widget_show (hpaned1);
19.251 - gtk_paned_pack1 (GTK_PANED (vpaned1), hpaned1, TRUE, TRUE);
19.252 - gtk_paned_set_position (GTK_PANED (hpaned1), 800);
19.253 -
19.254 - vbox2 = gtk_vbox_new (FALSE, 0);
19.255 - gtk_widget_show (vbox2);
19.256 - gtk_paned_pack1 (GTK_PANED (hpaned1), vbox2, FALSE, TRUE);
19.257 -
19.258 - hbox1 = gtk_hbox_new (FALSE, 0);
19.259 - gtk_widget_show (hbox1);
19.260 - gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, FALSE, 3);
19.261 -
19.262 - label21 = gtk_label_new (_("Page"));
19.263 - gtk_widget_show (label21);
19.264 - gtk_box_pack_start (GTK_BOX (hbox1), label21, FALSE, FALSE, 4);
19.265 - gtk_label_set_justify (GTK_LABEL (label21), GTK_JUSTIFY_CENTER);
19.266 -
19.267 - page_field = gtk_entry_new ();
19.268 - gtk_widget_show (page_field);
19.269 - gtk_box_pack_start (GTK_BOX (hbox1), page_field, FALSE, TRUE, 0);
19.270 -
19.271 - page_locked_btn = gtk_check_button_new_with_mnemonic (_("Locked"));
19.272 - gtk_widget_show (page_locked_btn);
19.273 - gtk_box_pack_start (GTK_BOX (hbox1), page_locked_btn, FALSE, FALSE, 5);
19.274 -
19.275 - jump_pc_btn = gtk_button_new_with_mnemonic (_(" Jump to PC "));
19.276 - gtk_widget_show (jump_pc_btn);
19.277 - gtk_box_pack_start (GTK_BOX (hbox1), jump_pc_btn, FALSE, FALSE, 4);
19.278 -
19.279 - label22 = gtk_label_new (_("Mode"));
19.280 - gtk_widget_show (label22);
19.281 - gtk_box_pack_start (GTK_BOX (hbox1), label22, FALSE, FALSE, 5);
19.282 - gtk_label_set_justify (GTK_LABEL (label22), GTK_JUSTIFY_RIGHT);
19.283 - gtk_misc_set_alignment (GTK_MISC (label22), 1, 0.5);
19.284 -
19.285 - mode_box = gtk_combo_new ();
19.286 - g_object_set_data (G_OBJECT (GTK_COMBO (mode_box)->popwin),
19.287 - "GladeParentKey", mode_box);
19.288 - gtk_widget_show (mode_box);
19.289 - gtk_box_pack_start (GTK_BOX (hbox1), mode_box, FALSE, FALSE, 0);
19.290 - mode_box_items = g_list_append (mode_box_items, (gpointer) _("SH4"));
19.291 - mode_box_items = g_list_append (mode_box_items, (gpointer) _("ARM7"));
19.292 - mode_box_items = g_list_append (mode_box_items, (gpointer) _("ARM7T"));
19.293 - gtk_combo_set_popdown_strings (GTK_COMBO (mode_box), mode_box_items);
19.294 - g_list_free (mode_box_items);
19.295 -
19.296 - mode_field = GTK_COMBO (mode_box)->entry;
19.297 - gtk_widget_show (mode_field);
19.298 - gtk_editable_set_editable (GTK_EDITABLE (mode_field), FALSE);
19.299 -
19.300 - label23 = gtk_label_new ("");
19.301 - gtk_widget_show (label23);
19.302 - gtk_box_pack_start (GTK_BOX (hbox1), label23, TRUE, TRUE, 4);
19.303 - gtk_label_set_justify (GTK_LABEL (label23), GTK_JUSTIFY_CENTER);
19.304 -
19.305 - scrolledwindow7 = gtk_scrolled_window_new (NULL, NULL);
19.306 - gtk_widget_show (scrolledwindow7);
19.307 - gtk_box_pack_start (GTK_BOX (vbox2), scrolledwindow7, TRUE, TRUE, 0);
19.308 - GTK_WIDGET_UNSET_FLAGS (scrolledwindow7, GTK_CAN_FOCUS);
19.309 - gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow7), GTK_SHADOW_IN);
19.310 -
19.311 - disasm_list = gtk_clist_new (4);
19.312 - gtk_widget_show (disasm_list);
19.313 - gtk_container_add (GTK_CONTAINER (scrolledwindow7), disasm_list);
19.314 - gtk_clist_set_column_width (GTK_CLIST (disasm_list), 0, 80);
19.315 - gtk_clist_set_column_width (GTK_CLIST (disasm_list), 1, 80);
19.316 - gtk_clist_set_column_width (GTK_CLIST (disasm_list), 2, 80);
19.317 - gtk_clist_set_column_width (GTK_CLIST (disasm_list), 3, 80);
19.318 - gtk_clist_column_titles_hide (GTK_CLIST (disasm_list));
19.319 -
19.320 - label24 = gtk_label_new ("");
19.321 - gtk_widget_show (label24);
19.322 - gtk_clist_set_column_widget (GTK_CLIST (disasm_list), 0, label24);
19.323 -
19.324 - label27 = gtk_label_new ("");
19.325 - gtk_widget_show (label27);
19.326 - gtk_clist_set_column_widget (GTK_CLIST (disasm_list), 1, label27);
19.327 -
19.328 - label28 = gtk_label_new ("");
19.329 - gtk_widget_show (label28);
19.330 - gtk_clist_set_column_widget (GTK_CLIST (disasm_list), 2, label28);
19.331 -
19.332 - label29 = gtk_label_new ("");
19.333 - gtk_widget_show (label29);
19.334 - gtk_clist_set_column_widget (GTK_CLIST (disasm_list), 3, label29);
19.335 -
19.336 - scrolledwindow4 = gtk_scrolled_window_new (NULL, NULL);
19.337 - gtk_widget_show (scrolledwindow4);
19.338 - gtk_paned_pack2 (GTK_PANED (hpaned1), scrolledwindow4, FALSE, TRUE);
19.339 - GTK_WIDGET_UNSET_FLAGS (scrolledwindow4, GTK_CAN_FOCUS);
19.340 - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow4), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
19.341 - gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow4), GTK_SHADOW_IN);
19.342 -
19.343 - reg_list = gtk_clist_new (2);
19.344 - gtk_widget_show (reg_list);
19.345 - gtk_container_add (GTK_CONTAINER (scrolledwindow4), reg_list);
19.346 - gtk_clist_set_column_width (GTK_CLIST (reg_list), 0, 80);
19.347 - gtk_clist_set_column_width (GTK_CLIST (reg_list), 1, 80);
19.348 - gtk_clist_column_titles_hide (GTK_CLIST (reg_list));
19.349 -
19.350 - label25 = gtk_label_new ("");
19.351 - gtk_widget_show (label25);
19.352 - gtk_clist_set_column_widget (GTK_CLIST (reg_list), 0, label25);
19.353 -
19.354 - label30 = gtk_label_new ("");
19.355 - gtk_widget_show (label30);
19.356 - gtk_clist_set_column_widget (GTK_CLIST (reg_list), 1, label30);
19.357 -
19.358 - scrolledwindow8 = gtk_scrolled_window_new (NULL, NULL);
19.359 - gtk_widget_show (scrolledwindow8);
19.360 - gtk_paned_pack2 (GTK_PANED (vpaned1), scrolledwindow8, FALSE, TRUE);
19.361 - GTK_WIDGET_UNSET_FLAGS (scrolledwindow8, GTK_CAN_FOCUS);
19.362 - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow8), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);
19.363 - gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow8), GTK_SHADOW_IN);
19.364 -
19.365 - output_list = gtk_clist_new (4);
19.366 - gtk_widget_show (output_list);
19.367 - gtk_container_add (GTK_CONTAINER (scrolledwindow8), output_list);
19.368 - gtk_clist_set_column_width (GTK_CLIST (output_list), 0, 80);
19.369 - gtk_clist_set_column_width (GTK_CLIST (output_list), 1, 80);
19.370 - gtk_clist_set_column_width (GTK_CLIST (output_list), 2, 80);
19.371 - gtk_clist_set_column_width (GTK_CLIST (output_list), 3, 80);
19.372 - gtk_clist_column_titles_hide (GTK_CLIST (output_list));
19.373 -
19.374 - label26 = gtk_label_new ("");
19.375 - gtk_widget_show (label26);
19.376 - gtk_clist_set_column_widget (GTK_CLIST (output_list), 0, label26);
19.377 -
19.378 - label31 = gtk_label_new ("");
19.379 - gtk_widget_show (label31);
19.380 - gtk_clist_set_column_widget (GTK_CLIST (output_list), 1, label31);
19.381 -
19.382 - label32 = gtk_label_new ("");
19.383 - gtk_widget_show (label32);
19.384 - gtk_clist_set_column_widget (GTK_CLIST (output_list), 2, label32);
19.385 -
19.386 - debug_appbar = gnome_appbar_new (TRUE, TRUE, GNOME_PREFERENCES_NEVER);
19.387 - gtk_widget_show (debug_appbar);
19.388 - gnome_app_set_statusbar (GNOME_APP (debug_win), debug_appbar);
19.389 -
19.390 - g_signal_connect ((gpointer) debug_win, "delete_event",
19.391 - G_CALLBACK (on_debug_win_delete_event),
19.392 - NULL);
19.393 - gnome_app_install_menu_hints (GNOME_APP (debug_win), menubar1_uiinfo);
19.394 - g_signal_connect ((gpointer) load_btn, "clicked",
19.395 - G_CALLBACK (on_load_btn_clicked),
19.396 - NULL);
19.397 - g_signal_connect ((gpointer) reset_btn, "clicked",
19.398 - G_CALLBACK (on_reset_btn_clicked),
19.399 - NULL);
19.400 - g_signal_connect ((gpointer) stop_btn, "clicked",
19.401 - G_CALLBACK (on_stop_btn_clicked),
19.402 - NULL);
19.403 - g_signal_connect ((gpointer) step_btn, "clicked",
19.404 - G_CALLBACK (on_step_btn_clicked),
19.405 - NULL);
19.406 - g_signal_connect ((gpointer) run_btn, "clicked",
19.407 - G_CALLBACK (on_run_btn_clicked),
19.408 - NULL);
19.409 - g_signal_connect ((gpointer) runto_btn, "clicked",
19.410 - G_CALLBACK (on_runto_btn_clicked),
19.411 - NULL);
19.412 - g_signal_connect ((gpointer) break_btn, "clicked",
19.413 - G_CALLBACK (on_break_btn_clicked),
19.414 - NULL);
19.415 - g_signal_connect ((gpointer) loadstate_button, "clicked",
19.416 - G_CALLBACK (on_loadstate_button_clicked),
19.417 - NULL);
19.418 - g_signal_connect ((gpointer) savestate_button, "clicked",
19.419 - G_CALLBACK (on_savestate_button_clicked),
19.420 - NULL);
19.421 - g_signal_connect ((gpointer) page_field, "key_press_event",
19.422 - G_CALLBACK (on_page_field_key_press_event),
19.423 - NULL);
19.424 - g_signal_connect ((gpointer) page_locked_btn, "toggled",
19.425 - G_CALLBACK (on_page_locked_btn_toggled),
19.426 - NULL);
19.427 - g_signal_connect ((gpointer) jump_pc_btn, "clicked",
19.428 - G_CALLBACK (on_jump_pc_btn_clicked),
19.429 - NULL);
19.430 - g_signal_connect ((gpointer) mode_field, "changed",
19.431 - G_CALLBACK (on_mode_field_changed),
19.432 - NULL);
19.433 - g_signal_connect ((gpointer) disasm_list, "select_row",
19.434 - G_CALLBACK (on_disasm_list_select_row),
19.435 - NULL);
19.436 - g_signal_connect ((gpointer) disasm_list, "unselect_row",
19.437 - G_CALLBACK (on_disasm_list_unselect_row),
19.438 - NULL);
19.439 - g_signal_connect ((gpointer) output_list, "select_row",
19.440 - G_CALLBACK (on_output_list_select_row),
19.441 - NULL);
19.442 -
19.443 - /* Store pointers to all widgets, for use by lookup_widget(). */
19.444 - GLADE_HOOKUP_OBJECT_NO_REF (debug_win, debug_win, "debug_win");
19.445 - GLADE_HOOKUP_OBJECT (debug_win, dock1, "dock1");
19.446 - GLADE_HOOKUP_OBJECT (debug_win, menubar1_uiinfo[0].widget, "file1");
19.447 - GLADE_HOOKUP_OBJECT (debug_win, file1_menu_uiinfo[0].widget, "new_file1");
19.448 - GLADE_HOOKUP_OBJECT (debug_win, file1_menu_uiinfo[1].widget, "open1");
19.449 - GLADE_HOOKUP_OBJECT (debug_win, file1_menu_uiinfo[2].widget, "save1");
19.450 - GLADE_HOOKUP_OBJECT (debug_win, file1_menu_uiinfo[3].widget, "save_as1");
19.451 - GLADE_HOOKUP_OBJECT (debug_win, file1_menu_uiinfo[4].widget, "separator1");
19.452 - GLADE_HOOKUP_OBJECT (debug_win, file1_menu_uiinfo[5].widget, "exit1");
19.453 - GLADE_HOOKUP_OBJECT (debug_win, menubar1_uiinfo[1].widget, "view1");
19.454 - GLADE_HOOKUP_OBJECT (debug_win, view1_menu_uiinfo[0].widget, "view_memory");
19.455 - GLADE_HOOKUP_OBJECT (debug_win, view1_menu_uiinfo[1].widget, "mem_mapped_regs1");
19.456 - GLADE_HOOKUP_OBJECT (debug_win, menubar1_uiinfo[2].widget, "settings1");
19.457 - GLADE_HOOKUP_OBJECT (debug_win, settings1_menu_uiinfo[0].widget, "preferences1");
19.458 - GLADE_HOOKUP_OBJECT (debug_win, menubar1_uiinfo[3].widget, "help1");
19.459 - GLADE_HOOKUP_OBJECT (debug_win, help1_menu_uiinfo[0].widget, "about1");
19.460 - GLADE_HOOKUP_OBJECT (debug_win, toolbar1, "toolbar1");
19.461 - GLADE_HOOKUP_OBJECT (debug_win, load_btn, "load_btn");
19.462 - GLADE_HOOKUP_OBJECT (debug_win, reset_btn, "reset_btn");
19.463 - GLADE_HOOKUP_OBJECT (debug_win, stop_btn, "stop_btn");
19.464 - GLADE_HOOKUP_OBJECT (debug_win, step_btn, "step_btn");
19.465 - GLADE_HOOKUP_OBJECT (debug_win, run_btn, "run_btn");
19.466 - GLADE_HOOKUP_OBJECT (debug_win, runto_btn, "runto_btn");
19.467 - GLADE_HOOKUP_OBJECT (debug_win, break_btn, "break_btn");
19.468 - GLADE_HOOKUP_OBJECT (debug_win, loadstate_button, "loadstate_button");
19.469 - GLADE_HOOKUP_OBJECT (debug_win, savestate_button, "savestate_button");
19.470 - GLADE_HOOKUP_OBJECT (debug_win, vpaned1, "vpaned1");
19.471 - GLADE_HOOKUP_OBJECT (debug_win, hpaned1, "hpaned1");
19.472 - GLADE_HOOKUP_OBJECT (debug_win, vbox2, "vbox2");
19.473 - GLADE_HOOKUP_OBJECT (debug_win, hbox1, "hbox1");
19.474 - GLADE_HOOKUP_OBJECT (debug_win, label21, "label21");
19.475 - GLADE_HOOKUP_OBJECT (debug_win, page_field, "page_field");
19.476 - GLADE_HOOKUP_OBJECT (debug_win, page_locked_btn, "page_locked_btn");
19.477 - GLADE_HOOKUP_OBJECT (debug_win, jump_pc_btn, "jump_pc_btn");
19.478 - GLADE_HOOKUP_OBJECT (debug_win, label22, "label22");
19.479 - GLADE_HOOKUP_OBJECT (debug_win, mode_box, "mode_box");
19.480 - GLADE_HOOKUP_OBJECT (debug_win, mode_field, "mode_field");
19.481 - GLADE_HOOKUP_OBJECT (debug_win, label23, "label23");
19.482 - GLADE_HOOKUP_OBJECT (debug_win, scrolledwindow7, "scrolledwindow7");
19.483 - GLADE_HOOKUP_OBJECT (debug_win, disasm_list, "disasm_list");
19.484 - GLADE_HOOKUP_OBJECT (debug_win, label24, "label24");
19.485 - GLADE_HOOKUP_OBJECT (debug_win, label27, "label27");
19.486 - GLADE_HOOKUP_OBJECT (debug_win, label28, "label28");
19.487 - GLADE_HOOKUP_OBJECT (debug_win, label29, "label29");
19.488 - GLADE_HOOKUP_OBJECT (debug_win, scrolledwindow4, "scrolledwindow4");
19.489 - GLADE_HOOKUP_OBJECT (debug_win, reg_list, "reg_list");
19.490 - GLADE_HOOKUP_OBJECT (debug_win, label25, "label25");
19.491 - GLADE_HOOKUP_OBJECT (debug_win, label30, "label30");
19.492 - GLADE_HOOKUP_OBJECT (debug_win, scrolledwindow8, "scrolledwindow8");
19.493 - GLADE_HOOKUP_OBJECT (debug_win, output_list, "output_list");
19.494 - GLADE_HOOKUP_OBJECT (debug_win, label26, "label26");
19.495 - GLADE_HOOKUP_OBJECT (debug_win, label31, "label31");
19.496 - GLADE_HOOKUP_OBJECT (debug_win, label32, "label32");
19.497 - GLADE_HOOKUP_OBJECT (debug_win, debug_appbar, "debug_appbar");
19.498 - GLADE_HOOKUP_OBJECT_NO_REF (debug_win, tooltips, "tooltips");
19.499 -
19.500 - return debug_win;
19.501 -}
19.502 -
19.503 -GtkWidget*
19.504 -create_mmr_win (void)
19.505 -{
19.506 - GtkWidget *mmr_win;
19.507 - GtkWidget *vbox1;
19.508 - GtkWidget *mmr_notebook;
19.509 - GtkWidget *empty_notebook_page;
19.510 - GtkWidget *label16;
19.511 - GtkWidget *hbuttonbox1;
19.512 - GtkWidget *mmr_close;
19.513 -
19.514 - mmr_win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
19.515 - gtk_window_set_title (GTK_WINDOW (mmr_win), _("lxDream! - Memory-Mapped Registers"));
19.516 - gtk_window_set_default_size (GTK_WINDOW (mmr_win), 600, 600);
19.517 -
19.518 - vbox1 = gtk_vbox_new (FALSE, 0);
19.519 - gtk_widget_show (vbox1);
19.520 - gtk_container_add (GTK_CONTAINER (mmr_win), vbox1);
19.521 -
19.522 - mmr_notebook = gtk_notebook_new ();
19.523 - gtk_widget_show (mmr_notebook);
19.524 - gtk_box_pack_start (GTK_BOX (vbox1), mmr_notebook, TRUE, TRUE, 0);
19.525 - gtk_notebook_set_tab_pos (GTK_NOTEBOOK (mmr_notebook), GTK_POS_LEFT);
19.526 -
19.527 - empty_notebook_page = gtk_vbox_new (FALSE, 0);
19.528 - gtk_widget_show (empty_notebook_page);
19.529 - gtk_container_add (GTK_CONTAINER (mmr_notebook), empty_notebook_page);
19.530 -
19.531 - label16 = gtk_label_new (_("label16"));
19.532 - gtk_widget_show (label16);
19.533 - gtk_notebook_set_tab_label (GTK_NOTEBOOK (mmr_notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (mmr_notebook), 0), label16);
19.534 - gtk_label_set_justify (GTK_LABEL (label16), GTK_JUSTIFY_CENTER);
19.535 -
19.536 - hbuttonbox1 = gtk_hbutton_box_new ();
19.537 - gtk_widget_show (hbuttonbox1);
19.538 - gtk_box_pack_start (GTK_BOX (vbox1), hbuttonbox1, FALSE, TRUE, 0);
19.539 - gtk_box_set_spacing (GTK_BOX (hbuttonbox1), 30);
19.540 -
19.541 - mmr_close = gtk_button_new_with_mnemonic (_("Close"));
19.542 - gtk_widget_show (mmr_close);
19.543 - gtk_container_add (GTK_CONTAINER (hbuttonbox1), mmr_close);
19.544 - GTK_WIDGET_SET_FLAGS (mmr_close, GTK_CAN_DEFAULT);
19.545 -
19.546 - g_signal_connect ((gpointer) mmr_win, "delete_event",
19.547 - G_CALLBACK (on_mmr_win_delete_event),
19.548 - NULL);
19.549 - g_signal_connect ((gpointer) mmr_close, "clicked",
19.550 - G_CALLBACK (on_mmr_close_clicked),
19.551 - NULL);
19.552 -
19.553 - /* Store pointers to all widgets, for use by lookup_widget(). */
19.554 - GLADE_HOOKUP_OBJECT_NO_REF (mmr_win, mmr_win, "mmr_win");
19.555 - GLADE_HOOKUP_OBJECT (mmr_win, vbox1, "vbox1");
19.556 - GLADE_HOOKUP_OBJECT (mmr_win, mmr_notebook, "mmr_notebook");
19.557 - GLADE_HOOKUP_OBJECT (mmr_win, label16, "label16");
19.558 - GLADE_HOOKUP_OBJECT (mmr_win, hbuttonbox1, "hbuttonbox1");
19.559 - GLADE_HOOKUP_OBJECT (mmr_win, mmr_close, "mmr_close");
19.560 -
19.561 - return mmr_win;
19.562 -}
19.563 -
19.564 -GtkWidget*
19.565 -create_about_win (void)
19.566 -{
19.567 - const gchar *authors[] = {
19.568 - "Nathan Keynes",
19.569 - NULL
19.570 - };
19.571 - const gchar *documenters[] = { NULL };
19.572 - /* TRANSLATORS: Replace this string with your names, one name per line. */
19.573 - gchar *translators = _("translator_credits");
19.574 - GdkPixbuf *about_win_logo_pixbuf;
19.575 - GtkWidget *about_win;
19.576 -
19.577 - if (!strcmp (translators, "translator_credits"))
19.578 - translators = NULL;
19.579 - about_win_logo_pixbuf = create_pixbuf ("dream/dcemu.gif");
19.580 - about_win = gnome_about_new ("Dream", VERSION,
19.581 - _("Copyright(c) 2002 Nathan Keynes"),
19.582 - "",
19.583 - authors,
19.584 - documenters,
19.585 - translators,
19.586 - about_win_logo_pixbuf);
19.587 - gtk_container_set_border_width (GTK_CONTAINER (about_win), 1);
19.588 - gtk_window_set_type_hint (GTK_WINDOW (about_win), GDK_WINDOW_TYPE_HINT_DIALOG);
19.589 -
19.590 - /* Store pointers to all widgets, for use by lookup_widget(). */
19.591 - GLADE_HOOKUP_OBJECT_NO_REF (about_win, about_win, "about_win");
19.592 -
19.593 - return about_win;
19.594 -}
19.595 -
19.596 -GtkWidget*
19.597 -create_dump_win (void)
19.598 -{
19.599 - GtkWidget *dump_win;
19.600 - GtkWidget *vbox3;
19.601 - GtkWidget *hbox2;
19.602 - GtkWidget *label34;
19.603 - GtkWidget *dump_from;
19.604 - GtkWidget *label35;
19.605 - GtkWidget *dump_to;
19.606 - GtkWidget *dump_view_button;
19.607 - GtkWidget *label36;
19.608 - GtkWidget *scrolledwindow9;
19.609 - GtkWidget *dump_text;
19.610 -
19.611 - dump_win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
19.612 - gtk_window_set_title (GTK_WINDOW (dump_win), _("Memory dump"));
19.613 -
19.614 - vbox3 = gtk_vbox_new (FALSE, 0);
19.615 - gtk_widget_show (vbox3);
19.616 - gtk_container_add (GTK_CONTAINER (dump_win), vbox3);
19.617 -
19.618 - hbox2 = gtk_hbox_new (FALSE, 0);
19.619 - gtk_widget_show (hbox2);
19.620 - gtk_box_pack_start (GTK_BOX (vbox3), hbox2, FALSE, TRUE, 3);
19.621 -
19.622 - label34 = gtk_label_new (_(" From "));
19.623 - gtk_widget_show (label34);
19.624 - gtk_box_pack_start (GTK_BOX (hbox2), label34, FALSE, FALSE, 0);
19.625 -
19.626 - dump_from = gtk_entry_new ();
19.627 - gtk_widget_show (dump_from);
19.628 - gtk_box_pack_start (GTK_BOX (hbox2), dump_from, FALSE, TRUE, 0);
19.629 -
19.630 - label35 = gtk_label_new (_(" To "));
19.631 - gtk_widget_show (label35);
19.632 - gtk_box_pack_start (GTK_BOX (hbox2), label35, FALSE, FALSE, 0);
19.633 -
19.634 - dump_to = gtk_entry_new ();
19.635 - gtk_widget_show (dump_to);
19.636 - gtk_box_pack_start (GTK_BOX (hbox2), dump_to, FALSE, TRUE, 0);
19.637 -
19.638 - dump_view_button = gtk_button_new_with_mnemonic (_("View"));
19.639 - gtk_widget_show (dump_view_button);
19.640 - gtk_box_pack_start (GTK_BOX (hbox2), dump_view_button, FALSE, FALSE, 0);
19.641 -
19.642 - label36 = gtk_label_new (_(" "));
19.643 - gtk_widget_show (label36);
19.644 - gtk_box_pack_start (GTK_BOX (hbox2), label36, TRUE, TRUE, 0);
19.645 -
19.646 - scrolledwindow9 = gtk_scrolled_window_new (NULL, NULL);
19.647 - gtk_widget_show (scrolledwindow9);
19.648 - gtk_box_pack_start (GTK_BOX (vbox3), scrolledwindow9, TRUE, TRUE, 0);
19.649 - gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow9), GTK_SHADOW_IN);
19.650 -
19.651 - dump_text = gtk_text_view_new ();
19.652 - gtk_widget_show (dump_text);
19.653 - gtk_container_add (GTK_CONTAINER (scrolledwindow9), dump_text);
19.654 -
19.655 - /* Store pointers to all widgets, for use by lookup_widget(). */
19.656 - GLADE_HOOKUP_OBJECT_NO_REF (dump_win, dump_win, "dump_win");
19.657 - GLADE_HOOKUP_OBJECT (dump_win, vbox3, "vbox3");
19.658 - GLADE_HOOKUP_OBJECT (dump_win, hbox2, "hbox2");
19.659 - GLADE_HOOKUP_OBJECT (dump_win, label34, "label34");
19.660 - GLADE_HOOKUP_OBJECT (dump_win, dump_from, "dump_from");
19.661 - GLADE_HOOKUP_OBJECT (dump_win, label35, "label35");
19.662 - GLADE_HOOKUP_OBJECT (dump_win, dump_to, "dump_to");
19.663 - GLADE_HOOKUP_OBJECT (dump_win, dump_view_button, "dump_view_button");
19.664 - GLADE_HOOKUP_OBJECT (dump_win, label36, "label36");
19.665 - GLADE_HOOKUP_OBJECT (dump_win, scrolledwindow9, "scrolledwindow9");
19.666 - GLADE_HOOKUP_OBJECT (dump_win, dump_text, "dump_text");
19.667 -
19.668 - return dump_win;
19.669 -}
19.670 -
19.671 -GtkWidget*
19.672 -create_watch_win (void)
19.673 -{
19.674 - GtkWidget *watch_win;
19.675 - GtkWidget *vbox4;
19.676 - GtkWidget *hbox4;
19.677 - GtkWidget *label37;
19.678 - GtkWidget *watch_start_addr;
19.679 - GtkWidget *label38;
19.680 - GtkWidget *watch_end_addr;
19.681 - GtkWidget *label39;
19.682 - GtkWidget *combo1;
19.683 - GtkWidget *watch_type;
19.684 - GtkWidget *button_add_watch;
19.685 - GtkWidget *scrolledwindow10;
19.686 - GtkWidget *treeview1;
19.687 - GtkWidget *hbox5;
19.688 - GtkWidget *label40;
19.689 - GtkWidget *button_clear_all;
19.690 - GtkWidget *button_close;
19.691 -
19.692 - watch_win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
19.693 - gtk_window_set_title (GTK_WINDOW (watch_win), _("Watchpoints"));
19.694 -
19.695 - vbox4 = gtk_vbox_new (FALSE, 0);
19.696 - gtk_widget_show (vbox4);
19.697 - gtk_container_add (GTK_CONTAINER (watch_win), vbox4);
19.698 -
19.699 - hbox4 = gtk_hbox_new (FALSE, 0);
19.700 - gtk_widget_show (hbox4);
19.701 - gtk_box_pack_start (GTK_BOX (vbox4), hbox4, FALSE, TRUE, 3);
19.702 -
19.703 - label37 = gtk_label_new (_("Start addr "));
19.704 - gtk_widget_show (label37);
19.705 - gtk_box_pack_start (GTK_BOX (hbox4), label37, FALSE, FALSE, 3);
19.706 -
19.707 - watch_start_addr = gtk_entry_new ();
19.708 - gtk_widget_show (watch_start_addr);
19.709 - gtk_box_pack_start (GTK_BOX (hbox4), watch_start_addr, FALSE, TRUE, 0);
19.710 -
19.711 - label38 = gtk_label_new (_("End addr"));
19.712 - gtk_widget_show (label38);
19.713 - gtk_box_pack_start (GTK_BOX (hbox4), label38, FALSE, FALSE, 3);
19.714 -
19.715 - watch_end_addr = gtk_entry_new ();
19.716 - gtk_widget_show (watch_end_addr);
19.717 - gtk_box_pack_start (GTK_BOX (hbox4), watch_end_addr, FALSE, TRUE, 0);
19.718 -
19.719 - label39 = gtk_label_new (_("Type"));
19.720 - gtk_widget_show (label39);
19.721 - gtk_box_pack_start (GTK_BOX (hbox4), label39, FALSE, FALSE, 3);
19.722 -
19.723 - combo1 = gtk_combo_new ();
19.724 - g_object_set_data (G_OBJECT (GTK_COMBO (combo1)->popwin),
19.725 - "GladeParentKey", combo1);
19.726 - gtk_widget_show (combo1);
19.727 - gtk_box_pack_start (GTK_BOX (hbox4), combo1, TRUE, TRUE, 0);
19.728 -
19.729 - watch_type = GTK_COMBO (combo1)->entry;
19.730 - gtk_widget_show (watch_type);
19.731 -
19.732 - button_add_watch = gtk_button_new_with_mnemonic (_("Add Watch"));
19.733 - gtk_widget_show (button_add_watch);
19.734 - gtk_box_pack_start (GTK_BOX (hbox4), button_add_watch, FALSE, FALSE, 3);
19.735 -
19.736 - scrolledwindow10 = gtk_scrolled_window_new (NULL, NULL);
19.737 - gtk_widget_show (scrolledwindow10);
19.738 - gtk_box_pack_start (GTK_BOX (vbox4), scrolledwindow10, TRUE, TRUE, 0);
19.739 -
19.740 - treeview1 = gtk_tree_view_new ();
19.741 - gtk_widget_show (treeview1);
19.742 - gtk_container_add (GTK_CONTAINER (scrolledwindow10), treeview1);
19.743 - gtk_tree_view_set_enable_search (GTK_TREE_VIEW (treeview1), FALSE);
19.744 -
19.745 - hbox5 = gtk_hbox_new (FALSE, 0);
19.746 - gtk_widget_show (hbox5);
19.747 - gtk_box_pack_start (GTK_BOX (vbox4), hbox5, FALSE, TRUE, 3);
19.748 -
19.749 - label40 = gtk_label_new ("");
19.750 - gtk_widget_show (label40);
19.751 - gtk_box_pack_start (GTK_BOX (hbox5), label40, TRUE, TRUE, 0);
19.752 -
19.753 - button_clear_all = gtk_button_new_with_mnemonic (_("Clear all"));
19.754 - gtk_widget_show (button_clear_all);
19.755 - gtk_box_pack_start (GTK_BOX (hbox5), button_clear_all, FALSE, FALSE, 3);
19.756 -
19.757 - button_close = gtk_button_new_with_mnemonic (_("Close"));
19.758 - gtk_widget_show (button_close);
19.759 - gtk_box_pack_start (GTK_BOX (hbox5), button_close, FALSE, FALSE, 5);
19.760 -
19.761 - g_signal_connect ((gpointer) button_add_watch, "clicked",
19.762 - G_CALLBACK (on_button_add_watch_clicked),
19.763 - NULL);
19.764 - g_signal_connect ((gpointer) button_clear_all, "clicked",
19.765 - G_CALLBACK (on_button_clear_all_clicked),
19.766 - NULL);
19.767 - g_signal_connect ((gpointer) button_close, "clicked",
19.768 - G_CALLBACK (on_button_close_clicked),
19.769 - NULL);
19.770 -
19.771 - /* Store pointers to all widgets, for use by lookup_widget(). */
19.772 - GLADE_HOOKUP_OBJECT_NO_REF (watch_win, watch_win, "watch_win");
19.773 - GLADE_HOOKUP_OBJECT (watch_win, vbox4, "vbox4");
19.774 - GLADE_HOOKUP_OBJECT (watch_win, hbox4, "hbox4");
19.775 - GLADE_HOOKUP_OBJECT (watch_win, label37, "label37");
19.776 - GLADE_HOOKUP_OBJECT (watch_win, watch_start_addr, "watch_start_addr");
19.777 - GLADE_HOOKUP_OBJECT (watch_win, label38, "label38");
19.778 - GLADE_HOOKUP_OBJECT (watch_win, watch_end_addr, "watch_end_addr");
19.779 - GLADE_HOOKUP_OBJECT (watch_win, label39, "label39");
19.780 - GLADE_HOOKUP_OBJECT (watch_win, combo1, "combo1");
19.781 - GLADE_HOOKUP_OBJECT (watch_win, watch_type, "watch_type");
19.782 - GLADE_HOOKUP_OBJECT (watch_win, button_add_watch, "button_add_watch");
19.783 - GLADE_HOOKUP_OBJECT (watch_win, scrolledwindow10, "scrolledwindow10");
19.784 - GLADE_HOOKUP_OBJECT (watch_win, treeview1, "treeview1");
19.785 - GLADE_HOOKUP_OBJECT (watch_win, hbox5, "hbox5");
19.786 - GLADE_HOOKUP_OBJECT (watch_win, label40, "label40");
19.787 - GLADE_HOOKUP_OBJECT (watch_win, button_clear_all, "button_clear_all");
19.788 - GLADE_HOOKUP_OBJECT (watch_win, button_close, "button_close");
19.789 -
19.790 - return watch_win;
19.791 -}
19.792 -
20.1 --- a/src/gui/interface.h Tue Oct 09 11:37:36 2007 +0000
20.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
20.3 @@ -1,9 +0,0 @@
20.4 -/*
20.5 - * DO NOT EDIT THIS FILE - it is generated by Glade.
20.6 - */
20.7 -
20.8 -GtkWidget* create_debug_win (void);
20.9 -GtkWidget* create_mmr_win (void);
20.10 -GtkWidget* create_about_win (void);
20.11 -GtkWidget* create_dump_win (void);
20.12 -GtkWidget* create_watch_win (void);
21.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
21.2 +++ b/src/gui/main_win.c Wed Oct 10 11:02:04 2007 +0000
21.3 @@ -0,0 +1,173 @@
21.4 +/**
21.5 + * $Id: main_win.c,v 1.1 2007-10-10 11:02:04 nkeynes Exp $
21.6 + *
21.7 + * Define the main (emu) GTK window, along with its menubars,
21.8 + * toolbars, etc.
21.9 + *
21.10 + * Copyright (c) 2005 Nathan Keynes.
21.11 + *
21.12 + * This program is free software; you can redistribute it and/or modify
21.13 + * it under the terms of the GNU General Public License as published by
21.14 + * the Free Software Foundation; either version 2 of the License, or
21.15 + * (at your option) any later version.
21.16 + *
21.17 + * This program is distributed in the hope that it will be useful,
21.18 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
21.19 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21.20 + * GNU General Public License for more details.
21.21 + */
21.22 +
21.23 +#include <assert.h>
21.24 +#include <sys/types.h>
21.25 +#include <sys/stat.h>
21.26 +#include <unistd.h>
21.27 +#include <string.h>
21.28 +#include <stdio.h>
21.29 +#include <stdlib.h>
21.30 +
21.31 +#include <gtk/gtk.h>
21.32 +
21.33 +#include "dream.h"
21.34 +#include "gui/gtkui.h"
21.35 +
21.36 +#define SET_ACTION_ENABLED(win,name,b) gtk_action_set_sensitive( gtk_action_group_get_action( win->actions, name), b)
21.37 +#define ENABLE_ACTION(win,name) SET_ACTION_ENABLED(win,name,TRUE)
21.38 +#define DISABLE_ACTION(win,name) SET_ACTION_ENABLED(win,name,FALSE)
21.39 +
21.40 +static const GtkActionEntry ui_actions[] = {
21.41 + { "FileMenu", NULL, "_File" },
21.42 + { "SettingsMenu", NULL, "_Settings" },
21.43 + { "HelpMenu", NULL, "_Help" },
21.44 + { "Mount", GTK_STOCK_CDROM, "_Mount...", "<control>O", "Mount a cdrom disc", G_CALLBACK(mount_action_callback) },
21.45 + { "Reset", GTK_STOCK_REFRESH, "_Reset", "<control>R", "Reset dreamcast", G_CALLBACK(reset_action_callback) },
21.46 + { "Pause", GTK_STOCK_MEDIA_PAUSE, "_Pause", NULL, "Pause dreamcast", G_CALLBACK(pause_action_callback) },
21.47 + { "Run", GTK_STOCK_MEDIA_PLAY, "Resume", NULL, "Resume", G_CALLBACK(resume_action_callback) },
21.48 + { "LoadState", GTK_STOCK_REVERT_TO_SAVED, "_Load state...", "F4", "Load an lxdream save state", G_CALLBACK(load_state_action_callback) },
21.49 + { "SaveState", GTK_STOCK_SAVE_AS, "_Save state...", "F3", "Create an lxdream save state", G_CALLBACK(save_state_action_callback) },
21.50 + { "Exit", GTK_STOCK_QUIT, "E_xit", NULL, "Exit lxdream", G_CALLBACK(exit_action_callback) },
21.51 + { "AudioSettings", NULL, "_Audio...", NULL, "Configure audio output", G_CALLBACK(audio_settings_callback) },
21.52 + { "ControllerSettings", NULL, "_Controllers...", NULL, "Configure controllers", G_CALLBACK(controller_settings_callback) },
21.53 + { "NetworkSettings", NULL, "_Network...", NULL, "Configure network settings", G_CALLBACK(network_settings_callback) },
21.54 + { "VideoSettings", NULL, "_Video...", NULL, "Configure video output", G_CALLBACK(video_settings_callback) },
21.55 + { "About", GTK_STOCK_ABOUT, "_About...", NULL, "About lxdream", G_CALLBACK(about_action_callback) }
21.56 +};
21.57 +static const GtkToggleActionEntry ui_toggle_actions[] = {
21.58 + { "FullScreen", NULL, "_Full Screen", "F9", "Toggle full screen video", G_CALLBACK(fullscreen_toggle_callback), 0 },
21.59 +};
21.60 +
21.61 +
21.62 +static const char *ui_description =
21.63 + "<ui>"
21.64 + " <menubar name='MainMenu'>"
21.65 + " <menu action='FileMenu'>"
21.66 + " <menuitem action='Mount'/>"
21.67 + " <separator/>"
21.68 + " <menuitem action='Reset'/>"
21.69 + " <menuitem action='Pause'/>"
21.70 + " <menuitem action='Run'/>"
21.71 + " <separator/>"
21.72 + " <menuitem action='LoadState'/>"
21.73 + " <menuitem action='SaveState'/>"
21.74 + " <separator/>"
21.75 + " <menuitem action='Exit'/>"
21.76 + " </menu>"
21.77 + " <menu action='SettingsMenu'>"
21.78 + " <menuitem action='AudioSettings'/>"
21.79 + " <menuitem action='ControllerSettings'/>"
21.80 + " <menuitem action='NetworkSettings'/>"
21.81 + " <menuitem action='VideoSettings'/>"
21.82 + " <separator/>"
21.83 + " <menuitem action='FullScreen'/>"
21.84 + " </menu>"
21.85 + " <menu action='HelpMenu'>"
21.86 + " <menuitem action='About'/>"
21.87 + " </menu>"
21.88 + " </menubar>"
21.89 + " <toolbar name='MainToolbar'>"
21.90 + " <toolitem action='Mount'/>"
21.91 + " <toolitem action='Reset'/>"
21.92 + " <toolitem action='Pause'/>"
21.93 + " <toolitem action='Run'/>"
21.94 + " <separator/>"
21.95 + " <toolitem action='LoadState'/>"
21.96 + " <toolitem action='SaveState'/>"
21.97 + " </toolbar>"
21.98 + "</ui>";
21.99 +
21.100 +
21.101 +struct main_window_info {
21.102 + GtkWidget *window;
21.103 + GtkWidget *menubar;
21.104 + GtkWidget *toolbar;
21.105 + GtkWidget *video;
21.106 + GtkWidget *statusbar;
21.107 + GtkActionGroup *actions;
21.108 +};
21.109 +
21.110 +main_window_t main_window_new( const gchar *title )
21.111 +{
21.112 + GtkWidget *vbox;
21.113 + GtkUIManager *ui_manager;
21.114 + GtkAccelGroup *accel_group;
21.115 + GError *error = NULL;
21.116 + main_window_t win = g_malloc0( sizeof(struct main_window_info) );
21.117 +
21.118 + win->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
21.119 + gtk_window_set_title( GTK_WINDOW(win->window), title );
21.120 +
21.121 + win->actions = gtk_action_group_new("MenuActions");
21.122 + gtk_action_group_add_actions( win->actions, ui_actions, G_N_ELEMENTS(ui_actions), win->window );
21.123 + gtk_action_group_add_toggle_actions( win->actions, ui_toggle_actions, G_N_ELEMENTS(ui_toggle_actions), win->window );
21.124 + DISABLE_ACTION(win, "NetworkSettings");
21.125 +
21.126 + ui_manager = gtk_ui_manager_new();
21.127 + gtk_ui_manager_set_add_tearoffs(ui_manager, TRUE);
21.128 + gtk_ui_manager_insert_action_group( ui_manager, win->actions, 0 );
21.129 +
21.130 + if (!gtk_ui_manager_add_ui_from_string (ui_manager, ui_description, -1, &error)) {
21.131 + g_message ("building menus failed: %s", error->message);
21.132 + g_error_free (error);
21.133 + exit(1);
21.134 + }
21.135 +
21.136 + accel_group = gtk_ui_manager_get_accel_group (ui_manager);
21.137 + gtk_window_add_accel_group (GTK_WINDOW (win->window), accel_group);
21.138 +
21.139 + win->menubar = gtk_ui_manager_get_widget(ui_manager, "/MainMenu");
21.140 + win->toolbar = gtk_ui_manager_get_widget(ui_manager, "/MainToolbar");
21.141 +
21.142 + gtk_toolbar_set_style( GTK_TOOLBAR(win->toolbar), GTK_TOOLBAR_ICONS );
21.143 +
21.144 + win->video = gtk_drawing_area_new();
21.145 + GTK_WIDGET_SET_FLAGS(win->video, GTK_CAN_FOCUS|GTK_CAN_DEFAULT);
21.146 + gtk_widget_set_size_request( win->video, 640, 480 );
21.147 + win->statusbar = gtk_statusbar_new();
21.148 +
21.149 + vbox = gtk_vbox_new(FALSE, 0);
21.150 + gtk_container_add( GTK_CONTAINER(win->window), vbox );
21.151 + gtk_box_pack_start( GTK_BOX(vbox), win->menubar, FALSE, FALSE, 0 );
21.152 + gtk_box_pack_start( GTK_BOX(vbox), win->toolbar, FALSE, FALSE, 0 );
21.153 + gtk_box_pack_start( GTK_BOX(vbox), win->video, TRUE, TRUE, 1 );
21.154 + gtk_box_pack_start( GTK_BOX(vbox), win->statusbar, FALSE, FALSE, 0 );
21.155 + gtk_widget_show_all( win->window );
21.156 + gtk_widget_grab_focus( win->video );
21.157 +
21.158 + return win;
21.159 +}
21.160 +
21.161 +void main_window_set_running( main_window_t win, gboolean running )
21.162 +{
21.163 + SET_ACTION_ENABLED( win, "Pause", running );
21.164 + SET_ACTION_ENABLED( win, "Run", !running );
21.165 +}
21.166 +
21.167 +void main_window_set_framerate( main_window_t win, float rate )
21.168 +{
21.169 +
21.170 +
21.171 +}
21.172 +
21.173 +GtkWidget *main_window_get_renderarea( main_window_t win )
21.174 +{
21.175 + return win->video;
21.176 +}
22.1 --- a/src/gui/mmio_win.c Tue Oct 09 11:37:36 2007 +0000
22.2 +++ b/src/gui/mmio_win.c Wed Oct 10 11:02:04 2007 +0000
22.3 @@ -1,5 +1,5 @@
22.4 /**
22.5 - * $Id: mmio_win.c,v 1.6 2007-10-08 11:48:56 nkeynes Exp $
22.6 + * $Id: mmio_win.c,v 1.7 2007-10-10 11:02:04 nkeynes Exp $
22.7 *
22.8 * Implements the MMIO register viewing window
22.9 *
22.10 @@ -18,9 +18,9 @@
22.11
22.12 #include <stdint.h>
22.13 #include <gnome.h>
22.14 -#include "interface.h"
22.15 -#include "callbacks.h"
22.16 -#include "gui.h"
22.17 +#include "debugif.h"
22.18 +#include "debugcb.h"
22.19 +#include "gui/gtkui.h"
22.20 #include "mem.h"
22.21 #include "mmio.h"
22.22
22.23 @@ -84,7 +84,7 @@
22.24 gtk_clist_set_column_title(list, 3, "Bit Pattern");
22.25 gtk_clist_set_column_title(list, 4, "Description");
22.26 gtk_clist_column_titles_show(list);
22.27 - gtk_widget_modify_font( GTK_WIDGET(list), fixed_list_font );
22.28 + gtk_widget_modify_font( GTK_WIDGET(list), gui_fixed_font );
22.29 gtk_widget_show( GTK_WIDGET(list) );
22.30 tab = gtk_label_new(_(name));
22.31 gtk_widget_show( tab );
22.32 @@ -128,15 +128,15 @@
22.33
22.34 gtk_clist_set_text( page, j, 2, data );
22.35 gtk_clist_set_text( page, j, 3, bits );
22.36 - gtk_clist_set_foreground( page, j, &clrChanged );
22.37 + gtk_clist_set_foreground( page, j, &gui_colour_changed );
22.38
22.39 gtk_clist_set_text( all_page, count, 2, data );
22.40 gtk_clist_set_text( all_page, count, 3, bits );
22.41 - gtk_clist_set_foreground( all_page, count, &clrChanged );
22.42 + gtk_clist_set_foreground( all_page, count, &gui_colour_changed );
22.43
22.44 } else {
22.45 - gtk_clist_set_foreground( page, j, &clrNormal );
22.46 - gtk_clist_set_foreground( all_page, count, &clrNormal );
22.47 + gtk_clist_set_foreground( page, j, &gui_colour_normal );
22.48 + gtk_clist_set_foreground( all_page, count, &gui_colour_normal );
22.49 }
22.50 count++;
22.51 }
23.1 --- a/src/loader.c Tue Oct 09 11:37:36 2007 +0000
23.2 +++ b/src/loader.c Wed Oct 10 11:02:04 2007 +0000
23.3 @@ -1,5 +1,5 @@
23.4 /**
23.5 - * $Id: loader.c,v 1.16 2007-10-07 06:21:14 nkeynes Exp $
23.6 + * $Id: loader.c,v 1.17 2007-10-10 11:02:04 nkeynes Exp $
23.7 *
23.8 * File loading routines, mostly for loading demos without going through the
23.9 * whole procedure of making a CD image for them.
23.10 @@ -23,7 +23,6 @@
23.11 #include <errno.h>
23.12 #include <stdint.h>
23.13 #include <elf.h>
23.14 -#include "gui/gui.h"
23.15 #include "mem.h"
23.16 #include "sh4core.h"
23.17 #include "bootstrap.h"
24.1 --- a/src/main.c Tue Oct 09 11:37:36 2007 +0000
24.2 +++ b/src/main.c Wed Oct 10 11:02:04 2007 +0000
24.3 @@ -1,5 +1,5 @@
24.4 /**
24.5 - * $Id: main.c,v 1.27 2007-10-06 09:00:10 nkeynes Exp $
24.6 + * $Id: main.c,v 1.28 2007-10-10 11:02:04 nkeynes Exp $
24.7 *
24.8 * Main program, initializes dreamcast and gui, then passes control off to
24.9 * the gtk main loop (currently).
24.10 @@ -24,8 +24,7 @@
24.11 #endif
24.12 #include <unistd.h>
24.13 #include <getopt.h>
24.14 -#include <gnome.h>
24.15 -#include "gui/gui.h"
24.16 +#include "gui.h"
24.17 #include "dream.h"
24.18 #include "syscall.h"
24.19 #include "mem.h"
24.20 @@ -72,6 +71,7 @@
24.21 bindtextdomain (PACKAGE, PACKAGE_LOCALE_DIR);
24.22 textdomain (PACKAGE);
24.23 #endif
24.24 + gboolean ui_initialized = gui_parse_cmdline(&argc, &argv);
24.25
24.26 while( (opt = getopt_long( argc, argv, option_list, longopts, NULL )) != -1 ) {
24.27 switch( opt ) {
24.28 @@ -127,28 +127,13 @@
24.29 dreamcast_load_config( config_file );
24.30
24.31 if( aica_program == NULL ) {
24.32 - if( !headless ) {
24.33 - gnome_init ("lxdream", VERSION, argc, argv);
24.34 - dreamcast_init();
24.35 - dreamcast_register_module( &gtk_gui_module );
24.36 - if( show_debugger ) {
24.37 - gtk_gui_show_debugger();
24.38 - }
24.39 - } else {
24.40 - dreamcast_init();
24.41 - }
24.42 -
24.43 + dreamcast_init();
24.44 } else {
24.45 dreamcast_configure_aica_only();
24.46 mem_load_block( aica_program, 0x00800000, 2048*1024 );
24.47 if( s3m_file != NULL ) {
24.48 mem_load_block( s3m_file, 0x00810000, 2048*1024 - 0x10000 );
24.49 }
24.50 - if( !headless ) {
24.51 - gnome_init ("lxdream", VERSION, argc, argv);
24.52 - dreamcast_register_module( &gtk_gui_module );
24.53 - set_disassembly_cpu( main_debug, "ARM7" );
24.54 - }
24.55 }
24.56
24.57 if( without_bios ) {
24.58 @@ -173,6 +158,8 @@
24.59 if( headless ) {
24.60 display_set_driver( &display_null_driver );
24.61 } else {
24.62 + gui_init(show_debugger);
24.63 +
24.64 gboolean initialized = FALSE;
24.65 for( i=0; display_driver_list[i] != NULL; i++ ) {
24.66 if( strcasecmp( display_driver_list[i]->name, display_driver_name ) == 0 ) {
24.67 @@ -211,7 +198,7 @@
24.68 }
24.69 }
24.70 if( !headless ) {
24.71 - gtk_main ();
24.72 + gui_main_loop();
24.73 }
24.74 return 0;
24.75 }
.