- the changes are present in CVS and these files are no longer needed

This commit is contained in:
Volker Ruppert 2002-08-25 09:12:55 +00:00
parent 95771fe0e5
commit 28e06c07a0
3 changed files with 0 additions and 752 deletions

View File

@ -1,225 +0,0 @@
----------------------------------------------------------------------
Patch name: patch.fhs
Author: Robert Millan
Date: May, 16th 2002
Detailed description:
see patch [ 551811 ]
Location of some files on Bochs installation breaks the
Filesystem Hierrachy Standard, to be found at:
http://www.pathname.com/fhs/
It is important to comply with FHS because most
distributions require it in order to accept packages.
We have to change some more files to make them work with the new file
locations. (Volker)
Patch was created with:
diff -u
Apply patch to what version:
CVS as May, 16th 2002
Instructions:
To patch, go to main bochs directory.
Type "patch -p0 < THIS_PATCH_FILE".
----------------------------------------------------------------------
diff -u -r1.68 Makefile.in
--- Makefile.in 18 Apr 2002 00:22:18 -0000 1.68
+++ Makefile.in 15 May 2002 09:06:13 -0000
@@ -30,19 +30,21 @@
bindir = @bindir@
mandir = @mandir@
man1dir = $(mandir)/man1
+docdir = $(prefix)/share/doc/bochs
+sharedir = $(prefix)/share/bochs
DESTDIR =
VERSION=@VERSION@
VER_STRING=@VER_STRING@
REL_STRING=@REL_STRING@
-BOCHSDIR=$(prefix)/bochs
-VERSIONDIR=$(BOCHSDIR)/$(VERSION)
MAN_PAGE_LIST=bochs bochsrc bximage bochs-dlx
-INSTALL_LIST=bios/BIOS-* CHANGES COPYING README bios/VGABIOS* bochs bochsdbg bximage @INSTALL_LIST_FOR_PLATFORM@
+INSTALL_LIST_SHARE=bios/BIOS-* bios/VGABIOS* @INSTALL_LIST_FOR_PLATFORM@
+INSTALL_LIST_DOC=CHANGES COPYING README
+INSTALL_LIST_BIN=bochs bochsdbg bximage $(srcdir)/build/linux/bochs-docs
+INSTALL_LIST=$(INSTALL_LIST_SHARE) $(INSTALL_LIST_DOC) $(INSTALL_LIST_BIN)
INSTALL_LIST_X11=install-x11-fonts test-x11-fonts
INSTALL_LIST_SED=DOC-linux.html
-BOCHS_SCRIPTS=bochs-docs
CP=cp
CAT=cat
RM=rm
@@ -58,7 +60,7 @@
RMDIR=rmdir
TAR=tar
CHMOD=chmod
-GZIP=gzip
+GZIP=gzip -9
GUNZIP=gunzip
ZIP=zip
UNIX2DOS=unix2dos
@@ -287,35 +289,31 @@
# install target for unix
#####################################################################
-install_unix: install_bin install_man install_fonts unpack_dlx install_dlx
-
-install_fonts::
- -srcdir=$(srcdir) $(VERSIONDIR)/install-x11-fonts
+install_unix: install_bin install_man install_share install_doc
install_bin::
- -mkdir -p $(DESTDIR)$(BOCHSDIR)
- -mkdir -p $(DESTDIR)$(VERSIONDIR)
- -mkdir -p $(DESTDIR)$(bindir)
- test -d $(DESTDIR)$(VERSIONDIR)
- test -w $(DESTDIR)$(VERSIONDIR)
- for i in bochs-docs; do cp $(srcdir)/build/linux/$$i $(DESTDIR)$(bindir)/$$i; $(CHMOD) 755 $(DESTDIR)$(bindir)/$$i; done
- for i in $(INSTALL_LIST_SED); do cp $(srcdir)/build/linux/$$i $(DESTDIR)$(VERSIONDIR)/$$i; $(CHMOD) 644 $(DESTDIR)$(VERSIONDIR)/$$i; done
+ for i in $(DESTDIR)$(bindir); do mkdir -p $$i && test -d $$i && test -w $$i; done
$(CHMOD) a+x install-x11-fonts test-x11-fonts
- for i in $(INSTALL_LIST); do if test -f $$i; then cp $$i $(DESTDIR)$(VERSIONDIR); else cp $(srcdir)/$$i $(DESTDIR)$(VERSIONDIR); fi; done
- $(LN_S) $(VERSIONDIR)/bochs $(DESTDIR)$(bindir)/bochs
- $(LN_S) $(VERSIONDIR)/bximage $(DESTDIR)$(bindir)/bximage
- $(CP) -r $(srcdir)/docs-html $(DESTDIR)$(VERSIONDIR)
- $(CP) -r $(srcdir)/gui/keymaps $(DESTDIR)$(VERSIONDIR)
- $(RM) -f $(DESTDIR)$(VERSIONDIR)/README
- $(CAT) $(srcdir)/build/linux/README.linux-binary $(srcdir)/README > $(DESTDIR)$(VERSIONDIR)/README
- $(CP) $(srcdir)/font/vga.pcf $(DESTDIR)$(VERSIONDIR)
- $(CP) $(srcdir)/.bochsrc $(DESTDIR)$(VERSIONDIR)/bochsrc-sample.txt
- $(RM) -f $(DESTDIR)$(BOCHSDIR)/latest
- $(LN_S) $(VERSION) $(DESTDIR)$(BOCHSDIR)/latest
+ for i in $(INSTALL_LIST_BIN); do if test -f $$i; then cp $$i $(DESTDIR)$(bindir); else cp $(srcdir)/$$i $(DESTDIR)$(bindir); fi; done
+
+install_share::
+ for i in $(DESTDIR)$(sharedir); do mkdir -p $$i && test -d $$i && test -w $$i; done
+ for i in $(INSTALL_LIST_SHARE); do if test -f $$i; then cp $$i $(DESTDIR)$(sharedir); else cp $(srcdir)/$$i $(DESTDIR)$(sharedir); fi; done
+ $(CP) -r $(srcdir)/gui/keymaps $(DESTDIR)$(sharedir)
+ $(CP) $(srcdir)/font/vga.pcf $(DESTDIR)$(sharedir)/vga.pcf
+
+install_doc::
+ for i in $(DESTDIR)$(docdir); do mkdir -p $$i && test -d $$i && test -w $$i; done
+ for i in $(INSTALL_LIST_SED); do install -m644 $(srcdir)/build/linux/$$i $(DESTDIR)$(docdir)/$$i; done
+ for i in $(INSTALL_LIST_DOC); do if test -f $$i; then cp $$i $(DESTDIR)$(docdir); else cp $(srcdir)/$$i $(DESTDIR)$(docdir); fi; done
+ $(CP) -r $(srcdir)/docs-html $(DESTDIR)$(docdir)
+ $(RM) -f $(DESTDIR)$(docdir)/README
+ $(CAT) $(srcdir)/build/linux/README.linux-binary $(srcdir)/README > $(DESTDIR)$(docdir)/README
+ $(CP) $(srcdir)/.bochsrc $(DESTDIR)$(docdir)/bochsrc-sample.txt
install_man::
-mkdir -p $(DESTDIR)$(man1dir)
- for i in $(MAN_PAGE_LIST); do cat $(srcdir)/doc/man/$$i.1 | $(SED) -e 's/@VERSION@/$(VERSION)/g' > $(DESTDIR)$(man1dir)/$$i.1; chmod 644 $(DESTDIR)$(man1dir)/$$i.1; done
+ for i in $(MAN_PAGE_LIST); do cat $(srcdir)/doc/man/$$i.1 | $(SED) 's/@VERSION@/$(VERSION)/g' | $(GZIP) -c > $(DESTDIR)$(man1dir)/$$i.1.gz; chmod 644 $(DESTDIR)$(man1dir)/$$i.1.gz; done
download_dlx: $(DLXLINUX_TAR)
@@ -331,20 +329,18 @@
(cd dlxlinux; $(MV) bochsrc.txt bochsrc.txt.orig; $(SED) -e "s/1\.1\.2/$(VERSION)/g" -e 's,/usr/local,$(prefix),g' < bochsrc.txt.orig > bochsrc.txt; rm -f bochsrc.txt.orig)
install_dlx:
- $(RM) -rf $(BOCHSDIR)/dlxlinux
- cp -r dlxlinux $(BOCHSDIR)/dlxlinux
- $(CHMOD) 755 $(BOCHSDIR)/dlxlinux
- $(GZIP) $(BOCHSDIR)/dlxlinux/hd10meg.img
- $(CHMOD) 644 $(BOCHSDIR)/dlxlinux/*
- for i in bochs-dlx; do cp $(srcdir)/build/linux/$$i $(bindir)/$$i; $(CHMOD) 755 $(bindir)/$$i; done
+ $(RM) -rf $(DESTDIR)$(sharedir)/dlxlinux
+ cp -r dlxlinux $(DESTDIR)$(sharedir)/dlxlinux
+ $(CHMOD) 755 $(DESTDIR)$(sharedir)/dlxlinux
+ $(GZIP) $(DESTDIR)$(sharedir)/dlxlinux/hd10meg.img
+ $(CHMOD) 644 $(DESTDIR)$(sharedir)/dlxlinux/*
+ for i in bochs-dlx; do cp $(srcdir)/build/linux/$$i $(bindir)/$$i; $(CHMOD) 755 $(DESTDIR)$(bindir)/$$i; done
uninstall::
- $(RM) -rf $(VERSIONDIR)
- $(RM) -rf $(BOCHSDIR)/dlxlinux
- $(RM) -rf $(BOCHSDIR)/latest
- -$(RMDIR) $(BOCHSDIR)
+ $(RM) -rf $(DESTDIR)$(sharedir)
+ $(RM) -rf $(DESTDIR)$(docdir)
for i in bochs bximage bochs-dlx $(BOCHS_SCRIPTS); do rm -f $(DESTDIR)$(bindir)/$$i; done
- for i in $(MAN_PAGE_LIST); do $(RM) -f $(man1dir)/$$i.1; done
+ for i in $(MAN_PAGE_LIST); do $(RM) -f $(man1dir)/$$i.1.gz; done
V6WORKSPACE_ZIP=build/win32/workspace.zip
V6WORKSPACE_FILES=bochs.dsw bochs.dsp bochs.opt cpu/cpu.dsp \
diff -urN ../bochs/build/linux/bochs-dlx.in ./build/linux/bochs-dlx.in
--- ../bochs/build/linux/bochs-dlx.in Fri Dec 7 16:46:13 2001
+++ ./build/linux/bochs-dlx.in Wed Jun 26 21:08:22 2002
@@ -1,6 +1,6 @@
#!/bin/sh
BOCHS=@prefix@/bin/bochs
-DLXINST=@prefix@/bochs/dlxlinux
+DLXINST=@prefix@/share/bochs/dlxlinux
GZIP=@GZIP@
if [ ! -z $1 ]; then
DLXPATH=$1
diff -urN ../bochs/build/linux/bochs-docs.in ./build/linux/bochs-docs.in
--- ../bochs/build/linux/bochs-docs.in Fri May 31 09:57:56 2002
+++ ./build/linux/bochs-docs.in Wed Jun 26 18:41:55 2002
@@ -1,6 +1,6 @@
#!/bin/sh
BROWSER=netscape
-URL=@prefix@/bochs/@VERSION@/DOC-linux.html
+URL=@prefix@/share/doc/bochs/DOC-linux.html
MY_PATH=@prefix@/bin/bochs-docs
cat <<EOF
diff -urN ../bochs/build/redhat/bochs.rpmspec.template ./build/redhat/bochs.rpmspec.template
--- ../bochs/build/redhat/bochs.rpmspec.template Sun Dec 9 00:38:55 2001
+++ ./build/redhat/bochs.rpmspec.template Wed Jun 26 18:42:43 2002
@@ -34,31 +34,26 @@
for i in "" usr usr/bin usr/man usr/man/man1; do
if ! test -d $RPM_BUILD_ROOT/$i; then mkdir $RPM_BUILD_ROOT/$i; fi
done
- make install_bin install_man install_fonts install_dlx prefix=$RPM_BUILD_ROOT/usr
- # fix up symlinks that point to buildroot
- cd $RPM_BUILD_ROOT/usr/bin
- rm -f bochs; ln -sf /usr/bochs/@SEDVERSION@/bochs .
- rm -f bximage; ln -sf /usr/bochs/@SEDVERSION@/bximage .
+ make install install_dlx prefix=$RPM_BUILD_ROOT/usr
%files
/usr/bin/bochs
/usr/bin/bochs-docs
/usr/bin/bochs-dlx
/usr/bin/bximage
- /usr/bochs/@SEDVERSION@
- /usr/bochs/dlxlinux
- /usr/bochs/latest
- /usr/man/man1/*
+ /usr/share/bochs/*
+ /usr/share/doc/*
+ /usr/man/*
%clean
rm -rf $RPM_BUILD_DIR/bochs-@SEDVERSION@
if test "/" != $RPM_BUILD_ROOT; then
rm -rf $RPM_BUILD_ROOT
fi
%post
- /usr/bochs/@SEDVERSION@/install-x11-fonts
+ /usr/share/bochs/install-x11-fonts
%preun
# clean up the bochsout.txt that is always produced if you
# run bochs-dlx.
- rm -rf /usr/bochs/dlxlinux/bochsout.txt core
+ rm -rf /usr/share/bochs/dlxlinux/bochsout.txt core
%postun
- rmdir /usr/bochs > /dev/null 2>&1
+ rmdir /usr/share/bochs > /dev/null 2>&1
diff -urN ../bochs/install-x11-fonts.in ./install-x11-fonts.in
--- ../bochs/install-x11-fonts.in Mon Mar 18 12:39:57 2002
+++ ./install-x11-fonts.in Wed Jun 26 18:35:53 2002
@@ -9,7 +9,7 @@
X11_FONT_PATH_CHOICES="/usr/X11R6/lib/X11/fonts /usr/local/lib/X11/fonts /usr/lib/X11/fonts /usr/openwin/lib/X11/fonts"
FONTS=vga.pcf
-FONT_SOURCE_PATH_CHOICES="font ${srcdir+$srcdir/font} @prefix@/bochs/latest"
+FONT_SOURCE_PATH_CHOICES="font ${srcdir+$srcdir/font} @prefix@/share/bochs"
die () {
cat <<EOF

View File

@ -1,87 +0,0 @@
----------------------------------------------------------------------
Patch name: patch.include-config
Author: Volker Ruppert
Date: August 16th 2002
Detailed description:
This patch adds include support for configuration files. Now you can store
platform and installation dependent values in a global configuration file.
If you are including such a file, you only need to define the disk images and
other guest OS dependent stuff. This is an example:
#include /etc/bochsrc
floppyb: 1_44=floppyb.img, status=inserted
diskc: file=c.img, cyl=20, heads=16, spt=63
Patch was created with:
diff -u
Apply patch to what version:
cvs checked out on DATE
Instructions:
To patch, go to main bochs directory.
Type "patch -p0 < THIS_PATCH_FILE".
----------------------------------------------------------------------
diff -urN ../bochs/main.cc main.cc
--- bochs/main.cc Mon Aug 12 18:19:28 2002
+++ bochs-current/main.cc Thu Aug 15 10:34:22 2002
@@ -30,6 +30,7 @@
#include "state_file.h"
int enable_control_panel = 1;
+int bochsrc_include_count = 0;
extern "C" {
#include <signal.h>
@@ -1541,6 +1542,8 @@
// try several possibilities for the bochsrc before giving up
+ bochsrc_include_count++;
+
fd = fopen (rcfile, "r");
if (fd == NULL) return -1;
@@ -1555,6 +1558,7 @@
}
} while (!feof(fd));
fclose(fd);
+ bochsrc_include_count--;
return 0;
}
@@ -1581,7 +1585,10 @@
num_params = 0;
- ptr = strtok(line, ":");
+ if (!strncmp(line, "#include", 8))
+ ptr = strtok(line, " ");
+ else
+ ptr = strtok(line, ":");
while (ptr) {
string_i = 0;
for (i=0; i<strlen(ptr); i++) {
@@ -1648,7 +1655,22 @@
if (num_params < 1) return;
- if (params[0][0] == '#') return; /* comment */
+ if (!strcmp(params[0], "#include")) {
+ if (num_params != 2) {
+ BX_ERROR(("%s: ignoring malformed #include directive.", context));
+ return;
+ }
+ if (!strcmp(params[1], context)) {
+ BX_ERROR(("%s: cannot include this file again.", context));
+ return;
+ }
+ if (bochsrc_include_count == 2) {
+ BX_ERROR(("%s: include directive in an included file not supported yet.", context));
+ return;
+ }
+ bx_read_configuration(params[1]);
+ }
+ else if (params[0][0] == '#') return; /* comment */
else if (!strcmp(params[0], "floppya")) {
for (i=1; i<num_params; i++) {
if (!strncmp(params[i], "2_88=", 5)) {

View File

@ -1,440 +0,0 @@
----------------------------------------------------------------------
Patch name: patch.userbutton
Author: Volker Ruppert
Date: August 6th 2002
Detailed description:
This patch adds a headerbar button that 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
The changes are present in CVS now.
Patch was created with:
diff -u
Apply patch to what version:
cvs checked out on DATE
Instructions:
To patch, go to main bochs directory.
Type "patch -p0 < THIS_PATCH_FILE".
----------------------------------------------------------------------
diff -urN ../bochs/.bochsrc ./.bochsrc
--- ../bochs/.bochsrc Fri Aug 2 07:41:04 2002
+++ ./.bochsrc Thu Aug 8 00:14:01 2002
@@ -447,6 +447,17 @@
#keyboard_type: mf
#=======================================================================
+# USER_SHORTCUT:
+# This defines the keyboard shortcut to be sent when you press the "user"
+# button in the headerbar. These shortcuts are currently recognized:
+# ctrlaltdel, ctrlaltesc, ctrlaltf1, alttab
+#
+# Example:
+# user_shortcut: keys=ctrlaltdel
+#=======================================================================
+#user_shortcut: keys=ctrlaltdel
+
+#=======================================================================
# other stuff
#=======================================================================
# magic_break
diff -urN ../bochs/bochs.h ./bochs.h
--- ../bochs/bochs.h Thu Aug 1 09:34:58 2002
+++ ./bochs.h Thu Aug 8 00:14:01 2002
@@ -660,6 +660,7 @@
bx_load32bitOSImage_t load32bitOSImage;
bx_log_options log;
bx_keyboard_options keyboard;
+ bx_param_string_c *Ouser_shortcut;
} bx_options_t;
extern bx_options_t bx_options;
diff -urN ../bochs/gui/bitmaps/userbutton.h ./gui/bitmaps/userbutton.h
--- ../bochs/gui/bitmaps/userbutton.h Thu Jan 1 01:00:00 1970
+++ ./gui/bitmaps/userbutton.h Thu Aug 8 00:14:02 2002
@@ -0,0 +1,19 @@
+/////////////////////////////////////////////////////////////////////////
+// $Id: patch.userbutton,v 1.4 2002-08-09 07:41:43 vruppert Exp $
+/////////////////////////////////////////////////////////////////////////
+#define BX_USER_BMAP_X 32
+#define BX_USER_BMAP_Y 32
+
+static const unsigned char bx_user_bmap[BX_USER_BMAP_X*BX_USER_BMAP_Y/8] = {
+ 0x00, 0x00, 0x00, 0x00, 0x84, 0x78, 0x9e, 0x07, 0x84, 0x04, 0x82, 0x08,
+ 0x84, 0x04, 0x82, 0x08, 0x84, 0x38, 0x9e, 0x07, 0x84, 0x40, 0x82, 0x01,
+ 0x84, 0x40, 0x82, 0x06, 0x78, 0x3c, 0x9e, 0x08, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x1c,
+ 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x80, 0x00,
+ 0x00, 0x00, 0x80, 0x00, 0xfe, 0xff, 0xff, 0x3f, 0x02, 0x00, 0x00, 0x20,
+ 0xaa, 0xaa, 0x2a, 0x2a, 0x02, 0x00, 0x00, 0x20, 0x02, 0x00, 0x00, 0x20,
+ 0xaa, 0xaa, 0xaa, 0x2a, 0x52, 0x55, 0x11, 0x25, 0xaa, 0xaa, 0xaa, 0x2a,
+ 0x52, 0x55, 0x01, 0x25, 0xaa, 0xaa, 0x82, 0x2a, 0x52, 0x55, 0x11, 0x25,
+ 0xaa, 0xbf, 0xaa, 0x2a, 0x02, 0x00, 0x00, 0x20, 0xfe, 0xff, 0xff, 0x3f,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+ };
diff -urN ../bochs/gui/bitmaps/userbutton.xpm ./gui/bitmaps/userbutton.xpm
--- ../bochs/gui/bitmaps/userbutton.xpm Thu Jan 1 01:00:00 1970
+++ ./gui/bitmaps/userbutton.xpm Thu Aug 8 00:22:23 2002
@@ -0,0 +1,40 @@
+/* XPM */
+static char *userbutton_xpm[] = {
+/* columns rows colors chars-per-pixel */
+"32 32 2 1",
+" c black",
+". c white",
+/* pixels */
+"................................",
+".. .... ... .. .. .....",
+".. .... .. ...... ..... ... ....",
+".. .... .. ...... ..... ... ....",
+".. .... ... ... .. .....",
+".. .... ...... .. ..... .......",
+".. .... ...... .. ..... . .....",
+"... ... ... .. ... ....",
+"................................",
+"................................",
+"............................. ..",
+".......................... ...",
+"......................... ......",
+"........................ .......",
+"....................... ........",
+"....................... ........",
+". ..",
+". ........................... ..",
+". . . . . . . . . . . ... . . ..",
+". ........................... ..",
+". ........................... ..",
+". . . . . . . . . . . . . . . ..",
+". .. . . . . . . ... ... . .. ..",
+". . . . . . . . . . . . . . . ..",
+". .. . . . . . . ....... . .. ..",
+". . . . . . . . . ..... . . . ..",
+". .. . . . . . . ... ... . .. ..",
+". . . . . . . . . . . . ..",
+". ........................... ..",
+". ..",
+"................................",
+"................................"
+};
diff -urN ../bochs/gui/control.cc ./gui/control.cc
--- ../bochs/gui/control.cc Wed Aug 7 09:24:32 2002
+++ ./gui/control.cc Thu Aug 8 00:14:02 2002
@@ -368,11 +368,12 @@
"7. VGA Update Interval: %d\n"
"8. Mouse: %s\n"
"9. Keyboard paste delay: %d\n"
-"10. Instruction tracing: off (doesn't exist yet)\n"
-"11. Continue simulation\n"
-"12. Quit now\n"
+"10. Userbutton shortcut: %s\n"
+"11. Instruction tracing: off (doesn't exist yet)\n"
+"12. Continue simulation\n"
+"13. Quit now\n"
"\n"
-"Please choose one: [11] ";
+"Please choose one: [12] ";
char *menu_prompt_list[BX_CPANEL_N_MENUS] = {
ask_about_control_panel,
@@ -421,7 +422,8 @@
/* ips->get (), */
SIM->get_param_num (BXP_VGA_UPDATE_INTERVAL)->get (),
SIM->get_param_num (BXP_MOUSE_ENABLED)->get () ? "enabled" : "disabled",
- SIM->get_param_num (BXP_KBD_PASTE_DELAY)->get ());
+ SIM->get_param_num (BXP_KBD_PASTE_DELAY)->get (),
+ SIM->get_param_string (BXP_USER_SHORTCUT)->getptr ());
}
int do_menu (bx_id id) {
@@ -511,7 +513,7 @@
bx_floppy_options floppyop;
bx_cdrom_options cdromop;
build_runtime_options_prompt (runtime_menu_prompt, prompt, 1024);
- if (ask_uint (prompt, 1, 12, 11, &choice, 10) < 0) return -1;
+ if (ask_uint (prompt, 1, 13, 12, &choice, 10) < 0) return -1;
switch (choice) {
case 1:
SIM->get_floppy_options (0, &floppyop);
@@ -534,9 +536,10 @@
case 7: askparam (BXP_VGA_UPDATE_INTERVAL); break;
case 8: askparam (BXP_MOUSE_ENABLED); break;
case 9: askparam (BXP_KBD_PASTE_DELAY); break;
- case 10: NOT_IMPLEMENTED (choice); break;
- case 11: fprintf (stderr, "Continuing simulation\n"); return 0;
- case 12:
+ case 10: askparam (BXP_USER_SHORTCUT); break;
+ case 11: NOT_IMPLEMENTED (choice); break;
+ case 12: fprintf (stderr, "Continuing simulation\n"); return 0;
+ case 13:
fprintf (stderr, "You chose quit on the control panel.\n");
SIM->quit_sim (1);
return -1;
diff -urN ../bochs/gui/gui.cc ./gui/gui.cc
--- ../bochs/gui/gui.cc Sun Aug 4 10:42:34 2002
+++ ./gui/gui.cc Thu Aug 8 00:14:02 2002
@@ -37,6 +37,7 @@
#include "gui/bitmaps/paste.h"
#include "gui/bitmaps/configbutton.h"
#include "gui/bitmaps/cdromd.h"
+#include "gui/bitmaps/userbutton.h"
#if BX_WITH_MACOS
# include <Disks.h>
#endif
@@ -82,6 +83,7 @@
BX_GUI_THIS copy_bmap_id = create_bitmap(bx_copy_bmap, BX_COPY_BMAP_X, BX_COPY_BMAP_Y);
BX_GUI_THIS paste_bmap_id = create_bitmap(bx_paste_bmap, BX_PASTE_BMAP_X, BX_PASTE_BMAP_Y);
BX_GUI_THIS config_bmap_id = create_bitmap(bx_config_bmap, BX_CONFIG_BMAP_X, BX_CONFIG_BMAP_Y);
+ BX_GUI_THIS user_bmap_id = create_bitmap(bx_user_bmap, BX_USER_BMAP_X, BX_USER_BMAP_Y);
// Add the initial bitmaps to the headerbar, and enable callback routine, for use
@@ -145,6 +147,9 @@
// Copy button
BX_GUI_THIS copy_hbar_id = headerbar_bitmap(BX_GUI_THIS copy_bmap_id,
BX_GRAVITY_RIGHT, copy_handler);
+ // User button
+ BX_GUI_THIS user_hbar_id = headerbar_bitmap(BX_GUI_THIS user_bmap_id,
+ BX_GRAVITY_RIGHT, userbutton_handler);
show_headerbar();
}
@@ -389,6 +394,53 @@
int old = bx_options.Omouse_enabled->get ();
BX_DEBUG (("toggle mouse_enabled, now %d", !old));
bx_options.Omouse_enabled->set (!old);
+}
+
+ void
+bx_gui_c::userbutton_handler(void)
+{
+ unsigned shortcut[4];
+ char *user_shortcut;
+ int i, len;
+
+ len = 0;
+ user_shortcut = bx_options.Ouser_shortcut->getptr();
+ i = 0;
+ if (user_shortcut[0] && (strcmp(user_shortcut, "none"))) {
+ if (!strcmp(user_shortcut, "ctrlaltdel")) {
+ shortcut[0] = BX_KEY_CTRL_L;
+ shortcut[1] = BX_KEY_ALT_L;
+ shortcut[2] = BX_KEY_DELETE;
+ len = 3;
+ }
+ else if (!strcmp(user_shortcut, "ctrlaltesc")) {
+ shortcut[0] = BX_KEY_CTRL_L;
+ shortcut[1] = BX_KEY_ALT_L;
+ shortcut[2] = BX_KEY_ESC;
+ len = 3;
+ }
+ else if (!strcmp(user_shortcut, "ctrlaltf1")) {
+ shortcut[0] = BX_KEY_CTRL_L;
+ shortcut[1] = BX_KEY_ALT_L;
+ shortcut[2] = BX_KEY_F1;
+ len = 3;
+ }
+ else if (!strcmp(user_shortcut, "alttab")) {
+ shortcut[0] = BX_KEY_ALT_L;
+ shortcut[1] = BX_KEY_TAB;
+ len = 2;
+ }
+ else {
+ BX_ERROR(("Unknown shortcut %s ignored", user_shortcut));
+ }
+ while (i < len) {
+ bx_devices.keyboard->gen_scancode(shortcut[i++]);
+ }
+ i--;
+ while (i >= 0) {
+ bx_devices.keyboard->gen_scancode(shortcut[i--] | BX_KEY_RELEASED);
+ }
+ }
}
void
diff -urN ../bochs/gui/gui.h ./gui/gui.h
--- ../bochs/gui/gui.h Sat Apr 20 09:19:35 2002
+++ ./gui/gui.h Thu Aug 8 00:14:02 2002
@@ -83,6 +83,7 @@
static void snapshot_handler(void);
static void config_handler(void);
static void toggle_mouse_enable(void);
+ static void userbutton_handler(void);
static Bit32s make_text_snapshot (char **snapshot, Bit32u *length);
Boolean floppyA_status;
@@ -98,11 +99,12 @@
unsigned snapshot_bmap_id, snapshot_hbar_id;
unsigned config_bmap_id, config_hbar_id;
unsigned mouse_bmap_id, nomouse_bmap_id, mouse_hbar_id;
+ unsigned user_bmap_id, user_hbar_id;
};
#define BX_MAX_PIXMAPS 16
-#define BX_MAX_HEADERBAR_ENTRIES 10
+#define BX_MAX_HEADERBAR_ENTRIES 11
#define BX_HEADER_BAR_Y 32
// align pixmaps towards left or right side of header bar
diff -urN ../bochs/gui/siminterface.h ./gui/siminterface.h
--- ../bochs/gui/siminterface.h Sun Aug 4 10:42:34 2002
+++ ./gui/siminterface.h Thu Aug 8 00:27:51 2002
@@ -158,6 +158,7 @@
BXP_KEYBOARD_USEMAPPING,
BXP_KEYBOARD_MAP,
BXP_KEYBOARD,
+ BXP_USER_SHORTCUT,
BXP_ASK_FOR_PATHNAME, // for general file selection dialog
BXP_THIS_IS_THE_LAST // used to determine length of list
} bx_id;
@@ -173,7 +174,8 @@
BX_TOOLBAR_PASTE,
BX_TOOLBAR_SNAPSHOT,
BX_TOOLBAR_CONFIG,
- BX_TOOLBAR_MOUSE_EN
+ BX_TOOLBAR_MOUSE_EN,
+ BX_TOOLBAR_USER
} bx_toolbar_buttons;
// Log level defines
diff -urN ../bochs/gui/wx.cc ./gui/wx.cc
--- ../bochs/gui/wx.cc Sat Apr 20 09:19:35 2002
+++ ./gui/wx.cc Thu Aug 8 09:31:24 2002
@@ -612,6 +612,7 @@
case BX_TOOLBAR_SNAPSHOT: snapshot_handler (); break;
case BX_TOOLBAR_CONFIG: config_handler (); break;
case BX_TOOLBAR_MOUSE_EN: toggle_mouse_enable (); break;
+ case BX_TOOLBAR_USER: userbutton_handler (); break;
default:
wxLogDebug ("unknown toolbar id %d", event_queue[i].u.toolbar.button);
}
diff -urN ../bochs/gui/wxmain.cc ./gui/wxmain.cc
--- ../bochs/gui/wxmain.cc Sat Jun 1 17:44:54 2002
+++ ./gui/wxmain.cc Thu Aug 8 09:32:53 2002
@@ -55,6 +55,7 @@
#include "bitmaps/snapshot.xpm"
#include "bitmaps/mouse.xpm"
#include "bitmaps/configbutton.xpm"
+#include "bitmaps/userbutton.xpm"
// FIXME: ugly global variables that the bx_gui_c object in wx.cc can use
// to access the MyFrame and the MyPanel.
@@ -96,7 +97,8 @@
ID_Toolbar_Paste,
ID_Toolbar_Snapshot,
ID_Toolbar_Config,
- ID_Toolbar_Mouse_en
+ ID_Toolbar_Mouse_en,
+ ID_Toolbar_User
};
//////////////////////////////////////////////////////////////////////
@@ -174,6 +176,7 @@
EVT_TOOL(ID_Toolbar_Snapshot, MyFrame::OnToolbarClick)
EVT_TOOL(ID_Toolbar_Config, MyFrame::OnToolbarClick)
EVT_TOOL(ID_Toolbar_Mouse_en, MyFrame::OnToolbarClick)
+ EVT_TOOL(ID_Toolbar_User, MyFrame::OnToolbarClick)
END_EVENT_TABLE()
@@ -253,6 +256,7 @@
BX_ADD_TOOL(ID_Toolbar_Snapshot, snapshot_xpm, "Save screen snapshot");
BX_ADD_TOOL(ID_Toolbar_Config, configbutton_xpm, "Runtime Configuration");
BX_ADD_TOOL(ID_Toolbar_Mouse_en, mouse_xpm, "Mouse Enable/Disable");
+ BX_ADD_TOOL(ID_Toolbar_User, userbutton_xpm, "Keyboard shortcut");
tb->Realize();
@@ -540,6 +544,7 @@
case ID_Toolbar_Snapshot: which = BX_TOOLBAR_SNAPSHOT; break;
case ID_Toolbar_Config: which = BX_TOOLBAR_CONFIG; break;
case ID_Toolbar_Mouse_en: which = BX_TOOLBAR_MOUSE_EN; break;
+ case ID_Toolbar_User: which = BX_TOOLBAR_USER; break;
default:
wxLogError ("unknown toolbar id %d", id);
}
diff -urN ../bochs/gui/x.cc ./gui/x.cc
--- ../bochs/gui/x.cc Sat May 18 18:02:20 2002
+++ ./gui/x.cc Thu Aug 8 00:14:02 2002
@@ -1245,15 +1245,23 @@
bx_gui_c::show_headerbar(void)
{
unsigned xorigin;
+ int xleft, xright;
// clear header bar area to white
XFillRectangle(bx_x_display, win, gc_headerbar_inv, 0,0, dimension_x, bx_headerbar_y);
+ xleft = 0;
+ xright = dimension_x;
for (unsigned i=0; i<bx_headerbar_entries; i++) {
- if (bx_headerbar_entry[i].alignment == BX_GRAVITY_LEFT)
+ if (bx_headerbar_entry[i].alignment == BX_GRAVITY_LEFT) {
xorigin = bx_headerbar_entry[i].xorigin;
- else
+ xleft += bx_headerbar_entry[i].xdim;
+ }
+ else {
xorigin = dimension_x - bx_headerbar_entry[i].xorigin;
+ xright = xorigin;
+ }
+ if (xright < xleft) break;
XCopyPlane(bx_x_display, bx_headerbar_entry[i].bitmap, win, gc_headerbar,
0,0, bx_headerbar_entry[i].xdim, bx_headerbar_entry[i].ydim,
xorigin, 0, 1);
diff -urN ../bochs/main.cc ./main.cc
--- ../bochs/main.cc Sun Aug 4 10:42:34 2002
+++ ./main.cc Thu Aug 8 00:14:02 2002
@@ -1023,6 +1023,12 @@
bx_options.Okeyboard_type->set_format ("Keyboard type: %s");
bx_options.Okeyboard_type->set_ask_format ("Enter keyboard type: [%s] ");
+ // Userbutton shortcut
+ bx_options.Ouser_shortcut = new bx_param_string_c (BXP_USER_SHORTCUT,
+ "Userbutton shortcut",
+ "Userbutton shortcut",
+ "none", 16);
+
bx_param_c *other_init_list[] = {
bx_options.Okeyboard_serial_delay,
bx_options.Okeyboard_paste_delay,
@@ -1035,6 +1041,7 @@
bx_options.keyboard.OuseMapping,
bx_options.keyboard.Okeymap,
bx_options.Okeyboard_type,
+ bx_options.Ouser_shortcut,
NULL
};
menu = new bx_list_c (BXP_MENU_MISC, "Configure Everything Else", "", other_init_list);
@@ -2357,7 +2364,15 @@
else if (!strncmp(params[i], "map=", 4)) {
bx_options.keyboard.Okeymap->set (strdup(&params[i][4]));
}
+ }
}
+ else if (!strcmp(params[0], "user_shortcut")) {
+ if (num_params != 2) {
+ BX_PANIC(("%s: user_shortcut directive: wrong # args.", context));
+ }
+ if(!strncmp(params[1], "keys=", 4)) {
+ bx_options.Ouser_shortcut->set (strdup(&params[1][5]));
+ }
}