Commit Graph

30 Commits

Author SHA1 Message Date
Bryce Denney
5c6d434929 - the raw keycodes code for wxMSW refers to HIWORD, so I made it
conditionally include <windows.h>.  This may seem like a drastic step
  for just one little type, but I expect before long we may want to use
  other symbols like VK_F12 which are also in windows.h.  In a cygwin
  compile this is required.
2002-09-26 19:24:53 +00:00
Bryce Denney
a4f0c5b53e - move read configuration and save configuration behavior out of wx.cc
and into wxmain.cc, like other actions.
- set a default siminterface callback for the whole application, which is used
  whenever the simulator is not running.  This is important when the wx code
  calls simulator or param code and triggers a BX_PANIC or something.
  The default callback is responsible for displaying error messages which
  appear while reading the bochsrc, for example.
- move the implementation of BX_SYNC_EVT_LOG_ASK and BX_ASYNC_EVT_LOG_MSG
  into a separate function OnLogMsg().  In the future, OnLogMsg() may be called
  from the application default callback on errors.
- modified: gui/wx.cc gui/wxmain.cc gui/wxmain.h
2002-09-25 18:40:15 +00:00
Bryce Denney
ae1ac3e266 - add cases in switch statement for keys: Right CTRL, Right ALT, Scroll Lock,
Print Screen, Pause.
2002-09-25 07:21:38 +00:00
Bryce Denney
2107fb3af9 - in the keycode conversion switch statement, rename bx_key to key_event so
that it is as close as possible to the x.cc version.  I've made some
  improvements in x.cc and I want to apply them to wxWindows as well.
2002-09-25 05:35:36 +00:00
Bryce Denney
85a7d1dad8 - on win32, the wxWindows interface was never redrawing the screen since I
started using a wxTimer to trigger the redraws.  Now instead of calling
  MyPanel::OnPaint directly, I call Refresh() instead.  This makes the Windows
  display work correctly.
2002-09-22 04:04:40 +00:00
Bryce Denney
d4bf3598f0 - fix some types in printf format strings 2002-09-22 02:44:31 +00:00
Bryce Denney
375fcf648b - plug up some memory leaks in wxWindows code, with help from Valgrind
- MyPanel::blankCursor
  - MyFrame::panel
  - AdvancedLogOptions::action (2d array of wxChoice *'s)
  - ParamDialog::idHash, ParamDialog::paramHash, and ParamStructs
  - file dialog in BrowseTextCtrl
- fix illegal use of a wxObject.  I had been clearing the ParamStruct
  with memset(), but I forgot that ParamStruct was a subclass of wxObject
  so I was trashing the wxObject fields too!  Instead I created a
  ParamStruct constructor that clears the pointers to NULL.
- comment out debug output from AdvancedLogOptionsDialog::SetAction
- modified files: gui/wx.cc gui/wxdialog.cc gui/wxdialog.h
  gui/wxmain.cc gui/wxmain.h
2002-09-20 21:25:09 +00:00
Bryce Denney
c278349cdf - in wxWindows, hide mouse cursor when mouse is captured, to avoid the
confusion of having two cursors showing at once.  Actually implemented by
  changing to a blank cursor when cursor should be hidden.
2002-09-19 00:43:32 +00:00
Bryce Denney
24d88d2d28 - implement mouse in wxWindows interface
- All mouse events in the VGA window go to MyPanel::OnMouse.  Middle mouse
  button and F12 both toggle mouse capture.  OnMouse queues an event
  for the simulation thread to process.  The simulation thread calls
  bx_devices.keyboard->mouse_motion() when it sees the event on the queue.
- add IFDBG_VGA around some display debug code.  All wx mouse debug code
  is controlled by IFDBG_MOUSE.
- modified: gui/wx.cc gui/wxmain.cc gui/wxmain.h
2002-09-18 22:44:02 +00:00
Bryce Denney
0a5ce87b15 - now instead of having the simulation thread send repaint messages to
the wxwindows thread, it just sets a boolean flag needRefresh.  Meanwhile, a
  wxTimer running in wall clock time (as opposed to sim time) triggers a
  repaint only if the the boolean is true.
- now MyRefresh is implemented by just setting needRefresh=true.
- make graphics_tile_update call MyRefresh.
- make dimension_update call MyRefresh.
2002-09-18 20:59:35 +00:00
Volker Ruppert
0ac366ada2 - the wx gui now uses the vga_charmap data for the vga text display 2002-09-08 09:23:45 +00:00
Bryce Denney
f0d1e765b5 - there were two calls to wxMutexGuiLeave()...bad! 2002-09-06 16:59:54 +00:00
Bryce Denney
70d0a6b844 - now that wxmain.h class definition includes a few dialogs from wxdialog.h,
wxdialog must come first.
2002-09-06 14:40:22 +00:00
Bryce Denney
47d7669685 - remove a huge chunk of obsolete code 2002-09-06 04:43:03 +00:00
Bryce Denney
17624e7549 - clean up memory usage after bx_gui_c::get_clipboard_text for win32,
X windows, wxWindows.  Each platform has its own way of returning
  a variable length string, and its own rules about how you're supposed
  to dispose of the string.  Now all platforms do the same thing: they
  allocate a Bit8u buffer with C++ "new" and copy the clipboard data in,
  then release the clipboard data in the platform-specific correct way.
  The Bit8u buffer is sent to the keyboard code, which frees it with
  delete [] when finished.
- modified: gui/wx.cc gui/x.cc gui/win32.cc iodev/keyboard.cc
2002-09-05 15:57:37 +00:00
Bryce Denney
ce2f799033 - fix bug in key mapping. I typed BX_KEY_MINUS for two different keys. 2002-09-05 15:13:34 +00:00
Bryce Denney
28801ce9ff - implement clipboard functions for wxWindows
- enable keymapping for wxWindows, by inserting bx_keymap.loadKeymap(NULL)
  call in wx.cc
2002-09-05 13:38:44 +00:00
Bryce Denney
578cc09f55 - keypad5 is apparantly called GDK_KP_Begin on my keyboard 2002-09-05 06:08:47 +00:00
Bryce Denney
137e132371 - add a bunch of missing key codes for MSW. These will only be used if
wxHAS_RAW_KEY_CODES is not available in the wxWindows library.
  my patch "patch.wx-raw-keycodes" adds wxHAS_RAW_KEY_CODES to the wxWindows
  library, and it will also be in wxWindows 2.3.3 and beyond.
2002-09-04 19:14:08 +00:00
Bryce Denney
5596107acb - (hopefully) solves a thread deadlock problem that showed up occasionally
on win32.  I believe this is the same problem that scarlip referred to as
  "it doesn't start reliably. sometimes it works, sometimes it won't".
  See comments in gui/wx.cc (dimension_update) for details.
- since dimension_update is called from the simulator thread, it needs to
  get the GUI mutex before calling any wxWindows functions.  Now it does.
- add lots of IFDBG_VGA(...) lines which I use to diagnose various problems.
  They are compiled away by default (for performance).  See definition of
  IFDBG_VGA() in gui/wxmain.h.
2002-09-04 15:51:04 +00:00
Volker Ruppert
dfe902554a - text mode cursor size feature implemented 2002-09-01 07:32:03 +00:00
Volker Ruppert
c3d63b2e81 - in function DrawBochsBitmap(): use the system palette instead of fixed values
- in function fillBxKeyEvent_MSW(): simplified the detection of extended scancodes
- in function text_update(): fixed a warning
2002-08-30 17:39:14 +00:00
Bryce Denney
77f87fbbca - to convince gcc -MM to ignore system headers, I had to change some
#include statements that used ""'s so that they used <>'s instead.
  (gcc -MM generates the dependency list in the Makefile.)
2002-08-30 07:03:50 +00:00
Bryce Denney
7ce3b36770 - get rid of the not-so-great name CUI which I introduced a few days
ago.  Now we have the simulator, the siminterface, the VGA display
  window (VGAW), and the configuration interface (CI).
2002-08-29 14:59:37 +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
6055c158e9 - wx gui menu functions "Read Configuration" and "Save Configuration" implemented
- loading default bochsrc for the wx gui no longer necessary
- the wx gui version of bochs now accepts the same command line arguments as
  the other guis
2002-08-25 15:51:46 +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
462871fd3a - Improvements for dimension_update() in text mode and text_update()
- The emulated vga card issues a dimension_update() using the real
    screen dimensions and the real font height.

  - The gui selects a font with the requested height or it recalculates
    the screen height if the font height is not available.

  - The text_update() function uses a new variable 'ncols' instead of the
    fixed value of 80 for the number of text columns.

  I have tested the changes with X11/Linux, SDL, wxGTK and win32. The changes
  in the other guis are not tested yet.
2002-04-20 07:19:35 +00:00
Volker Ruppert
189c1bbddc - text cursor disable feature added 2002-04-18 18:36:02 +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