Commit Graph

51 Commits

Author SHA1 Message Date
Volker Ruppert
21b8955a4e - userbutton shortcut feature improved. The shortcut string can be a combination
of these key names: "alt", "ctrl", "del", "esc", "f1", "f4", "tab", "win".
  Up to 3 keys can be pressed at a time.
2002-10-16 19:50:27 +00:00
Bryce Denney
346e2747d3 - fixed up ParamDialog to correctly handle "trees" of parameters. A
bx_list_c can now be displayed as either a wxStaticBox with the
  child parameters inside, or as a wxNotebook with each child
  parameter in a separate tab.  (The children can also be lists of
  course.)  The default display is the wxStaticBox type, but if you
  set the option bit bx_list_c::USE_TAB_WINDOW in the list,
  ParamDialog will use the wxNotebook display instead.
- to get the param trees working, I created a new struct
  AddParamContext, which is passed to AddParam().  This struct is
  critical when AddParam calls itself recursively to display lists
  within lists.
- use the wxNotebook display feature for the ATA0,1,2,3 controller
  dialog box.  Now instead of being hundreds of pixels tall, it is
  reasonable height with three different tabs.  This fixed bug
  #619074: "wx: ATA interface editor too tall" and was the whole
  reason I started messing with this at all.

plus some minor cleanups
- when I added the enum constant bx_list_c::USE_TAB_WINDOW, I also
  removed the BX_ prefix from all the other enum constants that are
  used in parameter options in siminterface.cc.  Since these constants
  are enums within a class, there is no possibility of namespace
  conflicts so the prefix is not needed.
- added wxADJUST_MINSIZE to all wxChoice controls, since that tells
  wxWindows to adjust its size to the length of the longest string.
- instead of calling SetSize or SetSizeHints on every textcontrol with
  a hardcoded width, I am using just two wxSize specifications for
  everything: either normalTextSize or longTextSize.
- edit names of a few menus and params.  For example now instead of
  the tab saying "Master ATA device on channel 0" it will say
  "First HD/CD on channel 0".

Modified Files:
  main.cc gui/control.cc gui/gui.cc gui/siminterface.cc gui/siminterface.h
  gui/wxdialog.cc gui/wxdialog.h gui/wxmain.cc
2002-10-06 02:37:28 +00:00
Christophe Bothamy
440dffc803 - applied patch.4ata-channels and patch.4ata-channels.bbd
- Features :
 . number of active channels defined at boot-time config
 . new options in bochsrc
 . up to 8 devices support (disks or cdroms)
 . up to 4 cdrom devices can be changed at runtime config
 . wxwindows config interface
2002-09-22 20:56:12 +00:00
Volker Ruppert
4c4294cc6f - new variable 'charmap_updated', 'charmap_changed' array renamed to
'char_changed'. These variables are currently only used by the win32 gui for
  the update of the font bitmaps. SDL and wxWindows do not use the variables
  since they are using the charmap data directly
- free text snapshot memory when the user has cancelled the dialog
- write text snapshot file in binary mode (disables the LF -> CRLF conversion
  in cygwin)
2002-09-21 19:38:47 +00:00
Volker Ruppert
721f89b77b - forward changes of the active charmap to the gui with the new function
set_text_charbyte()
- vga: store the address of the active charmap in the new variable
  charmap_address
- vga: text mode hack removed. The write modes, operations and masks must be
  used in text mode too.
- sdl: clear_screen() is not necessary when the charmap has changed
- win32: update only the changed font bitmaps before drawing the text
2002-09-19 18:59:50 +00:00
Volker Ruppert
d23d121674 - new function set_text_charmap() stores the vga charmap data in the array
vga_charmap
- the SDL gui uses the charmap data for the vga text display
  * TODO: implement this feature for other guis
- removed unused variables in sdl.cc and gui.cc
- fixed a warning in vga.cc
2002-09-08 07:56:10 +00:00
Bryce Denney
26385f2866 - 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 15:31:23 +00:00
Volker Ruppert
dc07804616 - simple user shortcut dialog for wxWindows added
- floppya, floppyb and cdromd handlers: don't change anything when the user has
  cancelled the dialog
2002-08-25 12:32:54 +00:00
Volker Ruppert
1d4d5aa244 - new "user" button added to the headerbar. It can send keyboard shortcuts to
the guest OS. The shortcut can be defined in the bochsrc or in the config
  interface. It is possible to change it at runtime.

  These shortcuts are currently recognized:
  ctrlaltdel, ctrlaltesc, ctrlaltf1, alttab

  Here is the list of changes:

  * userbutton.h and userbutton.xpm added in gui/bitmaps
  * config options for the userbutton shortcut added
  * initialize the new button in the gui.cc
  * the new userbutton handler generates keypresses and relaeses depending on
    the shortcut keyword
  * the gui stops adding buttons to the headerbar if not enough space is left.
    This can happen when the screen width is 320 pixels (done for X11 only).
  * TODO: build a dialog box for the wxWindows gui
2002-08-09 06:16:43 +00:00
Volker Ruppert
c3cda0a919 - separation of floppy device type and media type started. This feature needs
more work in the floppy and bios code.
- floppy and cdrom entries in the runtime config menu can be disabled if the
  drive wasn't defined in bochsrc or start menu
- floppy variable "initial_status" and cdrom variable "inserted" renamed to
  "status"
- unused variable *ips in function build_runtime_options_prompt() disabled
2002-08-04 08:42:34 +00:00
Bryce Denney
30aaf4088e - commit patch.wxwindows.gz in the main branch. Now you can try out
the wxwindows interface by just "configure --with-wx; make"

  Modified Files:
    Makefile.in bochs.h config.h.in configure configure.in
    load32bitOShack.cc logio.cc main.cc cpu/cpu.cc cpu/cpu.h
    debug/dbg_main.cc gui/Makefile.in gui/control.cc gui/gui.cc
    gui/siminterface.cc gui/siminterface.h gui/x.cc iodev/cdrom.cc
    iodev/keyboard.cc memory/misc_mem.cc
  Added Files:
    README-wxWindows wxbochs.rc gui/wx.cc gui/wxmain.cc
    gui/wxmain.h gui/bitmaps/cdromd.xpm
    gui/bitmaps/configbutton.xpm gui/bitmaps/copy.xpm
    gui/bitmaps/floppya.xpm gui/bitmaps/floppyb.xpm
    gui/bitmaps/mouse.xpm gui/bitmaps/paste.xpm
    gui/bitmaps/power.xpm gui/bitmaps/reset.xpm
    gui/bitmaps/snapshot.xpm
  Removed Files:
    patches/patch.wxwindows.gz
2002-04-18 00:22:20 +00:00
Volker Ruppert
bc7ca5b0e6 - removed unnecessary include statemants for X 2002-03-30 06:45:30 +00:00
Volker Ruppert
8263d15e76 - renamed update_floppy_status_buttons() to update_drive_status_buttons() since
it handles the cdrom status too
2002-03-17 20:57:54 +00:00
Volker Ruppert
92b06b9ebf - new function get_clipboard_text() for GUI specific clipboard handling
GUI specific paste functions for X11 and WIN32 in paste_handler() moved to
  the new function
- get_clipboard_text() prepared for other GUIs
- set_clipboard_text() has now a return value (0 = failed or not implemented)
- use portable code in copy_handler() if set_clipboard_text() fails
- snapshot_handler() prepared for adding a file dialog call
- writing snapshot file in binary mode (LF->CRLF conversion already done)
2002-03-16 11:30:06 +00:00
Bryce Denney
842bfb4430 - BX_WITH_X11 is always defined. use "#if BX_WITH_X11" not #ifdef 2002-03-15 17:10:58 +00:00
Volker Ruppert
7373bb7647 - new function set_clipboard_text() for GUI specific clipboard handling
GUI specific copy functions for X11 and WIN32 in copy_handler() moved to
  the new function
- set_clipboard_text() prepared for other GUIs
- value of text mode cursor variables fixed (and renamed in x.cc)
- BX_ERROR message in snapshot_handler() fixed
2002-03-15 16:45:10 +00:00
Bryce Denney
502a48057b - fix clipboard code that is compiled when neither windows nor X windows
is enabled.
2002-03-12 06:46:35 +00:00
Bryce Denney
ebc19a5e6c - fix bugs in copy&paste on win32.
- paste: grabbing the data from the clipboard in win32 was not implemented
  at all.  I found some example code on usenet and adapted it for Bochs.
- keymap: now if you call loadKeymap with NULL for the function pointer,
  it just fills in all the X windows keysyms with zero.  Added a call
  to loadKeymap in win32.cc.
2002-03-11 16:35:41 +00:00
Bryce Denney
d82a73ed21 - fix things I broke while working in linux 2002-03-11 15:45:34 +00:00
Bryce Denney
8125bee908 - commit patch.paste 2002-03-11 15:04:58 +00:00
Jeroen Janssen
b6074761e2 - fixed small bug causing always including X11 header 2002-03-10 20:08:14 +00:00
Bryce Denney
aa6acc2be4 - add code for X windows to put the snapshot data onto the clipboard. 2002-03-10 16:06:56 +00:00
Bryce Denney
3d2c58ee49 - revert to revision 1.27. My changes in 1.28 caused cygwin to be unable to
copy to the clipboard so I removed them.
- I was having cygwin compile problems because <windows.h> was not always
  included when compiling this file.  Add an include of <windows.h> at
  the top, and now it compiles in cygwin.
2002-03-10 05:49:26 +00:00
Bryce Denney
efb6eeb621 - use UNIX-like code when compiling in cygwin 2002-03-06 18:17:24 +00:00
Volker Ruppert
197f80bde5 - snapshot_handler() prepared for copying text to clipboard
- copy text to clipboard added for WIN32
2002-02-12 17:09:51 +00:00
Volker Ruppert
1d9861fc59 - implementation of the text mode snapshot function 2002-02-04 20:31:35 +00:00
Volker Ruppert
84b649831e - new cdrom button in the headerbar
- changing cdrom media in a Bochs session now possible
- don't eject cdrom when the guest OS has locked the drive
2002-02-01 16:46:27 +00:00
Bryce Denney
1e3f0cff19 - added configuration button contributed by
Volker Ruppert <Volker.Ruppert@t-online.de>
  instead of borrowing the snapshot button for the config interface.
2001-11-09 22:17:33 +00:00
Bryce Denney
daf2a9fb55 - add RCS Id to header of every file. This makes it easier to know what's
going on when someone sends in a modified file.
2001-10-03 13:10:38 +00:00
Bryce Denney
42473b7038 - fix up floppy button handlers so that the function that actually
updates the buttons can be called from the outside.
2001-09-28 06:03:40 +00:00
Bryce Denney
55f999327b - use #if BX_WITH_MACOS instead of #ifdef macintosh to distinguish
between MacOS pre-10 and MacOS 10
2001-09-26 00:15:30 +00:00
Todd T.Fries
28885e4973 some INFO->DEBUG/ERROR cleanups 2001-08-31 16:06:32 +00:00
Todd T.Fries
a06b031dcf setprefix -> put 2001-06-27 19:16:01 +00:00
Bryce Denney
fba34be1e7 - added a new method to all GUIs called mouse_enabled_changed_specific,
which notifies them that the mouse_enabled bit has changed.  Now that
  mouse_enabled can be initialized or modified by parameter events in
  addition to GUI events, the guis must be prepared for it.  I have pasted
  empty method definitions into mouse_enabled_changed_specific for all
  guis except for X11, which I did the right way.  The implementation
  of this function must use the argument "val" rather than reading the
  parameter.
2001-06-23 03:18:14 +00:00
Bryce Denney
0bc41bc8ba - now the win32 gui updates bx_options.Omouse_enabled whenever it
goes in/out of mouse capture mode.  This is critical because
  bx_options.Omouse_enabled is used to control whether the mouse
  events are sent into the hardware queue or not (keyboard.cc).
  This is only a partial fix though, because changing the mouse
  enabled setting in the control panel has no effect on the gui.
2001-06-23 01:47:26 +00:00
Bryce Denney
80a7541fed - used grep to search for more instances of new bx_options problems that
I have introduced, and fixed a lot.
2001-06-21 14:56:43 +00:00
Bryce Denney
ec0fbf18bc - convert nearly all bx_options to parameter form. All options that have
been converted into parameters temporarily have the letter "O" appended
  to their name.  I don't want to keep it this way, but it has helped
  in the conversion process because the compiler refuses to compile the
  old uses of the name.  Before I started using the "O" trick, there were
  many bugs like this:   if (bx_options.diskc.present) {...}
  This was legal with the new parameters, but it was testing whether the
  parameter structure had been created, instead of testing the value of
  the present parameter.  Renaming present to Opresent turns this into
  a compile error, which points out the incorrect use of the param.
- the "--disable-control-panel" no longer works, I'm afraid.  I can no
  longer support this and continue progress.
2001-06-20 14:01:39 +00:00
Todd T.Fries
12985edb26 setprefix now uses a variable length name as a string for an argument 2001-06-19 21:36:09 +00:00
Bryce Denney
c3d88c5924 - now ips, mouse_enabled, vga_update_interval, and rom_path are
declared as bx_param_c * types in the bx_options structure.  They are
  initialized in main.cc (bx_init_options) with default values.
  Access to parameters of this type should always be like this:
    bx_options.mouse_enabled->get ();
    bx_options.mouse_enabled->set (newval);
  Eventually I will be transferring all options to this format.
2001-06-16 23:08:32 +00:00
Bryce Denney
cee98e0033 - Add special case for power button so that it is always fatal.
a GUI panic.
2001-06-15 18:01:52 +00:00
Bryce Denney
a97df5a8fa - add some #if's to compile the control panel stuff only when
BX_USE_CONTROL_PANEL is set.  I put the #if...#endif thing around
  the entire file in siminterface.cc and control.cc so that it's safe
  to compile them in either case.
2001-06-11 06:48:37 +00:00
Bryce Denney
8b7fbca53e - more work on text-mode control panel. Now the control panel starts before
the simulation begins, to give you a chance to choose between bochsrcs,
  choose the boot disk, etc.
2001-06-09 20:01:12 +00:00
Bryce Denney
f2af827a63 - add a layer of abstraction between the text-mode control panel in
gui/control.cc and the simulator.  Now all communication between
  the control panel and the rest of bochs goes through an object
  called bx_simulator_interface_c.
2001-06-08 07:20:07 +00:00
Bryce Denney
b26e2fb362 - even if panic is nonfatal, the exit button should still make it quit! 2001-06-08 03:07:51 +00:00
Bryce Denney
0cc0bb9c2c - add first attempt at a text mode control panel 2001-06-07 20:31:20 +00:00
Todd T.Fries
2bbb1ef8eb strip '\n' from BX_{INFO,DEBUG,ERROR,PANIC}
don't need it, moved the output of it into the general io functions.
saves space, as well as removes the confusing output if a '\n' is left off
2001-05-30 18:56:02 +00:00
Todd T.Fries
622031500e reset callback now implemented 2001-05-25 14:21:46 +00:00
Todd T.Fries
bdb89cd364 merge in BRANCH-io-cleanup.
To see the commit logs for this use either cvsweb or
cvs update -r BRANCH-io-cleanup and then 'cvs log' the various files.

In general this provides a generic interface for logging.

logfunctions:: is a class that is inherited by some classes, and also
.   allocated as a standalone global called 'genlog'.  All logging uses
.   one of the ::info(), ::error(), ::ldebug(), ::panic() methods of this
.   class through 'BX_INFO(), BX_ERROR(), BX_DEBUG(), BX_PANIC()' macros
.   respectively.
.
.   An example usage:
.     BX_INFO(("Hello, World!\n"));

iofunctions:: is a class that is allocated once by default, and assigned
as the iofunction of each logfunctions instance.  It is this class that
maintains the file descriptor and other output related code, at this
point using vfprintf().  At some future point, someone may choose to
write a gui 'console' for bochs to which messages would be redirected
simply by assigning a different iofunction class to the various logfunctions
objects.

More cleanup is coming, but this works for now.  If you want to see alot
of debugging output, in main.cc, change onoff[LOGLEV_DEBUG]=0 to =1.

Comments, bugs, flames, to me: todd@fries.net
2001-05-15 14:49:57 +00:00
Bryce Denney
e363f402ca - This implements a solution that lets any GUI take over handling of any
signal.  First, selection of the GUI should cause BX_GUI_SIGHANDLER to
  be defined in config.h.in.  Then, the GUI should define member functions
    Bit32u get_sighandler_mask ();
    void sighandler (int sig);
  The mask function returns a bitfield where one bit corresponds to each
  signal.  For any signal whose bit is set to 1 in the return value of
  get_sighandler_mask, the gui will control that signal.  When the signal
  arrives, bx_gui.sighandler(sig) will be called by bx_signal_handler,
  instead of the default behavior of that signal.
2001-05-08 20:18:04 +00:00
Bryce Denney
a6fef54678 - update copyright dates to 2001 for all mandrake headers
- for bochs files with other header, replaced with current mandrake header
2001-04-10 02:20:02 +00:00