home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
tolkit45.zip
/
os2tk45
/
h
/
ddi.h
< prev
next >
Wrap
Text File
|
1999-03-15
|
21KB
|
564 lines
/*****************************************************************************
*
* SOURCE FILE NAME = DDI.H
*
* DESCRIPTIVE NAME = Video and Printer DDI Structures and defines
*
* Copyright : COPYRIGHT IBM CORPORATION, 1993
* LICENSED MATERIAL - PROGRAM PROPERTY OF IBM
* REFER TO COPYRIGHT INSTRUCTION FORM#G120-2083
* RESTRICTED MATERIALS OF IBM
* IBM CONFIDENTIAL
*
* ==========================================================================
*
* The folowing symbols are used in this file for conditional sections.
*
* #define: To include:
*
* INCL_VMANDDI Include all VMI interface definitions
* INCL_VMANWIN Include VMAN to VDD interface definitions
* INCL_VMANHELP Include VMAN Helper definitions and prototypes
*
* ==========================================================================
*
* VERSION = V2.1
*
* DESCRIPTION
* This file contains all of the defines and
* data structures that are shared between the
* video manager and the translation layers.
*
* FUNCTIONS
*
* NOTES
*
* STRUCTURES
*
* EXTERNAL REFERENCES
*
* EXTERNAL FUNCTIONS
*
* CHANGE ACTIVITY =
* DATE FLAG APAR CHANGE DESCRIPTION
* -------- ---------- ----- --------------------------------------
* mm/dd/yy @Vr.mpppxx xxxxx xxxxxxx
*
****************************************************************************/
/* NOINC */
#ifndef DDI_INCLUDED
/* INC */
#define DDI_INCLUDED
/** Possible return codes from the individual DDI's
*/
#define RC_SUCCESS 0
#define RC_SIMULATE 1
#define RC_UNSUPPORTED 2
#define RC_ERROR 3
#define RC_ERROR_IN_BACKGROUND 4
#define RC_ERROR_NO_HANDLE 5
#define RC_ERROR_RESOURCE_NOT_FOUND 6
#define RC_ERROR_INVALID_PARAMETER 7
#define RC_ERROR_OUT_OF_MEMORY 8
#define RC_DISABLED 9
#define RC_ENABLED 10
/*
** Defines and structures for the GHI_CMD_BITBLT DDI
*/
typedef struct _BMAPINFO { /* bmapinfo */
ULONG ulLength;
ULONG ulType;
ULONG ulWidth;
ULONG ulHeight;
ULONG ulBpp;
ULONG ulBytesPerLine;
PBYTE pBits;
} BMAPINFO;
typedef BMAPINFO *PBMAPINFO;
typedef struct _BLTRECT { /* bltrect */
ULONG ulXOrg;
ULONG ulYOrg;
ULONG ulXExt;
ULONG ulYExt;
} BLTRECT;
typedef BLTRECT *PBLTRECT;
/*
** Defines for the ulType field of the BMAPINFO data structure
*/
#define BMAP_VRAM 0x00000000
#define BMAP_MEMORY 0x00000001
#define BMAP_BANKED 0x00000010
#define BMAP_VERTICAL_SCAN 0x10000000
#define BMAP_FOCAFONT 0x20000000
/* Bank info passed to SD from GRE2VMAN */
/* Passed in Overloaded 2nd function param */
#define TYPE_GRDBNKINFO 0x00000001
#define TYPE_CMYKINFO 0x00000002
typedef struct _GRDBNKINFO { /* gbi */
ULONG ulLength; /* denotes length of ver. x */
ULONG ulType; /* 2nd parameter structure type */
ULONG ulAperture; /* Aperture Size for banked devices */
ULONG ulGID; /* Graphics Adapter ID used by VMAN */
ULONG ulCurrBank; /* Current bank (to avoid unnecessary change) */
ULONG ulReserved; /* System Reserved ulong */
PFN pfnBankSwitch; /* Function Pointer to Bank Switching Routine */
PVOID pvReserved; /* System Reserved Pointer */
} GRDBNKINFO;
typedef GRDBNKINFO *PGRDBNKINFO;
#define CMYK_DEVICE 0x00000002
#define CMY_ONLY 0x00000004
#define CMYK_INTERLEAVE 0x00000008
typedef struct _BITBLTINFO { /* bitbltinfo */
ULONG ulLength;
ULONG ulBltFlags;
ULONG cBlits;
ULONG ulROP;
ULONG ulMonoBackROP;
ULONG ulSrcFGColor;
ULONG ulSrcBGColor;
ULONG ulPatFGColor;
ULONG ulPatBGColor;
PBYTE abColors;
PBMAPINFO pSrcBmapInfo;
PBMAPINFO pDstBmapInfo;
PBMAPINFO pPatBmapInfo;
PPOINTL aptlSrcOrg;
PPOINTL aptlPatOrg;
PBLTRECT abrDst;
PRECTL prclSrcBounds; /* incl/excl bounds. */
PRECTL prclDstBounds; /* incl/excl bounds. */
} BITBLTINFO;
typedef BITBLTINFO *PBITBLTINFO;
/*
** Defines for ulBltFlags field of the BITBLTINFO data structure
**
** The default state of the flags are as follows:
**
** DIRECTION = Left to right - top to bottom
** TRANSPARENCY = NONE
** PATTERN STYLE = UNKNOWN
** BACKGROUND ROP = INVALID
*/
#define BF_DEFAULT_STATE 0x00000000 // blt dir X and Y positive.
#define BF_DIR_X_NEGATIVE 0x00000001
#define BF_DIR_RIGHT_LEFT BF_DIR_X_NEGATIVE
#define BF_DIR_Y_NEGATIVE 0x00000002
#define BF_DIR_BOTTOM_TOP BF_DIR_Y_NEGATIVE
#define BF_ROP_INCL_SRC 0x00000004
#define BF_ROP_INCL_PAT 0x00000008
#define BF_SRC_TRANSPARENT 0x00000010
#define BF_DST_TRANSPARENT 0x00000020
#define BF_PAT_TRANSPARENT 0x00000040
#define BF_PAT_SOLID 0x00000080
#define BF_PAT_HOLLOW 0x00000100
#define BF_APPLY_BACK_ROP 0x00000200
#define BF_SRC_MONOINVERT 0x00000400
#define BF_PAT_MONOINVERT 0x00000800
#define BF_DST_MONOINVERT 0x00020000
#define BF_SRC_BITS_EXTERNAL 0x00001000
#define BF_LAST_BLT 0x00002000
#define BF_SRC_Y_FLIP 0x00004000
#define BF_SRC_X_FLIP 0x00008000
#define BF_SRC_VERTICAL_SCAN 0x00010000
/*
** Defines and structures for the GHI_CMD_LINE DDI
*/
typedef struct _LINEPACK { /* linepack */
ULONG ulStyleStep;
ULONG ulStyleValue;
ULONG ulFlags;
struct _LINEPACK * plpkNext;
ULONG ulAbsDeltaX;
ULONG ulAbsDeltaY;
POINTL ptlClipStart;
POINTL ptlClipEnd;
POINTL ptlStart;
POINTL ptlEnd;
LONG lClipStartError; /* Bresenham error at the clip start.*/
/* not valid for horizontal or */
/* vertical lines. */
} LINEPACK; /* lpk */
typedef LINEPACK *PLINEPACK; /* plpk */
/*
** Defines for the ulFlags field of the LINEPACK/LINEINFO2 data structure
*/
#define LINE_DO_FIRST_PEL 0x00000002
#define LINE_DIR_Y_POSITIVE 0x00000004
#define LINE_HORIZONTAL 0x00000008
#define LINE_X_MAJOR 0x00000010
#define LINE_DIR_X_POSITIVE 0x00000020
#define LINE_VERTICAL 0x00001000
#define LINE_STYLE_X_MAJOR 0x00002000
#define LINE_DO_LAST_PEL 0x00004000
#define LINE_MONO_INVERT 0x00008000 /* need to set for the first */
/* line only, if required. */
#define LINE_START_CLIP 0x00010000 /* first line in LINEINFO2 is clipped */
#define LINE_END_CLIP 0x00020000 /* last line in LINEINFO2 is clipped */
#define LINE_Y_FLIP 0x00040000 /* flip Y for all lines in LINEINFO2 */
#define LINE_ALL_RADIAL 0x00080000 /* all lines in LINEINFO2 are vertical */
/* or horizontal or 45/135/225/315 degree */
#define LINE_DISJOINT 0x00100000 /* disjoint lines */
/* Line drawing
**
** The line starts from ptlStart and ends at ptlEnd(inclusive).
** The device can do the Bresenham either from ptlStart or
** from the ptlClipStart using the lClipStartError and
** will only set the pels from ptlClipStart to ptlClipEnd(inclusive).
**
** ulAbsDeltaX :
** absolute (ptlStart.x - ptlEnd.x)
**
** ulAbsDeltaY :
** absolute (ptlStart.y - ptlEnd.y)
**
** lClipStartError:
**
** This is the standard Bresenham error at the clipped start point.
** This is calculated from the initial error at the start point and
** the error increments for major step and diagonal step.
**
** The initial error and the error increments are:
**
** MAX = maximum (ulAbsDeltaX, ulAbsDeltaY)
** MIN = minimum (ulAbsDeltaX, ulAbsDeltaY)
** Major Inc. = Increment to the error for
** stepping along the major axis.
** = 2 * MIN
** Diagonal Inc. = Increment to the error for
** stepping along the major and minor axis.
** = 2 * MIN - 2 * MAX
** Initial error = Error at the start point.
** = 2 * MIN - MAX if LINE_DIR_X_POSITIVE is on
** = 2 * MIN - MAX - 1 if LINE_DIR_X_POSITIVE is off.
**
** Horizontal and vertical lines.
** The line is drawn from the clipped start to clipped end.
** The lClipStartError will not be given.
**
** First pel consideration.
** Set the the first pel at the ptlStart (not ptlClipStart) only
** if LINE_DO_FIRST_PEL is set and the first pel is not clipped out.
**
** Last pel consideration.
** Set the the last pel at the ptlEnd (not ptlClipEnd) only
** if LINE_DO_LAST_PEL is set and the last pel is not clipped out.
**
**
** Styling.
** Lines are styled using the ulStyleMask, ulStyleStep and ulStyleValue.
**
** ulStyleMask:
** A 32 bit style mask.
**
** ulStyleStep:
** The value to be added to ulStyleValue
** on each pel stepped along the style major direction.
**
** ulStyleValue:
** The style value at the current pel.
** it is composed of an error value and a mask position as :
**
** ┌────────────────────────────────────────────────────┐
** │ high word │ 3 bits │ 5 bits │ 8 bits │
** └────────────────────────────────────────────────────┘
** │ not used │ not used │ mask pos │ error value │
**
** Error Value :
** Error value at the current pel.
**
** Mask Position :
** Bit position of the ulStyleMask.
** if this bit is on,
** set the current pel to the ulFGColor through usForeROP,
** otherwise
** set the current pel to the ulBGColor through usBackRop
**
*/
typedef struct _LINEINFO { /* linfo */
ULONG ulLength;
ULONG ulType;
ULONG ulStyleMask;
ULONG cLines;
ULONG ulFGColor;
ULONG ulBGColor;
USHORT usForeROP;
USHORT usBackROP;
PBMAPINFO pDstBmapInfo;
PLINEPACK alpkLinePack;
PRECTL prclBounds; /* incl/incl bounds. */
} LINEINFO; /* linfo */
typedef LINEINFO *PLINEINFO; /* plinfo */
typedef struct _LINEINFO2 { /* linfo2 */
ULONG ulLength; /* same as lineinfo */
ULONG ulType; /* same as lineinfo */
ULONG ulStyleMask; /* same as lineinfo */
ULONG cLines; /* same as lineinfo */
ULONG ulFGColor; /* same as lineinfo */
ULONG ulBGColor; /* same as lineinfo */
USHORT usForeROP; /* same as lineinfo */
USHORT usBackROP; /* same as lineinfo */
PBMAPINFO pDstBmapInfo; /* same as lineinfo */
ULONG ulFlags; /* LINE_* see above */
ULONG ulXYStyleStep; /* low byte of low word: x style, high byte of low word: y style */
PULONG pulStyleValue; /* style value at start point */
POINTL ptlOrigin; /* origin */
PPOINTL pptlStart; /* start point */
PPOINTL pptlLines; /* points array */
POINTL ptlClipStart; /* clipped start point if it is clipped */
POINTL ptlClipEnd; /* clipped end point if it is clipped */
LONG lClipStartError;/* Bresenham error at the clip start. */
/* for first line. */
/* not valid for horizontal or */
/* vertical lines. */
PRECTL prclBounds; /* incl/incl bounds.*/
} LINEINFO2; /* linfo2 */
typedef LINEINFO2 *PLINEINFO2; /* plinfo2 */
/*
** Defines for the ulType field of the LINEINFO data structure
*/
#define LINE_SOLID 0x01
#define LINE_INVISIBLE 0x02
#define LINE_ALTERNATE 0x03
/*
** Defines for 2 way Line ROPS
*/
/* PATTERN = 0xC and DEST = 0xA */
#define LR_ZERO 0 /* 0x0 */
#define LR_INVERTMERGEPAT 1 /* ~(LR_DEST | LR_PATTERN) */
#define LR_MASKINVERTPAT 2 /* (~LR_PATTERN) & LR_DEST */
#define LR_INVERTCOPYPAT 3 /* ~LR_PATTERN */
#define LR_MASKPATINVERT 4 /* (~LR_DEST) & LR_PATTERN */
#define LR_INVERT 5 /* ~LR_DEST */
#define LR_XORPAT 6 /* LR_DEST ^ LR_PATTERN */
#define LR_INVERTMASKPAT 7 /* ~(LR_DEST & LR_PATTERN) */
#define LR_MASKPAT 8 /* LR_DEST & LR_PATTERN */
#define LR_INVERTXORPAT 9 /* ~(LR_DEST ^ LR_PATTERN) */
#define LR_LEAVEALONE 10 /* LR_DEST */
#define LR_MERGEINVERTPAT 11 /* (~LR_PATTERN) | LR_DEST */
#define LR_PATCOPY 12 /* LR_PATTERN */
#define LR_MERGEPATINVERT 13 /* (~LR_DEST) | LR_PATTERN */
#define LR_MERGEPAT 14 /* LR_PATTERN | LR_DEST */
#define LR_ONE 15 /* 0x0F */
/*
** Defines and structures for the TextBlt
*/
typedef struct _GLYPHINFO { /* glphyinfo */
char bAspace;
char bBspace;
char bCspace;
char bPad;
BMAPINFO bmapinfo;
} GLYPHINFO; /* glyphinfo */
typedef GLYPHINFO *PGLYPHINFO; /* pglyphinfo */
typedef struct _GLBTBL { /* glbtbl */
PGLYPHINFO pGlyphInfo[1]; // Up to 256 entries per table
} GLBTBL;
typedef GLBTBL *PGLBTBL;
typedef struct _GHBTBL { /* ghbtbl */
PGLBTBL pglbTbl[1]; // Up to 256 entries per table
} GHBTBL;
typedef GHBTBL *PGHBTBL;
// A subset of FontInfo ( pmddi.h ) for TextBlt
typedef struct _DEVFONTINFO { /* dfi */
ULONG ulFntCnt; // Maximum glyphs contained in this font.
ULONG fFontInfo; // Flags
ULONG ulEngTag; // Renderer Tag - i.e. 'GRE'
ULONG ulUniqueFntID;
ULONG ulMaxHeight;
ULONG ulMaxWidth;
PGHBTBL pghbTbl;
ULONG ulHalfWidth;
CHAR szGlyphlist[16];
ULONG ulReserved1;
ULONG ulReserved2;
} DEVFONTINFO;
typedef DEVFONTINFO *PDEVFONTINFO;
#define GRETAG ('G' + ('R'<<8) + ('E'<<16) + ('_'<<24)) // "GRE_"
#define WINTAG ('W' + ('I'<<8) + ('N'<<16) + ('_'<<24)) // "WIN_"
#define DFI_FIXED_FONT 0x00000001
#define DFI_DBCS_FONT 0x00000002
typedef struct _TEXTBLTINFO { /* tbi */
ULONG ulLength;
ULONG flOptions;
ULONG lGlyphCnt;
PLONG pGlyphIndices;
ULONG ulFGMix;
ULONG ulBGMix;
ULONG ulFGColor;
ULONG ulBGColor;
PBMAPINFO pDstBmapInfo;
PDEVFONTINFO pDevFntInfo;
ULONG ulClpCnt; // Non Clipping Drivers Ignore
PBLTRECT abrClipRects; // Non Clipping Drivers Ignore
PPOINTL aptlSrcOrg; // Clipping Drivers Ignore
PBLTRECT abrDst; // Clipping Drivers Ignore .ulXExt & ulYExt
} TEXTBLTINFO;
typedef TEXTBLTINFO *PTEXTBLTINFO;
/*
** Defines and structures for the GHI_CMD_PALETTE
*/
typedef struct _HWPALETTEINFO { /* hwpaletteinfo */
ULONG ulLength;
ULONG fFlags; /* Get/Set palette */
ULONG ulStartIndex; /* */
ULONG ulNumEntries; /* */
PRGB2 pRGBs; /* */
} HWPALETTEINFO;
typedef HWPALETTEINFO *PHWPALETTEINFO;
#define PALETTE_GET 0x0001
#define PALETTE_SET 0x0002
/*
** Defines and structures for the GHI_CMD_MOVEPTR DDI
*/
typedef struct _HWMOVEPTRIN { /* hwmoveptrin */
ULONG ulLength;
POINTL ptlPos;
} HWMOVEPTRIN;
typedef HWMOVEPTRIN *PHWMOVEPTRIN;
/*
** Defines and structures for the GHI_CMD_SETPTR DDI
*/
typedef struct _HWSETPTRIN { /* hwsetptrin */
ULONG ulLength;
PBYTE pbANDMask;
PBYTE pbXORMask;
PBYTE pbBits;
ULONG ulBpp;
ULONG ulWidth;
ULONG ulHeight;
POINTL ptlHotspot;
} HWSETPTRIN;
typedef HWSETPTRIN *PHWSETPTRIN;
typedef struct _HWSETPTROUT { /* hwsetptrout */
ULONG ulLength;
ULONG ulStatus;
} HWSETPTROUT;
typedef HWSETPTROUT *PHWSETPTROUT;
/*
** Defines for the ulStatus field of the HWSETPTROUT structure
*/
#define POINTER_VISIBLE 0x0001
#define POINTER_COLOR 0x0002
/*
** This flag is set by the GRADD if the pointer just set in
** via the GHI_CMD_SETPTR command is not a hardware sprite.
** VMAN uses this flag to determine whether it must remove
** the pointer on drawing operations that overlap the pointer.
*/
#define POINTER_SOFTWARE 0x0004
/*
** This flag is set by the GRADD if the pointer just set in
** via the GHI_CMD_SETPTR command does not require serialization
** with the normal drawing operations. This flag will typically
** be set if GRADD is using a hardware sprite, since moving
** a sprite often only requires changing registers which do not
** effect the drawing engine. When this flag is set, pointer
** movement performance is drastically improved.
*/
#define POINTER_FAST 0x0008
/*
** Defines and structures for the GHI_CMD_SHOWPTR DDI
*/
typedef struct _HWSHOWPTRIN { /* hwshowptrin */
ULONG ulLength;
BOOL fShow;
} HWSHOWPTRIN;
typedef HWSHOWPTRIN *PHWSHOWPTRIN;
/*
** Defines and structures for the GHI_CMD_REQUESTHW command
*/
/*
** Defines for the ulFlags field of HWREQIN
*/
#define REQUEST_HW 0x1
#define REQUEST_SEM_ONLY 0x2
typedef struct _HWREQIN { /* hwreqin */
ULONG ulLength;
ULONG ulFlags;
ULONG cScrChangeRects;
PRECTL arectlScreen;
} HWREQIN;
typedef HWREQIN *PHWREQIN;
/*
** Defines and structures for the GHI_CMD_BANK command
*/
typedef struct _HWBANKIN { /* hwbankin */
ULONG ulLength;
ULONG ulFlags; /* Get/Set bank */
ULONG ulBank; /* Bank number */
} HWBANKIN;
typedef HWBANKIN *PHWBANKIN;
/*
** Defines for the ulFlags field of the HWBANKIN data structure.
*/
#define BANK_SET 1
#define BANK_GET 2
typedef struct _HWBANKOUT { /* hwbankout */
ULONG ulLength;
ULONG ulBank; /* Bank number */
} HWBANKOUT;
typedef HWBANKOUT *PHWBANKOUT;
/* NOINC */
#endif /* DDI_INCLUDED */
/* INC */