home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-06-14 | 50.5 KB | 1,583 lines |
- Newsgroups: comp.sources.x
- From: ferguson@cs.rochester.edu (George Ferguson)
- Subject: v20i050: xarchie - An X browser interface to Archie, v2.0.6, Part22/24
- Message-ID: <1993Jun15.223544.1959@sparky.imd.sterling.com>
- X-Md4-Signature: 4699e2175b9c67a9cabb085daa6b58e0
- Sender: chris@sparky.imd.sterling.com (Chris Olson)
- Organization: Sterling Software
- Date: Tue, 15 Jun 1993 22:35:44 GMT
- Approved: chris@sparky.imd.sterling.com
-
- Submitted-by: ferguson@cs.rochester.edu (George Ferguson)
- Posting-number: Volume 20, Issue 50
- Archive-name: xarchie/part22
- Environment: X11
- Supersedes: xarchie: Volume 14, Issue 82-90
-
- Submitted-by: ferguson@cs.rochester.edu
- Archive-name: xarchie-2.0.6/part22
-
- #!/bin/sh
- # this is Part.22 (part 22 of xarchie-2.0.6)
- # do not concatenate these parts, unpack them in order with /bin/sh
- # file xarchie-2.0.6/FWF/FileChooser/Makefile continued
- #
- if test ! -r _shar_seq_.tmp; then
- echo 'Please unpack part 1 first!'
- exit 1
- fi
- (read Scheck
- if test "$Scheck" != 22; then
- echo Please unpack part "$Scheck" next!
- exit 1
- else
- exit 0
- fi
- ) < _shar_seq_.tmp || exit 1
- if test ! -f _shar_wnt_.tmp; then
- echo 'x - still skipping xarchie-2.0.6/FWF/FileChooser/Makefile'
- else
- echo 'x - continuing file xarchie-2.0.6/FWF/FileChooser/Makefile'
- sed 's/^X//' << 'SHAR_EOF' >> 'xarchie-2.0.6/FWF/FileChooser/Makefile' &&
- X SHLIBDEF = -DSUNSHLIB
- X
- X PROTO_DEFINES =
- X
- X INSTPGMFLAGS =
- X
- X INSTBINFLAGS = -m 0755
- X INSTUIDFLAGS = -m 4755
- X INSTLIBFLAGS = -m 0644
- X INSTINCFLAGS = -m 0444
- X INSTMANFLAGS = -m 0444
- X INSTDATFLAGS = -m 0444
- X INSTKMEMFLAGS = -g kmem -m 2755
- X
- X PROJECTROOT = /usr/staff
- X
- X TOP_INCLUDES = -I$(INCROOT)
- X
- X CDEBUGFLAGS = -O
- X CCOPTIONS = -pipe
- X
- X ALLINCLUDES = $(INCLUDES) $(EXTRA_INCLUDES) $(TOP_INCLUDES) $(STD_INCLUDES)
- X ALLDEFINES = $(ALLINCLUDES) $(STD_DEFINES) $(EXTRA_DEFINES) $(PROTO_DEFINES) $(DEFINES)
- X CFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) $(ALLDEFINES)
- X LINTFLAGS = $(LINTOPTS) -DLINT $(ALLDEFINES)
- X
- X LDLIBS = $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
- X
- X LDOPTIONS = $(CDEBUGFLAGS) $(CCOPTIONS) $(LOCAL_LDFLAGS) -L$(USRLIBDIR)
- X
- X LDCOMBINEFLAGS = -X -r
- X DEPENDFLAGS =
- X
- X MACROFILE = sun.cf
- X RM_CMD = $(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a .emacs_* tags TAGS make.log MakeOut
- 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 $(IRULESRC)/$(MACROFILE) $(EXTRA_ICONFIGFILES)
- X
- # -------------------------------------------------------------------------
- # X Window System Build Parameters
- # $XConsortium: Project.tmpl,v 1.138 91/09/10 09:02:12 rws Exp $
- X
- # -------------------------------------------------------------------------
- # X Window System make variables; this need to be coordinated with rules
- X
- X PATHSEP = /
- X USRLIBDIR = /usr/staff/lib
- X BINDIR = /usr/staff/bin
- X INCROOT = /usr/staff/include
- X BUILDINCROOT = $(TOP)
- X BUILDINCDIR = $(BUILDINCROOT)/X11
- X BUILDINCTOP = ..
- X INCDIR = $(INCROOT)/X11
- X ADMDIR = /usr/adm
- X LIBDIR = $(USRLIBDIR)/X11
- X CONFIGDIR = $(LIBDIR)/config
- X LINTLIBDIR = $(USRLIBDIR)/lint
- X
- X FONTDIR = $(LIBDIR)/fonts
- X XINITDIR = $(LIBDIR)/xinit
- X XDMDIR = $(LIBDIR)/xdm
- X TWMDIR = $(LIBDIR)/twm
- X MANPATH = /usr/staff/man
- X MANSOURCEPATH = $(MANPATH)/man
- X MANSUFFIX = 1
- X LIBMANSUFFIX = 3
- X MANDIR = $(MANSOURCEPATH)$(MANSUFFIX)
- X LIBMANDIR = $(MANSOURCEPATH)$(LIBMANSUFFIX)
- X NLSDIR = $(LIBDIR)/nls
- X PEXAPIDIR = $(LIBDIR)/PEX
- X XAPPLOADDIR = $(LIBDIR)/app-defaults
- X FONTCFLAGS = -t
- X
- X INSTAPPFLAGS = $(INSTDATFLAGS)
- X
- X IMAKE = imake
- X DEPEND = makedepend
- X RGB = rgb
- X
- X FONTC = bdftopcf
- X
- X MKFONTDIR = mkfontdir
- X MKDIRHIER = /bin/sh $(BINDIR)/mkdirhier
- X
- X CONFIGSRC = $(TOP)/config
- X DOCUTILSRC = $(TOP)/doc/util
- X CLIENTSRC = $(TOP)/clients
- X DEMOSRC = $(TOP)/demos
- X LIBSRC = $(TOP)/lib
- X FONTSRC = $(TOP)/fonts
- X INCLUDESRC = $(TOP)/X11
- X SERVERSRC = $(TOP)/server
- X UTILSRC = $(TOP)/util
- X SCRIPTSRC = $(UTILSRC)/scripts
- X EXAMPLESRC = $(TOP)/examples
- X CONTRIBSRC = $(TOP)/../contrib
- X DOCSRC = $(TOP)/doc
- X RGBSRC = $(TOP)/rgb
- X DEPENDSRC = $(UTILSRC)/makedepend
- X IMAKESRC = $(CONFIGSRC)
- X XAUTHSRC = $(LIBSRC)/Xau
- X XLIBSRC = $(LIBSRC)/X
- X XMUSRC = $(LIBSRC)/Xmu
- X TOOLKITSRC = $(LIBSRC)/Xt
- X AWIDGETSRC = $(LIBSRC)/Xaw
- X OLDXLIBSRC = $(LIBSRC)/oldX
- X XDMCPLIBSRC = $(LIBSRC)/Xdmcp
- X BDFTOSNFSRC = $(FONTSRC)/bdftosnf
- X BDFTOSNFSRC = $(FONTSRC)/clients/bdftosnf
- X BDFTOPCFSRC = $(FONTSRC)/clients/bdftopcf
- X MKFONTDIRSRC = $(FONTSRC)/clients/mkfontdir
- X FSLIBSRC = $(FONTSRC)/lib/fs
- X FONTSERVERSRC = $(FONTSRC)/server
- X EXTENSIONSRC = $(TOP)/extensions
- X XILIBSRC = $(EXTENSIONSRC)/lib/xinput
- X PHIGSLIBSRC = $(EXTENSIONSRC)/lib/PEX
- X
- # $XConsortium: sunLib.tmpl,v 1.14.1.1 92/03/17 14:58:46 rws Exp $
- X
- SHLIBLDFLAGS = -assert pure-text
- PICFLAGS = -pic
- X
- X DEPEXTENSIONLIB =
- X EXTENSIONLIB = -lXext
- X
- X DEPXLIB = $(DEPEXTENSIONLIB)
- X XLIB = $(EXTENSIONLIB) -lX11
- X
- X DEPXMULIB = $(USRLIBDIR)/libXmu.sa.$(SOXMUREV)
- X XMULIBONLY = -lXmu
- X XMULIB = -lXmu
- X
- X DEPOLDXLIB =
- X OLDXLIB = -loldX
- X
- X DEPXTOOLLIB = $(USRLIBDIR)/libXt.sa.$(SOXTREV)
- X XTOOLLIB = -lXt
- X
- X DEPXAWLIB = $(USRLIBDIR)/libXaw.sa.$(SOXAWREV)
- X XAWLIB = -lXaw
- X
- X DEPXILIB =
- X XILIB = -lXi
- X
- X SOXLIBREV = 4.10
- X SOXTREV = 4.10
- X SOXAWREV = 5.0
- X SOOLDXREV = 4.10
- X SOXMUREV = 4.10
- X SOXEXTREV = 4.10
- X SOXINPUTREV = 4.10
- X
- X DEPXAUTHLIB = $(USRLIBDIR)/libXau.a
- X XAUTHLIB = -lXau
- X DEPXDMCPLIB = $(USRLIBDIR)/libXdmcp.a
- X XDMCPLIB = -lXdmcp
- X
- X DEPPHIGSLIB = $(USRLIBDIR)/libphigs.a
- X PHIGSLIB = -lphigs
- X
- X DEPXBSDLIB = $(USRLIBDIR)/libXbsd.a
- X XBSDLIB = -lXbsd
- X
- X LINTEXTENSIONLIB = $(LINTLIBDIR)/llib-lXext.ln
- X LINTXLIB = $(LINTLIBDIR)/llib-lX11.ln
- X LINTXMU = $(LINTLIBDIR)/llib-lXmu.ln
- X LINTXTOOL = $(LINTLIBDIR)/llib-lXt.ln
- X LINTXAW = $(LINTLIBDIR)/llib-lXaw.ln
- X LINTXI = $(LINTLIBDIR)/llib-lXi.ln
- X LINTPHIGS = $(LINTLIBDIR)/llib-lphigs.ln
- X
- X DEPLIBS = $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB)
- X
- X DEPLIBS1 = $(DEPLIBS)
- X DEPLIBS2 = $(DEPLIBS)
- X DEPLIBS3 = $(DEPLIBS)
- X
- # -------------------------------------------------------------------------
- # Imake rules for building libraries, programs, scripts, and data files
- # rules: $XConsortium: Imake.rules,v 1.123 91/09/16 20:12:16 rws Exp $
- X
- # -------------------------------------------------------------------------
- # start of Imakefile
- X
- #
- # Imakefile for FileChooser
- #
- # Note that this Imakefile is just sufficient to build the FileChooser
- # for use with xarchie. The original FWF distribution contains a more
- # elaborate Imakefile for a variety of purposes. See the file ../README.
- #
- # George Ferguson, ferguson@cs.rochester.edu, 28 Jan 1993.
- #
- X
- SRCS = FChooser.c
- OBJS = FChooser.o
- X
- INCLUDES = -I. -I../Dir
- X
- all:: libFChooser.a
- X
- libFChooser.a: $(OBJS)
- X $(RM) $@
- X $(AR) $@ $(OBJS)
- X $(RANLIB) $@
- X
- depend::
- X $(DEPEND) $(DEPENDFLAGS) -s "# DO NOT DELETE" -- $(ALLDEFINES) -- $(SRCS)
- X
- # -------------------------------------------------------------------------
- # common rules for all Makefiles - do not edit
- X
- emptyrule::
- X
- clean::
- X $(RM_CMD) "#"*
- X
- Makefile::
- X -@if [ -f Makefile ]; then set -x; \
- X $(RM) Makefile.bak; $(MV) Makefile Makefile.bak; \
- X else exit 0; fi
- X $(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR)
- X
- tags::
- X $(TAGS) -w *.[ch]
- X $(TAGS) -xw *.[ch] > TAGS
- X
- saber:
- X # load $(ALLDEFINES) $(SRCS)
- X
- osaber:
- X # load $(ALLDEFINES) $(OBJS)
- X
- # -------------------------------------------------------------------------
- # empty rules for directories that do not have SUBDIRS - do not edit
- X
- install::
- X @echo "install in $(CURRENT_DIR) done"
- X
- install.man::
- X @echo "install.man in $(CURRENT_DIR) done"
- X
- Makefiles::
- X
- includes::
- X
- # -------------------------------------------------------------------------
- # dependencies generated by makedepend
- X
- SHAR_EOF
- echo 'File xarchie-2.0.6/FWF/FileChooser/Makefile is complete' &&
- chmod 0644 xarchie-2.0.6/FWF/FileChooser/Makefile ||
- echo 'restore of xarchie-2.0.6/FWF/FileChooser/Makefile failed'
- Wc_c="`wc -c < 'xarchie-2.0.6/FWF/FileChooser/Makefile'`"
- test 9856 -eq "$Wc_c" ||
- echo 'xarchie-2.0.6/FWF/FileChooser/Makefile: original size 9856, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= xarchie-2.0.6/FWF/FileChooser/Makefile.dst ==============
- if test -f 'xarchie-2.0.6/FWF/FileChooser/Makefile.dst' -a X"$1" != X"-c"; then
- echo 'x - skipping xarchie-2.0.6/FWF/FileChooser/Makefile.dst (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting xarchie-2.0.6/FWF/FileChooser/Makefile.dst (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'xarchie-2.0.6/FWF/FileChooser/Makefile.dst' &&
- # This Makefile is for use with FileChooser if you don't have imake/xmkmf.
- X
- RM = rm -f
- AR = ar clq
- RANLIB = ranlib
- X
- # These should be set in the master Makefile
- XXINCS = -I/usr/local/include
- CDEBUGFLAGS = -g
- X
- OBJS = FChooser.o
- INCLUDES = -I.
- CFLAGS = $(CDEBUGFLAGS) $(INCLUDES) $(XINCS)
- X
- libFChooser.a: $(OBJS)
- X $(RM) $@
- X $(AR) $@ $(OBJS)
- X $(RANLIB) $(@)
- X
- clean:
- X $(RM) libFChooser.a $(OBJS)
- SHAR_EOF
- chmod 0644 xarchie-2.0.6/FWF/FileChooser/Makefile.dst ||
- echo 'restore of xarchie-2.0.6/FWF/FileChooser/Makefile.dst failed'
- Wc_c="`wc -c < 'xarchie-2.0.6/FWF/FileChooser/Makefile.dst'`"
- test 391 -eq "$Wc_c" ||
- echo 'xarchie-2.0.6/FWF/FileChooser/Makefile.dst: original size 391, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= xarchie-2.0.6/FWF/FileChooser/README ==============
- if test -f 'xarchie-2.0.6/FWF/FileChooser/README' -a X"$1" != X"-c"; then
- echo 'x - skipping xarchie-2.0.6/FWF/FileChooser/README (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting xarchie-2.0.6/FWF/FileChooser/README (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'xarchie-2.0.6/FWF/FileChooser/README' &&
- X README for FileChooser
- X
- X George Ferguson
- X ferguson@cs.rochester.edu
- X
- X Last Change: 28 Jan 1993
- X
- X
- Description
- X
- X This file documents the FileChooser widget, which provides an
- X interface like that shown below (in ASCII) for selecting a file from a
- X directory:
- X
- X +==================================+
- X |+--------------------------------+|
- X || /parent/parent/dir ||
- X |+--------------------------------+|
- X ||# File1 ||
- X ||# File2 ||
- X ||# Subdir/ ||
- X ||# File3 ||
- X ||# ||
- X |+--------------------------------+|
- X +==================================+
- X
- X The top component is a MenuButton that, when clicked on, presents a
- X menu of the ancestor directories of the current directory. The bottom
- X component is List that presents the contents of the current directory.
- X The FileChooser widget's callbacks are called whenever the selection
- X changes. Selecting a subdirectory causes its contents to be displayed.
- X
- X This widget is meant to function within, say, a Form, which would
- X provide buttons and perhaps a Text item for entering new filenames.
- X The test program FChooserT.c illustrates such usage.
- X
- X Use of the FileChooser widget requires the Dir package from the
- X Free Widget Foundation (free-widgets-request@kazoo.cs.uiuc.edu).
- X
- Implementation Notes
- X
- X FileChooser is based on the FileSelector widget by Brian Totty
- X (totty@cs.uiuc.edu). The major differences are as follows:
- X - FileChooser does not provide any buttons or Text widgets,
- X just the directory menu and list of files. Thus it is meant
- X to be used within a larger application, for example, to
- X allow new filenames to be entered. Because of this, it does
- X not enforce any particular policy regarding selections.
- X - FileChooser uses a MenuButton and a dynamically generated
- X SimpleMenu to present the ancestor directories, similar to
- X the Macintosh (tm) interface. This results in about a 50%
- X saving in screen real estate.
- X
- X FileChooser attempts to resize its children whenever it is
- X resized. It makes both the MenuButton and the List as wide as the
- X FileChooser, and makes the List occupy the entire bottom of the
- X FileChooser (with a small gap below the MenuButton). The string
- X being displayed in the MenuButton (the current directory) is
- X adjusted if it is too long to fit in the given width: it is
- X right-aligned, with a "<" at the left edge to indicate truncation.
- X It would be nice if the "justify" resource of the MenuButton
- X looked after this, but c'est la vie.
- SHAR_EOF
- chmod 0644 xarchie-2.0.6/FWF/FileChooser/README ||
- echo 'restore of xarchie-2.0.6/FWF/FileChooser/README failed'
- Wc_c="`wc -c < 'xarchie-2.0.6/FWF/FileChooser/README'`"
- test 2725 -eq "$Wc_c" ||
- echo 'xarchie-2.0.6/FWF/FileChooser/README: original size 2725, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= xarchie-2.0.6/FWF/MultiList/Imakefile ==============
- if test ! -d 'xarchie-2.0.6/FWF/MultiList'; then
- echo 'x - creating directory xarchie-2.0.6/FWF/MultiList'
- mkdir 'xarchie-2.0.6/FWF/MultiList'
- fi
- if test -f 'xarchie-2.0.6/FWF/MultiList/Imakefile' -a X"$1" != X"-c"; then
- echo 'x - skipping xarchie-2.0.6/FWF/MultiList/Imakefile (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting xarchie-2.0.6/FWF/MultiList/Imakefile (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'xarchie-2.0.6/FWF/MultiList/Imakefile' &&
- #
- # Imakefile for MultiList
- #
- # Note that this Imakefile is just sufficient to build the MultiList
- # for use with xarchie. The original FWF distribution contains a more
- # elaborate Imakefile for a variety of purposes. See the file ../README.
- #
- # George Ferguson, ferguson@cs.rochester.edu, 21 Jul 1992.
- #
- X
- SRCS = MultiList.c
- OBJS = MultiList.o
- X
- INCLUDES = -I.
- X
- NormalLibraryTarget(MultiList,$(OBJS))
- X
- DependTarget()
- SHAR_EOF
- chmod 0644 xarchie-2.0.6/FWF/MultiList/Imakefile ||
- echo 'restore of xarchie-2.0.6/FWF/MultiList/Imakefile failed'
- Wc_c="`wc -c < 'xarchie-2.0.6/FWF/MultiList/Imakefile'`"
- test 416 -eq "$Wc_c" ||
- echo 'xarchie-2.0.6/FWF/MultiList/Imakefile: original size 416, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= xarchie-2.0.6/FWF/MultiList/Makefile ==============
- if test -f 'xarchie-2.0.6/FWF/MultiList/Makefile' -a X"$1" != X"-c"; then
- echo 'x - skipping xarchie-2.0.6/FWF/MultiList/Makefile (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting xarchie-2.0.6/FWF/MultiList/Makefile (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'xarchie-2.0.6/FWF/MultiList/Makefile' &&
- # Makefile generated by imake - do not edit!
- # $XConsortium: imake.c,v 1.65 91/07/25 17:50:17 rws Exp $
- #
- # The cpp used on this machine replaces all newlines and multiple tabs and
- # spaces in a macro expansion with a single space. Imake tries to compensate
- # for this, but is not always successful.
- #
- X
- # -------------------------------------------------------------------------
- # Makefile generated from "Imake.tmpl" and </tmp/IIf.a12678>
- # $XConsortium: Imake.tmpl,v 1.139 91/09/16 08:52:48 rws Exp $
- #
- # Platform-specific parameters may be set in the appropriate <vendor>.cf
- # configuration files. Site-specific parameters should be set in the file
- # site.def. Full rebuilds are recommended if any parameters are changed.
- #
- # If your C preprocessor does not define any unique symbols, you will need
- # to set BOOTSTRAPCFLAGS when rebuilding imake (usually when doing
- # "make World" the first time).
- #
- X
- # -------------------------------------------------------------------------
- # site-specific configuration parameters that need to come before
- # the platform-specific parameters - edit site.def to change
- X
- # site: $XConsortium: site.def,v 1.2 91/07/30 20:26:44 rws Exp $
- X
- # -------------------------------------------------------------------------
- # platform-specific configuration parameters - edit sun.cf to change
- X
- # platform: $XConsortium: sun.cf,v 1.72.1.1 92/03/18 13:13:37 rws Exp $
- X
- # operating system: SunOS 4.1.1
- X
- # $XConsortium: sunLib.rules,v 1.7 91/12/20 11:19:47 rws Exp $
- X
- # -------------------------------------------------------------------------
- # site-specific configuration parameters that go after
- # the platform-specific parameters - edit site.def to change
- X
- # site: $XConsortium: site.def,v 1.2 91/07/30 20:26:44 rws Exp $
- X
- X SHELL = /bin/sh
- X
- X TOP = ../../.
- X CURRENT_DIR = ./FWF/MultiList
- X
- X AR = ar clq
- X BOOTSTRAPCFLAGS =
- X CC = cc
- X AS = as
- X
- X COMPRESS = compress
- X CPP = /lib/cpp $(STD_CPP_DEFINES)
- X PREPROCESSCMD = cc -E $(STD_CPP_DEFINES)
- X INSTALL = install
- X LD = ld
- X LINT = lint
- X LINTLIBFLAG = -C
- X LINTOPTS = -axz
- X LN = ln -s
- X MAKE = make
- X MV = mv
- X CP = cp
- X
- X RANLIB = ranlib
- X RANLIBINSTFLAGS =
- X
- X RM = rm -f
- X TROFF = psroff
- X MSMACROS = -ms
- X TBL = tbl
- X EQN = eqn
- X STD_INCLUDES =
- X STD_CPP_DEFINES =
- X STD_DEFINES =
- X EXTRA_LOAD_FLAGS =
- X EXTRA_LIBRARIES =
- X TAGS = ctags
- X
- X SHAREDCODEDEF = -DSHAREDCODE
- X SHLIBDEF = -DSUNSHLIB
- X
- X PROTO_DEFINES =
- X
- X INSTPGMFLAGS =
- X
- X INSTBINFLAGS = -m 0755
- X INSTUIDFLAGS = -m 4755
- X INSTLIBFLAGS = -m 0644
- X INSTINCFLAGS = -m 0444
- X INSTMANFLAGS = -m 0444
- X INSTDATFLAGS = -m 0444
- X INSTKMEMFLAGS = -g kmem -m 2755
- X
- X PROJECTROOT = /usr/staff
- X
- X TOP_INCLUDES = -I$(INCROOT)
- X
- X CDEBUGFLAGS = -O
- X CCOPTIONS = -pipe
- X
- X ALLINCLUDES = $(INCLUDES) $(EXTRA_INCLUDES) $(TOP_INCLUDES) $(STD_INCLUDES)
- X ALLDEFINES = $(ALLINCLUDES) $(STD_DEFINES) $(EXTRA_DEFINES) $(PROTO_DEFINES) $(DEFINES)
- X CFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) $(ALLDEFINES)
- X LINTFLAGS = $(LINTOPTS) -DLINT $(ALLDEFINES)
- X
- X LDLIBS = $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
- X
- X LDOPTIONS = $(CDEBUGFLAGS) $(CCOPTIONS) $(LOCAL_LDFLAGS) -L$(USRLIBDIR)
- X
- X LDCOMBINEFLAGS = -X -r
- X DEPENDFLAGS =
- X
- X MACROFILE = sun.cf
- X RM_CMD = $(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a .emacs_* tags TAGS make.log MakeOut
- 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 $(IRULESRC)/$(MACROFILE) $(EXTRA_ICONFIGFILES)
- X
- # -------------------------------------------------------------------------
- # X Window System Build Parameters
- # $XConsortium: Project.tmpl,v 1.138 91/09/10 09:02:12 rws Exp $
- X
- # -------------------------------------------------------------------------
- # X Window System make variables; this need to be coordinated with rules
- X
- X PATHSEP = /
- X USRLIBDIR = /usr/staff/lib
- X BINDIR = /usr/staff/bin
- X INCROOT = /usr/staff/include
- X BUILDINCROOT = $(TOP)
- X BUILDINCDIR = $(BUILDINCROOT)/X11
- X BUILDINCTOP = ..
- X INCDIR = $(INCROOT)/X11
- X ADMDIR = /usr/adm
- X LIBDIR = $(USRLIBDIR)/X11
- X CONFIGDIR = $(LIBDIR)/config
- X LINTLIBDIR = $(USRLIBDIR)/lint
- X
- X FONTDIR = $(LIBDIR)/fonts
- X XINITDIR = $(LIBDIR)/xinit
- X XDMDIR = $(LIBDIR)/xdm
- X TWMDIR = $(LIBDIR)/twm
- X MANPATH = /usr/staff/man
- X MANSOURCEPATH = $(MANPATH)/man
- X MANSUFFIX = 1
- X LIBMANSUFFIX = 3
- X MANDIR = $(MANSOURCEPATH)$(MANSUFFIX)
- X LIBMANDIR = $(MANSOURCEPATH)$(LIBMANSUFFIX)
- X NLSDIR = $(LIBDIR)/nls
- X PEXAPIDIR = $(LIBDIR)/PEX
- X XAPPLOADDIR = $(LIBDIR)/app-defaults
- X FONTCFLAGS = -t
- X
- X INSTAPPFLAGS = $(INSTDATFLAGS)
- X
- X IMAKE = imake
- X DEPEND = makedepend
- X RGB = rgb
- X
- X FONTC = bdftopcf
- X
- X MKFONTDIR = mkfontdir
- X MKDIRHIER = /bin/sh $(BINDIR)/mkdirhier
- X
- X CONFIGSRC = $(TOP)/config
- X DOCUTILSRC = $(TOP)/doc/util
- X CLIENTSRC = $(TOP)/clients
- X DEMOSRC = $(TOP)/demos
- X LIBSRC = $(TOP)/lib
- X FONTSRC = $(TOP)/fonts
- X INCLUDESRC = $(TOP)/X11
- X SERVERSRC = $(TOP)/server
- X UTILSRC = $(TOP)/util
- X SCRIPTSRC = $(UTILSRC)/scripts
- X EXAMPLESRC = $(TOP)/examples
- X CONTRIBSRC = $(TOP)/../contrib
- X DOCSRC = $(TOP)/doc
- X RGBSRC = $(TOP)/rgb
- X DEPENDSRC = $(UTILSRC)/makedepend
- X IMAKESRC = $(CONFIGSRC)
- X XAUTHSRC = $(LIBSRC)/Xau
- X XLIBSRC = $(LIBSRC)/X
- X XMUSRC = $(LIBSRC)/Xmu
- X TOOLKITSRC = $(LIBSRC)/Xt
- X AWIDGETSRC = $(LIBSRC)/Xaw
- X OLDXLIBSRC = $(LIBSRC)/oldX
- X XDMCPLIBSRC = $(LIBSRC)/Xdmcp
- X BDFTOSNFSRC = $(FONTSRC)/bdftosnf
- X BDFTOSNFSRC = $(FONTSRC)/clients/bdftosnf
- X BDFTOPCFSRC = $(FONTSRC)/clients/bdftopcf
- X MKFONTDIRSRC = $(FONTSRC)/clients/mkfontdir
- X FSLIBSRC = $(FONTSRC)/lib/fs
- X FONTSERVERSRC = $(FONTSRC)/server
- X EXTENSIONSRC = $(TOP)/extensions
- X XILIBSRC = $(EXTENSIONSRC)/lib/xinput
- X PHIGSLIBSRC = $(EXTENSIONSRC)/lib/PEX
- X
- # $XConsortium: sunLib.tmpl,v 1.14.1.1 92/03/17 14:58:46 rws Exp $
- X
- SHLIBLDFLAGS = -assert pure-text
- PICFLAGS = -pic
- X
- X DEPEXTENSIONLIB =
- X EXTENSIONLIB = -lXext
- X
- X DEPXLIB = $(DEPEXTENSIONLIB)
- X XLIB = $(EXTENSIONLIB) -lX11
- X
- X DEPXMULIB = $(USRLIBDIR)/libXmu.sa.$(SOXMUREV)
- X XMULIBONLY = -lXmu
- X XMULIB = -lXmu
- X
- X DEPOLDXLIB =
- X OLDXLIB = -loldX
- X
- X DEPXTOOLLIB = $(USRLIBDIR)/libXt.sa.$(SOXTREV)
- X XTOOLLIB = -lXt
- X
- X DEPXAWLIB = $(USRLIBDIR)/libXaw.sa.$(SOXAWREV)
- X XAWLIB = -lXaw
- X
- X DEPXILIB =
- X XILIB = -lXi
- X
- X SOXLIBREV = 4.10
- X SOXTREV = 4.10
- X SOXAWREV = 5.0
- X SOOLDXREV = 4.10
- X SOXMUREV = 4.10
- X SOXEXTREV = 4.10
- X SOXINPUTREV = 4.10
- X
- X DEPXAUTHLIB = $(USRLIBDIR)/libXau.a
- X XAUTHLIB = -lXau
- X DEPXDMCPLIB = $(USRLIBDIR)/libXdmcp.a
- X XDMCPLIB = -lXdmcp
- X
- X DEPPHIGSLIB = $(USRLIBDIR)/libphigs.a
- X PHIGSLIB = -lphigs
- X
- X DEPXBSDLIB = $(USRLIBDIR)/libXbsd.a
- X XBSDLIB = -lXbsd
- X
- X LINTEXTENSIONLIB = $(LINTLIBDIR)/llib-lXext.ln
- X LINTXLIB = $(LINTLIBDIR)/llib-lX11.ln
- X LINTXMU = $(LINTLIBDIR)/llib-lXmu.ln
- X LINTXTOOL = $(LINTLIBDIR)/llib-lXt.ln
- X LINTXAW = $(LINTLIBDIR)/llib-lXaw.ln
- X LINTXI = $(LINTLIBDIR)/llib-lXi.ln
- X LINTPHIGS = $(LINTLIBDIR)/llib-lphigs.ln
- X
- X DEPLIBS = $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB)
- X
- X DEPLIBS1 = $(DEPLIBS)
- X DEPLIBS2 = $(DEPLIBS)
- X DEPLIBS3 = $(DEPLIBS)
- X
- # -------------------------------------------------------------------------
- # Imake rules for building libraries, programs, scripts, and data files
- # rules: $XConsortium: Imake.rules,v 1.123 91/09/16 20:12:16 rws Exp $
- X
- # -------------------------------------------------------------------------
- # start of Imakefile
- X
- #
- # Imakefile for MultiList
- #
- # Note that this Imakefile is just sufficient to build the MultiList
- # for use with xarchie. The original FWF distribution contains a more
- # elaborate Imakefile for a variety of purposes. See the file ../README.
- #
- # George Ferguson, ferguson@cs.rochester.edu, 21 Jul 1992.
- #
- X
- SRCS = MultiList.c
- OBJS = MultiList.o
- X
- INCLUDES = -I.
- X
- all:: libMultiList.a
- X
- libMultiList.a: $(OBJS)
- X $(RM) $@
- X $(AR) $@ $(OBJS)
- X $(RANLIB) $@
- X
- depend::
- X $(DEPEND) $(DEPENDFLAGS) -s "# DO NOT DELETE" -- $(ALLDEFINES) -- $(SRCS)
- X
- # -------------------------------------------------------------------------
- # common rules for all Makefiles - do not edit
- X
- emptyrule::
- X
- clean::
- X $(RM_CMD) "#"*
- X
- Makefile::
- X -@if [ -f Makefile ]; then set -x; \
- X $(RM) Makefile.bak; $(MV) Makefile Makefile.bak; \
- X else exit 0; fi
- X $(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR)
- X
- tags::
- X $(TAGS) -w *.[ch]
- X $(TAGS) -xw *.[ch] > TAGS
- X
- saber:
- X # load $(ALLDEFINES) $(SRCS)
- X
- osaber:
- X # load $(ALLDEFINES) $(OBJS)
- X
- # -------------------------------------------------------------------------
- # empty rules for directories that do not have SUBDIRS - do not edit
- X
- install::
- X @echo "install in $(CURRENT_DIR) done"
- X
- install.man::
- X @echo "install.man in $(CURRENT_DIR) done"
- X
- Makefiles::
- X
- includes::
- X
- # -------------------------------------------------------------------------
- # dependencies generated by makedepend
- X
- SHAR_EOF
- chmod 0644 xarchie-2.0.6/FWF/MultiList/Makefile ||
- echo 'restore of xarchie-2.0.6/FWF/MultiList/Makefile failed'
- Wc_c="`wc -c < 'xarchie-2.0.6/FWF/MultiList/Makefile'`"
- test 9845 -eq "$Wc_c" ||
- echo 'xarchie-2.0.6/FWF/MultiList/Makefile: original size 9845, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= xarchie-2.0.6/FWF/MultiList/Makefile.dst ==============
- if test -f 'xarchie-2.0.6/FWF/MultiList/Makefile.dst' -a X"$1" != X"-c"; then
- echo 'x - skipping xarchie-2.0.6/FWF/MultiList/Makefile.dst (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting xarchie-2.0.6/FWF/MultiList/Makefile.dst (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'xarchie-2.0.6/FWF/MultiList/Makefile.dst' &&
- # This Makefile is for use with MultiList if you don't have imake/xmkmf.
- X
- RM = rm -f
- AR = ar clq
- RANLIB = ranlib
- X
- # These should be set in the master Makefile
- XXINCS = -I/usr/local/include
- CDEBUGFLAGS = -g
- X
- OBJS = MultiList.o
- INCLUDES = -I.
- CFLAGS = $(CDEBUGFLAGS) $(INCLUDES) $(XINCS)
- X
- libMultiList.a: $(OBJS)
- X $(RM) $@
- X $(AR) $@ $(OBJS)
- X $(RANLIB) $(@)
- X
- clean:
- X $(RM) libMultiList.a $(OBJS)
- SHAR_EOF
- chmod 0644 xarchie-2.0.6/FWF/MultiList/Makefile.dst ||
- echo 'restore of xarchie-2.0.6/FWF/MultiList/Makefile.dst failed'
- Wc_c="`wc -c < 'xarchie-2.0.6/FWF/MultiList/Makefile.dst'`"
- test 392 -eq "$Wc_c" ||
- echo 'xarchie-2.0.6/FWF/MultiList/Makefile.dst: original size 392, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= xarchie-2.0.6/FWF/MultiList/MultiList.c ==============
- if test -f 'xarchie-2.0.6/FWF/MultiList/MultiList.c' -a X"$1" != X"-c"; then
- echo 'x - skipping xarchie-2.0.6/FWF/MultiList/MultiList.c (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting xarchie-2.0.6/FWF/MultiList/MultiList.c (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'xarchie-2.0.6/FWF/MultiList/MultiList.c' &&
- /****************************************************************************
- X
- X MultiList.c
- X
- X This file contains the implementation of the Picasso List
- X widget. Its functionality is intended to be similar to
- X The Athena List widget, with some extra features added.
- X
- X This code is loosely based on the Athena List source which
- X is why the MIT copyright notice appears below.
- X
- X The code was changed substantially in V3.4 to change the
- X action/callback interface which was unnecessarily ugly. Code
- X using some features of the old interface may need to be changed.
- X Hope the changes don't make people's lives too miserable.
- X
- X ****************************************************************************/
- X
- /*
- X * Author:
- X * Brian Totty
- X * Department of Computer Science
- X * University Of Illinois at Urbana-Champaign
- X * 1304 West Springfield Avenue
- X * Urbana, IL 61801
- X *
- X * totty@cs.uiuc.edu
- X *
- X */
- X
- /*
- X * Copyright 1989 Massachusetts Institute of Technology
- X *
- X * Permission to use, copy, modify, distribute, and sell this software and its
- X * documentation for any purpose is hereby granted without fee, provided that
- X * 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 M.I.T. not be used in advertising or
- X * publicity pertaining to distribution of the software without specific,
- X * written prior permission. M.I.T. makes no representations about the
- X * suitability of this software for any purpose. It is provided "as is"
- X * without express or implied warranty.
- X *
- X * M.I.T. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL M.I.T.
- X * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- X * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- X * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- X * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- X *
- X * Original Athena Author: Chris D. Peterson, MIT X Consortium
- X */
- X
- #include <stdio.h>
- #include <ctype.h>
- X
- #include <X11/IntrinsicP.h>
- #include <X11/StringDefs.h>
- X
- #include <MultiListP.h>
- X
- /*===========================================================================*
- X
- X D E C L A R A T I O N S A N D D E F I N I T I O N S
- X
- X *===========================================================================*/
- X
- Pixmap XmuCreateStippledPixmap();
- extern void XawInitializeWidgetSet();
- X
- #define SUPERCLASS &(simpleClassRec)
- X
- #define FontAscent(f) ((f)->max_bounds.ascent)
- #define FontDescent(f) ((f)->max_bounds.descent)
- #define FontH(f) (FontAscent(f) + FontDescent(f) + 2)
- #define FontW(f,s) (XTextWidth(f,s,strlen(s)) + 1)
- #define FontMaxCharW(f) ((f)->max_bounds.rbearing-(f)->min_bounds.lbearing+1)
- X
- #ifndef abs
- #define abs(a) ((a) < 0 ? -(a) : (a))
- #endif
- X
- #define max(a,b) ((a) > (b) ? (a) : (b))
- #define min(a,b) ((a) < (b) ? (a) : (b))
- #define XtStrlen(s) ((s) ? strlen(s) : 0)
- X
- #define TypeAlloc(t,n) (t *)malloc(sizeof(t) * n)
- #define StrCopy(s) strcpy(TypeAlloc(char,strlen(s)+1),s)
- #define StrCopyRetLength(s,lp) strcpy(TypeAlloc(char,(*lp=(strlen(s)+1))),s)
- X
- #define CoreFieldOffset(f) XtOffset(Widget,core.f)
- #define SimpleFieldOffset(f) XtOffset(XfwfMultiListWidget,simple.f)
- #define MultiListFieldOffset(f) XtOffset(XfwfMultiListWidget,multiList.f)
- X
- /*===========================================================================*
- X
- X I N T E R N A L P R O C E D U R E D E C L A R A T I O N S
- X
- X *===========================================================================*/
- X
- #if (!NeedFunctionPrototypes)
- X
- static void Initialize();
- static void Redisplay();
- static XtGeometryResult PreferredGeometry();
- static void Resize();
- static Boolean SetValues();
- X
- static void DestroyOldData();
- static void InitializeNewData();
- static void CreateNewGCs();
- X
- static void RecalcCoords();
- static void NegotiateSizeChange();
- static Boolean Layout();
- X
- static void RedrawAll();
- static void RedrawItem();
- static void RedrawRowColumn();
- X
- static void PixelToRowColumn();
- static void RowColumnToPixels();
- static Boolean RowColumnToItem();
- static Boolean ItemToRowColumn();
- X
- static void Select();
- static void Unselect();
- static void Toggle();
- static void Extend();
- static void Notify();
- X
- #else
- X
- static void Initialize(Widget request, Widget new);
- static void Redisplay(XfwfMultiListWidget mlw,
- X XEvent *event, Region rectangle_union);
- static XtGeometryResult PreferredGeometry(XfwfMultiListWidget mlw,
- X XtWidgetGeometry *parent_idea,
- X XtWidgetGeometry *our_idea);
- static void Resize(XfwfMultiListWidget mlw);
- static Boolean SetValues(XfwfMultiListWidget cpl,
- X XfwfMultiListWidget rpl,
- X XfwfMultiListWidget npl);
- static void DestroyOldData(XfwfMultiListWidget mlw);
- static void InitializeNewData(XfwfMultiListWidget mlw);
- static void CreateNewGCs(XfwfMultiListWidget mlw);
- static void RecalcCoords(XfwfMultiListWidget mlw,
- X Boolean width_changeable,
- X Boolean height_changeable);
- static void NegotiateSizeChange(XfwfMultiListWidget mlw,
- X Dimension width, Dimension height);
- static Boolean Layout(XfwfMultiListWidget mlw,
- X Boolean w_changeable, Boolean h_changeable,
- X Dimension *w_ptr, Dimension *h_ptr);
- static void RedrawAll(XfwfMultiListWidget mlw);
- static void RedrawItem(XfwfMultiListWidget mlw, int item_index);
- static void RedrawRowColumn(XfwfMultiListWidget mlw,
- X int row, int column);
- static void PixelToRowColumn(XfwfMultiListWidget mlw,
- X int x, int y, int *row_ptr, int *column_ptr);
- static void RowColumnToPixels(XfwfMultiListWidget mlw,
- X int row, int col, int *x_ptr, int *y_ptr,
- X int *w_ptr, int *h_ptr);
- static Boolean RowColumnToItem(XfwfMultiListWidget mlw,
- X int row, int column, int *item_ptr);
- static Boolean ItemToRowColumn(XfwfMultiListWidget mlw,
- X int item_index, int *row_ptr, int *column_ptr);
- static void Select(XfwfMultiListWidget mlw, XEvent *event,
- X String *params, Cardinal *num_params);
- static void Unselect(XfwfMultiListWidget mlw, XEvent *event,
- X String *params, Cardinal *num_params);
- static void Toggle(XfwfMultiListWidget mlw, XEvent *event,
- X String *params, Cardinal *num_params);
- static void Extend(XfwfMultiListWidget mlw, XEvent *event,
- X String *params, Cardinal *num_params);
- static void Notify(XfwfMultiListWidget mlw, XEvent *event,
- X String *params, Cardinal *num_params);
- #endif
- X
- /*===========================================================================*
- X
- X R E S O U R C E I N I T I A L I Z A T I O N
- X
- X *===========================================================================*/
- X
- static XtResource resources[] =
- {
- X {XtNwidth, XtCWidth, XtRDimension, sizeof(Dimension),
- X CoreFieldOffset(width), XtRString, "0"},
- X {XtNheight, XtCHeight, XtRDimension, sizeof(Dimension),
- X CoreFieldOffset(height), XtRString, "0"},
- X {XtNbackground, XtCBackground, XtRPixel, sizeof(Pixel),
- X CoreFieldOffset(background_pixel),XtRString,"XtDefaultBackground"},
- X
- X {XtNcursor, XtCCursor, XtRCursor, sizeof(Cursor),
- X SimpleFieldOffset(cursor), XtRString, "left_ptr"},
- X
- X {XtNforeground, XtCForeground, XtRPixel, sizeof(Pixel),
- X MultiListFieldOffset(foreground), XtRString,"XtDefaultForeground"},
- X {XtNhighlightForeground, XtCHForeground, XtRPixel, sizeof(Pixel),
- X MultiListFieldOffset(highlight_fg), XtRString, "XtDefaultBackground"},
- X {XtNhighlightBackground, XtCHBackground, XtRPixel, sizeof(Pixel),
- X MultiListFieldOffset(highlight_bg), XtRString, "XtDefaultForeground"},
- X {XtNcolumnSpacing, XtCSpacing, XtRDimension, sizeof(Dimension),
- X MultiListFieldOffset(column_space), XtRImmediate, (caddr_t)8},
- X {XtNrowSpacing, XtCSpacing, XtRDimension, sizeof(Dimension),
- X MultiListFieldOffset(row_space), XtRImmediate, (caddr_t)0},
- X {XtNdefaultColumns, XtCColumns, XtRInt, sizeof(int),
- X MultiListFieldOffset(default_cols), XtRImmediate, (caddr_t)1},
- X {XtNforceColumns, XtCColumns, XtRBoolean, sizeof(Boolean),
- X MultiListFieldOffset(force_cols), XtRString, (caddr_t) "False"},
- X {XtNpasteBuffer, XtCBoolean, XtRBoolean, sizeof(Boolean),
- X MultiListFieldOffset(paste), XtRString, (caddr_t) "False"},
- X {XtNverticalList, XtCBoolean, XtRBoolean, sizeof(Boolean),
- X MultiListFieldOffset(row_major), XtRString, (caddr_t) "False"},
- X {XtNlongest, XtCLongest, XtRInt, sizeof(int),
- X MultiListFieldOffset(longest), XtRImmediate, (caddr_t)0},
- X {XtNnumberStrings, XtCNumberStrings, XtRInt, sizeof(int),
- X MultiListFieldOffset(nitems), XtRImmediate, (caddr_t)0},
- X {XtNfont, XtCFont, XtRFontStruct, sizeof(XFontStruct *),
- X MultiListFieldOffset(font),XtRString, "XtDefaultFont"},
- X {XtNlist, XtCList, XtRPointer, sizeof(char **),
- X MultiListFieldOffset(list), XtRString, NULL},
- X {XtNsensitiveArray, XtCList, XtRPointer, sizeof(Boolean *),
- X MultiListFieldOffset(sensitive_array), XtRString, NULL},
- X {XtNcallback, XtCCallback, XtRCallback, sizeof(caddr_t),
- X MultiListFieldOffset(callback), XtRCallback, NULL},
- X {XtNmaxSelectable, XtCValue, XtRInt, sizeof(int),
- X MultiListFieldOffset(max_selectable), XtRImmediate, (caddr_t) 1},
- X
- X {XtNshadeSurplus, XtCBoolean, XtRBoolean, sizeof(Boolean),
- X MultiListFieldOffset(shade_surplus), XtRString, "True"},
- X
- X {XtNcolumnWidth, XtCValue, XtRDimension, sizeof(Dimension),
- X MultiListFieldOffset(col_width), XtRImmediate, (caddr_t)0},
- X {XtNrowHeight, XtCValue, XtRDimension, sizeof(Dimension),
- X MultiListFieldOffset(row_height), XtRImmediate, (caddr_t)0},
- };
- X
- /*===========================================================================*
- X
- X A C T I O N A N D T R A N S L A T I O N T A B L E S
- X
- X *===========================================================================*/
- X
- X
- static char defaultTranslations[] =
- " Shift <Btn1Down>: Toggle()\n\
- X Ctrl <Btn1Down>: Unselect()\n\
- X <Btn1Down>: Select()\n\
- X Button1 <Btn1Motion>: Extend()\n\
- X <Btn1Up>: Notify()";
- X
- static XtActionsRec actions[] =
- {
- X {"Select", (XtActionProc)Select},
- X {"Unselect", (XtActionProc)Unselect},
- X {"Toggle", (XtActionProc)Toggle},
- X {"Extend", (XtActionProc)Extend},
- X {"Notify", (XtActionProc)Notify},
- X {NULL, (XtActionProc)NULL}
- };
- X
- /*===========================================================================*
- X
- X C L A S S A L L O C A T I O N
- X
- X *===========================================================================*/
- X
- XXfwfMultiListClassRec xfwfMultiListClassRec =
- {
- X {
- X /* superclass */ (WidgetClass)SUPERCLASS,
- X /* class_name */ "XfwfMultiList",
- X /* widget_size */ sizeof(XfwfMultiListRec),
- X /* class_initialize */ NULL,
- X /* class_part_initialize*/ NULL,
- X /* class_inited */ FALSE,
- X /* initialize */ (XtInitProc)Initialize,
- X /* initialize_hook */ NULL,
- X /* realize */ XtInheritRealize,
- X /* actions */ actions,
- X /* num_actions */ XtNumber(actions),
- X /* resources */ resources,
- X /* resource_count */ XtNumber(resources),
- X /* xrm_class */ NULLQUARK,
- X /* compress_motion */ TRUE,
- X /* compress_exposure */ FALSE,
- X /* compress_enterleave */ TRUE,
- X /* visible_interest */ FALSE,
- X /* destroy */ NULL,
- X /* resize */ (XtWidgetProc)Resize,
- X /* expose */ (XtExposeProc)Redisplay,
- X /* set_values */ (XtSetValuesFunc)SetValues,
- X /* set_values_hook */ NULL,
- X /* set_values_almost */ XtInheritSetValuesAlmost,
- X /* get_values_hook */ NULL,
- X /* accept_focus */ NULL,
- X /* version */ XtVersion,
- X /* callback_private */ NULL,
- X /* tm_table */ defaultTranslations,
- X /* query_geometry */ (XtGeometryHandler)
- X PreferredGeometry,
- X /* display_accelerator */ XtInheritDisplayAccelerator,
- X /* extension */ NULL
- X }, /* Core Part */
- X {
- X /* change_sensitive */ XtInheritChangeSensitive
- X }
- };
- X
- WidgetClass xfwfMultiListWidgetClass = (WidgetClass)&xfwfMultiListClassRec;
- X
- /*===========================================================================*
- X
- X T O O L K I T M E T H O D S
- X
- X *===========================================================================*/
- X
- /*---------------------------------------------------------------------------*
- X
- X Initialize()
- X
- X This procedure is called by the X toolkit to initialize
- X the widget instance. The hook to this routine is in the
- X initialize part of the core part of the class.
- X
- X *---------------------------------------------------------------------------*/
- X
- /* ARGSUSED */
- static void Initialize(request,new)
- Widget request,new;
- {
- X XfwfMultiListWidget mlw;
- X
- X mlw = (XfwfMultiListWidget)new;
- X CreateNewGCs(mlw);
- X InitializeNewData(mlw);
- X RecalcCoords(mlw,(MultiListWidth(mlw) == 0),
- X (MultiListHeight(mlw) == 0));
- } /* Initialize */
- X
- X
- /*---------------------------------------------------------------------------*
- X
- X Redisplay(mlw,event,rectangle_union)
- X
- X This routine redraws the MultiList widget <mlw> based on the exposure
- X region requested in <event>.
- X
- X *---------------------------------------------------------------------------*/
- X
- /* ARGSUSED */
- static void Redisplay(mlw,event,rectangle_union)
- XXfwfMultiListWidget mlw;
- XXEvent *event;
- Region rectangle_union;
- {
- X GC shade_gc;
- X int i,x1,y1,w,h,x2,y2,row,col,ul_row,ul_col,lr_row,lr_col;
- X
- X if (MultiListShadeSurplus(mlw))
- X shade_gc = MultiListGrayGC(mlw);
- X else
- X shade_gc = MultiListEraseGC(mlw);
- X if (event == NULL)
- X {
- X XFillRectangle(XtDisplay(mlw),XtWindow(mlw),shade_gc,0,0,
- X MultiListWidth(mlw),MultiListHeight(mlw));
- X for (i = 0; i < MultiListNumItems(mlw); i++) RedrawItem(mlw,i);
- X }
- X else
- X {
- X x1 = event->xexpose.x;
- X y1 = event->xexpose.y;
- X w = event->xexpose.width;
- X h = event->xexpose.height;
- X x2 = x1 + w;
- X y2 = y1 + h;
- X XFillRectangle(XtDisplay(mlw),XtWindow(mlw),
- X shade_gc,x1,y1,w,h);
- X PixelToRowColumn(mlw,x1,y1,&ul_row,&ul_col);
- X PixelToRowColumn(mlw,x2,y2,&lr_row,&lr_col);
- X lr_row = min(lr_row,MultiListNumRows(mlw) - 1);
- X lr_col = min(lr_col,MultiListNumCols(mlw) - 1);
- X for (col = ul_col; col <= lr_col; col++)
- X {
- X for (row = ul_row; row <= lr_row; row++)
- X {
- X RedrawRowColumn(mlw,row,col);
- X }
- X }
- X }
- } /* End Redisplay */
- X
- X
- /*---------------------------------------------------------------------------*
- X
- X PreferredGeometry(mlw,parent_idea,our_idea)
- X
- X This routine is called by the parent to tell us about the
- X parent's idea of our width and/or height. We then suggest
- X our preference through <our_idea> and return the information
- X to the parent.
- X
- X *---------------------------------------------------------------------------*/
- X
- static XtGeometryResult PreferredGeometry(mlw,parent_idea,our_idea)
- XXfwfMultiListWidget mlw;
- XXtWidgetGeometry *parent_idea,*our_idea;
- {
- X Dimension nw,nh;
- X Boolean parent_wants_w,parent_wants_h,we_changed_size;
- X
- X parent_wants_w = (parent_idea->request_mode) & CWWidth;
- X parent_wants_h = (parent_idea->request_mode) & CWHeight;
- X
- X if (parent_wants_w)
- X nw = parent_idea->width;
- X else
- X nw = MultiListWidth(mlw);
- X
- X if (parent_wants_h)
- X nh = parent_idea->height;
- X else
- X nh = MultiListHeight(mlw);
- X
- X our_idea->request_mode = 0;
- X if (!parent_wants_w && !parent_wants_h) return(XtGeometryYes);
- X
- X we_changed_size = Layout(mlw,!parent_wants_w,!parent_wants_h,&nw,&nh);
- X our_idea->request_mode |= (CWWidth | CWHeight);
- X our_idea->width = nw;
- X our_idea->height = nh;
- X
- X if (we_changed_size)
- X return(XtGeometryAlmost);
- X else
- X return(XtGeometryYes);
- } /* End PreferredGeometry */
- X
- X
- /*---------------------------------------------------------------------------*
- X
- X Resize(mlw)
- X
- X This function is called when the widget is being resized. It
- X recalculates the layout of the widget.
- X
- X *---------------------------------------------------------------------------*/
- X
- static void Resize(mlw)
- XXfwfMultiListWidget mlw;
- {
- X Dimension width,height;
- X
- X width = MultiListWidth(mlw);
- X height = MultiListHeight(mlw);
- X Layout(mlw,False,False,&width,&height);
- } /* End Resize */
- X
- X
- /*---------------------------------------------------------------------------*
- X
- X SetValues(cpl,rpl,npl)
- X
- X This routine is called when the user is changing resources. <cpl>
- X is the current widget before the user's changes have been instituted.
- X <rpl> includes the original changes as requested by the user. <npl>
- X is the new resulting widget with the requested changes and with all
- X superclass changes already made.
- X
- X *---------------------------------------------------------------------------*/
- X
- /*ARGSUSED*/
- static Boolean SetValues(cpl,rpl,npl)
- XXfwfMultiListWidget cpl,rpl,npl;
- {
- X Boolean redraw,recalc;
- X
- X redraw = False;
- X recalc = False;
- X
- X /* Graphic Context Changes */
- X
- X if ((MultiListFG(cpl) != MultiListFG(npl)) ||
- X (MultiListBG(cpl) != MultiListBG(npl)) ||
- X (MultiListHighlightFG(cpl) != MultiListHighlightFG(npl)) ||
- X (MultiListHighlightBG(cpl) != MultiListHighlightBG(npl)) ||
- X (MultiListFont(cpl) != MultiListFont(npl)))
- X {
- X XtDestroyGC(MultiListEraseGC(cpl));
- X XtDestroyGC(MultiListDrawGC(cpl));
- X XtDestroyGC(MultiListHighlightForeGC(cpl));
- X XtDestroyGC(MultiListHighlightBackGC(cpl));
- X XtDestroyGC(MultiListGrayGC(cpl));
- X CreateNewGCs(npl);
- X redraw = True;
- X }
- X
- X /* Changes That Require Redraw */
- X
- X if ((MultiListSensitive(cpl) != MultiListSensitive(npl)) ||
- X (MultiListAncesSensitive(cpl) != MultiListAncesSensitive(npl)))
- X {
- X redraw = True;
- X }
- X
- X /* Changes That Require Selection Changes */
- X
- X if ((MultiListMaxSelectable(cpl) != MultiListMaxSelectable(npl)))
- X {
- X XtWarning("Dynamic change to maxSelectable unimplemented");
- X }
- X
- X /* Changes That Require Data Initialization */
- X
- X if ((MultiListList(cpl) != MultiListList(npl)) ||
- X (MultiListNumItems(cpl) != MultiListNumItems(npl)) ||
- X (MultiListSensitiveArray(cpl) != MultiListSensitiveArray(npl)))
- X {
- X DestroyOldData(cpl);
- X InitializeNewData(npl);
- X recalc = True;
- X redraw = True;
- X }
- X
- X /* Changes That Require Recalculating Coordinates */
- X
- X if ((MultiListWidth(cpl) != MultiListWidth(npl)) ||
- X (MultiListHeight(cpl) != MultiListHeight(npl)) ||
- X (MultiListColumnSpace(cpl) != MultiListColumnSpace(npl)) ||
- X (MultiListRowSpace(cpl) != MultiListRowSpace(npl)) ||
- X (MultiListDefaultCols(cpl) != MultiListDefaultCols(npl)) ||
- X ((MultiListForceCols(cpl) != MultiListForceCols(npl)) &&
- X (MultiListNumCols(cpl) != MultiListNumCols(npl))) ||
- X (MultiListRowMajor(cpl) != MultiListRowMajor(npl)) ||
- X (MultiListFont(cpl) != MultiListFont(npl)) ||
- X (MultiListLongest(cpl) != MultiListLongest(npl)))
- X {
- X recalc = True;
- X redraw = True;
- X }
- X
- X if (MultiListColWidth(cpl) != MultiListColWidth(npl))
- X {
- X XtWarning("columnWidth Resource Is Read-Only");
- X MultiListColWidth(npl) = MultiListColWidth(cpl);
- X }
- X if (MultiListRowHeight(cpl) != MultiListRowHeight(npl))
- X {
- X XtWarning("rowHeight Resource Is Read-Only");
- X MultiListRowHeight(npl) = MultiListRowHeight(cpl);
- X }
- X
- X if (recalc)
- X {
- X RecalcCoords(npl,!MultiListWidth(npl),!MultiListHeight(npl));
- X }
- X
- X if (!XtIsRealized((Widget)cpl))
- X return(False);
- X else
- X return(redraw);
- } /* End SetValues */
- X
- /*===========================================================================*
- X
- X D A T A I N I T I A L I Z A T I O N
- X
- X *===========================================================================*/
- X
- /*---------------------------------------------------------------------------*
- X
- X DestroyOldData(mlw)
- X
- X This routine frees the internal list item array and sets the
- X item count to 0. This is normally done immediately before
- X calling InitializeNewData() to rebuild the internal item
- X array from new user specified arrays.
- X
- X *---------------------------------------------------------------------------*/
- X
- static void DestroyOldData(mlw)
- XXfwfMultiListWidget mlw;
- {
- X int i;
- X
- X if (MultiListItemArray(mlw) != NULL) /* Free Old List */
- X {
- X for (i = 0; i < MultiListNumItems(mlw); i++)
- X {
- X free(MultiListItemString(MultiListNthItem(mlw,i)));
- X }
- X free((char *)MultiListItemArray(mlw));
- X }
- X if (MultiListSelArray(mlw) != NULL)
- X free((char *)MultiListSelArray(mlw));
- X MultiListSelArray(mlw) = NULL;
- X MultiListNumSelected(mlw) = 0;
- X MultiListItemArray(mlw) = NULL;
- X MultiListNumItems(mlw) = 0;
- } /* End DestroyOldData */
- X
- X
- /*---------------------------------------------------------------------------*
- X
- X InitializeNewData(mlw)
- X
- X This routine takes a MultiList widget <mlw> and builds up new
- X data item tables based on the string list and the sensitivity array.
- X All previous data should have already been freed. If the number
- X of items is 0, they will be counted, so the array must be NULL
- X terminated. If the list of strings is NULL, this is treated as
- X a list of 0 elements. If the sensitivity array is NULL, all
- X items are treated as sensitive.
- X
- X When this routine is done, the string list and sensitivity array
- X fields will all be set to NULL, and the widget will not reference
- X them again.
- X
- X *---------------------------------------------------------------------------*/
- X
- static void InitializeNewData(mlw)
- XXfwfMultiListWidget mlw;
- {
- X int i;
- X XfwfMultiListItem *item;
- X String *string_array;
- X
- X string_array = MultiListList(mlw);
- X if (string_array == NULL) MultiListNumItems(mlw) = 0;
- X
- X if (MultiListNumItems(mlw) == 0) /* Count Elements */
- X {
- X if (string_array == NULL) /* No elements */
- X {
- X MultiListNumItems(mlw) = 0;
- X }
- X else
- X {
- X for (i = 0; string_array[i] != NULL; i++);
- X MultiListNumItems(mlw) = i;
- X }
- X }
- X if (MultiListNumItems(mlw) == 0) /* No Items */
- X {
- X MultiListItemArray(mlw) = NULL;
- X }
- X else
- X {
- X MultiListItemArray(mlw) =
- X TypeAlloc(XfwfMultiListItem,MultiListNumItems(mlw));
- X for (i = 0; i < MultiListNumItems(mlw); i++)
- X {
- X item = MultiListNthItem(mlw,i);
- X if (MultiListSensitiveArray(mlw) == NULL ||
- X (MultiListSensitiveArray(mlw)[i] == True))
- X {
- X MultiListItemSensitive(item) = True;
- X }
- X else
- X {
- X MultiListItemSensitive(item) = False;
- X }
- X MultiListItemString(item) = StrCopy(string_array[i]);
- X MultiListItemHighlighted(item) = False;
- X }
- X }
- X if (MultiListMaxSelectable(mlw) == 0)
- X {
- X MultiListSelArray(mlw) = NULL;
- X MultiListNumSelected(mlw) = 0;
- X }
- X else
- X {
- X MultiListSelArray(mlw) =
- X TypeAlloc(int,MultiListMaxSelectable(mlw));
- X MultiListNumSelected(mlw) = 0;
- X }
- X
- X MultiListList(mlw) = NULL;
- X MultiListSensitiveArray(mlw) = NULL;
- } /* End InitializeNewData */
- X
- X
- /*---------------------------------------------------------------------------*
- X
- X CreateNewGCs(mlw)
- X
- X This routine takes a MultiList widget <mlw> and creates a new set of
- X graphic contexts for the widget based on the colors, fonts, etc.
- X in the widget. Any previous GCs are assumed to have already been
- X destroyed.
- X
- X *---------------------------------------------------------------------------*/
- X
- static void CreateNewGCs(mlw)
- XXfwfMultiListWidget mlw;
- {
- X XGCValues values;
- X unsigned int attribs;
- X
- X attribs = GCForeground | GCBackground | GCFont;
- X values.foreground = MultiListFG(mlw);
- X values.background = MultiListBG(mlw);
- X values.font = MultiListFont(mlw)->fid;
- X MultiListDrawGC(mlw) = XtGetGC((Widget)mlw,attribs,&values);
- X
- X values.foreground = MultiListBG(mlw);
- X MultiListEraseGC(mlw) = XtGetGC((Widget)mlw,attribs,&values);
- SHAR_EOF
- true || echo 'restore of xarchie-2.0.6/FWF/MultiList/MultiList.c failed'
- fi
- echo 'End of xarchie-2.0.6 part 22'
- echo 'File xarchie-2.0.6/FWF/MultiList/MultiList.c is continued in part 23'
- echo 23 > _shar_seq_.tmp
- exit 0
-
- exit 0 # Just in case...
- --
- // chris@IMD.Sterling.COM | Send comp.sources.x submissions to:
- \X/ Amiga - The only way to fly! | sources-x@imd.sterling.com
- "It's intuitively obvious to the |
- most casual observer..." | GCS d+/-- p+ c++ l+ m+ s++/+ g+ w+ t+ r+ x+
-