xref: /original-bsd/sys/news3400/iop/framebuf.h (revision 4f00418d)
13b6250d9Smckusick /*
2*4f00418dSbostic  * Copyright (c) 1992, 1993
3*4f00418dSbostic  *	The Regents of the University of California.  All rights reserved.
43b6250d9Smckusick  *
53b6250d9Smckusick  * This code is derived from software contributed to Berkeley by
63b6250d9Smckusick  * Sony Corp. and Kazumasa Utashiro of Software Research Associates, Inc.
73b6250d9Smckusick  *
83b6250d9Smckusick  * %sccs.include.redist.c%
93b6250d9Smckusick  *
103b6250d9Smckusick  * from: $Hdr: framebuf.h,v 4.300 91/06/09 06:42:21 root Rel41 $ SONY
113b6250d9Smckusick  *
12*4f00418dSbostic  *	@(#)framebuf.h	8.1 (Berkeley) 06/11/93
133b6250d9Smckusick  */
143b6250d9Smckusick 
153b6250d9Smckusick #ifndef __FRAMEBUF__
163b6250d9Smckusick #define __FRAMEBUF__ 1
173b6250d9Smckusick 
183b6250d9Smckusick typedef unsigned short	Word;
193b6250d9Smckusick 
203b6250d9Smckusick #define BitsPerWord	16
213b6250d9Smckusick 
223b6250d9Smckusick typedef struct {
233b6250d9Smckusick 	short	x, y;
243b6250d9Smckusick } sPoint;
253b6250d9Smckusick 
263b6250d9Smckusick typedef struct {
273b6250d9Smckusick 	int	x, y;
283b6250d9Smckusick } lPoint;
293b6250d9Smckusick 
303b6250d9Smckusick typedef struct {
313b6250d9Smckusick 	sPoint	origin;
323b6250d9Smckusick 	sPoint	extent;
333b6250d9Smckusick } sRectangle;
343b6250d9Smckusick 
353b6250d9Smckusick typedef struct {
363b6250d9Smckusick 	lPoint	origin;
373b6250d9Smckusick 	lPoint	extent;
383b6250d9Smckusick } lRectangle;
393b6250d9Smckusick 
403b6250d9Smckusick typedef struct {
413b6250d9Smckusick 	char		type;	/* BM_FB, BM_MEM, BM_0, BM_1 or BM_LBP */
423b6250d9Smckusick 	char		depth;	/* bitmap depth */
433b6250d9Smckusick 	unsigned short	width;	/* width in Words */
443b6250d9Smckusick 	sRectangle	rect;	/* defined area */
453b6250d9Smckusick 	Word		*base;	/* for BM_MEM */
463b6250d9Smckusick } sBitmap;
473b6250d9Smckusick 
483b6250d9Smckusick typedef struct {
493b6250d9Smckusick 	char		type;	/* BM_FB, BM_MEM, BM_0, BM_1 or BM_LBP */
503b6250d9Smckusick 	char		depth;	/* bitmap depth */
513b6250d9Smckusick 	unsigned short	width;	/* width in Words */
523b6250d9Smckusick 	lRectangle	rect;	/* defined area */
533b6250d9Smckusick 	Word		*base;	/* for BM_MEM */
543b6250d9Smckusick } lBitmap;
553b6250d9Smckusick 
563b6250d9Smckusick #define BM_FB		0	/* frame buffer */
573b6250d9Smckusick #define BM_MEM		1	/* bitmap in memory (XY format) */
583b6250d9Smckusick #define BM_0		2	/* virtual bitmap of data '0' */
593b6250d9Smckusick #define BM_1		3	/* virtual bitmap of data '1' */
603b6250d9Smckusick #define BM_LBP		4	/* lbp page buffer (future support) */
613b6250d9Smckusick 
623b6250d9Smckusick /* 2 operand bitblt */
633b6250d9Smckusick typedef struct {
643b6250d9Smckusick 	unsigned char	func;		/* function code */
653b6250d9Smckusick 	char		transp;		/* transparency */
663b6250d9Smckusick 	int		fore_color;	/* foreground color */
673b6250d9Smckusick 	int		aux_color;	/* auxiliary color */
683b6250d9Smckusick 	int		planemask;	/* select plane */
693b6250d9Smckusick 	sBitmap		srcBitmap;	/* source bitmap */
703b6250d9Smckusick 	sRectangle	srcRect;	/* source rectangle */
713b6250d9Smckusick 	sBitmap		destBitmap;	/* destination bitmap */
723b6250d9Smckusick 	sRectangle	destClip;	/* clip rectangle */
733b6250d9Smckusick 	sPoint		destPoint;	/* destination point */
743b6250d9Smckusick } sBitblt;
753b6250d9Smckusick 
763b6250d9Smckusick typedef struct {
773b6250d9Smckusick 	unsigned char	func;		/* function code */
783b6250d9Smckusick 	char		transp;		/* transparency */
793b6250d9Smckusick 	int		fore_color;	/* foreground color */
803b6250d9Smckusick 	int		aux_color;	/* auxiliary color */
813b6250d9Smckusick 	int		planemask;	/* select plane */
823b6250d9Smckusick 	lBitmap		srcBitmap;	/* source bitmap */
833b6250d9Smckusick 	lRectangle	srcRect;	/* source rectangle */
843b6250d9Smckusick 	lBitmap		destBitmap;	/* destination bitmap */
853b6250d9Smckusick 	lRectangle	destClip;	/* clip rectangle */
863b6250d9Smckusick 	lPoint		destPoint;	/* destination point */
873b6250d9Smckusick } lBitblt;
883b6250d9Smckusick 
893b6250d9Smckusick /* tile 2 operand bitblt */
903b6250d9Smckusick typedef struct {
913b6250d9Smckusick 	unsigned char	func;		/* function code */
923b6250d9Smckusick 	char		transp;		/* transparency */
933b6250d9Smckusick 	int		fore_color;	/* foreground color */
943b6250d9Smckusick 	int		aux_color;	/* auxiliary color */
953b6250d9Smckusick 	int		planemask;	/* select plane */
963b6250d9Smckusick 	sBitmap		ptnBitmap;	/* pattern bitmap */
973b6250d9Smckusick 	sRectangle	ptnRect;	/* pattern rectangle */
983b6250d9Smckusick 	sPoint		refPoint;	/* reference point */
993b6250d9Smckusick 	sBitmap		destBitmap;	/* destination bitmap */
1003b6250d9Smckusick 	sRectangle	destClip;	/* clip rectangle */
1013b6250d9Smckusick 	sRectangle	destRect;	/* destination rectangle */
1023b6250d9Smckusick } sTileBitblt;
1033b6250d9Smckusick 
1043b6250d9Smckusick typedef struct {
1053b6250d9Smckusick 	unsigned char	func;		/* function code */
1063b6250d9Smckusick 	char		transp;		/* transparency */
1073b6250d9Smckusick 	int		fore_color;	/* foreground color */
1083b6250d9Smckusick 	int		aux_color;	/* auxiliary color */
1093b6250d9Smckusick 	int		planemask;	/* select plane */
1103b6250d9Smckusick 	lBitmap		ptnBitmap;	/* pattern bitmap */
1113b6250d9Smckusick 	lRectangle	ptnRect;	/* pattern rectangle */
1123b6250d9Smckusick 	lPoint		refPoint;	/* reference point */
1133b6250d9Smckusick 	lBitmap		destBitmap;	/* destination bitmap */
1143b6250d9Smckusick 	lRectangle	destClip;	/* clip rectangle */
1153b6250d9Smckusick 	lRectangle	destRect;	/* destination rectangle */
1163b6250d9Smckusick } lTileBitblt;
1173b6250d9Smckusick 
1183b6250d9Smckusick /* 3 operand bitblt */
1193b6250d9Smckusick typedef struct {
1203b6250d9Smckusick 	unsigned char	func;		/* function code */
1213b6250d9Smckusick 	char		transp;		/* transparency */
1223b6250d9Smckusick 	int		fore_color;	/* foreground color */
1233b6250d9Smckusick 	int		aux_color;	/* auxiliary color */
1243b6250d9Smckusick 	int		planemask;	/* select plane */
1253b6250d9Smckusick 	sBitmap		ptnBitmap;	/* pattern bitmap */
1263b6250d9Smckusick 	sRectangle	ptnRect;	/* pattern rectangle */
1273b6250d9Smckusick 	sPoint		refPoint;	/* reference point */
1283b6250d9Smckusick 	sBitmap		srcBitmap;	/* source bitmap */
1293b6250d9Smckusick 	sRectangle	srcRect;	/* source rectangle */
1303b6250d9Smckusick 	sBitmap		destBitmap;	/* destination bitmap */
1313b6250d9Smckusick 	sRectangle	destClip;	/* clip rectangle */
1323b6250d9Smckusick 	sPoint		destPoint;	/* destination point */
1333b6250d9Smckusick } sBitblt3;
1343b6250d9Smckusick 
1353b6250d9Smckusick typedef struct {
1363b6250d9Smckusick 	unsigned char	func;		/* function code */
1373b6250d9Smckusick 	char		transp;		/* transparency */
1383b6250d9Smckusick 	int		fore_color;	/* foreground color */
1393b6250d9Smckusick 	int		aux_color;	/* auxiliary color */
1403b6250d9Smckusick 	int		planemask;	/* select plane */
1413b6250d9Smckusick 	lBitmap		ptnBitmap;	/* pattern bitmap */
1423b6250d9Smckusick 	lRectangle	ptnRect;	/* pattern rectangle */
1433b6250d9Smckusick 	lPoint		refPoint;	/* reference point */
1443b6250d9Smckusick 	lBitmap		srcBitmap;	/* source bitmap */
1453b6250d9Smckusick 	lRectangle	srcRect;	/* source rectangle */
1463b6250d9Smckusick 	lBitmap		destBitmap;	/* destination bitmap */
1473b6250d9Smckusick 	lRectangle	destClip;	/* clip rectangle */
1483b6250d9Smckusick 	lPoint		destPoint;	/* destination point */
1493b6250d9Smckusick } lBitblt3;
1503b6250d9Smckusick 
1513b6250d9Smckusick typedef struct {
1523b6250d9Smckusick 	sRectangle	srcRect;	/* source rectangle */
1533b6250d9Smckusick 	sPoint		destPoint;	/* destination point */
1543b6250d9Smckusick } sSrcDest;
1553b6250d9Smckusick 
1563b6250d9Smckusick typedef struct {
1573b6250d9Smckusick 	lRectangle	srcRect;	/* source rectangle */
1583b6250d9Smckusick 	lPoint		destPoint;	/* destination point */
1593b6250d9Smckusick } lSrcDest;
1603b6250d9Smckusick 
1613b6250d9Smckusick /*
1623b6250d9Smckusick  * batch bitblt
1633b6250d9Smckusick  */
1643b6250d9Smckusick typedef struct {
1653b6250d9Smckusick 	unsigned char	func;		/* function code */
1663b6250d9Smckusick 	char		transp;		/* transparency */
1673b6250d9Smckusick 	int		fore_color;	/* foreground color */
1683b6250d9Smckusick 	int		aux_color;	/* auxiliary color */
1693b6250d9Smckusick 	int		planemask;	/* select plane */
1703b6250d9Smckusick 	sBitmap		srcBitmap;	/* source bitmap */
1713b6250d9Smckusick 	sBitmap		destBitmap;	/* destination bitmap */
1723b6250d9Smckusick 	sRectangle	destClip;	/* clip rectangle */
1733b6250d9Smckusick 	int		nSrcDest;	/* number of src-dest in list */
1743b6250d9Smckusick 	sSrcDest	*srcDestList;	/* pointer to src-dest spec */
1753b6250d9Smckusick } sBatchBitblt;
1763b6250d9Smckusick 
1773b6250d9Smckusick typedef struct {
1783b6250d9Smckusick 	unsigned char	func;		/* function code */
1793b6250d9Smckusick 	char		transp;		/* transparency */
1803b6250d9Smckusick 	int		fore_color;	/* foreground color */
1813b6250d9Smckusick 	int		aux_color;	/* auxiliary color */
1823b6250d9Smckusick 	int		planemask;	/* select plane */
1833b6250d9Smckusick 	lBitmap		srcBitmap;	/* source bitmap */
1843b6250d9Smckusick 	lBitmap		destBitmap;	/* destination bitmap */
1853b6250d9Smckusick 	lRectangle	destClip;	/* clip rectangle */
1863b6250d9Smckusick 	int		nSrcDest;	/* number of src-dest in list */
1873b6250d9Smckusick 	lSrcDest	*srcDestList;	/* pointer to src-dest spec */
1883b6250d9Smckusick } lBatchBitblt;
1893b6250d9Smckusick 
1903b6250d9Smckusick #define MAX_BATCHBITBLT	1024		/* max number in src-dest list */
1913b6250d9Smckusick 
1923b6250d9Smckusick /*
1933b6250d9Smckusick  * set screen mode
1943b6250d9Smckusick  */
1953b6250d9Smckusick 
1963b6250d9Smckusick #define BLACK_ON_WHITE	0	/* white - 0, black - 1 (default) */
1973b6250d9Smckusick #define WHITE_ON_BLACK	1	/* white - 1, black - 0 */
1983b6250d9Smckusick 
1993b6250d9Smckusick /*
2003b6250d9Smckusick  * graphic primitive drawing
2013b6250d9Smckusick  */
2023b6250d9Smckusick 
2033b6250d9Smckusick /* scan line array */
2043b6250d9Smckusick typedef struct {
2053b6250d9Smckusick 	short	y;
2063b6250d9Smckusick 	short	x0, x1;		/* x0 <= x1 */
2073b6250d9Smckusick } sScanl;
2083b6250d9Smckusick 
2093b6250d9Smckusick typedef struct {
2103b6250d9Smckusick 	int	y;
2113b6250d9Smckusick 	int	x0, x1;		/* x0 <= x1 */
2123b6250d9Smckusick } lScanl;
2133b6250d9Smckusick 
2143b6250d9Smckusick /* line */
2153b6250d9Smckusick typedef struct {
2163b6250d9Smckusick 	unsigned int	lptn;		/* line pattern */
2173b6250d9Smckusick 	short		np;		/* number of points */
2183b6250d9Smckusick 	sPoint		*plist;		/* point list */
2193b6250d9Smckusick 	int		fore_color;	/* foreground color */
2203b6250d9Smckusick 	int		aux_color;	/* auxiliary color */
2213b6250d9Smckusick 	int		planemask;	/* select plane */
2223b6250d9Smckusick 	char		transp;		/* transparency */
2233b6250d9Smckusick 	unsigned char	func;		/* rop function code */
2243b6250d9Smckusick 	char		dlpf;		/* draw last point flag */
2253b6250d9Smckusick 	sRectangle	clip;		/* clip rectangle */
2263b6250d9Smckusick 	sBitmap		drawBM;		/* drawing bitmap */
2273b6250d9Smckusick } sPrimLine;
2283b6250d9Smckusick 
2293b6250d9Smckusick typedef struct {
2303b6250d9Smckusick 	unsigned int	lptn;		/* line pattern */
2313b6250d9Smckusick 	short		np;		/* number of points */
2323b6250d9Smckusick 	lPoint		*plist;		/* point list */
2333b6250d9Smckusick 	int		fore_color;	/* foreground color */
2343b6250d9Smckusick 	int		aux_color;	/* auxiliary color */
2353b6250d9Smckusick 	int		planemask;	/* select plane */
2363b6250d9Smckusick 	char		transp;		/* transparency */
2373b6250d9Smckusick 	unsigned char	func;		/* rop function code */
2383b6250d9Smckusick 	char		dlpf;		/* draw last point flag */
2393b6250d9Smckusick 	lRectangle	clip;		/* clip rectangle */
2403b6250d9Smckusick 	lBitmap		drawBM;		/* drawing bitmap */
2413b6250d9Smckusick } lPrimLine;
2423b6250d9Smckusick 
2433b6250d9Smckusick /* rectangle filling */
2443b6250d9Smckusick typedef struct {
2453b6250d9Smckusick 	sRectangle	rect;		/* rectangle */
2463b6250d9Smckusick 	sPoint		refPoint;	/* fill reference point */
2473b6250d9Smckusick 	sRectangle	ptnRect;	/* pattern rectangle */
2483b6250d9Smckusick 	sBitmap		ptnBM;		/* pattern bitmap */
2493b6250d9Smckusick 	int		fore_color;	/* foreground color */
2503b6250d9Smckusick 	int		aux_color;	/* auxiliary color */
2513b6250d9Smckusick 	int		planemask;	/* select plane */
2523b6250d9Smckusick 	char		transp;		/* transparency */
2533b6250d9Smckusick 	unsigned char	func;		/* rop function code */
2543b6250d9Smckusick 	sRectangle	clip;		/* clip rectangle */
2553b6250d9Smckusick 	sBitmap		drawBM;		/* drawing bitmap */
2563b6250d9Smckusick } sPrimRect;
2573b6250d9Smckusick 
2583b6250d9Smckusick typedef struct {
2593b6250d9Smckusick 	lRectangle	rect;		/* rectangle */
2603b6250d9Smckusick 	lPoint		refPoint;	/* fill reference point */
2613b6250d9Smckusick 	lRectangle	ptnRect;	/* pattern rectangle */
2623b6250d9Smckusick 	lBitmap		ptnBM;		/* pattern bitmap */
2633b6250d9Smckusick 	int		fore_color;	/* foreground color */
2643b6250d9Smckusick 	int		aux_color;	/* auxiliary color */
2653b6250d9Smckusick 	int		planemask;	/* select plane */
2663b6250d9Smckusick 	char		transp;		/* transparency */
2673b6250d9Smckusick 	unsigned char	func;		/* rop function code */
2683b6250d9Smckusick 	lRectangle	clip;		/* clip rectangle */
2693b6250d9Smckusick 	lBitmap		drawBM;		/* drawing bitmap */
2703b6250d9Smckusick } lPrimRect;
2713b6250d9Smckusick 
2723b6250d9Smckusick /* pattern filling */
2733b6250d9Smckusick typedef struct {
2743b6250d9Smckusick 	short		nscan;		/* number of scan element */
2753b6250d9Smckusick 	sScanl		*scan;		/* scan line data */
2763b6250d9Smckusick 	sPoint		refPoint;	/* fill reference point */
2773b6250d9Smckusick 	sRectangle	ptnRect;	/* pattern rectangle */
2783b6250d9Smckusick 	sBitmap		ptnBM;		/* pattern bitmap */
2793b6250d9Smckusick 	int		fore_color;	/* foreground color */
2803b6250d9Smckusick 	int		aux_color;	/* auxiliary color */
2813b6250d9Smckusick 	int		planemask;	/* select plane */
2823b6250d9Smckusick 	char		transp;		/* transparency */
2833b6250d9Smckusick 	unsigned char	func;		/* rop function code */
2843b6250d9Smckusick 	sRectangle	clip;		/* clip rectangle */
2853b6250d9Smckusick 	sBitmap		drawBM;		/* drawing bitmap */
2863b6250d9Smckusick } sPrimFill;
2873b6250d9Smckusick 
2883b6250d9Smckusick typedef struct {
2893b6250d9Smckusick 	short		nscan;		/* number of scan element */
2903b6250d9Smckusick 	lScanl		*scan;		/* scan line data */
2913b6250d9Smckusick 	lPoint		refPoint;	/* fill reference point */
2923b6250d9Smckusick 	lRectangle	ptnRect;	/* pattern rectangle */
2933b6250d9Smckusick 	lBitmap		ptnBM;		/* pattern bitmap */
2943b6250d9Smckusick 	int		fore_color;	/* foreground color */
2953b6250d9Smckusick 	int		aux_color;	/* auxiliary color */
2963b6250d9Smckusick 	int		planemask;	/* select plane */
2973b6250d9Smckusick 	char		transp;		/* transparency */
2983b6250d9Smckusick 	unsigned char	func;		/* rop function code */
2993b6250d9Smckusick 	lRectangle	clip;		/* clip rectangle */
3003b6250d9Smckusick 	lBitmap		drawBM;		/* drawing bitmap */
3013b6250d9Smckusick } lPrimFill;
3023b6250d9Smckusick 
3033b6250d9Smckusick /* marker */
3043b6250d9Smckusick typedef struct {
3053b6250d9Smckusick 	short		np;		/* number of points */
3063b6250d9Smckusick 	sPoint		*plist;		/* point list */
3073b6250d9Smckusick 	sRectangle	ptnRect;	/* pattern rectangle */
3083b6250d9Smckusick 	sBitmap		ptnBM;		/* pattern bitmap */
3093b6250d9Smckusick 	int		fore_color;	/* foreground color */
3103b6250d9Smckusick 	int		aux_color;	/* auxiliary color */
3113b6250d9Smckusick 	int		planemask;	/* select plane */
3123b6250d9Smckusick 	char		transp;		/* transparency */
3133b6250d9Smckusick 	unsigned char	func;		/* rop function code */
3143b6250d9Smckusick 	sRectangle	clip;		/* clip rectangle */
3153b6250d9Smckusick 	sBitmap		drawBM;		/* drawing bitmap */
3163b6250d9Smckusick } sPrimMarker;
3173b6250d9Smckusick 
3183b6250d9Smckusick typedef struct {
3193b6250d9Smckusick 	short		np;		/* number of points */
3203b6250d9Smckusick 	lPoint		*plist;		/* point list */
3213b6250d9Smckusick 	lRectangle	ptnRect;	/* pattern rectangle */
3223b6250d9Smckusick 	lBitmap		ptnBM;		/* pattern bitmap */
3233b6250d9Smckusick 	int		fore_color;	/* foreground color */
3243b6250d9Smckusick 	int		aux_color;	/* auxiliary color */
3253b6250d9Smckusick 	int		planemask;	/* select plane */
3263b6250d9Smckusick 	char		transp;		/* transparency */
3273b6250d9Smckusick 	unsigned char	func;		/* rop function code */
3283b6250d9Smckusick 	lRectangle	clip;		/* clip rectangle */
3293b6250d9Smckusick 	lBitmap		drawBM;		/* drawing bitmap */
3303b6250d9Smckusick } lPrimMarker;
3313b6250d9Smckusick 
3323b6250d9Smckusick /* text */
3333b6250d9Smckusick #define MAX_STRING	1024
3343b6250d9Smckusick 
3353b6250d9Smckusick typedef struct {
3363b6250d9Smckusick 	char		type;		/* ROM-font, etc */
3373b6250d9Smckusick 	short		len;		/* string length (byte) */
3383b6250d9Smckusick 	unsigned char	*str;		/* string */
3393b6250d9Smckusick 	sPoint		p;
3403b6250d9Smckusick 	int		dx, dy;		/* vector (16bit left shifted) */
3413b6250d9Smckusick 	char		ex_factor;	/* expansion factor */
3423b6250d9Smckusick 	sPoint		fp;		/* bitmap font upper-left */
3433b6250d9Smckusick 	short		width, height;	/* font width, font height */
3443b6250d9Smckusick 	short		column;		/* number of characters in a row */
3453b6250d9Smckusick 	unsigned short	first_chr;	/* first character code */
3463b6250d9Smckusick 	unsigned short	last_chr;	/* last character code */
3473b6250d9Smckusick 	sBitmap		fontBM;		/* font bitmap */
3483b6250d9Smckusick 	int		fore_color;	/* foreground color */
3493b6250d9Smckusick 	int		aux_color;	/* auxiliary color */
3503b6250d9Smckusick 	int		planemask;	/* select plane */
3513b6250d9Smckusick 	char		transp;		/* transparency */
3523b6250d9Smckusick 	unsigned char	func;		/* rop function code */
3533b6250d9Smckusick 	sRectangle	clip;		/* clip rectangle */
3543b6250d9Smckusick 	sBitmap		drawBM;		/* drawing bitmap */
3553b6250d9Smckusick } sPrimText;
3563b6250d9Smckusick 
3573b6250d9Smckusick typedef struct {
3583b6250d9Smckusick 	int		dx, dy;		/* vector (16bit left shifted) */
3593b6250d9Smckusick 	lPoint		fp;		/* bitmap font upper-left */
3603b6250d9Smckusick 	short		width, height;	/* font width, font height */
3613b6250d9Smckusick 	short		column;		/* number of characters in a row */
3623b6250d9Smckusick 	unsigned short	first_chr;	/* first character code */
3633b6250d9Smckusick 	unsigned short	last_chr;	/* last character code */
3643b6250d9Smckusick 	lBitmap		fontBM;		/* font bitmap */
3653b6250d9Smckusick 	int		fore_color;	/* foreground color */
3663b6250d9Smckusick 	int		aux_color;	/* auxiliary color */
3673b6250d9Smckusick 	int		planemask;	/* select plane */
3683b6250d9Smckusick 	lBitmap		drawBM;		/* drawing bitmap */
3693b6250d9Smckusick 	lRectangle	clip;		/* clip rectangle */
3703b6250d9Smckusick 	lPoint		p;		/* output position */
3713b6250d9Smckusick 	unsigned char	*str;		/* string */
3723b6250d9Smckusick 	short		len;		/* string length (byte) */
3733b6250d9Smckusick 	char		type;		/* ROM-font, etc */
3743b6250d9Smckusick 	char		transp;		/* transparency */
3753b6250d9Smckusick 	unsigned char	func;		/* rop function code */
3763b6250d9Smckusick 	char		ex_factor;	/* expansion factor */
3773b6250d9Smckusick } lPrimText;
3783b6250d9Smckusick 
3793b6250d9Smckusick /* dot */
3803b6250d9Smckusick typedef struct {
3813b6250d9Smckusick 	short		np;		/* number of points */
3823b6250d9Smckusick 	sPoint		*plist;		/* point list */
3833b6250d9Smckusick 	int		fore_color;	/* foreground color */
3843b6250d9Smckusick 	int		aux_color;	/* auxiliary color */
3853b6250d9Smckusick 	int		planemask;	/* select plane */
3863b6250d9Smckusick 	char		transp;		/* transparency */
3873b6250d9Smckusick 	unsigned char	func;		/* rop function code */
3883b6250d9Smckusick 	sRectangle	clip;		/* clip rectangle */
3893b6250d9Smckusick 	sBitmap		drawBM;		/* drawing bitmap */
3903b6250d9Smckusick } sPrimDot;
3913b6250d9Smckusick 
3923b6250d9Smckusick typedef struct {
3933b6250d9Smckusick 	short		np;		/* number of points */
3943b6250d9Smckusick 	lPoint		*plist;		/* point list */
3953b6250d9Smckusick 	int		fore_color;	/* foreground color */
3963b6250d9Smckusick 	int		aux_color;	/* auxiliary color */
3973b6250d9Smckusick 	int		planemask;	/* select plane */
3983b6250d9Smckusick 	char		transp;		/* transparency */
3993b6250d9Smckusick 	unsigned char	func;		/* rop function code */
4003b6250d9Smckusick 	lRectangle	clip;		/* clip rectangle */
4013b6250d9Smckusick 	lBitmap		drawBM;		/* drawing bitmap */
4023b6250d9Smckusick } lPrimDot;
4033b6250d9Smckusick 
4043b6250d9Smckusick /*
4053b6250d9Smckusick  *	screen type
4063b6250d9Smckusick  */
4073b6250d9Smckusick typedef struct {
4083b6250d9Smckusick 	short		colorwidth;	/* palette color width */
4093b6250d9Smckusick 	short		plane;		/* number of planes */
4103b6250d9Smckusick 	sRectangle	bufferrect;	/* framebuffer region */
4113b6250d9Smckusick 	sRectangle	visiblerect;	/* visible screen region */
4123b6250d9Smckusick } sScrType;
4133b6250d9Smckusick 
4143b6250d9Smckusick typedef struct {
4153b6250d9Smckusick 	short		colorwidth;	/* palette color width */
4163b6250d9Smckusick 	short		plane;		/* number of planes */
4173b6250d9Smckusick 	char		type;		/* device type */
4183b6250d9Smckusick 	char		unit;		/* unit no */
4193b6250d9Smckusick 	lRectangle	bufferrect;	/* framebuffer region */
4203b6250d9Smckusick 	lRectangle	visiblerect;	/* visible screen region */
4213b6250d9Smckusick } lScrType;
4223b6250d9Smckusick 
4233b6250d9Smckusick /* device type */
4243b6250d9Smckusick #define	FB_NWB512	1	/* fb is B/W bitmap display (816x1024) */
4253b6250d9Smckusick #define	FB_NWB225	2	/* fb is color bitmap display (1280x1024) */
4263b6250d9Smckusick #define	FB_POPM		3	/* fb is B/W bitmap display (816x1024) */
4273b6250d9Smckusick #define	FB_POPC		4	/* fb is color bitmap display (1024x768) */
4283b6250d9Smckusick #define FB_NWB514	5	/* fb is GrayScale bitmap display (1280x1280) */
4293b6250d9Smckusick #define FB_NWB251	6	/* fb is New color bitmap display (1280x1024) */
4303b6250d9Smckusick #define	FB_LCDM		7	/* fb is lcd bitmap (1120x780) */
4313b6250d9Smckusick #define	FB_LCDC		8	/* fb is LCD color bitmap display (?) */
4323b6250d9Smckusick #define	FB_NWB518	9	/* fb is B/W bitmap display (1024x768) */
4333b6250d9Smckusick #define	FB_NWB252	10	/* fb is color bitmap display (1024x768) */
4343b6250d9Smckusick #define	FB_NWB253	11	/* fb is B/W bitmap display (816x1024) */
4353b6250d9Smckusick #define	FB_NWB254	12	/* fb is color bitmap display (1024x768) */
4363b6250d9Smckusick #define	FB_NWB255	13	/* fb is B/W bitmap display (1280x1280) */
4373b6250d9Smckusick #define	FB_SLB101	14	/* fb is color bitmap display (1920x1035) */
4383b6250d9Smckusick #define FB_NWB256	15	/* fb is 3D-Rendaring Board (1280x1024) */
4393b6250d9Smckusick #define	FB_NWB257	16	/* fb is color bitmap display (1280x1024) */
4403b6250d9Smckusick 
4413b6250d9Smckusick #define FB_NWB240	200	/* fb is A3 LPB/IR interface (3136x4516) */
4423b6250d9Smckusick #define FB_NWB241	201	/* fb is A4 LBP/IR interface (3904x5600) */
4433b6250d9Smckusick #define FB_NWB242	202	/* fb is A3 Image Processor (3136x4516) */
4443b6250d9Smckusick 
4453b6250d9Smckusick #define FB_FB2015	254	/* fb is full color big display (2048x1536) */
4463b6250d9Smckusick #define FB_FB2020	255	/* fb is full color big display (2048x2048) */
4473b6250d9Smckusick 
4483b6250d9Smckusick #define FB_MONO0	1	/* fb is B/W (compat-3.0) */
4493b6250d9Smckusick #define FB_COLOR0	2	/* fb is color (compat-3.0) */
4503b6250d9Smckusick 
4513b6250d9Smckusick /*
4523b6250d9Smckusick  *	color
4533b6250d9Smckusick  */
4543b6250d9Smckusick typedef struct {
4553b6250d9Smckusick 	short	index;		/* palette number */
4563b6250d9Smckusick 	struct {
4573b6250d9Smckusick 		short	r, g, b;
4583b6250d9Smckusick 	} rgb;
4593b6250d9Smckusick } sPalette;
4603b6250d9Smckusick 
4613b6250d9Smckusick typedef struct {
4623b6250d9Smckusick 	int		count;
4633b6250d9Smckusick 	sPalette	*palette;
4643b6250d9Smckusick } lPalette;
4653b6250d9Smckusick 
4663b6250d9Smckusick /*
4673b6250d9Smckusick  *	cursor
4683b6250d9Smckusick  */
4693b6250d9Smckusick typedef struct {
4703b6250d9Smckusick 	unsigned char	func;
4713b6250d9Smckusick 	char		cursor_color;
4723b6250d9Smckusick 	char		mask_color;
4733b6250d9Smckusick 	sPoint		hot;
4743b6250d9Smckusick 	sPoint		size;
4753b6250d9Smckusick 	sRectangle	cursorRect;	/* Cursor Pattern rea */
4763b6250d9Smckusick 	sRectangle	maskRect;	/* Mask Pattern Area */
4773b6250d9Smckusick 	sRectangle	saveRect;	/* Save Pattern Area */
4783b6250d9Smckusick 	sRectangle	moveArea;
4793b6250d9Smckusick } sCursor;
4803b6250d9Smckusick 
4813b6250d9Smckusick typedef struct {
4823b6250d9Smckusick 	unsigned char	func;
4833b6250d9Smckusick 	char		cursor_color;
4843b6250d9Smckusick 	char		mask_color;
4853b6250d9Smckusick 	lPoint		hot;
4863b6250d9Smckusick 	lPoint		size;
4873b6250d9Smckusick 	lRectangle	cursorRect;	/* Cursor Pattern Area */
4883b6250d9Smckusick 	lRectangle	maskRect;	/* Mask Pattern Area */
4893b6250d9Smckusick 	lRectangle	saveRect;	/* Save Pattern Area */
4903b6250d9Smckusick 	lRectangle	moveArea;
4913b6250d9Smckusick } lCursor;
4923b6250d9Smckusick 
4933b6250d9Smckusick typedef struct {
4943b6250d9Smckusick 	unsigned char	func;
4953b6250d9Smckusick 	int		cursor_color;
4963b6250d9Smckusick 	int		mask_color;
4973b6250d9Smckusick 	lPoint		hot;
4983b6250d9Smckusick 	lPoint		size;
4993b6250d9Smckusick 	lRectangle	cursorRect;	/* Cursor Pattern Area */
5003b6250d9Smckusick 	lRectangle	maskRect;	/* Mask Pattern Area */
5013b6250d9Smckusick 	lRectangle	saveRect;	/* Save Pattern Area */
5023b6250d9Smckusick 	lRectangle	moveArea;
5033b6250d9Smckusick } lCursor2;
5043b6250d9Smckusick 
5053b6250d9Smckusick typedef struct {
5063b6250d9Smckusick 	int request;
5073b6250d9Smckusick 	lPoint sp;
5083b6250d9Smckusick 	lPoint dp;
5093b6250d9Smckusick 	lPoint size;
5103b6250d9Smckusick 	int refresh_rate;
5113b6250d9Smckusick 	int func;
5123b6250d9Smckusick 	int planemask;
5133b6250d9Smckusick } lVideoCtl;
5143b6250d9Smckusick 
5153b6250d9Smckusick typedef struct {
5163b6250d9Smckusick 	int request;
5173b6250d9Smckusick 	int mode;
5183b6250d9Smckusick 	int status;
5193b6250d9Smckusick 	lRectangle vframe;
5203b6250d9Smckusick 	int refresh_rate;
5213b6250d9Smckusick 	int func;
5223b6250d9Smckusick 	int planemask;
5233b6250d9Smckusick } lVideoStatus;
5243b6250d9Smckusick 
5253b6250d9Smckusick /* Video Control Request */
5263b6250d9Smckusick #define VIDEO_RESET     0x01
5273b6250d9Smckusick #define VIDEO_RUN       0x02
5283b6250d9Smckusick #define VIDEO_STOP      0x04
5293b6250d9Smckusick #define VIDEO_CONT      0x08
5303b6250d9Smckusick #define VIDEO_FRAME     0x10
5313b6250d9Smckusick #define VIDEO_ROP       0x20
5323b6250d9Smckusick 
5333b6250d9Smckusick /* Video Status */
5343b6250d9Smckusick #define VIDEO_STATUS    0x01
5353b6250d9Smckusick 
5363b6250d9Smckusick #define VIDEO_SIG_NTSC  0x01
5373b6250d9Smckusick #define VIDEO_SIG_PAL   0x02
5383b6250d9Smckusick 
5393b6250d9Smckusick #define VIDEO_STATUS_RUN        1
5403b6250d9Smckusick #define VIDEO_STATUS_STOP       2
5413b6250d9Smckusick #define VIDEO_STATUS_ERROR      4
5423b6250d9Smckusick 
5433b6250d9Smckusick #define VIDEO_ERROR_SIZE        0x100
5443b6250d9Smckusick #define VIDEO_ERROR_POINT       0x200
5453b6250d9Smckusick #define VIDEO_ERROR_PARAM       0x400
5463b6250d9Smckusick 
5473b6250d9Smckusick typedef struct {
5483b6250d9Smckusick 	int	request;
5493b6250d9Smckusick 	int	param[8];
5503b6250d9Smckusick } lFbIoctl;
5513b6250d9Smckusick 
5523b6250d9Smckusick 
5533b6250d9Smckusick /* func */
5543b6250d9Smckusick #define BF_0	0x0	/* 0 */
5553b6250d9Smckusick #define BF_SDA	0x1	/* Src & Dest */
5563b6250d9Smckusick #define BF_SDIA	0x2	/* Src & ~Dest */
5573b6250d9Smckusick #define BF_S	0x3	/* Src */
5583b6250d9Smckusick #define BF_SIDA	0x4	/* ~Src & Dest */
5593b6250d9Smckusick #define BF_D	0x5	/* Dest */
5603b6250d9Smckusick #define BF_SDX	0x6	/* Src ^ Dest */
5613b6250d9Smckusick #define BF_SDO	0x7	/* Src | Dest */
5623b6250d9Smckusick #define BF_SDOI	0x8	/* ~(Src | Dest) */
5633b6250d9Smckusick #define BF_SDXI	0x9	/* ~(Src ^ Dest) */
5643b6250d9Smckusick #define BF_DI	0xa	/* ~Dest */
5653b6250d9Smckusick #define BF_SDIO	0xb	/* Src | ~Dest */
5663b6250d9Smckusick #define BF_SI	0xc	/* ~Src */
5673b6250d9Smckusick #define BF_SIDO	0xd	/* ~Src | Dest */
5683b6250d9Smckusick #define BF_SDAI	0xe	/* ~(Src & Dest) */
5693b6250d9Smckusick #define BF_1	0xf	/* 1 */
5703b6250d9Smckusick 
5713b6250d9Smckusick #define BF_NOP(f)	((f) == BF_D)
5723b6250d9Smckusick #define BF_INV(f)	((f) == BF_DI)
5733b6250d9Smckusick #define BF_CON(f)	((f) == BF_0 || (f) == BF_1)
5743b6250d9Smckusick #define BF_SRC(f)	(!BF_NOP(f)&&!BF_INV(f)&&!BF_CON(f))
5753b6250d9Smckusick 
5763b6250d9Smckusick /* Bitmap Font Type */
5773b6250d9Smckusick #define ROM_ASCII	0
5783b6250d9Smckusick #define ROM_KANJI	1
5793b6250d9Smckusick #define ASCII		2
5803b6250d9Smckusick #define ROM_CONS	3
5813b6250d9Smckusick 
5823b6250d9Smckusick /* Plane Mask */
5833b6250d9Smckusick #define FB_PLANEALL	0xffffff
5843b6250d9Smckusick #define FB_PLANE0	0x000001
5853b6250d9Smckusick #define FB_PLANE1	0x000002
5863b6250d9Smckusick #define FB_PLANE2	0x000004
5873b6250d9Smckusick #define FB_PLANE3	0x000008
5883b6250d9Smckusick #define FB_PLANE4	0x000010
5893b6250d9Smckusick #define FB_PLANE5	0x000020
5903b6250d9Smckusick #define FB_PLANE6	0x000040
5913b6250d9Smckusick #define FB_PLANE7	0x000080
5923b6250d9Smckusick #define FB_PLANE8	0x000100
5933b6250d9Smckusick #define FB_PLANE9	0x000200
5943b6250d9Smckusick #define FB_PLANE10	0x000400
5953b6250d9Smckusick #define FB_PLANE11	0x000800
5963b6250d9Smckusick #define FB_PLANE12	0x001000
5973b6250d9Smckusick #define FB_PLANE13	0x002000
5983b6250d9Smckusick #define FB_PLANE14	0x004000
5993b6250d9Smckusick #define FB_PLANE15	0x008000
6003b6250d9Smckusick #define FB_PLANE16	0x010000
6013b6250d9Smckusick #define FB_PLANE17	0x020000
6023b6250d9Smckusick #define FB_PLANE18	0x040000
6033b6250d9Smckusick #define FB_PLANE19	0x080000
6043b6250d9Smckusick #define FB_PLANE20	0x100000
6053b6250d9Smckusick #define FB_PLANE21	0x200000
6063b6250d9Smckusick #define FB_PLANE22	0x400000
6073b6250d9Smckusick #define FB_PLANE23	0x800000
6083b6250d9Smckusick 
6093b6250d9Smckusick /* Line Pattern */
6103b6250d9Smckusick #define LINE_SLD	(unsigned)0xffffffff	/* solid */
6113b6250d9Smckusick #define LINE_DSH	(unsigned)0xfcfcfcfc	/* dash */
6123b6250d9Smckusick #define LINE_DOT	(unsigned)0xcccccccc	/* dot */
6133b6250d9Smckusick #define LINE_DSHDOT	(unsigned)0xfff18fff	/* dash dot */
6143b6250d9Smckusick #define LINE_DSHDOTDOT	(unsigned)0xff8c63ff	/* dash dot dot */
6153b6250d9Smckusick 
6163b6250d9Smckusick /*
6173b6250d9Smckusick  * FB IOCTL
6183b6250d9Smckusick  */
6193b6250d9Smckusick #include <sys/ioctl.h>
6203b6250d9Smckusick 
6213b6250d9Smckusick #define FBIOCSETSCR		_IOW('F', 0, int)
6223b6250d9Smckusick #define FBIOCGETSCR		_IOR('F', 1, int)
6233b6250d9Smckusick #define FBIOCSETDIM		_IOW('F', 2, int)
6243b6250d9Smckusick #define FBIOCGETDIM		_IOR('F', 3, int)
6253b6250d9Smckusick #define FBIOCSETSCRMODE		_IOW('F', 4, int)
6263b6250d9Smckusick #define FBIOCGETSCRMODE		_IOR('F', 5, int)
6273b6250d9Smckusick #define FBIOCAUTODIM		_IOW('F', 6, int)
6283b6250d9Smckusick 
6293b6250d9Smckusick #define FBIOCBITBLT 		_IOW('F', 10, sBitblt)
6303b6250d9Smckusick #define FBIOCBATCHBITBLT	_IOW('F', 11, sBatchBitblt)
6313b6250d9Smckusick #define FBIOCTILEBITBLT		_IOW('F', 12, sTileBitblt)
6323b6250d9Smckusick #define FBIOCBITBLT3		_IOW('F', 13, sBitblt3)
6333b6250d9Smckusick 
6343b6250d9Smckusick #define FBIOCPOLYLINE		_IOW('F', 20, sPrimLine)
6353b6250d9Smckusick #define FBIOCDJPOLYLINE		_IOW('F', 21, sPrimLine)
6363b6250d9Smckusick #define FBIOCPOLYMARKER		_IOW('F', 22, sPrimMarker)
6373b6250d9Smckusick #define FBIOCRECTANGLE		_IOW('F', 23, sPrimRect)
6383b6250d9Smckusick #define FBIOCFILLSCAN		_IOW('F', 24, sPrimFill)
6393b6250d9Smckusick #define FBIOCTEXT		_IOW('F', 25, sPrimText)
6403b6250d9Smckusick #define FBIOCPOLYDOT		_IOW('F', 26, sPrimDot)
6413b6250d9Smckusick 
6423b6250d9Smckusick #define FBIOCGETSCRTYPE		_IOR('F', 30, sScrType)
6433b6250d9Smckusick 
6443b6250d9Smckusick /* for color display */
6453b6250d9Smckusick #define FBIOCSETPALETTE		_IOW('F', 31, sPalette)
6463b6250d9Smckusick #define FBIOCGETPALETTE		_IOWR('F', 32, sPalette)
6473b6250d9Smckusick #define FBIOCSETDADDR		_IOW('F', 33, int)
6483b6250d9Smckusick 
6493b6250d9Smckusick #define FBIOCENABLE		_IO('F', 40)
6503b6250d9Smckusick #define FBIOCDISABLE		_IO('F', 41)
6513b6250d9Smckusick 
6523b6250d9Smckusick #define FBIOCSETCURSOR		_IOW('F', 42, sCursor)
6533b6250d9Smckusick #define FBIOCUNSETCURSOR	_IO('F', 43)
6543b6250d9Smckusick #define FBIOCSHOWCURSOR		_IO('F', 44)
6553b6250d9Smckusick #define FBIOCHIDECURSOR		_IO('F', 45)
6563b6250d9Smckusick #define FBIOCSETXY		_IOW('F', 46, sPoint)
6573b6250d9Smckusick 
6583b6250d9Smckusick #define FBIOCNBITBLT 		_IOW('F', 50, lBitblt)
6593b6250d9Smckusick #define FBIOCNBATCHBITBLT	_IOW('F', 51, lBatchBitblt)
6603b6250d9Smckusick #define FBIOCNTILEBITBLT	_IOW('F', 52, lTileBitblt)
6613b6250d9Smckusick #define FBIOCNBITBLT3		_IOW('F', 53, lBitblt3)
6623b6250d9Smckusick 
6633b6250d9Smckusick #define FBIOCNPOLYLINE		_IOW('F', 60, lPrimLine)
6643b6250d9Smckusick #define FBIOCNDJPOLYLINE	_IOW('F', 61, lPrimLine)
6653b6250d9Smckusick #define FBIOCNPOLYMARKER	_IOW('F', 62, lPrimMarker)
6663b6250d9Smckusick #define FBIOCNRECTANGLE		_IOW('F', 63, lPrimRect)
6673b6250d9Smckusick #define FBIOCNFILLSCAN		_IOW('F', 64, lPrimFill)
6683b6250d9Smckusick #define FBIOCNTEXT		_IOW('F', 65, lPrimText)
6693b6250d9Smckusick #define FBIOCNPOLYDOT		_IOW('F', 66, lPrimDot)
6703b6250d9Smckusick 
6713b6250d9Smckusick #define FBIOCNGETSCRTYPE	_IOR('F', 70, lScrType)
6723b6250d9Smckusick #define FBIOCNSETPALETTE	_IOW('F', 71, lPalette)
6733b6250d9Smckusick #define FBIOCNGETPALETTE	_IOWR('F', 72, lPalette)
6743b6250d9Smckusick #define FBIOCNSETPALETTEMODE	_IOW('F', 73, int)
6753b6250d9Smckusick #define FBIOCNGETPALETTEMODE	_IOR('F', 74, int)
6763b6250d9Smckusick 
6773b6250d9Smckusick #define FBIOCNSETCURSOR		_IOW('F', 80, lCursor)
6783b6250d9Smckusick #define FBIOCNUNSETCURSOR	_IO('F', 81)
6793b6250d9Smckusick #define FBIOCNSHOWCURSOR	_IO('F', 82)
6803b6250d9Smckusick #define FBIOCNHIDECURSOR	_IO('F', 83)
6813b6250d9Smckusick #define FBIOCNSETXY		_IOW('F', 84, lPoint)
6823b6250d9Smckusick #define FBIOCNSETCURSOR2	_IOW('F', 85, lCursor2)
6833b6250d9Smckusick 
6843b6250d9Smckusick #define FBIOCNSETVIDEO		_IOW('F', 90, lVideoCtl)
6853b6250d9Smckusick #define FBIOCNGETVIDEO		_IOR('F', 91, lVideoStatus)
6863b6250d9Smckusick 
6873b6250d9Smckusick #define FBIOCNIOCTL		_IOWR('F', 100, lFbIoctl)
6883b6250d9Smckusick 
6893b6250d9Smckusick #endif /* !__FRAMEBUF__ */
690