1.1.3.2 Required Printer-Driver Data Structures

There are two fundamental data structures used by GDI and a Windows printer
driver: They are the GDIINFO and the PDEVICE data structures. The members
of the GDIINFO data structure are initialized by Windows, and the members
of the PDEVICE data structure are initialized by the printer driver.


GDIINFO Structure

The GDIINFO data structure contains device data required by GDI. This
structure has the following format:

    typedef struct _GDIINFO {
        int dpVersion
        int dpTechnology
        int dpHorzSize
        int dpVertSize
        int dpHorzRes
        int dpVertRes
        int dpBitsPixel
        int dpPlanes
        int dpNumBrushes
        int dpNumPens
        int futureuse
        int dpNumFonts
        int dpNumColors
        int dpDEVICEsize
        unsigned dpCurves
        unsigned dpLines
        unsigned dpPolygonals
        unsigned dpText
        unsigned dpClip
        unsigned dpRaster
        int dpAspectX
        int dpAspectY
        int dpAspectXY
        int dpStyleLen
        POINT dpMLoWin
        POINT dpMLoVpt
        POINT dpMHiWin
        POINT dpMHiVpt
        POINT dpELoWin
        POINT dpELoVpt
        POINT dpEHiWin
        POINT dpEHiVpt
        POINT dpTwpWin
        POINT dpTwpVpt
        short int dpLogPixelsX
        short int dpLogPixelsY
        short int dpDCManage
        short int dpCaps1
        long int dpSpotSizeX
        long int dpSpotSizeY
        short int dpPalColors
        short int dpPalReserved
        short int dpPalResolution
    } GDIINFO;

This data structure contains three types of data:

o   Driver-management data

o   Driver-capabilities data

o   Driver-dimension data

The driver-management data specifies how GDI should manage multiple device
contexts for a given driver.

The driver-capabilities data specifies physical capabilities of the device
such as the number of predefined brushes and pens, the number of pure
colors that the device supports, the device's curve-, line-, and
polygon-rendering capabilities, and so on.

The driver-dimension data specifies the physical dimensions of the
printable portion of a piece of printer paper, the number of bits required
to represent a single dot on the page, the aspect ratio, and so on.


PDEVICE Structure

The PDEVICE data structure contains data that describes the current device
context to the driver. This data includes an identifier for the current
device font (if one is selected), a value specifying the output mode
(portrait or landscape), an identifier for the selected paper tray, paper
size, and so on. The format of this structure is device dependent.