home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / x / volume18 / wclock / part01 < prev    next >
Encoding:
Text File  |  1992-07-12  |  50.5 KB  |  1,671 lines

  1. Newsgroups: comp.sources.x
  2. Path: uunet!zaphod.mps.ohio-state.edu!mips!msi!dcmartin
  3. From: R.Caley@ed.ac.uk (Richard Caley)
  4. Subject: v18i011: Wclock - another X clock, Part01/04
  5. Message-ID: <csx-18i011-wclock@uunet.UU.NET>
  6. Originator: dcmartin@fascet
  7. Sender: dcmartin@msi.com (David C. Martin - Moderator)
  8. Organization: Molecular Simulations, Inc.
  9. Date: Mon, 13 Jul 1992 15:33:48 GMT
  10. Approved: dcmartin@msi.com
  11. Lines: 1658
  12.  
  13. Submitted-by: R.Caley@ed.ac.uk (Richard Caley)
  14. Posting-number: Volume 18, Issue 11
  15. Archive-name: wclock/part01
  16.  
  17. From the README:
  18.  
  19. Yes, yet another X clock.
  20.  
  21. Wclock's distinguishing feature is that it uses a rather unusual method
  22. to indicate the current time -- hands are so old fashioned don't you
  23. think. It is perhaps more useful as a conversation piece than as a time
  24. piece. I, being strange, actually do use it.
  25.  
  26. There are three sets of defaults in the application defaults file,
  27. the two non-default sets are named roseClock and eyeClock
  28.  
  29. #!/bin/sh
  30. # This is a shell archive (produced by shar 3.50)
  31. # To extract the files from this archive, save it to a file, remove
  32. # everything above the "!/bin/sh" line above, and type "sh file_name".
  33. #
  34. # made 07/13/1992 15:29 UTC by dcmartin@fascet
  35. # Source directory /home/fascet/dcmartin/csx/src/tmp
  36. #
  37. # existing files will NOT be overwritten unless -c is specified
  38. #
  39. # This is part 1 of a multipart archive                                    
  40. # do not concatenate these parts, unpack them in order with /bin/sh        
  41. #
  42. # This shar contains:
  43. # length  mode       name
  44. # ------ ---------- ------------------------------------------
  45. #    273 -r--r--r-- Imakefile
  46. #   1219 -rw-rw-rw- Makefile.std
  47. #   3285 -r--r--r-- Outline.c
  48. #   1680 -r--r--r-- Outline.h
  49. #   1733 -r--r--r-- OutlineP.h
  50. #   1557 -r--r--r-- README
  51. #   1472 -r--r--r-- Wclock.ad
  52. #  21042 -r--r--r-- Wclock.c
  53. #   4180 -r--r--r-- Wclock.h
  54. #   3038 -r--r--r-- WclockP.h
  55. #  11829 -r--r--r-- eye.mask
  56. #  11829 -r--r--r-- eye.mask1
  57. #  11829 -r--r--r-- eye.xbm
  58. #     51 -r--r--r-- patchlevel.h
  59. #  41150 -r--r--r-- rose.mask
  60. #  41150 -r--r--r-- rose.xbm
  61. #   5723 -r--r--r-- wclock.c
  62. #   5949 -r--r--r-- wclock.man
  63. #   1615 -r--r--r-- wclock.mask
  64. #   1590 -r--r--r-- wclock.xbm
  65. #
  66. if test -r _shar_seq_.tmp; then
  67.     echo 'Must unpack archives in sequence!'
  68.     echo Please unpack part `cat _shar_seq_.tmp` next
  69.     exit 1
  70. fi
  71. # ============= Imakefile ==============
  72. if test -f 'Imakefile' -a X"$1" != X"-c"; then
  73.     echo 'x - skipping Imakefile (File already exists)'
  74.     rm -f _shar_wnt_.tmp
  75. else
  76. > _shar_wnt_.tmp
  77. echo 'x - extracting Imakefile (Text)'
  78. sed 's/^X//' << 'SHAR_EOF' > 'Imakefile' &&
  79. X  SYS_LIBRARIES = -lm
  80. X        DEPLIBS = XawClientDepLibs
  81. LOCAL_LIBRARIES = XawClientLibs
  82. X        DEFINES = ExtensionDefines
  83. X    CDEBUGFLAGS = -O
  84. X
  85. SRCS=  wclock.c Wclock.c Outline.c
  86. OBJS=  wclock.o Wclock.o Outline.o
  87. X
  88. ComplexProgramTarget(wclock)
  89. InstallAppDefaults(Wclock)
  90. SHAR_EOF
  91. chmod 0444 Imakefile ||
  92. echo 'restore of Imakefile failed'
  93. Wc_c="`wc -c < 'Imakefile'`"
  94. test 273 -eq "$Wc_c" ||
  95.     echo 'Imakefile: original size 273, current size' "$Wc_c"
  96. rm -f _shar_wnt_.tmp
  97. fi
  98. # ============= Makefile.std ==============
  99. if test -f 'Makefile.std' -a X"$1" != X"-c"; then
  100.     echo 'x - skipping Makefile.std (File already exists)'
  101.     rm -f _shar_wnt_.tmp
  102. else
  103. > _shar_wnt_.tmp
  104. echo 'x - extracting Makefile.std (Text)'
  105. sed 's/^X//' << 'SHAR_EOF' > 'Makefile.std' &&
  106. X
  107. X ######################################################################
  108. X #                                                                    #
  109. X # Boring Makefile for wclock.                                        #
  110. X #                                                                    #
  111. X ######################################################################
  112. X
  113. WCLOCK=wclock
  114. X
  115. # places to put things. 
  116. X
  117. BINDIR=/usr/local/bin/X11
  118. MANDIR=/usr/man
  119. MANSEC=l
  120. X
  121. WCLOCK_SRC=wclock.c Wclock.c Outline.c
  122. WCLOCK_OBJ=$(WCLOCK_SRC:.c=.o)
  123. X
  124. LIBS= -lXaw -lXmu -lXt -lXext -lX11 -lm
  125. X
  126. # places to look for X things
  127. X
  128. INCLUDE_DIRS= -I/usr/local/include
  129. LIB_DIRS=
  130. X
  131. DEFINES=-DSHAPE
  132. CDEBUGFLAGS=-O
  133. X
  134. CFLAGS= $(CDEBUGFLAGS) $(DEFINES) $(INCLUDE_DIRS) $(LIB_DIRS)
  135. X
  136. wclock: $(WCLOCK_OBJ)
  137. X    $(CC) $(CFLAGS) -o wclock $(WCLOCK_OBJ) $(LIBS)
  138. X
  139. Outline.o : Outline.c OutlineP.h Outline.h
  140. Wclock.o : Wclock.c WclockP.h Wclock.h Outline.h /usr/include/math.h
  141. wclock.o : wclock.c Wclock.h Outline.h patchlevel.h wclock.xbm wclock.mask
  142. X
  143. install: wclock wclock.man
  144. X    install -s -m755 wclock $(BINDIR)
  145. X    install -m644 wclock.man $(MANDIR)/man$(MANSEC)/wclock.$(MANSEC)
  146. X
  147. clean:
  148. X    rm -f $(WCLOCK_OBJ) $(WCLOCK)
  149. X
  150. lint:
  151. X    $(LINT) $(DEFINES) $(INCLUDES) $(WCLOCK_SRC)
  152. SHAR_EOF
  153. chmod 0666 Makefile.std ||
  154. echo 'restore of Makefile.std failed'
  155. Wc_c="`wc -c < 'Makefile.std'`"
  156. test 1219 -eq "$Wc_c" ||
  157.     echo 'Makefile.std: original size 1219, current size' "$Wc_c"
  158. rm -f _shar_wnt_.tmp
  159. fi
  160. # ============= Outline.c ==============
  161. if test -f 'Outline.c' -a X"$1" != X"-c"; then
  162.     echo 'x - skipping Outline.c (File already exists)'
  163.     rm -f _shar_wnt_.tmp
  164. else
  165. > _shar_wnt_.tmp
  166. echo 'x - extracting Outline.c (Text)'
  167. sed 's/^X//' << 'SHAR_EOF' > 'Outline.c' &&
  168. X
  169. /*
  170. X * This file hacked from Weekday.c in the xdiary distribution by RJC.
  171. X */
  172. X
  173. /*
  174. X * Original author: Jason Baietto, jason@ssd.csd.harris.com
  175. X *
  176. X * Permission to use, copy, modify, and distribute, this software and its
  177. X * documentation for any purpose is hereby granted without fee, provided that
  178. X * the above copyright notice appear in all copies and that both that
  179. X * copyright notice and this permission notice appear in supporting
  180. X * documentation, and that the name of the copyright holder be used in
  181. X * advertising or publicity pertaining to distribution of the software with
  182. X * specific, written prior permission, and that no fee is charged for further
  183. X * distribution of this software, or any modifications thereof.  The copyright
  184. X * holder makes no representations about the suitability of this software for
  185. X * any purpose.  It is provided "as is" without express or implied warranty.
  186. X *
  187. X * THE COPYRIGHT HOLDER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  188. X * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, AND IN NO
  189. X * EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  190. X * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM ITS USE,
  191. X * LOSS OF DATA, PROFITS, QPA OR GPA, WHETHER IN AN ACTION OF CONTRACT,
  192. X * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
  193. X * THE USE OR PERFORMANCE OF THIS SOFTWARE.
  194. X */
  195. X
  196. #include <stdio.h>
  197. #include <ctype.h>
  198. #include <X11/StringDefs.h>
  199. #include <X11/IntrinsicP.h>
  200. #include "OutlineP.h"
  201. X
  202. #define MAX_STRING_LEN 256
  203. X
  204. /*==========================================================================*/
  205. /*                                 Quarks:                                  */
  206. /*==========================================================================*/
  207. XXrmQuark XtQNoOutline;
  208. XXrmQuark XtQBitmap;
  209. XXrmQuark XtQCircle;
  210. X
  211. X
  212. /*==========================================================================*/
  213. /*                         Outline Type Converter:                          */
  214. /*==========================================================================*/
  215. static void downcase_string(source, dest)
  216. char * source;
  217. char * dest;
  218. {
  219. X   for (; *source != 0; source++, dest++) {
  220. X      if ( isupper(*source) )
  221. X      *dest = tolower(*source);
  222. X      else
  223. X      *dest = *source;
  224. X   }
  225. X   *dest = 0;
  226. }
  227. X
  228. X
  229. X
  230. /*ARGSUSED*/
  231. void OutlineConverter(args, num_args, fromVal, toVal)
  232. XXrmValuePtr args;
  233. Cardinal    *num_args;
  234. XXrmValuePtr fromVal;
  235. XXrmValuePtr toVal;
  236. {
  237. X   static int initialized = FALSE;
  238. X   static XtOutline Outline;
  239. X   XrmQuark q;
  240. X   char lowerName[MAX_STRING_LEN];
  241. X
  242. X   if (!initialized) {
  243. X      /* Create quarks the first time we're called. */
  244. X      XtQBitmap     = XrmStringToQuark(XtNbitmap);
  245. X      XtQCircle   = XrmStringToQuark(XtNcircle);
  246. X      XtQNoOutline   = XrmStringToQuark(XtNnoOutline);
  247. X   }
  248. X
  249. X   downcase_string((char*)fromVal->addr, lowerName);
  250. X   q = XrmStringToQuark(lowerName);
  251. X
  252. X   toVal->size = sizeof(XtOutline);
  253. X   toVal->addr = (XtPointer) &Outline;
  254. X
  255. X   if (q == XtQBitmap) {
  256. X      Outline = Bitmap;
  257. X   } else if (q == XtQCircle) {
  258. X      Outline = Circle;
  259. X   } else if (q == XtQNoOutline) {
  260. X      Outline = NoOutline;
  261. X   } else {
  262. X      XtStringConversionWarning(fromVal->addr, "XtROutline");
  263. X      toVal->addr = NULL;
  264. X      toVal->size = 0;
  265. X   }
  266. }
  267. X
  268. X
  269. SHAR_EOF
  270. chmod 0444 Outline.c ||
  271. echo 'restore of Outline.c failed'
  272. Wc_c="`wc -c < 'Outline.c'`"
  273. test 3285 -eq "$Wc_c" ||
  274.     echo 'Outline.c: original size 3285, current size' "$Wc_c"
  275. rm -f _shar_wnt_.tmp
  276. fi
  277. # ============= Outline.h ==============
  278. if test -f 'Outline.h' -a X"$1" != X"-c"; then
  279.     echo 'x - skipping Outline.h (File already exists)'
  280.     rm -f _shar_wnt_.tmp
  281. else
  282. > _shar_wnt_.tmp
  283. echo 'x - extracting Outline.h (Text)'
  284. sed 's/^X//' << 'SHAR_EOF' > 'Outline.h' &&
  285. /*
  286. X * This file hacked from Weekday.c in the xdiary distribution by RJC.
  287. X */
  288. X
  289. /*
  290. X * Original author: Jason Baietto, jason@ssd.csd.harris.com
  291. X * xdiary Copyright 1990 Harris Computer Systems Division
  292. X *
  293. X * Permission to use, copy, modify, and distribute, this software and its
  294. X * documentation for any purpose is hereby granted without fee, provided that
  295. X * the above copyright notice appear in all copies and that both that
  296. X * copyright notice and this permission notice appear in supporting
  297. X * documentation, and that the name of the copyright holder be used in
  298. X * advertising or publicity pertaining to distribution of the software with
  299. X * specific, written prior permission, and that no fee is charged for further
  300. X * distribution of this software, or any modifications thereof.  The copyright
  301. X * holder makes no representations about the suitability of this software for
  302. X * any purpose.  It is provided "as is" without express or implied warranty.
  303. X *
  304. X * THE COPYRIGHT HOLDER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  305. X * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, AND IN NO
  306. X * EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  307. X * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM ITS USE,
  308. X * LOSS OF DATA, PROFITS, QPA OR GPA, WHETHER IN AN ACTION OF CONTRACT,
  309. X * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
  310. X * THE USE OR PERFORMANCE OF THIS SOFTWARE.
  311. X */
  312. X
  313. #ifndef _OutlineConverter_h
  314. #define _OutlineConverter_h
  315. X
  316. extern void OutlineConverter();
  317. X
  318. #define XtROutline "Outline"
  319. X
  320. typedef enum {
  321. X    NoOutline,
  322. X    Bitmap,
  323. X    Circle,
  324. } XtOutline;
  325. X
  326. #endif /* _OutlineConverter_h */
  327. SHAR_EOF
  328. chmod 0444 Outline.h ||
  329. echo 'restore of Outline.h failed'
  330. Wc_c="`wc -c < 'Outline.h'`"
  331. test 1680 -eq "$Wc_c" ||
  332.     echo 'Outline.h: original size 1680, current size' "$Wc_c"
  333. rm -f _shar_wnt_.tmp
  334. fi
  335. # ============= OutlineP.h ==============
  336. if test -f 'OutlineP.h' -a X"$1" != X"-c"; then
  337.     echo 'x - skipping OutlineP.h (File already exists)'
  338.     rm -f _shar_wnt_.tmp
  339. else
  340. > _shar_wnt_.tmp
  341. echo 'x - extracting OutlineP.h (Text)'
  342. sed 's/^X//' << 'SHAR_EOF' > 'OutlineP.h' &&
  343. /*
  344. X * This file hacked from Weekday.c in the xdiary distribution by RJC.
  345. X */
  346. X
  347. /*
  348. X * Original author: Jason Baietto, jason@ssd.csd.harris.com
  349. X * xdiary Copyright 1990 Harris Corporation
  350. X *
  351. X * Permission to use, copy, modify, and distribute, this software and its
  352. X * documentation for any purpose is hereby granted without fee, provided that
  353. X * the above copyright notice appear in all copies and that both that
  354. X * copyright notice and this permission notice appear in supporting
  355. X * documentation, and that the name of the copyright holder be used in
  356. X * advertising or publicity pertaining to distribution of the software with
  357. X * specific, written prior permission, and that no fee is charged for further
  358. X * distribution of this software, or any modifications thereof.  The copyright
  359. X * holder makes no representations about the suitability of this software for
  360. X * any purpose.  It is provided "as is" without express or implied warranty.
  361. X *
  362. X * THE COPYRIGHT HOLDER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  363. X * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, AND IN NO
  364. X * EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  365. X * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM ITS USE,
  366. X * LOSS OF DATA, PROFITS, QPA OR GPA, WHETHER IN AN ACTION OF CONTRACT,
  367. X * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
  368. X * THE USE OR PERFORMANCE OF THIS SOFTWARE.
  369. X */
  370. X
  371. #ifndef _OutlineConverterP_h
  372. #define _OutlineConverterP_h
  373. X
  374. #include "Outline.h"
  375. X
  376. #define XtNbitmap    "bitmap"
  377. #define XtNcircle    "circle"
  378. #define XtNnoOutline "none"
  379. X
  380. extern XrmQuark XtQBitmap;
  381. extern XrmQuark XtQCircle;
  382. extern XrmQuark XtQNoOutline;
  383. X
  384. #endif /* _OutlineConverter_h */
  385. SHAR_EOF
  386. chmod 0444 OutlineP.h ||
  387. echo 'restore of OutlineP.h failed'
  388. Wc_c="`wc -c < 'OutlineP.h'`"
  389. test 1733 -eq "$Wc_c" ||
  390.     echo 'OutlineP.h: original size 1733, current size' "$Wc_c"
  391. rm -f _shar_wnt_.tmp
  392. fi
  393. # ============= README ==============
  394. if test -f 'README' -a X"$1" != X"-c"; then
  395.     echo 'x - skipping README (File already exists)'
  396.     rm -f _shar_wnt_.tmp
  397. else
  398. > _shar_wnt_.tmp
  399. echo 'x - extracting README (Text)'
  400. sed 's/^X//' << 'SHAR_EOF' > 'README' &&
  401. X
  402. Yes, yet another X clock.
  403. X
  404. Wclock's distinguishing feature is that it uses a rather unusual method
  405. to indicate the current time -- hands are so old fashioned don't you
  406. think. It is perhaps more useful as a conversation piece than as a time
  407. piece. I, being strange, actually do use it.
  408. X
  409. There are three sets of defaults in the application defaults file,
  410. the two non-default sets are named roseClock and eyeClock
  411. X
  412. It should work as is.  Just make it and install the defaults (or stick
  413. them in your Xdefaults). The more interesting behaviour depends on the
  414. MIT Shape extension, so if you haven't got that you will be stuck with
  415. a boring clock. It is a good idea to make sure your window manager
  416. doesn't decorate the clock as this (a) spoils the effect and (b)
  417. causes the WM (well, tvtwm at least) to get very frustrated
  418. redecorating when the clock reshapes itself.
  419. X
  420. Start it as
  421. X    wclock -debug 60 -update 5
  422. X
  423. to get it to run fast so you can get the idea of what it does. Then
  424. try
  425. X
  426. X    wclock -name roseClock -debug 60 -update 5
  427. X
  428. and
  429. X
  430. X    wclock -name eyeClock -debug 60 -update 5
  431. X
  432. to see what else is possible.
  433. X
  434. Having read and taken to heart Henry Spencer's advice on not reinventing
  435. wheels, I produced wclock by cannibalising bits of xclock, xcal and
  436. xbiff. Kudos to those who did the hard bits (see manual page).
  437. X
  438. Many thanks to whoever originally scanned the images, unfortunately I
  439. have had them for a while and don't know who originally did them.  The
  440. eye belongs to Kate Bush, in case you're interested. 
  441. X
  442. X    - Richard Caley
  443. X
  444. --
  445. R.Caley@ed.ac.uk            _O_
  446. X                     |<
  447. SHAR_EOF
  448. chmod 0444 README ||
  449. echo 'restore of README failed'
  450. Wc_c="`wc -c < 'README'`"
  451. test 1557 -eq "$Wc_c" ||
  452.     echo 'README: original size 1557, current size' "$Wc_c"
  453. rm -f _shar_wnt_.tmp
  454. fi
  455. # ============= Wclock.ad ==============
  456. if test -f 'Wclock.ad' -a X"$1" != X"-c"; then
  457.     echo 'x - skipping Wclock.ad (File already exists)'
  458.     rm -f _shar_wnt_.tmp
  459. else
  460. > _shar_wnt_.tmp
  461. echo 'x - extracting Wclock.ad (Text)'
  462. sed 's/^X//' << 'SHAR_EOF' > 'Wclock.ad' &&
  463. X
  464. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  465. !                                                                    !
  466. ! Application defaults for wclock. There are three sets of defaults  !
  467. ! here so that three types of clock can be selected by naming the    !
  468. ! instance of wclock.                                                !
  469. !                                                                    !
  470. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  471. X
  472. X
  473. ! First a clock which displays as a picture of a rose.
  474. X
  475. roseClock*input: false
  476. roseClock*debugInc: 0
  477. roseClock*update: 60
  478. X
  479. roseClock*externalOutline: Bitmap
  480. roseClock*internalOutline: None
  481. X
  482. roseClock*externalBitmap: rose.mask
  483. roseClock*backgroundBitmap: rose.xbm
  484. X
  485. roseClock*forceShape: true
  486. roseClock*plotSegment: false
  487. roseClock*shapeSegment: true
  488. X
  489. roseClock*sliceWidth: 0
  490. roseClock*sliceSpace: 60
  491. X
  492. ! Similarly an eye.
  493. X
  494. eyeClock*input: false
  495. eyeClock*debugInc: 0
  496. eyeClock*update: 60
  497. X
  498. eyeClock*externalOutline: Bitmap
  499. eyeClock*internalOutline: None
  500. X
  501. eyeClock*externalBitmap: eye.mask
  502. eyeClock*backgroundBitmap: eye.xbm
  503. X
  504. eyeClock*forceShape: true
  505. eyeClock*plotSegment: false
  506. eyeClock*shapeSegment: true
  507. X
  508. eyeClock*sliceWidth: 0
  509. eyeClock*sliceSpace: 60
  510. X
  511. ! finally the default stripy wheel.
  512. X
  513. *input: false
  514. *debugInc: 0
  515. *update: 60
  516. X
  517. *externalOutline: Circle
  518. *internalOutline: Circle
  519. X
  520. *forceShape: true
  521. *plotSegment: false
  522. *shapeSegment: true
  523. X
  524. *sliceWidth: 30
  525. *sliceSpace: 60
  526. X
  527. X
  528. SHAR_EOF
  529. chmod 0444 Wclock.ad ||
  530. echo 'restore of Wclock.ad failed'
  531. Wc_c="`wc -c < 'Wclock.ad'`"
  532. test 1472 -eq "$Wc_c" ||
  533.     echo 'Wclock.ad: original size 1472, current size' "$Wc_c"
  534. rm -f _shar_wnt_.tmp
  535. fi
  536. # ============= Wclock.c ==============
  537. if test -f 'Wclock.c' -a X"$1" != X"-c"; then
  538.     echo 'x - skipping Wclock.c (File already exists)'
  539.     rm -f _shar_wnt_.tmp
  540. else
  541. > _shar_wnt_.tmp
  542. echo 'x - extracting Wclock.c (Text)'
  543. sed 's/^X//' << 'SHAR_EOF' > 'Wclock.c' &&
  544. #ifndef lint
  545. static char Xrcsid[] = "$XConsortium: Wclock.c,v 1.50 89/12/06 15:23:24 kit Exp $";
  546. #endif /* lint */
  547. X
  548. /*
  549. X * Hacked from Clock.c by RJC
  550. X *
  551. X * the code to shape the parent shell was pinched from xbiff.
  552. X */
  553. X
  554. X
  555. /***********************************************************
  556. Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts,
  557. and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
  558. X
  559. X                        All Rights Reserved
  560. X
  561. Permission to use, copy, modify, and distribute this software and its 
  562. documentation for any purpose and without fee is hereby granted, 
  563. provided that the above copyright notice appear in all copies and that
  564. both that copyright notice and this permission notice appear in 
  565. supporting documentation, and that the names of Digital or MIT not be
  566. used in advertising or publicity pertaining to distribution of the
  567. software without specific, written prior permission.  
  568. X
  569. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  570. ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  571. DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  572. ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  573. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  574. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  575. SOFTWARE.
  576. X
  577. ******************************************************************/
  578. X
  579. #include <X11/Xlib.h>
  580. #include <X11/StringDefs.h>
  581. #include <X11/IntrinsicP.h>
  582. #include <X11/Xaw/XawInit.h>
  583. #include "WclockP.h"
  584. #include "Outline.h"
  585. #include "math.h"
  586. #ifdef SHAPE
  587. #include <X11/extensions/shape.h>
  588. #endif
  589. X
  590. extern long time();
  591. static void Wclock_tic(), draw_segment();
  592. X    
  593. /* Private Definitions */
  594. X
  595. #define PI            3.14159265358979
  596. #define TWOPI            (2. * PI)
  597. #define EPSILON         (0.00001)
  598. #define CONVERT_A(A)        ((3.0 * PI / 2.0) + (A))
  599. X
  600. #define WCLOCK_SIZE_DEFAULT (150)
  601. X
  602. #define max(a, b) ((a) > (b) ? (a) : (b))
  603. #define min(a, b) ((a) < (b) ? (a) : (b))
  604. #define abs(a) ((a) < 0 ? -(a) : (a))
  605. X
  606. X
  607. /* Initialization of defaults */
  608. X
  609. #define offset(field) XtOffset(WclockWidget,Wclock.field)
  610. #define goffset(field) XtOffset(Widget,core.field)
  611. X
  612. static Pixmap nopix = None;
  613. X
  614. static XtResource resources[] = {
  615. X    {XtNwidth, XtCWidth, XtRDimension, sizeof(Dimension),
  616. X    goffset(width), XtRImmediate, (caddr_t) 0},
  617. X    {XtNheight, XtCHeight, XtRDimension, sizeof(Dimension),
  618. X    goffset(height), XtRImmediate, (caddr_t) 0},
  619. X    {XtNbackground, XtCBackground, XtRPixel, sizeof(Pixel),
  620. X    goffset(background_pixel), XtRString, "XtdefaultBackground"},
  621. X    {XtNupdate, XtCInterval, XtRInt, sizeof(int), 
  622. X        offset(update), XtRImmediate, (caddr_t) 60 },
  623. X    {XtNdebugInc, XtCInterval, XtRInt, sizeof(int), 
  624. X        offset(debugInc), XtRImmediate, (caddr_t) 0 },
  625. X    {XtNforeground, XtCForeground, XtRPixel, sizeof(Pixel),
  626. X        offset(fgpixel), XtRString, "XtdefaultForeground"},
  627. X    {XtNbackingStore, XtCBackingStore, XtRBackingStore, sizeof (int),
  628. X        offset (backing_store), XtRString, "default"},
  629. X    {XtNinternalOutline, XtCOutline, XtROutline, sizeof(int),
  630. X     offset (internalOutline), XtRString, "None"},
  631. X    {XtNinternalPercent, XtCMargin, XtRInt, sizeof(int),
  632. X     offset (internalPercent), XtRImmediate, (caddr_t) 80 },
  633. X    {XtNinternalBitmap, XtCMask, XtRBitmap, sizeof(Pixmap),
  634. X     offset (internalBitmap), XtRBitmap, (caddr_t) &nopix },
  635. X    {XtNexternalOutline, XtCOutline, XtROutline, sizeof(int),
  636. X     offset (externalOutline), XtRString, "None"},
  637. X    {XtNexternalPercent, XtCMargin, XtRInt, sizeof(int),
  638. X     offset (externalPercent), XtRImmediate, (caddr_t) 100 },
  639. X    {XtNexternalBitmap, XtCMask, XtRBitmap, sizeof(Pixmap),
  640. X     offset (externalBitmap), XtRBitmap, (caddr_t) &nopix },
  641. X    {XtNforceShape, XtCForceShape, XtRBoolean, sizeof(Boolean),
  642. X        offset (forceShape), XtRImmediate, (caddr_t)False },
  643. X    {XtNplotSegment, XtCPlotSegment, XtRBoolean, sizeof(Boolean),
  644. X        offset (plotSegment), XtRImmediate, (caddr_t)True },
  645. X    {XtNshapeSegment, XtCShapeSegment, XtRBoolean, sizeof(Boolean),
  646. X        offset (shapeSegment), XtRImmediate, (caddr_t)False },
  647. X    {XtNbackgroundBitmap, XtCBitmap, XtRBitmap, sizeof(Pixmap),
  648. X     offset (backgroundBitmap), XtRBitmap, (caddr_t) &nopix },
  649. X    {XtNsliceOffset, XtCSlice, XtRInt, sizeof(int),
  650. X     offset (sliceOffset), XtRImmediate, (caddr_t) 0 },
  651. X    {XtNsliceSpace, XtCSlice, XtRInt, sizeof(int),
  652. X     offset (sliceSpace), XtRImmediate, (caddr_t) 300 },
  653. X    {XtNsliceWidth, XtCSlice, XtRInt, sizeof(int),
  654. X     offset (sliceWidth), XtRImmediate, (caddr_t) 0 },
  655. };
  656. X
  657. #undef offset
  658. #undef goffset
  659. X
  660. static void ClassInitialize();
  661. static void Initialize(), Realize(), Destroy(), Resize(), Redisplay();
  662. static Boolean SetValues();
  663. X
  664. WclockClassRec wclockClassRec = {
  665. X    { /* core fields */
  666. X    /* superclass        */    &widgetClassRec,
  667. X    /* class_name        */    "Wclock",
  668. X    /* widget_size        */    sizeof(WclockRec),
  669. X    /* class_initialize        */    ClassInitialize,
  670. X    /* class_part_initialize    */    NULL,
  671. X    /* class_inited        */    FALSE,
  672. X    /* initialize        */    Initialize,
  673. X    /* initialize_hook        */    NULL,
  674. X    /* realize            */    Realize,
  675. X    /* actions            */    NULL,
  676. X    /* num_actions        */    0,
  677. X    /* resources        */    resources,
  678. X    /* resource_count        */    XtNumber(resources),
  679. X    /* xrm_class        */    NULL,
  680. X    /* compress_motion        */    TRUE,
  681. X    /* compress_exposure    */    TRUE,
  682. X    /* compress_enterleave    */    TRUE,
  683. X    /* visible_interest        */    FALSE,
  684. X    /* destroy            */    Destroy,
  685. X    /* resize            */    Resize,
  686. X    /* expose            */    Redisplay,
  687. X    /* set_values        */    SetValues,
  688. X    /* set_values_hook        */    NULL,
  689. X    /* set_values_almost    */    XtInheritSetValuesAlmost,
  690. X    /* get_values_hook        */    NULL,
  691. X    /* accept_focus        */    NULL,
  692. X    /* version            */    XtVersion,
  693. X    /* callback_private        */    NULL,
  694. X    /* tm_table            */    NULL,
  695. X    /* query_geometry           */    XtInheritQueryGeometry,
  696. X    /* display_accelerator      */    XtInheritDisplayAccelerator,
  697. X    /* extension                */    NULL
  698. X    }
  699. };
  700. X
  701. WidgetClass wclockWidgetClass = (WidgetClass) &wclockClassRec;
  702. X
  703. /****************************************************************
  704. X *
  705. X * Private Procedures
  706. X *
  707. X ****************************************************************/
  708. X
  709. static void ClassInitialize()
  710. {
  711. X    XawInitializeWidgetSet();
  712. X    XtAddConverter( XtRString, XtRBackingStore, XmuCvtStringToBackingStore,
  713. X            NULL, 0 );
  714. X    XtAddConverter( XtRString, XtROutline, OutlineConverter,
  715. X            NULL, 0 );
  716. }
  717. X
  718. /* ARGSUSED */
  719. static void Initialize (request, new)
  720. X    Widget request, new;
  721. {
  722. X    WclockWidget w = (WclockWidget)new;
  723. X    Display *dpy = XtDisplay(new);
  724. X    XtGCMask        valuemask;
  725. X    XGCValues    myXGCV;
  726. X    int min_height, min_width;
  727. X
  728. X    valuemask = GCForeground | GCBackground | GCLineWidth |GCFunction;
  729. X
  730. X
  731. X    if ( w->Wclock.backgroundBitmap != None )
  732. X        {
  733. X    unsigned int width, height, bw, d;
  734. X    Window root;
  735. X    int x,y;
  736. X        XGetGeometry(dpy, w->Wclock.backgroundBitmap,
  737. X                     &root, &x, &y, &width, &height, &bw, &d);
  738. X
  739. X    min_width = width;
  740. X    min_height = height;
  741. X    }
  742. X    else
  743. X    {
  744. X    min_width = min_height = WCLOCK_SIZE_DEFAULT;
  745. X    }
  746. X
  747. X    if (w->core.width == 0)
  748. X    w->core.width = min_width;
  749. X    if (w->core.height == 0)
  750. X    w->core.height = min_height;
  751. X
  752. X    myXGCV.foreground = w->Wclock.fgpixel;
  753. X    myXGCV.background = w->core.background_pixel;
  754. X    myXGCV.function   = GXcopy;
  755. X    myXGCV.line_width = 0;
  756. X    
  757. X    w->Wclock.myGC = XtGetGC((Widget)w, valuemask, &myXGCV);
  758. X
  759. X    valuemask = GCForeground | GCLineWidth ;
  760. X    myXGCV.foreground = w->core.background_pixel;
  761. X    w->Wclock.EraseGC = XtGetGC((Widget)w, valuemask, &myXGCV);
  762. X
  763. X    w->Wclock.setGC = NULL;
  764. X
  765. X    w->Wclock.unsetGC = NULL;
  766. X
  767. X    w->Wclock.invertGC = NULL;
  768. X
  769. X    if (w->Wclock.update <= 0)
  770. X    w->Wclock.update = 60;    /* make invalid update's use a default */
  771. X    w->Wclock.interval_id = 0;
  772. X
  773. X
  774. }
  775. X
  776. static void Realize (gw, valueMask, attrs)
  777. X     Widget gw;
  778. X     XtValueMask *valueMask;
  779. X     XSetWindowAttributes *attrs;
  780. {
  781. X     WclockWidget    w = (WclockWidget) gw;
  782. X
  783. X     switch (w->Wclock.backing_store) {
  784. X     case Always:
  785. X     case NotUseful:
  786. X     case WhenMapped:
  787. X         *valueMask |=CWBackingStore;
  788. X    attrs->backing_store = w->Wclock.backing_store;
  789. X    break;
  790. X     }
  791. X     XtCreateWindow( gw, InputOutput, (Visual *)CopyFromParent,
  792. X             *valueMask, attrs);
  793. X
  794. X
  795. X     Resize(gw);
  796. }
  797. X
  798. static void Destroy (gw)
  799. X     Widget gw;
  800. {
  801. X     Display *dpy = XtDisplay(gw);
  802. X     WclockWidget w = (WclockWidget) gw;
  803. X
  804. X     if (w->Wclock.interval_id) XtRemoveTimeOut (w->Wclock.interval_id);
  805. X
  806. X     XtDestroyGC (w->Wclock.myGC);
  807. X     XtDestroyGC (w->Wclock.EraseGC);
  808. X     if (w->Wclock.setGC != NULL)
  809. X     XtDestroyGC (w->Wclock.setGC);
  810. X     if (w->Wclock.unsetGC != NULL)
  811. X     XtDestroyGC (w->Wclock.unsetGC);
  812. X     if (w->Wclock.invertGC != NULL)
  813. X     XtDestroyGC (w->Wclock.invertGC);
  814. X     XFreePixmap (dpy, w->Wclock.segmentPM);
  815. X     XFreePixmap (dpy, w->Wclock.outlinePM);
  816. }
  817. X
  818. X
  819. static void
  820. SetupBackground(w)
  821. WclockWidget w;
  822. X
  823. {
  824. Display *dpy = XtDisplay(w);
  825. Window win = XtWindow(w);
  826. Pixmap pm;
  827. unsigned int width, height, bw, d;
  828. Window root;
  829. int x,y, secs;
  830. X
  831. if ( w->Wclock.backgroundBitmap != None 
  832. X     || w->Wclock.sliceWidth != 0)
  833. X    {
  834. X    pm=XCreatePixmap(dpy, win, 
  835. X             w->core.width,
  836. X             w->core.height,
  837. X             w->core.depth);
  838. X
  839. X    XFillRectangle(dpy, pm, w->Wclock.EraseGC, 
  840. X           0,0, w->core.width, w->core.height);
  841. X
  842. X    if ( w->Wclock.backgroundBitmap != None )
  843. X    {
  844. X    XGetGeometry(dpy, w->Wclock.backgroundBitmap, 
  845. X             &root, &x, &y, &width, &height, &bw, &d);
  846. X    
  847. X    XCopyPlane(dpy, w->Wclock.backgroundBitmap, pm, w->Wclock.myGC,
  848. X           0, 0, width, height,
  849. X           (w->core.width-width)/2,
  850. X           (w->core.height - height)/2,
  851. X           1);
  852. X    }
  853. X
  854. X    if ( w->Wclock.sliceWidth != 0 )
  855. X    {
  856. X    for (secs=w->Wclock.sliceOffset; secs < 3600 ; secs +=w->Wclock.sliceSpace)
  857. X        draw_segment(dpy, pm, w->Wclock.myGC,
  858. X             w->Wclock.centerX,
  859. X             w->Wclock.centerY,
  860. X             CONVERT_A(secs * TWOPI/3600),
  861. X             CONVERT_A((secs+w->Wclock.sliceWidth) * TWOPI/3600)
  862. X             );
  863. X    }
  864. X             
  865. X
  866. X    XSetWindowBackgroundPixmap(dpy, win, pm);
  867. X    XFreePixmap(dpy, pm);
  868. X    XClearWindow(dpy, win);    /* force rewrite */
  869. X    }
  870. X
  871. X     
  872. }
  873. X
  874. static void
  875. CreateOutline(w)
  876. WclockWidget w;
  877. X
  878. {
  879. Display *dpy = XtDisplay(w);
  880. Pixmap pm = w->Wclock.outlinePM;
  881. int hb, vb;
  882. unsigned int width, height, bw, d;
  883. Window root;
  884. int x,y;
  885. X
  886. if (w->Wclock.setGC == NULL)
  887. X    {
  888. X    XGCValues myXGCV;
  889. X    XtGCMask valuemask;
  890. X
  891. X    valuemask = GCForeground | GCBackground |GCFunction;
  892. X    myXGCV.foreground = 1;
  893. X    myXGCV.background = 0;
  894. X    myXGCV.function   = GXcopy;
  895. X    w->Wclock.setGC = XCreateGC(dpy, pm, valuemask, &myXGCV);
  896. X    
  897. X    myXGCV.foreground = 0;
  898. X    myXGCV.background = 1;
  899. X    w->Wclock.unsetGC = XCreateGC(dpy, pm, valuemask, &myXGCV);
  900. X    
  901. X    
  902. X    myXGCV.function   = GXcopyInverted;
  903. X    w->Wclock.invertGC = XCreateGC(dpy, pm, valuemask, &myXGCV);
  904. X    }
  905. X
  906. switch(w->Wclock.externalOutline)
  907. X    {
  908. X case NoOutline:
  909. X
  910. X    XFillRectangle(dpy, pm, w->Wclock.setGC, 
  911. X           0,0, w->core.width, w->core.height);
  912. X    break;
  913. X
  914. X case Circle:
  915. X
  916. X    hb = (float)w->core.width * (100 - w->Wclock.externalPercent) / 200;
  917. X    vb = (float)w->core.height * (100 - w->Wclock.externalPercent) / 200;
  918. X
  919. X    XFillRectangle(dpy, pm, w->Wclock.unsetGC, 
  920. X           0,0, w->core.width, w->core.height);
  921. X    XFillArc(dpy, pm, w->Wclock.setGC,
  922. X         hb, vb,
  923. X         w->core.width-2*hb, w->core.height-2*vb,
  924. X         0, 64*360);          
  925. X    break;
  926. X
  927. X case Bitmap:
  928. X    XFillRectangle(dpy, pm, w->Wclock.unsetGC, 
  929. X           0,0, w->core.width, w->core.height);
  930. X
  931. X    if ( w->Wclock.externalBitmap == None )
  932. X    {
  933. X    printf("No bitmap give for external outline\n");
  934. X    break;
  935. X    }
  936. X
  937. X    XGetGeometry(dpy, w->Wclock.externalBitmap, 
  938. X         &root, &x, &y, &width, &height, &bw, &d);
  939. X
  940. X    x=(w->core.width-width)/2;
  941. X    y=(w->core.height-height)/2;
  942. X
  943. X    XCopyArea(dpy, w->Wclock.externalBitmap, pm, w->Wclock.setGC,
  944. X           0, 0, width, height, 
  945. X           x,y);
  946. X    break;
  947. X    }
  948. X
  949. switch(w->Wclock.internalOutline)
  950. X    {
  951. X case NoOutline:
  952. X    break;
  953. X
  954. X case Circle:
  955. X
  956. X    hb = (float)w->core.width * (100 - w->Wclock.internalPercent) / 200;
  957. X    vb = (float)w->core.height * (100 - w->Wclock.internalPercent) / 200;
  958. X
  959. X    XFillArc(dpy, pm, w->Wclock.unsetGC,
  960. X         hb, vb,
  961. X         w->core.width-2*hb, w->core.height-2*vb,
  962. X         0, 64*360);          
  963. X    break;
  964. X
  965. X case Bitmap:
  966. X    if ( w->Wclock.internalBitmap == None )
  967. X    {
  968. X    printf("No bitmap give for internal outline\n");
  969. X    break;
  970. X    }
  971. X
  972. X    XGetGeometry(dpy, w->Wclock.internalBitmap, 
  973. X         &root, &x, &y, &width, &height, &bw, &d);
  974. X
  975. X    x=(w->core.width-width)/2;
  976. X    y=(w->core.height-height)/2;
  977. X
  978. X    XCopyArea(dpy, pm, w->Wclock.internalBitmap, w->Wclock.invertGC,
  979. X           0, 0, width, height, 
  980. X           x,y);
  981. X    break;
  982. X    }
  983. X
  984. }
  985. X
  986. X
  987. static void
  988. ImposeShape(w, outline, additional)
  989. WclockWidget w;
  990. Pixmap outline, additional;
  991. X
  992. {
  993. Widget parent;
  994. Window win=XtWindow(w);
  995. int x=0, y=0;
  996. X
  997. #ifdef SHAPE
  998. X    XShapeCombineMask (XtDisplay(w), win,
  999. X               ShapeBounding, x, y, 
  1000. X               outline,
  1001. X               ShapeSet);
  1002. X
  1003. X    if (additional != NULL)
  1004. X    XShapeCombineMask (XtDisplay(w), win,
  1005. X               ShapeBounding, x, y, 
  1006. X               additional,
  1007. X               ShapeIntersect);
  1008. X
  1009. X    if ( w->Wclock.forceShape )
  1010. X    {
  1011. X    for (parent = (Widget) w; XtParent(parent);
  1012. X         parent = XtParent(parent)) 
  1013. X        {
  1014. X        x += parent->core.x + parent->core.border_width;
  1015. X        y += parent->core.y + parent->core.border_width;
  1016. X        }
  1017. X
  1018. X    XShapeCombineMask (XtDisplay(parent), XtWindow(parent),
  1019. X               ShapeBounding, x, y, 
  1020. X               outline,
  1021. X               ShapeSet);
  1022. X
  1023. X    if (additional != NULL)
  1024. X        XShapeCombineMask (XtDisplay(parent), XtWindow(parent),
  1025. X                   ShapeBounding, x, y, 
  1026. X                   additional,
  1027. X                   ShapeIntersect);
  1028. X    }
  1029. #endif
  1030. }
  1031. X
  1032. static void Resize (gw) 
  1033. X    Widget gw;
  1034. {
  1035. X    WclockWidget w = (WclockWidget) gw;
  1036. X    Display *dpy = XtDisplay(w);
  1037. X    Window win = XtWindow(w);
  1038. X
  1039. X    /* don't do this computation if window hasn't been realized yet. */
  1040. X    if (XtIsRealized(gw)) {
  1041. X    /* need signed value since Dimension is unsigned */
  1042. X
  1043. X        w->Wclock.centerX = w->core.width / 2;
  1044. X        w->Wclock.centerY = w->core.height / 2;
  1045. X
  1046. X    if (w->Wclock.segmentPM != NULL)
  1047. X        XFreePixmap (dpy, w->Wclock.segmentPM);
  1048. X
  1049. X    if (w->Wclock.outlinePM != NULL )
  1050. X        XFreePixmap (dpy, w->Wclock.outlinePM);
  1051. X
  1052. X    w->Wclock.segmentPM = XCreatePixmap(dpy, win,
  1053. X                        w->core.width,
  1054. X                        w->core.height,
  1055. X                        1);
  1056. X
  1057. X    w->Wclock.outlinePM = XCreatePixmap(dpy, win,
  1058. X                      w->core.width,
  1059. X                      w->core.height,
  1060. X                      1);
  1061. X
  1062. X    CreateOutline(w);
  1063. X    ImposeShape(w, w->Wclock.outlinePM, None);
  1064. X    SetupBackground(w);
  1065. X    w->Wclock.otm.tm_min = -1; /* force refreash */
  1066. X    }
  1067. }
  1068. X
  1069. /* ARGSUSED */
  1070. static void Redisplay (gw, event, region)
  1071. X    Widget gw;
  1072. X    XEvent *event;        /* unused */
  1073. X    Region region;        /* unused */
  1074. {
  1075. X    WclockWidget w = (WclockWidget) gw;
  1076. X
  1077. X    Wclock_tic((caddr_t)w, (XtIntervalId *)0);
  1078. }
  1079. X
  1080. /* ARGSUSED */
  1081. static void Wclock_tic(client_data, id)
  1082. X        caddr_t client_data;
  1083. X        XtIntervalId *id;
  1084. {
  1085. X        WclockWidget w = (WclockWidget)client_data;    
  1086. X    struct tm *localtime();
  1087. X    struct tm tm; 
  1088. X    long    time_value;
  1089. X        register Display *dpy = XtDisplay(w);
  1090. X        register Window win = XtWindow(w);
  1091. X
  1092. X
  1093. X    if (id || !w->Wclock.interval_id)
  1094. X        w->Wclock.interval_id =
  1095. X        XtAppAddTimeOut( XtWidgetToApplicationContext( (Widget) w),
  1096. X                w->Wclock.update*1000, 
  1097. X                Wclock_tic, (caddr_t)w );
  1098. X
  1099. X    if ( w->Wclock.debugInc == 0 )
  1100. X        {
  1101. X        (void) time(&time_value);
  1102. X        tm = *localtime(&time_value);
  1103. X        }
  1104. X    else
  1105. X        {
  1106. X        tm.tm_sec = w->Wclock.otm.tm_sec;
  1107. X        tm.tm_min = w->Wclock.otm.tm_min;
  1108. X        tm.tm_hour = w->Wclock.otm.tm_hour;
  1109. X
  1110. X        tm.tm_sec += w->Wclock.debugInc;
  1111. X
  1112. X        while (tm.tm_sec >= 60)
  1113. X        {
  1114. X        tm.tm_sec -=60;
  1115. X        tm.tm_min++;
  1116. X        }
  1117. X
  1118. X         while (tm.tm_min >= 60)
  1119. X        {
  1120. X        tm.tm_min -=60;
  1121. X        tm.tm_hour++;
  1122. X        }
  1123. X        
  1124. X        while ( tm.tm_hour > 24 )
  1125. X        tm.tm_hour -= 24;
  1126. X        }
  1127. X
  1128. X    /*
  1129. X     * 12 hour Wclock.
  1130. X     */
  1131. X    if(tm.tm_hour > 12)
  1132. X        tm.tm_hour -= 12;
  1133. X
  1134. X    
  1135. X    if (tm.tm_min != w->Wclock.otm.tm_min ||
  1136. X        tm.tm_hour != w->Wclock.otm.tm_hour) 
  1137. X        {
  1138. X        int twelvemins = tm.tm_min / 12; /* how many fifths of an hour */
  1139. X
  1140. X        /* draw the segment from the position of the hour hand
  1141. X         * to that of the minute hand plus half a second.
  1142. X         */
  1143. X
  1144. X        if (w->Wclock.shapeSegment)
  1145. X        {
  1146. X        XFillRectangle(dpy, w->Wclock.segmentPM, w->Wclock.unsetGC, 
  1147. X                   0,0, w->core.width, w->core.height);
  1148. X
  1149. X        draw_segment(dpy, w->Wclock.segmentPM, w->Wclock.setGC,
  1150. X                 w->Wclock.centerX,
  1151. X                 w->Wclock.centerY,
  1152. X                 CONVERT_A(tm.tm_hour * TWOPI/12 + twelvemins * TWOPI/60),
  1153. X                 CONVERT_A(tm.tm_min * TWOPI/60 + PI/60));
  1154. X        }
  1155. X
  1156. X        if ( w->Wclock.plotSegment )
  1157. X        {
  1158. X        XClearWindow(dpy, win);
  1159. X        draw_segment(dpy, win, w->Wclock.setGC,
  1160. X                 w->Wclock.centerX,
  1161. X                 w->Wclock.centerY,
  1162. X                 CONVERT_A(tm.tm_hour * TWOPI/12 + twelvemins * TWOPI/60),
  1163. X                 CONVERT_A(tm.tm_min * TWOPI/60 + PI/60));
  1164. X        }
  1165. X
  1166. X        if ( w->Wclock.shapeSegment )
  1167. X        ImposeShape(w, w->Wclock.segmentPM, w->Wclock.outlinePM);
  1168. X
  1169. X
  1170. X        w->Wclock.otm.tm_sec = tm.tm_sec;
  1171. X        w->Wclock.otm.tm_min = tm.tm_min;
  1172. X        w->Wclock.otm.tm_hour = tm.tm_hour;
  1173. X        }
  1174. }
  1175. X
  1176. /*
  1177. X * draw a segment in the window starting at startrad radians and
  1178. X * ending at endrad radians.
  1179. X */
  1180. X
  1181. static void
  1182. project_onto_unit_square(th, xp, yp)
  1183. X
  1184. double th;
  1185. double *xp, *yp;
  1186. X
  1187. {
  1188. if ( th < PI/4 )
  1189. X    {
  1190. X    *xp=1;
  1191. X    *yp=tan(th);
  1192. X    }
  1193. else if ( th < 3*PI/4)
  1194. X    {
  1195. X    *xp=1/tan(th);
  1196. X    *yp=1;
  1197. X    }
  1198. else if ( th < 5*PI/4)
  1199. X    {
  1200. X    *xp= -1;
  1201. X    *yp= -tan(th);
  1202. X    }
  1203. else if ( th < 7 * PI/4)
  1204. X    {
  1205. X    *xp=-1/tan(th);
  1206. X    *yp= -1;
  1207. X    }
  1208. else
  1209. X    {
  1210. X    *xp=1;
  1211. X    *yp=tan(th);
  1212. X    }
  1213. X
  1214. }
  1215. X
  1216. static void
  1217. draw_segment(dsp, dr, gc, centreX, centreY, startrad, endrad)
  1218. X
  1219. Display *dsp;
  1220. Drawable dr;
  1221. GC gc;
  1222. int centreX, centreY;
  1223. double startrad, endrad;
  1224. X
  1225. {
  1226. XXPoint segment[10];
  1227. static struct 
  1228. X    {
  1229. X    double rad;
  1230. X    short xoff;
  1231. X    short yoff;
  1232. X    } vertices[] =
  1233. X    {
  1234. X    { PI/4,      1, -1},
  1235. X    { 3*PI/4,   -1, -1},
  1236. X    { 5*PI/4,     -1,  1},
  1237. X    { 7*PI/4,      1,  1},
  1238. X    { 2*PI,      1,  0},
  1239. X    };
  1240. #define NUM_VERT (sizeof(vertices)/sizeof(*vertices))
  1241. int vertex;
  1242. int p=0;
  1243. unsigned int width, height, bw, d;
  1244. Window root;
  1245. int x,y;
  1246. double px, py;
  1247. X
  1248. while ( startrad >= TWOPI )
  1249. X    startrad -= TWOPI;
  1250. X
  1251. while ( endrad >= TWOPI )
  1252. X    endrad -= TWOPI;
  1253. X
  1254. XXGetGeometry(dsp, dr, &root, &x, &y, &width, &height, &bw, &d);
  1255. X
  1256. segment[p].x=centreX;
  1257. segment[p++].y=centreY;
  1258. X
  1259. project_onto_unit_square(startrad, &px, &py);
  1260. X
  1261. segment[p].x= centreX + px * centreX;
  1262. segment[p++].y= centreY + py * centreY;
  1263. X
  1264. for (vertex=0; vertex <NUM_VERT ; vertex++)
  1265. X    if ( startrad < vertices[vertex].rad + EPSILON)
  1266. X    break;
  1267. X
  1268. if ( endrad >= startrad )
  1269. X    {
  1270. X    for ( ; vertex < NUM_VERT ; vertex++)
  1271. X    if ( endrad + EPSILON < vertices[vertex].rad )
  1272. X        break;
  1273. X    else
  1274. X        {
  1275. X        segment[p].x = centreX + vertices[vertex].xoff * centreX;
  1276. X        segment[p++].y = centreY - vertices[vertex].yoff * centreY;
  1277. X        }
  1278. X    }
  1279. else
  1280. X    {
  1281. X    for ( ; vertex < NUM_VERT ; vertex++)
  1282. X        {
  1283. X        segment[p].x = centreX + vertices[vertex].xoff * centreX;
  1284. X        segment[p++].y = centreY - vertices[vertex].yoff * centreY;
  1285. X        }
  1286. X    for ( vertex=0; vertex < NUM_VERT ; vertex++)
  1287. X    if ( endrad + EPSILON < vertices[vertex].rad  )
  1288. X        break;
  1289. X    else
  1290. X        {
  1291. X        segment[p].x = centreX + vertices[vertex].xoff * centreX;
  1292. X        segment[p++].y = centreY - vertices[vertex].yoff * centreY;
  1293. X        }
  1294. X    }
  1295. X
  1296. project_onto_unit_square(endrad, &px, &py);
  1297. X
  1298. segment[p].x= centreX + px * centreX;
  1299. segment[p++].y= centreY + py * centreY;
  1300. X
  1301. segment[p].x=centreX;
  1302. segment[p++].y=centreY;
  1303. X
  1304. XXFillPolygon(dsp, dr, gc, segment, p, Nonconvex, CoordModeOrigin);
  1305. }
  1306. X    
  1307. /* ARGSUSED */
  1308. static Boolean SetValues (gcurrent, grequest, gnew)
  1309. X    Widget gcurrent, grequest, gnew;
  1310. {
  1311. X      WclockWidget current = (WclockWidget) gcurrent;
  1312. X      WclockWidget new = (WclockWidget) gnew;
  1313. X      Boolean redisplay = FALSE;
  1314. X      XtGCMask valuemask;
  1315. X      XGCValues    myXGCV;
  1316. X
  1317. X      /* first check for changes to Wclock-specific resources.  We'll accept all
  1318. X         the changes, but may need to do some computations first. */
  1319. X
  1320. X      if (new->Wclock.update != current->Wclock.update) {
  1321. X      if (current->Wclock.interval_id)
  1322. X          XtRemoveTimeOut (current->Wclock.interval_id);
  1323. X      if (XtIsRealized(new))
  1324. X          new->Wclock.interval_id = XtAppAddTimeOut( 
  1325. X                                         XtWidgetToApplicationContext(gnew),
  1326. X                     new->Wclock.update*1000,
  1327. X                         Wclock_tic, (caddr_t)gnew);
  1328. X
  1329. X      }
  1330. X
  1331. X
  1332. X      if ((new->Wclock.fgpixel != current->Wclock.fgpixel)
  1333. X          || (new->core.background_pixel != current->core.background_pixel)) {
  1334. X          valuemask = GCForeground | GCBackground | GCLineWidth;
  1335. X      myXGCV.foreground = new->Wclock.fgpixel;
  1336. X      myXGCV.background = new->core.background_pixel;
  1337. X      myXGCV.line_width = 0;
  1338. X      XtDestroyGC (current->Wclock.myGC);
  1339. X      new->Wclock.myGC = XtGetGC(gcurrent, valuemask, &myXGCV);
  1340. X      redisplay = TRUE;
  1341. X          }
  1342. X
  1343. X      if (new->core.background_pixel != current->core.background_pixel) {
  1344. X          valuemask = GCForeground | GCLineWidth;
  1345. X      myXGCV.foreground = new->core.background_pixel;
  1346. X      myXGCV.line_width = 0;
  1347. X      XtDestroyGC (current->Wclock.EraseGC);
  1348. X      new->Wclock.EraseGC = XtGetGC((Widget)gcurrent, valuemask, &myXGCV);
  1349. X      redisplay = TRUE;
  1350. X      }
  1351. X     
  1352. X     return (redisplay);
  1353. }
  1354. X
  1355. X
  1356. X
  1357. SHAR_EOF
  1358. chmod 0444 Wclock.c ||
  1359. echo 'restore of Wclock.c failed'
  1360. Wc_c="`wc -c < 'Wclock.c'`"
  1361. test 21042 -eq "$Wc_c" ||
  1362.     echo 'Wclock.c: original size 21042, current size' "$Wc_c"
  1363. rm -f _shar_wnt_.tmp
  1364. fi
  1365. # ============= Wclock.h ==============
  1366. if test -f 'Wclock.h' -a X"$1" != X"-c"; then
  1367.     echo 'x - skipping Wclock.h (File already exists)'
  1368.     rm -f _shar_wnt_.tmp
  1369. else
  1370. > _shar_wnt_.tmp
  1371. echo 'x - extracting Wclock.h (Text)'
  1372. sed 's/^X//' << 'SHAR_EOF' > 'Wclock.h' &&
  1373. /*
  1374. * $XConsortium: Wclock.h,v 1.28 89/07/20 14:54:38 jim Exp $
  1375. */
  1376. X
  1377. /*
  1378. X * Hacked from Clock.h by RJC
  1379. X */
  1380. X
  1381. X
  1382. /***********************************************************
  1383. Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts,
  1384. and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
  1385. X
  1386. X                        All Rights Reserved
  1387. X
  1388. Permission to use, copy, modify, and distribute this software and its 
  1389. documentation for any purpose and without fee is hereby granted, 
  1390. provided that the above copyright notice appear in all copies and that
  1391. both that copyright notice and this permission notice appear in 
  1392. supporting documentation, and that the names of Digital or MIT not be
  1393. used in advertising or publicity pertaining to distribution of the
  1394. software without specific, written prior permission.  
  1395. X
  1396. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  1397. ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  1398. DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  1399. ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  1400. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  1401. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  1402. SOFTWARE.
  1403. X
  1404. ******************************************************************/
  1405. X
  1406. #ifndef _XawWclock_h
  1407. #define _XawWclock_h
  1408. X
  1409. /***********************************************************************
  1410. X *
  1411. X * Wclock Widget
  1412. X *
  1413. X ***********************************************************************/
  1414. X
  1415. #include <X11/Xmu/Converters.h>
  1416. #include "Outline.h"
  1417. X
  1418. /* Parameters:
  1419. X
  1420. X Name             Class        RepType        Default Value
  1421. X ----             -----        -------        -------------
  1422. X background         Background        Pixel        white
  1423. X backgroundBitmap    Pixmap             Bitmap          None
  1424. X backingStore         BackingStore    BackingStore    default
  1425. X border             BorderColor    Pixel        Black
  1426. X borderWidth         BorderWidth    Dimension    1
  1427. X debugInc         DebugInc        int        0
  1428. X destroyCallback     Callback        Pointer        NULL
  1429. X forceShape          forceShape         Boolean         False
  1430. X foreground         Foreground        Pixel        black
  1431. X height             Height        Dimension    164
  1432. X internalOutline     Outline            Outline         NoOutline
  1433. X internalPercent     Margin             int             20
  1434. X internalBitmap      Pixmap             Bitmap          None
  1435. X externalOutline     Outline            Outline         NoOutline
  1436. X externalPercent     Margin             int             20
  1437. X externalBitmap      Mask               Bitmap          None
  1438. X mappedWhenManaged   MappedWhenManaged    Boolean        True
  1439. X padding         Margin        int        8
  1440. X plotSegment         PlotSegment        Boolean         True
  1441. X shapeSegment        ShapeSegment       Boolean         False
  1442. X sliceOffset         Slice              int             0
  1443. X sliceSpace          Slice              int             0
  1444. X sliceWidth          Slice              int             0
  1445. X update             Interval        int        60 (seconds)
  1446. X width             Width        Dimension    164
  1447. X x             Position        Position    0
  1448. X y             Position        Position    0
  1449. X
  1450. */
  1451. X
  1452. /* Resource names used to the Wclock widget */
  1453. X
  1454. #define XtNdebugInc "debugInc"
  1455. #define XtNinternalOutline "internalOutline"
  1456. #define XtNinternalPercent "internalPercent"
  1457. #define XtNinternalBitmap  "internalBitmap"
  1458. #define XtNexternalOutline "externalOutline"
  1459. #define XtNexternalPercent "externalPercent"
  1460. #define XtNexternalBitmap  "externalBitmap"
  1461. #define XtNforceShape      "forceShape"
  1462. #define XtNplotSegment     "plotSegment"
  1463. #define XtNshapeSegment    "shapeSegment"
  1464. #define XtNbackgroundBitmap "backgroundBitmap"
  1465. #define XtNsliceWidth      "sliceWidth"
  1466. #define XtNsliceSpace      "sliceSpace"
  1467. #define XtNsliceOffset     "sliceOffset"
  1468. X
  1469. #define XtCOutline "Outline"
  1470. #define XtCMask    "Mask"
  1471. #define XtCForceShape "ForceShape"
  1472. #define XtCPlotSegment     "PlotSegment"
  1473. #define XtCShapeSegment    "ShapeSegment"
  1474. #define XtCSlice   "Slice"
  1475. X
  1476. typedef struct _WclockRec *WclockWidget;  /* completely defined in WclockPrivate.h */
  1477. typedef struct _WclockClassRec *WclockWidgetClass;    /* completely defined in WclockPrivate.h */
  1478. X
  1479. extern WidgetClass wclockWidgetClass;
  1480. X
  1481. #endif /* _XawWclock_h */
  1482. /* DON'T ADD STUFF AFTER THIS #endif */
  1483. SHAR_EOF
  1484. chmod 0444 Wclock.h ||
  1485. echo 'restore of Wclock.h failed'
  1486. Wc_c="`wc -c < 'Wclock.h'`"
  1487. test 4180 -eq "$Wc_c" ||
  1488.     echo 'Wclock.h: original size 4180, current size' "$Wc_c"
  1489. rm -f _shar_wnt_.tmp
  1490. fi
  1491. # ============= WclockP.h ==============
  1492. if test -f 'WclockP.h' -a X"$1" != X"-c"; then
  1493.     echo 'x - skipping WclockP.h (File already exists)'
  1494.     rm -f _shar_wnt_.tmp
  1495. else
  1496. > _shar_wnt_.tmp
  1497. echo 'x - extracting WclockP.h (Text)'
  1498. sed 's/^X//' << 'SHAR_EOF' > 'WclockP.h' &&
  1499. /*
  1500. * $XConsortium: WclockP.h,v 1.19 89/12/06 15:23:06 kit Exp $
  1501. */
  1502. X
  1503. /*
  1504. X * Hacked from ClockP.h by RJC
  1505. X */
  1506. X
  1507. X
  1508. /***********************************************************
  1509. Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts,
  1510. and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
  1511. X
  1512. X                        All Rights Reserved
  1513. X
  1514. Permission to use, copy, modify, and distribute this software and its 
  1515. documentation for any purpose and without fee is hereby granted, 
  1516. provided that the above copyright notice appear in all copies and that
  1517. both that copyright notice and this permission notice appear in 
  1518. supporting documentation, and that the names of Digital or MIT not be
  1519. used in advertising or publicity pertaining to distribution of the
  1520. software without specific, written prior permission.  
  1521. X
  1522. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  1523. ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  1524. DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  1525. ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  1526. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  1527. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  1528. SOFTWARE.
  1529. X
  1530. ******************************************************************/
  1531. X
  1532. #ifndef _XawWclockP_h
  1533. #define _XawWclockP_h
  1534. X
  1535. #include <X11/Xos.h>        /* Needed for struct tm. */
  1536. #include "Wclock.h"
  1537. #include <X11/CoreP.h>
  1538. X
  1539. /* New fields for the Wclock widget instance record */
  1540. typedef struct {
  1541. X     Pixel    fgpixel;    /* color index for text */
  1542. X     GC    myGC;        /* pointer to GraphicsContext */
  1543. X     GC    EraseGC;    /* eraser GC */
  1544. X     GC    setGC;        /* pointer to GraphicsContext */
  1545. X     GC    unsetGC;        /* pointer to GraphicsContext */
  1546. X     GC    invertGC;        /* pointer to GraphicsContext */
  1547. X     Pixmap segmentPM;    /* Holds the segment representing time */
  1548. X     Pixmap outlinePM;    /* Holds the shape pixmap */
  1549. X     int    externalOutline;
  1550. X     int    externalPercent;
  1551. X     Pixmap externalBitmap;
  1552. X     int    internalOutline;
  1553. X     int    internalPercent;
  1554. X     Pixmap internalBitmap;
  1555. X     Pixmap backgroundBitmap;
  1556. X     int    sliceWidth;
  1557. X     int    sliceSpace;
  1558. X     int    sliceOffset;
  1559. X     Boolean forceShape;
  1560. X     Boolean plotSegment;
  1561. X     Boolean shapeSegment;
  1562. /* start of graph stuff */
  1563. X     int    update;        /* update frequence */
  1564. X     int    debugInc;    /* how many seconds to add per update */
  1565. X     Dimension radius;        /* radius factor */
  1566. X     int    backing_store;    /* backing store type */
  1567. X     Position centerX;
  1568. X     Position centerY;
  1569. X     XPoint    *hour, *min;
  1570. X     struct tm  otm ;
  1571. X     XtIntervalId interval_id;
  1572. X   } WclockPart;
  1573. X
  1574. /* Full instance record declaration */
  1575. typedef struct _WclockRec {
  1576. X   CorePart core;
  1577. X   WclockPart Wclock;
  1578. X   } WclockRec;
  1579. X
  1580. /* New fields for the Wclock widget class record */
  1581. typedef struct {int dummy;} WclockClassPart;
  1582. X
  1583. /* Full class record declaration. */
  1584. typedef struct _WclockClassRec {
  1585. X   CoreClassPart core_class;
  1586. X   WclockClassPart Wclock_class;
  1587. X   } WclockClassRec;
  1588. X
  1589. /* Class pointer. */
  1590. extern WclockClassRec wclockClassRec;
  1591. X
  1592. #endif /* _XawWclockP_h */
  1593. SHAR_EOF
  1594. chmod 0444 WclockP.h ||
  1595. echo 'restore of WclockP.h failed'
  1596. Wc_c="`wc -c < 'WclockP.h'`"
  1597. test 3038 -eq "$Wc_c" ||
  1598.     echo 'WclockP.h: original size 3038, current size' "$Wc_c"
  1599. rm -f _shar_wnt_.tmp
  1600. fi
  1601. # ============= eye.mask ==============
  1602. if test -f 'eye.mask' -a X"$1" != X"-c"; then
  1603.     echo 'x - skipping eye.mask (File already exists)'
  1604.     rm -f _shar_wnt_.tmp
  1605. else
  1606. > _shar_wnt_.tmp
  1607. echo 'x - extracting eye.mask (Text)'
  1608. sed 's/^X//' << 'SHAR_EOF' > 'eye.mask' &&
  1609. #define eye_width 146
  1610. #define eye_height 99
  1611. static char eye_bits[] = {
  1612. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1613. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1614. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1615. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00,
  1616. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1617. X   0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1618. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04,
  1619. X   0x20, 0x22, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1620. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
  1621. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1622. X   0x00, 0x02, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1623. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x48, 0x88, 0x00, 0x00,
  1624. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1625. X   0x00, 0x02, 0x40, 0x00, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1626. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x10, 0x09, 0x52, 0x40,
  1627. X   0x80, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1628. X   0x00, 0x00, 0x00, 0x00, 0xa0, 0x04, 0xff, 0x0f, 0x00, 0x01, 0x00, 0x00,
  1629. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x81, 0x20, 0x09,
  1630. X   0xfd, 0xff, 0x7f, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1631. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x82, 0xf4, 0xff, 0xff, 0xff, 0x21, 0x00,
  1632. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10,
  1633. X   0x28, 0xfa, 0xff, 0xff, 0xff, 0x07, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
  1634. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0xd0, 0xff, 0xff, 0xff, 0xff,
  1635. X   0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1636. X   0x40, 0x10, 0xf5, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00,
  1637. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xf8, 0xff, 0xff,
  1638. X   0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1639. X   0x00, 0x00, 0x08, 0x29, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
  1640. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0xa0, 0xff,
  1641. X   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00,
  1642. X   0x00, 0x00, 0x00, 0x00, 0x20, 0xc8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  1643. X   0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1644. X   0xf1, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00,
  1645. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf4, 0xff, 0xff, 0xff, 0xff,
  1646. X   0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1647. X   0x08, 0x91, 0xfa, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03,
  1648. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff,
  1649. X   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00,
  1650. X   0x00, 0x00, 0x00, 0x24, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  1651. X   0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0xfe,
  1652. X   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00,
  1653. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  1654. X   0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
  1655. X   0x40, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00,
  1656. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0xff, 0xff, 0xff, 0xff,
  1657. X   0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1658. X   0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  1659. SHAR_EOF
  1660. true || echo 'restore of eye.mask failed'
  1661. fi
  1662. echo 'End of  part 1'
  1663. echo 'File eye.mask is continued in part 2'
  1664. echo 2 > _shar_seq_.tmp
  1665. exit 0
  1666. -- 
  1667. --
  1668. Molecular Simulations, Inc.            mail: dcmartin@msi.com
  1669. 796 N. Pastoria Avenue                uucp: uunet!dcmartin
  1670. Sunnyvale, California 94086            at&t: 408/522-9236
  1671.