/* Last modified: 18/1/2003                                                   */
/* Headers for shared definitions etc.                                        */
/* Use until we can get things properly scoped.     @@@                       */

#include <gtk/gtk.h>                                  /* GtkWidget used below */
#include <gdk/gdkx.h>


int TRACE;     /* Value - print trace of major procedure calls higher => more */


/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */

/* Required by interface.h and view.h                                         */


typedef enum
{ /* this describes a type of a feature and will be used as member in feature */
  UNKNOWN,
  XILINX_FPGA,
  TERMINAL
//,  I_HAVE_TO_PUT_SOMETHING_HERE,
//  ELSE_IT_WOULD_LOOK_STUPID
}
feature_type;

typedef struct
{                                      /* holds data of a Xilinx FPGA feature */
  char *filestring;
}
xilinx_fpga_data;

typedef struct
{                                              /* holds data about a terminal */
  GtkWidget *text;
}
terminal_data;

typedef struct
{                                                           /* Feature struct */
  unsigned char reference_number;
  int sub_reference_number;
  char *name;                     /* its name as recognised from .komodo file */
  feature_type type;
                 /* see above - enumeration with different supported features */
  union
  {                                           /* the data within that feature */
    xilinx_fpga_data xilinx_fpga;
    terminal_data terminal;
  }
  data;
  unsigned char dev_number;
  /* number to communicate by - serial number assigned depending on the order */
}                                                      /*   the board sent it */
feature;


feature *board_features;                          /* a list of those features */


/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* Required by interface and callbacks                                        */


int emulator_PID;                                 /* @@@ not sure about scope */


/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* Required by view, viewfuncs and callbacks                                  */

/* the following are the handles of the toggle-buttons used for flag display  */

GtkWidget *flag_button[2][6];   /* First index is CPSR/SPSR, second is flag # */
/* flag #: V, C, Z, N, I, F   ... turned out a bit silly @@@                  */
GtkWidget *CPSR_menu_handle;
GtkWidget *SPSR_menu_handle;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */

extern char *mem_column_data[];            /* Contents defined in callbacks.c */
                                            /* Used in callbacks.c and view.c */

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */

GdkColor view_greycolour;  /* defines the grey colour used in the application */
GdkColor view_redcolour;

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */

int nasty_flag_ignore_flag;                             /* TEMPORARY hack @@@ */
/* This disgusting little flag is there to patch a problem with the flag      */
/*   display window.  The problem is (something like) switching modes causes  */
/*   a toggle button update which - in turn - calls back as if the button is  */
/*   toggled manually.  This then (rather mysteriously) can cause a spurious  */
/*   flag change.  Notably this happens when switching register notebook      */
/*   pages.  Reordering some events -might- be the cure???                    */

