/*
 *	DClock.h ------	Rather senseless include file if you don't have the
 *			DClock 'C' source code.
 */

#include <intuition/intuitionbase.h>
#include <libraries/dosextens.h>
#include <workbench/workbench.h>
#include <devices/inputevent.h>
#include <graphics/gfxmacros.h>
#include <workbench/startup.h>
#include <graphics/gfxbase.h>
#include <exec/interrupts.h>
#include <devices/input.h>
#include <devices/audio.h>
#include <exec/execbase.h>
#include <exec/memory.h>

	/* Forward declarations. */

extern struct Library	*OpenLibrary();
extern struct Window	*OpenWindow();
extern struct MsgPort	*CreatePort();
extern struct MsgPort	*FindPort();
extern struct Message	*GetMsg();
extern struct Task	*FindTask();
extern void		*AllocMem();
extern struct IOStdReq	*CreateStdIO();
extern struct TextFont	*OpenFont();
extern ULONG		 Wait();
extern ULONG		 AvailMem();

	/* Global MessagePort identifier. */

#define PORTNAME "DPort"

	/* Current DClock revision. */

#define REVISION 12

	/* Raster size macro. */

#define Byte(Width) (((Width + 15) >> 4) << 1)

	/* Global MessagePort structure. Note: if you are up to
	 * expand this structure, add the new identifiers at the
	 * bottom. This will insure upward-compatibility with
	 * older DClock and DClock-Handler revisions.
	 */

struct DSeg
{
	/*******************************************
	 * Vital data! Don't change ANYTHING here! *
	 *******************************************/

	struct MsgPort	 Port;		/* Global messageport. */

	BPTR		 Segment;	/* Pointer to handler segment. */
	LONG		 SegSize;	/* Size of DSeg structure. */

	struct Task	*Father;	/* Calling process. */
	struct Task	*Child;		/* Waiting process (usually handler). */

	ULONG		 RingBack;	/* Multi-Purpose signal bit. */

	ULONG		 LastSecs;	/* Timer control. */
	BYTE		 Priority;	/* Handler priority. */
	UBYTE		 Revision;	/* Could come in handy for future revisions. */

	/***********************************************
	 * Custom data, open to expansion and changes. *
	 ***********************************************/

	UBYTE		 Beep;		/* Audible beep selected? */
	UBYTE		 Click;		/* Keyboard click selected? */

	UWORD		 ClickVolume;	/* Volume of keyboard click. */

	UBYTE		 TextColour;	/* Guess what? */
	UBYTE		 BackColour;	/* Guess what? */

	UBYTE		 Alarm;		/* Alarm clock enabled? */
	UBYTE		 AlarmHour;	/* Alarm time hour. */
	UBYTE		 AlarmMinute;	/* Alarm time minute. */
	UBYTE		 AlarmSecond;	/* Alarm time second. */

	UBYTE		 SetEnv;	/* Set environment variables? */

	/***********************************
	 * Append your custom flags below. *
	 ***********************************/
};
