## Presentation Device Driver Reference for OS/2

[prev][next][parent][TOC]

### Function Number and Command Flags

The first doubleword (DWORD) pulled from the stack contains two fields:

    /--------------------------------------------------------------\

    |Field          |WORD Type      |Description                   |

    |---------------+---------------+------------------------------|

    |Function Number|Low-order      |Identifies a specific         |

    |               |               |function. Header files define |

    |               |               |symbolic names for the Grexxx |

    |               |               |function numbers.             |

    |---------------+---------------+------------------------------|

    |Command Flags  |High-order     |See the following description.|

    \--------------------------------------------------------------/

Command Flags The flags in this 16-bit field tell the presentation driver which operations need to be done while it processes the function:

COM_DRAW Bit 0. If this flag is set, the presentation driver must draw the output of the function at the device. When not set, the driver does not draw the output. The function must still be processed to update internal data, such as current position and, if specified, boundary calculations.

COM_BOUND Bit 1. If set, the presentation driver must calculate the bounding rectangle for the output of the specified function. Upon completion, the driver calls its own GreAccumulateBounds routine to accumulate the bounding rectangle (GPI_BOUNDS in model space coordinates).

Note: All presentation drivers must be able to calculate bounds on any figure they can draw.

COM_CORR Bit 2. This flag is significant only for display drivers. If set, the display driver must determine whether the output of the specified function intersects the pick window. The result, TRUE or FALSE, is passed back to the caller in the return code for the called function. For details, see the function descriptions in Mandatory Functions for All Drivers and Simulated Functions.

COM_ALT_BOUND Bit 3. This flag is significant only for display drivers. It indicates that the display driver should accumulate USER_BOUNDS in screen coordinates. Notice that user bounds are those used by the Window Manager. Hardcopy drivers do not accumulate user bounds.

COM_AREA Bit 4. If set, the function is part of an area. Calls to functions that define an area (for example, GreSetCurrentPosition and GrePolyLine), or that are invalid in an area definition, are passed back to the graphics engine for processing by the default handler.

If all functions in the area component have been hooked by the presentation driver, it is not necessary to pass back functions received with COM_AREA set.

COM_PATH Bit 5. This flag is similar to the COM_AREA flag. Calls to functions that define a path (for example, GrePolyLine and GreSetCurrentPosition), or that are invalid in a path definition, are passed back to the graphics engine for processing by the default handler.

If all functions in the path component have been hooked by the presentation driver, it is not necessary to pass back functions received with COM_PATH set.

COM_TRANSFORM Bit 6. This flag is set by the graphics engine. If set, the engine is working in world coordinates and the presentation driver should return world coordinates for queries, and convert to device space (using GreConvert) for drawing functions. If this bit is not set, the graphics engine is working in device space and the presentation driver should return device coordinates for queries and should not convert to device space for drawing functions.

COM_RECORDING Bit 7. This flag is ignored.

COM_DEVICE Bit 8. If set, the presentation driver must process the function . The driver should not pass the function to the graphics engine.

COM_PRECLIP Bit 10. If set, the graphics engine has passed the function's data already clipped in screen coordinates.

The COM_PRECLIP flag will only be used and set by the Graphics Engine when a presentation driver reports CAPS_CLIP_FILLS in the CAPS_ADDITIONAL_GRAPHICS capability field of the mandatory entry point GreQueryDeviceCaps().

Note: This flag is supported if the Graphics Engine is Version 202 or greater.

Note: COM_DRAW, COM_BOUND, COM_CORR, COM_ALT_BOUND, COM_AREA, and COM_PATH apply only to drawing functions. They are ignored by all other functions. The remaining bits of the Command Flags field are not defined and their values are ignored.