/* special.h */

#define MAGIC_WORD		(('S'<<24) | ('P'<<16) | ('E'<<8) | 'C')

#define SPECIAL_PORT		"special_dvi"
#define SPECIAL_REPLY		"special_reply"

#define AC_SEND_SPECIAL		1
#define AC_REPLY_SPECIAL	2
#define AC_OK_BITMAP		3
#define AC_REPLY_BITMAP		4


#define LOC_NONE		0	/* no picture available		     */
#define LOC_BITMAP		1	/* bimap in RAM			     */
#define LOC_FILE		2	/* bitmap in a file		     */
#define LOC_BORDER		3	/* no picture, draw only a border    */
#define LOC_RECTANGLE		4	/* no picture, draw a full rectangle */
					/* LOC_BORDER || LOC_RECTANGLE 	     */
					/*		=> loc.map == NULL   */
#define LOC_BITMAP_BORDER	5	/* bitmap in RAM + draw border	     */
#define LOC_FILE_BORDER		6	/* bitmap in file + draw border	     */

union  location {
		unsigned long	*map;		/* picture as bitmap, lines with word (2Byte) alignment */
		char 		*filename;	/* picture as file */
	};

struct special_map {
		short		 where_is;	/* LOC_#? */
		long		 hoffset;	/* all in pixel */
		long		 voffset;
		long		 width;		/* in pixel (bitmap word-alignment!) */
		long		 height;	/* in pixel (bitmap word-alignment!) */
	union	location	 loc;
		long		 reserved1;
		long		 reserved2;
		long		 reserved3;
		long		 reserved4;
	};

struct special_msg {
	struct	Message		 msg;
		short		 action;
		short		 ret;
		char		*special_string;
		long		 hresolution;
		long		 vresolution;
		long		 reserved1;
		long		 reserved2;
	struct	special_map	*bmap;
	};


/* functions */

struct special_map *send_special(char *sp_string);
void		    special_ok(void);

