GreGetLineOrigin

From EDM2
Jump to: navigation, search

GreGetLineOrigin returns the current line style from the DC instance data and stores the current position to the address indicated by pptlXY. The presentation driver maintains the line style information.

This function must be supported by the presentation driver. GreGetLineOrigin is used to get the line style and current position simultaneously. This function call can be handled by bit-map simulation.

Simulation support
None. This function is mandatory for all drivers.

Syntax

GreGetLineOrigin(hdc, pptlXY, pInstance, lFunction)

Parameters

hdc (HDC) - input 
Device context handle.
pptlXY (PPOINTL) - input 
Pointer to an (X,Y) coordinate pair to which the current position is returned.
pInstance (PVOID) - input 
Pointer to instance data.
lFunction (ULONG) - input 
High-order WORD=flags; low-order WORD=NGreGetLineOrigin.

Returns

rc (LONG) - returns 
Return Code.

On completion, this function returns the style number (lStyle), or GPI_ALTERROR if an error occurs.

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_DEV_FUNC_NOT_INSTALLED
  • PMERR_INV_HDC

Refer to the "Error Explanations" section in the Presentation Manager Programming Reference for further explanation.

Remarks

Some lines and curves can be drawn either by the presentation driver or by simulations that must be able to query and set the style as required. If COM_TRANSFORM is not set, the coordinate pair at pptlXY is returned in screen coordinates.

The high-order WORD of the style number contains the first/last pel information. If the value of this byte is 0, the first pel is not drawn. (See First and Last Pel Considerations.) The low-order byte indicates the position in the style mask. This is a count, held in the three least significant bits, of the number of positions that the style mask byte is rotated. The next byte is the state of the style error value.