home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-02-04 | 56.1 KB | 2,148 lines |
- *** /tmp/,RCSt1a16911 Fri Dec 15 17:22:26 1989
- --- calentool.c Fri Dec 15 17:17:03 1989
- ***************
- *** 1,5
- /*
- ! * $Header: calentool.c,v 2.2 89/07/19 20:25:41 billr Exp $
- */
- /*
- * calentool.c
-
- --- 1,5 -----
- /*
- ! * $Header: calentool.c,v 2.3 89/12/15 17:16:58 billr Exp $
- */
- /*
- * calentool.c
- ***************
- *** 33,39
-
- extern Pixfont *font, *sfont;
- extern char apts_pathname[], tmpapts_pathname[];
- ! extern char todays_date[];
- extern char version[];
- extern Panel_item clock_pi;
- extern Frame fframe;
-
- --- 33,39 -----
-
- extern Pixfont *font, *sfont;
- extern char apts_pathname[], tmpapts_pathname[];
- ! extern char clockstr[];
- extern char version[];
- extern char *smonthnames[];
- extern Panel_item clock_pi;
- ***************
- *** 35,40
- extern char apts_pathname[], tmpapts_pathname[];
- extern char todays_date[];
- extern char version[];
- extern Panel_item clock_pi;
- extern Frame fframe;
- extern Panel panel;
-
- --- 35,41 -----
- extern char apts_pathname[], tmpapts_pathname[];
- extern char clockstr[];
- extern char version[];
- + extern char *smonthnames[];
- extern Panel_item clock_pi;
- extern Frame fframe;
- extern Panel panel;
- ***************
- *** 38,43
- extern Panel_item clock_pi;
- extern Frame fframe;
- extern Panel panel;
- #ifndef NO_SUN_MOON
- extern Frame sframe;
- #endif
-
- --- 39,45 -----
- extern Panel_item clock_pi;
- extern Frame fframe;
- extern Panel panel;
- + extern Rect *closed_rect;
- #ifndef NO_SUN_MOON
- extern Frame sframe;
- #endif
- ***************
- *** 71,77
- int one_based = 0, new_entry = 0, version2 = 0;
- int otherfile = 0;
- char *othername;
- ! int beep = 0, show_time = 0;
- int include_old = 0, save_old = 0;
- #ifndef NO_HOLIDAYS
- int holiday_a = 0, holiday_c = 0, holiday_i = 0;
-
- --- 73,79 -----
- int one_based = 0, new_entry = 0, version2 = 0;
- int otherfile = 0;
- char *othername;
- ! int beep = 0, show_time = 0, beep_open = 0;
- int include_old = 0, save_old = 0;
- #ifndef NO_HOLIDAYS
- int holiday_a = 0, holiday_c = 0, holiday_i = 0;
- ***************
- *** 86,92
- Cursor wait_cursor;
- char orig_apts_pathname[160];
- int orig_ro;
- ! char timestr[16], datestr_day[3], datestr_mon[4];
- struct pr_prpos where;
- int working_msg;
-
-
- --- 88,94 -----
- Cursor wait_cursor;
- char orig_apts_pathname[160];
- int orig_ro;
- ! char timestr[16], datestr_day[3];
- struct pr_prpos where;
- int working_msg;
- int hour24, monday_first, day_first;
- ***************
- *** 89,94
- char timestr[16], datestr_day[3], datestr_mon[4];
- struct pr_prpos where;
- int working_msg;
-
- static short icon_data[] = {
- #include "std.icon"
-
- --- 91,98 -----
- char timestr[16], datestr_day[3];
- struct pr_prpos where;
- int working_msg;
- + int hour24, monday_first, day_first;
- + int expire_days = 0;
-
- static short icon_data[] = {
- #include "std.icon"
- ***************
- *** 146,152
- mpr_static(tri_right_pr, 16, 16, 1, tri_right_data);
-
- char *strcpy(), *strcat(), *rindex();
- ! static Notify_value cleanup(), itimer_handler();
- Notify_value myframe_interposer();
-
- main(argc,argv)
-
- --- 150,156 -----
- mpr_static(tri_right_pr, 16, 16, 1, tri_right_data);
-
- char *strcpy(), *strcat(), *rindex();
- ! static Notify_value leave(), itimer_handler();
- Notify_value myframe_interposer();
-
- main(argc,argv)
- ***************
- *** 164,169
- progname = *argv;
-
- nr_weekdays = NR_WEEKDAYS;
- n_tslots = (N_TSLOTS > N_SLOTS ? N_SLOTS : N_TSLOTS);
-
- get_today(); /* initial day is today */
-
- --- 168,175 -----
- progname = *argv;
-
- nr_weekdays = NR_WEEKDAYS;
- + monday_first = MON_FIRST;
- + hour24 = HOUR_24;
- n_tslots = (N_TSLOTS > N_SLOTS ? N_SLOTS : N_TSLOTS);
-
- get_today(); /* initial day is today */
- ***************
- *** 169,175
- get_today(); /* initial day is today */
- current = today;
- read_only = 0;
- ! working_msg = 1;
-
- /*
- * Check for -p, -P or -m option, which means we don't want
-
- --- 175,181 -----
- get_today(); /* initial day is today */
- current = today;
- read_only = 0;
- ! working_msg = 0;
-
- /*
- * Check for -p, -P, -m or -M option, which means we don't want
- ***************
- *** 172,178
- working_msg = 1;
-
- /*
- ! * Check for -p, -P or -m option, which means we don't want
- * to create the tool. Also check for -Wp so we can supply
- * a resonable default if the user doesn't supply one.
- */
-
- --- 178,184 -----
- working_msg = 0;
-
- /*
- ! * Check for -p, -P, -m or -M option, which means we don't want
- * to create the tool. Also check for -Wp so we can supply
- * a resonable default if the user doesn't supply one.
- */
- ***************
- *** 179,185
- i = argc;
- while (--i > 0) {
- if (!strncmp(argv[i], "-p", 2) || !strcmp(argv[i], "-m")
- ! || !strncmp(argv[i], "-P", 2)) {
- /* standard getopt doesn't allow optional
- * arguments, so we do a check here for
- * obsolete usage of the -p option
-
- --- 185,191 -----
- i = argc;
- while (--i > 0) {
- if (!strncmp(argv[i], "-p", 2) || !strcmp(argv[i], "-m")
- ! || !strncmp(argv[i], "-P", 2) || !strcmp(argv[i], "-M")) {
- /* standard getopt doesn't allow optional
- * arguments, so we do a check here for
- * obsolete usage of the -p option
- ***************
- *** 205,211
- 0);
- }
-
- ! while ((flag = getopt(argc, argv, "57bd:f:im:op:P:rtu:zH:h:w")) != EOF)
- switch (flag) {
- case 'f': /* use this file */
- otherfile = 1;
-
- --- 211,217 -----
- 0);
- }
-
- ! while ((flag = getopt(argc, argv, "1:2:567bBd:eEf:im:M:op:P:rtu:zH:h:wx:")) != EOF)
- switch (flag) {
- case 'f': /* use this file */
- otherfile = 1;
- ***************
- *** 220,225
- read_only = 1;
- break;
-
- case 'p': /* print and exit */
- read_only = 1;
- switch (*optarg) {
-
- --- 226,251 -----
- read_only = 1;
- break;
-
- + case '1': /* -12 -- 12 hour time */
- + if (*optarg == '2')
- + hour24 = FALSE;
- + break;
- +
- + case '2': /* -24 -- 24 hour time */
- + if (*optarg == '4')
- + hour24 = TRUE;
- + break;
- +
- + case 'e': /* European calendar Mon-Sun */
- + monday_first = TRUE;
- + break;
- +
- + case 'E': /* European style */
- + monday_first = TRUE;
- + hour24 = TRUE;
- + day_first = TRUE;
- + break;
- +
- case 'p': /* print and exit */
- read_only = 1;
- switch (*optarg) {
- ***************
- *** 268,273
-
- case 'm': /* mail today's appts and exit */
- read_only = 1;
- printit_dst = DST_MAIL;
- mailto = optarg;
- break;
-
- --- 294,301 -----
-
- case 'm': /* mail today's appts and exit */
- read_only = 1;
- + if (!printit)
- + printit = PRI_DAY;
- printit_dst = DST_MAIL;
- mailto = optarg;
- break;
- ***************
- *** 272,277
- mailto = optarg;
- break;
-
- case 'b': /* beep to console for pending appt */
- beep = 1;
- break;
-
- --- 300,314 -----
- mailto = optarg;
- break;
-
- + case 'M': /* mail today's appts and exit (ignore
- + some notes) */
- + read_only = 1;
- + if (!printit)
- + printit = PRI_DAY_XNOTES;
- + printit_dst = DST_MAIL;
- + mailto = optarg;
- + break;
- +
- case 'b': /* beep to console for pending appt */
- beep = 1;
- break;
- ***************
- *** 276,281
- beep = 1;
- break;
-
- case 'i': /* include old appt files */
- include_old = 1;
- break;
-
- --- 313,322 -----
- beep = 1;
- break;
-
- + case 'B': /* beep then open wondow */
- + beep_open = 1;
- + break;
- +
- case 'i': /* include old appt files */
- include_old = 1;
- break;
- ***************
- *** 280,286
- include_old = 1;
- break;
-
- ! case 'o': /* save outdate appts to another file */
- save_old = 1;
- break;
-
-
- --- 321,327 -----
- include_old = 1;
- break;
-
- ! case 'o': /* save outdated appts to another file */
- save_old = 1;
- break;
-
- ***************
- *** 292,298
- nr_weekdays = 5;
- break;
-
- ! case '7': /* Sun - Sat week display */
- nr_weekdays = 7;
- break;
-
-
- --- 333,343 -----
- nr_weekdays = 5;
- break;
-
- ! case '6': /* Mon - Sat week display */
- ! nr_weekdays = 6;
- ! break;
- !
- ! case '7': /* Sun - Sat (or Mon-Sun) week display */
- nr_weekdays = 7;
- break;
-
- ***************
- *** 300,307
- update_interval = atoi(optarg);
- break;
-
- ! case 'w': /* don't display Working! message */
- ! working_msg = 0;
- break;
-
- case 'z': /* zero offset -- new style appts file */
-
- --- 345,352 -----
- update_interval = atoi(optarg);
- break;
-
- ! case 'w': /* display Working! message */
- ! working_msg = 1;
- break;
-
- case 'x': /* eXpire appts after so many days */
- ***************
- *** 304,309
- working_msg = 0;
- break;
-
- case 'z': /* zero offset -- new style appts file */
- one_based = 1;
- break;
-
- --- 349,358 -----
- working_msg = 1;
- break;
-
- + case 'x': /* eXpire appts after so many days */
- + expire_days = atoi(optarg);
- + break;
- +
- case 'z': /* zero offset -- new style appts file */
- one_based = 1;
- break;
- ***************
- *** 390,396
- fprintf(stderr, " -p <dwm> // print selected day [d], week [w] or month [m] appts and exit\n");
- fprintf(stderr, " -P <dwm> // like -p, only don't print marked notes\n");
- fprintf(stderr, " -m <user> // mail selected days appts to <user>\n");
- ! fprintf(stderr, " [-5|-7] // 5-day or 7-day week display\n");
- fprintf(stderr, " -d <date> // display appts for <date>\n");
- fprintf(stderr, " -b // beep and display message when appt is pending\n");
- fprintf(stderr, " -i // auto-include outdated appts files\n");
-
- --- 439,447 -----
- fprintf(stderr, " -p <dwm> // print selected day [d], week [w] or month [m] appts and exit\n");
- fprintf(stderr, " -P <dwm> // like -p, only don't print marked notes\n");
- fprintf(stderr, " -m <user> // mail selected days appts to <user>\n");
- ! fprintf(stderr, " -M <user> // like -m, only don't mail marked notes\n");
- ! fprintf(stderr, " [-5|-6|-7] // 5, 6 or 7-day week display\n");
- ! fprintf(stderr, " [-12|-24] // 12 or 24 hour time format\n");
- fprintf(stderr, " -d <date> // display appts for <date>\n");
- fprintf(stderr, " -b // beep and display message when appt is pending\n");
- fprintf(stderr, " -B // beep and open window when appt is pending\n");
- ***************
- *** 393,398
- fprintf(stderr, " [-5|-7] // 5-day or 7-day week display\n");
- fprintf(stderr, " -d <date> // display appts for <date>\n");
- fprintf(stderr, " -b // beep and display message when appt is pending\n");
- fprintf(stderr, " -i // auto-include outdated appts files\n");
- fprintf(stderr, " -o // create outdated include files\n");
- fprintf(stderr, " -t // display time below icon\n");
-
- --- 444,450 -----
- fprintf(stderr, " [-12|-24] // 12 or 24 hour time format\n");
- fprintf(stderr, " -d <date> // display appts for <date>\n");
- fprintf(stderr, " -b // beep and display message when appt is pending\n");
- + fprintf(stderr, " -B // beep and open window when appt is pending\n");
- fprintf(stderr, " -i // auto-include outdated appts files\n");
- fprintf(stderr, " -o // create outdated include files\n");
- fprintf(stderr, " -t // display time below icon\n");
- ***************
- *** 397,403
- fprintf(stderr, " -o // create outdated include files\n");
- fprintf(stderr, " -t // display time below icon\n");
- fprintf(stderr, " -u <interval> // time update interval (seconds)\n");
- ! fprintf(stderr, " -w // don't display 'Working!' message\n");
- #ifndef NO_HOLIDAYS
- fprintf(stderr, " -h <Aacijs> // display selected computed holidays\n");
- fprintf(stderr, " // A=All, a=astronomical, c=Christian,\n");
-
- --- 449,457 -----
- fprintf(stderr, " -o // create outdated include files\n");
- fprintf(stderr, " -t // display time below icon\n");
- fprintf(stderr, " -u <interval> // time update interval (seconds)\n");
- ! fprintf(stderr, " -w // display 'Working!' message\n");
- ! fprintf(stderr, " -e // Mon-Sun week display\n");
- ! fprintf(stderr, " -E // European options (-e, -24)\n");
- #ifndef NO_HOLIDAYS
- fprintf(stderr, " -h <Aacijs> // display selected computed holidays\n");
- fprintf(stderr, " // A=All, a=astronomical, c=Christian,\n");
- ***************
- *** 404,409
- fprintf(stderr, " // i=Islamic, j=Jewish, s=secular\n");
- fprintf(stderr, " -H <Aacijs> // like -h, only flag them as marked\n");
- #endif
- fprintf(stderr, " -z // conversion flag (see INSTALL)\n");
- fprintf(stderr, " <window_opts> // Suntools -W options\n");
- exit(1);
-
- --- 458,464 -----
- fprintf(stderr, " // i=Islamic, j=Jewish, s=secular\n");
- fprintf(stderr, " -H <Aacijs> // like -h, only flag them as marked\n");
- #endif
- + fprintf(stderr, " -x <days> // expire appts after <days> days\n");
- fprintf(stderr, " -z // conversion flag (see INSTALL)\n");
- fprintf(stderr, " <window_opts> // Suntools -W options\n");
- exit(1);
- ***************
- *** 410,416
- break;
- }
-
- !
- if (toolrunning) {
- (void) notify_set_signal_func(frame, cleanup, SIGHUP, NOTIFY_ASYNC);
- (void) notify_set_signal_func(frame, cleanup, SIGINT, NOTIFY_ASYNC);
-
- --- 465,474 -----
- break;
- }
-
- ! if (printit_dst == DST_MAIL && (printit == PRI_MONTH || printit == PRI_MONTH_XNOTES)) {
- ! fprintf(stderr, "calentool: can't mail month calendar\n");
- ! exit(1);
- ! }
- if (toolrunning) {
- (void) notify_set_signal_func(frame, leave, SIGHUP, NOTIFY_ASYNC);
- (void) notify_set_signal_func(frame, leave, SIGINT, NOTIFY_ASYNC);
- ***************
- *** 412,420
-
-
- if (toolrunning) {
- ! (void) notify_set_signal_func(frame, cleanup, SIGHUP, NOTIFY_ASYNC);
- ! (void) notify_set_signal_func(frame, cleanup, SIGINT, NOTIFY_ASYNC);
- ! (void) notify_set_signal_func(frame, cleanup, SIGTERM, NOTIFY_ASYNC);
- }
-
- /*
-
- --- 470,478 -----
- exit(1);
- }
- if (toolrunning) {
- ! (void) notify_set_signal_func(frame, leave, SIGHUP, NOTIFY_ASYNC);
- ! (void) notify_set_signal_func(frame, leave, SIGINT, NOTIFY_ASYNC);
- ! (void) notify_set_signal_func(frame, leave, SIGTERM, NOTIFY_ASYNC);
- }
-
- /*
- ***************
- *** 429,434
-
- if (printit) {
- print_apts(printit, printit_dst);
- exit(0);
- }
-
-
- --- 487,494 -----
-
- if (printit) {
- print_apts(printit, printit_dst);
- + if (save_old || expire_days)
- + expire(expire_days);
- exit(0);
- }
-
- ***************
- *** 478,487
- icon = icon_create(0);
- rev_icon = icon_create(0);
- na_icon = icon_create(0);
- ! strncpy(datestr_mon, todays_date+4, 3);
- ! datestr_mon[3] = '\0';
- ! strncpy(datestr_day, todays_date+8, 2);
- ! datestr_day[2] = '\0';
- /* the basic standard icon */
- pr_rop(ic_pr, 0, 0, 64, 64, PIX_SRC, &ic_mpr, 0, 0);
- if (show_time) {
-
- --- 538,544 -----
- icon = icon_create(0);
- rev_icon = icon_create(0);
- na_icon = icon_create(0);
- ! sprintf(datestr_day, "%2d", today.tm_mday);
- /* the basic standard icon */
- pr_rop(ic_pr, 0, 0, 64, 64, PIX_SRC, &ic_mpr, 0, 0);
- if (show_time) {
- ***************
- *** 486,495
- pr_rop(ic_pr, 0, 0, 64, 64, PIX_SRC, &ic_mpr, 0, 0);
- if (show_time) {
- /* time string displayed below icon */
- ! strcpy(timestr, todays_date+10);
- ! if (update_interval == 60) {
- ! /* display hh:mm */
- ! timestr[6] = '\0';
- ilabel_rect.r_left += 2*sfont->pf_defaultsize.x - 2;
- ilabel_rect.r_width -= 2*sfont->pf_defaultsize.x;
- } else
-
- --- 543,551 -----
- pr_rop(ic_pr, 0, 0, 64, 64, PIX_SRC, &ic_mpr, 0, 0);
- if (show_time) {
- /* time string displayed below icon */
- ! format_icon_time();
- ! if (update_interval >= 60) {
- ! /* no seconds displayed, adjust label position */
- ilabel_rect.r_left += 2*sfont->pf_defaultsize.x - 2;
- ilabel_rect.r_width -= 2*sfont->pf_defaultsize.x;
- }
- ***************
- *** 492,500
- timestr[6] = '\0';
- ilabel_rect.r_left += 2*sfont->pf_defaultsize.x - 2;
- ilabel_rect.r_width -= 2*sfont->pf_defaultsize.x;
- ! } else
- ! /* display hh:mm:ss */
- ! timestr[9] = '\0';
- /* draw a box around the time appendage */
- pr_vector(ic_pr, 0, 64, 63, 64, PIX_SET, 1);
- pr_vector(ic_pr, 63, 64, 63, 76, PIX_SET, 1);
-
- --- 548,559 -----
- /* no seconds displayed, adjust label position */
- ilabel_rect.r_left += 2*sfont->pf_defaultsize.x - 2;
- ilabel_rect.r_width -= 2*sfont->pf_defaultsize.x;
- ! }
- ! if (!hour24) {
- ! /* am/pm, increase size of label rect */
- ! ilabel_rect.r_left -= sfont->pf_defaultsize.x;
- ! ilabel_rect.r_width += sfont->pf_defaultsize.x;
- ! }
- /* draw a box around the time appendage */
- pr_vector(ic_pr, 0, 64, 63, 64, PIX_SET, 1);
- pr_vector(ic_pr, 63, 64, 63, 76, PIX_SET, 1);
- ***************
- *** 520,526
- pf_ttext(where, PIX_SRC, sfont, datestr_day);
- where.pos.x = 39;
- where.pr = ic_pr;
- ! pf_ttext(where, PIX_NOT(PIX_SRC), sfont, datestr_mon);
- where.pr = na_ic_pr;
- pf_ttext(where, PIX_NOT(PIX_SRC), sfont, datestr_mon);
- where.pr = rev_ic_pr;
-
- --- 579,585 -----
- pf_ttext(where, PIX_SRC, sfont, datestr_day);
- where.pos.x = 39;
- where.pr = ic_pr;
- ! pf_ttext(where, PIX_NOT(PIX_SRC), sfont, smonthnames[today.tm_mon]);
- where.pr = na_ic_pr;
- pf_ttext(where, PIX_NOT(PIX_SRC), sfont, smonthnames[today.tm_mon]);
- where.pr = rev_ic_pr;
- ***************
- *** 522,528
- where.pr = ic_pr;
- pf_ttext(where, PIX_NOT(PIX_SRC), sfont, datestr_mon);
- where.pr = na_ic_pr;
- ! pf_ttext(where, PIX_NOT(PIX_SRC), sfont, datestr_mon);
- where.pr = rev_ic_pr;
- pf_ttext(where, PIX_SRC, sfont, datestr_mon);
- (void)icon_init_from_pr(icon, ic_pr);
-
- --- 581,587 -----
- where.pr = ic_pr;
- pf_ttext(where, PIX_NOT(PIX_SRC), sfont, smonthnames[today.tm_mon]);
- where.pr = na_ic_pr;
- ! pf_ttext(where, PIX_NOT(PIX_SRC), sfont, smonthnames[today.tm_mon]);
- where.pr = rev_ic_pr;
- pf_ttext(where, PIX_SRC, sfont, smonthnames[today.tm_mon]);
- (void)icon_init_from_pr(icon, ic_pr);
- ***************
- *** 524,530
- where.pr = na_ic_pr;
- pf_ttext(where, PIX_NOT(PIX_SRC), sfont, datestr_mon);
- where.pr = rev_ic_pr;
- ! pf_ttext(where, PIX_SRC, sfont, datestr_mon);
- (void)icon_init_from_pr(icon, ic_pr);
- (void)icon_init_from_pr(rev_icon, rev_ic_pr);
- (void)icon_init_from_pr(na_icon, na_ic_pr);
-
- --- 583,589 -----
- where.pr = na_ic_pr;
- pf_ttext(where, PIX_NOT(PIX_SRC), sfont, smonthnames[today.tm_mon]);
- where.pr = rev_ic_pr;
- ! pf_ttext(where, PIX_SRC, sfont, smonthnames[today.tm_mon]);
- (void)icon_init_from_pr(icon, ic_pr);
- (void)icon_init_from_pr(rev_icon, rev_ic_pr);
- (void)icon_init_from_pr(na_icon, na_ic_pr);
- ***************
- *** 569,574
- FRAME_ICON, icon,
- 0);
-
- create_panel();
- create_main_window();
- create_attr_frame(); /* normally hidden */
-
- --- 628,634 -----
- FRAME_ICON, icon,
- 0);
-
- + closed_rect = (Rect *)window_get(frame, FRAME_CLOSED_RECT);
- create_panel();
- create_main_window();
- create_attr_frame(); /* normally hidden */
- ***************
- *** 594,600
-
- window_main_loop(frame);
-
- ! cleanup();
- }
-
-
-
- --- 654,660 -----
-
- window_main_loop(frame);
-
- ! leave();
- }
-
-
- ***************
- *** 613,631
- (void) notify_set_itimer_func(frame, itimer_handler, ITIMER_REAL, &cal_timer, NULL);
- get_today();
- /* update date/time displayed in the panel */
- ! panel_set(clock_pi, PANEL_LABEL_STRING, todays_date, 0);
- ! if (show_time && (int)window_get(frame, FRAME_CLOSED)) {
- ! strcpy(timestr, todays_date+10);
- ! if (update_interval == 60)
- ! /* display hh:mm */
- ! timestr[6] = '\0';
- ! else
- ! /* display hh:mm:ss */
- ! timestr[9] = '\0';
- ! cur_icon = (Icon) window_get(frame, FRAME_ICON);
- ! icon_set(cur_icon, ICON_LABEL, timestr, 0);
- ! window_set(frame, FRAME_ICON, cur_icon, 0);
- ! }
- #ifndef NO_SUN_MOON
- /* update data in Sun Data frame (if it's open) */
- if (sframe)
-
- --- 673,681 -----
- (void) notify_set_itimer_func(frame, itimer_handler, ITIMER_REAL, &cal_timer, NULL);
- get_today();
- /* update date/time displayed in the panel */
- ! panel_set(clock_pi, PANEL_LABEL_STRING, clockstr, 0);
- ! if (show_time && (int)window_get(frame, FRAME_CLOSED))
- ! update_icon_time();
- #ifndef NO_SUN_MOON
- /* update data in Sun Data frame (if it's open) */
- if (sframe)
- ***************
- *** 739,745
- }
- } else {
- /* notify the user via the console (once) ... */
- ! if (beep && sno != echoed_sno) {
- echoed_sno = sno;
- window_bell(frame);
- if ((console = fopen("/dev/console", "w")) != NULL) {
-
- --- 789,795 -----
- }
- } else {
- /* notify the user via the console (once) ... */
- ! if ((beep || beep_open) && sno != echoed_sno) {
- echoed_sno = sno;
- window_bell(frame);
- if (beep_open)
- ***************
- *** 742,751
- if (beep && sno != echoed_sno) {
- echoed_sno = sno;
- window_bell(frame);
- ! if ((console = fopen("/dev/console", "w")) != NULL) {
- ! fprintf(console, "%s\n", slots[sno].cur_appt->str);
- ! fclose(console);
- ! }
- /*
- * also put a copy in ~/.msgfile, in case
- * nlock(1) is running
-
- --- 792,804 -----
- if ((beep || beep_open) && sno != echoed_sno) {
- echoed_sno = sno;
- window_bell(frame);
- ! if (beep_open)
- ! window_set(frame, FRAME_CLOSED, FALSE, 0);
- ! if (beep)
- ! if ((console = fopen("/dev/console", "w")) != NULL) {
- ! fprintf(console, "<< %s >> %s\n", progname, slots[sno].cur_appt->str);
- ! fclose(console);
- ! }
- /*
- * also put a copy in ~/.msgfile, in case
- * nlock(1) is running
- ***************
- *** 771,778
- /* so that it opens on today */
- olddate = current = today;
- /* update date field of the icons */
- ! strncpy(datestr_mon, todays_date+4, 3);
- ! strncpy(datestr_day, todays_date+8, 2);
- /* replace the date */
- where.pr = ic_pr;
- where.pos.x = 13;
-
- --- 824,830 -----
- /* so that it opens on today */
- olddate = current = today;
- /* update date field of the icons */
- ! sprintf(datestr_day, "%d", today.tm_mday);
- /* replace the date */
- where.pr = ic_pr;
- where.pos.x = 13;
- ***************
- *** 790,796
- pf_ttext(where, PIX_SRC, sfont, datestr_day);
- where.pos.x = 39;
- where.pr = ic_pr;
- ! pf_ttext(where, PIX_NOT(PIX_SRC), sfont, datestr_mon);
- where.pr = na_ic_pr;
- pf_ttext(where, PIX_NOT(PIX_SRC), sfont, datestr_mon);
- where.pr = rev_ic_pr;
-
- --- 842,848 -----
- pf_ttext(where, PIX_SRC, sfont, datestr_day);
- where.pos.x = 39;
- where.pr = ic_pr;
- ! pf_ttext(where, PIX_NOT(PIX_SRC), sfont, smonthnames[today.tm_mon]);
- where.pr = na_ic_pr;
- pf_ttext(where, PIX_NOT(PIX_SRC), sfont, smonthnames[today.tm_mon]);
- where.pr = rev_ic_pr;
- ***************
- *** 792,798
- where.pr = ic_pr;
- pf_ttext(where, PIX_NOT(PIX_SRC), sfont, datestr_mon);
- where.pr = na_ic_pr;
- ! pf_ttext(where, PIX_NOT(PIX_SRC), sfont, datestr_mon);
- where.pr = rev_ic_pr;
- pf_ttext(where, PIX_SRC, sfont, datestr_mon);
- icon_set(icon, ICON_IMAGE, ic_pr, 0);
-
- --- 844,850 -----
- where.pr = ic_pr;
- pf_ttext(where, PIX_NOT(PIX_SRC), sfont, smonthnames[today.tm_mon]);
- where.pr = na_ic_pr;
- ! pf_ttext(where, PIX_NOT(PIX_SRC), sfont, smonthnames[today.tm_mon]);
- where.pr = rev_ic_pr;
- pf_ttext(where, PIX_SRC, sfont, smonthnames[today.tm_mon]);
- icon_set(icon, ICON_IMAGE, ic_pr, 0);
- ***************
- *** 794,800
- where.pr = na_ic_pr;
- pf_ttext(where, PIX_NOT(PIX_SRC), sfont, datestr_mon);
- where.pr = rev_ic_pr;
- ! pf_ttext(where, PIX_SRC, sfont, datestr_mon);
- icon_set(icon, ICON_IMAGE, ic_pr, 0);
- icon_set(rev_icon, ICON_IMAGE, rev_ic_pr, 0);
- icon_set(na_icon, ICON_IMAGE, na_ic_pr, 0);
-
- --- 846,852 -----
- where.pr = na_ic_pr;
- pf_ttext(where, PIX_NOT(PIX_SRC), sfont, smonthnames[today.tm_mon]);
- where.pr = rev_ic_pr;
- ! pf_ttext(where, PIX_SRC, sfont, smonthnames[today.tm_mon]);
- icon_set(icon, ICON_IMAGE, ic_pr, 0);
- icon_set(rev_icon, ICON_IMAGE, rev_ic_pr, 0);
- icon_set(na_icon, ICON_IMAGE, na_ic_pr, 0);
- ***************
- *** 824,830
- }
-
- static Notify_value
- ! cleanup(me, signal, when)
- Notify_client me;
- int signal;
- Notify_signal_mode when;
-
- --- 876,882 -----
- }
-
- static Notify_value
- ! leave(me, signal, when)
- Notify_client me;
- int signal;
- Notify_signal_mode when;
- ***************
- *** 831,836
- {
- if (day_is_open)
- close_day();
- if (access(tmpapts_pathname, R_OK) == 0 && unlink(tmpapts_pathname) < 0)
- perror(tmpapts_pathname);
- exit(0);
-
- --- 883,894 -----
- {
- if (day_is_open)
- close_day();
- +
- + /* create outdated include files (if necessary) */
- + if (save_old || expire_days)
- + expire(expire_days);
- +
- + /* delete tmp file */
- if (access(tmpapts_pathname, R_OK) == 0 && unlink(tmpapts_pathname) < 0)
- perror(tmpapts_pathname);
- exit(0);
- *** /tmp/,RCSt1a16942 Fri Dec 15 17:23:02 1989
- --- holidays.c Fri Dec 15 17:17:37 1989
- ***************
- *** 1,5
- /*
- ! * $Header: holidays.c,v 2.1 89/05/09 14:19:10 billr Exp $
- */
- /*
- * holidays.c
-
- --- 1,5 -----
- /*
- ! * $Header: holidays.c,v 2.2 89/12/15 17:17:34 billr Exp $
- */
- /*
- * holidays.c
- ***************
- *** 81,86
-
- extern struct tm current; /* current day displayed from calentool */
- int marked_note;
-
- int
- a_dates(appt, flag)
-
- --- 81,87 -----
-
- extern struct tm current; /* current day displayed from calentool */
- int marked_note;
- + int save_year = -1;
-
- int
- a_dates(appt, flag)
- ***************
- *** 277,282
- double day, hday;
- char *julian_time();
-
- hday = (*func)(current.tm_year+1900);
- gregorian_date(&day, &month, &year, hday);
- if (current.tm_mon == --month && current.tm_mday == (int)day) {
-
- --- 278,287 -----
- double day, hday;
- char *julian_time();
-
- + if (current.tm_year != save_year) {
- + datelib_init(current.tm_year+1900);
- + save_year = current.tm_year;
- + }
- hday = (*func)(current.tm_year+1900);
- gregorian_date(&day, &month, &year, hday);
- if (current.tm_mon == --month && current.tm_mday == (int)day) {
- ***************
- *** 284,289
- aptr->month = current.tm_mon;
- aptr->day = current.tm_mday;
- aptr->arrows = aptr->repeat = aptr->lookahead = 0;
- aptr->flags = (A_NOTE | READONLY);
- if (marked_note)
- aptr->flags |= MARKED;
-
- --- 289,295 -----
- aptr->month = current.tm_mon;
- aptr->day = current.tm_mday;
- aptr->arrows = aptr->repeat = aptr->lookahead = 0;
- + aptr->runlength = 0;
- aptr->flags = (A_NOTE | READONLY);
- if (marked_note)
- aptr->flags |= MARKED;
- ***************
- *** 311,316
- int month, year;
- int match = 0;
-
- (void)(*func)(current.tm_year+1900, &nr_dates, &date1, &date2, &year1, &year2);
- gregorian_date(&day, &month, &year, date1);
- if (current.tm_mon == --month && current.tm_mday == (int)day)
-
- --- 317,326 -----
- int month, year;
- int match = 0;
-
- + if (current.tm_year != save_year) {
- + datelib_init(current.tm_year+1900);
- + save_year = current.tm_year;
- + }
- (void)(*func)(current.tm_year+1900, &nr_dates, &date1, &date2, &year1, &year2);
- gregorian_date(&day, &month, &year, date1);
- if (current.tm_mon == --month && current.tm_mday == (int)day)
- ***************
- *** 325,330
- aptr->month = current.tm_mon;
- aptr->day = current.tm_mday;
- aptr->arrows = aptr->repeat = aptr->lookahead = 0;
- aptr->flags = (A_NOTE | READONLY);
- if (marked_note)
- aptr->flags |= MARKED;
-
- --- 335,341 -----
- aptr->month = current.tm_mon;
- aptr->day = current.tm_mday;
- aptr->arrows = aptr->repeat = aptr->lookahead = 0;
- + aptr->runlength = 0;
- aptr->flags = (A_NOTE | READONLY);
- if (marked_note)
- aptr->flags |= MARKED;
- ***************
- *** 352,357
- double hday, day;
- char buf[32];
-
- hday = (*func)(current.tm_year+1900, &jyear);
- gregorian_date(&day, &month, &year, hday);
- if (current.tm_mon == --month && current.tm_mday == (int)day) {
-
- --- 363,372 -----
- double hday, day;
- char buf[32];
-
- + if (current.tm_year != save_year) {
- + datelib_init(current.tm_year+1900);
- + save_year = current.tm_year;
- + }
- hday = (*func)(current.tm_year+1900, &jyear);
- gregorian_date(&day, &month, &year, hday);
- if (current.tm_mon == --month && current.tm_mday == (int)day) {
- ***************
- *** 360,365
- aptr->month = current.tm_mon;
- aptr->day = current.tm_mday;
- aptr->arrows = aptr->repeat = aptr->lookahead = 0;
- aptr->flags = (A_NOTE | READONLY);
- if (marked_note)
- aptr->flags |= MARKED;
-
- --- 375,381 -----
- aptr->month = current.tm_mon;
- aptr->day = current.tm_mday;
- aptr->arrows = aptr->repeat = aptr->lookahead = 0;
- + aptr->runlength = 0;
- aptr->flags = (A_NOTE | READONLY);
- if (marked_note)
- aptr->flags |= MARKED;
- *** /tmp/,RCSt1a16948 Fri Dec 15 17:23:08 1989
- --- init.c Fri Dec 15 17:17:43 1989
- ***************
- *** 1,5
- /*
- ! * $Header: init.c,v 2.2 89/07/19 20:27:59 billr Exp $
- */
- /*
- * init.c
-
- --- 1,5 -----
- /*
- ! * $Header: init.c,v 2.3 89/12/15 17:17:39 billr Exp $
- */
- /*
- * init.c
- ***************
- *** 424,431
- return(1);
- }
- }
- ! if (access(apts_pathname, W_OK) == -1)
- ! read_only = 1;
- /*
- * set permissions on tmp file based on .appointments file
- * with the expception that we need at least write permission
-
- --- 424,432 -----
- return(1);
- }
- }
- ! if (!read_only)
- ! if (access(apts_pathname, W_OK) == -1)
- ! read_only = 1;
- /*
- * set permissions on tmp file based on .appointments file
- * with the expception that we need at least write permission
- *** /tmp/,RCSt1a16953 Fri Dec 15 17:23:13 1989
- --- mpaint.c Fri Dec 15 17:17:47 1989
- ***************
- *** 1,5
- /*
- ! * $Header: mpaint.c,v 2.2 89/07/19 20:29:01 billr Exp $
- */
- /*
- * mpaint.c
-
- --- 1,5 -----
- /*
- ! * $Header: mpaint.c,v 2.3 89/12/15 17:17:44 billr Exp $
- */
- /*
- * mpaint.c
- ***************
- *** 52,57
- int read_stat;
- struct tm Save;
- struct appt_entry appt;
-
- lock_cursors();
- /* destory future appts popup, if it exists */
-
- --- 52,58 -----
- int read_stat;
- struct tm Save;
- struct appt_entry appt;
- + int runl;
-
- lock_cursors();
- /* destory future appts popup, if it exists */
- ***************
- *** 91,97
- fix_current_day();
- Last = current;
- working(FALSE);
- ! while ((read_stat = get_aentry(apts, &appt)) != EOF) {
- if (read_stat)
- continue; /* read error (ignore) */
- if (appt.flags & A_COMMENT)
-
- --- 92,98 -----
- fix_current_day();
- Last = current;
- working(FALSE);
- ! while ((read_stat = get_aentry(apts, &appt, FALSE)) != EOF) {
- if (read_stat)
- continue; /* read error (ignore) */
- if (appt.flags & A_COMMENT)
- ***************
- *** 125,133
- } else if ((appt.flags & REPEAT) && !(appt.flags & ALL_DAYS)) {
- if (appt.flags & EVERY_SOMEDAY)
- continue;
- ! while (ymd_compare(current, First) < 0) {
- ! current.tm_mday += appt.repeat;
- ! fix_current_day();
- }
- while (ymd_compare(current, Last) <= 0) {
- busy_today[current.tm_mday-1]++;
-
- --- 126,142 -----
- } else if ((appt.flags & REPEAT) && !(appt.flags & ALL_DAYS)) {
- if (appt.flags & EVERY_SOMEDAY)
- continue;
- ! if (appt.flags & RUN)
- ! runl = appt.runlength;
- ! else
- ! runl = 1;
- ! while (ymd_compare(current, First) < 0 && runl) {
- ! if (appt.flags & RUN)
- ! --runl;
- ! if (runl) {
- ! current.tm_mday += appt.repeat;
- ! fix_current_day();
- ! }
- }
- while (ymd_compare(current, Last) <= 0 && runl) {
- if (runl) {
- ***************
- *** 129,138
- current.tm_mday += appt.repeat;
- fix_current_day();
- }
- ! while (ymd_compare(current, Last) <= 0) {
- ! busy_today[current.tm_mday-1]++;
- ! current.tm_mday += appt.repeat;
- ! fix_current_day();
- }
- } else if (current.tm_year == First.tm_year
- && current.tm_mon == First.tm_mon) {
-
- --- 138,151 -----
- fix_current_day();
- }
- }
- ! while (ymd_compare(current, Last) <= 0 && runl) {
- ! if (runl) {
- ! busy_today[current.tm_mday-1]++;
- ! current.tm_mday += appt.repeat;
- ! fix_current_day();
- ! if (appt.flags & RUN)
- ! --runl;
- ! }
- }
- } else if (current.tm_year == First.tm_year
- && current.tm_mon == First.tm_mon) {
- ***************
- *** 177,184
- #endif
-
- y = top_border; /* Draw all day boxes. */
- ! x = 64*start_dow + left_border;
- ! days_in_week = start_dow;
- c[0] = ' ';
- c[1] = '1';
- c[2] = ' ';
-
- --- 190,207 -----
- #endif
-
- y = top_border; /* Draw all day boxes. */
- ! if (monday_first) {
- ! if (start_dow == SUN) {
- ! x = 64*6 + left_border;
- ! days_in_week = 6;
- ! } else {
- ! x = 64*(start_dow - 1) + left_border;
- ! days_in_week = start_dow -1 ;
- ! }
- ! } else {
- ! x = 64*start_dow + left_border;
- ! days_in_week = start_dow;
- ! }
- c[0] = ' ';
- c[1] = '1';
- c[2] = ' ';
- ***************
- *** 218,226
- }
- x = left_border + 27;
- y = top_border - 16;
- ! for (i=0; i<7; i++) { /* Sun Mon ... Sat */
- ! pw_char(main_pixwin,x,y,PIX_SRC,bigfont,daynames[i][0]);
- ! x += 64;
- }
-
- bottom_border = boxlims[n_days-1].highy;
-
- --- 241,257 -----
- }
- x = left_border + 27;
- y = top_border - 16;
- ! if (monday_first) {
- ! for (i=1; i<7; i++) { /* Mon ... Sat Sun */
- ! pw_char(main_pixwin,x,y,PIX_SRC,bigfont,daynames[i][0]);
- ! x += 64;
- ! }
- ! pw_char(main_pixwin,x,y,PIX_SRC,bigfont,daynames[0][0]);
- ! } else {
- ! for (i=0; i<7; i++) { /* Sun Mon ... Sat */
- ! pw_char(main_pixwin,x,y,PIX_SRC,bigfont,daynames[i][0]);
- ! x += 64;
- ! }
- }
-
- bottom_border = boxlims[n_days-1].highy;
- *** /tmp/,RCSt1a16958 Fri Dec 15 17:23:18 1989
- --- notify.c Fri Dec 15 17:17:55 1989
- ***************
- *** 1,5
- /*
- ! * $Header: notify.c,v 2.1 89/05/09 14:23:13 billr Exp $
- */
- /*
- * notify.c
-
- --- 1,5 -----
- /*
- ! * $Header: notify.c,v 2.2 89/12/15 17:17:49 billr Exp $
- */
- /*
- * notify.c
- ***************
- *** 53,58
- extern Panel_item repeat_pi, remind_pi, daysel_pi;
- extern Panel_item everyx_pi, whichwk_pi, marked_pi;
- extern Panel_item del_choice_pi, setdate_pi;
- #ifndef NO_SUN_MOON
- extern Frame mframe, sframe;
- extern Panel_item moonbutton_pi, sunbutton_pi;
-
- --- 53,59 -----
- extern Panel_item repeat_pi, remind_pi, daysel_pi;
- extern Panel_item everyx_pi, whichwk_pi, marked_pi;
- extern Panel_item del_choice_pi, setdate_pi;
- + extern Panel_item runl_pi;
- #ifndef NO_SUN_MOON
- extern Frame mframe, sframe;
- extern Panel_item moonbutton_pi, sunbutton_pi;
- ***************
- *** 77,83
- extern int show_future;
- extern int show_time;
- extern int update_interval;
- - extern char todays_date[], timestr[];
- extern struct appt_entry shelf_appt;
-
- int i;
-
- --- 78,83 -----
- extern int show_future;
- extern int show_time;
- extern int update_interval;
- extern struct appt_entry shelf_appt;
- extern int day_first;
-
- ***************
- *** 79,84
- extern int update_interval;
- extern char todays_date[], timestr[];
- extern struct appt_entry shelf_appt;
-
- int i;
-
-
- --- 79,85 -----
- extern int show_time;
- extern int update_interval;
- extern struct appt_entry shelf_appt;
- + extern int day_first;
-
- int i;
-
- ***************
- *** 419,425
- break;
-
- case 5: /* change date */
- ! sprintf(date, "%d/%d/%02d", Save.tm_mon+1, Save.tm_mday, Save.tm_year);
- panel_set_value(setdate_pi, date);
- do {
- window_loop(date_frame);
-
- --- 420,429 -----
- break;
-
- case 5: /* change date */
- ! if (day_first)
- ! sprintf(date, "%d/%d/%02d", Save.tm_mday, Save.tm_mon+1, Save.tm_year);
- ! else
- ! sprintf(date, "%d/%d/%02d", Save.tm_mon+1, Save.tm_mday, Save.tm_year);
- panel_set_value(setdate_pi, date);
- do {
- window_loop(date_frame);
- ***************
- *** 1018,1023
- new_entry = 1;
- flag |= LOOKAHEAD;
- apt->lookahead = value;
- }
- }
-
-
- --- 1022,1037 -----
- new_entry = 1;
- flag |= LOOKAHEAD;
- apt->lookahead = value;
- + }
- + }
- +
- + /* get runlength value */
- + value = atoi((char *)panel_get_value(runl_pi));
- + if (value > 0) {
- + if (apt->runlength != value) {
- + new_entry = 1;
- + flag |= RUN;
- + apt->runlength = value;
- }
- }
-
- *** /tmp/,RCSt1a16963 Fri Dec 15 17:23:25 1989
- --- paint.h Fri Dec 15 17:17:59 1989
- ***************
- *** 1,5
- /*
- ! * $Header: paint.h,v 2.1 89/05/09 14:25:24 billr Exp $
- */
- /*
- * paint.h
-
- --- 1,5 -----
- /*
- ! * $Header: paint.h,v 2.2 89/12/15 17:17:57 billr Exp $
- */
- /*
- * paint.h
- ***************
- *** 22,27
- * notice remains intact.
- */
-
- #include <suntool/panel.h>
-
- extern Pixfont *font, *bigfont;
-
- --- 22,28 -----
- * notice remains intact.
- */
-
- + #ifndef NOTOOL
- #include <suntool/panel.h>
-
- extern Pixfont *font, *bigfont;
- ***************
- *** 27,34
- extern Pixfont *font, *bigfont;
- extern Canvas canvas;
- extern Pixwin *main_pixwin;
- - extern struct tm current, today, First, Last;
- - extern struct dayslot slots[];
- extern Pixrect *timeslot_pr, *daybox_pr, *weekarrow_pr, *weekslot_pr;
- extern Pixrect *weekarrowshaft_pr, *weekarrowhead_pr;
- extern Pixrect *triangle_pr;
-
- --- 28,33 -----
- extern Pixfont *font, *bigfont;
- extern Canvas canvas;
- extern Pixwin *main_pixwin;
- extern Pixrect *timeslot_pr, *daybox_pr, *weekarrow_pr, *weekslot_pr;
- extern Pixrect *weekarrowshaft_pr, *weekarrowhead_pr;
- extern Pixrect *triangle_pr;
- ***************
- *** 38,44
- extern struct weekrect week_boxes[];
- extern int x_coord, y_coord, startx, starty;
- extern int mainsw_state;
- - extern int dayslot_width, nr_weekdays, max_strlen, n_tslots;
- extern int dayslot_height, weekslot_height, weekslot_width;
- extern int ybox_height, ybox_width;
- extern struct rect_limits boxlims[];
-
- --- 37,42 -----
- extern struct weekrect week_boxes[];
- extern int x_coord, y_coord, startx, starty;
- extern int mainsw_state;
- extern int dayslot_height, weekslot_height, weekslot_width;
- extern int ybox_height, ybox_width;
- extern struct rect_limits boxlims[];
- ***************
- *** 44,49
- extern struct rect_limits boxlims[];
- extern struct rect_limits mboxlims[];
- extern struct week_arrow week_arrows[];
- extern char apts_pathname[], tmpapts_pathname[];
- extern int read_only, day_is_open, version2;
- extern char *progname;
-
- --- 42,50 -----
- extern struct rect_limits boxlims[];
- extern struct rect_limits mboxlims[];
- extern struct week_arrow week_arrows[];
- + extern Frame fframe;
- + extern int hour24, monday_first, day_first;
- + #endif /* NOTOOL */
- extern char apts_pathname[], tmpapts_pathname[];
- extern int read_only, day_is_open, version2;
- extern char *progname;
- ***************
- *** 47,53
- extern char apts_pathname[], tmpapts_pathname[];
- extern int read_only, day_is_open, version2;
- extern char *progname;
- - extern Frame fframe;
- extern char *daynames[], *monthnames[];
- #ifndef NO_HOLIDAYS
- extern int holiday_a, holiday_c, holiday_i, holiday_j, holiday_s;
-
- --- 48,53 -----
- extern char apts_pathname[], tmpapts_pathname[];
- extern int read_only, day_is_open, version2;
- extern char *progname;
- extern char *daynames[], *monthnames[];
- extern int dayslot_width, nr_weekdays, max_strlen, n_tslots;
- extern struct tm current, today, First, Last;
- ***************
- *** 49,54
- extern char *progname;
- extern Frame fframe;
- extern char *daynames[], *monthnames[];
- #ifndef NO_HOLIDAYS
- extern int holiday_a, holiday_c, holiday_i, holiday_j, holiday_s;
-
-
- --- 49,57 -----
- extern int read_only, day_is_open, version2;
- extern char *progname;
- extern char *daynames[], *monthnames[];
- + extern int dayslot_width, nr_weekdays, max_strlen, n_tslots;
- + extern struct tm current, today, First, Last;
- + extern struct dayslot slots[];
- #ifndef NO_HOLIDAYS
- extern int holiday_a, holiday_c, holiday_i, holiday_j, holiday_s;
-
- *** /tmp/,RCSt1a16968 Fri Dec 15 17:23:28 1989
- --- patchlevel.h Fri Dec 15 17:18:02 1989
- ***************
- *** 1,5
- /*
- ! * $Header: patchlevel.h,v 2.5 89/09/19 06:19:56 billr Exp $
- */
- /*
- * patchlevel.h - current patchlevel of calentool program
-
- --- 1,5 -----
- /*
- ! * $Header: patchlevel.h,v 2.6 89/12/15 17:18:00 billr Exp $
- */
- /*
- * patchlevel.h - current patchlevel of calentool program
- ***************
- *** 5,8
- * patchlevel.h - current patchlevel of calentool program
- */
-
- ! #define PATCHLEVEL 4
-
- --- 5,8 -----
- * patchlevel.h - current patchlevel of calentool program
- */
-
- ! #define PATCHLEVEL 5
- *** /tmp/,RCSt1a16973 Fri Dec 15 17:23:32 1989
- --- put_aentry.c Fri Dec 15 17:18:06 1989
- ***************
- *** 1,5
- /*
- ! * $Header: put_aentry.c,v 2.1 89/05/09 14:19:36 billr Exp $
- */
- /*
- * put_aentry - write calentool style files
-
- --- 1,5 -----
- /*
- ! * $Header: put_aentry.c,v 2.2 89/12/15 17:18:04 billr Exp $
- */
- /*
- * put_aentry - write calentool style files
- ***************
- *** 91,96
-
- if (appt->flags & LOOKAHEAD)
- fprintf(apts_file, "<%d> ", appt->lookahead);
- if (appt->flags & DELETED)
- fprintf(apts_file, "# %s", appt->str);
- else
-
- --- 91,98 -----
-
- if (appt->flags & LOOKAHEAD)
- fprintf(apts_file, "<%d> ", appt->lookahead);
- + if (appt->flags & RUN)
- + fprintf(apts_file, "+%d ", appt->runlength);
- if (appt->flags & DELETED)
- fprintf(apts_file, "# %s", appt->str);
- else
- *** /tmp/,RCSt1a16978 Fri Dec 15 17:23:36 1989
- --- ras2ps.c Fri Dec 15 17:18:10 1989
- ***************
- *** 1,5
- /*
- ! * $Header: ras2ps.c,v 2.2 89/07/19 20:30:25 billr Exp $
- */
- /*
- * ras2ps - convert Sun raster file to RLL Postscript file
-
- --- 1,5 -----
- /*
- ! * $Header: ras2ps.c,v 2.3 89/12/15 17:18:07 billr Exp $
- */
- /*
- * ras2ps - convert Sun raster file to RLL Postscript file
- ***************
- *** 91,97
- sizey = 10.0;
- transx = transy = 0.5;
- inv = 0;
- ! rotate = 90.0;
- ofile = outfile;
-
- if (pr_load_header(infile, &rh) != 0)
-
- --- 91,97 -----
- sizey = 10.0;
- transx = transy = 0.5;
- inv = 0;
- ! rotate = 0.0;
- ofile = outfile;
-
- if (pr_load_header(infile, &rh) != 0)
- *** /tmp/,RCSt1a16983 Fri Dec 15 17:23:40 1989
- --- riseset.c Fri Dec 15 17:18:14 1989
- ***************
- *** 1,5
- /*
- ! * $Header: riseset.c,v 2.2 89/07/19 20:31:05 billr Exp $
- */
- /*
- * riseset.c
-
- --- 1,5 -----
- /*
- ! * $Header: riseset.c,v 2.3 89/12/15 17:18:11 billr Exp $
- */
- /*
- * riseset.c
- ***************
- *** 46,51
- #include "riseset.h"
-
- extern char *daynames[], *monthnames[];
-
- long UTC, TDT, tim, tim2;
- double Julian_Day, MJD, Tu, Ru, T70, Local, GMST, LST;
-
- --- 46,52 -----
- #include "riseset.h"
-
- extern char *daynames[], *monthnames[];
- + extern int day_first;
-
- long UTC, TDT, tim, tim2;
- double Julian_Day, MJD, Tu, Ru, T70, Local, GMST, LST;
- ***************
- *** 134,141
- ltm = localtime(&UTC);
- sprintf(riseset_buf[B_LCT], "%.24s Local Civil Time", asctime(ltm));
-
- ! sprintf(riseset_buf[B_DMY], "%s %s %d, %d", daynames[ltm->tm_wday],
- ! monthnames[ltm->tm_mon], ltm->tm_mday, ltm->tm_year+1900);
- tim2 = UTC + (long)(Local + Round); /* Compute Local Solar Time */
- tdate= gmctime(&tim2);
- *(tdate+19) = '\0';
-
- --- 135,146 -----
- ltm = localtime(&UTC);
- sprintf(riseset_buf[B_LCT], "%.24s Local Civil Time", asctime(ltm));
-
- ! if (day_first)
- ! sprintf(riseset_buf[B_DMY], "%s %d %s %d", daynames[ltm->tm_wday],
- ! ltm->tm_mday, monthnames[ltm->tm_mon], ltm->tm_year+1900);
- ! else
- ! sprintf(riseset_buf[B_DMY], "%s %s %d, %d", daynames[ltm->tm_wday],
- ! monthnames[ltm->tm_mon], ltm->tm_mday, ltm->tm_year+1900);
- tim2 = UTC + (long)(Local + Round); /* Compute Local Solar Time */
- tdate= gmctime(&tim2);
- *(tdate+19) = '\0';
- *** /tmp/,RCSt1a16988 Fri Dec 15 17:23:45 1989
- --- tool.c Fri Dec 15 17:18:22 1989
- ***************
- *** 1,5
- /*
- ! * $Header: tool.c,v 2.2 89/07/19 20:31:31 billr Exp $
- */
- /*
- * tool.c
-
- --- 1,5 -----
- /*
- ! * $Header: tool.c,v 2.3 89/12/15 17:18:15 billr Exp $
- */
- /*
- * tool.c
- ***************
- *** 45,50
- Panel_item monthmenu_pi, yearmenu_pi, weekbutton_pi, daybutton_pi;
- Panel_item previous_pi, next_pi, current_pi, filebutton_pi;
- Panel_item clock_pi;
- #ifndef NO_PRINTER
- Panel_item printbutton_pi;
- #endif
-
- --- 45,51 -----
- Panel_item monthmenu_pi, yearmenu_pi, weekbutton_pi, daybutton_pi;
- Panel_item previous_pi, next_pi, current_pi, filebutton_pi;
- Panel_item clock_pi;
- + Panel_item runl_pi;
- #ifndef NO_PRINTER
- Panel_item printbutton_pi;
- #endif
- ***************
- *** 125,130
- Notify_value check_close();
- int monthlength();
- char year_str[NR_YEARS][5]; /* holds strings for year menu */
- extern Pixwin *main_pixwin;
- extern Cursor day_cursor, wait_cursor;
- extern int day_is_open, mainsw_state;
-
- --- 126,132 -----
- Notify_value check_close();
- int monthlength();
- char year_str[NR_YEARS][5]; /* holds strings for year menu */
- + Rect *closed_rect;
- extern Pixwin *main_pixwin;
- extern Cursor day_cursor, wait_cursor;
- extern int day_is_open, mainsw_state;
- ***************
- *** 128,134
- extern Pixwin *main_pixwin;
- extern Cursor day_cursor, wait_cursor;
- extern int day_is_open, mainsw_state;
- ! extern char todays_date[];
- extern struct appt_entry future[];
- extern int findex;
- extern struct dayslot slots[];
-
- --- 130,136 -----
- extern Pixwin *main_pixwin;
- extern Cursor day_cursor, wait_cursor;
- extern int day_is_open, mainsw_state;
- ! extern char clockstr[];
- extern struct appt_entry future[];
- extern int findex;
- extern struct dayslot slots[];
- ***************
- *** 136,141
- extern Pixrect moon_icon_pr, sun_icon_pr;
- #endif
- extern char printer[];
-
- /* Create and init control panel */
- create_panel()
-
- --- 138,144 -----
- extern Pixrect moon_icon_pr, sun_icon_pr;
- #endif
- extern char printer[];
- + extern int day_first;
-
- /* Create and init control panel */
- create_panel()
- ***************
- *** 288,293
-
- width = (int)window_get(panel, WIN_WIDTH);
-
- clock_pi = panel_create_item(panel, PANEL_MESSAGE,
- PANEL_ITEM_X, width-150-(strlen(todays_date)*font->pf_defaultsize.x),
- PANEL_ITEM_Y, ATTR_ROW(2)+3,
-
- --- 291,297 -----
-
- width = (int)window_get(panel, WIN_WIDTH);
-
- + get_today(); /* get current date and time */
- clock_pi = panel_create_item(panel, PANEL_MESSAGE,
- PANEL_ITEM_X, width-150-(strlen(clockstr)*font->pf_defaultsize.x),
- PANEL_ITEM_Y, ATTR_ROW(2)+3,
- ***************
- *** 289,295
- width = (int)window_get(panel, WIN_WIDTH);
-
- clock_pi = panel_create_item(panel, PANEL_MESSAGE,
- ! PANEL_ITEM_X, width-150-(strlen(todays_date)*font->pf_defaultsize.x),
- PANEL_ITEM_Y, ATTR_ROW(2)+3,
- PANEL_LABEL_STRING, todays_date,
- PANEL_LABEL_FONT, font,
-
- --- 293,299 -----
-
- get_today(); /* get current date and time */
- clock_pi = panel_create_item(panel, PANEL_MESSAGE,
- ! PANEL_ITEM_X, width-150-(strlen(clockstr)*font->pf_defaultsize.x),
- PANEL_ITEM_Y, ATTR_ROW(2)+3,
- PANEL_LABEL_STRING, clockstr,
- PANEL_LABEL_FONT, font,
- ***************
- *** 291,297
- clock_pi = panel_create_item(panel, PANEL_MESSAGE,
- PANEL_ITEM_X, width-150-(strlen(todays_date)*font->pf_defaultsize.x),
- PANEL_ITEM_Y, ATTR_ROW(2)+3,
- ! PANEL_LABEL_STRING, todays_date,
- PANEL_LABEL_FONT, font,
- 0);
-
-
- --- 295,301 -----
- clock_pi = panel_create_item(panel, PANEL_MESSAGE,
- PANEL_ITEM_X, width-150-(strlen(clockstr)*font->pf_defaultsize.x),
- PANEL_ITEM_Y, ATTR_ROW(2)+3,
- ! PANEL_LABEL_STRING, clockstr,
- PANEL_LABEL_FONT, font,
- 0);
-
- ***************
- *** 479,485
- if (!fframe) {
- /* create new frame and control panel */
- fframe = window_create(frame, FRAME, FRAME_NO_CONFIRM, TRUE,
- ! WIN_SHOW, TRUE, WIN_X, ATTR_COL(12),
- WIN_Y, slots[N_SLOTS-4].slot_pos.top,
- FRAME_LABEL, "Future Appointments",
- FRAME_SHOW_LABEL, TRUE,
-
- --- 483,489 -----
- if (!fframe) {
- /* create new frame and control panel */
- fframe = window_create(frame, FRAME, FRAME_NO_CONFIRM, TRUE,
- ! WIN_X, ATTR_COL(12),
- WIN_Y, slots[N_SLOTS-4].slot_pos.top,
- FRAME_LABEL, "Future Appointments",
- FRAME_SHOW_LABEL, TRUE,
- ***************
- *** 484,489
- FRAME_LABEL, "Future Appointments",
- FRAME_SHOW_LABEL, TRUE,
- WIN_ERROR_MSG, "Can't create future frame.",
- 0);
-
- fcpanel = window_create(fframe, PANEL, 0);
-
- --- 488,494 -----
- FRAME_LABEL, "Future Appointments",
- FRAME_SHOW_LABEL, TRUE,
- WIN_ERROR_MSG, "Can't create future frame.",
- + FRAME_CLOSED_RECT, closed_rect,
- 0);
-
- fcpanel = window_create(fframe, PANEL, 0);
- ***************
- *** 553,558
- 0);
- }
- window_fit(fframe);
- }
-
- /*
-
- --- 558,564 -----
- 0);
- }
- window_fit(fframe);
- + window_set(fframe, WIN_SHOW, TRUE, 0);
- }
-
- /*
- ***************
- *** 567,572
- attr_frame = window_create(frame, FRAME, FRAME_NO_CONFIRM, TRUE,
- FRAME_SHOW_LABEL, FALSE,
- WIN_ERROR_MSG, "Can't create attributes frame.",
- 0);
-
- attr_panel = window_create(attr_frame, PANEL,
-
- --- 573,579 -----
- attr_frame = window_create(frame, FRAME, FRAME_NO_CONFIRM, TRUE,
- FRAME_SHOW_LABEL, FALSE,
- WIN_ERROR_MSG, "Can't create attributes frame.",
- + FRAME_CLOSED_RECT, closed_rect,
- 0);
-
- attr_panel = window_create(attr_frame, PANEL,
- ***************
- *** 631,636
- PANEL_BLINK_CARET, TRUE,
- 0);
-
- remind_pi = panel_create_item(attr_panel, PANEL_TEXT,
- PANEL_SHOW_ITEM, TRUE,
- PANEL_LABEL_STRING,
-
- --- 638,654 -----
- PANEL_BLINK_CARET, TRUE,
- 0);
-
- + runl_pi = panel_create_item(attr_panel, PANEL_TEXT,
- + PANEL_SHOW_ITEM, TRUE,
- + PANEL_LABEL_STRING,
- + "Repeat specified number of times (default forever):",
- + PANEL_VALUE, 0, PANEL_VALUE_STORED_LENGTH, 4,
- + PANEL_VALUE_DISPLAY_LENGTH, 4,
- + PANEL_ITEM_X, ATTR_COL(1),
- + PANEL_ITEM_Y, ATTR_ROW(4),
- + PANEL_BLINK_CARET, TRUE,
- + 0);
- +
- remind_pi = panel_create_item(attr_panel, PANEL_TEXT,
- PANEL_SHOW_ITEM, TRUE,
- PANEL_LABEL_STRING,
- ***************
- *** 638,644
- PANEL_VALUE, 0, PANEL_VALUE_STORED_LENGTH, 4,
- PANEL_VALUE_DISPLAY_LENGTH, 4,
- PANEL_ITEM_X, ATTR_COL(1),
- ! PANEL_ITEM_Y, ATTR_ROW(4),
- PANEL_BLINK_CARET, TRUE,
- 0);
-
-
- --- 656,662 -----
- PANEL_VALUE, 0, PANEL_VALUE_STORED_LENGTH, 4,
- PANEL_VALUE_DISPLAY_LENGTH, 4,
- PANEL_ITEM_X, ATTR_COL(1),
- ! PANEL_ITEM_Y, ATTR_ROW(5),
- PANEL_BLINK_CARET, TRUE,
- 0);
-
- ***************
- *** 651,657
- "Mark in month/year display:",
- PANEL_CHOICE_STRINGS, "Yes", "No", 0,
- PANEL_ITEM_X, ATTR_COL(1),
- ! PANEL_ITEM_Y, ATTR_ROW(5),
- 0);
-
- window_fit(attr_panel);
-
- --- 669,675 -----
- "Mark in month/year display:",
- PANEL_CHOICE_STRINGS, "Yes", "No", 0,
- PANEL_ITEM_X, ATTR_COL(1),
- ! PANEL_ITEM_Y, ATTR_ROW(6),
- 0);
-
- window_fit(attr_panel);
- ***************
- *** 667,672
- del_frame = window_create(frame, FRAME, FRAME_NO_CONFIRM, TRUE,
- FRAME_SHOW_LABEL, FALSE,
- WIN_ERROR_MSG, "Can't create delete frame.",
- 0);
-
- del_panel = window_create(del_frame, PANEL,
-
- --- 685,691 -----
- del_frame = window_create(frame, FRAME, FRAME_NO_CONFIRM, TRUE,
- FRAME_SHOW_LABEL, FALSE,
- WIN_ERROR_MSG, "Can't create delete frame.",
- + FRAME_CLOSED_RECT, closed_rect,
- 0);
-
- del_panel = window_create(del_frame, PANEL,
- ***************
- *** 720,726
- /* create new frame and canvas */
- if (!sframe) {
- sframe = window_create(frame, FRAME, FRAME_NO_CONFIRM, TRUE,
- ! WIN_SHOW, TRUE, WIN_X, ATTR_COL(12),
- FRAME_LABEL, "Solar Data",
- FRAME_SHOW_LABEL, TRUE,
- FRAME_DONE_PROC, sframe_done,
-
- --- 739,745 -----
- /* create new frame and canvas */
- if (!sframe) {
- sframe = window_create(frame, FRAME, FRAME_NO_CONFIRM, TRUE,
- ! WIN_X, ATTR_COL(12),
- FRAME_LABEL, "Solar Data",
- FRAME_SHOW_LABEL, TRUE,
- FRAME_DONE_PROC, sframe_done,
- ***************
- *** 725,730
- FRAME_SHOW_LABEL, TRUE,
- FRAME_DONE_PROC, sframe_done,
- WIN_ERROR_MSG, "Can't create sun data frame.",
- 0);
-
- spanel = window_create(sframe, PANEL, WIN_FONT, font,
-
- --- 744,750 -----
- FRAME_SHOW_LABEL, TRUE,
- FRAME_DONE_PROC, sframe_done,
- WIN_ERROR_MSG, "Can't create sun data frame.",
- + FRAME_CLOSED_RECT, closed_rect,
- 0);
-
- spanel = window_create(sframe, PANEL, WIN_FONT, font,
- ***************
- *** 759,764
-
- write_sun_data();
- window_fit(sframe);
- } else
- write_sun_data();
- }
-
- --- 779,785 -----
-
- write_sun_data();
- window_fit(sframe);
- + window_set(sframe, WIN_SHOW, TRUE, 0);
- } else
- write_sun_data();
- }
- ***************
- *** 773,779
- /* create new frame and canvas */
- if (!mframe) {
- mframe = window_create(frame, FRAME, FRAME_NO_CONFIRM, TRUE,
- ! WIN_SHOW, TRUE, WIN_X, ATTR_COL(12),
- FRAME_LABEL, "Lunar Data",
- FRAME_SHOW_LABEL, TRUE,
- FRAME_INHERIT_COLORS, TRUE,
-
- --- 794,800 -----
- /* create new frame and canvas */
- if (!mframe) {
- mframe = window_create(frame, FRAME, FRAME_NO_CONFIRM, TRUE,
- ! WIN_X, ATTR_COL(12),
- FRAME_LABEL, "Lunar Data",
- FRAME_SHOW_LABEL, TRUE,
- FRAME_FOREGROUND_COLOR, &fg_default,
- ***************
- *** 776,782
- WIN_SHOW, TRUE, WIN_X, ATTR_COL(12),
- FRAME_LABEL, "Lunar Data",
- FRAME_SHOW_LABEL, TRUE,
- - FRAME_INHERIT_COLORS, TRUE,
- FRAME_FOREGROUND_COLOR, &fg_default,
- FRAME_BACKGROUND_COLOR, &bg_default,
- FRAME_DONE_PROC, mframe_done,
-
- --- 797,802 -----
- WIN_X, ATTR_COL(12),
- FRAME_LABEL, "Lunar Data",
- FRAME_SHOW_LABEL, TRUE,
- FRAME_FOREGROUND_COLOR, &fg_default,
- FRAME_BACKGROUND_COLOR, &bg_default,
- FRAME_DONE_PROC, mframe_done,
- ***************
- *** 781,786
- FRAME_BACKGROUND_COLOR, &bg_default,
- FRAME_DONE_PROC, mframe_done,
- WIN_ERROR_MSG, "Can't create moon data frame.",
- 0);
-
- mpanel = window_create(mframe, PANEL, WIN_FONT, font,
-
- --- 801,807 -----
- FRAME_BACKGROUND_COLOR, &bg_default,
- FRAME_DONE_PROC, mframe_done,
- WIN_ERROR_MSG, "Can't create moon data frame.",
- + FRAME_CLOSED_RECT, closed_rect,
- 0);
-
- mpanel = window_create(mframe, PANEL, WIN_FONT, font,
- ***************
- *** 816,821
-
- write_moon_data();
- window_fit(mframe);
- } else
- write_moon_data();
- }
-
- --- 837,843 -----
-
- write_moon_data();
- window_fit(mframe);
- + window_set(mframe, WIN_SHOW, TRUE, 0);
- } else
- write_moon_data();
- }
- ***************
- *** 833,838
- FRAME_SHOW_LABEL, TRUE,
- FRAME_DONE_PROC, fileframe_done,
- WIN_ERROR_MSG, "Can't create file frame.",
- 0);
-
- filepanel = window_create(fileframe, PANEL, WIN_FONT, font,
-
- --- 855,861 -----
- FRAME_SHOW_LABEL, TRUE,
- FRAME_DONE_PROC, fileframe_done,
- WIN_ERROR_MSG, "Can't create file frame.",
- + FRAME_CLOSED_RECT, closed_rect,
- 0);
-
- filepanel = window_create(fileframe, PANEL, WIN_FONT, font,
- ***************
- *** 925,930
- WIN_SHOW, TRUE,
- WIN_X, ATTR_COL(15), WIN_Y, ATTR_ROW(15),
- WIN_ERROR_MSG, "Can't create error frame.",
- 0);
-
- prompt_panel = window_create(prompt_frame, PANEL,
-
- --- 948,954 -----
- WIN_SHOW, TRUE,
- WIN_X, ATTR_COL(15), WIN_Y, ATTR_ROW(15),
- WIN_ERROR_MSG, "Can't create error frame.",
- + FRAME_CLOSED_RECT, closed_rect,
- 0);
-
- prompt_panel = window_create(prompt_frame, PANEL,
- ***************
- *** 995,1000
- FRAME_SHOW_LABEL, TRUE,
- FRAME_DONE_PROC, prframe_done,
- WIN_ERROR_MSG, "Can't create printer frame.",
- 0);
-
- prpanel = window_create(prframe, PANEL, WIN_FONT, font,
-
- --- 1019,1025 -----
- FRAME_SHOW_LABEL, TRUE,
- FRAME_DONE_PROC, prframe_done,
- WIN_ERROR_MSG, "Can't create printer frame.",
- + FRAME_CLOSED_RECT, closed_rect,
- 0);
-
- prpanel = window_create(prframe, PANEL, WIN_FONT, font,
- ***************
- *** 1039,1044
- FRAME_SHOW_LABEL, TRUE,
- FRAME_DONE_PROC, dtframe_done,
- WIN_ERROR_MSG, "Can't create date frame.",
- 0);
-
- dtpanel = window_create(date_frame, PANEL, WIN_FONT, font,
-
- --- 1064,1070 -----
- FRAME_SHOW_LABEL, TRUE,
- FRAME_DONE_PROC, dtframe_done,
- WIN_ERROR_MSG, "Can't create date frame.",
- + FRAME_CLOSED_RECT, closed_rect,
- 0);
-
- dtpanel = window_create(date_frame, PANEL, WIN_FONT, font,
- ***************
- *** 1057,1063
- PANEL_SHOW_ITEM, TRUE,
- PANEL_ITEM_X, ATTR_COL(1),
- PANEL_ITEM_Y, ATTR_ROW(1)+5,
- ! PANEL_LABEL_STRING, "Enter date (D, M/D, or M/D/Y):",
- PANEL_LABEL_FONT, font,
- PANEL_LABEL_BOLD, TRUE,
- PANEL_VALUE_STORED_LENGTH, 10,
-
- --- 1083,1089 -----
- PANEL_SHOW_ITEM, TRUE,
- PANEL_ITEM_X, ATTR_COL(1),
- PANEL_ITEM_Y, ATTR_ROW(1)+5,
- ! PANEL_LABEL_STRING, (day_first ? "Enter date (D, D/M, or D/M/Y):" : "Enter date (D, M/D, or M/D/Y):"),
- PANEL_LABEL_FONT, font,
- PANEL_LABEL_BOLD, TRUE,
- PANEL_VALUE_STORED_LENGTH, 10,
- ***************
- *** 1065,1071
- PANEL_BLINK_CARET, TRUE,
- 0);
-
- ! sprintf(date, "%d/%d/%02d", current.tm_mon+1, current.tm_mday, current.tm_year);
- panel_set_value(setdate_pi, date);
- window_fit(dtpanel);
- window_fit(date_frame);
-
- --- 1091,1100 -----
- PANEL_BLINK_CARET, TRUE,
- 0);
-
- ! if (day_first)
- ! sprintf(date, "%d/%d/%02d", current.tm_mday, current.tm_mon+1, current.tm_year);
- ! else
- ! sprintf(date, "%d/%d/%02d", current.tm_mon+1, current.tm_mday, current.tm_year);
- panel_set_value(setdate_pi, date);
- window_fit(dtpanel);
- window_fit(date_frame);
-