Search
lxdream.org :: lxdream :: r537:d924be49e192
lxdream 0.9.1
released Jun 29
Download Now
changeset537:d924be49e192
parent536:d3a65d75b5ae
child538:7f176617a968
authornkeynes
dateTue Nov 20 10:27:58 2007 +0000 (12 years ago)
Move gtk UI into gtkui subdir (prep for non-gtk builds), and protect with
an automake conditional
Makefile.in
configure
configure.in
src/Makefile.am
src/Makefile.in
src/drivers/video_gtk.c
src/gtkui/ctrl_dlg.c
src/gtkui/debug_win.c
src/gtkui/dump_win.c
src/gtkui/gdrom_menu.c
src/gtkui/gtkcb.c
src/gtkui/gtkui.c
src/gtkui/gtkui.h
src/gtkui/main_win.c
src/gtkui/mmio_win.c
src/gtkui/path_dlg.c
src/gui/ctrl_dlg.c
src/gui/debug_win.c
src/gui/dump_win.c
src/gui/gdrom_menu.c
src/gui/gtkcb.c
src/gui/gtkui.c
src/gui/gtkui.h
src/gui/main_win.c
src/gui/mmio_win.c
src/gui/path_dlg.c
src/loader.c
src/main.c
1.1 --- a/Makefile.in Tue Nov 20 09:42:03 2007 +0000
1.2 +++ b/Makefile.in Tue Nov 20 10:27:58 2007 +0000
1.3 @@ -43,6 +43,8 @@
1.4 ARMCC = @ARMCC@
1.5 ARMLD = @ARMLD@
1.6 ARMOBJCOPY = @ARMOBJCOPY@
1.7 +AUDIO_ESOUND_FALSE = @AUDIO_ESOUND_FALSE@
1.8 +AUDIO_ESOUND_TRUE = @AUDIO_ESOUND_TRUE@
1.9 AUTOCONF = @AUTOCONF@
1.10 AUTOHEADER = @AUTOHEADER@
1.11 AUTOMAKE = @AUTOMAKE@
1.12 @@ -70,11 +72,17 @@
1.13 ECHO_N = @ECHO_N@
1.14 ECHO_T = @ECHO_T@
1.15 EGREP = @EGREP@
1.16 +ESOUND_CFLAGS = @ESOUND_CFLAGS@
1.17 +ESOUND_LIBS = @ESOUND_LIBS@
1.18 EXEEXT = @EXEEXT@
1.19 GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
1.20 GMOFILES = @GMOFILES@
1.21 GMSGFMT = @GMSGFMT@
1.22 GREP = @GREP@
1.23 +GTK_CFLAGS = @GTK_CFLAGS@
1.24 +GTK_LIBS = @GTK_LIBS@
1.25 +GUI_GTK_FALSE = @GUI_GTK_FALSE@
1.26 +GUI_GTK_TRUE = @GUI_GTK_TRUE@
1.27 INSTALL_DATA = @INSTALL_DATA@
1.28 INSTALL_PROGRAM = @INSTALL_PROGRAM@
1.29 INSTALL_SCRIPT = @INSTALL_SCRIPT@
1.30 @@ -83,6 +91,8 @@
1.31 INTLLIBS = @INTLLIBS@
1.32 LDFLAGS = @LDFLAGS@
1.33 LIBOBJS = @LIBOBJS@
1.34 +LIBPNG_CFLAGS = @LIBPNG_CFLAGS@
1.35 +LIBPNG_LIBS = @LIBPNG_LIBS@
1.36 LIBS = @LIBS@
1.37 LTLIBOBJS = @LTLIBOBJS@
1.38 MAINT = @MAINT@
1.39 @@ -94,8 +104,6 @@
1.40 OBJEXT = @OBJEXT@
1.41 PACKAGE = @PACKAGE@
1.42 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
1.43 -PACKAGE_CFLAGS = @PACKAGE_CFLAGS@
1.44 -PACKAGE_LIBS = @PACKAGE_LIBS@
1.45 PACKAGE_NAME = @PACKAGE_NAME@
1.46 PACKAGE_STRING = @PACKAGE_STRING@
1.47 PACKAGE_TARNAME = @PACKAGE_TARNAME@
1.48 @@ -173,7 +181,7 @@
1.49 installdirs-recursive install-recursive uninstall-recursive \
1.50 check-recursive installcheck-recursive
1.51 DIST_COMMON = README $(srcdir)/Makefile.in $(srcdir)/configure AUTHORS \
1.52 - COPYING ChangeLog INSTALL Makefile.am NEWS acconfig.h \
1.53 + COPYING ChangeLog INSTALL Makefile.am NEWS TODO acconfig.h \
1.54 aclocal.m4 config.guess config.h.in config.sub configure \
1.55 configure.in depcomp install-sh missing mkinstalldirs
1.56 DIST_SUBDIRS = src po test
2.1 --- a/configure Tue Nov 20 09:42:03 2007 +0000
2.2 +++ b/configure Tue Nov 20 10:27:58 2007 +0000
2.3 @@ -699,14 +699,18 @@
2.4 host_vendor
2.5 host_os
2.6 PKG_CONFIG
2.7 -PACKAGE_CFLAGS
2.8 -PACKAGE_LIBS
2.9 +LIBPNG_CFLAGS
2.10 +LIBPNG_LIBS
2.11 +GTK_CFLAGS
2.12 +GTK_LIBS
2.13 +GUI_GTK_TRUE
2.14 +GUI_GTK_FALSE
2.15 +BUILD_SH4X86_TRUE
2.16 +BUILD_SH4X86_FALSE
2.17 ESOUND_CFLAGS
2.18 ESOUND_LIBS
2.19 AUDIO_ESOUND_TRUE
2.20 AUDIO_ESOUND_FALSE
2.21 -BUILD_SH4X86_TRUE
2.22 -BUILD_SH4X86_FALSE
2.23 CDROM_LINUX_TRUE
2.24 CDROM_LINUX_FALSE
2.25 SHCC
2.26 @@ -748,8 +752,10 @@
2.27 CPPFLAGS
2.28 CPP
2.29 PKG_CONFIG
2.30 -PACKAGE_CFLAGS
2.31 -PACKAGE_LIBS
2.32 +LIBPNG_CFLAGS
2.33 +LIBPNG_LIBS
2.34 +GTK_CFLAGS
2.35 +GTK_LIBS
2.36 ESOUND_CFLAGS
2.37 ESOUND_LIBS'
2.38
2.39 @@ -1344,10 +1350,11 @@
2.40 you have headers in a nonstandard directory <include dir>
2.41 CPP C preprocessor
2.42 PKG_CONFIG path to pkg-config utility
2.43 - PACKAGE_CFLAGS
2.44 - C compiler flags for PACKAGE, overriding pkg-config
2.45 - PACKAGE_LIBS
2.46 - linker flags for PACKAGE, overriding pkg-config
2.47 + LIBPNG_CFLAGS
2.48 + C compiler flags for LIBPNG, overriding pkg-config
2.49 + LIBPNG_LIBS linker flags for LIBPNG, overriding pkg-config
2.50 + GTK_CFLAGS C compiler flags for GTK, overriding pkg-config
2.51 + GTK_LIBS linker flags for GTK, overriding pkg-config
2.52 ESOUND_CFLAGS
2.53 C compiler flags for ESOUND, overriding pkg-config
2.54 ESOUND_LIBS linker flags for ESOUND, overriding pkg-config
2.55 @@ -5057,20 +5064,20 @@
2.56 fi
2.57
2.58 pkg_failed=no
2.59 -{ echo "$as_me:$LINENO: checking for PACKAGE" >&5
2.60 -echo $ECHO_N "checking for PACKAGE... $ECHO_C" >&6; }
2.61 +{ echo "$as_me:$LINENO: checking for LIBPNG" >&5
2.62 +echo $ECHO_N "checking for LIBPNG... $ECHO_C" >&6; }
2.63
2.64 if test -n "$PKG_CONFIG"; then
2.65 - if test -n "$PACKAGE_CFLAGS"; then
2.66 - pkg_cv_PACKAGE_CFLAGS="$PACKAGE_CFLAGS"
2.67 + if test -n "$LIBPNG_CFLAGS"; then
2.68 + pkg_cv_LIBPNG_CFLAGS="$LIBPNG_CFLAGS"
2.69 else
2.70 if test -n "$PKG_CONFIG" && \
2.71 - { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \" gtk+-2.0 libpng \"") >&5
2.72 - ($PKG_CONFIG --exists --print-errors " gtk+-2.0 libpng ") 2>&5
2.73 + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libpng \"") >&5
2.74 + ($PKG_CONFIG --exists --print-errors "libpng ") 2>&5
2.75 ac_status=$?
2.76 echo "$as_me:$LINENO: \$? = $ac_status" >&5
2.77 (exit $ac_status); }; then
2.78 - pkg_cv_PACKAGE_CFLAGS=`$PKG_CONFIG --cflags " gtk+-2.0 libpng " 2>/dev/null`
2.79 + pkg_cv_LIBPNG_CFLAGS=`$PKG_CONFIG --cflags "libpng " 2>/dev/null`
2.80 else
2.81 pkg_failed=yes
2.82 fi
2.83 @@ -5079,16 +5086,16 @@
2.84 pkg_failed=untried
2.85 fi
2.86 if test -n "$PKG_CONFIG"; then
2.87 - if test -n "$PACKAGE_LIBS"; then
2.88 - pkg_cv_PACKAGE_LIBS="$PACKAGE_LIBS"
2.89 + if test -n "$LIBPNG_LIBS"; then
2.90 + pkg_cv_LIBPNG_LIBS="$LIBPNG_LIBS"
2.91 else
2.92 if test -n "$PKG_CONFIG" && \
2.93 - { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \" gtk+-2.0 libpng \"") >&5
2.94 - ($PKG_CONFIG --exists --print-errors " gtk+-2.0 libpng ") 2>&5
2.95 + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libpng \"") >&5
2.96 + ($PKG_CONFIG --exists --print-errors "libpng ") 2>&5
2.97 ac_status=$?
2.98 echo "$as_me:$LINENO: \$? = $ac_status" >&5
2.99 (exit $ac_status); }; then
2.100 - pkg_cv_PACKAGE_LIBS=`$PKG_CONFIG --libs " gtk+-2.0 libpng " 2>/dev/null`
2.101 + pkg_cv_LIBPNG_LIBS=`$PKG_CONFIG --libs "libpng " 2>/dev/null`
2.102 else
2.103 pkg_failed=yes
2.104 fi
2.105 @@ -5107,33 +5114,33 @@
2.106 _pkg_short_errors_supported=no
2.107 fi
2.108 if test $_pkg_short_errors_supported = yes; then
2.109 - PACKAGE_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors " gtk+-2.0 libpng "`
2.110 + LIBPNG_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "libpng "`
2.111 else
2.112 - PACKAGE_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors " gtk+-2.0 libpng "`
2.113 + LIBPNG_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libpng "`
2.114 fi
2.115 # Put the nasty error message in config.log where it belongs
2.116 - echo "$PACKAGE_PKG_ERRORS" >&5
2.117 -
2.118 - { { echo "$as_me:$LINENO: error: Package requirements ( gtk+-2.0 libpng ) were not met:
2.119 -
2.120 -$PACKAGE_PKG_ERRORS
2.121 + echo "$LIBPNG_PKG_ERRORS" >&5
2.122 +
2.123 + { { echo "$as_me:$LINENO: error: Package requirements (libpng ) were not met:
2.124 +
2.125 +$LIBPNG_PKG_ERRORS
2.126
2.127 Consider adjusting the PKG_CONFIG_PATH environment variable if you
2.128 installed software in a non-standard prefix.
2.129
2.130 -Alternatively, you may set the environment variables PACKAGE_CFLAGS
2.131 -and PACKAGE_LIBS to avoid the need to call pkg-config.
2.132 +Alternatively, you may set the environment variables LIBPNG_CFLAGS
2.133 +and LIBPNG_LIBS to avoid the need to call pkg-config.
2.134 See the pkg-config man page for more details.
2.135 " >&5
2.136 -echo "$as_me: error: Package requirements ( gtk+-2.0 libpng ) were not met:
2.137 -
2.138 -$PACKAGE_PKG_ERRORS
2.139 +echo "$as_me: error: Package requirements (libpng ) were not met:
2.140 +
2.141 +$LIBPNG_PKG_ERRORS
2.142
2.143 Consider adjusting the PKG_CONFIG_PATH environment variable if you
2.144 installed software in a non-standard prefix.
2.145
2.146 -Alternatively, you may set the environment variables PACKAGE_CFLAGS
2.147 -and PACKAGE_LIBS to avoid the need to call pkg-config.
2.148 +Alternatively, you may set the environment variables LIBPNG_CFLAGS
2.149 +and LIBPNG_LIBS to avoid the need to call pkg-config.
2.150 See the pkg-config man page for more details.
2.151 " >&2;}
2.152 { (exit 1); exit 1; }; }
2.153 @@ -5142,8 +5149,8 @@
2.154 is in your PATH or set the PKG_CONFIG environment variable to the full
2.155 path to pkg-config.
2.156
2.157 -Alternatively, you may set the environment variables PACKAGE_CFLAGS
2.158 -and PACKAGE_LIBS to avoid the need to call pkg-config.
2.159 +Alternatively, you may set the environment variables LIBPNG_CFLAGS
2.160 +and LIBPNG_LIBS to avoid the need to call pkg-config.
2.161 See the pkg-config man page for more details.
2.162
2.163 To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.
2.164 @@ -5152,181 +5159,21 @@
2.165 is in your PATH or set the PKG_CONFIG environment variable to the full
2.166 path to pkg-config.
2.167
2.168 -Alternatively, you may set the environment variables PACKAGE_CFLAGS
2.169 -and PACKAGE_LIBS to avoid the need to call pkg-config.
2.170 +Alternatively, you may set the environment variables LIBPNG_CFLAGS
2.171 +and LIBPNG_LIBS to avoid the need to call pkg-config.
2.172 See the pkg-config man page for more details.
2.173
2.174 To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.
2.175 See \`config.log' for more details." >&2;}
2.176 { (exit 1); exit 1; }; }
2.177 else
2.178 - PACKAGE_CFLAGS=$pkg_cv_PACKAGE_CFLAGS
2.179 - PACKAGE_LIBS=$pkg_cv_PACKAGE_LIBS
2.180 + LIBPNG_CFLAGS=$pkg_cv_LIBPNG_CFLAGS
2.181 + LIBPNG_LIBS=$pkg_cv_LIBPNG_LIBS
2.182 { echo "$as_me:$LINENO: result: yes" >&5
2.183 echo "${ECHO_T}yes" >&6; }
2.184 :
2.185 fi
2.186
2.187 -pkg_failed=no
2.188 -{ echo "$as_me:$LINENO: checking for ESOUND" >&5
2.189 -echo $ECHO_N "checking for ESOUND... $ECHO_C" >&6; }
2.190 -
2.191 -if test -n "$PKG_CONFIG"; then
2.192 - if test -n "$ESOUND_CFLAGS"; then
2.193 - pkg_cv_ESOUND_CFLAGS="$ESOUND_CFLAGS"
2.194 - else
2.195 - if test -n "$PKG_CONFIG" && \
2.196 - { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"esound\"") >&5
2.197 - ($PKG_CONFIG --exists --print-errors "esound") 2>&5
2.198 - ac_status=$?
2.199 - echo "$as_me:$LINENO: \$? = $ac_status" >&5
2.200 - (exit $ac_status); }; then
2.201 - pkg_cv_ESOUND_CFLAGS=`$PKG_CONFIG --cflags "esound" 2>/dev/null`
2.202 -else
2.203 - pkg_failed=yes
2.204 -fi
2.205 - fi
2.206 -else
2.207 - pkg_failed=untried
2.208 -fi
2.209 -if test -n "$PKG_CONFIG"; then
2.210 - if test -n "$ESOUND_LIBS"; then
2.211 - pkg_cv_ESOUND_LIBS="$ESOUND_LIBS"
2.212 - else
2.213 - if test -n "$PKG_CONFIG" && \
2.214 - { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"esound\"") >&5
2.215 - ($PKG_CONFIG --exists --print-errors "esound") 2>&5
2.216 - ac_status=$?
2.217 - echo "$as_me:$LINENO: \$? = $ac_status" >&5
2.218 - (exit $ac_status); }; then
2.219 - pkg_cv_ESOUND_LIBS=`$PKG_CONFIG --libs "esound" 2>/dev/null`
2.220 -else
2.221 - pkg_failed=yes
2.222 -fi
2.223 - fi
2.224 -else
2.225 - pkg_failed=untried
2.226 -fi
2.227 -
2.228 -
2.229 -
2.230 -if test $pkg_failed = yes; then
2.231 -
2.232 -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
2.233 - _pkg_short_errors_supported=yes
2.234 -else
2.235 - _pkg_short_errors_supported=no
2.236 -fi
2.237 - if test $_pkg_short_errors_supported = yes; then
2.238 - ESOUND_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "esound"`
2.239 - else
2.240 - ESOUND_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "esound"`
2.241 - fi
2.242 - # Put the nasty error message in config.log where it belongs
2.243 - echo "$ESOUND_PKG_ERRORS" >&5
2.244 -
2.245 - echo "Warning: esound not found - building without audio support"
2.246 -elif test $pkg_failed = untried; then
2.247 - echo "Warning: esound not found - building without audio support"
2.248 -else
2.249 - ESOUND_CFLAGS=$pkg_cv_ESOUND_CFLAGS
2.250 - ESOUND_LIBS=$pkg_cv_ESOUND_LIBS
2.251 - { echo "$as_me:$LINENO: result: yes" >&5
2.252 -echo "${ECHO_T}yes" >&6; }
2.253 -
2.254 - HAVE_ESOUND='yes'
2.255 -
2.256 -cat >>confdefs.h <<\_ACEOF
2.257 -#define HAVE_ESOUND 1
2.258 -_ACEOF
2.259 -
2.260 -fi
2.261 -
2.262 -
2.263 -if test "$HAVE_ESOUND" = 'yes' ; then
2.264 - AUDIO_ESOUND_TRUE=
2.265 - AUDIO_ESOUND_FALSE='#'
2.266 -else
2.267 - AUDIO_ESOUND_TRUE='#'
2.268 - AUDIO_ESOUND_FALSE=
2.269 -fi
2.270 -
2.271 -
2.272 -
2.273 -{ echo "$as_me:$LINENO: checking for uncompress in -lz" >&5
2.274 -echo $ECHO_N "checking for uncompress in -lz... $ECHO_C" >&6; }
2.275 -if test "${ac_cv_lib_z_uncompress+set}" = set; then
2.276 - echo $ECHO_N "(cached) $ECHO_C" >&6
2.277 -else
2.278 - ac_check_lib_save_LIBS=$LIBS
2.279 -LIBS="-lz $LIBS"
2.280 -cat >conftest.$ac_ext <<_ACEOF
2.281 -/* confdefs.h. */
2.282 -_ACEOF
2.283 -cat confdefs.h >>conftest.$ac_ext
2.284 -cat >>conftest.$ac_ext <<_ACEOF
2.285 -/* end confdefs.h. */
2.286 -
2.287 -/* Override any GCC internal prototype to avoid an error.
2.288 - Use char because int might match the return type of a GCC
2.289 - builtin and then its argument prototype would still apply. */
2.290 -#ifdef __cplusplus
2.291 -extern "C"
2.292 -#endif
2.293 -char uncompress ();
2.294 -int
2.295 -main ()
2.296 -{
2.297 -return uncompress ();
2.298 - ;
2.299 - return 0;
2.300 -}
2.301 -_ACEOF
2.302 -rm -f conftest.$ac_objext conftest$ac_exeext
2.303 -if { (ac_try="$ac_link"
2.304 -case "(($ac_try" in
2.305 - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
2.306 - *) ac_try_echo=$ac_try;;
2.307 -esac
2.308 -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
2.309 - (eval "$ac_link") 2>conftest.er1
2.310 - ac_status=$?
2.311 - grep -v '^ *+' conftest.er1 >conftest.err
2.312 - rm -f conftest.er1
2.313 - cat conftest.err >&5
2.314 - echo "$as_me:$LINENO: \$? = $ac_status" >&5
2.315 - (exit $ac_status); } && {
2.316 - test -z "$ac_c_werror_flag" ||
2.317 - test ! -s conftest.err
2.318 - } && test -s conftest$ac_exeext &&
2.319 - $as_test_x conftest$ac_exeext; then
2.320 - ac_cv_lib_z_uncompress=yes
2.321 -else
2.322 - echo "$as_me: failed program was:" >&5
2.323 -sed 's/^/| /' conftest.$ac_ext >&5
2.324 -
2.325 - ac_cv_lib_z_uncompress=no
2.326 -fi
2.327 -
2.328 -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
2.329 - conftest$ac_exeext conftest.$ac_ext
2.330 -LIBS=$ac_check_lib_save_LIBS
2.331 -fi
2.332 -{ echo "$as_me:$LINENO: result: $ac_cv_lib_z_uncompress" >&5
2.333 -echo "${ECHO_T}$ac_cv_lib_z_uncompress" >&6; }
2.334 -if test $ac_cv_lib_z_uncompress = yes; then
2.335 - cat >>confdefs.h <<_ACEOF
2.336 -#define HAVE_LIBZ 1
2.337 -_ACEOF
2.338 -
2.339 - LIBS="-lz $LIBS"
2.340 -
2.341 -else
2.342 -
2.343 - echo "Zlib (libz.so) could not be found, but is required."
2.344 - exit 1
2.345 -fi
2.346 -
2.347
2.348 { echo "$as_me:$LINENO: checking for glXQueryVersion in -lGL" >&5
2.349 echo $ECHO_N "checking for glXQueryVersion in -lGL... $ECHO_C" >&6; }
2.350 @@ -5606,6 +5453,203 @@
2.351
2.352
2.353
2.354 +{ echo "$as_me:$LINENO: checking for uncompress in -lz" >&5
2.355 +echo $ECHO_N "checking for uncompress in -lz... $ECHO_C" >&6; }
2.356 +if test "${ac_cv_lib_z_uncompress+set}" = set; then
2.357 + echo $ECHO_N "(cached) $ECHO_C" >&6
2.358 +else
2.359 + ac_check_lib_save_LIBS=$LIBS
2.360 +LIBS="-lz $LIBS"
2.361 +cat >conftest.$ac_ext <<_ACEOF
2.362 +/* confdefs.h. */
2.363 +_ACEOF
2.364 +cat confdefs.h >>conftest.$ac_ext
2.365 +cat >>conftest.$ac_ext <<_ACEOF
2.366 +/* end confdefs.h. */
2.367 +
2.368 +/* Override any GCC internal prototype to avoid an error.
2.369 + Use char because int might match the return type of a GCC
2.370 + builtin and then its argument prototype would still apply. */
2.371 +#ifdef __cplusplus
2.372 +extern "C"
2.373 +#endif
2.374 +char uncompress ();
2.375 +int
2.376 +main ()
2.377 +{
2.378 +return uncompress ();
2.379 + ;
2.380 + return 0;
2.381 +}
2.382 +_ACEOF
2.383 +rm -f conftest.$ac_objext conftest$ac_exeext
2.384 +if { (ac_try="$ac_link"
2.385 +case "(($ac_try" in
2.386 + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
2.387 + *) ac_try_echo=$ac_try;;
2.388 +esac
2.389 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
2.390 + (eval "$ac_link") 2>conftest.er1
2.391 + ac_status=$?
2.392 + grep -v '^ *+' conftest.er1 >conftest.err
2.393 + rm -f conftest.er1
2.394 + cat conftest.err >&5
2.395 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
2.396 + (exit $ac_status); } && {
2.397 + test -z "$ac_c_werror_flag" ||
2.398 + test ! -s conftest.err
2.399 + } && test -s conftest$ac_exeext &&
2.400 + $as_test_x conftest$ac_exeext; then
2.401 + ac_cv_lib_z_uncompress=yes
2.402 +else
2.403 + echo "$as_me: failed program was:" >&5
2.404 +sed 's/^/| /' conftest.$ac_ext >&5
2.405 +
2.406 + ac_cv_lib_z_uncompress=no
2.407 +fi
2.408 +
2.409 +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
2.410 + conftest$ac_exeext conftest.$ac_ext
2.411 +LIBS=$ac_check_lib_save_LIBS
2.412 +fi
2.413 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_z_uncompress" >&5
2.414 +echo "${ECHO_T}$ac_cv_lib_z_uncompress" >&6; }
2.415 +if test $ac_cv_lib_z_uncompress = yes; then
2.416 + cat >>confdefs.h <<_ACEOF
2.417 +#define HAVE_LIBZ 1
2.418 +_ACEOF
2.419 +
2.420 + LIBS="-lz $LIBS"
2.421 +
2.422 +else
2.423 +
2.424 + echo "Zlib (libz.so) could not be found, but is required."
2.425 + exit 1
2.426 +fi
2.427 +
2.428 +
2.429 +
2.430 +pkg_failed=no
2.431 +{ echo "$as_me:$LINENO: checking for GTK" >&5
2.432 +echo $ECHO_N "checking for GTK... $ECHO_C" >&6; }
2.433 +
2.434 +if test -n "$PKG_CONFIG"; then
2.435 + if test -n "$GTK_CFLAGS"; then
2.436 + pkg_cv_GTK_CFLAGS="$GTK_CFLAGS"
2.437 + else
2.438 + if test -n "$PKG_CONFIG" && \
2.439 + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"gtk+-2.0\"") >&5
2.440 + ($PKG_CONFIG --exists --print-errors "gtk+-2.0") 2>&5
2.441 + ac_status=$?
2.442 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
2.443 + (exit $ac_status); }; then
2.444 + pkg_cv_GTK_CFLAGS=`$PKG_CONFIG --cflags "gtk+-2.0" 2>/dev/null`
2.445 +else
2.446 + pkg_failed=yes
2.447 +fi
2.448 + fi
2.449 +else
2.450 + pkg_failed=untried
2.451 +fi
2.452 +if test -n "$PKG_CONFIG"; then
2.453 + if test -n "$GTK_LIBS"; then
2.454 + pkg_cv_GTK_LIBS="$GTK_LIBS"
2.455 + else
2.456 + if test -n "$PKG_CONFIG" && \
2.457 + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"gtk+-2.0\"") >&5
2.458 + ($PKG_CONFIG --exists --print-errors "gtk+-2.0") 2>&5
2.459 + ac_status=$?
2.460 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
2.461 + (exit $ac_status); }; then
2.462 + pkg_cv_GTK_LIBS=`$PKG_CONFIG --libs "gtk+-2.0" 2>/dev/null`
2.463 +else
2.464 + pkg_failed=yes
2.465 +fi
2.466 + fi
2.467 +else
2.468 + pkg_failed=untried
2.469 +fi
2.470 +
2.471 +
2.472 +
2.473 +if test $pkg_failed = yes; then
2.474 +
2.475 +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
2.476 + _pkg_short_errors_supported=yes
2.477 +else
2.478 + _pkg_short_errors_supported=no
2.479 +fi
2.480 + if test $_pkg_short_errors_supported = yes; then
2.481 + GTK_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "gtk+-2.0"`
2.482 + else
2.483 + GTK_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "gtk+-2.0"`
2.484 + fi
2.485 + # Put the nasty error message in config.log where it belongs
2.486 + echo "$GTK_PKG_ERRORS" >&5
2.487 +
2.488 + { { echo "$as_me:$LINENO: error: Package requirements (gtk+-2.0) were not met:
2.489 +
2.490 +$GTK_PKG_ERRORS
2.491 +
2.492 +Consider adjusting the PKG_CONFIG_PATH environment variable if you
2.493 +installed software in a non-standard prefix.
2.494 +
2.495 +Alternatively, you may set the environment variables GTK_CFLAGS
2.496 +and GTK_LIBS to avoid the need to call pkg-config.
2.497 +See the pkg-config man page for more details.
2.498 +" >&5
2.499 +echo "$as_me: error: Package requirements (gtk+-2.0) were not met:
2.500 +
2.501 +$GTK_PKG_ERRORS
2.502 +
2.503 +Consider adjusting the PKG_CONFIG_PATH environment variable if you
2.504 +installed software in a non-standard prefix.
2.505 +
2.506 +Alternatively, you may set the environment variables GTK_CFLAGS
2.507 +and GTK_LIBS to avoid the need to call pkg-config.
2.508 +See the pkg-config man page for more details.
2.509 +" >&2;}
2.510 + { (exit 1); exit 1; }; }
2.511 +elif test $pkg_failed = untried; then
2.512 + { { echo "$as_me:$LINENO: error: The pkg-config script could not be found or is too old. Make sure it
2.513 +is in your PATH or set the PKG_CONFIG environment variable to the full
2.514 +path to pkg-config.
2.515 +
2.516 +Alternatively, you may set the environment variables GTK_CFLAGS
2.517 +and GTK_LIBS to avoid the need to call pkg-config.
2.518 +See the pkg-config man page for more details.
2.519 +
2.520 +To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.
2.521 +See \`config.log' for more details." >&5
2.522 +echo "$as_me: error: The pkg-config script could not be found or is too old. Make sure it
2.523 +is in your PATH or set the PKG_CONFIG environment variable to the full
2.524 +path to pkg-config.
2.525 +
2.526 +Alternatively, you may set the environment variables GTK_CFLAGS
2.527 +and GTK_LIBS to avoid the need to call pkg-config.
2.528 +See the pkg-config man page for more details.
2.529 +
2.530 +To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.
2.531 +See \`config.log' for more details." >&2;}
2.532 + { (exit 1); exit 1; }; }
2.533 +else
2.534 + GTK_CFLAGS=$pkg_cv_GTK_CFLAGS
2.535 + GTK_LIBS=$pkg_cv_GTK_LIBS
2.536 + { echo "$as_me:$LINENO: result: yes" >&5
2.537 +echo "${ECHO_T}yes" >&6; }
2.538 + HAVE_GTK='yes'
2.539 +fi
2.540 +
2.541 +
2.542 +if test "$HAVE_GTK" = 'yes'; then
2.543 + GUI_GTK_TRUE=
2.544 + GUI_GTK_FALSE='#'
2.545 +else
2.546 + GUI_GTK_TRUE='#'
2.547 + GUI_GTK_FALSE=
2.548 +fi
2.549 +
2.550 +
2.551 case $host_cpu in
2.552 i386|i486|i586|i686)
2.553 SH4_TRANSLATOR="x86"
2.554 @@ -5635,6 +5679,92 @@
2.555 fi
2.556
2.557
2.558 +
2.559 +pkg_failed=no
2.560 +{ echo "$as_me:$LINENO: checking for ESOUND" >&5
2.561 +echo $ECHO_N "checking for ESOUND... $ECHO_C" >&6; }
2.562 +
2.563 +if test -n "$PKG_CONFIG"; then
2.564 + if test -n "$ESOUND_CFLAGS"; then
2.565 + pkg_cv_ESOUND_CFLAGS="$ESOUND_CFLAGS"
2.566 + else
2.567 + if test -n "$PKG_CONFIG" && \
2.568 + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"esound\"") >&5
2.569 + ($PKG_CONFIG --exists --print-errors "esound") 2>&5
2.570 + ac_status=$?
2.571 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
2.572 + (exit $ac_status); }; then
2.573 + pkg_cv_ESOUND_CFLAGS=`$PKG_CONFIG --cflags "esound" 2>/dev/null`
2.574 +else
2.575 + pkg_failed=yes
2.576 +fi
2.577 + fi
2.578 +else
2.579 + pkg_failed=untried
2.580 +fi
2.581 +if test -n "$PKG_CONFIG"; then
2.582 + if test -n "$ESOUND_LIBS"; then
2.583 + pkg_cv_ESOUND_LIBS="$ESOUND_LIBS"
2.584 + else
2.585 + if test -n "$PKG_CONFIG" && \
2.586 + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"esound\"") >&5
2.587 + ($PKG_CONFIG --exists --print-errors "esound") 2>&5
2.588 + ac_status=$?
2.589 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
2.590 + (exit $ac_status); }; then
2.591 + pkg_cv_ESOUND_LIBS=`$PKG_CONFIG --libs "esound" 2>/dev/null`
2.592 +else
2.593 + pkg_failed=yes
2.594 +fi
2.595 + fi
2.596 +else
2.597 + pkg_failed=untried
2.598 +fi
2.599 +
2.600 +
2.601 +
2.602 +if test $pkg_failed = yes; then
2.603 +
2.604 +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
2.605 + _pkg_short_errors_supported=yes
2.606 +else
2.607 + _pkg_short_errors_supported=no
2.608 +fi
2.609 + if test $_pkg_short_errors_supported = yes; then
2.610 + ESOUND_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "esound"`
2.611 + else
2.612 + ESOUND_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "esound"`
2.613 + fi
2.614 + # Put the nasty error message in config.log where it belongs
2.615 + echo "$ESOUND_PKG_ERRORS" >&5
2.616 +
2.617 + echo "Warning: esound not found - building without audio support"
2.618 +elif test $pkg_failed = untried; then
2.619 + echo "Warning: esound not found - building without audio support"
2.620 +else
2.621 + ESOUND_CFLAGS=$pkg_cv_ESOUND_CFLAGS
2.622 + ESOUND_LIBS=$pkg_cv_ESOUND_LIBS
2.623 + { echo "$as_me:$LINENO: result: yes" >&5
2.624 +echo "${ECHO_T}yes" >&6; }
2.625 +
2.626 + HAVE_ESOUND='yes'
2.627 +
2.628 +cat >>confdefs.h <<\_ACEOF
2.629 +#define HAVE_ESOUND 1
2.630 +_ACEOF
2.631 +
2.632 +fi
2.633 +
2.634 +
2.635 +if test "$HAVE_ESOUND" = 'yes' ; then
2.636 + AUDIO_ESOUND_TRUE=
2.637 + AUDIO_ESOUND_FALSE='#'
2.638 +else
2.639 + AUDIO_ESOUND_TRUE='#'
2.640 + AUDIO_ESOUND_FALSE=
2.641 +fi
2.642 +
2.643 +
2.644 if test "${ac_cv_header_linux_cdrom_h+set}" = set; then
2.645 { echo "$as_me:$LINENO: checking for linux/cdrom.h" >&5
2.646 echo $ECHO_N "checking for linux/cdrom.h... $ECHO_C" >&6; }
2.647 @@ -6053,6 +6183,7 @@
2.648 fi
2.649
2.650
2.651 +
2.652 GETTEXT_PACKAGE=lxdream
2.653
2.654
2.655 @@ -6061,9 +6192,6 @@
2.656 _ACEOF
2.657
2.658
2.659 -
2.660 -
2.661 -
2.662 ALL_LINGUAS="de pt_BR"
2.663
2.664
2.665 @@ -7679,6 +7807,20 @@
2.666 Usually this means the macro was only invoked conditionally." >&2;}
2.667 { (exit 1); exit 1; }; }
2.668 fi
2.669 +if test -z "${GUI_GTK_TRUE}" && test -z "${GUI_GTK_FALSE}"; then
2.670 + { { echo "$as_me:$LINENO: error: conditional \"GUI_GTK\" was never defined.
2.671 +Usually this means the macro was only invoked conditionally." >&5
2.672 +echo "$as_me: error: conditional \"GUI_GTK\" was never defined.
2.673 +Usually this means the macro was only invoked conditionally." >&2;}
2.674 + { (exit 1); exit 1; }; }
2.675 +fi
2.676 +if test -z "${BUILD_SH4X86_TRUE}" && test -z "${BUILD_SH4X86_FALSE}"; then
2.677 + { { echo "$as_me:$LINENO: error: conditional \"BUILD_SH4X86\" was never defined.
2.678 +Usually this means the macro was only invoked conditionally." >&5
2.679 +echo "$as_me: error: conditional \"BUILD_SH4X86\" was never defined.
2.680 +Usually this means the macro was only invoked conditionally." >&2;}
2.681 + { (exit 1); exit 1; }; }
2.682 +fi
2.683 if test -z "${AUDIO_ESOUND_TRUE}" && test -z "${AUDIO_ESOUND_FALSE}"; then
2.684 { { echo "$as_me:$LINENO: error: conditional \"AUDIO_ESOUND\" was never defined.
2.685 Usually this means the macro was only invoked conditionally." >&5
2.686 @@ -7686,13 +7828,6 @@
2.687 Usually this means the macro was only invoked conditionally." >&2;}
2.688 { (exit 1); exit 1; }; }
2.689 fi
2.690 -if test -z "${BUILD_SH4X86_TRUE}" && test -z "${BUILD_SH4X86_FALSE}"; then
2.691 - { { echo "$as_me:$LINENO: error: conditional \"BUILD_SH4X86\" was never defined.
2.692 -Usually this means the macro was only invoked conditionally." >&5
2.693 -echo "$as_me: error: conditional \"BUILD_SH4X86\" was never defined.
2.694 -Usually this means the macro was only invoked conditionally." >&2;}
2.695 - { (exit 1); exit 1; }; }
2.696 -fi
2.697 if test -z "${CDROM_LINUX_TRUE}" && test -z "${CDROM_LINUX_FALSE}"; then
2.698 { { echo "$as_me:$LINENO: error: conditional \"CDROM_LINUX\" was never defined.
2.699 Usually this means the macro was only invoked conditionally." >&5
2.700 @@ -8336,17 +8471,17 @@
2.701 host_vendor!$host_vendor$ac_delim
2.702 host_os!$host_os$ac_delim
2.703 PKG_CONFIG!$PKG_CONFIG$ac_delim
2.704 -PACKAGE_CFLAGS!$PACKAGE_CFLAGS$ac_delim
2.705 -PACKAGE_LIBS!$PACKAGE_LIBS$ac_delim
2.706 +LIBPNG_CFLAGS!$LIBPNG_CFLAGS$ac_delim
2.707 +LIBPNG_LIBS!$LIBPNG_LIBS$ac_delim
2.708 +GTK_CFLAGS!$GTK_CFLAGS$ac_delim
2.709 +GTK_LIBS!$GTK_LIBS$ac_delim
2.710 +GUI_GTK_TRUE!$GUI_GTK_TRUE$ac_delim
2.711 +GUI_GTK_FALSE!$GUI_GTK_FALSE$ac_delim
2.712 +BUILD_SH4X86_TRUE!$BUILD_SH4X86_TRUE$ac_delim
2.713 +BUILD_SH4X86_FALSE!$BUILD_SH4X86_FALSE$ac_delim
2.714 ESOUND_CFLAGS!$ESOUND_CFLAGS$ac_delim
2.715 ESOUND_LIBS!$ESOUND_LIBS$ac_delim
2.716 AUDIO_ESOUND_TRUE!$AUDIO_ESOUND_TRUE$ac_delim
2.717 -AUDIO_ESOUND_FALSE!$AUDIO_ESOUND_FALSE$ac_delim
2.718 -BUILD_SH4X86_TRUE!$BUILD_SH4X86_TRUE$ac_delim
2.719 -BUILD_SH4X86_FALSE!$BUILD_SH4X86_FALSE$ac_delim
2.720 -CDROM_LINUX_TRUE!$CDROM_LINUX_TRUE$ac_delim
2.721 -CDROM_LINUX_FALSE!$CDROM_LINUX_FALSE$ac_delim
2.722 -SHCC!$SHCC$ac_delim
2.723 _ACEOF
2.724
2.725 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
2.726 @@ -8388,6 +8523,10 @@
2.727 ac_delim='%!_!# '
2.728 for ac_last_try in false false false false false :; do
2.729 cat >conf$$subs.sed <<_ACEOF
2.730 +AUDIO_ESOUND_FALSE!$AUDIO_ESOUND_FALSE$ac_delim
2.731 +CDROM_LINUX_TRUE!$CDROM_LINUX_TRUE$ac_delim
2.732 +CDROM_LINUX_FALSE!$CDROM_LINUX_FALSE$ac_delim
2.733 +SHCC!$SHCC$ac_delim
2.734 SHLD!$SHLD$ac_delim
2.735 SHOBJCOPY!$SHOBJCOPY$ac_delim
2.736 ARMCC!$ARMCC$ac_delim
2.737 @@ -8417,7 +8556,7 @@
2.738 LTLIBOBJS!$LTLIBOBJS$ac_delim
2.739 _ACEOF
2.740
2.741 - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 27; then
2.742 + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 31; then
2.743 break
2.744 elif $ac_last_try; then
2.745 { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
3.1 --- a/configure.in Tue Nov 20 09:42:03 2007 +0000
3.2 +++ b/configure.in Tue Nov 20 10:27:58 2007 +0000
3.3 @@ -12,24 +12,24 @@
3.4 AC_CANONICAL_BUILD
3.5 AC_CANONICAL_HOST
3.6
3.7 -PKG_CHECK_MODULES(PACKAGE,
3.8 - [ gtk+-2.0 dnl
3.9 - libpng ])
3.10 -PKG_CHECK_MODULES(ESOUND, [esound], [
3.11 - HAVE_ESOUND='yes'
3.12 - AC_DEFINE([HAVE_ESOUND],1,[Have esound support]) ],
3.13 - [ echo "Warning: esound not found - building without audio support" ])
3.14 -AM_CONDITIONAL( AUDIO_ESOUND, [test "$HAVE_ESOUND" = 'yes'] )
3.15 +dnl ----------- Check for mandatory dependencies --------------
3.16 +dnl Check for libpng (required)
3.17 +PKG_CHECK_MODULES(LIBPNG, [libpng] )
3.18
3.19 -AC_CHECK_LIB(z, uncompress, [], [
3.20 - echo "Zlib (libz.so) could not be found, but is required."
3.21 - exit 1])
3.22 AC_CHECK_LIB(GL, glXQueryVersion, [], [
3.23 echo "The OpenGL library (libGL.so) could not be found, but is required."
3.24 exit 1])
3.25 AC_CHECK_HEADER([GL/gl.h], [], [
3.26 echo "The OpenGL header files (eg GL/gl.h) could not be found, but are required."
3.27 exit 1])
3.28 +dnl Implied by libpng, but check explicitly just in case
3.29 +AC_CHECK_LIB(z, uncompress, [], [
3.30 + echo "Zlib (libz.so) could not be found, but is required."
3.31 + exit 1])
3.32 +
3.33 +dnl Check for GTK (required for unix systems)
3.34 +PKG_CHECK_MODULES(GTK, gtk+-2.0, [HAVE_GTK='yes'])
3.35 +AM_CONDITIONAL(GUI_GTK, [test "$HAVE_GTK" = 'yes'])
3.36
3.37 dnl Check for a supported cpu target for translation purposes
3.38 case $host_cpu in
3.39 @@ -44,12 +44,20 @@
3.40 esac
3.41 AM_CONDITIONAL(BUILD_SH4X86, [test "$SH4_TRANSLATOR" = "x86" -o "$SH4_TRANSLATOR" = "x86_64"])
3.42
3.43 -dnl Check for cdrom device support
3.44 +dnl ------------------ Optional driver support -------------------
3.45 +dnl Check for esound
3.46 +PKG_CHECK_MODULES(ESOUND, [esound], [
3.47 + HAVE_ESOUND='yes'
3.48 + AC_DEFINE([HAVE_ESOUND],1,[Have esound support]) ],
3.49 + [ echo "Warning: esound not found - building without audio support" ])
3.50 +AM_CONDITIONAL( AUDIO_ESOUND, [test "$HAVE_ESOUND" = 'yes'] )
3.51 +
3.52 +dnl Check for linux cdrom device support
3.53 AC_CHECK_HEADER([linux/cdrom.h], [HAVE_LINUX_CDROM_H=yes], [
3.54 echo "Linux CDROM support not found, building without it."] )
3.55 AM_CONDITIONAL(CDROM_LINUX, [test "$HAVE_LINUX_CDROM_H" = "yes"])
3.56
3.57 -dnl Check for cross-compiler availability
3.58 +dnl Check for cross-compiler availability - needed for system tests
3.59 AC_PATH_PROG(SHCC, [sh-elf-gcc])
3.60 AC_PATH_PROG(SHLD, [sh-elf-ld])
3.61 AC_PATH_PROG(SHOBJCOPY, [sh-elf-objcopy])
3.62 @@ -72,12 +80,11 @@
3.63 AM_CONDITIONAL(BUILD_SYSTEST, [test "$BUILD_SH" = "yes"])
3.64 AM_CONDITIONAL(BUILD_ARMTEST, [test "$BUILD_ARM" = "yes"])
3.65
3.66 +
3.67 +dnl ----------------------- All done, finish up -----------------------
3.68 GETTEXT_PACKAGE=lxdream
3.69 AC_SUBST(GETTEXT_PACKAGE)
3.70 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[translation domain])
3.71 -AC_SUBST(PACKAGE_CFLAGS)
3.72 -AC_SUBST(PACKAGE_LIBS)
3.73 -
3.74
3.75 dnl Add the languages which your application supports here.
3.76 ALL_LINGUAS="de pt_BR"
4.1 --- a/src/Makefile.am Tue Nov 20 09:42:03 2007 +0000
4.2 +++ b/src/Makefile.am Tue Nov 20 10:27:58 2007 +0000
4.3 @@ -5,7 +5,7 @@
4.4 -DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
4.5 -DPACKAGE_CONF_DIR=\""$(sysconfdir)"\" \
4.6 -Ish4 \
4.7 - @PACKAGE_CFLAGS@ @ESOUND_CFLAGS@
4.8 + @GTK_CFLAGS@ @LIBPNG_CFLAGS@ @ESOUND_CFLAGS@
4.9
4.10 bin_PROGRAMS = lxdream
4.11 noinst_PROGRAMS = gendec genglsl
4.12 @@ -34,14 +34,9 @@
4.13 pvr2/texcache.c pvr2/yuv.c pvr2/rendsave.c \
4.14 maple/maple.c maple/maple.h \
4.15 maple/controller.c maple/controller.h \
4.16 - gui/gtkui.c gui/gtkui.h gui/main_win.c gui/gtkcb.c \
4.17 - gui/mmio_win.c gui/debug_win.c gui/dump_win.c \
4.18 - gui/ctrl_dlg.c gui/path_dlg.c gui/gdrom_menu.c \
4.19 loader.c bootstrap.c util.c \
4.20 display.c display.h \
4.21 - drivers/audio_null.c \
4.22 - drivers/video_null.c drivers/video_gtk.c drivers/video_gtk.h \
4.23 - drivers/video_x11.c drivers/video_x11.h \
4.24 + drivers/audio_null.c drivers/video_null.c \
4.25 drivers/gl_common.c drivers/gl_common.h drivers/gl_fbo.c \
4.26 drivers/gl_sl.c drivers/gl_slsrc.c
4.27
4.28 @@ -52,6 +47,15 @@
4.29 x86dasm/i386-dis.c x86dasm/dis-init.c x86dasm/dis-buf.c
4.30 endif
4.31
4.32 +if GUI_GTK
4.33 +lxdream_SOURCES += gtkui/gtkui.c gtkui/gtkui.h \
4.34 + gtkui/main_win.c gtkui/gtkcb.c \
4.35 + gtkui/mmio_win.c gtkui/debug_win.c gtkui/dump_win.c \
4.36 + gtkui/ctrl_dlg.c gtkui/path_dlg.c gtkui/gdrom_menu.c \
4.37 + drivers/video_gtk.c drivers/video_gtk.h \
4.38 + drivers/video_x11.c drivers/video_x11.h
4.39 +endif
4.40 +
4.41 if CDROM_LINUX
4.42 lxdream_SOURCES += drivers/cd_linux.c
4.43 else
4.44 @@ -62,10 +66,10 @@
4.45 lxdream_SOURCES += drivers/audio_esd.c
4.46 endif
4.47
4.48 -lxdream_LDADD = @PACKAGE_LIBS@ @ESOUND_LIBS@ $(INTLLIBS)
4.49 +lxdream_LDADD = @GTK_LIBS@ @LIBPNG_LIBS@ @ESOUND_LIBS@ $(INTLLIBS)
4.50
4.51 -gendec_LDADD = @PACKAGE_LIBS@ $(INTLLIBS)
4.52 -genglsl_LDADD = @PACKAGE_LIBS@ $(INTLLIBS)
4.53 +gendec_LDADD = @GTK_LIBS@ $(INTLLIBS)
4.54 +genglsl_LDADD = @GTK_LIBS@ $(INTLLIBS)
4.55
4.56 TESTS = test/testxlt
4.57
5.1 --- a/src/Makefile.in Tue Nov 20 09:42:03 2007 +0000
5.2 +++ b/src/Makefile.in Tue Nov 20 10:27:58 2007 +0000
5.3 @@ -41,9 +41,16 @@
5.4 @BUILD_SH4X86_TRUE@ x86dasm/x86dasm.c x86dasm/x86dasm.h \
5.5 @BUILD_SH4X86_TRUE@ x86dasm/i386-dis.c x86dasm/dis-init.c x86dasm/dis-buf.c
5.6
5.7 -@CDROM_LINUX_TRUE@am__append_2 = drivers/cd_linux.c
5.8 -@CDROM_LINUX_FALSE@am__append_3 = drivers/cd_none.c
5.9 -@AUDIO_ESOUND_TRUE@am__append_4 = drivers/audio_esd.c
5.10 +@GUI_GTK_TRUE@am__append_2 = gtkui/gtkui.c gtkui/gtkui.h \
5.11 +@GUI_GTK_TRUE@ gtkui/main_win.c gtkui/gtkcb.c \
5.12 +@GUI_GTK_TRUE@ gtkui/mmio_win.c gtkui/debug_win.c gtkui/dump_win.c \
5.13 +@GUI_GTK_TRUE@ gtkui/ctrl_dlg.c gtkui/path_dlg.c gtkui/gdrom_menu.c \
5.14 +@GUI_GTK_TRUE@ drivers/video_gtk.c drivers/video_gtk.h \
5.15 +@GUI_GTK_TRUE@ drivers/video_x11.c drivers/video_x11.h
5.16 +
5.17 +@CDROM_LINUX_TRUE@am__append_3 = drivers/cd_linux.c
5.18 +@CDROM_LINUX_FALSE@am__append_4 = drivers/cd_none.c
5.19 +@AUDIO_ESOUND_TRUE@am__append_5 = drivers/audio_esd.c
5.20 ACLOCAL = @ACLOCAL@
5.21 AMDEP_FALSE = @AMDEP_FALSE@
5.22 AMDEP_TRUE = @AMDEP_TRUE@
5.23 @@ -87,6 +94,10 @@
5.24 GMOFILES = @GMOFILES@
5.25 GMSGFMT = @GMSGFMT@
5.26 GREP = @GREP@
5.27 +GTK_CFLAGS = @GTK_CFLAGS@
5.28 +GTK_LIBS = @GTK_LIBS@
5.29 +GUI_GTK_FALSE = @GUI_GTK_FALSE@
5.30 +GUI_GTK_TRUE = @GUI_GTK_TRUE@
5.31 INSTALL_DATA = @INSTALL_DATA@
5.32 INSTALL_PROGRAM = @INSTALL_PROGRAM@
5.33 INSTALL_SCRIPT = @INSTALL_SCRIPT@
5.34 @@ -95,6 +106,8 @@
5.35 INTLLIBS = @INTLLIBS@
5.36 LDFLAGS = @LDFLAGS@
5.37 LIBOBJS = @LIBOBJS@
5.38 +LIBPNG_CFLAGS = @LIBPNG_CFLAGS@
5.39 +LIBPNG_LIBS = @LIBPNG_LIBS@
5.40 LIBS = @LIBS@
5.41 LTLIBOBJS = @LTLIBOBJS@
5.42 MAINT = @MAINT@
5.43 @@ -106,8 +119,6 @@
5.44 OBJEXT = @OBJEXT@
5.45 PACKAGE = @PACKAGE@
5.46 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
5.47 -PACKAGE_CFLAGS = @PACKAGE_CFLAGS@
5.48 -PACKAGE_LIBS = @PACKAGE_LIBS@
5.49 PACKAGE_NAME = @PACKAGE_NAME@
5.50 PACKAGE_STRING = @PACKAGE_STRING@
5.51 PACKAGE_TARNAME = @PACKAGE_TARNAME@
5.52 @@ -173,7 +184,7 @@
5.53 -DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
5.54 -DPACKAGE_CONF_DIR=\""$(sysconfdir)"\" \
5.55 -Ish4 \
5.56 - @PACKAGE_CFLAGS@ @ESOUND_CFLAGS@
5.57 + @GTK_CFLAGS@ @LIBPNG_CFLAGS@ @ESOUND_CFLAGS@
5.58
5.59
5.60 bin_PROGRAMS = lxdream
5.61 @@ -203,22 +214,17 @@
5.62 pvr2/texcache.c pvr2/yuv.c pvr2/rendsave.c \
5.63 maple/maple.c maple/maple.h \
5.64 maple/controller.c maple/controller.h \
5.65 - gui/gtkui.c gui/gtkui.h gui/main_win.c gui/gtkcb.c \
5.66 - gui/mmio_win.c gui/debug_win.c gui/dump_win.c \
5.67 - gui/ctrl_dlg.c gui/path_dlg.c gui/gdrom_menu.c \
5.68 loader.c bootstrap.c util.c \
5.69 display.c display.h \
5.70 - drivers/audio_null.c \
5.71 - drivers/video_null.c drivers/video_gtk.c drivers/video_gtk.h \
5.72 - drivers/video_x11.c drivers/video_x11.h \
5.73 + drivers/audio_null.c drivers/video_null.c \
5.74 drivers/gl_common.c drivers/gl_common.h drivers/gl_fbo.c \
5.75 drivers/gl_sl.c drivers/gl_slsrc.c\
5.76 -$(am__append_1) $(am__append_2) $(am__append_3) $(am__append_4)
5.77 +$(am__append_1) $(am__append_2) $(am__append_3) $(am__append_4) $(am__append_5)
5.78
5.79 -lxdream_LDADD = @PACKAGE_LIBS@ @ESOUND_LIBS@ $(INTLLIBS)
5.80 +lxdream_LDADD = @GTK_LIBS@ @LIBPNG_LIBS@ @ESOUND_LIBS@ $(INTLLIBS)
5.81
5.82 -gendec_LDADD = @PACKAGE_LIBS@ $(INTLLIBS)
5.83 -genglsl_LDADD = @PACKAGE_LIBS@ $(INTLLIBS)
5.84 +gendec_LDADD = @GTK_LIBS@ $(INTLLIBS)
5.85 +genglsl_LDADD = @GTK_LIBS@ $(INTLLIBS)
5.86
5.87 TESTS = test/testxlt
5.88
5.89 @@ -268,23 +274,30 @@
5.90 pvr2/pvr2mem.c pvr2/tacore.c pvr2/render.c pvr2/rendcore.c \
5.91 pvr2/rendbkg.c pvr2/rendsort.c pvr2/texcache.c pvr2/yuv.c \
5.92 pvr2/rendsave.c maple/maple.c maple/maple.h maple/controller.c \
5.93 - maple/controller.h gui/gtkui.c gui/gtkui.h gui/main_win.c \
5.94 - gui/gtkcb.c gui/mmio_win.c gui/debug_win.c gui/dump_win.c \
5.95 - gui/ctrl_dlg.c gui/path_dlg.c gui/gdrom_menu.c loader.c \
5.96 - bootstrap.c util.c display.c display.h drivers/audio_null.c \
5.97 - drivers/video_null.c drivers/video_gtk.c drivers/video_gtk.h \
5.98 - drivers/video_x11.c drivers/video_x11.h drivers/gl_common.c \
5.99 - drivers/gl_common.h drivers/gl_fbo.c drivers/gl_sl.c \
5.100 - drivers/gl_slsrc.c sh4/sh4x86.c sh4/sh4trans.c sh4/sh4trans.h \
5.101 - x86dasm/x86dasm.c x86dasm/x86dasm.h x86dasm/i386-dis.c \
5.102 - x86dasm/dis-init.c x86dasm/dis-buf.c drivers/cd_linux.c \
5.103 - drivers/cd_none.c drivers/audio_esd.c
5.104 + maple/controller.h loader.c bootstrap.c util.c display.c \
5.105 + display.h drivers/audio_null.c drivers/video_null.c \
5.106 + drivers/gl_common.c drivers/gl_common.h drivers/gl_fbo.c \
5.107 + drivers/gl_sl.c drivers/gl_slsrc.c sh4/sh4x86.c sh4/sh4trans.c \
5.108 + sh4/sh4trans.h x86dasm/x86dasm.c x86dasm/x86dasm.h \
5.109 + x86dasm/i386-dis.c x86dasm/dis-init.c x86dasm/dis-buf.c \
5.110 + gtkui/gtkui.c gtkui/gtkui.h gtkui/main_win.c gtkui/gtkcb.c \
5.111 + gtkui/mmio_win.c gtkui/debug_win.c gtkui/dump_win.c \
5.112 + gtkui/ctrl_dlg.c gtkui/path_dlg.c gtkui/gdrom_menu.c \
5.113 + drivers/video_gtk.c drivers/video_gtk.h drivers/video_x11.c \
5.114 + drivers/video_x11.h drivers/cd_linux.c drivers/cd_none.c \
5.115 + drivers/audio_esd.c
5.116 @BUILD_SH4X86_TRUE@am__objects_1 = sh4x86.$(OBJEXT) sh4trans.$(OBJEXT) \
5.117 @BUILD_SH4X86_TRUE@ x86dasm.$(OBJEXT) i386-dis.$(OBJEXT) \
5.118 @BUILD_SH4X86_TRUE@ dis-init.$(OBJEXT) dis-buf.$(OBJEXT)
5.119 -@CDROM_LINUX_TRUE@am__objects_2 = cd_linux.$(OBJEXT)
5.120 -@CDROM_LINUX_FALSE@am__objects_3 = cd_none.$(OBJEXT)
5.121 -@AUDIO_ESOUND_TRUE@am__objects_4 = audio_esd.$(OBJEXT)
5.122 +@GUI_GTK_TRUE@am__objects_2 = gtkui.$(OBJEXT) main_win.$(OBJEXT) \
5.123 +@GUI_GTK_TRUE@ gtkcb.$(OBJEXT) mmio_win.$(OBJEXT) \
5.124 +@GUI_GTK_TRUE@ debug_win.$(OBJEXT) dump_win.$(OBJEXT) \
5.125 +@GUI_GTK_TRUE@ ctrl_dlg.$(OBJEXT) path_dlg.$(OBJEXT) \
5.126 +@GUI_GTK_TRUE@ gdrom_menu.$(OBJEXT) video_gtk.$(OBJEXT) \
5.127 +@GUI_GTK_TRUE@ video_x11.$(OBJEXT)
5.128 +@CDROM_LINUX_TRUE@am__objects_3 = cd_linux.$(OBJEXT)
5.129 +@CDROM_LINUX_FALSE@am__objects_4 = cd_none.$(OBJEXT)
5.130 +@AUDIO_ESOUND_TRUE@am__objects_5 = audio_esd.$(OBJEXT)
5.131 am_lxdream_OBJECTS = main.$(OBJEXT) config.$(OBJEXT) mem.$(OBJEXT) \
5.132 watch.$(OBJEXT) asic.$(OBJEXT) syscall.$(OBJEXT) bios.$(OBJEXT) \
5.133 dcload.$(OBJEXT) ide.$(OBJEXT) gdimage.$(OBJEXT) \
5.134 @@ -298,15 +311,12 @@
5.135 tacore.$(OBJEXT) render.$(OBJEXT) rendcore.$(OBJEXT) \
5.136 rendbkg.$(OBJEXT) rendsort.$(OBJEXT) texcache.$(OBJEXT) \
5.137 yuv.$(OBJEXT) rendsave.$(OBJEXT) maple.$(OBJEXT) \
5.138 - controller.$(OBJEXT) gtkui.$(OBJEXT) main_win.$(OBJEXT) \
5.139 - gtkcb.$(OBJEXT) mmio_win.$(OBJEXT) debug_win.$(OBJEXT) \
5.140 - dump_win.$(OBJEXT) ctrl_dlg.$(OBJEXT) path_dlg.$(OBJEXT) \
5.141 - gdrom_menu.$(OBJEXT) loader.$(OBJEXT) bootstrap.$(OBJEXT) \
5.142 + controller.$(OBJEXT) loader.$(OBJEXT) bootstrap.$(OBJEXT) \
5.143 util.$(OBJEXT) display.$(OBJEXT) audio_null.$(OBJEXT) \
5.144 - video_null.$(OBJEXT) video_gtk.$(OBJEXT) video_x11.$(OBJEXT) \
5.145 - gl_common.$(OBJEXT) gl_fbo.$(OBJEXT) gl_sl.$(OBJEXT) \
5.146 - gl_slsrc.$(OBJEXT) $(am__objects_1) $(am__objects_2) \
5.147 - $(am__objects_3) $(am__objects_4)
5.148 + video_null.$(OBJEXT) gl_common.$(OBJEXT) gl_fbo.$(OBJEXT) \
5.149 + gl_sl.$(OBJEXT) gl_slsrc.$(OBJEXT) $(am__objects_1) \
5.150 + $(am__objects_2) $(am__objects_3) $(am__objects_4) \
5.151 + $(am__objects_5)
5.152 lxdream_OBJECTS = $(am_lxdream_OBJECTS)
5.153 lxdream_DEPENDENCIES =
5.154 lxdream_LDFLAGS =
5.155 @@ -1381,204 +1391,6 @@
5.156 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
5.157 @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`
5.158
5.159 -gtkui.o: gui/gtkui.c
5.160 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gtkui.o -MD -MP -MF "$(DEPDIR)/gtkui.Tpo" \
5.161 -@am__fastdepCC_TRUE@ -c -o gtkui.o `test -f 'gui/gtkui.c' || echo '$(srcdir)/'`gui/gtkui.c; \
5.162 -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/gtkui.Tpo" "$(DEPDIR)/gtkui.Po"; \
5.163 -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/gtkui.Tpo"; exit 1; \
5.164 -@am__fastdepCC_TRUE@ fi
5.165 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gui/gtkui.c' object='gtkui.o' libtool=no @AMDEPBACKSLASH@
5.166 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/gtkui.Po' tmpdepfile='$(DEPDIR)/gtkui.TPo' @AMDEPBACKSLASH@
5.167 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
5.168 -@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
5.169 -
5.170 -gtkui.obj: gui/gtkui.c
5.171 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gtkui.obj -MD -MP -MF "$(DEPDIR)/gtkui.Tpo" \
5.172 -@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`; \
5.173 -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/gtkui.Tpo" "$(DEPDIR)/gtkui.Po"; \
5.174 -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/gtkui.Tpo"; exit 1; \
5.175 -@am__fastdepCC_TRUE@ fi
5.176 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gui/gtkui.c' object='gtkui.obj' libtool=no @AMDEPBACKSLASH@
5.177 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/gtkui.Po' tmpdepfile='$(DEPDIR)/gtkui.TPo' @AMDEPBACKSLASH@
5.178 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
5.179 -@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`
5.180 -
5.181 -main_win.o: gui/main_win.c
5.182 -@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" \
5.183 -@am__fastdepCC_TRUE@ -c -o main_win.o `test -f 'gui/main_win.c' || echo '$(srcdir)/'`gui/main_win.c; \
5.184 -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/main_win.Tpo" "$(DEPDIR)/main_win.Po"; \
5.185 -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/main_win.Tpo"; exit 1; \
5.186 -@am__fastdepCC_TRUE@ fi
5.187 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gui/main_win.c' object='main_win.o' libtool=no @AMDEPBACKSLASH@
5.188 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/main_win.Po' tmpdepfile='$(DEPDIR)/main_win.TPo' @AMDEPBACKSLASH@
5.189 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
5.190 -@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
5.191 -
5.192 -main_win.obj: gui/main_win.c
5.193 -@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" \
5.194 -@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`; \
5.195 -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/main_win.Tpo" "$(DEPDIR)/main_win.Po"; \
5.196 -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/main_win.Tpo"; exit 1; \
5.197 -@am__fastdepCC_TRUE@ fi
5.198 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gui/main_win.c' object='main_win.obj' libtool=no @AMDEPBACKSLASH@
5.199 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/main_win.Po' tmpdepfile='$(DEPDIR)/main_win.TPo' @AMDEPBACKSLASH@
5.200 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
5.201 -@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`
5.202 -
5.203 -gtkcb.o: gui/gtkcb.c
5.204 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gtkcb.o -MD -MP -MF "$(DEPDIR)/gtkcb.Tpo" \
5.205 -@am__fastdepCC_TRUE@ -c -o gtkcb.o `test -f 'gui/gtkcb.c' || echo '$(srcdir)/'`gui/gtkcb.c; \
5.206 -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/gtkcb.Tpo" "$(DEPDIR)/gtkcb.Po"; \
5.207 -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/gtkcb.Tpo"; exit 1; \
5.208 -@am__fastdepCC_TRUE@ fi
5.209 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gui/gtkcb.c' object='gtkcb.o' libtool=no @AMDEPBACKSLASH@
5.210 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/gtkcb.Po' tmpdepfile='$(DEPDIR)/gtkcb.TPo' @AMDEPBACKSLASH@
5.211 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
5.212 -@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
5.213 -
5.214 -gtkcb.obj: gui/gtkcb.c
5.215 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gtkcb.obj -MD -MP -MF "$(DEPDIR)/gtkcb.Tpo" \
5.216 -@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`; \
5.217 -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/gtkcb.Tpo" "$(DEPDIR)/gtkcb.Po"; \
5.218 -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/gtkcb.Tpo"; exit 1; \
5.219 -@am__fastdepCC_TRUE@ fi
5.220 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gui/gtkcb.c' object='gtkcb.obj' libtool=no @AMDEPBACKSLASH@
5.221 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/gtkcb.Po' tmpdepfile='$(DEPDIR)/gtkcb.TPo' @AMDEPBACKSLASH@
5.222 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
5.223 -@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`
5.224 -
5.225 -mmio_win.o: gui/mmio_win.c
5.226 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mmio_win.o -MD -MP -MF "$(DEPDIR)/mmio_win.Tpo" \
5.227 -@am__fastdepCC_TRUE@ -c -o mmio_win.o `test -f 'gui/mmio_win.c' || echo '$(srcdir)/'`gui/mmio_win.c; \
5.228 -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/mmio_win.Tpo" "$(DEPDIR)/mmio_win.Po"; \
5.229 -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/mmio_win.Tpo"; exit 1; \
5.230 -@am__fastdepCC_TRUE@ fi
5.231 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gui/mmio_win.c' object='mmio_win.o' libtool=no @AMDEPBACKSLASH@
5.232 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/mmio_win.Po' tmpdepfile='$(DEPDIR)/mmio_win.TPo' @AMDEPBACKSLASH@
5.233 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
5.234 -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mmio_win.o `test -f 'gui/mmio_win.c' || echo '$(srcdir)/'`gui/mmio_win.c
5.235 -
5.236 -mmio_win.obj: gui/mmio_win.c
5.237 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mmio_win.obj -MD -MP -MF "$(DEPDIR)/mmio_win.Tpo" \
5.238 -@am__fastdepCC_TRUE@ -c -o mmio_win.obj `if test -f 'gui/mmio_win.c'; then $(CYGPATH_W) 'gui/mmio_win.c'; else $(CYGPATH_W) '$(srcdir)/gui/mmio_win.c'; fi`; \
5.239 -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/mmio_win.Tpo" "$(DEPDIR)/mmio_win.Po"; \
5.240 -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/mmio_win.Tpo"; exit 1; \
5.241 -@am__fastdepCC_TRUE@ fi
5.242 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gui/mmio_win.c' object='mmio_win.obj' libtool=no @AMDEPBACKSLASH@
5.243 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/mmio_win.Po' tmpdepfile='$(DEPDIR)/mmio_win.TPo' @AMDEPBACKSLASH@
5.244 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
5.245 -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mmio_win.obj `if test -f 'gui/mmio_win.c'; then $(CYGPATH_W) 'gui/mmio_win.c'; else $(CYGPATH_W) '$(srcdir)/gui/mmio_win.c'; fi`
5.246 -
5.247 -debug_win.o: gui/debug_win.c
5.248 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT debug_win.o -MD -MP -MF "$(DEPDIR)/debug_win.Tpo" \
5.249 -@am__fastdepCC_TRUE@ -c -o debug_win.o `test -f 'gui/debug_win.c' || echo '$(srcdir)/'`gui/debug_win.c; \
5.250 -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/debug_win.Tpo" "$(DEPDIR)/debug_win.Po"; \
5.251 -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/debug_win.Tpo"; exit 1; \
5.252 -@am__fastdepCC_TRUE@ fi
5.253 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gui/debug_win.c' object='debug_win.o' libtool=no @AMDEPBACKSLASH@
5.254 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/debug_win.Po' tmpdepfile='$(DEPDIR)/debug_win.TPo' @AMDEPBACKSLASH@
5.255 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
5.256 -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o debug_win.o `test -f 'gui/debug_win.c' || echo '$(srcdir)/'`gui/debug_win.c
5.257 -
5.258 -debug_win.obj: gui/debug_win.c
5.259 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT debug_win.obj -MD -MP -MF "$(DEPDIR)/debug_win.Tpo" \
5.260 -@am__fastdepCC_TRUE@ -c -o debug_win.obj `if test -f 'gui/debug_win.c'; then $(CYGPATH_W) 'gui/debug_win.c'; else $(CYGPATH_W) '$(srcdir)/gui/debug_win.c'; fi`; \
5.261 -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/debug_win.Tpo" "$(DEPDIR)/debug_win.Po"; \
5.262 -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/debug_win.Tpo"; exit 1; \
5.263 -@am__fastdepCC_TRUE@ fi
5.264 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gui/debug_win.c' object='debug_win.obj' libtool=no @AMDEPBACKSLASH@
5.265 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/debug_win.Po' tmpdepfile='$(DEPDIR)/debug_win.TPo' @AMDEPBACKSLASH@
5.266 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
5.267 -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o debug_win.obj `if test -f 'gui/debug_win.c'; then $(CYGPATH_W) 'gui/debug_win.c'; else $(CYGPATH_W) '$(srcdir)/gui/debug_win.c'; fi`
5.268 -
5.269 -dump_win.o: gui/dump_win.c
5.270 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dump_win.o -MD -MP -MF "$(DEPDIR)/dump_win.Tpo" \
5.271 -@am__fastdepCC_TRUE@ -c -o dump_win.o `test -f 'gui/dump_win.c' || echo '$(srcdir)/'`gui/dump_win.c; \
5.272 -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/dump_win.Tpo" "$(DEPDIR)/dump_win.Po"; \
5.273 -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/dump_win.Tpo"; exit 1; \
5.274 -@am__fastdepCC_TRUE@ fi
5.275 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gui/dump_win.c' object='dump_win.o' libtool=no @AMDEPBACKSLASH@
5.276 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/dump_win.Po' tmpdepfile='$(DEPDIR)/dump_win.TPo' @AMDEPBACKSLASH@
5.277 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
5.278 -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dump_win.o `test -f 'gui/dump_win.c' || echo '$(srcdir)/'`gui/dump_win.c
5.279 -
5.280 -dump_win.obj: gui/dump_win.c
5.281 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dump_win.obj -MD -MP -MF "$(DEPDIR)/dump_win.Tpo" \
5.282 -@am__fastdepCC_TRUE@ -c -o dump_win.obj `if test -f 'gui/dump_win.c'; then $(CYGPATH_W) 'gui/dump_win.c'; else $(CYGPATH_W) '$(srcdir)/gui/dump_win.c'; fi`; \
5.283 -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/dump_win.Tpo" "$(DEPDIR)/dump_win.Po"; \
5.284 -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/dump_win.Tpo"; exit 1; \
5.285 -@am__fastdepCC_TRUE@ fi
5.286 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gui/dump_win.c' object='dump_win.obj' libtool=no @AMDEPBACKSLASH@
5.287 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/dump_win.Po' tmpdepfile='$(DEPDIR)/dump_win.TPo' @AMDEPBACKSLASH@
5.288 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
5.289 -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dump_win.obj `if test -f 'gui/dump_win.c'; then $(CYGPATH_W) 'gui/dump_win.c'; else $(CYGPATH_W) '$(srcdir)/gui/dump_win.c'; fi`
5.290 -
5.291 -ctrl_dlg.o: gui/ctrl_dlg.c
5.292 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ctrl_dlg.o -MD -MP -MF "$(DEPDIR)/ctrl_dlg.Tpo" \
5.293 -@am__fastdepCC_TRUE@ -c -o ctrl_dlg.o `test -f 'gui/ctrl_dlg.c' || echo '$(srcdir)/'`gui/ctrl_dlg.c; \
5.294 -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/ctrl_dlg.Tpo" "$(DEPDIR)/ctrl_dlg.Po"; \
5.295 -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/ctrl_dlg.Tpo"; exit 1; \
5.296 -@am__fastdepCC_TRUE@ fi
5.297 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gui/ctrl_dlg.c' object='ctrl_dlg.o' libtool=no @AMDEPBACKSLASH@
5.298 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/ctrl_dlg.Po' tmpdepfile='$(DEPDIR)/ctrl_dlg.TPo' @AMDEPBACKSLASH@
5.299 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
5.300 -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ctrl_dlg.o `test -f 'gui/ctrl_dlg.c' || echo '$(srcdir)/'`gui/ctrl_dlg.c
5.301 -
5.302 -ctrl_dlg.obj: gui/ctrl_dlg.c
5.303 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ctrl_dlg.obj -MD -MP -MF "$(DEPDIR)/ctrl_dlg.Tpo" \
5.304 -@am__fastdepCC_TRUE@ -c -o ctrl_dlg.obj `if test -f 'gui/ctrl_dlg.c'; then $(CYGPATH_W) 'gui/ctrl_dlg.c'; else $(CYGPATH_W) '$(srcdir)/gui/ctrl_dlg.c'; fi`; \
5.305 -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/ctrl_dlg.Tpo" "$(DEPDIR)/ctrl_dlg.Po"; \
5.306 -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/ctrl_dlg.Tpo"; exit 1; \
5.307 -@am__fastdepCC_TRUE@ fi
5.308 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gui/ctrl_dlg.c' object='ctrl_dlg.obj' libtool=no @AMDEPBACKSLASH@
5.309 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/ctrl_dlg.Po' tmpdepfile='$(DEPDIR)/ctrl_dlg.TPo' @AMDEPBACKSLASH@
5.310 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
5.311 -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ctrl_dlg.obj `if test -f 'gui/ctrl_dlg.c'; then $(CYGPATH_W) 'gui/ctrl_dlg.c'; else $(CYGPATH_W) '$(srcdir)/gui/ctrl_dlg.c'; fi`
5.312 -
5.313 -path_dlg.o: gui/path_dlg.c
5.314 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT path_dlg.o -MD -MP -MF "$(DEPDIR)/path_dlg.Tpo" \
5.315 -@am__fastdepCC_TRUE@ -c -o path_dlg.o `test -f 'gui/path_dlg.c' || echo '$(srcdir)/'`gui/path_dlg.c; \
5.316 -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/path_dlg.Tpo" "$(DEPDIR)/path_dlg.Po"; \
5.317 -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/path_dlg.Tpo"; exit 1; \
5.318 -@am__fastdepCC_TRUE@ fi
5.319 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gui/path_dlg.c' object='path_dlg.o' libtool=no @AMDEPBACKSLASH@
5.320 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/path_dlg.Po' tmpdepfile='$(DEPDIR)/path_dlg.TPo' @AMDEPBACKSLASH@
5.321 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
5.322 -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o path_dlg.o `test -f 'gui/path_dlg.c' || echo '$(srcdir)/'`gui/path_dlg.c
5.323 -
5.324 -path_dlg.obj: gui/path_dlg.c
5.325 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT path_dlg.obj -MD -MP -MF "$(DEPDIR)/path_dlg.Tpo" \
5.326 -@am__fastdepCC_TRUE@ -c -o path_dlg.obj `if test -f 'gui/path_dlg.c'; then $(CYGPATH_W) 'gui/path_dlg.c'; else $(CYGPATH_W) '$(srcdir)/gui/path_dlg.c'; fi`; \
5.327 -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/path_dlg.Tpo" "$(DEPDIR)/path_dlg.Po"; \
5.328 -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/path_dlg.Tpo"; exit 1; \
5.329 -@am__fastdepCC_TRUE@ fi
5.330 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gui/path_dlg.c' object='path_dlg.obj' libtool=no @AMDEPBACKSLASH@
5.331 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/path_dlg.Po' tmpdepfile='$(DEPDIR)/path_dlg.TPo' @AMDEPBACKSLASH@
5.332 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
5.333 -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o path_dlg.obj `if test -f 'gui/path_dlg.c'; then $(CYGPATH_W) 'gui/path_dlg.c'; else $(CYGPATH_W) '$(srcdir)/gui/path_dlg.c'; fi`
5.334 -
5.335 -gdrom_menu.o: gui/gdrom_menu.c
5.336 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gdrom_menu.o -MD -MP -MF "$(DEPDIR)/gdrom_menu.Tpo" \
5.337 -@am__fastdepCC_TRUE@ -c -o gdrom_menu.o `test -f 'gui/gdrom_menu.c' || echo '$(srcdir)/'`gui/gdrom_menu.c; \
5.338 -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/gdrom_menu.Tpo" "$(DEPDIR)/gdrom_menu.Po"; \
5.339 -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/gdrom_menu.Tpo"; exit 1; \
5.340 -@am__fastdepCC_TRUE@ fi
5.341 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gui/gdrom_menu.c' object='gdrom_menu.o' libtool=no @AMDEPBACKSLASH@
5.342 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/gdrom_menu.Po' tmpdepfile='$(DEPDIR)/gdrom_menu.TPo' @AMDEPBACKSLASH@
5.343 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
5.344 -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o gdrom_menu.o `test -f 'gui/gdrom_menu.c' || echo '$(srcdir)/'`gui/gdrom_menu.c
5.345 -
5.346 -gdrom_menu.obj: gui/gdrom_menu.c
5.347 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gdrom_menu.obj -MD -MP -MF "$(DEPDIR)/gdrom_menu.Tpo" \
5.348 -@am__fastdepCC_TRUE@ -c -o gdrom_menu.obj `if test -f 'gui/gdrom_menu.c'; then $(CYGPATH_W) 'gui/gdrom_menu.c'; else $(CYGPATH_W) '$(srcdir)/gui/gdrom_menu.c'; fi`; \
5.349 -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/gdrom_menu.Tpo" "$(DEPDIR)/gdrom_menu.Po"; \
5.350 -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/gdrom_menu.Tpo"; exit 1; \
5.351 -@am__fastdepCC_TRUE@ fi
5.352 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gui/gdrom_menu.c' object='gdrom_menu.obj' libtool=no @AMDEPBACKSLASH@
5.353 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/gdrom_menu.Po' tmpdepfile='$(DEPDIR)/gdrom_menu.TPo' @AMDEPBACKSLASH@
5.354 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
5.355 -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o gdrom_menu.obj `if test -f 'gui/gdrom_menu.c'; then $(CYGPATH_W) 'gui/gdrom_menu.c'; else $(CYGPATH_W) '$(srcdir)/gui/gdrom_menu.c'; fi`
5.356 -
5.357 audio_null.o: drivers/audio_null.c
5.358 @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT audio_null.o -MD -MP -MF "$(DEPDIR)/audio_null.Tpo" \
5.359 @am__fastdepCC_TRUE@ -c -o audio_null.o `test -f 'drivers/audio_null.c' || echo '$(srcdir)/'`drivers/audio_null.c; \
5.360 @@ -1623,50 +1435,6 @@
5.361 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
5.362 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o video_null.obj `if test -f 'drivers/video_null.c'; then $(CYGPATH_W) 'drivers/video_null.c'; else $(CYGPATH_W) '$(srcdir)/drivers/video_null.c'; fi`
5.363
5.364 -video_gtk.o: drivers/video_gtk.c
5.365 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT video_gtk.o -MD -MP -MF "$(DEPDIR)/video_gtk.Tpo" \
5.366 -@am__fastdepCC_TRUE@ -c -o video_gtk.o `test -f 'drivers/video_gtk.c' || echo '$(srcdir)/'`drivers/video_gtk.c; \
5.367 -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/video_gtk.Tpo" "$(DEPDIR)/video_gtk.Po"; \
5.368 -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/video_gtk.Tpo"; exit 1; \
5.369 -@am__fastdepCC_TRUE@ fi
5.370 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='drivers/video_gtk.c' object='video_gtk.o' libtool=no @AMDEPBACKSLASH@
5.371 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/video_gtk.Po' tmpdepfile='$(DEPDIR)/video_gtk.TPo' @AMDEPBACKSLASH@
5.372 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
5.373 -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o video_gtk.o `test -f 'drivers/video_gtk.c' || echo '$(srcdir)/'`drivers/video_gtk.c
5.374 -
5.375 -video_gtk.obj: drivers/video_gtk.c
5.376 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT video_gtk.obj -MD -MP -MF "$(DEPDIR)/video_gtk.Tpo" \
5.377 -@am__fastdepCC_TRUE@ -c -o video_gtk.obj `if test -f 'drivers/video_gtk.c'; then $(CYGPATH_W) 'drivers/video_gtk.c'; else $(CYGPATH_W) '$(srcdir)/drivers/video_gtk.c'; fi`; \
5.378 -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/video_gtk.Tpo" "$(DEPDIR)/video_gtk.Po"; \
5.379 -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/video_gtk.Tpo"; exit 1; \
5.380 -@am__fastdepCC_TRUE@ fi
5.381 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='drivers/video_gtk.c' object='video_gtk.obj' libtool=no @AMDEPBACKSLASH@
5.382 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/video_gtk.Po' tmpdepfile='$(DEPDIR)/video_gtk.TPo' @AMDEPBACKSLASH@
5.383 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
5.384 -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o video_gtk.obj `if test -f 'drivers/video_gtk.c'; then $(CYGPATH_W) 'drivers/video_gtk.c'; else $(CYGPATH_W) '$(srcdir)/drivers/video_gtk.c'; fi`
5.385 -
5.386 -video_x11.o: drivers/video_x11.c
5.387 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT video_x11.o -MD -MP -MF "$(DEPDIR)/video_x11.Tpo" \
5.388 -@am__fastdepCC_TRUE@ -c -o video_x11.o `test -f 'drivers/video_x11.c' || echo '$(srcdir)/'`drivers/video_x11.c; \
5.389 -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/video_x11.Tpo" "$(DEPDIR)/video_x11.Po"; \
5.390 -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/video_x11.Tpo"; exit 1; \
5.391 -@am__fastdepCC_TRUE@ fi
5.392 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='drivers/video_x11.c' object='video_x11.o' libtool=no @AMDEPBACKSLASH@
5.393 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/video_x11.Po' tmpdepfile='$(DEPDIR)/video_x11.TPo' @AMDEPBACKSLASH@
5.394 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
5.395 -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o video_x11.o `test -f 'drivers/video_x11.c' || echo '$(srcdir)/'`drivers/video_x11.c
5.396 -
5.397 -video_x11.obj: drivers/video_x11.c
5.398 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT video_x11.obj -MD -MP -MF "$(DEPDIR)/video_x11.Tpo" \
5.399 -@am__fastdepCC_TRUE@ -c -o video_x11.obj `if test -f 'drivers/video_x11.c'; then $(CYGPATH_W) 'drivers/video_x11.c'; else $(CYGPATH_W) '$(srcdir)/drivers/video_x11.c'; fi`; \
5.400 -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/video_x11.Tpo" "$(DEPDIR)/video_x11.Po"; \
5.401 -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/video_x11.Tpo"; exit 1; \
5.402 -@am__fastdepCC_TRUE@ fi
5.403 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='drivers/video_x11.c' object='video_x11.obj' libtool=no @AMDEPBACKSLASH@
5.404 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/video_x11.Po' tmpdepfile='$(DEPDIR)/video_x11.TPo' @AMDEPBACKSLASH@
5.405 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
5.406 -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o video_x11.obj `if test -f 'drivers/video_x11.c'; then $(CYGPATH_W) 'drivers/video_x11.c'; else $(CYGPATH_W) '$(srcdir)/drivers/video_x11.c'; fi`
5.407 -
5.408 gl_common.o: drivers/gl_common.c
5.409 @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gl_common.o -MD -MP -MF "$(DEPDIR)/gl_common.Tpo" \
5.410 @am__fastdepCC_TRUE@ -c -o gl_common.o `test -f 'drivers/gl_common.c' || echo '$(srcdir)/'`drivers/gl_common.c; \
5.411 @@ -1887,6 +1655,248 @@
5.412 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
5.413 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dis-buf.obj `if test -f 'x86dasm/dis-buf.c'; then $(CYGPATH_W) 'x86dasm/dis-buf.c'; else $(CYGPATH_W) '$(srcdir)/x86dasm/dis-buf.c'; fi`
5.414
5.415 +gtkui.o: gtkui/gtkui.c
5.416 +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gtkui.o -MD -MP -MF "$(DEPDIR)/gtkui.Tpo" \
5.417 +@am__fastdepCC_TRUE@ -c -o gtkui.o `test -f 'gtkui/gtkui.c' || echo '$(srcdir)/'`gtkui/gtkui.c; \
5.418 +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/gtkui.Tpo" "$(DEPDIR)/gtkui.Po"; \
5.419 +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/gtkui.Tpo"; exit 1; \
5.420 +@am__fastdepCC_TRUE@ fi
5.421 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gtkui/gtkui.c' object='gtkui.o' libtool=no @AMDEPBACKSLASH@
5.422 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/gtkui.Po' tmpdepfile='$(DEPDIR)/gtkui.TPo' @AMDEPBACKSLASH@
5.423 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
5.424 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o gtkui.o `test -f 'gtkui/gtkui.c' || echo '$(srcdir)/'`gtkui/gtkui.c
5.425 +
5.426 +gtkui.obj: gtkui/gtkui.c
5.427 +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gtkui.obj -MD -MP -MF "$(DEPDIR)/gtkui.Tpo" \
5.428 +@am__fastdepCC_TRUE@ -c -o gtkui.obj `if test -f 'gtkui/gtkui.c'; then $(CYGPATH_W) 'gtkui/gtkui.c'; else $(CYGPATH_W) '$(srcdir)/gtkui/gtkui.c'; fi`; \
5.429 +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/gtkui.Tpo" "$(DEPDIR)/gtkui.Po"; \
5.430 +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/gtkui.Tpo"; exit 1; \
5.431 +@am__fastdepCC_TRUE@ fi
5.432 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gtkui/gtkui.c' object='gtkui.obj' libtool=no @AMDEPBACKSLASH@
5.433 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/gtkui.Po' tmpdepfile='$(DEPDIR)/gtkui.TPo' @AMDEPBACKSLASH@
5.434 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
5.435 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o gtkui.obj `if test -f 'gtkui/gtkui.c'; then $(CYGPATH_W) 'gtkui/gtkui.c'; else $(CYGPATH_W) '$(srcdir)/gtkui/gtkui.c'; fi`
5.436 +
5.437 +main_win.o: gtkui/main_win.c
5.438 +@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" \
5.439 +@am__fastdepCC_TRUE@ -c -o main_win.o `test -f 'gtkui/main_win.c' || echo '$(srcdir)/'`gtkui/main_win.c; \
5.440 +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/main_win.Tpo" "$(DEPDIR)/main_win.Po"; \
5.441 +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/main_win.Tpo"; exit 1; \
5.442 +@am__fastdepCC_TRUE@ fi
5.443 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gtkui/main_win.c' object='main_win.o' libtool=no @AMDEPBACKSLASH@
5.444 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/main_win.Po' tmpdepfile='$(DEPDIR)/main_win.TPo' @AMDEPBACKSLASH@
5.445 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
5.446 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o main_win.o `test -f 'gtkui/main_win.c' || echo '$(srcdir)/'`gtkui/main_win.c
5.447 +
5.448 +main_win.obj: gtkui/main_win.c
5.449 +@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" \
5.450 +@am__fastdepCC_TRUE@ -c -o main_win.obj `if test -f 'gtkui/main_win.c'; then $(CYGPATH_W) 'gtkui/main_win.c'; else $(CYGPATH_W) '$(srcdir)/gtkui/main_win.c'; fi`; \
5.451 +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/main_win.Tpo" "$(DEPDIR)/main_win.Po"; \
5.452 +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/main_win.Tpo"; exit 1; \
5.453 +@am__fastdepCC_TRUE@ fi
5.454 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gtkui/main_win.c' object='main_win.obj' libtool=no @AMDEPBACKSLASH@
5.455 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/main_win.Po' tmpdepfile='$(DEPDIR)/main_win.TPo' @AMDEPBACKSLASH@
5.456 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
5.457 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o main_win.obj `if test -f 'gtkui/main_win.c'; then $(CYGPATH_W) 'gtkui/main_win.c'; else $(CYGPATH_W) '$(srcdir)/gtkui/main_win.c'; fi`
5.458 +
5.459 +gtkcb.o: gtkui/gtkcb.c
5.460 +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gtkcb.o -MD -MP -MF "$(DEPDIR)/gtkcb.Tpo" \
5.461 +@am__fastdepCC_TRUE@ -c -o gtkcb.o `test -f 'gtkui/gtkcb.c' || echo '$(srcdir)/'`gtkui/gtkcb.c; \
5.462 +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/gtkcb.Tpo" "$(DEPDIR)/gtkcb.Po"; \
5.463 +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/gtkcb.Tpo"; exit 1; \
5.464 +@am__fastdepCC_TRUE@ fi
5.465 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gtkui/gtkcb.c' object='gtkcb.o' libtool=no @AMDEPBACKSLASH@
5.466 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/gtkcb.Po' tmpdepfile='$(DEPDIR)/gtkcb.TPo' @AMDEPBACKSLASH@
5.467 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
5.468 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o gtkcb.o `test -f 'gtkui/gtkcb.c' || echo '$(srcdir)/'`gtkui/gtkcb.c
5.469 +
5.470 +gtkcb.obj: gtkui/gtkcb.c
5.471 +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gtkcb.obj -MD -MP -MF "$(DEPDIR)/gtkcb.Tpo" \
5.472 +@am__fastdepCC_TRUE@ -c -o gtkcb.obj `if test -f 'gtkui/gtkcb.c'; then $(CYGPATH_W) 'gtkui/gtkcb.c'; else $(CYGPATH_W) '$(srcdir)/gtkui/gtkcb.c'; fi`; \
5.473 +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/gtkcb.Tpo" "$(DEPDIR)/gtkcb.Po"; \
5.474 +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/gtkcb.Tpo"; exit 1; \
5.475 +@am__fastdepCC_TRUE@ fi
5.476 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gtkui/gtkcb.c' object='gtkcb.obj' libtool=no @AMDEPBACKSLASH@
5.477 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/gtkcb.Po' tmpdepfile='$(DEPDIR)/gtkcb.TPo' @AMDEPBACKSLASH@
5.478 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
5.479 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o gtkcb.obj `if test -f 'gtkui/gtkcb.c'; then $(CYGPATH_W) 'gtkui/gtkcb.c'; else $(CYGPATH_W) '$(srcdir)/gtkui/gtkcb.c'; fi`
5.480 +
5.481 +mmio_win.o: gtkui/mmio_win.c
5.482 +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mmio_win.o -MD -MP -MF "$(DEPDIR)/mmio_win.Tpo" \
5.483 +@am__fastdepCC_TRUE@ -c -o mmio_win.o `test -f 'gtkui/mmio_win.c' || echo '$(srcdir)/'`gtkui/mmio_win.c; \
5.484 +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/mmio_win.Tpo" "$(DEPDIR)/mmio_win.Po"; \
5.485 +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/mmio_win.Tpo"; exit 1; \
5.486 +@am__fastdepCC_TRUE@ fi
5.487 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gtkui/mmio_win.c' object='mmio_win.o' libtool=no @AMDEPBACKSLASH@
5.488 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/mmio_win.Po' tmpdepfile='$(DEPDIR)/mmio_win.TPo' @AMDEPBACKSLASH@
5.489 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
5.490 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mmio_win.o `test -f 'gtkui/mmio_win.c' || echo '$(srcdir)/'`gtkui/mmio_win.c
5.491 +
5.492 +mmio_win.obj: gtkui/mmio_win.c
5.493 +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mmio_win.obj -MD -MP -MF "$(DEPDIR)/mmio_win.Tpo" \
5.494 +@am__fastdepCC_TRUE@ -c -o mmio_win.obj `if test -f 'gtkui/mmio_win.c'; then $(CYGPATH_W) 'gtkui/mmio_win.c'; else $(CYGPATH_W) '$(srcdir)/gtkui/mmio_win.c'; fi`; \
5.495 +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/mmio_win.Tpo" "$(DEPDIR)/mmio_win.Po"; \
5.496 +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/mmio_win.Tpo"; exit 1; \
5.497 +@am__fastdepCC_TRUE@ fi
5.498 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gtkui/mmio_win.c' object='mmio_win.obj' libtool=no @AMDEPBACKSLASH@
5.499 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/mmio_win.Po' tmpdepfile='$(DEPDIR)/mmio_win.TPo' @AMDEPBACKSLASH@
5.500 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
5.501 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mmio_win.obj `if test -f 'gtkui/mmio_win.c'; then $(CYGPATH_W) 'gtkui/mmio_win.c'; else $(CYGPATH_W) '$(srcdir)/gtkui/mmio_win.c'; fi`
5.502 +
5.503 +debug_win.o: gtkui/debug_win.c
5.504 +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT debug_win.o -MD -MP -MF "$(DEPDIR)/debug_win.Tpo" \
5.505 +@am__fastdepCC_TRUE@ -c -o debug_win.o `test -f 'gtkui/debug_win.c' || echo '$(srcdir)/'`gtkui/debug_win.c; \
5.506 +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/debug_win.Tpo" "$(DEPDIR)/debug_win.Po"; \
5.507 +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/debug_win.Tpo"; exit 1; \
5.508 +@am__fastdepCC_TRUE@ fi
5.509 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gtkui/debug_win.c' object='debug_win.o' libtool=no @AMDEPBACKSLASH@
5.510 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/debug_win.Po' tmpdepfile='$(DEPDIR)/debug_win.TPo' @AMDEPBACKSLASH@
5.511 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
5.512 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o debug_win.o `test -f 'gtkui/debug_win.c' || echo '$(srcdir)/'`gtkui/debug_win.c
5.513 +
5.514 +debug_win.obj: gtkui/debug_win.c
5.515 +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT debug_win.obj -MD -MP -MF "$(DEPDIR)/debug_win.Tpo" \
5.516 +@am__fastdepCC_TRUE@ -c -o debug_win.obj `if test -f 'gtkui/debug_win.c'; then $(CYGPATH_W) 'gtkui/debug_win.c'; else $(CYGPATH_W) '$(srcdir)/gtkui/debug_win.c'; fi`; \
5.517 +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/debug_win.Tpo" "$(DEPDIR)/debug_win.Po"; \
5.518 +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/debug_win.Tpo"; exit 1; \
5.519 +@am__fastdepCC_TRUE@ fi
5.520 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gtkui/debug_win.c' object='debug_win.obj' libtool=no @AMDEPBACKSLASH@
5.521 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/debug_win.Po' tmpdepfile='$(DEPDIR)/debug_win.TPo' @AMDEPBACKSLASH@
5.522 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
5.523 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o debug_win.obj `if test -f 'gtkui/debug_win.c'; then $(CYGPATH_W) 'gtkui/debug_win.c'; else $(CYGPATH_W) '$(srcdir)/gtkui/debug_win.c'; fi`
5.524 +
5.525 +dump_win.o: gtkui/dump_win.c
5.526 +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dump_win.o -MD -MP -MF "$(DEPDIR)/dump_win.Tpo" \
5.527 +@am__fastdepCC_TRUE@ -c -o dump_win.o `test -f 'gtkui/dump_win.c' || echo '$(srcdir)/'`gtkui/dump_win.c; \
5.528 +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/dump_win.Tpo" "$(DEPDIR)/dump_win.Po"; \
5.529 +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/dump_win.Tpo"; exit 1; \
5.530 +@am__fastdepCC_TRUE@ fi
5.531 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gtkui/dump_win.c' object='dump_win.o' libtool=no @AMDEPBACKSLASH@
5.532 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/dump_win.Po' tmpdepfile='$(DEPDIR)/dump_win.TPo' @AMDEPBACKSLASH@
5.533 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
5.534 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dump_win.o `test -f 'gtkui/dump_win.c' || echo '$(srcdir)/'`gtkui/dump_win.c
5.535 +
5.536 +dump_win.obj: gtkui/dump_win.c
5.537 +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dump_win.obj -MD -MP -MF "$(DEPDIR)/dump_win.Tpo" \
5.538 +@am__fastdepCC_TRUE@ -c -o dump_win.obj `if test -f 'gtkui/dump_win.c'; then $(CYGPATH_W) 'gtkui/dump_win.c'; else $(CYGPATH_W) '$(srcdir)/gtkui/dump_win.c'; fi`; \
5.539 +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/dump_win.Tpo" "$(DEPDIR)/dump_win.Po"; \
5.540 +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/dump_win.Tpo"; exit 1; \
5.541 +@am__fastdepCC_TRUE@ fi
5.542 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gtkui/dump_win.c' object='dump_win.obj' libtool=no @AMDEPBACKSLASH@
5.543 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/dump_win.Po' tmpdepfile='$(DEPDIR)/dump_win.TPo' @AMDEPBACKSLASH@
5.544 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
5.545 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dump_win.obj `if test -f 'gtkui/dump_win.c'; then $(CYGPATH_W) 'gtkui/dump_win.c'; else $(CYGPATH_W) '$(srcdir)/gtkui/dump_win.c'; fi`
5.546 +
5.547 +ctrl_dlg.o: gtkui/ctrl_dlg.c
5.548 +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ctrl_dlg.o -MD -MP -MF "$(DEPDIR)/ctrl_dlg.Tpo" \
5.549 +@am__fastdepCC_TRUE@ -c -o ctrl_dlg.o `test -f 'gtkui/ctrl_dlg.c' || echo '$(srcdir)/'`gtkui/ctrl_dlg.c; \
5.550 +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/ctrl_dlg.Tpo" "$(DEPDIR)/ctrl_dlg.Po"; \
5.551 +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/ctrl_dlg.Tpo"; exit 1; \
5.552 +@am__fastdepCC_TRUE@ fi
5.553 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gtkui/ctrl_dlg.c' object='ctrl_dlg.o' libtool=no @AMDEPBACKSLASH@
5.554 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/ctrl_dlg.Po' tmpdepfile='$(DEPDIR)/ctrl_dlg.TPo' @AMDEPBACKSLASH@
5.555 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
5.556 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ctrl_dlg.o `test -f 'gtkui/ctrl_dlg.c' || echo '$(srcdir)/'`gtkui/ctrl_dlg.c
5.557 +
5.558 +ctrl_dlg.obj: gtkui/ctrl_dlg.c
5.559 +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ctrl_dlg.obj -MD -MP -MF "$(DEPDIR)/ctrl_dlg.Tpo" \
5.560 +@am__fastdepCC_TRUE@ -c -o ctrl_dlg.obj `if test -f 'gtkui/ctrl_dlg.c'; then $(CYGPATH_W) 'gtkui/ctrl_dlg.c'; else $(CYGPATH_W) '$(srcdir)/gtkui/ctrl_dlg.c'; fi`; \
5.561 +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/ctrl_dlg.Tpo" "$(DEPDIR)/ctrl_dlg.Po"; \
5.562 +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/ctrl_dlg.Tpo"; exit 1; \
5.563 +@am__fastdepCC_TRUE@ fi
5.564 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gtkui/ctrl_dlg.c' object='ctrl_dlg.obj' libtool=no @AMDEPBACKSLASH@
5.565 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/ctrl_dlg.Po' tmpdepfile='$(DEPDIR)/ctrl_dlg.TPo' @AMDEPBACKSLASH@
5.566 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
5.567 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ctrl_dlg.obj `if test -f 'gtkui/ctrl_dlg.c'; then $(CYGPATH_W) 'gtkui/ctrl_dlg.c'; else $(CYGPATH_W) '$(srcdir)/gtkui/ctrl_dlg.c'; fi`
5.568 +
5.569 +path_dlg.o: gtkui/path_dlg.c
5.570 +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT path_dlg.o -MD -MP -MF "$(DEPDIR)/path_dlg.Tpo" \
5.571 +@am__fastdepCC_TRUE@ -c -o path_dlg.o `test -f 'gtkui/path_dlg.c' || echo '$(srcdir)/'`gtkui/path_dlg.c; \
5.572 +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/path_dlg.Tpo" "$(DEPDIR)/path_dlg.Po"; \
5.573 +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/path_dlg.Tpo"; exit 1; \
5.574 +@am__fastdepCC_TRUE@ fi
5.575 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gtkui/path_dlg.c' object='path_dlg.o' libtool=no @AMDEPBACKSLASH@
5.576 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/path_dlg.Po' tmpdepfile='$(DEPDIR)/path_dlg.TPo' @AMDEPBACKSLASH@
5.577 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
5.578 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o path_dlg.o `test -f 'gtkui/path_dlg.c' || echo '$(srcdir)/'`gtkui/path_dlg.c
5.579 +
5.580 +path_dlg.obj: gtkui/path_dlg.c
5.581 +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT path_dlg.obj -MD -MP -MF "$(DEPDIR)/path_dlg.Tpo" \
5.582 +@am__fastdepCC_TRUE@ -c -o path_dlg.obj `if test -f 'gtkui/path_dlg.c'; then $(CYGPATH_W) 'gtkui/path_dlg.c'; else $(CYGPATH_W) '$(srcdir)/gtkui/path_dlg.c'; fi`; \
5.583 +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/path_dlg.Tpo" "$(DEPDIR)/path_dlg.Po"; \
5.584 +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/path_dlg.Tpo"; exit 1; \
5.585 +@am__fastdepCC_TRUE@ fi
5.586 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gtkui/path_dlg.c' object='path_dlg.obj' libtool=no @AMDEPBACKSLASH@
5.587 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/path_dlg.Po' tmpdepfile='$(DEPDIR)/path_dlg.TPo' @AMDEPBACKSLASH@
5.588 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
5.589 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o path_dlg.obj `if test -f 'gtkui/path_dlg.c'; then $(CYGPATH_W) 'gtkui/path_dlg.c'; else $(CYGPATH_W) '$(srcdir)/gtkui/path_dlg.c'; fi`
5.590 +
5.591 +gdrom_menu.o: gtkui/gdrom_menu.c
5.592 +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gdrom_menu.o -MD -MP -MF "$(DEPDIR)/gdrom_menu.Tpo" \
5.593 +@am__fastdepCC_TRUE@ -c -o gdrom_menu.o `test -f 'gtkui/gdrom_menu.c' || echo '$(srcdir)/'`gtkui/gdrom_menu.c; \
5.594 +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/gdrom_menu.Tpo" "$(DEPDIR)/gdrom_menu.Po"; \
5.595 +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/gdrom_menu.Tpo"; exit 1; \
5.596 +@am__fastdepCC_TRUE@ fi
5.597 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gtkui/gdrom_menu.c' object='gdrom_menu.o' libtool=no @AMDEPBACKSLASH@
5.598 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/gdrom_menu.Po' tmpdepfile='$(DEPDIR)/gdrom_menu.TPo' @AMDEPBACKSLASH@
5.599 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
5.600 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o gdrom_menu.o `test -f 'gtkui/gdrom_menu.c' || echo '$(srcdir)/'`gtkui/gdrom_menu.c
5.601 +
5.602 +gdrom_menu.obj: gtkui/gdrom_menu.c
5.603 +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gdrom_menu.obj -MD -MP -MF "$(DEPDIR)/gdrom_menu.Tpo" \
5.604 +@am__fastdepCC_TRUE@ -c -o gdrom_menu.obj `if test -f 'gtkui/gdrom_menu.c'; then $(CYGPATH_W) 'gtkui/gdrom_menu.c'; else $(CYGPATH_W) '$(srcdir)/gtkui/gdrom_menu.c'; fi`; \
5.605 +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/gdrom_menu.Tpo" "$(DEPDIR)/gdrom_menu.Po"; \
5.606 +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/gdrom_menu.Tpo"; exit 1; \
5.607 +@am__fastdepCC_TRUE@ fi
5.608 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gtkui/gdrom_menu.c' object='gdrom_menu.obj' libtool=no @AMDEPBACKSLASH@
5.609 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/gdrom_menu.Po' tmpdepfile='$(DEPDIR)/gdrom_menu.TPo' @AMDEPBACKSLASH@
5.610 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
5.611 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o gdrom_menu.obj `if test -f 'gtkui/gdrom_menu.c'; then $(CYGPATH_W) 'gtkui/gdrom_menu.c'; else $(CYGPATH_W) '$(srcdir)/gtkui/gdrom_menu.c'; fi`
5.612 +
5.613 +video_gtk.o: drivers/video_gtk.c
5.614 +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT video_gtk.o -MD -MP -MF "$(DEPDIR)/video_gtk.Tpo" \
5.615 +@am__fastdepCC_TRUE@ -c -o video_gtk.o `test -f 'drivers/video_gtk.c' || echo '$(srcdir)/'`drivers/video_gtk.c; \
5.616 +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/video_gtk.Tpo" "$(DEPDIR)/video_gtk.Po"; \
5.617 +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/video_gtk.Tpo"; exit 1; \
5.618 +@am__fastdepCC_TRUE@ fi
5.619 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='drivers/video_gtk.c' object='video_gtk.o' libtool=no @AMDEPBACKSLASH@
5.620 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/video_gtk.Po' tmpdepfile='$(DEPDIR)/video_gtk.TPo' @AMDEPBACKSLASH@
5.621 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
5.622 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o video_gtk.o `test -f 'drivers/video_gtk.c' || echo '$(srcdir)/'`drivers/video_gtk.c
5.623 +
5.624 +video_gtk.obj: drivers/video_gtk.c
5.625 +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT video_gtk.obj -MD -MP -MF "$(DEPDIR)/video_gtk.Tpo" \
5.626 +@am__fastdepCC_TRUE@ -c -o video_gtk.obj `if test -f 'drivers/video_gtk.c'; then $(CYGPATH_W) 'drivers/video_gtk.c'; else $(CYGPATH_W) '$(srcdir)/drivers/video_gtk.c'; fi`; \
5.627 +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/video_gtk.Tpo" "$(DEPDIR)/video_gtk.Po"; \
5.628 +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/video_gtk.Tpo"; exit 1; \
5.629 +@am__fastdepCC_TRUE@ fi
5.630 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='drivers/video_gtk.c' object='video_gtk.obj' libtool=no @AMDEPBACKSLASH@
5.631 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/video_gtk.Po' tmpdepfile='$(DEPDIR)/video_gtk.TPo' @AMDEPBACKSLASH@
5.632 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
5.633 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o video_gtk.obj `if test -f 'drivers/video_gtk.c'; then $(CYGPATH_W) 'drivers/video_gtk.c'; else $(CYGPATH_W) '$(srcdir)/drivers/video_gtk.c'; fi`
5.634 +
5.635 +video_x11.o: drivers/video_x11.c
5.636 +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT video_x11.o -MD -MP -MF "$(DEPDIR)/video_x11.Tpo" \
5.637 +@am__fastdepCC_TRUE@ -c -o video_x11.o `test -f 'drivers/video_x11.c' || echo '$(srcdir)/'`drivers/video_x11.c; \
5.638 +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/video_x11.Tpo" "$(DEPDIR)/video_x11.Po"; \
5.639 +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/video_x11.Tpo"; exit 1; \
5.640 +@am__fastdepCC_TRUE@ fi
5.641 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='drivers/video_x11.c' object='video_x11.o' libtool=no @AMDEPBACKSLASH@
5.642 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/video_x11.Po' tmpdepfile='$(DEPDIR)/video_x11.TPo' @AMDEPBACKSLASH@
5.643 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
5.644 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o video_x11.o `test -f 'drivers/video_x11.c' || echo '$(srcdir)/'`drivers/video_x11.c
5.645 +
5.646 +video_x11.obj: drivers/video_x11.c
5.647 +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT video_x11.obj -MD -MP -MF "$(DEPDIR)/video_x11.Tpo" \
5.648 +@am__fastdepCC_TRUE@ -c -o video_x11.obj `if test -f 'drivers/video_x11.c'; then $(CYGPATH_W) 'drivers/video_x11.c'; else $(CYGPATH_W) '$(srcdir)/drivers/video_x11.c'; fi`; \
5.649 +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/video_x11.Tpo" "$(DEPDIR)/video_x11.Po"; \
5.650 +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/video_x11.Tpo"; exit 1; \
5.651 +@am__fastdepCC_TRUE@ fi
5.652 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='drivers/video_x11.c' object='video_x11.obj' libtool=no @AMDEPBACKSLASH@
5.653 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/video_x11.Po' tmpdepfile='$(DEPDIR)/video_x11.TPo' @AMDEPBACKSLASH@
5.654 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
5.655 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o video_x11.obj `if test -f 'drivers/video_x11.c'; then $(CYGPATH_W) 'drivers/video_x11.c'; else $(CYGPATH_W) '$(srcdir)/drivers/video_x11.c'; fi`
5.656 +
5.657 cd_linux.o: drivers/cd_linux.c
5.658 @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cd_linux.o -MD -MP -MF "$(DEPDIR)/cd_linux.Tpo" \
5.659 @am__fastdepCC_TRUE@ -c -o cd_linux.o `test -f 'drivers/cd_linux.c' || echo '$(srcdir)/'`drivers/cd_linux.c; \
6.1 --- a/src/drivers/video_gtk.c Tue Nov 20 09:42:03 2007 +0000
6.2 +++ b/src/drivers/video_gtk.c Tue Nov 20 10:27:58 2007 +0000
6.3 @@ -24,7 +24,7 @@
6.4 #include "display.h"
6.5 #include "drivers/video_x11.h"
6.6 #include "drivers/gl_common.h"
6.7 -#include "gui/gtkui.h"
6.8 +#include "gtkui/gtkui.h"
6.9
6.10 static GtkWidget *video_win = NULL;
6.11 int video_width = 640;
7.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
7.2 +++ b/src/gtkui/ctrl_dlg.c Tue Nov 20 10:27:58 2007 +0000
7.3 @@ -0,0 +1,302 @@
7.4 +/**
7.5 + * $Id: ctrl_dlg.c,v 1.6 2007-11-10 04:45:29 nkeynes Exp $
7.6 + *
7.7 + * Define the main (emu) GTK window, along with its menubars,
7.8 + * toolbars, etc.
7.9 + *
7.10 + * Copyright (c) 2005 Nathan Keynes.
7.11 + *
7.12 + * This program is free software; you can redistribute it and/or modify
7.13 + * it under the terms of the GNU General Public License as published by
7.14 + * the Free Software Foundation; either version 2 of the License, or
7.15 + * (at your option) any later version.
7.16 + *
7.17 + * This program is distributed in the hope that it will be useful,
7.18 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
7.19 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7.20 + * GNU General Public License for more details.
7.21 + */
7.22 +
7.23 +#include <assert.h>
7.24 +#include <gtk/gtk.h>
7.25 +#include <gdk/gdkkeysyms.h>
7.26 +
7.27 +#include "dream.h"
7.28 +#include "gtkui/gtkui.h"
7.29 +#include "maple/maple.h"
7.30 +
7.31 +#define MAX_DEVICES 4
7.32 +
7.33 +static void controller_device_configure(maple_device_t device);
7.34 +
7.35 +struct maple_config_class {
7.36 + const char *name;
7.37 + void (*config_func)(maple_device_t device);
7.38 +};
7.39 +
7.40 +typedef struct maple_slot_data {
7.41 + maple_device_t old_device;
7.42 + maple_device_t new_device;
7.43 + GtkWidget *button;
7.44 + GtkWidget *combo;
7.45 +} *maple_slot_data_t;
7.46 +
7.47 +static struct maple_config_class maple_device_config[] = {
7.48 + { "Sega Controller", controller_device_configure },
7.49 + { NULL, NULL } };
7.50 +
7.51 +static struct maple_slot_data maple_data[MAX_DEVICES];
7.52 +
7.53 +static gboolean config_key_buttonpress( GtkWidget *widget, GdkEventButton *event, gpointer user_data )
7.54 +{
7.55 + gboolean keypress_mode = GPOINTER_TO_INT(g_object_get_data( G_OBJECT(widget), "keypress_mode"));
7.56 + if( !keypress_mode ) {
7.57 + gtk_entry_set_text( GTK_ENTRY(widget), _("<press key>") );
7.58 + g_object_set_data( G_OBJECT(widget), "keypress_mode", GINT_TO_POINTER(TRUE) );
7.59 + }
7.60 + return FALSE;
7.61 +}
7.62 +
7.63 +static gboolean config_key_keypress( GtkWidget *widget, GdkEventKey *event, gpointer user_data )
7.64 +{
7.65 + gboolean keypress_mode = GPOINTER_TO_INT(g_object_get_data( G_OBJECT(widget), "keypress_mode"));
7.66 + if( keypress_mode ) {
7.67 + if( event->keyval == GDK_Escape ) {
7.68 + gtk_entry_set_text( GTK_ENTRY(widget), "" );
7.69 + g_object_set_data( G_OBJECT(widget), "keypress_mode", GINT_TO_POINTER(FALSE) );
7.70 + return TRUE;
7.71 + }
7.72 + GdkKeymap *keymap = gdk_keymap_get_default();
7.73 + guint keyval;
7.74 +
7.75 + gdk_keymap_translate_keyboard_state( keymap, event->hardware_keycode, 0, 0, &keyval,
7.76 + NULL, NULL, NULL );
7.77 + gtk_entry_set_text( GTK_ENTRY(widget), gdk_keyval_name(keyval) );
7.78 + g_object_set_data( G_OBJECT(widget), "keypress_mode", GINT_TO_POINTER(FALSE) );
7.79 + return TRUE;
7.80 + } else {
7.81 + switch( event->keyval ) {
7.82 + case GDK_Return:
7.83 + case GDK_KP_Enter:
7.84 + gtk_entry_set_text( GTK_ENTRY(widget), _("<press key>") );
7.85 + g_object_set_data( G_OBJECT(widget), "keypress_mode", GINT_TO_POINTER(TRUE) );
7.86 + return TRUE;
7.87 + case GDK_BackSpace:
7.88 + case GDK_Delete:
7.89 + gtk_entry_set_text( GTK_ENTRY(widget), "" );
7.90 + return TRUE;
7.91 + }
7.92 + return FALSE;
7.93 + }
7.94 +
7.95 +}
7.96 +
7.97 +static void controller_config_done( GtkWidget *panel, gboolean isOK )
7.98 +{
7.99 + if( isOK ) {
7.100 + maple_device_t device = (maple_device_t)gtk_object_get_data( GTK_OBJECT(panel), "maple_device" );
7.101 + lxdream_config_entry_t conf = device->get_config(device);
7.102 + int i;
7.103 + for( i=0; conf[i].key != NULL; i++ ) {
7.104 + char buf[64];
7.105 + GtkWidget *entry1, *entry2;
7.106 + const gchar *key1, *key2;
7.107 + snprintf( buf, sizeof(buf), "%s.1", conf[i].key );
7.108 + entry1 = GTK_WIDGET(g_object_get_qdata( G_OBJECT(panel), g_quark_from_string(buf)));
7.109 + key1 = gtk_entry_get_text(GTK_ENTRY(entry1));
7.110 + snprintf( buf, sizeof(buf), "%s.2", conf[i].key );
7.111 + entry2 = GTK_WIDGET(g_object_get_qdata( G_OBJECT(panel), g_quark_from_string(buf)));
7.112 + key2 = gtk_entry_get_text(GTK_ENTRY(entry2));
7.113 + if( key1 == NULL || key1[0] == '\0') {
7.114 + lxdream_set_config_value( &conf[i], key2 );
7.115 + } else if( key2 == NULL || key2[0] == '\0') {
7.116 + lxdream_set_config_value( &conf[i], key1 );
7.117 + } else {
7.118 + char buf[64];
7.119 + snprintf( buf, sizeof(buf), "%s, %s", key1, key2 );
7.120 + lxdream_set_config_value( &conf[i], buf );
7.121 + }
7.122 + }
7.123 + }
7.124 +
7.125 +}
7.126 +
7.127 +static void controller_device_configure( maple_device_t device )
7.128 +{
7.129 + lxdream_config_entry_t conf = device->get_config(device);
7.130 + int count, i;
7.131 + for( count=0; conf[count].key != NULL; count++ );
7.132 +
7.133 + GtkWidget *table = gtk_table_new( (count+1)>>1, 6, FALSE );
7.134 + GList *focus_chain = NULL;
7.135 + gtk_object_set_data( GTK_OBJECT(table), "maple_device", device );
7.136 + for( i=0; i<count; i++ ) {
7.137 + GtkWidget *text, *text2;
7.138 + char buf[64];
7.139 + int x=0;
7.140 + int y=i;
7.141 + if( i >= (count+1)>>1 ) {
7.142 + x = 3;
7.143 + y -= (count+1)>>1;
7.144 + }
7.145 + gtk_table_attach( GTK_TABLE(table), gtk_label_new(conf[i].key), x, x+1, y, y+1,
7.146 + GTK_SHRINK, GTK_SHRINK, 0, 0 );
7.147 + text = gtk_entry_new();
7.148 + gtk_entry_set_width_chars( GTK_ENTRY(text), 8 );
7.149 + gtk_entry_set_editable( GTK_ENTRY(text), FALSE );
7.150 + g_signal_connect( text, "key_press_event",
7.151 + G_CALLBACK(config_key_keypress), NULL );
7.152 + g_signal_connect( text, "button_press_event",
7.153 + G_CALLBACK(config_key_buttonpress), NULL );
7.154 + snprintf( buf, sizeof(buf), "%s.1", conf[i].key );
7.155 + g_object_set_data( G_OBJECT(text), "keypress_mode", GINT_TO_POINTER(FALSE) );
7.156 + g_object_set_qdata( G_OBJECT(table), g_quark_from_string(buf), text );
7.157 + gtk_table_attach_defaults( GTK_TABLE(table), text, x+1, x+2, y, y+1);
7.158 + focus_chain = g_list_append( focus_chain, text );
7.159 + text2 = gtk_entry_new();
7.160 + gtk_entry_set_width_chars( GTK_ENTRY(text2), 8 );
7.161 + gtk_entry_set_editable( GTK_ENTRY(text2), FALSE );
7.162 + g_signal_connect( text2, "key_press_event",
7.163 + G_CALLBACK(config_key_keypress), NULL );
7.164 + g_signal_connect( text2, "button_press_event",
7.165 + G_CALLBACK(config_key_buttonpress), NULL );
7.166 + snprintf( buf, sizeof(buf), "%s.2", conf[i].key );
7.167 + g_object_set_data( G_OBJECT(text2), "keypress_mode", GINT_TO_POINTER(FALSE) );
7.168 + g_object_set_qdata( G_OBJECT(table), g_quark_from_string(buf), text2 );
7.169 + gtk_table_attach_defaults( GTK_TABLE(table), text2, x+2, x+3, y, y+1);
7.170 + focus_chain = g_list_append( focus_chain, text2 );
7.171 + if( conf[i].value != NULL ) {
7.172 + gchar **parts = g_strsplit(conf[i].value,",",3);
7.173 + if( parts[0] != NULL ) {
7.174 + gtk_entry_set_text( GTK_ENTRY(text), g_strstrip(parts[0]) );
7.175 + if( parts[1] != NULL ) {
7.176 + gtk_entry_set_text( GTK_ENTRY(text2), g_strstrip(parts[1]) );
7.177 + }
7.178 + }
7.179 + g_strfreev(parts);
7.180 + }
7.181 + }
7.182 + gtk_container_set_focus_chain( GTK_CONTAINER(table), focus_chain );
7.183 + gtk_gui_run_property_dialog( _("Controller Configuration"), table, controller_config_done );
7.184 +}
7.185 +
7.186 +
7.187 +gboolean maple_properties_activated( GtkButton *button, gpointer user_data )
7.188 +{
7.189 + maple_slot_data_t data = (maple_slot_data_t)user_data;
7.190 + if( data->new_device != NULL ) {
7.191 + int i;
7.192 + for( i=0; maple_device_config[i].name != NULL; i++ ) {
7.193 + if( strcmp(data->new_device->device_class->name, maple_device_config[i].name) == 0 ) {
7.194 + if( data->new_device == data->old_device ) {
7.195 + // Make a copy at this point if we haven't already
7.196 + data->new_device = data->old_device->clone(data->old_device);
7.197 + }
7.198 + maple_device_config[i].config_func(data->new_device);
7.199 + break;
7.200 + }
7.201 + }
7.202 + if( maple_device_config[i].name == NULL ) {
7.203 + gui_error_dialog( _("No configuration page available for device type") );
7.204 + }
7.205 + }
7.206 + return TRUE;
7.207 +}
7.208 +
7.209 +gboolean maple_device_changed( GtkComboBox *combo, gpointer user_data )
7.210 +{
7.211 + maple_slot_data_t data = (maple_slot_data_t)user_data;
7.212 + int active = gtk_combo_box_get_active(combo);
7.213 + gtk_widget_set_sensitive(data->button, active != 0);
7.214 + if( active != 0 ) {
7.215 + gchar *devname = gtk_combo_box_get_active_text(combo);
7.216 + const maple_device_class_t devclz = maple_get_device_class(devname);
7.217 + assert(devclz != NULL);
7.218 + if( data->new_device != NULL ) {
7.219 + if( data->new_device->device_class != devclz ) {
7.220 + data->new_device->destroy(data->new_device);
7.221 + data->new_device = maple_new_device(devname);
7.222 + }
7.223 + } else {
7.224 + data->new_device = maple_new_device(devname);
7.225 + }
7.226 + } else {
7.227 + if( data->new_device != NULL && data->new_device != data->old_device ) {
7.228 + data->new_device->destroy(data->new_device);
7.229 + }
7.230 + data->new_device = NULL;
7.231 + }
7.232 + return TRUE;
7.233 +}
7.234 +
7.235 +void maple_dialog_done( GtkWidget *panel, gboolean isOK )
7.236 +{
7.237 + if( isOK ) {
7.238 + int i;
7.239 + for( i=0; i<MAX_DEVICES; i++ ) {
7.240 + if( maple_data[i].new_device != maple_data[i].old_device ) {
7.241 + if( maple_data[i].old_device != NULL ) {
7.242 + maple_detach_device(i,0);
7.243 + }
7.244 + if( maple_data[i].new_device != NULL ) {
7.245 + maple_attach_device(maple_data[i].new_device, i, 0 );
7.246 + }
7.247 + }
7.248 + }
7.249 + lxdream_save_config();
7.250 + } else {
7.251 + int i;
7.252 + for( i=0; i<MAX_DEVICES; i++ ) {
7.253 + if( maple_data[i].new_device != NULL &&
7.254 + maple_data[i].new_device != maple_data[i].old_device ) {
7.255 + maple_data[i].new_device->destroy(maple_data[i].new_device);
7.256 + }
7.257 + }
7.258 + }
7.259 +
7.260 +}
7.261 +
7.262 +GtkWidget *maple_panel_new()
7.263 +{
7.264 + GtkWidget *table = gtk_table_new(4, 3, TRUE);
7.265 + int i,j;
7.266 + const struct maple_device_class **devices = maple_get_device_classes();
7.267 +
7.268 + for( i=0; i< MAX_DEVICES; i++ ) {
7.269 + char buf[12];
7.270 + GtkWidget *combo, *button;
7.271 + int active = 0;
7.272 + maple_device_t device = maple_get_device(i,0);
7.273 + sprintf( buf, _("Slot %d."), i );
7.274 + gtk_table_attach_defaults( GTK_TABLE(table), gtk_label_new(buf), 0, 1, i, i+1 );
7.275 + combo = gtk_combo_box_new_text();
7.276 + gtk_combo_box_append_text( GTK_COMBO_BOX(combo), _("<empty>") );
7.277 + for( j=0; devices[j] != NULL; j++ ) {
7.278 + gtk_combo_box_append_text(GTK_COMBO_BOX(combo), devices[j]->name);
7.279 + if( device != NULL && device->device_class == devices[j] ) {
7.280 + active = j+1;
7.281 + }
7.282 + }
7.283 + gtk_combo_box_set_active(GTK_COMBO_BOX(combo), active);
7.284 + gtk_table_attach_defaults( GTK_TABLE(table), combo, 1, 2, i, i+1 );
7.285 + button = gtk_button_new_from_stock( GTK_STOCK_PROPERTIES );
7.286 + gtk_widget_set_sensitive(button, active != 0);
7.287 + gtk_table_attach_defaults( GTK_TABLE(table), button, 2, 3, i, i+1 );
7.288 +
7.289 + maple_data[i].old_device = device;
7.290 + maple_data[i].new_device = device;
7.291 + maple_data[i].combo = combo;
7.292 + maple_data[i].button = button;
7.293 + g_signal_connect( button, "clicked",
7.294 + G_CALLBACK( maple_properties_activated ), &maple_data[i] );
7.295 + g_signal_connect( combo, "changed",
7.296 + G_CALLBACK( maple_device_changed ), &maple_data[i] );
7.297 +
7.298 + }
7.299 + return table;
7.300 +}
7.301 +
7.302 +void maple_dialog_run( )
7.303 +{
7.304 + gtk_gui_run_property_dialog( _("Controller Settings"), maple_panel_new(), maple_dialog_done );
7.305 +}
8.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
8.2 +++ b/src/gtkui/debug_win.c Tue Nov 20 10:27:58 2007 +0000
8.3 @@ -0,0 +1,454 @@
8.4 +/**
8.5 + * $Id: debug_win.c,v 1.29 2007-11-10 04:45:29 nkeynes Exp $
8.6 + * This file is responsible for the main debugger gui frame.
8.7 + *
8.8 + * Copyright (c) 2005 Nathan Keynes.
8.9 + *
8.10 + * This program is free software; you can redistribute it and/or modify
8.11 + * it under the terms of the GNU General Public License as published by
8.12 + * the Free Software Foundation; either version 2 of the License, or
8.13 + * (at your option) any later version.
8.14 + *
8.15 + * This program is distributed in the hope that it will be useful,
8.16 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
8.17 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8.18 + * GNU General Public License for more details.
8.19 + */
8.20 +#include <stdlib.h>
8.21 +#include <stdarg.h>
8.22 +#include <stdio.h>
8.23 +#include <string.h>
8.24 +#include <math.h>
8.25 +#include <glib/gi18n.h>
8.26 +#include <gdk/gdkkeysyms.h>
8.27 +#include "mem.h"
8.28 +#include "cpu.h"
8.29 +#include "gtkui/gtkui.h"
8.30 +#include "sh4/sh4dasm.h"
8.31 +#include "aica/armdasm.h"
8.32 +
8.33 +GdkColor *msg_colors[] = { &gui_colour_error, &gui_colour_error, &gui_colour_warn,
8.34 + &gui_colour_normal,&gui_colour_debug, &gui_colour_trace };
8.35 +
8.36 +const cpu_desc_t cpu_list[4] = { &sh4_cpu_desc, &arm_cpu_desc, &armt_cpu_desc, NULL };
8.37 +
8.38 +void init_register_list( debug_window_t data );
8.39 +uint32_t row_to_address( debug_window_t data, int row );
8.40 +int address_to_row( debug_window_t data, uint32_t address );
8.41 +void set_disassembly_pc( debug_window_t data, unsigned int pc, gboolean select );
8.42 +void set_disassembly_region( debug_window_t data, unsigned int page );
8.43 +void set_disassembly_cpu( debug_window_t data, const gchar *cpu );
8.44 +
8.45 +void on_mode_field_changed ( GtkEditable *editable, gpointer user_data);
8.46 +gboolean on_page_field_key_press_event( GtkWidget * widget, GdkEventKey *event,
8.47 + gpointer user_data);
8.48 +void on_jump_pc_btn_clicked( GtkButton *button, gpointer user_data);
8.49 +void on_disasm_list_select_row (GtkCList *clist, gint row, gint column,
8.50 + GdkEvent *event, gpointer user_data);
8.51 +void on_disasm_list_unselect_row (GtkCList *clist, gint row, gint column,
8.52 + GdkEvent *event, gpointer user_data);
8.53 +gboolean on_debug_delete_event(GtkWidget *widget, GdkEvent event, gpointer user_data);
8.54 +
8.55 +struct debug_window_info {
8.56 + int disasm_from;
8.57 + int disasm_to;
8.58 + int disasm_pc;
8.59 + const struct cpu_desc_struct *cpu;
8.60 + const cpu_desc_t *cpu_list;
8.61 + GtkCList *regs_list;
8.62 + GtkCList *disasm_list;
8.63 + GtkEntry *page_field;
8.64 + GtkWidget *window;
8.65 + GtkWidget *statusbar;
8.66 + char saved_regs[0];
8.67 +};
8.68 +
8.69 +debug_window_t debug_window_new( const gchar *title, GtkWidget *menubar,
8.70 + GtkWidget *toolbar, GtkAccelGroup *accel_group )
8.71 +{
8.72 + debug_window_t data = g_malloc0( sizeof(struct debug_window_info) + cpu_list[0]->regs_size );
8.73 + GtkWidget *vbox;
8.74 +
8.75 + data->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
8.76 + gtk_window_set_default_size (GTK_WINDOW (data->window), 640, 480);
8.77 + gtk_window_set_title( GTK_WINDOW(data->window), title );
8.78 + gtk_window_add_accel_group (GTK_WINDOW (data->window), accel_group);
8.79 +
8.80 + gtk_toolbar_set_style( GTK_TOOLBAR(toolbar), GTK_TOOLBAR_ICONS );
8.81 +
8.82 + data->statusbar = gtk_statusbar_new();
8.83 +
8.84 + GtkWidget *hpaned = gtk_hpaned_new ();
8.85 + gtk_paned_set_position (GTK_PANED (hpaned), 800);
8.86 +
8.87 + GtkWidget *disasm_box = gtk_vbox_new(FALSE,0);
8.88 + gtk_paned_pack1 (GTK_PANED (hpaned), disasm_box, TRUE, TRUE);
8.89 +
8.90 + GtkWidget *hbox1 = gtk_hbox_new (FALSE, 0);
8.91 + gtk_box_pack_start (GTK_BOX (disasm_box), hbox1, FALSE, FALSE, 3);
8.92 + gtk_box_pack_start (GTK_BOX (hbox1), gtk_label_new (_("Page")), FALSE, FALSE, 4);
8.93 +
8.94 + data->page_field = GTK_ENTRY(gtk_entry_new ());
8.95 + gtk_box_pack_start (GTK_BOX (hbox1), GTK_WIDGET(data->page_field), FALSE, TRUE, 0);
8.96 +
8.97 + GtkWidget *jump_pc_btn = gtk_button_new_with_mnemonic (_(" Jump to PC "));
8.98 + gtk_box_pack_start (GTK_BOX (hbox1), jump_pc_btn, FALSE, FALSE, 4);
8.99 +
8.100 + gtk_box_pack_start (GTK_BOX (hbox1), gtk_label_new(_("Mode")), FALSE, FALSE, 5);
8.101 +
8.102 + GtkWidget *mode_box = gtk_combo_new ();
8.103 + gtk_box_pack_start (GTK_BOX (hbox1), mode_box, FALSE, FALSE, 0);
8.104 + GList *mode_box_items = NULL;
8.105 + mode_box_items = g_list_append (mode_box_items, (gpointer) _("SH4"));
8.106 + mode_box_items = g_list_append (mode_box_items, (gpointer) _("ARM7"));
8.107 + mode_box_items = g_list_append (mode_box_items, (gpointer) _("ARM7T"));
8.108 + gtk_combo_set_popdown_strings (GTK_COMBO (mode_box), mode_box_items);
8.109 + g_list_free (mode_box_items);
8.110 +
8.111 + GtkWidget *mode_field = GTK_COMBO (mode_box)->entry;
8.112 + gtk_editable_set_editable (GTK_EDITABLE (mode_field), FALSE);
8.113 +
8.114 + GtkWidget *disasm_scroll = gtk_scrolled_window_new (NULL, NULL);
8.115 + gtk_box_pack_start (GTK_BOX (disasm_box), disasm_scroll, TRUE, TRUE, 0);
8.116 + gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (disasm_scroll), GTK_SHADOW_IN);
8.117 + data->disasm_list = GTK_CLIST(gtk_clist_new (4));
8.118 + gtk_clist_set_column_width (GTK_CLIST (data->disasm_list), 0, 80);
8.119 + gtk_clist_set_column_width (GTK_CLIST (data->disasm_list), 2, 80);
8.120 + gtk_clist_set_column_width (GTK_CLIST (data->disasm_list), 3, 80);
8.121 + gtk_clist_set_column_width( data->disasm_list, 1, 16 );
8.122 + gtk_clist_column_titles_hide (GTK_CLIST (data->disasm_list));
8.123 + gtk_container_add (GTK_CONTAINER (disasm_scroll), GTK_WIDGET(data->disasm_list));
8.124 +
8.125 + GtkWidget *reg_scroll = gtk_scrolled_window_new (NULL, NULL);
8.126 + gtk_paned_pack2 (GTK_PANED (hpaned), reg_scroll, FALSE, TRUE);
8.127 + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (reg_scroll), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
8.128 + gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (reg_scroll), GTK_SHADOW_IN);
8.129 +
8.130 + data->regs_list = GTK_CLIST(gtk_clist_new (2));
8.131 + gtk_container_add (GTK_CONTAINER (reg_scroll), GTK_WIDGET(data->regs_list));
8.132 + gtk_clist_set_column_width (GTK_CLIST (data->regs_list), 0, 80);
8.133 + gtk_clist_set_column_width (GTK_CLIST (data->regs_list), 1, 80);
8.134 + gtk_clist_column_titles_hide (GTK_CLIST (data->regs_list));
8.135 + gtk_widget_modify_font( GTK_WIDGET(data->regs_list), gui_fixed_font );
8.136 +
8.137 + vbox = gtk_vbox_new(FALSE, 0);
8.138 + gtk_container_add( GTK_CONTAINER(data->window), vbox );
8.139 + gtk_box_pack_start( GTK_BOX(vbox), menubar, FALSE, FALSE, 0 );
8.140 + gtk_box_pack_start( GTK_BOX(vbox), toolbar, FALSE, FALSE, 0 );
8.141 + gtk_box_pack_start( GTK_BOX(vbox), hpaned, TRUE, TRUE, 0 );
8.142 + gtk_box_pack_start( GTK_BOX(vbox), data->statusbar, FALSE, FALSE, 0 );
8.143 +
8.144 + g_signal_connect ((gpointer) data->page_field, "key_press_event",
8.145 + G_CALLBACK (on_page_field_key_press_event),
8.146 + data);
8.147 + g_signal_connect ((gpointer) jump_pc_btn, "clicked",
8.148 + G_CALLBACK (on_jump_pc_btn_clicked),
8.149 + data);
8.150 + g_signal_connect ((gpointer) mode_field, "changed",
8.151 + G_CALLBACK (on_mode_field_changed),
8.152 + data);
8.153 + g_signal_connect ((gpointer) data->disasm_list, "select_row",
8.154 + G_CALLBACK (on_disasm_list_select_row),
8.155 + data);
8.156 + g_signal_connect ((gpointer) data->disasm_list, "unselect_row",
8.157 + G_CALLBACK (on_disasm_list_unselect_row),
8.158 + data);
8.159 + g_signal_connect ((gpointer) data->window, "delete_event",
8.160 + G_CALLBACK (on_debug_delete_event),
8.161 + data);
8.162 +
8.163 + data->disasm_from = -1;
8.164 + data->disasm_to = -1;
8.165 + data->disasm_pc = -1;
8.166 + data->cpu = cpu_list[0];
8.167 + data->cpu_list = cpu_list;
8.168 +
8.169 + init_register_list( data );
8.170 + gtk_object_set_data( GTK_OBJECT(data->window), "debug_data", data );
8.171 + set_disassembly_pc( data, *data->cpu->pc, FALSE );
8.172 + debug_window_set_running( data, FALSE );
8.173 +
8.174 + gtk_widget_show_all( data->window );
8.175 + return data;
8.176 +}
8.177 +
8.178 +void debug_window_show( debug_window_t data, gboolean show )
8.179 +{
8.180 + if( show ) {
8.181 + gtk_widget_show( data->window );
8.182 + } else {
8.183 + gtk_widget_hide( data->window );
8.184 + }
8.185 +}
8.186 +
8.187 +int debug_window_get_selected_row( debug_window_t data )
8.188 +{
8.189 + if( data->disasm_list->selection == NULL ) {
8.190 + return -1;
8.191 + } else {
8.192 + return GPOINTER_TO_INT(data->disasm_list->selection->data);
8.193 + }
8.194 +}
8.195 +
8.196 +void init_register_list( debug_window_t data )
8.197 +{
8.198 + int i;
8.199 + char buf[20];
8.200 + char *arr[2];
8.201 +
8.202 + gtk_clist_clear( data->regs_list );
8.203 + arr[1] = buf;
8.204 + for( i=0; data->cpu->regs_info[i].name != NULL; i++ ) {
8.205 + arr[0] = data->cpu->regs_info[i].name;
8.206 + if( data->cpu->regs_info->type == REG_INT )
8.207 + sprintf( buf, "%08X", *((uint32_t *)data->cpu->regs_info[i].value) );
8.208 + else
8.209 + sprintf( buf, "%f", *((float *)data->cpu->regs_info[i].value) );
8.210 + gtk_clist_append( data->regs_list, arr );
8.211 + }
8.212 +}
8.213 +
8.214 +/*
8.215 + * Check for changed registers and update the display
8.216 + */
8.217 +void debug_window_update( debug_window_t data )
8.218 +{
8.219 + int i;
8.220 + for( i=0; data->cpu->regs_info[i].name != NULL; i++ ) {
8.221 + if( data->cpu->regs_info[i].type == REG_INT ) {
8.222 + /* Yes this _is_ probably fairly evil */
8.223 + if( *((uint32_t *)data->cpu->regs_info[i].value) !=
8.224 + *((uint32_t *)((char *)data->saved_regs + ((char *)data->cpu->regs_info[i].value - (char *)data->cpu->regs))) ) {
8.225 + char buf[20];
8.226 + sprintf( buf, "%08X", *((uint32_t *)data->cpu->regs_info[i].value) );
8.227 + gtk_clist_set_text( data->regs_list, i, 1, buf );
8.228 + gtk_clist_set_foreground( data->regs_list, i, &gui_colour_changed );
8.229 + } else {
8.230 + gtk_clist_set_foreground( data->regs_list, i, &gui_colour_normal );
8.231 + }
8.232 + } else {
8.233 + if( *((float *)data->cpu->regs_info[i].value) !=
8.234 + *((float *)((char *)data->saved_regs + ((char *)data->cpu->regs_info[i].value - (char *)data->cpu->regs))) ) {
8.235 + char buf[20];
8.236 + sprintf( buf, "%f", *((float *)data->cpu->regs_info[i].value) );
8.237 + gtk_clist_set_text( data->regs_list, i, 1, buf );
8.238 + gtk_clist_set_foreground( data->regs_list, i, &gui_colour_changed );
8.239 + } else {
8.240 + gtk_clist_set_foreground( data->regs_list, i, &gui_colour_normal );
8.241 + }
8.242 + }
8.243 + }
8.244 +
8.245 + set_disassembly_pc( data, *data->cpu->pc, TRUE );
8.246 + memcpy( data->saved_regs, data->cpu->regs, data->cpu->regs_size );
8.247 +}
8.248 +
8.249 +void set_disassembly_region( debug_window_t data, unsigned int page )
8.250 +{
8.251 + uint32_t i, posn, next;
8.252 + char buf[80];
8.253 + char addr[10];
8.254 + char opcode[16] = "";
8.255 + char *arr[4] = { addr, " ", opcode, buf };
8.256 + unsigned int from = page & 0xFFFFF000;
8.257 + unsigned int to = from + 4096;
8.258 +
8.259 + gtk_clist_clear(data->disasm_list);
8.260 +
8.261 + sprintf( addr, "%08X", from );
8.262 + gtk_entry_set_text( data->page_field, addr );
8.263 +
8.264 + if( !data->cpu->is_valid_page_func( from ) ) {
8.265 + arr[3] = _("This page is currently unmapped");
8.266 + gtk_clist_append( data->disasm_list, arr );
8.267 + gtk_clist_set_foreground( data->disasm_list, 0, &gui_colour_error );
8.268 + } else {
8.269 + for( i=from; i<to; i = next ) {
8.270 + next = data->cpu->disasm_func( i, buf, sizeof(buf), opcode );
8.271 + sprintf( addr, "%08X", i );
8.272 + posn = gtk_clist_append( data->disasm_list, arr );
8.273 + if( buf[0] == '?' )
8.274 + gtk_clist_set_foreground( data->disasm_list, posn, &gui_colour_warn );
8.275 + if( data->cpu->get_breakpoint != NULL ) {
8.276 + int type = data->cpu->get_breakpoint( i );
8.277 + switch(type) {
8.278 + case BREAK_ONESHOT:
8.279 + gtk_clist_set_background( data->disasm_list, posn, &gui_colour_temp_break );
8.280 + break;
8.281 + case BREAK_KEEP:
8.282 + gtk_clist_set_background( data->disasm_list, posn, &gui_colour_break );
8.283 + break;
8.284 + }
8.285 + }
8.286 + }
8.287 + if( data->disasm_pc != -1 && data->disasm_pc >= from && data->disasm_pc < to )
8.288 + gtk_clist_set_foreground( data->disasm_list, address_to_row(data, data->disasm_pc),
8.289 + &gui_colour_pc );
8.290 + }
8.291 +
8.292 + if( page != from ) { /* not a page boundary */
8.293 + gtk_clist_moveto( data->disasm_list, (page-from)>>1, 0, 0.5, 0.0 );
8.294 + }
8.295 + data->disasm_from = from;
8.296 + data->disasm_to = to;
8.297 +}
8.298 +
8.299 +void jump_to_disassembly( debug_window_t data, unsigned int addr, gboolean select )
8.300 +{
8.301 + int row;
8.302 +
8.303 + if( addr < data->disasm_from || addr >= data->disasm_to )
8.304 + set_disassembly_region(data,addr);
8.305 +
8.306 + row = address_to_row( data, addr );
8.307 + if(select) {
8.308 + gtk_clist_select_row( data->disasm_list, row, 0 );
8.309 + }
8.310 + if( gtk_clist_row_is_visible( data->disasm_list, row ) != GTK_VISIBILITY_FULL ){
8.311 + gtk_clist_moveto( data->disasm_list, row, 0, 0.5, 0.0 );
8.312 + }
8.313 +}
8.314 +
8.315 +void jump_to_pc( debug_window_t data, gboolean select )
8.316 +{
8.317 + jump_to_disassembly( data, *data->cpu->pc, select );
8.318 +}
8.319 +
8.320 +void set_disassembly_pc( debug_window_t data, unsigned int pc, gboolean select )
8.321 +{
8.322 + int row;
8.323 +
8.324 + jump_to_disassembly( data, pc, select );
8.325 + if( data->disasm_pc != -1 && data->disasm_pc >= data->disasm_from &&
8.326 + data->disasm_pc < data->disasm_to )
8.327 + gtk_clist_set_foreground( data->disasm_list,
8.328 + (data->disasm_pc - data->disasm_from) / data->cpu->instr_size,
8.329 + &gui_colour_normal );
8.330 + row = address_to_row( data, pc );
8.331 + gtk_clist_set_foreground( data->disasm_list, row, &gui_colour_pc );
8.332 + data->disasm_pc = pc;
8.333 +}
8.334 +
8.335 +void set_disassembly_cpu( debug_window_t data, const gchar *cpu )
8.336 +{
8.337 + int i;
8.338 + for( i=0; data->cpu_list[i] != NULL; i++ ) {
8.339 + if( strcmp( data->cpu_list[i]->name, cpu ) == 0 ) {
8.340 + if( data->cpu != data->cpu_list[i] ) {
8.341 + data->cpu = data->cpu_list[i];
8.342 + data->disasm_from = data->disasm_to = -1; /* Force reload */
8.343 + set_disassembly_pc( data, *data->cpu->pc, FALSE );
8.344 + init_register_list( data );
8.345 + }
8.346 + return;
8.347 + }
8.348 + }
8.349 +}
8.350 +
8.351 +void debug_window_toggle_breakpoint( debug_window_t data, int row )
8.352 +{
8.353 + uint32_t pc = row_to_address( data, row );
8.354 + int oldType = data->cpu->get_breakpoint( pc );
8.355 + if( oldType != BREAK_NONE ) {
8.356 + data->cpu->clear_breakpoint( pc, oldType );
8.357 + gtk_clist_set_background( data->disasm_list, row, &gui_colour_white );
8.358 + } else {
8.359 + data->cpu->set_breakpoint( pc, BREAK_KEEP );
8.360 + gtk_clist_set_background( data->disasm_list, row, &gui_colour_break );
8.361 + }
8.362 +}
8.363 +
8.364 +void debug_window_set_oneshot_breakpoint( debug_window_t data, int row )
8.365 +{
8.366 + uint32_t pc = row_to_address( data, row );
8.367 + data->cpu->clear_breakpoint( pc, BREAK_ONESHOT );
8.368 + data->cpu->set_breakpoint( pc, BREAK_ONESHOT );
8.369 + gtk_clist_set_background( data->disasm_list, row, &gui_colour_temp_break );
8.370 +}
8.371 +
8.372 +/**
8.373 + * Execute a single instruction using the current CPU mode.
8.374 + */
8.375 +void debug_window_single_step( debug_window_t data )
8.376 +{
8.377 + data->cpu->step_func();
8.378 + gtk_gui_update();
8.379 +}
8.380 +
8.381 +uint32_t row_to_address( debug_window_t data, int row ) {
8.382 + return data->cpu->instr_size * row + data->disasm_from;
8.383 +}
8.384 +
8.385 +int address_to_row( debug_window_t data, uint32_t address ) {
8.386 + if( data->disasm_from > address || data->disasm_to <= address )
8.387 + return -1;
8.388 + return (address - data->disasm_from) / data->cpu->instr_size;
8.389 +}
8.390 +
8.391 +debug_window_t get_debug_info( GtkWidget *widget ) {
8.392 +
8.393 + GtkWidget *win = gtk_widget_get_toplevel(widget);
8.394 + debug_window_t data = (debug_window_t)gtk_object_get_data( GTK_OBJECT(win), "debug_data" );
8.395 + return data;
8.396 +}
8.397 +
8.398 +void debug_window_set_running( debug_window_t data, gboolean isRunning )
8.399 +{
8.400 + if( data != NULL ) {
8.401 + gtk_gui_enable_action( "SingleStep", !isRunning );
8.402 + gtk_gui_enable_action( "RunTo", !isRunning );
8.403 + }
8.404 +}
8.405 +
8.406 +void on_mode_field_changed ( GtkEditable *editable, gpointer user_data)
8.407 +{
8.408 + const gchar *text = gtk_entry_get_text( GTK_ENTRY(editable) );
8.409 + set_disassembly_cpu( gtk_gui_get_debugger(), text );
8.410 +}
8.411 +
8.412 +
8.413 +gboolean on_page_field_key_press_event( GtkWidget * widget, GdkEventKey *event,
8.414 + gpointer user_data)
8.415 +{
8.416 + if( event->keyval == GDK_Return || event->keyval == GDK_Linefeed ) {
8.417 + debug_window_t data = get_debug_info(widget);
8.418 + const gchar *text = gtk_entry_get_text( GTK_ENTRY(widget) );
8.419 + gchar *endptr;
8.420 + unsigned int val = strtoul( text, &endptr, 16 );
8.421 + if( text == endptr ) { /* invalid input */
8.422 + char buf[10];
8.423 + sprintf( buf, "%08X", row_to_address(data,0) );
8.424 + gtk_entry_set_text( GTK_ENTRY(widget), buf );
8.425 + } else {
8.426 + set_disassembly_region(data, val);
8.427 + }
8.428 + }
8.429 + return FALSE;
8.430 +}
8.431 +
8.432 +
8.433 +void on_jump_pc_btn_clicked( GtkButton *button, gpointer user_data)
8.434 +{
8.435 + debug_window_t data = get_debug_info( GTK_WIDGET(button) );
8.436 + jump_to_pc( data, TRUE );
8.437 +}
8.438 +
8.439 +void on_disasm_list_select_row (GtkCList *clist, gint row, gint column,
8.440 + GdkEvent *event, gpointer user_data)
8.441 +{
8.442 + gtk_gui_enable_action( "SetBreakpoint", TRUE );
8.443 + gtk_gui_enable_action( "RunTo", TRUE );
8.444 +}
8.445 +
8.446 +void on_disasm_list_unselect_row (GtkCList *clist, gint row, gint column,
8.447 + GdkEvent *event, gpointer user_data)
8.448 +{
8.449 + gtk_gui_enable_action( "SetBreakpoint", FALSE );
8.450 + gtk_gui_enable_action( "RunTo", FALSE );
8.451 +}
8.452 +
8.453 +gboolean on_debug_delete_event(GtkWidget *widget, GdkEvent event, gpointer user_data)
8.454 +{
8.455 + gtk_widget_hide( widget );
8.456 + return TRUE;
8.457 +}
9.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
9.2 +++ b/src/gtkui/dump_win.c Tue Nov 20 10:27:58 2007 +0000
9.3 @@ -0,0 +1,256 @@
9.4 +/**
9.5 + * $Id: dump_win.c,v 1.7 2007-10-31 12:23:19 nkeynes Exp $
9.6 + *
9.7 + * Implements the memory dump window.
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 +#include <ctype.h>
9.23 +#include <assert.h>
9.24 +#include <string.h>
9.25 +#include <glib/gi18n.h>
9.26 +#include "mem.h"
9.27 +#include "gtkui/gtkui.h"
9.28 +
9.29 +#define MAX_DUMP_SIZE 4096
9.30 +
9.31 +#define DUMP_WINDOW_TAG 0xD4B9DA7A
9.32 +
9.33 +struct dump_window_info {
9.34 + uint32_t _tag;
9.35 + uint32_t start;
9.36 + uint32_t end;
9.37 + int flags;
9.38 + unsigned char *data;
9.39 +
9.40 + GtkWidget *window;
9.41 + GtkWidget *fromInput, *toInput;
9.42 + GtkWidget *textArea;
9.43 + GtkTextTag *changedTag;
9.44 + GtkTextBuffer *textBuffer;
9.45 + struct dump_window_info *next;
9.46 +};
9.47 +
9.48 +static dump_window_t dump_list_head = NULL;
9.49 +
9.50 +gboolean on_dump_window_delete_event( GtkWidget *widget, GdkEvent *event,
9.51 + gpointer user_data );
9.52 +void on_dump_window_button_view_clicked( GtkWidget *widget, gpointer user_data );
9.53 +void dump_window_set_text( dump_window_t data, unsigned char *old_data, unsigned char *new_data );
9.54 +
9.55 +
9.56 +dump_window_t dump_window_new( const gchar *title )
9.57 +{
9.58 + GtkWidget *vbox3;
9.59 + GtkWidget *hbox2;
9.60 + GtkWidget *dump_view_button;
9.61 + GtkWidget *scrolledwindow9;
9.62 +
9.63 + dump_window_t dump = g_malloc0( sizeof( struct dump_window_info ) );
9.64 +
9.65 + dump->_tag = DUMP_WINDOW_TAG;
9.66 + dump->next = dump_list_head;
9.67 + dump_list_head = dump;
9.68 + dump->data = NULL;
9.69 + dump->start = 0;
9.70 + dump->end = 0;
9.71 + dump->window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
9.72 + gtk_window_set_title (GTK_WINDOW (dump->window), _("Memory dump"));
9.73 +
9.74 + vbox3 = gtk_vbox_new (FALSE, 0);
9.75 + gtk_container_add (GTK_CONTAINER (dump->window), vbox3);
9.76 +
9.77 + hbox2 = gtk_hbox_new (FALSE, 0);
9.78 + dump->fromInput = gtk_entry_new ();
9.79 + gtk_entry_set_text( GTK_ENTRY(dump->fromInput), "" );
9.80 + dump->toInput = gtk_entry_new ();
9.81 + gtk_entry_set_text( GTK_ENTRY(dump->toInput), "" );
9.82 + dump_view_button = gtk_button_new_with_mnemonic (_("View"));
9.83 +
9.84 + gtk_box_pack_start (GTK_BOX (hbox2), gtk_label_new(_(" From ")), FALSE, FALSE, 0);
9.85 + gtk_box_pack_start (GTK_BOX (hbox2), dump->fromInput, FALSE, TRUE, 0);
9.86 + gtk_box_pack_start (GTK_BOX (hbox2), gtk_label_new(_(" To ")), FALSE, FALSE, 0);
9.87 + gtk_box_pack_start (GTK_BOX (hbox2), dump->toInput, FALSE, TRUE, 0);
9.88 + gtk_box_pack_start (GTK_BOX (hbox2), dump_view_button, FALSE, FALSE, 0);
9.89 + gtk_box_pack_start (GTK_BOX (hbox2), gtk_label_new (_(" ")), TRUE, TRUE, 0);
9.90 + gtk_box_pack_start (GTK_BOX (vbox3), hbox2, FALSE, TRUE, 3);
9.91 +
9.92 + dump->textArea = gtk_text_view_new ();
9.93 + dump->textBuffer = gtk_text_buffer_new(NULL);
9.94 + dump->changedTag = gtk_text_buffer_create_tag(dump->textBuffer, "changed",
9.95 + "foreground", "blue", NULL);
9.96 + gtk_widget_modify_font(GTK_WIDGET(dump->textArea),gui_fixed_font);
9.97 + gtk_text_view_set_editable(GTK_TEXT_VIEW(dump->textArea), FALSE);
9.98 + gtk_text_view_set_buffer(GTK_TEXT_VIEW(dump->textArea), dump->textBuffer);
9.99 + scrolledwindow9 = gtk_scrolled_window_new (NULL, NULL);
9.100 + gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow9), GTK_SHADOW_IN);
9.101 + gtk_container_add (GTK_CONTAINER (scrolledwindow9), dump->textArea);
9.102 + gtk_box_pack_start (GTK_BOX (vbox3), scrolledwindow9, TRUE, TRUE, 0);
9.103 +
9.104 + g_signal_connect (dump->window, "delete_event",
9.105 + G_CALLBACK (on_dump_window_delete_event),
9.106 + dump);
9.107 + g_signal_connect (dump_view_button, "clicked",
9.108 + G_CALLBACK (on_dump_window_button_view_clicked),
9.109 + dump);
9.110 + gtk_widget_show_all( dump->window );
9.111 +
9.112 + return dump;
9.113 +}
9.114 +
9.115 +void gtk_entry_set_hex_value( GtkEntry *entry, uint32_t value )
9.116 +{
9.117 + char buf[10];
9.118 + sprintf( buf, "%08X", value );
9.119 + gtk_entry_set_text( entry, buf );
9.120 +}
9.121 +
9.122 +uint32_t gtk_entry_get_hex_value( GtkEntry *entry, uint32_t defaultValue )
9.123 +{
9.124 + const gchar *text = gtk_entry_get_text(entry);
9.125 + if( text == NULL )
9.126 + return defaultValue;
9.127 + gchar *endptr;
9.128 + uint32_t value = strtoul( text, &endptr, 16 );
9.129 + if( text == endptr ) { /* invalid input */
9.130 + value = defaultValue;
9.131 + gtk_entry_set_hex_value( entry, value );
9.132 + }
9.133 + return value;
9.134 +}
9.135 +
9.136 +gboolean on_dump_window_delete_event( GtkWidget *widget, GdkEvent *event,
9.137 + gpointer user_data )
9.138 +{
9.139 + dump_window_t data = (dump_window_t)user_data;
9.140 + if( data->data != NULL )
9.141 + free( data->data );
9.142 + dump_window_t node = dump_list_head;
9.143 + if( node == data )
9.144 + dump_list_head = data->next;
9.145 + else {
9.146 + while( node->next != data ) {
9.147 + node = node->next;
9.148 + assert( node != NULL );
9.149 + }
9.150 + node->next = data->next;
9.151 + }
9.152 + free( data );
9.153 + return FALSE;
9.154 +}
9.155 +
9.156 +void on_dump_window_button_view_clicked( GtkWidget *widget, gpointer user_data )
9.157 +{
9.158 + dump_window_t data = (dump_window_t)user_data;
9.159 + uint32_t startVal, endVal;
9.160 +
9.161 + assert( data != NULL );
9.162 + assert( data->_tag == DUMP_WINDOW_TAG );
9.163 +
9.164 + startVal = gtk_entry_get_hex_value(GTK_ENTRY(data->fromInput), data->start);
9.165 + endVal = gtk_entry_get_hex_value(GTK_ENTRY(data->toInput), data->end);
9.166 + if( startVal != data->start || endVal != data->end ) {
9.167 + if( startVal > endVal ) {
9.168 + int tmp = endVal;
9.169 + endVal = startVal;
9.170 + startVal = tmp;
9.171 + }
9.172 + if( endVal > startVal + MAX_DUMP_SIZE )
9.173 + endVal = startVal + MAX_DUMP_SIZE;
9.174 +
9.175 + gtk_entry_set_hex_value(GTK_ENTRY(data->fromInput),startVal);
9.176 + gtk_entry_set_hex_value(GTK_ENTRY(data->toInput),endVal);
9.177 + data->start = startVal;
9.178 + data->end = endVal;
9.179 +
9.180 + if( data->data != NULL ) {
9.181 + free( data->data );
9.182 + data->data = NULL;
9.183 + }
9.184 + if( startVal != endVal ) {
9.185 + data->data = malloc( endVal - startVal );
9.186 + mem_copy_from_sh4( data->data, startVal, endVal-startVal );
9.187 + dump_window_set_text( data, data->data, data->data );
9.188 + }
9.189 + }
9.190 +}
9.191 +
9.192 +void dump_window_update( dump_window_t data )
9.193 +{
9.194 + if( data->data == NULL )
9.195 + return;
9.196 + unsigned char tmp[data->end-data->start];
9.197 + int length = data->end-data->start;
9.198 + memcpy( tmp, data->data, length );
9.199 + mem_copy_from_sh4( data->data, data->start, length );
9.200 + dump_window_set_text( data, tmp, data->data );
9.201 +}
9.202 +
9.203 +void dump_window_update_all( )
9.204 +{
9.205 + dump_window_t node = dump_list_head;
9.206 + while( node != NULL ) {
9.207 + dump_window_update(node);
9.208 + node = node->next;
9.209 + }
9.210 +}
9.211 +
9.212 +void dump_window_set_text( dump_window_t data, unsigned char *old_data, unsigned char *new_data )
9.213 +{
9.214 + GtkTextBuffer *buf = data->textBuffer;
9.215 + GtkTextTag *changedTag = data->changedTag;
9.216 + GtkTextIter iter, endIter;
9.217 + int i, j, offset;
9.218 + /* Clear out the buffer */
9.219 + gtk_text_buffer_get_start_iter(buf,&iter);
9.220 + gtk_text_buffer_get_end_iter(buf,&endIter);
9.221 + gtk_text_buffer_delete(buf,&iter,&endIter);
9.222 + gtk_text_buffer_get_start_iter(buf,&iter);
9.223 +
9.224 + for( offset = 0, i=data->start; i<data->end; i+=16, offset+=16 ) {
9.225 + char text[80];
9.226 + sprintf(text, "%08X:", i );
9.227 + gtk_text_buffer_insert( buf, &iter, text, 9 );
9.228 + for( j=0; j<16; j++ ) {
9.229 + if( j%4 == 0 )
9.230 + gtk_text_buffer_insert( buf, &iter, " ", 1 );
9.231 + if( i+j < data->end ) {
9.232 + int oldVal = ((int)old_data[offset+j])&0xFF;
9.233 + int newVal = ((int)new_data[offset+j])&0xFF;
9.234 + sprintf(text, "%02X ", newVal);
9.235 + if( oldVal == newVal )
9.236 + gtk_text_buffer_insert( buf, &iter, text, 3 );
9.237 + else
9.238 + gtk_text_buffer_insert_with_tags( buf, &iter, text, 3,
9.239 + changedTag, NULL );
9.240 + } else {
9.241 + gtk_text_buffer_insert( buf, &iter, " ", 3 );
9.242 + }
9.243 + }
9.244 + gtk_text_buffer_insert( buf, &iter, " ", 2 );
9.245 + for( j=0; j<16 && i+j < data->end; j++ ) {
9.246 + int oldVal = ((int)old_data[offset+j])&0xFF;
9.247 + int newVal = ((int)new_data[offset+j])&0xFF;
9.248 + if( isprint(newVal) )
9.249 + sprintf( text, "%c", newVal );
9.250 + else strcpy( text, "." );
9.251 + if( oldVal == newVal )
9.252 + gtk_text_buffer_insert( buf, &iter, text, 1 );
9.253 + else
9.254 + gtk_text_buffer_insert_with_tags( buf, &iter, text, 1,
9.255 + changedTag, NULL );
9.256 + }
9.257 + gtk_text_buffer_insert( buf, &iter, "\n", 1 );
9.258 + }
9.259 +}
10.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
10.2 +++ b/src/gtkui/gdrom_menu.c Tue Nov 20 10:27:58 2007 +0000
10.3 @@ -0,0 +1,240 @@
10.4 +/**
10.5 + * $Id: gdrom_menu.c,v 1.5 2007-11-10 04:45:29 nkeynes Exp $
10.6 + *
10.7 + * Creates and manages the GD-Rom attachment menu.
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 +
10.22 +#include <assert.h>
10.23 +#include <libgen.h>
10.24 +#include <glib/gi18n.h>
10.25 +
10.26 +#include "dream.h"
10.27 +#include "dreamcast.h"
10.28 +#include "config.h"
10.29 +#include "gdrom/gdrom.h"
10.30 +#include "gtkui/gtkui.h"
10.31 +
10.32 +#define MAX_RECENT_ITEMS 5
10.33 +
10.34 +static GList *gdrom_menu_list = NULL;
10.35 +static gboolean gdrom_menu_adjusting = FALSE;
10.36 +static GList *gdrom_device_list = NULL;
10.37 +static GList *gdrom_recent_list = NULL;
10.38 +
10.39 +void gdrom_menu_rebuild_all();
10.40 +
10.41 +
10.42 +gint gdrom_menu_find_item( const gchar *name )
10.43 +{
10.44 + gint posn = 0;
10.45 + GList *ptr;
10.46 +
10.47 + for( ptr = gdrom_device_list; ptr != NULL; ptr = g_list_next(ptr) ) {
10.48 + gchar *device = (gchar *)ptr->data;
10.49 + posn++;
10.50 + if( strcmp(device, name) == 0 ) {
10.51 + return posn;
10.52 + }
10.53 + }
10.54 + posn++;
10.55 + for( ptr = gdrom_recent_list; ptr != NULL; ptr = g_list_next(ptr) ) {
10.56 + gchar *file = (gchar *)ptr->data;
10.57 + posn++;
10.58 + if( strcmp(file, name) == 0 ) {
10.59 + return posn;
10.60 + }
10.61 + }
10.62 + return -1;
10.63 +}
10.64 +
10.65 +gint gdrom_menu_add_recent_item( const gchar *name )
10.66 +{
10.67 + gdrom_recent_list = g_list_prepend( gdrom_recent_list, g_strdup(name) );
10.68 + if( g_list_length(gdrom_recent_list) > MAX_RECENT_ITEMS ) {
10.69 + GList *ptr = g_list_nth( gdrom_recent_list, MAX_RECENT_ITEMS );
10.70 + g_free( ptr->data );
10.71 + gdrom_recent_list = g_list_remove( gdrom_recent_list, ptr->data );
10.72 + }
10.73 +
10.74 + GList *ptr;
10.75 + int size = 0;
10.76 + for( ptr = gdrom_recent_list; ptr != NULL; ptr = g_list_next(ptr) ) {
10.77 + size += strlen( (gchar *)ptr->data ) + 1;
10.78 + }
10.79 + char buf[size];
10.80 + strcpy( buf, (gchar *)gdrom_recent_list->data );
10.81 + ptr = g_list_next(gdrom_recent_list);
10.82 + while( ptr != NULL ) {
10.83 + strcat( buf, ":" );
10.84 + strcat( buf, (gchar *)ptr->data );
10.85 + ptr = g_list_next(ptr);
10.86 + }
10.87 + lxdream_set_global_config_value( CONFIG_RECENT, buf );
10.88 + lxdream_save_config();
10.89 +
10.90 + return g_list_length( gdrom_device_list ) + 2; // menu posn of new item
10.91 +}
10.92 +
10.93 +void gdrom_menu_update_all()
10.94 +{
10.95 + gdrom_disc_t disc = gdrom_get_current_disc();
10.96 + gint posn = 0;
10.97 + GList *ptr;
10.98 +
10.99 + gdrom_menu_adjusting = TRUE;
10.100 +
10.101 + if( disc != NULL ) {
10.102 + posn = gdrom_menu_find_item( disc->name );
10.103 + if( posn == -1 ) {
10.104 + posn = gdrom_menu_add_recent_item( disc->name );
10.105 + gdrom_menu_rebuild_all();
10.106 + }
10.107 + }
10.108 +
10.109 + for( ptr = gdrom_menu_list; ptr != NULL; ptr = g_list_next(ptr) ) {
10.110 + GtkWidget *menu = GTK_WIDGET(ptr->data);
10.111 + GList *children = gtk_container_get_children( GTK_CONTAINER(menu) );
10.112 + GList *item = g_list_nth( children, posn );
10.113 + assert( item != NULL );
10.114 + gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM(item->data), TRUE );
10.115 + g_list_free(children);
10.116 + }
10.117 +
10.118 + gdrom_menu_adjusting = FALSE;
10.119 +}
10.120 +
10.121 +void gdrom_menu_empty_callback( GtkWidget *widget, gpointer user_data )
10.122 +{
10.123 + if( !gdrom_menu_adjusting ) {
10.124 + gdrom_unmount_disc();
10.125 + gdrom_menu_update_all();
10.126 + lxdream_set_global_config_value( CONFIG_GDROM, NULL );
10.127 + lxdream_save_config();
10.128 + }
10.129 +}
10.130 +
10.131 +gboolean gdrom_menu_open_file( const char *filename )
10.132 +{
10.133 + gboolean result = FALSE;
10.134 + if( filename != NULL ) {
10.135 + result = gdrom_mount_image(filename);
10.136 + }
10.137 + if( result ) {
10.138 + gdrom_menu_update_all();
10.139 + lxdream_set_global_config_value( CONFIG_GDROM, filename );
10.140 + lxdream_save_config();
10.141 + }
10.142 + return result;
10.143 +}
10.144 +
10.145 +void gdrom_menu_open_image_callback( GtkWidget *widget, gpointer user_data )
10.146 +{
10.147 + if( !gdrom_menu_adjusting ) {
10.148 + const gchar *dir = lxdream_get_config_value(CONFIG_DEFAULT_PATH);
10.149 + open_file_dialog( _("Open..."), gdrom_menu_open_file, NULL, NULL, dir );
10.150 + }
10.151 +}
10.152 +
10.153 +
10.154 +void gdrom_menu_open_specified_callback( GtkWidget *widget, gpointer user_data )
10.155 +{
10.156 + if( !gdrom_menu_adjusting ) {
10.157 + gdrom_menu_open_file( (gchar *)user_data );
10.158 + }
10.159 +}
10.160 +
10.161 +void gdrom_menu_build( GtkWidget *menu )
10.162 +{
10.163 + GSList *group = NULL;
10.164 + GtkWidget *empty = gtk_radio_menu_item_new_with_label( group, _("Empty") );
10.165 + group = gtk_radio_menu_item_get_group( GTK_RADIO_MENU_ITEM(empty) );
10.166 + g_signal_connect_after( empty, "activate", G_CALLBACK(gdrom_menu_empty_callback), NULL );
10.167 + gtk_menu_shell_append( GTK_MENU_SHELL(menu), empty );
10.168 +
10.169 + GList *ptr;
10.170 + for( ptr = gdrom_device_list; ptr != NULL; ptr = g_list_next(ptr) ) {
10.171 + gchar *name = (gchar *)ptr->data;
10.172 + GtkWidget *item = gtk_radio_menu_item_new_with_label( group, name);
10.173 + gtk_widget_set_name( item, name );
10.174 + group = gtk_radio_menu_item_get_group( GTK_RADIO_MENU_ITEM(item) );
10.175 + g_signal_connect_after( item, "activate", G_CALLBACK(gdrom_menu_open_specified_callback),
10.176 + name );
10.177 + gtk_menu_shell_append( GTK_MENU_SHELL(menu), item );
10.178 + }
10.179 +
10.180 + if( gdrom_recent_list != NULL ) {
10.181 + gtk_menu_shell_append( GTK_MENU_SHELL(menu), gtk_separator_menu_item_new() );
10.182 + for( ptr = gdrom_recent_list; ptr != NULL; ptr = g_list_next(ptr) ) {
10.183 + gchar *path = (gchar *)ptr->data;
10.184 + gchar *name = basename(path);
10.185 + GtkWidget *item = gtk_radio_menu_item_new_with_label( group, name );
10.186 + gtk_widget_set_name( item, path );
10.187 + group = gtk_radio_menu_item_get_group( GTK_RADIO_MENU_ITEM(item) );
10.188 + g_signal_connect_after( item, "activate", G_CALLBACK(gdrom_menu_open_specified_callback),
10.189 + path );
10.190 + gtk_menu_shell_append( GTK_MENU_SHELL(menu), item );
10.191 +
10.192 + }
10.193 + }
10.194 + gtk_menu_shell_append( GTK_MENU_SHELL(menu), gtk_separator_menu_item_new() );
10.195 + GtkWidget *open = gtk_image_menu_item_new_with_label( _("Open image file...") );
10.196 + g_signal_connect_after( open, "activate", G_CALLBACK(gdrom_menu_open_image_callback), NULL );
10.197 + gtk_menu_shell_append( GTK_MENU_SHELL(menu), open );
10.198 + gtk_widget_show_all(menu);
10.199 +}
10.200 +
10.201 +GtkWidget *gdrom_menu_new()
10.202 +{
10.203 + GtkWidget *menu = gtk_menu_new();
10.204 + gtk_menu_set_title( GTK_MENU(menu), _("GD-Rom Settings") );
10.205 +
10.206 + gdrom_menu_build(menu);
10.207 +
10.208 + gdrom_menu_list = g_list_append(gdrom_menu_list, menu);
10.209 + gtk_widget_show_all(menu);
10.210 + gdrom_menu_update_all();
10.211 + return menu;
10.212 +}
10.213 +
10.214 +void gdrom_menu_rebuild_all()
10.215 +{
10.216 + GList *ptr;
10.217 +
10.218 + for( ptr = gdrom_menu_list; ptr != NULL; ptr = g_list_next(ptr) ) {
10.219 + GtkWidget *menu = GTK_WIDGET(ptr->data);
10.220 + GList *children = gtk_container_get_children( GTK_CONTAINER(menu) );
10.221 + GList *listptr;
10.222 + for( listptr = children; listptr != NULL; listptr = g_list_next(listptr) ) {
10.223 + gtk_widget_destroy( GTK_WIDGET(listptr->data) );
10.224 + }
10.225 + g_list_free(children);
10.226 + gdrom_menu_build(menu);
10.227 + }
10.228 + gdrom_menu_update_all();
10.229 +}
10.230 +
10.231 +void gdrom_menu_init()
10.232 +{
10.233 + const gchar *recent = lxdream_get_config_value( CONFIG_RECENT );
10.234 + gdrom_device_list = gdrom_get_native_devices();
10.235 + if( recent != NULL ) {
10.236 + gchar **list = g_strsplit(recent, ":", 5);
10.237 + int i;
10.238 + for( i=0; list[i] != NULL; i++ ) {
10.239 + gdrom_recent_list = g_list_append( gdrom_recent_list, g_strdup(list[i]) );
10.240 + }
10.241 + g_strfreev(list);
10.242 + }
10.243 +}
11.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
11.2 +++ b/src/gtkui/gtkcb.c Tue Nov 20 10:27:58 2007 +0000
11.3 @@ -0,0 +1,260 @@
11.4 +/**
11.5 + * $Id: gtkcb.c,v 1.9 2007-11-10 04:45:29 nkeynes Exp $
11.6 + *
11.7 + * Action callbacks from the main window
11.8 + *
11.9 + * Copyright (c) 2005 Nathan Keynes.
11.10 + *
11.11 + * This program is free software; you can redistribute it and/or modify
11.12 + * it under the terms of the GNU General Public License as published by
11.13 + * the Free Software Foundation; either version 2 of the License, or
11.14 + * (at your option) any later version.
11.15 + *
11.16 + * This program is distributed in the hope that it will be useful,
11.17 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
11.18 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11.19 + * GNU General Public License for more details.
11.20 + */
11.21 +
11.22 +#include "dream.h"
11.23 +#include "config.h"
11.24 +#include "dreamcast.h"
11.25 +#include "gdrom/gdrom.h"
11.26 +#include "gtkui/gtkui.h"
11.27 +#include "pvr2/pvr2.h"
11.28 +
11.29 +
11.30 +
11.31 +static void add_file_pattern( GtkFileChooser *chooser, char *pattern, char *patname )
11.32 +{
11.33 + if( pattern != NULL ) {
11.34 + GtkFileFilter *filter = gtk_file_filter_new();
11.35 + gtk_file_filter_add_pattern( filter, pattern );
11.36 + gtk_file_filter_set_name( filter, patname );
11.37 + gtk_file_chooser_add_filter( chooser, filter );
11.38 + filter = gtk_file_filter_new();
11.39 + gtk_file_filter_set_name( filter, _("All files") );
11.40 + gtk_file_filter_add_pattern( filter, "*" );
11.41 + gtk_file_chooser_add_filter( chooser, filter );
11.42 + }
11.43 +}
11.44 +
11.45 +void open_file_dialog( char *title, file_callback_t action, char *pattern, char *patname,
11.46 + gchar const *initial_dir )
11.47 +{
11.48 + GtkWidget *file;
11.49 + file = gtk_file_chooser_dialog_new( title, NULL,
11.50 + GTK_FILE_CHOOSER_ACTION_OPEN,
11.51 + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
11.52 + GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
11.53 + NULL );
11.54 + add_file_pattern( GTK_FILE_CHOOSER(file), pattern, patname );
11.55 + gtk_file_chooser_set_current_folder( GTK_FILE_CHOOSER(file), initial_dir );
11.56 + gtk_window_set_modal( GTK_WINDOW(file), TRUE );
11.57 + gtk_dialog_set_default_response( GTK_DIALOG(file), GTK_RESPONSE_ACCEPT );
11.58 + int result = gtk_dialog_run( GTK_DIALOG(file) );
11.59 + if( result == GTK_RESPONSE_ACCEPT ) {
11.60 + gchar *filename = gtk_file_chooser_get_filename( GTK_FILE_CHOOSER(file) );
11.61 + action( filename );
11.62 + }
11.63 + gtk_widget_destroy(file);
11.64 +}
11.65 +
11.66 +void save_file_dialog( char *title, file_callback_t action, char *pattern, char *patname,
11.67 + gchar const *initial_dir )
11.68 +{
11.69 + GtkWidget *file;
11.70 + file = gtk_file_chooser_dialog_new( title, NULL,
11.71 + GTK_FILE_CHOOSER_ACTION_SAVE,
11.72 + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
11.73 + GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
11.74 + NULL );
11.75 + add_file_pattern( GTK_FILE_CHOOSER(file), pattern, patname );
11.76 + gtk_file_chooser_set_current_folder( GTK_FILE_CHOOSER(file), initial_dir );
11.77 + gtk_window_set_modal( GTK_WINDOW(file), TRUE );
11.78 + gtk_dialog_set_default_response( GTK_DIALOG(file), GTK_RESPONSE_ACCEPT );
11.79 + int result = gtk_dialog_run( GTK_DIALOG(file) );
11.80 + if( result == GTK_RESPONSE_ACCEPT ) {
11.81 + gchar *filename = gtk_file_chooser_get_filename( GTK_FILE_CHOOSER(file) );
11.82 + action( filename );
11.83 + }
11.84 + gtk_widget_destroy(file);
11.85 +}
11.86 +
11.87 +void mount_action_callback( GtkAction *action, gpointer user_data)
11.88 +{
11.89 + const gchar *dir = lxdream_get_config_value(CONFIG_DEFAULT_PATH);
11.90 + open_file_dialog( "Open...", gdrom_mount_image, NULL, NULL, dir );
11.91 +}
11.92 +void reset_action_callback( GtkAction *action, gpointer user_data)
11.93 +{
11.94 + dreamcast_reset();
11.95 +}
11.96 +
11.97 +void pause_action_callback( GtkAction *action, gpointer user_data)
11.98 +{
11.99 + dreamcast_stop();
11.100 +}
11.101 +
11.102 +void resume_action_callback( GtkAction *action, gpointer user_data)
11.103 +{
11.104 + dreamcast_run();
11.105 +}
11.106 +
11.107 +void load_state_preview_callback( GtkFileChooser *chooser, gpointer user_data )
11.108 +{
11.109 + GtkWidget *preview = GTK_WIDGET(user_data);
11.110 + gchar *filename = gtk_file_chooser_get_preview_filename(chooser);
11.111 +
11.112 + frame_buffer_t data = dreamcast_load_preview(filename);
11.113 + if( data != NULL ) {
11.114 + GdkPixbuf *pixbuf = gdk_pixbuf_new_from_frame_buffer(data);
11.115 + GdkPixbuf *scaled = gdk_pixbuf_scale_simple(pixbuf, 320, 240,
11.116 + GDK_INTERP_BILINEAR);
11.117 + g_object_unref(pixbuf);
11.118 + gtk_image_set_from_pixbuf( GTK_IMAGE(preview), scaled );
11.119 + g_object_unref(scaled);
11.120 + gtk_widget_show(preview);
11.121 + } else {
11.122 + gtk_widget_hide(preview);
11.123 + }
11.124 +}
11.125 +
11.126 +void load_state_action_callback( GtkAction *action, gpointer user_data)
11.127 +{
11.128 + GtkWidget *file, *preview, *frame, *align;
11.129 + GtkRequisition size;
11.130 + const gchar *dir = lxdream_get_config_value(CONFIG_SAVE_PATH);
11.131 + file = gtk_file_chooser_dialog_new( _("Load state..."), NULL,
11.132 + GTK_FILE_CHOOSER_ACTION_OPEN,
11.133 + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
11.134 + GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
11.135 + NULL );
11.136 + add_file_pattern( GTK_FILE_CHOOSER(file), "*.dst", _("lxDream Save State (*.dst)") );
11.137 + gtk_object_set_data( GTK_OBJECT(file), "file_action", action );
11.138 +
11.139 + preview = gtk_image_new( );
11.140 +
11.141 + frame = gtk_frame_new(NULL);
11.142 + gtk_frame_set_shadow_type( GTK_FRAME(frame), GTK_SHADOW_IN );
11.143 + gtk_container_add( GTK_CONTAINER(frame), preview );
11.144 + gtk_widget_show(frame);
11.145 + gtk_widget_size_request(frame, &size);
11.146 + gtk_widget_set_size_request(frame, size.width + 320, size.height + 240);
11.147 + align = gtk_alignment_new(0.5, 0.5, 0, 0 );
11.148 + gtk_container_add( GTK_CONTAINER(align), frame );
11.149 + gtk_widget_show( align );
11.150 + gtk_file_chooser_set_preview_widget(GTK_FILE_CHOOSER(file), align);
11.151 + g_signal_connect( file, "update-preview", G_CALLBACK(load_state_preview_callback),
11.152 + preview );
11.153 + gtk_file_chooser_set_current_folder( GTK_FILE_CHOOSER(file), dir );
11.154 + gtk_window_set_modal( GTK_WINDOW(file), TRUE );
11.155 + int result = gtk_dialog_run( GTK_DIALOG(file) );
11.156 + if( result == GTK_RESPONSE_ACCEPT ) {
11.157 + gchar *filename = gtk_file_chooser_get_filename( GTK_FILE_CHOOSER(file) );
11.158 + dreamcast_load_state( filename );
11.159 + }
11.160 + gtk_widget_destroy(file);
11.161 +}
11.162 +
11.163 +void save_state_action_callback( GtkAction *action, gpointer user_data)
11.164 +{
11.165 + const gchar *dir = lxdream_get_config_value(CONFIG_SAVE_PATH);
11.166 + save_file_dialog( "Save state...", dreamcast_save_state, "*.dst", _("lxDream Save State (*.dst)"), dir );
11.167 +}
11.168 +void about_action_callback( GtkAction *action, gpointer user_data)
11.169 +{
11.170 +
11.171 + GtkWidget *dialog = g_object_new (GTK_TYPE_ABOUT_DIALOG,
11.172 + "name", APP_NAME,
11.173 + "version", APP_VERSION,
11.174 + "copyright", "(C) 2003-2007 Nathan Keynes",
11.175 + NULL);
11.176 + gtk_window_set_modal(GTK_WINDOW(dialog), TRUE);
11.177 + gtk_dialog_run(GTK_DIALOG(dialog));
11.178 + gtk_widget_destroy(dialog);
11.179 +
11.180 +}
11.181 +
11.182 +void exit_action_callback( GtkAction *action, gpointer user_data)
11.183 +{
11.184 + exit(0);
11.185 +}
11.186 +
11.187 +void path_settings_callback( GtkAction *action, gpointer user_data)
11.188 +{
11.189 + path_dialog_run();
11.190 +}
11.191 +
11.192 +void audio_settings_callback( GtkAction *action, gpointer user_data)
11.193 +{
11.194 +}
11.195 +
11.196 +void maple_settings_callback( GtkAction *action, gpointer user_data)
11.197 +{
11.198 + maple_dialog_run( );
11.199 +}
11.200 +
11.201 +void network_settings_callback( GtkAction *action, gpointer user_data)
11.202 +{
11.203 +}
11.204 +
11.205 +void video_settings_callback( GtkAction *action, gpointer user_data)
11.206 +{
11.207 +}
11.208 +
11.209 +void fullscreen_toggle_callback( GtkToggleAction *action, gpointer user_data)
11.210 +{
11.211 + main_window_set_fullscreen(gtk_gui_get_main(), gtk_toggle_action_get_active(action));
11.212 +}
11.213 +
11.214 +void debugger_action_callback( GtkAction *action, gpointer user_data)
11.215 +{
11.216 + gtk_gui_show_debugger();
11.217 +}
11.218 +
11.219 +void debug_memory_action_callback( GtkAction *action, gpointer user_data)
11.220 +{
11.221 + gchar *title = g_strdup_printf( APP_NAME " " APP_VERSION " :: %s", _("Memory dump") );
11.222 + dump_window_new( title );
11.223 + g_free(title);
11.224 +}
11.225 +
11.226 +void debug_mmio_action_callback( GtkAction *action, gpointer user_data)
11.227 +{
11.228 + gtk_gui_show_mmio();
11.229 +}
11.230 +
11.231 +void save_scene_action_callback( GtkAction *action, gpointer user_data)
11.232 +{
11.233 + const gchar *dir = lxdream_get_config_value(CONFIG_SAVE_PATH);
11.234 + save_file_dialog( _("Save next scene..."), pvr2_save_next_scene, "*.dsc", _("lxdream scene file (*.dsc)"), dir );
11.235 +}
11.236 +
11.237 +int debug_window_get_selected_row( debug_window_t data );
11.238 +
11.239 +void debug_step_action_callback( GtkAction *action, gpointer user_data)
11.240 +{
11.241 + debug_window_single_step(gtk_gui_get_debugger());
11.242 +}
11.243 +
11.244 +void debug_runto_action_callback( GtkAction *action, gpointer user_data)
11.245 +{
11.246 + debug_window_t debug = gtk_gui_get_debugger();
11.247 + int selected_row = debug_window_get_selected_row(debug);
11.248 + if( selected_row == -1 ) {
11.249 + WARN( _("No address selected, so can't run to it"), NULL );
11.250 + } else {
11.251 + debug_window_set_oneshot_breakpoint( debug, selected_row );
11.252 + dreamcast_run();
11.253 + }
11.254 +}
11.255 +
11.256 +void debug_breakpoint_action_callback( GtkAction *action, gpointer user_data)
11.257 +{
11.258 + debug_window_t debug = gtk_gui_get_debugger();
11.259 + int selected_row = debug_window_get_selected_row(debug);
11.260 + if( selected_row != -1 ) {
11.261 + debug_window_toggle_breakpoint( debug, selected_row );
11.262 + }
11.263 +}
12.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
12.2 +++ b/src/gtkui/gtkui.c Tue Nov 20 10:27:58 2007 +0000
12.3 @@ -0,0 +1,468 @@
12.4 +/**
12.5 + * $Id: gtkui.c,v 1.12 2007-11-10 04:45:29 nkeynes Exp $
12.6 + *
12.7 + * Core GTK-based user interface
12.8 + *
12.9 + * Copyright (c) 2005 Nathan Keynes.
12.10 + *
12.11 + * This program is free software; you can redistribute it and/or modify
12.12 + * it under the terms of the GNU General Public License as published by
12.13 + * the Free Software Foundation; either version 2 of the License, or
12.14 + * (at your option) any later version.
12.15 + *
12.16 + * This program is distributed in the hope that it will be useful,
12.17 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
12.18 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12.19 + * GNU General Public License for more details.
12.20 + */
12.21 +
12.22 +#include "lxdream.h"
12.23 +#include <sys/time.h>
12.24 +#include <time.h>
12.25 +#include <glib/gi18n.h>
12.26 +#include "dreamcast.h"
12.27 +#include "display.h"
12.28 +#include "gdrom/gdrom.h"
12.29 +#include "gtkui/gtkui.h"
12.30 +
12.31 +
12.32 +void gtk_gui_start( void );
12.33 +void gtk_gui_stop( void );
12.34 +void gtk_gui_alloc_resources ( void );
12.35 +uint32_t gtk_gui_run_slice( uint32_t nanosecs );
12.36 +
12.37 +struct dreamcast_module gtk_gui_module = { "gui", NULL,
12.38 + gtk_gui_update,
12.39 + gtk_gui_start,
12.40 + gtk_gui_run_slice,
12.41 + gtk_gui_stop,
12.42 + NULL, NULL };
12.43 +
12.44 +/**
12.45 + * Single-instance windows (at most one)
12.46 + */
12.47 +static main_window_t main_win = NULL;
12.48 +static debug_window_t debug_win = NULL;
12.49 +static mmio_window_t mmio_win = NULL;
12.50 +
12.51 +/**
12.52 + * UIManager and action helpers
12.53 + */
12.54 +static GtkUIManager *global_ui_manager;
12.55 +static GtkActionGroup *global_action_group;
12.56 +
12.57 +/**
12.58 + * Count of running nanoseconds - used to cut back on the GUI runtime
12.59 + */
12.60 +static uint32_t gtk_gui_nanos = 0;
12.61 +static struct timeval gtk_gui_lasttv;
12.62 +
12.63 +static gboolean gtk_gui_init_ok = FALSE;
12.64 +
12.65 +#define ENABLE_ACTION(win,name) SET_ACTION_ENABLED(win,name,TRUE)
12.66 +#define DISABLE_ACTION(win,name) SET_ACTION_ENABLED(win,name,FALSE)
12.67 +
12.68 +// UI Actions
12.69 +static const GtkActionEntry ui_actions[] = {
12.70 + { "FileMenu", NULL, N_("_File") },
12.71 + { "SettingsMenu", NULL, N_("_Settings") },
12.72 + { "HelpMenu", NULL, N_("_Help") },
12.73 + { "Reset", GTK_STOCK_REFRESH, N_("_Reset"), "<control>R", N_("Reset dreamcast"), G_CALLBACK(reset_action_callback) },
12.74 + { "Pause", GTK_STOCK_MEDIA_PAUSE, N_("_Pause"), NULL, N_("Pause dreamcast"), G_CALLBACK(pause_action_callback) },
12.75 + { "Run", GTK_STOCK_MEDIA_PLAY, N_("Resume"), NULL, N_("Resume"), G_CALLBACK(resume_action_callback) },
12.76 + { "LoadState", GTK_STOCK_REVERT_TO_SAVED, N_("_Load state..."), "F4", N_("Load an lxdream save state"), G_CALLBACK(load_state_action_callback) },
12.77 + { "SaveState", GTK_STOCK_SAVE_AS, N_("_Save state..."), "F3", N_("Create an lxdream save state"), G_CALLBACK(save_state_action_callback) },
12.78 + { "Exit", GTK_STOCK_QUIT, N_("E_xit"), NULL, N_("Exit lxdream"), G_CALLBACK(exit_action_callback) },
12.79 + { "GdromSettings", NULL, N_("_GD-Rom...") },
12.80 + { "GdromUnmount", NULL, N_("_Empty") },
12.81 + { "GdromMount", GTK_STOCK_CDROM, N_("_Open Image..."), "<control>O", N_("Mount a cdrom disc"), G_CALLBACK(mount_action_callback) },
12.82 + { "PathSettings", NULL, N_("_Paths..."), NULL, N_("Configure files and paths"), G_CALLBACK(path_settings_callback) },
12.83 + { "AudioSettings", NULL, N_("_Audio..."), NULL, N_("Configure audio output"), G_CALLBACK(audio_settings_callback) },
12.84 + { "ControllerSettings", NULL, N_("_Controllers..."), NULL, N_("Configure controllers"), G_CALLBACK(maple_settings_callback) },
12.85 + { "NetworkSettings", NULL, N_("_Network..."), NULL, N_("Configure network settings"), G_CALLBACK(network_settings_callback) },
12.86 + { "VideoSettings", NULL, N_("_Video..."), NULL,N_( "Configure video output"), G_CALLBACK(video_settings_callback) },
12.87 + { "About", GTK_STOCK_ABOUT, N_("_About..."), NULL, N_("About lxdream"), G_CALLBACK(about_action_callback) },
12.88 + { "DebugMenu", NULL, N_("_Debug") },
12.89 + { "Debugger", NULL, N_("_Debugger"), NULL, N_("Open debugger window"), G_CALLBACK(debugger_action_callback) },
12.90 + { "DebugMem", NULL, N_("View _Memory"), NULL, N_("View memory dump"), G_CALLBACK(debug_memory_action_callback) },
12.91 + { "DebugMmio", NULL, N_("View IO _Registers"), NULL, N_("View MMIO Registers"), G_CALLBACK(debug_mmio_action_callback) },
12.92 + { "SaveScene", NULL, N_("_Save Scene"), NULL, N_("Save next rendered scene"), G_CALLBACK(save_scene_action_callback) },
12.93 + { "SingleStep", GTK_STOCK_REDO, N_("_Single Step"), NULL, N_("Single step"), G_CALLBACK(debug_step_action_callback) },
12.94 + { "RunTo", GTK_STOCK_GOTO_LAST, N_("Run _To"), NULL, N_("Run to"), G_CALLBACK( debug_runto_action_callback) },
12.95 + { "SetBreakpoint", GTK_STOCK_CLOSE, N_("_Breakpoint"), NULL, N_("Toggle breakpoint"), G_CALLBACK( debug_breakpoint_action_callback) }
12.96 +};
12.97 +static const GtkToggleActionEntry ui_toggle_actions[] = {
12.98 + { "FullScreen", NULL, "_Full Screen", "<alt>Return", "Toggle full screen video", G_CALLBACK(fullscreen_toggle_callback), 0 },
12.99 +};
12.100 +
12.101 +// Menus and toolbars
12.102 +static const char *ui_description =
12.103 + "<ui>"
12.104 + " <menubar name='MainMenu'>"
12.105 + " <menu action='FileMenu'>"
12.106 + " <menuitem action='GdromSettings'/>"
12.107 + " <separator/>"
12.108 + " <menuitem action='Reset'/>"
12.109 + " <menuitem action='Pause'/>"
12.110 + " <menuitem action='Run'/>"
12.111 + " <menuitem action='Debugger'/>"
12.112 + " <separator/>"
12.113 + " <menuitem action='LoadState'/>"
12.114 + " <menuitem action='SaveState'/>"
12.115 + " <separator/>"
12.116 + " <menuitem action='Exit'/>"
12.117 + " </menu>"
12.118 + " <menu action='SettingsMenu'>"
12.119 + " <menuitem action='PathSettings'/>"
12.120 + " <menuitem action='AudioSettings'/>"
12.121 + " <menuitem action='ControllerSettings'/>"
12.122 + " <menuitem action='NetworkSettings'/>"
12.123 + " <menuitem action='VideoSettings'/>"
12.124 + " <separator/>"
12.125 + " <menuitem action='FullScreen'/>"
12.126 + " </menu>"
12.127 + " <menu action='HelpMenu'>"
12.128 + " <menuitem action='About'/>"
12.129 + " </menu>"
12.130 + " </menubar>"
12.131 + " <toolbar name='MainToolbar'>"
12.132 + " <toolitem action='GdromMount'/>"
12.133 + " <toolitem action='Reset'/>"
12.134 + " <toolitem action='Pause'/>"
12.135 + " <toolitem action='Run'/>"
12.136 + " <separator/>"
12.137 + " <toolitem action='LoadState'/>"
12.138 + " <toolitem action='SaveState'/>"
12.139 + " </toolbar>"
12.140 + " <menubar name='DebugMenu'>"
12.141 + " <menu action='FileMenu'>"
12.142 + " <menuitem action='GdromSettings'/>"
12.143 + " <separator/>"
12.144 + " <menuitem action='Reset'/>"
12.145 + " <separator/>"
12.146 + " <menuitem action='LoadState'/>"
12.147 + " <menuitem action='SaveState'/>"
12.148 + " <separator/>"
12.149 + " <menuitem action='Exit'/>"
12.150 + " </menu>"
12.151 + " <menu action='DebugMenu'>"
12.152 + " <menuitem action='DebugMem'/>"
12.153 + " <menuitem action='DebugMmio'/>"
12.154 + " <menuitem action='SaveScene'/>"
12.155 + " <separator/>"
12.156 + " <menuitem action='SetBreakpoint'/>"
12.157 + " <menuitem action='Pause'/>"
12.158 + " <menuitem action='SingleStep'/>"
12.159 + " <menuitem action='RunTo'/>"
12.160 + " <menuitem action='Run'/>"
12.161 + " </menu>"
12.162 + " <menu action='SettingsMenu'>"
12.163 + " <menuitem action='PathSettings'/>"
12.164 + " <menuitem action='AudioSettings'/>"
12.165 + " <menuitem action='ControllerSettings'/>"
12.166 + " <menuitem action='NetworkSettings'/>"
12.167 + " <menuitem action='VideoSettings'/>"
12.168 + " <separator/>"
12.169 + " <menuitem action='FullScreen'/>"
12.170 + " </menu>"
12.171 + " <menu action='HelpMenu'>"
12.172 + " <menuitem action='About'/>"
12.173 + " </menu>"
12.174 + " </menubar>"
12.175 + " <toolbar name='DebugToolbar'>"
12.176 + " <toolitem action='GdromMount'/>"
12.177 + " <toolitem action='Reset'/>"
12.178 + " <toolitem action='Pause'/>"
12.179 + " <separator/>"
12.180 + " <toolitem action='SingleStep'/>"
12.181 + " <toolitem action='RunTo'/>"
12.182 + " <toolitem action='Run'/>"
12.183 + " <toolitem action='SetBreakpoint'/>"
12.184 + " <separator/>"
12.185 + " <toolitem action='LoadState'/>"
12.186 + " <toolitem action='SaveState'/>"
12.187 + " </toolbar>"
12.188 + "</ui>";
12.189 +
12.190 +gboolean gui_parse_cmdline( int *argc, char **argv[] )
12.191 +{
12.192 + gtk_gui_init_ok = gtk_init_check( argc, argv );
12.193 + return gtk_gui_init_ok;
12.194 +}
12.195 +
12.196 +gboolean gui_init( gboolean withDebug )
12.197 +{
12.198 + if( gtk_gui_init_ok ) {
12.199 + GError *error = NULL;
12.200 + dreamcast_register_module( &gtk_gui_module );
12.201 + gtk_gui_alloc_resources();
12.202 +
12.203 + global_action_group = gtk_action_group_new("MenuActions");
12.204 + gtk_action_group_set_translation_domain( global_action_group, NULL );
12.205 + gtk_action_group_add_actions( global_action_group, ui_actions, G_N_ELEMENTS(ui_actions), NULL );
12.206 + gtk_action_group_add_toggle_actions( global_action_group, ui_toggle_actions, G_N_ELEMENTS(ui_toggle_actions), NULL );
12.207 + gtk_gui_enable_action("AudioSettings", FALSE);
12.208 + gtk_gui_enable_action("NetworkSettings", FALSE);
12.209 + gtk_gui_enable_action("VideoSettings", FALSE);
12.210 +
12.211 + global_ui_manager = gtk_ui_manager_new();
12.212 + gtk_ui_manager_set_add_tearoffs(global_ui_manager, TRUE);
12.213 + gtk_ui_manager_insert_action_group( global_ui_manager, global_action_group, 0 );
12.214 +
12.215 + if (!gtk_ui_manager_add_ui_from_string (global_ui_manager, ui_description, -1, &error)) {
12.216 + g_message ("building menus failed: %s", error->message);
12.217 + g_error_free (error);
12.218 + exit(1);
12.219 + }
12.220 + GtkAccelGroup *accel_group = gtk_ui_manager_get_accel_group (global_ui_manager);
12.221 + GtkWidget *menubar = gtk_ui_manager_get_widget(global_ui_manager, "/MainMenu");
12.222 + GtkWidget *toolbar = gtk_ui_manager_get_widget(global_ui_manager, "/MainToolbar");
12.223 +
12.224 + GtkWidget *gdrommenuitem = gtk_ui_manager_get_widget(global_ui_manager, "/MainMenu/FileMenu/GdromSettings");
12.225 + gdrom_menu_init();
12.226 + GtkWidget *gdrommenu = gdrom_menu_new();
12.227 + gtk_menu_item_set_submenu( GTK_MENU_ITEM(gdrommenuitem), gdrommenu );
12.228 + main_win = main_window_new( APP_NAME " " APP_VERSION, menubar, toolbar, accel_group );
12.229 + if( withDebug ) {
12.230 + gtk_gui_show_debugger();
12.231 + }
12.232 +
12.233 + return TRUE;
12.234 + } else {
12.235 + return FALSE;
12.236 + }
12.237 +}
12.238 +
12.239 +void gui_main_loop(void)
12.240 +{
12.241 + gtk_main();
12.242 +}
12.243 +
12.244 +void gui_update_state(void)
12.245 +{
12.246 + gtk_gui_update();
12.247 +}
12.248 +
12.249 +gboolean gui_error_dialog( const char *msg, ... )
12.250 +{
12.251 + if( main_win != NULL ) {
12.252 + va_list args;
12.253 + GtkWidget *dialog =
12.254 + gtk_message_dialog_new( main_window_get_frame(main_win), GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT,
12.255 + GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, NULL );
12.256 + va_start(args, msg);
12.257 + gchar *markup = g_markup_vprintf_escaped( msg, args );
12.258 + va_end( args );
12.259 + gtk_message_dialog_set_markup( GTK_MESSAGE_DIALOG(dialog), markup );
12.260 + g_free(markup);
12.261 + gtk_dialog_run(GTK_DIALOG(dialog));
12.262 + gtk_widget_destroy(dialog);
12.263 + return TRUE;
12.264 + }
12.265 + return FALSE;
12.266 +}
12.267 +
12.268 +void gui_update_io_activity( io_activity_type io, gboolean active )
12.269 +{
12.270 +
12.271 +}
12.272 +
12.273 +void gtk_gui_show_debugger()
12.274 +{
12.275 + if( debug_win ) {
12.276 + debug_window_show(debug_win, TRUE);
12.277 + } else {
12.278 + GtkAccelGroup *accel_group = gtk_ui_manager_get_accel_group (global_ui_manager);
12.279 + GtkWidget *menubar = gtk_ui_manager_get_widget(global_ui_manager, "/DebugMenu");
12.280 + GtkWidget *toolbar = gtk_ui_manager_get_widget(global_ui_manager, "/DebugToolbar");
12.281 + GtkWidget *gdrommenuitem = gtk_ui_manager_get_widget(global_ui_manager, "/DebugMenu/FileMenu/GdromSettings");
12.282 + GtkWidget *gdrommenu = gdrom_menu_new();
12.283 + gtk_menu_item_set_submenu( GTK_MENU_ITEM(gdrommenuitem), gdrommenu );
12.284 + gchar *title = g_strdup_printf( APP_NAME " " APP_VERSION " :: %s", _("Debugger"));
12.285 + debug_win = debug_window_new( title, menubar, toolbar, accel_group );
12.286 + g_free(title);
12.287 + }
12.288 +}
12.289 +
12.290 +void gtk_gui_show_mmio()
12.291 +{
12.292 + if( mmio_win ) {
12.293 + mmio_window_show(mmio_win, TRUE);
12.294 + } else {
12.295 + gchar *title = g_strdup_printf( APP_NAME " " APP_VERSION " :: %s", _("MMIO Registers"));
12.296 + mmio_win = mmio_window_new( title );
12.297 + g_free(title);
12.298 + }
12.299 +}
12.300 +
12.301 +
12.302 +main_window_t gtk_gui_get_main()
12.303 +{
12.304 + return main_win;
12.305 +}
12.306 +
12.307 +debug_window_t gtk_gui_get_debugger()
12.308 +{
12.309 + return debug_win;
12.310 +}
12.311 +
12.312 +mmio_window_t gtk_gui_get_mmio()
12.313 +{
12.314 + return mmio_win;
12.315 +}
12.316 +
12.317 +GtkWidget *gtk_gui_get_renderarea()
12.318 +{
12.319 + if( main_win == NULL ) {
12.320 + return NULL;
12.321 + } else {
12.322 + return main_window_get_renderarea(main_win);
12.323 + }
12.324 +}
12.325 +
12.326 +/**
12.327 + * Hook called when DC starts running. Just disables the run/step buttons
12.328 + * and enables the stop button.
12.329 + */
12.330 +void gtk_gui_start( void )
12.331 +{
12.332 + main_window_set_running( main_win, TRUE );
12.333 + if( debug_win != NULL ) {
12.334 + debug_window_set_running( debug_win, TRUE );
12.335 + }
12.336 + gtk_gui_nanos = 0;
12.337 + gettimeofday(&gtk_gui_lasttv,NULL);
12.338 +}
12.339 +
12.340 +/**
12.341 + * Hook called when DC stops running. Enables the run/step buttons
12.342 + * and disables the stop button.
12.343 + */
12.344 +void gtk_gui_stop( void )
12.345 +{
12.346 + main_window_set_running( main_win, FALSE );
12.347 + gtk_gui_update();
12.348 +}
12.349 +
12.350 +void gtk_gui_update( void )
12.351 +{
12.352 + if( debug_win ) {
12.353 + debug_window_set_running( debug_win, FALSE );
12.354 + debug_window_update(debug_win);
12.355 + }
12.356 + if( mmio_win ) {
12.357 + mmio_window_update(mmio_win);
12.358 + }
12.359 + dump_window_update_all();
12.360 +}
12.361 +
12.362 +/**
12.363 + * Module run-slice. Because UI processing is fairly expensive, only
12.364 + * run the processing about 10 times a second while we're emulating.
12.365 + */
12.366 +uint32_t gtk_gui_run_slice( uint32_t nanosecs )
12.367 +{
12.368 + gtk_gui_nanos += nanosecs;
12.369 + if( gtk_gui_nanos > 100000000 ) {
12.370 + struct timeval tv;
12.371 + while( gtk_events_pending() )
12.372 + gtk_main_iteration();
12.373 +
12.374 + gettimeofday(&tv,NULL);
12.375 + double ns = ((tv.tv_sec - gtk_gui_lasttv.tv_sec) * 1000000000.0) +
12.376 + ((tv.tv_usec - gtk_gui_lasttv.tv_usec)*1000.0);
12.377 + double speed = (float)( (double)gtk_gui_nanos * 100.0 / ns );
12.378 + gtk_gui_lasttv.tv_sec = tv.tv_sec;
12.379 + gtk_gui_lasttv.tv_usec = tv.tv_usec;
12.380 + main_window_set_speed( main_win, speed );
12.381 + gtk_gui_nanos = 0;
12.382 + }
12.383 + return nanosecs;
12.384 +}
12.385 +
12.386 +
12.387 +PangoFontDescription *gui_fixed_font;
12.388 +GdkColor gui_colour_normal, gui_colour_changed, gui_colour_error;
12.389 +GdkColor gui_colour_warn, gui_colour_pc, gui_colour_debug;
12.390 +GdkColor gui_colour_trace, gui_colour_break, gui_colour_temp_break;
12.391 +GdkColor gui_colour_white;
12.392 +
12.393 +void gtk_gui_alloc_resources() {
12.394 + GdkColormap *map;
12.395 +
12.396 + gui_colour_normal.red = gui_colour_normal.green = gui_colour_normal.blue = 0;
12.397 + gui_colour_changed.red = gui_colour_changed.green = 64*256;
12.398 + gui_colour_changed.blue = 154*256;
12.399 + gui_colour_error.red = 65535;
12.400 + gui_colour_error.green = gui_colour_error.blue = 64*256;
12.401 + gui_colour_pc.red = 32*256;
12.402 + gui_colour_pc.green = 170*256;
12.403 + gui_colour_pc.blue = 52*256;
12.404 + gui_colour_warn = gui_colour_changed;
12.405 + gui_colour_trace.red = 156*256;
12.406 + gui_colour_trace.green = 78*256;
12.407 + gui_colour_trace.blue = 201*256;
12.408 + gui_colour_debug = gui_colour_pc;
12.409 + gui_colour_break.red = 65535;
12.410 + gui_colour_break.green = gui_colour_break.blue = 192*256;
12.411 + gui_colour_temp_break.red = gui_colour_temp_break.green = 128*256;
12.412 + gui_colour_temp_break.blue = 32*256;
12.413 + gui_colour_white.red = gui_colour_white.green = gui_colour_white.blue = 65535;
12.414 +
12.415 + map = gdk_colormap_new(gdk_visual_get_best(), TRUE);
12.416 + gdk_colormap_alloc_color(map, &gui_colour_normal, TRUE, TRUE);
12.417 + gdk_colormap_alloc_color(map, &gui_colour_changed, TRUE, TRUE);
12.418 + gdk_colormap_alloc_color(map, &gui_colour_error, TRUE, TRUE);
12.419 + gdk_colormap_alloc_color(map, &gui_colour_warn, TRUE, TRUE);
12.420 + gdk_colormap_alloc_color(map, &gui_colour_pc, TRUE, TRUE);
12.421 + gdk_colormap_alloc_color(map, &gui_colour_debug, TRUE, TRUE);
12.422 + gdk_colormap_alloc_color(map, &gui_colour_trace, TRUE, TRUE);
12.423 + gdk_colormap_alloc_color(map, &gui_colour_break, TRUE, TRUE);
12.424 + gdk_colormap_alloc_color(map, &gui_colour_temp_break, TRUE, TRUE);
12.425 + gdk_colormap_alloc_color(map, &gui_colour_white, TRUE, TRUE);
12.426 + gui_fixed_font = pango_font_description_from_string("Courier 10");
12.427 +}
12.428 +
12.429 +gint gtk_gui_run_property_dialog( const gchar *title, GtkWidget *panel, gtk_dialog_done_fn fn )
12.430 +{
12.431 + GtkWidget *dialog =
12.432 + gtk_dialog_new_with_buttons(title, main_window_get_frame(main_win),
12.433 + GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT,
12.434 + GTK_STOCK_OK, GTK_RESPONSE_ACCEPT,
12.435 + GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT,
12.436 + NULL);
12.437 + gint result;
12.438 + gtk_widget_show_all(panel);
12.439 + gtk_container_add( GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), panel );
12.440 + result = gtk_dialog_run( GTK_DIALOG(dialog) );
12.441 + if( fn != NULL ) {
12.442 + fn(panel, result == GTK_RESPONSE_ACCEPT);
12.443 + }
12.444 + gtk_widget_destroy( dialog );
12.445 + return result;
12.446 +}
12.447 +
12.448 +void gtk_gui_enable_action( const gchar *action, gboolean enable )
12.449 +{
12.450 + gtk_action_set_sensitive( gtk_action_group_get_action( global_action_group, action), enable);
12.451 +}
12.452 +
12.453 +static void delete_frame_buffer( guchar *pixels, gpointer buffer )
12.454 +{
12.455 + if( buffer != NULL ) {
12.456 + g_free(buffer);
12.457 + }
12.458 +}
12.459 +
12.460 +GdkPixbuf *gdk_pixbuf_new_from_frame_buffer( frame_buffer_t buffer )
12.461 +{
12.462 + return gdk_pixbuf_new_from_data( (unsigned char *)buffer->data,
12.463 + GDK_COLORSPACE_RGB,
12.464 + (buffer->colour_format == COLFMT_BGRA8888),
12.465 + 8,
12.466 + buffer->width,
12.467 + buffer->height,
12.468 + buffer->rowstride,
12.469 + delete_frame_buffer,
12.470 + buffer );
12.471 +}
13.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
13.2 +++ b/src/gtkui/gtkui.h Tue Nov 20 10:27:58 2007 +0000
13.3 @@ -0,0 +1,133 @@
13.4 +/**
13.5 + * $Id: gtkui.h,v 1.12 2007-11-10 04:45:29 nkeynes Exp $
13.6 + *
13.7 + * Core GTK-based user interface
13.8 + *
13.9 + * Copyright (c) 2005 Nathan Keynes.
13.10 + *
13.11 + * This program is free software; you can redistribute it and/or modify
13.12 + * it under the terms of the GNU General Public License as published by
13.13 + * the Free Software Foundation; either version 2 of the License, or
13.14 + * (at your option) any later version.
13.15 + *
13.16 + * This program is distributed in the hope that it will be useful,
13.17 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
13.18 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13.19 + * GNU General Public License for more details.
13.20 + */
13.21 +
13.22 +#ifndef __lxdream_gtkui_H
13.23 +#define __lxdream_gtkui_H
13.24 +
13.25 +#include "lxdream.h"
13.26 +#include <gtk/gtk.h>
13.27 +#include <glib/gi18n.h>
13.28 +#include "gui.h"
13.29 +#include "cpu.h"
13.30 +
13.31 +/********************* Top-level windows *********************/
13.32 +
13.33 +typedef struct main_window_info *main_window_t;
13.34 +typedef struct debug_window_info *debug_window_t;
13.35 +typedef struct mmio_window_info *mmio_window_t;
13.36 +typedef struct dump_window_info *dump_window_t;
13.37 +
13.38 +/**
13.39 + * Construct and show the main window, returning an
13.40 + * opaque pointer to the window.
13.41 + */
13.42 +main_window_t main_window_new( const gchar *title, GtkWidget *menubar,
13.43 + GtkWidget *toolbar, GtkAccelGroup *accel );
13.44 +GtkWindow *main_window_get_frame( main_window_t win );
13.45 +GtkWidget *main_window_get_renderarea( main_window_t win );
13.46 +void main_window_set_running( main_window_t win, gboolean running );
13.47 +void main_window_set_framerate( main_window_t win, float rate );
13.48 +void main_window_set_speed( main_window_t win, double speed );
13.49 +void main_window_set_fullscreen( main_window_t win, gboolean fullscreen );
13.50 +
13.51 +debug_window_t debug_window_new( const gchar *title, GtkWidget *menubar,
13.52 + GtkWidget *toolbar, GtkAccelGroup *accel );
13.53 +void debug_window_show( debug_window_t win, gboolean show );
13.54 +void debug_window_set_running( debug_window_t win, gboolean running );
13.55 +void debug_window_update(debug_window_t win);
13.56 +void debug_window_single_step( debug_window_t data );
13.57 +void debug_window_set_oneshot_breakpoint( debug_window_t data, int row );
13.58 +void debug_window_toggle_breakpoint( debug_window_t data, int row );
13.59 +
13.60 +
13.61 +mmio_window_t mmio_window_new( const gchar *title );
13.62 +void mmio_window_show( mmio_window_t win, gboolean show );
13.63 +void mmio_window_update(mmio_window_t win);
13.64 +
13.65 +dump_window_t dump_window_new( const gchar *title );
13.66 +void dump_window_update_all();
13.67 +
13.68 +void maple_dialog_run();
13.69 +void path_dialog_run();
13.70 +
13.71 +void gtk_gui_update( void );
13.72 +main_window_t gtk_gui_get_main();
13.73 +debug_window_t gtk_gui_get_debugger();
13.74 +mmio_window_t gtk_gui_get_mmio();
13.75 +void gtk_gui_show_mmio();
13.76 +void gtk_gui_show_debugger();
13.77 +
13.78 +/********************* Helper functions **********************/
13.79 +
13.80 +typedef void (*gtk_dialog_done_fn)(GtkWidget *panel, gboolean isOK);
13.81 +void gtk_gui_enable_action( const gchar *action, gboolean enabled );
13.82 +gint gtk_gui_run_property_dialog( const gchar *title, GtkWidget *panel, gtk_dialog_done_fn fn );
13.83 +
13.84 +
13.85 +typedef gboolean (*file_callback_t)( const gchar *filename );
13.86 +void open_file_dialog( char *title, file_callback_t action, char *pattern, char *patname,
13.87 + gchar const *initial_dir );
13.88 +
13.89 +/**
13.90 + * Construct a new pixbuf that takes ownership of the frame buffer
13.91 + */
13.92 +GdkPixbuf *gdk_pixbuf_new_from_frame_buffer( frame_buffer_t buffer );
13.93 +
13.94 +void gdrom_menu_init();
13.95 +GtkWidget *gdrom_menu_new();
13.96 +
13.97 +/******************** Video driver hooks *********************/
13.98 +
13.99 +GtkWidget *gtk_gui_get_renderarea();
13.100 +
13.101 +/******************* Callback declarations *******************/
13.102 +
13.103 +void mount_action_callback( GtkAction *action, gpointer user_data);
13.104 +void reset_action_callback( GtkAction *action, gpointer user_data);
13.105 +void pause_action_callback( GtkAction *action, gpointer user_data);
13.106 +void resume_action_callback( GtkAction *action, gpointer user_data);
13.107 +void load_state_action_callback( GtkAction *action, gpointer user_data);
13.108 +void save_state_action_callback( GtkAction *action, gpointer user_data);
13.109 +void about_action_callback( GtkAction *action, gpointer user_data);
13.110 +void exit_action_callback( GtkAction *action, gpointer user_data);
13.111 +
13.112 +void path_settings_callback( GtkAction *action, gpointer user_data);
13.113 +void audio_settings_callback( GtkAction *action, gpointer user_data);
13.114 +void maple_settings_callback( GtkAction *action, gpointer user_data);
13.115 +void network_settings_callback( GtkAction *action, gpointer user_data);
13.116 +void video_settings_callback( GtkAction *action, gpointer user_data);
13.117 +void fullscreen_toggle_callback( GtkToggleAction *action, gpointer user_data);
13.118 +
13.119 +void debugger_action_callback( GtkAction *action, gpointer user_data);
13.120 +void debug_memory_action_callback( GtkAction *action, gpointer user_data);
13.121 +void debug_mmio_action_callback( GtkAction *action, gpointer user_data);
13.122 +void save_scene_action_callback( GtkAction *action, gpointer user_data);
13.123 +void debug_step_action_callback( GtkAction *action, gpointer user_data);
13.124 +void debug_runto_action_callback( GtkAction *action, gpointer user_data);
13.125 +void debug_breakpoint_action_callback( GtkAction *action, gpointer user_data);
13.126 +
13.127 +void gdrom_open_direct_callback( GtkWidget *widget, gpointer user_data );
13.128 +
13.129 +/*************** Constant colour/font values *****************/
13.130 +extern PangoFontDescription *gui_fixed_font;
13.131 +extern GdkColor gui_colour_normal, gui_colour_changed, gui_colour_error;
13.132 +extern GdkColor gui_colour_warn, gui_colour_pc, gui_colour_debug;
13.133 +extern GdkColor gui_colour_trace, gui_colour_break, gui_colour_temp_break;
13.134 +extern GdkColor gui_colour_white;
13.135 +
13.136 +#endif /* __lxdream_gtkui_H */
14.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
14.2 +++ b/src/gtkui/main_win.c Tue Nov 20 10:27:58 2007 +0000
14.3 @@ -0,0 +1,159 @@
14.4 +/**
14.5 + * $Id: main_win.c,v 1.10 2007-11-08 10:46:41 nkeynes Exp $
14.6 + *
14.7 + * Define the main (emu) GTK window, along with its menubars,
14.8 + * toolbars, etc.
14.9 + *
14.10 + * Copyright (c) 2005 Nathan Keynes.
14.11 + *
14.12 + * This program is free software; you can redistribute it and/or modify
14.13 + * it under the terms of the GNU General Public License as published by
14.14 + * the Free Software Foundation; either version 2 of the License, or
14.15 + * (at your option) any later version.
14.16 + *
14.17 + * This program is distributed in the hope that it will be useful,
14.18 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
14.19 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14.20 + * GNU General Public License for more details.
14.21 + */
14.22 +
14.23 +#include <assert.h>
14.24 +#include <sys/types.h>
14.25 +#include <sys/stat.h>
14.26 +#include <unistd.h>
14.27 +#include <string.h>
14.28 +#include <stdio.h>
14.29 +#include <stdlib.h>
14.30 +
14.31 +#include <gtk/gtk.h>
14.32 +
14.33 +#include "dream.h"
14.34 +#include "gtkui/gtkui.h"
14.35 +
14.36 +
14.37 +struct main_window_info {
14.38 + GtkWidget *window;
14.39 + GtkWidget *video;
14.40 + GtkWidget *menubar;
14.41 + GtkWidget *toolbar;
14.42 + GtkWidget *statusbar;
14.43 + GtkActionGroup *actions;
14.44 +};
14.45 +
14.46 +static gboolean on_main_window_deleted( GtkWidget *widget, GdkEvent event, gpointer user_data )
14.47 +{
14.48 + exit(0);
14.49 +}
14.50 +
14.51 +static void on_main_window_state_changed( GtkWidget *widget, GdkEventWindowState *state,
14.52 + gpointer userdata )
14.53 +{
14.54 + main_window_t win = (main_window_t)userdata;
14.55 + if( state->changed_mask & GDK_WINDOW_STATE_FULLSCREEN ) {
14.56 + gboolean fs = (state->new_window_state & GDK_WINDOW_STATE_FULLSCREEN);
14.57 + GtkWidget *frame = gtk_widget_get_parent(win->video);
14.58 + if( frame->style == NULL ) {
14.59 + gtk_widget_set_style( frame, gtk_style_new() );
14.60 + }
14.61 + if( fs ) {
14.62 + gtk_widget_hide( win->menubar );
14.63 + gtk_widget_hide( win->toolbar );
14.64 + gtk_widget_hide( win->statusbar );
14.65 +
14.66 + frame->style->xthickness = 0;
14.67 + frame->style->ythickness = 0;
14.68 + } else {
14.69 + frame->style->xthickness = 2;
14.70 + frame->style->ythickness = 2;
14.71 + gtk_widget_show( win->menubar );
14.72 + gtk_widget_show( win->toolbar );
14.73 + gtk_widget_show( win->statusbar );
14.74 + }
14.75 + gtk_widget_queue_draw( win->window );
14.76 + }
14.77 +}
14.78 +
14.79 +main_window_t main_window_new( const gchar *title, GtkWidget *menubar, GtkWidget *toolbar,
14.80 + GtkAccelGroup *accel_group )
14.81 +{
14.82 + GtkWidget *vbox;
14.83 + GtkWidget *frame;
14.84 + main_window_t win = g_malloc0( sizeof(struct main_window_info) );
14.85 +
14.86 + win->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
14.87 + win->menubar = menubar;
14.88 + win->toolbar = toolbar;
14.89 + gtk_window_set_title( GTK_WINDOW(win->window), title );
14.90 + gtk_window_add_accel_group (GTK_WINDOW (win->window), accel_group);
14.91 +
14.92 + gtk_toolbar_set_style( GTK_TOOLBAR(toolbar), GTK_TOOLBAR_ICONS );
14.93 +
14.94 + win->video = gtk_drawing_area_new();
14.95 + GTK_WIDGET_SET_FLAGS(win->video, GTK_CAN_FOCUS|GTK_CAN_DEFAULT);
14.96 + gtk_widget_set_size_request( win->video, 640, 480 );
14.97 + frame = gtk_frame_new(NULL);
14.98 + gtk_frame_set_shadow_type( GTK_FRAME(frame), GTK_SHADOW_IN );
14.99 + gtk_container_add( GTK_CONTAINER(frame), win->video );
14.100 +
14.101 + win->statusbar = gtk_statusbar_new();
14.102 +
14.103 + vbox = gtk_vbox_new(FALSE, 0);
14.104 + gtk_container_add( GTK_CONTAINER(win->window), vbox );
14.105 + gtk_box_pack_start( GTK_BOX(vbox), menubar, FALSE, FALSE, 0 );
14.106 + gtk_box_pack_start( GTK_BOX(vbox), toolbar, FALSE, FALSE, 0 );
14.107 + gtk_box_pack_start( GTK_BOX(vbox), frame, TRUE, TRUE, 0 );
14.108 + gtk_box_pack_start( GTK_BOX(vbox), win->statusbar, FALSE, FALSE, 0 );
14.109 + gtk_widget_show_all( win->window );
14.110 + gtk_widget_grab_focus( win->video );
14.111 +
14.112 + gtk_statusbar_push( GTK_STATUSBAR(win->statusbar), 1, "Stopped" );
14.113 + g_signal_connect( win->window, "delete_event",
14.114 + G_CALLBACK(on_main_window_deleted), win );
14.115 + g_signal_connect( win->window, "window-state-event",
14.116 + G_CALLBACK(on_main_window_state_changed), win );
14.117 + return win;
14.118 +}
14.119 +
14.120 +void main_window_set_running( main_window_t win, gboolean running )
14.121 +{
14.122 + gtk_gui_enable_action( "Pause", running );
14.123 + gtk_gui_enable_action( "Run", !running );
14.124 + gtk_statusbar_pop( GTK_STATUSBAR(win->statusbar), 1 );
14.125 + gtk_statusbar_push( GTK_STATUSBAR(win->statusbar), 1, running ? "Running" : "Stopped" );
14.126 +}
14.127 +
14.128 +void main_window_set_framerate( main_window_t win, float rate )
14.129 +{
14.130 +
14.131 +
14.132 +}
14.133 +
14.134 +void main_window_set_speed( main_window_t win, double speed )
14.135 +{
14.136 + char buf[32];
14.137 +
14.138 + snprintf( buf, 32, "Running (%2.4f%%)", speed );
14.139 + gtk_statusbar_pop( GTK_STATUSBAR(win->statusbar), 1 );
14.140 + gtk_statusbar_push( GTK_STATUSBAR(win->statusbar), 1, buf );
14.141 +
14.142 +
14.143 +}
14.144 +
14.145 +GtkWidget *main_window_get_renderarea( main_window_t win )
14.146 +{
14.147 + return win->video;
14.148 +}
14.149 +
14.150 +GtkWindow *main_window_get_frame( main_window_t win )
14.151 +{
14.152 + return GTK_WINDOW(win->window);
14.153 +}
14.154 +
14.155 +void main_window_set_fullscreen( main_window_t win, gboolean fullscreen )
14.156 +{
14.157 + if( fullscreen ) {
14.158 + gtk_window_fullscreen( GTK_WINDOW(win->window) );
14.159 + } else {
14.160 + gtk_window_unfullscreen( GTK_WINDOW(win->window) );
14.161 + }
14.162 +}
15.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
15.2 +++ b/src/gtkui/mmio_win.c Tue Nov 20 10:27:58 2007 +0000
15.3 @@ -0,0 +1,241 @@
15.4 +/**
15.5 + * $Id: mmio_win.c,v 1.11 2007-11-10 04:45:29 nkeynes Exp $
15.6 + *
15.7 + * Implements the MMIO register viewing window
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 <stdint.h>
15.23 +#include <string.h>
15.24 +#include <glib/gi18n.h>
15.25 +#include "gtkui/gtkui.h"
15.26 +#include "mem.h"
15.27 +#include "mmio.h"
15.28 +
15.29 +
15.30 +struct mmio_window_info {
15.31 + GtkWidget *window;
15.32 + GtkWidget *notebook;
15.33 +};
15.34 +
15.35 +static void printbits( char *out, int nbits, uint32_t value )
15.36 +{
15.37 + if( nbits < 32 ) {
15.38 + int i;
15.39 + for( i=32; i>nbits; i-- ) {
15.40 + if( !(i % 8) ) *out++ = ' ';
15.41 + *out++ = ' ';
15.42 + }
15.43 + }
15.44 + while( nbits > 0 ) {
15.45 + *out++ = (value&(1<<--nbits) ? '1' : '0');
15.46 + if( !(nbits % 8) ) *out++ = ' ';
15.47 + }
15.48 + *out = '\0';
15.49 +}
15.50 +
15.51 +static void printhex( char *out, int nbits, uint32_t value )
15.52 +{
15.53 + char tmp[10], *p = tmp;
15.54 + int i;
15.55 +
15.56 + sprintf( tmp, "%08X", value );
15.57 + for( i=32; i>0; i-=4, p++ ) {
15.58 + if( i <= nbits ) *out++ = *p;
15.59 + else *out++ = ' ';
15.60 + }
15.61 + *out = '\0';
15.62 +}
15.63 +
15.64 +
15.65 +
15.66 +
15.67 +gboolean
15.68 +on_mmio_delete_event (GtkWidget *widget,
15.69 + GdkEvent *event,
15.70 + gpointer user_data)
15.71 +{
15.72 + gtk_widget_hide(widget);
15.73 + return TRUE;
15.74 +}
15.75 +
15.76 +
15.77 +void on_mmio_close_clicked( GtkButton *button, gpointer user_data)
15.78 +{
15.79 + gtk_widget_hide( ((mmio_window_t)user_data)->window );
15.80 +}
15.81 +
15.82 +
15.83 +void on_trace_button_toggled (GtkToggleButton *button,
15.84 + gpointer user_data)
15.85 +{
15.86 + struct mmio_region *io_rgn = (struct mmio_region *)user_data;
15.87 + gboolean isActive = gtk_toggle_button_get_active(button);
15.88 + if( io_rgn != NULL ) {
15.89 + io_rgn->trace_flag = isActive ? 1 : 0;
15.90 + }
15.91 +}
15.92 +
15.93 +static GtkCList *mmio_window_add_page( mmio_window_t mmio, char *name, struct mmio_region *io_rgn )
15.94 +{
15.95 + GtkCList *list;
15.96 + GtkWidget *scroll;
15.97 + GtkWidget *tab;
15.98 + GtkCheckButton *trace_button;
15.99 + GtkVBox *vbox;
15.100 +
15.101 + scroll = gtk_scrolled_window_new(NULL, NULL);
15.102 + gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW(scroll),
15.103 + GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS );
15.104 + list = GTK_CLIST(gtk_clist_new(5));
15.105 + gtk_clist_set_column_width(list, 0, 70);
15.106 + gtk_clist_set_column_width(list, 1, 75);
15.107 + gtk_clist_set_column_width(list, 2, 70);
15.108 + gtk_clist_set_column_width(list, 3, 280);
15.109 + gtk_clist_set_column_width(list, 4, 160);
15.110 + gtk_clist_set_column_justification(list, 0, GTK_JUSTIFY_CENTER );
15.111 + gtk_clist_set_column_justification(list, 2, GTK_JUSTIFY_CENTER );
15.112 + gtk_clist_set_column_justification(list, 3, GTK_JUSTIFY_CENTER );
15.113 + gtk_clist_set_column_title(list, 0, _("Address"));
15.114 + gtk_clist_set_column_title(list, 1, _("Register"));
15.115 + gtk_clist_set_column_title(list, 2, _("Value"));
15.116 + gtk_clist_set_column_title(list, 3, _("Bit Pattern"));
15.117 + gtk_clist_set_column_title(list, 4, _("Description"));
15.118 + gtk_clist_column_titles_show(list);
15.119 + gtk_widget_modify_font( GTK_WIDGET(list), gui_fixed_font );
15.120 + tab = gtk_label_new(_(name));
15.121 + gtk_container_add( GTK_CONTAINER(scroll), GTK_WIDGET(list) );
15.122 +
15.123 + vbox = GTK_VBOX(gtk_vbox_new( FALSE, 0 ));
15.124 + gtk_container_add( GTK_CONTAINER(vbox), GTK_WIDGET(scroll) );
15.125 +
15.126 + trace_button = GTK_CHECK_BUTTON(gtk_check_button_new_with_label(_("Trace access")));
15.127 + gtk_container_add( GTK_CONTAINER(vbox), GTK_WIDGET(trace_button) );
15.128 + gtk_box_set_child_packing( GTK_BOX(vbox), GTK_WIDGET(trace_button),
15.129 + FALSE, FALSE, 0, GTK_PACK_START );
15.130 + gtk_notebook_append_page( GTK_NOTEBOOK(mmio->notebook), GTK_WIDGET(vbox), tab );
15.131 + gtk_object_set_data( GTK_OBJECT(mmio->window), name, list );
15.132 + g_signal_connect ((gpointer) trace_button, "toggled",
15.133 + G_CALLBACK (on_trace_button_toggled),
15.134 + io_rgn);
15.135 + return list;
15.136 +}
15.137 +
15.138 +
15.139 +
15.140 +mmio_window_t mmio_window_new( const gchar *title )
15.141 +{
15.142 + mmio_window_t mmio = g_malloc0( sizeof(struct mmio_window_info) );
15.143 +
15.144 + int i, j;
15.145 + GtkCList *all_list;
15.146 + GtkWidget *vbox1;
15.147 + GtkWidget *hbuttonbox1;
15.148 + GtkWidget *mmr_close;
15.149 +
15.150 + mmio->window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
15.151 + gtk_window_set_title (GTK_WINDOW (mmio->window), title);
15.152 + gtk_window_set_default_size (GTK_WINDOW (mmio->window), 600, 600);
15.153 +
15.154 + vbox1 = gtk_vbox_new (FALSE, 0);
15.155 + gtk_container_add (GTK_CONTAINER (mmio->window), vbox1);
15.156 +
15.157 + mmio->notebook = gtk_notebook_new ();
15.158 + gtk_box_pack_start (GTK_BOX (vbox1), mmio->notebook, TRUE, TRUE, 0);
15.159 + gtk_notebook_set_tab_pos (GTK_NOTEBOOK (mmio->notebook), GTK_POS_LEFT);
15.160 +
15.161 + hbuttonbox1 = gtk_hbutton_box_new ();
15.162 + gtk_box_pack_start (GTK_BOX (vbox1), hbuttonbox1, FALSE, TRUE, 0);
15.163 + gtk_box_set_spacing (GTK_BOX (hbuttonbox1), 30);
15.164 +
15.165 + mmr_close = gtk_button_new_with_mnemonic (_("Close"));
15.166 + gtk_container_add (GTK_CONTAINER (hbuttonbox1), mmr_close);
15.167 + GTK_WIDGET_SET_FLAGS (mmr_close, GTK_CAN_DEFAULT);
15.168 +
15.169 + /* Add the mmio register data */
15.170 + all_list = mmio_window_add_page( mmio, "All", NULL );
15.171 + for( i=0; i < num_io_rgns; i++ ) {
15.172 + GtkCList *list = mmio_window_add_page( mmio, io_rgn[i]->id, io_rgn[i] );
15.173 + for( j=0; io_rgn[i]->ports[j].id != NULL; j++ ) {
15.174 + int sz = io_rgn[i]->ports[j].width;
15.175 + char addr[10], data[10], bits[40];
15.176 + char *arr[] = { addr, io_rgn[i]->ports[j].id, data, bits,
15.177 + io_rgn[i]->ports[j].desc };
15.178 + sprintf( addr, "%08X",
15.179 + io_rgn[i]->base + io_rgn[i]->ports[j].offset );
15.180 + printhex( data, sz, *io_rgn[i]->ports[j].val );
15.181 + printbits( bits, io_rgn[i]->ports[j].width,
15.182 + *io_rgn[i]->ports[j].val );
15.183 + gtk_clist_append( list, arr );
15.184 + gtk_clist_append( all_list, arr );
15.185 + }
15.186 + }
15.187 +
15.188 + g_signal_connect ((gpointer) mmio->window, "delete_event",
15.189 + G_CALLBACK (on_mmio_delete_event),
15.190 + NULL);
15.191 + g_signal_connect ((gpointer) mmr_close, "clicked",
15.192 + G_CALLBACK (on_mmio_close_clicked),
15.193 + mmio);
15.194 +
15.195 + gtk_widget_show_all( mmio->window );
15.196 + return mmio;
15.197 +}
15.198 +
15.199 +void mmio_window_update( mmio_window_t mmio )
15.200 +{
15.201 + int i,j, count = 0;
15.202 + GtkCList *page, *all_page;
15.203 + char data[10], bits[40];
15.204 +
15.205 + all_page = GTK_CLIST(gtk_object_get_data( GTK_OBJECT(mmio->window), "All" ));
15.206 +
15.207 + for( i=0; i < num_io_rgns; i++ ) {
15.208 + page = GTK_CLIST(gtk_object_get_data( GTK_OBJECT(mmio->window),
15.209 + io_rgn[i]->id ));
15.210 + for( j=0; io_rgn[i]->ports[j].id != NULL; j++ ) {
15.211 + if( *io_rgn[i]->ports[j].val !=
15.212 + *(uint32_t *)(io_rgn[i]->save_mem+io_rgn[i]->ports[j].offset)){
15.213 + int sz = io_rgn[i]->ports[j].width;
15.214 + /* Changed */
15.215 + printhex( data, sz, *io_rgn[i]->ports[j].val );
15.216 + printbits( bits, sz, *io_rgn[i]->ports[j].val );
15.217 +
15.218 + gtk_clist_set_text( page, j, 2, data );
15.219 + gtk_clist_set_text( page, j, 3, bits );
15.220 + gtk_clist_set_foreground( page, j, &gui_colour_changed );
15.221 +
15.222 + gtk_clist_set_text( all_page, count, 2, data );
15.223 + gtk_clist_set_text( all_page, count, 3, bits );
15.224 + gtk_clist_set_foreground( all_page, count, &gui_colour_changed );
15.225 +
15.226 + } else {
15.227 + gtk_clist_set_foreground( page, j, &gui_colour_normal );
15.228 + gtk_clist_set_foreground( all_page, count, &gui_colour_normal );
15.229 + }
15.230 + count++;
15.231 + }
15.232 + memcpy( io_rgn[i]->save_mem, io_rgn[i]->mem, PAGE_SIZE );
15.233 + }
15.234 +}
15.235 +
15.236 +void mmio_window_show( mmio_window_t mmio, gboolean show )
15.237 +{
15.238 + if( show ) {
15.239 + gtk_widget_show( mmio->window );
15.240 + } else {
15.241 + gtk_widget_hide( mmio->window );
15.242 + }
15.243 +}
15.244 +
16.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
16.2 +++ b/src/gtkui/path_dlg.c Tue Nov 20 10:27:58 2007 +0000
16.3 @@ -0,0 +1,128 @@
16.4 +/**
16.5 + * $Id: path_dlg.c,v 1.5 2007-11-10 04:45:29 nkeynes Exp $
16.6 + *
16.7 + * Define the main (emu) GTK window, along with its menubars,
16.8 + * toolbars, etc.
16.9 + *
16.10 + * Copyright (c) 2005 Nathan Keynes.
16.11 + *
16.12 + * This program is free software; you can redistribute it and/or modify
16.13 + * it under the terms of the GNU General Public License as published by
16.14 + * the Free Software Foundation; either version 2 of the License, or
16.15 + * (at your option) any later version.
16.16 + *
16.17 + * This program is distributed in the hope that it will be useful,
16.18 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
16.19 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16.20 + * GNU General Public License for more details.
16.21 + */
16.22 +
16.23 +#include <assert.h>
16.24 +#include <gtk/gtk.h>
16.25 +
16.26 +#include "dream.h"
16.27 +#include "dreamcast.h"
16.28 +#include "config.h"
16.29 +#include "gtkui/gtkui.h"
16.30 +
16.31 +static const gchar *path_label[] = { N_("Bios rom"), N_("Flash rom"), N_("Default disc path"),
16.32 + N_("Save state path"), N_("Bootstrap IP.BIN") };
16.33 +static const int path_id[] = { CONFIG_BIOS_PATH, CONFIG_FLASH_PATH, CONFIG_DEFAULT_PATH,
16.34 + CONFIG_SAVE_PATH, CONFIG_BOOTSTRAP };
16.35 +static GtkFileChooserAction path_action[] = {
16.36 + GTK_FILE_CHOOSER_ACTION_OPEN,
16.37 + GTK_FILE_CHOOSER_ACTION_OPEN,
16.38 + GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER,
16.39 + GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER,
16.40 + GTK_FILE_CHOOSER_ACTION_OPEN };
16.41 +
16.42 +static GtkWidget *path_entry[5];
16.43 +
16.44 +static gboolean path_file_button_clicked( GtkWidget *button, gpointer user_data )
16.45 +{
16.46 + GtkWidget *entry = GTK_WIDGET(user_data);
16.47 + GtkWidget *file = gtk_file_chooser_dialog_new( _("Select file"), NULL,
16.48 + GTK_FILE_CHOOSER_ACTION_OPEN,
16.49 + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
16.50 + GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
16.51 + NULL );
16.52 + const gchar *filename = gtk_entry_get_text(GTK_ENTRY(entry));
16.53 + gtk_file_chooser_set_filename( GTK_FILE_CHOOSER(file), filename );
16.54 + gtk_window_set_modal( GTK_WINDOW(file), TRUE );
16.55 + gtk_widget_show_all( file );
16.56 + gint result = gtk_dialog_run(GTK_DIALOG(file));
16.57 + if( result == GTK_RESPONSE_ACCEPT ) {
16.58 + filename = gtk_file_chooser_get_filename( GTK_FILE_CHOOSER(file) );
16.59 + gtk_entry_set_text(GTK_ENTRY(entry), filename);
16.60 + }
16.61 + gtk_widget_destroy(file);
16.62 + return TRUE;
16.63 +}
16.64 +
16.65 +static gboolean path_dir_button_clicked( GtkWidget *button, gpointer user_data )
16.66 +{
16.67 + GtkWidget *entry = GTK_WIDGET(user_data);
16.68 + GtkWidget *file = gtk_file_chooser_dialog_new( _("Select file"), NULL,
16.69 + GTK_FILE_CHOOSER_ACTION_OPEN,
16.70 + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
16.71 + GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
16.72 + NULL );
16.73 + const gchar *filename = gtk_entry_get_text(GTK_ENTRY(entry));
16.74 + gtk_file_chooser_set_action( GTK_FILE_CHOOSER(file), GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER );
16.75 + gtk_file_chooser_set_filename( GTK_FILE_CHOOSER(file), filename );
16.76 + gtk_window_set_modal( GTK_WINDOW(file), TRUE );
16.77 + gtk_widget_show_all( file );
16.78 + gint result = gtk_dialog_run(GTK_DIALOG(file));
16.79 + if( result == GTK_RESPONSE_ACCEPT ) {
16.80 + filename = gtk_file_chooser_get_filename( GTK_FILE_CHOOSER(file) );
16.81 + gtk_entry_set_text(GTK_ENTRY(entry), filename);
16.82 + }
16.83 + gtk_widget_destroy(file);
16.84 + return TRUE;
16.85 +}
16.86 +
16.87 +GtkWidget *path_panel_new(void)
16.88 +{
16.89 + GtkWidget *table = gtk_table_new( 5, 3, FALSE );
16.90 + int i;
16.91 + for( i=0; i<5; i++ ) {
16.92 + GtkWidget *text = path_entry[i] = gtk_entry_new();
16.93 + GtkWidget *button = gtk_button_new();
16.94 + gtk_table_attach( GTK_TABLE(table), gtk_label_new(Q_(path_label[i])), 0, 1, i, i+1,
16.95 + GTK_SHRINK, GTK_SHRINK, 0, 0);
16.96 + gtk_entry_set_text( GTK_ENTRY(text), lxdream_get_config_value(path_id[i]) );
16.97 + gtk_entry_set_width_chars( GTK_ENTRY(text), 48 );
16.98 + gtk_table_attach_defaults( GTK_TABLE(table), text, 1, 2, i, i+1 );
16.99 + gtk_table_attach( GTK_TABLE(table), button, 2, 3, i, i+1, GTK_SHRINK, GTK_SHRINK, 0, 0 );
16.100 + if( path_action[i] == GTK_FILE_CHOOSER_ACTION_OPEN ) {
16.101 + GtkWidget *image = gtk_image_new_from_stock(GTK_STOCK_OPEN, GTK_ICON_SIZE_BUTTON);
16.102 + gtk_button_set_image( GTK_BUTTON(button), image );
16.103 + g_signal_connect( button, "clicked", G_CALLBACK(path_file_button_clicked), text );
16.104 + } else {
16.105 + GtkWidget *image = gtk_image_new_from_stock(GTK_STOCK_OPEN, GTK_ICON_SIZE_BUTTON);
16.106 + gtk_button_set_image( GTK_BUTTON(button), image );
16.107 + g_signal_connect( button, "clicked", G_CALLBACK(path_dir_button_clicked), text );
16.108 + }
16.109 + }
16.110 + return table;
16.111 +
16.112 +}
16.113 +
16.114 +void path_panel_done( GtkWidget *panel, gboolean isOK )
16.115 +{
16.116 + if( isOK ) {
16.117 + int i;
16.118 + for(i=0; i<5; i++ ) {
16.119 + const char *filename = gtk_entry_get_text( GTK_ENTRY(path_entry[i]) );
16.120 + lxdream_set_global_config_value( path_id[i], filename );
16.121 + }
16.122 +
16.123 + lxdream_save_config();
16.124 + dreamcast_config_changed();
16.125 + }
16.126 +}
16.127 +
16.128 +void path_dialog_run( void )
16.129 +{
16.130 + gtk_gui_run_property_dialog( _("Path Settings"), path_panel_new(), path_panel_done );
16.131 +}
17.1 --- a/src/gui/ctrl_dlg.c Tue Nov 20 09:42:03 2007 +0000
17.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
17.3 @@ -1,302 +0,0 @@
17.4 -/**
17.5 - * $Id: ctrl_dlg.c,v 1.6 2007-11-10 04:45:29 nkeynes Exp $
17.6 - *
17.7 - * Define the main (emu) GTK window, along with its menubars,
17.8 - * toolbars, etc.
17.9 - *
17.10 - * Copyright (c) 2005 Nathan Keynes.
17.11 - *
17.12 - * This program is free software; you can redistribute it and/or modify
17.13 - * it under the terms of the GNU General Public License as published by
17.14 - * the Free Software Foundation; either version 2 of the License, or
17.15 - * (at your option) any later version.
17.16 - *
17.17 - * This program is distributed in the hope that it will be useful,
17.18 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
17.19 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17.20 - * GNU General Public License for more details.
17.21 - */
17.22 -
17.23 -#include <assert.h>
17.24 -#include <gtk/gtk.h>
17.25 -#include <gdk/gdkkeysyms.h>
17.26 -
17.27 -#include "dream.h"
17.28 -#include "gui/gtkui.h"
17.29 -#include "maple/maple.h"
17.30 -
17.31 -#define MAX_DEVICES 4
17.32 -
17.33 -static void controller_device_configure(maple_device_t device);
17.34 -
17.35 -struct maple_config_class {
17.36 - const char *name;
17.37 - void (*config_func)(maple_device_t device);
17.38 -};
17.39 -
17.40 -typedef struct maple_slot_data {
17.41 - maple_device_t old_device;
17.42 - maple_device_t new_device;
17.43 - GtkWidget *button;
17.44 - GtkWidget *combo;
17.45 -} *maple_slot_data_t;
17.46 -
17.47 -static struct maple_config_class maple_device_config[] = {
17.48 - { "Sega Controller", controller_device_configure },
17.49 - { NULL, NULL } };
17.50 -
17.51 -static struct maple_slot_data maple_data[MAX_DEVICES];
17.52 -
17.53 -static gboolean config_key_buttonpress( GtkWidget *widget, GdkEventButton *event, gpointer user_data )
17.54 -{
17.55 - gboolean keypress_mode = GPOINTER_TO_INT(g_object_get_data( G_OBJECT(widget), "keypress_mode"));
17.56 - if( !keypress_mode ) {
17.57 - gtk_entry_set_text( GTK_ENTRY(widget), _("<press key>") );
17.58 - g_object_set_data( G_OBJECT(widget), "keypress_mode", GINT_TO_POINTER(TRUE) );
17.59 - }
17.60 - return FALSE;
17.61 -}
17.62 -
17.63 -static gboolean config_key_keypress( GtkWidget *widget, GdkEventKey *event, gpointer user_data )
17.64 -{
17.65 - gboolean keypress_mode = GPOINTER_TO_INT(g_object_get_data( G_OBJECT(widget), "keypress_mode"));
17.66 - if( keypress_mode ) {
17.67 - if( event->keyval == GDK_Escape ) {
17.68 - gtk_entry_set_text( GTK_ENTRY(widget), "" );
17.69 - g_object_set_data( G_OBJECT(widget), "keypress_mode", GINT_TO_POINTER(FALSE) );
17.70 - return TRUE;
17.71 - }
17.72 - GdkKeymap *keymap = gdk_keymap_get_default();
17.73 - guint keyval;
17.74 -
17.75 - gdk_keymap_translate_keyboard_state( keymap, event->hardware_keycode, 0, 0, &keyval,
17.76 - NULL, NULL, NULL );
17.77 - gtk_entry_set_text( GTK_ENTRY(widget), gdk_keyval_name(keyval) );
17.78 - g_object_set_data( G_OBJECT(widget), "keypress_mode", GINT_TO_POINTER(FALSE) );
17.79 - return TRUE;
17.80 - } else {
17.81 - switch( event->keyval ) {
17.82 - case GDK_Return:
17.83 - case GDK_KP_Enter:
17.84 - gtk_entry_set_text( GTK_ENTRY(widget), _("<press key>") );
17.85 - g_object_set_data( G_OBJECT(widget), "keypress_mode", GINT_TO_POINTER(TRUE) );
17.86 - return TRUE;
17.87 - case GDK_BackSpace:
17.88 - case GDK_Delete:
17.89 - gtk_entry_set_text( GTK_ENTRY(widget), "" );
17.90 - return TRUE;
17.91 - }
17.92 - return FALSE;
17.93 - }
17.94 -
17.95 -}
17.96 -
17.97 -static void controller_config_done( GtkWidget *panel, gboolean isOK )
17.98 -{
17.99 - if( isOK ) {
17.100 - maple_device_t device = (maple_device_t)gtk_object_get_data( GTK_OBJECT(panel), "maple_device" );
17.101 - lxdream_config_entry_t conf = device->get_config(device);
17.102 - int i;
17.103 - for( i=0; conf[i].key != NULL; i++ ) {
17.104 - char buf[64];
17.105 - GtkWidget *entry1, *entry2;
17.106 - const gchar *key1, *key2;
17.107 - snprintf( buf, sizeof(buf), "%s.1", conf[i].key );
17.108 - entry1 = GTK_WIDGET(g_object_get_qdata( G_OBJECT(panel), g_quark_from_string(buf)));
17.109 - key1 = gtk_entry_get_text(GTK_ENTRY(entry1));
17.110 - snprintf( buf, sizeof(buf), "%s.2", conf[i].key );
17.111 - entry2 = GTK_WIDGET(g_object_get_qdata( G_OBJECT(panel), g_quark_from_string(buf)));
17.112 - key2 = gtk_entry_get_text(GTK_ENTRY(entry2));
17.113 - if( key1 == NULL || key1[0] == '\0') {
17.114 - lxdream_set_config_value( &conf[i], key2 );
17.115 - } else if( key2 == NULL || key2[0] == '\0') {
17.116 - lxdream_set_config_value( &conf[i], key1 );
17.117 - } else {
17.118 - char buf[64];
17.119 - snprintf( buf, sizeof(buf), "%s, %s", key1, key2 );
17.120 - lxdream_set_config_value( &conf[i], buf );
17.121 - }
17.122 - }
17.123 - }
17.124 -
17.125 -}
17.126 -
17.127 -static void controller_device_configure( maple_device_t device )
17.128 -{
17.129 - lxdream_config_entry_t conf = device->get_config(device);
17.130 - int count, i;
17.131 - for( count=0; conf[count].key != NULL; count++ );
17.132 -
17.133 - GtkWidget *table = gtk_table_new( (count+1)>>1, 6, FALSE );
17.134 - GList *focus_chain = NULL;
17.135 - gtk_object_set_data( GTK_OBJECT(table), "maple_device", device );
17.136 - for( i=0; i<count; i++ ) {
17.137 - GtkWidget *text, *text2;
17.138 - char buf[64];
17.139 - int x=0;
17.140 - int y=i;
17.141 - if( i >= (count+1)>>1 ) {
17.142 - x = 3;
17.143 - y -= (count+1)>>1;
17.144 - }
17.145 - gtk_table_attach( GTK_TABLE(table), gtk_label_new(conf[i].key), x, x+1, y, y+1,
17.146 - GTK_SHRINK, GTK_SHRINK, 0, 0 );
17.147 - text = gtk_entry_new();
17.148 - gtk_entry_set_width_chars( GTK_ENTRY(text), 8 );
17.149 - gtk_entry_set_editable( GTK_ENTRY(text), FALSE );
17.150 - g_signal_connect( text, "key_press_event",
17.151 - G_CALLBACK(config_key_keypress), NULL );
17.152 - g_signal_connect( text, "button_press_event",
17.153 - G_CALLBACK(config_key_buttonpress), NULL );
17.154 - snprintf( buf, sizeof(buf), "%s.1", conf[i].key );
17.155 - g_object_set_data( G_OBJECT(text), "keypress_mode", GINT_TO_POINTER(FALSE) );
17.156 - g_object_set_qdata( G_OBJECT(table), g_quark_from_string(buf), text );
17.157 - gtk_table_attach_defaults( GTK_TABLE(table), text, x+1, x+2, y, y+1);
17.158 - focus_chain = g_list_append( focus_chain, text );
17.159 - text2 = gtk_entry_new();
17.160 - gtk_entry_set_width_chars( GTK_ENTRY(text2), 8 );
17.161 - gtk_entry_set_editable( GTK_ENTRY(text2), FALSE );
17.162 - g_signal_connect( text2, "key_press_event",
17.163 - G_CALLBACK(config_key_keypress), NULL );
17.164 - g_signal_connect( text2, "button_press_event",
17.165 - G_CALLBACK(config_key_buttonpress), NULL );
17.166 - snprintf( buf, sizeof(buf), "%s.2", conf[i].key );
17.167 - g_object_set_data( G_OBJECT(text2), "keypress_mode", GINT_TO_POINTER(FALSE) );
17.168 - g_object_set_qdata( G_OBJECT(table), g_quark_from_string(buf), text2 );
17.169 - gtk_table_attach_defaults( GTK_TABLE(table), text2, x+2, x+3, y, y+1);
17.170 - focus_chain = g_list_append( focus_chain, text2 );
17.171 - if( conf[i].value != NULL ) {
17.172 - gchar **parts = g_strsplit(conf[i].value,",",3);
17.173 - if( parts[0] != NULL ) {
17.174 - gtk_entry_set_text( GTK_ENTRY(text), g_strstrip(parts[0]) );
17.175 - if( parts[1] != NULL ) {
17.176 - gtk_entry_set_text( GTK_ENTRY(text2), g_strstrip(parts[1]) );
17.177 - }
17.178 - }
17.179 - g_strfreev(parts);
17.180 - }
17.181 - }
17.182 - gtk_container_set_focus_chain( GTK_CONTAINER(table), focus_chain );
17.183 - gtk_gui_run_property_dialog( _("Controller Configuration"), table, controller_config_done );
17.184 -}
17.185 -
17.186 -
17.187 -gboolean maple_properties_activated( GtkButton *button, gpointer user_data )
17.188 -{
17.189 - maple_slot_data_t data = (maple_slot_data_t)user_data;
17.190 - if( data->new_device != NULL ) {
17.191 - int i;
17.192 - for( i=0; maple_device_config[i].name != NULL; i++ ) {
17.193 - if( strcmp(data->new_device->device_class->name, maple_device_config[i].name) == 0 ) {
17.194 - if( data->new_device == data->old_device ) {
17.195 - // Make a copy at this point if we haven't already
17.196 - data->new_device = data->old_device->clone(data->old_device);
17.197 - }
17.198 - maple_device_config[i].config_func(data->new_device);
17.199 - break;
17.200 - }
17.201 - }
17.202 - if( maple_device_config[i].name == NULL ) {
17.203 - gui_error_dialog( _("No configuration page available for device type") );
17.204 - }
17.205 - }
17.206 - return TRUE;
17.207 -}
17.208 -
17.209 -gboolean maple_device_changed( GtkComboBox *combo, gpointer user_data )
17.210 -{
17.211 - maple_slot_data_t data = (maple_slot_data_t)user_data;
17.212 - int active = gtk_combo_box_get_active(combo);
17.213 - gtk_widget_set_sensitive(data->button, active != 0);
17.214 - if( active != 0 ) {
17.215 - gchar *devname = gtk_combo_box_get_active_text(combo);
17.216 - const maple_device_class_t devclz = maple_get_device_class(devname);
17.217 - assert(devclz != NULL);
17.218 - if( data->new_device != NULL ) {
17.219 - if( data->new_device->device_class != devclz ) {
17.220 - data->new_device->destroy(data->new_device);
17.221 - data->new_device = maple_new_device(devname);
17.222 - }
17.223 - } else {
17.224 - data->new_device = maple_new_device(devname);
17.225 - }
17.226 - } else {
17.227 - if( data->new_device != NULL && data->new_device != data->old_device ) {
17.228 - data->new_device->destroy(data->new_device);
17.229 - }
17.230 - data->new_device = NULL;
17.231 - }
17.232 - return TRUE;
17.233 -}
17.234 -
17.235 -void maple_dialog_done( GtkWidget *panel, gboolean isOK )
17.236 -{
17.237 - if( isOK ) {
17.238 - int i;
17.239 - for( i=0; i<MAX_DEVICES; i++ ) {
17.240 - if( maple_data[i].new_device != maple_data[i].old_device ) {
17.241 - if( maple_data[i].old_device != NULL ) {
17.242 - maple_detach_device(i,0);
17.243 - }
17.244 - if( maple_data[i].new_device != NULL ) {
17.245 - maple_attach_device(maple_data[i].new_device, i, 0 );
17.246 - }
17.247 - }
17.248 - }
17.249 - lxdream_save_config();
17.250 - } else {
17.251 - int i;
17.252 - for( i=0; i<MAX_DEVICES; i++ ) {
17.253 - if( maple_data[i].new_device != NULL &&
17.254 - maple_data[i].new_device != maple_data[i].old_device ) {
17.255 - maple_data[i].new_device->destroy(maple_data[i].new_device);
17.256 - }
17.257 - }
17.258 - }
17.259 -
17.260 -}
17.261 -
17.262 -GtkWidget *maple_panel_new()
17.263 -{
17.264 - GtkWidget *table = gtk_table_new(4, 3, TRUE);
17.265 - int i,j;
17.266 - const struct maple_device_class **devices = maple_get_device_classes();
17.267 -
17.268 - for( i=0; i< MAX_DEVICES; i++ ) {
17.269 - char buf[12];
17.270 - GtkWidget *combo, *button;
17.271 - int active = 0;
17.272 - maple_device_t device = maple_get_device(i,0);
17.273 - sprintf( buf, _("Slot %d."), i );
17.274 - gtk_table_attach_defaults( GTK_TABLE(table), gtk_label_new(buf), 0, 1, i, i+1 );
17.275 - combo = gtk_combo_box_new_text();
17.276 - gtk_combo_box_append_text( GTK_COMBO_BOX(combo), _("<empty>") );
17.277 - for( j=0; devices[j] != NULL; j++ ) {
17.278 - gtk_combo_box_append_text(GTK_COMBO_BOX(combo), devices[j]->name);
17.279 - if( device != NULL && device->device_class == devices[j] ) {
17.280 - active = j+1;
17.281 - }
17.282 - }
17.283 - gtk_combo_box_set_active(GTK_COMBO_BOX(combo), active);
17.284 - gtk_table_attach_defaults( GTK_TABLE(table), combo, 1, 2, i, i+1 );
17.285 - button = gtk_button_new_from_stock( GTK_STOCK_PROPERTIES );
17.286 - gtk_widget_set_sensitive(button, active != 0);
17.287 - gtk_table_attach_defaults( GTK_TABLE(table), button, 2, 3, i, i+1 );
17.288 -
17.289 - maple_data[i].old_device = device;
17.290 - maple_data[i].new_device = device;
17.291 - maple_data[i].combo = combo;
17.292 - maple_data[i].button = button;
17.293 - g_signal_connect( button, "clicked",
17.294 - G_CALLBACK( maple_properties_activated ), &maple_data[i] );
17.295 - g_signal_connect( combo, "changed",
17.296 - G_CALLBACK( maple_device_changed ), &maple_data[i] );
17.297 -
17.298 - }
17.299 - return table;
17.300 -}
17.301 -
17.302 -void maple_dialog_run( )
17.303 -{
17.304 - gtk_gui_run_property_dialog( _("Controller Settings"), maple_panel_new(), maple_dialog_done );
17.305 -}
18.1 --- a/src/gui/debug_win.c Tue Nov 20 09:42:03 2007 +0000
18.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
18.3 @@ -1,454 +0,0 @@
18.4 -/**
18.5 - * $Id: debug_win.c,v 1.29 2007-11-10 04:45:29 nkeynes Exp $
18.6 - * This file is responsible for the main debugger gui frame.
18.7 - *
18.8 - * Copyright (c) 2005 Nathan Keynes.
18.9 - *
18.10 - * This program is free software; you can redistribute it and/or modify
18.11 - * it under the terms of the GNU General Public License as published by
18.12 - * the Free Software Foundation; either version 2 of the License, or
18.13 - * (at your option) any later version.
18.14 - *
18.15 - * This program is distributed in the hope that it will be useful,
18.16 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
18.17 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18.18 - * GNU General Public License for more details.
18.19 - */
18.20 -#include <stdlib.h>
18.21 -#include <stdarg.h>
18.22 -#include <stdio.h>
18.23 -#include <string.h>
18.24 -#include <math.h>
18.25 -#include <glib/gi18n.h>
18.26 -#include <gdk/gdkkeysyms.h>
18.27 -#include "mem.h"
18.28 -#include "cpu.h"
18.29 -#include "gui/gtkui.h"
18.30 -#include "sh4/sh4dasm.h"
18.31 -#include "aica/armdasm.h"
18.32 -
18.33 -GdkColor *msg_colors[] = { &gui_colour_error, &gui_colour_error, &gui_colour_warn,
18.34 - &gui_colour_normal,&gui_colour_debug, &gui_colour_trace };
18.35 -
18.36 -const cpu_desc_t cpu_list[4] = { &sh4_cpu_desc, &arm_cpu_desc, &armt_cpu_desc, NULL };
18.37 -
18.38 -void init_register_list( debug_window_t data );
18.39 -uint32_t row_to_address( debug_window_t data, int row );
18.40 -int address_to_row( debug_window_t data, uint32_t address );
18.41 -void set_disassembly_pc( debug_window_t data, unsigned int pc, gboolean select );
18.42 -void set_disassembly_region( debug_window_t data, unsigned int page );
18.43 -void set_disassembly_cpu( debug_window_t data, const gchar *cpu );
18.44 -
18.45 -void on_mode_field_changed ( GtkEditable *editable, gpointer user_data);
18.46 -gboolean on_page_field_key_press_event( GtkWidget * widget, GdkEventKey *event,
18.47 - gpointer user_data);
18.48 -void on_jump_pc_btn_clicked( GtkButton *button, gpointer user_data);
18.49 -void on_disasm_list_select_row (GtkCList *clist, gint row, gint column,
18.50 - GdkEvent *event, gpointer user_data);
18.51 -void on_disasm_list_unselect_row (GtkCList *clist, gint row, gint column,
18.52 - GdkEvent *event, gpointer user_data);
18.53 -gboolean on_debug_delete_event(GtkWidget *widget, GdkEvent event, gpointer user_data);
18.54 -
18.55 -struct debug_window_info {
18.56 - int disasm_from;
18.57 - int disasm_to;
18.58 - int disasm_pc;
18.59 - const struct cpu_desc_struct *cpu;
18.60 - const cpu_desc_t *cpu_list;
18.61 - GtkCList *regs_list;
18.62 - GtkCList *disasm_list;
18.63 - GtkEntry *page_field;
18.64 - GtkWidget *window;
18.65 - GtkWidget *statusbar;
18.66 - char saved_regs[0];
18.67 -};
18.68 -
18.69 -debug_window_t debug_window_new( const gchar *title, GtkWidget *menubar,
18.70 - GtkWidget *toolbar, GtkAccelGroup *accel_group )
18.71 -{
18.72 - debug_window_t data = g_malloc0( sizeof(struct debug_window_info) + cpu_list[0]->regs_size );
18.73 - GtkWidget *vbox;
18.74 -
18.75 - data->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
18.76 - gtk_window_set_default_size (GTK_WINDOW (data->window), 640, 480);
18.77 - gtk_window_set_title( GTK_WINDOW(data->window), title );
18.78 - gtk_window_add_accel_group (GTK_WINDOW (data->window), accel_group);
18.79 -
18.80 - gtk_toolbar_set_style( GTK_TOOLBAR(toolbar), GTK_TOOLBAR_ICONS );
18.81 -
18.82 - data->statusbar = gtk_statusbar_new();
18.83 -
18.84 - GtkWidget *hpaned = gtk_hpaned_new ();
18.85 - gtk_paned_set_position (GTK_PANED (hpaned), 800);
18.86 -
18.87 - GtkWidget *disasm_box = gtk_vbox_new(FALSE,0);
18.88 - gtk_paned_pack1 (GTK_PANED (hpaned), disasm_box, TRUE, TRUE);
18.89 -
18.90 - GtkWidget *hbox1 = gtk_hbox_new (FALSE, 0);
18.91 - gtk_box_pack_start (GTK_BOX (disasm_box), hbox1, FALSE, FALSE, 3);
18.92 - gtk_box_pack_start (GTK_BOX (hbox1), gtk_label_new (_("Page")), FALSE, FALSE, 4);
18.93 -
18.94 - data->page_field = GTK_ENTRY(gtk_entry_new ());
18.95 - gtk_box_pack_start (GTK_BOX (hbox1), GTK_WIDGET(data->page_field), FALSE, TRUE, 0);
18.96 -
18.97 - GtkWidget *jump_pc_btn = gtk_button_new_with_mnemonic (_(" Jump to PC "));
18.98 - gtk_box_pack_start (GTK_BOX (hbox1), jump_pc_btn, FALSE, FALSE, 4);
18.99 -
18.100 - gtk_box_pack_start (GTK_BOX (hbox1), gtk_label_new(_("Mode")), FALSE, FALSE, 5);
18.101 -
18.102 - GtkWidget *mode_box = gtk_combo_new ();
18.103 - gtk_box_pack_start (GTK_BOX (hbox1), mode_box, FALSE, FALSE, 0);
18.104 - GList *mode_box_items = NULL;
18.105 - mode_box_items = g_list_append (mode_box_items, (gpointer) _("SH4"));
18.106 - mode_box_items = g_list_append (mode_box_items, (gpointer) _("ARM7"));
18.107 - mode_box_items = g_list_append (mode_box_items, (gpointer) _("ARM7T"));
18.108 - gtk_combo_set_popdown_strings (GTK_COMBO (mode_box), mode_box_items);
18.109 - g_list_free (mode_box_items);
18.110 -
18.111 - GtkWidget *mode_field = GTK_COMBO (mode_box)->entry;
18.112 - gtk_editable_set_editable (GTK_EDITABLE (mode_field), FALSE);
18.113 -
18.114 - GtkWidget *disasm_scroll = gtk_scrolled_window_new (NULL, NULL);
18.115 - gtk_box_pack_start (GTK_BOX (disasm_box), disasm_scroll, TRUE, TRUE, 0);
18.116 - gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (disasm_scroll), GTK_SHADOW_IN);
18.117 - data->disasm_list = GTK_CLIST(gtk_clist_new (4));
18.118 - gtk_clist_set_column_width (GTK_CLIST (data->disasm_list), 0, 80);
18.119 - gtk_clist_set_column_width (GTK_CLIST (data->disasm_list), 2, 80);
18.120 - gtk_clist_set_column_width (GTK_CLIST (data->disasm_list), 3, 80);
18.121 - gtk_clist_set_column_width( data->disasm_list, 1, 16 );
18.122 - gtk_clist_column_titles_hide (GTK_CLIST (data->disasm_list));
18.123 - gtk_container_add (GTK_CONTAINER (disasm_scroll), GTK_WIDGET(data->disasm_list));
18.124 -
18.125 - GtkWidget *reg_scroll = gtk_scrolled_window_new (NULL, NULL);
18.126 - gtk_paned_pack2 (GTK_PANED (hpaned), reg_scroll, FALSE, TRUE);
18.127 - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (reg_scroll), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
18.128 - gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (reg_scroll), GTK_SHADOW_IN);
18.129 -
18.130 - data->regs_list = GTK_CLIST(gtk_clist_new (2));
18.131 - gtk_container_add (GTK_CONTAINER (reg_scroll), GTK_WIDGET(data->regs_list));
18.132 - gtk_clist_set_column_width (GTK_CLIST (data->regs_list), 0, 80);
18.133 - gtk_clist_set_column_width (GTK_CLIST (data->regs_list), 1, 80);
18.134 - gtk_clist_column_titles_hide (GTK_CLIST (data->regs_list));
18.135 - gtk_widget_modify_font( GTK_WIDGET(data->regs_list), gui_fixed_font );
18.136 -
18.137 - vbox = gtk_vbox_new(FALSE, 0);
18.138 - gtk_container_add( GTK_CONTAINER(data->window), vbox );
18.139 - gtk_box_pack_start( GTK_BOX(vbox), menubar, FALSE, FALSE, 0 );
18.140 - gtk_box_pack_start( GTK_BOX(vbox), toolbar, FALSE, FALSE, 0 );
18.141 - gtk_box_pack_start( GTK_BOX(vbox), hpaned, TRUE, TRUE, 0 );
18.142 - gtk_box_pack_start( GTK_BOX(vbox), data->statusbar, FALSE, FALSE, 0 );
18.143 -
18.144 - g_signal_connect ((gpointer) data->page_field, "key_press_event",
18.145 - G_CALLBACK (on_page_field_key_press_event),
18.146 - data);
18.147 - g_signal_connect ((gpointer) jump_pc_btn, "clicked",
18.148 - G_CALLBACK (on_jump_pc_btn_clicked),
18.149 - data);
18.150 - g_signal_connect ((gpointer) mode_field, "changed",
18.151 - G_CALLBACK (on_mode_field_changed),
18.152 - data);
18.153 - g_signal_connect ((gpointer) data->disasm_list, "select_row",
18.154 - G_CALLBACK (on_disasm_list_select_row),
18.155 - data);
18.156 - g_signal_connect ((gpointer) data->disasm_list, "unselect_row",
18.157 - G_CALLBACK (on_disasm_list_unselect_row),
18.158 - data);
18.159 - g_signal_connect ((gpointer) data->window, "delete_event",
18.160 - G_CALLBACK (on_debug_delete_event),
18.161 - data);
18.162 -
18.163 - data->disasm_from = -1;
18.164 - data->disasm_to = -1;
18.165 - data->disasm_pc = -1;
18.166 - data->cpu = cpu_list[0];
18.167 - data->cpu_list = cpu_list;
18.168 -
18.169 - init_register_list( data );
18.170 - gtk_object_set_data( GTK_OBJECT(data->window), "debug_data", data );
18.171 - set_disassembly_pc( data, *data->cpu->pc, FALSE );
18.172 - debug_window_set_running( data, FALSE );
18.173 -
18.174 - gtk_widget_show_all( data->window );
18.175 - return data;
18.176 -}
18.177 -
18.178 -void debug_window_show( debug_window_t data, gboolean show )
18.179 -{
18.180 - if( show ) {
18.181 - gtk_widget_show( data->window );
18.182 - } else {
18.183 - gtk_widget_hide( data->window );
18.184 - }
18.185 -}
18.186 -
18.187 -int debug_window_get_selected_row( debug_window_t data )
18.188 -{
18.189 - if( data->disasm_list->selection == NULL ) {
18.190 - return -1;
18.191 - } else {
18.192 - return GPOINTER_TO_INT(data->disasm_list->selection->data);
18.193 - }
18.194 -}
18.195 -
18.196 -void init_register_list( debug_window_t data )
18.197 -{
18.198 - int i;
18.199 - char buf[20];
18.200 - char *arr[2];
18.201 -
18.202 - gtk_clist_clear( data->regs_list );
18.203 - arr[1] = buf;
18.204 - for( i=0; data->cpu->regs_info[i].name != NULL; i++ ) {
18.205 - arr[0] = data->cpu->regs_info[i].name;
18.206 - if( data->cpu->regs_info->type == REG_INT )
18.207 - sprintf( buf, "%08X", *((uint32_t *)data->cpu->regs_info[i].value) );
18.208 - else
18.209 - sprintf( buf, "%f", *((float *)data->cpu->regs_info[i].value) );
18.210 - gtk_clist_append( data->regs_list, arr );
18.211 - }
18.212 -}
18.213 -
18.214 -/*
18.215 - * Check for changed registers and update the display
18.216 - */
18.217 -void debug_window_update( debug_window_t data )
18.218 -{
18.219 - int i;
18.220 - for( i=0; data->cpu->regs_info[i].name != NULL; i++ ) {
18.221 - if( data->cpu->regs_info[i].type == REG_INT ) {
18.222 - /* Yes this _is_ probably fairly evil */
18.223 - if( *((uint32_t *)data->cpu->regs_info[i].value) !=
18.224 - *((uint32_t *)((char *)data->saved_regs + ((char *)data->cpu->regs_info[i].value - (char *)data->cpu->regs))) ) {
18.225 - char buf[20];
18.226 - sprintf( buf, "%08X", *((uint32_t *)data->cpu->regs_info[i].value) );
18.227 - gtk_clist_set_text( data->regs_list, i, 1, buf );
18.228 - gtk_clist_set_foreground( data->regs_list, i, &gui_colour_changed );
18.229 - } else {
18.230 - gtk_clist_set_foreground( data->regs_list, i, &gui_colour_normal );
18.231 - }
18.232 - } else {
18.233 - if( *((float *)data->cpu->regs_info[i].value) !=
18.234 - *((float *)((char *)data->saved_regs + ((char *)data->cpu->regs_info[i].value - (char *)data->cpu->regs))) ) {
18.235 - char buf[20];
18.236 - sprintf( buf, "%f", *((float *)data->cpu->regs_info[i].value) );
18.237 - gtk_clist_set_text( data->regs_list, i, 1, buf );
18.238 - gtk_clist_set_foreground( data->regs_list, i, &gui_colour_changed );
18.239 - } else {
18.240 - gtk_clist_set_foreground( data->regs_list, i, &gui_colour_normal );
18.241 - }
18.242 - }
18.243 - }
18.244 -
18.245 - set_disassembly_pc( data, *data->cpu->pc, TRUE );
18.246 - memcpy( data->saved_regs, data->cpu->regs, data->cpu->regs_size );
18.247 -}
18.248 -
18.249 -void set_disassembly_region( debug_window_t data, unsigned int page )
18.250 -{
18.251 - uint32_t i, posn, next;
18.252 - char buf[80];
18.253 - char addr[10];
18.254 - char opcode[16] = "";
18.255 - char *arr[4] = { addr, " ", opcode, buf };
18.256 - unsigned int from = page & 0xFFFFF000;
18.257 - unsigned int to = from + 4096;
18.258 -
18.259 - gtk_clist_clear(data->disasm_list);
18.260 -
18.261 - sprintf( addr, "%08X", from );
18.262 - gtk_entry_set_text( data->page_field, addr );
18.263 -
18.264 - if( !data->cpu->is_valid_page_func( from ) ) {
18.265 - arr[3] = _("This page is currently unmapped");
18.266 - gtk_clist_append( data->disasm_list, arr );
18.267 - gtk_clist_set_foreground( data->disasm_list, 0, &gui_colour_error );
18.268 - } else {
18.269 - for( i=from; i<to; i = next ) {
18.270 - next = data->cpu->disasm_func( i, buf, sizeof(buf), opcode );
18.271 - sprintf( addr, "%08X", i );
18.272 - posn = gtk_clist_append( data->disasm_list, arr );
18.273 - if( buf[0] == '?' )
18.274 - gtk_clist_set_foreground( data->disasm_list, posn, &gui_colour_warn );
18.275 - if( data->cpu->get_breakpoint != NULL ) {
18.276 - int type = data->cpu->get_breakpoint( i );
18.277 - switch(type) {
18.278 - case BREAK_ONESHOT:
18.279 - gtk_clist_set_background( data->disasm_list, posn, &gui_colour_temp_break );
18.280 - break;
18.281 - case BREAK_KEEP:
18.282 - gtk_clist_set_background( data->disasm_list, posn, &gui_colour_break );
18.283 - break;
18.284 - }
18.285 - }
18.286 - }
18.287 - if( data->disasm_pc != -1 && data->disasm_pc >= from && data->disasm_pc < to )
18.288 - gtk_clist_set_foreground( data->disasm_list, address_to_row(data, data->disasm_pc),
18.289 - &gui_colour_pc );
18.290 - }
18.291 -
18.292 - if( page != from ) { /* not a page boundary */
18.293 - gtk_clist_moveto( data->disasm_list, (page-from)>>1, 0, 0.5, 0.0 );
18.294 - }
18.295 - data->disasm_from = from;
18.296 - data->disasm_to = to;
18.297 -}
18.298 -
18.299 -void jump_to_disassembly( debug_window_t data, unsigned int addr, gboolean select )
18.300 -{
18.301 - int row;
18.302 -
18.303 - if( addr < data->disasm_from || addr >= data->disasm_to )
18.304 - set_disassembly_region(data,addr);
18.305 -
18.306 - row = address_to_row( data, addr );
18.307 - if(select) {
18.308 - gtk_clist_select_row( data->disasm_list, row, 0 );
18.309 - }
18.310 - if( gtk_clist_row_is_visible( data->disasm_list, row ) != GTK_VISIBILITY_FULL ){
18.311 - gtk_clist_moveto( data->disasm_list, row, 0, 0.5, 0.0 );
18.312 - }
18.313 -}
18.314 -
18.315 -void jump_to_pc( debug_window_t data, gboolean select )
18.316 -{
18.317 - jump_to_disassembly( data, *data->cpu->pc, select );
18.318 -}
18.319 -
18.320 -void set_disassembly_pc( debug_window_t data, unsigned int pc, gboolean select )
18.321 -{
18.322 - int row;
18.323 -
18.324 - jump_to_disassembly( data, pc, select );
18.325 - if( data->disasm_pc != -1 && data->disasm_pc >= data->disasm_from &&
18.326 - data->disasm_pc < data->disasm_to )
18.327 - gtk_clist_set_foreground( data->disasm_list,
18.328 - (data->disasm_pc - data->disasm_from) / data->cpu->instr_size,
18.329 - &gui_colour_normal );
18.330 - row = address_to_row( data, pc );
18.331 - gtk_clist_set_foreground( data->disasm_list, row, &gui_colour_pc );
18.332 - data->disasm_pc = pc;
18.333 -}
18.334 -
18.335 -void set_disassembly_cpu( debug_window_t data, const gchar *cpu )
18.336 -{
18.337 - int i;
18.338 - for( i=0; data->cpu_list[i] != NULL; i++ ) {
18.339 - if( strcmp( data->cpu_list[i]->name, cpu ) == 0 ) {
18.340 - if( data->cpu != data->cpu_list[i] ) {
18.341 - data->cpu = data->cpu_list[i];
18.342 - data->disasm_from = data->disasm_to = -1; /* Force reload */
18.343 - set_disassembly_pc( data, *data->cpu->pc, FALSE );
18.344 - init_register_list( data );
18.345 - }
18.346 - return;
18.347 - }
18.348 - }
18.349 -}
18.350 -
18.351 -void debug_window_toggle_breakpoint( debug_window_t data, int row )
18.352 -{
18.353 - uint32_t pc = row_to_address( data, row );
18.354 - int oldType = data->cpu->get_breakpoint( pc );
18.355 - if( oldType != BREAK_NONE ) {
18.356 - data->cpu->clear_breakpoint( pc, oldType );
18.357 - gtk_clist_set_background( data->disasm_list, row, &gui_colour_white );
18.358 - } else {
18.359 - data->cpu->set_breakpoint( pc, BREAK_KEEP );
18.360 - gtk_clist_set_background( data->disasm_list, row, &gui_colour_break );
18.361 - }
18.362 -}
18.363 -
18.364 -void debug_window_set_oneshot_breakpoint( debug_window_t data, int row )
18.365 -{
18.366 - uint32_t pc = row_to_address( data, row );
18.367 - data->cpu->clear_breakpoint( pc, BREAK_ONESHOT );
18.368 - data->cpu->set_breakpoint( pc, BREAK_ONESHOT );
18.369 - gtk_clist_set_background( data->disasm_list, row, &gui_colour_temp_break );
18.370 -}
18.371 -
18.372 -/**
18.373 - * Execute a single instruction using the current CPU mode.
18.374 - */
18.375 -void debug_window_single_step( debug_window_t data )
18.376 -{
18.377 - data->cpu->step_func();
18.378 - gtk_gui_update();
18.379 -}
18.380 -
18.381 -uint32_t row_to_address( debug_window_t data, int row ) {
18.382 - return data->cpu->instr_size * row + data->disasm_from;
18.383 -}
18.384 -
18.385 -int address_to_row( debug_window_t data, uint32_t address ) {
18.386 - if( data->disasm_from > address || data->disasm_to <= address )
18.387 - return -1;
18.388 - return (address - data->disasm_from) / data->cpu->instr_size;
18.389 -}
18.390 -
18.391 -debug_window_t get_debug_info( GtkWidget *widget ) {
18.392 -
18.393 - GtkWidget *win = gtk_widget_get_toplevel(widget);
18.394 - debug_window_t data = (debug_window_t)gtk_object_get_data( GTK_OBJECT(win), "debug_data" );
18.395 - return data;
18.396 -}
18.397 -
18.398 -void debug_window_set_running( debug_window_t data, gboolean isRunning )
18.399 -{
18.400 - if( data != NULL ) {
18.401 - gtk_gui_enable_action( "SingleStep", !isRunning );
18.402 - gtk_gui_enable_action( "RunTo", !isRunning );
18.403 - }
18.404 -}
18.405 -
18.406 -void on_mode_field_changed ( GtkEditable *editable, gpointer user_data)
18.407 -{
18.408 - const gchar *text = gtk_entry_get_text( GTK_ENTRY(editable) );
18.409 - set_disassembly_cpu( gtk_gui_get_debugger(), text );
18.410 -}
18.411 -
18.412 -
18.413 -gboolean on_page_field_key_press_event( GtkWidget * widget, GdkEventKey *event,
18.414 - gpointer user_data)
18.415 -{
18.416 - if( event->keyval == GDK_Return || event->keyval == GDK_Linefeed ) {
18.417 - debug_window_t data = get_debug_info(widget);
18.418 - const gchar *text = gtk_entry_get_text( GTK_ENTRY(widget) );
18.419 - gchar *endptr;
18.420 - unsigned int val = strtoul( text, &endptr, 16 );
18.421 - if( text == endptr ) { /* invalid input */
18.422 - char buf[10];
18.423 - sprintf( buf, "%08X", row_to_address(data,0) );
18.424 - gtk_entry_set_text( GTK_ENTRY(widget), buf );
18.425 - } else {
18.426 - set_disassembly_region(data, val);
18.427 - }
18.428 - }
18.429 - return FALSE;
18.430 -}
18.431 -
18.432 -
18.433 -void on_jump_pc_btn_clicked( GtkButton *button, gpointer user_data)
18.434 -{
18.435 - debug_window_t data = get_debug_info( GTK_WIDGET(button) );
18.436 - jump_to_pc( data, TRUE );
18.437 -}
18.438 -
18.439 -void on_disasm_list_select_row (GtkCList *clist, gint row, gint column,
18.440 - GdkEvent *event, gpointer user_data)
18.441 -{
18.442 - gtk_gui_enable_action( "SetBreakpoint", TRUE );
18.443 - gtk_gui_enable_action( "RunTo", TRUE );
18.444 -}
18.445 -
18.446 -void on_disasm_list_unselect_row (GtkCList *clist, gint row, gint column,
18.447 - GdkEvent *event, gpointer user_data)
18.448 -{
18.449 - gtk_gui_enable_action( "SetBreakpoint", FALSE );
18.450 - gtk_gui_enable_action( "RunTo", FALSE );
18.451 -}
18.452 -
18.453 -gboolean on_debug_delete_event(GtkWidget *widget, GdkEvent event, gpointer user_data)
18.454 -{
18.455 - gtk_widget_hide( widget );
18.456 - return TRUE;
18.457 -}
19.1 --- a/src/gui/dump_win.c Tue Nov 20 09:42:03 2007 +0000
19.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
19.3 @@ -1,256 +0,0 @@
19.4 -/**
19.5 - * $Id: dump_win.c,v 1.7 2007-10-31 12:23:19 nkeynes Exp $
19.6 - *
19.7 - * Implements the memory dump window.
19.8 - *
19.9 - * Copyright (c) 2005 Nathan Keynes.
19.10 - *
19.11 - * This program is free software; you can redistribute it and/or modify
19.12 - * it under the terms of the GNU General Public License as published by
19.13 - * the Free Software Foundation; either version 2 of the License, or
19.14 - * (at your option) any later version.
19.15 - *
19.16 - * This program is distributed in the hope that it will be useful,
19.17 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
19.18 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19.19 - * GNU General Public License for more details.
19.20 - */
19.21 -
19.22 -#include <ctype.h>
19.23 -#include <assert.h>
19.24 -#include <string.h>
19.25 -#include <glib/gi18n.h>
19.26 -#include "mem.h"
19.27 -#include "gui/gtkui.h"
19.28 -
19.29 -#define MAX_DUMP_SIZE 4096
19.30 -
19.31 -#define DUMP_WINDOW_TAG 0xD4B9DA7A
19.32 -
19.33 -struct dump_window_info {
19.34 - uint32_t _tag;
19.35 - uint32_t start;
19.36 - uint32_t end;
19.37 - int flags;
19.38 - unsigned char *data;
19.39 -
19.40 - GtkWidget *window;
19.41 - GtkWidget *fromInput, *toInput;
19.42 - GtkWidget *textArea;
19.43 - GtkTextTag *changedTag;
19.44 - GtkTextBuffer *textBuffer;
19.45 - struct dump_window_info *next;
19.46 -};
19.47 -
19.48 -static dump_window_t dump_list_head = NULL;
19.49 -
19.50 -gboolean on_dump_window_delete_event( GtkWidget *widget, GdkEvent *event,
19.51 - gpointer user_data );
19.52 -void on_dump_window_button_view_clicked( GtkWidget *widget, gpointer user_data );
19.53 -void dump_window_set_text( dump_window_t data, unsigned char *old_data, unsigned char *new_data );
19.54 -
19.55 -
19.56 -dump_window_t dump_window_new( const gchar *title )
19.57 -{
19.58 - GtkWidget *vbox3;
19.59 - GtkWidget *hbox2;
19.60 - GtkWidget *dump_view_button;
19.61 - GtkWidget *scrolledwindow9;
19.62 -
19.63 - dump_window_t dump = g_malloc0( sizeof( struct dump_window_info ) );
19.64 -
19.65 - dump->_tag = DUMP_WINDOW_TAG;
19.66 - dump->next = dump_list_head;
19.67 - dump_list_head = dump;
19.68 - dump->data = NULL;
19.69 - dump->start = 0;
19.70 - dump->end = 0;
19.71 - dump->window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
19.72 - gtk_window_set_title (GTK_WINDOW (dump->window), _("Memory dump"));
19.73 -
19.74 - vbox3 = gtk_vbox_new (FALSE, 0);
19.75 - gtk_container_add (GTK_CONTAINER (dump->window), vbox3);
19.76 -
19.77 - hbox2 = gtk_hbox_new (FALSE, 0);
19.78 - dump->fromInput = gtk_entry_new ();
19.79 - gtk_entry_set_text( GTK_ENTRY(dump->fromInput), "" );
19.80 - dump->toInput = gtk_entry_new ();
19.81 - gtk_entry_set_text( GTK_ENTRY(dump->toInput), "" );
19.82 - dump_view_button = gtk_button_new_with_mnemonic (_("View"));
19.83 -
19.84 - gtk_box_pack_start (GTK_BOX (hbox2), gtk_label_new(_(" From ")), FALSE, FALSE, 0);
19.85 - gtk_box_pack_start (GTK_BOX (hbox2), dump->fromInput, FALSE, TRUE, 0);
19.86 - gtk_box_pack_start (GTK_BOX (hbox2), gtk_label_new(_(" To ")), FALSE, FALSE, 0);
19.87 - gtk_box_pack_start (GTK_BOX (hbox2), dump->toInput, FALSE, TRUE, 0);
19.88 - gtk_box_pack_start (GTK_BOX (hbox2), dump_view_button, FALSE, FALSE, 0);
19.89 - gtk_box_pack_start (GTK_BOX (hbox2), gtk_label_new (_(" ")), TRUE, TRUE, 0);
19.90 - gtk_box_pack_start (GTK_BOX (vbox3), hbox2, FALSE, TRUE, 3);
19.91 -
19.92 - dump->textArea = gtk_text_view_new ();
19.93 - dump->textBuffer = gtk_text_buffer_new(NULL);
19.94 - dump->changedTag = gtk_text_buffer_create_tag(dump->textBuffer, "changed",
19.95 - "foreground", "blue", NULL);
19.96 - gtk_widget_modify_font(GTK_WIDGET(dump->textArea),gui_fixed_font);
19.97 - gtk_text_view_set_editable(GTK_TEXT_VIEW(dump->textArea), FALSE);
19.98 - gtk_text_view_set_buffer(GTK_TEXT_VIEW(dump->textArea), dump->textBuffer);
19.99 - scrolledwindow9 = gtk_scrolled_window_new (NULL, NULL);
19.100 - gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow9), GTK_SHADOW_IN);
19.101 - gtk_container_add (GTK_CONTAINER (scrolledwindow9), dump->textArea);
19.102 - gtk_box_pack_start (GTK_BOX (vbox3), scrolledwindow9, TRUE, TRUE, 0);
19.103 -
19.104 - g_signal_connect (dump->window, "delete_event",
19.105 - G_CALLBACK (on_dump_window_delete_event),
19.106 - dump);
19.107 - g_signal_connect (dump_view_button, "clicked",
19.108 - G_CALLBACK (on_dump_window_button_view_clicked),
19.109 - dump);
19.110 - gtk_widget_show_all( dump->window );
19.111 -
19.112 - return dump;
19.113 -}
19.114 -
19.115 -void gtk_entry_set_hex_value( GtkEntry *entry, uint32_t value )
19.116 -{
19.117 - char buf[10];
19.118 - sprintf( buf, "%08X", value );
19.119 - gtk_entry_set_text( entry, buf );
19.120 -}
19.121 -
19.122 -uint32_t gtk_entry_get_hex_value( GtkEntry *entry, uint32_t defaultValue )
19.123 -{
19.124 - const gchar *text = gtk_entry_get_text(entry);
19.125 - if( text == NULL )
19.126 - return defaultValue;
19.127 - gchar *endptr;
19.128 - uint32_t value = strtoul( text, &endptr, 16 );
19.129 - if( text == endptr ) { /* invalid input */
19.130 - value = defaultValue;
19.131 - gtk_entry_set_hex_value( entry, value );
19.132 - }
19.133 - return value;
19.134 -}
19.135 -
19.136 -gboolean on_dump_window_delete_event( GtkWidget *widget, GdkEvent *event,
19.137 - gpointer user_data )
19.138 -{
19.139 - dump_window_t data = (dump_window_t)user_data;
19.140 - if( data->data != NULL )
19.141 - free( data->data );
19.142 - dump_window_t node = dump_list_head;
19.143 - if( node == data )
19.144 - dump_list_head = data->next;
19.145 - else {
19.146 - while( node->next != data ) {
19.147 - node = node->next;
19.148 - assert( node != NULL );
19.149 - }
19.150 - node->next = data->next;
19.151 - }
19.152 - free( data );
19.153 - return FALSE;
19.154 -}
19.155 -
19.156 -void on_dump_window_button_view_clicked( GtkWidget *widget, gpointer user_data )
19.157 -{
19.158 - dump_window_t data = (dump_window_t)user_data;
19.159 - uint32_t startVal, endVal;
19.160 -
19.161 - assert( data != NULL );
19.162 - assert( data->_tag == DUMP_WINDOW_TAG );
19.163 -
19.164 - startVal = gtk_entry_get_hex_value(GTK_ENTRY(data->fromInput), data->start);
19.165 - endVal = gtk_entry_get_hex_value(GTK_ENTRY(data->toInput), data->end);
19.166 - if( startVal != data->start || endVal != data->end ) {
19.167 - if( startVal > endVal ) {
19.168 - int tmp = endVal;
19.169 - endVal = startVal;
19.170 - startVal = tmp;
19.171 - }
19.172 - if( endVal > startVal + MAX_DUMP_SIZE )
19.173 - endVal = startVal + MAX_DUMP_SIZE;
19.174 -
19.175 - gtk_entry_set_hex_value(GTK_ENTRY(data->fromInput),startVal);
19.176 - gtk_entry_set_hex_value(GTK_ENTRY(data->toInput),endVal);
19.177 - data->start = startVal;
19.178 - data->end = endVal;
19.179 -
19.180 - if( data->data != NULL ) {
19.181 - free( data->data );
19.182 - data->data = NULL;
19.183 - }
19.184 - if( startVal != endVal ) {
19.185 - data->data = malloc( endVal - startVal );
19.186 - mem_copy_from_sh4( data->data, startVal, endVal-startVal );
19.187 - dump_window_set_text( data, data->data, data->data );
19.188 - }
19.189 - }
19.190 -}
19.191 -
19.192 -void dump_window_update( dump_window_t data )
19.193 -{
19.194 - if( data->data == NULL )
19.195 - return;
19.196 - unsigned char tmp[data->end-data->start];
19.197 - int length = data->end-data->start;
19.198 - memcpy( tmp, data->data, length );
19.199 - mem_copy_from_sh4( data->data, data->start, length );
19.200 - dump_window_set_text( data, tmp, data->data );
19.201 -}
19.202 -
19.203 -void dump_window_update_all( )
19.204 -{
19.205 - dump_window_t node = dump_list_head;
19.206 - while( node != NULL ) {
19.207 - dump_window_update(node);
19.208 - node = node->next;
19.209 - }
19.210 -}
19.211 -
19.212 -void dump_window_set_text( dump_window_t data, unsigned char *old_data, unsigned char *new_data )
19.213 -{
19.214 - GtkTextBuffer *buf = data->textBuffer;
19.215 - GtkTextTag *changedTag = data->changedTag;
19.216 - GtkTextIter iter, endIter;
19.217 - int i, j, offset;
19.218 - /* Clear out the buffer */
19.219 - gtk_text_buffer_get_start_iter(buf,&iter);
19.220 - gtk_text_buffer_get_end_iter(buf,&endIter);
19.221 - gtk_text_buffer_delete(buf,&iter,&endIter);
19.222 - gtk_text_buffer_get_start_iter(buf,&iter);
19.223 -
19.224 - for( offset = 0, i=data->start; i<data->end; i+=16, offset+=16 ) {
19.225 - char text[80];
19.226 - sprintf(text, "%08X:", i );
19.227 - gtk_text_buffer_insert( buf, &iter, text, 9 );
19.228 - for( j=0; j<16; j++ ) {
19.229 - if( j%4 == 0 )
19.230 - gtk_text_buffer_insert( buf, &iter, " ", 1 );
19.231 - if( i+j < data->end ) {
19.232 - int oldVal = ((int)old_data[offset+j])&0xFF;
19.233 - int newVal = ((int)new_data[offset+j])&0xFF;
19.234 - sprintf(text, "%02X ", newVal);
19.235 - if( oldVal == newVal )
19.236 - gtk_text_buffer_insert( buf, &iter, text, 3 );
19.237 - else
19.238 - gtk_text_buffer_insert_with_tags( buf, &iter, text, 3,
19.239 - changedTag, NULL );
19.240 - } else {
19.241 - gtk_text_buffer_insert( buf, &iter, " ", 3 );
19.242 - }
19.243 - }
19.244 - gtk_text_buffer_insert( buf, &iter, " ", 2 );
19.245 - for( j=0; j<16 && i+j < data->end; j++ ) {
19.246 - int oldVal = ((int)old_data[offset+j])&0xFF;
19.247 - int newVal = ((int)new_data[offset+j])&0xFF;
19.248 - if( isprint(newVal) )
19.249 - sprintf( text, "%c", newVal );
19.250 - else strcpy( text, "." );
19.251 - if( oldVal == newVal )
19.252 - gtk_text_buffer_insert( buf, &iter, text, 1 );
19.253 - else
19.254 - gtk_text_buffer_insert_with_tags( buf, &iter, text, 1,
19.255 - changedTag, NULL );
19.256 - }
19.257 - gtk_text_buffer_insert( buf, &iter, "\n", 1 );
19.258 - }
19.259 -}
20.1 --- a/src/gui/gdrom_menu.c Tue Nov 20 09:42:03 2007 +0000
20.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
20.3 @@ -1,240 +0,0 @@
20.4 -/**
20.5 - * $Id: gdrom_menu.c,v 1.5 2007-11-10 04:45:29 nkeynes Exp $
20.6 - *
20.7 - * Creates and manages the GD-Rom attachment menu.
20.8 - *
20.9 - * Copyright (c) 2005 Nathan Keynes.
20.10 - *
20.11 - * This program is free software; you can redistribute it and/or modify
20.12 - * it under the terms of the GNU General Public License as published by
20.13 - * the Free Software Foundation; either version 2 of the License, or
20.14 - * (at your option) any later version.
20.15 - *
20.16 - * This program is distributed in the hope that it will be useful,
20.17 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
20.18 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20.19 - * GNU General Public License for more details.
20.20 - */
20.21 -
20.22 -#include <assert.h>
20.23 -#include <libgen.h>
20.24 -#include <glib/gi18n.h>
20.25 -
20.26 -#include "dream.h"
20.27 -#include "dreamcast.h"
20.28 -#include "config.h"
20.29 -#include "gdrom/gdrom.h"
20.30 -#include "gui/gtkui.h"
20.31 -
20.32 -#define MAX_RECENT_ITEMS 5
20.33 -
20.34 -static GList *gdrom_menu_list = NULL;
20.35 -static gboolean gdrom_menu_adjusting = FALSE;
20.36 -static GList *gdrom_device_list = NULL;
20.37 -static GList *gdrom_recent_list = NULL;
20.38 -
20.39 -void gdrom_menu_rebuild_all();
20.40 -
20.41 -
20.42 -gint gdrom_menu_find_item( const gchar *name )
20.43 -{
20.44 - gint posn = 0;
20.45 - GList *ptr;
20.46 -
20.47 - for( ptr = gdrom_device_list; ptr != NULL; ptr = g_list_next(ptr) ) {
20.48 - gchar *device = (gchar *)ptr->data;
20.49 - posn++;
20.50 - if( strcmp(device, name) == 0 ) {
20.51 - return posn;
20.52 - }
20.53 - }
20.54 - posn++;
20.55 - for( ptr = gdrom_recent_list; ptr != NULL; ptr = g_list_next(ptr) ) {
20.56 - gchar *file = (gchar *)ptr->data;
20.57 - posn++;
20.58 - if( strcmp(file, name) == 0 ) {
20.59 - return posn;
20.60 - }
20.61 - }
20.62 - return -1;
20.63 -}
20.64 -
20.65 -gint gdrom_menu_add_recent_item( const gchar *name )
20.66 -{
20.67 - gdrom_recent_list = g_list_prepend( gdrom_recent_list, g_strdup(name) );
20.68 - if( g_list_length(gdrom_recent_list) > MAX_RECENT_ITEMS ) {
20.69 - GList *ptr = g_list_nth( gdrom_recent_list, MAX_RECENT_ITEMS );
20.70 - g_free( ptr->data );
20.71 - gdrom_recent_list = g_list_remove( gdrom_recent_list, ptr->data );
20.72 - }
20.73 -
20.74 - GList *ptr;
20.75 - int size = 0;
20.76 - for( ptr = gdrom_recent_list; ptr != NULL; ptr = g_list_next(ptr) ) {
20.77 - size += strlen( (gchar *)ptr->data ) + 1;
20.78 - }
20.79 - char buf[size];
20.80 - strcpy( buf, (gchar *)gdrom_recent_list->data );
20.81 - ptr = g_list_next(gdrom_recent_list);
20.82 - while( ptr != NULL ) {
20.83 - strcat( buf, ":" );
20.84 - strcat( buf, (gchar *)ptr->data );
20.85 - ptr = g_list_next(ptr);
20.86 - }
20.87 - lxdream_set_global_config_value( CONFIG_RECENT, buf );
20.88 - lxdream_save_config();
20.89 -
20.90 - return g_list_length( gdrom_device_list ) + 2; // menu posn of new item
20.91 -}
20.92 -
20.93 -void gdrom_menu_update_all()
20.94 -{
20.95 - gdrom_disc_t disc = gdrom_get_current_disc();
20.96 - gint posn = 0;
20.97 - GList *ptr;
20.98 -
20.99 - gdrom_menu_adjusting = TRUE;
20.100 -
20.101 - if( disc != NULL ) {
20.102 - posn = gdrom_menu_find_item( disc->name );
20.103 - if( posn == -1 ) {
20.104 - posn = gdrom_menu_add_recent_item( disc->name );
20.105 - gdrom_menu_rebuild_all();
20.106 - }
20.107 - }
20.108 -
20.109 - for( ptr = gdrom_menu_list; ptr != NULL; ptr = g_list_next(ptr) ) {
20.110 - GtkWidget *menu = GTK_WIDGET(ptr->data);
20.111 - GList *children = gtk_container_get_children( GTK_CONTAINER(menu) );
20.112 - GList *item = g_list_nth( children, posn );
20.113 - assert( item != NULL );
20.114 - gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM(item->data), TRUE );
20.115 - g_list_free(children);
20.116 - }
20.117 -
20.118 - gdrom_menu_adjusting = FALSE;
20.119 -}
20.120 -
20.121 -void gdrom_menu_empty_callback( GtkWidget *widget, gpointer user_data )
20.122 -{
20.123 - if( !gdrom_menu_adjusting ) {
20.124 - gdrom_unmount_disc();
20.125 - gdrom_menu_update_all();
20.126 - lxdream_set_global_config_value( CONFIG_GDROM, NULL );
20.127 - lxdream_save_config();
20.128 - }
20.129 -}
20.130 -
20.131 -gboolean gdrom_menu_open_file( const char *filename )
20.132 -{
20.133 - gboolean result = FALSE;
20.134 - if( filename != NULL ) {
20.135 - result = gdrom_mount_image(filename);
20.136 - }
20.137 - if( result ) {
20.138 - gdrom_menu_update_all();
20.139 - lxdream_set_global_config_value( CONFIG_GDROM, filename );
20.140 - lxdream_save_config();
20.141 - }
20.142 - return result;
20.143 -}
20.144 -
20.145 -void gdrom_menu_open_image_callback( GtkWidget *widget, gpointer user_data )
20.146 -{
20.147 - if( !gdrom_menu_adjusting ) {
20.148 - const gchar *dir = lxdream_get_config_value(CONFIG_DEFAULT_PATH);
20.149 - open_file_dialog( _("Open..."), gdrom_menu_open_file, NULL, NULL, dir );
20.150 - }
20.151 -}
20.152 -
20.153 -
20.154 -void gdrom_menu_open_specified_callback( GtkWidget *widget, gpointer user_data )
20.155 -{
20.156 - if( !gdrom_menu_adjusting ) {
20.157 - gdrom_menu_open_file( (gchar *)user_data );
20.158 - }
20.159 -}
20.160 -
20.161 -void gdrom_menu_build( GtkWidget *menu )
20.162 -{
20.163 - GSList *group = NULL;
20.164 - GtkWidget *empty = gtk_radio_menu_item_new_with_label( group, _("Empty") );
20.165 - group = gtk_radio_menu_item_get_group( GTK_RADIO_MENU_ITEM(empty) );
20.166 - g_signal_connect_after( empty, "activate", G_CALLBACK(gdrom_menu_empty_callback), NULL );
20.167 - gtk_menu_shell_append( GTK_MENU_SHELL(menu), empty );
20.168 -
20.169 - GList *ptr;
20.170 - for( ptr = gdrom_device_list; ptr != NULL; ptr = g_list_next(ptr) ) {
20.171 - gchar *name = (gchar *)ptr->data;
20.172 - GtkWidget *item = gtk_radio_menu_item_new_with_label( group, name);
20.173 - gtk_widget_set_name( item, name );
20.174 - group = gtk_radio_menu_item_get_group( GTK_RADIO_MENU_ITEM(item) );
20.175 - g_signal_connect_after( item, "activate", G_CALLBACK(gdrom_menu_open_specified_callback),
20.176 - name );
20.177 - gtk_menu_shell_append( GTK_MENU_SHELL(menu), item );
20.178 - }
20.179 -
20.180 - if( gdrom_recent_list != NULL ) {
20.181 - gtk_menu_shell_append( GTK_MENU_SHELL(menu), gtk_separator_menu_item_new() );
20.182 - for( ptr = gdrom_recent_list; ptr != NULL; ptr = g_list_next(ptr) ) {
20.183 - gchar *path = (gchar *)ptr->data;
20.184 - gchar *name = basename(path);
20.185 - GtkWidget *item = gtk_radio_menu_item_new_with_label( group, name );
20.186 - gtk_widget_set_name( item, path );
20.187 - group = gtk_radio_menu_item_get_group( GTK_RADIO_MENU_ITEM(item) );
20.188 - g_signal_connect_after( item, "activate", G_CALLBACK(gdrom_menu_open_specified_callback),
20.189 - path );
20.190 - gtk_menu_shell_append( GTK_MENU_SHELL(menu), item );
20.191 -
20.192 - }
20.193 - }
20.194 - gtk_menu_shell_append( GTK_MENU_SHELL(menu), gtk_separator_menu_item_new() );
20.195 - GtkWidget *open = gtk_image_menu_item_new_with_label( _("Open image file...") );
20.196 - g_signal_connect_after( open, "activate", G_CALLBACK(gdrom_menu_open_image_callback), NULL );
20.197 - gtk_menu_shell_append( GTK_MENU_SHELL(menu), open );
20.198 - gtk_widget_show_all(menu);
20.199 -}
20.200 -
20.201 -GtkWidget *gdrom_menu_new()
20.202 -{
20.203 - GtkWidget *menu = gtk_menu_new();
20.204 - gtk_menu_set_title( GTK_MENU(menu), _("GD-Rom Settings") );
20.205 -
20.206 - gdrom_menu_build(menu);
20.207 -
20.208 - gdrom_menu_list = g_list_append(gdrom_menu_list, menu);
20.209 - gtk_widget_show_all(menu);
20.210 - gdrom_menu_update_all();
20.211 - return menu;
20.212 -}
20.213 -
20.214 -void gdrom_menu_rebuild_all()
20.215 -{
20.216 - GList *ptr;
20.217 -
20.218 - for( ptr = gdrom_menu_list; ptr != NULL; ptr = g_list_next(ptr) ) {
20.219 - GtkWidget *menu = GTK_WIDGET(ptr->data);
20.220 - GList *children = gtk_container_get_children( GTK_CONTAINER(menu) );
20.221 - GList *listptr;
20.222 - for( listptr = children; listptr != NULL; listptr = g_list_next(listptr) ) {
20.223 - gtk_widget_destroy( GTK_WIDGET(listptr->data) );
20.224 - }
20.225 - g_list_free(children);
20.226 - gdrom_menu_build(menu);
20.227 - }
20.228 - gdrom_menu_update_all();
20.229 -}
20.230 -
20.231 -void gdrom_menu_init()
20.232 -{
20.233 - const gchar *recent = lxdream_get_config_value( CONFIG_RECENT );
20.234 - gdrom_device_list = gdrom_get_native_devices();
20.235 - if( recent != NULL ) {
20.236 - gchar **list = g_strsplit(recent, ":", 5);
20.237 - int i;
20.238 - for( i=0; list[i] != NULL; i++ ) {
20.239 - gdrom_recent_list = g_list_append( gdrom_recent_list, g_strdup(list[i]) );
20.240 - }
20.241 - g_strfreev(list);
20.242 - }
20.243 -}
21.1 --- a/src/gui/gtkcb.c Tue Nov 20 09:42:03 2007 +0000
21.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
21.3 @@ -1,260 +0,0 @@
21.4 -/**
21.5 - * $Id: gtkcb.c,v 1.9 2007-11-10 04:45:29 nkeynes Exp $
21.6 - *
21.7 - * Action callbacks from the main window
21.8 - *
21.9 - * Copyright (c) 2005 Nathan Keynes.
21.10 - *
21.11 - * This program is free software; you can redistribute it and/or modify
21.12 - * it under the terms of the GNU General Public License as published by
21.13 - * the Free Software Foundation; either version 2 of the License, or
21.14 - * (at your option) any later version.
21.15 - *
21.16 - * This program is distributed in the hope that it will be useful,
21.17 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
21.18 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21.19 - * GNU General Public License for more details.
21.20 - */
21.21 -
21.22 -#include "dream.h"
21.23 -#include "config.h"
21.24 -#include "dreamcast.h"
21.25 -#include "gdrom/gdrom.h"
21.26 -#include "gui/gtkui.h"
21.27 -#include "pvr2/pvr2.h"
21.28 -
21.29 -
21.30 -
21.31 -static void add_file_pattern( GtkFileChooser *chooser, char *pattern, char *patname )
21.32 -{
21.33 - if( pattern != NULL ) {
21.34 - GtkFileFilter *filter = gtk_file_filter_new();
21.35 - gtk_file_filter_add_pattern( filter, pattern );
21.36 - gtk_file_filter_set_name( filter, patname );
21.37 - gtk_file_chooser_add_filter( chooser, filter );
21.38 - filter = gtk_file_filter_new();
21.39 - gtk_file_filter_set_name( filter, _("All files") );
21.40 - gtk_file_filter_add_pattern( filter, "*" );
21.41 - gtk_file_chooser_add_filter( chooser, filter );
21.42 - }
21.43 -}
21.44 -
21.45 -void open_file_dialog( char *title, file_callback_t action, char *pattern, char *patname,
21.46 - gchar const *initial_dir )
21.47 -{
21.48 - GtkWidget *file;
21.49 - file = gtk_file_chooser_dialog_new( title, NULL,
21.50 - GTK_FILE_CHOOSER_ACTION_OPEN,
21.51 - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
21.52 - GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
21.53 - NULL );
21.54 - add_file_pattern( GTK_FILE_CHOOSER(file), pattern, patname );
21.55 - gtk_file_chooser_set_current_folder( GTK_FILE_CHOOSER(file), initial_dir );
21.56 - gtk_window_set_modal( GTK_WINDOW(file), TRUE );
21.57 - gtk_dialog_set_default_response( GTK_DIALOG(file), GTK_RESPONSE_ACCEPT );
21.58 - int result = gtk_dialog_run( GTK_DIALOG(file) );
21.59 - if( result == GTK_RESPONSE_ACCEPT ) {
21.60 - gchar *filename = gtk_file_chooser_get_filename( GTK_FILE_CHOOSER(file) );
21.61 - action( filename );
21.62 - }
21.63 - gtk_widget_destroy(file);
21.64 -}
21.65 -
21.66 -void save_file_dialog( char *title, file_callback_t action, char *pattern, char *patname,
21.67 - gchar const *initial_dir )
21.68 -{
21.69 - GtkWidget *file;
21.70 - file = gtk_file_chooser_dialog_new( title, NULL,
21.71 - GTK_FILE_CHOOSER_ACTION_SAVE,
21.72 - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
21.73 - GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
21.74 - NULL );
21.75 - add_file_pattern( GTK_FILE_CHOOSER(file), pattern, patname );
21.76 - gtk_file_chooser_set_current_folder( GTK_FILE_CHOOSER(file), initial_dir );
21.77 - gtk_window_set_modal( GTK_WINDOW(file), TRUE );
21.78 - gtk_dialog_set_default_response( GTK_DIALOG(file), GTK_RESPONSE_ACCEPT );
21.79 - int result = gtk_dialog_run( GTK_DIALOG(file) );
21.80 - if( result == GTK_RESPONSE_ACCEPT ) {
21.81 - gchar *filename = gtk_file_chooser_get_filename( GTK_FILE_CHOOSER(file) );
21.82 - action( filename );
21.83 - }
21.84 - gtk_widget_destroy(file);
21.85 -}
21.86 -
21.87 -void mount_action_callback( GtkAction *action, gpointer user_data)
21.88 -{
21.89 - const gchar *dir = lxdream_get_config_value(CONFIG_DEFAULT_PATH);
21.90 - open_file_dialog( "Open...", gdrom_mount_image, NULL, NULL, dir );
21.91 -}
21.92 -void reset_action_callback( GtkAction *action, gpointer user_data)
21.93 -{
21.94 - dreamcast_reset();
21.95 -}
21.96 -
21.97 -void pause_action_callback( GtkAction *action, gpointer user_data)
21.98 -{
21.99 - dreamcast_stop();
21.100 -}
21.101 -
21.102 -void resume_action_callback( GtkAction *action, gpointer user_data)
21.103 -{
21.104 - dreamcast_run();
21.105 -}
21.106 -
21.107 -void load_state_preview_callback( GtkFileChooser *chooser, gpointer user_data )
21.108 -{
21.109 - GtkWidget *preview = GTK_WIDGET(user_data);
21.110 - gchar *filename = gtk_file_chooser_get_preview_filename(chooser);
21.111 -
21.112 - frame_buffer_t data = dreamcast_load_preview(filename);
21.113 - if( data != NULL ) {
21.114 - GdkPixbuf *pixbuf = gdk_pixbuf_new_from_frame_buffer(data);
21.115 - GdkPixbuf *scaled = gdk_pixbuf_scale_simple(pixbuf, 320, 240,
21.116 - GDK_INTERP_BILINEAR);
21.117 - g_object_unref(pixbuf);
21.118 - gtk_image_set_from_pixbuf( GTK_IMAGE(preview), scaled );
21.119 - g_object_unref(scaled);
21.120 - gtk_widget_show(preview);
21.121 - } else {
21.122 - gtk_widget_hide(preview);
21.123 - }
21.124 -}
21.125 -
21.126 -void load_state_action_callback( GtkAction *action, gpointer user_data)
21.127 -{
21.128 - GtkWidget *file, *preview, *frame, *align;
21.129 - GtkRequisition size;
21.130 - const gchar *dir = lxdream_get_config_value(CONFIG_SAVE_PATH);
21.131 - file = gtk_file_chooser_dialog_new( _("Load state..."), NULL,
21.132 - GTK_FILE_CHOOSER_ACTION_OPEN,
21.133 - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
21.134 - GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
21.135 - NULL );
21.136 - add_file_pattern( GTK_FILE_CHOOSER(file), "*.dst", _("lxDream Save State (*.dst)") );
21.137 - gtk_object_set_data( GTK_OBJECT(file), "file_action", action );
21.138 -
21.139 - preview = gtk_image_new( );
21.140 -
21.141 - frame = gtk_frame_new(NULL);
21.142 - gtk_frame_set_shadow_type( GTK_FRAME(frame), GTK_SHADOW_IN );
21.143 - gtk_container_add( GTK_CONTAINER(frame), preview );
21.144 - gtk_widget_show(frame);
21.145 - gtk_widget_size_request(frame, &size);
21.146 - gtk_widget_set_size_request(frame, size.width + 320, size.height + 240);
21.147 - align = gtk_alignment_new(0.5, 0.5, 0, 0 );
21.148 - gtk_container_add( GTK_CONTAINER(align), frame );
21.149 - gtk_widget_show( align );
21.150 - gtk_file_chooser_set_preview_widget(GTK_FILE_CHOOSER(file), align);
21.151 - g_signal_connect( file, "update-preview", G_CALLBACK(load_state_preview_callback),
21.152 - preview );
21.153 - gtk_file_chooser_set_current_folder( GTK_FILE_CHOOSER(file), dir );
21.154 - gtk_window_set_modal( GTK_WINDOW(file), TRUE );
21.155 - int result = gtk_dialog_run( GTK_DIALOG(file) );
21.156 - if( result == GTK_RESPONSE_ACCEPT ) {
21.157 - gchar *filename = gtk_file_chooser_get_filename( GTK_FILE_CHOOSER(file) );
21.158 - dreamcast_load_state( filename );
21.159 - }
21.160 - gtk_widget_destroy(file);
21.161 -}
21.162 -
21.163 -void save_state_action_callback( GtkAction *action, gpointer user_data)
21.164 -{
21.165 - const gchar *dir = lxdream_get_config_value(CONFIG_SAVE_PATH);
21.166 - save_file_dialog( "Save state...", dreamcast_save_state, "*.dst", _("lxDream Save State (*.dst)"), dir );
21.167 -}
21.168 -void about_action_callback( GtkAction *action, gpointer user_data)
21.169 -{
21.170 -
21.171 - GtkWidget *dialog = g_object_new (GTK_TYPE_ABOUT_DIALOG,
21.172 - "name", APP_NAME,
21.173 - "version", APP_VERSION,
21.174 - "copyright", "(C) 2003-2007 Nathan Keynes",
21.175 - NULL);
21.176 - gtk_window_set_modal(GTK_WINDOW(dialog), TRUE);
21.177 - gtk_dialog_run(GTK_DIALOG(dialog));
21.178 - gtk_widget_destroy(dialog);
21.179 -
21.180 -}
21.181 -
21.182 -void exit_action_callback( GtkAction *action, gpointer user_data)
21.183 -{
21.184 - exit(0);
21.185 -}
21.186 -
21.187 -void path_settings_callback( GtkAction *action, gpointer user_data)
21.188 -{
21.189 - path_dialog_run();
21.190 -}
21.191 -
21.192 -void audio_settings_callback( GtkAction *action, gpointer user_data)
21.193 -{
21.194 -}
21.195 -
21.196 -void maple_settings_callback( GtkAction *action, gpointer user_data)
21.197 -{
21.198 - maple_dialog_run( );
21.199 -}
21.200 -
21.201 -void network_settings_callback( GtkAction *action, gpointer user_data)
21.202 -{
21.203 -}
21.204 -
21.205 -void video_settings_callback( GtkAction *action, gpointer user_data)
21.206 -{
21.207 -}
21.208 -
21.209 -void fullscreen_toggle_callback( GtkToggleAction *action, gpointer user_data)
21.210 -{
21.211 - main_window_set_fullscreen(gtk_gui_get_main(), gtk_toggle_action_get_active(action));
21.212 -}
21.213 -
21.214 -void debugger_action_callback( GtkAction *action, gpointer user_data)
21.215 -{
21.216 - gtk_gui_show_debugger();
21.217 -}
21.218 -
21.219 -void debug_memory_action_callback( GtkAction *action, gpointer user_data)
21.220 -{
21.221 - gchar *title = g_strdup_printf( APP_NAME " " APP_VERSION " :: %s", _("Memory dump") );
21.222 - dump_window_new( title );
21.223 - g_free(title);
21.224 -}
21.225 -
21.226 -void debug_mmio_action_callback( GtkAction *action, gpointer user_data)
21.227 -{
21.228 - gtk_gui_show_mmio();
21.229 -}
21.230 -
21.231 -void save_scene_action_callback( GtkAction *action, gpointer user_data)
21.232 -{
21.233 - const gchar *dir = lxdream_get_config_value(CONFIG_SAVE_PATH);
21.234 - save_file_dialog( _("Save next scene..."), pvr2_save_next_scene, "*.dsc", _("lxdream scene file (*.dsc)"), dir );
21.235 -}
21.236 -
21.237 -int debug_window_get_selected_row( debug_window_t data );
21.238 -
21.239 -void debug_step_action_callback( GtkAction *action, gpointer user_data)
21.240 -{
21.241 - debug_window_single_step(gtk_gui_get_debugger());
21.242 -}
21.243 -
21.244 -void debug_runto_action_callback( GtkAction *action, gpointer user_data)
21.245 -{
21.246 - debug_window_t debug = gtk_gui_get_debugger();
21.247 - int selected_row = debug_window_get_selected_row(debug);
21.248 - if( selected_row == -1 ) {
21.249 - WARN( _("No address selected, so can't run to it"), NULL );
21.250 - } else {
21.251 - debug_window_set_oneshot_breakpoint( debug, selected_row );
21.252 - dreamcast_run();
21.253 - }
21.254 -}
21.255 -
21.256 -void debug_breakpoint_action_callback( GtkAction *action, gpointer user_data)
21.257 -{
21.258 - debug_window_t debug = gtk_gui_get_debugger();
21.259 - int selected_row = debug_window_get_selected_row(debug);
21.260 - if( selected_row != -1 ) {
21.261 - debug_window_toggle_breakpoint( debug, selected_row );
21.262 - }
21.263 -}
22.1 --- a/src/gui/gtkui.c Tue Nov 20 09:42:03 2007 +0000
22.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
22.3 @@ -1,463 +0,0 @@
22.4 -/**
22.5 - * $Id: gtkui.c,v 1.12 2007-11-10 04:45:29 nkeynes Exp $
22.6 - *
22.7 - * Core GTK-based user interface
22.8 - *
22.9 - * Copyright (c) 2005 Nathan Keynes.
22.10 - *
22.11 - * This program is free software; you can redistribute it and/or modify
22.12 - * it under the terms of the GNU General Public License as published by
22.13 - * the Free Software Foundation; either version 2 of the License, or
22.14 - * (at your option) any later version.
22.15 - *
22.16 - * This program is distributed in the hope that it will be useful,
22.17 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
22.18 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22.19 - * GNU General Public License for more details.
22.20 - */
22.21 -
22.22 -#include "lxdream.h"
22.23 -#include <sys/time.h>
22.24 -#include <time.h>
22.25 -#include <glib/gi18n.h>
22.26 -#include "dreamcast.h"
22.27 -#include "display.h"
22.28 -#include "gdrom/gdrom.h"
22.29 -#include "gui/gtkui.h"
22.30 -
22.31 -
22.32 -void gtk_gui_start( void );
22.33 -void gtk_gui_stop( void );
22.34 -void gtk_gui_alloc_resources ( void );
22.35 -uint32_t gtk_gui_run_slice( uint32_t nanosecs );
22.36 -
22.37 -struct dreamcast_module gtk_gui_module = { "gui", NULL,
22.38 - gtk_gui_update,
22.39 - gtk_gui_start,
22.40 - gtk_gui_run_slice,
22.41 - gtk_gui_stop,
22.42 - NULL, NULL };
22.43 -
22.44 -/**
22.45 - * Single-instance windows (at most one)
22.46 - */
22.47 -static main_window_t main_win = NULL;
22.48 -static debug_window_t debug_win = NULL;
22.49 -static mmio_window_t mmio_win = NULL;
22.50 -
22.51 -/**
22.52 - * UIManager and action helpers
22.53 - */
22.54 -static GtkUIManager *global_ui_manager;
22.55 -static GtkActionGroup *global_action_group;
22.56 -
22.57 -/**
22.58 - * Count of running nanoseconds - used to cut back on the GUI runtime
22.59 - */
22.60 -static uint32_t gtk_gui_nanos = 0;
22.61 -static struct timeval gtk_gui_lasttv;
22.62 -
22.63 -static gboolean gtk_gui_init_ok = FALSE;
22.64 -
22.65 -#define ENABLE_ACTION(win,name) SET_ACTION_ENABLED(win,name,TRUE)
22.66 -#define DISABLE_ACTION(win,name) SET_ACTION_ENABLED(win,name,FALSE)
22.67 -
22.68 -// UI Actions
22.69 -static const GtkActionEntry ui_actions[] = {
22.70 - { "FileMenu", NULL, N_("_File") },
22.71 - { "SettingsMenu", NULL, N_("_Settings") },
22.72 - { "HelpMenu", NULL, N_("_Help") },
22.73 - { "Reset", GTK_STOCK_REFRESH, N_("_Reset"), "<control>R", N_("Reset dreamcast"), G_CALLBACK(reset_action_callback) },
22.74 - { "Pause", GTK_STOCK_MEDIA_PAUSE, N_("_Pause"), NULL, N_("Pause dreamcast"), G_CALLBACK(pause_action_callback) },
22.75 - { "Run", GTK_STOCK_MEDIA_PLAY, N_("Resume"), NULL, N_("Resume"), G_CALLBACK(resume_action_callback) },
22.76 - { "LoadState", GTK_STOCK_REVERT_TO_SAVED, N_("_Load state..."), "F4", N_("Load an lxdream save state"), G_CALLBACK(load_state_action_callback) },
22.77 - { "SaveState", GTK_STOCK_SAVE_AS, N_("_Save state..."), "F3", N_("Create an lxdream save state"), G_CALLBACK(save_state_action_callback) },
22.78 - { "Exit", GTK_STOCK_QUIT, N_("E_xit"), NULL, N_("Exit lxdream"), G_CALLBACK(exit_action_callback) },
22.79 - { "GdromSettings", NULL, N_("_GD-Rom...") },
22.80 - { "GdromUnmount", NULL, N_("_Empty") },
22.81 - { "GdromMount", GTK_STOCK_CDROM, N_("_Open Image..."), "<control>O", N_("Mount a cdrom disc"), G_CALLBACK(mount_action_callback) },
22.82 - { "PathSettings", NULL, N_("_Paths..."), NULL, N_("Configure files and paths"), G_CALLBACK(path_settings_callback) },
22.83 - { "AudioSettings", NULL, N_("_Audio..."), NULL, N_("Configure audio output"), G_CALLBACK(audio_settings_callback) },
22.84 - { "ControllerSettings", NULL, N_("_Controllers..."), NULL, N_("Configure controllers"), G_CALLBACK(maple_settings_callback) },
22.85 - { "NetworkSettings", NULL, N_("_Network..."), NULL, N_("Configure network settings"), G_CALLBACK(network_settings_callback) },
22.86 - { "VideoSettings", NULL, N_("_Video..."), NULL,N_( "Configure video output"), G_CALLBACK(video_settings_callback) },
22.87 - { "About", GTK_STOCK_ABOUT, N_("_About..."), NULL, N_("About lxdream"), G_CALLBACK(about_action_callback) },
22.88 - { "DebugMenu", NULL, N_("_Debug") },
22.89 - { "Debugger", NULL, N_("_Debugger"), NULL, N_("Open debugger window"), G_CALLBACK(debugger_action_callback) },
22.90 - { "DebugMem", NULL, N_("View _Memory"), NULL, N_("View memory dump"), G_CALLBACK(debug_memory_action_callback) },
22.91 - { "DebugMmio", NULL, N_("View IO _Registers"), NULL, N_("View MMIO Registers"), G_CALLBACK(debug_mmio_action_callback) },
22.92 - { "SaveScene", NULL, N_("_Save Scene"), NULL, N_("Save next rendered scene"), G_CALLBACK(save_scene_action_callback) },
22.93 - { "SingleStep", GTK_STOCK_REDO, N_("_Single Step"), NULL, N_("Single step"), G_CALLBACK(debug_step_action_callback) },
22.94 - { "RunTo", GTK_STOCK_GOTO_LAST, N_("Run _To"), NULL, N_("Run to"), G_CALLBACK( debug_runto_action_callback) },
22.95 - { "SetBreakpoint", GTK_STOCK_CLOSE, N_("_Breakpoint"), NULL, N_("Toggle breakpoint"), G_CALLBACK( debug_breakpoint_action_callback) }
22.96 -};
22.97 -static const GtkToggleActionEntry ui_toggle_actions[] = {
22.98 - { "FullScreen", NULL, "_Full Screen", "<alt>Return", "Toggle full screen video", G_CALLBACK(fullscreen_toggle_callback), 0 },
22.99 -};
22.100 -
22.101 -// Menus and toolbars
22.102 -static const char *ui_description =
22.103 - "<ui>"
22.104 - " <menubar name='MainMenu'>"
22.105 - " <menu action='FileMenu'>"
22.106 - " <menuitem action='GdromSettings'/>"
22.107 - " <separator/>"
22.108 - " <menuitem action='Reset'/>"
22.109 - " <menuitem action='Pause'/>"
22.110 - " <menuitem action='Run'/>"
22.111 - " <menuitem action='Debugger'/>"
22.112 - " <separator/>"
22.113 - " <menuitem action='LoadState'/>"
22.114 - " <menuitem action='SaveState'/>"
22.115 - " <separator/>"
22.116 - " <menuitem action='Exit'/>"
22.117 - " </menu>"
22.118 - " <menu action='SettingsMenu'>"
22.119 - " <menuitem action='PathSettings'/>"
22.120 - " <menuitem action='AudioSettings'/>"
22.121 - " <menuitem action='ControllerSettings'/>"
22.122 - " <menuitem action='NetworkSettings'/>"
22.123 - " <menuitem action='VideoSettings'/>"
22.124 - " <separator/>"
22.125 - " <menuitem action='FullScreen'/>"
22.126 - " </menu>"
22.127 - " <menu action='HelpMenu'>"
22.128 - " <menuitem action='About'/>"
22.129 - " </menu>"
22.130 - " </menubar>"
22.131 - " <toolbar name='MainToolbar'>"
22.132 - " <toolitem action='GdromMount'/>"
22.133 - " <toolitem action='Reset'/>"
22.134 - " <toolitem action='Pause'/>"
22.135 - " <toolitem action='Run'/>"
22.136 - " <separator/>"
22.137 - " <toolitem action='LoadState'/>"
22.138 - " <toolitem action='SaveState'/>"
22.139 - " </toolbar>"
22.140 - " <menubar name='DebugMenu'>"
22.141 - " <menu action='FileMenu'>"
22.142 - " <menuitem action='GdromSettings'/>"
22.143 - " <separator/>"
22.144 - " <menuitem action='Reset'/>"
22.145 - " <separator/>"
22.146 - " <menuitem action='LoadState'/>"
22.147 - " <menuitem action='SaveState'/>"
22.148 - " <separator/>"
22.149 - " <menuitem action='Exit'/>"
22.150 - " </menu>"
22.151 - " <menu action='DebugMenu'>"
22.152 - " <menuitem action='DebugMem'/>"
22.153 - " <menuitem action='DebugMmio'/>"
22.154 - " <menuitem action='SaveScene'/>"
22.155 - " <separator/>"
22.156 - " <menuitem action='SetBreakpoint'/>"
22.157 - " <menuitem action='Pause'/>"
22.158 - " <menuitem action='SingleStep'/>"
22.159 - " <menuitem action='RunTo'/>"
22.160 - " <menuitem action='Run'/>"
22.161 - " </menu>"
22.162 - " <menu action='SettingsMenu'>"
22.163 - " <menuitem action='PathSettings'/>"
22.164 - " <menuitem action='AudioSettings'/>"
22.165 - " <menuitem action='ControllerSettings'/>"
22.166 - " <menuitem action='NetworkSettings'/>"
22.167 - " <menuitem action='VideoSettings'/>"
22.168 - " <separator/>"
22.169 - " <menuitem action='FullScreen'/>"
22.170 - " </menu>"
22.171 - " <menu action='HelpMenu'>"
22.172 - " <menuitem action='About'/>"
22.173 - " </menu>"
22.174 - " </menubar>"
22.175 - " <toolbar name='DebugToolbar'>"
22.176 - " <toolitem action='GdromMount'/>"
22.177 - " <toolitem action='Reset'/>"
22.178 - " <toolitem action='Pause'/>"
22.179 - " <separator/>"
22.180 - " <toolitem action='SingleStep'/>"
22.181 - " <toolitem action='RunTo'/>"
22.182 - " <toolitem action='Run'/>"
22.183 - " <toolitem action='SetBreakpoint'/>"
22.184 - " <separator/>"
22.185 - " <toolitem action='LoadState'/>"
22.186 - " <toolitem action='SaveState'/>"
22.187 - " </toolbar>"
22.188 - "</ui>";
22.189 -
22.190 -gboolean gui_parse_cmdline( int *argc, char **argv[] )
22.191 -{
22.192 - gtk_gui_init_ok = gtk_init_check( argc, argv );
22.193 - return gtk_gui_init_ok;
22.194 -}
22.195 -
22.196 -gboolean gui_init( gboolean withDebug )
22.197 -{
22.198 - if( gtk_gui_init_ok ) {
22.199 - GError *error = NULL;
22.200 - dreamcast_register_module( &gtk_gui_module );
22.201 - gtk_gui_alloc_resources();
22.202 -
22.203 - global_action_group = gtk_action_group_new("MenuActions");
22.204 - gtk_action_group_set_translation_domain( global_action_group, NULL );
22.205 - gtk_action_group_add_actions( global_action_group, ui_actions, G_N_ELEMENTS(ui_actions), NULL );
22.206 - gtk_action_group_add_toggle_actions( global_action_group, ui_toggle_actions, G_N_ELEMENTS(ui_toggle_actions), NULL );
22.207 - gtk_gui_enable_action("AudioSettings", FALSE);
22.208 - gtk_gui_enable_action("NetworkSettings", FALSE);
22.209 - gtk_gui_enable_action("VideoSettings", FALSE);
22.210 -
22.211 - global_ui_manager = gtk_ui_manager_new();
22.212 - gtk_ui_manager_set_add_tearoffs(global_ui_manager, TRUE);
22.213 - gtk_ui_manager_insert_action_group( global_ui_manager, global_action_group, 0 );
22.214 -
22.215 - if (!gtk_ui_manager_add_ui_from_string (global_ui_manager, ui_description, -1, &error)) {
22.216 - g_message ("building menus failed: %s", error->message);
22.217 - g_error_free (error);
22.218 - exit(1);
22.219 - }
22.220 - GtkAccelGroup *accel_group = gtk_ui_manager_get_accel_group (global_ui_manager);
22.221 - GtkWidget *menubar = gtk_ui_manager_get_widget(global_ui_manager, "/MainMenu");
22.222 - GtkWidget *toolbar = gtk_ui_manager_get_widget(global_ui_manager, "/MainToolbar");
22.223 -
22.224 - GtkWidget *gdrommenuitem = gtk_ui_manager_get_widget(global_ui_manager, "/MainMenu/FileMenu/GdromSettings");
22.225 - gdrom_menu_init();
22.226 - GtkWidget *gdrommenu = gdrom_menu_new();
22.227 - gtk_menu_item_set_submenu( GTK_MENU_ITEM(gdrommenuitem), gdrommenu );
22.228 - main_win = main_window_new( APP_NAME " " APP_VERSION, menubar, toolbar, accel_group );
22.229 - if( withDebug ) {
22.230 - gtk_gui_show_debugger();
22.231 - }
22.232 -
22.233 - return TRUE;
22.234 - } else {
22.235 - return FALSE;
22.236 - }
22.237 -}
22.238 -
22.239 -void gui_main_loop(void)
22.240 -{
22.241 - gtk_main();
22.242 -}
22.243 -
22.244 -gboolean gui_error_dialog( const char *msg, ... )
22.245 -{
22.246 - if( main_win != NULL ) {
22.247 - va_list args;
22.248 - GtkWidget *dialog =
22.249 - gtk_message_dialog_new( main_window_get_frame(main_win), GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT,
22.250 - GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, NULL );
22.251 - va_start(args, msg);
22.252 - gchar *markup = g_markup_vprintf_escaped( msg, args );
22.253 - va_end( args );
22.254 - gtk_message_dialog_set_markup( GTK_MESSAGE_DIALOG(dialog), markup );
22.255 - g_free(markup);
22.256 - gtk_dialog_run(GTK_DIALOG(dialog));
22.257 - gtk_widget_destroy(dialog);
22.258 - return TRUE;
22.259 - }
22.260 - return FALSE;
22.261 -}
22.262 -
22.263 -void gui_update_io_activity( io_activity_type io, gboolean active )
22.264 -{
22.265 -
22.266 -}
22.267 -
22.268 -void gtk_gui_show_debugger()
22.269 -{
22.270 - if( debug_win ) {
22.271 - debug_window_show(debug_win, TRUE);
22.272 - } else {
22.273 - GtkAccelGroup *accel_group = gtk_ui_manager_get_accel_group (global_ui_manager);
22.274 - GtkWidget *menubar = gtk_ui_manager_get_widget(global_ui_manager, "/DebugMenu");
22.275 - GtkWidget *toolbar = gtk_ui_manager_get_widget(global_ui_manager, "/DebugToolbar");
22.276 - GtkWidget *gdrommenuitem = gtk_ui_manager_get_widget(global_ui_manager, "/DebugMenu/FileMenu/GdromSettings");
22.277 - GtkWidget *gdrommenu = gdrom_menu_new();
22.278 - gtk_menu_item_set_submenu( GTK_MENU_ITEM(gdrommenuitem), gdrommenu );
22.279 - gchar *title = g_strdup_printf( APP_NAME " " APP_VERSION " :: %s", _("Debugger"));
22.280 - debug_win = debug_window_new( title, menubar, toolbar, accel_group );
22.281 - g_free(title);
22.282 - }
22.283 -}
22.284 -
22.285 -void gtk_gui_show_mmio()
22.286 -{
22.287 - if( mmio_win ) {
22.288 - mmio_window_show(mmio_win, TRUE);
22.289 - } else {
22.290 - gchar *title = g_strdup_printf( APP_NAME " " APP_VERSION " :: %s", _("MMIO Registers"));
22.291 - mmio_win = mmio_window_new( title );
22.292 - g_free(title);
22.293 - }
22.294 -}
22.295 -
22.296 -
22.297 -main_window_t gtk_gui_get_main()
22.298 -{
22.299 - return main_win;
22.300 -}
22.301 -
22.302 -debug_window_t gtk_gui_get_debugger()
22.303 -{
22.304 - return debug_win;
22.305 -}
22.306 -
22.307 -mmio_window_t gtk_gui_get_mmio()
22.308 -{
22.309 - return mmio_win;
22.310 -}
22.311 -
22.312 -GtkWidget *gtk_gui_get_renderarea()
22.313 -{
22.314 - if( main_win == NULL ) {
22.315 - return NULL;
22.316 - } else {
22.317 - return main_window_get_renderarea(main_win);
22.318 - }
22.319 -}
22.320 -
22.321 -/**
22.322 - * Hook called when DC starts running. Just disables the run/step buttons
22.323 - * and enables the stop button.
22.324 - */
22.325 -void gtk_gui_start( void )
22.326 -{
22.327 - main_window_set_running( main_win, TRUE );
22.328 - if( debug_win != NULL ) {
22.329 - debug_window_set_running( debug_win, TRUE );
22.330 - }
22.331 - gtk_gui_nanos = 0;
22.332 - gettimeofday(&gtk_gui_lasttv,NULL);
22.333 -}
22.334 -
22.335 -/**
22.336 - * Hook called when DC stops running. Enables the run/step buttons
22.337 - * and disables the stop button.
22.338 - */
22.339 -void gtk_gui_stop( void )
22.340 -{
22.341 - main_window_set_running( main_win, FALSE );
22.342 - gtk_gui_update();
22.343 -}
22.344 -
22.345 -void gtk_gui_update( void )
22.346 -{
22.347 - if( debug_win ) {
22.348 - debug_window_set_running( debug_win, FALSE );
22.349 - debug_window_update(debug_win);
22.350 - }
22.351 - if( mmio_win ) {
22.352 - mmio_window_update(mmio_win);
22.353 - }
22.354 - dump_window_update_all();
22.355 -}
22.356 -
22.357 -/**
22.358 - * Module run-slice. Because UI processing is fairly expensive, only
22.359 - * run the processing about 10 times a second while we're emulating.
22.360 - */
22.361 -uint32_t gtk_gui_run_slice( uint32_t nanosecs )
22.362 -{
22.363 - gtk_gui_nanos += nanosecs;
22.364 - if( gtk_gui_nanos > 100000000 ) {
22.365 - struct timeval tv;
22.366 - while( gtk_events_pending() )
22.367 - gtk_main_iteration();
22.368 -
22.369 - gettimeofday(&tv,NULL);
22.370 - double ns = ((tv.tv_sec - gtk_gui_lasttv.tv_sec) * 1000000000.0) +
22.371 - ((tv.tv_usec - gtk_gui_lasttv.tv_usec)*1000.0);
22.372 - double speed = (float)( (double)gtk_gui_nanos * 100.0 / ns );
22.373 - gtk_gui_lasttv.tv_sec = tv.tv_sec;
22.374 - gtk_gui_lasttv.tv_usec = tv.tv_usec;
22.375 - main_window_set_speed( main_win, speed );
22.376 - gtk_gui_nanos = 0;
22.377 - }
22.378 - return nanosecs;
22.379 -}
22.380 -
22.381 -
22.382 -PangoFontDescription *gui_fixed_font;
22.383 -GdkColor gui_colour_normal, gui_colour_changed, gui_colour_error;
22.384 -GdkColor gui_colour_warn, gui_colour_pc, gui_colour_debug;
22.385 -GdkColor gui_colour_trace, gui_colour_break, gui_colour_temp_break;
22.386 -GdkColor gui_colour_white;
22.387 -
22.388 -void gtk_gui_alloc_resources() {
22.389 - GdkColormap *map;
22.390 -
22.391 - gui_colour_normal.red = gui_colour_normal.green = gui_colour_normal.blue = 0;
22.392 - gui_colour_changed.red = gui_colour_changed.green = 64*256;
22.393 - gui_colour_changed.blue = 154*256;
22.394 - gui_colour_error.red = 65535;
22.395 - gui_colour_error.green = gui_colour_error.blue = 64*256;
22.396 - gui_colour_pc.red = 32*256;
22.397 - gui_colour_pc.green = 170*256;
22.398 - gui_colour_pc.blue = 52*256;
22.399 - gui_colour_warn = gui_colour_changed;
22.400 - gui_colour_trace.red = 156*256;
22.401 - gui_colour_trace.green = 78*256;
22.402 - gui_colour_trace.blue = 201*256;
22.403 - gui_colour_debug = gui_colour_pc;
22.404 - gui_colour_break.red = 65535;
22.405 - gui_colour_break.green = gui_colour_break.blue = 192*256;
22.406 - gui_colour_temp_break.red = gui_colour_temp_break.green = 128*256;
22.407 - gui_colour_temp_break.blue = 32*256;
22.408 - gui_colour_white.red = gui_colour_white.green = gui_colour_white.blue = 65535;
22.409 -
22.410 - map = gdk_colormap_new(gdk_visual_get_best(), TRUE);
22.411 - gdk_colormap_alloc_color(map, &gui_colour_normal, TRUE, TRUE);
22.412 - gdk_colormap_alloc_color(map, &gui_colour_changed, TRUE, TRUE);
22.413 - gdk_colormap_alloc_color(map, &gui_colour_error, TRUE, TRUE);
22.414 - gdk_colormap_alloc_color(map, &gui_colour_warn, TRUE, TRUE);
22.415 - gdk_colormap_alloc_color(map, &gui_colour_pc, TRUE, TRUE);
22.416 - gdk_colormap_alloc_color(map, &gui_colour_debug, TRUE, TRUE);
22.417 - gdk_colormap_alloc_color(map, &gui_colour_trace, TRUE, TRUE);
22.418 - gdk_colormap_alloc_color(map, &gui_colour_break, TRUE, TRUE);
22.419 - gdk_colormap_alloc_color(map, &gui_colour_temp_break, TRUE, TRUE);
22.420 - gdk_colormap_alloc_color(map, &gui_colour_white, TRUE, TRUE);
22.421 - gui_fixed_font = pango_font_description_from_string("Courier 10");
22.422 -}
22.423 -
22.424 -gint gtk_gui_run_property_dialog( const gchar *title, GtkWidget *panel, gtk_dialog_done_fn fn )
22.425 -{
22.426 - GtkWidget *dialog =
22.427 - gtk_dialog_new_with_buttons(title, main_window_get_frame(main_win),
22.428 - GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT,
22.429 - GTK_STOCK_OK, GTK_RESPONSE_ACCEPT,
22.430 - GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT,
22.431 - NULL);
22.432 - gint result;
22.433 - gtk_widget_show_all(panel);
22.434 - gtk_container_add( GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), panel );
22.435 - result = gtk_dialog_run( GTK_DIALOG(dialog) );
22.436 - if( fn != NULL ) {
22.437 - fn(panel, result == GTK_RESPONSE_ACCEPT);
22.438 - }
22.439 - gtk_widget_destroy( dialog );
22.440 - return result;
22.441 -}
22.442 -
22.443 -void gtk_gui_enable_action( const gchar *action, gboolean enable )
22.444 -{
22.445 - gtk_action_set_sensitive( gtk_action_group_get_action( global_action_group, action), enable);
22.446 -}
22.447 -
22.448 -static void delete_frame_buffer( guchar *pixels, gpointer buffer )
22.449 -{
22.450 - if( buffer != NULL ) {
22.451 - g_free(buffer);
22.452 - }
22.453 -}
22.454 -
22.455 -GdkPixbuf *gdk_pixbuf_new_from_frame_buffer( frame_buffer_t buffer )
22.456 -{
22.457 - return gdk_pixbuf_new_from_data( (unsigned char *)buffer->data,
22.458 - GDK_COLORSPACE_RGB,
22.459 - (buffer->colour_format == COLFMT_BGRA8888),
22.460 - 8,
22.461 - buffer->width,
22.462 - buffer->height,
22.463 - buffer->rowstride,
22.464 - delete_frame_buffer,
22.465 - buffer );
22.466 -}
23.1 --- a/src/gui/gtkui.h Tue Nov 20 09:42:03 2007 +0000
23.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
23.3 @@ -1,133 +0,0 @@
23.4 -/**
23.5 - * $Id: gtkui.h,v 1.12 2007-11-10 04:45:29 nkeynes Exp $
23.6 - *
23.7 - * Core GTK-based user interface
23.8 - *
23.9 - * Copyright (c) 2005 Nathan Keynes.
23.10 - *
23.11 - * This program is free software; you can redistribute it and/or modify
23.12 - * it under the terms of the GNU General Public License as published by
23.13 - * the Free Software Foundation; either version 2 of the License, or
23.14 - * (at your option) any later version.
23.15 - *
23.16 - * This program is distributed in the hope that it will be useful,
23.17 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
23.18 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23.19 - * GNU General Public License for more details.
23.20 - */
23.21 -
23.22 -#ifndef __lxdream_gtkui_H
23.23 -#define __lxdream_gtkui_H
23.24 -
23.25 -#include "lxdream.h"
23.26 -#include <gtk/gtk.h>
23.27 -#include <glib/gi18n.h>
23.28 -#include "gui.h"
23.29 -#include "cpu.h"
23.30 -
23.31 -/********************* Top-level windows *********************/
23.32 -
23.33 -typedef struct main_window_info *main_window_t;
23.34 -typedef struct debug_window_info *debug_window_t;
23.35 -typedef struct mmio_window_info *mmio_window_t;
23.36 -typedef struct dump_window_info *dump_window_t;
23.37 -
23.38 -/**
23.39 - * Construct and show the main window, returning an
23.40 - * opaque pointer to the window.
23.41 - */
23.42 -main_window_t main_window_new( const gchar *title, GtkWidget *menubar,
23.43 - GtkWidget *toolbar, GtkAccelGroup *accel );
23.44 -GtkWindow *main_window_get_frame( main_window_t win );
23.45 -GtkWidget *main_window_get_renderarea( main_window_t win );
23.46 -void main_window_set_running( main_window_t win, gboolean running );
23.47 -void main_window_set_framerate( main_window_t win, float rate );
23.48 -void main_window_set_speed( main_window_t win, double speed );
23.49 -void main_window_set_fullscreen( main_window_t win, gboolean fullscreen );
23.50 -
23.51 -debug_window_t debug_window_new( const gchar *title, GtkWidget *menubar,
23.52 - GtkWidget *toolbar, GtkAccelGroup *accel );
23.53 -void debug_window_show( debug_window_t win, gboolean show );
23.54 -void debug_window_set_running( debug_window_t win, gboolean running );
23.55 -void debug_window_update(debug_window_t win);
23.56 -void debug_window_single_step( debug_window_t data );
23.57 -void debug_window_set_oneshot_breakpoint( debug_window_t data, int row );
23.58 -void debug_window_toggle_breakpoint( debug_window_t data, int row );
23.59 -
23.60 -
23.61 -mmio_window_t mmio_window_new( const gchar *title );
23.62 -void mmio_window_show( mmio_window_t win, gboolean show );
23.63 -void mmio_window_update(mmio_window_t win);
23.64 -
23.65 -dump_window_t dump_window_new( const gchar *title );
23.66 -void dump_window_update_all();
23.67 -
23.68 -void maple_dialog_run();
23.69 -void path_dialog_run();
23.70 -
23.71 -void gtk_gui_update( void );
23.72 -main_window_t gtk_gui_get_main();
23.73 -debug_window_t gtk_gui_get_debugger();
23.74 -mmio_window_t gtk_gui_get_mmio();
23.75 -void gtk_gui_show_mmio();
23.76 -void gtk_gui_show_debugger();
23.77 -
23.78 -/********************* Helper functions **********************/
23.79 -
23.80 -typedef void (*gtk_dialog_done_fn)(GtkWidget *panel, gboolean isOK);
23.81 -void gtk_gui_enable_action( const gchar *action, gboolean enabled );
23.82 -gint gtk_gui_run_property_dialog( const gchar *title, GtkWidget *panel, gtk_dialog_done_fn fn );
23.83 -
23.84 -
23.85 -typedef gboolean (*file_callback_t)( const gchar *filename );
23.86 -void open_file_dialog( char *title, file_callback_t action, char *pattern, char *patname,
23.87 - gchar const *initial_dir );
23.88 -
23.89 -/**
23.90 - * Construct a new pixbuf that takes ownership of the frame buffer
23.91 - */
23.92 -GdkPixbuf *gdk_pixbuf_new_from_frame_buffer( frame_buffer_t buffer );
23.93 -
23.94 -void gdrom_menu_init();
23.95 -GtkWidget *gdrom_menu_new();
23.96 -
23.97 -/******************** Video driver hooks *********************/
23.98 -
23.99 -GtkWidget *gtk_gui_get_renderarea();
23.100 -
23.101 -/******************* Callback declarations *******************/
23.102 -
23.103 -void mount_action_callback( GtkAction *action, gpointer user_data);
23.104 -void reset_action_callback( GtkAction *action, gpointer user_data);
23.105 -void pause_action_callback( GtkAction *action, gpointer user_data);
23.106 -void resume_action_callback( GtkAction *action, gpointer user_data);
23.107 -void load_state_action_callback( GtkAction *action, gpointer user_data);
23.108 -void save_state_action_callback( GtkAction *action, gpointer user_data);
23.109 -void about_action_callback( GtkAction *action, gpointer user_data);
23.110 -void exit_action_callback( GtkAction *action, gpointer user_data);
23.111 -
23.112 -void path_settings_callback( GtkAction *action, gpointer user_data);
23.113 -void audio_settings_callback( GtkAction *action, gpointer user_data);
23.114 -void maple_settings_callback( GtkAction *action, gpointer user_data);
23.115 -void network_settings_callback( GtkAction *action, gpointer user_data);
23.116 -void video_settings_callback( GtkAction *action, gpointer user_data);
23.117 -void fullscreen_toggle_callback( GtkToggleAction *action, gpointer user_data);
23.118 -
23.119 -void debugger_action_callback( GtkAction *action, gpointer user_data);
23.120 -void debug_memory_action_callback( GtkAction *action, gpointer user_data);
23.121 -void debug_mmio_action_callback( GtkAction *action, gpointer user_data);
23.122 -void save_scene_action_callback( GtkAction *action, gpointer user_data);
23.123 -void debug_step_action_callback( GtkAction *action, gpointer user_data);
23.124 -void debug_runto_action_callback( GtkAction *action, gpointer user_data);
23.125 -void debug_breakpoint_action_callback( GtkAction *action, gpointer user_data);
23.126 -
23.127 -void gdrom_open_direct_callback( GtkWidget *widget, gpointer user_data );
23.128 -
23.129 -/*************** Constant colour/font values *****************/
23.130 -extern PangoFontDescription *gui_fixed_font;
23.131 -extern GdkColor gui_colour_normal, gui_colour_changed, gui_colour_error;
23.132 -extern GdkColor gui_colour_warn, gui_colour_pc, gui_colour_debug;
23.133 -extern GdkColor gui_colour_trace, gui_colour_break, gui_colour_temp_break;
23.134 -extern GdkColor gui_colour_white;
23.135 -
23.136 -#endif /* __lxdream_gtkui_H */
24.1 --- a/src/gui/main_win.c Tue Nov 20 09:42:03 2007 +0000
24.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
24.3 @@ -1,159 +0,0 @@
24.4 -/**
24.5 - * $Id: main_win.c,v 1.10 2007-11-08 10:46:41 nkeynes Exp $
24.6 - *
24.7 - * Define the main (emu) GTK window, along with its menubars,
24.8 - * toolbars, etc.
24.9 - *
24.10 - * Copyright (c) 2005 Nathan Keynes.
24.11 - *
24.12 - * This program is free software; you can redistribute it and/or modify
24.13 - * it under the terms of the GNU General Public License as published by
24.14 - * the Free Software Foundation; either version 2 of the License, or
24.15 - * (at your option) any later version.
24.16 - *
24.17 - * This program is distributed in the hope that it will be useful,
24.18 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
24.19 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24.20 - * GNU General Public License for more details.
24.21 - */
24.22 -
24.23 -#include <assert.h>
24.24 -#include <sys/types.h>
24.25 -#include <sys/stat.h>
24.26 -#include <unistd.h>
24.27 -#include <string.h>
24.28 -#include <stdio.h>
24.29 -#include <stdlib.h>
24.30 -
24.31 -#include <gtk/gtk.h>
24.32 -
24.33 -#include "dream.h"
24.34 -#include "gui/gtkui.h"
24.35 -
24.36 -
24.37 -struct main_window_info {
24.38 - GtkWidget *window;
24.39 - GtkWidget *video;
24.40 - GtkWidget *menubar;
24.41 - GtkWidget *toolbar;
24.42 - GtkWidget *statusbar;
24.43 - GtkActionGroup *actions;
24.44 -};
24.45 -
24.46 -static gboolean on_main_window_deleted( GtkWidget *widget, GdkEvent event, gpointer user_data )
24.47 -{
24.48 - exit(0);
24.49 -}
24.50 -
24.51 -static void on_main_window_state_changed( GtkWidget *widget, GdkEventWindowState *state,
24.52 - gpointer userdata )
24.53 -{
24.54 - main_window_t win = (main_window_t)userdata;
24.55 - if( state->changed_mask & GDK_WINDOW_STATE_FULLSCREEN ) {
24.56 - gboolean fs = (state->new_window_state & GDK_WINDOW_STATE_FULLSCREEN);
24.57 - GtkWidget *frame = gtk_widget_get_parent(win->video);
24.58 - if( frame->style == NULL ) {
24.59 - gtk_widget_set_style( frame, gtk_style_new() );
24.60 - }
24.61 - if( fs ) {
24.62 - gtk_widget_hide( win->menubar );
24.63 - gtk_widget_hide( win->toolbar );
24.64 - gtk_widget_hide( win->statusbar );
24.65 -
24.66 - frame->style->xthickness = 0;
24.67 - frame->style->ythickness = 0;
24.68 - } else {
24.69 - frame->style->xthickness = 2;
24.70 - frame->style->ythickness = 2;
24.71 - gtk_widget_show( win->menubar );
24.72 - gtk_widget_show( win->toolbar );
24.73 - gtk_widget_show( win->statusbar );
24.74 - }
24.75 - gtk_widget_queue_draw( win->window );
24.76 - }
24.77 -}
24.78 -
24.79 -main_window_t main_window_new( const gchar *title, GtkWidget *menubar, GtkWidget *toolbar,
24.80 - GtkAccelGroup *accel_group )
24.81 -{
24.82 - GtkWidget *vbox;
24.83 - GtkWidget *frame;
24.84 - main_window_t win = g_malloc0( sizeof(struct main_window_info) );
24.85 -
24.86 - win->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
24.87 - win->menubar = menubar;
24.88 - win->toolbar = toolbar;
24.89 - gtk_window_set_title( GTK_WINDOW(win->window), title );
24.90 - gtk_window_add_accel_group (GTK_WINDOW (win->window), accel_group);
24.91 -
24.92 - gtk_toolbar_set_style( GTK_TOOLBAR(toolbar), GTK_TOOLBAR_ICONS );
24.93 -
24.94 - win->video = gtk_drawing_area_new();
24.95 - GTK_WIDGET_SET_FLAGS(win->video, GTK_CAN_FOCUS|GTK_CAN_DEFAULT);
24.96 - gtk_widget_set_size_request( win->video, 640, 480 );
24.97 - frame = gtk_frame_new(NULL);
24.98 - gtk_frame_set_shadow_type( GTK_FRAME(frame), GTK_SHADOW_IN );
24.99 - gtk_container_add( GTK_CONTAINER(frame), win->video );
24.100 -
24.101 - win->statusbar = gtk_statusbar_new();
24.102 -
24.103 - vbox = gtk_vbox_new(FALSE, 0);
24.104 - gtk_container_add( GTK_CONTAINER(win->window), vbox );
24.105 - gtk_box_pack_start( GTK_BOX(vbox), menubar, FALSE, FALSE, 0 );
24.106 - gtk_box_pack_start( GTK_BOX(vbox), toolbar, FALSE, FALSE, 0 );
24.107 - gtk_box_pack_start( GTK_BOX(vbox), frame, TRUE, TRUE, 0 );
24.108 - gtk_box_pack_start( GTK_BOX(vbox), win->statusbar, FALSE, FALSE, 0 );
24.109 - gtk_widget_show_all( win->window );
24.110 - gtk_widget_grab_focus( win->video );
24.111 -
24.112 - gtk_statusbar_push( GTK_STATUSBAR(win->statusbar), 1, "Stopped" );
24.113 - g_signal_connect( win->window, "delete_event",
24.114 - G_CALLBACK(on_main_window_deleted), win );
24.115 - g_signal_connect( win->window, "window-state-event",
24.116 - G_CALLBACK(on_main_window_state_changed), win );
24.117 - return win;
24.118 -}
24.119 -
24.120 -void main_window_set_running( main_window_t win, gboolean running )
24.121 -{
24.122 - gtk_gui_enable_action( "Pause", running );
24.123 - gtk_gui_enable_action( "Run", !running );
24.124 - gtk_statusbar_pop( GTK_STATUSBAR(win->statusbar), 1 );
24.125 - gtk_statusbar_push( GTK_STATUSBAR(win->statusbar), 1, running ? "Running" : "Stopped" );
24.126 -}
24.127 -
24.128 -void main_window_set_framerate( main_window_t win, float rate )
24.129 -{
24.130 -
24.131 -
24.132 -}
24.133 -
24.134 -void main_window_set_speed( main_window_t win, double speed )
24.135 -{
24.136 - char buf[32];
24.137 -
24.138 - snprintf( buf, 32, "Running (%2.4f%%)", speed );
24.139 - gtk_statusbar_pop( GTK_STATUSBAR(win->statusbar), 1 );
24.140 - gtk_statusbar_push( GTK_STATUSBAR(win->statusbar), 1, buf );
24.141 -
24.142 -
24.143 -}
24.144 -
24.145 -GtkWidget *main_window_get_renderarea( main_window_t win )
24.146 -{
24.147 - return win->video;
24.148 -}
24.149 -
24.150 -GtkWindow *main_window_get_frame( main_window_t win )
24.151 -{
24.152 - return GTK_WINDOW(win->window);
24.153 -}
24.154 -
24.155 -void main_window_set_fullscreen( main_window_t win, gboolean fullscreen )
24.156 -{
24.157 - if( fullscreen ) {
24.158 - gtk_window_fullscreen( GTK_WINDOW(win->window) );
24.159 - } else {
24.160 - gtk_window_unfullscreen( GTK_WINDOW(win->window) );
24.161 - }
24.162 -}
25.1 --- a/src/gui/mmio_win.c Tue Nov 20 09:42:03 2007 +0000
25.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
25.3 @@ -1,241 +0,0 @@
25.4 -/**
25.5 - * $Id: mmio_win.c,v 1.11 2007-11-10 04:45:29 nkeynes Exp $
25.6 - *
25.7 - * Implements the MMIO register viewing window
25.8 - *
25.9 - * Copyright (c) 2005 Nathan Keynes.
25.10 - *
25.11 - * This program is free software; you can redistribute it and/or modify
25.12 - * it under the terms of the GNU General Public License as published by
25.13 - * the Free Software Foundation; either version 2 of the License, or
25.14 - * (at your option) any later version.
25.15 - *
25.16 - * This program is distributed in the hope that it will be useful,
25.17 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
25.18 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25.19 - * GNU General Public License for more details.
25.20 - */
25.21 -
25.22 -#include <stdint.h>
25.23 -#include <string.h>
25.24 -#include <glib/gi18n.h>
25.25 -#include "gui/gtkui.h"
25.26 -#include "mem.h"
25.27 -#include "mmio.h"
25.28 -
25.29 -
25.30 -struct mmio_window_info {
25.31 - GtkWidget *window;
25.32 - GtkWidget *notebook;
25.33 -};
25.34 -
25.35 -static void printbits( char *out, int nbits, uint32_t value )
25.36 -{
25.37 - if( nbits < 32 ) {
25.38 - int i;
25.39 - for( i=32; i>nbits; i-- ) {
25.40 - if( !(i % 8) ) *out++ = ' ';
25.41 - *out++ = ' ';
25.42 - }
25.43 - }
25.44 - while( nbits > 0 ) {
25.45 - *out++ = (value&(1<<--nbits) ? '1' : '0');
25.46 - if( !(nbits % 8) ) *out++ = ' ';
25.47 - }
25.48 - *out = '\0';
25.49 -}
25.50 -
25.51 -static void printhex( char *out, int nbits, uint32_t value )
25.52 -{
25.53 - char tmp[10], *p = tmp;
25.54 - int i;
25.55 -
25.56 - sprintf( tmp, "%08X", value );
25.57 - for( i=32; i>0; i-=4, p++ ) {
25.58 - if( i <= nbits ) *out++ = *p;
25.59 - else *out++ = ' ';
25.60 - }
25.61 - *out = '\0';
25.62 -}
25.63 -
25.64 -
25.65 -
25.66 -
25.67 -gboolean
25.68 -on_mmio_delete_event (GtkWidget *widget,
25.69 - GdkEvent *event,
25.70 - gpointer user_data)
25.71 -{
25.72 - gtk_widget_hide(widget);
25.73 - return TRUE;
25.74 -}
25.75 -
25.76 -
25.77 -void on_mmio_close_clicked( GtkButton *button, gpointer user_data)
25.78 -{
25.79 - gtk_widget_hide( ((mmio_window_t)user_data)->window );
25.80 -}
25.81 -
25.82 -
25.83 -void on_trace_button_toggled (GtkToggleButton *button,
25.84 - gpointer user_data)
25.85 -{
25.86 - struct mmio_region *io_rgn = (struct mmio_region *)user_data;
25.87 - gboolean isActive = gtk_toggle_button_get_active(button);
25.88 - if( io_rgn != NULL ) {
25.89 - io_rgn->trace_flag = isActive ? 1 : 0;
25.90 - }
25.91 -}
25.92 -
25.93 -static GtkCList *mmio_window_add_page( mmio_window_t mmio, char *name, struct mmio_region *io_rgn )
25.94 -{
25.95 - GtkCList *list;
25.96 - GtkWidget *scroll;
25.97 - GtkWidget *tab;
25.98 - GtkCheckButton *trace_button;
25.99 - GtkVBox *vbox;
25.100 -
25.101 - scroll = gtk_scrolled_window_new(NULL, NULL);
25.102 - gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW(scroll),
25.103 - GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS );
25.104 - list = GTK_CLIST(gtk_clist_new(5));
25.105 - gtk_clist_set_column_width(list, 0, 70);
25.106 - gtk_clist_set_column_width(list, 1, 75);
25.107 - gtk_clist_set_column_width(list, 2, 70);
25.108 - gtk_clist_set_column_width(list, 3, 280);
25.109 - gtk_clist_set_column_width(list, 4, 160);
25.110 - gtk_clist_set_column_justification(list, 0, GTK_JUSTIFY_CENTER );
25.111 - gtk_clist_set_column_justification(list, 2, GTK_JUSTIFY_CENTER );
25.112 - gtk_clist_set_column_justification(list, 3, GTK_JUSTIFY_CENTER );
25.113 - gtk_clist_set_column_title(list, 0, _("Address"));
25.114 - gtk_clist_set_column_title(list, 1, _("Register"));
25.115 - gtk_clist_set_column_title(list, 2, _("Value"));
25.116 - gtk_clist_set_column_title(list, 3, _("Bit Pattern"));
25.117 - gtk_clist_set_column_title(list, 4, _("Description"));
25.118 - gtk_clist_column_titles_show(list);
25.119 - gtk_widget_modify_font( GTK_WIDGET(list), gui_fixed_font );
25.120 - tab = gtk_label_new(_(name));
25.121 - gtk_container_add( GTK_CONTAINER(scroll), GTK_WIDGET(list) );
25.122 -
25.123 - vbox = GTK_VBOX(gtk_vbox_new( FALSE, 0 ));
25.124 - gtk_container_add( GTK_CONTAINER(vbox), GTK_WIDGET(scroll) );
25.125 -
25.126 - trace_button = GTK_CHECK_BUTTON(gtk_check_button_new_with_label(_("Trace access")));
25.127 - gtk_container_add( GTK_CONTAINER(vbox), GTK_WIDGET(trace_button) );
25.128 - gtk_box_set_child_packing( GTK_BOX(vbox), GTK_WIDGET(trace_button),
25.129 - FALSE, FALSE, 0, GTK_PACK_START );
25.130 - gtk_notebook_append_page( GTK_NOTEBOOK(mmio->notebook), GTK_WIDGET(vbox), tab );
25.131 - gtk_object_set_data( GTK_OBJECT(mmio->window), name, list );
25.132 - g_signal_connect ((gpointer) trace_button, "toggled",
25.133 - G_CALLBACK (on_trace_button_toggled),
25.134 - io_rgn);
25.135 - return list;
25.136 -}
25.137 -
25.138 -
25.139 -
25.140 -mmio_window_t mmio_window_new( const gchar *title )
25.141 -{
25.142 - mmio_window_t mmio = g_malloc0( sizeof(struct mmio_window_info) );
25.143 -
25.144 - int i, j;
25.145 - GtkCList *all_list;
25.146 - GtkWidget *vbox1;
25.147 - GtkWidget *hbuttonbox1;
25.148 - GtkWidget *mmr_close;
25.149 -
25.150 - mmio->window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
25.151 - gtk_window_set_title (GTK_WINDOW (mmio->window), title);
25.152 - gtk_window_set_default_size (GTK_WINDOW (mmio->window), 600, 600);
25.153 -
25.154 - vbox1 = gtk_vbox_new (FALSE, 0);
25.155 - gtk_container_add (GTK_CONTAINER (mmio->window), vbox1);
25.156 -
25.157 - mmio->notebook = gtk_notebook_new ();
25.158 - gtk_box_pack_start (GTK_BOX (vbox1), mmio->notebook, TRUE, TRUE, 0);
25.159 - gtk_notebook_set_tab_pos (GTK_NOTEBOOK (mmio->notebook), GTK_POS_LEFT);
25.160 -
25.161 - hbuttonbox1 = gtk_hbutton_box_new ();
25.162 - gtk_box_pack_start (GTK_BOX (vbox1), hbuttonbox1, FALSE, TRUE, 0);
25.163 - gtk_box_set_spacing (GTK_BOX (hbuttonbox1), 30);
25.164 -
25.165 - mmr_close = gtk_button_new_with_mnemonic (_("Close"));
25.166 - gtk_container_add (GTK_CONTAINER (hbuttonbox1), mmr_close);
25.167 - GTK_WIDGET_SET_FLAGS (mmr_close, GTK_CAN_DEFAULT);
25.168 -
25.169 - /* Add the mmio register data */
25.170 - all_list = mmio_window_add_page( mmio, "All", NULL );
25.171 - for( i=0; i < num_io_rgns; i++ ) {
25.172 - GtkCList *list = mmio_window_add_page( mmio, io_rgn[i]->id, io_rgn[i] );
25.173 - for( j=0; io_rgn[i]->ports[j].id != NULL; j++ ) {
25.174 - int sz = io_rgn[i]->ports[j].width;
25.175 - char addr[10], data[10], bits[40];
25.176 - char *arr[] = { addr, io_rgn[i]->ports[j].id, data, bits,
25.177 - io_rgn[i]->ports[j].desc };
25.178 - sprintf( addr, "%08X",
25.179 - io_rgn[i]->base + io_rgn[i]->ports[j].offset );
25.180 - printhex( data, sz, *io_rgn[i]->ports[j].val );
25.181 - printbits( bits, io_rgn[i]->ports[j].width,
25.182 - *io_rgn[i]->ports[j].val );
25.183 - gtk_clist_append( list, arr );
25.184 - gtk_clist_append( all_list, arr );
25.185 - }
25.186 - }
25.187 -
25.188 - g_signal_connect ((gpointer) mmio->window, "delete_event",
25.189 - G_CALLBACK (on_mmio_delete_event),
25.190 - NULL);
25.191 - g_signal_connect ((gpointer) mmr_close, "clicked",
25.192 - G_CALLBACK (on_mmio_close_clicked),
25.193 - mmio);
25.194 -
25.195 - gtk_widget_show_all( mmio->window );
25.196 - return mmio;
25.197 -}
25.198 -
25.199 -void mmio_window_update( mmio_window_t mmio )
25.200 -{
25.201 - int i,j, count = 0;
25.202 - GtkCList *page, *all_page;
25.203 - char data[10], bits[40];
25.204 -
25.205 - all_page = GTK_CLIST(gtk_object_get_data( GTK_OBJECT(mmio->window), "All" ));
25.206 -
25.207 - for( i=0; i < num_io_rgns; i++ ) {
25.208 - page = GTK_CLIST(gtk_object_get_data( GTK_OBJECT(mmio->window),
25.209 - io_rgn[i]->id ));
25.210 - for( j=0; io_rgn[i]->ports[j].id != NULL; j++ ) {
25.211 - if( *io_rgn[i]->ports[j].val !=
25.212 - *(uint32_t *)(io_rgn[i]->save_mem+io_rgn[i]->ports[j].offset)){
25.213 - int sz = io_rgn[i]->ports[j].width;
25.214 - /* Changed */
25.215 - printhex( data, sz, *io_rgn[i]->ports[j].val );
25.216 - printbits( bits, sz, *io_rgn[i]->ports[j].val );
25.217 -
25.218 - gtk_clist_set_text( page, j, 2, data );
25.219 - gtk_clist_set_text( page, j, 3, bits );
25.220 - gtk_clist_set_foreground( page, j, &gui_colour_changed );
25.221 -
25.222 - gtk_clist_set_text( all_page, count, 2, data );
25.223 - gtk_clist_set_text( all_page, count, 3, bits );
25.224 - gtk_clist_set_foreground( all_page, count, &gui_colour_changed );
25.225 -
25.226 - } else {
25.227 - gtk_clist_set_foreground( page, j, &gui_colour_normal );
25.228 - gtk_clist_set_foreground( all_page, count, &gui_colour_normal );
25.229 - }
25.230 - count++;
25.231 - }
25.232 - memcpy( io_rgn[i]->save_mem, io_rgn[i]->mem, PAGE_SIZE );
25.233 - }
25.234 -}
25.235 -
25.236 -void mmio_window_show( mmio_window_t mmio, gboolean show )
25.237 -{
25.238 - if( show ) {
25.239 - gtk_widget_show( mmio->window );
25.240 - } else {
25.241 - gtk_widget_hide( mmio->window );
25.242 - }
25.243 -}
25.244 -
26.1 --- a/src/gui/path_dlg.c Tue Nov 20 09:42:03 2007 +0000
26.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
26.3 @@ -1,128 +0,0 @@
26.4 -/**
26.5 - * $Id: path_dlg.c,v 1.5 2007-11-10 04:45:29 nkeynes Exp $
26.6 - *
26.7 - * Define the main (emu) GTK window, along with its menubars,
26.8 - * toolbars, etc.
26.9 - *
26.10 - * Copyright (c) 2005 Nathan Keynes.
26.11 - *
26.12 - * This program is free software; you can redistribute it and/or modify
26.13 - * it under the terms of the GNU General Public License as published by
26.14 - * the Free Software Foundation; either version 2 of the License, or
26.15 - * (at your option) any later version.
26.16 - *
26.17 - * This program is distributed in the hope that it will be useful,
26.18 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
26.19 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26.20 - * GNU General Public License for more details.
26.21 - */
26.22 -
26.23 -#include <assert.h>
26.24 -#include <gtk/gtk.h>
26.25 -
26.26 -#include "dream.h"
26.27 -#include "dreamcast.h"
26.28 -#include "config.h"
26.29 -#include "gui/gtkui.h"
26.30 -
26.31 -static const gchar *path_label[] = { N_("Bios rom"), N_("Flash rom"), N_("Default disc path"),
26.32 - N_("Save state path"), N_("Bootstrap IP.BIN") };
26.33 -static const int path_id[] = { CONFIG_BIOS_PATH, CONFIG_FLASH_PATH, CONFIG_DEFAULT_PATH,
26.34 - CONFIG_SAVE_PATH, CONFIG_BOOTSTRAP };
26.35 -static GtkFileChooserAction path_action[] = {
26.36 - GTK_FILE_CHOOSER_ACTION_OPEN,
26.37 - GTK_FILE_CHOOSER_ACTION_OPEN,
26.38 - GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER,
26.39 - GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER,
26.40 - GTK_FILE_CHOOSER_ACTION_OPEN };
26.41 -
26.42 -static GtkWidget *path_entry[5];
26.43 -
26.44 -static gboolean path_file_button_clicked( GtkWidget *button, gpointer user_data )
26.45 -{
26.46 - GtkWidget *entry = GTK_WIDGET(user_data);
26.47 - GtkWidget *file = gtk_file_chooser_dialog_new( _("Select file"), NULL,
26.48 - GTK_FILE_CHOOSER_ACTION_OPEN,
26.49 - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
26.50 - GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
26.51 - NULL );
26.52 - const gchar *filename = gtk_entry_get_text(GTK_ENTRY(entry));
26.53 - gtk_file_chooser_set_filename( GTK_FILE_CHOOSER(file), filename );
26.54 - gtk_window_set_modal( GTK_WINDOW(file), TRUE );
26.55 - gtk_widget_show_all( file );
26.56 - gint result = gtk_dialog_run(GTK_DIALOG(file));
26.57 - if( result == GTK_RESPONSE_ACCEPT ) {
26.58 - filename = gtk_file_chooser_get_filename( GTK_FILE_CHOOSER(file) );
26.59 - gtk_entry_set_text(GTK_ENTRY(entry), filename);
26.60 - }
26.61 - gtk_widget_destroy(file);
26.62 - return TRUE;
26.63 -}
26.64 -
26.65 -static gboolean path_dir_button_clicked( GtkWidget *button, gpointer user_data )
26.66 -{
26.67 - GtkWidget *entry = GTK_WIDGET(user_data);
26.68 - GtkWidget *file = gtk_file_chooser_dialog_new( _("Select file"), NULL,
26.69 - GTK_FILE_CHOOSER_ACTION_OPEN,
26.70 - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
26.71 - GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
26.72 - NULL );
26.73 - const gchar *filename = gtk_entry_get_text(GTK_ENTRY(entry));
26.74 - gtk_file_chooser_set_action( GTK_FILE_CHOOSER(file), GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER );
26.75 - gtk_file_chooser_set_filename( GTK_FILE_CHOOSER(file), filename );
26.76 - gtk_window_set_modal( GTK_WINDOW(file), TRUE );
26.77 - gtk_widget_show_all( file );
26.78 - gint result = gtk_dialog_run(GTK_DIALOG(file));
26.79 - if( result == GTK_RESPONSE_ACCEPT ) {
26.80 - filename = gtk_file_chooser_get_filename( GTK_FILE_CHOOSER(file) );
26.81 - gtk_entry_set_text(GTK_ENTRY(entry), filename);
26.82 - }
26.83 - gtk_widget_destroy(file);
26.84 - return TRUE;
26.85 -}
26.86 -
26.87 -GtkWidget *path_panel_new(void)
26.88 -{
26.89 - GtkWidget *table = gtk_table_new( 5, 3, FALSE );
26.90 - int i;
26.91 - for( i=0; i<5; i++ ) {
26.92 - GtkWidget *text = path_entry[i] = gtk_entry_new();
26.93 - GtkWidget *button = gtk_button_new();
26.94 - gtk_table_attach( GTK_TABLE(table), gtk_label_new(Q_(path_label[i])), 0, 1, i, i+1,
26.95 - GTK_SHRINK, GTK_SHRINK, 0, 0);
26.96 - gtk_entry_set_text( GTK_ENTRY(text), lxdream_get_config_value(path_id[i]) );
26.97 - gtk_entry_set_width_chars( GTK_ENTRY(text), 48 );
26.98 - gtk_table_attach_defaults( GTK_TABLE(table), text, 1, 2, i, i+1 );
26.99 - gtk_table_attach( GTK_TABLE(table), button, 2, 3, i, i+1, GTK_SHRINK, GTK_SHRINK, 0, 0 );
26.100 - if( path_action[i] == GTK_FILE_CHOOSER_ACTION_OPEN ) {
26.101 - GtkWidget *image = gtk_image_new_from_stock(GTK_STOCK_OPEN, GTK_ICON_SIZE_BUTTON);
26.102 - gtk_button_set_image( GTK_BUTTON(button), image );
26.103 - g_signal_connect( button, "clicked", G_CALLBACK(path_file_button_clicked), text );
26.104 - } else {
26.105 - GtkWidget *image = gtk_image_new_from_stock(GTK_STOCK_OPEN, GTK_ICON_SIZE_BUTTON);
26.106 - gtk_button_set_image( GTK_BUTTON(button), image );
26.107 - g_signal_connect( button, "clicked", G_CALLBACK(path_dir_button_clicked), text );
26.108 - }
26.109 - }
26.110 - return table;
26.111 -
26.112 -}
26.113 -
26.114 -void path_panel_done( GtkWidget *panel, gboolean isOK )
26.115 -{
26.116 - if( isOK ) {
26.117 - int i;
26.118 - for(i=0; i<5; i++ ) {
26.119 - const char *filename = gtk_entry_get_text( GTK_ENTRY(path_entry[i]) );
26.120 - lxdream_set_global_config_value( path_id[i], filename );
26.121 - }
26.122 -
26.123 - lxdream_save_config();
26.124 - dreamcast_config_changed();
26.125 - }
26.126 -}
26.127 -
26.128 -void path_dialog_run( void )
26.129 -{
26.130 - gtk_gui_run_property_dialog( _("Path Settings"), path_panel_new(), path_panel_done );
26.131 -}
27.1 --- a/src/loader.c Tue Nov 20 09:42:03 2007 +0000
27.2 +++ b/src/loader.c Tue Nov 20 10:27:58 2007 +0000
27.3 @@ -31,9 +31,7 @@
27.4 #include "config.h"
27.5 #include "loader.h"
27.6 #include "syscall.h"
27.7 -
27.8 -// FIXME: This probably shouldn't be here
27.9 -#include <gui/gtkui.h>
27.10 +#include "gui.h"
27.11
27.12 char bootstrap_magic[32] = "SEGA SEGAKATANA SEGA ENTERPRISES";
27.13 char iso_magic[6] = "\001CD001";
27.14 @@ -80,7 +78,7 @@
27.15 read( fd, load, BOOTSTRAP_SIZE );
27.16 bootstrap_dump( load, TRUE );
27.17 sh4_set_pc( BOOTSTRAP_LOAD_ADDR + 0x300 );
27.18 - gtk_gui_update();
27.19 + gui_update_state();
27.20 } else {
27.21 /* look for a valid ISO9660 header */
27.22 lseek( fd, 32768, SEEK_SET );
27.23 @@ -128,7 +126,7 @@
27.24 }
27.25 bios_install();
27.26 dcload_install();
27.27 - gtk_gui_update();
27.28 + gui_update_state();
27.29 }
27.30
27.31
28.1 --- a/src/main.c Tue Nov 20 09:42:03 2007 +0000
28.2 +++ b/src/main.c Tue Nov 20 10:27:58 2007 +0000
28.3 @@ -2,7 +2,7 @@
28.4 * $Id: main.c,v 1.35 2007-11-07 11:45:53 nkeynes Exp $
28.5 *
28.6 * Main program, initializes dreamcast and gui, then passes control off to
28.7 - * the gtk main loop (currently).
28.8 + * the main loop.
28.9 *
28.10 * Copyright (c) 2005 Nathan Keynes.
28.11 *
.