#ifndef CYBERGRAPHX_CYBERGRAPHICS_H
#define CYBERGRAPHX_CYBERGRAPHICS_H

/*
    Copyright © 1995-2013, The AROS Development Team. All rights reserved.
    $Id$
*/

#ifndef GRAPHICS_DISPLAYINFO_H
#   include <graphics/displayinfo.h>
#endif

#ifndef UTILITY_TAGITEM_H
#   include <utility/tagitem.h>
#endif


#define CYBERGFXNAME	    	    "cybergraphics.library"
#define CYBERGFX_INCLUDE_VERSION    41UL

/* ProcessPixelArray Operations (v50) */

#define POP_BRIGHTEN                0
#define POP_DARKEN                  1
#define POP_SETALPHA                2
#define POP_TINT                    3
#define POP_BLUR                    4
#define POP_COLOR2GREY              5
#define POP_NEGATIVE                6
#define POP_NEGFADE                 7
#define POP_TINTFADE                8
#define POP_GRADIENT                9
#define POP_SHIFTRGB                10

#define GRADTYPE_HORIZONTAL         0
#define GRADTYPE_VERTICAL           1
#define GRADTYPE_RECTANGLE          2
#define GRADTYPE_LINEAR_ANGLE       3
#define GRADTYPE_RADIAL             4

#define RGBSHIFT_BGR                (1UL)
#define RGBSHIFT_BRG                (2UL)
#define RGBSHIFT_GBR                (3UL)
#define RGBSHIFT_GRB                (4UL)
#define RGBSHIFT_RBG                (5UL)

#define PPAOPTAG_FADEFULLSCALE      0x85231020
#define PPAOPTAG_FADEOFFSET         0x85231021

#define PPAOPTAG_GRADIENTTYPE       0x85231022
#define PPAOPTAG_GRADCOLOR1         0x85231023
#define PPAOPTAG_GRADCOLOR2         0x85231024
#define PPAOPTAG_GRADFULLSCALE      PPAOPTAG_FADEFULLSCALE
#define PPAOPTAG_GRADOFFSET         PPAOPTAG_FADEOFFSET
#define PPAOPTAG_GRADSYMCENTER      0x85231026

#define PPAOPTAG_RGBMASK            0x85231025

/* ModeList Node */

struct CyberModeNode
{
    struct Node     Node;
    char	    ModeText[DISPLAYNAMELEN];
    ULONG	    DisplayID;
    UWORD	    Width;
    UWORD	    Height;
    UWORD	    Depth;
    struct TagItem *DisplayTagList;	
};


#define CYBRMATTR_XMOD		0x80000001
#define CYBRMATTR_BPPIX		0x80000002
#define CYBRMATTR_DISPADR	0x80000003
#define CYBRMATTR_PIXFMT	0x80000004
#define CYBRMATTR_WIDTH		0x80000005
#define CYBRMATTR_HEIGHT	0x80000006
#define CYBRMATTR_DEPTH		0x80000007
#define CYBRMATTR_ISCYBERGFX	0x80000008
#define CYBRMATTR_ISLINEARMEM	0x80000009
#define CYBRMATTR_PIXFMT_ALPHA  0x8000000A

#define CYBRIDATTR_PIXFMT	0x80000001
#define CYBRIDATTR_WIDTH	0x80000002
#define CYBRIDATTR_HEIGHT	0x80000003
#define CYBRIDATTR_DEPTH	0x80000004
#define CYBRIDATTR_BPPIX	0x80000005

#define CYBRMREQ_TB	    	(TAG_USER + 0x40000)

#define CYBRMREQ_MinDepth	(CYBRMREQ_TB + 0)
#define CYBRMREQ_MaxDepth	(CYBRMREQ_TB + 1)
#define CYBRMREQ_MinWidth	(CYBRMREQ_TB + 2)
#define CYBRMREQ_MaxWidth	(CYBRMREQ_TB + 3)
#define CYBRMREQ_MinHeight	(CYBRMREQ_TB + 4)
#define CYBRMREQ_MaxHeight	(CYBRMREQ_TB + 5)
#define CYBRMREQ_CModelArray	(CYBRMREQ_TB + 6)
#define CYBRMREQ_WinTitle	(CYBRMREQ_TB + 20)
#define CYBRMREQ_OKText		(CYBRMREQ_TB + 21)
#define CYBRMREQ_CancelText	(CYBRMREQ_TB + 22)
#define CYBRMREQ_Screen		(CYBRMREQ_TB + 30)

#define CYBRBIDTG_TB	    	(TAG_USER + 0x50000)

#define CYBRBIDTG_Depth		(CYBRBIDTG_TB + 0)
#define CYBRBIDTG_NominalWidth	(CYBRBIDTG_TB + 1)
#define CYBRBIDTG_NominalHeight	(CYBRBIDTG_TB + 2)
#define CYBRBIDTG_MonitorID	(CYBRBIDTG_TB + 3)
#define CYBRBIDTG_BoardName	(CYBRBIDTG_TB + 5)

#define PIXFMT_LUT8	0UL
#define PIXFMT_RGB15	1UL
#define PIXFMT_BGR15	2UL
#define PIXFMT_RGB15PC	3UL
#define PIXFMT_BGR15PC	4UL
#define PIXFMT_RGB16	5UL
#define PIXFMT_BGR16	6UL
#define PIXFMT_RGB16PC	7UL
#define PIXFMT_BGR16PC	8UL
#define PIXFMT_RGB24	9UL
#define PIXFMT_BGR24	10UL
#define PIXFMT_ARGB32	11UL
#define PIXFMT_BGRA32	12UL
#define PIXFMT_RGBA32	13UL

#define RECTFMT_RGB	0UL
#define RECTFMT_RGBA	1UL
#define RECTFMT_ARGB	2UL
#define RECTFMT_LUT8	3UL
#define RECTFMT_GREY8	4UL
#define RECTFMT_RAW 	5UL

/* AROS extensions */

#define PIXFMT_ABGR32	100UL
#define PIXFMT_0RGB32   101UL
#define PIXFMT_BGR032   102UL
#define PIXFMT_RGB032   103UL
#define PIXFMT_0BGR32   104UL

#define RECTFMT_RGB15	100UL
#define RECTFMT_BGR15	101UL
#define RECTFMT_RGB15PC 102UL
#define RECTFMT_BGR15PC 103UL
#define RECTFMT_RGB16	104UL
#define RECTFMT_BGR16	105UL
#define RECTFMT_RGB16PC 106UL
#define RECTFMT_BGR16PC 107UL
#define RECTFMT_RGB24	RECTFMT_RGB
#define RECTFMT_BGR24	109UL
#define RECTFMT_ARGB32	RECTFMT_ARGB
#define RECTFMT_BGRA32	111UL
#define RECTFMT_RGBA32	RECTFMT_RGBA
#define RECTFMT_ABGR32	113UL
#define RECTFMT_0RGB32  114UL
#define RECTFMT_BGR032  115UL
#define RECTFMT_RGB032  116UL
#define RECTFMT_0BGR32  117UL

/* End AROS extensions */

#define SETVC_DPMSLevel		0x88002001

#define DPMS_ON		0UL
#define DPMS_STANDBY	1UL
#define DPMS_SUSPEND	2UL
#define DPMS_OFF	3UL


#define LBMI_WIDTH		0x84001001
#define LBMI_HEIGHT		0x84001002
#define LBMI_DEPTH		0x84001003
#define LBMI_PIXFMT		0x84001004
#define LBMI_BYTESPERPIX	0x84001005
#define LBMI_BYTESPERROW	0x84001006
#define LBMI_BASEADDRESS	0x84001007


#define UBMI_UPDATERECTS	0x85001001
#define UBMI_REALLYUNLOCK	0x85001002

struct CDrawMsg
{
    APTR    cdm_MemPtr;
    ULONG   cdm_offx;
    ULONG   cdm_offy;
    ULONG   cdm_xsize;
    ULONG   cdm_ysize;
    UWORD   cdm_BytesPerRow;
    UWORD   cdm_BytesPerPix;
    UWORD   cdm_ColorModel;
};

#define CTABFMT_XRGB8	0UL


/*** The extend cybergfx flags are now defined together with the
   old AmigaOS flags, so we have to include them here
*/

#ifndef GRAPHICS_GFX_H
#   include <graphics/gfx.h>
#endif

#define SHIFT_PIXFMT( fmt ) (  ((ULONG)(fmt)) << BMB_PIXFMT_SHIFTUP )
#define DOWNSHIFT_PIXFMT( fmt ) (  ((ULONG)(fmt)) >> BMB_PIXFMT_SHIFTUP )


#endif /* CYBERGRAPHX_CYBERGRAPHICS_H */
