v05i056: Xrooms -- A Rooms implementation for X, Part06/14

Kent Landfield kent at ssbell.IMD.Sterling.COM
Mon Jan 15 17:08:49 AEST 1990


Submitted-by: wsl.dec.com!mikey (Mike Yang)
Posting-number: Volume 5, Issue 56
Archive-name: xrooms/part06

#! /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 archive 6 (of 14)."
# Contents:  ./Makefile ./lib/Makefile ./xrooms/xrProtoArgs.c
#   ./xrooms/xrProtoIter.c ./xrooms/xrXUtils.c
# Wrapped by kent at ssbell on Sun Jan 14 21:57:52 1990
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f './Makefile' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'./Makefile'\"
else
echo shar: Extracting \"'./Makefile'\" \(10206 characters\)
sed "s/^X//" >'./Makefile' <<'END_OF_FILE'
X# Makefile generated by imake - do not edit!
X# $XConsortium: imake.c,v 1.37 88/10/08 20:08:30 jim Exp $
X
X###########################################################################
X# X Window System Makefile generated from template file Imake.tmpl
X# $XConsortium: Imake.tmpl,v 1.91 88/10/23 22:37:10 jim Exp $
X#
X# Do not change the body of the imake template file.  Server-specific
X# parameters may be set in the appropriate .macros file; site-specific
X# parameters (but shared by all servers) may be set in site.def.  If you
X# make any changes, you'll need to rebuild the makefiles using
X# "make World" (at best) or "make Makefile; make Makefiles" (at least) in
X# the top level directory.
X#
X# If your C preprocessor doesn't define any unique symbols, you'll need
X# to set BOOTSTRAPCFLAGS when rebuilding imake (usually when doing
X# "make Makefile", "make Makefiles", or "make World").
X#
X# If you absolutely can't get imake to work, you'll need to set the
X# variables at the top of each Makefile as well as the dependencies at the
X# bottom (makedepend will do this automatically).
X#
X
X###########################################################################
X# platform-specific configuration parameters - edit Mips.macros to change
X
X# platform:  $XConsortium: Vax.macros,v 1.49 88/10/23 11:01:02 jim Exp $
X
XBOOTSTRAPCFLAGS =
X             AS = as
X             CC = cc
X            CPP = /lib/cpp
X             LD = ld
X           LINT = lint
X        INSTALL = install
X           TAGS = ctags
X             RM = rm -f
X             MV = mv
X             LN = ln -s
X         RANLIB = ranlib
XRANLIBINSTFLAGS = -t
X             AR = ar clq
X             LS = ls
X       LINTOPTS = -axz
X    LINTLIBFLAG = -C
X           MAKE = make
XSTD_CPP_DEFINES =
X    STD_DEFINES =
X
X###########################################################################
X# site-specific configuration parameters - edit site.def to change
X
X# site:  $XConsortium: site.def,v 1.16 88/10/12 10:30:24 jim Exp $
X
XSYSLAST_LIBRARIES = -ldnet
X
X###########################################################################
X# definitions common to all Makefiles - do not edit
X
X          SHELL = 	/bin/sh
X
X        DESTDIR =
X      USRLIBDIR =     $(DESTDIR)/usr/lib
X         BINDIR = 	    $(DESTDIR)/usr/bin/X11
X         INCDIR = 	    $(DESTDIR)/usr/include/X11
X         ADMDIR = $(DESTDIR)/usr/adm
X         LIBDIR = $(USRLIBDIR)/X11
X     LINTLIBDIR = $(USRLIBDIR)/lint
X        FONTDIR = $(LIBDIR)/fonts
X       XINITDIR = $(LIBDIR)/xinit
X         XDMDIR = $(LIBDIR)/xdm
X         UWMDIR = $(LIBDIR)/uwm
X         AWMDIR = $(LIBDIR)/awm
X         TWMDIR = $(LIBDIR)/twm
X        MANPATH = $(DESTDIR)/usr/local/man
X  MANSOURCEPATH = $(MANPATH)/man
X         MANDIR = $(MANSOURCEPATH)1
X      LIBMANDIR = $(MANSOURCEPATH)3
X    XAPPLOADDIR = $(LIBDIR)/app-defaults
X
X   INSTBINFLAGS = -m 0755
X   INSTUIDFLAGS = -m 4755
X   INSTLIBFLAGS = -m 0664
X   INSTINCFLAGS = -m 0444
X   INSTMANFLAGS = -m 0444
X   INSTAPPFLAGS = -m 0444
X  INSTKMEMFLAGS =       -m 0755
X        FCFLAGS = -t
X    CDEBUGFLAGS = -O
X
X        PATHSEP = /
X         DEPEND = $(DEPENDSRC)/makedepend
X          IMAKE = $(IMAKESRC)/imake
X            RGB = $(RGBSRC)/rgb
X             FC = $(BDFTOSNFSRC)/bdftosnf
X      MKFONTDIR = $(MKFONTDIRSRC)/mkfontdir
X      MKDIRHIER = $(SCRIPTSSRC)/mkdirhier.sh
X
X         CFLAGS = $(CDEBUGFLAGS) $(INCLUDES) $(STD_DEFINES) $(DEFINES)
X      LINTFLAGS = $(LINTOPTS) $(INCLUDES) $(STD_DEFINES) $(DEFINES) -DLINT
X        LDFLAGS = $(CDEBUGFLAGS) $(SYS_LIBRARIES) $(SYSAUX_LIBRARIES)
X            TOP = ../../../../../../a10c/pk/V2max/x11
X      CLIENTSRC = $(TOP)/clients
X        DEMOSRC = $(TOP)/demos
X         LIBSRC = $(TOP)/lib
X        FONTSRC = $(TOP)/fonts
X     INCLUDESRC = $(TOP)/X11 -I$(TOP)
X      SERVERSRC = $(TOP)/server
X        UTILSRC = $(TOP)/util
X     SCRIPTSSRC = $(UTILSRC)/scripts
X     EXAMPLESRC = $(TOP)/examples
X     CONTRIBSRC = $(TOP)/contrib
X         DOCSRC = $(TOP)/doc
X         RGBSRC = $(TOP)/rgb
X      DEPENDSRC = $(UTILSRC)/makedepend
X       IMAKESRC = $(UTILSRC)/imake
X       IRULESRC = $(UTILSRC)/imake.includes
X        XLIBSRC = $(LIBSRC)/X
X         XMUSRC = $(LIBSRC)/Xmu
X     TOOLKITSRC = $(LIBSRC)/Xt
X     AWIDGETSRC = $(LIBSRC)/Xaw
X     OLDXLIBSRC = $(LIBSRC)/oldX
X    BDFTOSNFSRC = $(FONTSRC)/bdftosnf
X   MKFONTDIRSRC = $(FONTSRC)/mkfontdir
X   EXTENSIONSRC = $(TOP)/extensions
X   EXTENSIONLIB = $(EXTENSIONSRC)/lib/libXext.a
X           XLIB = $(XLIBSRC)/libX11.a
X         XMULIB = $(XMUSRC)/libXmu.a
X        OLDXLIB = $(OLDXLIBSRC)/liboldX.a
X       XTOOLLIB = $(TOOLKITSRC)/libXt.a
X         XAWLIB = $(AWIDGETSRC)/libXaw.a
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       INCLUDES = -I$(TOP)
X      MACROFILE = Mips.macros
X   ICONFIGFILES = $(IRULESRC)/Imake.tmpl \
X			$(IRULESRC)/$(MACROFILE) $(IRULESRC)/site.def
X  IMAKE_DEFINES =
X      IMAKE_CMD = $(NEWTOP)$(IMAKE) -TImake.tmpl -I$(NEWTOP)$(IRULESRC) \
X			-s Makefile $(IMAKE_DEFINES)
X         RM_CMD = $(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a \
X			.emacs_* tags TAGS make.log MakeOut
X
X###########################################################################
X# rules:  $XConsortium: Imake.rules,v 1.71 88/10/23 22:46:34 jim Exp $
X
X###########################################################################
X# start of Imakefile
X
X#
X# Make file for font libraries
X#
X         SUBDIRS = utils lib xrooms xrset
X
X     CDEBUGFLAGS = -g
X
X    UTIL_DEFINES = -DDEBUG_ON -DENTRY_TRACKING_ON -DASSERTIONS_ON
X
Xall::
X	@case '${MFLAGS}' in *[ik]*) set +e;; esac; \
X	for i in $(SUBDIRS) ;\
X	do \
X		(cd $$i ; echo "making all in $$i"; \
X			$(MAKE) 'CDEBUGFLAGS=$(CDEBUGFLAGS)' 'UTIL_DEFINES=$(UTIL_DEFINES)' $(MFLAGS)); \
X	done
X
Xdepend::
X	@case '${MFLAGS}' in *[ik]*) set +e;; esac; \
X	for i in $(SUBDIRS) ;\
X	do \
X		(cd $$i ; echo "depending in $$i"; \
X			$(MAKE) $(MFLAGS) depend ); \
X	done
X
Xlintlib::
X	@case '${MFLAGS}' in *[ik]*) set +e;; esac; \
X	for i in $(SUBDIRS) ;\
X	do \
X		(cd $$i ; echo "making lint subdirs for lintlib and lintlib in $$i"; \
X			$(MAKE) $(MFLAGS) DESTDIR='$(DESTDIR)' \
X				LINTOPTS='$(LINTOPTS)' lintlib ); \
X	done
X
Xinstall.ln::
X	@case '${MFLAGS}' in *[ik]*) set +e;; esac; \
X	for i in $(SUBDIRS) ;\
X	do \
X		(cd $$i ; echo "making lint subdirs for install.ln and install.ln in $$i"; \
X			$(MAKE) $(MFLAGS) DESTDIR='$(DESTDIR)' \
X				LINTOPTS='$(LINTOPTS)' install.ln ); \
X	done
X
X###########################################################################
X# Imake.tmpl common rules for all Makefiles - do not edit
X
Xemptyrule::
X
Xclean::
X	$(RM_CMD) \#*
X
XMakefile:: $(IMAKE)
X
XMakefile:: Imakefile \
X	$(IRULESRC)/Imake.tmpl \
X	$(IRULESRC)/Imake.rules \
X	$(IRULESRC)/site.def \
X	$(IRULESRC)/$(MACROFILE)
X	- at if [ -f Makefile ]; then \
X		echo "$(RM) Makefile.bak; $(MV) Makefile Makefile.bak"; \
X		$(RM) Makefile.bak; $(MV) Makefile Makefile.bak; \
X	else exit 0; fi
X	$(IMAKE_CMD) -DTOPDIR=$(TOP)
X
X$(IMAKE):
X	@echo "making $@"; \
X	cd $(IMAKESRC); $(MAKE) BOOTSTRAPCFLAGS=$(BOOTSTRAPCFLAGS)
X
Xtags::
X	$(TAGS) -w *.[ch]
X	$(TAGS) -xw *.[ch] > TAGS
X
X###########################################################################
X# rules for building in SUBDIRS - do not edit
X
Xinstall::
X	@case '${MFLAGS}' in *[ik]*) set +e;; esac; \
X	for i in $(SUBDIRS) ;\
X	do \
X		(cd $$i ; echo "installing in $$i"; \
X			$(MAKE) $(MFLAGS) \
X				DESTDIR='$(DESTDIR)' install ); \
X	done
X
Xinstall.man::
X	@case '${MFLAGS}' in *[ik]*) set +e;; esac; \
X	for i in $(SUBDIRS) ;\
X	do \
X		(cd $$i ; echo "installing man pages in $$i"; \
X			$(MAKE) $(MFLAGS) \
X				DESTDIR='$(DESTDIR)' install.man ); \
X	done
X
Xclean::
X	@case '${MFLAGS}' in *[ik]*) set +e;; esac; \
X	for i in $(SUBDIRS) ;\
X	do \
X		(cd $$i ; echo "cleaning in $$i"; \
X			$(MAKE) $(MFLAGS) RM_CMD='$(RM_CMD)' clean ); \
X	done
X
Xtags::
X	@case '${MFLAGS}' in *[ik]*) set +e;; esac; \
X	for i in $(SUBDIRS) ;\
X	do \
X		(cd $$i ; echo "tagging in $$i"; \
X			$(MAKE) $(MFLAGS) TAGS='$(TAGS)' tags ); \
X	done
X
XMakefiles:: $(IMAKE)
X
XMakefiles::
X	@case '${MFLAGS}' in *[ik]*) set +e;; esac; \
X	for i in $(SUBDIRS) ;\
X	do \
X		echo "Making Makefiles in $$i..."; \
X		case "$$i" in \
X		./?*/?*/?*/?*) newtop=../../../../ sub=subsubsubsub;; \
X		./?*/?*/?*) newtop=../../../ sub=subsubsub;; \
X		./?*/?*)    newtop=../../ sub=subsub;; \
X		./?*)       newtop=../ sub=sub;; \
X		*/?*/?*/?*)    newtop=../../../../ sub=subsubsubsub;; \
X		*/?*/?*)    newtop=../../../ sub=subsubsub;; \
X		*/?*)       newtop=../../ sub=subsub;; \
X		*)	    newtop=../ sub=sub;; \
X		esac; \
X		$(MAKE) $${sub}dirMakefiles NEWTOP=$$newtop \
X			MAKEFILE_SUBDIR=$$i;\
X	done
X
XsubdirMakefiles:
X	$(RM) $(MAKEFILE_SUBDIR)/Makefile.bak
X	- at if [ -f $(MAKEFILE_SUBDIR)/Makefile ]; then \
X	echo "$(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak"; \
X	$(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak; \
X	else exit 0; fi
X	cd $(MAKEFILE_SUBDIR); $(IMAKE_CMD) -DTOPDIR=../$(TOP); \
X	$(MAKE) $(MFLAGS) Makefiles
X
XsubsubdirMakefiles:
X	$(RM) $(MAKEFILE_SUBDIR)/Makefile.bak
X	- at if [ -f $(MAKEFILE_SUBDIR)/Makefile ]; then \
X	echo "$(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak"; \
X	$(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak; \
X	else exit 0; fi
X	cd $(MAKEFILE_SUBDIR); $(IMAKE_CMD) -DTOPDIR=../../$(TOP); \
X	$(MAKE) $(MFLAGS) Makefiles
X
XsubsubsubdirMakefiles:
X	$(RM) $(MAKEFILE_SUBDIR)/Makefile.bak
X	- at if [ -f $(MAKEFILE_SUBDIR)/Makefile ]; then \
X	echo "$(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak"; \
X	$(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak; \
X	else exit 0; fi
X	cd $(MAKEFILE_SUBDIR); $(IMAKE_CMD) -DTOPDIR=../../../$(TOP); \
X	$(MAKE) $(MFLAGS) Makefiles
X
XsubsubsubsubdirMakefiles:
X	$(RM) $(MAKEFILE_SUBDIR)/Makefile.bak
X	- at if [ -f $(MAKEFILE_SUBDIR)/Makefile ]; then \
X	echo "$(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak"; \
X	$(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak; \
X	else exit 0; fi
X	cd $(MAKEFILE_SUBDIR); $(IMAKE_CMD) -DTOPDIR=../../../../$(TOP); \
X	$(MAKE) $(MFLAGS) Makefiles
X
X###########################################################################
X# dependencies generated by makedepend
X
END_OF_FILE
if test 10206 -ne `wc -c <'./Makefile'`; then
    echo shar: \"'./Makefile'\" unpacked with wrong size!
fi
# end of './Makefile'
fi
if test -f './lib/Makefile' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'./lib/Makefile'\"
else
echo shar: Extracting \"'./lib/Makefile'\" \(9387 characters\)
sed "s/^X//" >'./lib/Makefile' <<'END_OF_FILE'
X# Makefile generated by imake - do not edit!
X# $XConsortium: imake.c,v 1.37 88/10/08 20:08:30 jim Exp $
X
X###########################################################################
X# X Window System Makefile generated from template file Imake.tmpl
X# $XConsortium: Imake.tmpl,v 1.91 88/10/23 22:37:10 jim Exp $
X#
X# Do not change the body of the imake template file.  Server-specific
X# parameters may be set in the appropriate .macros file; site-specific
X# parameters (but shared by all servers) may be set in site.def.  If you
X# make any changes, you'll need to rebuild the makefiles using
X# "make World" (at best) or "make Makefile; make Makefiles" (at least) in
X# the top level directory.
X#
X# If your C preprocessor doesn't define any unique symbols, you'll need
X# to set BOOTSTRAPCFLAGS when rebuilding imake (usually when doing
X# "make Makefile", "make Makefiles", or "make World").
X#
X# If you absolutely can't get imake to work, you'll need to set the
X# variables at the top of each Makefile as well as the dependencies at the
X# bottom (makedepend will do this automatically).
X#
X
X###########################################################################
X# platform-specific configuration parameters - edit Mips.macros to change
X
X# platform:  $XConsortium: Vax.macros,v 1.49 88/10/23 11:01:02 jim Exp $
X
XBOOTSTRAPCFLAGS =
X             AS = as
X             CC = cc
X            CPP = /lib/cpp
X             LD = ld
X           LINT = lint
X        INSTALL = install
X           TAGS = ctags
X             RM = rm -f
X             MV = mv
X             LN = ln -s
X         RANLIB = ranlib
XRANLIBINSTFLAGS = -t
X             AR = ar clq
X             LS = ls
X       LINTOPTS = -axz
X    LINTLIBFLAG = -C
X           MAKE = make
XSTD_CPP_DEFINES =
X    STD_DEFINES =
X
X###########################################################################
X# site-specific configuration parameters - edit site.def to change
X
X# site:  $XConsortium: site.def,v 1.16 88/10/12 10:30:24 jim Exp $
X
XSYSLAST_LIBRARIES = -ldnet
X
X###########################################################################
X# definitions common to all Makefiles - do not edit
X
X          SHELL = 	/bin/sh
X
X        DESTDIR =
X      USRLIBDIR =     $(DESTDIR)/usr/lib
X         BINDIR = 	    $(DESTDIR)/usr/bin/X11
X         INCDIR = 	    $(DESTDIR)/usr/include/X11
X         ADMDIR = $(DESTDIR)/usr/adm
X         LIBDIR = $(USRLIBDIR)/X11
X     LINTLIBDIR = $(USRLIBDIR)/lint
X        FONTDIR = $(LIBDIR)/fonts
X       XINITDIR = $(LIBDIR)/xinit
X         XDMDIR = $(LIBDIR)/xdm
X         UWMDIR = $(LIBDIR)/uwm
X         AWMDIR = $(LIBDIR)/awm
X         TWMDIR = $(LIBDIR)/twm
X        MANPATH = $(DESTDIR)/usr/local/man
X  MANSOURCEPATH = $(MANPATH)/man
X         MANDIR = $(MANSOURCEPATH)1
X      LIBMANDIR = $(MANSOURCEPATH)3
X    XAPPLOADDIR = $(LIBDIR)/app-defaults
X
X   INSTBINFLAGS = -m 0755
X   INSTUIDFLAGS = -m 4755
X   INSTLIBFLAGS = -m 0664
X   INSTINCFLAGS = -m 0444
X   INSTMANFLAGS = -m 0444
X   INSTAPPFLAGS = -m 0444
X  INSTKMEMFLAGS =       -m 0755
X        FCFLAGS = -t
X    CDEBUGFLAGS = -O
X
X        PATHSEP = /
X         DEPEND = $(DEPENDSRC)/makedepend
X          IMAKE = $(IMAKESRC)/imake
X            RGB = $(RGBSRC)/rgb
X             FC = $(BDFTOSNFSRC)/bdftosnf
X      MKFONTDIR = $(MKFONTDIRSRC)/mkfontdir
X      MKDIRHIER = $(SCRIPTSSRC)/mkdirhier.sh
X
X         CFLAGS = $(CDEBUGFLAGS) $(INCLUDES) $(STD_DEFINES) $(DEFINES)
X      LINTFLAGS = $(LINTOPTS) $(INCLUDES) $(STD_DEFINES) $(DEFINES) -DLINT
X        LDFLAGS = $(CDEBUGFLAGS) $(SYS_LIBRARIES) $(SYSAUX_LIBRARIES)
X            TOP = /usr/src/X11
X      CLIENTSRC = $(TOP)/clients
X        DEMOSRC = $(TOP)/demos
X         LIBSRC = $(TOP)/lib
X        FONTSRC = $(TOP)/fonts
X     INCLUDESRC = $(TOP)/X11 -I$(TOP)
X      SERVERSRC = $(TOP)/server
X        UTILSRC = $(TOP)/util
X     SCRIPTSSRC = $(UTILSRC)/scripts
X     EXAMPLESRC = $(TOP)/examples
X     CONTRIBSRC = $(TOP)/contrib
X         DOCSRC = $(TOP)/doc
X         RGBSRC = $(TOP)/rgb
X      DEPENDSRC = $(UTILSRC)/makedepend
X       IMAKESRC = $(UTILSRC)/imake
X       IRULESRC = $(UTILSRC)/imake.includes
X        XLIBSRC = $(LIBSRC)/X
X         XMUSRC = $(LIBSRC)/Xmu
X     TOOLKITSRC = $(LIBSRC)/Xt
X     AWIDGETSRC = $(LIBSRC)/Xaw
X     OLDXLIBSRC = $(LIBSRC)/oldX
X    BDFTOSNFSRC = $(FONTSRC)/bdftosnf
X   MKFONTDIRSRC = $(FONTSRC)/mkfontdir
X   EXTENSIONSRC = $(TOP)/extensions
X   EXTENSIONLIB = $(EXTENSIONSRC)/lib/libXext.a
X           XLIB = $(XLIBSRC)/libX11.a
X         XMULIB = $(XMUSRC)/libXmu.a
X        OLDXLIB = $(OLDXLIBSRC)/liboldX.a
X       XTOOLLIB = $(TOOLKITSRC)/libXt.a
X         XAWLIB = $(AWIDGETSRC)/libXaw.a
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       INCLUDES = -I$(TOP)
X      MACROFILE = Mips.macros
X   ICONFIGFILES = $(IRULESRC)/Imake.tmpl \
X			$(IRULESRC)/$(MACROFILE) $(IRULESRC)/site.def
X  IMAKE_DEFINES =
X      IMAKE_CMD = $(NEWTOP)$(IMAKE) -TImake.tmpl -I$(NEWTOP)$(IRULESRC) \
X			-s Makefile $(IMAKE_DEFINES)
X         RM_CMD = $(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a \
X			.emacs_* tags TAGS make.log MakeOut
X
X###########################################################################
X# rules:  $XConsortium: Imake.rules,v 1.71 88/10/23 22:46:34 jim Exp $
X
X###########################################################################
X# start of Imakefile
X
X         LIBSRCS = appstate.c ashash.c app.c room.c profscan.c names.c
X         LIBOBJS = appstate.o ashash.o app.o room.o profscan.o names.o
X         APPSRCS = apps.c rooms.c nameprof.c profile.c profparser.y
X         APPOBJS = apps.o rooms.o nameprof.o profile.o profparser.o
X            SRCS = $(LIBSRCS) $(APPSRCS)
X            OBJS = $(LIBOBJS) $(APPOBJS)
X        INCLUDES = -I../utils -I.
X
X     CDEBUGFLAGS = -g
X
X    UTIL_DEFINES = -DDEBUG_ON -DENTRY_TRACKING_ON -DASSERTIONS_ON
X
X         DEFINES = $(STD_DEFINES) $(UTIL_DEFINES)
X
Xall:: librooms.a
X
Xlibrooms.a: $(OBJS)
X	$(RM) $@
X	$(AR) $@ $(OBJS)
X	$(RANLIB) $@
X
Xdepend:: $(DEPEND)
X
Xdepend::
X	$(DEPEND) -s "# DO NOT DELETE" -- $(CFLAGS) -- $(SRCS)
X
X$(DEPEND):
X	@echo "making $@"; \
X	cd $(DEPENDSRC); $(MAKE)
X
X###########################################################################
X# Imake.tmpl common rules for all Makefiles - do not edit
X
Xemptyrule::
X
Xclean::
X	$(RM_CMD) \#*
X
XMakefile:: $(IMAKE)
X
XMakefile:: Imakefile \
X	$(IRULESRC)/Imake.tmpl \
X	$(IRULESRC)/Imake.rules \
X	$(IRULESRC)/site.def \
X	$(IRULESRC)/$(MACROFILE)
X	- at if [ -f Makefile ]; then \
X		echo "$(RM) Makefile.bak; $(MV) Makefile Makefile.bak"; \
X		$(RM) Makefile.bak; $(MV) Makefile Makefile.bak; \
X	else exit 0; fi
X	$(IMAKE_CMD) -DTOPDIR=$(TOP)
X
X$(IMAKE):
X	@echo "making $@"; \
X	cd $(IMAKESRC); $(MAKE) BOOTSTRAPCFLAGS=$(BOOTSTRAPCFLAGS)
X
Xtags::
X	$(TAGS) -w *.[ch]
X	$(TAGS) -xw *.[ch] > TAGS
X
X###########################################################################
X# empty rules for directories that do not have SUBDIRS - do not edit
X
Xinstall::
X	@echo "install done"
X
Xinstall.man::
X	@echo "install.man done"
X
XMakefiles::
X
X###########################################################################
X# dependencies generated by makedepend
X
X# DO NOT DELETE
X
Xappstate.o: ../utils/utils.h /usr/include/stdio.h /usr/include/string.h
Xappstate.o: ../utils/machdep.h appstatestr.h appstate.h
Xashash.o: ../utils/utils.h /usr/include/stdio.h /usr/include/string.h
Xashash.o: ../utils/machdep.h ../utils/storagestr.h ../utils/storage.h
Xashash.o: ashash.h ../utils/hash.h appstate.h
Xapp.o: ../utils/utils.h /usr/include/stdio.h /usr/include/string.h
Xapp.o: ../utils/machdep.h appstr.h ../utils/list.h ../utils/storage.h app.h
Xapp.o: appstate.h ../utils/strtbl.h ashash.h ../utils/hash.h
Xroom.o: ../utils/utils.h /usr/include/stdio.h /usr/include/string.h
Xroom.o: ../utils/machdep.h app.h appstate.h ../utils/strtbl.h roomstr.h
Xroom.o: ../utils/list.h ../utils/storage.h room.h
Xprofscan.o: /usr/include/X11/Xlib.h /usr/include/sys/types.h
Xprofscan.o: /usr/include/X11/X.h /usr/include/X11/Xutil.h ../utils/utils.h
Xprofscan.o: /usr/include/stdio.h /usr/include/string.h ../utils/machdep.h
Xprofscan.o: appstate.h profile.h scanstr.h profscan.h /usr/include/ctype.h
Xnames.o: ../utils/utils.h /usr/include/stdio.h /usr/include/string.h
Xnames.o: ../utils/machdep.h /usr/include/ctype.h namesstr.h ../utils/regex.h
Xnames.o: names.h
Xapps.o: ../utils/utils.h /usr/include/stdio.h /usr/include/string.h
Xapps.o: ../utils/machdep.h ../utils/hash.h ../utils/storage.h
Xapps.o: ../utils/strtbl.h rooms.h room.h app.h appstate.h apps.h profile.h
Xrooms.o: ../utils/utils.h /usr/include/stdio.h /usr/include/string.h
Xrooms.o: ../utils/machdep.h ../utils/strtbl.h ../utils/hash.h
Xrooms.o: ../utils/storage.h apps.h app.h appstate.h rooms.h room.h profile.h
Xnameprof.o: ../utils/utils.h /usr/include/stdio.h /usr/include/string.h
Xnameprof.o: ../utils/machdep.h ../utils/strtbl.h ../utils/list.h
Xnameprof.o: ../utils/storage.h nameprof.h names.h
Xprofile.o: ../utils/utils.h /usr/include/stdio.h /usr/include/string.h
Xprofile.o: ../utils/machdep.h apps.h app.h appstate.h ../utils/strtbl.h
Xprofile.o: rooms.h room.h profilestr.h profile.h profscan.h names.h
Xprofile.o: nameprof.h
Xprofparser.o: ../utils/utils.h /usr/include/stdio.h /usr/include/string.h
Xprofparser.o: ../utils/machdep.h profparser.h ../utils/strtbl.h appstate.h
Xprofparser.o: rooms.h room.h app.h apps.h profile.h profscan.h names.h
Xprofparser.o: nameprof.h
END_OF_FILE
if test 9387 -ne `wc -c <'./lib/Makefile'`; then
    echo shar: \"'./lib/Makefile'\" unpacked with wrong size!
fi
# end of './lib/Makefile'
fi
if test -f './xrooms/xrProtoArgs.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'./xrooms/xrProtoArgs.c'\"
else
echo shar: Extracting \"'./xrooms/xrProtoArgs.c'\" \(9601 characters\)
sed "s/^X//" >'./xrooms/xrProtoArgs.c' <<'END_OF_FILE'
X
X  /*\
X   *  $Header: xrProtoArgs.c,v 5.2 90/01/11 15:17:44 erik Exp $
X   *
X   *		              COPYRIGHT 1990
X   *		        DIGITAL EQUIPMENT CORPORATION
X   *		           MAYNARD, MASSACHUSETTS
X   *			    ALL RIGHTS RESERVED.
X   *
X   * THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE AND
X   * SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT CORPORATION.
X   * DIGITAL MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE 
X   * FOR ANY PURPOSE.  IT IS SUPPLIED "AS IS" WITHOUT EXPRESS OR IMPLIED 
X   * WARRANTY.
X   *
X   * IF THE SOFTWARE IS MODIFIED IN A MANNER CREATING DERIVATIVE COPYRIGHT
X   * RIGHTS, APPROPRIATE LEGENDS MAY BE PLACED ON THE DERIVATIVE WORK IN
X   * ADDITION TO THAT SET FORTH ABOVE.
X   *
X   * Permission to use, copy, modify, and distribute this software and its
X   * documentation for any purpose and without fee is hereby granted, provided
X   * that the above copyright notice appear in all copies and that both that
X   * copyright notice and this permission notice appear in supporting
X   * documentation, and that the name of Digital Equipment Corporation not be
X   * used in advertising or publicity pertaining to distribution of the 
X   * software without specific, written prior permission.
X  \*/
X
X#include <X11/Xlib.h>
X#include <X11/cursorfont.h>
X#include <X11/Xutil.h>
X
X#define	DEBUG_VAR	xrpaDebug
X#include "utils.h"
X#include "hash.h"
X
X#include "appstate.h"
X#include "apps.h"
X#include "rooms.h"
X
X#include "xrDebug.h"
X#include "xrXUtils.h"
X#include "xrApp.h"
X#include "xrGen.h"
X#include "xrProtoArgs.h"
X#include "xrooms.h"
X
X
X/***====================================================================***/
X
Xstatic	xrpaSelectInfoRec	xrpaLastPress= { NullApp,0,0,0,0,0 };
Xstatic	RoomPtr			xrpaLastRoom=	NullRoom;
X
Xstatic RoomPtr
XxrpaGetLastRoom()
X{
X    uENTRY("xrpaGetLastRoom()\n");
X    uRETURN(xrpaLastRoom);
X}
X
Xstatic void
XxrpaSetLastRoom(pRoom)
XRoomPtr	pRoom;
X{
X    uENTRY1("xrpaSetLastRoom(%s)\n",roomText(pRoom));
X    xrpaLastRoom=	pRoom;
X    uVOIDRETURN;
X}
X
XAppPtr
XxrpaGetLastApp()
X{
X    uENTRY("xrpaGetLastApp()\n");
X    uRETURN(xrpaLastPress.pApp);
X}
X
Xstatic void
XxrpaSetLastApp(pApp)
XAppPtr	pApp;
X{
X    uENTRY1("xrpaSetLastApp(%s)\n",appText(pApp));
X    xrpaLastPress.pApp=	pApp;
X    xrpaLastPress.x=		xrpaLastPress.y=	1;
X    xrpaLastPress.button=	1;
X    xrpaLastPress.dx=		xrpaLastPress.dy=	0;
X    uVOIDRETURN;
X}
X
X/***====================================================================***/
X
Xstatic void
XxrpaFindSectorAndDelta(win,x1,y1,x2,y2,pPressInfo)
XWindow		win;
Xint		x1,y1;
Xint		x2,y2;
XxrpaSelectInfoPtr pPressInfo;
X{
XWindow		rootRtrn,kidRtrn;
Xint		realX,realY;
Xint		realWidth,realHeight;
Xunsigned	borderRtrn,depthRtrn;
Xint		xSector=	1;
Xint		ySector=	1;
Xint		dx=		0;
Xint		dy=		0;
X
X    uENTRY6("xrpaFindSectorAndDelta(0x%x,%d,%d,%d,%d,0x%x)\n",win,
X						x1,y1,x2,y2,pPressInfo);
X    
X    if (XGetGeometry(xroomsDpy,win,&rootRtrn,&realX,&realY,
X					&realWidth,&realHeight,
X					&borderRtrn,&depthRtrn)) {
X	XTranslateCoordinates(xroomsDpy,rootRtrn,win,x1,y1,&realX,&realY,
X								&kidRtrn);
X	x1=	realX;	y1=	realY;
X	XTranslateCoordinates(xroomsDpy,rootRtrn,win,x2,y2,&realX,&realY,
X								&kidRtrn);
X	x2=	realX;	y2=	realY;
X	uDEBUG4(WATCH_EVENTS,"translated coordinates: (%d,%d) -> (%d,%d)\n",
X								x1,y1,x2,y2);
X	uDEBUG2(WATCH_EVENTS,"window is %dx%d\n",realWidth,realHeight);
X	realWidth/=3;	realHeight/= 3;
X	if 	(x1<=realWidth)		xSector=	1;
X	else if (x1<=(realWidth*2))	xSector=	0;
X	else 				xSector=	-1;
X	if 	(y1<=realHeight)	ySector=	1;
X	else if (y1<=(realHeight*2))	ySector=	0;
X	else 				ySector=	-1;
X
X	dx=	x1-x2;	
X	if 	(dx>realWidth)		dx=	1;
X	else if	(dx<(-realWidth))	dx=	-1;
X	else				dx=	0;
X
X	dy=	y1-y2;
X	if 	(dy>realHeight)		dy=	1;
X	else if	(dy<(-realHeight))	dy=	-1;
X	else				dy=	0;
X    }
X    if (pPressInfo!=NullSelectInfo) {
X	pPressInfo->x=	xSector;
X	pPressInfo->y=	ySector;
X	pPressInfo->dx=	dx;
X	pPressInfo->dy=	dy;
X    }
X    uVOIDRETURN;
X}
X
X/***====================================================================***/
X
X/*
X * Routine to let user select a window using the mouse, lifted from dsimple.c
X * with stuff to locate client window added.
X */
X
XAppPtr 
XxrpaSelectApp(pInfo)
XxrpaSelectInfoPtr	pInfo;
X{
Xint	status;
XCursor	cursor;
XXEvent	event;
XWindow	targetWin= None;
Xint	buttons= 0;
Xint	button,x1,y1,x2,y2;
X
X    uENTRY1("xrpaSelectApp(0x%x)\n",pInfo);
X    /* Make the target cursor */
X    cursor = XCreateFontCursor(xroomsDpy, XC_crosshair);
X
X    do {
X	/* Grab the pointer using target cursor, letting it roam all over */
X	status = XGrabPointer(xroomsDpy, xroomsRoot, False,
X			ButtonPressMask|ButtonReleaseMask, GrabModeSync,
X			GrabModeAsync, xroomsRoot, cursor, CurrentTime);
X    } while (status!=GrabSuccess);
X
X    /* Let the user select a window... */
X    while ((targetWin == None) || (buttons != 0)) {
X	/* allow one more event */
X	XAllowEvents(xroomsDpy,SyncPointer, CurrentTime);
X	XWindowEvent(xroomsDpy,xroomsRoot,ButtonPressMask|ButtonReleaseMask,
X								&event);
X	switch (event.type) {
X	    case ButtonPress:
X		if (targetWin == None) {
X		    targetWin = event.xbutton.subwindow; /* window selected */
X		    button=	event.xbutton.button;
X		    x1=		event.xbutton.x;
X		    y1=		event.xbutton.y;
X		    if ((targetWin == None)||(buttons>1))
X			targetWin = xroomsRoot;
X		}
X		buttons++;
X		break;
X	    case ButtonRelease:
X		   /* there may have been some down before we started */
X		if (buttons > 0) 
X		    buttons--;
X		if (event.xbutton.button==button) {
X		    x2=	event.xbutton.x;
X		    y2=	event.xbutton.y;
X		}
X		break;
X	}
X    } 
X
X    XUngrabPointer(xroomsDpy, CurrentTime);      /* Done with pointer */
X
X    if (targetWin!=xroomsRoot) {
X	Window	tmpWin= targetWin;
X
X	tmpWin=		xruFindClientWindowAbove(targetWin,(WinState *)NULL);
X	if (tmpWin==None) 
X	    tmpWin=	xruFindClientWindow(targetWin,(WinState *)NULL);
X	if (tmpWin!=None) {
X	    AppPtr	pApp=	xraLookupWindowApp(tmpWin);
X	    if ((pInfo!=NullSelectInfo)&&(pApp!=NullApp)) {
X		pInfo->pApp=	pApp;
X		pInfo->button=	button;
X		xrpaFindSectorAndDelta(tmpWin,x1,y1,x2,y2,pInfo);
X	    }
X	    uRETURN(pApp);
X	}
X    }
X    uRETURN(NullApp);
X}
X
X
X/***====================================================================***/
X
Xunsigned
XxrpaLastParts()
X{
Xunsigned	parts= 0;
X
X    uENTRY("xrpaLastParts()\n");
X    if		(xrpaLastPress.x<0)	parts|= XR_X_PART|XR_X_NEGATIVE;
X    else if	(xrpaLastPress.x>0)	parts|= XR_X_PART;
X
X    if		(xrpaLastPress.y<0)	parts|= XR_Y_PART|XR_Y_NEGATIVE;
X    else if	(xrpaLastPress.y>0)	parts|= XR_Y_PART;
X
X    if (xrpaLastPress.dx!=0)
X	parts|=	XR_WIDTH_PART;
X    if (xrpaLastPress.dy!=0)
X	parts|=	XR_HEIGHT_PART;
X    uDEBUG4(WATCH_EVENTS,"press at (%d,%d), delta was (%d,%d)\n",
X				xrpaLastPress.x,xrpaLastPress.y,
X				xrpaLastPress.dx,xrpaLastPress.dy);
X    uDEBUG1(WATCH_EVENTS,"parts= 0x%x\n",parts);
X    uRETURN(parts);
X}
X
X/***====================================================================***/
X
XAppPtr
XxrpaGetApp(which,name)
Xunsigned	 which;
Xchar		*name;
X{
XStringToken	 nameToken;
XAppPtr		 pApp= NullApp;
X
X    uENTRY2("xrpaGetApp(0x%x,%s)\n",which,uStringText(name));
X    if ((which==XR_QUERY_APP)||(which==XR_QUERY_MULT_APPS))
X	pApp=	xrpaSelectApp(&xrpaLastPress);
X    else if (which==XR_LAST_APP)	pApp=	xrpaGetLastApp();
X    else if (which==XR_NAMED_APP) {
X	if (stGetTokenIfExists(name,&nameToken)) {
X	    pApp= LookupApp(nameToken);
X	}
X	xrpaSetLastApp(pApp);
X    }
X    else if (which==XR_WINDOW_APP) {
X	Window	winId;
X	if (sscanf(name,"0x%x",&winId)==1) {
X	    winId=	xruFindClientWindow(winId,(WinState *)NULL);
X	    if (winId!=None) {
X		pApp=	xraLookupWindowApp(winId);
X		if (pApp!=NullApp)
X		    xrpaSetLastApp(pApp);
X	    }
X	}
X	else pApp=	NullApp;
X    }
X    else if (which==XR_ALL_APPS) {
X	pApp=	NullApp;
X    }
X    uRETURN(pApp);
X}
X
X/***====================================================================***/
X
XRoomPtr
XxrpaGetRoom(which,name)
Xunsigned	 which;
Xchar		*name;
X{
XStringToken	nameToken;
XRoomPtr		pRoom= NullRoom;
X
X    uENTRY2("xrpaGetRoom(0x%x,%s)\n",which,uStringText(name));
X    if (which&XR_QUERY_ROOM) {
X	/* not implemented yet */
X	pRoom=	GetCurrentRoom();
X	xrpaSetLastRoom(pRoom);
X    }
X    else if (which&XR_CURRENT_ROOM)  {
X	pRoom=	GetCurrentRoom();
X	xrpaSetLastRoom(pRoom);
X    }
X    else if (which&XR_LAST_ROOM)
X	pRoom=	xrpaGetLastRoom();
X    else if (which&XR_NAMED_ROOM) {
X	if (stGetTokenIfExists(name,&nameToken)) {
X	    pRoom= LookupRoom(nameToken);
X	}
X	if ((pRoom==NullRoom)&&(which&XR_CREATE_ROOM)) {
X	    nameToken=	stGetToken(name);
X	    pRoom=	CreateRoom(nameToken);
X	}
X	xrpaSetLastRoom(pRoom);
X    }
X    else if (which&XR_ALL_ROOMS) {
X	pRoom=	NullRoom;
X    }
X    uRETURN(pRoom);
X}
X
X/***====================================================================***/
X
XAppStatePtr
XxrpaGetState(which,pApp,pRoom)
Xunsigned	which;
XAppPtr		pApp;
XRoomPtr		pRoom;
X{
XAppStatePtr	pState=	NullAppState;
X
X    uENTRY3("xrpaGetState(0x%x,%s,%s)\n",which,appText(pApp),
X						roomText(pRoom));
X
X    if (pApp!=NullApp) {
X	if (which&XR_QUERY_STATE) {
X	    which=	xrpDfltBoltState;
X	}
X	if (which&(XR_DFLT_STATE|XR_ALL_STATES)) 
X	     pState=	appGetDefault(pApp);
X	else if ((which&XR_LOCAL_STATE)&&(pRoom!=NullRoom)) {
X	    pState= appSetRoomState(pApp,roomName(pRoom),appGetDefault(pApp),
X									False);
X	    if (appIsActive(pApp))
X		roomCheckAppStates(pRoom,pApp);
X	}
X	else if ((which&XR_VISIBLE_STATE)&&(pRoom!=NullRoom)) {
X	    if (appIsActive(pApp))
X		pState=	roomGetVisibleState(pRoom,pApp);
X	    else {
X		pState= appGetRoomState(pApp,roomName(pRoom));
X		if (pState==NullAppState) {
X		    pState=	appGetDefault(pApp);
X		}
X	    }
X	}
X	else pState=	NullAppState;
X    }
X    uRETURN(pState);
X}
X
END_OF_FILE
if test 9601 -ne `wc -c <'./xrooms/xrProtoArgs.c'`; then
    echo shar: \"'./xrooms/xrProtoArgs.c'\" unpacked with wrong size!
fi
# end of './xrooms/xrProtoArgs.c'
fi
if test -f './xrooms/xrProtoIter.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'./xrooms/xrProtoIter.c'\"
else
echo shar: Extracting \"'./xrooms/xrProtoIter.c'\" \(10937 characters\)
sed "s/^X//" >'./xrooms/xrProtoIter.c' <<'END_OF_FILE'
X
X  /*\
X   *  $Header: xrProtoIter.c,v 5.1 90/01/11 15:18:07 erik Exp $
X   *
X   *		              COPYRIGHT 1990
X   *		        DIGITAL EQUIPMENT CORPORATION
X   *		           MAYNARD, MASSACHUSETTS
X   *			    ALL RIGHTS RESERVED.
X   *
X   * THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE AND
X   * SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT CORPORATION.
X   * DIGITAL MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE 
X   * FOR ANY PURPOSE.  IT IS SUPPLIED "AS IS" WITHOUT EXPRESS OR IMPLIED 
X   * WARRANTY.
X   *
X   * IF THE SOFTWARE IS MODIFIED IN A MANNER CREATING DERIVATIVE COPYRIGHT
X   * RIGHTS, APPROPRIATE LEGENDS MAY BE PLACED ON THE DERIVATIVE WORK IN
X   * ADDITION TO THAT SET FORTH ABOVE.
X   *
X   * Permission to use, copy, modify, and distribute this software and its
X   * documentation for any purpose and without fee is hereby granted, provided
X   * that the above copyright notice appear in all copies and that both that
X   * copyright notice and this permission notice appear in supporting
X   * documentation, and that the name of Digital Equipment Corporation not be
X   * used in advertising or publicity pertaining to distribution of the 
X   * software without specific, written prior permission.
X  \*/
X
X#include <X11/Xlib.h>
X#define	DEBUG_VAR	xrpiDebug
X#include "utils.h"
X
X#include "appstate.h"
X#include "apps.h"
X#include "rooms.h"
X
X#include "xrGen.h"
X#include "xrProtoArgs.h"
X#include "xrProtoIter.h"
X
X/***====================================================================***/
X/***          ITERATE ACROSS SELECTED STATES OF AN APPLICATION          ***/
X/***====================================================================***/
X
Xtypedef struct	_xrpiIterState	{
X	unsigned	flags;
X	unsigned	which;
X	Opaque		pending;
X	Opaque		pIState;
X} xrpiIterStateRec,*xrpiIterStatePtr;
X#define	NullIterState	((xrpiIterStatePtr)NULL)
X
X#define	xrpiFreeMe		((unsigned)(1<<1))
X#define	xrpiInUse		((unsigned)(1<<2))
X#define	xrpiSinglePending	((unsigned)(1<<3))
X#define	xrpiIterInProgress	((unsigned)(1<<4))
X
Xstatic	xrpiIterStateRec	dfltASIterState;
X
X/***====================================================================***/
X
XBoolean
X_xrpiInitAppStatesIter(pApp, pRoom, whichStates, ppIState)
XAppPtr		 pApp;
XRoomPtr		 pRoom;
Xunsigned	 whichStates;
XOpaque		*ppIState;
X{
XBoolean	ok=	True;
XxrpiIterStatePtr	pIState;
XStringToken	rmName;
X
X    uENTRY4("_xrpiInitAppStatesIter(%s,%s,0x%x,0x%x)\n",appText(pApp),
X					roomText(pRoom),whichStates,ppIState);
X    if ((pApp==NullApp)||(ppIState==(Opaque *)NULL)) {
X	uRETURN(False);
X    }
X    if (pRoom==NullRoom) {
X	pRoom=	GetCurrentRoom();
X	if (pRoom==NullRoom) {
X	    uRETURN(False);
X	}
X    }
X    rmName=	roomName(pRoom);
X    if (!(dfltASIterState.flags&xrpiInUse)) {
X	pIState=	&dfltASIterState;
X	pIState->flags=	xrpiInUse;
X    }
X    else {
X	pIState=	uTypedAlloc(xrpiIterStateRec);
X	if (pIState==NullIterState) {
X	    uRETURN(False);
X	}
X	pIState->flags=	xrpiInUse|xrpiFreeMe;
X    }
X    pIState->pIState=	(Opaque)NULL;
X    pIState->pending=	(Opaque)NULL;
X    if (whichStates&XR_ALL_STATES) {
X	if (whichStates&XR_DESTROY_LOCAL_STATES) {
X	    AppStatePtr	pState=	roomGetVisibleState(pRoom,pApp);
X	    if (pState!=NullAppState) {
X		appSetDefault(pApp,pState,False);
X	    }
X	    appRemoveAllRoomStates(pApp);
X	}
X	else {
X	    if (_appInitIter(pApp,&pIState->pIState))
X		pIState->flags|=	xrpiIterInProgress;
X	}
X    }
X
X    switch (whichStates&XR_WHICH_MASK) {
X	case XR_QUERY_STATE:	/* not implemented */
X	case XR_VISIBLE_STATE:
X		pIState->pending= (Opaque)roomGetVisibleState(pRoom,pApp);
X		if (pIState->pending!=(Opaque)NULL)
X		     pIState->flags|=	xrpiSinglePending;
X		else ok= False;
X		break;
X	case XR_LOCAL_STATE:
X		pIState->pending=	(Opaque)appGetRoomState(pApp,rmName);
X		if ((pIState->pending==(Opaque)NULL)&&
X		    (whichStates&XR_CREATE_LOCAL_STATES)) {
X		    pIState->pending=	(Opaque)appGetDefault(pApp);
X		    pIState->pending=	(Opaque)appSetRoomState(pApp,rmName,
X						(AppStatePtr)pIState->pending,
X						False);
X		}
X		if (pIState->pending==(Opaque)NULL)
X			pIState->flags|=	xrpiSinglePending;
X		else	ok= False;
X		break;
X	case XR_ALL_STATES:
X	case XR_DFLT_STATE:
X		pIState->pending=	(Opaque)appGetDefault(pApp);
X		pIState->flags|=	xrpiSinglePending;
X		break;
X	default:
X		ok= False;
X		break;
X    }
X    *ppIState=	(Opaque)pIState;
X    uRETURN(ok);
X}
X
X/***====================================================================***/
X
XBoolean
X_xrpiAppStatesIterNext( inState, pApp, ppState )
XOpaque		 inState;
XAppPtr		 pApp;
XAppStatePtr	*ppState;
X{
XxrpiIterStatePtr pIState= (xrpiIterStatePtr)inState;
XBoolean		 ok;
XStringToken	 name;
X
X    uENTRY3("_xrpiAppStatesIterNext(0x%x,%s,0x%x)\n",pIState,appText(pApp),
X								ppState);
X    if (pIState->flags&xrpiSinglePending) {
X	*ppState=	(AppStatePtr)pIState->pending;
X	pIState->flags&= (~xrpiSinglePending);
X	uRETURN(True);
X    }
X    if (pIState->flags&xrpiIterInProgress) {
X	ok= _appIterNext(pApp,&pIState->pIState,&name,ppState);
X	if (!ok) {
X	    pIState->flags&= (~xrpiIterInProgress);
X	}
X	uRETURN(ok);
X    }
X    uRETURN(False);
X}
X
X/***====================================================================***/
X
Xvoid
XxrpiEndAppStatesIterator( pApp, inState )
XAppPtr	pApp;
XOpaque	inState;
X{
XxrpiIterStatePtr pIState= (xrpiIterStatePtr)inState;
X
X    uENTRY1("xrpiEndAppStatesIterator( 0x%x )\n",pIState);
X    if ( pIState!= NullIterState ) {
X	pIState->flags&=	(~xrpiSinglePending);
X	pIState->pending=	(Opaque)NULL;
X	if (pIState->pIState!=(Opaque)NULL) {
X	    pIState->flags&=	(~xrpiIterInProgress);
X	    appEndIterator(pApp,pIState->pIState);
X	    pIState->pIState=	(Opaque)NULL;
X	}
X	pIState->flags&=	(~xrpiInUse);
X	if (pIState->flags&xrpiFreeMe) {
X	    uFree((Opaque)pIState);
X	}
X    }
X    uVOIDRETURN;
X}
X
X/***====================================================================***/
X
Xstatic	xrpiIterStateRec	dfltAppIterState;
X
XBoolean
X_xrpiInitAppsIter( whichApps, nameOrId, ppIState )
Xunsigned	 whichApps;
Xchar		*nameOrId;
XOpaque		*ppIState;
X{
XBoolean	ok=	True;
XxrpiIterStatePtr	pIState;
X
X    uENTRY3("_xrpiInitAppsIter(0x%x,0x%x,%s)\n",whichApps,uStringText(nameOrId),
X								ppIState);
X    if (!(dfltAppIterState.flags&xrpiInUse)) {
X	pIState=	&dfltAppIterState;
X	pIState->flags=	xrpiInUse;
X    }
X    else {
X	pIState=	uTypedAlloc(xrpiIterStateRec);
X	if (pIState==NullIterState) {
X	    uRETURN(False);
X	}
X	pIState->flags=	xrpiInUse|xrpiFreeMe;
X    }
X    pIState->pIState=	(Opaque)NULL;
X    pIState->which=	whichApps;
X    pIState->pending=	(Opaque)NULL;
X
X    if (whichApps==XR_ALL_APPS) {
X	ok= _AppsInitIter(AllApps,&pIState->pIState);
X	if (ok)	pIState->flags|=	xrpiIterInProgress;
X    }
X    else if (whichApps==XR_ACTIVE_APPS) {
X	ok= _AppsInitIter(ActiveApps,&pIState->pIState);
X	if (ok)	pIState->flags|=	xrpiIterInProgress;
X    }
X    else {
X	pIState->pending=	(Opaque)xrpaGetApp(whichApps,nameOrId);
X	if (pIState->pending!=(Opaque)NULL)
X	     pIState->flags|=	xrpiSinglePending;
X	else ok= 		False;
X    }
X    *ppIState=	(Opaque)pIState;
X    uRETURN(ok);
X}
X
X/***====================================================================***/
X
XBoolean
X_xrpiAppsIterNext( inState, ppApp )
XOpaque		 inState;
XAppPtr		*ppApp;
X{
XxrpiIterStatePtr pIState= (xrpiIterStatePtr)inState;
XBoolean		 ok;
X
X    uENTRY2("_xrpiAppsIterNext(0x%x,0x%x)\n",pIState,ppApp);
X    if (pIState->flags&xrpiSinglePending) {
X	*ppApp=	(AppPtr)pIState->pending;
X	if (pIState->which==XR_QUERY_MULT_APPS) {
X	    pIState->pending=(Opaque)xrpaGetApp(XR_QUERY_MULT_APPS,NullString);
X	    if (pIState->pending==(Opaque)NULL) {
X		pIState->flags&= (~xrpiSinglePending);
X	    }
X	}
X	else pIState->flags&= (~xrpiSinglePending);
X	uRETURN(True);
X    }
X    if (pIState->flags&xrpiIterInProgress) {
X	ok= _AppsIterNext(pIState->pIState,ppApp);
X	if (!ok) {
X	    pIState->flags&= (~xrpiIterInProgress);
X	}
X	uRETURN(ok);
X    }
X    uRETURN(False);
X}
X
X/***====================================================================***/
X
Xvoid
XxrpiEndAppsIterator( inState )
XOpaque	inState;
X{
XxrpiIterStatePtr pIState= (xrpiIterStatePtr)inState;
X
X    uENTRY1("xrpiEndAppsIterator( 0x%x )\n",pIState);
X    if ( pIState!= NullIterState ) {
X	pIState->flags&=	(~xrpiSinglePending);
X	pIState->pending=	(Opaque)NULL;
X	if (pIState->pIState!=(Opaque)NULL) {
X	    pIState->flags&=	(~xrpiIterInProgress);
X	    AppsEndIterator(pIState->pIState);
X	    pIState->pIState=	(Opaque)NULL;
X	}
X	pIState->flags&=	(~xrpiInUse);
X	if (pIState->flags&xrpiFreeMe) {
X	    uFree((Opaque)pIState);
X	}
X    }
X}
X
X/***====================================================================***/
X
Xstatic	xrpiIterStateRec	dfltRoomsIterState;
X
XBoolean
X_xrpiInitRoomsIter( whichRooms, name, ppIState)
Xunsigned	 whichRooms;
Xchar		*name;
XOpaque		*ppIState;
X{
XBoolean	ok=	True;
XxrpiIterStatePtr	pIState;
X
X    uENTRY3("_xrpiInitRoomsIter(0x%x,%s,0x%x)\n",whichRooms,uStringText(name),
X							ppIState);
X    if (!(dfltRoomsIterState.flags&xrpiInUse)) {
X	pIState=	&dfltRoomsIterState;
X	pIState->flags=	xrpiInUse;
X    }
X    else {
X	pIState=	uTypedAlloc(xrpiIterStateRec);
X	if (pIState==NullIterState) {
X	    uRETURN(False);
X	}
X	pIState->flags=	xrpiInUse|xrpiFreeMe;
X    }
X    pIState->pIState=	(Opaque)NULL;
X    pIState->pending=	(Opaque)NULL;
X
X    if ((whichRooms==XR_ALL_ROOMS)||(whichRooms==XR_VISIBLE_ROOMS)) {
X	ok= _RoomsInitIter(&pIState->pIState);
X	if (ok)	pIState->flags|=	xrpiIterInProgress;
X	pIState->which=	whichRooms;
X    }
X    else {
X	pIState->pending=	(Opaque)xrpaGetRoom(whichRooms,name);
X	if (pIState->pending!=(Opaque)NULL)
X	     pIState->flags|=	xrpiSinglePending;
X	else ok= 		False;
X    }
X    *ppIState=	(Opaque)pIState;
X    uRETURN(ok);
X}
X
X/***====================================================================***/
X
XBoolean
X_xrpiRoomsIterNext( inState, ppRoom )
XOpaque		 inState;
XRoomPtr		*ppRoom;
X{
XxrpiIterStatePtr pIState= (xrpiIterStatePtr)inState;
XBoolean		 ok;
X
X    uENTRY2("_xrpiRoomsIterNext(0x%x,0x%x)\n",pIState,ppRoom);
X    if (pIState->flags&xrpiSinglePending) {
X	*ppRoom=	(RoomPtr)pIState->pending;
X	pIState->flags&= (~xrpiSinglePending);
X	uRETURN(True);
X    }
X    if (pIState->flags&xrpiIterInProgress) {
X	if (pIState->which==XR_ALL_ROOMS)
X		ok= _RoomsIterNext(pIState->pIState,ppRoom);
X	else	ok= _RoomsIterNextVisible(pIState->pIState,ppRoom);
X	if (!ok) {
X	    pIState->flags&= (~xrpiIterInProgress);
X	}
X	uRETURN(ok);
X    }
X    uRETURN(False);
X}
X
X/***====================================================================***/
X
Xvoid
XxrpiEndRoomsIterator( inState )
XOpaque	inState;
X{
XxrpiIterStatePtr pIState= (xrpiIterStatePtr)inState;
X
X    uENTRY1("xrpiEndRoomsIterator( 0x%x )\n",pIState);
X    if ( pIState!= NullIterState ) {
X	pIState->flags&=	(~xrpiSinglePending);
X	pIState->pending=	(Opaque)NULL;
X	if (pIState->pIState!=(Opaque)NULL) { 
X	    pIState->flags&=	(~xrpiIterInProgress);
X	    RoomsEndIterator(pIState->pIState);
X	    pIState->pIState=	(Opaque)NULL;
X	}
X	pIState->flags&=	(~xrpiInUse);
X	if (pIState->flags&xrpiFreeMe) {
X	    uFree((Opaque)pIState);
X	}
X    }
X}
X
END_OF_FILE
if test 10937 -ne `wc -c <'./xrooms/xrProtoIter.c'`; then
    echo shar: \"'./xrooms/xrProtoIter.c'\" unpacked with wrong size!
fi
# end of './xrooms/xrProtoIter.c'
fi
if test -f './xrooms/xrXUtils.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'./xrooms/xrXUtils.c'\"
else
echo shar: Extracting \"'./xrooms/xrXUtils.c'\" \(10879 characters\)
sed "s/^X//" >'./xrooms/xrXUtils.c' <<'END_OF_FILE'
X
X  /*\
X   *  $Header: xrXUtils.c,v 5.0 90/01/10 07:01:42 erik Exp $
X   *
X   *		              COPYRIGHT 1990
X   *		        DIGITAL EQUIPMENT CORPORATION
X   *		           MAYNARD, MASSACHUSETTS
X   *			    ALL RIGHTS RESERVED.
X   *
X   * THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE AND
X   * SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT CORPORATION.
X   * DIGITAL MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE 
X   * FOR ANY PURPOSE.  IT IS SUPPLIED "AS IS" WITHOUT EXPRESS OR IMPLIED 
X   * WARRANTY.
X   *
X   * IF THE SOFTWARE IS MODIFIED IN A MANNER CREATING DERIVATIVE COPYRIGHT
X   * RIGHTS, APPROPRIATE LEGENDS MAY BE PLACED ON THE DERIVATIVE WORK IN
X   * ADDITION TO THAT SET FORTH ABOVE.
X   *
X   * Permission to use, copy, modify, and distribute this software and its
X   * documentation for any purpose and without fee is hereby granted, provided
X   * that the above copyright notice appear in all copies and that both that
X   * copyright notice and this permission notice appear in supporting
X   * documentation, and that the name of Digital Equipment Corporation not be
X   * used in advertising or publicity pertaining to distribution of the 
X   * software without specific, written prior permission.
X  \*/
X
X#include <X11/Xproto.h>
X#include <X11/Xlib.h>
X#include <X11/Xatom.h>
X#include <X11/Xutil.h>
X
X#define	DEBUG_VAR xruDebug
X#include "utils.h"
X#include "appstate.h"
X
X#include "xrDebug.h"
X#include "xrooms.h"
X#include "xrXUtils.h"
X
X/***====================================================================***/
X
XBoolean	xruFindFakeRoot;
XBoolean	xruFindFakeState;
X
X/***====================================================================***/
X
XBoolean
XxruGetChildren(window, children, nChildren)
XWindow	  window;
XWindow	**children;
Xint	 *nChildren;
X{
XWindow	  rtrnRoot,rtrnParent;
X
X    uENTRY3("xruGetChildren(0x%x,0x%x,0x%x)\n",window,children,nChildren);
X    if (XQueryTree(xroomsDpy, window, &rtrnRoot, &rtrnParent, children, 
X								nChildren)) {
X	uRETURN(True);
X    }
X    uRETURN(False);
X}
X
X
X/***====================================================================***/
X
XWindow
XxruGetParent(window)
XWindow	  window;
X{
XWindow	  rtrnRoot,rtrnParent;
XWindow	 *children= NULL;
Xint	  nChildren;
X
X    uENTRY1("xruGetParent(0x%x)\n",window);
X    if (XQueryTree(xroomsDpy,window,&rtrnRoot,&rtrnParent,&children,
X							&nChildren)) {
X	if ((nChildren>0)&&(children))
X	    (void)XFree	(children);
X	uRETURN(rtrnParent);
X    }
X    uRETURN(None);
X}
X
X/***====================================================================***/
X
X/*
X * Find the window manager root window (the parent of the reparented
X * application windows).  For most window managers, this is simply
X * RootWindow(dpy, screen).  For dxwm, this is it's full-screen
X * pseudo-root.
X *
X * To find the window manager root window,
X *   1.  If DEC_WM_DECORATION_GEOMETRY is not an interned atom, return
X *       RootWindow(dpy, screen)
X *   2.  Look for a direct child of RootWindow(dpy, screen) that is
X *       full-screen and has override_redirect = True.  [=top]
X *   3.  If top does not exist, return RootWindow(dpy, screen).
X *   4.  If top does not have a single, full-screen child, return
X *       RootWindow(dpy, screen).  [=WmRoot]
X *   5.  Otherwise, return WmRoot.
X *
X */
X
X
XWindow
XxruWMRoot(dpy, root, xdw, xdh)
XDisplay *dpy;
XWindow root;
Xint xdw, xdh;
X{
X  Atom dec_wm;
X  Window top, ig_win, *children;
X  int numchildren, i;
X  XWindowAttributes xwa;
X
X  dec_wm = XInternAtom(dpy, "DEC_WM_DECORATION_GEOMETRY", True);
X  if (dec_wm == None)
X    return root;
X  XQueryTree(dpy, root, &ig_win, &ig_win, &children, &numchildren);
X  top = NULL;
X  for (i=0; i<numchildren; i++) {
X    XGetWindowAttributes(dpy, children[i], &xwa);
X    if (xwa.x == 0 && xwa.y == 0 &&
X	xwa.width == xdw &&
X	xwa.height == xdh &&
X	xwa.border_width == 0 &&
X	xwa.override_redirect && (xwa.map_state==IsViewable)) {
X      top = children[i];
X      break;
X    }
X  }
X  if (!top)
X    return root;
X  XQueryTree(dpy, top, &ig_win, &ig_win, &children, &numchildren);
X  for (i=0; i<numchildren; i++) {
X    XGetWindowAttributes(dpy, children[i], &xwa);
X    if (xwa.x == 0 && xwa.y == 0 &&
X	xwa.width == xdw &&
X	xwa.height == xdh &&
X	xwa.border_width == 0 &&
X	!xwa.override_redirect) {
X      return children[i];
X    }
X  }
X  return root;
X}
X
X/***====================================================================***/
X
XWindow
XxruWMRootWindow(dpy, screen)
XDisplay *dpy;
Xint screen;
X{
X  return xruWMRoot(dpy, RootWindow(dpy, screen),
X		XDisplayWidth(dpy, screen), XDisplayHeight(dpy, screen));
X}
X
X/***====================================================================***/
X
X/*
X * Find the "root" window; the window in which the window manager puts
X * decorated windows.  Almost always the real root window (except for
X * things like dxwm.)
X */
XWindow
XxruFindRoot()
X{
X    uENTRY("xruFindRoot()\n");
X    if (xruFindFakeRoot) {
X	uRETURN(xruWMRootWindow(xroomsDpy,xroomsScreenIndex));
X    }
X    uRETURN(XRootWindow(xroomsDpy,xroomsScreenIndex));
X}
X
X/***====================================================================***/
X
X/*
X * Return the iconic state for the window.  If it doesn't have one,
X * return asInactive.
X */
X
XWinState
XxruGetState(window,lookForName)
XWindow	window;
XBoolean	lookForName;
X{
XAtom		 actualType;
Xunsigned long	 actualFormat, nItems, bytesAfter;
Xchar		*propRtrn;
XWinState	 result;
X
X    uENTRY2("xruGetState(0x%x,%s)\n",window,booleanText(lookForName));
X    if (XGetWindowProperty(xroomsDpy, window, WM_STATE, 0, 1, False,
X		       AnyPropertyType, &actualType, &actualFormat,
X		       &nItems, &bytesAfter, &propRtrn)==Success) {
X	if ((actualType != None)&&(nItems>0)) {
X	    bcopy(propRtrn, (char *) &result, sizeof(int));
X	    XFree(propRtrn);
X	    uRETURN(result);
X	}
X    }
X
X    if ((lookForName)&&(XGetWindowProperty(xroomsDpy,window,XA_WM_NAME,0,1,
X			False,AnyPropertyType, &actualType, &actualFormat,
X			&nItems, &bytesAfter, &propRtrn)==Success)) {
X
X	if ((actualType != None)&&(nItems>0)) {
X	    uDEBUG2(WATCH_APPS,"window 0x%x has name \"%s\"but no state\n",
X						window,propRtrn);
X	    if (propRtrn!=NullString)
X		XFree(propRtrn);
X	    if (xruFindFakeState) {
X		XWindowAttributes xwa;
X		XGetWindowAttributes(xroomsDpy,window,&xwa);
X		if (!xwa.override_redirect) {
X		   if (xwa.map_state==IsViewable)	result=	asNormal;
X		   else 				result=	asIconic;
X		}
X		else result=	asInactive;
X		uDEBUG1(WATCH_APPS,"faking %s state\n",asWinStateText(result));
X	    }
X	    else {
X		XSelectInput(xroomsDpy, window, PropertyChangeMask);
X		result= xruGetState(window,False);
X		uDEBUG2(WATCH_APPS,"second attempt at 0x%x returns %d\n",
X							window,result);
X	    }
X	    uRETURN(result);
X	}
X    }
X    uRETURN(asInactive);
X}
X
X/***====================================================================***/
X
X
XBoolean
XxruIsTransient(window)
XWindow	window;
X{
XAtom		 actualType;
Xunsigned long	 actualFormat, nItems, bytesAfter;
Xchar		*propRtrn;
X
X    uENTRY1("xruIsTransient(0x%x)\n",window);
X    if (XGetWindowProperty(xroomsDpy, window, XA_WM_TRANSIENT_FOR, 0, 1, False,
X		       AnyPropertyType, &actualType, &actualFormat,
X		       &nItems, &bytesAfter, &propRtrn)==Success) {
X	if ((actualType != None)&&(nItems>0)) {
X	    if (propRtrn!=NullString) XFree(propRtrn);
X	    uRETURN(True);
X	}
X    }
X    uRETURN(False);
X}
X
X/***====================================================================***/
X
XWindow 
XxruFindClientWindowAbove(window, pState)
XWindow	 	 window;
XWinState	*pState;
X{
XWinState	 state;
X
X    uENTRY2("xruFindClientWindowAbove(0x%x,0x%x)\n",window,pState);
X    do {
X	state= xruGetState(window,True);
X	if (state != asInactive) {
X	    if (pState!=(WinState *)NULL)
X	    *pState = state;
X	    uRETURN(window);
X	}
X	window=	xruGetParent(window);
X    } while ((window!=None)&&(window!=xroomsRoot)&&(window!=xroomsRealRoot));
X
X    uRETURN(None);
X}
X
X/***====================================================================***/
X
XWindow 
XxruFindClientWindow(window, pState)
XWindow	 	 window;
XWinState	*pState;
X{
XWinState	 state;
XWindow		*children;
Xint	 	 i,nChildren;
XWindow	 	 result;
X
X    uENTRY2("xruFindClientWindow(0x%x,0x%x)\n",window,pState);
X    state= xruGetState(window,True);
X    if (state != asInactive) {
X	if (pState!=(WinState *)NULL)
X	    *pState = state;
X	uRETURN(window);
X    }
X
X    result=	NULL;
X    if (xruGetChildren(window, &children, &nChildren)) {
X	for (i=0;(i<nChildren)&&(!result); i++) {
X	    result= xruFindClientWindow(children[i], pState);
X	}
X
X	if (nChildren)
X	    XFree((char *) children);
X    }
X    uRETURN(result);
X}
X
X/***====================================================================***/
X
XBoolean
XxruGetPropertyString(dpy, window, name, pRtrn)
XDisplay		 *dpy;
XWindow		  window;
XAtom		  name;
Xchar		**pRtrn;
X{
XAtom		 actualtype;
Xunsigned long	 actualformat, nitems, bytesafter;
Xchar		*propreturn = NULL;
Xchar		*ptr, buf[20];
XXSizeHints	*pHints;
Xint		 i;
X
X    if (pRtrn!=(char **)NULL)
X	*pRtrn=	NullString;
X    if (name == None)
X	return False;
X    if (XGetWindowProperty(dpy, window, name, 0, 99999, False,
X			    AnyPropertyType, &actualtype, &actualformat,
X			    &nitems, &bytesafter, &propreturn)==Success) {
X	if (bytesafter > 0) {
X	    uWarning("Far too big a property was stored.\n");
X	    return False;
X	}
X	if ((actualtype == None)||(propreturn==NULL)) {
X	    uDEBUG(WATCH_APPS,"property not found\n");
X	    return False;
X	}
X    }
X    else {
X	uDEBUG(WATCH_APPS,"XGetWindowProperty failed\n");
X	return False;
X    }
X
X    if (actualtype == XA_STRING) {
X	for (i=nitems * actualformat / 8 , ptr=propreturn ; i > 0 ; i--, ptr++)
X	    if (*ptr == 0) *ptr = ' ';
X	if (pRtrn!=(char **)NULL)
X	    *pRtrn=	propreturn;
X	return True;
X    }
X    else if (actualtype == XA_WM_SIZE_HINTS) {
X	pHints= (XSizeHints *)propreturn;
X	if ((pHints->flags & (USSize | USPosition))&&(pRtrn!=(char **)NULL)) {
X	    *pRtrn=	propreturn = (char *) malloc(30);
X	    *propreturn = 0;
X	    if (pHints->flags & USSize)
X		sprintf(propreturn, "%dx%d", pHints->width, pHints->height);
X	    if (pHints->flags & USPosition) {
X		sprintf(buf, "+%d+%d", pHints->x, pHints->y);
X		strcat(propreturn, buf);
X	    }
X	}
X	(void)XFree(pHints);
X	return True;
X    }
X    else if (actualtype == WM_STATE) {
X	WinState	result;
X	bcopy(propreturn, (char *) &result, sizeof(int));
X	XFree(propreturn);
X	if (pRtrn!=(char **)NULL) {
X	    ptr=	asWinStateText(result);
X	    *pRtrn = uStringDup(ptr);
X	}
X	return True;
X    }
X    else {
X	XFree(propreturn);
X	return(True);
X    }
X}
X
X/***====================================================================***/
X
Xint 
XxruIgnoreErrors(dpy, event)
XDisplay		*dpy;
XXErrorEvent 	*event;
X{
X    if ((event->request_code == X_GetProperty)||
X	(event->request_code == X_MapWindow)||
X	(event->request_code == X_QueryTree)) {
X	if (DEBUG_VAR&WATCH_ERRORS)
X	    _XPrintDefaultError(dpy, event, stderr);
X	return 0;
X    }
X    _XPrintDefaultError(dpy, event, stderr);
X    return 0;
X}
X
X
END_OF_FILE
if test 10879 -ne `wc -c <'./xrooms/xrXUtils.c'`; then
    echo shar: \"'./xrooms/xrXUtils.c'\" unpacked with wrong size!
fi
# end of './xrooms/xrXUtils.c'
fi
echo shar: End of archive 6 \(of 14\).
cp /dev/null ark6isdone
MISSING=""
for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 14 archives.
    rm -f ark[1-9]isdone ark[1-9][0-9]isdone
else
    echo You still need to unpack the following archives:
    echo "        " ${MISSING}
fi
##  End of shell archive.
exit 0



More information about the Comp.sources.x mailing list