home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 2 / 2307 / Calendar.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-12-28  |  3.9 KB  |  128 lines

  1. /*
  2.  * Author: Jason Baietto, jason@ssd.csd.harris.com
  3.  * xdiary Copyright 1990 Harris Corporation
  4.  *
  5.  * Permission to use, copy, modify, and distribute, this software and its
  6.  * documentation for any purpose is hereby granted without fee, provided that
  7.  * the above copyright notice appear in all copies and that both that
  8.  * copyright notice and this permission notice appear in supporting
  9.  * documentation, and that the name of the copyright holder be used in
  10.  * advertising or publicity pertaining to distribution of the software with
  11.  * specific, written prior permission, and that no fee is charged for further
  12.  * distribution of this software, or any modifications thereof.  The copyright
  13.  * holder makes no representations about the suitability of this software for
  14.  * any purpose.  It is provided "as is" without express or implied warranty.
  15.  *
  16.  * THE COPYRIGHT HOLDER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  17.  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, AND IN NO
  18.  * EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  19.  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM ITS USE,
  20.  * LOSS OF DATA, PROFITS, QPA OR GPA, WHETHER IN AN ACTION OF CONTRACT,
  21.  * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
  22.  * THE USE OR PERFORMANCE OF THIS SOFTWARE.
  23.  */
  24.  
  25. #ifndef _CalendarWidget_h
  26. #define _CalendarWidget_h
  27.  
  28. #include <X11/Core.h>
  29. #include "StrInRect.h"
  30. #include "Date.h"
  31.  
  32. /* 
  33.    Calendar.h -- Public Include File.
  34.    Author: Jason Baietto
  35.    Date:   September 16, 1990
  36. */
  37.  
  38. /* Public functions: */
  39. extern void CalendarSetDate();
  40. extern void CalendarShowMonth();
  41. extern void CalendarGetDate();
  42. extern void CalendarSetMonthInfo();
  43. extern void CalendarIncMonth();
  44. extern void CalendarDecMonth();
  45. extern void CalendarIncYear();
  46. extern void CalendarDecYear();
  47. extern void CalendarIncDay();
  48. extern void CalendarDecDay();
  49. extern Date GetTodaysDate();
  50. extern Date DateConverter();
  51. extern char * CalendarPrettyDate();
  52.  
  53. typedef struct {
  54.    unsigned int mask;
  55.    union {
  56.       char * string;
  57.       Pixmap pixmap;
  58.    } info[9]; /* one per gravity */
  59. } DayInfo;
  60.  
  61. typedef DayInfo MonthInfo[31];
  62.  
  63. /* Resource Names: */
  64. #ifndef XtNlineWidth
  65. #define XtNlineWidth        "lineWidth"
  66. #endif
  67. #define XtNdigitFont        "digitFont"
  68. #define XtNweekdayFont      "weekdayFont"
  69. #define XtNtitleFont        "titleFont"
  70. #define XtNinfoFont         "infoFont"
  71. #define XtNdigitGravity     "digitGravity"
  72. #define XtNdigitNames       "digitNames"
  73. #define XtNweekdayNames     "weekdayNames"
  74. #define XtNmonthNames       "monthNames"
  75. #ifndef XtNhighlight
  76. #define XtNhighlight        "highlight"
  77. #endif
  78. #define XtNshowYear         "showYear"
  79. #define XtNstartingWeekday  "startingWeekday"
  80.  
  81. /* Resource Classes: */
  82. #ifndef XtCLineWidth
  83. #define XtCLineWidth        "LineWidth"
  84. #endif
  85. #define XtCCalendarFont     "CalendarFont"
  86. #define XtCDigitGravity     "DigitGravity"
  87. #define XtCDigitNames       "DigitNames"
  88. #define XtCWeekdayNames     "WeekdayNames"
  89. #define XtCMonthNames       "MonthNames"
  90. #ifndef XtCHighlight
  91. #define XtCHighlight        "Highlight"
  92. #endif
  93. #define XtCShowYear         "ShowYear"
  94. #define XtCStartingWeekday  "StartingWeekday"
  95.  
  96. extern WidgetClass calendarWidgetClass;
  97.  
  98. typedef struct _CalendarClassRec *CalendarWidgetClass;
  99. typedef struct _CalendarRec      *CalendarWidget;
  100.  
  101. #define DIstringNW  (1L<<0)
  102. #define DIstringN   (1L<<1)
  103. #define DIstringNE  (1L<<2)
  104. #define DIstringW   (1L<<3)
  105. #define DIstringC   (1L<<4)
  106. #define DIstringE   (1L<<5)
  107. #define DIstringSW  (1L<<6)
  108. #define DIstringS   (1L<<7)
  109. #define DIstringSE  (1L<<8)
  110.  
  111. #define DIpixmapNW  (1L<<9)
  112. #define DIpixmapN   (1L<<10)
  113. #define DIpixmapNE  (1L<<11)
  114. #define DIpixmapW   (1L<<12)
  115. #define DIpixmapC   (1L<<13)
  116. #define DIpixmapE   (1L<<14)
  117. #define DIpixmapSW  (1L<<15)
  118. #define DIpixmapS   (1L<<16)
  119. #define DIpixmapSE  (1L<<17)
  120.  
  121.  
  122. #define XtRcalendarDefaultTranslations \
  123.    "<Btn1Down>:    select()\n\
  124.     <Btn1Motion>:  select()\n\
  125.     <Btn1Up>:      notify()"
  126.  
  127. #endif /* _CalendarWidget_h */
  128.