Jump to content

GreUpdateCursor: Difference between revisions

From EDM2
Created page with "GreUpdateCursor updates the drawn alphanumeric cursor to match the cursor state information contained in the presentation space. ; Simulation support: This function is manda..."
 
No edit summary
Line 47: Line 47:
LONG                      rc;        /*  Return codes. */
LONG                      rc;        /*  Return codes. */


rc = GreUpdateCursor(hdc, pVioPS, pInstance,
rc = GreUpdateCursor(hdc, pVioPS, pInstance, lFunction);
      lFunction);
</PRE>
</PRE>


[[Category:Gre]]
[[Category:Gre]]

Revision as of 19:33, 7 February 2020

GreUpdateCursor updates the drawn alphanumeric cursor to match the cursor state information contained in the presentation space.

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

Syntax

GreUpdateCursor(hdc, pVioPS, pInstance, lFunction);

Parameters

hdc (HDC) - input
The device context handle.
pVioPS (VioPresentationSpace *) - input
A pointer to the Vio presentation space.
pInstance (PVOID) - input
A pointer to instance data.
lFunction (ULONG) - input
High-order WORD=flags; low-order WORD=NGreUpdateCursor.

Return Code

rc (LONG) - returns
Return codes.

This function returns a LONG value as an error indicator:

  • NO_ERROR Successful
  • CE_INVALID_PRESENTATION_SPACE Error. For example, this message might be returned as a result of an invalid CellByteSize.

Remarks

This function usually involves removing the previous cursor from the window and drawing the new cursor, if visible, according to the presentation space information. The new cursor (if visible) is positioned and clipped according to this information and the window's cell-buffer origin and size.

The cursor is drawn as an Exclusive-OR bar. Its new position, size, and shape are saved by the handling routine in the VioPresentationSpace. Only one cursor can be visible on the screen at any time and it must be in the window with the input focus. This requirement is enforced by the operating system for VIO functions but not for AVIO. The AVIO application must alter the visibility of the cursor when changing input focus. When the text cursor collides with an AVIO and VIO drawing, the presentation driver must remove and redraw the cursor around the alphanumeric updates.

Note
GreBitblt copies everything including the cursor.

The presentation driver can assume that the values in the RowOrgLatch and CursorWidth fields of the VioPresentationSpace structure parallel the WindowOriginRow and TextCursorWidth, respectively.

Declaration

#define INCL_AVIOP
#include <os2.h>

HDC                       hdc;        /*  The device context handle. */
VioPresentationSpace     *pVioPS;     /*  A pointer to the Vio presentation space. */
PVOID                     pInstance;  /*  A pointer to instance data. */
ULONG                     lFunction;  /*  High-order WORD=flags; low-order WORD=NGreUpdateCursor. */
LONG                      rc;         /*  Return codes. */

rc = GreUpdateCursor(hdc, pVioPS, pInstance, lFunction);