/*
**    GrabKEY
**
**        © 1996 by Timo C. Nentwig
**        All Rights Reserved !
**
**        Tcn@techbase.in-berlin.de
**
**
*/

/// #include

	// System includes

#include <datatypes/pictureclass.h>
#include <datatypes/soundclass.h>

#include <devices/timer.h>

#include <dos/dos.h>
#include <dos/dostags.h>

#include <exec/types.h>
#include <exec/memory.h>

#include <graphics/gfxbase.h>
#include <graphics/gfxmacros.h>
#include <graphics/rpattr.h>

#include <intuition/intuition.h>
#include <intuition/intuitionbase.h>

#include <libraries/commodities.h>
#include <libraries/gadtools.h>
#include <libraries/gtlayout.h>
#include <libraries/locale.h>
#include <libraries/reqtools.h>

#include <proto/commodities.h>
#include <proto/datatypes.h>
#include <proto/dos.h>
#include <proto/exec.h>
#include <proto/graphics.h>
#include <proto/icon.h>
#include <proto/intuition.h>
#include <proto/layers.h>
#include <proto/locale.h>
#include <proto/reqtools.h>

#include <pragmas/commodities_pragmas.h>
#include <pragmas/datatypes_pragmas.h>
#include <pragmas/dos_pragmas.h>
#include <pragmas/exec_pragmas.h>
#include <pragmas/graphics_pragmas.h>
#include <pragmas/icon_pragmas.h>
#include <pragmas/intuition_pragmas.h>
#include <pragmas/layers_pragmas.h>
#include <pragmas/locale_pragmas.h>
#include <pragmas/reqtools_pragmas.h>

	// Standard 'C' includes

#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <strings.h>

	// Private includes

#include <tcn/macros.h>
#include <tcn/register.h>

	// Locale support

#define CATCOMP_NUMBERS
#define CATCOMP_ARRAY
#include "gk_Locale.h"

	// Memory tracking

#if MWDEBUG

	#include    <misc/memwatch.h>

#endif

///
/// #define

	// Constants

#define    PRG_VERSION    "2.0"
#define    PRG_TITLE      "GrabKEY"
#define    PRG_AUTHOR     "Timo C. Nentwig"
#define    PRG_YEAR       "1996"
#define    PRG_EMAIL      "Tcn@techbase.in-berlin.de"

#define    TT_LEN          126                             // Whole tooltype must not be longer than 128 bytes

	// Macros

#define    STRCPY(a,b)    strncpy (a, b, sizeof (a));      // USE _ONLY_ FOR ARRAYS, NOT POINTERS

///

enum
{

	WINDOW, SCREEN, RANGE

};

enum
{

	TO_FILE, TO_PRINTER, TO_CLIPBOARD

};

enum
{

	CX_POPKEY = 1,
	SAVE_WINDOW_KEY, SAVE_SCREEN_KEY,
	CLIP_WINDOW_KEY, CLIP_SCREEN_KEY,
	PRINT_WINDOW_KEY, PRINT_SCREEN_KEY

};

/// struct MouseInfo

extern struct    MouseInfo
{

	ULONG    Current_X;
	ULONG    Current_Y;
	ULONG    Last_X;
	ULONG    Last_Y;

};

///
/// struct Settings

extern struct    Settings
{

	struct
	{

		struct
		{

			UBYTE    Save  [TT_LEN];
			UBYTE    Clip  [TT_LEN];
			UBYTE    Print [TT_LEN];

		} Window;

		struct
		{

			UBYTE    Save  [TT_LEN];
			UBYTE    Clip  [TT_LEN];
			UBYTE    Print [TT_LEN];

		} Screen;

	} Key;

	struct
	{

		UBYTE    Start [TT_LEN];
		UBYTE    Done  [TT_LEN];
		UBYTE    Error [TT_LEN];

	} Sound;

	struct
	{

		LONG     Priority;
		BOOL     PopUp;
		UBYTE    PopKey [TT_LEN];

	} Cx;

	struct
	{

		BOOL     Count;
		BOOL     Icon;
		UBYTE    Path [TT_LEN];

	} File;

};

///

	// System libraries

extern struct    Library         *CxBase;
extern struct    Library         *DataTypesBase;
extern struct    Library         *GadToolsBase;
extern struct    GfxBase         *GfxBase;
extern struct    Library         *IconBase;
extern struct    IntuitionBase   *IntuitionBase;
extern struct    Library         *LocaleBase;

	// External libraries

extern struct    Library         *GTLayoutBase;
extern struct    ReqToolsBase    *ReqToolsBase;

	// Settings structure

extern struct    Settings        *Set;

	// Commodity specifics

extern struct    MsgPort         *CxPort;
extern CxObj                     *Broker;

	// Locale specifics

extern struct    Hook             LocaleHook;
extern struct    Catalog         *Catalog;

	// GUI specifics

extern struct    LayoutHandle    *Handle;
extern struct    Window          *Window;
extern ULONG                      GUIMask;

