- new symbol BX_USE_TEXTCONFIG controls the presence of the text mode configuration

interface. It should be set to 1 unless Bochs is compiled for wxWindows only.
- 'user_shortcut' is now available at runtime (wx version only)
This commit is contained in:
Volker Ruppert 2004-01-29 18:50:33 +00:00
parent d1922bc835
commit c3d9a977f8
7 changed files with 44 additions and 19 deletions

View File

@ -397,6 +397,10 @@
#define BX_WITH_SVGA 0
#define BX_WITH_WX 0
// BX_USE_TEXTCONFIG should be set to 1 unless Bochs is compiled
// for wxWindows only.
#define BX_USE_TEXTCONFIG 1
// add special export symbols for win32 DLL building. The main code must
// have __declspec(dllexport) on variables, functions, or classes that the
// plugins can access. The plugins should #define PLUGGABLE which will

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: siminterface.h,v 1.115 2004-01-15 02:08:34 danielg4 Exp $
// $Id: siminterface.h,v 1.116 2004-01-29 18:50:32 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Before I can describe what this file is for, I have to make the
@ -81,9 +81,9 @@
//////////////////////////////////////////////////////
// BX_UI_TEXT should be set to 1 when the text mode configuration interface
// BX_USE_TEXTCONFIG should be set to 1 when the text mode configuration interface
// is compiled in. This gives each type of parameter a text_print and text_ask
// method (defined in gui/control.cc) so that you can call text_ask() on any
// method (defined in gui/textconfig.cc) so that you can call text_ask() on any
// kind of parameter to ask the user to edit the value.
//
// I have been considering whether to use the same strategy for the
@ -101,7 +101,6 @@
// implementations for example). This argues for keeping UI-specific
// structures out of the simulator interface. It certainly works ok for the
// text interface, but that's because FILE* is standard and portable.
#define BX_UI_TEXT 1
//////////////////////////////////////////////////////
@ -873,7 +872,7 @@ public:
static const char* set_default_format (const char *f);
static const char *get_default_format () { return default_text_format; }
virtual bx_list_c *get_dependent_list () { return NULL; }
#if BX_UI_TEXT
#if BX_USE_TEXTCONFIG
virtual void text_print (FILE *fp) {}
virtual int text_ask (FILE *fpin, FILE *fpout) {return -1;}
#endif
@ -933,7 +932,7 @@ public:
static Bit32u get_default_base () { return default_base; }
void set_options (Bit32u options) { this->options = options; }
Bit32u get_options () { return options; }
#if BX_UI_TEXT
#if BX_USE_TEXTCONFIG
virtual void text_print (FILE *fp);
virtual int text_ask (FILE *fpin, FILE *fpout);
#endif
@ -1010,7 +1009,7 @@ public:
char *name,
char *description,
Bit64s initial_val);
#if BX_UI_TEXT
#if BX_USE_TEXTCONFIG
virtual void text_print (FILE *fp);
virtual int text_ask (FILE *fpin, FILE *fpout);
#endif
@ -1044,7 +1043,7 @@ public:
char *get_choice (int n) { return choices[n]; }
int find_by_name (const char *string);
bool set_by_name (const char *string);
#if BX_UI_TEXT
#if BX_USE_TEXTCONFIG
virtual void text_print (FILE *fp);
virtual int text_ask (FILE *fpin, FILE *fpout);
#endif
@ -1085,7 +1084,7 @@ public:
void set_separator (char sep) {separator = sep; }
char get_separator () {return separator; }
int get_maxsize () {return maxsize; }
#if BX_UI_TEXT
#if BX_USE_TEXTCONFIG
virtual void text_print (FILE *fp);
virtual int text_ask (FILE *fpin, FILE *fpout);
#endif
@ -1157,7 +1156,7 @@ public:
bx_param_string_c *get_title () { return title; }
void set_parent (bx_param_c *newparent) { parent = newparent; }
bx_param_c *get_parent () { return parent; }
#if BX_UI_TEXT
#if BX_USE_TEXTCONFIG
virtual void text_print (FILE *);
virtual int text_ask (FILE *fpin, FILE *fpout);
#endif

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: textconfig.cc,v 1.19 2004-01-17 08:36:29 danielg4 Exp $
// $Id: textconfig.cc,v 1.20 2004-01-29 18:50:33 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// This is code for a text-mode configuration interface. Note that this file
@ -14,6 +14,8 @@
#include "config.h"
#if BX_USE_TEXTCONFIG
extern "C" {
#include <stdio.h>
#include <ctype.h>
@ -997,3 +999,5 @@ int init_text_config_interface ()
SIM->register_configuration_interface ("textconfig", ci_callback, NULL);
return 0; // success
}
#endif

View File

@ -1,7 +1,12 @@
/////////////////////////////////////////////////////////////////////////
// $Id: textconfig.h,v 1.1 2002-10-29 20:16:04 bdenney Exp $
// $Id: textconfig.h,v 1.2 2004-01-29 18:50:33 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
#include "config.h"
#if BX_USE_TEXTCONFIG
enum {
BX_CI_INIT,
BX_CI_START_MENU,
@ -17,3 +22,5 @@ enum {
};
int init_text_config_interface ();
#endif

View File

@ -1,11 +1,13 @@
/////////////////////////////////////////////////////////////////////////
// $Id: win32dialog.cc,v 1.11 2004-01-26 04:24:55 danielg4 Exp $
// $Id: win32dialog.cc,v 1.12 2004-01-29 18:50:33 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
#ifdef WIN32
#include "config.h"
#if BX_USE_TEXTCONFIG && defined(WIN32)
#ifdef WIN32
extern "C" {
#include <stdio.h>
#include <windows.h>
@ -257,4 +259,4 @@ int FloppyDialog(bx_param_filename_c *param)
(DLGPROC)FloppyDlgProc, (LPARAM)param);
}
#endif // WIN32
#endif // BX_USE_TEXTCONFIG && defined(WIN32)

View File

@ -1,8 +1,10 @@
/////////////////////////////////////////////////////////////////////////
// $Id: win32dialog.h,v 1.5 2003-09-01 17:47:57 vruppert Exp $
// $Id: win32dialog.h,v 1.6 2004-01-29 18:50:33 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
#ifdef WIN32
#include "config.h"
#if BX_USE_TEXTCONFIG && defined(WIN32)
extern "C" {
#include <windows.h>

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: main.cc,v 1.262 2004-01-29 17:49:02 mcb30 Exp $
// $Id: main.cc,v 1.263 2004-01-29 18:50:31 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002 MandrakeSoft S.A.
@ -1134,7 +1134,9 @@ void bx_init_options ()
bx_options.Oscreenmode->set_handler (bx_param_string_handler);
#endif
static char *config_interface_list[] = {
#if BX_USE_TEXTCONFIG
"textconfig",
#endif
#if BX_WITH_WX
"wx",
#endif
@ -1575,6 +1577,7 @@ void bx_init_options ()
"Userbutton shortcut",
"Defines the keyboard shortcut to be sent when you press the 'user' button in the headerbar.",
"none", 16);
bx_options.Ouser_shortcut->set_runtime_param (1);
// GDB stub
bx_options.gdbstub.port = 1234;
@ -1854,7 +1857,11 @@ int bxmain () {
bx_param_enum_c *ci_param = SIM->get_param_enum (BXP_SEL_CONFIG_INTERFACE);
char *ci_name = ci_param->get_choice (ci_param->get ());
if (!strcmp(ci_name, "textconfig")) {
#if BX_USE_TEXTCONFIG
init_text_config_interface (); // in textconfig.h
#else
BX_PANIC(("configuration interface 'textconfig' not present"));
#endif
}
#if BX_WITH_WX
else if (!strcmp(ci_name, "wx")) {