home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / x / volume20 / xball / part02 < prev    next >
Encoding:
Text File  |  1993-05-26  |  79.4 KB  |  2,986 lines

  1. Newsgroups: comp.sources.x
  2. From: daven@ctron.com ("David N. Nedde")
  3. Subject: v20i002:  xball - simulate bouncing balls in a window, Part02/05
  4. Message-ID: <1993May24.202838.23929@sparky.imd.sterling.com>
  5. X-Md4-Signature: 5a6862a34275cb11a12c028f97eb0266
  6. Sender: chris@sparky.imd.sterling.com (Chris Olson)
  7. Organization: Sterling Software
  8. Date: Mon, 24 May 1993 20:28:38 GMT
  9. Approved: chris@sparky.imd.sterling.com
  10.  
  11. Submitted-by: daven@ctron.com ("David N. Nedde")
  12. Posting-number: Volume 20, Issue 2
  13. Archive-name: xball/part02
  14. Environment: X11, OSF/Motif, Athena
  15.  
  16. #! /bin/sh
  17. # This is a shell archive.  Remove anything before this line, then unpack
  18. # it by saving it into a file and typing "sh file".  To overwrite existing
  19. # files, type "sh file -c".  You can also feed this as standard input via
  20. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  21. # will see the following message at the end:
  22. #        "End of archive 2 (of 5)."
  23. # Contents:  Make.motif Make.athena color_l.c demo.c file_sel.c help.c
  24. #   list.c misc.c miscx.c help.h
  25. # Wrapped by daven@osiris on Tue May  4 16:35:07 1993
  26. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  27. if test -f 'Make.motif' -a "${1}" != "-c" ; then 
  28.   echo shar: Will not clobber existing file \"'Make.motif'\"
  29. else
  30. echo shar: Extracting \"'Make.motif'\" \(12467 characters\)
  31. sed "s/^X//" >'Make.motif' <<'END_OF_FILE'
  32. X# Makefile generated by imake - do not edit!
  33. X# $XConsortium: imake.c,v 1.51 89/12/12 12:37:30 jim Exp $
  34. X#
  35. X# The cpp used on this machine replaces all newlines and multiple tabs and
  36. X# spaces in a macro expansion with a single space.  Imake tries to compensate
  37. X# for this, but is not always successful.
  38. X#
  39. X
  40. X###########################################################################
  41. X# Makefile generated from "Imake.tmpl" and <Imakefile>
  42. X# $XConsortium: Imake.tmpl,v 1.77 89/12/18 17:01:37 jim Exp $
  43. X#
  44. X# Platform-specific parameters may be set in the appropriate .cf
  45. X# configuration files.  Site-wide parameters may be set in the file
  46. X# site.def.  Full rebuilds are recommended if any parameters are changed.
  47. X#
  48. X# If your C preprocessor doesn't define any unique symbols, you'll need
  49. X# to set BOOTSTRAPCFLAGS when rebuilding imake (usually when doing
  50. X# "make Makefile", "make Makefiles", or "make World").
  51. X#
  52. X# If you absolutely can't get imake to work, you'll need to set the
  53. X# variables at the top of each Makefile as well as the dependencies at the
  54. X# bottom (makedepend will do this automatically).
  55. X#
  56. X
  57. X###########################################################################
  58. X# platform-specific configuration parameters - edit sun.cf to change
  59. X
  60. XSYSLIBS=-lXt -lX11
  61. XMWM_DEFINES=-DSHAPE -DOPAQUE
  62. XSYSLIBS=$(MTOOLKITSRC)/libXt.a $(XLIBSRC)/libX11.a
  63. X
  64. X# platform:  $XConsortium: sun.cf,v 1.38 89/12/23 16:10:10 jim Exp $
  65. X# operating system:  SunOS 4.1
  66. X
  67. X###########################################################################
  68. X# site-specific configuration parameters - edit site.def to change
  69. X
  70. X# site:  $XConsortium: site.def,v 1.21 89/12/06 11:46:50 jim Exp $
  71. X
  72. X            SHELL = /bin/sh
  73. X
  74. X              TOP = .
  75. X      CURRENT_DIR = .
  76. X
  77. X               AR = ar cq
  78. X  BOOTSTRAPCFLAGS =
  79. X               CC = cc
  80. X
  81. X         COMPRESS = compress
  82. X              CPP = /lib/cpp $(STD_CPP_DEFINES)
  83. X    PREPROCESSCMD = cc -E $(STD_CPP_DEFINES)
  84. X          INSTALL = install
  85. X               LD = ld
  86. X             LINT = lint
  87. X      LINTLIBFLAG = -C
  88. X         LINTOPTS = -axz
  89. X               LN = ln -s
  90. X             MAKE = make
  91. X               MV = mv
  92. X               CP = cp
  93. X           RANLIB = ranlib
  94. X  RANLIBINSTFLAGS =
  95. X               RM = rm -f
  96. X     STD_INCLUDES =
  97. X  STD_CPP_DEFINES =
  98. X      STD_DEFINES =
  99. X EXTRA_LOAD_FLAGS =
  100. X  EXTRA_LIBRARIES =
  101. X             TAGS = ctags
  102. X
  103. X    SHAREDCODEDEF = -DSHAREDCODE
  104. X         SHLIBDEF = -DSUNSHLIB
  105. X
  106. X    PROTO_DEFINES =
  107. X
  108. X     INSTPGMFLAGS =
  109. X
  110. X     INSTBINFLAGS = -m 0755
  111. X     INSTUIDFLAGS = -m 4755
  112. X     INSTLIBFLAGS = -m 0664
  113. X     INSTINCFLAGS = -m 0444
  114. X     INSTMANFLAGS = -m 0444
  115. X     INSTDATFLAGS = -m 0444
  116. X    INSTKMEMFLAGS = -m 4755
  117. X
  118. X          DESTDIR =
  119. X
  120. X     TOP_INCLUDES = -I$(INCROOT)
  121. X
  122. X      CDEBUGFLAGS = -O
  123. X        CCOPTIONS = -D_NO_PROTO -DSTRINGS_ALIGNED -DNO_REGEX -DNO_ISDIR -DUSE_RE_COMP -DUSE_GETWD
  124. X      COMPATFLAGS =
  125. X
  126. X      ALLINCLUDES = $(STD_INCLUDES) $(TOP_INCLUDES) $(INCLUDES) $(EXTRA_INCLUDES)
  127. X       ALLDEFINES = $(ALLINCLUDES) $(STD_DEFINES) $(PROTO_DEFINES) $(DEFINES) $(COMPATFLAGS)
  128. X           CFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) $(ALLDEFINES)
  129. X        LINTFLAGS = $(LINTOPTS) -DLINT $(ALLDEFINES)
  130. X           LDLIBS = $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
  131. X        LDOPTIONS = $(CDEBUGFLAGS) $(CCOPTIONS)
  132. X   LDCOMBINEFLAGS = -X -r
  133. X
  134. X        MACROFILE = sun.cf
  135. X           RM_CMD = $(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a .emacs_* tags TAGS make.log MakeOut
  136. X
  137. X    IMAKE_DEFINES =
  138. X
  139. X         IRULESRC = $(CONFIGDIR)
  140. X        IMAKE_CMD = $(IMAKE) -DUseInstalled -I$(IRULESRC) $(IMAKE_DEFINES)
  141. X
  142. X     ICONFIGFILES = $(IRULESRC)/Imake.tmpl $(IRULESRC)/Imake.rules \
  143. X            $(IRULESRC)/Project.tmpl $(IRULESRC)/site.def \
  144. X            $(IRULESRC)/$(MACROFILE) $(EXTRA_ICONFIGFILES)
  145. X
  146. X###########################################################################
  147. X# X Window System Build Parameters
  148. X# $XConsortium: Project.tmpl,v 1.63 89/12/18 16:46:44 jim Exp $
  149. X
  150. X###########################################################################
  151. X# X Window System make variables; this need to be coordinated with rules
  152. X# $XConsortium: Project.tmpl,v 1.63 89/12/18 16:46:44 jim Exp $
  153. X
  154. X          PATHSEP = /
  155. X        USRLIBDIR = $(DESTDIR)/usr/lib
  156. X           BINDIR = $(DESTDIR)/usr/bin/X11
  157. X          INCROOT = $(DESTDIR)/usr/include
  158. X     BUILDINCROOT = $(TOP)
  159. X      BUILDINCDIR = $(BUILDINCROOT)/X11
  160. X      BUILDINCTOP = ..
  161. X           INCDIR = $(INCROOT)/X11
  162. X           ADMDIR = $(DESTDIR)/usr/adm
  163. X           LIBDIR = $(USRLIBDIR)/X11
  164. X        CONFIGDIR = $(LIBDIR)/config
  165. X       LINTLIBDIR = $(USRLIBDIR)/lint
  166. X
  167. X          FONTDIR = $(LIBDIR)/fonts
  168. X         XINITDIR = $(LIBDIR)/xinit
  169. X           XDMDIR = $(LIBDIR)/xdm
  170. X           AWMDIR = $(LIBDIR)/awm
  171. X           TWMDIR = $(LIBDIR)/twm
  172. X           GWMDIR = $(LIBDIR)/gwm
  173. X          MANPATH = $(DESTDIR)/usr/man
  174. X    MANSOURCEPATH = $(MANPATH)/man
  175. X           MANDIR = $(MANSOURCEPATH)n
  176. X        LIBMANDIR = $(MANSOURCEPATH)3
  177. X      XAPPLOADDIR = $(LIBDIR)/app-defaults
  178. X
  179. X        SOXLIBREV = 4.2
  180. X          SOXTREV = 4.0
  181. X         SOXAWREV = 4.0
  182. X        SOOLDXREV = 4.0
  183. X         SOXMUREV = 4.0
  184. X        SOXEXTREV = 4.0
  185. X
  186. X       FONTCFLAGS = -t
  187. X
  188. X     INSTAPPFLAGS = $(INSTDATFLAGS)
  189. X
  190. X            IMAKE = imake
  191. X           DEPEND = makedepend
  192. X              RGB = rgb
  193. X            FONTC = bdftosnf
  194. X        MKFONTDIR = mkfontdir
  195. X        MKDIRHIER = /bin/sh $(BINDIR)/mkdirhier.sh
  196. X
  197. X        CONFIGSRC = $(TOP)/config
  198. X        CLIENTSRC = $(TOP)/clients
  199. X          DEMOSRC = $(TOP)/demos
  200. X           LIBSRC = $(TOP)/lib
  201. X          FONTSRC = $(TOP)/fonts
  202. X       INCLUDESRC = $(TOP)/X11
  203. X        SERVERSRC = $(TOP)/server
  204. X          UTILSRC = $(TOP)/util
  205. X        SCRIPTSRC = $(UTILSRC)/scripts
  206. X       EXAMPLESRC = $(TOP)/examples
  207. X       CONTRIBSRC = $(TOP)/../contrib
  208. X           DOCSRC = $(TOP)/doc
  209. X           RGBSRC = $(TOP)/rgb
  210. X        DEPENDSRC = $(UTILSRC)/makedepend
  211. X         IMAKESRC = $(CONFIGSRC)
  212. X         XAUTHSRC = $(LIBSRC)/Xau
  213. X          XLIBSRC = $(LIBSRC)/X
  214. X           XMUSRC = $(LIBSRC)/Xmu
  215. X       TOOLKITSRC = $(LIBSRC)/Xt
  216. X       AWIDGETSRC = $(LIBSRC)/Xaw
  217. X       OLDXLIBSRC = $(LIBSRC)/oldX
  218. X      XDMCPLIBSRC = $(LIBSRC)/Xdmcp
  219. X      BDFTOSNFSRC = $(FONTSRC)/bdftosnf
  220. X     MKFONTDIRSRC = $(FONTSRC)/mkfontdir
  221. X     EXTENSIONSRC = $(TOP)/extensions
  222. X
  223. X  DEPEXTENSIONLIB = $(USRLIBDIR)/libXext.a
  224. X     EXTENSIONLIB =  -lXext
  225. X
  226. X          DEPXLIB = $(DEPEXTENSIONLIB)
  227. X             XLIB = $(EXTENSIONLIB) -lX11
  228. X
  229. X      DEPXAUTHLIB = $(USRLIBDIR)/libXau.a
  230. X         XAUTHLIB =  -lXau
  231. X
  232. X        DEPXMULIB =
  233. X           XMULIB = -lXmu
  234. X
  235. X       DEPOLDXLIB =
  236. X          OLDXLIB = -loldX
  237. X
  238. X      DEPXTOOLLIB =
  239. X         XTOOLLIB = -lXt
  240. X
  241. X        DEPXAWLIB =
  242. X           XAWLIB = -lXaw
  243. X
  244. X LINTEXTENSIONLIB = $(USRLIBDIR)/llib-lXext.ln
  245. X         LINTXLIB = $(USRLIBDIR)/llib-lX11.ln
  246. X          LINTXMU = $(USRLIBDIR)/llib-lXmu.ln
  247. X        LINTXTOOL = $(USRLIBDIR)/llib-lXt.ln
  248. X          LINTXAW = $(USRLIBDIR)/llib-lXaw.ln
  249. X
  250. X          DEPLIBS = $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB)
  251. X
  252. X         DEPLIBS1 = $(DEPLIBS)
  253. X         DEPLIBS2 = $(DEPLIBS)
  254. X         DEPLIBS3 = $(DEPLIBS)
  255. X
  256. X      USRINCDIR = $(DESTDIR)/usr/include
  257. X        TESTSRC = $(TOP)/tests
  258. X     TESTSRCLIB = $(TESTSRC)/lib
  259. X     TESTSRCBIN = $(TESTSRC)/bin
  260. X       COMMONPP = $(TESTSRCBIN)/Commonpp
  261. X
  262. X     TESTCOMSRC = $(TESTSRCLIB)/Common
  263. X    MTOOLKITSRC = $(LIBSRC)/Xt
  264. X     MWIDGETSRC = $(LIBSRC)/Xm
  265. X   MRESOURCESRC = $(LIBSRC)/Mrm
  266. X         UILSRC = $(CLIENTSRC)/uil
  267. X            UIL = $(UILSRC)/uil
  268. X      XMTOOLLIB = $(MTOOLKITSRC)/libXt.a
  269. X          XMLIB = $(MWIDGETSRC)/libXm.a
  270. X   MRESOURCELIB = $(MRESOURCESRC)/libMrm.a
  271. X         UILLIB = $(UILSRC)/libUil.a
  272. X     TESTCOMLIB = $(TESTCOMSRC)/libCommon.a
  273. X
  274. X  LINTMRESOURCE = $(MRESOURCESRC)/libMrm.a
  275. XLINTXMWIDGETLIB = $(MWIDGETSRC)/llib-l/Xm.ln
  276. X     LINTXMTOOL = $(MTOOLKITSRC)/llib-lXt.ln
  277. X     LINTUILLIB = $(UILSRC)/llib-lUil.ln
  278. X
  279. X        DEPLIBS =
  280. X
  281. X        DEPLIBS1 = $(DEPLIBS)
  282. X        DEPLIBS2 = $(DEPLIBS)
  283. X        DEPLIBS3 = $(DEPLIBS)
  284. X
  285. X###########################################################################
  286. X# Imake rules for building libraries, programs, scripts, and data files
  287. X# rules:  $XConsortium: Imake.rules,v 1.67 89/12/18 17:14:15 jim Exp $
  288. X
  289. X###########################################################################
  290. X# start of Imakefile
  291. X
  292. X# MOTIF  -> Have Motif Widgets
  293. X# ATHENA -> Have Athena Widgets
  294. X
  295. X#define ATHENA
  296. X
  297. X           DELAY = -DDELAY=100       # DELAY ranges from -18 to whatever
  298. X#    GRAVITY = -DGRAVITY=8       # Default gravity
  299. X# ELASTICITY = -DELASTICY=90     # Default elasticity
  300. X          USLEEP = -DHAVE_USLEEP      # Uncomment if usleep installed...
  301. X       MYDEFINES = $(DELAY) $(USLEEP)
  302. X     CDEBUGFLAGS = -g
  303. X
  304. XM_SRCS = act_area.c
  305. XM_OBJS = act_area.o
  306. XM_INCS = act_area.h
  307. X
  308. XA_SRCS = filemenu.c
  309. XA_OBJS = filemenu.o
  310. XA_INCS =
  311. X
  312. X         DEFINES = -DMOTIF $(MYDEFINES)
  313. X#   MYLDLIBS = -lPW    # Uncomment if you get regcmp and regex undefined
  314. X          LDLIBS = -lXm -lXmu -lXt -lX11 $(MYLDLIBS)
  315. X
  316. XTOOL_SRCS = $(M_SRCS)
  317. XTOOL_OBJS = $(M_OBJS)
  318. XTOOL_INCS = $(M_INCS)
  319. X
  320. X LINTOPTS = -abhuvz -D_NO_PROTO $(DEFINES)
  321. X
  322. XCOMM_SRCS = \
  323. X    color_l.c \
  324. X    demo.c \
  325. X    file_sel.c \
  326. X    help.c \
  327. X    item.c \
  328. X    items.c \
  329. X    list.c \
  330. X    menu.c \
  331. X    misc.c \
  332. X    miscx.c \
  333. X    room.c \
  334. X    scrollbar.c \
  335. X    sim.c \
  336. X    table.c \
  337. X    xball.c \
  338. X    xball_sys.c
  339. X
  340. XCOMM_OBJS = \
  341. X    color_l.o \
  342. X    demo.o \
  343. X    file_sel.o \
  344. X    help.o \
  345. X    item.o \
  346. X    items.o \
  347. X    list.o \
  348. X    menu.o \
  349. X    misc.o \
  350. X    miscx.o \
  351. X    room.o \
  352. X    scrollbar.o \
  353. X    sim.o \
  354. X    table.o \
  355. X    xball.o \
  356. X    xball_sys.o
  357. X
  358. XCOMM_INCS = \
  359. X    color_l.h \
  360. X    demo.h \
  361. X    fallback.h \
  362. X    file_sel.h \
  363. X    help.h \
  364. X    intf.h \
  365. X    item.h \
  366. X    items.h \
  367. X    list.h \
  368. X    menu.h \
  369. X    misc.h \
  370. X    miscx.h \
  371. X    names.h \
  372. X        patchlevel.h \
  373. X    room.h \
  374. X    scrollbar.h \
  375. X    sim.h \
  376. X    table.h \
  377. X    xball_sys.h
  378. X
  379. XSRCS = $(COMM_SRCS) $(TOOL_SRCS)
  380. XOBJS = $(COMM_OBJS) $(TOOL_OBJS)
  381. XINCS = $(COMM_INCS) $(TOOL_INCS)
  382. X
  383. X PROGRAM = xball
  384. X
  385. Xall:: xball
  386. X
  387. Xxball: $(OBJS) $(DEPLIBS)
  388. X    $(RM) $@
  389. X    $(CC) -o $@ $(OBJS) $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) $(EXTRA_LOAD_FLAGS)
  390. X
  391. Xsaber_xball:
  392. X    #load $(ALLDEFINES) $(SRCS) $(LOCAL_LIBRARIES) $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
  393. X
  394. Xosaber_xball:
  395. X    #load $(ALLDEFINES) $(OBJS) $(LOCAL_LIBRARIES) $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
  396. X
  397. Xinstall:: xball
  398. X    $(INSTALL) -c $(INSTPGMFLAGS)   xball $(BINDIR)
  399. X
  400. Xinstall.man:: xball.man
  401. X    $(INSTALL) -c $(INSTMANFLAGS) xball.man $(MANDIR)/xball.n
  402. X
  403. Xdepend::
  404. X    $(DEPEND) -s "# DO NOT DELETE" -- $(ALLDEFINES) -- $(SRCS)
  405. X
  406. Xlint:
  407. X    $(LINT) $(LINTFLAGS) $(SRCS) $(LINTLIBS)
  408. Xlint1:
  409. X    $(LINT) $(LINTFLAGS) $(FILE) $(LINTLIBS)
  410. X
  411. Xclean::
  412. X    $(RM) $(PROGRAM)
  413. X
  414. XCLASS            = XBall
  415. XAPP_DEFAULTS_SRC = $(CLASS).ad
  416. X
  417. Xinstall::  $(CLASS).ad
  418. X    $(INSTALL) -c $(INSTAPPFLAGS)  $(CLASS).ad $(XAPPLOADDIR)/ $(CLASS)
  419. X
  420. Xfallback.h: $(APP_DEFAULTS_SRC)
  421. X    gen_fallback $(APP_DEFAULTS_SRC) > $@
  422. X
  423. XDEMOS = demo1 demo2 demo3 demo4 demo5 demo6 demo7 demo8 demo9 demo10 \
  424. X        demo11 demo12 demo13 demo14
  425. X
  426. XBITMAPS = \
  427. X    good_bitmaps \
  428. X    on.xbm \
  429. X    off.xbm \
  430. X    man.xbm \
  431. X    stipple.xbm \
  432. X    xball.xbm \
  433. X    xball-a.xbm \
  434. X    xball-b.xbm \
  435. X    xball-l.xbm \
  436. X    xball-x.xbm \
  437. X    sgi.xbm
  438. X
  439. XMISC = \
  440. X    gen_fallback \
  441. X    run_demos \
  442. X        xball.man \
  443. X    README
  444. X
  445. XDRAWING_A_DIRS = \
  446. X    X11 \
  447. X    X11/Xaw_d
  448. X
  449. XDRAWING_A = \
  450. X    X11/Xaw_d/DrawingA.c \
  451. X    X11/Xaw_d/DrawingA.h \
  452. X    X11/Xaw_d/DrawingAP.h \
  453. X    X11/Xaw_d/DrawingA.doc \
  454. X    X11/Xaw_d/Imakefile \
  455. X    X11/Xaw_d/Makefile.std \
  456. X    X11/Xaw_d/Makefile \
  457. X        X11/Xaw_d/demo.c \
  458. X    X11/Xaw_d/README \
  459. X    Imakefile \
  460. X    Makefile.std \
  461. X    Makefile \
  462. X    Make.motif \
  463. X    Make.athena
  464. X
  465. XDIST = \
  466. X    $(DRAWING_A) \
  467. X    $(COMM_SRCS) \
  468. X    $(COMM_INCS) \
  469. X    $(M_SRCS) \
  470. X    $(M_INCS) \
  471. X    $(A_SRCS) \
  472. X    $(A_INCS) \
  473. X    $(APP_DEFAULTS_SRC) \
  474. X    $(MISC) \
  475. X    $(BITMAPS) \
  476. X    $(DEMOS)
  477. X
  478. Xshar:
  479. X    makekit -s75k -p $(DRAWING_A_DIRS) $(DIST)
  480. X
  481. Xtar:
  482. X    tar cvf - $(DIST) | compress -v > xball.tar.Z
  483. X
  484. X###########################################################################
  485. X# common rules for all Makefiles - do not edit
  486. X
  487. Xemptyrule::
  488. X
  489. Xclean::
  490. X    $(RM_CMD) \#*
  491. X
  492. XMakefile::
  493. X    -@if [ -f Makefile ]; then \
  494. X    echo "    $(RM) Makefile.bak; $(MV) Makefile Makefile.bak"; \
  495. X    $(RM) Makefile.bak; $(MV) Makefile Makefile.bak; \
  496. X    else exit 0; fi
  497. X    $(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR)
  498. X
  499. Xtags::
  500. X    $(TAGS) -w *.[ch]
  501. X    $(TAGS) -xw *.[ch] > TAGS
  502. X
  503. Xsaber:
  504. X    #load $(ALLDEFINES) $(SRCS)
  505. X
  506. Xosaber:
  507. X    #load $(ALLDEFINES) $(OBJS)
  508. X
  509. X###########################################################################
  510. X# empty rules for directories that do not have SUBDIRS - do not edit
  511. X
  512. Xinstall::
  513. X    @echo "install in $(CURRENT_DIR) done"
  514. X
  515. Xinstall.man::
  516. X    @echo "install.man in $(CURRENT_DIR) done"
  517. X
  518. XMakefiles::
  519. X
  520. Xincludes::
  521. X
  522. X###########################################################################
  523. X# dependencies generated by makedepend
  524. X
  525. END_OF_FILE
  526. if test 12467 -ne `wc -c <'Make.motif'`; then
  527.     echo shar: \"'Make.motif'\" unpacked with wrong size!
  528. fi
  529. # end of 'Make.motif'
  530. fi
  531. if test -f 'Make.athena' -a "${1}" != "-c" ; then 
  532.   echo shar: Will not clobber existing file \"'Make.athena'\"
  533. else
  534. echo shar: Extracting \"'Make.athena'\" \(15960 characters\)
  535. sed "s/^X//" >'Make.athena' <<'END_OF_FILE'
  536. X# Makefile generated by imake - do not edit!
  537. X# $XConsortium: imake.c,v 1.51 89/12/12 12:37:30 jim Exp $
  538. X#
  539. X# The cpp used on this machine replaces all newlines and multiple tabs and
  540. X# spaces in a macro expansion with a single space.  Imake tries to compensate
  541. X# for this, but is not always successful.
  542. X#
  543. X
  544. X###########################################################################
  545. X# Makefile generated from "Imake.tmpl" and <Imakefile>
  546. X# $XConsortium: Imake.tmpl,v 1.77 89/12/18 17:01:37 jim Exp $
  547. X#
  548. X# Platform-specific parameters may be set in the appropriate .cf
  549. X# configuration files.  Site-wide parameters may be set in the file
  550. X# site.def.  Full rebuilds are recommended if any parameters are changed.
  551. X#
  552. X# If your C preprocessor doesn't define any unique symbols, you'll need
  553. X# to set BOOTSTRAPCFLAGS when rebuilding imake (usually when doing
  554. X# "make Makefile", "make Makefiles", or "make World").
  555. X#
  556. X# If you absolutely can't get imake to work, you'll need to set the
  557. X# variables at the top of each Makefile as well as the dependencies at the
  558. X# bottom (makedepend will do this automatically).
  559. X#
  560. X
  561. X###########################################################################
  562. X# platform-specific configuration parameters - edit sun.cf to change
  563. X
  564. XSYSLIBS=-lXt -lX11
  565. XMWM_DEFINES=-DSHAPE -DOPAQUE
  566. XSYSLIBS=$(MTOOLKITSRC)/libXt.a $(XLIBSRC)/libX11.a
  567. X
  568. X# platform:  $XConsortium: sun.cf,v 1.38 89/12/23 16:10:10 jim Exp $
  569. X# operating system:  SunOS 4.1
  570. X
  571. X###########################################################################
  572. X# site-specific configuration parameters - edit site.def to change
  573. X
  574. X# site:  $XConsortium: site.def,v 1.21 89/12/06 11:46:50 jim Exp $
  575. X
  576. X            SHELL = /bin/sh
  577. X
  578. X              TOP = .
  579. X      CURRENT_DIR = .
  580. X
  581. X               AR = ar cq
  582. X  BOOTSTRAPCFLAGS =
  583. X               CC = cc
  584. X
  585. X         COMPRESS = compress
  586. X              CPP = /lib/cpp $(STD_CPP_DEFINES)
  587. X    PREPROCESSCMD = cc -E $(STD_CPP_DEFINES)
  588. X          INSTALL = install
  589. X               LD = ld
  590. X             LINT = lint
  591. X      LINTLIBFLAG = -C
  592. X         LINTOPTS = -axz
  593. X               LN = ln -s
  594. X             MAKE = make
  595. X               MV = mv
  596. X               CP = cp
  597. X           RANLIB = ranlib
  598. X  RANLIBINSTFLAGS =
  599. X               RM = rm -f
  600. X     STD_INCLUDES =
  601. X  STD_CPP_DEFINES =
  602. X      STD_DEFINES =
  603. X EXTRA_LOAD_FLAGS =
  604. X  EXTRA_LIBRARIES =
  605. X             TAGS = ctags
  606. X
  607. X    SHAREDCODEDEF = -DSHAREDCODE
  608. X         SHLIBDEF = -DSUNSHLIB
  609. X
  610. X    PROTO_DEFINES =
  611. X
  612. X     INSTPGMFLAGS =
  613. X
  614. X     INSTBINFLAGS = -m 0755
  615. X     INSTUIDFLAGS = -m 4755
  616. X     INSTLIBFLAGS = -m 0664
  617. X     INSTINCFLAGS = -m 0444
  618. X     INSTMANFLAGS = -m 0444
  619. X     INSTDATFLAGS = -m 0444
  620. X    INSTKMEMFLAGS = -m 4755
  621. X
  622. X          DESTDIR =
  623. X
  624. X     TOP_INCLUDES = -I$(INCROOT)
  625. X
  626. X      CDEBUGFLAGS = -O
  627. X        CCOPTIONS = -D_NO_PROTO -DSTRINGS_ALIGNED -DNO_REGEX -DNO_ISDIR -DUSE_RE_COMP -DUSE_GETWD
  628. X      COMPATFLAGS =
  629. X
  630. X      ALLINCLUDES = $(STD_INCLUDES) $(TOP_INCLUDES) $(INCLUDES) $(EXTRA_INCLUDES)
  631. X       ALLDEFINES = $(ALLINCLUDES) $(STD_DEFINES) $(PROTO_DEFINES) $(DEFINES) $(COMPATFLAGS)
  632. X           CFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) $(ALLDEFINES)
  633. X        LINTFLAGS = $(LINTOPTS) -DLINT $(ALLDEFINES)
  634. X           LDLIBS = $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
  635. X        LDOPTIONS = $(CDEBUGFLAGS) $(CCOPTIONS)
  636. X   LDCOMBINEFLAGS = -X -r
  637. X
  638. X        MACROFILE = sun.cf
  639. X           RM_CMD = $(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a .emacs_* tags TAGS make.log MakeOut
  640. X
  641. X    IMAKE_DEFINES =
  642. X
  643. X         IRULESRC = $(CONFIGDIR)
  644. X        IMAKE_CMD = $(IMAKE) -DUseInstalled -I$(IRULESRC) $(IMAKE_DEFINES)
  645. X
  646. X     ICONFIGFILES = $(IRULESRC)/Imake.tmpl $(IRULESRC)/Imake.rules \
  647. X            $(IRULESRC)/Project.tmpl $(IRULESRC)/site.def \
  648. X            $(IRULESRC)/$(MACROFILE) $(EXTRA_ICONFIGFILES)
  649. X
  650. X###########################################################################
  651. X# X Window System Build Parameters
  652. X# $XConsortium: Project.tmpl,v 1.63 89/12/18 16:46:44 jim Exp $
  653. X
  654. X###########################################################################
  655. X# X Window System make variables; this need to be coordinated with rules
  656. X# $XConsortium: Project.tmpl,v 1.63 89/12/18 16:46:44 jim Exp $
  657. X
  658. X          PATHSEP = /
  659. X        USRLIBDIR = $(DESTDIR)/usr/lib
  660. X           BINDIR = $(DESTDIR)/usr/bin/X11
  661. X          INCROOT = $(DESTDIR)/usr/include
  662. X     BUILDINCROOT = $(TOP)
  663. X      BUILDINCDIR = $(BUILDINCROOT)/X11
  664. X      BUILDINCTOP = ..
  665. X           INCDIR = $(INCROOT)/X11
  666. X           ADMDIR = $(DESTDIR)/usr/adm
  667. X           LIBDIR = $(USRLIBDIR)/X11
  668. X        CONFIGDIR = $(LIBDIR)/config
  669. X       LINTLIBDIR = $(USRLIBDIR)/lint
  670. X
  671. X          FONTDIR = $(LIBDIR)/fonts
  672. X         XINITDIR = $(LIBDIR)/xinit
  673. X           XDMDIR = $(LIBDIR)/xdm
  674. X           AWMDIR = $(LIBDIR)/awm
  675. X           TWMDIR = $(LIBDIR)/twm
  676. X           GWMDIR = $(LIBDIR)/gwm
  677. X          MANPATH = $(DESTDIR)/usr/man
  678. X    MANSOURCEPATH = $(MANPATH)/man
  679. X           MANDIR = $(MANSOURCEPATH)n
  680. X        LIBMANDIR = $(MANSOURCEPATH)3
  681. X      XAPPLOADDIR = $(LIBDIR)/app-defaults
  682. X
  683. X        SOXLIBREV = 4.2
  684. X          SOXTREV = 4.0
  685. X         SOXAWREV = 4.0
  686. X        SOOLDXREV = 4.0
  687. X         SOXMUREV = 4.0
  688. X        SOXEXTREV = 4.0
  689. X
  690. X       FONTCFLAGS = -t
  691. X
  692. X     INSTAPPFLAGS = $(INSTDATFLAGS)
  693. X
  694. X            IMAKE = imake
  695. X           DEPEND = makedepend
  696. X              RGB = rgb
  697. X            FONTC = bdftosnf
  698. X        MKFONTDIR = mkfontdir
  699. X        MKDIRHIER = /bin/sh $(BINDIR)/mkdirhier.sh
  700. X
  701. X        CONFIGSRC = $(TOP)/config
  702. X        CLIENTSRC = $(TOP)/clients
  703. X          DEMOSRC = $(TOP)/demos
  704. X           LIBSRC = $(TOP)/lib
  705. X          FONTSRC = $(TOP)/fonts
  706. X       INCLUDESRC = $(TOP)/X11
  707. X        SERVERSRC = $(TOP)/server
  708. X          UTILSRC = $(TOP)/util
  709. X        SCRIPTSRC = $(UTILSRC)/scripts
  710. X       EXAMPLESRC = $(TOP)/examples
  711. X       CONTRIBSRC = $(TOP)/../contrib
  712. X           DOCSRC = $(TOP)/doc
  713. X           RGBSRC = $(TOP)/rgb
  714. X        DEPENDSRC = $(UTILSRC)/makedepend
  715. X         IMAKESRC = $(CONFIGSRC)
  716. X         XAUTHSRC = $(LIBSRC)/Xau
  717. X          XLIBSRC = $(LIBSRC)/X
  718. X           XMUSRC = $(LIBSRC)/Xmu
  719. X       TOOLKITSRC = $(LIBSRC)/Xt
  720. X       AWIDGETSRC = $(LIBSRC)/Xaw
  721. X       OLDXLIBSRC = $(LIBSRC)/oldX
  722. X      XDMCPLIBSRC = $(LIBSRC)/Xdmcp
  723. X      BDFTOSNFSRC = $(FONTSRC)/bdftosnf
  724. X     MKFONTDIRSRC = $(FONTSRC)/mkfontdir
  725. X     EXTENSIONSRC = $(TOP)/extensions
  726. X
  727. X  DEPEXTENSIONLIB = $(USRLIBDIR)/libXext.a
  728. X     EXTENSIONLIB =  -lXext
  729. X
  730. X          DEPXLIB = $(DEPEXTENSIONLIB)
  731. X             XLIB = $(EXTENSIONLIB) -lX11
  732. X
  733. X      DEPXAUTHLIB = $(USRLIBDIR)/libXau.a
  734. X         XAUTHLIB =  -lXau
  735. X
  736. X        DEPXMULIB =
  737. X           XMULIB = -lXmu
  738. X
  739. X       DEPOLDXLIB =
  740. X          OLDXLIB = -loldX
  741. X
  742. X      DEPXTOOLLIB =
  743. X         XTOOLLIB = -lXt
  744. X
  745. X        DEPXAWLIB =
  746. X           XAWLIB = -lXaw
  747. X
  748. X LINTEXTENSIONLIB = $(USRLIBDIR)/llib-lXext.ln
  749. X         LINTXLIB = $(USRLIBDIR)/llib-lX11.ln
  750. X          LINTXMU = $(USRLIBDIR)/llib-lXmu.ln
  751. X        LINTXTOOL = $(USRLIBDIR)/llib-lXt.ln
  752. X          LINTXAW = $(USRLIBDIR)/llib-lXaw.ln
  753. X
  754. X          DEPLIBS = $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB)
  755. X
  756. X         DEPLIBS1 = $(DEPLIBS)
  757. X         DEPLIBS2 = $(DEPLIBS)
  758. X         DEPLIBS3 = $(DEPLIBS)
  759. X
  760. X      USRINCDIR = $(DESTDIR)/usr/include
  761. X        TESTSRC = $(TOP)/tests
  762. X     TESTSRCLIB = $(TESTSRC)/lib
  763. X     TESTSRCBIN = $(TESTSRC)/bin
  764. X       COMMONPP = $(TESTSRCBIN)/Commonpp
  765. X
  766. X     TESTCOMSRC = $(TESTSRCLIB)/Common
  767. X    MTOOLKITSRC = $(LIBSRC)/Xt
  768. X     MWIDGETSRC = $(LIBSRC)/Xm
  769. X   MRESOURCESRC = $(LIBSRC)/Mrm
  770. X         UILSRC = $(CLIENTSRC)/uil
  771. X            UIL = $(UILSRC)/uil
  772. X      XMTOOLLIB = $(MTOOLKITSRC)/libXt.a
  773. X          XMLIB = $(MWIDGETSRC)/libXm.a
  774. X   MRESOURCELIB = $(MRESOURCESRC)/libMrm.a
  775. X         UILLIB = $(UILSRC)/libUil.a
  776. X     TESTCOMLIB = $(TESTCOMSRC)/libCommon.a
  777. X
  778. X  LINTMRESOURCE = $(MRESOURCESRC)/libMrm.a
  779. XLINTXMWIDGETLIB = $(MWIDGETSRC)/llib-l/Xm.ln
  780. X     LINTXMTOOL = $(MTOOLKITSRC)/llib-lXt.ln
  781. X     LINTUILLIB = $(UILSRC)/llib-lUil.ln
  782. X
  783. X        DEPLIBS =
  784. X
  785. X        DEPLIBS1 = $(DEPLIBS)
  786. X        DEPLIBS2 = $(DEPLIBS)
  787. X        DEPLIBS3 = $(DEPLIBS)
  788. X
  789. X###########################################################################
  790. X# Imake rules for building libraries, programs, scripts, and data files
  791. X# rules:  $XConsortium: Imake.rules,v 1.67 89/12/18 17:14:15 jim Exp $
  792. X
  793. X###########################################################################
  794. X# start of Imakefile
  795. X
  796. X# MOTIF  -> Have Motif Widgets
  797. X# ATHENA -> Have Athena Widgets
  798. X
  799. X#define MOTIF
  800. X
  801. X           DELAY = -DDELAY=100       # DELAY ranges from -18 to whatever
  802. X#    GRAVITY = -DGRAVITY=8       # Default gravity
  803. X# ELASTICITY = -DELASTICY=90     # Default elasticity
  804. X          USLEEP = -DHAVE_USLEEP      # Uncomment if usleep installed...
  805. X       MYDEFINES = $(DELAY) $(USLEEP)
  806. X     CDEBUGFLAGS = -g
  807. X
  808. XM_SRCS = act_area.c
  809. XM_OBJS = act_area.o
  810. XM_INCS = act_area.h
  811. X
  812. XA_SRCS = filemenu.c
  813. XA_OBJS = filemenu.o
  814. XA_INCS =
  815. X
  816. X        PREDEFINES = -DSUNOS4
  817. X
  818. X        SUBDIRS = X11/Xaw_d
  819. XLOCAL_LIBRARIES = -lXaw_d
  820. X        DEFINES = -DATHENA $(MYDEFINES)
  821. X       INCLUDES = -I.
  822. X      LDOPTIONS = -LX11/Xaw_d
  823. X         LDLIBS = -lXaw_d -lXaw -lXt -lXmu -lXext -lX11
  824. X
  825. Xall::
  826. X    @case '${MFLAGS}' in *[ik]*) set +e;; esac; \
  827. X    for i in $(SUBDIRS) ;\
  828. X    do \
  829. X    (cd $$i ; echo "making" all "in $(CURRENT_DIR)/$$i..."; \
  830. X    $(MAKE) $(MFLAGS) 'CDEBUGFLAGS=$(CDEBUGFLAGS)' all); \
  831. X    done
  832. X
  833. XTOOL_SRCS = $(A_SRCS)
  834. XTOOL_OBJS = $(A_OBJS)
  835. XTOOL_INCS = $(A_INCS)
  836. X
  837. X LINTOPTS = -abhuvz -D_NO_PROTO $(DEFINES)
  838. X
  839. XCOMM_SRCS = \
  840. X    color_l.c \
  841. X    demo.c \
  842. X    file_sel.c \
  843. X    help.c \
  844. X    item.c \
  845. X    items.c \
  846. X    list.c \
  847. X    menu.c \
  848. X    misc.c \
  849. X    miscx.c \
  850. X    room.c \
  851. X    scrollbar.c \
  852. X    sim.c \
  853. X    table.c \
  854. X    xball.c \
  855. X    xball_sys.c
  856. X
  857. XCOMM_OBJS = \
  858. X    color_l.o \
  859. X    demo.o \
  860. X    file_sel.o \
  861. X    help.o \
  862. X    item.o \
  863. X    items.o \
  864. X    list.o \
  865. X    menu.o \
  866. X    misc.o \
  867. X    miscx.o \
  868. X    room.o \
  869. X    scrollbar.o \
  870. X    sim.o \
  871. X    table.o \
  872. X    xball.o \
  873. X    xball_sys.o
  874. X
  875. XCOMM_INCS = \
  876. X    color_l.h \
  877. X    demo.h \
  878. X    fallback.h \
  879. X    file_sel.h \
  880. X    help.h \
  881. X    intf.h \
  882. X    item.h \
  883. X    items.h \
  884. X    list.h \
  885. X    menu.h \
  886. X    misc.h \
  887. X    miscx.h \
  888. X    names.h \
  889. X        patchlevel.h \
  890. X    room.h \
  891. X    scrollbar.h \
  892. X    sim.h \
  893. X    table.h \
  894. X    xball_sys.h
  895. X
  896. XSRCS = $(COMM_SRCS) $(TOOL_SRCS)
  897. XOBJS = $(COMM_OBJS) $(TOOL_OBJS)
  898. XINCS = $(COMM_INCS) $(TOOL_INCS)
  899. X
  900. X PROGRAM = xball
  901. X
  902. Xall:: xball
  903. X
  904. Xxball: $(OBJS) $(DEPLIBS)
  905. X    $(RM) $@
  906. X    $(CC) -o $@ $(OBJS) $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) $(EXTRA_LOAD_FLAGS)
  907. X
  908. Xsaber_xball:
  909. X    #load $(ALLDEFINES) $(SRCS) $(LOCAL_LIBRARIES) $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
  910. X
  911. Xosaber_xball:
  912. X    #load $(ALLDEFINES) $(OBJS) $(LOCAL_LIBRARIES) $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
  913. X
  914. Xinstall:: xball
  915. X    $(INSTALL) -c $(INSTPGMFLAGS)   xball $(BINDIR)
  916. X
  917. Xinstall.man:: xball.man
  918. X    $(INSTALL) -c $(INSTMANFLAGS) xball.man $(MANDIR)/xball.n
  919. X
  920. Xdepend::
  921. X    $(DEPEND) -s "# DO NOT DELETE" -- $(ALLDEFINES) -- $(SRCS)
  922. X
  923. Xlint:
  924. X    $(LINT) $(LINTFLAGS) $(SRCS) $(LINTLIBS)
  925. Xlint1:
  926. X    $(LINT) $(LINTFLAGS) $(FILE) $(LINTLIBS)
  927. X
  928. Xclean::
  929. X    $(RM) $(PROGRAM)
  930. X
  931. XCLASS            = XBall
  932. XAPP_DEFAULTS_SRC = $(CLASS).ad
  933. X
  934. Xinstall::  $(CLASS).ad
  935. X    $(INSTALL) -c $(INSTAPPFLAGS)  $(CLASS).ad $(XAPPLOADDIR)/ $(CLASS)
  936. X
  937. Xfallback.h: $(APP_DEFAULTS_SRC)
  938. X    gen_fallback $(APP_DEFAULTS_SRC) > $@
  939. X
  940. XDEMOS = demo1 demo2 demo3 demo4 demo5 demo6 demo7 demo8 demo9 demo10 \
  941. X        demo11 demo12 demo13 demo14
  942. X
  943. XBITMAPS = \
  944. X    good_bitmaps \
  945. X    on.xbm \
  946. X    off.xbm \
  947. X    man.xbm \
  948. X    stipple.xbm \
  949. X    xball.xbm \
  950. X    xball-a.xbm \
  951. X    xball-b.xbm \
  952. X    xball-l.xbm \
  953. X    xball-x.xbm \
  954. X    sgi.xbm
  955. X
  956. XMISC = \
  957. X    gen_fallback \
  958. X    run_demos \
  959. X        xball.man \
  960. X    README
  961. X
  962. XDRAWING_A_DIRS = \
  963. X    X11 \
  964. X    X11/Xaw_d
  965. X
  966. XDRAWING_A = \
  967. X    X11/Xaw_d/DrawingA.c \
  968. X    X11/Xaw_d/DrawingA.h \
  969. X    X11/Xaw_d/DrawingAP.h \
  970. X    X11/Xaw_d/DrawingA.doc \
  971. X    X11/Xaw_d/Imakefile \
  972. X    X11/Xaw_d/Makefile.std \
  973. X    X11/Xaw_d/Makefile \
  974. X        X11/Xaw_d/demo.c \
  975. X    X11/Xaw_d/README \
  976. X    Imakefile \
  977. X    Makefile.std \
  978. X    Makefile \
  979. X    Make.motif \
  980. X    Make.athena
  981. X
  982. XDIST = \
  983. X    $(DRAWING_A) \
  984. X    $(COMM_SRCS) \
  985. X    $(COMM_INCS) \
  986. X    $(M_SRCS) \
  987. X    $(M_INCS) \
  988. X    $(A_SRCS) \
  989. X    $(A_INCS) \
  990. X    $(APP_DEFAULTS_SRC) \
  991. X    $(MISC) \
  992. X    $(BITMAPS) \
  993. X    $(DEMOS)
  994. X
  995. Xshar:
  996. X    makekit -s75k -p $(DRAWING_A_DIRS) $(DIST)
  997. X
  998. Xtar:
  999. X    tar cvf - $(DIST) | compress -v > xball.tar.Z
  1000. X
  1001. X###########################################################################
  1002. X# common rules for all Makefiles - do not edit
  1003. X
  1004. Xemptyrule::
  1005. X
  1006. Xclean::
  1007. X    $(RM_CMD) \#*
  1008. X
  1009. XMakefile::
  1010. X    -@if [ -f Makefile ]; then \
  1011. X    echo "    $(RM) Makefile.bak; $(MV) Makefile Makefile.bak"; \
  1012. X    $(RM) Makefile.bak; $(MV) Makefile Makefile.bak; \
  1013. X    else exit 0; fi
  1014. X    $(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR)
  1015. X
  1016. Xtags::
  1017. X    $(TAGS) -w *.[ch]
  1018. X    $(TAGS) -xw *.[ch] > TAGS
  1019. X
  1020. Xsaber:
  1021. X    #load $(ALLDEFINES) $(SRCS)
  1022. X
  1023. Xosaber:
  1024. X    #load $(ALLDEFINES) $(OBJS)
  1025. X
  1026. X###########################################################################
  1027. X# rules for building in SUBDIRS - do not edit
  1028. X
  1029. Xinstall::
  1030. X    @case '${MFLAGS}' in *[ik]*) set +e;; esac; \
  1031. X    for i in $(SUBDIRS) ;\
  1032. X    do \
  1033. X    (cd $$i ; echo "installing" "in $(CURRENT_DIR)/$$i..."; \
  1034. X    $(MAKE) $(MFLAGS) DESTDIR='$(DESTDIR)' install); \
  1035. X    done
  1036. X
  1037. Xinstall.man::
  1038. X    @case '${MFLAGS}' in *[ik]*) set +e;; esac; \
  1039. X    for i in $(SUBDIRS) ;\
  1040. X    do \
  1041. X    (cd $$i ; echo "installing man pages" "in $(CURRENT_DIR)/$$i..."; \
  1042. X    $(MAKE) $(MFLAGS) DESTDIR='$(DESTDIR)' install.man); \
  1043. X    done
  1044. X
  1045. Xclean::
  1046. X    @case '${MFLAGS}' in *[ik]*) set +e;; esac; \
  1047. X    for i in $(SUBDIRS) ;\
  1048. X    do \
  1049. X    (cd $$i ; echo "cleaning" "in $(CURRENT_DIR)/$$i..."; \
  1050. X    $(MAKE) $(MFLAGS) RM_CMD='$(RM_CMD)' clean); \
  1051. X    done
  1052. X
  1053. Xtags::
  1054. X    @case '${MFLAGS}' in *[ik]*) set +e;; esac; \
  1055. X    for i in $(SUBDIRS) ;\
  1056. X    do \
  1057. X    (cd $$i ; echo "tagging" "in $(CURRENT_DIR)/$$i..."; \
  1058. X    $(MAKE) $(MFLAGS) TAGS='$(TAGS)' tags); \
  1059. X    done
  1060. X
  1061. XMakefiles::
  1062. X    @case '${MFLAGS}' in *[ik]*) set +e;; esac; \
  1063. X    for i in $(SUBDIRS) ;\
  1064. X    do \
  1065. X    echo "making Makefiles in $(CURRENT_DIR)/$$i..."; \
  1066. X    case "$$i" in \
  1067. X    ./?*/?*/?*/?*) newtop=../../../../ sub=subsubsubsub;; \
  1068. X    ./?*/?*/?*) newtop=../../../ sub=subsubsub;; \
  1069. X    ./?*/?*) newtop=../../ sub=subsub;; \
  1070. X    ./?*) newtop=../ sub=sub;; \
  1071. X    */?*/?*/?*) newtop=../../../../ sub=subsubsubsub;; \
  1072. X    */?*/?*) newtop=../../../ sub=subsubsub;; \
  1073. X    */?*) newtop=../../ sub=subsub;; \
  1074. X    *) newtop=../ sub=sub;; \
  1075. X    esac; \
  1076. X    case "$(TOP)" in \
  1077. X    /?*) newtop= upprefix= ;; \
  1078. X    *) upprefix=../ ;; \
  1079. X    esac; \
  1080. X    $(MAKE) $${sub}dirMakefiles UPPREFIX=$$upprefix NEWTOP=$$newtop \
  1081. X    MAKEFILE_SUBDIR=$$i NEW_CURRENT_DIR=$(CURRENT_DIR)/$$i;\
  1082. X    done
  1083. X
  1084. XsubdirMakefiles:
  1085. X    $(RM) $(MAKEFILE_SUBDIR)/Makefile.bak
  1086. X    -@if [ -f $(MAKEFILE_SUBDIR)/Makefile ]; then \
  1087. X    echo "    $(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak"; \
  1088. X    $(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak; \
  1089. X    else exit 0; fi
  1090. X    cd $(MAKEFILE_SUBDIR); $(IMAKE_CMD) -DTOPDIR=$(UPPREFIX)$(TOP) -DCURDIR=$(NEW_CURRENT_DIR); \
  1091. X    $(MAKE) $(MFLAGS) Makefiles
  1092. X
  1093. XsubsubdirMakefiles:
  1094. X    $(RM) $(MAKEFILE_SUBDIR)/Makefile.bak
  1095. X    -@if [ -f $(MAKEFILE_SUBDIR)/Makefile ]; then \
  1096. X    echo "    $(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak"; \
  1097. X    $(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak; \
  1098. X    else exit 0; fi
  1099. X    cd $(MAKEFILE_SUBDIR); $(IMAKE_CMD) -DTOPDIR=$(UPPREFIX)$(UPPREFIX)$(TOP) -DCURDIR=$(NEW_CURRENT_DIR); \
  1100. X    $(MAKE) $(MFLAGS) Makefiles
  1101. X
  1102. XsubsubsubdirMakefiles:
  1103. X    $(RM) $(MAKEFILE_SUBDIR)/Makefile.bak
  1104. X    -@if [ -f $(MAKEFILE_SUBDIR)/Makefile ]; then \
  1105. X    echo "    $(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak"; \
  1106. X    $(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak; \
  1107. X    else exit 0; fi
  1108. X    cd $(MAKEFILE_SUBDIR); $(IMAKE_CMD) -DTOPDIR=$(UPPREFIX)$(UPPREFIX)$(UPPREFIX)$(TOP) -DCURDIR=$(NEW_CURRENT_DIR); \
  1109. X    $(MAKE) $(MFLAGS) Makefiles
  1110. X
  1111. XsubsubsubsubdirMakefiles:
  1112. X    $(RM) $(MAKEFILE_SUBDIR)/Makefile.bak
  1113. X    -@if [ -f $(MAKEFILE_SUBDIR)/Makefile ]; then \
  1114. X    echo "    $(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak"; \
  1115. X    $(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak; \
  1116. X    else exit 0; fi
  1117. X    cd $(MAKEFILE_SUBDIR); $(IMAKE_CMD) -DTOPDIR=$(UPPREFIX)$(UPPREFIX)$(UPPREFIX)$(UPPREFIX)$(TOP) -DCURDIR=$(NEW_CURRENT_DIR); \
  1118. X    $(MAKE) $(MFLAGS) Makefiles
  1119. X
  1120. Xincludes::
  1121. X    @case '${MFLAGS}' in *[ik]*) set +e;; esac; \
  1122. X    for i in $(SUBDIRS) ;\
  1123. X    do \
  1124. X    (cd $$i ; echo including "in $(CURRENT_DIR)/$$i..."; \
  1125. X    $(MAKE) $(MFLAGS)   includes); \
  1126. X    done
  1127. X
  1128. X###########################################################################
  1129. X# dependencies generated by makedepend
  1130. X
  1131. END_OF_FILE
  1132. if test 15960 -ne `wc -c <'Make.athena'`; then
  1133.     echo shar: \"'Make.athena'\" unpacked with wrong size!
  1134. fi
  1135. # end of 'Make.athena'
  1136. fi
  1137. if test -f 'color_l.c' -a "${1}" != "-c" ; then 
  1138.   echo shar: Will not clobber existing file \"'color_l.c'\"
  1139. else
  1140. echo shar: Extracting \"'color_l.c'\" \(6091 characters\)
  1141. sed "s/^X//" >'color_l.c' <<'END_OF_FILE'
  1142. X/**********************************************************************
  1143. X * color_l.c - Color list object definition
  1144. X *
  1145. X * Copyright 1993, David Nedde
  1146. X *
  1147. X * Permission to use, copy, modify, and distribute this software
  1148. X * and its documentation for any purpose and without fee is granted
  1149. X * provided that the above copyright notice appears in all copies.
  1150. X * It is provided "as is" without express or implied warranty.
  1151. X **********************************************************************/
  1152. X
  1153. X/* System Headers */
  1154. X#include <stdlib.h>
  1155. X#include <stdio.h>
  1156. X#include <X11/X.h>
  1157. X#include <X11/Intrinsic.h>
  1158. X
  1159. X/* Local headers */
  1160. X#include "color_l.h"
  1161. X#include "misc.h"
  1162. X
  1163. X/* Functions */
  1164. Xstatic void get_rgb4_names();
  1165. X
  1166. X
  1167. X/* Public object methods */
  1168. X
  1169. X/* Constructs the color_list object */
  1170. Xcolor_list_type color_list__create(filename)
  1171. Xchar *filename;
  1172. X{
  1173. X    color_list_type color_list;
  1174. X
  1175. X
  1176. X    color_list = XtNew( color_list_struct);
  1177. X
  1178. X    color_list->shaded_4_list = list__create();
  1179. X
  1180. X    get_rgb4_names( color_list, filename);
  1181. X
  1182. X    return color_list;
  1183. X}
  1184. X
  1185. X
  1186. X/* Destroys the color_list object */
  1187. Xvoid color_list__destroy(color_list)
  1188. Xcolor_list_type color_list;
  1189. X{
  1190. X    color_type            color;
  1191. X
  1192. X    
  1193. X    for (color = color_list__get_last( color_list);
  1194. X         color != (color_type)0;
  1195. X         color = color_list__get_prev( color_list))
  1196. X    {
  1197. X        XtFree( color->name);
  1198. X        XtFree( (char *)color);
  1199. X    }
  1200. X
  1201. X    list__destroy(color_list->shaded_4_list);
  1202. X
  1203. X    XtFree( (char *)color_list);
  1204. X}
  1205. X
  1206. X
  1207. X/* Remove a specified node from the colored list */
  1208. Xcolor_type color_list__remove( color_list, ind)
  1209. Xcolor_list_type color_list;
  1210. Xint             ind;
  1211. X{
  1212. X    return (color_type)list__remove( color_list->shaded_4_list, ind);
  1213. X}
  1214. X
  1215. X
  1216. X/* Returns the number of nodes in the color list */
  1217. Xint color_list__get_count( color_list)
  1218. Xcolor_list_type color_list;
  1219. X{
  1220. X    return list__get_count( color_list->shaded_4_list);
  1221. X}
  1222. X
  1223. X
  1224. X/* Private object methods */
  1225. X
  1226. X/**********************************************************************
  1227. X/*
  1228. X/* get_rgb4_colors - Extract the names of all colors from rgb.txt that
  1229. X/*             have 4 shades of the same color.
  1230. X/*
  1231. X/* void get_rgb4_colors( color_list, passed_file_name)
  1232. X/*
  1233. X/* list_type color_list   <-  a list of found colors
  1234. X/* char * passed_file_name -> The path of the rgb.txt file.  If this parameter
  1235. X/*                            is NULL, the RGB.TXT #define is used.
  1236. X/*
  1237. X/**********************************************************************/
  1238. Xstatic void get_rgb4_names(color_list, passed_file_name)
  1239. Xcolor_list_type color_list;
  1240. Xchar *passed_file_name;
  1241. X{
  1242. X    FILE               *rgb; /* File pointer for rgb.txt */
  1243. X    char            colorname[50]; /* Temp color name string */
  1244. X    int                   r,g,b;
  1245. X    color_type            color;
  1246. X    color_type            colors[SHADES];
  1247. X    int                   color_index;
  1248. X    int                   shade_index;
  1249. X  
  1250. X
  1251. X
  1252. X    /*** Find the number of system colors */
  1253. X    if (!(rgb = fopen(passed_file_name, "r"))) 
  1254. X    {
  1255. X        /* Problem opening file */
  1256. X        fprintf(stderr,"color_list::get_rgb4_names: Opening rgb.txt file: ");
  1257. X        perror(passed_file_name);
  1258. X        exit( EXIT_FAILURE);
  1259. X    }
  1260. X
  1261. X    /* Count the number of 4-shaded colors in the rgb.txt file */
  1262. X    while (4 == fscanf(rgb, "%d %d %d %49[^\n]\n", &r, &g, &b, colorname))
  1263. X    {
  1264. X        color = XtNew( color_struct);
  1265. X        color->r = r;
  1266. X        color->g = g;
  1267. X        color->b = b;
  1268. X        color->name = XtNewString( colorname);
  1269. X        color->last_char = strlen( color->name) - 1;
  1270. X
  1271. X        list__add_end( color_list->shaded_4_list, (void *)color);
  1272. X    }
  1273. X
  1274. X    fclose(rgb);
  1275. X
  1276. X
  1277. X    /* Now, remove all colors that do not have color, color2, color3, color4
  1278. X       in the list */
  1279. X
  1280. X    color_index = color_list__get_count( color_list) - 1; 
  1281. X    while (color_index >= SHADES - 1)
  1282. X    {
  1283. X        for (shade_index = 0; shade_index < SHADES; shade_index++)
  1284. X    {
  1285. X        colors[ shade_index] = 
  1286. X            color_list__get_cell( color_list, color_index - shade_index);
  1287. X
  1288. X        if (colors[ shade_index]->name[ colors[ shade_index]->last_char] !=
  1289. X        '0' + SHADES - shade_index)
  1290. X        {
  1291. X            /* all 4 colors are not there */
  1292. X            int saveindex = color_index;
  1293. X
  1294. X            color_index -= shade_index + 1;
  1295. X        while( shade_index >= 0)
  1296. X        {
  1297. X            XtFree( colors[ shade_index]->name);
  1298. X            XtFree( (char *)colors[ shade_index]);
  1299. X            color_list__remove( color_list, saveindex + shade_index);
  1300. X            shade_index--;
  1301. X        }
  1302. X        break;
  1303. X        }
  1304. X    }
  1305. X    if (shade_index == SHADES)
  1306. X      color_index -= SHADES;
  1307. X    }
  1308. X
  1309. X    /* delete any remaning colors... */
  1310. X    while (color_index >= 0)
  1311. X    {
  1312. X        color = color_list__get_cell( color_list, color_index);
  1313. X
  1314. X        XtFree( color->name);
  1315. X        XtFree( (char *)color);
  1316. X        color_list__remove( color_list, color_index);
  1317. X
  1318. X    color_index--;
  1319. X    }
  1320. X}
  1321. X
  1322. X
  1323. X
  1324. X/* Gets the last node in the color list */
  1325. Xcolor_type color_list__get_last( color_list)
  1326. Xcolor_list_type color_list;
  1327. X{
  1328. X    return (color_type)list__get_last( color_list->shaded_4_list);
  1329. X}
  1330. X
  1331. X
  1332. X/* Get the previous node in the color list */
  1333. Xcolor_type color_list__get_prev( color_list)
  1334. Xcolor_list_type color_list;
  1335. X{
  1336. X    return (color_type)list__get_prev( color_list->shaded_4_list);
  1337. X}
  1338. X
  1339. X
  1340. X#ifdef NOT_USED
  1341. X
  1342. Xchar *color__get_shade( color, shade_num)
  1343. Xcolor_type color;
  1344. Xint shade_num;
  1345. X{
  1346. X    color->name[ color->last_char] = '0' + shade_num;
  1347. X    return color->name;
  1348. X}
  1349. X
  1350. X/**********************************************************************
  1351. X/*
  1352. X/* is_4_shaded_color - Returns True if the colorname passed is one of
  1353. X/*               the colors that has 4 shades.
  1354. X/*
  1355. X/* Bool is_4_shaded_color( colorname)
  1356. X/*
  1357. X/*  Bool return <- True if the colorname is a color with 4 shades
  1358. X/*  char *colorname -> The colorname to check
  1359. X/*
  1360. X/**********************************************************************/
  1361. Xstatic Bool is_4_shaded_color( colorname)
  1362. Xchar *colorname;
  1363. X{
  1364. X  /* A color with '4' as it's last character that isn't a 
  1365. X  /* grey color (e.g. grey14) is how we determine that we
  1366. X  /* have found a color that has 4 shades. */
  1367. X
  1368. X  return (colorname[strlen(colorname)-1] == '4' && 
  1369. X      (strncmp(colorname,"grey",4) != 0 &&
  1370. X       strncmp(colorname,"gray",4) != 0));
  1371. X}
  1372. X#endif
  1373. X
  1374. END_OF_FILE
  1375. if test 6091 -ne `wc -c <'color_l.c'`; then
  1376.     echo shar: \"'color_l.c'\" unpacked with wrong size!
  1377. fi
  1378. # end of 'color_l.c'
  1379. fi
  1380. if test -f 'demo.c' -a "${1}" != "-c" ; then 
  1381.   echo shar: Will not clobber existing file \"'demo.c'\"
  1382. else
  1383. echo shar: Extracting \"'demo.c'\" \(14150 characters\)
  1384. sed "s/^X//" >'demo.c' <<'END_OF_FILE'
  1385. X/**********************************************************************
  1386. X * demo.c - defines the demo object
  1387. X *
  1388. X * Copyright 1993, David Nedde
  1389. X *
  1390. X * Permission to use, copy, modify, and distribute this software
  1391. X * and its documentation for any purpose and without fee is granted
  1392. X * provided that the above copyright notice appears in all copies.
  1393. X * It is provided "as is" without express or implied warranty.
  1394. X **********************************************************************/
  1395. X
  1396. X/* System Headers */
  1397. X#include <stdio.h>
  1398. X#include <unistd.h>
  1399. X#include <X11/StringDefs.h>
  1400. X
  1401. X#ifdef MOTIF
  1402. X#include <Xm/Xm.h>
  1403. X#endif
  1404. X
  1405. X/* Local headers */
  1406. X#include "demo.h"
  1407. X#include "names.h"
  1408. X#include "intf.h"
  1409. X#include "miscx.h"
  1410. X
  1411. X/* Structures */
  1412. Xtypedef struct {
  1413. X  char *demo_file;
  1414. X} app_data,*app_data_ptr;
  1415. Xstatic app_data res_data;
  1416. Xstatic XtResource resources[] = {
  1417. X  { "demoFile", "DemoFile", XtRString, sizeof(char *),
  1418. X        XtOffset( app_data_ptr, demo_file), XtRString, NULL}
  1419. X};
  1420. X
  1421. X/* Functions */
  1422. Xvoid demo_start(/* demo*/);
  1423. X
  1424. X
  1425. X/* Public object methods */
  1426. X
  1427. X/* Create the demo object */
  1428. Xdemo_type demo__create( w, menu, gravity, elasticity, file_sel, items, room)
  1429. XWidget          w;
  1430. Xmenu_type       menu;
  1431. Xscrollbar_type  gravity;
  1432. Xscrollbar_type  elasticity;
  1433. Xfile_sel_type   file_sel;
  1434. Xitems_type      items;
  1435. Xroom_type       room;
  1436. X{
  1437. X    demo_type demo = XtNew( demo_struct_type);
  1438. X
  1439. X    demo->menu = menu;
  1440. X    demo->gravity = gravity;
  1441. X    demo->elasticity = elasticity;
  1442. X    demo->file_sel = file_sel;
  1443. X    demo->items = items;
  1444. X    demo->room = room;
  1445. X
  1446. X    XtGetApplicationResources(get_toplevel(w), (XtPointer)&res_data, 
  1447. X                              resources, XtNumber(resources), 
  1448. X                              (ArgList)NULL,(Cardinal)0);
  1449. X
  1450. X    if (res_data.demo_file != 0)
  1451. X    {
  1452. X        demo->file_name  = XtNewString( res_data.demo_file);
  1453. X        demo_start( demo);
  1454. X        demo->interactive = False;
  1455. X    }
  1456. X    else
  1457. X    {
  1458. X        demo->file_name = (char *)0;
  1459. X        demo->file_ptr   = (FILE *)0;
  1460. X        demo->iterations = 0;
  1461. X        demo->interactive = True;
  1462. X
  1463. X        /* The 'Stop Demo' menu item is greyed since demo is not running */
  1464. X        menu__set_sensitivity( demo->menu, STOP_DEMO, False);
  1465. X    }
  1466. X
  1467. X    return demo;
  1468. X}
  1469. X
  1470. X
  1471. X/* Destroy the demo object */
  1472. Xvoid demo__destroy( demo)
  1473. Xdemo_type demo;
  1474. X{
  1475. X    demo__stop( demo);
  1476. X    XtFree( (char *)demo);
  1477. X}
  1478. X
  1479. X
  1480. X/* A menu callback (mcb) which queries the user for a filename, and then */
  1481. X/* loads and runs the selected demo.                                     */
  1482. Xvoid demo__run_mcb( w, demo, call_data, extra)
  1483. XWidget    w;
  1484. Xdemo_type demo;
  1485. XXtPointer call_data;
  1486. Xchar *    extra;
  1487. X{
  1488. X    char *file_name = file_sel__display( demo->file_sel, "Load Demo");
  1489. X   
  1490. X    if (file_name != (char *)0)
  1491. X    {
  1492. X        demo__stop(demo);        /* Stop a demo if one is in progress */
  1493. X
  1494. X        demo->file_name = XtNewString(file_name);
  1495. X
  1496. X        demo_start( demo);
  1497. X    }
  1498. X}
  1499. X
  1500. X
  1501. X/* A menu callback (mcb) which stops the currently running demo */
  1502. Xvoid demo__stop_mcb( w, demo, call_data, extra)
  1503. XWidget    w;
  1504. Xdemo_type demo;
  1505. XXtPointer call_data;
  1506. Xchar *    extra;
  1507. X{
  1508. X    demo__stop( demo);
  1509. X}
  1510. X
  1511. X
  1512. X/* If a demo is running, stops it by reseting the menu sensitivity,
  1513. X   and cleaning up the demo file */
  1514. Xvoid demo__stop( demo)
  1515. Xdemo_type demo;
  1516. X{
  1517. X    if (!demo__running(demo))
  1518. X        return;
  1519. X
  1520. X    /* The 'Stop Demo' menu item is greyed since menu is not running */
  1521. X    menu__set_sensitivity( demo->menu, STOP_DEMO, False);
  1522. X
  1523. X    /* Set the file_name member to NULL to tell background_processing() that
  1524. X     * there is not a demo in progress */
  1525. X    if (demo->file_name != (char *)0)
  1526. X    {
  1527. X        XtFree( demo->file_name);
  1528. X        demo->file_name = (char *)0;
  1529. X    }
  1530. X
  1531. X    /* Close the demo file */
  1532. X    if (demo->file_ptr != (FILE *)0)
  1533. X    {
  1534. X        fclose(demo->file_ptr);
  1535. X        demo->file_ptr = (FILE *)0;
  1536. X    }
  1537. X}
  1538. X
  1539. X
  1540. X    
  1541. X/* Returns True if a demo is currently running */
  1542. XBool demo__running(demo)
  1543. Xdemo_type demo;
  1544. X{
  1545. X    return demo->file_name != (char *)0;
  1546. X}
  1547. X
  1548. X
  1549. X
  1550. X/*
  1551. X  demo language: (have 'quit demo' button)
  1552. X    create %d,%d,%d,%d: create a ball with x,y, x & y velocity
  1553. X    randomize: randomize velocities of all balls on screen
  1554. X    load_bitmap %s %d,%d: load a bitmap to an x,y on the screen
  1555. X    set_velocity %s %d,%d: set ball velocities (rel or abs)
  1556. X    gravity %d: set gravity to something
  1557. X    elasticity %d: set elasticity to something
  1558. X    iterate %d: pause for n iterations
  1559. X    perpetual on|off: turn perpetual balls on or off
  1560. X    collide on|off: turn ball collision on or off
  1561. X    item_width %d: change item width
  1562. X    item_height %d: change item height
  1563. X    window_width %d: Change window width
  1564. X    window_height %d: Change window height
  1565. X    clear: clear screen
  1566. X    create_random %d,%d: create count random balls with a velocity_factor
  1567. X    label %s:  A label
  1568. X    goto %s: Goto label
  1569. X    exit: quit the xball program
  1570. X    quit: quit the xball program
  1571. X    stop: stop demo but leave program alive
  1572. X*/
  1573. X#define MAX_LEN 100
  1574. X#define is_command(comm) (strncmp(comm,in_line,strlen(comm)) == 0)
  1575. X
  1576. X
  1577. X/* Performs one iteration of the currently running demo */
  1578. Xvoid demo__process(demo)
  1579. Xdemo_type demo;
  1580. X{
  1581. X    char in_line[MAX_LEN];       /* The current demo file line read in */
  1582. X
  1583. X    /* Used to extract parameters from in_line */
  1584. X    char str[MAX_LEN];     
  1585. X    int  x,y;
  1586. X    int  x_vel,y_vel;
  1587. X    int  width,height;
  1588. X    int  count;
  1589. X    int  velocity;
  1590. X    item_type item;
  1591. X
  1592. X
  1593. X    /* Do not run the demo until the item static data has been initialized */
  1594. X    if (!item__initted())
  1595. X        return;
  1596. X
  1597. X    if (demo->iterations > 0)
  1598. X    {
  1599. X        /* Pause for another iteration */
  1600. X        demo->iterations--;
  1601. X        return;
  1602. X    }
  1603. X
  1604. X
  1605. X    /* Read the next line of the demo */
  1606. X    while (fgets(in_line,MAX_LEN,demo->file_ptr) != (char *)NULL)
  1607. X    {
  1608. X        if (in_line[0] == '#' || in_line[0] == '\n')
  1609. X        {
  1610. X            /* Comment */
  1611. X            continue;
  1612. X        }
  1613. X        else 
  1614. X        if (is_command("create_random"))
  1615. X        {
  1616. X            /* create_random %d1,%d2 */
  1617. X            /* create %d1 random balls with a max velocity of %d2 */
  1618. X            
  1619. X            sscanf(in_line,"create_random %d,%d", &count, &velocity);
  1620. X            for (x = 0; x < count; x++)
  1621. X            {
  1622. X                items__new_item(demo->items, 
  1623. X                    rand_range(intf2int(room__get_left_wall( demo->room)),
  1624. X                               intf2int(room__get_right_wall( demo->room))),
  1625. X                    rand_range(intf2int(room__get_ceiling( demo->room)),
  1626. X                               intf2int(room__get_floor( demo->room))),
  1627. X                                rand_range( -velocity, velocity),
  1628. X                                rand_range( -velocity, velocity));
  1629. X            }
  1630. X        }
  1631. X        else    
  1632. X        if (is_command("create"))
  1633. X        {
  1634. X            /* create %d1,%d2,%d3,%d4 */
  1635. X            /* Create a ball with x,y position %d1,%d2 and 
  1636. X               an x & y velocity of %d2,%d4 */
  1637. X
  1638. X            sscanf(in_line,"create %d,%d,%d,%d\n", &x,&y, &x_vel,&y_vel);
  1639. X
  1640. X            items__new_item(demo->items, x, y, x_vel, y_vel);
  1641. X        }
  1642. X        else 
  1643. X        if (is_command("randomize"))
  1644. X        {
  1645. X            int min_x,max_x,min_y,max_y;
  1646. X
  1647. X
  1648. X            /* randomize %d,%d,%d,%d */
  1649. X            /* randomize velocities of all balls on screen 
  1650. X               with a max velocity of %d */
  1651. X
  1652. X            min_x = max_x = min_y = max_y = 0;
  1653. X            sscanf(in_line,"randomize %d,%d,%d,%d", &min_x,&max_x,&min_y,&max_y);
  1654. X
  1655. X            for (item = items__get_first( demo->items);
  1656. X                 item != (item_type)0;
  1657. X                 item = items__get_next( demo->items))
  1658. X            {
  1659. X                item__randomize( item, min_x, max_x, min_y, max_y);
  1660. X            }
  1661. X        }
  1662. X        else 
  1663. X        if (is_command("load_bitmap"))
  1664. X        {
  1665. X            /* load_bitmap %s %d1,%d2 */
  1666. X            /* load a bitmap file (where %s is the file path) to an 
  1667. X               x,y position of %d1,%d2 on the screen */
  1668. X
  1669. X            sscanf(in_line,"load_bitmap %s %d,%d", str,&x,&y);
  1670. X            room__load_bitmap(demo->room, str, x, y);
  1671. X        }
  1672. X        else 
  1673. X        if (is_command("set_velocity"))
  1674. X        {
  1675. X            /* set_velocity %s %d1,%d2 */
  1676. X            /* set ball velocities (%s is relative or absolute) to the x
  1677. X               and y velocities %d1,%d2 */
  1678. X
  1679. X            sscanf(in_line,"set_velocity %s %d,%d", str,&x_vel,&y_vel);
  1680. X
  1681. X            if (strncmp(str,"rel",3) == 0)
  1682. X            {
  1683. X                for (item = items__get_first( demo->items);
  1684. X                     item != (item_type)0;
  1685. X                     item = items__get_next( demo->items))
  1686. X                {
  1687. X                    item__set_x_vel( item, item__get_x_vel(item) + x_vel);
  1688. X                    item__set_y_vel( item, item__get_y_vel(item) + y_vel);
  1689. X                }
  1690. X            }
  1691. X            else if (strncmp(str,"abs",3) == 0)
  1692. X            {
  1693. X                for (item = items__get_first( demo->items);
  1694. X                     item != (item_type)0;
  1695. X                     item = items__get_next( demo->items))
  1696. X                {
  1697. X                    item__set_x_vel( item, x_vel);
  1698. X                    item__set_y_vel( item, y_vel);
  1699. X                }
  1700. X                room__flush( demo->room);
  1701. X            }
  1702. X            else
  1703. X                fprintf(stderr, 
  1704. X                        "Unrecognized set_velocity mode '%s'.\nValid modes: 'abs' or 'rel'.\n", str);
  1705. X        }
  1706. X        else 
  1707. X        if (is_command("gravity"))
  1708. X        {
  1709. X            /* gravity %d */
  1710. X            /* set gravity to %d */
  1711. X            
  1712. X            int gravity_value;
  1713. X
  1714. X            sscanf(in_line,"gravity %d", &gravity_value);
  1715. X
  1716. X            scrollbar__set_value( demo->gravity, gravity_value);
  1717. X        }
  1718. X        else 
  1719. X        if (is_command("elasticity"))
  1720. X        {
  1721. X            /* elasticity %d */
  1722. X            /* set elasticity to %d */
  1723. X
  1724. X            int elasticity_value;
  1725. X
  1726. X            sscanf(in_line,"elasticity %d", &elasticity_value);
  1727. X            
  1728. X            scrollbar__set_value( demo->elasticity, elasticity_value);
  1729. X        }
  1730. X        else 
  1731. X        if (is_command("iterate"))
  1732. X        {
  1733. X            /* iterate %d */
  1734. X            /* pause for %d iterations */
  1735. X
  1736. X            sscanf(in_line,"iterate %d", &demo->iterations);
  1737. X
  1738. X            if (demo->iterations)
  1739. X                /* We are pausing - exit read loop */
  1740. X                return;
  1741. X        }
  1742. X        else    
  1743. X        if (is_command("perpetual"))
  1744. X        {
  1745. X            /* perpetual %s */  
  1746. X            /* toggle perpetual (%s is 'on' or 'off') */
  1747. X
  1748. X            sscanf(in_line,"%*s %s", str);
  1749. X
  1750. X            menu__set_toggle( demo->menu, PERPETUAL, strcmp("on",str) == 0);
  1751. X        }
  1752. X        else 
  1753. X        if (is_command("collide"))
  1754. X        {
  1755. X            /* collide %s */
  1756. X            /* toggle ball collision (%s is 'on' or 'off') */
  1757. X
  1758. X            sscanf(in_line,"%*s %s", str);
  1759. X
  1760. X            menu__set_toggle( demo->menu, BALL_COLLIDE, strcmp("on",str) == 0);
  1761. X        }
  1762. X        else
  1763. X#if 0
  1764. X        if (is_command("item_size"))
  1765. X        {
  1766. X            /* item_width %d */
  1767. X            /* change item size to %d,%d */
  1768. X
  1769. X            sscanf(in_line,"item_size %d,%d", &width, &height);
  1770. X
  1771. X            items__set_visible( demo->items, False);
  1772. X
  1773. X            item__set_size( width, height);
  1774. X
  1775. X            items__set_visible( demo->items, True);
  1776. X        }
  1777. X        else 
  1778. X#endif
  1779. X        if (is_command("window_width"))
  1780. X        {
  1781. X            /* window_width %d */
  1782. X            /* Change window width to %d */
  1783. X
  1784. X            sscanf(in_line,"window_width %d", &width);
  1785. X
  1786. X            room__set_width( demo->room, width);
  1787. X        }
  1788. X        else 
  1789. X        if (is_command("window_height"))
  1790. X        {
  1791. X            /* window_height %d */
  1792. X            /* Change window height to %d */
  1793. X
  1794. X            sscanf(in_line,"window_height %d", &height);
  1795. X
  1796. X            room__set_height( demo->room, (Dimension)height);
  1797. X        }
  1798. X        else 
  1799. X        if (is_command("clear"))
  1800. X        {
  1801. X            /* clear */
  1802. X            /* delete all balls in window */
  1803. X
  1804. X            items__destroy_all( demo->items);
  1805. X        }
  1806. X#if 0
  1807. X        else 
  1808. X        if (is_command("goto") || is_command("label"))
  1809. X        {
  1810. X            /* goto %s */
  1811. X            /* Goto label %s */
  1812. X
  1813. X            /* label %s */
  1814. X            /* The label %s */
  1815. X
  1816. X            printf("Not implemented\n");
  1817. X        }
  1818. X#endif
  1819. X        else 
  1820. X        if (is_command("exit") || is_command("quit"))
  1821. X        {
  1822. X            /* exit */
  1823. X            /* quit */
  1824. X            /* quit the xball program */
  1825. X
  1826. X            if (!demo->interactive)
  1827. X            {
  1828. X                demo__stop( demo);
  1829. X                exit(0);
  1830. X            }
  1831. X        }
  1832. X        else 
  1833. X        if (is_command("stop"))
  1834. X        {
  1835. X            /* stop */
  1836. X            /* stop demo but leave program alive */
  1837. X
  1838. X            demo__stop( demo);
  1839. X            return;
  1840. X        }
  1841. X        else
  1842. X        if (is_command("backwards"))
  1843. X        {
  1844. X            sscanf(in_line,"backwards %d", &count);
  1845. X
  1846. X            items__move_items_backwards( demo->items, demo->room, count);
  1847. X        }
  1848. X        else
  1849. X        if (is_command("visible"))
  1850. X        {
  1851. X            sscanf(in_line,"visible %s", str);
  1852. X
  1853. X            items__set_visible( demo->items, strcmp("on",str) == 0);
  1854. X        }
  1855. X        else
  1856. X        if (is_command("sleep"))
  1857. X        {
  1858. X            sscanf(in_line,"sleep %u", &count);
  1859. X
  1860. X            sleep( (unsigned)count);
  1861. X        }
  1862. X        else
  1863. X        {
  1864. X            /* Could not recognize demo command */
  1865. X            in_line[strlen(in_line)-1] = '\0'; /* Kill newline */
  1866. X            printf("Unrecognized command '%s'\n", in_line);
  1867. X        }
  1868. X    }
  1869. X  
  1870. X    if (feof(demo->file_ptr))
  1871. X    {
  1872. X        /* At the end of the demo file.  Stop processing the demo */
  1873. X        demo__stop( demo);
  1874. X    }
  1875. X}
  1876. X
  1877. X
  1878. X/* Private object methods */
  1879. X
  1880. X/* Loads the currently specified demo program and sensitises the stop demo 
  1881. X   menu  */
  1882. Xstatic void demo_start( demo)
  1883. Xdemo_type demo;
  1884. X{
  1885. X    demo->iterations = 0;
  1886. X
  1887. X    /* Start up the demo file */
  1888. X
  1889. X    if ((demo->file_ptr = fopen(demo->file_name, "r")) == (FILE *)0)
  1890. X    {
  1891. X        /* Problem opening demo file */
  1892. X        fprintf(stderr,"Opening demo file: ");
  1893. X        perror( demo->file_name);
  1894. X
  1895. X
  1896. X        XtFree( demo->file_name);
  1897. X        demo->file_name = (char *)0;
  1898. X        return;
  1899. X    }
  1900. X    else
  1901. X    {
  1902. X        menu__set_sensitivity( demo->menu, STOP_DEMO, True);
  1903. X    }
  1904. X}
  1905. END_OF_FILE
  1906. if test 14150 -ne `wc -c <'demo.c'`; then
  1907.     echo shar: \"'demo.c'\" unpacked with wrong size!
  1908. fi
  1909. # end of 'demo.c'
  1910. fi
  1911. if test -f 'file_sel.c' -a "${1}" != "-c" ; then 
  1912.   echo shar: Will not clobber existing file \"'file_sel.c'\"
  1913. else
  1914. echo shar: Extracting \"'file_sel.c'\" \(6437 characters\)
  1915. sed "s/^X//" >'file_sel.c' <<'END_OF_FILE'
  1916. X/**********************************************************************
  1917. X * file_sel.c - Object that asks the user for a filename.
  1918. X *
  1919. X * Copyright 1993, David Nedde
  1920. X *
  1921. X * Permission to use, copy, modify, and distribute this software
  1922. X * and its documentation for any purpose and without fee is granted
  1923. X * provided that the above copyright notice appears in all copies.
  1924. X * It is provided "as is" without express or implied warranty.
  1925. X **********************************************************************/
  1926. X
  1927. X/**********************************************************************
  1928. X * File_sel Object
  1929. X *
  1930. X * Private Methods:
  1931. X *
  1932. X *   XtCallbackProc button_cb
  1933. X *     Callback if the user presses a button in the selection dialog.
  1934. X *  
  1935. X *
  1936. X * Private Data:
  1937. X *
  1938. X *   Bool searching - True while the dialog is up.
  1939. X *   char *filename - Filename the user selected.
  1940. X *   Widget dialog_w - the dialog widget.
  1941. X *
  1942. X **********************************************************************/
  1943. X
  1944. X/* System headers */
  1945. X#include <stdio.h>
  1946. X#include <X11/Intrinsic.h>
  1947. X
  1948. X#ifdef MOTIF
  1949. X#include <Xm/FileSB.h>
  1950. X#include <Xm/DialogS.h>
  1951. X#endif
  1952. X
  1953. X/* Local headers */
  1954. X#include "file_sel.h"
  1955. X#include "miscx.h"
  1956. X#include "names.h"
  1957. X
  1958. X/* Functions */
  1959. Xstatic void display_dialog(/* file_sel, title*/);
  1960. X
  1961. X
  1962. X/* Create the file_sel object */
  1963. Xfile_sel_type file_sel__create(toplevel)
  1964. XWidget toplevel;
  1965. X{
  1966. X    file_sel_type file_sel = XtNew( file_sel_struct_type);
  1967. X
  1968. X    file_sel->toplevel = toplevel;
  1969. X
  1970. X    file_sel->searching = False;
  1971. X    file_sel->filename = (char *)0;
  1972. X    file_sel->dialog_w = (Widget)0;
  1973. X
  1974. X    return file_sel;
  1975. X}
  1976. X
  1977. X
  1978. X/**********************************************************************
  1979. X * file_sel__free - Free data associated with file_sel object
  1980. X *
  1981. X * void file_sel__free( file_sel_type file_sel)
  1982. X *
  1983. X *
  1984. X * file_sel - the file_sel object
  1985. X *
  1986. X **********************************************************************/
  1987. Xvoid file_sel__destroy(file_sel)
  1988. Xfile_sel_type file_sel;
  1989. X{
  1990. X    if (file_sel->filename != (char *)0)
  1991. X    {
  1992. X        XtFree( file_sel->filename);
  1993. X    }
  1994. X
  1995. X    if (file_sel->dialog_w != (Widget)0)
  1996. X    {
  1997. X        XtDestroyWidget( file_sel->dialog_w);
  1998. X    }
  1999. X
  2000. X    XtFree( (char *)file_sel);
  2001. X}
  2002. X
  2003. X
  2004. X/**********************************************************************
  2005. X * file_sel__display - Display the file selection box and return selected file
  2006. X *
  2007. X * char *file_sel__display(file_sel_type file_sel, char *title)
  2008. X *
  2009. X *
  2010. X * file_sel - the file_sel object
  2011. X * title - the string used for the dialog's popup window title
  2012. X * Returns - the filename selected by the user, or (char *)0 if canceled
  2013. X *
  2014. X * Description:
  2015. X *   If the title is (char *)0, a default title will be used.
  2016. X *   the returned string is not to be freed by the caller.
  2017. X *   The method only returns when the user is done with the dialog.
  2018. X *
  2019. X **********************************************************************/
  2020. Xchar *file_sel__display(file_sel, title)
  2021. Xfile_sel_type file_sel;
  2022. Xchar *        title;
  2023. X{
  2024. X    /* Free filename if it was set in previous calls */
  2025. X    if (file_sel->filename != (char *)0)
  2026. X    {
  2027. X        XtFree(file_sel->filename);
  2028. X        file_sel->filename = (char *)0;
  2029. X    }
  2030. X
  2031. X    /* Display dialog to user and set the filename member */
  2032. X    display_dialog( file_sel, title);
  2033. X
  2034. X    return file_sel->filename;
  2035. X}
  2036. X
  2037. X
  2038. X/* Private object methods */
  2039. X
  2040. X#ifdef MOTIF
  2041. X
  2042. Xstatic void button_cb(/*w, file_sel, call_data*/);
  2043. X
  2044. X
  2045. Xstatic void display_dialog( file_sel, title)
  2046. Xfile_sel_type file_sel;
  2047. Xchar *        title;
  2048. X{
  2049. X    XEvent event;
  2050. X    XtAppContext app_context;
  2051. X
  2052. X
  2053. X    file_sel->searching = True;
  2054. X
  2055. X    if (file_sel->dialog_w == (Widget)0)
  2056. X    {
  2057. X        file_sel->dialog_w = 
  2058. X            XmCreateFileSelectionDialog(file_sel->toplevel, FILE_SB, NULL, 0);
  2059. X
  2060. X        XtAddCallback(file_sel->dialog_w, XmNcancelCallback,
  2061. X                      button_cb, (XtPointer)file_sel);
  2062. X        XtAddCallback(file_sel->dialog_w,XmNokCallback,    
  2063. X                      button_cb, (XtPointer)file_sel);
  2064. X        XtAddCallback(file_sel->dialog_w,XmNhelpCallback,
  2065. X                      button_cb, (XtPointer)file_sel);
  2066. X    }
  2067. X
  2068. X    app_context = XtWidgetToApplicationContext( file_sel->dialog_w);
  2069. X
  2070. X    if (title == (char *)0)
  2071. X      title = "Select File";
  2072. X
  2073. X    XtVaSetValues( file_sel->dialog_w,
  2074. X                  XmNdialogStyle, XmDIALOG_FULL_APPLICATION_MODAL,
  2075. X                  XtVaTypedArg,
  2076. X                    XmNdialogTitle, XmRString, title, sizeof(char *),
  2077. X                  NULL);
  2078. X
  2079. X
  2080. X    XmFileSelectionDoSearch( file_sel->dialog_w, NULL);
  2081. X    XtManageChild( file_sel->dialog_w); /* Manage the file selection widget */
  2082. X
  2083. X
  2084. X    /* Keep processing Xt events until one of the callbacks resets the 
  2085. X       searching data member */
  2086. X    while (file_sel->searching)
  2087. X    {
  2088. X        XtAppNextEvent(app_context, &event);
  2089. X        XtDispatchEvent(&event);
  2090. X    }
  2091. X}
  2092. X
  2093. X
  2094. X/**********************************************************************
  2095. X * button_cb - Callback if the user presses a button in the selection dialog.
  2096. X *
  2097. X * XtCallbackProc button_cb
  2098. X *
  2099. X * Description:
  2100. X *   Brings down the file selection dialog.
  2101. X *   If the OK button was pressed, the selected string is saved.
  2102. X *   If the Cancel button was pressed...
  2103. X **********************************************************************/
  2104. Xstatic void button_cb(w, file_sel, call_data)
  2105. XWidget w;
  2106. Xfile_sel_type file_sel;
  2107. XXmFileSelectionBoxCallbackStruct *call_data;
  2108. X{
  2109. X    XtUnmanageChild(w);  /* Bring down the file selection dialog */
  2110. X
  2111. X    switch (call_data->reason)
  2112. X    {
  2113. X        case XmCR_OK:
  2114. X        /* Get the selected filename as a (char *) */
  2115. X        if (!XmStringGetLtoR(call_data->value, XmSTRING_DEFAULT_CHARSET, 
  2116. X                             &file_sel->filename))
  2117. X            /* Internal error - couldn't get the selected filename */
  2118. X            break;
  2119. X
  2120. X        if (file_sel->filename[0] == '\0')
  2121. X        {
  2122. X            /* No string was selected */
  2123. X            XtFree( file_sel->filename);
  2124. X            file_sel->filename = (char *)0;
  2125. X        }
  2126. X        break;
  2127. X
  2128. X
  2129. X        case XmCR_HELP:
  2130. X        break;
  2131. X
  2132. X
  2133. X        case XmCR_CANCEL:
  2134. X        break;
  2135. X    }
  2136. X
  2137. X    file_sel->searching = False;     /* Exit file_sel__display() routine */
  2138. X}
  2139. X
  2140. X#endif
  2141. X
  2142. X
  2143. X#ifdef ATHENA
  2144. X
  2145. X/* Display the file dialog to the user.  
  2146. X   Call SelFile in filemenu.c */
  2147. Xstatic void display_dialog( file_sel, title)
  2148. Xfile_sel_type file_sel;
  2149. Xchar *        title;
  2150. X{
  2151. X    SelFile( file_sel->toplevel, /*prompt=*/NULL, /*cancel=*/NULL, 
  2152. X             /*init_path=*/NULL, /*show_entry=*/NULL, 
  2153. X             &file_sel->filename);
  2154. X}
  2155. X
  2156. X#endif
  2157. END_OF_FILE
  2158. if test 6437 -ne `wc -c <'file_sel.c'`; then
  2159.     echo shar: \"'file_sel.c'\" unpacked with wrong size!
  2160. fi
  2161. # end of 'file_sel.c'
  2162. fi
  2163. if test -f 'help.c' -a "${1}" != "-c" ; then 
  2164.   echo shar: Will not clobber existing file \"'help.c'\"
  2165. else
  2166. echo shar: Extracting \"'help.c'\" \(8702 characters\)
  2167. sed "s/^X//" >'help.c' <<'END_OF_FILE'
  2168. X/**********************************************************************
  2169. X * help.c - help object definition
  2170. X *
  2171. X * Copyright 1993, David Nedde
  2172. X *
  2173. X * Permission to use, copy, modify, and distribute this software
  2174. X * and its documentation for any purpose and without fee is granted
  2175. X * provided that the above copyright notice appears in all copies.
  2176. X * It is provided "as is" without express or implied warranty.
  2177. X **********************************************************************/
  2178. X
  2179. X/* System Headers */
  2180. X#include <X11/StringDefs.h>
  2181. X
  2182. X#ifdef MOTIF
  2183. X#include <Xm/Xm.h>
  2184. X#include <Xm/Form.h>
  2185. X#include <Xm/Text.h>
  2186. X#include <Xm/Separator.h>
  2187. X#include "act_area.h"
  2188. X#endif
  2189. X
  2190. X#ifdef ATHENA
  2191. X#include <X11/Intrinsic.h>
  2192. X#include <X11/Shell.h>
  2193. X#include <X11/Xaw/Form.h>
  2194. X#include <X11/Xaw/AsciiText.h>
  2195. X#include <X11/Xaw/Command.h>
  2196. X#endif
  2197. X
  2198. X/* Local headers */
  2199. X#include "help.h"
  2200. X#include "names.h"
  2201. X#include "misc.h"
  2202. X#include "miscx.h"
  2203. X
  2204. X/* File scope variables */
  2205. Xtypedef struct {
  2206. X  char *menu_help;
  2207. X  char *scrollbar_help;
  2208. X  char *pointer_help;
  2209. X  char *demo_help;
  2210. X  char *startup_help;
  2211. X  char *about_help;
  2212. X} app_data,*app_data_ptr;
  2213. Xstatic app_data res_data = { 0, 0, 0, 0, 0, 0 };
  2214. Xstatic XtResource resources[] = {
  2215. X  { "menuHelp", "MenuHelp", XtRString, sizeof(char *),
  2216. X        XtOffset( app_data_ptr, menu_help), XtRString, NULL},
  2217. X  { "scrollbarHelp", "ScrollbarHelp", XtRString, sizeof(char *),
  2218. X        XtOffset( app_data_ptr, scrollbar_help), XtRString, NULL},
  2219. X  { "pointerHelp", "PointerHelp", XtRString, sizeof(char *),
  2220. X        XtOffset( app_data_ptr, pointer_help), XtRString, NULL},
  2221. X  { "demoHelp", "DemoHelp", XtRString, sizeof(char *),
  2222. X        XtOffset( app_data_ptr, demo_help), XtRString, NULL},
  2223. X  { "startupHelp", "StartupHelp", XtRString, sizeof(char *),
  2224. X        XtOffset( app_data_ptr, startup_help), XtRString, NULL},
  2225. X  { "aboutString", "AboutString", XtRString, sizeof(char *),
  2226. X        XtOffset( app_data_ptr, about_help), XtRString, NULL}
  2227. X};
  2228. X
  2229. X/* Functions */
  2230. Xstatic void close_cb(/*w, help, call_data*/);
  2231. Xstatic void display_help_dialog(/*help, message*/);
  2232. Xstatic void create_help_dialog(/* help*/);
  2233. Xstatic void set_help_text(/* help, message*/);
  2234. X
  2235. X
  2236. X/* Public object methods */
  2237. X
  2238. X/* Create the help object */
  2239. Xhelp_type help__create(w)
  2240. XWidget w;
  2241. X{
  2242. X    help_type help = XtNew( help_struct_type);
  2243. X
  2244. X    help->toplevel = w;
  2245. X
  2246. X    help->dialog_w = (Widget)0;
  2247. X
  2248. X    return help;
  2249. X}
  2250. X
  2251. X
  2252. X/* Destroy the help object */
  2253. Xvoid help__destroy(help)
  2254. Xhelp_type help;
  2255. X{
  2256. X    XtDestroyWidget( help->dialog_w);
  2257. X
  2258. X    XtFree( (char *)help);
  2259. X}
  2260. X
  2261. X
  2262. X/* A menu callback (mcb) that displayshelp to the user, based on the
  2263. X   name of the menu button used to invoke the callback */
  2264. Xvoid help__display_mcb(w, help, call_data, extra)
  2265. XWidget    w;
  2266. Xhelp_type help;
  2267. XXtPointer call_data;
  2268. Xchar *    extra;
  2269. X{
  2270. X    char * help_text;
  2271. X    char * widget_name = XtName(w);
  2272. X
  2273. X
  2274. X    if (res_data.menu_help == 0)
  2275. X    {
  2276. X        /* Read help text resources */
  2277. X        XtGetApplicationResources(get_toplevel(w), (XtPointer)&res_data, 
  2278. X                                  resources, XtNumber(resources), 
  2279. X                                  (ArgList)NULL,(Cardinal)0);
  2280. X
  2281. X    /* We have to convert the ~ to newlines because fallback
  2282. X       resources do not work if they have newlines embedded in them */
  2283. X    /* convert_newlines is in misc.c */
  2284. X        convert_newlines( res_data.menu_help);
  2285. X        convert_newlines( res_data.scrollbar_help);
  2286. X        convert_newlines( res_data.pointer_help);
  2287. X        convert_newlines( res_data.demo_help);
  2288. X        convert_newlines( res_data.startup_help);
  2289. X        convert_newlines( res_data.about_help);
  2290. X    }
  2291. X
  2292. X    if (strcmp( widget_name, ON_MENUS) == 0)
  2293. X        help_text = res_data.menu_help;
  2294. X    else
  2295. X    if (strcmp( widget_name, ON_SCROLL) == 0)
  2296. X        help_text = res_data.scrollbar_help;
  2297. X    else
  2298. X    if (strcmp( widget_name, ON_BUTTONS) == 0)
  2299. X        help_text = res_data.pointer_help;
  2300. X    else
  2301. X    if (strcmp( widget_name, ON_DEMOS) == 0)
  2302. X        help_text = res_data.demo_help;
  2303. X    else
  2304. X    if (strcmp( widget_name, ON_PARAMS) == 0)
  2305. X        help_text = res_data.startup_help;
  2306. X    else
  2307. X    if (strcmp( widget_name, ABOUT) == 0)
  2308. X        help_text = res_data.about_help;
  2309. X
  2310. X    /* Display the help dialog */
  2311. X    display_help_dialog(help, help_text);
  2312. X}
  2313. X
  2314. X
  2315. X/* Private object methods */
  2316. X
  2317. X/* Called when the user wants to close the help dialog */
  2318. Xstatic void close_cb(w, help, call_data)
  2319. XWidget          w;
  2320. Xhelp_type       help;
  2321. XXtPointer call_data;
  2322. X{
  2323. X    XtUnmanageChild( help->dialog_w);
  2324. X}
  2325. X
  2326. X
  2327. X/* Displays the passed message in the help dialog */
  2328. Xstatic void display_help_dialog(help, message)
  2329. Xhelp_type help;
  2330. Xchar   *message;
  2331. X{
  2332. X    if (help->dialog_w == (Widget)0)
  2333. X    {
  2334. X        create_help_dialog( help);
  2335. X    }
  2336. X
  2337. X    set_help_text( help, message);
  2338. X
  2339. X    XtManageChild( help->dialog_w);
  2340. X}
  2341. X
  2342. X
  2343. X#ifdef MOTIF
  2344. X
  2345. X/* Creates the Motif help dialog */
  2346. X/* Uses CreateActionArea in act_area.c */
  2347. Xstatic void create_help_dialog( help)
  2348. Xhelp_type help;
  2349. X{
  2350. X    Widget sep;
  2351. X    Arg    wargs[10];
  2352. X    int    n;
  2353. X
  2354. X    static ActionAreaItem action_items[] = {
  2355. X        { "close",            close_cb,  NULL }
  2356. X    };
  2357. X
  2358. X
  2359. X    help->dialog_w = 
  2360. X        XmCreateFormDialog( help->toplevel, HELP_DIALOG, NULL, 0);
  2361. X
  2362. X
  2363. X    /* Create the action area */
  2364. X    action_items[0].data = (XtPointer )help;
  2365. X    CreateActionArea( help->dialog_w, 
  2366. X                      action_items, XtNumber(action_items));
  2367. X
  2368. X
  2369. X    sep = XtVaCreateManagedWidget("separator", xmSeparatorWidgetClass,
  2370. X                            help->dialog_w, 
  2371. X                            NULL);
  2372. X
  2373. X    n = 0;
  2374. X    XtSetArg(wargs[n], XmNeditMode,           XmMULTI_LINE_EDIT); n++;
  2375. X    XtSetArg(wargs[n], XmNeditable,           False); n++;
  2376. X    XtSetArg(wargs[n], XmNverifyBell,         False); n++;
  2377. X    XtSetArg(wargs[n], XmNtopAttachment,      XmATTACH_FORM); n++;
  2378. X    XtSetArg(wargs[n], XmNleftAttachment,     XmATTACH_FORM); n++;
  2379. X    XtSetArg(wargs[n], XmNrightAttachment,    XmATTACH_FORM); n++;
  2380. X    XtSetArg(wargs[n], XmNbottomAttachment,   XmATTACH_WIDGET); n++;
  2381. X    XtSetArg(wargs[n], XmNbottomWidget,       sep); n++;
  2382. X
  2383. X    help->text_w = 
  2384. X        XmCreateScrolledText( help->dialog_w, "help_text", wargs, n);
  2385. X    XtManageChild( help->text_w);
  2386. X}
  2387. X
  2388. X
  2389. X/* Sets the help text in the Motif dialog */
  2390. Xstatic void set_help_text( help, message)
  2391. Xhelp_type help;
  2392. Xchar * message;
  2393. X{
  2394. X    XmTextSetString( help->text_w, message);
  2395. X}
  2396. X
  2397. X#endif
  2398. X
  2399. X
  2400. X#ifdef ATHENA
  2401. X
  2402. X/* Creates the Athena help dialog */
  2403. Xstatic void create_help_dialog( help)
  2404. Xhelp_type help;
  2405. X{
  2406. X    Widget      form;
  2407. X    Widget      button;
  2408. X    char        buff[50];
  2409. X    Dimension   border_width;
  2410. X    Dimension   top_width;
  2411. X    Dimension   top_height;
  2412. X    Dimension   dialog_width;
  2413. X    Dimension   dialog_height;
  2414. X    int         x_offset, y_offset;
  2415. X    Position    x,y;
  2416. X
  2417. X
  2418. X
  2419. X    sprintf(buff, "%s_popup", HELP_DIALOG);
  2420. X    help->dialog_w = 
  2421. X        XtVaCreateWidget( buff, transientShellWidgetClass, help->toplevel,
  2422. X                          XtNtransientFor,      help->toplevel,
  2423. X                          XtNmappedWhenManaged, False,
  2424. X                          NULL);
  2425. X
  2426. X    form = XtVaCreateManagedWidget( HELP_DIALOG, formWidgetClass, 
  2427. X                                    help->dialog_w, NULL);
  2428. X
  2429. X    help->text_w = 
  2430. X        XtVaCreateManagedWidget( "help_textAW", asciiTextWidgetClass, form,
  2431. X                                 NULL);
  2432. X
  2433. X    button = 
  2434. X        XtVaCreateManagedWidget( "close", commandWidgetClass, form,
  2435. X                                 XtNfromVert,   help->text_w,
  2436. X                                 NULL);
  2437. X    XtAddCallback( button, XtNcallback, close_cb, (XtPointer)help);
  2438. X
  2439. X    XtInstallAccelerators( form, button);
  2440. X
  2441. X    /* Manage so the shell widget's width and height will be set */
  2442. X    XtManageChild( help->dialog_w);
  2443. X
  2444. X    /* Position centered over the toplevel window */
  2445. X    XtVaGetValues( help->toplevel,
  2446. X                   XtNwidth,       &top_width,
  2447. X                   XtNheight,      &top_height,
  2448. X                   XtNborderWidth, &border_width,
  2449. X                   NULL);
  2450. X
  2451. X    XtVaGetValues( help->dialog_w,
  2452. X                   XtNwidth,  &dialog_width,
  2453. X                   XtNheight, &dialog_height,
  2454. X                   NULL);
  2455. X
  2456. X    x_offset = (top_width  - dialog_width ) / 2;
  2457. X    y_offset = (top_height - dialog_height) / 2;
  2458. X
  2459. X    XtTranslateCoords(help->toplevel, x_offset, y_offset, &x, &y);
  2460. X
  2461. X    XtUnmanageChild( help->dialog_w);
  2462. X
  2463. X    XtVaSetValues( help->dialog_w,
  2464. X                   XtNx,                 x,
  2465. X                   XtNy,                 y,
  2466. X                   XtNmappedWhenManaged, True,
  2467. X                   NULL);
  2468. X}
  2469. X
  2470. X
  2471. X/* Set the help string in the Athena help dialog */
  2472. Xstatic void set_help_text( help, message)
  2473. Xhelp_type help;
  2474. Xchar * message;
  2475. X{
  2476. X    XtVaSetValues( help->text_w,
  2477. X                   XtNstring, message,
  2478. X                   NULL);
  2479. X}
  2480. X
  2481. X#endif
  2482. END_OF_FILE
  2483. if test 8702 -ne `wc -c <'help.c'`; then
  2484.     echo shar: \"'help.c'\" unpacked with wrong size!
  2485. fi
  2486. # end of 'help.c'
  2487. fi
  2488. if test -f 'list.c' -a "${1}" != "-c" ; then 
  2489.   echo shar: Will not clobber existing file \"'list.c'\"
  2490. else
  2491. echo shar: Extracting \"'list.c'\" \(5282 characters\)
  2492. sed "s/^X//" >'list.c' <<'END_OF_FILE'
  2493. X/**********************************************************************
  2494. X * list.c - defines a void * list object
  2495. X *
  2496. X * Copyright 1993, David Nedde
  2497. X *
  2498. X * Permission to use, copy, modify, and distribute this software
  2499. X * and its documentation for any purpose and without fee is granted
  2500. X * provided that the above copyright notice appears in all copies.
  2501. X * It is provided "as is" without express or implied warranty.
  2502. X **********************************************************************/
  2503. X
  2504. X/* System Headers */
  2505. X#include <malloc.h>
  2506. X
  2507. X/* Local headers */
  2508. X#include "list.h"
  2509. X
  2510. X/* Functions */
  2511. Xstatic void list_double(/* list*/);
  2512. Xstatic void *get_item(/* list, index*/);
  2513. X
  2514. X
  2515. X
  2516. X/* Public object methods */
  2517. X
  2518. X/* Create the list object */
  2519. Xlist_type list__create()
  2520. X{
  2521. X    list_type list;
  2522. X
  2523. X
  2524. X    list = (list_type)malloc( sizeof( list_struct));
  2525. X
  2526. X    list->count     = 0;
  2527. X    list->curr_item = 0;
  2528. X    list->max_count = LIST_INITIAL_SIZE;
  2529. X    list->data = (void **)malloc( sizeof( void *) * list->max_count);
  2530. X
  2531. X    return list;
  2532. X}
  2533. X
  2534. X
  2535. X/* Destroy the list object.  Items in the list are not freed */
  2536. Xvoid list__destroy( list)
  2537. Xlist_type list;
  2538. X{
  2539. X    free( list->data);
  2540. X    free( list);
  2541. X}
  2542. X
  2543. X
  2544. X/* Add an item to the start of the list */
  2545. Xvoid *list__add_start( list, data_item)
  2546. Xlist_type list;
  2547. Xvoid *data_item;
  2548. X{
  2549. X    int i;
  2550. X
  2551. X
  2552. X    if (list->count == list->max_count)
  2553. X        list_double( list);
  2554. X
  2555. X    /* Copy all item down by one */
  2556. X    for (i = list->count-1; i > 0; i--)
  2557. X        list->data[ i] = list->data[ i - 1];
  2558. X
  2559. X    list->data[ 0] = data_item;
  2560. X
  2561. X    list->count++;
  2562. X
  2563. X    return data_item;
  2564. X}
  2565. X
  2566. X
  2567. X/* Add an item to the end of the list */
  2568. Xvoid *list__add_end( list, data_item)
  2569. Xlist_type list;
  2570. Xvoid *data_item;
  2571. X{
  2572. X    if (list->count == list->max_count)
  2573. X        list_double( list);
  2574. X
  2575. X    list->data[ list->count] = data_item;
  2576. X
  2577. X    list->count++;
  2578. X
  2579. X    return data_item;
  2580. X}
  2581. X
  2582. X
  2583. X/* Get the first item in the list */
  2584. Xvoid *list__get_first( list)
  2585. Xlist_type list;
  2586. X{
  2587. X    list->curr_item = 0;
  2588. X    return get_item( list, list->curr_item);
  2589. X}
  2590. X
  2591. X
  2592. X/* Get the next item in the list.  NULL is returned if there are no more
  2593. X   items in the list */
  2594. Xvoid *list__get_next( list)
  2595. Xlist_type list;
  2596. X{
  2597. X    list->curr_item++;
  2598. X    return get_item( list, list->curr_item);
  2599. X}
  2600. X
  2601. X
  2602. X/* Return the last item in the list */
  2603. Xvoid *list__get_last( list)
  2604. Xlist_type list;
  2605. X{
  2606. X    list->curr_item = list->count - 1;
  2607. X    return get_item( list, list->curr_item);
  2608. X}
  2609. X
  2610. X
  2611. X/* Return the previous item in the list.  If there are no more items,
  2612. X   return NULL. */
  2613. Xvoid *list__get_prev( list)
  2614. Xlist_type list;
  2615. X{
  2616. X    if (list->curr_item > 0)
  2617. X    {
  2618. X        list->curr_item--;
  2619. X        return get_item( list, list->curr_item);
  2620. X    }
  2621. X    else
  2622. X        return (void *)0;
  2623. X}
  2624. X
  2625. X
  2626. X/* Remove the last item in the list.  The item removed is returned. */
  2627. Xvoid *list__remove_last( list)
  2628. Xlist_type list;
  2629. X{
  2630. X    void *data_item = (void *)0;
  2631. X
  2632. X
  2633. X    if (list->count > 0)
  2634. X    {
  2635. X        list->count--;
  2636. X        data_item = list->data[ list->count];
  2637. X        list->data[ list->count] = (void *)0;
  2638. X    }
  2639. X
  2640. X    return data_item;
  2641. X}
  2642. X
  2643. X
  2644. X/* Remove the first item in the list.  The item removed is returned. */
  2645. Xvoid *list__remove_first( list)
  2646. Xlist_type list;
  2647. X{
  2648. X    int i;
  2649. X    void *data_item = (void *)0;
  2650. X
  2651. X
  2652. X    if (list->count > 0)
  2653. X    {
  2654. X        list->count--;
  2655. X        data_item = list->data[ 0];
  2656. X
  2657. X        /* Shift data pointers up one */
  2658. X        for (i = 0; i < list->count; i++)
  2659. X            list->data[ i] = list->data[ i+1];
  2660. X
  2661. X        list->data[ list->count] = (void *)0;
  2662. X    }
  2663. X
  2664. X    return data_item;
  2665. X}
  2666. X
  2667. X
  2668. X/* Remove the current item in the list, as positioned by get_first, next, 
  2669. X   last, prev.   The current item is now the item after the one removed */
  2670. Xvoid *list__remove_curr( list)
  2671. Xlist_type list;
  2672. X{
  2673. X    int i;
  2674. X    void *data_item = (void *)0;
  2675. X
  2676. X    if (list->curr_item < list->count)
  2677. X    {
  2678. X        data_item = list->data[ list->curr_item];
  2679. X
  2680. X        for (i = list->curr_item; i < list->count; i++)
  2681. X            list->data[ i] = list->data[ i+1];
  2682. X
  2683. X        list->data[ list->count] = (void *)0;
  2684. X    }
  2685. X
  2686. X    return data_item;
  2687. X}
  2688. X
  2689. X
  2690. X/* Remove an item at the specified position in the list */
  2691. Xvoid *list__remove( list, ind)
  2692. Xlist_type list;
  2693. Xint       ind;
  2694. X{
  2695. X    int i;
  2696. X    void *data_item = (void *)0;
  2697. X
  2698. X    if (ind >= 0 && ind < list->count)
  2699. X    {
  2700. X        data_item = list->data[ ind];
  2701. X
  2702. X        for (i = ind; i < list->count - 1; i++)
  2703. X            list->data[ i] = list->data[ i+1];
  2704. X
  2705. X        list->data[ list->count] = (void *)0;
  2706. X    }
  2707. X
  2708. X    list->count--;
  2709. X
  2710. X    return data_item;
  2711. X}
  2712. X
  2713. X
  2714. X/* Remove all items in the list.  The objects are not freed */
  2715. Xvoid list__remove_all( list)
  2716. Xlist_type list;
  2717. X{
  2718. X    int i;
  2719. X
  2720. X
  2721. X    for (i = 0; i < list->count; i++)
  2722. X        list->data[ i] = (void *)0;
  2723. X
  2724. X    list->count = 0;
  2725. X}
  2726. X
  2727. X
  2728. X/* Private object methods */
  2729. X
  2730. X/* Return the specified object at a specified position */
  2731. Xstatic void *get_item( list, ind)
  2732. Xlist_type list;
  2733. Xint       ind;
  2734. X{
  2735. X    if (ind < list->count)
  2736. X        return list->data[ ind];
  2737. X    else
  2738. X        return (void *)0;
  2739. X}
  2740. X
  2741. X
  2742. X/* Double the size of the list */
  2743. Xstatic void list_double( list)
  2744. Xlist_type list;
  2745. X{
  2746. X    int i;
  2747. X
  2748. X
  2749. X    /* Double the list's size */
  2750. X    void **tmp_data = list->data;
  2751. X
  2752. X    list->max_count *= 2;
  2753. X    list->data = (void **)malloc( sizeof( void *) * list->max_count);
  2754. X
  2755. X    for (i = 0; i < list->count; i++)
  2756. X        list->data[ i] = tmp_data[ i];
  2757. X
  2758. X    free( tmp_data);
  2759. X}
  2760. END_OF_FILE
  2761. if test 5282 -ne `wc -c <'list.c'`; then
  2762.     echo shar: \"'list.c'\" unpacked with wrong size!
  2763. fi
  2764. # end of 'list.c'
  2765. fi
  2766. if test -f 'misc.c' -a "${1}" != "-c" ; then 
  2767.   echo shar: Will not clobber existing file \"'misc.c'\"
  2768. else
  2769. echo shar: Extracting \"'misc.c'\" \(1605 characters\)
  2770. sed "s/^X//" >'misc.c' <<'END_OF_FILE'
  2771. X/**********************************************************************
  2772. X * misc.c - Misc functions
  2773. X *
  2774. X * Copyright 1993, David Nedde
  2775. X *
  2776. X * Permission to use, copy, modify, and distribute this software
  2777. X * and its documentation for any purpose and without fee is granted
  2778. X * provided that the above copyright notice appears in all copies.
  2779. X * It is provided "as is" without express or implied warranty.
  2780. X **********************************************************************/
  2781. X
  2782. X/* System Headers */
  2783. X#include <malloc.h>
  2784. X#include <string.h>
  2785. X
  2786. X
  2787. X/* Given a string 'text\nmore text', allocates and returns the
  2788. X   string before the newline. */
  2789. Xchar *get_string( str)
  2790. Xchar *str;
  2791. X{
  2792. X    char *tmp;
  2793. X    char *newline = strchr(str,'\n');
  2794. X    int len;
  2795. X
  2796. X    if (newline == (char *)0)
  2797. X        return (char *)0;
  2798. X
  2799. X    len = newline - str;
  2800. X    tmp = malloc( len + 1);
  2801. X    strncpy( tmp, str, len + 1);
  2802. X    tmp[ len] = '\0';
  2803. X
  2804. X    return tmp;
  2805. X}
  2806. X
  2807. X
  2808. X/* Because some systems  do not have strdup */
  2809. Xchar *my_strdup( str)
  2810. Xchar *str;
  2811. X{
  2812. X    char *ret_str = malloc( strlen( str) + 1);
  2813. X
  2814. X    strcpy( ret_str, str);
  2815. X
  2816. X    return ret_str;
  2817. X}
  2818. X
  2819. X
  2820. X/* Return a random value in the specified range */
  2821. Xlong rand_range( min, max)
  2822. Xlong min, max;
  2823. X{
  2824. X    if (min == max)
  2825. X        return min;
  2826. X    else
  2827. X        return random() % (max - min) + min;
  2828. X}
  2829. X
  2830. X
  2831. X/* Change '~' to \n in the passed string */
  2832. X/* This silliness is due to fallback resources not handling \n in the 
  2833. X   resource string */
  2834. Xvoid convert_newlines( str)
  2835. Xchar *str;
  2836. X{
  2837. X    char *curr = strchr( str, '~');
  2838. X
  2839. X
  2840. X    while (curr != 0)
  2841. X    {
  2842. X        *curr = '\n';
  2843. X        curr = strchr( curr, '~');
  2844. X    }
  2845. X}
  2846. END_OF_FILE
  2847. if test 1605 -ne `wc -c <'misc.c'`; then
  2848.     echo shar: \"'misc.c'\" unpacked with wrong size!
  2849. fi
  2850. # end of 'misc.c'
  2851. fi
  2852. if test -f 'miscx.c' -a "${1}" != "-c" ; then 
  2853.   echo shar: Will not clobber existing file \"'miscx.c'\"
  2854. else
  2855. echo shar: Extracting \"'miscx.c'\" \(1735 characters\)
  2856. sed "s/^X//" >'miscx.c' <<'END_OF_FILE'
  2857. X/**********************************************************************
  2858. X * miscx.c - Misc X, Xt and Xmu related functions
  2859. X *
  2860. X * Copyright 1993, David Nedde
  2861. X *
  2862. X * Permission to use, copy, modify, and distribute this software
  2863. X * and its documentation for any purpose and without fee is granted
  2864. X * provided that the above copyright notice appears in all copies.
  2865. X * It is provided "as is" without express or implied warranty.
  2866. X **********************************************************************/
  2867. X
  2868. X/* System Headers */
  2869. X#include <X11/StringDefs.h>
  2870. X#include <X11/IntrinsicP.h>
  2871. X#include <X11/CoreP.h>
  2872. X#include <X11/Xmu/Converters.h>
  2873. X
  2874. X
  2875. X/**********************************************************************
  2876. X * setupCoverters - Setup user-defined Xt type converters.
  2877. X *
  2878. X * void setupConverters()
  2879. X *
  2880. X * Description:
  2881. X *   Sets up string to widget converter.
  2882. X **********************************************************************/
  2883. Xvoid setupConverters()
  2884. X{
  2885. X        static XtConvertArgRec parentCvtArgs[] = {
  2886. X                {XtBaseOffset, (caddr_t)XtOffset(Widget, core.parent),
  2887. X                        sizeof(Widget)}
  2888. X        };
  2889. X
  2890. X        XtAddConverter(XtRString, XtRWindow, XmuCvtStringToWidget,
  2891. X                parentCvtArgs, XtNumber(parentCvtArgs));
  2892. X}
  2893. X
  2894. X
  2895. X/**********************************************************************
  2896. X * get_toplevel - Return the toplevel widget in the widget heirarchy.
  2897. X *
  2898. X * Widget get_toplevel(Widget w)
  2899. X *
  2900. X *
  2901. X * w - Any widget in the heirarchy
  2902. X *
  2903. X **********************************************************************/
  2904. XWidget get_toplevel(w)
  2905. XWidget w;
  2906. X{
  2907. X    /* Get the toplevel shell widget to change the cursor for all windows */
  2908. X    while (!XtIsTopLevelShell( w))
  2909. X        w = XtParent( w);
  2910. X
  2911. X    return w;
  2912. X}
  2913. END_OF_FILE
  2914. if test 1735 -ne `wc -c <'miscx.c'`; then
  2915.     echo shar: \"'miscx.c'\" unpacked with wrong size!
  2916. fi
  2917. # end of 'miscx.c'
  2918. fi
  2919. if test -f 'help.h' -a "${1}" != "-c" ; then 
  2920.   echo shar: Will not clobber existing file \"'help.h'\"
  2921. else
  2922. echo shar: Extracting \"'help.h'\" \(805 characters\)
  2923. sed "s/^X//" >'help.h' <<'END_OF_FILE'
  2924. X/**********************************************************************
  2925. X * file - description
  2926. X *
  2927. X * Copyright 1993, David Nedde
  2928. X *
  2929. X * Permission to use, copy, modify, and distribute this software
  2930. X * and its documentation for any purpose and without fee is granted
  2931. X * provided that the above copyright notice appears in all copies.
  2932. X * It is provided "as is" without express or implied warranty.
  2933. X **********************************************************************/
  2934. X
  2935. X#ifndef __HELP_H__
  2936. X#define __HELP_H__
  2937. X
  2938. X#include <X11/Intrinsic.h>
  2939. X
  2940. Xtypedef struct {
  2941. X    Widget toplevel;
  2942. X    Widget dialog_w;
  2943. X    Widget text_w;
  2944. X} help_struct_type, *help_type;
  2945. X
  2946. X
  2947. X/* Public methods */
  2948. Xhelp_type help__create(/*w*/);
  2949. Xvoid      help__destroy(/*help*/);
  2950. Xvoid      help__display_mcb(/*w, help, call_data, extra*/);
  2951. X
  2952. X
  2953. X#endif
  2954. X
  2955. X
  2956. END_OF_FILE
  2957. if test 805 -ne `wc -c <'help.h'`; then
  2958.     echo shar: \"'help.h'\" unpacked with wrong size!
  2959. fi
  2960. # end of 'help.h'
  2961. fi
  2962. echo shar: End of archive 2 \(of 5\).
  2963. cp /dev/null ark2isdone
  2964. MISSING=""
  2965. for I in 1 2 3 4 5 ; do
  2966.     if test ! -f ark${I}isdone ; then
  2967.     MISSING="${MISSING} ${I}"
  2968.     fi
  2969. done
  2970. if test "${MISSING}" = "" ; then
  2971.     echo You have unpacked all 5 archives.
  2972.     rm -f ark[1-9]isdone
  2973. else
  2974.     echo You still need to unpack the following archives:
  2975.     echo "        " ${MISSING}
  2976. fi
  2977. ##  End of shell archive.
  2978. exit 0
  2979.  
  2980. exit 0 # Just in case...
  2981. -- 
  2982.   // chris@IMD.Sterling.COM       | Send comp.sources.x submissions to:
  2983. \X/  Amiga - The only way to fly! |    sources-x@imd.sterling.com
  2984.  "It's intuitively obvious to the |
  2985.   most casual observer..."        | GCS d+/-- p+ c++ l+ m+ s++/+ g+ w+ t+ r+ x+
  2986.