GDIINFO

typedef struct _GDIINFO {
    ULONG ulVersion;
    ULONG ulTechnology;
    ULONG ulHorzSize;
    ULONG ulVertSize;
    ULONG ulHorzRes;
    ULONG ulVertRes;
    ULONG cBitsPixel;
    ULONG cPlanes;
    ULONG ulNumColors;
    ULONG flRaster;
    ULONG ulLogPixelsX;
    ULONG ulLogPixelsY;
    ULONG flTextCaps;
    ULONG ulDACRed;
    ULONG ulDACGreen;
    ULONG ulDACBlue;
    ULONG ulAspectX;
    ULONG ulAspectY;
    ULONG ulAspectXY;
    LONG xStyleStep;
    LONG yStyleStep;
    LONG denStyleStep;
    POINTL ptlPhysOffset;
    SIZEL szlPhysSize;
    ULONG ulNumPalReg;
    COLORINFO ciDevice;
    ULONG ulDevicePelsDPI;
    ULONG ulPrimaryOrder;
    ULONG ulHTPatternSize;
    ULONG ulHTOutputFormat;
    ULONG flHTFlags;
    ULONG ulVRefresh;
    ULONG ulBltAlignment;
    ULONG ulPanningHorzRes;
    ULONG ulPanningVertRes;
} GDIINFO, *PGDIINFO;

The GDIINFO structure describes the graphic capabilities of a given device. GDI zero-initializes this structure before calling the driver-supplied DrvEnablePDEV function.

Members

ulVersion
Specifies the driver version number. The byte ordering of ulVersion has the following form.
The high-order 16 bits must be set to zero. Bits 8 through 15 specify the version number of the Microsoft operating system for which the driver is designed. The high-order 4 bits of this range specify the major number of the version, the low-order 4 bits contain the minor number of the version. The low-order 8 bits of ulVersion specify the version number of the display driver; this value should be incremented for each release of the display driver binary file.

The version number contained in ulVersion is displayed in the Driver Information group of the Display Type dialog box displayed by the Display applet in Control Panel.

ulTechnology
Specifies the device technology. This member can be one of the following values:

Value

Meaning

DT_PLOTTER

Vector plotter

DT_RASDISPLAY

Raster display

DT_RASPRINTER

Raster printer

DT_RASCAMERA

Raster camera

DT_CHARSTREAM

Device fonts only

ulHorzSize
Specifies the width of the physical surface, in millimeters.
ulVertSize
Specifies the height of the physical surface, in millimeters.
ulHorzRes
Specifies the width of the physical surface, in pixels. See also ulDesktopHorzRes.
ulVertRes
Specifies the height of the physical surface, in pixels. See also ulDesktopHorzRes.
cBitsPixel
Specifies the number of adjacent bits in each color plane.
cPlanes
Specifies the number of color planes.
ulNumColors
Specifies the number of distinct colors supported at the same time (entries in device’s color table).
flRaster
Reserved ; must be zero.
ulLogPixelsX
Specifies the width in logical pixels per inch. This member must be 96 for this release.
ulLogPixelsY
Specifies the height in logical pixels per inch. This member must be 96 for this release.
flTextCaps
Specifies a flag describing Windows 3.1 text capabilities. If the driver TC_SCROLLBLT flag is in this member, it indicates that the console should perform text scrolling by redrawing the entire screen, using the driver-supplied DrvTextOut function rather than the DrvBitBlt or DrvCopyBits functions. The driver should set this flag if screen-to-screen bit-block transfers are slow. If this flag is not set, the driver is implicitly requesting that the console perform text scrolls through DrvBitBlt/DevCopyBits.
ulDACcolor
Specifies the display number of DAC bits for the specified color.
ulAspectX
Specifies the relative width of a device pixel, in the range of one to 1000.
ulAspectY
Specifies the relative height of a device pixel, in the range of one to 1000.
ulAspectXY
Specifies the square root of the sum of the squares of ulAspectX and ulAspectY.
xStyleStep
Specifies the numerator of style advance for x-major lines, dx. For additional information, refer to the following Comments section and Styled Cosmetic Lines.
yStyleStep
Specifies the numerator of style advance for y-major lines, dy. For additional information, refer to the following Comments section and Styled Cosmetic Lines.
denStyleStep
Specifies the denominator of style advance, D. For additional information, refer to the following Comments section and Styled Cosmetic Lines.
ptlPhysOffset
Specifies the size, in pixels, of the unwriteable margin of a surface.
szlPhysSize
Specifies the size, in pixels, of the entire surface, including unwritable margins.
ulNumPalReg
Specifies the number of palette registers for an indexed device.
ciDevice
A COLORINFO structure that defines the device’s colors in CIE coordinate space.
ulDevicePelsDPI
For printers, specifies the number of pixels (or dots, or nozzles) per inch if the pixels are laid out side by side without overlapping or space between. For example, if the size of a pixel is 0.001 inch, this value is equal to one-divided-by 0.001. If the member is zero, GDI halftoning calculates this number based on the assumption that all pixels are connected with no overlapping.

Because the physical dot size for most printers is larger than the measured dot size, GDI uses this value to approximate how many physical dots can be placed, based on the cell size (pattern size). A log regression is then performed to determine what is most linear; that is, where the dots should be placed for the best coverage to optimize the overlapped device pixels coverage (dot gain).

For displays, this member should be set to zero.

ulPrimaryOrder
Specifies the bit order of the device’s primary colors or plane numbers for the halftone output in accordance with the color-to-bit mapping listed in the following table. For example, if your device output order is BGR (Bit 0[C], Bit 1[B], Bit 2[A]), set this member to PRIMARY_ORDER_CBA.

Bit 2(A)

Bit 1(B)

Bit 0(C)

RGB Primary Colors

R

G

B

CMY Primary Colors

C

M

Y

Plane Numbers

Plane3

Plane2

Plane1

This member can be one of the following values:

PRIMARY_ORDER_ABC
PRIMARY_ORDER_ACB
PRIMARY_ORDER_BAC
PRIMARY_ORDER_BCA
PRIMARY_ORDER_CBA
PRIMARY_ORDER_CAB

ulHTPatternSize
Specifies the size of the halftone pattern. The values ending with AxB_M are variations of the AxB patterns. In other words, SIZE_AxB and SIZE_AxB_M differ by which pixels are lit in an A x B pattern. This member can be one of the following values:

HT_PATSIZE_2x2
HT_PATSIZE_2x2_M
HT_PATSIZE_4x4
HT_PATSIZE_4x4_M
HT_PATSIZE_6x6
HT_PATSIZE_6x6_M
HT_PATSIZE_8x8
HT_PATSIZE_8x8_M
HT_PATSIZE_10x10
HT_PATSIZE_10x10_M
HT_PATSIZE_12x12
HT_PATSIZE_12x12_M
HT_PATSIZE_14x14
HT_PATSIZE_14x14_M
HT_PATSIZE_16x16
HT_PATSIZE_16x16_M
HT_PATSIZE_MAX_INDEX
HT_PATSIZE_DEFAULT

ulHTOutputFormat
Specifies the preferred output format for halftone. HT_FORMAT_4BPP uses only 8 full intensity colors while HT_FORMATP_IRGB uses all the 16 colors including the half-intensity colors. It is assumed that a 5 x 5 x 5 format (5 bits per color) is used for HT_FORMAT_16BPP. This member can be one of the following values:

HT_FORMAT_1BPP
HT_FORMAT_4BPP
HT_FORMAT_4BPP_IRGB
HT_FORMAT_8BPP
HT_FORMAT_16BPP
HT_FORMAT_24BPP
HT_FORMAT_32BPP

flHTFlags
Specifies a combination of flags describing the device. These flags are needed for halftoning. This member can be a combination of the following values:

Flag

Meaning

HT_FLAG_SQUARE_DEVICE_PEL

Device pixel is square rather than round (displays only ¾ printers require rounded pixels).

HT_FLAG_HAS_BLACK_DYE

Device has separate black dye.

HT_FLAG_ADDITIVE_PRIMS

Device primaries are additive.

HT_FLAG_OUTPUT_CMY

Device uses CMY primaries rather than RGB.

ulVRefresh
The video refresh rate for the currrent display mode. This is the value returned by the miniport driver for the refresh rate for the current mode.

The refresh rate contained in ulVRefresh is displayed in the Driver Information group of the Display Type dialog box displayed by the Display applet contained in Control Panel.

ulBltAlignment
This member indicates the preferred x-alignment for bit block transfers to the device. A value of zero indicates that bit block transfers are accelerated; any other nonnegative number indicates that bit block transfers are not accelerated, and gives the preferred horizontal alignment as a pixel multiple.

This value is used by the system to determine the default alignment for window positions and is also used to set the initial full-drag default during setup. A value of zero indicates that full-drag should be on by default; any value other than zero indicates that full-drag should be off by default.

ulPanningHorzRes, ulPanningVertRes
ulPanningHorzRes and ulPanningVertRes are provided for drivers which support seamless multiple displays and should be set to the pixel dimensions of the entire virtual desktop. ulHorzRes and ulVertRes should be set to the physical pixel dimensions of the smallest screen. Settings these values for multiple-display drivers will ensure that dialog boxes and maximized windows are not split across physical displays.

If a driver does not support seamless multiple displays, ulPanningHorzRes and ulPanningVertRes should be set to the same values as ulHorzRez and ulVertRes.

Comments

The xStyleStep, yStyleStep, and denStyleStep members define how a cosmetic line style should advance as it draws each pixel of a cosmetic line. The amount advanced along the style for each pixel is defined as a fraction that depends on whether the line is x-styled or y-styled. If the line is x-styled, the style advances by the fractional amount dx/D for each pixel moved in the x direction. Otherwise the style advances by dy/D for each pixel moved in the y direction.

The dots in the predefined line style PS_DOT are each one unit long. If the driver defines xStyleStep as one and denStyleStep as 5, then a dotted horizontal line consists of 5-pixels-on followed by 5-pixels-off, repeated.

Each of these three numbers must be less than 65536, even though the caps members are LONG values. These style steps are defined by the driver to ensure that the dots and dashes in a line are a pleasing size on the output device. The horizontal and vertical steps can be different to correct for non trivial aspect ratios. For example, on an EGA display, whose pixels are 33 percent higher than they are wide, you can set:

pdevcaps->xStyleStep   =  3;    // For an EGA
pdevcaps->yStyleStep   =  4;
pdevcaps->denStyleStep = 12;

In this case, horizontal dotted lines are 4-pixels-on, 4-pixels-off, because the style advances by 3/12 or 1/4 for each pixel. Vertical dotted lines are 3-pixels-on/3-pixels-off.

Styled lines look better if both the x and y style steps divide evenly into the style denominator, as they do in the preceding example. This gives dashes and dots that are always the same length.

GDI needs this information so that its bitmap functions can emulate exactly what the device does on its own surface. Applications can access this information to determine exactly which pixels will be turned on for styled lines. Refer also to Styled Cosmetic Lines.

See Also

CIECHROMA, COLORINFO, DrvBitBlt, DrvCopyBits, DrvEnablePDEV, DrvTextOut