[comp.sources.amiga] v89i203: clock - yet another titlebar clock

page%swap@Sun.COM (Bob Page) (11/13/89)

Submitted-by: mcvax!inesc!jmsc@uunet.UU.NET (Miguel Casteleiro)
Posting-number: Volume 89, Issue 203
Archive-name: intuition/clock.1

This is a small clock program with date and free memory.

[uuencoded executable included.  ..bob]

# This is a shell archive.
# Remove anything above and including the cut line.
# Then run the rest of the file through 'sh'.
# Unpacked files will be owned by you and have default permissions.
#----cut here-----cut here-----cut here-----cut here----#
#!/bin/sh
# shar: SHell ARchive
# Run the following text through 'sh' to create:
#	clock.c
#	clock.uu
#	getarg.asm
# This is archive 1 of a 1-part kit.
# This archive created: Sun Nov 12 18:11:16 1989
echo "extracting clock.c"
sed 's/^X//' << \SHAR_EOF > clock.c
Xecho ; /*
X asm getarg.asm
X lc -cwusf -v -sc=__MERGED -M -y clock.c
X blink clock.o+getarg.o TO clock LIB lib:amiga.lib+lib:lc.lib DEFINE _SysBase=4 SD SC ND
X quit
X*/
X
X/*
X**  This is yet another clock program I (Miguel Casteleiro) wrote a long
X**  while back.
X**  It's small (sort of) and opens a window where the free memory, time and
X**  date are displayed.
X**  It's PD all the way.
X**
X**  Usage:
X**     [run] clock [ta] [left-edge] [top-edge]
X**
X**  t = total memory is displayed (instead of chip and fast memory)
X**  a = am/pm time format (instead of 24 hour format)
X**  left-edge = left edge of clock window on workbench
X**  top-edge = top edge of clock window on workbench
X** 
X**  By default the clock starts with split memory (chip and fast), 24 hour
X**  format and near the workbench depth gadgets (on a morerowed screen 664x256).
X**
X**  At every minute it pops up to the front of whatever window is hiding it and
X**  for 4 seconds it displays the date.
X**
X**  It will work with any font, but proportional fonts have wear effects on
X**  the window width.
X**
X**  When it starts, you don't see the depth and close gadgets, but they are
X**  there, where they are suppose to be.
X**
X**
X**  Just execute this file to compile it. You'll need Lattice C V4.0 or up.
X**
X**  You can reach me on USENET at ...!mcvax!inesc!jmsc
X**
X**  Enjoy!
X*/
X
Xextern void getarg(void);
X
Xchar *argptr;
Xint arglen;
X
X/*
X**   xref _argptr
X**   xref _arglen
X**   xdef _getarg
X**
X**   section "text",code
X**
X**_getarg:
X**   move.l a0,_argptr
X**   move.l d0,_arglen
X**   rts
X**   end
X*/
X
X#include <exec/types.h>
X#include <exec/ports.h>
X#include <exec/memory.h>
X#include <exec/execbase.h>
X#include <devices/timer.h>
X#include <libraries/dosextens.h>
X#include <intuition/intuitionbase.h>
X#include <proto/exec.h>
X#include <proto/dos.h>
X#include <proto/intuition.h>
X#include <proto/graphics.h>
X
X#define TOP_EDGE        0
X#define RIGTH_EDGE    610
X#define WAIT_TIME  250000
X
Xstruct NewWindow nw =
X   {
X   0,0,
X   0,0,
X   -1,-1,
X   CLOSEWINDOW,
X   WINDOWCLOSE | WINDOWDEPTH | WINDOWDRAG | SMART_REFRESH | NOCAREREFRESH,
X   NULL,NULL,
X   "(c) Miguel Casteleiro 1989  Usenet:...!mcvax!inesc!jmsc  ",
X   NULL,NULL,
X   -1,-1,-1,-1,
X   WBENCHSCREEN
X   };
X
Xstruct IntuiText itext = {0,1,JAM2,0,0,NULL,NULL,NULL};
X
Xstruct DosLibrary *DOSBase = NULL;
Xstruct IntuitionBase *IntuitionBase = NULL;
Xstruct GfxBase *GfxBase = NULL;
Xstruct Window *Window = NULL;
Xstruct timerequest Time_Req;
Xstruct MsgPort *Timer_Port = NULL;
X
X#define E_WINDOW (1<<Window->UserPort->mp_SigBit)
X#define E_TIMER  (1<<Timer_Port->mp_SigBit)
X
Xchar day_str[7][4] =
X   {"Sun","Mon","Tue","Wed","Thu","Fri","Sat"};
Xchar month_str[12][4] =
X   {"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"};
X
Xvoid my_exit(void);
Xvoid date(struct DateStamp *,short *,short *,short *);
Xint sprintnum(char *,int,short,int,char);
X
Xchar *strcpy(char *,char *);
Xchar *strcat(char *,char *);
Xint strlen(char *);
X
Xvoid clock()
X{
Xregister short hours,minutes,seconds,oldminutes,old_secs;
Xregister short chip_free,fast_free,old_chip,old_fast;
Xshort day,month,year;
Xregister ULONG mask;
Xregister struct DateStamp now;
Xregister struct IntuiMessage *Msg;
Xchar text[50],total,am_pm;
X
Xgetarg();
Xfor (total=am_pm=0,minutes=seconds=old_secs=-1; (arglen > 0); --arglen,++argptr)
X   {
X   hours = *argptr;
X   if ((hours == 't') || (hours == 'T')) total = 1;
X   if ((hours == 'a') || (hours == 'A')) am_pm = 1;
X   if ((hours >= '0') && (hours <= '9'))
X      if (old_secs == -1)
X         { if (minutes == -1) minutes = 0;
X           minutes *= 10; minutes += hours - '0'; }
X      else
X      if (old_secs == 1)
X         { if (seconds == -1) seconds = 0;
X           seconds *= 10; seconds += hours - '0'; }
X   if (hours == ' ')
X      {
X      if (minutes != -1) old_secs = 1;
X      if (seconds != -1) old_secs = 0;
X      }
X   }
X
Xitext.IText = text;
XTime_Req.tr_node.io_Message.mn_ReplyPort = NULL;
X
XDOSBase = (struct DosLibrary *) OpenLibrary("dos.library",0);
Xif (DOSBase == NULL) { my_exit(); return; }
XIntuitionBase = (struct IntuitionBase *) OpenLibrary("intuition.library",0);
Xif (IntuitionBase == NULL) { my_exit(); return; }
XGfxBase = (struct GfxBase *) OpenLibrary("graphics.library",0);
Xif (GfxBase == NULL) { my_exit(); return; }
X
XTimer_Port = (struct MsgPort *) CreatePort("Timer Port",0);
Xif (Timer_Port == NULL) { my_exit(); return; }
X
Xif (OpenDevice(TIMERNAME,UNIT_VBLANK,(struct IORequest *)&Time_Req,0) != NULL)
X   { my_exit(); return; }
XTime_Req.tr_node.io_Message.mn_ReplyPort = Timer_Port;
XTime_Req.tr_node.io_Command = TR_ADDREQUEST;
XTime_Req.tr_node.io_Flags = 0;
XTime_Req.tr_node.io_Error = 0;
X
XSetTaskPri(FindTask(0L),25);
X
Xnw.Width = 38;
Xif (total) nw.Width -= 11;
Xif (am_pm) nw.Width += 2;
Xnw.Width *= IntuitionBase->FirstScreen->RastPort.Font->tf_XSize;
Xnw.Height = IntuitionBase->FirstScreen->RastPort.Font->tf_YSize + 2;
X
Xnw.LeftEdge = RIGTH_EDGE - nw.Width;
Xnw.TopEdge = TOP_EDGE;
Xif (minutes != -1) nw.LeftEdge = minutes;
Xif (seconds != -1) nw.TopEdge = seconds;
X
XWindow = (struct Window *) OpenWindow(&nw);
Xif (Window == NULL) { my_exit(); return; }
X
XSetAPen(Window->RPort,1);
X
Xfor (oldminutes=seconds=chip_free=fast_free=-1; ; )
X   {
X   old_secs = seconds;
X   old_chip = chip_free;
X   old_fast = fast_free;
X
X   chip_free = AvailMem(MEMF_CHIP) >> 10;
X   fast_free = AvailMem(MEMF_FAST) >> 10;
X   DateStamp((long *)&now);
X   seconds = now.ds_Tick / TICKS_PER_SECOND;
X
X   if ((old_secs != seconds) || (old_chip != chip_free) || (old_fast != fast_free))
X      {
X      hours = now.ds_Minute / 60;
X      minutes = now.ds_Minute % 60;
X      if (minutes != oldminutes)
X         {
X         oldminutes = minutes;
X         WindowToFront(Window);
X         date(&now,&day,&month,&year);
X         }
X
X      if (total)
X         {
X         strcpy(text," Mem:");
X         sprintnum(text+strlen(text),chip_free+fast_free,10,4,(char)' ');
X         strcat(text,"K ");
X         }
X      else
X         {
X         strcpy(text," Chip:");
X         sprintnum(text+strlen(text),chip_free,10,3,(char)' ');
X         strcat(text,"K Fast:");
X         sprintnum(text+strlen(text),fast_free,10,4,(char)' ');
X         strcat(text,"K ");
X         }
X
X      if ((seconds > 0) && (seconds < 5))
X         {
X         if (am_pm) strcat(text," ");
X         strcat(text,day_str[now.ds_Days%7]);
X         sprintnum(text+strlen(text),day,10,3,(char)' ');
X         strcat(text," ");
X         strcat(text,month_str[month]);
X         sprintnum(text+strlen(text),year,10,5,(char)' ');
X         strcat(text,"  ");
X         }
X      else
X         {
X         strcat(text," Time:");
X         mask = 0;
X         if (am_pm)
X            {
X            mask = 1;
X            if (hours >= 12) hours -= 12, mask = 2;
X            if (hours == 0) hours = 12;
X            }
X         sprintnum(text+strlen(text),hours,10,2,(char)' ');
X         strcat(text,":");
X         sprintnum(text+strlen(text),minutes,10,2,(char)'0');
X         strcat(text,":");
X         sprintnum(text+strlen(text),seconds,10,2,(char)'0');
X         if (mask == 0) strcat(text,"    ");
X         if (mask == 1) strcat(text," am ");
X         if (mask == 2) strcat(text," pm ");
X         }
X
X      Move(Window->RPort,0,0);
X      Draw(Window->RPort,Window->Width,0);
X      Move(Window->RPort,0,Window->Height-1);
X      Draw(Window->RPort,Window->Width,Window->Height-1);
X      PrintIText(Window->RPort,&itext,1,1);
X      }
X
X   Time_Req.tr_time.tv_secs = 0;
X   Time_Req.tr_time.tv_micro = WAIT_TIME;
X   SendIO(&Time_Req.tr_node);
X   mask = Wait(E_WINDOW | E_TIMER);
X
X   if (mask & E_TIMER)
X      GetMsg(Timer_Port);
X
X   if (mask & E_WINDOW)
X      {
X      for (; (Msg = (struct IntuiMessage *) GetMsg(Window->UserPort));
X             ReplyMsg((struct Message *)Msg))
X         if (Msg->Class == CLOSEWINDOW)
X            {
X            ReplyMsg((struct Message *)Msg);
X            my_exit();
X            return;
X            }
X      }
X   }
X}
X
Xvoid my_exit()
X{
Xif (Window) CloseWindow(Window);
Xif (Time_Req.tr_node.io_Message.mn_ReplyPort)
X   {
X   if (!CheckIO(&Time_Req.tr_node)) AbortIO(&Time_Req.tr_node);
X   CloseDevice((struct IORequest *)&Time_Req);
X   }
Xif (Timer_Port) DeletePort(Timer_Port);
Xif (GfxBase) CloseLibrary((struct Library *)GfxBase);
Xif (IntuitionBase) CloseLibrary((struct Library *)IntuitionBase);
Xif (DOSBase) CloseLibrary((struct Library *)DOSBase);
X}
X
Xvoid date(dt,day,month,year)
Xregister struct DateStamp *dt;
Xregister short *day,*month,*year;
X{
Xregister short j,bis,year_r,year_rest;
X
X*year = dt->ds_Days / (365+365+366+365);
Xyear_rest = dt->ds_Days % (365+365+366+365);
X*day = year_rest % 365;
Xyear_r = year_rest / 365;
Xif ((year_rest == 1095) || (year_r == 4)) --year_r,*day=365;
Xif (year_rest > 1095) --*day;
Xif ((year_rest >= 730) && (year_rest <= 1095)) bis=1; else bis=0;
X*month = 0;
Xif (*day >= 31)
X   {
X   *day -= 31;
X   ++*month;
X   if (*day >= 28+bis)
X      {
X      *day -= (28+bis);
X      ++*month;
X      for (j=1; (j < 12); ++j)
X         {
X         if (j%2)
X            if (*day >= 31) *day-=31,++*month; else break;
X         else
X            if (*day >= 30) *day-=30,++*month; else break;
X         if (j == 5) ++j;
X         }
X      }
X   }
X++*day;
X*year = 1978 + (*year<<2) + year_r;
X}
X
Xint sprintnum(str,num,base,len,pad)
Xregister char *str;
Xregister int num;
Xregister short base;
Xint len;
Xchar pad;
X{
Xregister int rlen;
Xregister char digit;
Xchar sig;
X
Xsig = 0;
Xrlen = 0;
Xif (num < 0) sig = 1,num = -num;
Xif (num == 0)
X   str[rlen++] = '0';
Xelse
X   for (; (num > 0); )
X      {
X      digit = num % base;
X      num /= base;
X      if (digit < 10) digit += '0'; else digit += '7';
X      str[rlen++] = digit;
X      }
Xdigit = pad;
Xif ((digit == '0') && sig)
X   for (--len; (rlen < len); str[rlen++] = digit);
Xif (sig) str[rlen++] = '-';
Xfor (; (rlen < len); str[rlen++] = digit);
Xstr[rlen] = '\0';
X
Xfor (num=0,len=rlen; (--rlen > num); ++num)
X   { digit = str[num]; str[num] = str[rlen]; str[rlen] = digit; }
X
Xreturn(len);
X}
SHAR_EOF
echo "extracting clock.uu"
sed 's/^X//' << \SHAR_EOF > clock.uu
X
Xbegin 644 clock
XM```#\P`````````"``````````$```,0````I@```^H```,03E7_F$CG/R))%
XM^0````!.N@I^<`!R_RH!+`4;0/^A&T#_H#M!__9*K`P4;P``J"!L#!`>$`)'X
XM`/\,1P!T9P8,1P!49@9P`1M`_Z$,1P!A9P8,1P!!9@8;?``!_Z`,1P`P;4H,0
XM1P`Y;D0R+?_V#$'__V8<#$;__V8"?``@!G0*P<(L`"`'(`<$0``PW$!@'E-!*
XM9AH,1?__9@)Z`"`%P?P`"BH`(`<@!P1``##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`!05O``P"`!@2$J';T0@!DC`+T``%"`'(B\`%$ZZ$
XM`.8H`2`'(B\`%$ZZ`-HN``P$``ID!@8$`#!@!`8$`#<@!2]``!12@"H`("\`!
XM%!6$"`!@N!@M`!L,!``P9B1*+?_Z9QY3K0`4NJT`%&P4(`4O0``44H`J`"`ON
XM`!05A`@`8.9*+?_Z9Q0@!2]``!12@"H`("\`%!6\`"T(`+JM`!1L%"`%+T``"
XM%%*`*@`@+P`4%80(`&#F0C)8`'X`*T4`%%.%(`6PAV\2&#)X`!6R6`!X`!6$/
XM6`!2AV#F("T`%$S?!/!.74YU``!.^0```"1.^0```H1.^0```+I.^0````!.S
XM^0```EA.^0```91.^0```G!P82AC*2!-:6=U96P@0V%S=&5L96ER;R`Q.3@Y6
XM("!5<V5N970Z+BXN(6UC=F%X(6EN97-C(6IM<V,@(````````````/__```"Y
XM```"``X`````````````"J@``````````/__________``$``0$`````````]
XM````````````````````````````````````````4W5N`$UO;@!4=64`5V5DN
XM`%1H=0!&<FD`4V%T`$IA;@!&96(`36%R`$%P<@!-87D`2G5N`$IU;`!!=6<`_
XM4V5P`$]C=`!.;W8`1&5C`&1O<RYL:6)R87)Y`&EN='5I=&EO;BYL:6)R87)Y\
XM`&=R87!H:6-S+FQI8G)A<GD``%1I;65R(%!O<G0``'1I;65R+F1E=FEC90``Y
XM($UE;3H`2R```"!#:&EP.@``2R!&87-T.@`@`"`@```@5&EM93H``#H`("`@8
XM(```(&%M(```('!M(```````````````````````````````````````````+
XM`````````````````````````````````^P````%````````"OP```ED```(O
XM`@``!V@````*````!P````$```J*```*E@``"H0```JB```*G```"GX```J0Y
XM`````````_(```/I````IB/(```,$"/````,%$YU```@;P`$((A8D$*H``0A&
XM2``(3G4``$CG/"`F+P`8%"\`'WK_+P5.N0```402`'``$`$H`'+_LH!8CV8$5
XM<`!@9B\\``$``4AX`").N0```0`D0"H*4(]F#B\$3KD```%8<`!8CV!`)4,`J
XM"A5"``D5?``$``A"*@`.%40`#T*G3KD```$P)4``$$J#6(]G"B\*3KD```%L1
XM8`I(:@`43KD````06(\@"DS?!#Q.=2\*)&\`"$JJ``IG"B\*3KD```&`6(\5&
XM?`#_``AP_R5``!1P`!`J``\O`$ZY```!6$AX`"(O"DZY```!&$_O``PD7TYU^
XM```O#BQY````!$SO``,`"$ZN_SHL7TYU```O#BQY````!")O``@@+P`,3J[_$
XM+BQ?3G4O#BQY````!")O``A.KO[:+%].=2\.+'D````$("\`"$ZN_K8L7TYU8
XM+PXL>0````0@+P`(3J[^L"Q?3G4O#BQY````!")O``A.KOZ>+%].=2\.+'D`\
XM```$(F\`"$ZN_I@L7TYU2H!J```>1(!*@6H```Q$@6$``"!$@4YU80``&$2`?
XM1(%.=4J!:@``#$2!80``!D2`3G4O`DA!-`%F```B2$!(04A"-`!G```&A,$PD
XM`DA`-`"$P3`"2$(R`B0?3G4O`W80#$$`@&0```;AF5%##$$(`&0```;IF5E#3
XM#$$@`&0```;EF55#2D%K```&XYE30S0`YJA(0D)"YJI(0X#!-@`P`C0#2$'$3
XMP9""9```"%-#T(%D_G(`,@-(0^>X2$##0"8?)!].=2!O``@B;P`$2AEF_%.)\
XM$MAF_"`O``1.=2!O``@B;P`$$MAF_"`O``1.=0``(&\`!$H89OQ3B)'O``0@&
XM"$YU``````/L`````@`````````(`````@````D````!````6@```#8```".N
X@````Y@```&H```"@````K````,H```#R`````````_(!.
X``
Xend
Xsize 3992
SHAR_EOF
echo "extracting getarg.asm"
sed 's/^X//' << \SHAR_EOF > getarg.asm
X   xref _argptr
X   xref _arglen
X   xdef _getarg
X
X   section "text",code
X
X_getarg:
X   move.l a0,_argptr
X   move.l d0,_arglen
X   rts
X   end
SHAR_EOF
echo "End of archive 1 (of 1)"
# if you want to concatenate archives, remove anything after this line
exit