home *** CD-ROM | disk | FTP | other *** search
- From: kent@ssbell.IMD.Sterling.COM (Kent Landfield)
- Newsgroups: comp.sources.x
- Subject: v05i066: dwim (Do What I Mean) patch for X11R4 TWM, Part01/01
- Message-ID: <647@ssbell.IMD.Sterling.COM>
- Date: 4 Feb 90 08:04:18 GMT
- Approved: kent@ssbell.IMD.Sterling.COM (Kent Landfield)
-
- Submitted-by: uunet!helios.TN.CORNELL.EDU!davidra
- Posting-number: Volume 5, Issue 66
- Archive-name: dwim/part01
-
-
- Here is the DWIM patch to TWM for X11R4; it requires the X11R4 distribution
- twm source and the well-known "patch" program.
-
- DWIM is an unofficial patch to TWM that seeks to make mice impotent and
- obsolete (to quote a former president). It does the following awful things
- to the "tab" ("Tom's") window manager:
-
- * xterm titles become numbers
- * it uses a .dwimrc* file instead of .twmrc*
- * if set up correctly (control-digit must be bound to f.nop), dwim
- lets the user go from one window to another by hitting control-digit.
- (For instance, control-4 causes the mouse to warp to near the upper
- right-hand corner of window 4, moves the focus to window 4, and
- raises window 4).
- * it draws fewer box outlines in the icon manager
- * it can generate artificial mouse button events. Unfortunately, it
- seems that almost all clients ignore artificial mouse button events.
- I know of one client on which these events work: xplot. Because
- this may not work on other clients, I have documented this feature
- only in the source code.
-
-
- Note that the old dwim (X11R3) works perfectly well on an X11R4 server and
- vice versa. (There may be one problem, but it's in the server, not
- twm/dwim -- black and white are reversed on BorderColor for a monochrome
- display).
-
- Note one bug fix in TWM X11R4 that of course carries over to DWIM: previously,
- to bind a key or mouse button with two modifiers, one gave the two modifier
- characters without a vertical bar between them:
-
- "f" = cm : window : f.dwimpress "right"
-
- Now, the vertical bar is required syntax:
-
- "f" = c|m : window : f.dwimpress "right"
-
-
- Compilation note: people with antsy compilers may have to use -traditional
- (see the Makefile and Imakefile).
-
- David Rabson
- davidra@helios.tn.cornell.edu
- Laboratory of Atomic and Solid State Physics, Cornell University
-
- -----------------------------------------------------------------------------
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then unpack
- # it by saving it into a file and typing "sh file". To overwrite existing
- # files, type "sh file -c". You can also feed this as standard input via
- # unshar, or by typing "sh <file", e.g.. If this archive is complete, you
- # will see the following message at the end:
- # "End of shell archive."
- # Contents: dwim.patch
- # Wrapped by kent@ssbell on Sun Feb 4 01:56:59 1990
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f 'dwim.patch' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'dwim.patch'\"
- else
- echo shar: Extracting \"'dwim.patch'\" \(40231 characters\)
- sed "s/^X//" >'dwim.patch' <<'END_OF_FILE'
- Xdiff -c twm/Imakefile dwim/Imakefile
- X*** twm/Imakefile Thu Jan 18 12:51:00 1990
- X--- dwim/Imakefile Sat Jan 6 01:47:33 1990
- X***************
- X*** 1,5 ****
- X /**/#
- X! /**/#Here is an Imakefile for twm. It depends on having TWMDIR defined
- X /**/#in Imake.tmpl. I like to use Imakefiles for everything, and I am sure
- X /**/#other people do also, so perhaps you could do us all a favor and
- X /**/#distribute this one.
- X--- 1,7 ----
- X+ /**/# DWIM MODIFICATIONS David Rabson 1/90
- X+
- X /**/#
- X! /**/#Here is an Imakefile for dwim. It depends on having TWMDIR defined
- X /**/#in Imake.tmpl. I like to use Imakefiles for everything, and I am sure
- X /**/#other people do also, so perhaps you could do us all a favor and
- X /**/#distribute this one.
- X***************
- X*** 9,14 ****
- X--- 11,18 ----
- X #if !HasPutenv
- X PUTENVDEF = -DNOPUTENV
- X #endif
- X+ CC = gcc
- X+ CCOPTIONS = -O -finline-functions
- X
- X YFLAGS = -d
- X DEPLIBS = $(DEPXMULIB) $(DEPEXTENSIONLIB) $(DEPXLIB)
- X***************
- X*** 18,34 ****
- X
- X SRCS = gram.c lex.c deftwmrc.c add_window.c gc.c list.c twm.c \
- X parse.c menus.c events.c resize.c util.c version.c iconmgr.c \
- X! cursor.c icons.c
- X
- X OBJS = gram.o lex.o deftwmrc.o add_window.o gc.o list.o twm.o \
- X parse.o menus.o events.o resize.o util.o version.o iconmgr.o \
- X! cursor.o icons.o
- X
- X! AllTarget(twm)
- X
- X depend:: lex.c gram.c deftwmrc.c
- X
- X! ComplexProgramTarget(twm)
- X
- X gram.h gram.c: gram.y
- X yacc $(YFLAGS) gram.y
- X--- 22,38 ----
- X
- X SRCS = gram.c lex.c deftwmrc.c add_window.c gc.c list.c twm.c \
- X parse.c menus.c events.c resize.c util.c version.c iconmgr.c \
- X! cursor.c icons.c dwim.c
- X
- X OBJS = gram.o lex.o deftwmrc.o add_window.o gc.o list.o twm.o \
- X parse.o menus.o events.o resize.o util.o version.o iconmgr.o \
- X! cursor.o icons.o dwim.o
- X
- X! AllTarget(dwim)
- X
- X depend:: lex.c gram.c deftwmrc.c
- X
- X! ComplexProgramTarget(dwim)
- X
- X gram.h gram.c: gram.y
- X yacc $(YFLAGS) gram.y
- X***************
- X*** 38,52 ****
- X clean::
- X $(RM) y.tab.h y.tab.c lex.yy.c gram.h gram.c lex.c deftwmrc.c
- X
- X! deftwmrc.c: system.twmrc
- X! $(RM) $@
- X! echo '/* ' >>$@
- X! echo ' * This file is generated automatically from the default' >>$@
- X! echo ' * twm bindings file system.twmrc by the twm Imakefile.' >>$@
- X! echo ' */' >>$@
- X! echo '' >>$@
- X! echo 'char *defTwmrc[] = {' >>$@
- X! sed -e '/^#/d' -e 's/"/\\"/g' -e 's/^/ "/' -e 's/$$/",/' \
- X! system.twmrc >>$@
- X! echo ' (char *) 0 };' >>$@
- X
- X--- 42,59 ----
- X clean::
- X $(RM) y.tab.h y.tab.c lex.yy.c gram.h gram.c lex.c deftwmrc.c
- X
- X! dwim.o: dwim.c
- X! $(CC) $(CFLAGS) -traditional -c dwim.c
- X
- X+ /**/#deftwmrc.c: system.twmrc
- X+ # $(RM) $@
- X+ # echo '/* ' >>$@
- X+ # echo ' * This file is generated automatically from the default' >>$@
- X+ # echo ' * twm bindings file system.twmrc by the twm Imakefile.' >>$@
- X+ # echo ' */' >>$@
- X+ # echo '' >>$@
- X+ # echo 'char *defTwmrc[] = {' >>$@
- X+ # sed -e '/^#/d' -e 's/"/\\"/g' -e 's/^/ "/' -e 's/$$/",/' \
- X+ # system.twmrc >>$@
- X+ # echo ' (char *) 0 };' >>$@
- X+ #
- Xdiff -c twm/Makefile dwim/Makefile
- X*** twm/Makefile Thu Jan 18 12:50:55 1990
- X--- dwim/Makefile Sat Jan 6 01:15:29 1990
- X***************
- X*** 7,13 ****
- X #
- X
- X ###########################################################################
- X! # Makefile generated from "Imake.tmpl" and <Imakefile>
- X # $XConsortium: Imake.tmpl,v 1.77 89/12/18 17:01:37 jim Exp $
- X #
- X # Platform-specific parameters may be set in the appropriate .cf
- X--- 7,13 ----
- X #
- X
- X ###########################################################################
- X! # Makefile generated from "Imake.tmpl" and </tmp/IIf.a13037>
- X # $XConsortium: Imake.tmpl,v 1.77 89/12/18 17:01:37 jim Exp $
- X #
- X # Platform-specific parameters may be set in the appropriate .cf
- X***************
- X*** 27,33 ****
- X # platform-specific configuration parameters - edit sun.cf to change
- X
- X # platform: $XConsortium: sun.cf,v 1.38 89/12/23 16:10:10 jim Exp $
- X! # operating system: SunOS 3.5
- X
- X ###########################################################################
- X # site-specific configuration parameters - edit site.def to change
- X--- 27,33 ----
- X # platform-specific configuration parameters - edit sun.cf to change
- X
- X # platform: $XConsortium: sun.cf,v 1.38 89/12/23 16:10:10 jim Exp $
- X! # operating system: SunOS 3.5
- X
- X ###########################################################################
- X # site-specific configuration parameters - edit site.def to change
- X***************
- X*** 34,51 ****
- X
- X # site: $XConsortium: site.def,v 1.21 89/12/06 11:46:50 jim Exp $
- X
- X! SHELL = /bin/sh
- X
- X! TOP = ../../.
- X CURRENT_DIR = ./clients/twm
- X
- X AR = ar cq
- X BOOTSTRAPCFLAGS =
- X! CC = gcc -DNOSTDHDRS -fstrength-reduce -fpcc-struct-return -finline-functions
- X
- X COMPRESS = compress
- X CPP = /lib/cpp $(STD_CPP_DEFINES)
- X! PREPROCESSCMD = gcc -DNOSTDHDRS -fstrength-reduce -fpcc-struct-return -finline-functions -E $(STD_CPP_DEFINES)
- X INSTALL = install
- X LD = ld
- X LINT = lint
- X--- 34,51 ----
- X
- X # site: $XConsortium: site.def,v 1.21 89/12/06 11:46:50 jim Exp $
- X
- X! SHELL = /bin/sh
- X
- X! TOP = /u4/arthur/XR4
- X CURRENT_DIR = ./clients/twm
- X
- X AR = ar cq
- X BOOTSTRAPCFLAGS =
- X! CC = gcc -DNOSTDHDRS -fstrength-reduce -fpcc-struct-return -fwritable-strings -traditional
- X
- X COMPRESS = compress
- X CPP = /lib/cpp $(STD_CPP_DEFINES)
- X! PREPROCESSCMD = gcc -DNOSTDHDRS -fstrength-reduce -fpcc-struct-return -fwritable-strings -traditional -E $(STD_CPP_DEFINES)
- X INSTALL = install
- X LD = ld
- X LINT = lint
- X***************
- X*** 81,87 ****
- X
- X DESTDIR =
- X
- X! TOP_INCLUDES = -I$(TOP)
- X
- X CDEBUGFLAGS = -O
- X CCOPTIONS =
- X--- 81,87 ----
- X
- X DESTDIR =
- X
- X! TOP_INCLUDES = -I$(INCROOT)
- X
- X CDEBUGFLAGS = -O
- X CCOPTIONS =
- X***************
- X*** 100,107 ****
- X
- X IMAKE_DEFINES =
- X
- X! IRULESRC = $(CONFIGSRC)
- X! IMAKE_CMD = $(NEWTOP)$(IMAKE) -I$(NEWTOP)$(IRULESRC) $(IMAKE_DEFINES)
- X
- X ICONFIGFILES = $(IRULESRC)/Imake.tmpl $(IRULESRC)/Imake.rules \
- X $(IRULESRC)/Project.tmpl $(IRULESRC)/site.def \
- X--- 100,107 ----
- X
- X IMAKE_DEFINES =
- X
- X! IRULESRC = $(CONFIGDIR)
- X! IMAKE_CMD = $(IMAKE) -DUseInstalled -I$(IRULESRC) $(IMAKE_DEFINES)
- X
- X ICONFIGFILES = $(IRULESRC)/Imake.tmpl $(IRULESRC)/Imake.rules \
- X $(IRULESRC)/Project.tmpl $(IRULESRC)/site.def \
- X***************
- X*** 117,123 ****
- X
- X PATHSEP = /
- X USRLIBDIR = /usr/contrib/lib/libX
- X! BINDIR = /usr/contrib/bin/X11R4
- X INCROOT = /usr/contrib/lib/include
- X BUILDINCROOT = $(TOP)
- X BUILDINCDIR = $(BUILDINCROOT)/X11
- X--- 117,123 ----
- X
- X PATHSEP = /
- X USRLIBDIR = /usr/contrib/lib/libX
- X! BINDIR = /usr/contrib/bin/X11
- X INCROOT = /usr/contrib/lib/include
- X BUILDINCROOT = $(TOP)
- X BUILDINCDIR = $(BUILDINCROOT)/X11
- X***************
- X*** 144,155 ****
- X
- X INSTAPPFLAGS = $(INSTDATFLAGS)
- X
- X! IMAKE = $(IMAKESRC)/imake
- X! DEPEND = $(DEPENDSRC)/makedepend
- X! RGB = $(RGBSRC)/rgb
- X! FONTC = $(BDFTOSNFSRC)/bdftosnf
- X! MKFONTDIR = $(MKFONTDIRSRC)/mkfontdir
- X! MKDIRHIER = /bin/sh $(SCRIPTSRC)/mkdirhier.sh
- X
- X CONFIGSRC = $(TOP)/config
- X CLIENTSRC = $(TOP)/clients
- X--- 144,155 ----
- X
- X INSTAPPFLAGS = $(INSTDATFLAGS)
- X
- X! IMAKE = imake
- X! DEPEND = makedepend
- X! RGB = rgb
- X! FONTC = bdftosnf
- X! MKFONTDIR = mkfontdir
- X! MKDIRHIER = /bin/sh $(BINDIR)/mkdirhier.sh
- X
- X CONFIGSRC = $(TOP)/config
- X CLIENTSRC = $(TOP)/clients
- X***************
- X*** 177,208 ****
- X MKFONTDIRSRC = $(FONTSRC)/mkfontdir
- X EXTENSIONSRC = $(TOP)/extensions
- X
- X! DEPEXTENSIONLIB = $(EXTENSIONSRC)/lib/libXext.a
- X! EXTENSIONLIB = $(DEPEXTENSIONLIB)
- X
- X! DEPXLIB = $(DEPEXTENSIONLIB) $(XLIBSRC)/libX11.a
- X! XLIB = $(EXTENSIONLIB) $(XLIBSRC)/libX11.a
- X
- X! DEPXAUTHLIB = $(XAUTHSRC)/libXau.a
- X! XAUTHLIB = $(DEPXAUTHLIB)
- X
- X! DEPXMULIB = $(XMUSRC)/libXmu.a
- X! XMULIB = $(DEPXMULIB)
- X
- X! DEPOLDXLIB = $(OLDXLIBSRC)/liboldX.a
- X! OLDXLIB = $(DEPOLDXLIB)
- X
- X! DEPXTOOLLIB = $(TOOLKITSRC)/libXt.a
- X! XTOOLLIB = $(DEPXTOOLLIB)
- X
- X! DEPXAWLIB = $(AWIDGETSRC)/libXaw.a
- X! XAWLIB = $(DEPXAWLIB)
- X
- X! LINTEXTENSIONLIB = $(EXTENSIONSRC)/lib/llib-lXext.ln
- X! LINTXLIB = $(XLIBSRC)/llib-lX11.ln
- X! LINTXMU = $(XMUSRC)/llib-lXmu.ln
- X! LINTXTOOL = $(TOOLKITSRC)/llib-lXt.ln
- X! LINTXAW = $(AWIDGETSRC)/llib-lXaw.ln
- X
- X DEPLIBS = $(LOCAL_LIBRARIES)
- X
- X--- 177,208 ----
- X MKFONTDIRSRC = $(FONTSRC)/mkfontdir
- X EXTENSIONSRC = $(TOP)/extensions
- X
- X! DEPEXTENSIONLIB = $(USRLIBDIR)/libXext.a
- X! EXTENSIONLIB = -lXext
- X
- X! DEPXLIB = $(DEPEXTENSIONLIB) $(USRLIBDIR)/libX11.a
- X! XLIB = $(EXTENSIONLIB) -lX11
- X
- X! DEPXAUTHLIB = $(USRLIBDIR)/libXau.a
- X! XAUTHLIB = -lXau
- X
- X! DEPXMULIB = $(USRLIBDIR)/libXmu.a
- X! XMULIB = -lXmu
- X
- X! DEPOLDXLIB = $(USRLIBDIR)/liboldX.a
- X! OLDXLIB = -loldX
- X
- X! DEPXTOOLLIB = $(USRLIBDIR)/libXt.a
- X! XTOOLLIB = -lXt
- X
- X! DEPXAWLIB = $(USRLIBDIR)/libXaw.a
- X! XAWLIB = -lXaw
- X
- X! LINTEXTENSIONLIB = $(USRLIBDIR)/llib-lXext.ln
- X! LINTXLIB = $(USRLIBDIR)/llib-lX11.ln
- X! LINTXMU = $(USRLIBDIR)/llib-lXmu.ln
- X! LINTXTOOL = $(USRLIBDIR)/llib-lXt.ln
- X! LINTXAW = $(USRLIBDIR)/llib-lXaw.ln
- X
- X DEPLIBS = $(LOCAL_LIBRARIES)
- X
- X***************
- X*** 217,229 ****
- X ###########################################################################
- X # start of Imakefile
- X
- X #
- X! #Here is an Imakefile for twm. It depends on having TWMDIR defined
- X #in Imake.tmpl. I like to use Imakefiles for everything, and I am sure
- X #other people do also, so perhaps you could do us all a favor and
- X #distribute this one.
- X #
- X
- X YFLAGS = -d
- X DEPLIBS = $(DEPXMULIB) $(DEPEXTENSIONLIB) $(DEPXLIB)
- X LOCAL_LIBRARIES = $(XMULIB) $(EXTENSIONLIB) $(XLIB)
- X--- 217,234 ----
- X ###########################################################################
- X # start of Imakefile
- X
- X+ # DWIM MODIFICATIONS David Rabson 1/90
- X+
- X #
- X! #Here is an Imakefile for dwim. It depends on having TWMDIR defined
- X #in Imake.tmpl. I like to use Imakefiles for everything, and I am sure
- X #other people do also, so perhaps you could do us all a favor and
- X #distribute this one.
- X #
- X
- X+ CC = gcc
- X+ CCOPTIONS = -O -finline-functions
- X+
- X YFLAGS = -d
- X DEPLIBS = $(DEPXMULIB) $(DEPEXTENSIONLIB) $(DEPXLIB)
- X LOCAL_LIBRARIES = $(XMULIB) $(EXTENSIONLIB) $(XLIB)
- X***************
- X*** 232,268 ****
- X
- X SRCS = gram.c lex.c deftwmrc.c add_window.c gc.c list.c twm.c \
- X parse.c menus.c events.c resize.c util.c version.c iconmgr.c \
- X! cursor.c icons.c
- X
- X OBJS = gram.o lex.o deftwmrc.o add_window.o gc.o list.o twm.o \
- X parse.o menus.o events.o resize.o util.o version.o iconmgr.o \
- X! cursor.o icons.o
- X
- X! all:: twm
- X
- X depend:: lex.c gram.c deftwmrc.c
- X
- X! PROGRAM = twm
- X
- X! all:: twm
- X
- X! twm: $(OBJS) $(DEPLIBS)
- X! $(RM) $@
- X $(CC) -o $@ $(OBJS) $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) $(EXTRA_LOAD_FLAGS)
- X
- X! install:: twm
- X! $(INSTALL) -c $(INSTPGMFLAGS) twm $(BINDIR)
- X
- X! install.man:: twm.man
- X! $(INSTALL) -c $(INSTMANFLAGS) twm.man $(MANDIR)/twm.n
- X
- X- depend:: $(DEPEND)
- X-
- X- $(DEPEND):
- X- @echo "checking $@ over in $(DEPENDSRC) first..."; \
- X- cd $(DEPENDSRC); $(MAKE); \
- X- echo "okay, continuing in $(CURRENT_DIR)"
- X-
- X depend::
- X $(DEPEND) -s "# DO NOT DELETE" -- $(ALLDEFINES) -- $(SRCS)
- X
- X--- 237,266 ----
- X
- X SRCS = gram.c lex.c deftwmrc.c add_window.c gc.c list.c twm.c \
- X parse.c menus.c events.c resize.c util.c version.c iconmgr.c \
- X! cursor.c icons.c dwim.c
- X
- X OBJS = gram.o lex.o deftwmrc.o add_window.o gc.o list.o twm.o \
- X parse.o menus.o events.o resize.o util.o version.o iconmgr.o \
- X! cursor.o icons.o dwim.o
- X
- X! all:: dwim
- X
- X depend:: lex.c gram.c deftwmrc.c
- X
- X! PROGRAM = dwim
- X
- X! all:: dwim
- X
- X! dwim: $(OBJS) $(DEPLIBS)
- X! $(RM) $@
- X $(CC) -o $@ $(OBJS) $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) $(EXTRA_LOAD_FLAGS)
- X
- X! install:: dwim
- X! $(INSTALL) -c $(INSTPGMFLAGS) dwim $(BINDIR)
- X
- X! install.man:: dwim.man
- X! $(INSTALL) -c $(INSTMANFLAGS) dwim.man $(MANDIR)/dwim.n
- X
- X depend::
- X $(DEPEND) -s "# DO NOT DELETE" -- $(ALLDEFINES) -- $(SRCS)
- X
- X***************
- X*** 282,299 ****
- X clean::
- X $(RM) y.tab.h y.tab.c lex.yy.c gram.h gram.c lex.c deftwmrc.c
- X
- X! deftwmrc.c: system.twmrc
- X! $(RM) $@
- X! echo '/* ' >>$@
- X! echo ' * This file is generated automatically from the default' >>$@
- X! echo ' * twm bindings file system.twmrc by the twm Imakefile.' >>$@
- X! echo ' */' >>$@
- X! echo '' >>$@
- X! echo 'char *defTwmrc[] = {' >>$@
- X! sed -e '/^#/d' -e 's/"/\\"/g' -e 's/^/ "/' -e 's/$$/",/' \
- X! system.twmrc >>$@
- X! echo ' (char *) 0 };' >>$@
- X
- X ###########################################################################
- X # common rules for all Makefiles - do not edit
- X
- X--- 280,301 ----
- X clean::
- X $(RM) y.tab.h y.tab.c lex.yy.c gram.h gram.c lex.c deftwmrc.c
- X
- X! dwim.o: dwim.c
- X! $(CC) $(CFLAGS) -traditional -c dwim.c
- X
- X+ #deftwmrc.c: system.twmrc
- X+ # $(RM) $@
- X+ # echo '/* ' >>$@
- X+ # echo ' * This file is generated automatically from the default' >>$@
- X+ # echo ' * twm bindings file system.twmrc by the twm Imakefile.' >>$@
- X+ # echo ' */' >>$@
- X+ # echo '' >>$@
- X+ # echo 'char *defTwmrc[] = {' >>$@
- X+ # sed -e '/^#/d' -e 's/"/\\"/g' -e 's/^/ "/' -e 's/$$/",/' \
- X+ # system.twmrc >>$@
- X+ # echo ' (char *) 0 };' >>$@
- X+ #
- X+
- X ###########################################################################
- X # common rules for all Makefiles - do not edit
- X
- X***************
- X*** 301,315 ****
- X
- X clean::
- X $(RM_CMD) \#*
- X-
- X- Makefile:: $(IMAKE)
- X-
- X- $(IMAKE):
- X- @(cd $(IMAKESRC); if [ -f Makefile ]; then \
- X- echo "checking $@ in $(IMAKESRC) first..."; $(MAKE) all; else \
- X- echo "bootstrapping $@ from Makefile.ini in $(IMAKESRC) first..."; \
- X- $(MAKE) -f Makefile.ini BOOTSTRAPCFLAGS=$(BOOTSTRAPCFLAGS); fi; \
- X- echo "okay, continuing in $(CURRENT_DIR)")
- X
- X Makefile::
- X -@if [ -f Makefile ]; then \
- X--- 303,308 ----
- XOnly in dwim: SUN3
- Xdiff -c twm/add_window.c dwim/add_window.c
- X*** twm/add_window.c Thu Jan 18 12:51:06 1990
- X--- dwim/add_window.c Sat Jan 6 01:33:06 1990
- X***************
- X*** 25,30 ****
- X--- 25,31 ----
- X /** OR PERFORMANCE OF THIS SOFTWARE. **/
- X /*****************************************************************************/
- X
- X+ /* DWIM modifications David Rabson 6/89, 1/90 */
- X
- X /**********************************************************************
- X *
- X***************
- X*** 213,218 ****
- X--- 214,229 ----
- X tmp_win->attr.x != 0 || tmp_win->attr.y != 0)))
- X ask_user = FALSE;
- X
- X+ /* BEGIN DWIM */
- X+ if(dwim_set) {
- X+ /* titles become numbers in dwim */
- X+ dwim_setname(&tmp_win->name, tmp_win);
- X+ tmp_win->icon_name = tmp_win->name;
- X+ XStoreName(dpy, tmp_win->w, tmp_win->name);
- X+ XStoreName(dpy, tmp_win->icon_w, tmp_win->icon_name);
- X+ }
- X+ /* END DWIM */
- X+
- X if (tmp_win->name == NULL)
- X tmp_win->name = NoName;
- X if (tmp_win->class.res_name == NULL)
- X***************
- X*** 560,565 ****
- X--- 571,580 ----
- X if (XGetWindowProperty (dpy, tmp_win->w, XA_WM_ICON_NAME, 0L, 200L, False,
- X XA_STRING, &actual_type, &actual_format, &nitems,
- X &bytesafter,(unsigned char **)&tmp_win->icon_name))
- X+ tmp_win->icon_name = tmp_win->name;
- X+
- X+ /* DWIM: undo the resetting of the icon_name the above just did */
- X+ if(dwim_set)
- X tmp_win->icon_name = tmp_win->name;
- X
- X if (tmp_win->icon_name == NULL)
- XOnly in dwim: dwim
- Xdiff -c twm/dwim.c dwim/dwim.c
- X*** twm/dwim.c Thu Jan 18 12:54:09 1990
- X--- dwim/dwim.c Sat Jan 6 00:01:49 1990
- X***************
- X*** 0 ****
- X--- 1,400 ----
- X+ /* dwim.c
- X+ *
- X+ * functions added to twm
- X+ *
- X+ * dwim_setname(sp, tw)
- X+ * char **sp;
- X+ * Window w, wf;
- X+ *
- X+ * Stuff sp with the name (number) of a new window and notes a new window's
- X+ * creation. Wf is the window frame (which seems to be necessary to raise
- X+ * a window).
- X+ *
- X+ *
- X+ * dwim_demise(s)
- X+ * char *s;
- X+ *
- X+ * Note the demise of a window named s. If !atoi(s), dwim ignores this.
- X+ *
- X+ *
- X+ * dwim_command()
- X+ *
- X+ * Grab the keyboard for a one-character command. Execute it.
- X+ *
- X+ *
- X+ * dwim_press(pressq,action)
- X+ * char pressq; 1=press, 0=release
- X+ * char *action;
- X+ *
- X+ * do something according to "action" -- right now, the strings
- X+ * "left," "right," and "middle" are defined to generate left, right,
- X+ * and middle keypress events
- X+ *
- X+ *
- X+ * dwim_intercept(ev)
- X+ * XEvent ev;
- X+ *
- X+ * Intercept a grabbed key stroke and decide what we want to do with it.
- X+ * Return 1 if the usual twm keystroke event routine should get it or 0
- X+ * if it shouldn't.
- X+ *
- X+ * dwim_usleep(useconds)
- X+ * int useconds;
- X+ *
- X+ * sleep the given number of microseconds -- may be useful for mouse buttons
- X+ *
- X+ */
- X+
- X+ #include "twm.h"
- X+ #include "screen.h"
- X+ #include <stdio.h>
- X+ #include <ctype.h>
- X+ #define ALLOC(x) (x *)malloc(sizeof(x))
- X+ #define NUMMODS 8 /* # of mods in XModifierMap */
- X+
- X+ /* globals (also in twm.h) */
- X+ int dwim_set = 1;
- X+
- X+ /* statics */
- X+
- X+ static int grabit=0; /* are we currently grabbing the keyboard? */
- X+
- X+ struct dwim_wits { /* used to hold the two important windows */
- X+ Window w, wf;
- X+ TwmWindow *tw;
- X+ };
- X+
- X+ static int dwim_nextnum=1;
- X+
- X+ struct dwim_winlist { /*list of windows*/
- X+ int num;
- X+ struct dwim_wits wins;
- X+ struct dwim_winlist *next;
- X+ } root={0}; /* root will be a fake to make things easier */
- X+
- X+ struct dwim_nlist { /* list of free window numbers */
- X+ int n;
- X+ struct dwim_nlist *next;
- X+ } nroot={0,0}; /* again, a dummy root */
- X+
- X+ /* table of press/release requests */
- X+ void buttonfunc();
- X+ static struct prtable {
- X+ char *command; /* when you get this command */
- X+ void (*func)(); /* do this */
- X+ int iparam; /* with this parameter */
- X+ }prtable[]={
- X+ {"left",buttonfunc,1},
- X+ {"middle",buttonfunc,2},
- X+ {"right",buttonfunc,3},
- X+ {0,0,0}
- X+ };
- X+
- X+ char *malloc();
- X+
- X+
- X+ /* Stuff sp with the name of a new window and note the window struct */
- X+ dwim_setname(sp,tw)
- X+ char **sp;
- X+ TwmWindow *tw;
- X+ {
- X+ char *buffer=malloc(4); /* 4 is magic */
- X+ int num = newnum();
- X+
- X+ if(num < 1 || num > 999)
- X+ dwim_err("inconsistency in dwim_setname");
- X+
- X+ sprintf(buffer,"%d",num);
- X+ *sp = buffer; /* stuff it */
- X+
- X+ addwin(num,tw); /* below */
- X+ }
- X+
- X+ /* Note the demise of a window (take it off the list if it's on it) */
- X+ dwim_demise(w)
- X+ Window w;
- X+ {
- X+ struct dwim_winlist *node = root.next;
- X+ struct dwim_winlist *prev = &root;
- X+
- X+ while(node) {
- X+ if( w == node->wins.w ) { /* match? */
- X+ prev->next = node->next;
- X+ addfree(node->num); /*below--add num to freelist*/
- X+ free(node);
- X+ break; /* no need to continue */
- X+ }
- X+ prev = node;
- X+ node = node->next;
- X+ }
- X+ }
- X+
- X+ /* Grab the keyboard for one keystroke and execute it (shift keys are tricky).
- X+ * Since events are asyncronous in X (and I don't know how to get around this),
- X+ * the ungrabbing will have to take place in dwim_intercept() below.
- X+ *
- X+ * I think this is essentially like shifting the focus to the root window.
- X+ */
- X+ dwim_command()
- X+ {
- X+ XGrabKeyboard(dpy,
- X+ Scr->Root, False, GrabModeAsync, GrabModeAsync, CurrentTime);
- X+
- X+ grabit=1; /* let dwim_intercept, etc., know */
- X+ }
- X+
- X+
- X+ /* generate a keypress or keyrelease event (action to be interpreted) */
- X+ dwim_press(pressq, action)
- X+ char pressq; /* 1=press, 0=release */
- X+ char *action;
- X+ {
- X+ struct prtable *t;
- X+
- X+ /* determine what kind of action this is (no abbreviation) */
- X+ for(t= prtable; t->command; t++)
- X+ if(!strcmp(t->command,action)) {
- X+ (*t->func)(pressq,t->iparam); /* do it */
- X+ return; /* leave */
- X+ }
- X+
- X+ /* reach here on unknown code */
- X+ fprintf(stderr,
- X+ "dwim: unknown dwim press/release command, <%s>\n",action);
- X+ }
- X+
- X+ /* do the press/release stuff -- called by dwim_press() above */
- X+ static void
- X+ buttonfunc(pressq, which)
- X+ char pressq; /* 1=press, 0=release */
- X+ /* which tells which button to press or release */
- X+ {
- X+ XButtonEvent event;
- X+ static long buttonmasks[]=
- X+ {Button1Mask,Button2Mask,Button3Mask,Button4Mask,Button5Mask};
- X+ static long buttons[]=
- X+ {Button1,Button2,Button3,Button4,Button5};
- X+ Window focus;
- X+
- X+ /* get the focus window (into focus) */
- X+ {
- X+ int junk;
- X+ XGetInputFocus(dpy,&focus,&junk);
- X+ }
- X+
- X+ /* set up the event */
- X+ event.type = pressq?ButtonPress:ButtonRelease;
- X+ event.state = buttonmasks[which-1];
- X+ event.button= buttons[which-1];
- X+ event.window = focus; /* this IS necessary */
- X+
- X+ /* send the event */
- X+ if(!XSendEvent(dpy, focus, True, -1, &event))
- X+ fprintf(stderr,"dwim: XSendEvent returns error\n");
- X+ XFlush(dpy); /* probably does nothing */
- X+ }
- X+
- X+
- X+ /* intercept an event; return 0 or 1 depending on whether twm should see it */
- X+ dwim_intercept(ev)
- X+ XEvent ev;
- X+ {
- X+ Window w = ev.xkey.window;
- X+ unsigned int keycode = ev.xkey.keycode;
- X+ unsigned int state = ev.xkey.state; /* modifier mask */
- X+ char b, bu; /* b is a char, bu is same char unshifted */
- X+ XEvent evc; /* event copy used to get bu */
- X+
- X+ #ifdef NEVERDEF
- X+ fprintf(stderr,"TRACER [dwim_intercept]: keycode=0x%x, state=0x%x\n"
- X+ ,keycode,state); /*TRACER*/
- X+ #endif NEVERDEF
- X+ /* ignore modifiers (shift keys) -- wait for the real thing */
- X+ if(ismodifier(keycode))
- X+ return(1); /* twm probably ignores it, too */
- X+
- X+ /* ungrab a grabbed keyboard */
- X+ if(grabit) {
- X+ XUngrabKeyboard(dpy, CurrentTime);
- X+ grabit=0;
- X+ }
- X+
- X+ /* get the key (truncate translation to one character) */
- X+ XLookupString(&ev, &b, 1, NULL, NULL); /* b is a char */
- X+ evc = ev; /* NOTE: an XEvent is not a pointer */
- X+ evc.xkey.state = 0; /* unshift it */
- X+ XLookupString(&evc, &bu, 1, NULL, NULL); /* bu is unshifted */
- X+
- X+ return(dokey(b,bu,state));
- X+ }
- X+
- X+ /* sleep some microseconds */
- X+ dwim_usleep(us)
- X+ char *us;
- X+ {
- X+ int u;
- X+ if((u=atoi(us))>1000) {
- X+ fprintf(stderr,
- X+ "dwim: usleep > 1000 microseconds changed to 1000\n");
- X+ u = 1000;
- X+ }
- X+ usleep(u);
- X+ }
- X+
- X+ /* continue to process intercepted key -- return same as dwim_intercept() */
- X+ static
- X+ dokey(b,bu,state)
- X+ char b,bu; /* bu is unshifted char */
- X+ {
- X+ struct dwim_wits numtowinframe();
- X+
- X+ if( (dwim_set && isdigit(bu)) ) {
- X+ warpto(numtowinframe(bu-'0')); /* may fail with EBSDC */
- X+ return(0);
- X+ }
- X+ return(1);
- X+ }
- X+
- X+ /* convert a number to a window -- return Scr->Root if no match */
- X+ static
- X+ struct dwim_wits
- X+ numtowinframe(n)
- X+ {
- X+ struct dwim_winlist *node = root.next;
- X+ static struct dwim_wits rvalue;
- X+
- X+ while(node) {
- X+ if(node->num == n)
- X+ return(node->wins);
- X+ node = node->next;
- X+ }
- X+ rvalue.w = rvalue.wf = Scr->Root;
- X+ rvalue.tw = &Scr->TwmRoot;
- X+ return(rvalue); /* no match */
- X+ }
- X+
- X+ /* is the keycode a modifier (e.g., just the shift key) ? */
- X+ static
- X+ ismodifier(key)
- X+ unsigned int key;
- X+ {
- X+ static XModifierKeymap *map = 0;
- X+ static int max_keypermod;
- X+ KeyCode *m; /* a NUMMODS x max_keypermod array */
- X+ int i;
- X+
- X+ if(!map) {
- X+ map = XGetModifierMapping(dpy);
- X+ max_keypermod = map->max_keypermod;
- X+ m = map->modifiermap;
- X+ }
- X+
- X+ /* just try them out serially (there can't be too many...) */
- X+ i = max_keypermod*NUMMODS; /* number of possibilities */
- X+ m = map->modifiermap;
- X+ do {
- X+ if(*m++ == key)
- X+ return(1);
- X+ } while(--i);
- X+
- X+ return(0); /* no, it's not a modifier */
- X+ }
- X+
- X+
- X+ /* add a number to the list of free numbers */
- X+ static
- X+ addfree(n)
- X+ {
- X+ struct dwim_nlist *old = nroot.next;
- X+ struct dwim_nlist *new = ALLOC(struct dwim_nlist);
- X+
- X+ new->n = n;
- X+ nroot.next = new;
- X+ new->next = old;
- X+ }
- X+
- X+ /* get a new number */
- X+ static
- X+ newnum()
- X+ {
- X+ int n;
- X+ struct dwim_nlist *node;
- X+ if(node = nroot.next) {
- X+ /* first try the freelist */
- X+ n = node->n;
- X+ nroot.next = node->next;
- X+ free(node);
- X+ } else
- X+ /* otherwise ... */
- X+ n = dwim_nextnum++;
- X+
- X+ return(n);
- X+ }
- X+
- X+ /* add a new window and frame to our list */
- X+ static
- X+ addwin(num,tw)
- X+ TwmWindow *tw;
- X+ {
- X+ struct dwim_winlist *old = root.next;
- X+ struct dwim_winlist *new = ALLOC(struct dwim_winlist);
- X+
- X+ /* fill the new node */
- X+ new->num = num;
- X+ new->wins.w = tw->w;
- X+ new->wins.wf = tw->frame;
- X+ new->wins.tw = tw;
- X+
- X+ /* insert the new node */
- X+ root.next = new;
- X+ new->next = old;
- X+ }
- X+
- X+
- X+ static
- X+ dwim_err(s)
- X+ char *s;
- X+ {
- X+ fprintf(stderr,"dwim: %s\n",s);
- X+ Done(); /* in twm.c */
- X+ }
- X+
- X+ /* a debugging routine */
- X+ static
- X+ wintraverse()
- X+ {
- X+ struct dwim_winlist *node = root.next;
- X+ printf("------ wintraverse ------\n");
- X+ while(node) {
- X+ printf("%d 0x%09x\n",node->num,(unsigned int)node->wins.w);
- X+ node=node->next;
- X+ }
- X+ printf("-------------------------\n");
- X+ }
- X+
- X+
- X+ /* warp pointer and focus to window w */
- X+ static
- X+ warpto(dw)
- X+ struct dwim_wits dw;
- X+ {
- X+ XRaiseWindow(dpy, dw.w); /* seems to do nothing */
- X+ XRaiseWindow(dpy, dw.wf);
- X+ DeIconify(dw.tw); /* this might work */
- X+
- X+ /* warp to upper left corner of window */
- X+ XWarpPointer(dpy, None, dw.w, 0, 0, 0, 0, 0, 0);
- X+
- X+ XSetInputFocus(dpy, dw.w, RevertToNone, CurrentTime);
- X+ }
- X+
- X+ /* get window width */
- X+ static
- X+ getwidth(w)
- X+ Window w;
- X+ {
- X+ XWindowAttributes buf;
- X+
- X+ XGetWindowAttributes(dpy, w, &buf);
- X+ return(buf.width);
- X+ }
- Xdiff -c twm/dwim.man dwim/dwim.man
- X*** twm/dwim.man Thu Jan 18 12:54:14 1990
- X--- dwim/dwim.man Sat Jan 6 01:43:12 1990
- X***************
- X*** 0 ****
- X--- 1,61 ----
- X+ .TH DWIM 1 "6 January 1990" "X Version 11R4"
- X+ .SH NAME
- X+ .PP
- X+ dwim - a window manager hack for X11 (Do What I Mean)
- X+ .PP
- X+ .SH SYNTAX
- X+ .PP
- X+ \fBdwim \fP[-display \fIdisplay\fP]
- X+ .PP
- X+ .SH DESCRIPTION
- X+ .PP
- X+ \fIdwim\fR is a set of patches to \fItwm\fR (Tom's Window Manager, \fIcf.\fR)
- X+ to do a small number of things with keystrokes that are more naturally done
- X+ with keystrokes than with the mouse.
- X+ .PP
- X+ \fIdwim\fR reads a file called \fI.dwimrc\fR instead of \fI.twmrc\fR.
- X+ (Just as twm release 4 reads .twmrc.0 [for screen 0], so dwim will
- X+ read .dwimrc.0).
- X+ .PP
- X+ Xterm's are labeled with numbers instead of the name "xterm."
- X+ Any digit typed in the root window will cause the focus to shift
- X+ to the window numbered by the same digit. In addition, if a digit key
- X+ key is mapped in the \fI.dwimrc\fR (with or without shift modifiers),
- X+ \fIdwim\fR will intercept that key before \fItwm\fR sees it and will
- X+ cause the focus to be shifted. When the focus is shifted, the appropriate
- X+ window is also raised or deiconified.
- X+ .PP
- X+ The function \fIf.dwimcom\fR effectively shifts the focus to the root window
- X+ for one keystroke only (shift-key, control-key, and meta-key all count as
- X+ one keystroke).
- X+ .PP
- X+ The usual way to use \fIdwm\fR is to add the following lines to a \fI.twmrc\fR
- X+ file:
- X+ .IP
- X+ .nf
- X+ "w" = m : window : f.dwimcom
- X+ "1" = c : window : f.nop
- X+ "2" = c : window : f.nop
- X+ "3" = c : window : f.nop
- X+ "4" = c : window : f.nop
- X+ "5" = c : window : f.nop
- X+ "6" = c : window : f.nop
- X+ "7" = c : window : f.nop
- X+ "8" = c : window : f.nop
- X+ "9" = c : window : f.nop
- X+ .fi
- X+ .PP
- X+ With these lines, \fImeta-w digit\fR or \fIcontrol-digit\fR will cause the
- X+ focus to be shifted to the given window.
- X+ .SH "NOTES ON RELEASE 4"
- X+ In X11R3, dwim (and twm) accepted "cm" in a binding to indicate that both
- X+ control and meta should be pressed. In X11R4, both dwim and twm require
- X+ that modifier characters should be separated by vertical bars ("c|m").
- X+ .PP
- X+ Until I can figure out why most (but not all) applications ignore
- X+ synthetic mouse button presses, users who wish to try the undocumented
- X+ dwim artificial mouse commands will have to look in the sources.
- X+ .SH AUTHOR
- X+ David A. Rabson
- X+ \".SH BUGS
- X+
- Xdiff -c twm/events.c dwim/events.c
- X*** twm/events.c Thu Jan 18 12:51:01 1990
- X--- dwim/events.c Fri Jan 5 20:59:08 1990
- X***************
- X*** 25,30 ****
- X--- 25,31 ----
- X /** OR PERFORMANCE OF THIS SOFTWARE. **/
- X /*****************************************************************************/
- X
- X+ /* DWIM modifications David Rabson 6/89, 1/90 */
- X
- X /***********************************************************************
- X *
- X***************
- X*** 479,487 ****
- X--- 480,498 ----
- X ***********************************************************************
- X */
- X
- X+ /* DWIM modifications: intercept the event first */
- X void
- X HandleKeyPress()
- X {
- X+ static void TwmHandleKeyPress();
- X+
- X+ if(!dwim_set || dwim_intercept(Event))
- X+ TwmHandleKeyPress(); /* let twm see it, maybe */
- X+ }
- X+
- X+ void static
- X+ TwmHandleKeyPress()
- X+ {
- X FuncKey *key;
- X int len;
- X
- X***************
- X*** 1086,1091 ****
- X--- 1097,1105 ----
- X free_cwins (Tmp_win); /* 9 */
- X if (Tmp_win->titlebuttons) /* 10 */
- X free ((char *) Tmp_win->titlebuttons);
- X+
- X+ dwim_demise(Tmp_win->w); /*DWIM*/
- X+
- X free((char *)Tmp_win);
- X }
- X
- Xdiff -c twm/gram.y dwim/gram.y
- X*** twm/gram.y Thu Jan 18 12:50:56 1990
- X--- dwim/gram.y Fri Jan 5 20:43:07 1990
- X***************
- X*** 25,30 ****
- X--- 25,31 ----
- X /** OR PERFORMANCE OF THIS SOFTWARE. **/
- X /*****************************************************************************/
- X
- X+ /* DWIM modifications David Rabson 6/89, 1/90 */
- X
- X /***********************************************************************
- X *
- X***************
- X*** 88,93 ****
- X--- 89,95 ----
- X %token <num> NUMBER KEYWORD NKEYWORD CKEYWORD CLKEYWORD FKEYWORD FSKEYWORD
- X %token <num> SKEYWORD DKEYWORD JKEYWORD WINDOW_RING WARP_CURSOR ERRORTOKEN
- X %token <ptr> STRING
- X+ %token <num> DWIM_SET
- X
- X %type <ptr> string
- X %type <num> action button number signed_number full fullkey
- X***************
- X*** 103,108 ****
- X--- 105,111 ----
- X ;
- X
- X stmt : error
- X+ | DWIM_SET { dwim_set = 1; }
- X | noarg
- X | sarg
- X | narg
- X***************
- X*** 190,198 ****
- X | MENU string LP string COLON string RP {
- X root = GetRoot($2, $4, $6); }
- X menu { root->real_menu = TRUE;}
- X! | MENU string { root = GetRoot($2, NULLSTR, NULLSTR); }
- X menu { root->real_menu = TRUE; }
- X! | FUNCTION string { root = GetRoot($2, NULLSTR, NULLSTR); }
- X function
- X | ICONS { list = &Scr->IconNames; }
- X icon_list
- X--- 193,201 ----
- X | MENU string LP string COLON string RP {
- X root = GetRoot($2, $4, $6); }
- X menu { root->real_menu = TRUE;}
- X! | MENU string {root = GetRoot($2, NULLSTR, NULLSTR);}
- X menu { root->real_menu = TRUE; }
- X! | FUNCTION string {root = GetRoot($2, NULLSTR, NULLSTR);}
- X function
- X | ICONS { list = &Scr->IconNames; }
- X icon_list
- Xdiff -c twm/iconmgr.c dwim/iconmgr.c
- X*** twm/iconmgr.c Thu Jan 18 12:51:05 1990
- X--- dwim/iconmgr.c Sat Jan 6 01:27:27 1990
- X***************
- X*** 683,691 ****
- X--- 683,694 ----
- X WList *tmp;
- X {
- X {
- X+ extern int dwim_set; /*DWIM*/
- X XSetForeground(dpy, Scr->NormalGC, tmp->fore);
- X+ if(!dwim_set) { /*DWIM*//* I happen not to like this */
- X XDrawRectangle(dpy, tmp->w, Scr->NormalGC, 2, 2,
- X tmp->width-5, tmp->height-5);
- X+ }
- X
- X if (tmp->active && Scr->Highlight)
- X XSetForeground(dpy, Scr->NormalGC, tmp->highlight);
- Xdiff -c twm/menus.c dwim/menus.c
- X*** twm/menus.c Thu Jan 18 12:50:57 1990
- X--- dwim/menus.c Fri Jan 5 22:30:28 1990
- X***************
- X*** 25,30 ****
- X--- 25,31 ----
- X /** OR PERFORMANCE OF THIS SOFTWARE. **/
- X /*****************************************************************************/
- X
- X+ /* DWIM modifications David Rabson 6/89, 1/90 */
- X
- X /***********************************************************************
- X *
- X***************
- X*** 1888,1893 ****
- X--- 1889,1907 ----
- X XMapWindow(dpy, w);
- X XDestroyWindow(dpy, w);
- X XFlush(dpy);
- X+ break;
- X+
- X+ case F_DWIMCOM:
- X+ dwim_command();
- X+ break;
- X+ case F_DWIMPRESS:
- X+ dwim_press((char)1,action);
- X+ break;
- X+ case F_DWIMRELEASE:
- X+ dwim_press((char)0,action);
- X+ break;
- X+ case F_DWIMUSLEEP:
- X+ dwim_usleep(action);
- X break;
- X
- X case F_QUIT:
- Xdiff -c twm/parse.c dwim/parse.c
- X*** twm/parse.c Thu Jan 18 12:50:53 1990
- X--- dwim/parse.c Fri Jan 5 22:18:10 1990
- X***************
- X*** 25,36 ****
- X /** OR PERFORMANCE OF THIS SOFTWARE. **/
- X /*****************************************************************************/
- X
- X
- X /***********************************************************************
- X *
- X * $XConsortium: parse.c,v 1.39 89/12/14 14:51:30 jim Exp $
- X *
- X! * parse the .twmrc file
- X *
- X * 17-Nov-87 Thomas E. LaStrange File created
- X *
- X--- 25,37 ----
- X /** OR PERFORMANCE OF THIS SOFTWARE. **/
- X /*****************************************************************************/
- X
- X+ /* DWIM modifications David Rabson, 1/90 */
- X
- X /***********************************************************************
- X *
- X * $XConsortium: parse.c,v 1.39 89/12/14 14:51:30 jim Exp $
- X *
- X! * parse the .dwimrc file
- X *
- X * 17-Nov-87 Thomas E. LaStrange File created
- X *
- X***************
- X*** 78,87 ****
- X /***********************************************************************
- X *
- X * Procedure:
- X! * ParseTwmrc - parse the .twmrc file
- X *
- X * Inputs:
- X! * filename - the filename to parse. A NULL indicates $HOME/.twmrc
- X *
- X ***********************************************************************
- X */
- X--- 79,88 ----
- X /***********************************************************************
- X *
- X * Procedure:
- X! * ParseTwmrc - parse the .dwimrc file
- X *
- X * Inputs:
- X! * filename - the filename to parse. A NULL indicates $HOME/.dwimrc
- X *
- X ***********************************************************************
- X */
- X***************
- X*** 121,128 ****
- X char tmpfilename[257];
- X
- X /*
- X! * If filename given, try it, else try ~/.twmrc.# then ~/.twmrc. Then
- X * try system.twmrc; finally using built-in defaults.
- X */
- X for (twmrc = NULL, i = 0; !twmrc && i < 4; i++) {
- X switch (i) {
- X--- 122,130 ----
- X char tmpfilename[257];
- X
- X /*
- X! * If filename given, try it, else try ~/.dwimrc.# then ~/.dwimrc. Then
- X * try system.twmrc; finally using built-in defaults.
- X+ * DWIM author note: the people at MIT write really AWFUL code.
- X */
- X for (twmrc = NULL, i = 0; !twmrc && i < 4; i++) {
- X switch (i) {
- X***************
- X*** 130,142 ****
- X cp = filename;
- X break;
- X
- X! case 1: /* ~/.twmrc.screennum */
- X if (!filename) {
- X home = getenv ("HOME");
- X if (home) {
- X homelen = strlen (home);
- X cp = tmpfilename;
- X! (void) sprintf (tmpfilename, "%s/.twmrc.%d",
- X home, Scr->screen);
- X break;
- X }
- X--- 132,144 ----
- X cp = filename;
- X break;
- X
- X! case 1: /* ~/.dwimrc.screennum */
- X if (!filename) {
- X home = getenv ("HOME");
- X if (home) {
- X homelen = strlen (home);
- X cp = tmpfilename;
- X! (void) sprintf (tmpfilename, "%s/.dwimrc.%d",
- X home, Scr->screen);
- X break;
- X }
- X***************
- X*** 143,151 ****
- X }
- X continue;
- X
- X! case 2: /* ~/.twmrc */
- X if (home) {
- X! tmpfilename[homelen + 7] = '\0';
- X }
- X break;
- X
- X--- 145,153 ----
- X }
- X continue;
- X
- X! case 2: /* ~/.dwimrc */
- X if (home) {
- X! tmpfilename[homelen + 8] = '\0'; /* DWIM: 8 was 7 (UGLY!) */
- X }
- X break;
- X
- X***************
- X*** 162,168 ****
- X
- X if (filename && cp != filename) {
- X fprintf (stderr,
- X! "%s: unable to open twmrc file %s, using %s instead\n",
- X ProgramName, filename, cp);
- X }
- X status = doparse (twmFileInput, "file", cp);
- X--- 164,170 ----
- X
- X if (filename && cp != filename) {
- X fprintf (stderr,
- X! "%s: unable to open dwimrc file %s, using %s instead\n",
- X ProgramName, filename, cp);
- X }
- X status = doparse (twmFileInput, "file", cp);
- X***************
- X*** 171,177 ****
- X } else {
- X if (filename) {
- X fprintf (stderr,
- X! "%s: unable to open twmrc file %s, using built-in defaults instead\n",
- X ProgramName, filename);
- X }
- X return ParseStringList (defTwmrc);
- X--- 173,179 ----
- X } else {
- X if (filename) {
- X fprintf (stderr,
- X! "%s: unable to open dwimrc file %s, using built-in defaults instead\n",
- X ProgramName, filename);
- X }
- X return ParseStringList (defTwmrc);
- X***************
- X*** 384,389 ****
- X--- 386,392 ----
- X { "donticonifybyunmapping", DONT_ICONIFY_BY_UNMAPPING, 0 },
- X { "dontmoveoff", KEYWORD, kw0_DontMoveOff },
- X { "dontsqueezetitle", DONT_SQUEEZE_TITLE, 0 },
- X+ { "dwim_set", KEYWORD, DWIM_SET },
- X { "east", DKEYWORD, D_EAST },
- X { "f", FRAME, 0 },
- X { "f.autoraise", FKEYWORD, F_AUTORAISE },
- X***************
- X*** 400,405 ****
- X--- 403,412 ----
- X { "f.deltastop", FKEYWORD, F_DELTASTOP },
- X { "f.destroy", FKEYWORD, F_DESTROY },
- X { "f.downiconmgr", FKEYWORD, F_DOWNICONMGR },
- X+ { "f.dwimcom", FKEYWORD, F_DWIMCOM },
- X+ { "f.dwimpress", FSKEYWORD, F_DWIMPRESS },
- X+ { "f.dwimrelease", FSKEYWORD, F_DWIMRELEASE },
- X+ { "f.dwimusleep", FSKEYWORD, F_DWIMUSLEEP },
- X { "f.exec", FSKEYWORD, F_EXEC },
- X { "f.file", FSKEYWORD, F_FILE },
- X { "f.focus", FKEYWORD, F_FOCUS },
- Xdiff -c twm/parse.h dwim/parse.h
- X*** twm/parse.h Thu Jan 18 12:50:58 1990
- X--- dwim/parse.h Fri Jan 5 22:18:59 1990
- X***************
- X*** 25,30 ****
- X--- 25,31 ----
- X /** OR PERFORMANCE OF THIS SOFTWARE. **/
- X /*****************************************************************************/
- X
- X+ /* DWIM modifications: David Rabson, 6/89, 1/90 */
- X
- X /**********************************************************************
- X *
- X***************
- X*** 90,95 ****
- X--- 91,102 ----
- X #define F_CUTFILE 43
- X #define F_SHOWLIST 44
- X #define F_HIDELIST 45
- X+
- X+ #define F_DWIMCOM 8001
- X+ #define F_DWIMSET 8002
- X+ #define F_DWIMPRESS 8003
- X+ #define F_DWIMRELEASE 8004
- X+ #define F_DWIMUSLEEP 8005
- X
- X #define F_MENU 101 /* string */
- X #define F_WARPTO 102 /* string */
- XCommon subdirectories: twm/sample-twmrc and dwim/sample-twmrc
- Xdiff -c twm/twm.h dwim/twm.h
- X*** twm/twm.h Thu Jan 18 12:51:01 1990
- X--- dwim/twm.h Sat Jan 6 00:37:59 1990
- X***************
- X*** 25,30 ****
- X--- 25,31 ----
- X /** OR PERFORMANCE OF THIS SOFTWARE. **/
- X /*****************************************************************************/
- X
- X+ /* DWIM modifications David Rabson 6/89, 1/90 */
- X
- X /***********************************************************************
- X *
- X***************
- X*** 334,339 ****
- X--- 335,342 ----
- X
- X extern Bool ErrorOccurred;
- X extern XErrorEvent LastErrorEvent;
- X+
- X+ extern int dwim_set;
- X
- X #define ResetError() (ErrorOccurred = False)
- X
- Xdiff -c twm/version.c dwim/version.c
- X*** twm/version.c Thu Jan 18 12:50:58 1990
- X--- dwim/version.c Fri Jan 5 20:17:21 1990
- X***************
- X*** 25,29 ****
- X /** OR PERFORMANCE OF THIS SOFTWARE. **/
- X /*****************************************************************************/
- X
- X! char *Version = "MIT X Consortium, R4";
- X!
- X--- 25,29 ----
- X /** OR PERFORMANCE OF THIS SOFTWARE. **/
- X /*****************************************************************************/
- X
- X! /*char *Version = "MIT X Consortium, R4";*/ /* modified David Rabson 1/90 */
- X! char *Version = "dwim: from X11R4 release 1/90";
- X
- X
- X
- END_OF_FILE
- if test 40231 -ne `wc -c <'dwim.patch'`; then
- echo shar: \"'dwim.patch'\" unpacked with wrong size!
- fi
- # end of 'dwim.patch'
- fi
- echo shar: End of shell archive.
- exit 0
-