Jump to content

GreCharStr: Difference between revisions

From EDM2
Created page with "GreCharStr draws a string of character cells from the LVB to the device context. ; Simulation support: This function is mandatory for display drivers. For other drivers, it ..."
 
Ak120 (talk | contribs)
mNo edit summary
 
Line 1: Line 1:
GreCharStr draws a string of character cells from the LVB to the device context.  
GreCharStr draws a string of character cells from the LVB to the device context.
 
;Simulation support: This function is mandatory for display drivers. For other drivers, it is simulated by a handling routine in the graphics engine.


; Simulation support: This function is mandatory for display drivers. For other drivers, it is simulated by a handling routine in the graphics engine.
==Syntax==
==Syntax==
  GreCharStr(hdc, pVioPS, pCharRect, pInstance, lFunction);
  GreCharStr(hdc, pVioPS, pCharRect, pInstance, lFunction)
 
==Parameters==
==Parameters==
;hdc (HDC) - input  
;hdc (HDC) - input:The device context handle.
:The device context handle.  
;pVioPS (VioPresentationSpace *) - input:A pointer to the Vio presentation space.
;pCharRect (LPGridRectRef) - input:A pointer to parameter block. This is a GridStringRef structure:
:;StartRow:The starting row (relative to the bottom left of the LVB) of the character rectangle to be drawn
:;StartCol:The starting column (relative to the bottom left of the LVB) of the character rectangle to be drawn
:;StringLength:Number of characters to be written
;pInstance (PVOID) - input:A pointer to instance data.
;lFunction (ULONG) - input:High-order WORD=flags; low-order WORD=NGreCharStr.


;pVioPS (VioPresentationSpace *) - input
:A pointer to the Vio presentation space.
;pCharRect (LPGridRectRef) - input
:A pointer to parameter block. This is a GridStringRef structure:
:;StartRow
::The starting row (relative to the bottom left of the LVB) of the character rectangle to be drawn
:;StartCol
::The starting column (relative to the bottom left of the LVB) of the character rectangle to be drawn
:;StringLength
::Number of characters to be written
;pInstance (PVOID) - input
:A pointer to instance data.
;lFunction (ULONG) - input
:High-order WORD=flags; low-order WORD=NGreCharStr.
==Return Code==
==Return Code==
; rc (LONG) - returns : Return codes.  
;rc (LONG) - returns : Return codes.
 
:This function returns a LONG value as an error indicator.
This function returns a LONG value as an error indicator.  
* NO_ERROR Successful.
 
* GRE_INVALID_COLUMN_INDEX Invalid column index.
* NO_ERROR Successful.  
* CE_INVALID_PRESENTATION_SPACE Error. For example, this message might be returned as a result of an invalid CellByteSize.
* GRE_INVALID_COLUMN_INDEX Invalid column index.  
* CE_INVALID_ROW_INDEX Invalid row index.
* CE_INVALID_PRESENTATION_SPACE Error. For example, this message might be returned as a result of an invalid CellByteSize.  
* GRE_NEGATIVE_LENGTH Negative length.
* CE_INVALID_ROW_INDEX Invalid row index.  
* GRE_NEGATIVE_LENGTH Negative length.  
 


==Remarks==
==Remarks==
The attributes for each character are applied by the handling routine as the character is drawn. When the end of a row is reached, the next character is drawn in the first cell of the next row. Character drawing continues until either the string or the logical video buffer is exhausted.  
The attributes for each character are applied by the handling routine as the character is drawn. When the end of a row is reached, the next character is drawn in the first cell of the next row. Character drawing continues until either the string or the logical video buffer is exhausted.
 
==Example Code==
<PRE>
#define INCL_AVIOP
#include <os2.h>
 
HDC                      hdc;        /*  The device context handle. */
VioPresentationSpace    *pVioPS;    /*  A pointer to the Vio presentation space. */
LPGridRectRef            pCharRect;
PVOID                    pInstance;  /*  A pointer to instance data. */
ULONG                    lFunction;  /*  High-order WORD=flags; low-order WORD=NGreCharStr. */
LONG                      rc;        /*  Return codes. */
 
rc = GreCharStr(hdc, pVioPS, pCharRect, pInstance,
      lFunction);
 
 
</PRE>
 


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

Latest revision as of 23:15, 17 January 2020

GreCharStr draws a string of character cells from the LVB to the device context.

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

Syntax

GreCharStr(hdc, pVioPS, pCharRect, pInstance, lFunction)

Parameters

hdc (HDC) - input
The device context handle.
pVioPS (VioPresentationSpace *) - input
A pointer to the Vio presentation space.
pCharRect (LPGridRectRef) - input
A pointer to parameter block. This is a GridStringRef structure:
StartRow
The starting row (relative to the bottom left of the LVB) of the character rectangle to be drawn
StartCol
The starting column (relative to the bottom left of the LVB) of the character rectangle to be drawn
StringLength
Number of characters to be written
pInstance (PVOID) - input
A pointer to instance data.
lFunction (ULONG) - input
High-order WORD=flags; low-order WORD=NGreCharStr.

Return Code

rc (LONG) - returns
Return codes.
This function returns a LONG value as an error indicator.
  • NO_ERROR Successful.
  • GRE_INVALID_COLUMN_INDEX Invalid column index.
  • CE_INVALID_PRESENTATION_SPACE Error. For example, this message might be returned as a result of an invalid CellByteSize.
  • CE_INVALID_ROW_INDEX Invalid row index.
  • GRE_NEGATIVE_LENGTH Negative length.

Remarks

The attributes for each character are applied by the handling routine as the character is drawn. When the end of a row is reached, the next character is drawn in the first cell of the next row. Character drawing continues until either the string or the logical video buffer is exhausted.