diff options
| author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2006-03-20 22:46:46 +0000 | 
|---|---|---|
| committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2006-03-20 22:46:46 +0000 | 
| commit | 300160e73da486946ae513f1d039dcd7b85ff17c (patch) | |
| tree | f26691ff724b57dac450ab47e4eea91e63cdadc1 /mixgtk | |
| parent | 50375f34b611281a3b05a37221e2baa143f5f5ca (diff) | |
| download | mdk-300160e73da486946ae513f1d039dcd7b85ff17c.tar.gz mdk-300160e73da486946ae513f1d039dcd7b85ff17c.tar.bz2 | |
Version 1.2.1 imported1.2.1
git-archimport-id: mdk@sv.gnu.org/mdk--devel--1--patch-1
Diffstat (limited to 'mixgtk')
| -rw-r--r-- | mixgtk/Makefile.am | 47 | ||||
| -rw-r--r-- | mixgtk/gmixvm.c | 124 | ||||
| -rw-r--r-- | mixgtk/mixgtk.c | 79 | ||||
| -rw-r--r-- | mixgtk/mixgtk.glade | 3913 | ||||
| -rw-r--r-- | mixgtk/mixgtk.gladep | 9 | ||||
| -rw-r--r-- | mixgtk/mixgtk.h | 49 | ||||
| -rw-r--r-- | mixgtk/mixgtk_cmd_dispatcher.c | 547 | ||||
| -rw-r--r-- | mixgtk/mixgtk_cmd_dispatcher.h | 61 | ||||
| -rw-r--r-- | mixgtk/mixgtk_config.c | 113 | ||||
| -rw-r--r-- | mixgtk/mixgtk_config.h | 70 | ||||
| -rw-r--r-- | mixgtk/mixgtk_device.c | 625 | ||||
| -rw-r--r-- | mixgtk/mixgtk_device.h | 45 | ||||
| -rw-r--r-- | mixgtk/mixgtk_fontsel.c | 142 | ||||
| -rw-r--r-- | mixgtk/mixgtk_fontsel.h | 51 | ||||
| -rw-r--r-- | mixgtk/mixgtk_gen_handlers.c | 165 | ||||
| -rw-r--r-- | mixgtk/mixgtk_gen_handlers.h | 62 | ||||
| -rw-r--r-- | mixgtk/mixgtk_input.c | 233 | ||||
| -rw-r--r-- | mixgtk/mixgtk_input.h | 49 | ||||
| -rw-r--r-- | mixgtk/mixgtk_mixal.c | 580 | ||||
| -rw-r--r-- | mixgtk/mixgtk_mixal.h | 66 | ||||
| -rw-r--r-- | mixgtk/mixgtk_mixvm.c | 529 | ||||
| -rw-r--r-- | mixgtk/mixgtk_mixvm.h | 72 | ||||
| -rw-r--r-- | mixgtk/mixgtk_widgets.c | 153 | ||||
| -rw-r--r-- | mixgtk/mixgtk_widgets.h | 102 | ||||
| -rw-r--r-- | mixgtk/mixgtk_wm.c | 573 | ||||
| -rw-r--r-- | mixgtk/mixgtk_wm.h | 46 | 
26 files changed, 8505 insertions, 0 deletions
| diff --git a/mixgtk/Makefile.am b/mixgtk/Makefile.am new file mode 100644 index 0000000..60adf8d --- /dev/null +++ b/mixgtk/Makefile.am @@ -0,0 +1,47 @@ +## Process this file with automake to produce Makefile.in + +# Copyright (C) 2001, 2004 Free Software Foundation, Inc. +# +# This file is free software; as a special exception the author gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# $Id: Makefile.am,v 1.19 2005/09/18 21:49:40 jao Exp $ + +EXTRA_DIST = mixgtk.glade + +if MAKE_GUILE +GUILED = -DMAKE_GUILE +else +GUILED = +endif + +if MAKE_GUI + +pkgdata_DATA = mixgtk.glade + +INCLUDES = -I$(includedir) -I$(top_srcdir) \ +           -DGLADE_FILE=\""$(pkgdatadir)/mixgtk.glade"\"\ +           -DLOCAL_GLADE_FILE=\""$(srcdir)/mixgtk.glade"\"\ +           $(GUILED) +LDADD = $(top_builddir)/mixlib/libmix.a $(top_builddir)/lib/libreplace.a\ +        $(top_builddir)/mixguile/libmixguile.a $(INTLLIBS) + +AM_LDFLAGS = -Wl,--export-dynamic +bin_PROGRAMS = gmixvm +gmixvm_SOURCES = gmixvm.c mixgtk.h mixgtk.c \ +                 mixgtk_config.h mixgtk_config.c \ +                 mixgtk_gen_handlers.h mixgtk_gen_handlers.c \ +		 mixgtk_cmd_dispatcher.h mixgtk_cmd_dispatcher.c \ +                 mixgtk_widgets.h mixgtk_widgets.c \ +                 mixgtk_device.h mixgtk_device.c \ +                 mixgtk_mixvm.h mixgtk_mixvm.c \ +                 mixgtk_mixal.h mixgtk_mixal.c \ +                 mixgtk_input.h mixgtk_input.c \ +		 mixgtk_fontsel.h mixgtk_fontsel.c \ +                 mixgtk_wm.h mixgtk_wm.c +endif diff --git a/mixgtk/gmixvm.c b/mixgtk/gmixvm.c new file mode 100644 index 0000000..150c891 --- /dev/null +++ b/mixgtk/gmixvm.c @@ -0,0 +1,124 @@ +/* -*-c-*- -------------- gmixvm.c : + * Main function of the mix gtk front-end + * ------------------------------------------------------------------ + *  $Id: gmixvm.c,v 1.6 2005/09/20 19:43:14 jao Exp $ + * ------------------------------------------------------------------ + * Copyright (C) 2001, 2002 Free Software Foundation, Inc. + *   + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + *   + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the + * GNU General Public License for more details. + *   + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + *   + */ + +#include <stdio.h> +#include <stdlib.h> +#include "mixgtk.h" + +static gboolean initfile_ = TRUE; + +#ifdef MAKE_GUILE +#  include <mixguile/mixguile.h> +#  include "mixgtk_cmd_dispatcher.h" +static void +inner_main_ (int argc, char *argv[]) +{ +  mixgtk_init (argc, argv); +  mixguile_set_cmd_dispatcher (mixgtk_cmd_dispatcher_get_mix_dispatcher ()); +  mixguile_load_bootstrap (initfile_); +  mixgtk_main (); +  mixgtk_release (); +} +#endif + +#ifdef HAVE_GETOPT_LONG +#  include <getopt.h> +#else +#  include <lib/getopt.h> +#endif /* HAVE_GETOPT_LONG */ + +enum { +  VER_OPT = 'v', +  NOINIT_OPT = 'q', +  HELP_OPT = 'h', +  USAGE_OPT = 'u' +}; + +static const char *options_ = "vqhu";  + +static struct option long_options_[] = +{ +  {"version", no_argument, 0, VER_OPT}, +  {"help", no_argument, 0, HELP_OPT}, +  {"usage", no_argument, 0, USAGE_OPT}, +  {"noinit", no_argument, 0, NOINIT_OPT}, +  {0, 0, 0, 0} +}; + +static void print_usage_ (const gchar *prog) +{ +  static const char *usage_ = +    "Usage: %s [-vhuq] [--version] [--help] [--usage] [--noinit]\n"; +  fprintf (stderr, usage_, prog); +} + +int +main(int argc, char *argv[]) +{ +  int c; + +  const char *prog_name = argv[0]; +       +  setlocale (LC_ALL, ""); +  bindtextdomain (PACKAGE, LOCALEDIR); +  textdomain (PACKAGE); + +  while (1) +    { +      c = getopt_long (argc, argv, options_, long_options_, (int*)0); +      +      /* Detect the end of the options. */ +      if (c == -1) +	break; +      +      switch (c) +	{ +     	case VER_OPT: +	  mix_print_license (_("gmixvm, GTK MIX virtual machine")); +	  return EXIT_SUCCESS; +	case NOINIT_OPT: +	  initfile_ = FALSE; +	  break; +	case HELP_OPT: +	case USAGE_OPT: +	  print_usage_ (prog_name); +	  return EXIT_SUCCESS; +	case '?': +	  print_usage_ (prog_name); +	  return EXIT_FAILURE; +	default: +	  g_assert_not_reached (); +	  break; +	} +    } + +#ifdef MAKE_GUILE +  mixguile_enter (argc, argv, inner_main_); +#else +  if (!mixgtk_init (argc, argv)) return EXIT_FAILURE; +  mixgtk_main (); +  mixgtk_release (); +#endif + +  return EXIT_SUCCESS; +} diff --git a/mixgtk/mixgtk.c b/mixgtk/mixgtk.c new file mode 100644 index 0000000..eddb528 --- /dev/null +++ b/mixgtk/mixgtk.c @@ -0,0 +1,79 @@ +/* -*-c-*- -------------- mixgtk.c : + * Main functions of the mix gtk front-end + * ------------------------------------------------------------------ + * $Id: mixgtk.c,v 1.19 2005/09/20 19:43:14 jao Exp $ + * ------------------------------------------------------------------ + * Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include <stdio.h> +#include <string.h> + +#include "mixgtk_widgets.h" + +#include "mixgtk_cmd_dispatcher.h" +#include "mixgtk_input.h" +#include "mixgtk_config.h" +#include "mixgtk_wm.h" +#include "mixgtk.h" + +/* initialise the app */ +gboolean +mixgtk_init (int argc, char *argv[]) +{ +  mix_init_lib (); + +  gtk_init (&argc, &argv); + +  if (!mixgtk_config_load ()) +    { +      g_error (_("Unable to load gmixvm configuration")); +    } + +  if (!mixgtk_widget_factory_init ()) +    { +      g_error (_("Unable to initialise application: missing glade file")); +      return FALSE; +    } + +  if (!mixgtk_wm_init ()) +    { +      g_error (_("Unable to initialise application\n")); +      return FALSE; +    } + +  mixgtk_input_init (); + +  return TRUE; +} + +/* main loop */ +void +mixgtk_main (void) +{ +  gtk_main (); +} + +/* clean up */ +void +mixgtk_release (void) +{ +  if (mixgtk_config_is_autosave ()) mixgtk_config_save (); +  mix_vm_cmd_dispatcher_delete (mixgtk_cmd_dispatcher_get_mix_dispatcher ()); +  mix_release_lib (); +} diff --git a/mixgtk/mixgtk.glade b/mixgtk/mixgtk.glade new file mode 100644 index 0000000..f16f441 --- /dev/null +++ b/mixgtk/mixgtk.glade @@ -0,0 +1,3913 @@ +<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> +<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd"> + +<glade-interface> + +<widget class="GtkWindow" id="main_window"> +  <property name="title" translatable="yes">gmixvm</property> +  <property name="type">GTK_WINDOW_TOPLEVEL</property> +  <property name="window_position">GTK_WIN_POS_NONE</property> +  <property name="modal">False</property> +  <property name="default_width">650</property> +  <property name="default_height">550</property> +  <property name="resizable">True</property> +  <property name="destroy_with_parent">False</property> +  <property name="role">gmixvm-main</property> +  <property name="decorated">True</property> +  <property name="skip_taskbar_hint">False</property> +  <property name="skip_pager_hint">False</property> +  <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property> +  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> + +  <child> +    <widget class="GtkVBox" id="main_vbox"> +      <property name="border_width">2</property> +      <property name="visible">True</property> +      <property name="homogeneous">False</property> +      <property name="spacing">2</property> + +      <child> +	<widget class="GtkMenuBar" id="mainmenubar"> +	  <property name="visible">True</property> + +	  <child> +	    <widget class="GtkMenuItem" id="file"> +	      <property name="visible">True</property> +	      <property name="label" translatable="yes">_File</property> +	      <property name="use_underline">True</property> + +	      <child> +		<widget class="GtkMenu" id="file_menu"> + +		  <child> +		    <widget class="GtkImageMenuItem" id="file_open"> +		      <property name="visible">True</property> +		      <property name="tooltip" translatable="yes">Load a MIX file</property> +		      <property name="label" translatable="yes">_Load...</property> +		      <property name="use_underline">True</property> +		      <signal name="activate" handler="on_file_open_activate"/> +		      <accelerator key="O" modifiers="GDK_CONTROL_MASK" signal="activate"/> + +		      <child internal-child="image"> +			<widget class="GtkImage" id="image432"> +			  <property name="visible">True</property> +			  <property name="stock">gtk-open</property> +			  <property name="icon_size">1</property> +			  <property name="xalign">0.5</property> +			  <property name="yalign">0.5</property> +			  <property name="xpad">0</property> +			  <property name="ypad">0</property> +			</widget> +		      </child> +		    </widget> +		  </child> + +		  <child> +		    <widget class="GtkImageMenuItem" id="edit"> +		      <property name="visible">True</property> +		      <property name="tooltip" translatable="yes">Edit a MIXAL source file</property> +		      <property name="label" translatable="yes">_Edit...</property> +		      <property name="use_underline">True</property> +		      <signal name="activate" handler="on_file_edit_activate"/> +		      <accelerator key="E" modifiers="GDK_CONTROL_MASK" signal="activate"/> + +		      <child internal-child="image"> +			<widget class="GtkImage" id="image433"> +			  <property name="visible">True</property> +			  <property name="stock">gtk-justify-fill</property> +			  <property name="icon_size">1</property> +			  <property name="xalign">0.5</property> +			  <property name="yalign">0.5</property> +			  <property name="xpad">0</property> +			  <property name="ypad">0</property> +			</widget> +		      </child> +		    </widget> +		  </child> + +		  <child> +		    <widget class="GtkImageMenuItem" id="compile"> +		      <property name="visible">True</property> +		      <property name="tooltip" translatable="yes">Compile a MIXAL source file</property> +		      <property name="label" translatable="yes">_Compile...</property> +		      <property name="use_underline">True</property> +		      <signal name="activate" handler="on_file_compile_activate"/> +		      <accelerator key="B" modifiers="GDK_CONTROL_MASK" signal="activate"/> + +		      <child internal-child="image"> +			<widget class="GtkImage" id="image434"> +			  <property name="visible">True</property> +			  <property name="stock">gtk-execute</property> +			  <property name="icon_size">1</property> +			  <property name="xalign">0.5</property> +			  <property name="yalign">0.5</property> +			  <property name="xpad">0</property> +			  <property name="ypad">0</property> +			</widget> +		      </child> +		    </widget> +		  </child> + +		  <child> +		    <widget class="GtkSeparatorMenuItem" id="separator2"> +		      <property name="visible">True</property> +		    </widget> +		  </child> + +		  <child> +		    <widget class="GtkImageMenuItem" id="file_exit"> +		      <property name="visible">True</property> +		      <property name="tooltip" translatable="yes">Exit application</property> +		      <property name="label" translatable="yes">E_xit</property> +		      <property name="use_underline">True</property> +		      <signal name="activate" handler="on_file_exit_activate"/> +		      <accelerator key="Q" modifiers="GDK_CONTROL_MASK | GDK_MOD1_MASK" signal="activate"/> + +		      <child internal-child="image"> +			<widget class="GtkImage" id="image435"> +			  <property name="visible">True</property> +			  <property name="stock">gtk-quit</property> +			  <property name="icon_size">1</property> +			  <property name="xalign">0.5</property> +			  <property name="yalign">0.5</property> +			  <property name="xpad">0</property> +			  <property name="ypad">0</property> +			</widget> +		      </child> +		    </widget> +		  </child> +		</widget> +	      </child> +	    </widget> +	  </child> + +	  <child> +	    <widget class="GtkMenuItem" id="debug"> +	      <property name="visible">True</property> +	      <property name="label" translatable="yes">De_bug</property> +	      <property name="use_underline">True</property> + +	      <child> +		<widget class="GtkMenu" id="debug_menu"> + +		  <child> +		    <widget class="GtkImageMenuItem" id="debug_run"> +		      <property name="visible">True</property> +		      <property name="tooltip" translatable="yes">Run program</property> +		      <property name="label" translatable="yes">_Run</property> +		      <property name="use_underline">True</property> +		      <signal name="activate" handler="on_debug_run_activate"/> +		      <accelerator key="R" modifiers="GDK_CONTROL_MASK" signal="activate"/> + +		      <child internal-child="image"> +			<widget class="GtkImage" id="image436"> +			  <property name="visible">True</property> +			  <property name="stock">gtk-go-forward</property> +			  <property name="icon_size">1</property> +			  <property name="xalign">0.5</property> +			  <property name="yalign">0.5</property> +			  <property name="xpad">0</property> +			  <property name="ypad">0</property> +			</widget> +		      </child> +		    </widget> +		  </child> + +		  <child> +		    <widget class="GtkImageMenuItem" id="debug_next"> +		      <property name="visible">True</property> +		      <property name="tooltip" translatable="yes">Execute next instruction</property> +		      <property name="label" translatable="yes">_Next</property> +		      <property name="use_underline">True</property> +		      <signal name="activate" handler="on_debug_next_activate"/> +		      <accelerator key="N" modifiers="GDK_CONTROL_MASK" signal="activate"/> + +		      <child internal-child="image"> +			<widget class="GtkImage" id="image437"> +			  <property name="visible">True</property> +			  <property name="stock">gtk-goto-last</property> +			  <property name="icon_size">1</property> +			  <property name="xalign">0.5</property> +			  <property name="yalign">0.5</property> +			  <property name="xpad">0</property> +			  <property name="ypad">0</property> +			</widget> +		      </child> +		    </widget> +		  </child> + +		  <child> +		    <widget class="GtkImageMenuItem" id="clear_breakpoints"> +		      <property name="visible">True</property> +		      <property name="tooltip" translatable="yes">Clear all set breakpoints</property> +		      <property name="label" translatable="yes">_Clear breakpoints</property> +		      <property name="use_underline">True</property> +		      <signal name="activate" handler="on_clear_breakpoints_activate"/> +		      <accelerator key="C" modifiers="GDK_CONTROL_MASK" signal="activate"/> + +		      <child internal-child="image"> +			<widget class="GtkImage" id="image438"> +			  <property name="visible">True</property> +			  <property name="stock">gtk-clear</property> +			  <property name="icon_size">1</property> +			  <property name="xalign">0.5</property> +			  <property name="yalign">0.5</property> +			  <property name="xpad">0</property> +			  <property name="ypad">0</property> +			</widget> +		      </child> +		    </widget> +		  </child> + +		  <child> +		    <widget class="GtkImageMenuItem" id="symbols"> +		      <property name="visible">True</property> +		      <property name="tooltip" translatable="yes">Show the symbol table</property> +		      <property name="label" translatable="yes">_Symbols...</property> +		      <property name="use_underline">True</property> +		      <signal name="activate" handler="on_symbols_activate"/> +		      <accelerator key="Y" modifiers="GDK_CONTROL_MASK" signal="activate"/> + +		      <child internal-child="image"> +			<widget class="GtkImage" id="image439"> +			  <property name="visible">True</property> +			  <property name="stock">gtk-index</property> +			  <property name="icon_size">1</property> +			  <property name="xalign">0.5</property> +			  <property name="yalign">0.5</property> +			  <property name="xpad">0</property> +			  <property name="ypad">0</property> +			</widget> +		      </child> +		    </widget> +		  </child> +		</widget> +	      </child> +	    </widget> +	  </child> + +	  <child> +	    <widget class="GtkMenuItem" id="view1"> +	      <property name="visible">True</property> +	      <property name="label" translatable="yes">Vie_w</property> +	      <property name="use_underline">True</property> + +	      <child> +		<widget class="GtkMenu" id="view1_menu"> + +		  <child> +		    <widget class="GtkCheckMenuItem" id="show_toolbars"> +		      <property name="visible">True</property> +		      <property name="label" translatable="yes">_Toolbars</property> +		      <property name="use_underline">True</property> +		      <property name="active">False</property> +		    </widget> +		  </child> + +		  <child> +		    <widget class="GtkImageMenuItem" id=" "> +		      <property name="visible">True</property> +		      <property name="label" translatable="yes">_Detached windows</property> +		      <property name="use_underline">True</property> + +		      <child internal-child="image"> +			<widget class="GtkImage" id="image440"> +			  <property name="visible">True</property> +			  <property name="stock">gtk-dnd-multiple</property> +			  <property name="icon_size">1</property> +			  <property name="xalign">0.5</property> +			  <property name="yalign">0.5</property> +			  <property name="xpad">0</property> +			  <property name="ypad">0</property> +			</widget> +		      </child> + +		      <child> +			<widget class="GtkMenu" id=" _menu"> + +			  <child> +			    <widget class="GtkCheckMenuItem" id="detach_vm"> +			      <property name="visible">True</property> +			      <property name="label" translatable="yes">_Virtual machine</property> +			      <property name="use_underline">True</property> +			      <property name="active">False</property> +			    </widget> +			  </child> + +			  <child> +			    <widget class="GtkCheckMenuItem" id="detach_source"> +			      <property name="visible">True</property> +			      <property name="label" translatable="yes">_Source</property> +			      <property name="use_underline">True</property> +			      <property name="active">False</property> +			    </widget> +			  </child> + +			  <child> +			    <widget class="GtkCheckMenuItem" id="detach_dev"> +			      <property name="visible">True</property> +			      <property name="label" translatable="yes">_Devices</property> +			      <property name="use_underline">True</property> +			      <property name="active">False</property> +			    </widget> +			  </child> +			</widget> +		      </child> +		    </widget> +		  </child> +		</widget> +	      </child> +	    </widget> +	  </child> + +	  <child> +	    <widget class="GtkMenuItem" id="settings2"> +	      <property name="visible">True</property> +	      <property name="label" translatable="yes">S_ettings</property> +	      <property name="use_underline">True</property> + +	      <child> +		<widget class="GtkMenu" id="settings2_menu"> + +		  <child> +		    <widget class="GtkImageMenuItem" id="fonts1"> +		      <property name="visible">True</property> +		      <property name="label" translatable="yes">Change _font</property> +		      <property name="use_underline">True</property> + +		      <child internal-child="image"> +			<widget class="GtkImage" id="image441"> +			  <property name="visible">True</property> +			  <property name="stock">gtk-select-font</property> +			  <property name="icon_size">1</property> +			  <property name="xalign">0.5</property> +			  <property name="yalign">0.5</property> +			  <property name="xpad">0</property> +			  <property name="ypad">0</property> +			</widget> +		      </child> + +		      <child> +			<widget class="GtkMenu" id="fonts1_menu"> + +			  <child> +			    <widget class="GtkMenuItem" id="mix"> +			      <property name="visible">True</property> +			      <property name="label" translatable="yes">_Virtual machine</property> +			      <property name="use_underline">True</property> +			      <signal name="activate" handler="on_mix_font_activate"/> +			    </widget> +			  </child> + +			  <child> +			    <widget class="GtkMenuItem" id="mixal"> +			      <property name="visible">True</property> +			      <property name="label" translatable="yes">_Source</property> +			      <property name="use_underline">True</property> +			      <signal name="activate" handler="on_mixal_font_activate"/> +			    </widget> +			  </child> + +			  <child> +			    <widget class="GtkMenuItem" id="command_prompt"> +			      <property name="visible">True</property> +			      <property name="label" translatable="yes">Command _prompt</property> +			      <property name="use_underline">True</property> +			      <signal name="activate" handler="on_prompt_font_activate"/> +			    </widget> +			  </child> + +			  <child> +			    <widget class="GtkMenuItem" id="command_log"> +			      <property name="visible">True</property> +			      <property name="label" translatable="yes">Command l_og</property> +			      <property name="use_underline">True</property> +			      <signal name="activate" handler="on_log_font_activate"/> +			    </widget> +			  </child> + +			  <child> +			    <widget class="GtkMenuItem" id="devices"> +			      <property name="visible">True</property> +			      <property name="label" translatable="yes">_Devices</property> +			      <property name="use_underline">True</property> +			      <signal name="activate" handler="on_devices_font_activate"/> +			    </widget> +			  </child> + +			  <child> +			    <widget class="GtkMenuItem" id="symbol_list"> +			      <property name="visible">True</property> +			      <property name="label" translatable="yes">Symbol _list</property> +			      <property name="use_underline">True</property> +			      <signal name="activate" handler="on_symbols_font_activate" last_modification_time="Sun, 04 Jul 2004 23:03:55 GMT"/> +			    </widget> +			  </child> + +			  <child> +			    <widget class="GtkSeparatorMenuItem" id="separator4"> +			      <property name="visible">True</property> +			    </widget> +			  </child> + +			  <child> +			    <widget class="GtkMenuItem" id="all_fonts"> +			      <property name="visible">True</property> +			      <property name="tooltip" translatable="yes">Change all fonts at once</property> +			      <property name="label" translatable="yes">_All</property> +			      <property name="use_underline">True</property> +			      <signal name="activate" handler="on_all_fonts_activate" last_modification_time="Sat, 03 Jul 2004 00:34:07 GMT"/> +			    </widget> +			  </child> +			</widget> +		      </child> +		    </widget> +		  </child> + +		  <child> +		    <widget class="GtkImageMenuItem" id="device_output1"> +		      <property name="visible">True</property> +		      <property name="tooltip" translatable="yes">Change format of binary devices output</property> +		      <property name="label" translatable="yes">_Device output...</property> +		      <property name="use_underline">True</property> +		      <signal name="activate" handler="on_devform_activate"/> + +		      <child internal-child="image"> +			<widget class="GtkImage" id="image442"> +			  <property name="visible">True</property> +			  <property name="stock">gtk-zoom-100</property> +			  <property name="icon_size">1</property> +			  <property name="xalign">0.5</property> +			  <property name="yalign">0.5</property> +			  <property name="xpad">0</property> +			  <property name="ypad">0</property> +			</widget> +		      </child> +		    </widget> +		  </child> + +		  <child> +		    <widget class="GtkImageMenuItem" id="devices_dir"> +		      <property name="visible">True</property> +		      <property name="label" translatable="yes">De_vices dir...</property> +		      <property name="use_underline">True</property> +		      <signal name="activate" handler="on_devdir_activate"/> + +		      <child internal-child="image"> +			<widget class="GtkImage" id="image443"> +			  <property name="visible">True</property> +			  <property name="stock">gtk-home</property> +			  <property name="icon_size">1</property> +			  <property name="xalign">0.5</property> +			  <property name="yalign">0.5</property> +			  <property name="xpad">0</property> +			  <property name="ypad">0</property> +			</widget> +		      </child> +		    </widget> +		  </child> + +		  <child> +		    <widget class="GtkImageMenuItem" id="external_programs1"> +		      <property name="visible">True</property> +		      <property name="label" translatable="yes">E_xternal programs...</property> +		      <property name="use_underline">True</property> +		      <signal name="activate" handler="on_external_programs_activate"/> + +		      <child internal-child="image"> +			<widget class="GtkImage" id="image444"> +			  <property name="visible">True</property> +			  <property name="stock">gtk-preferences</property> +			  <property name="icon_size">1</property> +			  <property name="xalign">0.5</property> +			  <property name="yalign">0.5</property> +			  <property name="xpad">0</property> +			  <property name="ypad">0</property> +			</widget> +		      </child> +		    </widget> +		  </child> + +		  <child> +		    <widget class="GtkSeparatorMenuItem" id="separator3"> +		      <property name="visible">True</property> +		    </widget> +		  </child> + +		  <child> +		    <widget class="GtkImageMenuItem" id="save"> +		      <property name="visible">True</property> +		      <property name="tooltip" translatable="yes">Save current settings</property> +		      <property name="label" translatable="yes">_Save</property> +		      <property name="use_underline">True</property> +		      <signal name="activate" handler="on_save_activate"/> + +		      <child internal-child="image"> +			<widget class="GtkImage" id="image445"> +			  <property name="visible">True</property> +			  <property name="stock">gtk-save</property> +			  <property name="icon_size">1</property> +			  <property name="xalign">0.5</property> +			  <property name="yalign">0.5</property> +			  <property name="xpad">0</property> +			  <property name="ypad">0</property> +			</widget> +		      </child> +		    </widget> +		  </child> + +		  <child> +		    <widget class="GtkCheckMenuItem" id="save_on_exit"> +		      <property name="visible">True</property> +		      <property name="tooltip" translatable="yes">Toogle save settings on exit</property> +		      <property name="label" translatable="yes">Save on _exit</property> +		      <property name="use_underline">True</property> +		      <property name="active">False</property> +		      <signal name="toggled" handler="on_save_on_exit_toggle"/> +		    </widget> +		  </child> +		</widget> +	      </child> +	    </widget> +	  </child> + +	  <child> +	    <widget class="GtkMenuItem" id="help"> +	      <property name="visible">True</property> +	      <property name="label" translatable="yes">_Help</property> +	      <property name="use_underline">True</property> + +	      <child> +		<widget class="GtkMenu" id="help_menu"> + +		  <child> +		    <widget class="GtkImageMenuItem" id="about"> +		      <property name="visible">True</property> +		      <property name="label" translatable="yes">_About...</property> +		      <property name="use_underline">True</property> +		      <signal name="activate" handler="on_about_activate"/> + +		      <child internal-child="image"> +			<widget class="GtkImage" id="image446"> +			  <property name="visible">True</property> +			  <property name="stock">gtk-help</property> +			  <property name="icon_size">1</property> +			  <property name="xalign">0.5</property> +			  <property name="yalign">0.5</property> +			  <property name="xpad">0</property> +			  <property name="ypad">0</property> +			</widget> +		      </child> +		    </widget> +		  </child> +		</widget> +	      </child> +	    </widget> +	  </child> +	</widget> +	<packing> +	  <property name="padding">0</property> +	  <property name="expand">False</property> +	  <property name="fill">True</property> +	</packing> +      </child> + +      <child> +	<widget class="GtkHandleBox" id="tb_handle"> +	  <property name="visible">True</property> +	  <property name="shadow_type">GTK_SHADOW_OUT</property> +	  <property name="handle_position">GTK_POS_LEFT</property> +	  <property name="snap_edge">GTK_POS_TOP</property> + +	  <child> +	    <widget class="GtkToolbar" id="main_toolbar"> +	      <property name="visible">True</property> +	      <property name="orientation">GTK_ORIENTATION_HORIZONTAL</property> +	      <property name="toolbar_style">GTK_TOOLBAR_ICONS</property> +	      <property name="tooltips">True</property> +	      <property name="show_arrow">True</property> + +	      <child> +		<widget class="GtkToolButton" id="load_button"> +		  <property name="visible">True</property> +		  <property name="tooltip" translatable="yes">Load MIX program</property> +		  <property name="label" translatable="yes">Open</property> +		  <property name="use_underline">True</property> +		  <property name="stock_id">gtk-open</property> +		  <property name="visible_horizontal">True</property> +		  <property name="visible_vertical">True</property> +		  <property name="is_important">True</property> +		  <signal name="clicked" handler="on_file_open_activate"/> +		</widget> +		<packing> +		  <property name="expand">False</property> +		  <property name="homogeneous">True</property> +		</packing> +	      </child> + +	      <child> +		<widget class="GtkToolButton" id="compile_button"> +		  <property name="visible">True</property> +		  <property name="tooltip" translatable="yes">Compile MIXAL source</property> +		  <property name="label" translatable="yes">Compile</property> +		  <property name="use_underline">True</property> +		  <property name="stock_id">gtk-execute</property> +		  <property name="visible_horizontal">True</property> +		  <property name="visible_vertical">True</property> +		  <property name="is_important">True</property> +		  <signal name="clicked" handler="on_file_compile_activate"/> +		</widget> +		<packing> +		  <property name="expand">False</property> +		  <property name="homogeneous">True</property> +		</packing> +	      </child> + +	      <child> +		<widget class="GtkToolButton" id="edit_button"> +		  <property name="visible">True</property> +		  <property name="tooltip" translatable="yes">Edit MIXAL source</property> +		  <property name="label" translatable="yes">Edit</property> +		  <property name="use_underline">True</property> +		  <property name="stock_id">gtk-justify-fill</property> +		  <property name="visible_horizontal">True</property> +		  <property name="visible_vertical">True</property> +		  <property name="is_important">True</property> +		  <signal name="clicked" handler="on_file_edit_activate"/> +		</widget> +		<packing> +		  <property name="expand">False</property> +		  <property name="homogeneous">True</property> +		</packing> +	      </child> + +	      <child> +		<widget class="GtkToolButton" id="run_button"> +		  <property name="visible">True</property> +		  <property name="tooltip" translatable="yes">Run</property> +		  <property name="label" translatable="yes">Run</property> +		  <property name="use_underline">True</property> +		  <property name="stock_id">gtk-go-forward</property> +		  <property name="visible_horizontal">True</property> +		  <property name="visible_vertical">True</property> +		  <property name="is_important">True</property> +		  <signal name="clicked" handler="on_debug_run_activate"/> +		</widget> +		<packing> +		  <property name="expand">False</property> +		  <property name="homogeneous">True</property> +		</packing> +	      </child> + +	      <child> +		<widget class="GtkToolButton" id="step_button"> +		  <property name="visible">True</property> +		  <property name="tooltip" translatable="yes">Next</property> +		  <property name="label" translatable="yes">Next</property> +		  <property name="use_underline">True</property> +		  <property name="stock_id">gtk-goto-last</property> +		  <property name="visible_horizontal">True</property> +		  <property name="visible_vertical">True</property> +		  <property name="is_important">True</property> +		  <signal name="clicked" handler="on_debug_next_activate"/> +		</widget> +		<packing> +		  <property name="expand">False</property> +		  <property name="homogeneous">True</property> +		</packing> +	      </child> + +	      <child> +		<widget class="GtkToolButton" id="clear_button"> +		  <property name="visible">True</property> +		  <property name="tooltip" translatable="yes">Clear breakpoints</property> +		  <property name="label" translatable="yes">Clear</property> +		  <property name="use_underline">True</property> +		  <property name="stock_id">gtk-clear</property> +		  <property name="visible_horizontal">True</property> +		  <property name="visible_vertical">True</property> +		  <property name="is_important">True</property> +		  <signal name="clicked" handler="on_clear_breakpoints_activate"/> +		</widget> +		<packing> +		  <property name="expand">False</property> +		  <property name="homogeneous">True</property> +		</packing> +	      </child> + +	      <child> +		<widget class="GtkToolButton" id="symbols_button"> +		  <property name="visible">True</property> +		  <property name="tooltip" translatable="yes">Symbol table</property> +		  <property name="label" translatable="yes">Symbols</property> +		  <property name="use_underline">True</property> +		  <property name="stock_id">gtk-index</property> +		  <property name="visible_horizontal">True</property> +		  <property name="visible_vertical">True</property> +		  <property name="is_important">True</property> +		  <signal name="clicked" handler="on_symbols_activate"/> +		</widget> +		<packing> +		  <property name="expand">False</property> +		  <property name="homogeneous">True</property> +		</packing> +	      </child> + +	      <child> +		<widget class="GtkSeparatorToolItem" id="separatortoolitem2"> +		  <property name="visible">True</property> +		  <property name="draw">True</property> +		  <property name="visible_horizontal">True</property> +		  <property name="visible_vertical">True</property> +		</widget> +		<packing> +		  <property name="expand">False</property> +		  <property name="homogeneous">False</property> +		</packing> +	      </child> + +	      <child> +		<widget class="GtkToolButton" id="button28"> +		  <property name="visible">True</property> +		  <property name="tooltip" translatable="yes">Device directory</property> +		  <property name="label" translatable="yes">Devdir</property> +		  <property name="use_underline">True</property> +		  <property name="stock_id">gtk-home</property> +		  <property name="visible_horizontal">True</property> +		  <property name="visible_vertical">True</property> +		  <property name="is_important">False</property> +		  <signal name="clicked" handler="on_devdir_activate"/> +		</widget> +		<packing> +		  <property name="expand">False</property> +		  <property name="homogeneous">True</property> +		</packing> +	      </child> + +	      <child> +		<widget class="GtkToolButton" id="button30"> +		  <property name="visible">True</property> +		  <property name="tooltip" translatable="yes">Output format</property> +		  <property name="label" translatable="yes">Format</property> +		  <property name="use_underline">True</property> +		  <property name="stock_id">gtk-zoom-100</property> +		  <property name="visible_horizontal">True</property> +		  <property name="visible_vertical">True</property> +		  <property name="is_important">False</property> +		  <signal name="clicked" handler="on_devform_activate"/> +		</widget> +		<packing> +		  <property name="expand">False</property> +		  <property name="homogeneous">True</property> +		</packing> +	      </child> + +	      <child> +		<widget class="GtkToolButton" id="button31"> +		  <property name="visible">True</property> +		  <property name="tooltip" translatable="yes">External programs</property> +		  <property name="label" translatable="yes">Programs</property> +		  <property name="use_underline">True</property> +		  <property name="stock_id">gtk-properties</property> +		  <property name="visible_horizontal">True</property> +		  <property name="visible_vertical">True</property> +		  <property name="is_important">False</property> +		  <signal name="clicked" handler="on_external_programs_activate"/> +		</widget> +		<packing> +		  <property name="expand">False</property> +		  <property name="homogeneous">True</property> +		</packing> +	      </child> + +	      <child> +		<widget class="GtkSeparatorToolItem" id="separatortoolitem8"> +		  <property name="visible">True</property> +		  <property name="draw">True</property> +		  <property name="visible_horizontal">True</property> +		  <property name="visible_vertical">True</property> +		</widget> +		<packing> +		  <property name="expand">False</property> +		  <property name="homogeneous">False</property> +		</packing> +	      </child> + +	      <child> +		<widget class="GtkToolButton" id="dettach_button"> +		  <property name="visible">True</property> +		  <property name="tooltip" translatable="yes">Detach window</property> +		  <property name="label" translatable="yes">Detach</property> +		  <property name="use_underline">True</property> +		  <property name="stock_id">gtk-dnd-multiple</property> +		  <property name="visible_horizontal">True</property> +		  <property name="visible_vertical">True</property> +		  <property name="is_important">False</property> +		  <signal name="clicked" handler="on_detach_clicked" last_modification_time="Tue, 29 Jun 2004 22:14:37 GMT"/> +		</widget> +		<packing> +		  <property name="expand">False</property> +		  <property name="homogeneous">True</property> +		</packing> +	      </child> + +	      <child> +		<widget class="GtkToolButton" id="attach_button"> +		  <property name="visible">True</property> +		  <property name="tooltip" translatable="yes">Attach all windows</property> +		  <property name="label" translatable="yes"></property> +		  <property name="use_underline">True</property> +		  <property name="stock_id">gtk-dnd</property> +		  <property name="visible_horizontal">True</property> +		  <property name="visible_vertical">True</property> +		  <property name="is_important">True</property> +		  <signal name="clicked" handler="on_attach_all_clicked" last_modification_time="Thu, 01 Jul 2004 22:00:12 GMT"/> +		</widget> +		<packing> +		  <property name="expand">False</property> +		  <property name="homogeneous">True</property> +		</packing> +	      </child> +	    </widget> +	  </child> +	</widget> +	<packing> +	  <property name="padding">3</property> +	  <property name="expand">False</property> +	  <property name="fill">False</property> +	</packing> +      </child> + +      <child> +	<widget class="GtkVPaned" id="main_panel"> +	  <property name="visible">True</property> +	  <property name="can_focus">True</property> +	  <property name="position">1</property> + +	  <child> +	    <widget class="GtkNotebook" id="main_notebook"> +	      <property name="visible">True</property> +	      <property name="can_focus">True</property> +	      <property name="show_tabs">True</property> +	      <property name="show_border">True</property> +	      <property name="tab_pos">GTK_POS_TOP</property> +	      <property name="scrollable">False</property> +	      <property name="enable_popup">False</property> +	    </widget> +	    <packing> +	      <property name="shrink">False</property> +	      <property name="resize">True</property> +	    </packing> +	  </child> + +	  <child> +	    <widget class="GtkVBox" id="prompt_vbox"> +	      <property name="visible">True</property> +	      <property name="homogeneous">False</property> +	      <property name="spacing">0</property> + +	      <child> +		<widget class="GtkScrolledWindow" id="mixlog_scrolledwindow"> +		  <property name="visible">True</property> +		  <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property> +		  <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property> +		  <property name="shadow_type">GTK_SHADOW_IN</property> +		  <property name="window_placement">GTK_CORNER_TOP_LEFT</property> + +		  <child> +		    <widget class="GtkTextView" id="command_log"> +		      <property name="visible">True</property> +		      <property name="editable">False</property> +		      <property name="overwrite">False</property> +		      <property name="accepts_tab">True</property> +		      <property name="justification">GTK_JUSTIFY_LEFT</property> +		      <property name="wrap_mode">GTK_WRAP_WORD</property> +		      <property name="cursor_visible">True</property> +		      <property name="pixels_above_lines">0</property> +		      <property name="pixels_below_lines">0</property> +		      <property name="pixels_inside_wrap">0</property> +		      <property name="left_margin">3</property> +		      <property name="right_margin">4</property> +		      <property name="indent">0</property> +		      <property name="text" translatable="yes"></property> +		    </widget> +		  </child> +		</widget> +		<packing> +		  <property name="padding">0</property> +		  <property name="expand">True</property> +		  <property name="fill">True</property> +		</packing> +	      </child> + +	      <child> +		<widget class="GtkEntry" id="command_prompt"> +		  <property name="visible">True</property> +		  <property name="tooltip" translatable="yes">Enter MIXVM command here</property> +		  <property name="can_focus">True</property> +		  <property name="has_focus">True</property> +		  <property name="editable">True</property> +		  <property name="visibility">True</property> +		  <property name="max_length">0</property> +		  <property name="text" translatable="yes"></property> +		  <property name="has_frame">True</property> +		  <property name="invisible_char" translatable="yes">*</property> +		  <property name="activates_default">False</property> +		  <signal name="key_press_event" handler="on_command_prompt_key_press_event" after="yes"/> +		  <signal name="activate" handler="on_command_prompt_activate" last_modification_time="Sat, 19 Jun 2004 00:00:22 GMT"/> +		</widget> +		<packing> +		  <property name="padding">0</property> +		  <property name="expand">False</property> +		  <property name="fill">False</property> +		</packing> +	      </child> +	    </widget> +	    <packing> +	      <property name="shrink">True</property> +	      <property name="resize">True</property> +	    </packing> +	  </child> +	</widget> +	<packing> +	  <property name="padding">0</property> +	  <property name="expand">True</property> +	  <property name="fill">True</property> +	</packing> +      </child> + +      <child> +	<widget class="GtkStatusbar" id="main_statusbar"> +	  <property name="visible">True</property> +	  <property name="has_resize_grip">True</property> +	</widget> +	<packing> +	  <property name="padding">0</property> +	  <property name="expand">False</property> +	  <property name="fill">False</property> +	</packing> +      </child> +    </widget> +  </child> +</widget> + +<widget class="GtkDialog" id="word_dialog"> +  <property name="title" translatable="yes">Enter value</property> +  <property name="type">GTK_WINDOW_TOPLEVEL</property> +  <property name="window_position">GTK_WIN_POS_NONE</property> +  <property name="modal">True</property> +  <property name="resizable">False</property> +  <property name="destroy_with_parent">False</property> +  <property name="decorated">True</property> +  <property name="skip_taskbar_hint">False</property> +  <property name="skip_pager_hint">False</property> +  <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property> +  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> +  <property name="has_separator">True</property> +  <signal name="destroy" handler="gtk_widget_hide"/> +  <signal name="destroy_event" handler="gtk_widget_hide"/> +  <signal name="delete_event" handler="gtk_widget_hide"/> + +  <child internal-child="vbox"> +    <widget class="GtkVBox" id="dialog-vbox5"> +      <property name="visible">True</property> +      <property name="homogeneous">False</property> +      <property name="spacing">0</property> + +      <child internal-child="action_area"> +	<widget class="GtkHButtonBox" id="dialog-action_area5"> +	  <property name="visible">True</property> +	  <property name="layout_style">GTK_BUTTONBOX_END</property> + +	  <child> +	    <widget class="GtkButton" id="word_cancel"> +	      <property name="visible">True</property> +	      <property name="can_default">True</property> +	      <property name="can_focus">True</property> +	      <property name="label">gtk-cancel</property> +	      <property name="use_stock">True</property> +	      <property name="relief">GTK_RELIEF_NORMAL</property> +	      <property name="focus_on_click">True</property> +	      <property name="response_id">-6</property> +	      <signal name="clicked" handler="on_word_cancel_clicked" last_modification_time="Thu, 01 Jul 2004 22:25:09 GMT"/> +	    </widget> +	  </child> + +	  <child> +	    <widget class="GtkButton" id="word_reset"> +	      <property name="visible">True</property> +	      <property name="can_default">True</property> +	      <property name="can_focus">True</property> +	      <property name="label">gtk-clear</property> +	      <property name="use_stock">True</property> +	      <property name="relief">GTK_RELIEF_NORMAL</property> +	      <property name="focus_on_click">False</property> +	      <property name="response_id">0</property> +	      <signal name="clicked" handler="on_word_reset_clicked" last_modification_time="Thu, 01 Jul 2004 22:28:00 GMT"/> +	    </widget> +	  </child> + +	  <child> +	    <widget class="GtkButton" id="word_ok"> +	      <property name="visible">True</property> +	      <property name="can_default">True</property> +	      <property name="can_focus">True</property> +	      <property name="label">gtk-ok</property> +	      <property name="use_stock">True</property> +	      <property name="relief">GTK_RELIEF_NORMAL</property> +	      <property name="focus_on_click">True</property> +	      <property name="response_id">-5</property> +	      <signal name="clicked" handler="on_word_ok_clicked" last_modification_time="Thu, 01 Jul 2004 22:26:25 GMT"/> +	    </widget> +	  </child> +	</widget> +	<packing> +	  <property name="padding">0</property> +	  <property name="expand">False</property> +	  <property name="fill">False</property> +	  <property name="pack_type">GTK_PACK_END</property> +	</packing> +      </child> + +      <child> +	<widget class="GtkFixed" id="word_layout"> +	  <property name="border_width">5</property> +	  <property name="visible">True</property> + +	  <child> +	    <widget class="GtkEntry" id="word_decimal"> +	      <property name="width_request">0</property> +	      <property name="height_request">0</property> +	      <property name="visible">True</property> +	      <property name="can_focus">True</property> +	      <property name="has_focus">True</property> +	      <property name="events">GDK_KEY_PRESS_MASK</property> +	      <property name="editable">True</property> +	      <property name="visibility">True</property> +	      <property name="max_length">0</property> +	      <property name="text" translatable="yes">0</property> +	      <property name="has_frame">True</property> +	      <property name="invisible_char" translatable="yes">*</property> +	      <property name="activates_default">False</property> +	      <property name="width_chars">28</property> +	      <signal name="changed" handler="on_word_dec_changed" after="yes" last_modification_time="Sun, 20 Jun 2004 23:47:46 GMT"/> +	    </widget> +	    <packing> +	      <property name="x">88</property> +	      <property name="y">64</property> +	    </packing> +	  </child> + +	  <child> +	    <widget class="GtkEntry" id="word_b2"> +	      <property name="width_request">0</property> +	      <property name="height_request">0</property> +	      <property name="visible">True</property> +	      <property name="can_focus">True</property> +	      <property name="events">GDK_KEY_PRESS_MASK</property> +	      <property name="editable">True</property> +	      <property name="visibility">True</property> +	      <property name="max_length">2</property> +	      <property name="text" translatable="yes">0</property> +	      <property name="has_frame">True</property> +	      <property name="invisible_char" translatable="yes">*</property> +	      <property name="activates_default">False</property> +	      <property name="width_chars">3</property> +	      <signal name="changed" handler="on_word_byte_changed" last_modification_time="Sun, 20 Jun 2004 23:20:10 GMT"/> +	    </widget> +	    <packing> +	      <property name="x">144</property> +	      <property name="y">32</property> +	    </packing> +	  </child> + +	  <child> +	    <widget class="GtkEntry" id="word_b3"> +	      <property name="width_request">0</property> +	      <property name="height_request">0</property> +	      <property name="visible">True</property> +	      <property name="can_focus">True</property> +	      <property name="events">GDK_BUTTON_PRESS_MASK</property> +	      <property name="editable">True</property> +	      <property name="visibility">True</property> +	      <property name="max_length">2</property> +	      <property name="text" translatable="yes">0</property> +	      <property name="has_frame">True</property> +	      <property name="invisible_char" translatable="yes">*</property> +	      <property name="activates_default">False</property> +	      <property name="width_chars">3</property> +	      <signal name="changed" handler="on_word_byte_changed" last_modification_time="Sun, 20 Jun 2004 23:20:28 GMT"/> +	    </widget> +	    <packing> +	      <property name="x">176</property> +	      <property name="y">32</property> +	    </packing> +	  </child> + +	  <child> +	    <widget class="GtkEntry" id="word_b4"> +	      <property name="width_request">0</property> +	      <property name="height_request">0</property> +	      <property name="visible">True</property> +	      <property name="can_focus">True</property> +	      <property name="events">GDK_KEY_PRESS_MASK</property> +	      <property name="editable">True</property> +	      <property name="visibility">True</property> +	      <property name="max_length">2</property> +	      <property name="text" translatable="yes">0</property> +	      <property name="has_frame">True</property> +	      <property name="invisible_char" translatable="yes">*</property> +	      <property name="activates_default">False</property> +	      <property name="width_chars">3</property> +	      <signal name="changed" handler="on_word_byte_changed" last_modification_time="Sun, 20 Jun 2004 23:20:57 GMT"/> +	    </widget> +	    <packing> +	      <property name="x">208</property> +	      <property name="y">32</property> +	    </packing> +	  </child> + +	  <child> +	    <widget class="GtkEntry" id="word_b5"> +	      <property name="width_request">0</property> +	      <property name="height_request">0</property> +	      <property name="visible">True</property> +	      <property name="can_focus">True</property> +	      <property name="events">GDK_KEY_PRESS_MASK</property> +	      <property name="editable">True</property> +	      <property name="visibility">True</property> +	      <property name="max_length">2</property> +	      <property name="text" translatable="yes">0</property> +	      <property name="has_frame">True</property> +	      <property name="invisible_char" translatable="yes">*</property> +	      <property name="activates_default">False</property> +	      <property name="width_chars">3</property> +	      <signal name="changed" handler="on_word_byte_changed" last_modification_time="Sun, 20 Jun 2004 23:21:18 GMT"/> +	    </widget> +	    <packing> +	      <property name="x">238</property> +	      <property name="y">32</property> +	    </packing> +	  </child> + +	  <child> +	    <widget class="GtkEntry" id="word_b1"> +	      <property name="width_request">0</property> +	      <property name="height_request">0</property> +	      <property name="visible">True</property> +	      <property name="can_focus">True</property> +	      <property name="events">GDK_KEY_PRESS_MASK</property> +	      <property name="editable">True</property> +	      <property name="visibility">True</property> +	      <property name="max_length">2</property> +	      <property name="text" translatable="yes">0</property> +	      <property name="has_frame">True</property> +	      <property name="invisible_char" translatable="yes">*</property> +	      <property name="activates_default">False</property> +	      <property name="width_chars">3</property> +	      <signal name="changed" handler="on_word_byte_changed" last_modification_time="Sun, 20 Jun 2004 23:19:50 GMT"/> +	    </widget> +	    <packing> +	      <property name="x">112</property> +	      <property name="y">32</property> +	    </packing> +	  </child> + +	  <child> +	    <widget class="GtkEntry" id="word_sign"> +	      <property name="width_request">0</property> +	      <property name="height_request">0</property> +	      <property name="visible">True</property> +	      <property name="can_focus">True</property> +	      <property name="events">GDK_KEY_PRESS_MASK</property> +	      <property name="editable">True</property> +	      <property name="visibility">True</property> +	      <property name="max_length">1</property> +	      <property name="text" translatable="yes">+</property> +	      <property name="has_frame">True</property> +	      <property name="invisible_char" translatable="yes">*</property> +	      <property name="activates_default">False</property> +	      <property name="width_chars">2</property> +	      <signal name="changed" handler="on_word_sign_changed" last_modification_time="Sun, 20 Jun 2004 23:19:23 GMT"/> +	    </widget> +	    <packing> +	      <property name="x">88</property> +	      <property name="y">32</property> +	    </packing> +	  </child> + +	  <child> +	    <widget class="GtkLabel" id="label60"> +	      <property name="width_request">0</property> +	      <property name="height_request">0</property> +	      <property name="visible">True</property> +	      <property name="label" translatable="yes">Decimal</property> +	      <property name="use_underline">False</property> +	      <property name="use_markup">False</property> +	      <property name="justify">GTK_JUSTIFY_CENTER</property> +	      <property name="wrap">False</property> +	      <property name="selectable">False</property> +	      <property name="xalign">0.5</property> +	      <property name="yalign">0.5</property> +	      <property name="xpad">0</property> +	      <property name="ypad">0</property> +	    </widget> +	    <packing> +	      <property name="x">14</property> +	      <property name="y">68</property> +	    </packing> +	  </child> + +	  <child> +	    <widget class="GtkLabel" id="label61"> +	      <property name="width_request">0</property> +	      <property name="height_request">0</property> +	      <property name="visible">True</property> +	      <property name="label" translatable="yes">Bytes</property> +	      <property name="use_underline">False</property> +	      <property name="use_markup">False</property> +	      <property name="justify">GTK_JUSTIFY_CENTER</property> +	      <property name="wrap">False</property> +	      <property name="selectable">False</property> +	      <property name="xalign">0.5</property> +	      <property name="yalign">0.5</property> +	      <property name="xpad">0</property> +	      <property name="ypad">0</property> +	    </widget> +	    <packing> +	      <property name="x">15</property> +	      <property name="y">36</property> +	    </packing> +	  </child> + +	  <child> +	    <widget class="GtkLabel" id="word_label"> +	      <property name="width_request">0</property> +	      <property name="height_request">0</property> +	      <property name="visible">True</property> +	      <property name="label" translatable="yes">Enter value</property> +	      <property name="use_underline">False</property> +	      <property name="use_markup">False</property> +	      <property name="justify">GTK_JUSTIFY_CENTER</property> +	      <property name="wrap">False</property> +	      <property name="selectable">False</property> +	      <property name="xalign">0.5</property> +	      <property name="yalign">0.5</property> +	      <property name="xpad">0</property> +	      <property name="ypad">0</property> +	    </widget> +	    <packing> +	      <property name="x">112</property> +	      <property name="y">8</property> +	    </packing> +	  </child> +	</widget> +	<packing> +	  <property name="padding">0</property> +	  <property name="expand">True</property> +	  <property name="fill">True</property> +	</packing> +      </child> +    </widget> +  </child> +</widget> + +<widget class="GtkWindow" id="about_dialog"> +  <property name="title" translatable="yes">MDK</property> +  <property name="type">GTK_WINDOW_TOPLEVEL</property> +  <property name="window_position">GTK_WIN_POS_CENTER</property> +  <property name="modal">True</property> +  <property name="default_width">250</property> +  <property name="default_height">150</property> +  <property name="resizable">True</property> +  <property name="destroy_with_parent">False</property> +  <property name="decorated">True</property> +  <property name="skip_taskbar_hint">False</property> +  <property name="skip_pager_hint">False</property> +  <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property> +  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> +  <signal name="delete_event" handler="gtk_widget_hide"/> +  <signal name="destroy_event" handler="gtk_widget_hide"/> +  <signal name="destroy" handler="gtk_widget_hide"/> + +  <child> +    <widget class="GtkLayout" id="layout1"> +      <property name="visible">True</property> +      <property name="width">250</property> +      <property name="height">150</property> +      <property name="hadjustment">0 0 250 0 225 250</property> +      <property name="vadjustment">0 0 150 0 135 150</property> + +      <child> +	<widget class="GtkLabel" id="label222"> +	  <property name="width_request">0</property> +	  <property name="height_request">0</property> +	  <property name="visible">True</property> +	  <property name="label" translatable="yes">GNU MIX Development Kit</property> +	  <property name="use_underline">False</property> +	  <property name="use_markup">False</property> +	  <property name="justify">GTK_JUSTIFY_CENTER</property> +	  <property name="wrap">False</property> +	  <property name="selectable">False</property> +	  <property name="xalign">0.5</property> +	  <property name="yalign">0.5</property> +	  <property name="xpad">0</property> +	  <property name="ypad">0</property> +	</widget> +	<packing> +	  <property name="x">56</property> +	  <property name="y">24</property> +	</packing> +      </child> + +      <child> +	<widget class="GtkLabel" id="version_label"> +	  <property name="width_request">52</property> +	  <property name="height_request">16</property> +	  <property name="visible">True</property> +	  <property name="label" translatable="yes">label223</property> +	  <property name="use_underline">False</property> +	  <property name="use_markup">False</property> +	  <property name="justify">GTK_JUSTIFY_CENTER</property> +	  <property name="wrap">False</property> +	  <property name="selectable">False</property> +	  <property name="xalign">0.5</property> +	  <property name="yalign">0.5</property> +	  <property name="xpad">0</property> +	  <property name="ypad">0</property> +	</widget> +	<packing> +	  <property name="x">96</property> +	  <property name="y">48</property> +	</packing> +      </child> + +      <child> +	<widget class="GtkLabel" id="label224"> +	  <property name="width_request">0</property> +	  <property name="height_request">0</property> +	  <property name="visible">True</property> +	  <property name="label" translatable="yes"> Copyright (C) 2001, 2002, 2003 , 2004 +Free Software Foundation, Inc. + +Please, send bug reports to +bug-mdk@gnu.org</property> +	  <property name="use_underline">False</property> +	  <property name="use_markup">False</property> +	  <property name="justify">GTK_JUSTIFY_CENTER</property> +	  <property name="wrap">True</property> +	  <property name="selectable">False</property> +	  <property name="xalign">0.5</property> +	  <property name="yalign">0.5</property> +	  <property name="xpad">0</property> +	  <property name="ypad">0</property> +	</widget> +	<packing> +	  <property name="x">24</property> +	  <property name="y">80</property> +	</packing> +      </child> +    </widget> +  </child> +</widget> + +<widget class="GtkDialog" id="goto_dialog"> +  <property name="title" translatable="yes">Go to memory cell</property> +  <property name="type">GTK_WINDOW_TOPLEVEL</property> +  <property name="window_position">GTK_WIN_POS_NONE</property> +  <property name="modal">True</property> +  <property name="resizable">True</property> +  <property name="destroy_with_parent">False</property> +  <property name="decorated">True</property> +  <property name="skip_taskbar_hint">False</property> +  <property name="skip_pager_hint">False</property> +  <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property> +  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> +  <property name="has_separator">True</property> +  <signal name="destroy_event" handler="gtk_widget_hide"/> +  <signal name="delete_event" handler="gtk_widget_hide"/> +  <signal name="destroy" handler="gtk_widget_hide"/> + +  <child internal-child="vbox"> +    <widget class="GtkVBox" id="dialog-vbox6"> +      <property name="visible">True</property> +      <property name="homogeneous">False</property> +      <property name="spacing">0</property> + +      <child internal-child="action_area"> +	<widget class="GtkHButtonBox" id="dialog-action_area6"> +	  <property name="visible">True</property> +	  <property name="layout_style">GTK_BUTTONBOX_END</property> + +	  <child> +	    <widget class="GtkButton" id="goto_cancel"> +	      <property name="visible">True</property> +	      <property name="can_default">True</property> +	      <property name="can_focus">True</property> +	      <property name="label">gtk-cancel</property> +	      <property name="use_stock">True</property> +	      <property name="relief">GTK_RELIEF_NORMAL</property> +	      <property name="focus_on_click">True</property> +	      <property name="response_id">-6</property> +	    </widget> +	  </child> + +	  <child> +	    <widget class="GtkButton" id="goto_ok"> +	      <property name="visible">True</property> +	      <property name="can_default">True</property> +	      <property name="has_default">True</property> +	      <property name="can_focus">True</property> +	      <property name="label">gtk-ok</property> +	      <property name="use_stock">True</property> +	      <property name="relief">GTK_RELIEF_NORMAL</property> +	      <property name="focus_on_click">True</property> +	      <property name="response_id">-5</property> +	    </widget> +	  </child> +	</widget> +	<packing> +	  <property name="padding">0</property> +	  <property name="expand">False</property> +	  <property name="fill">True</property> +	  <property name="pack_type">GTK_PACK_END</property> +	</packing> +      </child> + +      <child> +	<widget class="GtkVBox" id="vbox1"> +	  <property name="border_width">12</property> +	  <property name="visible">True</property> +	  <property name="homogeneous">False</property> +	  <property name="spacing">0</property> + +	  <child> +	    <widget class="GtkLabel" id="label225"> +	      <property name="visible">True</property> +	      <property name="label" translatable="yes">Go to address:</property> +	      <property name="use_underline">False</property> +	      <property name="use_markup">False</property> +	      <property name="justify">GTK_JUSTIFY_CENTER</property> +	      <property name="wrap">False</property> +	      <property name="selectable">False</property> +	      <property name="xalign">0.5</property> +	      <property name="yalign">0.5</property> +	      <property name="xpad">0</property> +	      <property name="ypad">0</property> +	    </widget> +	    <packing> +	      <property name="padding">0</property> +	      <property name="expand">True</property> +	      <property name="fill">True</property> +	    </packing> +	  </child> + +	  <child> +	    <widget class="GtkEntry" id="goto_entry"> +	      <property name="visible">True</property> +	      <property name="can_focus">True</property> +	      <property name="has_focus">True</property> +	      <property name="editable">True</property> +	      <property name="visibility">True</property> +	      <property name="max_length">0</property> +	      <property name="text" translatable="yes"></property> +	      <property name="has_frame">True</property> +	      <property name="invisible_char" translatable="yes">*</property> +	      <property name="activates_default">True</property> +	    </widget> +	    <packing> +	      <property name="padding">10</property> +	      <property name="expand">False</property> +	      <property name="fill">False</property> +	    </packing> +	  </child> +	</widget> +	<packing> +	  <property name="padding">0</property> +	  <property name="expand">False</property> +	  <property name="fill">False</property> +	</packing> +      </child> +    </widget> +  </child> +</widget> + +<widget class="GtkFontSelectionDialog" id="fontsel_dialog"> +  <property name="border_width">4</property> +  <property name="title" translatable="yes">Select Font</property> +  <property name="type">GTK_WINDOW_TOPLEVEL</property> +  <property name="window_position">GTK_WIN_POS_NONE</property> +  <property name="modal">True</property> +  <property name="resizable">True</property> +  <property name="destroy_with_parent">False</property> +  <property name="decorated">True</property> +  <property name="skip_taskbar_hint">False</property> +  <property name="skip_pager_hint">False</property> +  <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property> +  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> +  <signal name="delete_event" handler="gtk_widget_hide"/> +  <signal name="destroy_event" handler="gtk_widget_hide"/> +  <signal name="destroy" handler="gtk_widget_hide"/> + +  <child internal-child="cancel_button"> +    <widget class="GtkButton" id="cancel_button1"> +      <property name="visible">True</property> +      <property name="can_default">True</property> +      <property name="can_focus">True</property> +      <property name="relief">GTK_RELIEF_NORMAL</property> +      <property name="focus_on_click">True</property> +    </widget> +  </child> + +  <child internal-child="apply_button"> +    <widget class="GtkButton" id="apply_button1"> +      <property name="visible">True</property> +      <property name="can_default">True</property> +      <property name="can_focus">True</property> +      <property name="relief">GTK_RELIEF_NORMAL</property> +      <property name="focus_on_click">True</property> +    </widget> +  </child> + +  <child internal-child="ok_button"> +    <widget class="GtkButton" id="ok_button1"> +      <property name="visible">True</property> +      <property name="can_default">True</property> +      <property name="can_focus">True</property> +      <property name="relief">GTK_RELIEF_NORMAL</property> +      <property name="focus_on_click">True</property> +    </widget> +  </child> + +  <child internal-child="font_selection"> +    <widget class="GtkFontSelection" id="fontselection1"> +      <property name="border_width">4</property> +      <property name="visible">True</property> +      <property name="preview_text" translatable="yes">abcdefghijk ABCDEFGHIJK</property> +    </widget> +    <packing> +      <property name="padding">0</property> +      <property name="expand">True</property> +      <property name="fill">True</property> +    </packing> +  </child> +</widget> + +<widget class="GtkDialog" id="devform_dialog"> +  <property name="title" translatable="yes">Device output format</property> +  <property name="type">GTK_WINDOW_TOPLEVEL</property> +  <property name="window_position">GTK_WIN_POS_NONE</property> +  <property name="modal">True</property> +  <property name="default_width">320</property> +  <property name="default_height">140</property> +  <property name="resizable">True</property> +  <property name="destroy_with_parent">False</property> +  <property name="decorated">True</property> +  <property name="skip_taskbar_hint">False</property> +  <property name="skip_pager_hint">False</property> +  <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property> +  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> +  <property name="has_separator">True</property> +  <signal name="delete_event" handler="gtk_widget_hide"/> +  <signal name="destroy_event" handler="gtk_widget_hide"/> +  <signal name="destroy" handler="gtk_widget_hide"/> + +  <child internal-child="vbox"> +    <widget class="GtkVBox" id="dialog-vbox8"> +      <property name="visible">True</property> +      <property name="homogeneous">False</property> +      <property name="spacing">0</property> + +      <child internal-child="action_area"> +	<widget class="GtkHButtonBox" id="dialog-action_area8"> +	  <property name="visible">True</property> +	  <property name="layout_style">GTK_BUTTONBOX_END</property> + +	  <child> +	    <widget class="GtkButton" id="button37"> +	      <property name="visible">True</property> +	      <property name="can_default">True</property> +	      <property name="can_focus">True</property> +	      <property name="label">gtk-cancel</property> +	      <property name="use_stock">True</property> +	      <property name="relief">GTK_RELIEF_NORMAL</property> +	      <property name="focus_on_click">True</property> +	      <property name="response_id">-6</property> +	    </widget> +	  </child> + +	  <child> +	    <widget class="GtkButton" id="button38"> +	      <property name="visible">True</property> +	      <property name="can_default">True</property> +	      <property name="can_focus">True</property> +	      <property name="label">gtk-apply</property> +	      <property name="use_stock">True</property> +	      <property name="relief">GTK_RELIEF_NORMAL</property> +	      <property name="focus_on_click">True</property> +	      <property name="response_id">-10</property> +	    </widget> +	  </child> + +	  <child> +	    <widget class="GtkButton" id="button39"> +	      <property name="visible">True</property> +	      <property name="can_default">True</property> +	      <property name="can_focus">True</property> +	      <property name="label">gtk-ok</property> +	      <property name="use_stock">True</property> +	      <property name="relief">GTK_RELIEF_NORMAL</property> +	      <property name="focus_on_click">True</property> +	      <property name="response_id">-5</property> +	    </widget> +	  </child> +	</widget> +	<packing> +	  <property name="padding">0</property> +	  <property name="expand">False</property> +	  <property name="fill">True</property> +	  <property name="pack_type">GTK_PACK_END</property> +	</packing> +      </child> + +      <child> +	<widget class="GtkFixed" id="fixed2"> +	  <property name="visible">True</property> + +	  <child> +	    <widget class="GtkButton" id="devset_button"> +	      <property name="width_request">0</property> +	      <property name="height_request">0</property> +	      <property name="visible">True</property> +	      <property name="tooltip" translatable="yes">Set all devices to current format</property> +	      <property name="can_focus">True</property> +	      <property name="label" translatable="yes">S_et all</property> +	      <property name="use_underline">True</property> +	      <property name="relief">GTK_RELIEF_NORMAL</property> +	      <property name="focus_on_click">True</property> +	      <signal name="clicked" handler="on_devset_button_clicked"/> +	    </widget> +	    <packing> +	      <property name="x">233</property> +	      <property name="y">31</property> +	    </packing> +	  </child> + +	  <child> +	    <widget class="GtkLabel" id="label232"> +	      <property name="width_request">0</property> +	      <property name="height_request">0</property> +	      <property name="visible">True</property> +	      <property name="label" translatable="yes">Device</property> +	      <property name="use_underline">False</property> +	      <property name="use_markup">False</property> +	      <property name="justify">GTK_JUSTIFY_CENTER</property> +	      <property name="wrap">False</property> +	      <property name="selectable">False</property> +	      <property name="xalign">0.5</property> +	      <property name="yalign">0.5</property> +	      <property name="xpad">0</property> +	      <property name="ypad">0</property> +	    </widget> +	    <packing> +	      <property name="x">24</property> +	      <property name="y">10</property> +	    </packing> +	  </child> + +	  <child> +	    <widget class="GtkLabel" id="label233"> +	      <property name="width_request">0</property> +	      <property name="height_request">0</property> +	      <property name="visible">True</property> +	      <property name="label" translatable="yes">Format</property> +	      <property name="use_underline">False</property> +	      <property name="use_markup">False</property> +	      <property name="justify">GTK_JUSTIFY_CENTER</property> +	      <property name="wrap">False</property> +	      <property name="selectable">False</property> +	      <property name="xalign">0.5</property> +	      <property name="yalign">0.5</property> +	      <property name="xpad">0</property> +	      <property name="ypad">0</property> +	    </widget> +	    <packing> +	      <property name="x">24</property> +	      <property name="y">38</property> +	    </packing> +	  </child> + +	  <child> +	    <widget class="GtkComboBoxEntry" id="dev_combo"> +	      <property name="width_request">183</property> +	      <property name="height_request">25</property> +	      <property name="visible">True</property> +	      <property name="items" translatable="yes">tape0 +tape1 +tape2 +tape3 +tape4 +tape5 +tape6 +tape7 +disk0 +disk1 +disk2 +disk3 +disk4 +disk5 +disk6 +disk7</property> +	      <signal name="changed" handler="on_dev_combo_changed" last_modification_time="Wed, 23 Jun 2004 11:34:16 GMT"/> +	    </widget> +	    <packing> +	      <property name="x">90</property> +	      <property name="y">2</property> +	    </packing> +	  </child> + +	  <child> +	    <widget class="GtkRadioButton" id="wordradio"> +	      <property name="width_request">0</property> +	      <property name="height_request">0</property> +	      <property name="visible">True</property> +	      <property name="tooltip" translatable="yes">Show output as MIX words</property> +	      <property name="can_focus">True</property> +	      <property name="label" translatable="yes">Word</property> +	      <property name="use_underline">True</property> +	      <property name="relief">GTK_RELIEF_NORMAL</property> +	      <property name="focus_on_click">True</property> +	      <property name="active">False</property> +	      <property name="inconsistent">False</property> +	      <property name="draw_indicator">True</property> +	    </widget> +	    <packing> +	      <property name="x">89</property> +	      <property name="y">34</property> +	    </packing> +	  </child> + +	  <child> +	    <widget class="GtkRadioButton" id="decradio"> +	      <property name="width_request">0</property> +	      <property name="height_request">0</property> +	      <property name="visible">True</property> +	      <property name="tooltip" translatable="yes">Show output as decimal numbers</property> +	      <property name="can_focus">True</property> +	      <property name="label" translatable="yes">Decimal</property> +	      <property name="use_underline">True</property> +	      <property name="relief">GTK_RELIEF_NORMAL</property> +	      <property name="focus_on_click">True</property> +	      <property name="active">False</property> +	      <property name="inconsistent">False</property> +	      <property name="draw_indicator">True</property> +	      <property name="group">wordradio</property> +	      <signal name="toggled" handler="on_decradio_toggled"/> +	    </widget> +	    <packing> +	      <property name="x">154</property> +	      <property name="y">34</property> +	    </packing> +	  </child> +	</widget> +	<packing> +	  <property name="padding">0</property> +	  <property name="expand">True</property> +	  <property name="fill">False</property> +	  <property name="pack_type">GTK_PACK_END</property> +	</packing> +      </child> +    </widget> +  </child> +</widget> + +<widget class="GtkDialog" id="external_dialog"> +  <property name="title" translatable="yes">External programs</property> +  <property name="type">GTK_WINDOW_TOPLEVEL</property> +  <property name="window_position">GTK_WIN_POS_NONE</property> +  <property name="modal">True</property> +  <property name="resizable">True</property> +  <property name="destroy_with_parent">False</property> +  <property name="decorated">True</property> +  <property name="skip_taskbar_hint">False</property> +  <property name="skip_pager_hint">False</property> +  <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property> +  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> +  <property name="has_separator">True</property> +  <signal name="delete_event" handler="gtk_widget_hide"/> +  <signal name="destroy_event" handler="gtk_widget_hide"/> +  <signal name="destroy" handler="gtk_widget_hide"/> + +  <child internal-child="vbox"> +    <widget class="GtkVBox" id="dialog-vbox9"> +      <property name="visible">True</property> +      <property name="homogeneous">False</property> +      <property name="spacing">0</property> + +      <child internal-child="action_area"> +	<widget class="GtkHButtonBox" id="dialog-action_area9"> +	  <property name="visible">True</property> +	  <property name="layout_style">GTK_BUTTONBOX_END</property> + +	  <child> +	    <widget class="GtkButton" id="button40"> +	      <property name="visible">True</property> +	      <property name="can_default">True</property> +	      <property name="can_focus">True</property> +	      <property name="label">gtk-cancel</property> +	      <property name="use_stock">True</property> +	      <property name="relief">GTK_RELIEF_NORMAL</property> +	      <property name="focus_on_click">True</property> +	      <property name="response_id">-6</property> +	    </widget> +	  </child> + +	  <child> +	    <widget class="GtkButton" id="button41"> +	      <property name="visible">True</property> +	      <property name="can_default">True</property> +	      <property name="can_focus">True</property> +	      <property name="label">gtk-ok</property> +	      <property name="use_stock">True</property> +	      <property name="relief">GTK_RELIEF_NORMAL</property> +	      <property name="focus_on_click">True</property> +	      <property name="response_id">-5</property> +	    </widget> +	  </child> +	</widget> +	<packing> +	  <property name="padding">0</property> +	  <property name="expand">False</property> +	  <property name="fill">True</property> +	  <property name="pack_type">GTK_PACK_END</property> +	</packing> +      </child> + +      <child> +	<widget class="GtkVBox" id="vbox2"> +	  <property name="visible">True</property> +	  <property name="homogeneous">True</property> +	  <property name="spacing">0</property> + +	  <child> +	    <widget class="GtkFixed" id="fixed3"> +	      <property name="visible">True</property> + +	      <child> +		<widget class="GtkEntry" id="editor_entry"> +		  <property name="width_request">0</property> +		  <property name="height_request">0</property> +		  <property name="visible">True</property> +		  <property name="can_focus">True</property> +		  <property name="editable">True</property> +		  <property name="visibility">True</property> +		  <property name="max_length">0</property> +		  <property name="text" translatable="yes">xterm -e vi %s</property> +		  <property name="has_frame">True</property> +		  <property name="invisible_char" translatable="yes">*</property> +		  <property name="activates_default">False</property> +		</widget> +		<packing> +		  <property name="x">256</property> +		  <property name="y">12</property> +		</packing> +	      </child> + +	      <child> +		<widget class="GtkLabel" id="label234"> +		  <property name="width_request">0</property> +		  <property name="height_request">0</property> +		  <property name="visible">True</property> +		  <property name="label" translatable="yes">Editor command (e.g xterm -e vi %s)</property> +		  <property name="use_underline">False</property> +		  <property name="use_markup">False</property> +		  <property name="justify">GTK_JUSTIFY_LEFT</property> +		  <property name="wrap">False</property> +		  <property name="selectable">False</property> +		  <property name="xalign">0.5</property> +		  <property name="yalign">0.5</property> +		  <property name="xpad">0</property> +		  <property name="ypad">0</property> +		</widget> +		<packing> +		  <property name="x">8</property> +		  <property name="y">15</property> +		</packing> +	      </child> +	    </widget> +	    <packing> +	      <property name="padding">0</property> +	      <property name="expand">True</property> +	      <property name="fill">True</property> +	    </packing> +	  </child> + +	  <child> +	    <widget class="GtkFixed" id="fixed4"> +	      <property name="visible">True</property> + +	      <child> +		<widget class="GtkEntry" id="mixasm_entry"> +		  <property name="width_request">0</property> +		  <property name="height_request">0</property> +		  <property name="visible">True</property> +		  <property name="can_focus">True</property> +		  <property name="editable">True</property> +		  <property name="visibility">True</property> +		  <property name="max_length">0</property> +		  <property name="text" translatable="yes">mixasm %s</property> +		  <property name="has_frame">True</property> +		  <property name="invisible_char" translatable="yes">*</property> +		  <property name="activates_default">False</property> +		</widget> +		<packing> +		  <property name="x">255</property> +		  <property name="y">4</property> +		</packing> +	      </child> + +	      <child> +		<widget class="GtkLabel" id="label235"> +		  <property name="width_request">0</property> +		  <property name="height_request">0</property> +		  <property name="visible">True</property> +		  <property name="label" translatable="yes">MIX sssembler command (e.g. mixasm %s)</property> +		  <property name="use_underline">False</property> +		  <property name="use_markup">False</property> +		  <property name="justify">GTK_JUSTIFY_LEFT</property> +		  <property name="wrap">False</property> +		  <property name="selectable">False</property> +		  <property name="xalign">0.5</property> +		  <property name="yalign">0.5</property> +		  <property name="xpad">0</property> +		  <property name="ypad">0</property> +		</widget> +		<packing> +		  <property name="x">8</property> +		  <property name="y">8</property> +		</packing> +	      </child> +	    </widget> +	    <packing> +	      <property name="padding">0</property> +	      <property name="expand">True</property> +	      <property name="fill">True</property> +	    </packing> +	  </child> +	</widget> +	<packing> +	  <property name="padding">0</property> +	  <property name="expand">True</property> +	  <property name="fill">True</property> +	</packing> +      </child> +    </widget> +  </child> +</widget> + +<widget class="GtkDialog" id="symbols_dialog"> +  <property name="title" translatable="yes">Symbol table</property> +  <property name="type">GTK_WINDOW_TOPLEVEL</property> +  <property name="window_position">GTK_WIN_POS_NONE</property> +  <property name="modal">False</property> +  <property name="default_width">245</property> +  <property name="default_height">265</property> +  <property name="resizable">True</property> +  <property name="destroy_with_parent">False</property> +  <property name="decorated">True</property> +  <property name="skip_taskbar_hint">False</property> +  <property name="skip_pager_hint">False</property> +  <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property> +  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> +  <property name="has_separator">True</property> +  <signal name="delete_event" handler="gtk_widget_hide"/> +  <signal name="destroy_event" handler="gtk_widget_hide"/> +  <signal name="destroy" handler="gtk_widget_hide"/> + +  <child internal-child="vbox"> +    <widget class="GtkVBox" id="dialog-vbox10"> +      <property name="visible">True</property> +      <property name="homogeneous">False</property> +      <property name="spacing">0</property> + +      <child internal-child="action_area"> +	<widget class="GtkHButtonBox" id="dialog-action_area10"> +	  <property name="visible">True</property> +	  <property name="layout_style">GTK_BUTTONBOX_END</property> + +	  <child> +	    <widget class="GtkButton" id="button1"> +	      <property name="visible">True</property> +	      <property name="can_focus">True</property> +	      <property name="relief">GTK_RELIEF_NORMAL</property> +	      <property name="focus_on_click">True</property> +	      <property name="response_id">0</property> +	      <signal name="clicked" handler="on_symbol_ok_clicked"/> + +	      <child> +		<widget class="GtkAlignment" id="alignment1"> +		  <property name="visible">True</property> +		  <property name="xalign">0.5</property> +		  <property name="yalign">0.5</property> +		  <property name="xscale">0</property> +		  <property name="yscale">0</property> +		  <property name="top_padding">0</property> +		  <property name="bottom_padding">0</property> +		  <property name="left_padding">0</property> +		  <property name="right_padding">0</property> + +		  <child> +		    <widget class="GtkHBox" id="hbox36"> +		      <property name="visible">True</property> +		      <property name="homogeneous">False</property> +		      <property name="spacing">2</property> + +		      <child> +			<widget class="GtkImage" id="image57"> +			  <property name="visible">True</property> +			  <property name="stock">gtk-close</property> +			  <property name="icon_size">4</property> +			  <property name="xalign">0.5</property> +			  <property name="yalign">0.5</property> +			  <property name="xpad">0</property> +			  <property name="ypad">0</property> +			</widget> +			<packing> +			  <property name="padding">0</property> +			  <property name="expand">False</property> +			  <property name="fill">False</property> +			</packing> +		      </child> + +		      <child> +			<widget class="GtkLabel" id="label1437"> +			  <property name="visible">True</property> +			  <property name="label" translatable="yes">_Close</property> +			  <property name="use_underline">True</property> +			  <property name="use_markup">False</property> +			  <property name="justify">GTK_JUSTIFY_LEFT</property> +			  <property name="wrap">False</property> +			  <property name="selectable">False</property> +			  <property name="xalign">0.5</property> +			  <property name="yalign">0.5</property> +			  <property name="xpad">0</property> +			  <property name="ypad">0</property> +			</widget> +			<packing> +			  <property name="padding">0</property> +			  <property name="expand">False</property> +			  <property name="fill">False</property> +			</packing> +		      </child> +		    </widget> +		  </child> +		</widget> +	      </child> +	    </widget> +	  </child> +	</widget> +	<packing> +	  <property name="padding">0</property> +	  <property name="expand">False</property> +	  <property name="fill">True</property> +	  <property name="pack_type">GTK_PACK_END</property> +	</packing> +      </child> + +      <child> +	<widget class="GtkScrolledWindow" id="scrolledwindow26"> +	  <property name="visible">True</property> +	  <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property> +	  <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property> +	  <property name="shadow_type">GTK_SHADOW_IN</property> +	  <property name="window_placement">GTK_CORNER_TOP_LEFT</property> + +	  <child> +	    <widget class="GtkTreeView" id="symbols_view"> +	      <property name="visible">True</property> +	      <property name="can_focus">True</property> +	      <property name="headers_visible">False</property> +	      <property name="rules_hint">True</property> +	      <property name="reorderable">True</property> +	      <property name="enable_search">True</property> +	    </widget> +	  </child> +	</widget> +	<packing> +	  <property name="padding">0</property> +	  <property name="expand">True</property> +	  <property name="fill">True</property> +	</packing> +      </child> +    </widget> +  </child> +</widget> + +<widget class="GtkWindow" id="mixal_window"> +  <property name="title" translatable="yes">MIXAL source</property> +  <property name="type">GTK_WINDOW_TOPLEVEL</property> +  <property name="window_position">GTK_WIN_POS_NONE</property> +  <property name="modal">False</property> +  <property name="default_width">570</property> +  <property name="default_height">225</property> +  <property name="resizable">True</property> +  <property name="destroy_with_parent">False</property> +  <property name="decorated">True</property> +  <property name="skip_taskbar_hint">False</property> +  <property name="skip_pager_hint">False</property> +  <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property> +  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> + +  <child> +    <widget class="GtkVBox" id="vbox5"> +      <property name="visible">True</property> +      <property name="homogeneous">False</property> +      <property name="spacing">0</property> + +      <child> +	<widget class="GtkHandleBox" id="tb_handle"> +	  <property name="visible">True</property> +	  <property name="shadow_type">GTK_SHADOW_OUT</property> +	  <property name="handle_position">GTK_POS_LEFT</property> +	  <property name="snap_edge">GTK_POS_TOP</property> + +	  <child> +	    <widget class="GtkToolbar" id="mixal_toolbar"> +	      <property name="border_width">2</property> +	      <property name="visible">True</property> +	      <property name="can_default">True</property> +	      <property name="orientation">GTK_ORIENTATION_HORIZONTAL</property> +	      <property name="toolbar_style">GTK_TOOLBAR_ICONS</property> +	      <property name="tooltips">True</property> +	      <property name="show_arrow">True</property> + +	      <child> +		<widget class="GtkToolButton" id="button14"> +		  <property name="visible">True</property> +		  <property name="tooltip" translatable="yes">Run</property> +		  <property name="label" translatable="yes">Run</property> +		  <property name="use_underline">True</property> +		  <property name="stock_id">gtk-go-forward</property> +		  <property name="visible_horizontal">True</property> +		  <property name="visible_vertical">True</property> +		  <property name="is_important">True</property> +		  <signal name="clicked" handler="on_debug_run_activate"/> +		</widget> +		<packing> +		  <property name="expand">False</property> +		  <property name="homogeneous">True</property> +		</packing> +	      </child> + +	      <child> +		<widget class="GtkToolButton" id="button15"> +		  <property name="visible">True</property> +		  <property name="tooltip" translatable="yes">Next</property> +		  <property name="label" translatable="yes">Step</property> +		  <property name="use_underline">True</property> +		  <property name="stock_id">gtk-goto-last</property> +		  <property name="visible_horizontal">True</property> +		  <property name="visible_vertical">True</property> +		  <property name="is_important">True</property> +		  <signal name="clicked" handler="on_debug_next_activate"/> +		</widget> +		<packing> +		  <property name="expand">False</property> +		  <property name="homogeneous">True</property> +		</packing> +	      </child> + +	      <child> +		<widget class="GtkToolButton" id="button16"> +		  <property name="visible">True</property> +		  <property name="tooltip" translatable="yes">Clear breakpoints</property> +		  <property name="label" translatable="yes">Clear</property> +		  <property name="use_underline">True</property> +		  <property name="stock_id">gtk-clear</property> +		  <property name="visible_horizontal">True</property> +		  <property name="visible_vertical">True</property> +		  <property name="is_important">True</property> +		  <signal name="clicked" handler="on_clear_breakpoints_activate"/> +		</widget> +		<packing> +		  <property name="expand">False</property> +		  <property name="homogeneous">True</property> +		</packing> +	      </child> + +	      <child> +		<widget class="GtkToolButton" id="button18"> +		  <property name="visible">True</property> +		  <property name="tooltip" translatable="yes">Symbol table</property> +		  <property name="label" translatable="yes">Symbols</property> +		  <property name="use_underline">True</property> +		  <property name="stock_id">gtk-index</property> +		  <property name="visible_horizontal">True</property> +		  <property name="visible_vertical">True</property> +		  <property name="is_important">True</property> +		  <signal name="clicked" handler="on_symbols_activate"/> +		</widget> +		<packing> +		  <property name="expand">False</property> +		  <property name="homogeneous">True</property> +		</packing> +	      </child> + +	      <child> +		<widget class="GtkSeparatorToolItem" id="separatortoolitem7"> +		  <property name="visible">True</property> +		  <property name="draw">True</property> +		  <property name="visible_horizontal">True</property> +		  <property name="visible_vertical">True</property> +		</widget> +		<packing> +		  <property name="expand">False</property> +		  <property name="homogeneous">False</property> +		</packing> +	      </child> + +	      <child> +		<widget class="GtkToolButton" id="button22"> +		  <property name="visible">True</property> +		  <property name="tooltip" translatable="yes">Source code font</property> +		  <property name="label" translatable="yes">Font</property> +		  <property name="use_underline">True</property> +		  <property name="stock_id">gtk-select-font</property> +		  <property name="visible_horizontal">True</property> +		  <property name="visible_vertical">True</property> +		  <property name="is_important">True</property> +		  <signal name="clicked" handler="on_mixal_font_activate"/> +		</widget> +		<packing> +		  <property name="expand">False</property> +		  <property name="homogeneous">True</property> +		</packing> +	      </child> + +	      <child> +		<widget class="GtkSeparatorToolItem" id="separatortoolitem10"> +		  <property name="visible">True</property> +		  <property name="draw">True</property> +		  <property name="visible_horizontal">True</property> +		  <property name="visible_vertical">True</property> +		</widget> +		<packing> +		  <property name="expand">False</property> +		  <property name="homogeneous">False</property> +		</packing> +	      </child> + +	      <child> +		<widget class="GtkToolButton" id="attach_button"> +		  <property name="visible">True</property> +		  <property name="tooltip" translatable="yes">Attach window</property> +		  <property name="label" translatable="yes"></property> +		  <property name="use_underline">True</property> +		  <property name="stock_id">gtk-dnd</property> +		  <property name="visible_horizontal">True</property> +		  <property name="visible_vertical">True</property> +		  <property name="is_important">True</property> +		</widget> +		<packing> +		  <property name="expand">False</property> +		  <property name="homogeneous">True</property> +		</packing> +	      </child> +	    </widget> +	  </child> +	</widget> +	<packing> +	  <property name="padding">0</property> +	  <property name="expand">False</property> +	  <property name="fill">False</property> +	</packing> +      </child> + +      <child> +	<widget class="GtkVBox" id="mixal_container"> +	  <property name="visible">True</property> +	  <property name="homogeneous">False</property> +	  <property name="spacing">0</property> + +	  <child> +	    <placeholder/> +	  </child> +	</widget> +	<packing> +	  <property name="padding">0</property> +	  <property name="expand">True</property> +	  <property name="fill">True</property> +	</packing> +      </child> + +      <child> +	<widget class="GtkStatusbar" id="mixal_statusbar"> +	  <property name="visible">True</property> +	  <property name="has_resize_grip">True</property> +	</widget> +	<packing> +	  <property name="padding">0</property> +	  <property name="expand">False</property> +	  <property name="fill">False</property> +	</packing> +      </child> +    </widget> +  </child> +</widget> + +<widget class="GtkWindow" id="devices_window"> +  <property name="title" translatable="yes">Devices</property> +  <property name="type">GTK_WINDOW_TOPLEVEL</property> +  <property name="window_position">GTK_WIN_POS_NONE</property> +  <property name="modal">False</property> +  <property name="default_width">550</property> +  <property name="default_height">250</property> +  <property name="resizable">True</property> +  <property name="destroy_with_parent">False</property> +  <property name="decorated">True</property> +  <property name="skip_taskbar_hint">False</property> +  <property name="skip_pager_hint">False</property> +  <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property> +  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> +  <signal name="delete_event" handler="on_window_hide"/> +  <signal name="destroy_event" handler="on_window_hide"/> +  <signal name="destroy" handler="on_window_hide"/> + +  <child> +    <widget class="GtkVBox" id="vbox4"> +      <property name="visible">True</property> +      <property name="homogeneous">False</property> +      <property name="spacing">0</property> + +      <child> +	<widget class="GtkHandleBox" id="tb_handle"> +	  <property name="visible">True</property> +	  <property name="shadow_type">GTK_SHADOW_OUT</property> +	  <property name="handle_position">GTK_POS_LEFT</property> +	  <property name="snap_edge">GTK_POS_TOP</property> + +	  <child> +	    <widget class="GtkToolbar" id="devices_toolbar"> +	      <property name="border_width">2</property> +	      <property name="visible">True</property> +	      <property name="can_default">True</property> +	      <property name="orientation">GTK_ORIENTATION_HORIZONTAL</property> +	      <property name="toolbar_style">GTK_TOOLBAR_ICONS</property> +	      <property name="tooltips">True</property> +	      <property name="show_arrow">True</property> + +	      <child> +		<widget class="GtkToolButton" id="devdir_button"> +		  <property name="visible">True</property> +		  <property name="tooltip" translatable="yes">Device directory</property> +		  <property name="label" translatable="yes">Directory</property> +		  <property name="use_underline">True</property> +		  <property name="stock_id">gtk-home</property> +		  <property name="visible_horizontal">True</property> +		  <property name="visible_vertical">True</property> +		  <property name="is_important">True</property> +		  <signal name="clicked" handler="on_devdir_activate"/> +		</widget> +		<packing> +		  <property name="expand">False</property> +		  <property name="homogeneous">True</property> +		</packing> +	      </child> + +	      <child> +		<widget class="GtkToolButton" id="output_button"> +		  <property name="visible">True</property> +		  <property name="tooltip" translatable="yes">Output format</property> +		  <property name="label" translatable="yes">Output</property> +		  <property name="use_underline">True</property> +		  <property name="stock_id">gtk-zoom-100</property> +		  <property name="visible_horizontal">True</property> +		  <property name="visible_vertical">True</property> +		  <property name="is_important">True</property> +		  <signal name="clicked" handler="on_devform_activate"/> +		</widget> +		<packing> +		  <property name="expand">False</property> +		  <property name="homogeneous">True</property> +		</packing> +	      </child> + +	      <child> +		<widget class="GtkSeparatorToolItem" id="separatortoolitem11"> +		  <property name="visible">True</property> +		  <property name="draw">True</property> +		  <property name="visible_horizontal">True</property> +		  <property name="visible_vertical">True</property> +		</widget> +		<packing> +		  <property name="expand">False</property> +		  <property name="homogeneous">False</property> +		</packing> +	      </child> + +	      <child> +		<widget class="GtkToolButton" id="button21"> +		  <property name="visible">True</property> +		  <property name="tooltip" translatable="yes">Output font</property> +		  <property name="label" translatable="yes">Font</property> +		  <property name="use_underline">True</property> +		  <property name="stock_id">gtk-select-font</property> +		  <property name="visible_horizontal">True</property> +		  <property name="visible_vertical">True</property> +		  <property name="is_important">True</property> +		  <signal name="clicked" handler="on_devices_font_activate"/> +		</widget> +		<packing> +		  <property name="expand">False</property> +		  <property name="homogeneous">True</property> +		</packing> +	      </child> + +	      <child> +		<widget class="GtkSeparatorToolItem" id="separatortoolitem12"> +		  <property name="visible">True</property> +		  <property name="draw">True</property> +		  <property name="visible_horizontal">True</property> +		  <property name="visible_vertical">True</property> +		</widget> +		<packing> +		  <property name="expand">False</property> +		  <property name="homogeneous">False</property> +		</packing> +	      </child> + +	      <child> +		<widget class="GtkToolButton" id="attach_button"> +		  <property name="visible">True</property> +		  <property name="label" translatable="yes"></property> +		  <property name="use_underline">True</property> +		  <property name="stock_id">gtk-dnd</property> +		  <property name="visible_horizontal">True</property> +		  <property name="visible_vertical">True</property> +		  <property name="is_important">True</property> +		</widget> +		<packing> +		  <property name="expand">False</property> +		  <property name="homogeneous">True</property> +		</packing> +	      </child> +	    </widget> +	  </child> +	</widget> +	<packing> +	  <property name="padding">0</property> +	  <property name="expand">False</property> +	  <property name="fill">False</property> +	</packing> +      </child> + +      <child> +	<widget class="GtkVBox" id="dev_container"> +	  <property name="visible">True</property> +	  <property name="homogeneous">False</property> +	  <property name="spacing">0</property> + +	  <child> +	    <placeholder/> +	  </child> +	</widget> +	<packing> +	  <property name="padding">0</property> +	  <property name="expand">True</property> +	  <property name="fill">True</property> +	</packing> +      </child> +    </widget> +  </child> +</widget> + +<widget class="GtkDialog" id="devdir_dialog"> +  <property name="title" translatable="yes">Devices directory</property> +  <property name="type">GTK_WINDOW_TOPLEVEL</property> +  <property name="window_position">GTK_WIN_POS_NONE</property> +  <property name="modal">False</property> +  <property name="resizable">True</property> +  <property name="destroy_with_parent">False</property> +  <property name="decorated">True</property> +  <property name="skip_taskbar_hint">False</property> +  <property name="skip_pager_hint">False</property> +  <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property> +  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> +  <property name="has_separator">True</property> +  <signal name="delete_event" handler="gtk_widget_hide"/> +  <signal name="destroy_event" handler="gtk_widget_hide"/> +  <signal name="destroy" handler="gtk_widget_hide"/> + +  <child internal-child="vbox"> +    <widget class="GtkVBox" id="dialog-vbox11"> +      <property name="visible">True</property> +      <property name="homogeneous">False</property> +      <property name="spacing">0</property> + +      <child internal-child="action_area"> +	<widget class="GtkHButtonBox" id="dialog-action_area11"> +	  <property name="visible">True</property> +	  <property name="layout_style">GTK_BUTTONBOX_END</property> + +	  <child> +	    <widget class="GtkButton" id="devdir_cancel"> +	      <property name="visible">True</property> +	      <property name="can_default">True</property> +	      <property name="can_focus">True</property> +	      <property name="label">gtk-cancel</property> +	      <property name="use_stock">True</property> +	      <property name="relief">GTK_RELIEF_NORMAL</property> +	      <property name="focus_on_click">True</property> +	      <property name="response_id">-6</property> +	      <signal name="clicked" handler="on_devdir_cancel_clicked" last_modification_time="Tue, 22 Jun 2004 22:16:53 GMT"/> +	    </widget> +	  </child> + +	  <child> +	    <widget class="GtkButton" id="devdir_ok"> +	      <property name="visible">True</property> +	      <property name="can_default">True</property> +	      <property name="can_focus">True</property> +	      <property name="label">gtk-ok</property> +	      <property name="use_stock">True</property> +	      <property name="relief">GTK_RELIEF_NORMAL</property> +	      <property name="focus_on_click">True</property> +	      <property name="response_id">-5</property> +	      <signal name="clicked" handler="on_devdir_ok_clicked" last_modification_time="Tue, 22 Jun 2004 22:18:04 GMT"/> +	    </widget> +	  </child> +	</widget> +	<packing> +	  <property name="padding">0</property> +	  <property name="expand">False</property> +	  <property name="fill">False</property> +	  <property name="pack_type">GTK_PACK_END</property> +	</packing> +      </child> + +      <child> +	<widget class="GtkHBox" id="hbox1"> +	  <property name="border_width">25</property> +	  <property name="visible">True</property> +	  <property name="homogeneous">False</property> +	  <property name="spacing">11</property> + +	  <child> +	    <widget class="GtkLabel" id="label239"> +	      <property name="visible">True</property> +	      <property name="label" translatable="yes">Directory</property> +	      <property name="use_underline">False</property> +	      <property name="use_markup">False</property> +	      <property name="justify">GTK_JUSTIFY_CENTER</property> +	      <property name="wrap">False</property> +	      <property name="selectable">False</property> +	      <property name="xalign">0.5</property> +	      <property name="yalign">0.5</property> +	      <property name="xpad">0</property> +	      <property name="ypad">0</property> +	    </widget> +	    <packing> +	      <property name="padding">0</property> +	      <property name="expand">False</property> +	      <property name="fill">False</property> +	    </packing> +	  </child> + +	  <child> +	    <widget class="GtkEntry" id="devdir_entry"> +	      <property name="visible">True</property> +	      <property name="can_focus">True</property> +	      <property name="editable">False</property> +	      <property name="visibility">True</property> +	      <property name="max_length">0</property> +	      <property name="text" translatable="yes"></property> +	      <property name="has_frame">True</property> +	      <property name="invisible_char" translatable="yes">*</property> +	      <property name="activates_default">False</property> +	    </widget> +	    <packing> +	      <property name="padding">0</property> +	      <property name="expand">True</property> +	      <property name="fill">True</property> +	    </packing> +	  </child> + +	  <child> +	    <widget class="GtkButton" id="devdir_browse"> +	      <property name="visible">True</property> +	      <property name="can_focus">True</property> +	      <property name="label">gtk-open</property> +	      <property name="use_stock">True</property> +	      <property name="relief">GTK_RELIEF_NORMAL</property> +	      <property name="focus_on_click">True</property> +	      <signal name="clicked" handler="on_devdir_browse_clicked"/> +	    </widget> +	    <packing> +	      <property name="padding">0</property> +	      <property name="expand">False</property> +	      <property name="fill">False</property> +	    </packing> +	  </child> +	</widget> +	<packing> +	  <property name="padding">0</property> +	  <property name="expand">False</property> +	  <property name="fill">True</property> +	</packing> +      </child> +    </widget> +  </child> +</widget> + +<widget class="GtkWindow" id="mixvm_window"> +  <property name="title" translatable="yes">Virtual machine</property> +  <property name="type">GTK_WINDOW_TOPLEVEL</property> +  <property name="window_position">GTK_WIN_POS_NONE</property> +  <property name="modal">False</property> +  <property name="default_width">640</property> +  <property name="default_height">268</property> +  <property name="resizable">True</property> +  <property name="destroy_with_parent">False</property> +  <property name="decorated">True</property> +  <property name="skip_taskbar_hint">False</property> +  <property name="skip_pager_hint">False</property> +  <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property> +  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> + +  <child> +    <widget class="GtkVBox" id="vbox8"> +      <property name="visible">True</property> +      <property name="homogeneous">False</property> +      <property name="spacing">0</property> + +      <child> +	<widget class="GtkHandleBox" id="tb_handle"> +	  <property name="visible">True</property> +	  <property name="shadow_type">GTK_SHADOW_OUT</property> +	  <property name="handle_position">GTK_POS_LEFT</property> +	  <property name="snap_edge">GTK_POS_TOP</property> + +	  <child> +	    <widget class="GtkToolbar" id="mixvm_toolbar"> +	      <property name="visible">True</property> +	      <property name="can_default">True</property> +	      <property name="orientation">GTK_ORIENTATION_HORIZONTAL</property> +	      <property name="toolbar_style">GTK_TOOLBAR_ICONS</property> +	      <property name="tooltips">True</property> +	      <property name="show_arrow">True</property> + +	      <child> +		<widget class="GtkToolButton" id="toolbutton2"> +		  <property name="visible">True</property> +		  <property name="label" translatable="yes">Font</property> +		  <property name="use_underline">True</property> +		  <property name="stock_id">gtk-select-font</property> +		  <property name="visible_horizontal">True</property> +		  <property name="visible_vertical">True</property> +		  <property name="is_important">True</property> +		  <signal name="clicked" handler="on_mix_font_activate" last_modification_time="Wed, 30 Jun 2004 16:06:57 GMT"/> +		</widget> +		<packing> +		  <property name="expand">False</property> +		  <property name="homogeneous">True</property> +		</packing> +	      </child> + +	      <child> +		<widget class="GtkSeparatorToolItem" id="separatortoolitem9"> +		  <property name="visible">True</property> +		  <property name="draw">True</property> +		  <property name="visible_horizontal">True</property> +		  <property name="visible_vertical">True</property> +		</widget> +		<packing> +		  <property name="expand">False</property> +		  <property name="homogeneous">False</property> +		</packing> +	      </child> + +	      <child> +		<widget class="GtkToolButton" id="attach_button"> +		  <property name="visible">True</property> +		  <property name="label" translatable="yes"></property> +		  <property name="use_underline">True</property> +		  <property name="stock_id">gtk-dnd</property> +		  <property name="visible_horizontal">True</property> +		  <property name="visible_vertical">True</property> +		  <property name="is_important">True</property> +		</widget> +		<packing> +		  <property name="expand">False</property> +		  <property name="homogeneous">True</property> +		</packing> +	      </child> +	    </widget> +	  </child> +	</widget> +	<packing> +	  <property name="padding">0</property> +	  <property name="expand">False</property> +	  <property name="fill">False</property> +	</packing> +      </child> + +      <child> +	<widget class="GtkFrame" id="mixvm_container"> +	  <property name="border_width">5</property> +	  <property name="visible">True</property> +	  <property name="label_xalign">0</property> +	  <property name="label_yalign">0.5</property> +	  <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> + +	  <child> +	    <widget class="GtkHBox" id="mixvm_widget"> +	      <property name="visible">True</property> +	      <property name="homogeneous">False</property> +	      <property name="spacing">0</property> + +	      <child> +		<widget class="GtkVBox" id="vbox6"> +		  <property name="border_width">1</property> +		  <property name="visible">True</property> +		  <property name="homogeneous">False</property> +		  <property name="spacing">1</property> + +		  <child> +		    <widget class="GtkFrame" id="frame3"> +		      <property name="border_width">2</property> +		      <property name="visible">True</property> +		      <property name="label_xalign">0</property> +		      <property name="label_yalign">0.5</property> +		      <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> + +		      <child> +			<widget class="GtkTable" id="table1"> +			  <property name="border_width">8</property> +			  <property name="visible">True</property> +			  <property name="n_rows">3</property> +			  <property name="n_columns">6</property> +			  <property name="homogeneous">False</property> +			  <property name="row_spacing">6</property> +			  <property name="column_spacing">11</property> + +			  <child> +			    <widget class="GtkLabel" id="label97"> +			      <property name="width_request">0</property> +			      <property name="height_request">0</property> +			      <property name="visible">True</property> +			      <property name="label" translatable="yes">A</property> +			      <property name="use_underline">False</property> +			      <property name="use_markup">False</property> +			      <property name="justify">GTK_JUSTIFY_CENTER</property> +			      <property name="wrap">False</property> +			      <property name="selectable">False</property> +			      <property name="xalign">0.5</property> +			      <property name="yalign">0.5</property> +			      <property name="xpad">0</property> +			      <property name="ypad">0</property> +			    </widget> +			    <packing> +			      <property name="left_attach">0</property> +			      <property name="right_attach">1</property> +			      <property name="top_attach">0</property> +			      <property name="bottom_attach">1</property> +			      <property name="x_options">fill</property> +			      <property name="y_options"></property> +			    </packing> +			  </child> + +			  <child> +			    <widget class="GtkLabel" id="label100"> +			      <property name="width_request">0</property> +			      <property name="height_request">0</property> +			      <property name="visible">True</property> +			      <property name="label" translatable="yes">I1</property> +			      <property name="use_underline">False</property> +			      <property name="use_markup">False</property> +			      <property name="justify">GTK_JUSTIFY_CENTER</property> +			      <property name="wrap">False</property> +			      <property name="selectable">False</property> +			      <property name="xalign">0.5</property> +			      <property name="yalign">0.5</property> +			      <property name="xpad">0</property> +			      <property name="ypad">0</property> +			    </widget> +			    <packing> +			      <property name="left_attach">2</property> +			      <property name="right_attach">3</property> +			      <property name="top_attach">0</property> +			      <property name="bottom_attach">1</property> +			      <property name="x_options">fill</property> +			      <property name="y_options"></property> +			    </packing> +			  </child> + +			  <child> +			    <widget class="GtkLabel" id="label101"> +			      <property name="width_request">0</property> +			      <property name="height_request">0</property> +			      <property name="visible">True</property> +			      <property name="label" translatable="yes">I2</property> +			      <property name="use_underline">False</property> +			      <property name="use_markup">False</property> +			      <property name="justify">GTK_JUSTIFY_CENTER</property> +			      <property name="wrap">False</property> +			      <property name="selectable">False</property> +			      <property name="xalign">0.5</property> +			      <property name="yalign">0.5</property> +			      <property name="xpad">0</property> +			      <property name="ypad">0</property> +			    </widget> +			    <packing> +			      <property name="left_attach">2</property> +			      <property name="right_attach">3</property> +			      <property name="top_attach">1</property> +			      <property name="bottom_attach">2</property> +			      <property name="x_options">fill</property> +			      <property name="y_options"></property> +			    </packing> +			  </child> + +			  <child> +			    <widget class="GtkEntry" id="rA_entry"> +			      <property name="width_request">0</property> +			      <property name="height_request">0</property> +			      <property name="visible">True</property> +			      <property name="can_default">True</property> +			      <property name="has_default">True</property> +			      <property name="editable">False</property> +			      <property name="visibility">True</property> +			      <property name="max_length">0</property> +			      <property name="text" translatable="yes"></property> +			      <property name="has_frame">True</property> +			      <property name="invisible_char" translatable="yes">*</property> +			      <property name="activates_default">False</property> +			      <property name="width_chars">19</property> +			      <signal name="button_press_event" handler="on_register_click"/> +			    </widget> +			    <packing> +			      <property name="left_attach">1</property> +			      <property name="right_attach">2</property> +			      <property name="top_attach">0</property> +			      <property name="bottom_attach">1</property> +			      <property name="x_options"></property> +			      <property name="y_options"></property> +			    </packing> +			  </child> + +			  <child> +			    <widget class="GtkEntry" id="rI1_entry"> +			      <property name="width_request">0</property> +			      <property name="height_request">0</property> +			      <property name="visible">True</property> +			      <property name="can_focus">True</property> +			      <property name="editable">False</property> +			      <property name="visibility">True</property> +			      <property name="max_length">0</property> +			      <property name="text" translatable="yes"></property> +			      <property name="has_frame">True</property> +			      <property name="invisible_char" translatable="yes">*</property> +			      <property name="activates_default">False</property> +			      <property name="width_chars">9</property> +			      <signal name="button_press_event" handler="on_register_click"/> +			    </widget> +			    <packing> +			      <property name="left_attach">3</property> +			      <property name="right_attach">4</property> +			      <property name="top_attach">1</property> +			      <property name="bottom_attach">2</property> +			      <property name="x_options"></property> +			      <property name="y_options"></property> +			    </packing> +			  </child> + +			  <child> +			    <widget class="GtkEntry" id="rI2_entry"> +			      <property name="width_request">0</property> +			      <property name="height_request">0</property> +			      <property name="visible">True</property> +			      <property name="can_focus">True</property> +			      <property name="editable">False</property> +			      <property name="visibility">True</property> +			      <property name="max_length">0</property> +			      <property name="text" translatable="yes"></property> +			      <property name="has_frame">True</property> +			      <property name="invisible_char" translatable="yes">*</property> +			      <property name="activates_default">False</property> +			      <property name="width_chars">9</property> +			      <signal name="button_press_event" handler="on_register_click"/> +			    </widget> +			    <packing> +			      <property name="left_attach">3</property> +			      <property name="right_attach">4</property> +			      <property name="top_attach">0</property> +			      <property name="bottom_attach">1</property> +			      <property name="x_options"></property> +			      <property name="y_options"></property> +			    </packing> +			  </child> + +			  <child> +			    <widget class="GtkLabel" id="label98"> +			      <property name="width_request">0</property> +			      <property name="height_request">0</property> +			      <property name="visible">True</property> +			      <property name="label" translatable="yes">X</property> +			      <property name="use_underline">False</property> +			      <property name="use_markup">False</property> +			      <property name="justify">GTK_JUSTIFY_CENTER</property> +			      <property name="wrap">False</property> +			      <property name="selectable">False</property> +			      <property name="xalign">0.5</property> +			      <property name="yalign">0.5</property> +			      <property name="xpad">0</property> +			      <property name="ypad">0</property> +			    </widget> +			    <packing> +			      <property name="left_attach">0</property> +			      <property name="right_attach">1</property> +			      <property name="top_attach">1</property> +			      <property name="bottom_attach">2</property> +			      <property name="x_options">fill</property> +			      <property name="y_options"></property> +			    </packing> +			  </child> + +			  <child> +			    <widget class="GtkLabel" id="label102"> +			      <property name="width_request">16</property> +			      <property name="height_request">16</property> +			      <property name="visible">True</property> +			      <property name="label" translatable="yes">I3</property> +			      <property name="use_underline">False</property> +			      <property name="use_markup">False</property> +			      <property name="justify">GTK_JUSTIFY_CENTER</property> +			      <property name="wrap">False</property> +			      <property name="selectable">False</property> +			      <property name="xalign">0.5</property> +			      <property name="yalign">0.5</property> +			      <property name="xpad">0</property> +			      <property name="ypad">0</property> +			    </widget> +			    <packing> +			      <property name="left_attach">2</property> +			      <property name="right_attach">3</property> +			      <property name="top_attach">2</property> +			      <property name="bottom_attach">3</property> +			      <property name="x_options">fill</property> +			      <property name="y_options"></property> +			    </packing> +			  </child> + +			  <child> +			    <widget class="GtkLabel" id="label103"> +			      <property name="width_request">0</property> +			      <property name="height_request">0</property> +			      <property name="visible">True</property> +			      <property name="label" translatable="yes">I4</property> +			      <property name="use_underline">False</property> +			      <property name="use_markup">False</property> +			      <property name="justify">GTK_JUSTIFY_CENTER</property> +			      <property name="wrap">False</property> +			      <property name="selectable">False</property> +			      <property name="xalign">0.5</property> +			      <property name="yalign">0.5</property> +			      <property name="xpad">0</property> +			      <property name="ypad">0</property> +			    </widget> +			    <packing> +			      <property name="left_attach">4</property> +			      <property name="right_attach">5</property> +			      <property name="top_attach">0</property> +			      <property name="bottom_attach">1</property> +			      <property name="x_options">fill</property> +			      <property name="y_options"></property> +			    </packing> +			  </child> + +			  <child> +			    <widget class="GtkLabel" id="label104"> +			      <property name="width_request">16</property> +			      <property name="height_request">16</property> +			      <property name="visible">True</property> +			      <property name="label" translatable="yes">I5</property> +			      <property name="use_underline">False</property> +			      <property name="use_markup">False</property> +			      <property name="justify">GTK_JUSTIFY_CENTER</property> +			      <property name="wrap">False</property> +			      <property name="selectable">False</property> +			      <property name="xalign">0.5</property> +			      <property name="yalign">0.5</property> +			      <property name="xpad">0</property> +			      <property name="ypad">0</property> +			    </widget> +			    <packing> +			      <property name="left_attach">4</property> +			      <property name="right_attach">5</property> +			      <property name="top_attach">1</property> +			      <property name="bottom_attach">2</property> +			      <property name="x_options">fill</property> +			      <property name="y_options"></property> +			    </packing> +			  </child> + +			  <child> +			    <widget class="GtkLabel" id="label105"> +			      <property name="width_request">16</property> +			      <property name="height_request">16</property> +			      <property name="visible">True</property> +			      <property name="label" translatable="yes">I6</property> +			      <property name="use_underline">False</property> +			      <property name="use_markup">False</property> +			      <property name="justify">GTK_JUSTIFY_CENTER</property> +			      <property name="wrap">False</property> +			      <property name="selectable">False</property> +			      <property name="xalign">0.5</property> +			      <property name="yalign">0.5</property> +			      <property name="xpad">0</property> +			      <property name="ypad">0</property> +			    </widget> +			    <packing> +			      <property name="left_attach">4</property> +			      <property name="right_attach">5</property> +			      <property name="top_attach">2</property> +			      <property name="bottom_attach">3</property> +			      <property name="x_options">fill</property> +			      <property name="y_options"></property> +			    </packing> +			  </child> + +			  <child> +			    <widget class="GtkLabel" id="label99"> +			      <property name="width_request">0</property> +			      <property name="height_request">0</property> +			      <property name="visible">True</property> +			      <property name="label" translatable="yes">J</property> +			      <property name="use_underline">False</property> +			      <property name="use_markup">False</property> +			      <property name="justify">GTK_JUSTIFY_CENTER</property> +			      <property name="wrap">False</property> +			      <property name="selectable">False</property> +			      <property name="xalign">0.5</property> +			      <property name="yalign">0.5</property> +			      <property name="xpad">0</property> +			      <property name="ypad">0</property> +			    </widget> +			    <packing> +			      <property name="left_attach">0</property> +			      <property name="right_attach">1</property> +			      <property name="top_attach">2</property> +			      <property name="bottom_attach">3</property> +			      <property name="x_options">fill</property> +			      <property name="y_options"></property> +			    </packing> +			  </child> + +			  <child> +			    <widget class="GtkEntry" id="rX_entry"> +			      <property name="width_request">0</property> +			      <property name="height_request">0</property> +			      <property name="visible">True</property> +			      <property name="can_focus">True</property> +			      <property name="editable">False</property> +			      <property name="visibility">True</property> +			      <property name="max_length">0</property> +			      <property name="text" translatable="yes"></property> +			      <property name="has_frame">True</property> +			      <property name="invisible_char" translatable="yes">*</property> +			      <property name="activates_default">False</property> +			      <property name="width_chars">19</property> +			      <signal name="button_press_event" handler="on_register_click"/> +			    </widget> +			    <packing> +			      <property name="left_attach">1</property> +			      <property name="right_attach">2</property> +			      <property name="top_attach">1</property> +			      <property name="bottom_attach">2</property> +			      <property name="x_options"></property> +			      <property name="y_options"></property> +			    </packing> +			  </child> + +			  <child> +			    <widget class="GtkEntry" id="rI4_entry"> +			      <property name="width_request">0</property> +			      <property name="height_request">0</property> +			      <property name="visible">True</property> +			      <property name="can_focus">True</property> +			      <property name="editable">False</property> +			      <property name="visibility">True</property> +			      <property name="max_length">0</property> +			      <property name="text" translatable="yes"></property> +			      <property name="has_frame">True</property> +			      <property name="invisible_char" translatable="yes">*</property> +			      <property name="activates_default">False</property> +			      <property name="width_chars">9</property> +			      <signal name="button_press_event" handler="on_register_click"/> +			    </widget> +			    <packing> +			      <property name="left_attach">5</property> +			      <property name="right_attach">6</property> +			      <property name="top_attach">0</property> +			      <property name="bottom_attach">1</property> +			      <property name="x_options"></property> +			      <property name="y_options"></property> +			    </packing> +			  </child> + +			  <child> +			    <widget class="GtkEntry" id="rI5_entry"> +			      <property name="width_request">0</property> +			      <property name="height_request">0</property> +			      <property name="visible">True</property> +			      <property name="can_focus">True</property> +			      <property name="editable">False</property> +			      <property name="visibility">True</property> +			      <property name="max_length">0</property> +			      <property name="text" translatable="yes"></property> +			      <property name="has_frame">True</property> +			      <property name="invisible_char" translatable="yes">*</property> +			      <property name="activates_default">False</property> +			      <property name="width_chars">9</property> +			      <signal name="button_press_event" handler="on_register_click"/> +			    </widget> +			    <packing> +			      <property name="left_attach">5</property> +			      <property name="right_attach">6</property> +			      <property name="top_attach">1</property> +			      <property name="bottom_attach">2</property> +			      <property name="x_options"></property> +			      <property name="y_options"></property> +			    </packing> +			  </child> + +			  <child> +			    <widget class="GtkEntry" id="rI6_entry"> +			      <property name="width_request">0</property> +			      <property name="height_request">0</property> +			      <property name="visible">True</property> +			      <property name="can_focus">True</property> +			      <property name="editable">False</property> +			      <property name="visibility">True</property> +			      <property name="max_length">0</property> +			      <property name="text" translatable="yes"></property> +			      <property name="has_frame">True</property> +			      <property name="invisible_char" translatable="yes">*</property> +			      <property name="activates_default">False</property> +			      <property name="width_chars">9</property> +			      <signal name="button_press_event" handler="on_register_click"/> +			    </widget> +			    <packing> +			      <property name="left_attach">5</property> +			      <property name="right_attach">6</property> +			      <property name="top_attach">2</property> +			      <property name="bottom_attach">3</property> +			      <property name="x_options"></property> +			      <property name="y_options"></property> +			    </packing> +			  </child> + +			  <child> +			    <widget class="GtkEntry" id="rI3_entry"> +			      <property name="width_request">0</property> +			      <property name="height_request">0</property> +			      <property name="visible">True</property> +			      <property name="can_focus">True</property> +			      <property name="editable">False</property> +			      <property name="visibility">True</property> +			      <property name="max_length">0</property> +			      <property name="text" translatable="yes"></property> +			      <property name="has_frame">True</property> +			      <property name="invisible_char" translatable="yes">*</property> +			      <property name="activates_default">False</property> +			      <property name="width_chars">9</property> +			      <signal name="button_press_event" handler="on_register_click"/> +			    </widget> +			    <packing> +			      <property name="left_attach">3</property> +			      <property name="right_attach">4</property> +			      <property name="top_attach">2</property> +			      <property name="bottom_attach">3</property> +			      <property name="x_options"></property> +			      <property name="y_options"></property> +			    </packing> +			  </child> + +			  <child> +			    <widget class="GtkHBox" id="hbox22"> +			      <property name="visible">True</property> +			      <property name="homogeneous">False</property> +			      <property name="spacing">0</property> + +			      <child> +				<widget class="GtkEntry" id="rJ_entry"> +				  <property name="width_request">0</property> +				  <property name="height_request">0</property> +				  <property name="visible">True</property> +				  <property name="can_focus">True</property> +				  <property name="editable">False</property> +				  <property name="visibility">True</property> +				  <property name="max_length">0</property> +				  <property name="text" translatable="yes"></property> +				  <property name="has_frame">True</property> +				  <property name="invisible_char" translatable="yes">*</property> +				  <property name="activates_default">False</property> +				  <property name="width_chars">9</property> +				  <signal name="button_press_event" handler="on_register_click"/> +				</widget> +				<packing> +				  <property name="padding">0</property> +				  <property name="expand">False</property> +				  <property name="fill">False</property> +				</packing> +			      </child> + +			      <child> +				<placeholder/> +			      </child> +			    </widget> +			    <packing> +			      <property name="left_attach">1</property> +			      <property name="right_attach">2</property> +			      <property name="top_attach">2</property> +			      <property name="bottom_attach">3</property> +			      <property name="x_options">fill</property> +			      <property name="y_options">fill</property> +			    </packing> +			  </child> +			</widget> +		      </child> + +		      <child> +			<widget class="GtkLabel" id="label264"> +			  <property name="visible">True</property> +			  <property name="label" translatable="yes">Registers </property> +			  <property name="use_underline">False</property> +			  <property name="use_markup">False</property> +			  <property name="justify">GTK_JUSTIFY_LEFT</property> +			  <property name="wrap">False</property> +			  <property name="selectable">False</property> +			  <property name="xalign">0.5</property> +			  <property name="yalign">0.5</property> +			  <property name="xpad">2</property> +			  <property name="ypad">0</property> +			</widget> +			<packing> +			  <property name="type">label_item</property> +			</packing> +		      </child> +		    </widget> +		    <packing> +		      <property name="padding">5</property> +		      <property name="expand">False</property> +		      <property name="fill">True</property> +		    </packing> +		  </child> + +		  <child> +		    <widget class="GtkHBox" id="hbox7"> +		      <property name="visible">True</property> +		      <property name="homogeneous">False</property> +		      <property name="spacing">0</property> + +		      <child> +			<widget class="GtkFrame" id="frame5"> +			  <property name="border_width">2</property> +			  <property name="visible">True</property> +			  <property name="label_xalign">0</property> +			  <property name="label_yalign">0.5</property> +			  <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> + +			  <child> +			    <widget class="GtkHBox" id="hbox6"> +			      <property name="border_width">1</property> +			      <property name="visible">True</property> +			      <property name="homogeneous">False</property> +			      <property name="spacing">5</property> + +			      <child> +				<widget class="GtkRadioButton" id="greater_radio"> +				  <property name="border_width">2</property> +				  <property name="width_request">0</property> +				  <property name="height_request">0</property> +				  <property name="visible">True</property> +				  <property name="tooltip" translatable="yes">Greater</property> +				  <property name="can_focus">True</property> +				  <property name="label" translatable="yes">G</property> +				  <property name="use_underline">True</property> +				  <property name="relief">GTK_RELIEF_NORMAL</property> +				  <property name="focus_on_click">True</property> +				  <property name="active">False</property> +				  <property name="inconsistent">False</property> +				  <property name="draw_indicator">True</property> +				  <signal name="toggled" handler="on_cmp_g_toggled"/> +				</widget> +				<packing> +				  <property name="padding">0</property> +				  <property name="expand">False</property> +				  <property name="fill">False</property> +				</packing> +			      </child> + +			      <child> +				<widget class="GtkRadioButton" id="equal_radio"> +				  <property name="border_width">2</property> +				  <property name="width_request">0</property> +				  <property name="height_request">0</property> +				  <property name="visible">True</property> +				  <property name="tooltip" translatable="yes">Equal</property> +				  <property name="can_focus">True</property> +				  <property name="label" translatable="yes">E</property> +				  <property name="use_underline">True</property> +				  <property name="relief">GTK_RELIEF_NORMAL</property> +				  <property name="focus_on_click">True</property> +				  <property name="active">False</property> +				  <property name="inconsistent">False</property> +				  <property name="draw_indicator">True</property> +				  <property name="group">greater_radio</property> +				  <signal name="toggled" handler="on_cmp_e_toggled"/> +				</widget> +				<packing> +				  <property name="padding">0</property> +				  <property name="expand">False</property> +				  <property name="fill">False</property> +				</packing> +			      </child> + +			      <child> +				<widget class="GtkRadioButton" id="lesser_radio"> +				  <property name="border_width">2</property> +				  <property name="width_request">0</property> +				  <property name="height_request">0</property> +				  <property name="visible">True</property> +				  <property name="tooltip" translatable="yes">Lesser</property> +				  <property name="can_focus">True</property> +				  <property name="label" translatable="yes">L</property> +				  <property name="use_underline">True</property> +				  <property name="relief">GTK_RELIEF_NORMAL</property> +				  <property name="focus_on_click">True</property> +				  <property name="active">False</property> +				  <property name="inconsistent">False</property> +				  <property name="draw_indicator">True</property> +				  <property name="group">greater_radio</property> +				  <signal name="toggled" handler="on_cmp_l_toggled"/> +				</widget> +				<packing> +				  <property name="padding">0</property> +				  <property name="expand">False</property> +				  <property name="fill">False</property> +				</packing> +			      </child> + +			      <child> +				<widget class="GtkVSeparator" id="vseparator9"> +				  <property name="height_request">7</property> +				  <property name="visible">True</property> +				</widget> +				<packing> +				  <property name="padding">0</property> +				  <property name="expand">False</property> +				  <property name="fill">False</property> +				</packing> +			      </child> + +			      <child> +				<widget class="GtkCheckButton" id="over_toggle"> +				  <property name="visible">True</property> +				  <property name="can_focus">True</property> +				  <property name="label" translatable="yes">Overflow</property> +				  <property name="use_underline">True</property> +				  <property name="relief">GTK_RELIEF_NORMAL</property> +				  <property name="focus_on_click">True</property> +				  <property name="active">False</property> +				  <property name="inconsistent">False</property> +				  <property name="draw_indicator">True</property> +				  <signal name="toggled" handler="on_overflow_toggled" last_modification_time="Mon, 21 Jun 2004 11:44:04 GMT"/> +				</widget> +				<packing> +				  <property name="padding">0</property> +				  <property name="expand">False</property> +				  <property name="fill">False</property> +				</packing> +			      </child> +			    </widget> +			  </child> + +			  <child> +			    <widget class="GtkLabel" id="label266"> +			      <property name="visible">True</property> +			      <property name="label" translatable="yes">Flags </property> +			      <property name="use_underline">False</property> +			      <property name="use_markup">False</property> +			      <property name="justify">GTK_JUSTIFY_LEFT</property> +			      <property name="wrap">False</property> +			      <property name="selectable">False</property> +			      <property name="xalign">0.5</property> +			      <property name="yalign">0.5</property> +			      <property name="xpad">2</property> +			      <property name="ypad">0</property> +			    </widget> +			    <packing> +			      <property name="type">label_item</property> +			    </packing> +			  </child> +			</widget> +			<packing> +			  <property name="padding">0</property> +			  <property name="expand">False</property> +			  <property name="fill">False</property> +			</packing> +		      </child> + +		      <child> +			<placeholder/> +		      </child> + +		      <child> +			<widget class="GtkFrame" id="frame6"> +			  <property name="border_width">2</property> +			  <property name="visible">True</property> +			  <property name="label_xalign">0</property> +			  <property name="label_yalign">0.5</property> +			  <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> + +			  <child> +			    <widget class="GtkHBox" id="hbox7"> +			      <property name="border_width">4</property> +			      <property name="visible">True</property> +			      <property name="homogeneous">False</property> +			      <property name="spacing">1</property> + +			      <child> +				<widget class="GtkEntry" id="loc_entry"> +				  <property name="width_request">0</property> +				  <property name="height_request">0</property> +				  <property name="visible">True</property> +				  <property name="can_focus">True</property> +				  <property name="editable">False</property> +				  <property name="visibility">True</property> +				  <property name="max_length">4</property> +				  <property name="text" translatable="yes">0</property> +				  <property name="has_frame">True</property> +				  <property name="invisible_char" translatable="yes">*</property> +				  <property name="activates_default">False</property> +				  <property name="width_chars">6</property> +				</widget> +				<packing> +				  <property name="padding">5</property> +				  <property name="expand">False</property> +				  <property name="fill">False</property> +				</packing> +			      </child> + +			      <child> +				<widget class="GtkButton" id="loc_arrow"> +				  <property name="visible">True</property> +				  <property name="tooltip" translatable="yes">View loc address</property> +				  <property name="can_focus">True</property> +				  <property name="relief">GTK_RELIEF_NORMAL</property> +				  <property name="focus_on_click">True</property> +				  <signal name="clicked" handler="on_loc_arrow_clicked"/> + +				  <child> +				    <widget class="GtkImage" id="image4"> +				      <property name="visible">True</property> +				      <property name="stock">gtk-jump-to</property> +				      <property name="icon_size">4</property> +				      <property name="xalign">0.5</property> +				      <property name="yalign">0.5</property> +				      <property name="xpad">0</property> +				      <property name="ypad">0</property> +				    </widget> +				  </child> +				</widget> +				<packing> +				  <property name="padding">1</property> +				  <property name="expand">False</property> +				  <property name="fill">False</property> +				</packing> +			      </child> +			    </widget> +			  </child> + +			  <child> +			    <widget class="GtkLabel" id="label1323"> +			      <property name="visible">True</property> +			      <property name="label" translatable="yes">Location </property> +			      <property name="use_underline">False</property> +			      <property name="use_markup">False</property> +			      <property name="justify">GTK_JUSTIFY_LEFT</property> +			      <property name="wrap">False</property> +			      <property name="selectable">False</property> +			      <property name="xalign">0.5</property> +			      <property name="yalign">0.5</property> +			      <property name="xpad">2</property> +			      <property name="ypad">0</property> +			    </widget> +			    <packing> +			      <property name="type">label_item</property> +			    </packing> +			  </child> +			</widget> +			<packing> +			  <property name="padding">0</property> +			  <property name="expand">False</property> +			  <property name="fill">False</property> +			  <property name="pack_type">GTK_PACK_END</property> +			</packing> +		      </child> +		    </widget> +		    <packing> +		      <property name="padding">5</property> +		      <property name="expand">False</property> +		      <property name="fill">True</property> +		    </packing> +		  </child> + +		  <child> +		    <widget class="GtkFrame" id="frame2"> +		      <property name="border_width">2</property> +		      <property name="visible">True</property> +		      <property name="label_xalign">0</property> +		      <property name="label_yalign">0.5</property> +		      <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> + +		      <child> +			<widget class="GtkHBox" id="hbox4"> +			  <property name="border_width">5</property> +			  <property name="visible">True</property> +			  <property name="homogeneous">True</property> +			  <property name="spacing">5</property> + +			  <child> +			    <widget class="GtkLabel" id="label258"> +			      <property name="width_request">0</property> +			      <property name="height_request">0</property> +			      <property name="visible">True</property> +			      <property name="label" translatable="yes">Uptime:</property> +			      <property name="use_underline">False</property> +			      <property name="use_markup">False</property> +			      <property name="justify">GTK_JUSTIFY_LEFT</property> +			      <property name="wrap">False</property> +			      <property name="selectable">False</property> +			      <property name="xalign">0.5</property> +			      <property name="yalign">0.5</property> +			      <property name="xpad">0</property> +			      <property name="ypad">0</property> +			    </widget> +			    <packing> +			      <property name="padding">0</property> +			      <property name="expand">False</property> +			      <property name="fill">False</property> +			    </packing> +			  </child> + +			  <child> +			    <widget class="GtkLabel" id="uptime_label"> +			      <property name="width_request">0</property> +			      <property name="height_request">0</property> +			      <property name="visible">True</property> +			      <property name="label" translatable="yes">00000000</property> +			      <property name="use_underline">False</property> +			      <property name="use_markup">False</property> +			      <property name="justify">GTK_JUSTIFY_CENTER</property> +			      <property name="wrap">False</property> +			      <property name="selectable">False</property> +			      <property name="xalign">0.5</property> +			      <property name="yalign">0.5</property> +			      <property name="xpad">5</property> +			      <property name="ypad">0</property> +			    </widget> +			    <packing> +			      <property name="padding">0</property> +			      <property name="expand">False</property> +			      <property name="fill">False</property> +			    </packing> +			  </child> + +			  <child> +			    <widget class="GtkLabel" id="label260"> +			      <property name="width_request">0</property> +			      <property name="height_request">0</property> +			      <property name="visible">True</property> +			      <property name="label" translatable="yes">Elapsed:</property> +			      <property name="use_underline">False</property> +			      <property name="use_markup">False</property> +			      <property name="justify">GTK_JUSTIFY_LEFT</property> +			      <property name="wrap">False</property> +			      <property name="selectable">False</property> +			      <property name="xalign">0.5</property> +			      <property name="yalign">0.5</property> +			      <property name="xpad">0</property> +			      <property name="ypad">0</property> +			    </widget> +			    <packing> +			      <property name="padding">3</property> +			      <property name="expand">False</property> +			      <property name="fill">False</property> +			    </packing> +			  </child> + +			  <child> +			    <widget class="GtkLabel" id="elapsed_label"> +			      <property name="width_request">0</property> +			      <property name="height_request">0</property> +			      <property name="visible">True</property> +			      <property name="label" translatable="yes">000000</property> +			      <property name="use_underline">False</property> +			      <property name="use_markup">False</property> +			      <property name="justify">GTK_JUSTIFY_CENTER</property> +			      <property name="wrap">False</property> +			      <property name="selectable">False</property> +			      <property name="xalign">0.5</property> +			      <property name="yalign">0.5</property> +			      <property name="xpad">5</property> +			      <property name="ypad">0</property> +			    </widget> +			    <packing> +			      <property name="padding">0</property> +			      <property name="expand">False</property> +			      <property name="fill">False</property> +			    </packing> +			  </child> + +			  <child> +			    <widget class="GtkLabel" id="label261"> +			      <property name="width_request">0</property> +			      <property name="height_request">0</property> +			      <property name="visible">True</property> +			      <property name="label" translatable="yes">Program:</property> +			      <property name="use_underline">False</property> +			      <property name="use_markup">False</property> +			      <property name="justify">GTK_JUSTIFY_LEFT</property> +			      <property name="wrap">False</property> +			      <property name="selectable">False</property> +			      <property name="xalign">0.5</property> +			      <property name="yalign">0.5</property> +			      <property name="xpad">0</property> +			      <property name="ypad">0</property> +			    </widget> +			    <packing> +			      <property name="padding">2</property> +			      <property name="expand">False</property> +			      <property name="fill">False</property> +			    </packing> +			  </child> + +			  <child> +			    <widget class="GtkLabel" id="program_label"> +			      <property name="width_request">0</property> +			      <property name="height_request">0</property> +			      <property name="visible">True</property> +			      <property name="label" translatable="yes">000000</property> +			      <property name="use_underline">False</property> +			      <property name="use_markup">False</property> +			      <property name="justify">GTK_JUSTIFY_CENTER</property> +			      <property name="wrap">False</property> +			      <property name="selectable">False</property> +			      <property name="xalign">0.5</property> +			      <property name="yalign">0.5</property> +			      <property name="xpad">5</property> +			      <property name="ypad">0</property> +			    </widget> +			    <packing> +			      <property name="padding">0</property> +			      <property name="expand">False</property> +			      <property name="fill">False</property> +			    </packing> +			  </child> +			</widget> +		      </child> + +		      <child> +			<widget class="GtkLabel" id="label263"> +			  <property name="visible">True</property> +			  <property name="label" translatable="yes">Times </property> +			  <property name="use_underline">False</property> +			  <property name="use_markup">False</property> +			  <property name="justify">GTK_JUSTIFY_CENTER</property> +			  <property name="wrap">False</property> +			  <property name="selectable">False</property> +			  <property name="xalign">0.5</property> +			  <property name="yalign">0.5</property> +			  <property name="xpad">2</property> +			  <property name="ypad">0</property> +			</widget> +			<packing> +			  <property name="type">label_item</property> +			</packing> +		      </child> +		    </widget> +		    <packing> +		      <property name="padding">5</property> +		      <property name="expand">False</property> +		      <property name="fill">True</property> +		    </packing> +		  </child> +		</widget> +		<packing> +		  <property name="padding">2</property> +		  <property name="expand">False</property> +		  <property name="fill">False</property> +		</packing> +	      </child> + +	      <child> +		<widget class="GtkFrame" id="frame4"> +		  <property name="border_width">7</property> +		  <property name="visible">True</property> +		  <property name="label_xalign">0</property> +		  <property name="label_yalign">0.5</property> +		  <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> + +		  <child> +		    <widget class="GtkScrolledWindow" id="memory_scroll"> +		      <property name="border_width">5</property> +		      <property name="visible">True</property> +		      <property name="can_focus">True</property> +		      <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property> +		      <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property> +		      <property name="shadow_type">GTK_SHADOW_IN</property> +		      <property name="window_placement">GTK_CORNER_TOP_LEFT</property> + +		      <child> +			<widget class="GtkTreeView" id="memory_cells"> +			  <property name="visible">True</property> +			  <property name="can_focus">True</property> +			  <property name="events">GDK_BUTTON_PRESS_MASK</property> +			  <property name="headers_visible">True</property> +			  <property name="rules_hint">True</property> +			  <property name="reorderable">False</property> +			  <property name="enable_search">True</property> +			</widget> +		      </child> +		    </widget> +		  </child> + +		  <child> +		    <widget class="GtkLabel" id="label265"> +		      <property name="visible">True</property> +		      <property name="label" translatable="yes">Memory </property> +		      <property name="use_underline">False</property> +		      <property name="use_markup">False</property> +		      <property name="justify">GTK_JUSTIFY_LEFT</property> +		      <property name="wrap">False</property> +		      <property name="selectable">False</property> +		      <property name="xalign">0.5</property> +		      <property name="yalign">0.5</property> +		      <property name="xpad">2</property> +		      <property name="ypad">0</property> +		    </widget> +		    <packing> +		      <property name="type">label_item</property> +		    </packing> +		  </child> +		</widget> +		<packing> +		  <property name="padding">3</property> +		  <property name="expand">True</property> +		  <property name="fill">True</property> +		  <property name="pack_type">GTK_PACK_END</property> +		</packing> +	      </child> +	    </widget> +	  </child> + +	  <child> +	    <widget class="GtkLabel" id="label1414"> +	      <property name="visible">True</property> +	      <property name="label" translatable="yes">MIX Virtual Machine </property> +	      <property name="use_underline">False</property> +	      <property name="use_markup">False</property> +	      <property name="justify">GTK_JUSTIFY_LEFT</property> +	      <property name="wrap">False</property> +	      <property name="selectable">False</property> +	      <property name="xalign">0.5</property> +	      <property name="yalign">0.5</property> +	      <property name="xpad">2</property> +	      <property name="ypad">0</property> +	    </widget> +	    <packing> +	      <property name="type">label_item</property> +	    </packing> +	  </child> +	</widget> +	<packing> +	  <property name="padding">0</property> +	  <property name="expand">True</property> +	  <property name="fill">True</property> +	</packing> +      </child> +    </widget> +  </child> +</widget> + +<widget class="GtkDialog" id="input_dialog"> +  <property name="visible">True</property> +  <property name="title" translatable="yes">MIX Console input</property> +  <property name="type">GTK_WINDOW_TOPLEVEL</property> +  <property name="window_position">GTK_WIN_POS_NONE</property> +  <property name="modal">True</property> +  <property name="resizable">True</property> +  <property name="destroy_with_parent">False</property> +  <property name="decorated">True</property> +  <property name="skip_taskbar_hint">False</property> +  <property name="skip_pager_hint">False</property> +  <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property> +  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> +  <property name="has_separator">True</property> +  <signal name="destroy_event" handler="gtk_widget_hide" last_modification_time="Wed, 23 Jun 2004 20:54:59 GMT"/> +  <signal name="close" handler="gtk_widget_hide" last_modification_time="Wed, 23 Jun 2004 20:55:16 GMT"/> + +  <child internal-child="vbox"> +    <widget class="GtkVBox" id="dialog-vbox12"> +      <property name="visible">True</property> +      <property name="homogeneous">False</property> +      <property name="spacing">0</property> + +      <child internal-child="action_area"> +	<widget class="GtkHButtonBox" id="dialog-action_area12"> +	  <property name="visible">True</property> +	  <property name="layout_style">GTK_BUTTONBOX_END</property> + +	  <child> +	    <widget class="GtkButton" id="okbutton1"> +	      <property name="visible">True</property> +	      <property name="can_default">True</property> +	      <property name="has_default">True</property> +	      <property name="can_focus">True</property> +	      <property name="label">gtk-ok</property> +	      <property name="use_stock">True</property> +	      <property name="relief">GTK_RELIEF_NORMAL</property> +	      <property name="focus_on_click">True</property> +	      <property name="response_id">-5</property> +	    </widget> +	  </child> +	</widget> +	<packing> +	  <property name="padding">0</property> +	  <property name="expand">False</property> +	  <property name="fill">True</property> +	  <property name="pack_type">GTK_PACK_END</property> +	</packing> +      </child> + +      <child> +	<widget class="GtkVBox" id="vbox7"> +	  <property name="border_width">3</property> +	  <property name="visible">True</property> +	  <property name="homogeneous">True</property> +	  <property name="spacing">0</property> + +	  <child> +	    <widget class="GtkLabel" id="label1438"> +	      <property name="visible">True</property> +	      <property name="label" translatable="yes">Enter up to 70 characters</property> +	      <property name="use_underline">False</property> +	      <property name="use_markup">False</property> +	      <property name="justify">GTK_JUSTIFY_LEFT</property> +	      <property name="wrap">False</property> +	      <property name="selectable">False</property> +	      <property name="xalign">0.5</property> +	      <property name="yalign">0.5</property> +	      <property name="xpad">0</property> +	      <property name="ypad">0</property> +	    </widget> +	    <packing> +	      <property name="padding">0</property> +	      <property name="expand">False</property> +	      <property name="fill">False</property> +	    </packing> +	  </child> + +	  <child> +	    <widget class="GtkEntry" id="input_entry"> +	      <property name="visible">True</property> +	      <property name="can_focus">True</property> +	      <property name="editable">True</property> +	      <property name="visibility">True</property> +	      <property name="max_length">70</property> +	      <property name="text" translatable="yes"></property> +	      <property name="has_frame">True</property> +	      <property name="invisible_char" translatable="yes">*</property> +	      <property name="activates_default">True</property> +	      <property name="width_chars">70</property> +	    </widget> +	    <packing> +	      <property name="padding">0</property> +	      <property name="expand">False</property> +	      <property name="fill">False</property> +	    </packing> +	  </child> +	</widget> +	<packing> +	  <property name="padding">0</property> +	  <property name="expand">False</property> +	  <property name="fill">False</property> +	</packing> +      </child> +    </widget> +  </child> +</widget> + +</glade-interface> diff --git a/mixgtk/mixgtk.gladep b/mixgtk/mixgtk.gladep new file mode 100644 index 0000000..40a311a --- /dev/null +++ b/mixgtk/mixgtk.gladep @@ -0,0 +1,9 @@ +<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> +<!DOCTYPE glade-project SYSTEM "http://glade.gnome.org/glade-project-2.0.dtd"> + +<glade-project> +  <name>Mixgtk</name> +  <program_name>mixgtk</program_name> +  <pixmaps_directory>.</pixmaps_directory> +  <gnome_support>FALSE</gnome_support> +</glade-project> diff --git a/mixgtk/mixgtk.h b/mixgtk/mixgtk.h new file mode 100644 index 0000000..913c245 --- /dev/null +++ b/mixgtk/mixgtk.h @@ -0,0 +1,49 @@ +/* -*-c-*- ---------------- mixgtk.h : + * Gmixvm initialisation and cleanup functions + * ------------------------------------------------------------------ + *  Last change: Time-stamp: <2001-04-29 12:06:48 jao> + * ------------------------------------------------------------------ + * Copyright (C) 2001, 2004 Free Software Foundation, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + + +#ifndef MIXGTK_H +#define MIXGTK_H + +#include <gtk/gtk.h> +#include <mixlib/mix.h> + +/* the app files directory */ +#define MIXGTK_FILES_DIR  ".mdk" + +/* initialise the app */ +extern gboolean +mixgtk_init (int argc, char *argv[]); + +/* enter the main mixgtk loop */ +extern void +mixgtk_main (void); + +/* clean up */ +extern void +mixgtk_release (void); + + + +#endif /* MIXGTK_H */ + diff --git a/mixgtk/mixgtk_cmd_dispatcher.c b/mixgtk/mixgtk_cmd_dispatcher.c new file mode 100644 index 0000000..dbb2909 --- /dev/null +++ b/mixgtk/mixgtk_cmd_dispatcher.c @@ -0,0 +1,547 @@ +/* -*-c-*- -------------- mixgtk_cmd_dispatcher.c : + * Implementation of the functions declared in mixgtk_cmd_dispatcher.h + * ------------------------------------------------------------------ + * $Id: mixgtk_cmd_dispatcher.c,v 1.24 2005/09/20 19:43:14 jao Exp $ + * ------------------------------------------------------------------ + * Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include <stdlib.h> +#include <stdio.h> +#include <string.h> +#include <ctype.h> +#include <unistd.h> +#include <fcntl.h> +#include <errno.h> + +#include <mixlib/mix.h> + +#ifdef HAVE_LIBHISTORY +#  include <readline/history.h> +#endif + +#ifdef MAKE_GUILE +#  include <mixguile/mixguile.h> +#endif + +#include <gdk/gdkkeysyms.h> +#include <mixlib/mix_vm_command.h> +#include "mixgtk_mixvm.h" +#include "mixgtk_mixal.h" +#include "mixgtk_fontsel.h" +#include "mixgtk_config.h" +#include "mixgtk_cmd_dispatcher.h" + + +/* a mix vm command dispatcher */ +typedef struct mixgtk_dispatch_ +{ +  mix_vm_cmd_dispatcher_t *dispatcher; /* the underlying cmd dispatcher */ +  FILE *out;			/* the dispatcher's output file */ +  int fildes[2];		/* pipe for communication with the dispatcher */ +  GtkWidget *prompt;		/* the command prompt widget */ +  GtkWidget *log;		/* the dispatcher's messages echo area */ +  GtkWidget *status;		/* the status bar widget */ +  guint context;		/* context of the status bar messages */ +  gchar *last_file; +} mixgtk_dispatch_data_t; + +static struct mixgtk_dispatch_ dis_data_ = {NULL}; + +static GtkWidget *ext_dlg_ = NULL; +static GtkWidget *ed_entry_ = NULL; +static GtkWidget *asm_entry_ = NULL; + +static const gchar *ED_NAME_ = "editor_entry"; +static const gchar *ASM_NAME_ = "mixasm_entry"; + +static const gchar *TITLE_FORMAT_ = "gmixvm - %s"; + +static void +log_command_ (mixgtk_dispatch_data_t *dis, const gchar *cmd) +{ +  GtkTextBuffer *buf = gtk_text_view_get_buffer (GTK_TEXT_VIEW (dis->log)); +  GtkTextIter end; + +  gtk_text_buffer_get_end_iter (buf, &end); +  gtk_text_buffer_place_cursor (buf, &end); +  gtk_text_buffer_insert_at_cursor (buf, "MIX> ", -1); +  gtk_text_buffer_insert_at_cursor (buf, cmd, -1); +  gtk_text_buffer_insert_at_cursor (buf, "\n", -1); + +#ifdef HAVE_LIBHISTORY +  add_history ((char *)cmd); +/*  history_search ((char *)cmd, 0); */ +  history_set_pos (history_base + history_length - 1); +#endif +} + +static void +flush_log_ (mixgtk_dispatch_data_t *dis) +{ +  enum {BLKSIZE = 100}; +  static gchar BUFFER[BLKSIZE]; + +  GtkTextBuffer *buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (dis->log)); +  GtkTextMark *mark; +  GtkTextIter end; +  ssize_t k; + +  gtk_text_buffer_get_end_iter (buffer, &end); +  gtk_text_buffer_place_cursor (buffer, &end); + +  fflush (dis->out); +  while ((k = read (dis->fildes[0], BUFFER, BLKSIZE)) != 0) +    { +      if (k == -1 && errno != EINTR) break; +      if (k != -1) +	gtk_text_buffer_insert_at_cursor (buffer, BUFFER, k); +    } + +  mark = gtk_text_buffer_get_insert (buffer); +  gtk_text_view_scroll_to_mark (GTK_TEXT_VIEW (dis->log), mark, 0, +                                TRUE, 0, 0); +} + +/* hooks */ +static void +global_post_hook_ (mix_vm_cmd_dispatcher_t *dis, +		   mix_vm_command_t cmd, const gchar *arg, gpointer data) +{ +  flush_log_ ((mixgtk_dispatch_data_t *)data); +  mixgtk_mixvm_update_vm_widgets (); +} + +static void +load_post_hook_ (mix_vm_cmd_dispatcher_t *dis, const gchar *arg, +		 gpointer data) +{ +  static glong id = -1; + +  if (mix_vm_cmd_dispatcher_get_last_result (dis)) +    { +      GtkWindow *mainw = +	GTK_WINDOW (mixgtk_widget_factory_get_dialog (MIXGTK_MAIN)); + +      if (dis_data_.last_file) g_free (dis_data_.last_file); +      dis_data_.last_file = g_strdup_printf (TITLE_FORMAT_, arg); +      gtk_window_set_title (mainw, dis_data_.last_file); + +      mixgtk_mixal_load_file (); +      mixgtk_mixal_update (); +      mixgtk_mixal_update_bp_all (); + +      if (id != -1) +	gtk_statusbar_remove (GTK_STATUSBAR (dis_data_.status), +			      dis_data_.context, (guint)id); +      id = +	gtk_statusbar_push (GTK_STATUSBAR (dis_data_.status), dis_data_.context, +			    dis_data_.last_file); +    } +} + +static void +run_post_hook_ (mix_vm_cmd_dispatcher_t *dis, const gchar *arg, +		 gpointer data) +{ +  mixgtk_mixal_update (); +} + +static void +next_post_hook_ (mix_vm_cmd_dispatcher_t *dis, const gchar *arg, +		 gpointer data) +{ +  mixgtk_mixal_update (); +} + +static void +linebp_post_hook_ (mix_vm_cmd_dispatcher_t *dis, const gchar *arg, +		gpointer data) +{ +  if (arg && strlen (arg)) mixgtk_mixal_update_bp_at_line (atoi (arg)); +} + +static void +addrbp_post_hook_ (mix_vm_cmd_dispatcher_t *dis, const gchar *arg, +		gpointer data) +{ +  if (arg && strlen (arg)) mixgtk_mixal_update_bp_at_address (atoi (arg)); +} + +static void +allbp_post_hook_ (mix_vm_cmd_dispatcher_t *dis, const gchar *arg, +		  gpointer data) +{ +  mixgtk_mixal_update_bp_all (); +} + + +static void +install_hooks_ (void) +{ +  mix_vm_cmd_dispatcher_global_post_hook (dis_data_.dispatcher, +					  global_post_hook_, +					  (gpointer)(&dis_data_)); +  mix_vm_cmd_dispatcher_post_hook (dis_data_.dispatcher, +				   MIX_CMD_LOAD, load_post_hook_, +				   NULL); +  mix_vm_cmd_dispatcher_post_hook (dis_data_.dispatcher, +				   MIX_CMD_RUN, run_post_hook_, +				   NULL); +  mix_vm_cmd_dispatcher_post_hook (dis_data_.dispatcher, +				   MIX_CMD_NEXT, next_post_hook_, +				   NULL); +  mix_vm_cmd_dispatcher_post_hook (dis_data_.dispatcher, +				   MIX_CMD_SBP, linebp_post_hook_, +				   NULL); +  mix_vm_cmd_dispatcher_post_hook (dis_data_.dispatcher, +				   MIX_CMD_CBP, linebp_post_hook_, +				   NULL); +  mix_vm_cmd_dispatcher_post_hook (dis_data_.dispatcher, +				   MIX_CMD_SBPA, addrbp_post_hook_, +				   NULL); +  mix_vm_cmd_dispatcher_post_hook (dis_data_.dispatcher, +				   MIX_CMD_CBPA, addrbp_post_hook_, +				   NULL); +  mix_vm_cmd_dispatcher_post_hook (dis_data_.dispatcher, +				   MIX_CMD_CABP, allbp_post_hook_, +				   NULL); +} + +/* configuration stuff */ +static const gchar *EDITOR_KEY_ = "Editor"; +static const gchar *MIXASM_KEY_ = "Mixasm"; + +static void +read_config_ (void) +{ +  const gchar *editor = mixgtk_config_get (EDITOR_KEY_); +  const gchar *assem = mixgtk_config_get (MIXASM_KEY_); + +  if (!editor) +    { +      static const gchar *ENV[] = {"MDK_EDITOR", "X_EDITOR", NULL}; +      gchar *edit = NULL; +      int k = 0; +      while (!edit && ENV[k]) edit = getenv (ENV[k++]); +      if (edit) edit = g_strconcat (edit, " %s", NULL); +      else edit = g_strdup ("xterm -e vi %s"); +      mix_vm_cmd_dispatcher_set_editor (dis_data_.dispatcher, edit); +      g_free (edit); +    } +  else +    { +      mix_vm_cmd_dispatcher_set_editor (dis_data_.dispatcher, editor); +    } +  if (!assem) assem = "mixasm %s"; +  mix_vm_cmd_dispatcher_set_assembler (dis_data_.dispatcher, assem); + +} + +void +on_external_programs_activate () +{ +  if (!ext_dlg_) +    { +      ext_dlg_ = mixgtk_widget_factory_get_dialog (MIXGTK_EXTERNPROG_DIALOG); +      g_return_if_fail (ext_dlg_ != NULL); +      ed_entry_ = mixgtk_widget_factory_get_child_by_name +	(MIXGTK_EXTERNPROG_DIALOG, ED_NAME_); +      g_assert (ed_entry_); +      asm_entry_ = mixgtk_widget_factory_get_child_by_name +	(MIXGTK_EXTERNPROG_DIALOG, ASM_NAME_); +      g_assert (asm_entry_); +    } +  gtk_entry_set_text (GTK_ENTRY (ed_entry_), +		      mix_vm_cmd_dispatcher_get_editor (dis_data_.dispatcher)); +  gtk_entry_set_text (GTK_ENTRY (asm_entry_), +		      mix_vm_cmd_dispatcher_get_assembler +		      (dis_data_.dispatcher)); +  gtk_widget_show (ext_dlg_); +  if (gtk_dialog_run (GTK_DIALOG (ext_dlg_)) == GTK_RESPONSE_OK) +    { +      const gchar *value = gtk_entry_get_text (GTK_ENTRY (ed_entry_)); +      mix_vm_cmd_dispatcher_set_editor (dis_data_.dispatcher, value); +      mixgtk_config_update (EDITOR_KEY_, value); +      value = gtk_entry_get_text (GTK_ENTRY (asm_entry_)); +      mix_vm_cmd_dispatcher_set_assembler (dis_data_.dispatcher, value); +      mixgtk_config_update (MIXASM_KEY_, value); +    } + +  gtk_widget_hide (ext_dlg_); +} + +/* initialise the command dispatcher */ +gboolean +mixgtk_cmd_dispatcher_init (mixgtk_dialog_id_t top) +{ +  static gboolean restart = FALSE; +  gchar *text = NULL; + +  ext_dlg_ = NULL; +  ed_entry_ = NULL; +  asm_entry_ = NULL; + +  dis_data_.prompt = +    mixgtk_widget_factory_get (top, MIXGTK_WIDGET_PROMPT); +  g_return_val_if_fail (dis_data_.prompt != NULL, FALSE); + +  if (dis_data_.log) +    text = gtk_editable_get_chars (GTK_EDITABLE (dis_data_.log), 0, -1); + +  dis_data_.log = +    mixgtk_widget_factory_get (top, MIXGTK_WIDGET_LOG); + +  g_return_val_if_fail (dis_data_.log != NULL, FALSE); + +  if (text) +    { +      gtk_text_buffer_insert_at_cursor +        (gtk_text_view_get_buffer (GTK_TEXT_VIEW (dis_data_.log)), text, -1); +      g_free (text); +    } + +  if (!dis_data_.dispatcher) +    { +      static const gchar *HISTORY_FILE = "gmixvm.history"; +      static gint HISTORY_SIZE = 100; +      mix_config_t *config = mixgtk_config_get_mix_config (); + +      int r = pipe (dis_data_.fildes); +      g_return_val_if_fail (r == 0, FALSE); +      /* connect stdout/stderr to the pipe's write end */ +      if (dup2 (dis_data_.fildes[1], STDOUT_FILENO) == -1 +	  || dup2 (dis_data_.fildes[1], STDOUT_FILENO) == -1) +	return FALSE; +      dis_data_.out = fdopen (dis_data_.fildes[1], "w"); +      g_return_val_if_fail (dis_data_.out != NULL, FALSE); +      r = fcntl (dis_data_.fildes[0], F_GETFL, 0); +      g_return_val_if_fail (r != -1, FALSE); +      r |= O_NONBLOCK; +      r = fcntl(dis_data_.fildes[0], F_SETFL, r); +      g_return_val_if_fail (r != -1, FALSE); + +      if (!mix_config_get_history_file (config)) +	mix_config_set_history_file (config, HISTORY_FILE); +      if (mix_config_get_history_size (config) == 0) +	mix_config_set_history_size (config, HISTORY_SIZE); + +      dis_data_.dispatcher = +	mix_vm_cmd_dispatcher_new_with_config (dis_data_.out, +					       dis_data_.out, +					       config); +      mix_vm_cmd_dispatcher_print_time (dis_data_.dispatcher, FALSE); + +      install_hooks_ (); +    } + +  dis_data_.status = +    mixgtk_widget_factory_get (MIXGTK_MAIN, MIXGTK_WIDGET_STATUSBAR); +  g_return_val_if_fail (dis_data_.status != NULL, FALSE); +  dis_data_.context = gtk_statusbar_get_context_id (GTK_STATUSBAR +						    (dis_data_.status), +						    "cmd_dis_context"); +  if (!restart) read_config_ (); +  if (dis_data_.last_file) +    gtk_window_set_title +      (GTK_WINDOW (mixgtk_widget_factory_get_dialog (MIXGTK_MAIN)), +       dis_data_.last_file); + +  mixgtk_fontsel_set_font (MIX_FONT_LOG, dis_data_.log); +  mixgtk_fontsel_set_font (MIX_FONT_PROMPT, dis_data_.prompt); + +  restart = TRUE; +  return TRUE; +} + +/* dispatch an externally provided command */ +#ifdef MAKE_GUILE +static gboolean +try_guile_ (const gchar *command) +{ +  if (command && command[0] == '(' && command[strlen (command) - 1] == ')') +    { +      mixguile_interpret_command (command); +      return TRUE; +    } +  return FALSE; +} +#else +#  define try_guile_(ignored)  FALSE +#endif + +void +mixgtk_cmd_dispatcher_dispatch (const gchar *command) +{ +  GtkWidget *entry = dis_data_.prompt; +  g_return_if_fail (command != NULL); +  g_assert (entry != NULL); +  gtk_entry_set_text (GTK_ENTRY (entry), command); +  log_command_ (&dis_data_, command); +  if (!try_guile_ (command)) +    mix_vm_cmd_dispatcher_dispatch_text (dis_data_.dispatcher, command); +  gtk_entry_set_text (GTK_ENTRY (entry), ""); +} + +/* get times */ +void +mixgtk_cmd_dispatcher_get_times (gint *uptime, gint *progtime, gint *laptime) +{ +  if (uptime != NULL) +    *uptime = mix_vm_cmd_dispatcher_get_uptime (dis_data_.dispatcher); +  if (progtime != NULL) +    *progtime = mix_vm_cmd_dispatcher_get_progtime (dis_data_.dispatcher); +  if (laptime != NULL) +    *laptime = mix_vm_cmd_dispatcher_get_laptime (dis_data_.dispatcher); +} + +/* get the underlying vm */ +mix_vm_t * +mixgtk_cmd_dispatcher_get_vm (void) +{ +  return (mix_vm_t *) mix_vm_cmd_dispatcher_get_vm (dis_data_.dispatcher); +} + +/* get the current source file */ +const gchar * +mixgtk_cmd_dispatcher_get_src_path (void) +{ +  return mix_vm_cmd_dispatcher_get_src_file_path (dis_data_.dispatcher); +} + +/* get the mix cmd dispatcher */ +mix_vm_cmd_dispatcher_t * +mixgtk_cmd_dispatcher_get_mix_dispatcher (void) +{ +  return dis_data_.dispatcher; +} + +/* process commands */ +void +complete_command_ (void) +{ +  GtkEntry *entry = GTK_ENTRY (dis_data_.prompt); +  gchar *prefix = NULL; +  const gchar *text = gtk_entry_get_text (entry); +  const GList  *cmds = +    mix_vm_cmd_dispatcher_complete (dis_data_.dispatcher, text, &prefix); + +  if (prefix != NULL) +    { +      GtkTextBuffer *buf = +        gtk_text_view_get_buffer (GTK_TEXT_VIEW (dis_data_.log)); + +      gtk_entry_set_text (entry, prefix); +      if (g_list_length ((GList *)cmds) > 1) +	{ +          static gchar BUFFER[25]; +	  gint k = 0; +	  gtk_text_buffer_insert_at_cursor (buf, "Completions:\n", -1); +	  while (cmds) +	    { +	      g_snprintf (BUFFER, 25, "%-12s", (const char*)cmds->data); +	      ++k; +	      gtk_text_buffer_insert_at_cursor (buf, BUFFER, -1); +	      if (k%5 == 0) +		gtk_text_buffer_insert_at_cursor (buf, "\n", -1); + +	      cmds = cmds->next; +	    } +	  if (k%5 != 0) +	    gtk_text_buffer_insert_at_cursor (buf, "\n", -1); +	} +      else +        { +          gint pos = strlen (prefix); +          gtk_editable_insert_text (GTK_EDITABLE (entry), " ", 1, &pos); +        } +      flush_log_ (&dis_data_); +      g_free (prefix); +    } +} + +int +on_command_prompt_key_press_event (GtkEntry *w, GdkEventKey *e, gpointer d) +{ +  guint key = e->keyval; +  gboolean result = FALSE; + +#ifdef HAVE_LIBHISTORY +  HIST_ENTRY *entry = NULL; +  if (key == GDK_Up) +    { +      entry = previous_history (); +      if (entry && entry->line) +	gtk_entry_set_text (w, entry->line); +      result = TRUE; +    } +  if (key == GDK_Down) +    { +      entry = next_history (); +      if (entry && entry->line) +	gtk_entry_set_text (w, entry->line); +      result = TRUE; +    } +#endif + +  if (key == GDK_Tab) +    { +      complete_command_ (); +      result = TRUE; +    } + +  if (result) gtk_editable_set_position (GTK_EDITABLE (w), -1); + +  return result; +} + +void +on_command_prompt_activate (GtkEntry *prompt, gpointer data) +{ +  gchar *text = +    g_strstrip (gtk_editable_get_chars (GTK_EDITABLE (prompt), 0, -1)); +  if (text && *text) +    { +      log_command_ (&dis_data_, text); +      if (!try_guile_ (text)) +        mix_vm_cmd_dispatcher_dispatch_text (dis_data_.dispatcher, text); +      gtk_entry_set_text (prompt, ""); +    } +  g_free (text); +} + +void +on_log_font_activate () +{ +  GtkWidget *w[] = { dis_data_.log }; +  mixgtk_fontsel_query_font (MIX_FONT_LOG, w, 1); +} + +void +on_prompt_font_activate () +{ +  GtkWidget *w[] = { dis_data_.prompt }; +  mixgtk_fontsel_query_font (MIX_FONT_PROMPT, w, 1); +} + +void +mixgtk_cmd_dispatcher_update_fonts (void) +{ +  mixgtk_fontsel_set_font (MIX_FONT_LOG, dis_data_.log); +  mixgtk_fontsel_set_font (MIX_FONT_PROMPT, dis_data_.prompt); +} diff --git a/mixgtk/mixgtk_cmd_dispatcher.h b/mixgtk/mixgtk_cmd_dispatcher.h new file mode 100644 index 0000000..25ca240 --- /dev/null +++ b/mixgtk/mixgtk_cmd_dispatcher.h @@ -0,0 +1,61 @@ +/* -*-c-*- ---------------- mixgtk_cmd_dispatcher.h : + * functions to access the command dispatcher + * ------------------------------------------------------------------ + * $Id: mixgtk_cmd_dispatcher.h,v 1.6 2005/09/20 19:43:14 jao Exp $ + * ------------------------------------------------------------------ + * Copyright (C) 2001, 2004 Free Software Foundation, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + + +#ifndef MIXGTK_CMD_DISPATCHER_H +#define MIXGTK_CMD_DISPATCHER_H + +#include <mixlib/mix_vm.h> +#include <mixlib/mix_vm_command.h> +#include "mixgtk_widgets.h" + +/* initialise the command dispatcher */ +extern gboolean +mixgtk_cmd_dispatcher_init (mixgtk_dialog_id_t top); + +extern void +mixgtk_cmd_dispatcher_update_fonts (void); + +/* dispatch an externally provided command */ +extern void +mixgtk_cmd_dispatcher_dispatch (const gchar *command); + +/* get times */ +extern void +mixgtk_cmd_dispatcher_get_times (gint *uptime, gint *progtime, gint *laptime); + +/* get the underlying vm */ +extern mix_vm_t * +mixgtk_cmd_dispatcher_get_vm (void); + +/* get the current source file */ +extern const gchar * +mixgtk_cmd_dispatcher_get_src_path (void); + +/* get the mix cmd dispatcher */ +extern mix_vm_cmd_dispatcher_t * +mixgtk_cmd_dispatcher_get_mix_dispatcher (void); + + +#endif /* MIXGTK_CMD_DISPATCHER_H */ + diff --git a/mixgtk/mixgtk_config.c b/mixgtk/mixgtk_config.c new file mode 100644 index 0000000..275d182 --- /dev/null +++ b/mixgtk/mixgtk_config.c @@ -0,0 +1,113 @@ +/* -*-c-*- -------------- mixgtk_config.c : + * Implementation of the functions declared in mixgtk_config.h + * ------------------------------------------------------------------ + *  $Id: mixgtk_config.c,v 1.10 2005/09/20 19:43:14 jao Exp $ + * ------------------------------------------------------------------ + * Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include <stdlib.h> +#include <stdio.h> +#include <string.h> + +#include <sys/types.h> +#include <sys/stat.h> +#include <errno.h> +#include "mixgtk.h" +#include "mixgtk_config.h" + +static const gchar *MIXGTK_CONFIG_FILE_ = "gmixvm.config"; +static const gchar *SHOW_TB_KEY = "Toolbars"; +static const gchar *TB_YES = "Yes"; +static const gchar *TB_NO = "No"; + +static mix_config_t *config_ = NULL; + +/* load configuration */ +gboolean +mixgtk_config_load (void) +{ +  if (config_ == NULL) +    { +      gchar *cdir = g_strconcat (g_get_home_dir (), G_DIR_SEPARATOR_S, +				 MIXGTK_FILES_DIR, NULL); +      config_ = mix_config_new (cdir, MIXGTK_CONFIG_FILE_); +      g_free (cdir); +    } +  return (config_ != NULL); +} + +/* get mixlib config */ +mix_config_t * +mixgtk_config_get_mix_config (void) +{ +  return config_; +} + +/* autosave state */ +gboolean +mixgtk_config_is_autosave (void) +{ +  return mix_config_is_autosave (config_); +} + +void +mixgtk_config_set_autosave (gboolean autosave) +{ +  mix_config_set_autosave (config_, autosave); +} + +/* update config item */ +void +mixgtk_config_update (const gchar *key, const gchar *value) +{ +  mix_config_update (config_, key, value); +} + +/* get config item */ +const gchar * +mixgtk_config_get (const gchar *key) +{ +  return mix_config_get (config_, key); +} + +void +mixgtk_config_remove (const char *key) +{ +  mix_config_remove (config_, key); +} + +/* save configuration */ +void +mixgtk_config_save (void) +{ +  mix_config_save (config_); +} + +gboolean +mixgtk_config_show_toolbars (void) +{ +  const gchar *show = mixgtk_config_get (SHOW_TB_KEY); +  return (!show || !strcmp (show, TB_YES)); +} + +void +mixgtk_config_set_show_toolbars (gboolean show) +{ +  mixgtk_config_update (SHOW_TB_KEY, show? TB_YES : TB_NO); +} diff --git a/mixgtk/mixgtk_config.h b/mixgtk/mixgtk_config.h new file mode 100644 index 0000000..7c3f548 --- /dev/null +++ b/mixgtk/mixgtk_config.h @@ -0,0 +1,70 @@ +/* -*-c-*- ---------------- mixgtk_config.h : + * Configuration functions declarations. + * ------------------------------------------------------------------ + *  $Id: mixgtk_config.h,v 1.7 2005/09/20 19:43:14 jao Exp $ + * ------------------------------------------------------------------ + * Copyright (C) 2001, 2004 Free Software Foundation, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + + +#ifndef MIXGTK_CONFIG_H +#define MIXGTK_CONFIG_H + +#include <mixlib/mix.h> +#include <mixlib/mix_config.h> + +/* load configuration */ +extern gboolean +mixgtk_config_load (void); + +/* get mix config */ +extern mix_config_t * +mixgtk_config_get_mix_config (void); + +/* autosave state */ +extern gboolean +mixgtk_config_is_autosave (void); + +extern void +mixgtk_config_set_autosave (gboolean autosave); + +/* update config item */ +extern void +mixgtk_config_update (const gchar *key, const gchar *value); + +/* get config item */ +extern const gchar * +mixgtk_config_get (const gchar *key); + +/* remove config item */ +extern void +mixgtk_config_remove (const gchar *key); + +/* save configuration */ +extern void +mixgtk_config_save (void); + +/* shared config params */ +extern gboolean +mixgtk_config_show_toolbars (void); + +extern void +mixgtk_config_set_show_toolbars (gboolean show); + +#endif /* MIXGTK_CONFIG_H */ + diff --git a/mixgtk/mixgtk_device.c b/mixgtk/mixgtk_device.c new file mode 100644 index 0000000..203933c --- /dev/null +++ b/mixgtk/mixgtk_device.c @@ -0,0 +1,625 @@ +/* -*-c-*- ---------------- mixgtk_device.c : + * actual types for mixgtk devices + * ------------------------------------------------------------------ + * $Id: mixgtk_device.c,v 1.26 2005/09/20 19:43:14 jao Exp $ + * ------------------------------------------------------------------ + * Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#include <mixlib/mix_vm_command.h> +#include <mixlib/xmix_device.h> + +#include "mixgtk.h" +#include "mixgtk_gen_handlers.h" +#include "mixgtk_widgets.h" +#include "mixgtk_fontsel.h" +#include "mixgtk_config.h" +#include "mixgtk_cmd_dispatcher.h" +#include "mixgtk_device.h" + +#define BIN_DEV_COL_ 5 + +static const gchar *DEV_FORMAT_KEY_ = "Device.format"; + +/* device container */ +static GtkNotebook *dev_nb_ = NULL; +/* devdir dialog */ +static GtkWidget *devdir_dlg_ = NULL; +static GtkEntry *devdir_entry_ = NULL; +/* terminal input dialog */ +static GtkWidget *input_dlg_ = NULL; +static GtkEntry *input_dlg_entry_ = NULL; + +/** configuration stuff */ +#define LAST_BIN_DEV_   mix_dev_DISK_7 +static GtkWidget *devdlg_ = NULL; +static GtkWidget *dtoggle_ = NULL; +static GtkWidget *wtoggle_ = NULL; +static GtkWidget *combo_ = NULL; + +/* virtual machine */ +static mix_vm_t *vm_ = NULL; +/* dec settings */ +static gint32 decs_ = 0; +static gint32 new_decs_ = 0; + +/* macros manipulating dec settings */ +#define IS_DEC(flags,type) (((flags) >> (type)) & 1) +#define SET_DEC(flags,type) ((flags) |= (1<<(type))) +#define CLEAR_DEC(flags,type) ((flags) &= ~(1<<(type))) + +/* a mixgtk device */ +struct mixgtk_device_t +{ +  mix_device_t device; +  GtkWidget *widget; +  GtkWidget *scroll; +}; + +struct mixgtk_bin_device_t +{ +  struct mixgtk_device_t gtk_device; +  guint last_insert; +  GtkListStore *store; +  gboolean dec; +}; + +/* callbacks for output devices */ +static void +write_char_ (struct mixgtk_device_t *dev, const mix_word_t *block) +{ +  enum {MAX_BLOCK = 16, BUFF_SIZE = MAX_BLOCK * 5 + 2}; +  static gchar BUFFER[BUFF_SIZE]; + +  guint k, j; +  GtkTextIter end; +  GtkTextBuffer *buffer; +  GtkTextMark *mark; + +  for (k = 0; k < SIZES_[dev->device.type]; k++) +    for (j = 1; j < 6; j++) +      { +	mix_char_t ch = mix_word_get_byte (block[k], j); +	BUFFER[5 * k + j - 1] = mix_char_to_ascii (ch); +      } + +  BUFFER[5 * k] = '\n'; +  BUFFER[5 * k + 1] = '\0'; + +  buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (dev->widget)); +  gtk_text_buffer_get_end_iter (buffer, &end); +  gtk_text_buffer_place_cursor (buffer, &end); +  gtk_text_buffer_insert_at_cursor (buffer, BUFFER, -1); +  mark = gtk_text_buffer_get_insert (buffer); +  gtk_text_view_scroll_to_mark (GTK_TEXT_VIEW (dev->widget), mark, 0, +                                TRUE, 0, 0); +} + +static const gchar * +get_word_string_ (mix_word_t w, gboolean dec) +{ +  enum {BUFF_SIZE = 17}; +  static gchar BUFFER[BUFF_SIZE] = { 0 }; +  if (dec) +    g_snprintf (BUFFER, BUFF_SIZE, "%s%011ld", +	      mix_word_is_negative (w)? "-" : "+", +	      mix_word_magnitude (w)); +  else +    mix_word_print_to_buffer (w, BUFFER); +  return BUFFER; +} + +static void +write_bin_  (struct mixgtk_bin_device_t *dev, const mix_word_t *block) +{ +  guint k, col; +  gboolean dec = FALSE; +  size_t len; + +  GtkTreeView *view = GTK_TREE_VIEW (dev->gtk_device.widget); +  GtkListStore *store = dev->store; +  GtkTreeIter iter; + +  g_assert (view); +  g_assert (store); + +  dec = IS_DEC(decs_, dev->gtk_device.device.type); + +  for (k = 0, len = SIZES_[dev->gtk_device.device.type]; +       k < len;  k += BIN_DEV_COL_) +    { +      gtk_list_store_append (store, &iter); +      for (col = 0; col < BIN_DEV_COL_; ++col) +        gtk_list_store_set (store, &iter, +                            col, get_word_string_ (block[k + col], dec), +                            col + BIN_DEV_COL_, (guint)block[k + col], +                            -1); +      dev->last_insert++; +    } +} + +static gboolean +write_ (mix_device_t *dev, const mix_word_t *block) +{ +  struct mixgtk_device_t *gtkdev  = (struct mixgtk_device_t *) dev; + +  if (dev->type != mix_dev_CONSOLE && !(DEF_DEV_VTABLE_->write)(dev, block)) +    return FALSE; + +  if (MODES_[dev->type] == mix_dev_CHAR) write_char_ (gtkdev, block); +  else write_bin_ ((struct mixgtk_bin_device_t *)gtkdev, block); + +  gtk_notebook_set_current_page (dev_nb_, +                                 gtk_notebook_page_num (dev_nb_, +                                                        gtkdev->scroll)); + +  return TRUE; +} + +static gboolean +read_cons_ (mix_word_t *block) +{ +  gchar *text; +  size_t i, j; + +  if (input_dlg_ == NULL) +    { +      input_dlg_ = mixgtk_widget_factory_get_dialog (MIXGTK_INPUT_DIALOG); +      g_assert (input_dlg_); +      input_dlg_entry_ = GTK_ENTRY (mixgtk_widget_factory_get_child_by_name +                                    (MIXGTK_INPUT_DIALOG, "input_entry")); +      g_assert (input_dlg_entry_); +    } + +  gtk_entry_set_text (input_dlg_entry_, ""); +  gtk_dialog_run (GTK_DIALOG (input_dlg_)); +  gtk_widget_hide (input_dlg_); +  text = g_strdup_printf ("%-70s", gtk_entry_get_text (input_dlg_entry_)); +  for (i = 0; i < 70; ++i) +    for (j = 0; j < 5; ++j) +      mix_word_set_byte (block + i, j + 1, +                         mix_char_to_byte +                         (mix_ascii_to_char (text[5 * i + j]))); +  g_free (text); +  return TRUE; +} + +static gboolean +read_ (mix_device_t *dev, mix_word_t *block) +{ +  struct mixgtk_device_t *gtkdev  = (struct mixgtk_device_t *) dev; + +  if (dev->type == mix_dev_CONSOLE && !read_cons_ (block)) return FALSE; + +  if (dev->type != mix_dev_CONSOLE && !(DEF_DEV_VTABLE_->read)(dev, block)) +    return FALSE; + +  if (MODES_[dev->type] == mix_dev_CHAR) write_char_ (gtkdev, block); +  else write_bin_ ((struct mixgtk_bin_device_t *)gtkdev, block); + +  gtk_notebook_set_current_page (dev_nb_, +                                 gtk_notebook_page_num (dev_nb_, +                                                        gtkdev->scroll)); +  return TRUE; +} + +static gboolean +ioc_ (mix_device_t *dev, mix_short_t cmd) +{ +  return (DEF_DEV_VTABLE_->ioc)(dev, cmd); +} + +static gboolean +busy_ (const mix_device_t *dev) +{ +  return (DEF_DEV_VTABLE_->busy)(dev); +} + +static void +destroy_ (mix_device_t *dev) +{ +  struct mixgtk_device_t *gtkdev = (struct mixgtk_device_t *)dev; +  if (MODES_[dev->type] == mix_dev_BIN) { +    struct mixgtk_bin_device_t * bdev = (struct mixgtk_bin_device_t *)dev; +    gtk_list_store_clear (bdev->store); +    g_object_unref ((gpointer)bdev->store); +  } +  (DEF_DEV_VTABLE_->destroy) (dev); +  gtk_notebook_remove_page (dev_nb_, +                            gtk_notebook_page_num (dev_nb_, +                                                   gtkdev->scroll)); +} + +static mix_device_vtable_t MIXGTK_VTABLE_ = { +  write_, read_, ioc_, busy_, destroy_ +}; + +/* create the gui part of the device */ +static void +mixgtk_device_construct_gui_ (struct mixgtk_device_t *dev) +{ +  GtkWidget *label = gtk_label_new (DEF_NAMES_[dev->device.type]); + +  g_assert (label); + +  dev->scroll = gtk_scrolled_window_new (NULL, NULL); +  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (dev->scroll), +                                  GTK_POLICY_AUTOMATIC, +                                  GTK_POLICY_AUTOMATIC); + +  if (MODES_[dev->device.type] == mix_dev_CHAR) +    { +      dev->widget = gtk_text_view_new (); +      gtk_text_view_set_editable (GTK_TEXT_VIEW (dev->widget), FALSE); +    } +  else +    { +      gint k; +      struct mixgtk_bin_device_t *bindev = (struct mixgtk_bin_device_t *)dev; +      GtkCellRenderer *renderer = gtk_cell_renderer_text_new (); +      GType *types = g_new (GType, BIN_DEV_COL_ * 2); + +      for (k = 0; k < BIN_DEV_COL_; ++k) +        { +          types[k] = G_TYPE_STRING; +          types[k + BIN_DEV_COL_] = G_TYPE_UINT; +        } + +      bindev->store = gtk_list_store_newv (BIN_DEV_COL_ * 2, types); + +      dev->widget = +        gtk_tree_view_new_with_model (GTK_TREE_MODEL (bindev->store)); + +      gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (dev->widget), FALSE); +      gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (dev->widget), TRUE); + +      for (k = 0; k < BIN_DEV_COL_; ++k) +	{ +          gtk_tree_view_append_column +            (GTK_TREE_VIEW (dev->widget), +             gtk_tree_view_column_new_with_attributes ("", renderer, +                                                       "text", k, NULL)); +	} + + +      g_free (types); +    } + +  g_assert (dev->widget); +  gtk_container_add (GTK_CONTAINER (dev->scroll), dev->widget); +  mixgtk_fontsel_set_font (MIX_FONT_DEVICES, dev->widget); +  gtk_notebook_append_page (dev_nb_, dev->scroll, label); +  gtk_widget_show (label); +  gtk_widget_show (dev->scroll); +  gtk_widget_show (dev->widget); +} + +static void +redraw_bin_device_ (struct mixgtk_bin_device_t *dev) +{ +  if (dev != NULL) +    { +      GtkTreeModel *store = GTK_TREE_MODEL (dev->store); +      GtkTreeIter iter; +      gboolean valid; + +      g_assert (store); + +      valid = +        gtk_tree_model_get_iter_first (store, &iter); + +      while (valid) +        { +          gint k; +          guint word; + +          for (k = 0; k < BIN_DEV_COL_; ++k) +            { +              gtk_tree_model_get (store, &iter, k + BIN_DEV_COL_, &word, -1); +              gtk_list_store_set (GTK_LIST_STORE (store), &iter, +                                  k, get_word_string_ ((mix_word_t)word, +                                                       dev->dec), +                                  -1); +            } +          valid = gtk_tree_model_iter_next (store, &iter); +        } +      gtk_widget_queue_draw (((struct mixgtk_device_t *)dev)->widget); +    } +} + + +/* create a new mixgtk device */ +static mix_device_t * +mixgtk_device_new_ (mix_device_type_t type) +{ +  struct mixgtk_device_t *dev = NULL; + +  g_return_val_if_fail (type < mix_dev_INVALID, NULL); + +  if (MODES_[type] == mix_dev_CHAR) +    { +      dev = g_new (struct mixgtk_device_t, 1); +    } +  else +    { +      dev = (struct mixgtk_device_t *) g_new (struct mixgtk_bin_device_t, 1); +      ((struct mixgtk_bin_device_t *)dev)->last_insert = 0; +    } + +  construct_device_ (&dev->device, type); + +  dev->device.vtable = &MIXGTK_VTABLE_; + +  mixgtk_device_construct_gui_ (dev); + +  return (mix_device_t *)dev; +} + +/* init default devices */ +GtkWidget * +mixgtk_device_init (mix_vm_t *vm) +{ +  g_assert (vm != NULL); + +  vm_ = vm; +  devdlg_ = NULL; +  devdir_dlg_ = NULL; +  devdir_entry_ = NULL; +  input_dlg_ = NULL; +  dtoggle_ = NULL; +  wtoggle_ = NULL; +  combo_ = NULL; + +  if (dev_nb_ == NULL) +    { +      mix_vm_set_device_factory (vm, mixgtk_device_new_); + +      /* read format configuration */ +      if (mixgtk_config_get (DEV_FORMAT_KEY_)) +        decs_ =  atoi (mixgtk_config_get (DEV_FORMAT_KEY_)); + +      dev_nb_ = GTK_NOTEBOOK (gtk_notebook_new ()); +      gtk_notebook_set_tab_pos (dev_nb_, GTK_POS_RIGHT); +      gtk_notebook_set_scrollable (dev_nb_, FALSE); +    } + +  mixgtk_fontsel_set_font (MIX_FONT_DEVICES, GTK_WIDGET (dev_nb_)); + +  return GTK_WIDGET (dev_nb_); +} + +void +mixgtk_device_set_format (mix_device_type_t dev, gboolean dec) +{ +  gboolean changed; + +  g_return_if_fail (dev < mix_dev_INVALID); + +  changed = (dec && !IS_DEC (decs_, dev)) || (!dec && IS_DEC (decs_, dev)); + +  if (changed && (MODES_[dev] == mix_dev_BIN)) +    { +      struct mixgtk_bin_device_t *gdev = +        (struct mixgtk_bin_device_t *) mix_vm_get_device (vm_, dev); + +      if (gdev != NULL) +        { +          if (dec) SET_DEC (decs_, dev); else CLEAR_DEC (decs_, dev); +          gdev->dec = !(gdev->dec); +          redraw_bin_device_ (gdev); +        } +    } +} + + +static mix_device_type_t +get_device_idx_ (void) +{ +  int k; +  const gchar *name = gtk_entry_get_text (GTK_ENTRY (GTK_BIN (combo_)->child)); +  for (k = 0; k <= LAST_BIN_DEV_; ++k) +    if (!strcmp (name, DEF_NAMES_[k])) break; +  return k; +} + +static void +init_devform_ (void) +{ +  devdlg_ = mixgtk_widget_factory_get_dialog (MIXGTK_DEVFORM_DIALOG); +  g_assert (devdlg_); +  dtoggle_ = mixgtk_widget_factory_get_child_by_name +    (MIXGTK_DEVFORM_DIALOG, "decradio"); +  g_assert (dtoggle_); +  wtoggle_ = mixgtk_widget_factory_get_child_by_name +    (MIXGTK_DEVFORM_DIALOG, "wordradio"); +  g_assert (wtoggle_); +  combo_ = mixgtk_widget_factory_get_child_by_name +    (MIXGTK_DEVFORM_DIALOG, "dev_combo"); +  g_assert (combo_); +  gtk_editable_set_editable (GTK_EDITABLE (GTK_BIN (combo_)->child), FALSE); +} + +void +on_dev_combo_changed () +{ +  mix_device_type_t dev = get_device_idx_ (); +  if (dev <= LAST_BIN_DEV_) +    { +      gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dtoggle_), +                                    IS_DEC (new_decs_, dev)); +      gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (wtoggle_), +                                    !IS_DEC (new_decs_, dev)); +    } +} + +void +on_devform_activate () +{ +  gint result = GTK_RESPONSE_APPLY; + +  if (!devdlg_) init_devform_ (); +  new_decs_ = decs_; + +  while (result == GTK_RESPONSE_APPLY) +    { +      //on_dev_combo_changed (); +      result = gtk_dialog_run (GTK_DIALOG (devdlg_)); +      if (result != GTK_RESPONSE_CANCEL) +        { +          int k; +          gchar value[20]; +          for (k = 0; k <= LAST_BIN_DEV_; ++k) +            mixgtk_device_set_format (k, IS_DEC (new_decs_, k)); +          decs_ = new_decs_; +          g_snprintf (value, 20, "%d", decs_); +          mixgtk_config_update (DEV_FORMAT_KEY_, value); +        } +    } + +  gtk_widget_hide (devdlg_); +} + +void +on_decradio_toggled (GtkToggleButton *button) +{ +  if (gtk_toggle_button_get_active (button)) +    SET_DEC (new_decs_, get_device_idx_ ()); +  else +    CLEAR_DEC (new_decs_, get_device_idx_ ()); +} + +void +on_devset_button_clicked () +{ +  static gint32 ON = 0xffff, OFF = 0; +  new_decs_ = (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dtoggle_)))? +    ON : OFF; +} + +void +on_devdir_activate () +{ +  static const gchar *DEVDIR_ENTRY_NAME = "devdir_entry"; +  if (devdir_dlg_ == NULL) +    { +      devdir_dlg_ = mixgtk_widget_factory_get_dialog (MIXGTK_DEVDIR_DIALOG); +      g_assert (devdir_dlg_); +      devdir_entry_ = GTK_ENTRY +	(mixgtk_widget_factory_get_child_by_name (MIXGTK_DEVDIR_DIALOG, +						  DEVDIR_ENTRY_NAME)); +      g_assert (devdir_entry_); +    } +  gtk_entry_set_text (devdir_entry_, mix_device_get_dir ()); +  gtk_widget_show (devdir_dlg_); +} + +void +on_devdir_browse_clicked () +{ +  GtkWidget *dialog; +  const gchar *current = gtk_entry_get_text (devdir_entry_); + +  dialog = +    gtk_file_chooser_dialog_new (_("Devices folder"), +                                 GTK_WINDOW (devdir_dlg_), +                                 GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, +                                 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, +                                 GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, +                                 NULL); + +  if (current != NULL) +    gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (dialog), current); + +  if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) +    { +      char *filename +        = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog)); +      gtk_entry_set_text (devdir_entry_, filename); +      g_free (filename); +    } + +  gtk_widget_destroy (dialog); +} + +void +on_devdir_cancel_clicked () +{ +  gtk_widget_hide (devdir_dlg_); +} + +void +on_devdir_ok_clicked () +{ +  const gchar *dirname = gtk_entry_get_text (devdir_entry_); +  gchar *cmd = g_strconcat (mix_vm_command_to_string (MIX_CMD_SDDIR), +			    " ", dirname, NULL); +  gtk_widget_hide (devdir_dlg_); +  mixgtk_cmd_dispatcher_dispatch (cmd); +  g_free (cmd); +} + + + +/* fonts */ +static GtkWidget ** +font_widgets_ (gint * n) +{ +  gint no = gtk_notebook_get_n_pages (dev_nb_); +  GtkWidget **w = g_new (GtkWidget *, no + 1); +  gint k, j; + +  for (k = 0, j = 0; k < no && j < mix_dev_INVALID; ++j) +    { +      struct mixgtk_device_t * dev = +        (struct mixgtk_device_t *) mix_vm_get_device (vm_, j); +      if (dev != NULL) w[k++] = dev->widget; +    } + +  g_assert (k == no); +  w[k] = GTK_WIDGET (dev_nb_); + +  if (n) *n = no; + +  return w; +} + +void +on_devices_font_activate () +{ +  gint no = 0; +  GtkWidget **w = font_widgets_ (&no); +  mixgtk_fontsel_query_font (MIX_FONT_DEVICES, w, no + 1); +  g_free (w); +} + +void +mixgtk_device_update_fonts (void) +{ +  gint k, n = 0; +  GtkWidget **w = font_widgets_ (&n); + +  g_assert (n >= 0); + +  for (k = 0; k < n; ++k) +    mixgtk_fontsel_set_font (MIX_FONT_DEVICES, w[k]); +} diff --git a/mixgtk/mixgtk_device.h b/mixgtk/mixgtk_device.h new file mode 100644 index 0000000..69859f3 --- /dev/null +++ b/mixgtk/mixgtk_device.h @@ -0,0 +1,45 @@ +/* -*-c-*- ---------------- mixgtk_device.h : + * Block devices used by mixgtk + * ------------------------------------------------------------------ + *  Last change: Time-stamp: <01/03/04 23:43:59 jose> + * ------------------------------------------------------------------ + * Copyright (C) 2001, 2004 Free Software Foundation, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + + +#ifndef MIXGTK_DEVICE_H +#define MIXGTK_DEVICE_H + +#include <gtk/gtk.h> +#include <mixlib/mix_vm.h> +#include <mixlib/mix_device.h> + +/* init default devices */ +extern GtkWidget * +mixgtk_device_init (mix_vm_t *vm); + +extern void +mixgtk_device_update_fonts (void); + +/* change the output format of a device */ +extern void +mixgtk_device_set_format (mix_device_type_t dev, gboolean dec); + + +#endif /* MIXGTK_DEVICE_H */ + diff --git a/mixgtk/mixgtk_fontsel.c b/mixgtk/mixgtk_fontsel.c new file mode 100644 index 0000000..e88793b --- /dev/null +++ b/mixgtk/mixgtk_fontsel.c @@ -0,0 +1,142 @@ +/* -*-c-*- -------------- mixgtk_fontsel.c : + * Implementation of the functions declared in mixgtk_fontsel.h + * ------------------------------------------------------------------ + *  $Id: mixgtk_fontsel.c,v 1.19 2005/09/20 19:43:14 jao Exp $ + * ------------------------------------------------------------------ + * Copyright (C) 2001, 2004 Free Software Foundation, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include <mixlib/mix.h> +#include "mixgtk_widgets.h" +#include "mixgtk_config.h" +#include "mixgtk_mixvm.h" +#include "mixgtk_mixal.h" +#include "mixgtk_cmd_dispatcher.h" +#include "mixgtk_device.h" +#include "mixgtk_fontsel.h" + +static GtkFontSelectionDialog *fontsel_dialog_ = NULL; + +static const gchar *keys_[MIX_FONT_NO] = { +  "MIX.font", "Prompt.font", "Log.font", "MIXAL.font", "Devices.font", +  "Symbols.font", "Default.font" +}; + + +/* initialise the font selection dialog */ +static void +init_fontsel_ (void) +{ +  fontsel_dialog_ = +    GTK_FONT_SELECTION_DIALOG +    (mixgtk_widget_factory_get_dialog (MIXGTK_FONTSEL_DIALOG)); +  g_assert (fontsel_dialog_ != NULL); +} + +void +mixgtk_fontsel_set_font (mixgtk_font_t f, GtkWidget *w) +{ +  const gchar *font; +  PangoFontDescription *font_desc; + +  if (f >= MIX_FONT_NO || w == NULL) return; + +  font = mixgtk_config_get (keys_[f]); +  if (!font) +    { +      mixgtk_config_update (keys_[f], "Monospace 10"); +      font = mixgtk_config_get (keys_[f]); +      g_assert (font); +    } + +  font_desc = pango_font_description_from_string (font); + +  if (font_desc) +    { +      gtk_widget_modify_font (w, font_desc); +      gtk_widget_queue_draw (w); +      pango_font_description_free (font_desc); +    } +  else +    mixgtk_config_remove (keys_[f]); + +} + +gboolean +mixgtk_fontsel_query_font (mixgtk_font_t f, GtkWidget **w, size_t no) +{ +  gint result = GTK_RESPONSE_APPLY; +  const gchar *current; +  gboolean ret = FALSE; + +  if (f >= MIX_FONT_NO) return FALSE; +  if (!fontsel_dialog_) init_fontsel_ (); + +  current = mixgtk_config_get (keys_[f]); +  gtk_font_selection_dialog_set_font_name (fontsel_dialog_, +                                           current? current : "Monospace 10"); + +  while (result == GTK_RESPONSE_APPLY) +    { +      result = gtk_dialog_run (GTK_DIALOG (fontsel_dialog_)); +      if (result != GTK_RESPONSE_CANCEL) +        { +          gint k; +          mixgtk_config_update +            (keys_[f], +             gtk_font_selection_dialog_get_font_name (fontsel_dialog_)); +          for (k = 0; k < no; ++k) +            mixgtk_fontsel_set_font (f, w[k]); +          ret = TRUE; +        } +    } +  gtk_widget_hide (GTK_WIDGET (fontsel_dialog_)); +  return ret; +} + +void +on_all_fonts_activate (void) +{ +  gint result = GTK_RESPONSE_APPLY; +  const gchar *current; + +  if (!fontsel_dialog_) init_fontsel_ (); + +  current = mixgtk_config_get (keys_[MIX_FONT_DEFAULT]); +  gtk_font_selection_dialog_set_font_name (fontsel_dialog_, +                                           current? current : "Monospace"); + +  while (result == GTK_RESPONSE_APPLY) +    { +      result = gtk_dialog_run (GTK_DIALOG (fontsel_dialog_)); +      if (result != GTK_RESPONSE_CANCEL) +        { +          gint k; +          current = gtk_font_selection_dialog_get_font_name (fontsel_dialog_); + +          for (k = 0; k < MIX_FONT_NO; ++k) +            mixgtk_config_update (keys_[k], current); + +          mixgtk_mixal_update_fonts (); +          mixgtk_mixvm_update_fonts (); +          mixgtk_device_update_fonts (); +          mixgtk_cmd_dispatcher_update_fonts (); +        } +    } +  gtk_widget_hide (GTK_WIDGET (fontsel_dialog_)); +} diff --git a/mixgtk/mixgtk_fontsel.h b/mixgtk/mixgtk_fontsel.h new file mode 100644 index 0000000..2228ed6 --- /dev/null +++ b/mixgtk/mixgtk_fontsel.h @@ -0,0 +1,51 @@ +/* -*-c-*- ---------------- mixgtk_fontsel.h : + * Functions for handling font selection. + * ------------------------------------------------------------------ + *  $Id: mixgtk_fontsel.h,v 1.8 2005/09/20 19:43:14 jao Exp $ + * ------------------------------------------------------------------ + * Copyright (C) 2001, 2004 Free Software Foundation, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + + +#ifndef MIXGTK_FONTSEL_H +#define MIXGTK_FONTSEL_H + +#include <glib.h> +#include "mixgtk_widgets.h" + +typedef enum { +  MIX_FONT_MIXVM, +  MIX_FONT_LOG, +  MIX_FONT_PROMPT, +  MIX_FONT_MIXAL, +  MIX_FONT_DEVICES, +  MIX_FONT_SYMBOLS, +  MIX_FONT_DEFAULT, +  MIX_FONT_NO +} mixgtk_font_t; + +/* configured fonts */ +extern void +mixgtk_fontsel_set_font (mixgtk_font_t f, GtkWidget *w); + +extern gboolean +mixgtk_fontsel_query_font (mixgtk_font_t f, GtkWidget **ws, size_t no); + + +#endif /* MIXGTK_FONTSEL_H */ + diff --git a/mixgtk/mixgtk_gen_handlers.c b/mixgtk/mixgtk_gen_handlers.c new file mode 100644 index 0000000..151feac --- /dev/null +++ b/mixgtk/mixgtk_gen_handlers.c @@ -0,0 +1,165 @@ +/* -*-c-*- -------------- mixgtk_gen_handlers.c : + * Implementation of the functions declared in mixgtk_gen_handlers.h + * ------------------------------------------------------------------ + * $Id: mixgtk_gen_handlers.c,v 1.10 2005/09/20 19:43:14 jao Exp $ + * ------------------------------------------------------------------ + * Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include <mixlib/mix_vm_command.h> +#include "mixgtk_gen_handlers.h" +#include "mixgtk_cmd_dispatcher.h" +#include "mixgtk_config.h" + +/* grab a file with an externally provided callback */ +void +mixgtk_get_file (file_callback_t callback, +		 const gchar *title, +                 const gchar *pattern, +                 const gchar *def_file) +{ +  if (callback != NULL) +    { +      GtkWidget *dialog; + +      dialog = +        gtk_file_chooser_dialog_new (title, +                                     NULL, +                                     GTK_FILE_CHOOSER_ACTION_OPEN, +                                     GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, +                                     GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, +                                     NULL); + +      if (pattern != NULL) +        { +          GtkFileFilter *filter = gtk_file_filter_new (); +          gtk_file_filter_add_pattern (filter, pattern); +          gtk_file_chooser_set_filter (GTK_FILE_CHOOSER (dialog), filter); +        } + +      if (def_file != NULL) +        gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (dialog), def_file); + +      if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) +        { +          char *filename; + +          filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog)); +          callback (filename); +          g_free (filename); +        } + +      gtk_widget_destroy (dialog); +    } +} + +/* exec prompt command */ +static void +exec_cmd_ (mix_vm_command_t cmd, const gchar *arg) +{ +  gchar *command; +  if (arg) +    command = g_strdup_printf ("%s %s", +			       mix_vm_command_to_string (cmd), +			       arg); +  else +    command = g_strdup (mix_vm_command_to_string (cmd)); +  mixgtk_cmd_dispatcher_dispatch (command); +  g_free (command); +} + +/* load mix binary */ +static void +open_cb_ (const gchar *file) +{ +  if (file) +      exec_cmd_ (MIX_CMD_LOAD, file); +} + +void +on_file_open_activate (GtkWidget *w, gpointer data) +{ +  mixgtk_get_file (open_cb_, _("Load MIX program..."), "*.mix", NULL); +} + +/* edit mixal source */ +static void +edit_cb_ (const gchar *file) +{ +  exec_cmd_ (MIX_CMD_EDIT, file); +} + +void +on_file_edit_activate (GtkWidget *w, gpointer data) +{ +  mixgtk_get_file (edit_cb_, _("Edit MIXAL source file..."), "*.mixal", +		   mixgtk_cmd_dispatcher_get_src_path ()); +} + +/* compile mixal source */ +static void +compile_cb_ (const gchar *file) +{ +  exec_cmd_ (MIX_CMD_COMPILE, file); +} + +void +on_file_compile_activate (GtkWidget *w, gpointer data) +{ +  mixgtk_get_file (compile_cb_, _("Compile MIXAL source file..."), "*.mixal", +		   mixgtk_cmd_dispatcher_get_src_path ()); +} + +void +on_debug_run_activate (GtkWidget *w, gpointer p) +{ +  mixgtk_cmd_dispatcher_dispatch (mix_vm_command_to_string (MIX_CMD_RUN)); +} + +void +on_debug_next_activate (GtkWidget *w, gpointer p) +{ +  mixgtk_cmd_dispatcher_dispatch (mix_vm_command_to_string (MIX_CMD_NEXT)); +} + + +void +on_file_exit_activate (GtkWidget *w, gpointer data) +{ +  gtk_main_quit (); +} + +void +on_clear_breakpoints_activate (GtkWidget *w, gpointer data) +{ +  mixgtk_cmd_dispatcher_dispatch (mix_vm_command_to_string (MIX_CMD_CABP)); +} + +void +on_save_on_exit_toggle (GtkWidget *w, gpointer data) +{ +  mixgtk_config_set_autosave (GTK_CHECK_MENU_ITEM (w)->active); +} + +void +on_save_activate (GtkWidget *w, gpointer data) +{ +  mixgtk_config_save (); +} + + diff --git a/mixgtk/mixgtk_gen_handlers.h b/mixgtk/mixgtk_gen_handlers.h new file mode 100644 index 0000000..c82c195 --- /dev/null +++ b/mixgtk/mixgtk_gen_handlers.h @@ -0,0 +1,62 @@ +/* -*-c-*- ---------------- mixgtk_gen_handlers.h : + * general signal handlers declarations + * ------------------------------------------------------------------ + *  $Id: mixgtk_gen_handlers.h,v 1.7 2005/09/20 19:43:14 jao Exp $ + * ------------------------------------------------------------------ + * Copyright (C) 2001, 2004 Free Software Foundation, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + + +#ifndef MIXGTK_GEN_HANDLERS_H +#define MIXGTK_GEN_HANDLERS_H + +#include <gtk/gtk.h> + +extern void +on_main_window_destroy (GtkWidget *w, gpointer data); + +extern void +on_file_open_activate (GtkWidget *w, gpointer data); + +extern void +on_file_exit_activate (GtkWidget *w, gpointer data); + +extern void +on_file_edit_activate (GtkWidget *w, gpointer data); + +extern void +on_file_compile_activate (GtkWidget *w, gpointer data); + +extern void +on_clear_breakpoints_activate (GtkWidget *w, gpointer data); + +extern void +on_save_on_exit_toggle (GtkWidget *w, gpointer data); + +extern void +on_save_activate (GtkWidget *w, gpointer data); + +typedef void (*file_callback_t)(const gchar *file); + +extern void +mixgtk_get_file (file_callback_t callback, const gchar *title, +		 const gchar *pattern, const gchar *def_file); + + +#endif /* MIXGTK_GEN_HANDLERS_H */ + diff --git a/mixgtk/mixgtk_input.c b/mixgtk/mixgtk_input.c new file mode 100644 index 0000000..238fadd --- /dev/null +++ b/mixgtk/mixgtk_input.c @@ -0,0 +1,233 @@ +/* -*-c-*- -------------- mixgtk_input.c : + * Implementation of the functions declared in mixgtk_input.h + * ------------------------------------------------------------------ + * $Id: mixgtk_input.c,v 1.7 2005/09/20 19:43:14 jao Exp $ + * ------------------------------------------------------------------ + * Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include <ctype.h> +#include <stdlib.h> +#include <string.h> + +#include "mixgtk_widgets.h" +#include "mixgtk_input.h" + +enum { +  MSG_, SIGN_, B1_, B2_, B3_, B4_, B5_, DEC_, RESET_, OK_, SIZE_ +}; + +static const gchar *WGT_NAMES_[SIZE_] = { +  "word_label",  "word_sign", "word_b1", "word_b2", "word_b3", +  "word_b4", "word_b5", "word_decimal",  "word_reset", "word_ok" +}; + +static GtkDialog *dialog_ = NULL; +static GtkWidget *childs_[SIZE_]; +static input_callback_t callback_; +static gpointer data_; + + +static void init_dialog_ (void); +static void set_word_ (mix_word_t word); + + +/* init */ +void +mixgtk_input_init (void) +{ +  dialog_ = NULL; +} + +/* get a word */ +void +mixgtk_input_word (const gchar *message, mix_word_t def, +		   input_callback_t cb, gpointer data) +{ +  if (!dialog_) init_dialog_ (); +  gtk_label_set_text (GTK_LABEL (childs_[MSG_]), message); +  set_word_ (def); +  callback_ = cb; +  data_ = data; +  gtk_widget_show (childs_[B1_]); +  gtk_widget_show (childs_[B2_]); +  gtk_widget_show (childs_[B3_]); +  gtk_widget_show (GTK_WIDGET (dialog_)); +} + +/* get a short */ +void +mixgtk_input_short (const gchar *message, mix_short_t def, +		    input_callback_t cb, gpointer data) +{ +  if (!dialog_) init_dialog_ (); +  gtk_label_set_text (GTK_LABEL (childs_[MSG_]), message); +  set_word_ (mix_word_to_short_fast (def)); +  callback_ = cb; +  data_ = data; +  gtk_widget_show (GTK_WIDGET (dialog_)); +  gtk_widget_hide (childs_[B1_]); +  gtk_widget_hide (childs_[B2_]); +  gtk_widget_hide (childs_[B3_]); +} + +#include <gdk/gdkkeysyms.h> + +/* dec and bytes input handler */ +void +on_word_dec_changed (GtkEditable *dec, gpointer *data) +{ +  gchar *txt = gtk_editable_get_chars (dec, 0, -1); + +  if (strlen (txt) > 0) +    { +      gint val = atoi (txt); +      set_word_ (mix_word_new (val)); +    } +  g_free (txt); +} + +void +on_word_byte_changed (GtkEditable *byte, gpointer *data) +{ +  gchar *txt = gtk_editable_get_chars (byte, 0, 2); + +  if (strlen (txt) > 0) +    { +      mix_byte_t bytes[5]; +      gint k; +      const gchar *s; +      mix_word_t w; + +      for (k = 0; k < 5; ++k) +	{ +	  const gchar *text = gtk_entry_get_text (GTK_ENTRY (childs_[B1_ + k])); +	  bytes[k] = mix_byte_new (atoi (text)); +	} +      w = mix_bytes_to_word (bytes, 5); +      s = gtk_entry_get_text (GTK_ENTRY (childs_[SIGN_])); +      if (s && s[0] == '-') mix_word_reverse_sign (w); +      set_word_ (w); +    } +  g_free (txt); +} + +void +on_word_sign_changed (GtkEditable *sign, gpointer *data) +{ +  gchar *txt = gtk_editable_get_chars (sign, 0, 1); + +  if (strlen (txt) > 0) +    { +      gint pos = 0; +      mix_word_t w = +        mix_word_new (atoi (gtk_entry_get_text (GTK_ENTRY (childs_[DEC_])))); + +      g_signal_handlers_block_by_func (GTK_OBJECT (sign), +                                       on_word_sign_changed, data); + +      if (txt[0] != '+' && txt[0] != '-') txt[0] = '+'; +      gtk_editable_delete_text (sign, 0, 1); +      gtk_editable_insert_text (sign, txt, 1, &pos); + +      g_signal_handlers_unblock_by_func (GTK_OBJECT (sign), +                                         on_word_sign_changed, data); +      set_word_ (txt[0] == '-' ? mix_word_negative (w) : w); +    } +  g_free (txt); +} + +void +on_word_ok_clicked (GtkWidget *widget, gpointer *data) +{ +  const gchar *text = gtk_entry_get_text (GTK_ENTRY (childs_[DEC_])); +  mix_word_t w = mix_word_new (atoi (text)); +  if (w == MIX_WORD_ZERO) +    { +      const gchar *sign = gtk_entry_get_text (GTK_ENTRY (childs_[SIGN_])); +      if (sign && sign[0] == '-') mix_word_reverse_sign (w); +    } +  callback_ (w, data_); +  gtk_widget_hide (GTK_WIDGET (dialog_)); +} + +void +on_word_cancel_clicked (GtkWidget *widget, gpointer *data) +{ +  gtk_widget_hide (GTK_WIDGET (dialog_)); +} + +void +on_word_reset_clicked (GtkWidget *w, gpointer *data) +{ +  set_word_ (MIX_WORD_ZERO); +} + +static void +init_dialog_ (void) +{ +  gint k; + +  dialog_ = GTK_DIALOG (mixgtk_widget_factory_get_dialog (MIXGTK_WORD_DIALOG)); +  g_assert (dialog_ != NULL); +  for (k = 0; k < SIZE_; ++k) +    { +      childs_[k] = mixgtk_widget_factory_get_child_by_name +	(MIXGTK_WORD_DIALOG, WGT_NAMES_[k]); +      g_assert (childs_[k] != NULL); +    } +} + +static void +set_word_ (mix_word_t word) +{ +  enum {SIZE = 50}; +  static gchar BUFFER[SIZE] = {0}; +  gint k; +  gint val = mix_word_magnitude (word); +  gboolean neg = mix_word_is_negative (word); +  g_snprintf (BUFFER, SIZE, "%s%d", neg ? "-" : "", val); + + +  g_signal_handlers_block_by_func (GTK_OBJECT (childs_[DEC_]), +                                   on_word_dec_changed, NULL); +  g_signal_handlers_block_by_func (GTK_OBJECT (childs_[SIGN_]), +                                   on_word_sign_changed, NULL); +  for (k = B1_; k <= B5_; ++k) +    g_signal_handlers_block_by_func (GTK_OBJECT (childs_[k]), +                                     on_word_byte_changed, NULL); + +  gtk_entry_set_text (GTK_ENTRY (childs_[DEC_]), BUFFER); +  gtk_entry_set_text (GTK_ENTRY (childs_[SIGN_]), neg ? "-" : "+"); + +  for (k = 1; k < 6; ++k) +    { +      mix_byte_t b = mix_word_get_byte (word, k); +      g_snprintf (BUFFER, SIZE, "%d", (int)b); +      gtk_entry_set_text (GTK_ENTRY (childs_[SIGN_ + k]), BUFFER); +    } + +  for (k = B1_; k <= B5_; ++k) +    g_signal_handlers_unblock_by_func (GTK_OBJECT (childs_[k]), +                                       on_word_byte_changed, NULL); +  g_signal_handlers_unblock_by_func (GTK_OBJECT (childs_[DEC_]), +                                     on_word_dec_changed, NULL); +  g_signal_handlers_unblock_by_func (GTK_OBJECT (childs_[SIGN_]), +                                     on_word_sign_changed, NULL); +} + diff --git a/mixgtk/mixgtk_input.h b/mixgtk/mixgtk_input.h new file mode 100644 index 0000000..924e90b --- /dev/null +++ b/mixgtk/mixgtk_input.h @@ -0,0 +1,49 @@ +/* -*-c-*- ---------------- mixgtk_input.h : + * Declaration of functions for user input + * ------------------------------------------------------------------ + *  Last change: Time-stamp: <01/03/12 23:35:14 jose> + * ------------------------------------------------------------------ + * Copyright (C) 2001 Free Software Foundation, Inc. + *   + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + *   + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the + * GNU General Public License for more details. + *   + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + *   + */ + + +#ifndef MIXGTK_INPUT_H +#define MIXGTK_INPUT_H + +#include <mixlib/mix_types.h> + +/* callback function type */ +typedef void (*input_callback_t)(mix_word_t result, gpointer data); + +/* init */ +extern void +mixgtk_input_init (void); + +/* get a word */ +extern void +mixgtk_input_word (const gchar *message, mix_word_t def, +		   input_callback_t cb, gpointer data); + +/* get a short */ +extern void +mixgtk_input_short (const gchar *message, mix_short_t def, +		    input_callback_t cb, gpointer data ); + + +#endif /* MIXGTK_INPUT_H */ + diff --git a/mixgtk/mixgtk_mixal.c b/mixgtk/mixgtk_mixal.c new file mode 100644 index 0000000..50d09a7 --- /dev/null +++ b/mixgtk/mixgtk_mixal.c @@ -0,0 +1,580 @@ +/* -*-c-*- -------------- mixgtk_mixal.c : + * Implementation of the functions declared in mixgtk_mixal.h + * ------------------------------------------------------------------ + * $Id: mixgtk_mixal.c,v 1.22 2005/09/20 19:43:14 jao Exp $ + * ------------------------------------------------------------------ + * Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + + +#include <stdlib.h> +#include <string.h> + +#include "mixgtk_widgets.h" +#include "mixgtk_config.h" +#include "mixgtk_fontsel.h" +#include "mixgtk_mixal.h" + +static mix_vm_t *vm_ = NULL; +static GtkTreeView *clist_ = NULL; +static GtkListStore *clist_store_ = NULL; + +static gulong lineno_; +static GtkStatusbar *status_ = NULL; +static gint status_context_ = 0; +static GPtrArray *tips_text_ = NULL; + +static GtkWidget *symbols_dlg_ = NULL; +static GtkTreeView *symbols_view_ = NULL; +static GtkListStore *symbols_store_ = NULL; +static const gchar *SYMBOLS_VIEW_NAME_ = "symbols_view"; + +static const gchar *bp_stock_id_ = NULL; +static const gchar *pc_stock_id_ = NULL; +static const guint bp_stock_size_ = GTK_ICON_SIZE_MENU; + +enum { +  CLIST_BP_ID_COL, +  CLIST_BP_SIZE_COL, +  CLIST_ADDRESS_COL, +  CLIST_BYTECODE_COL, +  CLIST_CODE_COL, +  CLIST_ADDRESS_NO_COL, +  CLIST_LINE_NO_COL, +  CLIST_COL_NO +}; + +enum { +  SYMBOLS_NAME_COL, +  SYMBOLS_VALUE_COL, +  SYMBOLS_WORD_COL, +  SYMBOLS_COL_NO +}; + + +static gboolean +mixal_event_ (GtkWidget *w, GdkEvent *event, gpointer data); + + +static void +init_symbols_ (void) +{ +  GtkCellRenderer *renderer = gtk_cell_renderer_text_new (); + +  symbols_dlg_ = mixgtk_widget_factory_get_dialog (MIXGTK_SYMBOLS_DIALOG); +  g_assert (symbols_dlg_); +  symbols_view_ = GTK_TREE_VIEW +    (mixgtk_widget_factory_get_child_by_name +     (MIXGTK_SYMBOLS_DIALOG, SYMBOLS_VIEW_NAME_)); +  g_assert (symbols_view_); + +  mixgtk_fontsel_set_font (MIX_FONT_SYMBOLS, GTK_WIDGET (symbols_view_)); + +  symbols_store_ = gtk_list_store_new (SYMBOLS_COL_NO, +                                       G_TYPE_STRING, +                                       G_TYPE_STRING, +                                       G_TYPE_STRING); + +  gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (symbols_store_), +                                        SYMBOLS_NAME_COL, +                                        GTK_SORT_ASCENDING); + +  gtk_tree_view_set_model (symbols_view_, GTK_TREE_MODEL (symbols_store_)); +  g_object_unref (G_OBJECT (symbols_store_)); +  gtk_tree_view_append_column +    (symbols_view_, +     gtk_tree_view_column_new_with_attributes ("Name", renderer, +                                               "text", SYMBOLS_NAME_COL, +                                               NULL)); +  gtk_tree_view_append_column +    (symbols_view_, +     gtk_tree_view_column_new_with_attributes ("Value", renderer, +                                               "text", SYMBOLS_VALUE_COL, +                                               NULL)); +  gtk_tree_view_append_column +    (symbols_view_, +     gtk_tree_view_column_new_with_attributes ("", renderer, +                                               "text", SYMBOLS_WORD_COL, +                                               NULL)); +} + +static void +insert_symbol_ (gpointer symbol, gpointer value, gpointer data) +{ +  enum {DEC_SIZE = 25, WORD_SIZE = 20}; +  static gchar DEC[DEC_SIZE], WORD[WORD_SIZE]; + +  GtkTreeIter iter; + +  mix_word_t w = (mix_word_t)GPOINTER_TO_INT (value); +  g_snprintf (DEC, DEC_SIZE, "%s%ld", +	    mix_word_is_negative (w)? "-" : "+", +	    mix_word_magnitude (w)); +  mix_word_print_to_buffer (w, WORD); + +  gtk_list_store_append (symbols_store_, &iter); +  gtk_list_store_set (symbols_store_, &iter, +                      SYMBOLS_NAME_COL, (const gchar*)symbol, +                      SYMBOLS_VALUE_COL, DEC, +                      SYMBOLS_WORD_COL, WORD, +                      -1); +} + +static void +fill_symbols_ (const mix_symbol_table_t *table) +{ +  if (symbols_view_) +    gtk_list_store_clear (symbols_store_); +  else +    init_symbols_ (); + +  mix_symbol_table_foreach (((mix_symbol_table_t *)table), +			    insert_symbol_, NULL); +} + +static void +init_clist_ (void) +{ +  GtkStockItem item; + +  GtkCellRenderer *renderer = gtk_cell_renderer_text_new (); +  GtkCellRenderer *bprenderer = gtk_cell_renderer_pixbuf_new (); + +  clist_ = GTK_TREE_VIEW (gtk_tree_view_new ()); + +  clist_store_ = gtk_list_store_new (CLIST_COL_NO, +                                     G_TYPE_STRING, +                                     G_TYPE_INT, +                                     G_TYPE_STRING, +                                     G_TYPE_STRING, +                                     G_TYPE_STRING, +                                     G_TYPE_INT, +                                     G_TYPE_INT); + +  gtk_tree_view_set_model (clist_, GTK_TREE_MODEL (clist_store_)); +  g_object_unref (G_OBJECT (clist_store_)); +  gtk_tree_view_set_rules_hint (clist_, TRUE); + +  gtk_tree_view_append_column +    (clist_, +     gtk_tree_view_column_new_with_attributes ("", bprenderer, +                                               "stock-id", CLIST_BP_ID_COL, +                                               "stock-size", CLIST_BP_SIZE_COL, +                                               NULL)); +  gtk_tree_view_append_column +    (clist_, +     gtk_tree_view_column_new_with_attributes ("Address", renderer, +                                               "text", CLIST_ADDRESS_COL, +                                               NULL)); +  gtk_tree_view_append_column +    (clist_, +     gtk_tree_view_column_new_with_attributes ("Bytecode", renderer, +                                               "text", CLIST_BYTECODE_COL, +                                               NULL)); +  gtk_tree_view_append_column +    (clist_, +     gtk_tree_view_column_new_with_attributes ("Source", renderer, +                                               "text", CLIST_CODE_COL, +                                               NULL)); + +  if (gtk_stock_lookup (GTK_STOCK_STOP, &item)) +    { +      bp_stock_id_ = item.stock_id; +    } + +  if (gtk_stock_lookup (GTK_STOCK_GO_FORWARD, &item)) +    { +      pc_stock_id_ = item.stock_id; +    } + +  symbols_dlg_ = NULL; +  symbols_view_ = NULL; + +  g_signal_connect (G_OBJECT (clist_), "event", +                    G_CALLBACK (mixal_event_), NULL); + + +  mixgtk_fontsel_set_font (MIX_FONT_MIXAL, GTK_WIDGET (clist_)); + +  gtk_widget_show (GTK_WIDGET (clist_)); + +} + + +/* initialise the mixal widgets */ +GtkWidget * +mixgtk_mixal_init (mix_vm_t *vm) +{ +  if (vm != NULL) vm_ = vm; + +  if (vm_ == NULL) return FALSE; + +  if (clist_ == NULL) init_clist_ (); + +  status_ = NULL; + +  return GTK_WIDGET (clist_); +} + +void +mixgtk_mixal_reparent (GtkStatusbar *status) +{ +  g_assert (status != NULL); +  mixgtk_mixal_pop_status (); +  status_ = status; +  status_context_ = gtk_statusbar_get_context_id (status_, "MIXAL status"); +} + +void +mixgtk_mixal_update_fonts (void) +{ +  mixgtk_fontsel_set_font (MIX_FONT_MIXAL, GTK_WIDGET (clist_)); +  mixgtk_fontsel_set_font (MIX_FONT_SYMBOLS, GTK_WIDGET (symbols_view_)); +} + +void +mixgtk_mixal_pop_status (void) +{ +  if (status_ != NULL) +    gtk_statusbar_pop (status_, status_context_); +} + +/* load the corresponding mixal file */ +static void +update_tips_ (const mix_symbol_table_t *table, +	      const gchar *line) +{ +  enum {SIZE = 256}; +  static gchar BUFFER[256]; +  static const gchar *DELIMITERS = " /+*=-()\t,:\n"; +  if (line) +    { +      guint k = 0; +      gchar *tip = g_strdup (""); +      gchar *new_tip; +      gchar **tokens; +      gchar *text = g_strdup (line); +      text = g_strdelimit (text, DELIMITERS, ' '); +      tokens = g_strsplit (g_strstrip (text), " ", -1); +      while (tokens[k]) +	{ +	  if (mix_symbol_table_is_defined (table, tokens[k])) +	    { +	      mix_word_t val = mix_symbol_table_value (table, tokens[k]); +	      g_snprintf (BUFFER, SIZE, "[ %s = %s%ld ]", tokens[k], +			mix_word_is_negative (val)? "-" : "+", +			mix_word_magnitude (val)); +	      new_tip = g_strconcat (tip, " ", BUFFER, NULL); +	      g_free (tip); +	      tip = new_tip; +	    } +	  ++k; +	} +      g_ptr_array_add (tips_text_, (gpointer)tip); +      g_strfreev (tokens); +      g_free (text); +    } +} + +void +mixgtk_mixal_load_file (void) +{ +  enum {ADDR_SIZE = 20, CONT_SIZE = 200, WORD_SIZE = 20}; +  static gchar ADDR[ADDR_SIZE], CONT[CONT_SIZE], WORD[WORD_SIZE]; + +  const mix_src_file_t *file; +  GtkTreeIter iter; + +  g_assert (vm_); +  g_assert (clist_); + +  gtk_list_store_clear (clist_store_); +  if (tips_text_) +    { +      g_ptr_array_free (tips_text_, TRUE); +      tips_text_ = NULL; +    } + +  file = mix_vm_get_src_file (vm_); +  if (file != NULL) +    { +      gint k; + +      mix_address_t addr; +      const mix_symbol_table_t *table =	mix_vm_get_symbol_table (vm_); + +      if (table) tips_text_ = g_ptr_array_new (); + +      lineno_ = mix_src_file_get_line_no (file); + +      for (k = 0; k < lineno_; ++k) +	{ +	  gchar *line = +            g_strchomp ((gchar *)mix_src_file_get_line (file, k + 1)); + +	  g_snprintf (CONT, CONT_SIZE, " %03d:  %s", k + 1, line); +	  addr = mix_vm_get_lineno_address (vm_, k + 1); +	  if (addr != MIX_VM_CELL_NO) +	    { +	      g_snprintf (ADDR, ADDR_SIZE, "%04d", mix_short_magnitude (addr)); +	      mix_word_print_to_buffer (mix_vm_get_addr_contents (vm_, addr), +					WORD); +	    } +	  else +            { +              g_snprintf (ADDR, ADDR_SIZE, _("N/A")); +              g_snprintf (WORD, WORD_SIZE, _("N/A")); +            } +          gtk_list_store_append (clist_store_, &iter); +          gtk_list_store_set (clist_store_, &iter, +                              CLIST_ADDRESS_NO_COL, mix_short_magnitude (addr), +                              CLIST_LINE_NO_COL, k + 1, +                              CLIST_ADDRESS_COL, ADDR, +                              CLIST_CODE_COL, CONT, +                              CLIST_BYTECODE_COL, WORD, +                              CLIST_BP_SIZE_COL, bp_stock_size_, +                              -1); +          if (table) update_tips_ (table, line); +	} +      if (table) fill_symbols_ (table); +    } +  else +    { +      lineno_ = 0; +      gtk_list_store_append (clist_store_, &iter); +      gtk_list_store_set (clist_store_, &iter, +                          CLIST_ADDRESS_NO_COL, MIX_VM_CELL_NO, +                          CLIST_LINE_NO_COL, 0, +                          CLIST_ADDRESS_COL, "", +                          CLIST_CODE_COL, _("Source not available"), +                          CLIST_BYTECODE_COL, "", +                          -1); +    } +} + + +/* update the widgets */ +static gint +find_address_ (gint address) +{ +  GtkTreeIter iter; +  gint addr; +  gint row = 0; +  gboolean valid = +    gtk_tree_model_get_iter_first (GTK_TREE_MODEL (clist_store_), &iter); + +  while (valid) +    { +      ++row; +      gtk_tree_model_get (GTK_TREE_MODEL (clist_store_), &iter, +                          CLIST_ADDRESS_NO_COL, &addr, -1); +      if (addr == address) return row; +      valid = gtk_tree_model_iter_next (GTK_TREE_MODEL (clist_store_), &iter); +    } +  return 0; +} + +static void +update_bp_ (gint row) +{ +  if (row > 0) +    { +      GtkTreePath *path = gtk_tree_path_new_from_indices (row - 1, -1); +      GtkTreeIter iter; + +      if (gtk_tree_model_get_iter (GTK_TREE_MODEL (clist_store_), &iter, path)) +        { +          gint address; +          const gchar *id = NULL; + +          gtk_tree_model_get (GTK_TREE_MODEL (clist_store_), &iter, +                              CLIST_ADDRESS_NO_COL, &address, -1); +          if (mix_vm_has_breakpoint_at_address (vm_, address)) +            id = bp_stock_id_; +          else if (address == +                   (gint) mix_short_magnitude (mix_vm_get_prog_count (vm_))) +            id = pc_stock_id_; + +          gtk_list_store_set (clist_store_, &iter, CLIST_BP_ID_COL, id, -1); +        } +      gtk_tree_path_free (path); +    } +} + +static void +select_row_ (gint row) +{ +  static gint previous = 0; + +  if (row > 0 && previous != row) +    { +      GtkTreePath *path = gtk_tree_path_new_from_indices (row - 1, -1); +      GtkTreeIter iter; + +      if (gtk_tree_model_get_iter (GTK_TREE_MODEL (clist_store_), &iter, path)) +        { +          gtk_list_store_set (clist_store_, &iter, +                              CLIST_BP_ID_COL, pc_stock_id_, +                              -1); +          update_bp_ (previous); +          previous = row; +          gtk_tree_view_scroll_to_cell (clist_, path, NULL, FALSE, 0.3, 0); +        } +      gtk_tree_path_free (path); +    } +} + +void +mixgtk_mixal_update (void) +{ +  gint addr = 0; + +  g_assert (vm_); + +  addr = (gint) mix_short_magnitude (mix_vm_get_prog_count (vm_)); +  select_row_ (find_address_ (addr)); +} + +/* breakpoints */ +void +mixgtk_mixal_update_bp_at_address (guint addr) +{ +  update_bp_ (find_address_ ((gint)addr)); +} + +void +mixgtk_mixal_update_bp_at_line (guint line) +{ +  update_bp_ ((gint)line); +} + +void +mixgtk_mixal_update_bp_all (void) +{ +  gint k; +  for (k = 1; k <= lineno_; ++k) update_bp_ (k); +  mixgtk_mixal_update (); +} + +/* callbacks */ +static void +mixal_row_clicked_ (GtkTreeIter *iter) +{ + +  gint addr = MIX_VM_CELL_NO; +  gtk_tree_model_get (GTK_TREE_MODEL (clist_store_), +                      iter, CLIST_ADDRESS_NO_COL, &addr, -1); + +  if (addr < MIX_VM_CELL_NO) +    { +      gboolean isset = mix_vm_has_breakpoint_at_address (vm_, addr); +      if (isset) +        mix_vm_clear_breakpoint_address (vm_, addr); +      else +        mix_vm_set_breakpoint_address (vm_, addr); +      update_bp_ (find_address_ (addr)); +    } +} + +static void +mixal_motion_ (GtkTreeIter *iter) +{ +  static gint last_row = 0; +  static guint last_message = 0; + +  gint row = last_row; + +  gtk_tree_model_get (GTK_TREE_MODEL (clist_store_), iter, +                      CLIST_LINE_NO_COL, &row, -1); + +  if (row > 0 && row != last_row && tips_text_) +    { +      const gchar *msg = NULL; +      last_row = row; +      if (last_message) +        gtk_statusbar_remove (status_, status_context_, last_message); +      msg = (const gchar *)g_ptr_array_index (tips_text_, row - 1); +      if (msg) +        last_message = gtk_statusbar_push (status_, status_context_, msg); +      else +        last_message = 0; +    } +} + +static gboolean +mixal_event_ (GtkWidget *w, GdkEvent *event, gpointer data) +{ +  GdkEventType type = event->type; +  if ((type == GDK_BUTTON_PRESS || type == GDK_MOTION_NOTIFY) +      && (gtk_tree_view_get_bin_window (clist_) == event->any.window)) +    { +      gdouble x = (type == GDK_BUTTON_PRESS)? event->button.x : event->motion.x; +      gdouble y = (type == GDK_BUTTON_PRESS)? event->button.y : event->motion.y; +      GtkTreeIter iter; +      GtkTreePath *path = NULL; +      GtkTreeViewColumn *col = NULL; +      if (gtk_tree_view_get_path_at_pos (clist_, x, y, &path, &col, NULL, NULL) +          && gtk_tree_model_get_iter (GTK_TREE_MODEL (clist_store_), +                                      &iter, path)) +        { +          if (type == GDK_BUTTON_PRESS) mixal_row_clicked_ (&iter); +          else mixal_motion_ (&iter); +        } +      if (path) gtk_tree_path_free (path); +      return TRUE; +    } +  return FALSE; +} + +void +on_symbol_ok_clicked () +{ +  gtk_widget_hide (symbols_dlg_); +} + +void +on_symbols_activate () +{ +  if (!symbols_dlg_) init_symbols_ (); +  gtk_widget_show (symbols_dlg_); +} + +void +on_mixal_leave_notify_event () +{ +  if (status_ != NULL) gtk_statusbar_pop (status_, status_context_); +} + +void +on_mixal_font_activate () +{ +  GtkWidget *w[] = { GTK_WIDGET (clist_) }; +  mixgtk_fontsel_query_font (MIX_FONT_MIXAL, w, 1); +} + +void +on_symbols_font_activate () +{ +  if (symbols_view_ != NULL) +    { +      GtkWidget *w[] = { GTK_WIDGET (symbols_view_) }; +      mixgtk_fontsel_query_font (MIX_FONT_SYMBOLS, w, 1); +    } +  else +    mixgtk_fontsel_query_font (MIX_FONT_SYMBOLS, NULL, 0); +} diff --git a/mixgtk/mixgtk_mixal.h b/mixgtk/mixgtk_mixal.h new file mode 100644 index 0000000..1afe9a0 --- /dev/null +++ b/mixgtk/mixgtk_mixal.h @@ -0,0 +1,66 @@ +/* -*-c-*- ---------------- mixgtk_mixal.h : + * Declarations for functions displaying the mixal source file + * ------------------------------------------------------------------ + * $Id: mixgtk_mixal.h,v 1.8 2005/09/20 19:43:14 jao Exp $ + * ------------------------------------------------------------------ + * Copyright (C) 2001, 2004 Free Software Foundation, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + + +#ifndef MIXGTK_MIXAL_H +#define MIXGTK_MIXAL_H + +#include <gtk/gtk.h> +#include <mixlib/mix_vm.h> +#include "mixgtk_widgets.h" + + +/* initialise the mixal widget */ +extern GtkWidget * +mixgtk_mixal_init (mix_vm_t *vm); + +extern void +mixgtk_mixal_reparent (GtkStatusbar *stat); + +/* load the corresponding mixal file */ +extern void +mixgtk_mixal_load_file (void); + +/* update the widget */ +extern void +mixgtk_mixal_update (void); + +extern void +mixgtk_mixal_update_fonts (void); + +extern void +mixgtk_mixal_pop_status (void); + +/* breakpoints */ +extern void +mixgtk_mixal_update_bp_at_address (guint addr); + +extern void +mixgtk_mixal_update_bp_at_line (guint line); + +extern void +mixgtk_mixal_update_bp_all (void); + + +#endif /* MIXGTK_MIXAL_H */ + diff --git a/mixgtk/mixgtk_mixvm.c b/mixgtk/mixgtk_mixvm.c new file mode 100644 index 0000000..cc74e27 --- /dev/null +++ b/mixgtk/mixgtk_mixvm.c @@ -0,0 +1,529 @@ +/* -*-c-*- -------------- mixgtk_mixvm.c : + * Implementation of the functions declared in mixgtk_mixvm.h + * ------------------------------------------------------------------ + * $Id: mixgtk_mixvm.c,v 1.16 2005/09/20 19:43:14 jao Exp $ + * ------------------------------------------------------------------ + * Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include <stdlib.h> +#include <mixlib/xmix_vm.h> +#include "mixgtk_widgets.h" +#include "mixgtk_fontsel.h" +#include "mixgtk_mixvm.h" +#include "mixgtk_cmd_dispatcher.h" +#include "mixgtk_input.h" + + +/* Local variables */ + +#define REGISTER_NO_ (MIXGTK_WIDGET_rI6 - MIXGTK_WIDGET_rA + 1) + +static GtkEntry *reg_entries_[REGISTER_NO_]; +static GtkTooltips *tips_ = NULL; +static GtkEntry *loc_entry_; +static GtkWidget *goto_ = NULL; +static GtkEntry *goto_entry_ = NULL; +static GtkToggleButton *over_button_; +static GtkToggleButton *cmp_buttons_[3]; +static GtkTreeView *memory_; +static GtkListStore *mem_store_; +static GtkLabel *laptime_; +static GtkLabel *progtime_; +static GtkLabel *uptime_; +static mix_vm_t *vm_; + + +/* Static function prototypes */ +static void init_goto_ (void); +static void update_register_ (mixgtk_widget_id_t reg); +static gboolean init_mem_ (void); + + +enum { +  MEM_ADDRESS_COL, +  MEM_CONTENTS_COL, +  MEM_COL_NO +}; + + +/* initialise the mixvm widgets */ +gboolean +mixgtk_mixvm_init (mix_vm_t *vm) +{ +  int k; + +  g_assert (vm != NULL); + +  vm_ = vm; + +  if (!tips_) tips_ = gtk_tooltips_new (); + +  for (k = 0; k < REGISTER_NO_; ++k) +    { +      reg_entries_[k] = +        GTK_ENTRY (mixgtk_widget_factory_get(MIXGTK_MIXVM_DIALOG, +                                             MIXGTK_WIDGET_rA + k)); +      g_assert (reg_entries_[k] != NULL); +      mixgtk_fontsel_set_font (MIX_FONT_MIXVM, +                               GTK_WIDGET (reg_entries_[k])); +    } + +  loc_entry_ = +    GTK_ENTRY (mixgtk_widget_factory_get (MIXGTK_MIXVM_DIALOG, +                                          MIXGTK_WIDGET_LOC)); +  g_assert (loc_entry_ != NULL); +  mixgtk_fontsel_set_font (MIX_FONT_MIXVM, GTK_WIDGET (loc_entry_)); + +  uptime_ = +    GTK_LABEL (mixgtk_widget_factory_get (MIXGTK_MIXVM_DIALOG, +                                          MIXGTK_WIDGET_UPTIME)); +  g_assert (uptime_ != NULL); + +  progtime_ = +    GTK_LABEL (mixgtk_widget_factory_get (MIXGTK_MIXVM_DIALOG, +                                          MIXGTK_WIDGET_PROGTIME)); +  g_assert (progtime_ != NULL); + +  laptime_ = +    GTK_LABEL (mixgtk_widget_factory_get (MIXGTK_MIXVM_DIALOG, +                                          MIXGTK_WIDGET_LAPTIME)); +  g_assert (laptime_ != NULL); + +  over_button_ = +    GTK_TOGGLE_BUTTON +    (mixgtk_widget_factory_get (MIXGTK_MIXVM_DIALOG, MIXGTK_WIDGET_OVER)); +  g_assert (over_button_ != NULL); + +  for (k = 0; k < 3; ++k) +    { +      cmp_buttons_[k] =	GTK_TOGGLE_BUTTON +        (mixgtk_widget_factory_get (MIXGTK_MIXVM_DIALOG, +                                    MIXGTK_WIDGET_CMP_L +k)); +      g_assert (cmp_buttons_[k] != NULL); +    } +  init_mem_ (); + +  return TRUE; +} + +static GtkWidget ** +text_widgets_ (gint *n) +{ +  static GtkWidget *w[REGISTER_NO_ + 2] = { NULL}; + +  if (w[0] == NULL) +    { +      gint k; +      w[0] = GTK_WIDGET (loc_entry_); +      w[1] = GTK_WIDGET (memory_); +      for (k = 0; k < REGISTER_NO_; ++k) +        w[k + 2] = GTK_WIDGET (reg_entries_[k]); +  }; + +  if (n) *n = REGISTER_NO_ + 2; + +  return w; +} + +void +mixgtk_mixvm_update_fonts (void) +{ +  gint k, n = 0; +  GtkWidget **w = text_widgets_ (&n); +  for (k = 0; k < n; ++k) +    mixgtk_fontsel_set_font (MIX_FONT_MIXVM, w[k]); +} + +/* update register widgets */ +void +mixgtk_mixvm_update_registers (void) +{ +  gint k; +  for (k = MIXGTK_WIDGET_rA; k <= MIXGTK_WIDGET_rI6; ++k) +    update_register_ (k); +} + +/* update the overflow toggle */ +void +mixgtk_mixvm_update_over_toggle (void) +{ +  g_assert (over_button_); +  gtk_toggle_button_set_active (over_button_, +				mix_vm_get_overflow (vm_)); +} + +/* update the comparison flag */ +void +mixgtk_mixvm_update_cmp (void) +{ +  gint toggle; + +  g_assert (cmp_buttons_); + +  toggle = mix_vm_get_cmpflag (vm_); +  gtk_toggle_button_set_active (cmp_buttons_[toggle], TRUE); +} + + +/* update the memory cells */ +void +mixgtk_mixvm_update_cells (void) +{ +  static gchar BUFFER[20]; +  GtkTreeIter iter; +  gboolean valid = +    gtk_tree_model_get_iter_first (GTK_TREE_MODEL (mem_store_), &iter); +  gint k = 0; + +  while (valid) +    { +      mix_word_print_to_buffer (mix_vm_get_addr_contents (vm_, k++), BUFFER); +      gtk_list_store_set (mem_store_, &iter, MEM_CONTENTS_COL, BUFFER, -1); +      valid = gtk_tree_model_iter_next (GTK_TREE_MODEL (mem_store_), &iter); +    } +} + +void +mixgtk_mixvm_update_cells_to_address (gint address) +{ +  GtkTreePath *path = gtk_tree_path_new_from_indices (address, -1); + +  if (address >= MIX_VM_CELL_NO) return; +  gtk_tree_view_scroll_to_cell (memory_, path, NULL, TRUE, 0, 0); +  gtk_tree_path_free (path); +} + +/* update the loc pointer */ +void +mixgtk_mixvm_update_loc (void) +{ +  enum {SIZE = 10 }; +  static gchar BUFFER[SIZE]; +  mix_short_t locval; + +  g_assert (loc_entry_); + +  locval = mix_vm_get_prog_count (vm_); +  g_snprintf (BUFFER, SIZE, "%04d", mix_short_magnitude (locval)); +  gtk_entry_set_text (loc_entry_, BUFFER); +} + +/* update times */ +void +mixgtk_mixvm_update_times (void) +{ +  enum {SIZE = 20 }; +  static gchar BUFFER[SIZE]; +  gint uptime, progtime, laptime; + +  g_assert (uptime_ && progtime_ && laptime_); +  mixgtk_cmd_dispatcher_get_times (&uptime, &progtime, &laptime); +  g_snprintf (BUFFER, SIZE, "%d", uptime); +  gtk_label_set_text (uptime_, BUFFER); +  g_snprintf (BUFFER, SIZE, "%d", progtime); +  gtk_label_set_text (progtime_, BUFFER); +  g_snprintf (BUFFER, SIZE, "%d", laptime); +  gtk_label_set_text (laptime_, BUFFER); +} + + +/* update all mixvm widgets */ +void +mixgtk_mixvm_update_vm_widgets (void) +{ +  mixgtk_mixvm_update_registers (); +  mixgtk_mixvm_update_loc (); +  mixgtk_mixvm_update_over_toggle (); +  mixgtk_mixvm_update_cmp (); +  mixgtk_mixvm_update_cells (); +  mixgtk_mixvm_update_times (); +} + + +/* update cmp flag */ +void +on_cmp_e_toggled (GtkWidget *widget, gpointer data) +{ +  if (GTK_TOGGLE_BUTTON (widget)->active) +    mix_vm_set_cmpflag (vm_, mix_EQ); +} + +void +on_cmp_l_toggled (GtkWidget *widget, gpointer data) +{ +  if (GTK_TOGGLE_BUTTON (widget)->active) +    mix_vm_set_cmpflag (vm_, mix_LESS); +} + +void +on_cmp_g_toggled (GtkWidget *widget, gpointer data) +{ +  if (GTK_TOGGLE_BUTTON (widget)->active) +    mix_vm_set_cmpflag (vm_, mix_GREAT); +} + +void +on_overflow_toggled (GtkWidget *widget, gpointer data) +{ +  mix_vm_set_overflow (vm_, GTK_TOGGLE_BUTTON (widget)->active); +} + +void +on_loc_arrow_clicked (GtkWidget *widget, gpointer data) +{ +  gint address = mix_short_magnitude (mix_vm_get_prog_count (vm_)); +  mixgtk_mixvm_update_cells_to_address (address); +} + +static void +register_AX_ (mix_word_t w, gpointer reg) +{ +  gint k = GPOINTER_TO_INT (reg); +  if (k == 0) +    mix_vm_set_rA (vm_, w); +  else +    mix_vm_set_rX (vm_, w); +  update_register_ (MIXGTK_WIDGET_rA + k); +} + +static void +register_j_ (mix_word_t w, gpointer data) +{ +  if (mix_word_is_negative (w)) mix_word_reverse_sign (w); +  mix_vm_set_rJ (vm_, mix_word_to_short_fast (w)); +  update_register_ (MIXGTK_WIDGET_rJ); +} + +static void +register_i_ (mix_word_t w, gpointer reg) +{ +  mix_vm_set_rI (vm_, GPOINTER_TO_INT (reg), mix_word_to_short_fast (w)); +  update_register_ (MIXGTK_WIDGET_rI1 - 1 + GPOINTER_TO_INT (reg)); +} + +gboolean +on_register_click (GtkWidget *w, GdkEvent *e, gpointer data) +{ +  enum {SIZE = 20}; +  static gchar BUFFER[SIZE]; +  gint k; + +  if (w == GTK_WIDGET (reg_entries_[0])) +    mixgtk_input_word (_("Register A"), mix_vm_get_rA (vm_), +		       register_AX_, GINT_TO_POINTER (0)); +  else if (w == GTK_WIDGET (reg_entries_[1])) +    mixgtk_input_word (_("Register X"), mix_vm_get_rX (vm_), +		       register_AX_, GINT_TO_POINTER(1)); +  else if (w == GTK_WIDGET (reg_entries_[2])) +    mixgtk_input_short (_("Register J"), mix_vm_get_rJ (vm_), +			register_j_, NULL); +  else for (k = 1; k < 7; ++k) +    { +      if (w == GTK_WIDGET (reg_entries_[2 + k])) +	{ +	  g_snprintf (BUFFER, SIZE, _("Register I%d"), k); +	  mixgtk_input_short (BUFFER, mix_vm_get_rI (vm_, k), +			      register_i_, GINT_TO_POINTER (k)); +	  break; +	} +    } +  return TRUE; +} + +static void +mem_cell_ (mix_word_t w, gpointer a) +{ +  mix_short_t addr = mix_short_new (GPOINTER_TO_INT (a)); +  mix_vm_set_addr_contents (vm_, addr, w); +  mixgtk_mixvm_update_cells (); +} + +void +on_mix_font_activate (void) +{ +  gint n; +  GtkWidget **w = text_widgets_ (&n); +  mixgtk_fontsel_query_font (MIX_FONT_MIXVM, w, n); +} + + + +/* static functions */ +static void +init_goto_ (void) +{ +  goto_ = mixgtk_widget_factory_get_dialog (MIXGTK_GOTO_DIALOG); +  g_assert (goto_ != NULL); +  goto_entry_ = +    GTK_ENTRY (mixgtk_widget_factory_get (MIXGTK_GOTO_DIALOG, +                                          MIXGTK_WIDGET_GOTO_ENTRY)); +  g_assert (goto_entry_ != NULL); +} + +static void +update_register_ (mixgtk_widget_id_t reg) +{ +  static gchar BUFFER[20]; +  mix_word_t tipval = MIX_WORD_ZERO; +  switch (reg) +    { +    case MIXGTK_WIDGET_rA: +      tipval = mix_vm_get_rA (vm_); +      mix_word_print_to_buffer (tipval, BUFFER); +      break; +    case MIXGTK_WIDGET_rX: +      tipval = mix_vm_get_rX (vm_); +      mix_word_print_to_buffer (tipval, BUFFER); +      break; +    case MIXGTK_WIDGET_rJ: +      tipval = mix_short_to_word_fast (mix_vm_get_rJ (vm_)); +      mix_short_print_to_buffer (mix_vm_get_rJ (vm_), BUFFER); +      break; +    case MIXGTK_WIDGET_rI1: +    case MIXGTK_WIDGET_rI2: +    case MIXGTK_WIDGET_rI3: +    case MIXGTK_WIDGET_rI4: +    case MIXGTK_WIDGET_rI5: +    case MIXGTK_WIDGET_rI6: +      { +	gint k = reg - MIXGTK_WIDGET_rI1 + 1; +	tipval = mix_short_to_word_fast (mix_vm_get_rI (vm_, k)); +	mix_short_print_to_buffer (mix_vm_get_rI (vm_, k), BUFFER); +      } +      break; +    default: +      g_assert_not_reached (); +    } +  gtk_entry_set_text (reg_entries_[reg - MIXGTK_WIDGET_rA], BUFFER); +  g_snprintf (BUFFER, 20, "%s%ld", mix_word_is_negative (tipval)? "-" : "", +              mix_word_magnitude (tipval)); +  gtk_tooltips_set_tip (tips_, +			GTK_WIDGET (reg_entries_[reg - MIXGTK_WIDGET_rA]), +			BUFFER, NULL); + +} + + +static void +cells_clicked_ (GtkTreeViewColumn* col, gpointer data) +{ +  if (!goto_) init_goto_ (); +  if (gtk_dialog_run (GTK_DIALOG (goto_)) == GTK_RESPONSE_OK) +    { +      const gchar *txt = gtk_entry_get_text (goto_entry_); +      mix_short_t addr = mix_short_new (atoi (txt)); +      if (addr < MIX_VM_CELL_NO) +        mixgtk_mixvm_update_cells_to_address (addr); +    } +  gtk_widget_hide (goto_); +} + +static gboolean +cont_clicked_ (GtkWidget *w, GdkEvent *event, gpointer data) +{ +  enum {SIZE = 30}; +  static gchar BUFFER[SIZE]; + +  if (event->type == GDK_BUTTON_PRESS) +    { +      GtkTreeIter iter; +      GtkTreeModel *model; +      GtkTreeSelection *selection; + +      selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (memory_)); + +      if (gtk_tree_selection_get_selected (selection, &model, &iter)) +        { +          gint addr; + +          gtk_tree_model_get (model, &iter, MEM_ADDRESS_COL, &addr, -1); +          g_snprintf (BUFFER, SIZE, _("Memory cell no. %d"), addr); +          mixgtk_input_word +            (BUFFER, +             mix_vm_get_addr_contents (vm_, mix_short_new (addr)), +             mem_cell_, GINT_TO_POINTER (addr)); +        } +    } + +  return FALSE; +} + + +static gboolean +init_mem_ (void) +{ +  gint k; +  GtkTreeIter iter; +  GtkCellRenderer *renderer; +  GtkTreeViewColumn *col; + +  /* model */ + +  mem_store_ = gtk_list_store_new (MEM_COL_NO, G_TYPE_INT, G_TYPE_STRING); + +  g_assert (mem_store_); + +  for (k = 0; k< MIX_VM_CELL_NO; ++k) +    { +      gtk_list_store_append (mem_store_, &iter); +      gtk_list_store_set (mem_store_, &iter, +                          MEM_ADDRESS_COL, k, +                          MEM_CONTENTS_COL, "+ 00 00 00 00 00", +                          -1); +    } + +  /* view */ + +  renderer = gtk_cell_renderer_text_new (); +  memory_ = +    GTK_TREE_VIEW (mixgtk_widget_factory_get (MIXGTK_MIXVM_DIALOG, +                                              MIXGTK_WIDGET_CELLS)); + +  g_assert (memory_); +  g_assert (renderer); + +  gtk_tree_view_set_model (memory_, GTK_TREE_MODEL (mem_store_)); +  gtk_tree_view_set_headers_clickable (memory_, TRUE); +  g_object_unref (G_OBJECT (mem_store_)); + +  col = gtk_tree_view_column_new_with_attributes ("Address", renderer, +                                                  "text", 0, NULL); +  gtk_tree_view_column_set_clickable (col, TRUE); +  g_signal_connect (G_OBJECT (col), "clicked", +                    G_CALLBACK (cells_clicked_), NULL); + +  gtk_tree_view_append_column (memory_, col); + + +  col = gtk_tree_view_column_new_with_attributes ("Contents", renderer, +                                                  "text", 1, NULL); +  gtk_tree_view_column_set_clickable (col, TRUE); +  g_signal_connect (G_OBJECT (col), "clicked", +                    G_CALLBACK (cont_clicked_), NULL); + +  gtk_tree_view_append_column (memory_, col); + +  g_signal_connect (G_OBJECT (memory_), "event-after", +                    G_CALLBACK (cont_clicked_), NULL); + +  mixgtk_fontsel_set_font (MIX_FONT_MIXVM, GTK_WIDGET (memory_)); + +  return TRUE; +} + diff --git a/mixgtk/mixgtk_mixvm.h b/mixgtk/mixgtk_mixvm.h new file mode 100644 index 0000000..79a8d72 --- /dev/null +++ b/mixgtk/mixgtk_mixvm.h @@ -0,0 +1,72 @@ +/* -*-c-*- ---------------- mixgtk_mixvm.h : + * Functions dealing with the mixvm widgets + * ------------------------------------------------------------------ + * $Id: mixgtk_mixvm.h,v 1.6 2005/09/20 19:43:14 jao Exp $ + * ------------------------------------------------------------------ + * Copyright (C) 2001, 2004 Free Software Foundation, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + + +#ifndef MIXGTK_MIXVM_H +#define MIXGTK_MIXVM_H + +#include <mixlib/mix_vm.h> +#include "mixgtk.h" +#include "mixgtk_widgets.h" + +/* initialise the mixvm widgets */ +extern gboolean +mixgtk_mixvm_init (mix_vm_t *vm); + +extern void +mixgtk_mixvm_update_fonts (void); + +/* update register widgets */ +extern void +mixgtk_mixvm_update_registers (void); + +/* update the overflow toggle */ +extern void +mixgtk_mixvm_update_over_toggle (void); + +/* update the comparison flag */ +extern void +mixgtk_mixvm_update_cmp (void); + +/* update the memory cells */ +extern void +mixgtk_mixvm_update_cells (void); + +extern void +mixgtk_mixvm_update_cells_to_address (gint address); + +/* update the loc pointer */ +extern void +mixgtk_mixvm_update_loc (void); + +/* update times */ +extern void +mixgtk_mixvm_update_times (void); + +/* update all mixvm widgets */ +extern void +mixgtk_mixvm_update_vm_widgets (void); + + +#endif /* MIXGTK_MIXVM_H */ + diff --git a/mixgtk/mixgtk_widgets.c b/mixgtk/mixgtk_widgets.c new file mode 100644 index 0000000..724b578 --- /dev/null +++ b/mixgtk/mixgtk_widgets.c @@ -0,0 +1,153 @@ +/* -*-c-*- -------------- mixgtk_widgets.c : + * Implementation of the functions declared in mixgtk_widgets.h + * ------------------------------------------------------------------ + *  Last change: Time-stamp: "2001-04-29 14:32:17 jao" + * ------------------------------------------------------------------ + * Copyright (C) 2001, 2004 Free Software Foundation, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + + +#include <unistd.h> +#include <glade/glade.h> +#include <mixlib/mix.h> +#include "mixgtk_config.h" +#include "mixgtk_widgets.h" + +/* dialog names */ +static const gchar * dnames_[] = { +  "main_window", +  "mixvm_window", +  "mixal_window", +  "devices_window", +  "word_dialog", +  "about_dialog", +  "goto_dialog", +  "fontsel_dialog", +  "devform_dialog", +  "external_dialog", +  "symbols_dialog", +  "input_dialog", +  "devdir_dialog" +}; + +#define DLG_NO_ (sizeof (dnames_) / sizeof(dnames_[0])) + +/* widget names */ +static const gchar *names_[] = { +  "main_statusbar", +  "attach_button", +  "main_notebook", +  "mixvm_widget", +  "mixvm_container", +  "command_prompt", +  "command_log", +  "dev_container", +  "mixal_container", +  "mixal_statusbar", +  "rA_entry", +  "rX_entry", +  "rJ_entry", +  "rI1_entry", +  "rI2_entry", +  "rI3_entry", +  "rI4_entry", +  "rI5_entry", +  "rI6_entry", +  "lesser_radio", +  "equal_radio", +  "greater_radio", +  "over_toggle", +  "memory_cells", +  "elapsed_label", +  "program_label", +  "uptime_label", +  "devices_container", +  "loc_entry", +  "goto_entry", +  NULL +}; + +#define WIDGET_NO_ (sizeof (names_) / sizeof (names_[0])) + +/* the glade specs */ +static GladeXML *xml_[DLG_NO_] = {NULL}; + +/* the xml file name */ +static const gchar *file_ = NULL; + +static void init_xml_ (mixgtk_dialog_id_t dlg) +{ +  xml_[dlg] = glade_xml_new (file_, dnames_[dlg], NULL); +  glade_xml_signal_autoconnect (xml_[dlg]); +  g_assert (xml_[dlg] != NULL); +} + +/* create a new factory from an xml glade file */ +gboolean +mixgtk_widget_factory_init (void) +{ +  if (!file_) +    { +      const gchar *glade_file = GLADE_FILE; +      glade_init (); +      if (access (glade_file, R_OK)) { +	if (access (LOCAL_GLADE_FILE, R_OK)) return FALSE; +	glade_file = LOCAL_GLADE_FILE; +      } +      file_ = g_strdup (glade_file); +    } +  else +    { +      gint k; +      for (k = 0; k < DLG_NO_; ++k) if (xml_[k]) xml_[k] = NULL; +    } + +  init_xml_ (MIXGTK_MAIN); +  return TRUE; +} + +/* get a widget */ +GtkWidget * +mixgtk_widget_factory_get (mixgtk_dialog_id_t dlg, mixgtk_widget_id_t widget) +{ +  g_assert (widget < WIDGET_NO_); + +  return mixgtk_widget_factory_get_child_by_name (dlg, names_[widget]); +} + + +GtkWidget * +mixgtk_widget_factory_get_dialog (mixgtk_dialog_id_t dlg) +{ +  g_assert (dlg < DLG_NO_); + +  if (!xml_[dlg]) init_xml_ (dlg); +  return glade_xml_get_widget (xml_[dlg], dnames_[dlg]); +} + +GtkWidget * +mixgtk_widget_factory_get_child_by_name (mixgtk_dialog_id_t dlg, +					 const gchar *name) +{ +  g_assert (dlg < DLG_NO_); +  g_assert (name != NULL); +  if (!xml_[dlg]) init_xml_ (dlg); +  return glade_xml_get_widget (xml_[dlg], name); +} + + diff --git a/mixgtk/mixgtk_widgets.h b/mixgtk/mixgtk_widgets.h new file mode 100644 index 0000000..720f962 --- /dev/null +++ b/mixgtk/mixgtk_widgets.h @@ -0,0 +1,102 @@ +/* -*-c-*- ---------------- mixgtk_widgets.h : + * glade-based factory of mixvm widgets + * ------------------------------------------------------------------ + * $Id: mixgtk_widgets.h,v 1.15 2005/09/20 19:43:14 jao Exp $ + * ------------------------------------------------------------------ + * Copyright (C) 2001, 2004 Free Software Foundation, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + + +#ifndef MIXGTK_WIDGETS_H +#define MIXGTK_WIDGETS_H + +#include <gtk/gtk.h> +#include <mixlib/mix_vm.h> + +/* enumeration of gmixvm dialogs */ +typedef enum { +  MIXGTK_MAIN,	          /* main app window */ +  MIXGTK_MIXVM_DIALOG,    /* mixvm dialog */ +  MIXGTK_MIXAL_DIALOG,	  /* mixal dialog */ +  MIXGTK_DEVICES_DIALOG,  /* devices dialog */ +  MIXGTK_WORD_DIALOG,	  /* input dialog for a mix word */ +  MIXGTK_ABOUT_DIALOG, +  MIXGTK_GOTO_DIALOG, +  MIXGTK_FONTSEL_DIALOG,  /* font selection dialog */ +  MIXGTK_DEVFORM_DIALOG,  /* device format config dialog */ +  MIXGTK_EXTERNPROG_DIALOG,	/* external programs dialog */ +  MIXGTK_SYMBOLS_DIALOG,	/* symbol table dialog */ +  MIXGTK_INPUT_DIALOG,          /* console input dialog */ +  MIXGTK_DEVDIR_DIALOG          /* devices directory chooser */ +} mixgtk_dialog_id_t; + +/* enumeration of mixvm widget ids */ +typedef enum { +  MIXGTK_WIDGET_STATUSBAR, +  MIXGTK_WIDGET_ATTACH_BUTTON, +  MIXGTK_WIDGET_NOTEBOOK,       /* the notebook */ +  MIXGTK_WIDGET_MIXVM,		/* virtual machine */ +  MIXGTK_WIDGET_MIXVM_CONTAINER, +  MIXGTK_WIDGET_PROMPT,		/* command prompt */ +  MIXGTK_WIDGET_LOG,		/* command output */ +  MIXGTK_WIDGET_DEV_CONTAINER, +  MIXGTK_WIDGET_MIXAL_CONTAINER, +  MIXGTK_WIDGET_MIXAL_STATUSBAR, +  MIXGTK_WIDGET_rA, +  MIXGTK_WIDGET_rX, +  MIXGTK_WIDGET_rJ, +  MIXGTK_WIDGET_rI1, +  MIXGTK_WIDGET_rI2, +  MIXGTK_WIDGET_rI3, +  MIXGTK_WIDGET_rI4, +  MIXGTK_WIDGET_rI5, +  MIXGTK_WIDGET_rI6, +  MIXGTK_WIDGET_CMP_L, +  MIXGTK_WIDGET_CMP_E, +  MIXGTK_WIDGET_CMP_G, +  MIXGTK_WIDGET_OVER, +  MIXGTK_WIDGET_CELLS, +  MIXGTK_WIDGET_LAPTIME, +  MIXGTK_WIDGET_PROGTIME, +  MIXGTK_WIDGET_UPTIME, +  MIXGTK_WIDGET_DEVICES, +  MIXGTK_WIDGET_LOC, +  MIXGTK_WIDGET_GOTO_ENTRY, +  MIXGTK_WIDGET_NONE +} mixgtk_widget_id_t; + + +/* create a new factory from an xml glade file */ +extern gboolean +mixgtk_widget_factory_init (void); + +/* get a dialog */ +extern GtkWidget * +mixgtk_widget_factory_get_dialog (mixgtk_dialog_id_t dlg); + +/* get a widget */ +extern GtkWidget * +mixgtk_widget_factory_get (mixgtk_dialog_id_t dlg, mixgtk_widget_id_t widget); + +/* Get a widget by name */ +extern GtkWidget * +mixgtk_widget_factory_get_child_by_name (mixgtk_dialog_id_t dlg, +					 const gchar *name); + +#endif /* MIXGTK_WIDGETS_H */ + diff --git a/mixgtk/mixgtk_wm.c b/mixgtk/mixgtk_wm.c new file mode 100644 index 0000000..7821d0e --- /dev/null +++ b/mixgtk/mixgtk_wm.c @@ -0,0 +1,573 @@ +/* -*-c-*- -------------- mixgtk_wm.c : + * Implementation of the functions declared in mixgtk_wm.h + * ------------------------------------------------------------------ + * $Id: mixgtk_wm.c,v 1.12 2005/09/20 19:43:14 jao Exp $ + * ------------------------------------------------------------------ + * Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include <string.h> + +#include "mixgtk_wm.h" + +#include "mixgtk_widgets.h" +#include "mixgtk_config.h" +#include "mixgtk_device.h" +#include "mixgtk_mixvm.h" +#include "mixgtk_mixal.h" +#include "mixgtk_widgets.h" +#include "mixgtk_cmd_dispatcher.h" +#include "mixgtk.h" + + +typedef struct window_info_t_ +{ +  mixgtk_dialog_id_t dialog; +  GtkWidget *widget; +  GtkCheckMenuItem *menu; +  const gchar *menu_name; +  const gchar *config_key; +  gboolean detached; +  void (*detach) (void); +  void (*attach) (void); +} window_info_t_; + +static const gchar *DETACH_YES_ = "Yes"; +static const gchar *DETACH_NO_ = "No"; +static GtkWidget *about_ = NULL; + +static GtkContainer *mixvm_container_ = NULL; +static GtkContainer *mixal_container_ = NULL; +static GtkContainer *dev_container_ = NULL; + +static const gchar *TB_MENU_NAME_ = "show_toolbars"; +static GtkCheckMenuItem *tb_menu_ = NULL; +static GtkNotebook *notebook_ = NULL; + +static mix_vm_t *vm_ = NULL; + +static void init_info_ (void); +static void init_notebook_ (void); +static void init_dispatcher_ (void); +static void init_mixvm_ (void); +static void init_mixal_ (void); +static void init_dev_ (void); +static void init_signals_ (void); +static void init_visibility_ (void); +static void init_tb_ (void); +static void init_about_ (void); +static void init_autosave_ (void); +static void show_toolbars_ (gboolean show); +static void add_page_ (GtkWidget *w, mixgtk_window_id_t id); +static void mixvm_attach_ (void); +static void mixvm_detach_ (void); +static void mixal_attach_ (void); +static void mixal_detach_ (void); +static void dev_attach_ (void); +static void dev_detach_ (void); +static void on_nb_switch_ (GtkNotebook *notebook, GtkWidget *page, +                           guint page_num, gpointer user_data); + +static window_info_t_ infos_[] = { +  {MIXGTK_MIXVM_DIALOG, NULL, NULL, "detach_vm", "MIX.detach", +   FALSE, mixvm_detach_, mixvm_attach_}, +  {MIXGTK_MIXAL_DIALOG, NULL, NULL, "detach_source", "MIXAL.detach", +   FALSE, mixal_detach_, mixal_attach_}, +  {MIXGTK_DEVICES_DIALOG, NULL, NULL, "detach_dev", "Devices.detach", +   FALSE, dev_detach_, dev_attach_} +}; + +static size_t INF_NO_ = sizeof (infos_) / sizeof (infos_[0]); + + +gboolean +mixgtk_wm_init (void) +{ +  gint k; + +  init_info_ (); +  init_notebook_ (); +  init_dispatcher_ (); +  init_mixvm_ (); +  init_mixal_ (); +  init_dev_ (); + +  for (k = 0; k < INF_NO_; ++k) +    { +      if (infos_[k].detached) +        mixgtk_wm_detach_window (k); +      else +        mixgtk_wm_attach_window (k); +    } + +  init_tb_ (); +  init_about_ (); +  init_autosave_ (); +  init_visibility_ (); +  init_signals_ (); + +  return TRUE; +} + +void +mixgtk_wm_detach_window (mixgtk_window_id_t w) +{ +  if (w < INF_NO_) +    { +      (*(infos_[w].detach)) (); +      infos_[w].detached = TRUE; +      gtk_check_menu_item_set_active (infos_[w].menu, TRUE); +      mixgtk_config_update (infos_[w].config_key, DETACH_YES_); +      if (infos_[w].widget != NULL) gtk_widget_show (infos_[w].widget); +      if (gtk_notebook_get_n_pages (notebook_) < 1) +        gtk_widget_hide (GTK_WIDGET (notebook_)); +      gtk_widget_show (mixgtk_widget_factory_get_dialog (infos_[w].dialog)); +    } +} + +void +mixgtk_wm_attach_window (mixgtk_window_id_t w) +{ +  if (w < INF_NO_) +    { +      gint page = gtk_notebook_page_num (notebook_, infos_[w].widget); + +      gtk_widget_hide (mixgtk_widget_factory_get_dialog (infos_[w].dialog)); + +      if (page < 0) (*(infos_[w].attach)) (); + +      infos_[w].detached = FALSE; +      gtk_check_menu_item_set_active (infos_[w].menu, FALSE); +      mixgtk_config_update (infos_[w].config_key, DETACH_NO_); +      if (gtk_notebook_get_n_pages (notebook_) == 1) +        gtk_widget_show (GTK_WIDGET (notebook_)); +    } +} + + + +/* callbacks */ +void +on_detach_clicked (GtkWidget *ignored) +{ +  gint page = gtk_notebook_get_current_page (notebook_); +  if (page >= 0) +    { +      gint k; +      GtkWidget *w = gtk_notebook_get_nth_page (notebook_, page); + +      for (k = 0; k < INF_NO_; ++k) +        if (infos_[k].widget == w) mixgtk_wm_detach_window (k); +    } +} + +void +on_attach_all_clicked () +{ +  gint k; +  for (k = INF_NO_; k > 0; --k) +    if (infos_[k - 1].detached) mixgtk_wm_attach_window (k - 1); +} + +void +on_attach_toggled (GtkCheckMenuItem *item) +{ +  gint k; +  for (k = 0; k < INF_NO_; ++k) +    if (item == infos_[k].menu) break; +  g_return_if_fail (k < INF_NO_); +  if (item->active) mixgtk_wm_detach_window (k); +  else mixgtk_wm_attach_window (k); +  mixgtk_config_update (infos_[k].config_key, +                        (item->active)? DETACH_YES_ : DETACH_NO_); +} + +void +on_window_hide (GtkWidget *w) +{ +  gint k; +  for (k = 0; k < INF_NO_; ++k) +    if (w == mixgtk_widget_factory_get_dialog (infos_[k].dialog)) break; +  g_return_if_fail (k < INF_NO_); +  mixgtk_wm_attach_window (k); +} + +void +on_show_toolbars_toggled (GtkCheckMenuItem *item) +{ +  if (item->active != mixgtk_config_show_toolbars ()) +    show_toolbars_ (item->active); +} + +void +on_widget_attach (GtkWidget *ign, gpointer id) +{ +  mixgtk_wm_attach_window (GPOINTER_TO_INT (id)); +} + + +/* about box */ +void +on_about_activate (GtkWidget *w, gpointer data) +{ +  if (!about_) init_about_ (); +  gtk_widget_show (about_); +} + + +static void +init_info_ (void) +{ +  gint k; +  for (k = 0; k < INF_NO_; ++k) +    { +      const gchar *txt; + +      infos_[k].menu = +        GTK_CHECK_MENU_ITEM +        (mixgtk_widget_factory_get_child_by_name (MIXGTK_MAIN, +                                                  infos_[k].menu_name)); +      g_assert (infos_[k].menu != NULL); +      txt = mixgtk_config_get (infos_[k].config_key); +      infos_[k].detached = txt && !g_ascii_strcasecmp (txt, DETACH_YES_); +    } +} + +static void +init_notebook_ (void) +{ +  notebook_ = +    GTK_NOTEBOOK (mixgtk_widget_factory_get (MIXGTK_MAIN, +                                             MIXGTK_WIDGET_NOTEBOOK)); +  g_assert (notebook_ != NULL); +  gtk_widget_show (GTK_WIDGET (notebook_)); +} + +static void +add_page_ (GtkWidget *page, mixgtk_window_id_t id) +{ +  static const gchar *LABELS[] = { +    N_("_Virtual machine"), N_("_Source"), N_("_Devices") +  }; + +  gint p = 0; + +  g_assert (page != NULL); +  g_assert (id < INF_NO_); +  g_assert (notebook_ != NULL); + +  if (id > MIXGTK_MIXVM_WINDOW) +    { +      if (id == MIXGTK_DEVICES_WINDOW) +        p = gtk_notebook_get_n_pages (notebook_); +      else +        p = infos_[MIXGTK_MIXVM_WINDOW].detached ? 0 : 1; +    } + +  gtk_notebook_insert_page (notebook_, page, +                            gtk_label_new_with_mnemonic (LABELS[id]), +                            p); +  gtk_notebook_set_current_page (notebook_, p); +  gtk_widget_show (page); +  gtk_widget_show (GTK_WIDGET (notebook_)); +} + +static void +init_signals_ (void) +{ +  gint k; +  for (k = 0; k < INF_NO_; ++k) +    { +      GObject *dialog = +        G_OBJECT (mixgtk_widget_factory_get_dialog (infos_[k].dialog)); + +      GObject *button = +        G_OBJECT (mixgtk_widget_factory_get (infos_[k].dialog, +                                             MIXGTK_WIDGET_ATTACH_BUTTON)); + +      g_assert (dialog != NULL); +      g_assert (button != NULL); + +      g_signal_connect (button, "clicked", +                        G_CALLBACK (on_widget_attach), GINT_TO_POINTER (k)); +      g_signal_connect (dialog, "destroy", +                        G_CALLBACK (on_window_hide), NULL); +      g_signal_connect (dialog, "destroy_event", +                        G_CALLBACK (on_window_hide), NULL); +      g_signal_connect (dialog, "delete_event", +                        G_CALLBACK (on_window_hide), NULL); +      g_signal_connect (G_OBJECT (infos_[k].menu), "toggled", +                        G_CALLBACK (on_attach_toggled), NULL); +    } + +} + +static void +init_visibility_ (void) +{ +  gint k; +  for (k = 0; k < INF_NO_; ++k) +    if (infos_[k].detached) +      gtk_widget_show (mixgtk_widget_factory_get_dialog (infos_[k].dialog)); + +  if (gtk_notebook_get_n_pages (notebook_) > 0) +    gtk_notebook_set_current_page (notebook_, 0); + +  gtk_widget_show (mixgtk_widget_factory_get_dialog (MIXGTK_MAIN)); +} + +static void +init_dispatcher_ (void) +{ +  if (!mixgtk_cmd_dispatcher_init (MIXGTK_MAIN)) +    g_assert (FALSE); +  vm_ = mixgtk_cmd_dispatcher_get_vm (); +  g_assert (vm_ != NULL); +} + +static void +init_mixvm_ (void) +{ +  GtkContainer *vm = +    GTK_CONTAINER +    (mixgtk_widget_factory_get (MIXGTK_MIXVM_DIALOG, MIXGTK_WIDGET_MIXVM)); + +  mixvm_container_ = +    GTK_CONTAINER (mixgtk_widget_factory_get (MIXGTK_MIXVM_DIALOG, +                                              MIXGTK_WIDGET_MIXVM_CONTAINER)); + +  g_assert (mixvm_container_ != NULL); + +  g_assert (vm != NULL); +  g_object_ref (G_OBJECT (vm)); +  infos_[MIXGTK_MIXVM_WINDOW].widget = GTK_WIDGET (vm); + +  mixgtk_mixvm_init (vm_); +  mixgtk_mixvm_update_vm_widgets (); + +  gtk_widget_show (GTK_WIDGET (vm)); + +} + +static void +init_mixal_ (void) +{ +  GtkWidget *page = gtk_scrolled_window_new (NULL, NULL); +  GtkWidget *mixal = mixgtk_mixal_init (vm_); + +  g_assert (page != NULL); +  g_assert (mixal != NULL); + +  g_object_ref (page); +  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (page), +                                  GTK_POLICY_AUTOMATIC, +                                  GTK_POLICY_AUTOMATIC); + +  gtk_container_add (GTK_CONTAINER (page), mixal); + +  infos_[MIXGTK_MIXAL_WINDOW].widget = page; + +  mixal_container_ = +    GTK_CONTAINER (mixgtk_widget_factory_get (MIXGTK_MIXAL_DIALOG, +                                              MIXGTK_WIDGET_MIXAL_CONTAINER)); + +  g_assert (mixal_container_ != NULL); + +  gtk_container_add (mixal_container_, page); + +  gtk_widget_show (mixal); +  gtk_widget_show (page); +  gtk_widget_show (GTK_WIDGET (mixal_container_)); +} + +static void +init_dev_ (void) +{ +  GtkWidget *page = gtk_scrolled_window_new (NULL, NULL); +  GtkWidget *devs = mixgtk_device_init (vm_); + +  g_assert (page != NULL); +  g_assert (devs != NULL); + +  g_object_ref (page); +  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (page), +                                  GTK_POLICY_AUTOMATIC, +                                  GTK_POLICY_AUTOMATIC); + +  gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (page), devs); + +  infos_[MIXGTK_DEVICES_WINDOW].widget = page; + +  dev_container_ = +    GTK_CONTAINER (mixgtk_widget_factory_get (MIXGTK_DEVICES_DIALOG, +                                              MIXGTK_WIDGET_DEV_CONTAINER)); + +  g_assert (dev_container_ != NULL); + +  gtk_container_add (dev_container_, page); + +  gtk_widget_show (devs); +  gtk_widget_show (page); +} + +static void +init_tb_ (void) +{ +  tb_menu_ = GTK_CHECK_MENU_ITEM +    (mixgtk_widget_factory_get_child_by_name (MIXGTK_MAIN, +  					      TB_MENU_NAME_)); +  g_assert (tb_menu_ != NULL); + +  gtk_check_menu_item_set_active (tb_menu_, mixgtk_config_show_toolbars ()); +  show_toolbars_ (mixgtk_config_show_toolbars ()); + +  g_signal_connect (G_OBJECT (tb_menu_), "toggled", +                    G_CALLBACK (on_show_toolbars_toggled), NULL); +} + +static void +show_toolbars_ (gboolean show) +{ +  static const gchar *HANDLE_NAME = "tb_handle"; + +  int k; + +  GtkWidget *handle = +    mixgtk_widget_factory_get_child_by_name (MIXGTK_MAIN, HANDLE_NAME); + +  if (show) +    gtk_widget_show (handle); +  else +    gtk_widget_hide (handle); + +  for (k = 0; k < INF_NO_; ++k) +    { +      GtkWidget *hd = +        mixgtk_widget_factory_get_child_by_name (infos_[k].dialog, HANDLE_NAME); +      if (show) gtk_widget_show (hd); else gtk_widget_hide (hd); +    } + +  mixgtk_config_set_show_toolbars (show); +} + +static void +init_autosave_ (void) +{ +#define AUTOSAVE_ITEM_ "save_on_exit" + +  GtkCheckMenuItem *item = GTK_CHECK_MENU_ITEM +    (mixgtk_widget_factory_get_child_by_name (MIXGTK_MAIN, AUTOSAVE_ITEM_)); +  if (item) +    { +      gtk_check_menu_item_set_active (item, mixgtk_config_is_autosave ()); +    } +} + +static void +init_about_ (void) +{ +#define VERSION_LABEL_ "version_label" +#define GPL_TEXT_ "gpl_text" +  GtkWidget *label; +  about_ = mixgtk_widget_factory_get_dialog (MIXGTK_ABOUT_DIALOG); +  g_assert (about_ != NULL); +  label = mixgtk_widget_factory_get_child_by_name (MIXGTK_ABOUT_DIALOG, +						   VERSION_LABEL_); +  g_assert (label != NULL); +  gtk_label_set_text (GTK_LABEL (label), VERSION); +  gtk_widget_show (label); +} + +static void +mixvm_attach_ (void) +{ +  gtk_container_remove (mixvm_container_, infos_[MIXGTK_MIXVM_WINDOW].widget); +  add_page_ (infos_[MIXGTK_MIXVM_WINDOW].widget, MIXGTK_MIXVM_WINDOW); +} + +static void +mixvm_detach_ (void) +{ +  gtk_widget_reparent (infos_[MIXGTK_MIXVM_WINDOW].widget, +                       GTK_WIDGET (mixvm_container_)); +} + +static void +mixal_attach_ (void) +{ +  static GtkStatusbar *stat = NULL; + +  if (stat == NULL) +    { +      stat = +        GTK_STATUSBAR +        (mixgtk_widget_factory_get (MIXGTK_MAIN, MIXGTK_WIDGET_STATUSBAR)); +      g_assert (stat); + +      g_signal_connect (G_OBJECT (notebook_), "switch-page", +                        G_CALLBACK (on_nb_switch_), NULL); +    } + +  mixgtk_mixal_reparent (stat); +  gtk_container_remove (mixal_container_, infos_[MIXGTK_MIXAL_WINDOW].widget); +  add_page_ (infos_[MIXGTK_MIXAL_WINDOW].widget, MIXGTK_MIXAL_WINDOW); +} + +static void +mixal_detach_ (void) +{ +  static GtkStatusbar *stat = NULL; + +  if (stat == NULL) +    { +      stat = +        GTK_STATUSBAR +        (mixgtk_widget_factory_get (MIXGTK_MIXAL_DIALOG, +                                    MIXGTK_WIDGET_MIXAL_STATUSBAR)); +      g_assert (stat); +    } + +  mixgtk_mixal_reparent (stat); +  gtk_widget_reparent (infos_[MIXGTK_MIXAL_WINDOW].widget, +                       GTK_WIDGET (mixal_container_)); +} + +static void +dev_attach_ (void) +{ +  gtk_container_remove (dev_container_, infos_[MIXGTK_DEVICES_WINDOW].widget); +  add_page_ (infos_[MIXGTK_DEVICES_WINDOW].widget, MIXGTK_DEVICES_WINDOW); +} + +static void +dev_detach_ (void) +{ +  gtk_widget_reparent (infos_[MIXGTK_DEVICES_WINDOW].widget, +                       GTK_WIDGET (dev_container_)); +} + +static void +on_nb_switch_ (GtkNotebook *notebook, GtkWidget *page, +               guint page_num, gpointer user_data) +{ +  if (!(infos_[MIXGTK_MIXAL_WINDOW].detached) +      && (page != infos_[MIXGTK_MIXAL_WINDOW].widget)) +    mixgtk_mixal_pop_status (); +} + + diff --git a/mixgtk/mixgtk_wm.h b/mixgtk/mixgtk_wm.h new file mode 100644 index 0000000..878eca6 --- /dev/null +++ b/mixgtk/mixgtk_wm.h @@ -0,0 +1,46 @@ +/* -*-c-*- ---------------- mixgtk_wm.h : + * Functions for window management + * ------------------------------------------------------------------ + * $Id: mixgtk_wm.h,v 1.5 2005/09/20 19:43:14 jao Exp $ + * ------------------------------------------------------------------ + * Copyright (C) 2001, 2004 Free Software Foundation, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + + +#ifndef MIXGTK_WM_H +#define MIXGTK_WM_H + +#include "mixgtk.h" + +typedef enum { +  MIXGTK_MIXVM_WINDOW, +  MIXGTK_MIXAL_WINDOW, +  MIXGTK_DEVICES_WINDOW +} mixgtk_window_id_t; + +extern gboolean +mixgtk_wm_init (void); + +extern void +mixgtk_wm_attach_window (mixgtk_window_id_t w); + +extern void +mixgtk_wm_detach_window (mixgtk_window_id_t w); + +#endif /* MIXGTK_WM_H */ + | 
