home *** CD-ROM | disk | FTP | other *** search
- /*
- * $Header: ct.h,v 2.1 89/05/09 14:25:13 billr Exp $
- */
- /*
- * ct.h - header file for calentool
- *
- * Author: Philip Heller, Sun Microsystems. Inc. <terrapin!heller@sun.com>
- *
- * Original source Copyright (C) 1987, Sun Microsystems, Inc.
- * All Rights Reserved
- * Permission is hereby granted to use and modify this program in source
- * or binary form as long as it is not sold for profit and this copyright
- * notice remains intact.
- *
- *
- * Changes/additions by: Bill Randle, Tektronix, Inc. <billr@saab.CNA.TEK.COM>
- *
- * Changes and additions Copyright (C) 1988, 1989 Tektronix, Inc.
- * All Rights Reserved
- * Permission is hereby granted to use and modify the modifications in source
- * or binary form as long as they are not sold for profit and this copyright
- * notice remains intact.
- */
-
- /* directory for date/event files */
- #ifndef DATELIB_DIR
- # define DATELIB_DIR "/usr/local/lib/calentool"
- #endif
-
- #ifndef NOPRINTER
- /* command string for sending a file to the Postscript printer */
- # ifndef PRINT_CMD
- # define PRINT_CMD "lpr -Plw"
- # endif
-
- /*# define RASTER_ONLY /* define this if no Postscript printer available */
- #endif
-
- /* define NR_WEEKDAYS for desired week display */
- /* NR_WEEKDAYS display */
- /* 5 Mon-Fri */
- /* 6 Mon-Sat */
- /* 7 Sun-Sat */
- /**/
- #ifndef NR_WEEKDAYS
- # define NR_WEEKDAYS 5
- #endif
-
- #ifndef START_HOUR
- # define START_HOUR 8 /* 8am */
- #endif /* to */
- #ifndef END_HOUR
- # define END_HOUR 18 /* 6pm */
- #endif
-
- #ifndef START_YEAR
- # define START_YEAR 89
- #endif
- #ifndef NR_YEARS
- # define NR_YEARS 5 /* number of years in menu */
- #endif
-
- #ifndef UPDATE_RATE
- # define UPDATE_RATE "second" /* update time */
- #endif /* options are "second" & "minute" */
- #define TIME_OUT 5 /* check appts every 5 minutes */
-
- /*
- * If calentool is too big and you want a stripped-down version
- * define some or all of these here or in the Makefile. Combined,
- * they save ~100K bytes.
- */
- /*#define NO_PRINTER /* exclude printer support code */
- /*#define NO_HOLIDAYS /* exclude holiday checking code */
- /*#define NO_SUN_MOON /* exclude Sun/Moon data frames */
-
- /*********************************************************************/
- /* Nothing below here should need to be changed (typically) */
- /*********************************************************************/
-
- #ifndef TRUE
- # define TRUE 1
- #endif
- #ifndef FALSE
- # define FALSE 0
- #endif
-
- #ifndef N_TSLOTS
- # define N_TSLOTS ((END_HOUR-START_HOUR)*2) /* Number of 30-minute slots in a day. */
- #endif
- #define N_SLOTS (N_TSLOTS+10) /* Total number of slots on a day page. */
- #define MAX_FUTURE_ENTRIES 32 /* number of appts displayed in popup window */
-
- /*
- * APPT_CHECK_LIMIT is typically either "n_tslots"
- * or "N_SLOTS" depending on whether we include the
- * notes section when indicating that we still have
- * appts today.
- */
- #ifndef APPT_CHECK_LIMIT
- # define APPT_CHECK_LIMIT n_tslots
- #endif
-
- /* Dimensions of 30-minute week slot.
- * Message size determines width - everything else keyed
- * off font size and message size
- */
- #define WEEK_MESSAGE_SIZE 12
-
- #define DISPLAYING_DAY 1 /* Defs for state of main */
- #define DISPLAYING_WEEK 2 /* subwindow (mainsw_state) */
- #define DISPLAYING_MONTH 3
- #define DISPLAYING_YEAR 4
-
- #define BACKSPACE 8 /* editing chars */
- #define CTRL_R 18
- #define CTRL_U 21
- #define CTRL_W 23
- #define DEL 127
-
- #define NONE 0
- #define DAY 1 /* Defs for "selected_type" (type of */
- #define WEEK 2 /* object selected by month click). */
- #define MONTH 3
-
- #define INACTIVE 0 /* Defs for "active" field of timeslot. */
- #define ARROW_SHAFT 1
- #define ARROW_HEAD 2
- #define ACTIVE 4
-
- #define JUSTIFY_LEFT 0 /* text justification in day slot */
- #define JUSTIFY_RIGHT 1
- #define JUSTIFY_INDEX 2
-
- #define FOUND_SLOT 1 /* event tags for day display */
- #define FOUND_MORE 2
- #define FOUND_LARROW 3
- #define FOUND_RARROW 4
-
- #define MMODIFY 1 /* order of entries in day menu */
- #define MCUT 2
- #define MPASTE 3
- #define MCOPY 4
- #define MDELETE 5
- #define MUNDELETE 6
-
- #define PR_POSTSCRIPT 1 /* print options */
- #define PR_RASTER 2
-
- #define SUN 0 /* days of the week */
- #define MON 1
- #define TUE 2
- #define WED 3
- #define THU 4
- #define FRI 5
- #define SAT 6
-
- #define JAN 0 /* selected months */
- #define FEB 1
- #define DEC 11
-
- #define ALL_YEARS 0x1 /* flags for special case appts */
- #define ALL_MONTHS 0x2
- #define ALL_DAYS 0x4
- #define REPEAT 0x8
- #define A_COMMENT 0x10
- #define EVERY_SUN 0x20
- #define EVERY_MON 0x40
- #define EVERY_TUE 0x60
- #define EVERY_WED 0x80
- #define EVERY_THU 0xa0
- #define EVERY_FRI 0xc0
- #define EVERY_SAT 0xe0
- #define EVERY_SOMEDAY 0xe0
- /* convert flag value to day-of-week number */
- # define Pickday(d) ((((d)&EVERY_SOMEDAY)>>5)-1)
- /* convert day of week to flag value */
- # define Setday(d) (((d)+1)<<5)
- #define LOOKAHEAD 0x100
- #define READONLY 0x200
- #define A_NOTE 0x400
- #define MARKED 0x800 /* don't show in month/year display */
- #define MARKED_NOTE 0xc00
- #define DELETED 0x1000 /* don't show the appt that matches this */
-
- /* format of repeat field for every_someday type appts */
- #define WEEK1 0x1
- #define WEEK2 0x2
- #define WEEK3 0x4
- #define WEEK4 0x8
- #define WEEK5 0x10
- #define ALL_WEEKS 0x1f
- #define LAST_WEEK 0x20
- #define WEEK_LIMIT 0x3f
-
- /* error reporting flags */
- #define NON_FATAL 0
- #define FATAL 1
-
- #define STD_ICON 0 /* flags for icon currently displayed */
- #define REV_ICON 1
- #define NA_ICON 2
-
- /* header line in appts file implies one-based entries and 99 memo flag */
- #define HEADER "# CalenTool V2 - DO NOT REMOVE THIS LINE\n"
-
- #define MAX_STRLEN 256 /* max size of strings */
- struct appt_entry {
- /* describes an entry in the appointments file */
- int year, month, day, hour, minute, arrows;
- int repeat, lookahead, flags, sindex;
- char str[MAX_STRLEN];
- struct appt_entry *next; /* ptr to next appt in list */
- }; /* NULL if last entry */
-
- struct rect_pos {
- /* location of a given rect in the canvas */
- int top, bottom, left, right;
- };
-
- struct dayslot {
- /* struct for storing relevant info for 30 min day slot */
- struct rect_pos slot_pos; /* slot position in day display */
- struct rect_pos larrow_pos; /* position of left scroll arrow */
- struct rect_pos rarrow_pos; /* position of right scroll arrow */
- struct rect_pos moreb_pos; /* position of "more" button */
- int active; /* status of this slot */
- int count; /* number of active appts in this slot */
- struct appt_entry *cur_appt; /* ptr to current appt in list */
- struct appt_entry *first; /* ptr to first appt in list */
- }; /* NULL if no entries */
-
- struct weekrect {
- /* info for week display */
- struct rect_pos wday_pos; /* screen position of this day */
- struct rect_pos moreb_pos; /* position of "more" button */
- int more;
- struct dayslot weekslots[N_SLOTS];
- };
-
- struct rect_limits {
- int lowx;
- int lowy;
- int highx;
- int highy;
- };
-
- struct week_arrow {
- int top;
- int bottom;
- int left;
- int right;
- int active;
- };
-