home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 January
/
usenetsourcesnewsgroupsinfomagicjanuary1994.iso
/
sources
/
x
/
volume6
/
dclock
/
patch1
< prev
next >
Wrap
Internet Message Format
|
1990-04-25
|
5KB
Path: uunet!cs.utexas.edu!usc!apple!sun-barr!newstop!sun!sun.com
From: argv@sun.com (Dan Heller)
Newsgroups: comp.sources.x
Subject: v06i091: Dclock -- digital clock for X11R4, Patch1, Part01/01
Message-ID: <134851@sun.Eng.Sun.COM>
Date: 25 Apr 90 22:46:56 GMT
Sender: news@sun.Eng.Sun.COM
Lines: 156
Approved: argv@sun.com
Submitted-by: Dan Heller <argv@sun.com>
Posting-number: Volume 6, Issue 91
Archive-name: dclock/patch1
Patch-To: dclock: Volume 6, Issue 87
Note-- what was originally posted was patchlevel 3! You are *not* behind.
Please don't send requests for patchlevels 1 and 2.
Prereq: 3
*** patchlevel.h.orig Wed Apr 25 15:23:09 1990
--- patchlevel.h Wed Apr 25 15:23:24 1990
***************
*** 1 ****
! #define PATCHLEVEL 3
--- 1 ----
! #define PATCHLEVEL 4
*** Dclock.c.orig Tue Apr 24 22:47:32 1990
--- Dclock.c Wed Apr 25 15:22:14 1990
***************
*** 299,304 ****
--- 299,306 ----
for (n = 0; n < 10; n++)
new->dclock.digits[n] = new->dclock.tiny_digits[n] = 0;
new->dclock.colon[0] = new->dclock.colon[1] = 0;
+
+ new->dclock.interval_id = (XtIntervalId)NULL;
}
static void
***************
*** 363,369 ****
{
int n;
! if (w->dclock.interval_id)
XtRemoveTimeOut(w->dclock.interval_id);
XtReleaseGC (w, w->dclock.foreGC);
XtReleaseGC (w, w->dclock.backGC);
--- 365,371 ----
{
int n;
! if (w->dclock.interval_id != (XtIntervalId)NULL)
XtRemoveTimeOut(w->dclock.interval_id);
XtReleaseGC (w, w->dclock.foreGC);
XtReleaseGC (w, w->dclock.backGC);
***************
*** 630,638 ****
if (!XtIsRealized(w))
return;
! if (w->dclock.interval_id) {
XtRemoveTimeOut(w->dclock.interval_id);
! w->dclock.interval_id = NULL;
}
XFillRectangle(XtDisplay(w), XtWindow(w), w->dclock.backGC,
0, 0, w->core.width, w->core.height);
--- 632,640 ----
if (!XtIsRealized(w))
return;
! if (w->dclock.interval_id != (XtIntervalId)NULL) {
XtRemoveTimeOut(w->dclock.interval_id);
! w->dclock.interval_id = (XtIntervalId)NULL;
}
XFillRectangle(XtDisplay(w), XtWindow(w), w->dclock.backGC,
0, 0, w->core.width, w->core.height);
***************
*** 647,657 ****
w->dclock.fade = save_fade;
if (w->dclock.display_time)
if (w->dclock.seconds)
! w->dclock.interval_id = XtAddTimeOut(1000, timeout, w);
else {
t = time(0);
w->dclock.interval_id =
! XtAddTimeOut((unsigned long)(60 - (t % 60)) * 1000, timeout, w);
}
}
--- 649,659 ----
w->dclock.fade = save_fade;
if (w->dclock.display_time)
if (w->dclock.seconds)
! w->dclock.interval_id = XtAddTimeOut((unsigned long)1000, timeout, (XtPointer)w);
else {
t = time(0);
w->dclock.interval_id =
! XtAddTimeOut((unsigned long)(60 - (t % 60)) * 1000, timeout, (XtPointer)w);
}
}
***************
*** 922,929 ****
{
Boolean alarm_went_off = show_time(w);
w->dclock.interval_id =
! XtAddTimeOut((alarm_went_off || w->dclock.seconds)? 1000 : 60000,
! timeout, w);
}
/* ARGSUSED */
--- 924,931 ----
{
Boolean alarm_went_off = show_time(w);
w->dclock.interval_id =
! XtAddTimeOut((unsigned long)((alarm_went_off || w->dclock.seconds)? 1000 : 60000),
! timeout, (XtPointer)w);
}
/* ARGSUSED */
***************
*** 965,973 ****
do_redraw = True;
}
if (new->dclock.seconds != current->dclock.seconds) {
! if (current->dclock.interval_id) {
XtRemoveTimeOut(current->dclock.interval_id);
! current->dclock.interval_id = NULL;
}
Resize(new);
do_redraw = True;
--- 967,975 ----
do_redraw = True;
}
if (new->dclock.seconds != current->dclock.seconds) {
! if (current->dclock.interval_id != (XtIntervalId)NULL) {
XtRemoveTimeOut(current->dclock.interval_id);
! current->dclock.interval_id = (XtIntervalId)NULL;
}
Resize(new);
do_redraw = True;
***************
*** 1097,1103 ****
XtRemoveTimeOut(w->dclock.interval_id);
saved_secs = w->dclock.seconds, w->dclock.seconds = False;
saved_miltime = w->dclock.miltime, w->dclock.miltime = True;
! w->dclock.interval_id = NULL;
} else {
w->dclock.seconds = saved_secs;
w->dclock.miltime = saved_miltime;
--- 1099,1105 ----
XtRemoveTimeOut(w->dclock.interval_id);
saved_secs = w->dclock.seconds, w->dclock.seconds = False;
saved_miltime = w->dclock.miltime, w->dclock.miltime = True;
! w->dclock.interval_id = (XtIntervalId)NULL;
} else {
w->dclock.seconds = saved_secs;
w->dclock.miltime = saved_miltime;
dan
-----------------------------------------------------------
O'Reilly && Associates
argv@sun.com / argv@ora.com
632 Petaluma Ave, Sebastopol, CA 95472
800-338-NUTS, in CA: 800-533-NUTS, FAX 707-829-0104
Opinions expressed reflect those of the author only.