2001-10-03 17:10:38 +04:00
|
|
|
/////////////////////////////////////////////////////////////////////////
|
2002-08-30 20:23:36 +04:00
|
|
|
// $Id: siminterface.h,v 1.53 2002-08-30 16:23:36 bdenney Exp $
|
2001-10-03 17:10:38 +04:00
|
|
|
/////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
- I've added lots of comments in siminterface.h, and tried to clean up
the terminology a bit. In particular, the term "gui" has started
to mean different things in different contexts, so I've defined
some more specific names for the parts of the user interface, and
updated comments and some variable names to reflect it. See
siminterface.h for a more complete description of all of these.
VGAW: VGA display window and toolbar buttons, the traditional Bochs
display which is ported to X, win32, MacOS X, etc. Implemented
in gui/gui.* and platform dependent gui/*.cc files.
CI: configuration interface that lets the user change settings such
as floppy disk image, ne2k settings, log options. The CI consists
of two parts: configuration user interface (CUI) which does the
actual rendering to the screen and handles key/mouse/menu events,
and the siminterface object.
CUI: configuration user interface. This handles the user interactions
that allow the user to configure Bochs. To actually change any
values it talks to the siminterface object. One implementation of
the CUI is the text-mode menus in gui/control.cc. Another
implementation is (will be) the wxWindows menus and dialogs in
gui/wxmain.cc.
siminterface: the glue between the CUI and the simulation code,
accessible throughout the code by the global variable
bx_simulator_interface_c *SIM;
Among other things, siminterface methods allow the simulator to ask the
CUI to display things or ask for user input, and allows the CUI
to query and modify variables in the simulation code.
GUI: Literally, "graphical user interface". Until the configuration menus
and wxWindows came along, everyone understood that "gui" referred to the
VGA display window and the toolbar buttons because that's all there
was. Now that we have the wxWindows code, which implements both the VGAW
and the CUI, while all other platforms implement only the VGAW, it's not
so clear. So, I'm trying to use VGAW, CI, and CUI consistently since
they are more specific.
control panel: This has been used as another name for the configuration
interface. "control panel" is also somewhat unspecific and it sounds
like it would be graphical with buttons and sliders, but our text-mode
thing is not graphical at all. I've replaced "control panel" with
"configuration interface" wherever I could find it. In configure script,
the --disable-control-panel option is still supported, but it politely
suggests that you use --disable-config-interface instead.
- clean up comments in siminterface,wx* code
- add comments and examples for bx_param_* and BxEvents
- remove some obsolete stuff: notify_*_args,
bx_simulator_interface_c::[sg]et_enabled() methods
- in siminterface.cc, move a few bx_real_sim_c methods to where they belong,
with the rest of the methods. No changes to the actual methods.
- remove some DOS ^M's which crept in and confused my editor.
2002-08-26 19:31:23 +04:00
|
|
|
// Before I can describe what this file is for, I have to make the
|
|
|
|
// distinction between a configuration interface (CI) and the VGA display
|
|
|
|
// window (VGAW). I will try to avoid the term 'GUI' because it is unclear
|
|
|
|
// if that means CI or VGAW, and because not all interfaces are graphical
|
|
|
|
// anyway.
|
|
|
|
//
|
|
|
|
// The traditional Bochs screen is a window with a large VGA display panel and
|
|
|
|
// a series of buttons (floppy, cdrom, snapshot, power). Over the years, we
|
|
|
|
// have collected many implementations of the VGAW for different environments
|
|
|
|
// and platforms; each implementation is in a separate file under gui/*:
|
|
|
|
// x.cc, win32.cc, beos.cc, macintosh.cc, etc. The files gui.h and gui.cc
|
|
|
|
// define the platform independent part of the VGAW, leaving about 15 methods
|
|
|
|
// of the bx_gui_c class undefined. The platform dependent file must
|
|
|
|
// implement the remaining 15 methods.
|
|
|
|
//
|
|
|
|
// The configuration interface is relatively new, started by Bryce Denney in
|
|
|
|
// June 2001. The CI is intended to allow the user to edit a variety of
|
|
|
|
// configuration and runtime options. Some options, such as memory size or
|
|
|
|
// enabling the ethernet card, should only be changed before the simulation
|
|
|
|
// begins; others, such as floppy disk image, instructions per second, and
|
|
|
|
// logging options can be safely changed at runtime. The CI allows the user to
|
|
|
|
// make these changes. Before the CI existed, only a few things could be
|
|
|
|
// changed at runtime, all linked to clicking on the VGAW buttons.
|
|
|
|
//
|
|
|
|
// At the time that the CI was conceived, we were still debating what form the
|
|
|
|
// user interface part would take: stdin/stdout menus, a graphical application
|
|
|
|
// with menus and dialogs running in a separate thread, or even a tiny web
|
2002-08-29 18:59:37 +04:00
|
|
|
// server that you can connect to with a web browser. As a result the
|
|
|
|
// interface to the CI was designed so that the user interface of the CI
|
|
|
|
// could be replaced easily at compile time, or maybe even at runtime via
|
|
|
|
// a plugin architecture. To this end, we kept a clear separation between
|
|
|
|
// the user interface code and the siminterface, the code that interfaces with
|
|
|
|
// the simulator. The same siminterface is used all the time, while
|
|
|
|
// different implementations of the CI can be switched in reasonably easily.
|
|
|
|
// Only the CI code uses library specific graphics and I/O functions; the
|
|
|
|
// siminterface deals in portable abstractions and callback functions.
|
|
|
|
// The first CI implementation was a series of text mode menus implemented in
|
|
|
|
// control.cc.
|
- I've added lots of comments in siminterface.h, and tried to clean up
the terminology a bit. In particular, the term "gui" has started
to mean different things in different contexts, so I've defined
some more specific names for the parts of the user interface, and
updated comments and some variable names to reflect it. See
siminterface.h for a more complete description of all of these.
VGAW: VGA display window and toolbar buttons, the traditional Bochs
display which is ported to X, win32, MacOS X, etc. Implemented
in gui/gui.* and platform dependent gui/*.cc files.
CI: configuration interface that lets the user change settings such
as floppy disk image, ne2k settings, log options. The CI consists
of two parts: configuration user interface (CUI) which does the
actual rendering to the screen and handles key/mouse/menu events,
and the siminterface object.
CUI: configuration user interface. This handles the user interactions
that allow the user to configure Bochs. To actually change any
values it talks to the siminterface object. One implementation of
the CUI is the text-mode menus in gui/control.cc. Another
implementation is (will be) the wxWindows menus and dialogs in
gui/wxmain.cc.
siminterface: the glue between the CUI and the simulation code,
accessible throughout the code by the global variable
bx_simulator_interface_c *SIM;
Among other things, siminterface methods allow the simulator to ask the
CUI to display things or ask for user input, and allows the CUI
to query and modify variables in the simulation code.
GUI: Literally, "graphical user interface". Until the configuration menus
and wxWindows came along, everyone understood that "gui" referred to the
VGA display window and the toolbar buttons because that's all there
was. Now that we have the wxWindows code, which implements both the VGAW
and the CUI, while all other platforms implement only the VGAW, it's not
so clear. So, I'm trying to use VGAW, CI, and CUI consistently since
they are more specific.
control panel: This has been used as another name for the configuration
interface. "control panel" is also somewhat unspecific and it sounds
like it would be graphical with buttons and sliders, but our text-mode
thing is not graphical at all. I've replaced "control panel" with
"configuration interface" wherever I could find it. In configure script,
the --disable-control-panel option is still supported, but it politely
suggests that you use --disable-config-interface instead.
- clean up comments in siminterface,wx* code
- add comments and examples for bx_param_* and BxEvents
- remove some obsolete stuff: notify_*_args,
bx_simulator_interface_c::[sg]et_enabled() methods
- in siminterface.cc, move a few bx_real_sim_c methods to where they belong,
with the rest of the methods. No changes to the actual methods.
- remove some DOS ^M's which crept in and confused my editor.
2002-08-26 19:31:23 +04:00
|
|
|
//
|
2002-08-29 18:59:37 +04:00
|
|
|
// The configuration interface MUST use the siminterface methods to access the
|
|
|
|
// simulator. It should not modify settings in some device with code like
|
|
|
|
// bx_floppy.s.media[2].heads = 17. If such access is needed, then a
|
|
|
|
// siminterface method should be written to make the change on the CI's behalf.
|
|
|
|
// This separation is enforced by the fact that the CI does not even include
|
|
|
|
// bochs.h. You'll notice that control.cc include osdep.h, control.h, and
|
|
|
|
// siminterface.h, so it doesn't know what bx_floppy or bx_cpu_c are. I'm sure
|
|
|
|
// some people will say is overly restrictive and/or annoying. When I set it
|
|
|
|
// up this way, we were still talking about making the CI in a seperate
|
|
|
|
// process, where direct method calls would be impossible. Also, we have been
|
|
|
|
// considering turning devices into plugin modules which are dynamically
|
|
|
|
// linked. Any direct references to something like bx_floppy.s.media[2].heads
|
|
|
|
// would have to be reworked before a plugin interface was possible as well.
|
|
|
|
//
|
|
|
|
// The siminterface is the glue between the CI and the simulator. There is
|
- I've added lots of comments in siminterface.h, and tried to clean up
the terminology a bit. In particular, the term "gui" has started
to mean different things in different contexts, so I've defined
some more specific names for the parts of the user interface, and
updated comments and some variable names to reflect it. See
siminterface.h for a more complete description of all of these.
VGAW: VGA display window and toolbar buttons, the traditional Bochs
display which is ported to X, win32, MacOS X, etc. Implemented
in gui/gui.* and platform dependent gui/*.cc files.
CI: configuration interface that lets the user change settings such
as floppy disk image, ne2k settings, log options. The CI consists
of two parts: configuration user interface (CUI) which does the
actual rendering to the screen and handles key/mouse/menu events,
and the siminterface object.
CUI: configuration user interface. This handles the user interactions
that allow the user to configure Bochs. To actually change any
values it talks to the siminterface object. One implementation of
the CUI is the text-mode menus in gui/control.cc. Another
implementation is (will be) the wxWindows menus and dialogs in
gui/wxmain.cc.
siminterface: the glue between the CUI and the simulation code,
accessible throughout the code by the global variable
bx_simulator_interface_c *SIM;
Among other things, siminterface methods allow the simulator to ask the
CUI to display things or ask for user input, and allows the CUI
to query and modify variables in the simulation code.
GUI: Literally, "graphical user interface". Until the configuration menus
and wxWindows came along, everyone understood that "gui" referred to the
VGA display window and the toolbar buttons because that's all there
was. Now that we have the wxWindows code, which implements both the VGAW
and the CUI, while all other platforms implement only the VGAW, it's not
so clear. So, I'm trying to use VGAW, CI, and CUI consistently since
they are more specific.
control panel: This has been used as another name for the configuration
interface. "control panel" is also somewhat unspecific and it sounds
like it would be graphical with buttons and sliders, but our text-mode
thing is not graphical at all. I've replaced "control panel" with
"configuration interface" wherever I could find it. In configure script,
the --disable-control-panel option is still supported, but it politely
suggests that you use --disable-config-interface instead.
- clean up comments in siminterface,wx* code
- add comments and examples for bx_param_* and BxEvents
- remove some obsolete stuff: notify_*_args,
bx_simulator_interface_c::[sg]et_enabled() methods
- in siminterface.cc, move a few bx_real_sim_c methods to where they belong,
with the rest of the methods. No changes to the actual methods.
- remove some DOS ^M's which crept in and confused my editor.
2002-08-26 19:31:23 +04:00
|
|
|
// just one global instance of the siminterface object, which can be referred
|
2002-08-29 18:59:37 +04:00
|
|
|
// to by the global variable bx_simulator_interface_c *SIM; The base class
|
|
|
|
// bx_simulator_interface_c, contains only virtual functions and it defines the
|
|
|
|
// interface that the CI is allowed to use. In siminterface.cc, a class
|
|
|
|
// called bx_real_sim_c is defined with bx_simulator_interface_c as its parent
|
|
|
|
// class. Bx_real_sim_c implements each of the functions. The separation into
|
|
|
|
// parent class and child class leaves the possibility of making a different
|
|
|
|
// child class that talks to the simulator in a different way (networking for
|
|
|
|
// example). At the moment this particular abstraction is serving no specific
|
|
|
|
// purpose, so it might be removed in the future.
|
- I've added lots of comments in siminterface.h, and tried to clean up
the terminology a bit. In particular, the term "gui" has started
to mean different things in different contexts, so I've defined
some more specific names for the parts of the user interface, and
updated comments and some variable names to reflect it. See
siminterface.h for a more complete description of all of these.
VGAW: VGA display window and toolbar buttons, the traditional Bochs
display which is ported to X, win32, MacOS X, etc. Implemented
in gui/gui.* and platform dependent gui/*.cc files.
CI: configuration interface that lets the user change settings such
as floppy disk image, ne2k settings, log options. The CI consists
of two parts: configuration user interface (CUI) which does the
actual rendering to the screen and handles key/mouse/menu events,
and the siminterface object.
CUI: configuration user interface. This handles the user interactions
that allow the user to configure Bochs. To actually change any
values it talks to the siminterface object. One implementation of
the CUI is the text-mode menus in gui/control.cc. Another
implementation is (will be) the wxWindows menus and dialogs in
gui/wxmain.cc.
siminterface: the glue between the CUI and the simulation code,
accessible throughout the code by the global variable
bx_simulator_interface_c *SIM;
Among other things, siminterface methods allow the simulator to ask the
CUI to display things or ask for user input, and allows the CUI
to query and modify variables in the simulation code.
GUI: Literally, "graphical user interface". Until the configuration menus
and wxWindows came along, everyone understood that "gui" referred to the
VGA display window and the toolbar buttons because that's all there
was. Now that we have the wxWindows code, which implements both the VGAW
and the CUI, while all other platforms implement only the VGAW, it's not
so clear. So, I'm trying to use VGAW, CI, and CUI consistently since
they are more specific.
control panel: This has been used as another name for the configuration
interface. "control panel" is also somewhat unspecific and it sounds
like it would be graphical with buttons and sliders, but our text-mode
thing is not graphical at all. I've replaced "control panel" with
"configuration interface" wherever I could find it. In configure script,
the --disable-control-panel option is still supported, but it politely
suggests that you use --disable-config-interface instead.
- clean up comments in siminterface,wx* code
- add comments and examples for bx_param_* and BxEvents
- remove some obsolete stuff: notify_*_args,
bx_simulator_interface_c::[sg]et_enabled() methods
- in siminterface.cc, move a few bx_real_sim_c methods to where they belong,
with the rest of the methods. No changes to the actual methods.
- remove some DOS ^M's which crept in and confused my editor.
2002-08-26 19:31:23 +04:00
|
|
|
//
|
2002-08-29 18:59:37 +04:00
|
|
|
// An important part of the siminterface implementation is the use of parameter
|
|
|
|
// classes, or bx_param_*. The parameter classes are described below, where
|
|
|
|
// they are declared. Search for "parameter classes" below for detals.
|
- I've added lots of comments in siminterface.h, and tried to clean up
the terminology a bit. In particular, the term "gui" has started
to mean different things in different contexts, so I've defined
some more specific names for the parts of the user interface, and
updated comments and some variable names to reflect it. See
siminterface.h for a more complete description of all of these.
VGAW: VGA display window and toolbar buttons, the traditional Bochs
display which is ported to X, win32, MacOS X, etc. Implemented
in gui/gui.* and platform dependent gui/*.cc files.
CI: configuration interface that lets the user change settings such
as floppy disk image, ne2k settings, log options. The CI consists
of two parts: configuration user interface (CUI) which does the
actual rendering to the screen and handles key/mouse/menu events,
and the siminterface object.
CUI: configuration user interface. This handles the user interactions
that allow the user to configure Bochs. To actually change any
values it talks to the siminterface object. One implementation of
the CUI is the text-mode menus in gui/control.cc. Another
implementation is (will be) the wxWindows menus and dialogs in
gui/wxmain.cc.
siminterface: the glue between the CUI and the simulation code,
accessible throughout the code by the global variable
bx_simulator_interface_c *SIM;
Among other things, siminterface methods allow the simulator to ask the
CUI to display things or ask for user input, and allows the CUI
to query and modify variables in the simulation code.
GUI: Literally, "graphical user interface". Until the configuration menus
and wxWindows came along, everyone understood that "gui" referred to the
VGA display window and the toolbar buttons because that's all there
was. Now that we have the wxWindows code, which implements both the VGAW
and the CUI, while all other platforms implement only the VGAW, it's not
so clear. So, I'm trying to use VGAW, CI, and CUI consistently since
they are more specific.
control panel: This has been used as another name for the configuration
interface. "control panel" is also somewhat unspecific and it sounds
like it would be graphical with buttons and sliders, but our text-mode
thing is not graphical at all. I've replaced "control panel" with
"configuration interface" wherever I could find it. In configure script,
the --disable-control-panel option is still supported, but it politely
suggests that you use --disable-config-interface instead.
- clean up comments in siminterface,wx* code
- add comments and examples for bx_param_* and BxEvents
- remove some obsolete stuff: notify_*_args,
bx_simulator_interface_c::[sg]et_enabled() methods
- in siminterface.cc, move a few bx_real_sim_c methods to where they belong,
with the rest of the methods. No changes to the actual methods.
- remove some DOS ^M's which crept in and confused my editor.
2002-08-26 19:31:23 +04:00
|
|
|
//
|
2002-08-29 18:59:37 +04:00
|
|
|
// Also this header file declares data structures for certain events that pass
|
|
|
|
// between the siminterface and the CI. Search for "event structures" below.
|
- I've added lots of comments in siminterface.h, and tried to clean up
the terminology a bit. In particular, the term "gui" has started
to mean different things in different contexts, so I've defined
some more specific names for the parts of the user interface, and
updated comments and some variable names to reflect it. See
siminterface.h for a more complete description of all of these.
VGAW: VGA display window and toolbar buttons, the traditional Bochs
display which is ported to X, win32, MacOS X, etc. Implemented
in gui/gui.* and platform dependent gui/*.cc files.
CI: configuration interface that lets the user change settings such
as floppy disk image, ne2k settings, log options. The CI consists
of two parts: configuration user interface (CUI) which does the
actual rendering to the screen and handles key/mouse/menu events,
and the siminterface object.
CUI: configuration user interface. This handles the user interactions
that allow the user to configure Bochs. To actually change any
values it talks to the siminterface object. One implementation of
the CUI is the text-mode menus in gui/control.cc. Another
implementation is (will be) the wxWindows menus and dialogs in
gui/wxmain.cc.
siminterface: the glue between the CUI and the simulation code,
accessible throughout the code by the global variable
bx_simulator_interface_c *SIM;
Among other things, siminterface methods allow the simulator to ask the
CUI to display things or ask for user input, and allows the CUI
to query and modify variables in the simulation code.
GUI: Literally, "graphical user interface". Until the configuration menus
and wxWindows came along, everyone understood that "gui" referred to the
VGA display window and the toolbar buttons because that's all there
was. Now that we have the wxWindows code, which implements both the VGAW
and the CUI, while all other platforms implement only the VGAW, it's not
so clear. So, I'm trying to use VGAW, CI, and CUI consistently since
they are more specific.
control panel: This has been used as another name for the configuration
interface. "control panel" is also somewhat unspecific and it sounds
like it would be graphical with buttons and sliders, but our text-mode
thing is not graphical at all. I've replaced "control panel" with
"configuration interface" wherever I could find it. In configure script,
the --disable-control-panel option is still supported, but it politely
suggests that you use --disable-config-interface instead.
- clean up comments in siminterface,wx* code
- add comments and examples for bx_param_* and BxEvents
- remove some obsolete stuff: notify_*_args,
bx_simulator_interface_c::[sg]et_enabled() methods
- in siminterface.cc, move a few bx_real_sim_c methods to where they belong,
with the rest of the methods. No changes to the actual methods.
- remove some DOS ^M's which crept in and confused my editor.
2002-08-26 19:31:23 +04:00
|
|
|
|
2001-06-08 11:20:07 +04:00
|
|
|
|
- I've added lots of comments in siminterface.h, and tried to clean up
the terminology a bit. In particular, the term "gui" has started
to mean different things in different contexts, so I've defined
some more specific names for the parts of the user interface, and
updated comments and some variable names to reflect it. See
siminterface.h for a more complete description of all of these.
VGAW: VGA display window and toolbar buttons, the traditional Bochs
display which is ported to X, win32, MacOS X, etc. Implemented
in gui/gui.* and platform dependent gui/*.cc files.
CI: configuration interface that lets the user change settings such
as floppy disk image, ne2k settings, log options. The CI consists
of two parts: configuration user interface (CUI) which does the
actual rendering to the screen and handles key/mouse/menu events,
and the siminterface object.
CUI: configuration user interface. This handles the user interactions
that allow the user to configure Bochs. To actually change any
values it talks to the siminterface object. One implementation of
the CUI is the text-mode menus in gui/control.cc. Another
implementation is (will be) the wxWindows menus and dialogs in
gui/wxmain.cc.
siminterface: the glue between the CUI and the simulation code,
accessible throughout the code by the global variable
bx_simulator_interface_c *SIM;
Among other things, siminterface methods allow the simulator to ask the
CUI to display things or ask for user input, and allows the CUI
to query and modify variables in the simulation code.
GUI: Literally, "graphical user interface". Until the configuration menus
and wxWindows came along, everyone understood that "gui" referred to the
VGA display window and the toolbar buttons because that's all there
was. Now that we have the wxWindows code, which implements both the VGAW
and the CUI, while all other platforms implement only the VGAW, it's not
so clear. So, I'm trying to use VGAW, CI, and CUI consistently since
they are more specific.
control panel: This has been used as another name for the configuration
interface. "control panel" is also somewhat unspecific and it sounds
like it would be graphical with buttons and sliders, but our text-mode
thing is not graphical at all. I've replaced "control panel" with
"configuration interface" wherever I could find it. In configure script,
the --disable-control-panel option is still supported, but it politely
suggests that you use --disable-config-interface instead.
- clean up comments in siminterface,wx* code
- add comments and examples for bx_param_* and BxEvents
- remove some obsolete stuff: notify_*_args,
bx_simulator_interface_c::[sg]et_enabled() methods
- in siminterface.cc, move a few bx_real_sim_c methods to where they belong,
with the rest of the methods. No changes to the actual methods.
- remove some DOS ^M's which crept in and confused my editor.
2002-08-26 19:31:23 +04:00
|
|
|
|
|
|
|
//////////////////////////////////////////////////////
|
2002-04-18 04:22:20 +04:00
|
|
|
// BX_UI_TEXT 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
|
|
|
|
// kind of parameter to ask the user to edit the value.
|
|
|
|
//
|
- I've added lots of comments in siminterface.h, and tried to clean up
the terminology a bit. In particular, the term "gui" has started
to mean different things in different contexts, so I've defined
some more specific names for the parts of the user interface, and
updated comments and some variable names to reflect it. See
siminterface.h for a more complete description of all of these.
VGAW: VGA display window and toolbar buttons, the traditional Bochs
display which is ported to X, win32, MacOS X, etc. Implemented
in gui/gui.* and platform dependent gui/*.cc files.
CI: configuration interface that lets the user change settings such
as floppy disk image, ne2k settings, log options. The CI consists
of two parts: configuration user interface (CUI) which does the
actual rendering to the screen and handles key/mouse/menu events,
and the siminterface object.
CUI: configuration user interface. This handles the user interactions
that allow the user to configure Bochs. To actually change any
values it talks to the siminterface object. One implementation of
the CUI is the text-mode menus in gui/control.cc. Another
implementation is (will be) the wxWindows menus and dialogs in
gui/wxmain.cc.
siminterface: the glue between the CUI and the simulation code,
accessible throughout the code by the global variable
bx_simulator_interface_c *SIM;
Among other things, siminterface methods allow the simulator to ask the
CUI to display things or ask for user input, and allows the CUI
to query and modify variables in the simulation code.
GUI: Literally, "graphical user interface". Until the configuration menus
and wxWindows came along, everyone understood that "gui" referred to the
VGA display window and the toolbar buttons because that's all there
was. Now that we have the wxWindows code, which implements both the VGAW
and the CUI, while all other platforms implement only the VGAW, it's not
so clear. So, I'm trying to use VGAW, CI, and CUI consistently since
they are more specific.
control panel: This has been used as another name for the configuration
interface. "control panel" is also somewhat unspecific and it sounds
like it would be graphical with buttons and sliders, but our text-mode
thing is not graphical at all. I've replaced "control panel" with
"configuration interface" wherever I could find it. In configure script,
the --disable-control-panel option is still supported, but it politely
suggests that you use --disable-config-interface instead.
- clean up comments in siminterface,wx* code
- add comments and examples for bx_param_* and BxEvents
- remove some obsolete stuff: notify_*_args,
bx_simulator_interface_c::[sg]et_enabled() methods
- in siminterface.cc, move a few bx_real_sim_c methods to where they belong,
with the rest of the methods. No changes to the actual methods.
- remove some DOS ^M's which crept in and confused my editor.
2002-08-26 19:31:23 +04:00
|
|
|
// I have been considering whether to use the same strategy for the
|
|
|
|
// wxWindows interface, but I'm not sure if I like it. One problem is
|
|
|
|
// that in order to declare member functions that are useful for
|
|
|
|
// wxWindows, the wxWindows header files would have to be included
|
|
|
|
// before the param object definitions. That means that all the
|
|
|
|
// wxwindows headers would have be included when compiling every
|
|
|
|
// single bochs file. One of the things I like about the separation
|
2002-08-29 18:59:37 +04:00
|
|
|
// between the simulator and CI is that the two parts can be
|
- I've added lots of comments in siminterface.h, and tried to clean up
the terminology a bit. In particular, the term "gui" has started
to mean different things in different contexts, so I've defined
some more specific names for the parts of the user interface, and
updated comments and some variable names to reflect it. See
siminterface.h for a more complete description of all of these.
VGAW: VGA display window and toolbar buttons, the traditional Bochs
display which is ported to X, win32, MacOS X, etc. Implemented
in gui/gui.* and platform dependent gui/*.cc files.
CI: configuration interface that lets the user change settings such
as floppy disk image, ne2k settings, log options. The CI consists
of two parts: configuration user interface (CUI) which does the
actual rendering to the screen and handles key/mouse/menu events,
and the siminterface object.
CUI: configuration user interface. This handles the user interactions
that allow the user to configure Bochs. To actually change any
values it talks to the siminterface object. One implementation of
the CUI is the text-mode menus in gui/control.cc. Another
implementation is (will be) the wxWindows menus and dialogs in
gui/wxmain.cc.
siminterface: the glue between the CUI and the simulation code,
accessible throughout the code by the global variable
bx_simulator_interface_c *SIM;
Among other things, siminterface methods allow the simulator to ask the
CUI to display things or ask for user input, and allows the CUI
to query and modify variables in the simulation code.
GUI: Literally, "graphical user interface". Until the configuration menus
and wxWindows came along, everyone understood that "gui" referred to the
VGA display window and the toolbar buttons because that's all there
was. Now that we have the wxWindows code, which implements both the VGAW
and the CUI, while all other platforms implement only the VGAW, it's not
so clear. So, I'm trying to use VGAW, CI, and CUI consistently since
they are more specific.
control panel: This has been used as another name for the configuration
interface. "control panel" is also somewhat unspecific and it sounds
like it would be graphical with buttons and sliders, but our text-mode
thing is not graphical at all. I've replaced "control panel" with
"configuration interface" wherever I could find it. In configure script,
the --disable-control-panel option is still supported, but it politely
suggests that you use --disable-config-interface instead.
- clean up comments in siminterface,wx* code
- add comments and examples for bx_param_* and BxEvents
- remove some obsolete stuff: notify_*_args,
bx_simulator_interface_c::[sg]et_enabled() methods
- in siminterface.cc, move a few bx_real_sim_c methods to where they belong,
with the rest of the methods. No changes to the actual methods.
- remove some DOS ^M's which crept in and confused my editor.
2002-08-26 19:31:23 +04:00
|
|
|
// compiled without any knowledge of the other. Bochs doesn't include
|
2002-08-29 18:59:37 +04:00
|
|
|
// <wx.h>, and the wxwindows CI (wxmain.cc) doesn't need to include <bochs.h>.
|
|
|
|
// Aside from making compiles faster, this enforces the use of the siminterface
|
|
|
|
// so it keeps the interface clean (important when we may have multiple UI
|
- I've added lots of comments in siminterface.h, and tried to clean up
the terminology a bit. In particular, the term "gui" has started
to mean different things in different contexts, so I've defined
some more specific names for the parts of the user interface, and
updated comments and some variable names to reflect it. See
siminterface.h for a more complete description of all of these.
VGAW: VGA display window and toolbar buttons, the traditional Bochs
display which is ported to X, win32, MacOS X, etc. Implemented
in gui/gui.* and platform dependent gui/*.cc files.
CI: configuration interface that lets the user change settings such
as floppy disk image, ne2k settings, log options. The CI consists
of two parts: configuration user interface (CUI) which does the
actual rendering to the screen and handles key/mouse/menu events,
and the siminterface object.
CUI: configuration user interface. This handles the user interactions
that allow the user to configure Bochs. To actually change any
values it talks to the siminterface object. One implementation of
the CUI is the text-mode menus in gui/control.cc. Another
implementation is (will be) the wxWindows menus and dialogs in
gui/wxmain.cc.
siminterface: the glue between the CUI and the simulation code,
accessible throughout the code by the global variable
bx_simulator_interface_c *SIM;
Among other things, siminterface methods allow the simulator to ask the
CUI to display things or ask for user input, and allows the CUI
to query and modify variables in the simulation code.
GUI: Literally, "graphical user interface". Until the configuration menus
and wxWindows came along, everyone understood that "gui" referred to the
VGA display window and the toolbar buttons because that's all there
was. Now that we have the wxWindows code, which implements both the VGAW
and the CUI, while all other platforms implement only the VGAW, it's not
so clear. So, I'm trying to use VGAW, CI, and CUI consistently since
they are more specific.
control panel: This has been used as another name for the configuration
interface. "control panel" is also somewhat unspecific and it sounds
like it would be graphical with buttons and sliders, but our text-mode
thing is not graphical at all. I've replaced "control panel" with
"configuration interface" wherever I could find it. In configure script,
the --disable-control-panel option is still supported, but it politely
suggests that you use --disable-config-interface instead.
- clean up comments in siminterface,wx* code
- add comments and examples for bx_param_* and BxEvents
- remove some obsolete stuff: notify_*_args,
bx_simulator_interface_c::[sg]et_enabled() methods
- in siminterface.cc, move a few bx_real_sim_c methods to where they belong,
with the rest of the methods. No changes to the actual methods.
- remove some DOS ^M's which crept in and confused my editor.
2002-08-26 19:31:23 +04:00
|
|
|
// implementations for example). This argues for keeping UI-specific
|
2002-08-29 18:59:37 +04:00
|
|
|
// structures out of the simulator interface. It certainly works ok for the
|
|
|
|
// text interface, but that's because FILE* is standard and portable.
|
2002-04-18 04:22:20 +04:00
|
|
|
#define BX_UI_TEXT (!BX_WITH_WX)
|
2001-06-18 18:11:55 +04:00
|
|
|
|
|
|
|
//////////////////////////////////////////////////////
|
2001-06-16 03:52:34 +04:00
|
|
|
|
2002-04-18 04:22:20 +04:00
|
|
|
// list of possible types for bx_param_c and descendant objects
|
|
|
|
typedef enum {
|
|
|
|
BXT_OBJECT = 201,
|
|
|
|
BXT_PARAM,
|
|
|
|
BXT_PARAM_NUM,
|
|
|
|
BXT_PARAM_BOOL,
|
|
|
|
BXT_PARAM_ENUM,
|
|
|
|
BXT_PARAM_STRING,
|
|
|
|
BXT_LIST
|
|
|
|
} bx_objtype;
|
|
|
|
|
- I've added lots of comments in siminterface.h, and tried to clean up
the terminology a bit. In particular, the term "gui" has started
to mean different things in different contexts, so I've defined
some more specific names for the parts of the user interface, and
updated comments and some variable names to reflect it. See
siminterface.h for a more complete description of all of these.
VGAW: VGA display window and toolbar buttons, the traditional Bochs
display which is ported to X, win32, MacOS X, etc. Implemented
in gui/gui.* and platform dependent gui/*.cc files.
CI: configuration interface that lets the user change settings such
as floppy disk image, ne2k settings, log options. The CI consists
of two parts: configuration user interface (CUI) which does the
actual rendering to the screen and handles key/mouse/menu events,
and the siminterface object.
CUI: configuration user interface. This handles the user interactions
that allow the user to configure Bochs. To actually change any
values it talks to the siminterface object. One implementation of
the CUI is the text-mode menus in gui/control.cc. Another
implementation is (will be) the wxWindows menus and dialogs in
gui/wxmain.cc.
siminterface: the glue between the CUI and the simulation code,
accessible throughout the code by the global variable
bx_simulator_interface_c *SIM;
Among other things, siminterface methods allow the simulator to ask the
CUI to display things or ask for user input, and allows the CUI
to query and modify variables in the simulation code.
GUI: Literally, "graphical user interface". Until the configuration menus
and wxWindows came along, everyone understood that "gui" referred to the
VGA display window and the toolbar buttons because that's all there
was. Now that we have the wxWindows code, which implements both the VGAW
and the CUI, while all other platforms implement only the VGAW, it's not
so clear. So, I'm trying to use VGAW, CI, and CUI consistently since
they are more specific.
control panel: This has been used as another name for the configuration
interface. "control panel" is also somewhat unspecific and it sounds
like it would be graphical with buttons and sliders, but our text-mode
thing is not graphical at all. I've replaced "control panel" with
"configuration interface" wherever I could find it. In configure script,
the --disable-control-panel option is still supported, but it politely
suggests that you use --disable-config-interface instead.
- clean up comments in siminterface,wx* code
- add comments and examples for bx_param_* and BxEvents
- remove some obsolete stuff: notify_*_args,
bx_simulator_interface_c::[sg]et_enabled() methods
- in siminterface.cc, move a few bx_real_sim_c methods to where they belong,
with the rest of the methods. No changes to the actual methods.
- remove some DOS ^M's which crept in and confused my editor.
2002-08-26 19:31:23 +04:00
|
|
|
// list if parameter id values. The actual values are not important;
|
|
|
|
// it's only important that they all be different from each other.
|
2001-06-16 03:52:34 +04:00
|
|
|
typedef enum {
|
2001-06-18 18:11:55 +04:00
|
|
|
BXP_NULL = 101,
|
|
|
|
BXP_IPS,
|
2001-06-16 03:52:34 +04:00
|
|
|
BXP_VGA_UPDATE_INTERVAL,
|
|
|
|
BXP_MOUSE_ENABLED,
|
2001-06-16 23:29:59 +04:00
|
|
|
BXP_MEM_SIZE,
|
|
|
|
BXP_ROM_PATH,
|
2001-06-17 17:50:52 +04:00
|
|
|
BXP_ROM_ADDRESS,
|
2001-06-18 18:11:55 +04:00
|
|
|
BXP_VGA_ROM_PATH,
|
2002-07-24 21:52:34 +04:00
|
|
|
BXP_OPTROM1_PATH,
|
|
|
|
BXP_OPTROM1_ADDRESS,
|
|
|
|
BXP_OPTROM2_PATH,
|
|
|
|
BXP_OPTROM2_ADDRESS,
|
|
|
|
BXP_OPTROM3_PATH,
|
|
|
|
BXP_OPTROM3_ADDRESS,
|
|
|
|
BXP_OPTROM4_PATH,
|
|
|
|
BXP_OPTROM4_ADDRESS,
|
2001-06-20 18:01:39 +04:00
|
|
|
BXP_KBD_SERIAL_DELAY,
|
2002-03-26 16:51:48 +03:00
|
|
|
BXP_KBD_PASTE_DELAY,
|
2001-12-12 13:38:39 +03:00
|
|
|
BXP_KBD_TYPE,
|
2001-06-20 18:01:39 +04:00
|
|
|
BXP_FLOPPY_CMD_DELAY,
|
2002-08-04 12:42:34 +04:00
|
|
|
BXP_FLOPPYA_DEVTYPE,
|
2001-06-20 18:01:39 +04:00
|
|
|
BXP_FLOPPYA_PATH,
|
|
|
|
BXP_FLOPPYA_TYPE,
|
|
|
|
BXP_FLOPPYA_STATUS,
|
2001-06-21 18:37:55 +04:00
|
|
|
BXP_FLOPPYA,
|
2002-08-04 12:42:34 +04:00
|
|
|
BXP_FLOPPYB_DEVTYPE,
|
2001-06-20 18:01:39 +04:00
|
|
|
BXP_FLOPPYB_PATH,
|
|
|
|
BXP_FLOPPYB_TYPE,
|
|
|
|
BXP_FLOPPYB_STATUS,
|
2001-06-21 18:37:55 +04:00
|
|
|
BXP_FLOPPYB,
|
2001-06-20 18:01:39 +04:00
|
|
|
BXP_DISKC_PRESENT,
|
|
|
|
BXP_DISKC_PATH,
|
|
|
|
BXP_DISKC_CYLINDERS,
|
|
|
|
BXP_DISKC_HEADS,
|
|
|
|
BXP_DISKC_SPT,
|
2001-06-21 18:37:55 +04:00
|
|
|
BXP_DISKC,
|
2001-06-20 18:01:39 +04:00
|
|
|
BXP_DISKD_PRESENT,
|
|
|
|
BXP_DISKD_PATH,
|
|
|
|
BXP_DISKD_CYLINDERS,
|
|
|
|
BXP_DISKD_HEADS,
|
|
|
|
BXP_DISKD_SPT,
|
2001-06-21 18:37:55 +04:00
|
|
|
BXP_DISKD,
|
2002-08-24 21:11:33 +04:00
|
|
|
BXP_COM1_ENABLED,
|
2002-03-03 09:03:29 +03:00
|
|
|
BXP_COM1_PATH,
|
2002-08-24 21:11:33 +04:00
|
|
|
BXP_COM2_ENABLED,
|
2002-03-03 09:03:29 +03:00
|
|
|
BXP_COM2_PATH,
|
2002-08-24 21:11:33 +04:00
|
|
|
BXP_COM3_ENABLED,
|
2002-03-03 09:03:29 +03:00
|
|
|
BXP_COM3_PATH,
|
2002-08-24 21:11:33 +04:00
|
|
|
BXP_COM4_ENABLED,
|
2002-03-03 09:03:29 +03:00
|
|
|
BXP_COM4_PATH,
|
2001-06-20 18:01:39 +04:00
|
|
|
BXP_CDROM_PRESENT,
|
|
|
|
BXP_CDROM_PATH,
|
2002-08-04 12:42:34 +04:00
|
|
|
BXP_CDROM_STATUS,
|
2001-06-21 18:37:55 +04:00
|
|
|
BXP_CDROMD,
|
2001-06-20 18:01:39 +04:00
|
|
|
BXP_PRIVATE_COLORMAP,
|
2001-08-16 00:17:19 +04:00
|
|
|
BXP_FULLSCREEN,
|
2001-08-16 06:00:31 +04:00
|
|
|
BXP_SCREENMODE,
|
2001-06-20 18:01:39 +04:00
|
|
|
BXP_I440FX_SUPPORT,
|
|
|
|
BXP_NEWHARDDRIVESUPPORT,
|
|
|
|
BXP_LOG_FILENAME,
|
2002-06-26 18:42:35 +04:00
|
|
|
BXP_LOG_PREFIX,
|
2001-06-20 18:01:39 +04:00
|
|
|
BXP_CMOS_PATH,
|
|
|
|
BXP_CMOS_IMAGE,
|
|
|
|
BXP_CMOS_TIME0,
|
|
|
|
BXP_LOAD32BITOS_WHICH,
|
|
|
|
BXP_LOAD32BITOS_PATH,
|
|
|
|
BXP_LOAD32BITOS_IOLOG,
|
|
|
|
BXP_LOAD32BITOS_INITRD,
|
2001-06-21 23:57:21 +04:00
|
|
|
BXP_LOAD32BITOS,
|
2001-06-20 18:01:39 +04:00
|
|
|
BXP_BOOTDRIVE,
|
2002-04-23 11:44:34 +04:00
|
|
|
BXP_FLOPPYSIGCHECK,
|
2001-06-21 18:37:55 +04:00
|
|
|
BXP_MENU_MAIN,
|
|
|
|
BXP_MENU_MEMORY,
|
|
|
|
BXP_MENU_INTERFACE,
|
|
|
|
BXP_MENU_DISK,
|
2002-03-03 09:10:04 +03:00
|
|
|
BXP_MENU_SERIAL_PARALLEL,
|
2001-06-21 18:37:55 +04:00
|
|
|
BXP_MENU_SOUND,
|
|
|
|
BXP_MENU_MISC,
|
|
|
|
BXP_MENU_RUNTIME,
|
2001-06-21 20:59:56 +04:00
|
|
|
BXP_SYSTEM_CLOCK_SYNC,
|
|
|
|
BXP_MAX_IPS,
|
2001-06-21 22:34:50 +04:00
|
|
|
BXP_NE2K_VALID,
|
|
|
|
BXP_NE2K_IOADDR,
|
|
|
|
BXP_NE2K_IRQ,
|
|
|
|
BXP_NE2K_MACADDR,
|
|
|
|
BXP_NE2K_ETHMOD,
|
|
|
|
BXP_NE2K_ETHDEV,
|
2002-05-02 11:54:22 +04:00
|
|
|
BXP_NE2K_SCRIPT,
|
2001-06-21 22:34:50 +04:00
|
|
|
BXP_NE2K,
|
|
|
|
BXP_SB16_PRESENT,
|
|
|
|
BXP_SB16_MIDIFILE,
|
|
|
|
BXP_SB16_WAVEFILE,
|
|
|
|
BXP_SB16_LOGFILE,
|
|
|
|
BXP_SB16_MIDIMODE,
|
|
|
|
BXP_SB16_WAVEMODE,
|
|
|
|
BXP_SB16_LOGLEVEL,
|
|
|
|
BXP_SB16_DMATIMER,
|
|
|
|
BXP_SB16,
|
2002-08-24 21:11:33 +04:00
|
|
|
BXP_PARPORT1_ENABLED,
|
2001-11-12 05:35:09 +03:00
|
|
|
BXP_PARPORT1_OUTFILE,
|
2002-08-24 21:11:33 +04:00
|
|
|
BXP_PARPORT2_ENABLED,
|
2001-11-12 05:35:09 +03:00
|
|
|
BXP_PARPORT2_OUTFILE,
|
2001-12-14 20:56:37 +03:00
|
|
|
BXP_KEYBOARD_USEMAPPING,
|
|
|
|
BXP_KEYBOARD_MAP,
|
|
|
|
BXP_KEYBOARD,
|
2002-08-09 10:16:43 +04:00
|
|
|
BXP_USER_SHORTCUT,
|
2002-04-18 04:22:20 +04:00
|
|
|
BXP_ASK_FOR_PATHNAME, // for general file selection dialog
|
2001-06-18 18:11:55 +04:00
|
|
|
BXP_THIS_IS_THE_LAST // used to determine length of list
|
2001-06-16 03:52:34 +04:00
|
|
|
} bx_id;
|
|
|
|
|
|
|
|
typedef enum {
|
2002-04-18 04:22:20 +04:00
|
|
|
BX_TOOLBAR_UNDEFINED,
|
|
|
|
BX_TOOLBAR_FLOPPYA,
|
|
|
|
BX_TOOLBAR_FLOPPYB,
|
|
|
|
BX_TOOLBAR_CDROMD,
|
|
|
|
BX_TOOLBAR_RESET,
|
|
|
|
BX_TOOLBAR_POWER,
|
|
|
|
BX_TOOLBAR_COPY,
|
|
|
|
BX_TOOLBAR_PASTE,
|
|
|
|
BX_TOOLBAR_SNAPSHOT,
|
|
|
|
BX_TOOLBAR_CONFIG,
|
2002-08-09 10:16:43 +04:00
|
|
|
BX_TOOLBAR_MOUSE_EN,
|
|
|
|
BX_TOOLBAR_USER
|
2002-04-18 04:22:20 +04:00
|
|
|
} bx_toolbar_buttons;
|
|
|
|
|
|
|
|
// Log level defines
|
|
|
|
typedef enum {
|
|
|
|
LOGLEV_DEBUG = 0,
|
|
|
|
LOGLEV_INFO,
|
|
|
|
LOGLEV_ERROR,
|
|
|
|
LOGLEV_PANIC,
|
|
|
|
N_LOGLEV
|
|
|
|
} bx_log_levels;
|
|
|
|
|
2002-08-30 10:06:36 +04:00
|
|
|
// types of reset
|
|
|
|
#define BX_RESET_SOFTWARE 10
|
|
|
|
#define BX_RESET_HARDWARE 11
|
|
|
|
|
|
|
|
//cdrom
|
|
|
|
#define BX_EJECTED 10
|
|
|
|
#define BX_INSERTED 11
|
|
|
|
|
2002-04-18 04:22:20 +04:00
|
|
|
///////////////////////////////////////////////////////////////////
|
2002-08-29 18:59:37 +04:00
|
|
|
// event structures for communication between simulator and CI
|
2002-04-18 04:22:20 +04:00
|
|
|
///////////////////////////////////////////////////////////////////
|
2002-08-29 18:59:37 +04:00
|
|
|
// Because the CI (configuration interface) might be in a different
|
|
|
|
// thread or even a different process, we pass events encoded in data
|
|
|
|
// structures to it instead of just calling functions. Each type of
|
|
|
|
// event is declared as a different structure, and then all those
|
|
|
|
// structures are squished into a union in BxEvent. (BTW, this is
|
|
|
|
// almost exactly how X windows event structs work.)
|
- I've added lots of comments in siminterface.h, and tried to clean up
the terminology a bit. In particular, the term "gui" has started
to mean different things in different contexts, so I've defined
some more specific names for the parts of the user interface, and
updated comments and some variable names to reflect it. See
siminterface.h for a more complete description of all of these.
VGAW: VGA display window and toolbar buttons, the traditional Bochs
display which is ported to X, win32, MacOS X, etc. Implemented
in gui/gui.* and platform dependent gui/*.cc files.
CI: configuration interface that lets the user change settings such
as floppy disk image, ne2k settings, log options. The CI consists
of two parts: configuration user interface (CUI) which does the
actual rendering to the screen and handles key/mouse/menu events,
and the siminterface object.
CUI: configuration user interface. This handles the user interactions
that allow the user to configure Bochs. To actually change any
values it talks to the siminterface object. One implementation of
the CUI is the text-mode menus in gui/control.cc. Another
implementation is (will be) the wxWindows menus and dialogs in
gui/wxmain.cc.
siminterface: the glue between the CUI and the simulation code,
accessible throughout the code by the global variable
bx_simulator_interface_c *SIM;
Among other things, siminterface methods allow the simulator to ask the
CUI to display things or ask for user input, and allows the CUI
to query and modify variables in the simulation code.
GUI: Literally, "graphical user interface". Until the configuration menus
and wxWindows came along, everyone understood that "gui" referred to the
VGA display window and the toolbar buttons because that's all there
was. Now that we have the wxWindows code, which implements both the VGAW
and the CUI, while all other platforms implement only the VGAW, it's not
so clear. So, I'm trying to use VGAW, CI, and CUI consistently since
they are more specific.
control panel: This has been used as another name for the configuration
interface. "control panel" is also somewhat unspecific and it sounds
like it would be graphical with buttons and sliders, but our text-mode
thing is not graphical at all. I've replaced "control panel" with
"configuration interface" wherever I could find it. In configure script,
the --disable-control-panel option is still supported, but it politely
suggests that you use --disable-config-interface instead.
- clean up comments in siminterface,wx* code
- add comments and examples for bx_param_* and BxEvents
- remove some obsolete stuff: notify_*_args,
bx_simulator_interface_c::[sg]et_enabled() methods
- in siminterface.cc, move a few bx_real_sim_c methods to where they belong,
with the rest of the methods. No changes to the actual methods.
- remove some DOS ^M's which crept in and confused my editor.
2002-08-26 19:31:23 +04:00
|
|
|
//
|
|
|
|
// These are simple structs, unblemished by C++ methods and tricks.
|
|
|
|
// No matter what event type it is, we allocate a BxEvent for each
|
|
|
|
// one, as opposed to trying to save a few bytes on small events by
|
|
|
|
// allocating only the bytes necessary for it. This makes it easy and
|
|
|
|
// fast to store events in a queue, like this
|
|
|
|
// BxEvent event_queue[MAX_EVENTS];
|
|
|
|
//
|
|
|
|
// Events come in two varieties: synchronous and asynchronous. We
|
2002-08-29 18:59:37 +04:00
|
|
|
// have to worry about sync and async events because the CI and the
|
- I've added lots of comments in siminterface.h, and tried to clean up
the terminology a bit. In particular, the term "gui" has started
to mean different things in different contexts, so I've defined
some more specific names for the parts of the user interface, and
updated comments and some variable names to reflect it. See
siminterface.h for a more complete description of all of these.
VGAW: VGA display window and toolbar buttons, the traditional Bochs
display which is ported to X, win32, MacOS X, etc. Implemented
in gui/gui.* and platform dependent gui/*.cc files.
CI: configuration interface that lets the user change settings such
as floppy disk image, ne2k settings, log options. The CI consists
of two parts: configuration user interface (CUI) which does the
actual rendering to the screen and handles key/mouse/menu events,
and the siminterface object.
CUI: configuration user interface. This handles the user interactions
that allow the user to configure Bochs. To actually change any
values it talks to the siminterface object. One implementation of
the CUI is the text-mode menus in gui/control.cc. Another
implementation is (will be) the wxWindows menus and dialogs in
gui/wxmain.cc.
siminterface: the glue between the CUI and the simulation code,
accessible throughout the code by the global variable
bx_simulator_interface_c *SIM;
Among other things, siminterface methods allow the simulator to ask the
CUI to display things or ask for user input, and allows the CUI
to query and modify variables in the simulation code.
GUI: Literally, "graphical user interface". Until the configuration menus
and wxWindows came along, everyone understood that "gui" referred to the
VGA display window and the toolbar buttons because that's all there
was. Now that we have the wxWindows code, which implements both the VGAW
and the CUI, while all other platforms implement only the VGAW, it's not
so clear. So, I'm trying to use VGAW, CI, and CUI consistently since
they are more specific.
control panel: This has been used as another name for the configuration
interface. "control panel" is also somewhat unspecific and it sounds
like it would be graphical with buttons and sliders, but our text-mode
thing is not graphical at all. I've replaced "control panel" with
"configuration interface" wherever I could find it. In configure script,
the --disable-control-panel option is still supported, but it politely
suggests that you use --disable-config-interface instead.
- clean up comments in siminterface,wx* code
- add comments and examples for bx_param_* and BxEvents
- remove some obsolete stuff: notify_*_args,
bx_simulator_interface_c::[sg]et_enabled() methods
- in siminterface.cc, move a few bx_real_sim_c methods to where they belong,
with the rest of the methods. No changes to the actual methods.
- remove some DOS ^M's which crept in and confused my editor.
2002-08-26 19:31:23 +04:00
|
|
|
// simulation may be running in different threads. An async event is
|
|
|
|
// the simplest. Whichever thread originates the event just builds
|
|
|
|
// the data structure, sends it, and then continues with its business.
|
|
|
|
// Async events can go in either direction. Synchronous events
|
|
|
|
// require the other thread to "respond" before the originating thread
|
|
|
|
// can continue. It's like a function with a return value; you can't
|
|
|
|
// continue until you get the return value back.
|
|
|
|
//
|
|
|
|
// Examples:
|
|
|
|
//
|
2002-08-29 18:59:37 +04:00
|
|
|
// async event: In the wxWindows implementation, both the CI and the
|
- I've added lots of comments in siminterface.h, and tried to clean up
the terminology a bit. In particular, the term "gui" has started
to mean different things in different contexts, so I've defined
some more specific names for the parts of the user interface, and
updated comments and some variable names to reflect it. See
siminterface.h for a more complete description of all of these.
VGAW: VGA display window and toolbar buttons, the traditional Bochs
display which is ported to X, win32, MacOS X, etc. Implemented
in gui/gui.* and platform dependent gui/*.cc files.
CI: configuration interface that lets the user change settings such
as floppy disk image, ne2k settings, log options. The CI consists
of two parts: configuration user interface (CUI) which does the
actual rendering to the screen and handles key/mouse/menu events,
and the siminterface object.
CUI: configuration user interface. This handles the user interactions
that allow the user to configure Bochs. To actually change any
values it talks to the siminterface object. One implementation of
the CUI is the text-mode menus in gui/control.cc. Another
implementation is (will be) the wxWindows menus and dialogs in
gui/wxmain.cc.
siminterface: the glue between the CUI and the simulation code,
accessible throughout the code by the global variable
bx_simulator_interface_c *SIM;
Among other things, siminterface methods allow the simulator to ask the
CUI to display things or ask for user input, and allows the CUI
to query and modify variables in the simulation code.
GUI: Literally, "graphical user interface". Until the configuration menus
and wxWindows came along, everyone understood that "gui" referred to the
VGA display window and the toolbar buttons because that's all there
was. Now that we have the wxWindows code, which implements both the VGAW
and the CUI, while all other platforms implement only the VGAW, it's not
so clear. So, I'm trying to use VGAW, CI, and CUI consistently since
they are more specific.
control panel: This has been used as another name for the configuration
interface. "control panel" is also somewhat unspecific and it sounds
like it would be graphical with buttons and sliders, but our text-mode
thing is not graphical at all. I've replaced "control panel" with
"configuration interface" wherever I could find it. In configure script,
the --disable-control-panel option is still supported, but it politely
suggests that you use --disable-config-interface instead.
- clean up comments in siminterface,wx* code
- add comments and examples for bx_param_* and BxEvents
- remove some obsolete stuff: notify_*_args,
bx_simulator_interface_c::[sg]et_enabled() methods
- in siminterface.cc, move a few bx_real_sim_c methods to where they belong,
with the rest of the methods. No changes to the actual methods.
- remove some DOS ^M's which crept in and confused my editor.
2002-08-26 19:31:23 +04:00
|
|
|
// VGAW operate in the wxWindows GUI thread. When the user presses a
|
|
|
|
// key, wxWindows sends a wxKeyEvent to the VGAW event handler code in
|
|
|
|
// wx.cc. The VGAW handler then builds a BxEvent with
|
|
|
|
// type=BX_ASYNC_EVT_KEY, and fills in the bx_key and raw_scancode
|
|
|
|
// fields. The asynchronous event is placed on the event_queue for
|
|
|
|
// the simulator, then the VGAW handler returns. (With wxWindows and
|
|
|
|
// many other graphical libaries, the event handler must return
|
|
|
|
// quickly because the window will not be updated until it's done.)
|
|
|
|
// Some time later, the simulator reaches the point where it checks
|
|
|
|
// for new events from the user (actually controlled by
|
|
|
|
// bx_keyb_c::periodic() in iodev/keyboard.cc) and calls
|
|
|
|
// bx_gui.handle_events(). Then all the events in the queue are
|
|
|
|
// processed by the simulator. There is no "response" sent back to
|
|
|
|
// the originating thread.
|
|
|
|
//
|
|
|
|
// sync event: Sometimes the simulator reaches a point where it needs
|
|
|
|
// to ask the user how to proceed. In this case, the simulator sends
|
|
|
|
// a synchronous event because it requires a response before it can
|
|
|
|
// continue. It builds an event structure, perhaps with type
|
|
|
|
// BX_SYNC_EVT_ASK_PARAM, sends it to the user interface
|
|
|
|
// using the event handler function defined by set_notify_callback(),
|
|
|
|
// and pauses the simulation. The user interface asks the user the
|
|
|
|
// question, and puts the answer into the BxEvent.retcode field. The
|
|
|
|
// event handler function returns the modified BxEvent with retcode
|
|
|
|
// filled in, and the simulation continues. The details of this
|
2002-08-29 18:59:37 +04:00
|
|
|
// transaction can be complicated if the simulation and CI are not
|
- I've added lots of comments in siminterface.h, and tried to clean up
the terminology a bit. In particular, the term "gui" has started
to mean different things in different contexts, so I've defined
some more specific names for the parts of the user interface, and
updated comments and some variable names to reflect it. See
siminterface.h for a more complete description of all of these.
VGAW: VGA display window and toolbar buttons, the traditional Bochs
display which is ported to X, win32, MacOS X, etc. Implemented
in gui/gui.* and platform dependent gui/*.cc files.
CI: configuration interface that lets the user change settings such
as floppy disk image, ne2k settings, log options. The CI consists
of two parts: configuration user interface (CUI) which does the
actual rendering to the screen and handles key/mouse/menu events,
and the siminterface object.
CUI: configuration user interface. This handles the user interactions
that allow the user to configure Bochs. To actually change any
values it talks to the siminterface object. One implementation of
the CUI is the text-mode menus in gui/control.cc. Another
implementation is (will be) the wxWindows menus and dialogs in
gui/wxmain.cc.
siminterface: the glue between the CUI and the simulation code,
accessible throughout the code by the global variable
bx_simulator_interface_c *SIM;
Among other things, siminterface methods allow the simulator to ask the
CUI to display things or ask for user input, and allows the CUI
to query and modify variables in the simulation code.
GUI: Literally, "graphical user interface". Until the configuration menus
and wxWindows came along, everyone understood that "gui" referred to the
VGA display window and the toolbar buttons because that's all there
was. Now that we have the wxWindows code, which implements both the VGAW
and the CUI, while all other platforms implement only the VGAW, it's not
so clear. So, I'm trying to use VGAW, CI, and CUI consistently since
they are more specific.
control panel: This has been used as another name for the configuration
interface. "control panel" is also somewhat unspecific and it sounds
like it would be graphical with buttons and sliders, but our text-mode
thing is not graphical at all. I've replaced "control panel" with
"configuration interface" wherever I could find it. In configure script,
the --disable-control-panel option is still supported, but it politely
suggests that you use --disable-config-interface instead.
- clean up comments in siminterface,wx* code
- add comments and examples for bx_param_* and BxEvents
- remove some obsolete stuff: notify_*_args,
bx_simulator_interface_c::[sg]et_enabled() methods
- in siminterface.cc, move a few bx_real_sim_c methods to where they belong,
with the rest of the methods. No changes to the actual methods.
- remove some DOS ^M's which crept in and confused my editor.
2002-08-26 19:31:23 +04:00
|
|
|
// in the same thread, but the behavior is as described.
|
|
|
|
//
|
2002-04-18 04:22:20 +04:00
|
|
|
|
|
|
|
///// types and definitions used in event structures
|
|
|
|
|
|
|
|
#define BX_EVT_IS_ASYNC(type) ((type) > __ALL_EVENTS_BELOW_ARE_ASYNC__)
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
__ALL_EVENTS_BELOW_ARE_SYNCHRONOUS__ = 2000,
|
2002-08-29 18:59:37 +04:00
|
|
|
BX_SYNC_EVT_GET_PARAM, // CI -> simulator -> CI
|
|
|
|
BX_SYNC_EVT_ASK_PARAM, // simulator -> CI -> simulator
|
|
|
|
BX_SYNC_EVT_TICK, // simulator -> CI, wait for response.
|
|
|
|
BX_SYNC_EVT_LOG_ASK, // simulator -> CI, wait for response.
|
2002-04-18 04:22:20 +04:00
|
|
|
__ALL_EVENTS_BELOW_ARE_ASYNC__,
|
- I've added lots of comments in siminterface.h, and tried to clean up
the terminology a bit. In particular, the term "gui" has started
to mean different things in different contexts, so I've defined
some more specific names for the parts of the user interface, and
updated comments and some variable names to reflect it. See
siminterface.h for a more complete description of all of these.
VGAW: VGA display window and toolbar buttons, the traditional Bochs
display which is ported to X, win32, MacOS X, etc. Implemented
in gui/gui.* and platform dependent gui/*.cc files.
CI: configuration interface that lets the user change settings such
as floppy disk image, ne2k settings, log options. The CI consists
of two parts: configuration user interface (CUI) which does the
actual rendering to the screen and handles key/mouse/menu events,
and the siminterface object.
CUI: configuration user interface. This handles the user interactions
that allow the user to configure Bochs. To actually change any
values it talks to the siminterface object. One implementation of
the CUI is the text-mode menus in gui/control.cc. Another
implementation is (will be) the wxWindows menus and dialogs in
gui/wxmain.cc.
siminterface: the glue between the CUI and the simulation code,
accessible throughout the code by the global variable
bx_simulator_interface_c *SIM;
Among other things, siminterface methods allow the simulator to ask the
CUI to display things or ask for user input, and allows the CUI
to query and modify variables in the simulation code.
GUI: Literally, "graphical user interface". Until the configuration menus
and wxWindows came along, everyone understood that "gui" referred to the
VGA display window and the toolbar buttons because that's all there
was. Now that we have the wxWindows code, which implements both the VGAW
and the CUI, while all other platforms implement only the VGAW, it's not
so clear. So, I'm trying to use VGAW, CI, and CUI consistently since
they are more specific.
control panel: This has been used as another name for the configuration
interface. "control panel" is also somewhat unspecific and it sounds
like it would be graphical with buttons and sliders, but our text-mode
thing is not graphical at all. I've replaced "control panel" with
"configuration interface" wherever I could find it. In configure script,
the --disable-control-panel option is still supported, but it politely
suggests that you use --disable-config-interface instead.
- clean up comments in siminterface,wx* code
- add comments and examples for bx_param_* and BxEvents
- remove some obsolete stuff: notify_*_args,
bx_simulator_interface_c::[sg]et_enabled() methods
- in siminterface.cc, move a few bx_real_sim_c methods to where they belong,
with the rest of the methods. No changes to the actual methods.
- remove some DOS ^M's which crept in and confused my editor.
2002-08-26 19:31:23 +04:00
|
|
|
BX_ASYNC_EVT_KEY, // vga window -> simulator
|
|
|
|
BX_ASYNC_EVT_MOUSE, // vga window -> simulator
|
2002-08-29 18:59:37 +04:00
|
|
|
BX_ASYNC_EVT_SET_PARAM, // CI -> simulator
|
|
|
|
BX_ASYNC_EVT_LOG_MSG, // simulator -> CI
|
|
|
|
BX_ASYNC_EVT_VALUE_CHANGED, // simulator -> CI
|
|
|
|
BX_ASYNC_EVT_TOOLBAR // CI -> simulator
|
2002-04-18 04:22:20 +04:00
|
|
|
} BxEventType;
|
|
|
|
|
|
|
|
typedef union {
|
|
|
|
Bit32s s32;
|
|
|
|
char *charptr;
|
|
|
|
} AnyParamVal;
|
|
|
|
|
|
|
|
// Define substructures which make up the interior of BxEvent. The
|
- I've added lots of comments in siminterface.h, and tried to clean up
the terminology a bit. In particular, the term "gui" has started
to mean different things in different contexts, so I've defined
some more specific names for the parts of the user interface, and
updated comments and some variable names to reflect it. See
siminterface.h for a more complete description of all of these.
VGAW: VGA display window and toolbar buttons, the traditional Bochs
display which is ported to X, win32, MacOS X, etc. Implemented
in gui/gui.* and platform dependent gui/*.cc files.
CI: configuration interface that lets the user change settings such
as floppy disk image, ne2k settings, log options. The CI consists
of two parts: configuration user interface (CUI) which does the
actual rendering to the screen and handles key/mouse/menu events,
and the siminterface object.
CUI: configuration user interface. This handles the user interactions
that allow the user to configure Bochs. To actually change any
values it talks to the siminterface object. One implementation of
the CUI is the text-mode menus in gui/control.cc. Another
implementation is (will be) the wxWindows menus and dialogs in
gui/wxmain.cc.
siminterface: the glue between the CUI and the simulation code,
accessible throughout the code by the global variable
bx_simulator_interface_c *SIM;
Among other things, siminterface methods allow the simulator to ask the
CUI to display things or ask for user input, and allows the CUI
to query and modify variables in the simulation code.
GUI: Literally, "graphical user interface". Until the configuration menus
and wxWindows came along, everyone understood that "gui" referred to the
VGA display window and the toolbar buttons because that's all there
was. Now that we have the wxWindows code, which implements both the VGAW
and the CUI, while all other platforms implement only the VGAW, it's not
so clear. So, I'm trying to use VGAW, CI, and CUI consistently since
they are more specific.
control panel: This has been used as another name for the configuration
interface. "control panel" is also somewhat unspecific and it sounds
like it would be graphical with buttons and sliders, but our text-mode
thing is not graphical at all. I've replaced "control panel" with
"configuration interface" wherever I could find it. In configure script,
the --disable-control-panel option is still supported, but it politely
suggests that you use --disable-config-interface instead.
- clean up comments in siminterface,wx* code
- add comments and examples for bx_param_* and BxEvents
- remove some obsolete stuff: notify_*_args,
bx_simulator_interface_c::[sg]et_enabled() methods
- in siminterface.cc, move a few bx_real_sim_c methods to where they belong,
with the rest of the methods. No changes to the actual methods.
- remove some DOS ^M's which crept in and confused my editor.
2002-08-26 19:31:23 +04:00
|
|
|
// substructures, such as BxKeyEvent or BxMouseEvent, should never be
|
|
|
|
// allocated on their own. They are only intended to be used within
|
|
|
|
// the union in the BxEvent structure.
|
2002-04-18 04:22:20 +04:00
|
|
|
|
|
|
|
// Event type: BX_SYNC_EVT_TICK
|
- I've added lots of comments in siminterface.h, and tried to clean up
the terminology a bit. In particular, the term "gui" has started
to mean different things in different contexts, so I've defined
some more specific names for the parts of the user interface, and
updated comments and some variable names to reflect it. See
siminterface.h for a more complete description of all of these.
VGAW: VGA display window and toolbar buttons, the traditional Bochs
display which is ported to X, win32, MacOS X, etc. Implemented
in gui/gui.* and platform dependent gui/*.cc files.
CI: configuration interface that lets the user change settings such
as floppy disk image, ne2k settings, log options. The CI consists
of two parts: configuration user interface (CUI) which does the
actual rendering to the screen and handles key/mouse/menu events,
and the siminterface object.
CUI: configuration user interface. This handles the user interactions
that allow the user to configure Bochs. To actually change any
values it talks to the siminterface object. One implementation of
the CUI is the text-mode menus in gui/control.cc. Another
implementation is (will be) the wxWindows menus and dialogs in
gui/wxmain.cc.
siminterface: the glue between the CUI and the simulation code,
accessible throughout the code by the global variable
bx_simulator_interface_c *SIM;
Among other things, siminterface methods allow the simulator to ask the
CUI to display things or ask for user input, and allows the CUI
to query and modify variables in the simulation code.
GUI: Literally, "graphical user interface". Until the configuration menus
and wxWindows came along, everyone understood that "gui" referred to the
VGA display window and the toolbar buttons because that's all there
was. Now that we have the wxWindows code, which implements both the VGAW
and the CUI, while all other platforms implement only the VGAW, it's not
so clear. So, I'm trying to use VGAW, CI, and CUI consistently since
they are more specific.
control panel: This has been used as another name for the configuration
interface. "control panel" is also somewhat unspecific and it sounds
like it would be graphical with buttons and sliders, but our text-mode
thing is not graphical at all. I've replaced "control panel" with
"configuration interface" wherever I could find it. In configure script,
the --disable-control-panel option is still supported, but it politely
suggests that you use --disable-config-interface instead.
- clean up comments in siminterface,wx* code
- add comments and examples for bx_param_* and BxEvents
- remove some obsolete stuff: notify_*_args,
bx_simulator_interface_c::[sg]et_enabled() methods
- in siminterface.cc, move a few bx_real_sim_c methods to where they belong,
with the rest of the methods. No changes to the actual methods.
- remove some DOS ^M's which crept in and confused my editor.
2002-08-26 19:31:23 +04:00
|
|
|
//
|
2002-04-18 04:22:20 +04:00
|
|
|
// A tick event is synchronous, sent from the simulator to the GUI. The
|
|
|
|
// event doesn't do anything visible. Primarily it gives the GUI a chance
|
|
|
|
// to tell the simulator to quit, if necessary. There may be other uses
|
- I've added lots of comments in siminterface.h, and tried to clean up
the terminology a bit. In particular, the term "gui" has started
to mean different things in different contexts, so I've defined
some more specific names for the parts of the user interface, and
updated comments and some variable names to reflect it. See
siminterface.h for a more complete description of all of these.
VGAW: VGA display window and toolbar buttons, the traditional Bochs
display which is ported to X, win32, MacOS X, etc. Implemented
in gui/gui.* and platform dependent gui/*.cc files.
CI: configuration interface that lets the user change settings such
as floppy disk image, ne2k settings, log options. The CI consists
of two parts: configuration user interface (CUI) which does the
actual rendering to the screen and handles key/mouse/menu events,
and the siminterface object.
CUI: configuration user interface. This handles the user interactions
that allow the user to configure Bochs. To actually change any
values it talks to the siminterface object. One implementation of
the CUI is the text-mode menus in gui/control.cc. Another
implementation is (will be) the wxWindows menus and dialogs in
gui/wxmain.cc.
siminterface: the glue between the CUI and the simulation code,
accessible throughout the code by the global variable
bx_simulator_interface_c *SIM;
Among other things, siminterface methods allow the simulator to ask the
CUI to display things or ask for user input, and allows the CUI
to query and modify variables in the simulation code.
GUI: Literally, "graphical user interface". Until the configuration menus
and wxWindows came along, everyone understood that "gui" referred to the
VGA display window and the toolbar buttons because that's all there
was. Now that we have the wxWindows code, which implements both the VGAW
and the CUI, while all other platforms implement only the VGAW, it's not
so clear. So, I'm trying to use VGAW, CI, and CUI consistently since
they are more specific.
control panel: This has been used as another name for the configuration
interface. "control panel" is also somewhat unspecific and it sounds
like it would be graphical with buttons and sliders, but our text-mode
thing is not graphical at all. I've replaced "control panel" with
"configuration interface" wherever I could find it. In configure script,
the --disable-control-panel option is still supported, but it politely
suggests that you use --disable-config-interface instead.
- clean up comments in siminterface,wx* code
- add comments and examples for bx_param_* and BxEvents
- remove some obsolete stuff: notify_*_args,
bx_simulator_interface_c::[sg]et_enabled() methods
- in siminterface.cc, move a few bx_real_sim_c methods to where they belong,
with the rest of the methods. No changes to the actual methods.
- remove some DOS ^M's which crept in and confused my editor.
2002-08-26 19:31:23 +04:00
|
|
|
// for the tick in the future, such as giving some kind of regular
|
|
|
|
// status report or mentioning watched values that changed, but so far
|
|
|
|
// it's just for that one thing. There is no data associated with a
|
|
|
|
// tick event.
|
2002-04-18 04:22:20 +04:00
|
|
|
|
|
|
|
// Event type: BX_ASYNC_EVT_KEY
|
- I've added lots of comments in siminterface.h, and tried to clean up
the terminology a bit. In particular, the term "gui" has started
to mean different things in different contexts, so I've defined
some more specific names for the parts of the user interface, and
updated comments and some variable names to reflect it. See
siminterface.h for a more complete description of all of these.
VGAW: VGA display window and toolbar buttons, the traditional Bochs
display which is ported to X, win32, MacOS X, etc. Implemented
in gui/gui.* and platform dependent gui/*.cc files.
CI: configuration interface that lets the user change settings such
as floppy disk image, ne2k settings, log options. The CI consists
of two parts: configuration user interface (CUI) which does the
actual rendering to the screen and handles key/mouse/menu events,
and the siminterface object.
CUI: configuration user interface. This handles the user interactions
that allow the user to configure Bochs. To actually change any
values it talks to the siminterface object. One implementation of
the CUI is the text-mode menus in gui/control.cc. Another
implementation is (will be) the wxWindows menus and dialogs in
gui/wxmain.cc.
siminterface: the glue between the CUI and the simulation code,
accessible throughout the code by the global variable
bx_simulator_interface_c *SIM;
Among other things, siminterface methods allow the simulator to ask the
CUI to display things or ask for user input, and allows the CUI
to query and modify variables in the simulation code.
GUI: Literally, "graphical user interface". Until the configuration menus
and wxWindows came along, everyone understood that "gui" referred to the
VGA display window and the toolbar buttons because that's all there
was. Now that we have the wxWindows code, which implements both the VGAW
and the CUI, while all other platforms implement only the VGAW, it's not
so clear. So, I'm trying to use VGAW, CI, and CUI consistently since
they are more specific.
control panel: This has been used as another name for the configuration
interface. "control panel" is also somewhat unspecific and it sounds
like it would be graphical with buttons and sliders, but our text-mode
thing is not graphical at all. I've replaced "control panel" with
"configuration interface" wherever I could find it. In configure script,
the --disable-control-panel option is still supported, but it politely
suggests that you use --disable-config-interface instead.
- clean up comments in siminterface,wx* code
- add comments and examples for bx_param_* and BxEvents
- remove some obsolete stuff: notify_*_args,
bx_simulator_interface_c::[sg]et_enabled() methods
- in siminterface.cc, move a few bx_real_sim_c methods to where they belong,
with the rest of the methods. No changes to the actual methods.
- remove some DOS ^M's which crept in and confused my editor.
2002-08-26 19:31:23 +04:00
|
|
|
//
|
|
|
|
// A key event can be sent from the VGA window to the Bochs simulator.
|
|
|
|
// It is asynchronous.
|
2002-04-18 04:22:20 +04:00
|
|
|
typedef struct {
|
|
|
|
// what was pressed? This is a BX_KEY_* value. For key releases,
|
|
|
|
// BX_KEY_RELEASED is ORed with the base BX_KEY_*.
|
|
|
|
Bit32u bx_key;
|
|
|
|
Boolean raw_scancode;
|
|
|
|
} BxKeyEvent;
|
|
|
|
|
|
|
|
// Event type: BX_ASYNC_EVT_MOUSE
|
- I've added lots of comments in siminterface.h, and tried to clean up
the terminology a bit. In particular, the term "gui" has started
to mean different things in different contexts, so I've defined
some more specific names for the parts of the user interface, and
updated comments and some variable names to reflect it. See
siminterface.h for a more complete description of all of these.
VGAW: VGA display window and toolbar buttons, the traditional Bochs
display which is ported to X, win32, MacOS X, etc. Implemented
in gui/gui.* and platform dependent gui/*.cc files.
CI: configuration interface that lets the user change settings such
as floppy disk image, ne2k settings, log options. The CI consists
of two parts: configuration user interface (CUI) which does the
actual rendering to the screen and handles key/mouse/menu events,
and the siminterface object.
CUI: configuration user interface. This handles the user interactions
that allow the user to configure Bochs. To actually change any
values it talks to the siminterface object. One implementation of
the CUI is the text-mode menus in gui/control.cc. Another
implementation is (will be) the wxWindows menus and dialogs in
gui/wxmain.cc.
siminterface: the glue between the CUI and the simulation code,
accessible throughout the code by the global variable
bx_simulator_interface_c *SIM;
Among other things, siminterface methods allow the simulator to ask the
CUI to display things or ask for user input, and allows the CUI
to query and modify variables in the simulation code.
GUI: Literally, "graphical user interface". Until the configuration menus
and wxWindows came along, everyone understood that "gui" referred to the
VGA display window and the toolbar buttons because that's all there
was. Now that we have the wxWindows code, which implements both the VGAW
and the CUI, while all other platforms implement only the VGAW, it's not
so clear. So, I'm trying to use VGAW, CI, and CUI consistently since
they are more specific.
control panel: This has been used as another name for the configuration
interface. "control panel" is also somewhat unspecific and it sounds
like it would be graphical with buttons and sliders, but our text-mode
thing is not graphical at all. I've replaced "control panel" with
"configuration interface" wherever I could find it. In configure script,
the --disable-control-panel option is still supported, but it politely
suggests that you use --disable-config-interface instead.
- clean up comments in siminterface,wx* code
- add comments and examples for bx_param_* and BxEvents
- remove some obsolete stuff: notify_*_args,
bx_simulator_interface_c::[sg]et_enabled() methods
- in siminterface.cc, move a few bx_real_sim_c methods to where they belong,
with the rest of the methods. No changes to the actual methods.
- remove some DOS ^M's which crept in and confused my editor.
2002-08-26 19:31:23 +04:00
|
|
|
//
|
|
|
|
// A mouse event can be sent from the VGA window to the Bochs
|
|
|
|
// simulator. It is asynchronous. Currently unused because mouse
|
|
|
|
// events aren't implemented in our wxWindows code yet.
|
2002-04-18 04:22:20 +04:00
|
|
|
typedef struct {
|
|
|
|
// type is BX_EVT_MOUSE
|
|
|
|
Bit16u x, y; // coordinate (vga screen?)
|
|
|
|
Bit8u buttons; // which buttons are pressed.
|
|
|
|
// bit 0: 1=left button down, 0=up
|
|
|
|
// bit 1: 1=right button down, 0=up
|
|
|
|
} BxMouseEvent;
|
|
|
|
|
|
|
|
// Event type: BX_SYNC_EVT_GET_PARAM, BX_ASYNC_EVT_SET_PARAM
|
- I've added lots of comments in siminterface.h, and tried to clean up
the terminology a bit. In particular, the term "gui" has started
to mean different things in different contexts, so I've defined
some more specific names for the parts of the user interface, and
updated comments and some variable names to reflect it. See
siminterface.h for a more complete description of all of these.
VGAW: VGA display window and toolbar buttons, the traditional Bochs
display which is ported to X, win32, MacOS X, etc. Implemented
in gui/gui.* and platform dependent gui/*.cc files.
CI: configuration interface that lets the user change settings such
as floppy disk image, ne2k settings, log options. The CI consists
of two parts: configuration user interface (CUI) which does the
actual rendering to the screen and handles key/mouse/menu events,
and the siminterface object.
CUI: configuration user interface. This handles the user interactions
that allow the user to configure Bochs. To actually change any
values it talks to the siminterface object. One implementation of
the CUI is the text-mode menus in gui/control.cc. Another
implementation is (will be) the wxWindows menus and dialogs in
gui/wxmain.cc.
siminterface: the glue between the CUI and the simulation code,
accessible throughout the code by the global variable
bx_simulator_interface_c *SIM;
Among other things, siminterface methods allow the simulator to ask the
CUI to display things or ask for user input, and allows the CUI
to query and modify variables in the simulation code.
GUI: Literally, "graphical user interface". Until the configuration menus
and wxWindows came along, everyone understood that "gui" referred to the
VGA display window and the toolbar buttons because that's all there
was. Now that we have the wxWindows code, which implements both the VGAW
and the CUI, while all other platforms implement only the VGAW, it's not
so clear. So, I'm trying to use VGAW, CI, and CUI consistently since
they are more specific.
control panel: This has been used as another name for the configuration
interface. "control panel" is also somewhat unspecific and it sounds
like it would be graphical with buttons and sliders, but our text-mode
thing is not graphical at all. I've replaced "control panel" with
"configuration interface" wherever I could find it. In configure script,
the --disable-control-panel option is still supported, but it politely
suggests that you use --disable-config-interface instead.
- clean up comments in siminterface,wx* code
- add comments and examples for bx_param_* and BxEvents
- remove some obsolete stuff: notify_*_args,
bx_simulator_interface_c::[sg]et_enabled() methods
- in siminterface.cc, move a few bx_real_sim_c methods to where they belong,
with the rest of the methods. No changes to the actual methods.
- remove some DOS ^M's which crept in and confused my editor.
2002-08-26 19:31:23 +04:00
|
|
|
//
|
2002-08-29 18:59:37 +04:00
|
|
|
// Parameter set/get events are initiated by the CI, since Bochs can
|
- I've added lots of comments in siminterface.h, and tried to clean up
the terminology a bit. In particular, the term "gui" has started
to mean different things in different contexts, so I've defined
some more specific names for the parts of the user interface, and
updated comments and some variable names to reflect it. See
siminterface.h for a more complete description of all of these.
VGAW: VGA display window and toolbar buttons, the traditional Bochs
display which is ported to X, win32, MacOS X, etc. Implemented
in gui/gui.* and platform dependent gui/*.cc files.
CI: configuration interface that lets the user change settings such
as floppy disk image, ne2k settings, log options. The CI consists
of two parts: configuration user interface (CUI) which does the
actual rendering to the screen and handles key/mouse/menu events,
and the siminterface object.
CUI: configuration user interface. This handles the user interactions
that allow the user to configure Bochs. To actually change any
values it talks to the siminterface object. One implementation of
the CUI is the text-mode menus in gui/control.cc. Another
implementation is (will be) the wxWindows menus and dialogs in
gui/wxmain.cc.
siminterface: the glue between the CUI and the simulation code,
accessible throughout the code by the global variable
bx_simulator_interface_c *SIM;
Among other things, siminterface methods allow the simulator to ask the
CUI to display things or ask for user input, and allows the CUI
to query and modify variables in the simulation code.
GUI: Literally, "graphical user interface". Until the configuration menus
and wxWindows came along, everyone understood that "gui" referred to the
VGA display window and the toolbar buttons because that's all there
was. Now that we have the wxWindows code, which implements both the VGAW
and the CUI, while all other platforms implement only the VGAW, it's not
so clear. So, I'm trying to use VGAW, CI, and CUI consistently since
they are more specific.
control panel: This has been used as another name for the configuration
interface. "control panel" is also somewhat unspecific and it sounds
like it would be graphical with buttons and sliders, but our text-mode
thing is not graphical at all. I've replaced "control panel" with
"configuration interface" wherever I could find it. In configure script,
the --disable-control-panel option is still supported, but it politely
suggests that you use --disable-config-interface instead.
- clean up comments in siminterface,wx* code
- add comments and examples for bx_param_* and BxEvents
- remove some obsolete stuff: notify_*_args,
bx_simulator_interface_c::[sg]et_enabled() methods
- in siminterface.cc, move a few bx_real_sim_c methods to where they belong,
with the rest of the methods. No changes to the actual methods.
- remove some DOS ^M's which crept in and confused my editor.
2002-08-26 19:31:23 +04:00
|
|
|
// always access the parameters directly. So far, I haven't used
|
2002-08-29 18:59:37 +04:00
|
|
|
// these event types. In the CI I just call
|
- I've added lots of comments in siminterface.h, and tried to clean up
the terminology a bit. In particular, the term "gui" has started
to mean different things in different contexts, so I've defined
some more specific names for the parts of the user interface, and
updated comments and some variable names to reflect it. See
siminterface.h for a more complete description of all of these.
VGAW: VGA display window and toolbar buttons, the traditional Bochs
display which is ported to X, win32, MacOS X, etc. Implemented
in gui/gui.* and platform dependent gui/*.cc files.
CI: configuration interface that lets the user change settings such
as floppy disk image, ne2k settings, log options. The CI consists
of two parts: configuration user interface (CUI) which does the
actual rendering to the screen and handles key/mouse/menu events,
and the siminterface object.
CUI: configuration user interface. This handles the user interactions
that allow the user to configure Bochs. To actually change any
values it talks to the siminterface object. One implementation of
the CUI is the text-mode menus in gui/control.cc. Another
implementation is (will be) the wxWindows menus and dialogs in
gui/wxmain.cc.
siminterface: the glue between the CUI and the simulation code,
accessible throughout the code by the global variable
bx_simulator_interface_c *SIM;
Among other things, siminterface methods allow the simulator to ask the
CUI to display things or ask for user input, and allows the CUI
to query and modify variables in the simulation code.
GUI: Literally, "graphical user interface". Until the configuration menus
and wxWindows came along, everyone understood that "gui" referred to the
VGA display window and the toolbar buttons because that's all there
was. Now that we have the wxWindows code, which implements both the VGAW
and the CUI, while all other platforms implement only the VGAW, it's not
so clear. So, I'm trying to use VGAW, CI, and CUI consistently since
they are more specific.
control panel: This has been used as another name for the configuration
interface. "control panel" is also somewhat unspecific and it sounds
like it would be graphical with buttons and sliders, but our text-mode
thing is not graphical at all. I've replaced "control panel" with
"configuration interface" wherever I could find it. In configure script,
the --disable-control-panel option is still supported, but it politely
suggests that you use --disable-config-interface instead.
- clean up comments in siminterface,wx* code
- add comments and examples for bx_param_* and BxEvents
- remove some obsolete stuff: notify_*_args,
bx_simulator_interface_c::[sg]et_enabled() methods
- in siminterface.cc, move a few bx_real_sim_c methods to where they belong,
with the rest of the methods. No changes to the actual methods.
- remove some DOS ^M's which crept in and confused my editor.
2002-08-26 19:31:23 +04:00
|
|
|
// SIM->get_param(parameter_id) to get a pointer to the bx_param_c
|
|
|
|
// object and then call the get/set methods. This is okay for
|
|
|
|
// configuration since bochs is not running. However it could be
|
|
|
|
// dangerous for the GUI thread to poke around in Bochs structures
|
|
|
|
// while the thread is running. For these cases, I may have to be
|
|
|
|
// more careful and actually build get/set events and place them on
|
|
|
|
// Bochs's event queue to be processed during SIM->periodic() or
|
|
|
|
// something.
|
2002-04-18 04:22:20 +04:00
|
|
|
typedef struct {
|
|
|
|
// type is BX_EVT_GET_PARAM, BX_EVT_SET_PARAM
|
|
|
|
class bx_param_c *param; // pointer to param structure
|
|
|
|
AnyParamVal val;
|
|
|
|
} BxParamEvent;
|
|
|
|
|
|
|
|
// Event type: BX_SYNC_EVT_ASK_PARAM
|
2002-08-29 18:59:37 +04:00
|
|
|
// Synchronous event sent from the simulator to the CI. This tells the
|
|
|
|
// CI to ask the user to choose the value of a parameter. The CI may
|
2002-04-18 04:22:20 +04:00
|
|
|
// need to discover the type of parameter so that it can use the right
|
|
|
|
// kind of graphical display. The BxParamEvent is used for these events
|
|
|
|
// too.
|
|
|
|
// FIXME: at the moment the GUI implements the ASK_PARAM event for just
|
|
|
|
// a few parameter types. I need to implement the event for all parameter
|
|
|
|
// types.
|
|
|
|
|
|
|
|
// Event type: BX_ASYNC_EVT_VALUE_CHANGED
|
- I've added lots of comments in siminterface.h, and tried to clean up
the terminology a bit. In particular, the term "gui" has started
to mean different things in different contexts, so I've defined
some more specific names for the parts of the user interface, and
updated comments and some variable names to reflect it. See
siminterface.h for a more complete description of all of these.
VGAW: VGA display window and toolbar buttons, the traditional Bochs
display which is ported to X, win32, MacOS X, etc. Implemented
in gui/gui.* and platform dependent gui/*.cc files.
CI: configuration interface that lets the user change settings such
as floppy disk image, ne2k settings, log options. The CI consists
of two parts: configuration user interface (CUI) which does the
actual rendering to the screen and handles key/mouse/menu events,
and the siminterface object.
CUI: configuration user interface. This handles the user interactions
that allow the user to configure Bochs. To actually change any
values it talks to the siminterface object. One implementation of
the CUI is the text-mode menus in gui/control.cc. Another
implementation is (will be) the wxWindows menus and dialogs in
gui/wxmain.cc.
siminterface: the glue between the CUI and the simulation code,
accessible throughout the code by the global variable
bx_simulator_interface_c *SIM;
Among other things, siminterface methods allow the simulator to ask the
CUI to display things or ask for user input, and allows the CUI
to query and modify variables in the simulation code.
GUI: Literally, "graphical user interface". Until the configuration menus
and wxWindows came along, everyone understood that "gui" referred to the
VGA display window and the toolbar buttons because that's all there
was. Now that we have the wxWindows code, which implements both the VGAW
and the CUI, while all other platforms implement only the VGAW, it's not
so clear. So, I'm trying to use VGAW, CI, and CUI consistently since
they are more specific.
control panel: This has been used as another name for the configuration
interface. "control panel" is also somewhat unspecific and it sounds
like it would be graphical with buttons and sliders, but our text-mode
thing is not graphical at all. I've replaced "control panel" with
"configuration interface" wherever I could find it. In configure script,
the --disable-control-panel option is still supported, but it politely
suggests that you use --disable-config-interface instead.
- clean up comments in siminterface,wx* code
- add comments and examples for bx_param_* and BxEvents
- remove some obsolete stuff: notify_*_args,
bx_simulator_interface_c::[sg]et_enabled() methods
- in siminterface.cc, move a few bx_real_sim_c methods to where they belong,
with the rest of the methods. No changes to the actual methods.
- remove some DOS ^M's which crept in and confused my editor.
2002-08-26 19:31:23 +04:00
|
|
|
//
|
2002-08-29 18:59:37 +04:00
|
|
|
// Asynchronous event sent from the simulator to the CI, telling it that
|
2002-04-18 04:22:20 +04:00
|
|
|
// some value that it (hopefully) cares about has changed. This isn't
|
|
|
|
// being used yet, but a good example is in a debugger interface, you might
|
|
|
|
// want to maintain a reasonably current display of the PC or some other
|
2002-08-29 18:59:37 +04:00
|
|
|
// simulation state. The CI would set some kind of event mask (which
|
2002-04-18 04:22:20 +04:00
|
|
|
// doesn't exist now of course) and then when certain values change, the
|
2002-08-29 18:59:37 +04:00
|
|
|
// simulator would send this event so that the CI can update. We may need
|
2002-04-18 04:22:20 +04:00
|
|
|
// some kind of "flow control" since the simulator will be able to produce
|
- I've added lots of comments in siminterface.h, and tried to clean up
the terminology a bit. In particular, the term "gui" has started
to mean different things in different contexts, so I've defined
some more specific names for the parts of the user interface, and
updated comments and some variable names to reflect it. See
siminterface.h for a more complete description of all of these.
VGAW: VGA display window and toolbar buttons, the traditional Bochs
display which is ported to X, win32, MacOS X, etc. Implemented
in gui/gui.* and platform dependent gui/*.cc files.
CI: configuration interface that lets the user change settings such
as floppy disk image, ne2k settings, log options. The CI consists
of two parts: configuration user interface (CUI) which does the
actual rendering to the screen and handles key/mouse/menu events,
and the siminterface object.
CUI: configuration user interface. This handles the user interactions
that allow the user to configure Bochs. To actually change any
values it talks to the siminterface object. One implementation of
the CUI is the text-mode menus in gui/control.cc. Another
implementation is (will be) the wxWindows menus and dialogs in
gui/wxmain.cc.
siminterface: the glue between the CUI and the simulation code,
accessible throughout the code by the global variable
bx_simulator_interface_c *SIM;
Among other things, siminterface methods allow the simulator to ask the
CUI to display things or ask for user input, and allows the CUI
to query and modify variables in the simulation code.
GUI: Literally, "graphical user interface". Until the configuration menus
and wxWindows came along, everyone understood that "gui" referred to the
VGA display window and the toolbar buttons because that's all there
was. Now that we have the wxWindows code, which implements both the VGAW
and the CUI, while all other platforms implement only the VGAW, it's not
so clear. So, I'm trying to use VGAW, CI, and CUI consistently since
they are more specific.
control panel: This has been used as another name for the configuration
interface. "control panel" is also somewhat unspecific and it sounds
like it would be graphical with buttons and sliders, but our text-mode
thing is not graphical at all. I've replaced "control panel" with
"configuration interface" wherever I could find it. In configure script,
the --disable-control-panel option is still supported, but it politely
suggests that you use --disable-config-interface instead.
- clean up comments in siminterface,wx* code
- add comments and examples for bx_param_* and BxEvents
- remove some obsolete stuff: notify_*_args,
bx_simulator_interface_c::[sg]et_enabled() methods
- in siminterface.cc, move a few bx_real_sim_c methods to where they belong,
with the rest of the methods. No changes to the actual methods.
- remove some DOS ^M's which crept in and confused my editor.
2002-08-26 19:31:23 +04:00
|
|
|
// new events much faster than the gui can accept them.
|
2002-04-18 04:22:20 +04:00
|
|
|
|
- use setjmp() and longjmp() to quit the simulation thread cleanly.
I use setjmp() to save the context just before calling
bx_continue_after_config_interface(). Then, in
bx_real_sim_c:quit_sim, I use longjmp() to jump back to that context.
This happens in main.cc and in gui/wxmain.cc (wxWindows only).
I haven't tested with the debugger yet. Possibly with debugger
the quit longjmp() should jump back to the debugger prompt loop
instead of actually quitting the program.
- clean up BX_ASYNC_EVT_LOG_MSG implementation by creating a different,
synchronous event called BX_SYNC_EVT_LOG_ASK. The async event
could be used to simply tell the CI that an event has occurred,
for example if the user wanted to view the events on screen
(not implemented). The sync event is used when you want the user
to respond before the simulation can continue, such as a for the
"panic=ask" behavior.
- in wxmain.cc, move the updates to the Start,Stop,Pause,Resume menu
items into a separate method simStatusChanged(). This makes the code that
does important stuff more readable.
- remove wxMutexGuiEnter()/Leave() from MyFrame::OnSim2CuiEvent().
This method is an event handler called in the gui thread, so it
already has the gui lock. This call caused thread lock on my linux
box.
2002-08-27 22:11:13 +04:00
|
|
|
// Event type: BX_ASYNC_EVT_LOG_MSG (unused)
|
- I've added lots of comments in siminterface.h, and tried to clean up
the terminology a bit. In particular, the term "gui" has started
to mean different things in different contexts, so I've defined
some more specific names for the parts of the user interface, and
updated comments and some variable names to reflect it. See
siminterface.h for a more complete description of all of these.
VGAW: VGA display window and toolbar buttons, the traditional Bochs
display which is ported to X, win32, MacOS X, etc. Implemented
in gui/gui.* and platform dependent gui/*.cc files.
CI: configuration interface that lets the user change settings such
as floppy disk image, ne2k settings, log options. The CI consists
of two parts: configuration user interface (CUI) which does the
actual rendering to the screen and handles key/mouse/menu events,
and the siminterface object.
CUI: configuration user interface. This handles the user interactions
that allow the user to configure Bochs. To actually change any
values it talks to the siminterface object. One implementation of
the CUI is the text-mode menus in gui/control.cc. Another
implementation is (will be) the wxWindows menus and dialogs in
gui/wxmain.cc.
siminterface: the glue between the CUI and the simulation code,
accessible throughout the code by the global variable
bx_simulator_interface_c *SIM;
Among other things, siminterface methods allow the simulator to ask the
CUI to display things or ask for user input, and allows the CUI
to query and modify variables in the simulation code.
GUI: Literally, "graphical user interface". Until the configuration menus
and wxWindows came along, everyone understood that "gui" referred to the
VGA display window and the toolbar buttons because that's all there
was. Now that we have the wxWindows code, which implements both the VGAW
and the CUI, while all other platforms implement only the VGAW, it's not
so clear. So, I'm trying to use VGAW, CI, and CUI consistently since
they are more specific.
control panel: This has been used as another name for the configuration
interface. "control panel" is also somewhat unspecific and it sounds
like it would be graphical with buttons and sliders, but our text-mode
thing is not graphical at all. I've replaced "control panel" with
"configuration interface" wherever I could find it. In configure script,
the --disable-control-panel option is still supported, but it politely
suggests that you use --disable-config-interface instead.
- clean up comments in siminterface,wx* code
- add comments and examples for bx_param_* and BxEvents
- remove some obsolete stuff: notify_*_args,
bx_simulator_interface_c::[sg]et_enabled() methods
- in siminterface.cc, move a few bx_real_sim_c methods to where they belong,
with the rest of the methods. No changes to the actual methods.
- remove some DOS ^M's which crept in and confused my editor.
2002-08-26 19:31:23 +04:00
|
|
|
//
|
2002-08-29 18:59:37 +04:00
|
|
|
// Asynchronous event from the simulator to the CI. When a BX_PANIC,
|
2002-04-18 04:22:20 +04:00
|
|
|
// BX_ERROR, BX_INFO, or BX_DEBUG is found in the simulator code, this
|
2002-08-29 18:59:37 +04:00
|
|
|
// event type can be used to inform the CI of the condition. There is
|
|
|
|
// no point in sending messages to the CI that will not be displayed; these
|
2002-04-18 04:22:20 +04:00
|
|
|
// would only slow the simulation. So we will need some mechanism for
|
2002-08-29 18:59:37 +04:00
|
|
|
// choosing what kinds of events will be delivered to the CI. Normally,
|
2002-04-18 04:22:20 +04:00
|
|
|
// you wouldn't want to look at the log unless something is going wrong.
|
|
|
|
// At that point, you might want to open up a window to watch the debug
|
- I've added lots of comments in siminterface.h, and tried to clean up
the terminology a bit. In particular, the term "gui" has started
to mean different things in different contexts, so I've defined
some more specific names for the parts of the user interface, and
updated comments and some variable names to reflect it. See
siminterface.h for a more complete description of all of these.
VGAW: VGA display window and toolbar buttons, the traditional Bochs
display which is ported to X, win32, MacOS X, etc. Implemented
in gui/gui.* and platform dependent gui/*.cc files.
CI: configuration interface that lets the user change settings such
as floppy disk image, ne2k settings, log options. The CI consists
of two parts: configuration user interface (CUI) which does the
actual rendering to the screen and handles key/mouse/menu events,
and the siminterface object.
CUI: configuration user interface. This handles the user interactions
that allow the user to configure Bochs. To actually change any
values it talks to the siminterface object. One implementation of
the CUI is the text-mode menus in gui/control.cc. Another
implementation is (will be) the wxWindows menus and dialogs in
gui/wxmain.cc.
siminterface: the glue between the CUI and the simulation code,
accessible throughout the code by the global variable
bx_simulator_interface_c *SIM;
Among other things, siminterface methods allow the simulator to ask the
CUI to display things or ask for user input, and allows the CUI
to query and modify variables in the simulation code.
GUI: Literally, "graphical user interface". Until the configuration menus
and wxWindows came along, everyone understood that "gui" referred to the
VGA display window and the toolbar buttons because that's all there
was. Now that we have the wxWindows code, which implements both the VGAW
and the CUI, while all other platforms implement only the VGAW, it's not
so clear. So, I'm trying to use VGAW, CI, and CUI consistently since
they are more specific.
control panel: This has been used as another name for the configuration
interface. "control panel" is also somewhat unspecific and it sounds
like it would be graphical with buttons and sliders, but our text-mode
thing is not graphical at all. I've replaced "control panel" with
"configuration interface" wherever I could find it. In configure script,
the --disable-control-panel option is still supported, but it politely
suggests that you use --disable-config-interface instead.
- clean up comments in siminterface,wx* code
- add comments and examples for bx_param_* and BxEvents
- remove some obsolete stuff: notify_*_args,
bx_simulator_interface_c::[sg]et_enabled() methods
- in siminterface.cc, move a few bx_real_sim_c methods to where they belong,
with the rest of the methods. No changes to the actual methods.
- remove some DOS ^M's which crept in and confused my editor.
2002-08-26 19:31:23 +04:00
|
|
|
// messages from one or two devices only.
|
2002-04-18 04:22:20 +04:00
|
|
|
//
|
- I've added lots of comments in siminterface.h, and tried to clean up
the terminology a bit. In particular, the term "gui" has started
to mean different things in different contexts, so I've defined
some more specific names for the parts of the user interface, and
updated comments and some variable names to reflect it. See
siminterface.h for a more complete description of all of these.
VGAW: VGA display window and toolbar buttons, the traditional Bochs
display which is ported to X, win32, MacOS X, etc. Implemented
in gui/gui.* and platform dependent gui/*.cc files.
CI: configuration interface that lets the user change settings such
as floppy disk image, ne2k settings, log options. The CI consists
of two parts: configuration user interface (CUI) which does the
actual rendering to the screen and handles key/mouse/menu events,
and the siminterface object.
CUI: configuration user interface. This handles the user interactions
that allow the user to configure Bochs. To actually change any
values it talks to the siminterface object. One implementation of
the CUI is the text-mode menus in gui/control.cc. Another
implementation is (will be) the wxWindows menus and dialogs in
gui/wxmain.cc.
siminterface: the glue between the CUI and the simulation code,
accessible throughout the code by the global variable
bx_simulator_interface_c *SIM;
Among other things, siminterface methods allow the simulator to ask the
CUI to display things or ask for user input, and allows the CUI
to query and modify variables in the simulation code.
GUI: Literally, "graphical user interface". Until the configuration menus
and wxWindows came along, everyone understood that "gui" referred to the
VGA display window and the toolbar buttons because that's all there
was. Now that we have the wxWindows code, which implements both the VGAW
and the CUI, while all other platforms implement only the VGAW, it's not
so clear. So, I'm trying to use VGAW, CI, and CUI consistently since
they are more specific.
control panel: This has been used as another name for the configuration
interface. "control panel" is also somewhat unspecific and it sounds
like it would be graphical with buttons and sliders, but our text-mode
thing is not graphical at all. I've replaced "control panel" with
"configuration interface" wherever I could find it. In configure script,
the --disable-control-panel option is still supported, but it politely
suggests that you use --disable-config-interface instead.
- clean up comments in siminterface,wx* code
- add comments and examples for bx_param_* and BxEvents
- remove some obsolete stuff: notify_*_args,
bx_simulator_interface_c::[sg]et_enabled() methods
- in siminterface.cc, move a few bx_real_sim_c methods to where they belong,
with the rest of the methods. No changes to the actual methods.
- remove some DOS ^M's which crept in and confused my editor.
2002-08-26 19:31:23 +04:00
|
|
|
// Idea: Except for panics that require user attention to continue, it
|
|
|
|
// might be most efficient to just append log messages to a file.
|
|
|
|
// When the user wants to look at the log messages, the gui can reopen
|
|
|
|
// the file (read only), skip to the end, and look backward for a
|
|
|
|
// reasonable number of lines to display (200?). This allows it to
|
|
|
|
// skip over huge bursts of log entries without allocating memory,
|
|
|
|
// synchronizing threads, etc. for each.
|
2002-04-18 04:22:20 +04:00
|
|
|
typedef struct {
|
|
|
|
Bit8u level;
|
|
|
|
char *prefix;
|
|
|
|
char *msg;
|
|
|
|
} BxLogMsgEvent;
|
|
|
|
|
- use setjmp() and longjmp() to quit the simulation thread cleanly.
I use setjmp() to save the context just before calling
bx_continue_after_config_interface(). Then, in
bx_real_sim_c:quit_sim, I use longjmp() to jump back to that context.
This happens in main.cc and in gui/wxmain.cc (wxWindows only).
I haven't tested with the debugger yet. Possibly with debugger
the quit longjmp() should jump back to the debugger prompt loop
instead of actually quitting the program.
- clean up BX_ASYNC_EVT_LOG_MSG implementation by creating a different,
synchronous event called BX_SYNC_EVT_LOG_ASK. The async event
could be used to simply tell the CI that an event has occurred,
for example if the user wanted to view the events on screen
(not implemented). The sync event is used when you want the user
to respond before the simulation can continue, such as a for the
"panic=ask" behavior.
- in wxmain.cc, move the updates to the Start,Stop,Pause,Resume menu
items into a separate method simStatusChanged(). This makes the code that
does important stuff more readable.
- remove wxMutexGuiEnter()/Leave() from MyFrame::OnSim2CuiEvent().
This method is an event handler called in the gui thread, so it
already has the gui lock. This call caused thread lock on my linux
box.
2002-08-27 22:11:13 +04:00
|
|
|
// Event type: BX_SYNC_EVT_LOG_ASK
|
|
|
|
//
|
|
|
|
// This is a synchronous version of BX_ASYNC_EVT_LOG_MSG, which is used
|
|
|
|
// when the "action=ask" setting is used. If the simulator runs into a
|
2002-08-29 18:59:37 +04:00
|
|
|
// panic, it sends a synchronous BX_SYNC_EVT_LOG_ASK to the CI to be
|
|
|
|
// displayed. The CI shows a dialog that asks if the user wants to
|
- use setjmp() and longjmp() to quit the simulation thread cleanly.
I use setjmp() to save the context just before calling
bx_continue_after_config_interface(). Then, in
bx_real_sim_c:quit_sim, I use longjmp() to jump back to that context.
This happens in main.cc and in gui/wxmain.cc (wxWindows only).
I haven't tested with the debugger yet. Possibly with debugger
the quit longjmp() should jump back to the debugger prompt loop
instead of actually quitting the program.
- clean up BX_ASYNC_EVT_LOG_MSG implementation by creating a different,
synchronous event called BX_SYNC_EVT_LOG_ASK. The async event
could be used to simply tell the CI that an event has occurred,
for example if the user wanted to view the events on screen
(not implemented). The sync event is used when you want the user
to respond before the simulation can continue, such as a for the
"panic=ask" behavior.
- in wxmain.cc, move the updates to the Start,Stop,Pause,Resume menu
items into a separate method simStatusChanged(). This makes the code that
does important stuff more readable.
- remove wxMutexGuiEnter()/Leave() from MyFrame::OnSim2CuiEvent().
This method is an event handler called in the gui thread, so it
already has the gui lock. This call caused thread lock on my linux
box.
2002-08-27 22:11:13 +04:00
|
|
|
// continue, quit, etc. and sends the answer back to the simulator.
|
|
|
|
// This event also uses BxLogMsgEvent.
|
|
|
|
|
2002-04-18 04:22:20 +04:00
|
|
|
// Event type: BX_EVT_TOOLBAR
|
- I've added lots of comments in siminterface.h, and tried to clean up
the terminology a bit. In particular, the term "gui" has started
to mean different things in different contexts, so I've defined
some more specific names for the parts of the user interface, and
updated comments and some variable names to reflect it. See
siminterface.h for a more complete description of all of these.
VGAW: VGA display window and toolbar buttons, the traditional Bochs
display which is ported to X, win32, MacOS X, etc. Implemented
in gui/gui.* and platform dependent gui/*.cc files.
CI: configuration interface that lets the user change settings such
as floppy disk image, ne2k settings, log options. The CI consists
of two parts: configuration user interface (CUI) which does the
actual rendering to the screen and handles key/mouse/menu events,
and the siminterface object.
CUI: configuration user interface. This handles the user interactions
that allow the user to configure Bochs. To actually change any
values it talks to the siminterface object. One implementation of
the CUI is the text-mode menus in gui/control.cc. Another
implementation is (will be) the wxWindows menus and dialogs in
gui/wxmain.cc.
siminterface: the glue between the CUI and the simulation code,
accessible throughout the code by the global variable
bx_simulator_interface_c *SIM;
Among other things, siminterface methods allow the simulator to ask the
CUI to display things or ask for user input, and allows the CUI
to query and modify variables in the simulation code.
GUI: Literally, "graphical user interface". Until the configuration menus
and wxWindows came along, everyone understood that "gui" referred to the
VGA display window and the toolbar buttons because that's all there
was. Now that we have the wxWindows code, which implements both the VGAW
and the CUI, while all other platforms implement only the VGAW, it's not
so clear. So, I'm trying to use VGAW, CI, and CUI consistently since
they are more specific.
control panel: This has been used as another name for the configuration
interface. "control panel" is also somewhat unspecific and it sounds
like it would be graphical with buttons and sliders, but our text-mode
thing is not graphical at all. I've replaced "control panel" with
"configuration interface" wherever I could find it. In configure script,
the --disable-control-panel option is still supported, but it politely
suggests that you use --disable-config-interface instead.
- clean up comments in siminterface,wx* code
- add comments and examples for bx_param_* and BxEvents
- remove some obsolete stuff: notify_*_args,
bx_simulator_interface_c::[sg]et_enabled() methods
- in siminterface.cc, move a few bx_real_sim_c methods to where they belong,
with the rest of the methods. No changes to the actual methods.
- remove some DOS ^M's which crept in and confused my editor.
2002-08-26 19:31:23 +04:00
|
|
|
// Asynchronous event from the VGAW to the simulator, sent when the user
|
2002-04-18 04:22:20 +04:00
|
|
|
// clicks on a toolbar button. This may one day become something more
|
|
|
|
// general, like a command event, but at the moment it's only needed for
|
|
|
|
// the toolbar events.
|
|
|
|
typedef struct {
|
|
|
|
bx_toolbar_buttons button;
|
|
|
|
bool on; // for toggling buttons, on=true means the toolbar button is
|
|
|
|
// pressed. on=false means it is not pressed.
|
|
|
|
} BxToolbarEvent;
|
|
|
|
|
|
|
|
// The BxEvent structure should be used for all events. Every event has
|
|
|
|
// a type and a spot for a return code (only used for synchronous events).
|
|
|
|
typedef struct {
|
|
|
|
BxEventType type; // what kind is this?
|
|
|
|
Bit32s retcode; // sucess or failure. only used for synchronous events.
|
|
|
|
union {
|
|
|
|
BxKeyEvent key;
|
|
|
|
BxMouseEvent mouse;
|
|
|
|
BxParamEvent param;
|
|
|
|
BxLogMsgEvent logmsg;
|
|
|
|
BxToolbarEvent toolbar;
|
|
|
|
} u;
|
|
|
|
} BxEvent;
|
|
|
|
|
2001-06-16 03:52:34 +04:00
|
|
|
|
2001-06-16 23:29:59 +04:00
|
|
|
////////////////////////////////////////////////////////////////////
|
- I've added lots of comments in siminterface.h, and tried to clean up
the terminology a bit. In particular, the term "gui" has started
to mean different things in different contexts, so I've defined
some more specific names for the parts of the user interface, and
updated comments and some variable names to reflect it. See
siminterface.h for a more complete description of all of these.
VGAW: VGA display window and toolbar buttons, the traditional Bochs
display which is ported to X, win32, MacOS X, etc. Implemented
in gui/gui.* and platform dependent gui/*.cc files.
CI: configuration interface that lets the user change settings such
as floppy disk image, ne2k settings, log options. The CI consists
of two parts: configuration user interface (CUI) which does the
actual rendering to the screen and handles key/mouse/menu events,
and the siminterface object.
CUI: configuration user interface. This handles the user interactions
that allow the user to configure Bochs. To actually change any
values it talks to the siminterface object. One implementation of
the CUI is the text-mode menus in gui/control.cc. Another
implementation is (will be) the wxWindows menus and dialogs in
gui/wxmain.cc.
siminterface: the glue between the CUI and the simulation code,
accessible throughout the code by the global variable
bx_simulator_interface_c *SIM;
Among other things, siminterface methods allow the simulator to ask the
CUI to display things or ask for user input, and allows the CUI
to query and modify variables in the simulation code.
GUI: Literally, "graphical user interface". Until the configuration menus
and wxWindows came along, everyone understood that "gui" referred to the
VGA display window and the toolbar buttons because that's all there
was. Now that we have the wxWindows code, which implements both the VGAW
and the CUI, while all other platforms implement only the VGAW, it's not
so clear. So, I'm trying to use VGAW, CI, and CUI consistently since
they are more specific.
control panel: This has been used as another name for the configuration
interface. "control panel" is also somewhat unspecific and it sounds
like it would be graphical with buttons and sliders, but our text-mode
thing is not graphical at all. I've replaced "control panel" with
"configuration interface" wherever I could find it. In configure script,
the --disable-control-panel option is still supported, but it politely
suggests that you use --disable-config-interface instead.
- clean up comments in siminterface,wx* code
- add comments and examples for bx_param_* and BxEvents
- remove some obsolete stuff: notify_*_args,
bx_simulator_interface_c::[sg]et_enabled() methods
- in siminterface.cc, move a few bx_real_sim_c methods to where they belong,
with the rest of the methods. No changes to the actual methods.
- remove some DOS ^M's which crept in and confused my editor.
2002-08-26 19:31:23 +04:00
|
|
|
// parameter classes: bx_param_c and family
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// All variables that can be configured through the CI are declared as
|
|
|
|
// "parameters" or objects of type bx_param_*. There is a bx_param_*
|
|
|
|
// class for each type of data that the user would need to see and
|
|
|
|
// edit, e.g. integer, boolean, enum, string, filename, or list of
|
|
|
|
// other parameters. The purpose of the bx_param_* class, in addition
|
|
|
|
// to storing the parameter's value, is to hold the name, description,
|
|
|
|
// and constraints on the value. The bx_param_* class should hold
|
2002-08-29 18:59:37 +04:00
|
|
|
// everything that the CI would need to display the value and allow
|
- I've added lots of comments in siminterface.h, and tried to clean up
the terminology a bit. In particular, the term "gui" has started
to mean different things in different contexts, so I've defined
some more specific names for the parts of the user interface, and
updated comments and some variable names to reflect it. See
siminterface.h for a more complete description of all of these.
VGAW: VGA display window and toolbar buttons, the traditional Bochs
display which is ported to X, win32, MacOS X, etc. Implemented
in gui/gui.* and platform dependent gui/*.cc files.
CI: configuration interface that lets the user change settings such
as floppy disk image, ne2k settings, log options. The CI consists
of two parts: configuration user interface (CUI) which does the
actual rendering to the screen and handles key/mouse/menu events,
and the siminterface object.
CUI: configuration user interface. This handles the user interactions
that allow the user to configure Bochs. To actually change any
values it talks to the siminterface object. One implementation of
the CUI is the text-mode menus in gui/control.cc. Another
implementation is (will be) the wxWindows menus and dialogs in
gui/wxmain.cc.
siminterface: the glue between the CUI and the simulation code,
accessible throughout the code by the global variable
bx_simulator_interface_c *SIM;
Among other things, siminterface methods allow the simulator to ask the
CUI to display things or ask for user input, and allows the CUI
to query and modify variables in the simulation code.
GUI: Literally, "graphical user interface". Until the configuration menus
and wxWindows came along, everyone understood that "gui" referred to the
VGA display window and the toolbar buttons because that's all there
was. Now that we have the wxWindows code, which implements both the VGAW
and the CUI, while all other platforms implement only the VGAW, it's not
so clear. So, I'm trying to use VGAW, CI, and CUI consistently since
they are more specific.
control panel: This has been used as another name for the configuration
interface. "control panel" is also somewhat unspecific and it sounds
like it would be graphical with buttons and sliders, but our text-mode
thing is not graphical at all. I've replaced "control panel" with
"configuration interface" wherever I could find it. In configure script,
the --disable-control-panel option is still supported, but it politely
suggests that you use --disable-config-interface instead.
- clean up comments in siminterface,wx* code
- add comments and examples for bx_param_* and BxEvents
- remove some obsolete stuff: notify_*_args,
bx_simulator_interface_c::[sg]et_enabled() methods
- in siminterface.cc, move a few bx_real_sim_c methods to where they belong,
with the rest of the methods. No changes to the actual methods.
- remove some DOS ^M's which crept in and confused my editor.
2002-08-26 19:31:23 +04:00
|
|
|
// the user to modify it. For integer parameters, the minimum and
|
|
|
|
// maximum allowed value can be defined, and the base in which it
|
|
|
|
// should be displayed and interpreted. For enums, the
|
|
|
|
// bx_param_enum_c structure includes the list of values which the
|
|
|
|
// parameter can have.
|
|
|
|
//
|
|
|
|
// Also, some parameter classes support get/set callback functions to
|
|
|
|
// allow arbitrary code to be executed when the parameter is get/set.
|
|
|
|
// An example of where this is useful: if you disable the NE2K card,
|
|
|
|
// the set() handler for that parameter can tell the user interface
|
|
|
|
// that the NE2K's irq, I/O address, and mac address should be
|
|
|
|
// disabled (greyed out, hidden, or made inaccessible). The get/set
|
|
|
|
// methods can also check if the set() value is acceptable using
|
|
|
|
// whatever means and override it.
|
|
|
|
//
|
|
|
|
// The parameter concept is similar to the use of parameters in JavaBeans.
|
|
|
|
|
2001-06-16 03:52:34 +04:00
|
|
|
class bx_object_c {
|
|
|
|
private:
|
|
|
|
bx_id id;
|
2002-04-18 04:22:20 +04:00
|
|
|
bx_objtype type;
|
2001-06-16 03:52:34 +04:00
|
|
|
protected:
|
2002-04-18 04:22:20 +04:00
|
|
|
void set_type (bx_objtype type);
|
2001-06-16 03:52:34 +04:00
|
|
|
public:
|
|
|
|
bx_object_c (bx_id id);
|
|
|
|
bx_id get_id () { return id; }
|
|
|
|
Bit8u get_type () { return type; }
|
|
|
|
};
|
|
|
|
|
|
|
|
class bx_param_c : public bx_object_c {
|
2001-06-21 18:37:55 +04:00
|
|
|
protected:
|
2001-06-16 03:52:34 +04:00
|
|
|
char *name;
|
|
|
|
char *description;
|
2001-06-18 18:11:55 +04:00
|
|
|
char *text_format; // printf format string. %d for ints, %s for strings, etc.
|
|
|
|
char *ask_format; // format string for asking for a new value
|
|
|
|
int runtime_param;
|
2001-06-21 18:37:55 +04:00
|
|
|
int enabled;
|
2001-06-16 03:52:34 +04:00
|
|
|
public:
|
2002-04-18 04:22:20 +04:00
|
|
|
bx_param_c (bx_id id, char *name, char *description);
|
2001-06-18 18:11:55 +04:00
|
|
|
void set_format (char *format) {text_format = format;}
|
|
|
|
char *get_format () {return text_format;}
|
|
|
|
void set_ask_format (char *format) {ask_format = format; }
|
|
|
|
char *get_ask_format () {return ask_format;}
|
|
|
|
void set_runtime_param (int val) { runtime_param = val; }
|
2001-06-16 03:52:34 +04:00
|
|
|
char *get_name () { return name; }
|
|
|
|
char *get_description () { return description; }
|
2001-06-21 18:37:55 +04:00
|
|
|
int get_enabled () { return enabled; }
|
|
|
|
void set_enabled (int enabled) { this->enabled = enabled; }
|
2001-06-16 03:52:34 +04:00
|
|
|
void reset () {}
|
2001-06-16 23:29:59 +04:00
|
|
|
int getint () {return -1;}
|
2001-06-18 18:11:55 +04:00
|
|
|
#if BX_UI_TEXT
|
|
|
|
virtual void text_print (FILE *fp) {}
|
2001-06-22 17:37:08 +04:00
|
|
|
virtual int text_ask (FILE *fpin, FILE *fpout) {return -1;}
|
2001-06-18 18:11:55 +04:00
|
|
|
#endif
|
2001-06-16 23:29:59 +04:00
|
|
|
};
|
|
|
|
|
2001-06-17 03:08:32 +04:00
|
|
|
typedef Bit32s (*param_event_handler)(class bx_param_c *, int set, Bit32s val);
|
2001-06-16 03:52:34 +04:00
|
|
|
|
|
|
|
class bx_param_num_c : public bx_param_c {
|
2001-06-20 18:01:39 +04:00
|
|
|
protected:
|
2001-06-16 03:52:34 +04:00
|
|
|
Bit32s min, max, val, initial_val;
|
2001-06-17 03:08:32 +04:00
|
|
|
param_event_handler handler;
|
2001-06-18 18:11:55 +04:00
|
|
|
int base;
|
2001-06-16 03:52:34 +04:00
|
|
|
public:
|
|
|
|
bx_param_num_c (bx_id id,
|
|
|
|
char *name,
|
|
|
|
char *description,
|
|
|
|
Bit32s min, Bit32s max, Bit32s initial_val);
|
|
|
|
void reset ();
|
2001-06-21 18:37:55 +04:00
|
|
|
void set_handler (param_event_handler handler);
|
2001-06-16 03:52:34 +04:00
|
|
|
Bit32s get ();
|
2001-06-16 23:29:59 +04:00
|
|
|
void set (Bit32s val);
|
2001-06-18 18:11:55 +04:00
|
|
|
void set_base (int base) { this->base = base; }
|
2002-04-18 04:22:20 +04:00
|
|
|
int get_base () { return base; }
|
|
|
|
Bit32s get_min () { return min; }
|
|
|
|
Bit32s get_max () { return max; }
|
2001-06-18 18:11:55 +04:00
|
|
|
#if BX_UI_TEXT
|
|
|
|
virtual void text_print (FILE *fp);
|
|
|
|
virtual int text_ask (FILE *fpin, FILE *fpout);
|
|
|
|
#endif
|
2001-06-16 23:29:59 +04:00
|
|
|
};
|
|
|
|
|
2001-06-20 18:01:39 +04:00
|
|
|
class bx_param_bool_c : public bx_param_num_c {
|
|
|
|
public:
|
|
|
|
bx_param_bool_c (bx_id id,
|
|
|
|
char *name,
|
|
|
|
char *description,
|
|
|
|
Bit32s initial_val);
|
|
|
|
#if BX_UI_TEXT
|
|
|
|
virtual void text_print (FILE *fp);
|
|
|
|
virtual int text_ask (FILE *fpin, FILE *fpout);
|
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
|
|
|
class bx_param_enum_c : public bx_param_num_c {
|
|
|
|
char **choices;
|
|
|
|
public:
|
|
|
|
bx_param_enum_c (bx_id id,
|
|
|
|
char *name,
|
|
|
|
char *description,
|
|
|
|
char **choices,
|
|
|
|
Bit32s initial_val,
|
|
|
|
Bit32s value_base = 0);
|
2002-04-18 04:22:20 +04:00
|
|
|
char *get_choice (int n) { return choices[n]; }
|
2001-06-20 18:01:39 +04:00
|
|
|
#if BX_UI_TEXT
|
2001-06-21 18:37:55 +04:00
|
|
|
virtual void text_print (FILE *fp);
|
|
|
|
virtual int text_ask (FILE *fpin, FILE *fpout);
|
2001-06-20 18:01:39 +04:00
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
2001-06-21 18:37:55 +04:00
|
|
|
typedef char* (*param_string_event_handler)(class bx_param_string_c *, int set, char *val, int maxlen);
|
2001-06-16 23:29:59 +04:00
|
|
|
|
|
|
|
class bx_param_string_c : public bx_param_c {
|
|
|
|
int maxsize;
|
|
|
|
char *val, *initial_val;
|
|
|
|
param_string_event_handler handler;
|
2001-06-21 23:27:05 +04:00
|
|
|
bx_param_num_c *options;
|
|
|
|
char separator;
|
2001-06-16 23:29:59 +04:00
|
|
|
public:
|
2001-06-21 23:27:05 +04:00
|
|
|
enum {
|
- I've added lots of comments in siminterface.h, and tried to clean up
the terminology a bit. In particular, the term "gui" has started
to mean different things in different contexts, so I've defined
some more specific names for the parts of the user interface, and
updated comments and some variable names to reflect it. See
siminterface.h for a more complete description of all of these.
VGAW: VGA display window and toolbar buttons, the traditional Bochs
display which is ported to X, win32, MacOS X, etc. Implemented
in gui/gui.* and platform dependent gui/*.cc files.
CI: configuration interface that lets the user change settings such
as floppy disk image, ne2k settings, log options. The CI consists
of two parts: configuration user interface (CUI) which does the
actual rendering to the screen and handles key/mouse/menu events,
and the siminterface object.
CUI: configuration user interface. This handles the user interactions
that allow the user to configure Bochs. To actually change any
values it talks to the siminterface object. One implementation of
the CUI is the text-mode menus in gui/control.cc. Another
implementation is (will be) the wxWindows menus and dialogs in
gui/wxmain.cc.
siminterface: the glue between the CUI and the simulation code,
accessible throughout the code by the global variable
bx_simulator_interface_c *SIM;
Among other things, siminterface methods allow the simulator to ask the
CUI to display things or ask for user input, and allows the CUI
to query and modify variables in the simulation code.
GUI: Literally, "graphical user interface". Until the configuration menus
and wxWindows came along, everyone understood that "gui" referred to the
VGA display window and the toolbar buttons because that's all there
was. Now that we have the wxWindows code, which implements both the VGAW
and the CUI, while all other platforms implement only the VGAW, it's not
so clear. So, I'm trying to use VGAW, CI, and CUI consistently since
they are more specific.
control panel: This has been used as another name for the configuration
interface. "control panel" is also somewhat unspecific and it sounds
like it would be graphical with buttons and sliders, but our text-mode
thing is not graphical at all. I've replaced "control panel" with
"configuration interface" wherever I could find it. In configure script,
the --disable-control-panel option is still supported, but it politely
suggests that you use --disable-config-interface instead.
- clean up comments in siminterface,wx* code
- add comments and examples for bx_param_* and BxEvents
- remove some obsolete stuff: notify_*_args,
bx_simulator_interface_c::[sg]et_enabled() methods
- in siminterface.cc, move a few bx_real_sim_c methods to where they belong,
with the rest of the methods. No changes to the actual methods.
- remove some DOS ^M's which crept in and confused my editor.
2002-08-26 19:31:23 +04:00
|
|
|
BX_RAW_BYTES = 1, // use binary text editor, like MAC addr
|
|
|
|
BX_IS_FILENAME = 2, // 1=yes it's a filename, 0=not a filename.
|
|
|
|
// Some guis have a file browser. This
|
|
|
|
// bit suggests that they use it.
|
2002-07-04 23:24:30 +04:00
|
|
|
BX_SAVE_FILE_DIALOG = 4 // Use save dialog opposed to open file dialog
|
2001-06-21 23:27:05 +04:00
|
|
|
} bx_string_opt_bits;
|
2001-06-16 23:29:59 +04:00
|
|
|
bx_param_string_c (bx_id id,
|
|
|
|
char *name,
|
|
|
|
char *description,
|
2001-06-18 18:11:55 +04:00
|
|
|
char *initial_val,
|
|
|
|
int maxsize=-1);
|
2001-12-22 23:58:25 +03:00
|
|
|
virtual ~bx_param_string_c ();
|
2001-06-16 23:29:59 +04:00
|
|
|
void reset ();
|
2001-06-21 18:37:55 +04:00
|
|
|
void set_handler (param_string_event_handler handler);
|
2001-06-16 23:29:59 +04:00
|
|
|
Bit32s get (char *buf, int len);
|
|
|
|
char *getptr () {return val; }
|
|
|
|
void set (char *buf);
|
2001-06-21 23:27:05 +04:00
|
|
|
bx_param_num_c *get_options () { return options; }
|
|
|
|
void set_separator (char sep) {separator = sep; }
|
2001-06-18 18:11:55 +04:00
|
|
|
#if BX_UI_TEXT
|
|
|
|
virtual void text_print (FILE *fp);
|
|
|
|
virtual int text_ask (FILE *fpin, FILE *fpout);
|
|
|
|
#endif
|
2001-06-16 03:52:34 +04:00
|
|
|
};
|
|
|
|
|
- I've added lots of comments in siminterface.h, and tried to clean up
the terminology a bit. In particular, the term "gui" has started
to mean different things in different contexts, so I've defined
some more specific names for the parts of the user interface, and
updated comments and some variable names to reflect it. See
siminterface.h for a more complete description of all of these.
VGAW: VGA display window and toolbar buttons, the traditional Bochs
display which is ported to X, win32, MacOS X, etc. Implemented
in gui/gui.* and platform dependent gui/*.cc files.
CI: configuration interface that lets the user change settings such
as floppy disk image, ne2k settings, log options. The CI consists
of two parts: configuration user interface (CUI) which does the
actual rendering to the screen and handles key/mouse/menu events,
and the siminterface object.
CUI: configuration user interface. This handles the user interactions
that allow the user to configure Bochs. To actually change any
values it talks to the siminterface object. One implementation of
the CUI is the text-mode menus in gui/control.cc. Another
implementation is (will be) the wxWindows menus and dialogs in
gui/wxmain.cc.
siminterface: the glue between the CUI and the simulation code,
accessible throughout the code by the global variable
bx_simulator_interface_c *SIM;
Among other things, siminterface methods allow the simulator to ask the
CUI to display things or ask for user input, and allows the CUI
to query and modify variables in the simulation code.
GUI: Literally, "graphical user interface". Until the configuration menus
and wxWindows came along, everyone understood that "gui" referred to the
VGA display window and the toolbar buttons because that's all there
was. Now that we have the wxWindows code, which implements both the VGAW
and the CUI, while all other platforms implement only the VGAW, it's not
so clear. So, I'm trying to use VGAW, CI, and CUI consistently since
they are more specific.
control panel: This has been used as another name for the configuration
interface. "control panel" is also somewhat unspecific and it sounds
like it would be graphical with buttons and sliders, but our text-mode
thing is not graphical at all. I've replaced "control panel" with
"configuration interface" wherever I could find it. In configure script,
the --disable-control-panel option is still supported, but it politely
suggests that you use --disable-config-interface instead.
- clean up comments in siminterface,wx* code
- add comments and examples for bx_param_* and BxEvents
- remove some obsolete stuff: notify_*_args,
bx_simulator_interface_c::[sg]et_enabled() methods
- in siminterface.cc, move a few bx_real_sim_c methods to where they belong,
with the rest of the methods. No changes to the actual methods.
- remove some DOS ^M's which crept in and confused my editor.
2002-08-26 19:31:23 +04:00
|
|
|
// Declare a filename class. It is identical to a string, except that
|
2002-04-18 04:22:20 +04:00
|
|
|
// it initializes the options differently. This is just a shortcut
|
|
|
|
// for declaring a string param and setting the options with BX_IS_FILENAME.
|
- I've added lots of comments in siminterface.h, and tried to clean up
the terminology a bit. In particular, the term "gui" has started
to mean different things in different contexts, so I've defined
some more specific names for the parts of the user interface, and
updated comments and some variable names to reflect it. See
siminterface.h for a more complete description of all of these.
VGAW: VGA display window and toolbar buttons, the traditional Bochs
display which is ported to X, win32, MacOS X, etc. Implemented
in gui/gui.* and platform dependent gui/*.cc files.
CI: configuration interface that lets the user change settings such
as floppy disk image, ne2k settings, log options. The CI consists
of two parts: configuration user interface (CUI) which does the
actual rendering to the screen and handles key/mouse/menu events,
and the siminterface object.
CUI: configuration user interface. This handles the user interactions
that allow the user to configure Bochs. To actually change any
values it talks to the siminterface object. One implementation of
the CUI is the text-mode menus in gui/control.cc. Another
implementation is (will be) the wxWindows menus and dialogs in
gui/wxmain.cc.
siminterface: the glue between the CUI and the simulation code,
accessible throughout the code by the global variable
bx_simulator_interface_c *SIM;
Among other things, siminterface methods allow the simulator to ask the
CUI to display things or ask for user input, and allows the CUI
to query and modify variables in the simulation code.
GUI: Literally, "graphical user interface". Until the configuration menus
and wxWindows came along, everyone understood that "gui" referred to the
VGA display window and the toolbar buttons because that's all there
was. Now that we have the wxWindows code, which implements both the VGAW
and the CUI, while all other platforms implement only the VGAW, it's not
so clear. So, I'm trying to use VGAW, CI, and CUI consistently since
they are more specific.
control panel: This has been used as another name for the configuration
interface. "control panel" is also somewhat unspecific and it sounds
like it would be graphical with buttons and sliders, but our text-mode
thing is not graphical at all. I've replaced "control panel" with
"configuration interface" wherever I could find it. In configure script,
the --disable-control-panel option is still supported, but it politely
suggests that you use --disable-config-interface instead.
- clean up comments in siminterface,wx* code
- add comments and examples for bx_param_* and BxEvents
- remove some obsolete stuff: notify_*_args,
bx_simulator_interface_c::[sg]et_enabled() methods
- in siminterface.cc, move a few bx_real_sim_c methods to where they belong,
with the rest of the methods. No changes to the actual methods.
- remove some DOS ^M's which crept in and confused my editor.
2002-08-26 19:31:23 +04:00
|
|
|
class bx_param_filename_c : public bx_param_string_c {
|
2002-04-18 04:22:20 +04:00
|
|
|
public:
|
|
|
|
bx_param_filename_c (bx_id id,
|
|
|
|
char *name,
|
|
|
|
char *description,
|
|
|
|
char *initial_val,
|
|
|
|
int maxsize=-1);
|
|
|
|
};
|
|
|
|
|
2001-06-18 18:11:55 +04:00
|
|
|
class bx_list_c : public bx_param_c {
|
2001-06-16 03:52:34 +04:00
|
|
|
private:
|
2001-06-18 18:11:55 +04:00
|
|
|
// just a list of bx_param_c objects. size tells current number of
|
|
|
|
// objects in the list, and maxsize tells how many list items are
|
|
|
|
// allocated in the constructor.
|
|
|
|
bx_param_c **list;
|
|
|
|
int size, maxsize;
|
|
|
|
// options is a bit field whose bits are defined by bx_listopt_bits ORed
|
|
|
|
// together. Options is a bx_param so that if necessary the bx_list could
|
|
|
|
// install a handler to cause get/set of options to have side effects.
|
|
|
|
bx_param_num_c *options;
|
|
|
|
// for a menu, the value of choice before the call to "ask" is default.
|
|
|
|
// After ask, choice holds the value that the user chose. Choice defaults
|
|
|
|
// to 1 in the constructor.
|
|
|
|
bx_param_num_c *choice;
|
|
|
|
// title of the menu or series
|
|
|
|
bx_param_string_c *title;
|
|
|
|
// if the menu shows a "return to previous menu" type of choice,
|
|
|
|
// this controls where that choice will go.
|
|
|
|
bx_param_c *parent;
|
|
|
|
void init ();
|
2001-06-16 03:52:34 +04:00
|
|
|
public:
|
2001-06-18 18:11:55 +04:00
|
|
|
enum {
|
|
|
|
// When a bx_list_c is displayed as a menu, SHOW_PARENT controls whether or
|
- I've added lots of comments in siminterface.h, and tried to clean up
the terminology a bit. In particular, the term "gui" has started
to mean different things in different contexts, so I've defined
some more specific names for the parts of the user interface, and
updated comments and some variable names to reflect it. See
siminterface.h for a more complete description of all of these.
VGAW: VGA display window and toolbar buttons, the traditional Bochs
display which is ported to X, win32, MacOS X, etc. Implemented
in gui/gui.* and platform dependent gui/*.cc files.
CI: configuration interface that lets the user change settings such
as floppy disk image, ne2k settings, log options. The CI consists
of two parts: configuration user interface (CUI) which does the
actual rendering to the screen and handles key/mouse/menu events,
and the siminterface object.
CUI: configuration user interface. This handles the user interactions
that allow the user to configure Bochs. To actually change any
values it talks to the siminterface object. One implementation of
the CUI is the text-mode menus in gui/control.cc. Another
implementation is (will be) the wxWindows menus and dialogs in
gui/wxmain.cc.
siminterface: the glue between the CUI and the simulation code,
accessible throughout the code by the global variable
bx_simulator_interface_c *SIM;
Among other things, siminterface methods allow the simulator to ask the
CUI to display things or ask for user input, and allows the CUI
to query and modify variables in the simulation code.
GUI: Literally, "graphical user interface". Until the configuration menus
and wxWindows came along, everyone understood that "gui" referred to the
VGA display window and the toolbar buttons because that's all there
was. Now that we have the wxWindows code, which implements both the VGAW
and the CUI, while all other platforms implement only the VGAW, it's not
so clear. So, I'm trying to use VGAW, CI, and CUI consistently since
they are more specific.
control panel: This has been used as another name for the configuration
interface. "control panel" is also somewhat unspecific and it sounds
like it would be graphical with buttons and sliders, but our text-mode
thing is not graphical at all. I've replaced "control panel" with
"configuration interface" wherever I could find it. In configure script,
the --disable-control-panel option is still supported, but it politely
suggests that you use --disable-config-interface instead.
- clean up comments in siminterface,wx* code
- add comments and examples for bx_param_* and BxEvents
- remove some obsolete stuff: notify_*_args,
bx_simulator_interface_c::[sg]et_enabled() methods
- in siminterface.cc, move a few bx_real_sim_c methods to where they belong,
with the rest of the methods. No changes to the actual methods.
- remove some DOS ^M's which crept in and confused my editor.
2002-08-26 19:31:23 +04:00
|
|
|
// not the menu shows a "Return to parent menu" choice or not.
|
2001-06-18 18:11:55 +04:00
|
|
|
BX_SHOW_PARENT = (1<<0),
|
|
|
|
// Some lists are best displayed shown as menus, others as a series of
|
2002-08-29 18:59:37 +04:00
|
|
|
// related questions. This bit suggests to the CI that the
|
- I've added lots of comments in siminterface.h, and tried to clean up
the terminology a bit. In particular, the term "gui" has started
to mean different things in different contexts, so I've defined
some more specific names for the parts of the user interface, and
updated comments and some variable names to reflect it. See
siminterface.h for a more complete description of all of these.
VGAW: VGA display window and toolbar buttons, the traditional Bochs
display which is ported to X, win32, MacOS X, etc. Implemented
in gui/gui.* and platform dependent gui/*.cc files.
CI: configuration interface that lets the user change settings such
as floppy disk image, ne2k settings, log options. The CI consists
of two parts: configuration user interface (CUI) which does the
actual rendering to the screen and handles key/mouse/menu events,
and the siminterface object.
CUI: configuration user interface. This handles the user interactions
that allow the user to configure Bochs. To actually change any
values it talks to the siminterface object. One implementation of
the CUI is the text-mode menus in gui/control.cc. Another
implementation is (will be) the wxWindows menus and dialogs in
gui/wxmain.cc.
siminterface: the glue between the CUI and the simulation code,
accessible throughout the code by the global variable
bx_simulator_interface_c *SIM;
Among other things, siminterface methods allow the simulator to ask the
CUI to display things or ask for user input, and allows the CUI
to query and modify variables in the simulation code.
GUI: Literally, "graphical user interface". Until the configuration menus
and wxWindows came along, everyone understood that "gui" referred to the
VGA display window and the toolbar buttons because that's all there
was. Now that we have the wxWindows code, which implements both the VGAW
and the CUI, while all other platforms implement only the VGAW, it's not
so clear. So, I'm trying to use VGAW, CI, and CUI consistently since
they are more specific.
control panel: This has been used as another name for the configuration
interface. "control panel" is also somewhat unspecific and it sounds
like it would be graphical with buttons and sliders, but our text-mode
thing is not graphical at all. I've replaced "control panel" with
"configuration interface" wherever I could find it. In configure script,
the --disable-control-panel option is still supported, but it politely
suggests that you use --disable-config-interface instead.
- clean up comments in siminterface,wx* code
- add comments and examples for bx_param_* and BxEvents
- remove some obsolete stuff: notify_*_args,
bx_simulator_interface_c::[sg]et_enabled() methods
- in siminterface.cc, move a few bx_real_sim_c methods to where they belong,
with the rest of the methods. No changes to the actual methods.
- remove some DOS ^M's which crept in and confused my editor.
2002-08-26 19:31:23 +04:00
|
|
|
// series of questions format is preferred.
|
2001-06-18 18:11:55 +04:00
|
|
|
BX_SERIES_ASK = (1<<1)
|
|
|
|
} bx_listopt_bits;
|
2001-06-21 18:37:55 +04:00
|
|
|
//bx_list_c (bx_id id, int maxsize);
|
|
|
|
bx_list_c (bx_id id, char *name, char *description, bx_param_c **init_list);
|
2001-12-22 23:58:25 +03:00
|
|
|
virtual ~bx_list_c();
|
2001-06-18 18:11:55 +04:00
|
|
|
void add (bx_param_c *param);
|
|
|
|
bx_param_c *get (int index);
|
|
|
|
bx_param_num_c *get_options () { return options; }
|
|
|
|
bx_param_num_c *get_choice () { return choice; }
|
|
|
|
bx_param_string_c *get_title () { return title; }
|
|
|
|
void set_parent (bx_param_c *parent);
|
|
|
|
#if BX_UI_TEXT
|
|
|
|
virtual void text_print (FILE *);
|
|
|
|
virtual int text_ask (FILE *fpin, FILE *fpout);
|
|
|
|
#endif
|
2001-06-16 03:52:34 +04:00
|
|
|
};
|
2001-06-18 18:11:55 +04:00
|
|
|
|
2001-06-20 18:01:39 +04:00
|
|
|
////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
#define BX_FLOPPY_NONE 10 // floppy not present
|
|
|
|
#define BX_FLOPPY_1_2 11 // 1.2M 5.25"
|
|
|
|
#define BX_FLOPPY_1_44 12 // 1.44M 3.5"
|
|
|
|
#define BX_FLOPPY_2_88 13 // 2.88M 3.5"
|
|
|
|
#define BX_FLOPPY_720K 14 // 720K 3.5"
|
2002-08-01 11:37:56 +04:00
|
|
|
#define BX_FLOPPY_360K 15 // 360K 5.25"
|
|
|
|
#define BX_FLOPPY_LAST 15 // last legal value of floppy type
|
2001-06-20 18:01:39 +04:00
|
|
|
#define BX_FLOPPY_GUESS 20 // decide based on image size
|
|
|
|
|
|
|
|
extern char *floppy_type_names[];
|
2002-08-30 00:13:05 +04:00
|
|
|
extern int floppy_type_n_sectors[];
|
2001-06-20 18:01:39 +04:00
|
|
|
extern int n_floppy_type_names;
|
|
|
|
extern char *floppy_status_names[];
|
|
|
|
extern int n_floppy_status_names;
|
2001-06-21 18:37:55 +04:00
|
|
|
extern char *floppy_bootdisk_names[];
|
|
|
|
extern int n_floppy_bootdisk_names;
|
2001-06-21 23:57:21 +04:00
|
|
|
extern char *loader_os_names[];
|
|
|
|
extern int n_loader_os_names;
|
2001-12-12 13:38:39 +03:00
|
|
|
extern char *keyboard_type_names[];
|
|
|
|
extern int n_keyboard_type_names;
|
2001-06-20 18:01:39 +04:00
|
|
|
|
|
|
|
typedef struct {
|
2002-08-04 12:42:34 +04:00
|
|
|
bx_param_enum_c *Odevtype;
|
2001-06-20 18:01:39 +04:00
|
|
|
bx_param_string_c *Opath;
|
|
|
|
bx_param_enum_c *Otype;
|
2002-08-04 12:42:34 +04:00
|
|
|
bx_param_enum_c *Ostatus;
|
2001-06-20 18:01:39 +04:00
|
|
|
} bx_floppy_options;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
bx_param_bool_c *Opresent;
|
|
|
|
bx_param_string_c *Opath;
|
|
|
|
bx_param_num_c *Ocylinders;
|
|
|
|
bx_param_num_c *Oheads;
|
|
|
|
bx_param_num_c *Ospt;
|
|
|
|
} bx_disk_options;
|
|
|
|
|
2002-03-03 09:03:29 +03:00
|
|
|
typedef struct {
|
2002-08-24 21:11:33 +04:00
|
|
|
bx_param_bool_c *Oenabled;
|
2002-03-03 09:03:29 +03:00
|
|
|
bx_param_string_c *Odev;
|
|
|
|
} bx_serial_options;
|
|
|
|
|
2001-06-20 18:01:39 +04:00
|
|
|
struct bx_cdrom_options
|
|
|
|
{
|
|
|
|
bx_param_bool_c *Opresent;
|
|
|
|
bx_param_string_c *Opath;
|
2002-08-04 12:42:34 +04:00
|
|
|
bx_param_enum_c *Ostatus;
|
2001-06-20 18:01:39 +04:00
|
|
|
};
|
|
|
|
|
2001-06-18 18:11:55 +04:00
|
|
|
|
2001-06-16 23:29:59 +04:00
|
|
|
////////////////////////////////////////////////////////////////////
|
- I've added lots of comments in siminterface.h, and tried to clean up
the terminology a bit. In particular, the term "gui" has started
to mean different things in different contexts, so I've defined
some more specific names for the parts of the user interface, and
updated comments and some variable names to reflect it. See
siminterface.h for a more complete description of all of these.
VGAW: VGA display window and toolbar buttons, the traditional Bochs
display which is ported to X, win32, MacOS X, etc. Implemented
in gui/gui.* and platform dependent gui/*.cc files.
CI: configuration interface that lets the user change settings such
as floppy disk image, ne2k settings, log options. The CI consists
of two parts: configuration user interface (CUI) which does the
actual rendering to the screen and handles key/mouse/menu events,
and the siminterface object.
CUI: configuration user interface. This handles the user interactions
that allow the user to configure Bochs. To actually change any
values it talks to the siminterface object. One implementation of
the CUI is the text-mode menus in gui/control.cc. Another
implementation is (will be) the wxWindows menus and dialogs in
gui/wxmain.cc.
siminterface: the glue between the CUI and the simulation code,
accessible throughout the code by the global variable
bx_simulator_interface_c *SIM;
Among other things, siminterface methods allow the simulator to ask the
CUI to display things or ask for user input, and allows the CUI
to query and modify variables in the simulation code.
GUI: Literally, "graphical user interface". Until the configuration menus
and wxWindows came along, everyone understood that "gui" referred to the
VGA display window and the toolbar buttons because that's all there
was. Now that we have the wxWindows code, which implements both the VGAW
and the CUI, while all other platforms implement only the VGAW, it's not
so clear. So, I'm trying to use VGAW, CI, and CUI consistently since
they are more specific.
control panel: This has been used as another name for the configuration
interface. "control panel" is also somewhat unspecific and it sounds
like it would be graphical with buttons and sliders, but our text-mode
thing is not graphical at all. I've replaced "control panel" with
"configuration interface" wherever I could find it. In configure script,
the --disable-control-panel option is still supported, but it politely
suggests that you use --disable-config-interface instead.
- clean up comments in siminterface,wx* code
- add comments and examples for bx_param_* and BxEvents
- remove some obsolete stuff: notify_*_args,
bx_simulator_interface_c::[sg]et_enabled() methods
- in siminterface.cc, move a few bx_real_sim_c methods to where they belong,
with the rest of the methods. No changes to the actual methods.
- remove some DOS ^M's which crept in and confused my editor.
2002-08-26 19:31:23 +04:00
|
|
|
// base class simulator interface, contains just virtual functions.
|
|
|
|
// I'm not longer sure that having a base class is going to be of any
|
|
|
|
// use... -Bryce
|
2001-06-10 00:01:12 +04:00
|
|
|
|
- use setjmp() and longjmp() to quit the simulation thread cleanly.
I use setjmp() to save the context just before calling
bx_continue_after_config_interface(). Then, in
bx_real_sim_c:quit_sim, I use longjmp() to jump back to that context.
This happens in main.cc and in gui/wxmain.cc (wxWindows only).
I haven't tested with the debugger yet. Possibly with debugger
the quit longjmp() should jump back to the debugger prompt loop
instead of actually quitting the program.
- clean up BX_ASYNC_EVT_LOG_MSG implementation by creating a different,
synchronous event called BX_SYNC_EVT_LOG_ASK. The async event
could be used to simply tell the CI that an event has occurred,
for example if the user wanted to view the events on screen
(not implemented). The sync event is used when you want the user
to respond before the simulation can continue, such as a for the
"panic=ask" behavior.
- in wxmain.cc, move the updates to the Start,Stop,Pause,Resume menu
items into a separate method simStatusChanged(). This makes the code that
does important stuff more readable.
- remove wxMutexGuiEnter()/Leave() from MyFrame::OnSim2CuiEvent().
This method is an event handler called in the gui thread, so it
already has the gui lock. This call caused thread lock on my linux
box.
2002-08-27 22:11:13 +04:00
|
|
|
#include <setjmp.h>
|
|
|
|
|
2001-06-08 11:20:07 +04:00
|
|
|
class bx_simulator_interface_c {
|
|
|
|
public:
|
|
|
|
bx_simulator_interface_c ();
|
- use setjmp() and longjmp() to quit the simulation thread cleanly.
I use setjmp() to save the context just before calling
bx_continue_after_config_interface(). Then, in
bx_real_sim_c:quit_sim, I use longjmp() to jump back to that context.
This happens in main.cc and in gui/wxmain.cc (wxWindows only).
I haven't tested with the debugger yet. Possibly with debugger
the quit longjmp() should jump back to the debugger prompt loop
instead of actually quitting the program.
- clean up BX_ASYNC_EVT_LOG_MSG implementation by creating a different,
synchronous event called BX_SYNC_EVT_LOG_ASK. The async event
could be used to simply tell the CI that an event has occurred,
for example if the user wanted to view the events on screen
(not implemented). The sync event is used when you want the user
to respond before the simulation can continue, such as a for the
"panic=ask" behavior.
- in wxmain.cc, move the updates to the Start,Stop,Pause,Resume menu
items into a separate method simStatusChanged(). This makes the code that
does important stuff more readable.
- remove wxMutexGuiEnter()/Leave() from MyFrame::OnSim2CuiEvent().
This method is an event handler called in the gui thread, so it
already has the gui lock. This call caused thread lock on my linux
box.
2002-08-27 22:11:13 +04:00
|
|
|
virtual void set_quit_context (jmp_buf *context) {}
|
2001-06-18 18:11:55 +04:00
|
|
|
virtual int get_init_done () { return -1; }
|
|
|
|
virtual int set_init_done (int n) {return -1;}
|
2002-04-18 04:22:20 +04:00
|
|
|
virtual void get_param_id_range (int *min, int *max) {}
|
2001-06-18 18:11:55 +04:00
|
|
|
virtual int register_param (bx_id id, bx_param_c *it) {return -1;}
|
2002-08-30 20:23:36 +04:00
|
|
|
virtual void reset_all_param () {}
|
2001-06-16 23:29:59 +04:00
|
|
|
virtual bx_param_c *get_param (bx_id id) {return NULL;}
|
|
|
|
virtual bx_param_num_c *get_param_num (bx_id id) {return NULL;}
|
2001-06-17 03:08:32 +04:00
|
|
|
virtual bx_param_string_c *get_param_string (bx_id id) {return NULL;}
|
2001-06-08 11:20:07 +04:00
|
|
|
virtual int get_n_log_modules () {return -1;}
|
|
|
|
virtual char *get_prefix (int mod) {return 0;}
|
|
|
|
virtual int get_log_action (int mod, int level) {return -1;}
|
|
|
|
virtual void set_log_action (int mod, int level, int action) {}
|
|
|
|
virtual char *get_action_name (int action) {return 0;}
|
2001-11-14 03:23:08 +03:00
|
|
|
virtual const char *get_log_level_name (int level) {return 0;}
|
2001-06-08 11:20:07 +04:00
|
|
|
virtual int get_max_log_level () {return -1;}
|
2002-04-18 04:22:20 +04:00
|
|
|
|
|
|
|
// exiting is somewhat complicated! The preferred way to exit bochs is
|
|
|
|
// to call BX_EXIT(exitcode). That is defined to call
|
|
|
|
// SIM->quit_sim(exitcode). The quit_sim function first calls
|
|
|
|
// the cleanup functions in bochs so that it can destroy windows
|
2002-08-29 18:59:37 +04:00
|
|
|
// and free up memory, then sends a notify message to the CI
|
- I've added lots of comments in siminterface.h, and tried to clean up
the terminology a bit. In particular, the term "gui" has started
to mean different things in different contexts, so I've defined
some more specific names for the parts of the user interface, and
updated comments and some variable names to reflect it. See
siminterface.h for a more complete description of all of these.
VGAW: VGA display window and toolbar buttons, the traditional Bochs
display which is ported to X, win32, MacOS X, etc. Implemented
in gui/gui.* and platform dependent gui/*.cc files.
CI: configuration interface that lets the user change settings such
as floppy disk image, ne2k settings, log options. The CI consists
of two parts: configuration user interface (CUI) which does the
actual rendering to the screen and handles key/mouse/menu events,
and the siminterface object.
CUI: configuration user interface. This handles the user interactions
that allow the user to configure Bochs. To actually change any
values it talks to the siminterface object. One implementation of
the CUI is the text-mode menus in gui/control.cc. Another
implementation is (will be) the wxWindows menus and dialogs in
gui/wxmain.cc.
siminterface: the glue between the CUI and the simulation code,
accessible throughout the code by the global variable
bx_simulator_interface_c *SIM;
Among other things, siminterface methods allow the simulator to ask the
CUI to display things or ask for user input, and allows the CUI
to query and modify variables in the simulation code.
GUI: Literally, "graphical user interface". Until the configuration menus
and wxWindows came along, everyone understood that "gui" referred to the
VGA display window and the toolbar buttons because that's all there
was. Now that we have the wxWindows code, which implements both the VGAW
and the CUI, while all other platforms implement only the VGAW, it's not
so clear. So, I'm trying to use VGAW, CI, and CUI consistently since
they are more specific.
control panel: This has been used as another name for the configuration
interface. "control panel" is also somewhat unspecific and it sounds
like it would be graphical with buttons and sliders, but our text-mode
thing is not graphical at all. I've replaced "control panel" with
"configuration interface" wherever I could find it. In configure script,
the --disable-control-panel option is still supported, but it politely
suggests that you use --disable-config-interface instead.
- clean up comments in siminterface,wx* code
- add comments and examples for bx_param_* and BxEvents
- remove some obsolete stuff: notify_*_args,
bx_simulator_interface_c::[sg]et_enabled() methods
- in siminterface.cc, move a few bx_real_sim_c methods to where they belong,
with the rest of the methods. No changes to the actual methods.
- remove some DOS ^M's which crept in and confused my editor.
2002-08-26 19:31:23 +04:00
|
|
|
// telling it that bochs has stopped.
|
2002-04-18 04:22:20 +04:00
|
|
|
virtual void quit_sim (int code) {}
|
|
|
|
|
2001-06-12 00:27:23 +04:00
|
|
|
virtual int get_default_rc (char *path, int len) {return -1;}
|
2001-06-10 00:01:12 +04:00
|
|
|
virtual int read_rc (char *path) {return -1;}
|
2001-06-11 10:35:18 +04:00
|
|
|
virtual int write_rc (char *rc, int overwrite) {return -1;}
|
2001-06-12 00:27:23 +04:00
|
|
|
virtual int get_log_file (char *path, int len) {return -1;}
|
2001-06-10 00:01:12 +04:00
|
|
|
virtual int set_log_file (char *path) {return -1;}
|
2002-06-26 18:42:35 +04:00
|
|
|
virtual int get_log_prefix (char *prefix, int len) {return -1;}
|
|
|
|
virtual int set_log_prefix (char *prefix) {return -1;}
|
2001-06-10 00:01:12 +04:00
|
|
|
virtual int get_floppy_options (int drive, bx_floppy_options *out) {return -1;}
|
|
|
|
virtual int get_cdrom_options (int drive, bx_cdrom_options *out) {return -1;}
|
|
|
|
virtual char *get_floppy_type_name (int type) {return NULL;}
|
2002-04-18 04:22:20 +04:00
|
|
|
|
2002-08-29 18:59:37 +04:00
|
|
|
// The CI calls set_notify_callback to register its event handler function.
|
- I've added lots of comments in siminterface.h, and tried to clean up
the terminology a bit. In particular, the term "gui" has started
to mean different things in different contexts, so I've defined
some more specific names for the parts of the user interface, and
updated comments and some variable names to reflect it. See
siminterface.h for a more complete description of all of these.
VGAW: VGA display window and toolbar buttons, the traditional Bochs
display which is ported to X, win32, MacOS X, etc. Implemented
in gui/gui.* and platform dependent gui/*.cc files.
CI: configuration interface that lets the user change settings such
as floppy disk image, ne2k settings, log options. The CI consists
of two parts: configuration user interface (CUI) which does the
actual rendering to the screen and handles key/mouse/menu events,
and the siminterface object.
CUI: configuration user interface. This handles the user interactions
that allow the user to configure Bochs. To actually change any
values it talks to the siminterface object. One implementation of
the CUI is the text-mode menus in gui/control.cc. Another
implementation is (will be) the wxWindows menus and dialogs in
gui/wxmain.cc.
siminterface: the glue between the CUI and the simulation code,
accessible throughout the code by the global variable
bx_simulator_interface_c *SIM;
Among other things, siminterface methods allow the simulator to ask the
CUI to display things or ask for user input, and allows the CUI
to query and modify variables in the simulation code.
GUI: Literally, "graphical user interface". Until the configuration menus
and wxWindows came along, everyone understood that "gui" referred to the
VGA display window and the toolbar buttons because that's all there
was. Now that we have the wxWindows code, which implements both the VGAW
and the CUI, while all other platforms implement only the VGAW, it's not
so clear. So, I'm trying to use VGAW, CI, and CUI consistently since
they are more specific.
control panel: This has been used as another name for the configuration
interface. "control panel" is also somewhat unspecific and it sounds
like it would be graphical with buttons and sliders, but our text-mode
thing is not graphical at all. I've replaced "control panel" with
"configuration interface" wherever I could find it. In configure script,
the --disable-control-panel option is still supported, but it politely
suggests that you use --disable-config-interface instead.
- clean up comments in siminterface,wx* code
- add comments and examples for bx_param_* and BxEvents
- remove some obsolete stuff: notify_*_args,
bx_simulator_interface_c::[sg]et_enabled() methods
- in siminterface.cc, move a few bx_real_sim_c methods to where they belong,
with the rest of the methods. No changes to the actual methods.
- remove some DOS ^M's which crept in and confused my editor.
2002-08-26 19:31:23 +04:00
|
|
|
// This event handler function is called whenever the simulator needs to
|
2002-08-29 18:59:37 +04:00
|
|
|
// send an event to the CI. For example, if the simulator hits a panic and
|
|
|
|
// wants to ask the user how to proceed, it would call the CI event handler
|
|
|
|
// to ask the CI to display a dialog.
|
- I've added lots of comments in siminterface.h, and tried to clean up
the terminology a bit. In particular, the term "gui" has started
to mean different things in different contexts, so I've defined
some more specific names for the parts of the user interface, and
updated comments and some variable names to reflect it. See
siminterface.h for a more complete description of all of these.
VGAW: VGA display window and toolbar buttons, the traditional Bochs
display which is ported to X, win32, MacOS X, etc. Implemented
in gui/gui.* and platform dependent gui/*.cc files.
CI: configuration interface that lets the user change settings such
as floppy disk image, ne2k settings, log options. The CI consists
of two parts: configuration user interface (CUI) which does the
actual rendering to the screen and handles key/mouse/menu events,
and the siminterface object.
CUI: configuration user interface. This handles the user interactions
that allow the user to configure Bochs. To actually change any
values it talks to the siminterface object. One implementation of
the CUI is the text-mode menus in gui/control.cc. Another
implementation is (will be) the wxWindows menus and dialogs in
gui/wxmain.cc.
siminterface: the glue between the CUI and the simulation code,
accessible throughout the code by the global variable
bx_simulator_interface_c *SIM;
Among other things, siminterface methods allow the simulator to ask the
CUI to display things or ask for user input, and allows the CUI
to query and modify variables in the simulation code.
GUI: Literally, "graphical user interface". Until the configuration menus
and wxWindows came along, everyone understood that "gui" referred to the
VGA display window and the toolbar buttons because that's all there
was. Now that we have the wxWindows code, which implements both the VGAW
and the CUI, while all other platforms implement only the VGAW, it's not
so clear. So, I'm trying to use VGAW, CI, and CUI consistently since
they are more specific.
control panel: This has been used as another name for the configuration
interface. "control panel" is also somewhat unspecific and it sounds
like it would be graphical with buttons and sliders, but our text-mode
thing is not graphical at all. I've replaced "control panel" with
"configuration interface" wherever I could find it. In configure script,
the --disable-control-panel option is still supported, but it politely
suggests that you use --disable-config-interface instead.
- clean up comments in siminterface,wx* code
- add comments and examples for bx_param_* and BxEvents
- remove some obsolete stuff: notify_*_args,
bx_simulator_interface_c::[sg]et_enabled() methods
- in siminterface.cc, move a few bx_real_sim_c methods to where they belong,
with the rest of the methods. No changes to the actual methods.
- remove some DOS ^M's which crept in and confused my editor.
2002-08-26 19:31:23 +04:00
|
|
|
//
|
|
|
|
// NOTE: At present, the standard VGAW buttons (floppy, snapshot, power,
|
|
|
|
// etc.) are displayed and handled by gui.cc, not by the CI or siminterface.
|
|
|
|
// gui.cc uses its own callback functions to implement the behavior of
|
|
|
|
// the buttons. Some of these implementations call the siminterface.
|
2002-04-18 04:22:20 +04:00
|
|
|
typedef BxEvent* (*sim_interface_callback_t)(void *theclass, BxEvent *event);
|
|
|
|
virtual void set_notify_callback (sim_interface_callback_t func, void *arg) {}
|
|
|
|
|
2002-08-29 18:59:37 +04:00
|
|
|
// send an event from the simulator to the CI.
|
|
|
|
virtual BxEvent* sim_to_ci_event (BxEvent *event) {return NULL;}
|
2002-04-18 04:22:20 +04:00
|
|
|
|
- I've added lots of comments in siminterface.h, and tried to clean up
the terminology a bit. In particular, the term "gui" has started
to mean different things in different contexts, so I've defined
some more specific names for the parts of the user interface, and
updated comments and some variable names to reflect it. See
siminterface.h for a more complete description of all of these.
VGAW: VGA display window and toolbar buttons, the traditional Bochs
display which is ported to X, win32, MacOS X, etc. Implemented
in gui/gui.* and platform dependent gui/*.cc files.
CI: configuration interface that lets the user change settings such
as floppy disk image, ne2k settings, log options. The CI consists
of two parts: configuration user interface (CUI) which does the
actual rendering to the screen and handles key/mouse/menu events,
and the siminterface object.
CUI: configuration user interface. This handles the user interactions
that allow the user to configure Bochs. To actually change any
values it talks to the siminterface object. One implementation of
the CUI is the text-mode menus in gui/control.cc. Another
implementation is (will be) the wxWindows menus and dialogs in
gui/wxmain.cc.
siminterface: the glue between the CUI and the simulation code,
accessible throughout the code by the global variable
bx_simulator_interface_c *SIM;
Among other things, siminterface methods allow the simulator to ask the
CUI to display things or ask for user input, and allows the CUI
to query and modify variables in the simulation code.
GUI: Literally, "graphical user interface". Until the configuration menus
and wxWindows came along, everyone understood that "gui" referred to the
VGA display window and the toolbar buttons because that's all there
was. Now that we have the wxWindows code, which implements both the VGAW
and the CUI, while all other platforms implement only the VGAW, it's not
so clear. So, I'm trying to use VGAW, CI, and CUI consistently since
they are more specific.
control panel: This has been used as another name for the configuration
interface. "control panel" is also somewhat unspecific and it sounds
like it would be graphical with buttons and sliders, but our text-mode
thing is not graphical at all. I've replaced "control panel" with
"configuration interface" wherever I could find it. In configure script,
the --disable-control-panel option is still supported, but it politely
suggests that you use --disable-config-interface instead.
- clean up comments in siminterface,wx* code
- add comments and examples for bx_param_* and BxEvents
- remove some obsolete stuff: notify_*_args,
bx_simulator_interface_c::[sg]et_enabled() methods
- in siminterface.cc, move a few bx_real_sim_c methods to where they belong,
with the rest of the methods. No changes to the actual methods.
- remove some DOS ^M's which crept in and confused my editor.
2002-08-26 19:31:23 +04:00
|
|
|
// called from simulator when it hits serious errors, to ask if the user
|
|
|
|
// wants to continue or not
|
2002-04-18 04:22:20 +04:00
|
|
|
virtual int log_msg (const char *prefix, int level, char *msg) {return -1;}
|
- I've added lots of comments in siminterface.h, and tried to clean up
the terminology a bit. In particular, the term "gui" has started
to mean different things in different contexts, so I've defined
some more specific names for the parts of the user interface, and
updated comments and some variable names to reflect it. See
siminterface.h for a more complete description of all of these.
VGAW: VGA display window and toolbar buttons, the traditional Bochs
display which is ported to X, win32, MacOS X, etc. Implemented
in gui/gui.* and platform dependent gui/*.cc files.
CI: configuration interface that lets the user change settings such
as floppy disk image, ne2k settings, log options. The CI consists
of two parts: configuration user interface (CUI) which does the
actual rendering to the screen and handles key/mouse/menu events,
and the siminterface object.
CUI: configuration user interface. This handles the user interactions
that allow the user to configure Bochs. To actually change any
values it talks to the siminterface object. One implementation of
the CUI is the text-mode menus in gui/control.cc. Another
implementation is (will be) the wxWindows menus and dialogs in
gui/wxmain.cc.
siminterface: the glue between the CUI and the simulation code,
accessible throughout the code by the global variable
bx_simulator_interface_c *SIM;
Among other things, siminterface methods allow the simulator to ask the
CUI to display things or ask for user input, and allows the CUI
to query and modify variables in the simulation code.
GUI: Literally, "graphical user interface". Until the configuration menus
and wxWindows came along, everyone understood that "gui" referred to the
VGA display window and the toolbar buttons because that's all there
was. Now that we have the wxWindows code, which implements both the VGAW
and the CUI, while all other platforms implement only the VGAW, it's not
so clear. So, I'm trying to use VGAW, CI, and CUI consistently since
they are more specific.
control panel: This has been used as another name for the configuration
interface. "control panel" is also somewhat unspecific and it sounds
like it would be graphical with buttons and sliders, but our text-mode
thing is not graphical at all. I've replaced "control panel" with
"configuration interface" wherever I could find it. In configure script,
the --disable-control-panel option is still supported, but it politely
suggests that you use --disable-config-interface instead.
- clean up comments in siminterface,wx* code
- add comments and examples for bx_param_* and BxEvents
- remove some obsolete stuff: notify_*_args,
bx_simulator_interface_c::[sg]et_enabled() methods
- in siminterface.cc, move a few bx_real_sim_c methods to where they belong,
with the rest of the methods. No changes to the actual methods.
- remove some DOS ^M's which crept in and confused my editor.
2002-08-26 19:31:23 +04:00
|
|
|
|
2002-08-29 18:59:37 +04:00
|
|
|
// tell the CI to ask the user for the value of a parameter.
|
2002-04-18 04:22:20 +04:00
|
|
|
virtual int ask_param (bx_id param) {return -1;}
|
|
|
|
|
|
|
|
// ask the user for a pathname
|
|
|
|
virtual int ask_filename (char *filename, int maxlen, char *prompt, char *the_default, int flags) {return -1;}
|
|
|
|
// called at a regular interval, currently by the keyboard handler.
|
|
|
|
virtual void periodic () {}
|
2002-08-30 00:13:05 +04:00
|
|
|
virtual int create_disk_image (const char *filename, int sectors, Boolean overwrite) {return -3;}
|
2001-06-08 11:20:07 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
extern bx_simulator_interface_c *SIM;
|
|
|
|
|
2002-04-18 04:22:20 +04:00
|
|
|
extern void bx_init_siminterface ();
|
2002-08-25 12:31:16 +04:00
|
|
|
extern void bx_init_main (int argc, char *argv[]);
|
- I've added lots of comments in siminterface.h, and tried to clean up
the terminology a bit. In particular, the term "gui" has started
to mean different things in different contexts, so I've defined
some more specific names for the parts of the user interface, and
updated comments and some variable names to reflect it. See
siminterface.h for a more complete description of all of these.
VGAW: VGA display window and toolbar buttons, the traditional Bochs
display which is ported to X, win32, MacOS X, etc. Implemented
in gui/gui.* and platform dependent gui/*.cc files.
CI: configuration interface that lets the user change settings such
as floppy disk image, ne2k settings, log options. The CI consists
of two parts: configuration user interface (CUI) which does the
actual rendering to the screen and handles key/mouse/menu events,
and the siminterface object.
CUI: configuration user interface. This handles the user interactions
that allow the user to configure Bochs. To actually change any
values it talks to the siminterface object. One implementation of
the CUI is the text-mode menus in gui/control.cc. Another
implementation is (will be) the wxWindows menus and dialogs in
gui/wxmain.cc.
siminterface: the glue between the CUI and the simulation code,
accessible throughout the code by the global variable
bx_simulator_interface_c *SIM;
Among other things, siminterface methods allow the simulator to ask the
CUI to display things or ask for user input, and allows the CUI
to query and modify variables in the simulation code.
GUI: Literally, "graphical user interface". Until the configuration menus
and wxWindows came along, everyone understood that "gui" referred to the
VGA display window and the toolbar buttons because that's all there
was. Now that we have the wxWindows code, which implements both the VGAW
and the CUI, while all other platforms implement only the VGAW, it's not
so clear. So, I'm trying to use VGAW, CI, and CUI consistently since
they are more specific.
control panel: This has been used as another name for the configuration
interface. "control panel" is also somewhat unspecific and it sounds
like it would be graphical with buttons and sliders, but our text-mode
thing is not graphical at all. I've replaced "control panel" with
"configuration interface" wherever I could find it. In configure script,
the --disable-control-panel option is still supported, but it politely
suggests that you use --disable-config-interface instead.
- clean up comments in siminterface,wx* code
- add comments and examples for bx_param_* and BxEvents
- remove some obsolete stuff: notify_*_args,
bx_simulator_interface_c::[sg]et_enabled() methods
- in siminterface.cc, move a few bx_real_sim_c methods to where they belong,
with the rest of the methods. No changes to the actual methods.
- remove some DOS ^M's which crept in and confused my editor.
2002-08-26 19:31:23 +04:00
|
|
|
extern int bx_continue_after_config_interface (int argc, char *argv[]);
|