Jump to content

DEVESC_QUERYVIOCELLSIZES

From EDM2

GreEscape DEVESC_QUERYVIOCELLSIZES obtains the details of the VIO cell sizes supported by the presentation driver.

Simulation support
This function is mandatory for display drivers. For other drivers, it is simulated by a handling routine in the graphics engine.

Syntax

GreEscape(hdc, lEscape, cInCount, pInData, pcOutCount, pOutData, pInstance, lFunction);

Parameters

hdc (HDC) - input
Device context handle.
lEscape (LONG) - input
DEVESC_QUERYVIOCELLSIZES escape code.
cInCount (LONG) - input
The handling routine ignores this parameter.
pInData (PBYTE) - input
The handling routine ignores this parameter.
pcOutCount (PLONG) - input
Pointer to the number of bytes pointed to by pOutData.

On return, the handling routine updates the value indicated by this pointer to the number of bytes actually returned. This value must be an even multiple of sizeof(LONG). When the value passed is less than sizeof(LONG), the handling routine must change it to 0. Nothing is loaded at the address indicated by pOutData.

When the value passed equals sizeof(LONG), the handling routine must return the number of supported VIO character-cell sizes. The value indicated by pcOutCount is unchanged. The contents of the address indicated by pOutData are updated so that maxcount is the number of VIO cell sizes provided by the device. When the value passed is greater than sizeof(LONG), the handling routine must update the buffer addressed by pOutData so that:

"maxcount" is the number of VIO cell sizes provided by the device.

"count" is the number of VIOFONTCELLSIZE structures returned. This can be 0 when OutCount is 2*sizeof(LONG). For example:

count==((pcOutCount-2*sizeof(LONG))/2*sizeof(LONG))
pOutData (PLONG) - input
Pointer to the address of the data returned.

This is the location at which the handling routine stores the following structures:

maxcount Total number of VIO cell sizes provided by the device

count Number of VIOFONTCELLSIZE structures that follow

Followed by an array of VIOFONTCELLSIZE structures:

xWidth Width of the VIO character cell

yHeight Height of the VIO character cell

pInstance (PVOID) - input
Pointer to instance data.
lFunction (ULONG) - input
High-order WORD=flags; low-order WORD=NGreEscape.

Returns

rc (LONG) - returns
Return Code.

The handling routine returns:

DEV_OK
Successful
DEVESC_NOTIMPLEMENTED
Escape not implemented for specified code
DEVESC_ERROR
Error

Remarks

The DEVESC_QUERYVIOCELLSIZES must be implemented by presentation drivers for display devices that provide two or more VIO fonts with different cell sizes. Other presentation drivers should not implement this escape code.

This escape code is not metafiled or recorded.

Sample Source Code

Declaration:

#define INCL_GRE_DEVICE
#include <os2.h>

HDC       hdc;         /* Device context handle. */
LONG      lEscape;     /* DEVESC_QUERYVIOCELLSIZES escape code. */
LONG      cInCount;    /* The handling routine ignores this parameter. */
PBYTE     pInData;     /* The handling routine ignores this parameter. */
PLONG     pcOutCount;  /* Pointer to the number of bytes pointed to by pOutData. */
PLONG     pOutData;    /* Pointer to the address of the data returned. */
PVOID     pInstance;   /* Pointer to instance data. */
ULONG     lFunction;   /* High-order WORD=flags; low-order WORD=NGreEscape. */
LONG      rc;          /* Return Code. */

rc = GreEscape(hdc, lEscape, cInCount, pInData,
        pcOutCount, pOutData, pInstance, lFunction);