Jump to content

GreDrawRLE

From EDM2
Revision as of 17:49, 7 February 2020 by Ak120 (talk | contribs)

GreDrawRLE draws a run-length-encoded shape. If the call is passed back to the graphics engine, it calls the GrePolyScanline entry point.

This function can be hooked by the presentation driver.

Simulation support
This function is simulated by a handling routine in the graphics engine.

Syntax

GreDrawRLE(hdc, pRLEHDR, pInstance, lFunction)

Parameters

hdc (HDC) - input
Device context handle.
pRLEHDR (PRLEHDR) - input
Pointer to run-length-encoding data header (RLEHDR) structure.
pInstance (PVOID) - input
Pointer to instance data.
lFunction (ULONG) - input
High-order WORD=flags; low-order WORD=NGreDrawRLE.

Return Code

rc (ULONG) - returns
Return codes.
On completion, the handling routine must return an integer (cHits) indicating, where appropriate, whether correlation hits were detected:
  • GPI_OK Successful
  • GPI_HITS Successful with correlation hit (returned by display drivers when the correlation flag is ON, and a hit is detected)
  • GPI_ERROR Error
Possible Errors Detected: When an error is detected, the handling routine must call WinSetErrorInfo to post the condition. Error codes for conditions that the handling routine is expected to check include:
  • PMERR_BITMAP_NOT_SELECTED
  • PMERR_COORDINATE_OVERFLOW
  • PMERR_DEV_FUNC_NOT_INSTALLED
  • PMERR_HDC_BUSY
  • PMERR_INV_COLOR_DATA
  • PMERR_INV_COLOR_INDEX
  • PMERR_INV_COORD_SPACE
  • PMERR_INV_HDC
  • PMERR_INV_IN_AREA
  • PMERR_INV_IN_PATH
  • PMERR_INV_LENGTH_OR_COUNT
  • PMERR_INV_PICK_APERTURE_POSN
Refer to the "Error Explanations" section in the Presentation Manager Programming Reference for further explanation.

Remarks

GreDrawRLE is called by the area fill code in the graphics engine. The calling function uses the driver's CAPS_ADDITIONAL_GRAPHICS/CAPS_CLIP_FILLS field, which is queried during the first instance of DevOpenDC. If it is set, the data delivered to GreDrawRLE has already been clipped and the COM_PRECLIP flag will be set in the flag's WORD of the function number. All coordinates are passed as screen coordinates.

Sample Code

#define INCL_GRE_LINE
#include <os2.h>

HDC        hdc;        /*  Device context handle. */
PRLEHDR    pRLEHDR;    /*  Pointer to run-length-encoding data header. */
PVOID      pInstance;  /*  Pointer to instance data. */
ULONG      lFunction;  /*  High-order WORD=flags; low-order WORD=NGreDrawRLE. */
ULONG      rc;         /*  Return codes. */

rc = GreDrawRLE(hdc, pRLEHDR, pInstance, lFunction);