home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / x / volume8 / xcal / patch2 next >
Internet Message Format  |  1990-06-26  |  7KB

  1. Path: uunet!cs.utexas.edu!usc!apple!sun-barr!newstop!sun!hillside.co.uk
  2. From: pc@hillside.co.uk (Peter Collinson)
  3. Newsgroups: comp.sources.x
  4. Subject: v08i005: Xcal, Patch2, Part01/01
  5. Message-ID: <137919@sun.Eng.Sun.COM>
  6. Date: 27 Jun 90 06:45:01 GMT
  7. Sender: news@sun.Eng.Sun.COM
  8. Lines: 254
  9. Approved: argv@sun.com
  10.  
  11. Submitted-by: Peter Collinson <pc@hillside.co.uk>
  12. Posting-number: Volume 8, Issue 5
  13. Archive-name: xcal/patch2
  14. Patch-To: xcal: Volume 7, Issue 1-2,28
  15.  
  16. Xcal is a calendar program. It generally sits on your screen
  17. displaying today's date - the format of this can be tailored to your
  18. taste.
  19.  
  20. The patch below is from Rod Whitby <rwhitby@adl.austek.oz.au> and
  21. since several people have asked for this feature, I have put it out
  22. as a patch immediately.
  23.  
  24. From Rod's mail:
  25.  
  26. If InitialCalendar is True, then this month's calendar will be popped
  27. up when xcal is started.
  28.  
  29. If InitialEdit is True, and there exists a file for today's date, then
  30. an Edit window for today will be popped up when xcal is started.
  31.  
  32. ------------------------- patch from here --------------
  33. Prereq: 1
  34. *** patchlevel.h~    Sat Jun 23 19:50:35 1990
  35. --- patchlevel.h    Sat Jun 23 19:50:09 1990
  36. ***************
  37. *** 1 ****
  38. ! #define PATCHLEVEL 1
  39. --- 1 ----
  40. ! #define PATCHLEVEL 2
  41. *** version.c~    Sat Jun 23 19:47:55 1990
  42. --- version.c    Sat Jun 23 19:41:52 1990
  43. ***************
  44. *** 1,10 ****
  45.   #ifndef lint
  46. ! static char *sccsid = "@(#)version.c    1.2 (Hillside Systems) 5/5/90";
  47.   #endif  lint
  48.   /*
  49.    *    Version control file
  50. !  *    version.c    1.2    5/5/90
  51. !  *    Automatically created on Sat May  5 16:15:20 BST 1990
  52.    *    
  53.    *    Hand edit none of this if you want freeze to continue to work
  54.    */
  55. --- 1,10 ----
  56.   #ifndef lint
  57. ! static char *sccsid = "@(#)version.c    1.3 (Hillside Systems) 6/23/90";
  58.   #endif  lint
  59.   /*
  60.    *    Version control file
  61. !  *    version.c    1.3    6/23/90
  62. !  *    Automatically created on Sat Jun 23 19:41:41 BST 1990
  63.    *    
  64.    *    Hand edit none of this if you want freeze to continue to work
  65.    */
  66. ***************
  67. *** 12,37 ****
  68.   #define    PROGNAME    XCal
  69.   #endif
  70.   #ifdef    VER_VEC
  71. ! char    version[] = "XCal Version 1.2, released Sat May  5 16:15:20 BST 1990";
  72.   #endif
  73.   #ifdef    VER_DEF
  74. ! #define    VERSION    "XCal Version 1.2, released Sat May  5 16:15:20 BST 1990"
  75.   #endif
  76.   
  77.   /*    SCCS files
  78.    *
  79.   +1.5    Makefile
  80. ! +3.3    xcal.c
  81. ! +1.5    xcal.man
  82. ! +3.2    xcal.h
  83.   +3.1    xcal_popup.c
  84.   +3.4    xcal_strip.c
  85.   +3.2    xcal_help.c
  86.   +3.3    xcal_edit.c
  87.   +1.4    XCal.ad
  88. ! +1.2    Imakefile
  89.   +1.1    README
  90. ! +1.4    CHANGES
  91. ! +1.2    patchlevel.h
  92.    *
  93.    */
  94. --- 12,37 ----
  95.   #define    PROGNAME    XCal
  96.   #endif
  97.   #ifdef    VER_VEC
  98. ! char    version[] = "XCal Version 1.3, released Sat Jun 23 19:41:41 BST 1990";
  99.   #endif
  100.   #ifdef    VER_DEF
  101. ! #define    VERSION    "XCal Version 1.3, released Sat Jun 23 19:41:41 BST 1990"
  102.   #endif
  103.   
  104.   /*    SCCS files
  105.    *
  106.   +1.5    Makefile
  107. ! +3.4    xcal.c
  108. ! +1.6    xcal.man
  109. ! +3.3    xcal.h
  110.   +3.1    xcal_popup.c
  111.   +3.4    xcal_strip.c
  112.   +3.2    xcal_help.c
  113.   +3.3    xcal_edit.c
  114.   +1.4    XCal.ad
  115. ! +1.3    Imakefile
  116.   +1.1    README
  117. ! +1.5    CHANGES
  118. ! +1.3    patchlevel.h
  119.    *
  120.    */
  121. *** Imakefile~    Sat Jun 23 19:47:06 1990
  122. --- Imakefile    Sat Jun 23 19:41:51 1990
  123. ***************
  124. *** 1,4 ****
  125. --- 1,5 ----
  126.   LOCAL_LIBRARIES = XawClientLibs
  127. +            INCS = xcal.h
  128.              SRCS = xcal.c xcal_edit.c xcal_help.c xcal_popup.c
  129. xcal_strip.c version.c
  130.              OBJS = xcal.o xcal_edit.o xcal_help.o xcal_popup.o
  131. xcal_strip.o version.o
  132.    OSMAJORVERSION = OSMajorVersion
  133. *** CHANGES~    Sat Jun 23 19:46:33 1990
  134. --- CHANGES    Sat Jun 23 19:41:52 1990
  135. ***************
  136. *** 1,5 ****
  137. ! Changes:    CHANGES    1.4    5/5/90
  138.   
  139.   xcal_edit.c    Fix bug where colour mapping on days failed to change when
  140.           data is deleted or added.
  141.   
  142. --- 1,18 ----
  143. ! Changes:    CHANGES    1.5    6/23/90
  144.   
  145. + ---------------------------- 1.5
  146. + xcal.h        Add initialCalendar/initialEdit switches
  147. +         Support for better start-up options... from
  148. +         From: Rod Whitby <rwhitby@adl.austek.oz.au>
  149. + xcal.c        Add hooks and code to perform startuo
  150. + Imakefile    Corrected
  151. + xcal.man    Add new lines supporting initialCalendar/initialEdit
  152. + ---------------------------- 1.4
  153.   xcal_edit.c    Fix bug where colour mapping on days failed to change when
  154.           data is deleted or added.
  155.   
  156. *** xcal.c~    Sat Jun 23 19:48:29 1990
  157. --- xcal.c    Sat Jun 23 19:41:46 1990
  158. ***************
  159. *** 1,5 ****
  160.   #ifndef lint
  161. ! static char *sccsid = "@(#)xcal.c    3.3 (Hillside Systems) 5/2/90";
  162.   static char *copyright = "@(#)Copyright 1989 Peter Collinson, Hillside Systems";
  163.   #endif  lint
  164.   /***
  165. --- 1,5 ----
  166.   #ifndef lint
  167. ! static char *sccsid = "@(#)xcal.c    3.4 (Hillside Systems) 6/23/90";
  168.   static char *copyright = "@(#)Copyright 1989 Peter Collinson, Hillside Systems";
  169.   #endif  lint
  170.   /***
  171. ***************
  172. *** 77,82 ****
  173. --- 77,86 ----
  174.       offset(calCompat), XtRString, "False" },
  175.   {"giveHelp", "GiveHelp", XtRBoolean, sizeof(Boolean),
  176.       offset(giveHelp), XtRString, "True" },
  177. + {"initialCalendar", "InitialCalendar", XtRBoolean, sizeof(Boolean),
  178. +     offset(initialCalendar), XtRString, "False" },
  179. + {"initialEdit", "InitialEdit", XtRBoolean, sizeof(Boolean),
  180. +     offset(initialEdit), XtRString, "False" },
  181.   {"markForeground", "MarkForeground", XtRPixel, sizeof(Pixel),
  182.       offset(marked.fg), XtRString, "White" },
  183.   {"markBackground", "MarkBackground", XtRPixel, sizeof(Pixel),
  184. ***************
  185. *** 263,268 ****
  186. --- 267,285 ----
  187.       XtAugmentTranslations(lab, XtParseTranslationTable(defTranslations));
  188.   
  189.       XtMapWidget(toplevel);
  190. +     if (appResources.initialCalendar) {
  191. +       DoCalendar(lab, NULL, NULL);
  192. +     }
  193. +     if (appResources.initialEdit) {
  194. +       MonthEntry    *me;
  195. +       me = GetMonthEntry(today.year, today.month);
  196. +       if (me->me_have[today.day]) {
  197. +         StartEditing(lab, &today);
  198. +       }
  199. +     }
  200.       XtMainLoop();
  201.   }
  202.   
  203. *** xcal.h~    Sat Jun 23 19:49:26 1990
  204. --- xcal.h    Sat Jun 23 19:41:47 1990
  205. ***************
  206. *** 1,5 ****
  207.   /*
  208. !  *    xcal.h    3.2    5/2/90
  209.    *
  210.    *    Header file for the xcal program
  211.    */
  212. --- 1,5 ----
  213.   /*
  214. !  *    xcal.h    3.3    6/23/90
  215.    *
  216.    *    Header file for the xcal program
  217.    */
  218. ***************
  219. *** 44,49 ****
  220. --- 44,51 ----
  221.       Boolean    markToday;    /* Mark today with today's colours */
  222.       Boolean    calCompat;    /* True if handle files like xcalendar */
  223.       Boolean giveHelp;    /* True if help is needed (default) */
  224. +     Boolean initialCalendar;/* Pop up Calendar on startup if True */
  225. +     Boolean initialEdit;    /* Pop up today's Edit on startup if True */
  226.       String    mon[12];    /* Long month names */
  227.       String    smon[12];    /* Short month names */
  228.       String    day[7];        /* day names */
  229. *** xcal.man~    Sat Jun 23 19:48:56 1990
  230. --- xcal.man    Sat Jun 23 19:41:46 1990
  231. ***************
  232. *** 212,217 ****
  233. --- 212,229 ----
  234.   If False, help buttons disappear and the initial message is not printed.
  235.   Default: True.
  236.   .TP
  237. + .B InitialCalendar
  238. + If True then the calendar for this month is automatically displayed on
  239. + startup.
  240. + If False, the calendar is not automatically displayed.
  241. + Default: False.
  242. + .TP
  243. + .B InitialEdit
  244. + If True then an edit window for today is automatically displayed on
  245. + startup if a file exists for today's date.
  246. + If False, the edit window is not automatically displayed.
  247. + Default: False.
  248. + .TP
  249.   .B UseWmTitle
  250.   If True display the month and the year at the head of each strip.
  251.   This information is duplicated if your window manager uses titles
  252.  
  253. dan
  254. ----------------------------------------------------
  255. O'Reilly && Associates   argv@sun.com / argv@ora.com
  256. Opinions expressed reflect those of the author only.
  257.