#ifndef SKETCH_DRIVER_H
#define SKETCH_DRIVER_H
/*
**	$VER: sketch.h 39.11 (5.2.95)
**
**	include file for sending commands to sketch's driver port
**
**	(C) Copyright 1995 Miguel Fides (Dior/Darkness)
**	    All Rights Reserved
**
*/

#ifndef EXEC_PORTS_H
#include "exec/ports.h"
#endif /* EXEC_PORTS_H */

/*
**	The driver supports two Message receiving methods:
**	a) The standard one:
**	You supply a reply port in the Message.mn_ReplyPort field.
**	When your message has been processed the driver will
**	send it you back.
**	b) The quick one:
**	You allocate a message using exec's (v36+) AllocVec and
**	fill the Message.mn_ReplyPort with a NULL pointer.
**	Then the driver will free your message using FreeVec when
**	your command had finished. You will NOT get response and
**	you won't know if it failed. :-)
*/

struct	SketchMessage {
	struct	Message Message;
	long	Command;
	long	Error;
	long	Button;		/* Always returned */
	long	Value;		/* Command dependant sense */
	long	X,Y;		/* Input/output */
	long	Width,Height;	/* Use when defining areas */
	void	*Extension;	/* NULL for now */
	};

/* Commands */
#define	SM_GETREAL	0	/* Get full-res non-clipped coords */
#define	SM_SETREAL	1	/* Update driver coords and buttons */
#define	SM_GETRES	2	/* Get tablet resolution */
#define	SM_GETFULLRANGE	3	/* Get tablet's full range */
#define	SM_CLICK	4	/* SM_GETREAL but waits a pressed button */
#define	SM_GETCLIPBOX	5	/* Get current clip box */
#define	SM_SETCLIPBOX	6	/* Set current clip box */
#define	SM_GETCLIPMODE	7	/* Get clip mode in Value */
#define SM_SETCLIPMODE	8	/* Set clip mode to Value */
#define	SM_GETREALCLIP	9	/* Get full-res clipped coords */
#define	SM_RESET	10	/* Reset tablet parameters */
#define SM_QUIT		11	/* NOT IMPLEMENTED YET */
#define SM_SAVEPREFS	12	/* NOT IMPLEMENTED YET */
#define SM_DEATH	1000	/* Server is quitting. DO NOT USE */

/* Error */
#define	SM_OK		0
#define	SM_UNKNOWN	1	/* Command unknown */
#define SM_WRONGVALUE	2	/* Command known but bad parameters */
#define	SM_DELAYED	3	/* Command is waiting */
#define	SM_ABORTED	4	/* Command correct but not done */

/* CLIP MODES */
#define	SCM_INHIBIT	0	/* Don't send any messages to input.device */
				/* In this mode tablet data is only available */
				/* directly from the Driver Port */
#define SCM_ABSOLUTE	1	/* ClipBox is always at defined location */
#define SCM_RELATIVE	2	/* ---- NOT IMPLEMENTED YET ---- */
#define SCM_ILLEGAL	3	/* This is the first non usable value! */

struct	SketchConfig {
	long	MagicID;
	long	ClipMode;
	long	BoxX,BoxY,BoxWidth,BoxHeight;
	};

#define SC_MAGIC (('M'<<24)|('M'<<16)|('S'<<8)|'S')

#endif	/* SKETCH_DRIVER_H */
