/* $Revision Header *** Header built automatically - do not edit! ***********
 *
 *	(C) Copyright 1991 by Torsten Jürgeleit
 *
 *	Name .....: render.h
 *	Created ..: Thursday 19-Dec-91 15:14:39
 *	Revision .: 3
 *
 *	Date        Author                 Comment
 *	=========   ====================   ====================
 *	28-Jul-92   Torsten Jürgeleit      open window centered over position
 *					   of mouse pointer
 *	12-May-92   Torsten Jürgeleit      text colors for IClearWindow()
 *	30-Apr-92   Torsten Jürgeleit      raster for clear_window()
 *	19-Dec-91   Torsten Jürgeleit      Created this file!
 *
 ****************************************************************************
 *
 *	Defines, structures, prototypes and pragmas for render functions
 *
 * $Revision Header ********************************************************/

#ifndef	ISUP_RENDER_H
#define	ISUP_RENDER_H

	/* ID for ISUP structures and intuition messages */

#define ISUP_ID		((ULONG)'I' << 24 | (ULONG)'S' << 16 | 'U' << 8 | 'P')

	/* Defines for render info flags */

#define RENDER_INFO_FLAG_INNER_WINDOW		(1 << 0)   /* use upper left corner of inner window as location (0,0) */
#define RENDER_INFO_FLAG_BACK_FILL		(1 << 1)   /* fill window back ground with different color */
#define RENDER_INFO_FLAG_AVAIL_FONTS		(1 << 2)   /* scan available fonts and use this list for ask_font/open_font */

	/* Defines for open window flags */

#define OPEN_WINDOW_FLAG_CENTER_SCREEN		(1 << 0)   /* center window on screen */
#define OPEN_WINDOW_FLAG_RENDER_PENS		(1 << 1)   /* use render pens for detail and backfill pen */
#define OPEN_WINDOW_FLAG_CENTER_MOUSE		(1 << 2)   /* center window over current position of mouse pointer */

	/* Defines for clear window flags */

#define CLEAR_WINDOW_FLAG_CUSTOM_DRAW_MODE	(1 << 0)   /* don't change draw mode */
#define CLEAR_WINDOW_FLAG_CUSTOM_COLOR		(1 << 1)   /* don't change background color */
#define CLEAR_WINDOW_FLAG_NORMAL_COLOR		(1 << 2)   /* use normal background color */
#define CLEAR_WINDOW_FLAG_USE_RASTER		(1 << 3)   /* use standard raster for window background */
#define CLEAR_WINDOW_FLAG_ABSOLUTE_POS		(1 << 4)   /* don't add window border offset to given upper left position */
#define CLEAR_WINDOW_FLAG_TEXT1_COLOR		(1 << 5)   /* use text color 1 */
#define CLEAR_WINDOW_FLAG_TEXT2_COLOR		(1 << 6)   /* use text color 2 */

	/* Defines for internal use only */

#define MAX_RENDER_COLORS	16	/* max screen colors to look at */
#define MAX_RENDER_IMAGES	11

#define IMAGE_ARROW_LEFT	0
#define IMAGE_ARROW_RIGHT	1
#define IMAGE_ARROW_UP		2
#define IMAGE_ARROW_DOWN	3
#define IMAGE_KNOB_UNSELECTED	4
#define IMAGE_KNOB_SELECTED	5
#define IMAGE_CHECK_UNSELECTED	6
#define IMAGE_CHECK_SELECTED	7
#define IMAGE_CYCLE		8
#define IMAGE_COUNT_LEFT	9
#define IMAGE_COUNT_RIGHT	10

#define IMAGE_ARROW_WIDTH	9	/* fixed dimensions for images */
#define IMAGE_ARROW_HEIGHT	5
#define IMAGE_ARROW_DEPTH	1

#define IMAGE_KNOB_WIDTH	18
#define IMAGE_KNOB_HEIGHT	9
#define IMAGE_KNOB_DEPTH	2

#define IMAGE_CHECK_WIDTH	13
#define IMAGE_CHECK_HEIGHT	7
#define IMAGE_CHECK_DEPTH	1

#define IMAGE_CYCLE_WIDTH	16
#define IMAGE_CYCLE_HEIGHT	9
#define IMAGE_CYCLE_DEPTH	2

#define IMAGE_COUNT_WIDTH	8
#define IMAGE_COUNT_HEIGHT	5
#define IMAGE_COUNT_DEPTH	1

#define IMAGE_HORIZ_OFFSET	4
#define IMAGE_VERT_OFFSET	2

#define INTUISUP_DATA_END	0	/* end marker for data arrays */

	/* Structures */

struct RenderInfo {
	LONG	ri_ID;		/* id = 'ISUP' */
	struct Screen  *ri_Screen;
	USHORT	ri_ScreenWidth;
	USHORT	ri_ScreenHeight;
	UBYTE	ri_ScreenDepth;
	UBYTE	ri_WindowBorderTop;
	UBYTE	ri_WindowBorderLeft;
	UBYTE	ri_WindowBorderRight;
	UBYTE	ri_WindowBorderBottom;
	UBYTE	ri_HighlightPen;
	UBYTE	ri_ShadowPen;
	UBYTE	ri_TextPen1;
	UBYTE	ri_TextPen2;
	UBYTE	ri_BackPen;
	USHORT	ri_Flags;
	ULONG	ri_ImageDataSize;
	USHORT	*ri_ImageData;
	ULONG	ri_AvailFontsHeaderSize;
	struct AvailFontsHeader  *ri_AvailFontsHeader;
	struct TextFont          *ri_TextFont;
	struct TextAttr          ri_TextAttr;
	struct Image             ri_Images[MAX_RENDER_IMAGES];
};
	/* Global prototypes */

struct RenderInfo  *get_render_info(struct Screen  *screen, USHORT flags);
SHORT calc_color_difference(SHORT color1, SHORT color2);
VOID  free_render_info(struct RenderInfo  *ri);
struct Window  *open_window(struct RenderInfo  *ri, struct NewWindow  *nw,
							      USHORT flags);
VOID clear_window(struct RenderInfo  *ri, struct Window  *win,
	     USHORT left_edge, USHORT top_edge, USHORT width, USHORT height,
							      USHORT flags);
VOID close_window(struct Window  *win, BOOL more_windows);
struct AvailFontsHeader  *avail_fonts(struct RenderInfo  *ri);
struct TextAttr          *ask_font(struct RenderInfo  *ri,
						      struct TextAttr  *ta);
struct TextFont          *open_font(struct RenderInfo  *ri,
						      struct TextAttr  *ta);
	/* Global pragmas (Aztec C v5.2a) */

#pragma intfunc(get_render_info(a0,d0))
#pragma regcall(calc_color_difference(d0,d1))   /* internal function */
#pragma intfunc(free_render_info(a0))
#pragma intfunc(open_window(a0,a1,d0))
#pragma intfunc(clear_window(a0,a1,d0,d1,d2,d3,d4))
#pragma intfunc(close_window(a0,d0))
#pragma intfunc(avail_fonts(a0))
#pragma intfunc(ask_font(a0,a1))
#pragma intfunc(open_font(a0,a1))

#endif   /* ISUP_RENDER_H */
