Jump to content

GreQueryCharPositions: Difference between revisions

From EDM2
Created page with "GreQueryCharPositions stores, at the location addressed by paptXY, an array of world coordinates identifying the start points at which the device is to place each character of..."
 
Ak120 (talk | contribs)
mNo edit summary
 
Line 1: Line 1:
GreQueryCharPositions stores, at the location addressed by paptXY, an array of world coordinates identifying the start points at which the device is to place each character of a given string.  
GreQueryCharPositions stores, at the location addressed by paptXY, an array of world coordinates identifying the start points at which the device is to place each character of a given string.


This function must be supported by the presentation driver. GreQueryCharPositions is called by GpiQueryCharStringPos, and is used to get the position where the next string output would occur relative to the current presentation space position. It also returns the starting position of each character within that string.  
This function must be supported by the presentation driver. GreQueryCharPositions is called by [[GpiQueryCharStringPos]], and is used to get the position where the next string output would occur relative to the current presentation space position. It also returns the starting position of each character within that string.


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


==Syntax==
==Syntax==
  GreQueryCharPositions(hdc, pptlStart, flOptions, cChars, pchString, pAdx,
  GreQueryCharPositions(hdc, pptlStart, flOptions, cChars, pchString, pAdx,
       paptXY, pInstance, lFunction);
       paptXY, pInstance, lFunction)
 
==Parameters==
==Parameters==
;hdc (HDC) - input  
;hdc (HDC) - input:Device context handle.
:Device context handle.  
;pptlStart (PPOINTL) - input:Pointer to (X,Y) coordinates of optional starting position.
 
;flOptions (ULONG) - input:Options flags.
;pptlStart (PPOINTL) - input  
:The following flags can be set:
:Pointer to (X,Y) coordinates of optional starting position.  
::CHS_VECTOR: If set, increment vector is present.
 
::CHS_START_XY: If set, starting position is present. Otherwise, pptlStart is ignored.  
;flOptions (ULONG) - input  
;cChars (LONG) - input:Number of bytes in string.
:Options flags.  
;pchString (PCH) - input:Pointer to character string.
 
;pAdx (PLONG) - input:Pointer to Increment array.
:The following flags can be set:  
:Vector of increment values with one element for each character in the string. After writing a character, the increment specifies the absolute distance in world coordinates to get to the starting point of the next character.
 
;paptXY (PPOINTL) - input:Pointer to array where character positions are returned.
:;CHS_VECTOR  
:Pointer to an array of (cChars+1) returned positions. The first value in the array is the initial current position; the last value is the current position on return.
::If set, increment vector is present.  
;pInstance (PVOID) - input:Pointer to instance data.
:;CHS_START_XY  
;lFunction (ULONG) - input:High-order WORD=flags; low-order WORD=NGreQueryCharPositions.
::If set, starting position is present. Otherwise, pptlStart is ignored.  
 
;cChars (LONG) - input  
:Number of bytes in string.  
 
;pchString (PCH) - input  
:Pointer to character string.  
 
;pAdx (PLONG) - input  
:Pointer to Increment array.  
 
:Vector of increment values with one element for each character in the string. After writing a character, the increment specifies the absolute distance in world coordinates to get to the starting point of the next character.  
 
;paptXY (PPOINTL) - input  
:Pointer to array where character positions are returned.  
 
:Pointer to an array of (cChars+1) returned positions. The first value in the array is the initial current position; the last value is the current position on return.  
 
;pInstance (PVOID) - input  
:Pointer to instance data.  
 
;lFunction (ULONG) - input  
:High-order WORD=flags; low-order WORD=NGreQueryCharPositions.  


==Return Code==
==Return Code==
;rc (BOOL) - returns  
;rc (BOOL) - returns:Return Code.
:Return Code.  
:On completion, the handling routine must return a BOOLEAN value to indicate success or an error.
 
:*TRUE Successful
:On completion, the handling routine must return a BOOLEAN value to indicate success or an error.  
:*FALSE 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:
:*TRUE Successful  
:*PMERR_COORDINATE_OVERFLOW
:*FALSE Error  
:*PMERR_DEV_FUNC_NOT_INSTALLED
 
:*PMERR_EXCEEDS_MAX_SEG_LENGTH
: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_HDC_BUSY
 
:*PMERR_INSUFFICIENT_MEMORY
:*PMERR_COORDINATE_OVERFLOW  
:*PMERR_INV_CHAR_ANGLE_ATTR
:*PMERR_DEV_FUNC_NOT_INSTALLED  
:*PMERR_INV_CHAR_MODE_ATTR
:*PMERR_EXCEEDS_MAX_SEG_LENGTH  
:*PMERR_INV_CHAR_POS_OPTIONS
:*PMERR_HDC_BUSY  
:*PMERR_INV_CODEPAGE
:*PMERR_INSUFFICIENT_MEMORY  
:*PMERR_INV_COORD_SPACE
:*PMERR_INV_CHAR_ANGLE_ATTR  
:*PMERR_INV_HDC
:*PMERR_INV_CHAR_MODE_ATTR  
:*PMERR_INV_LENGTH_OR_COUNT
:*PMERR_INV_CHAR_POS_OPTIONS  
:*PMERR_INV_MATRIX_ELEMENT
:*PMERR_INV_CODEPAGE  
:*PMERR_INV_SETID
:*PMERR_INV_COORD_SPACE  
:*PMERR_INV_TRANSFORM_TYPE
:*PMERR_INV_HDC  
Refer to the "Error Explanations" section in the ''Presentation Manager Programming Reference'' for further explanation.
:*PMERR_INV_LENGTH_OR_COUNT  
:*PMERR_INV_MATRIX_ELEMENT  
:*PMERR_INV_SETID  
:*PMERR_INV_TRANSFORM_TYPE  
 
Refer to the "Error Explanations" section in the Presentation Manager Programming Reference for further explanation.  


==Remarks==
==Remarks==
GreQueryCharPositions is required for the management of device fonts in CM_MODE2 only. When the presentation driver has no device fonts, the handling routine must post PMERR_DEV_FUNC_NOT_INSTALLED.  
GreQueryCharPositions is required for the management of device fonts in CM_MODE2 only. When the presentation driver has no device fonts, the handling routine must post PMERR_DEV_FUNC_NOT_INSTALLED.
 
==Sample Code==
<PRE>
#define INCL_GRE_STRINGS
#include <os2.h>
 
HDC        hdc;        /*  Device context handle. */
PPOINTL    pptlStart;  /*  Pointer to (X,Y) coordinates of optional starting position. */
ULONG      flOptions;  /*  Options flags. */
LONG      cChars;    /*  Number of bytes in string. */
PCH        pchString;  /*  Pointer to character string. */
PLONG      pAdx;      /*  Pointer to Increment array. */
PPOINTL    paptXY;    /*  Pointer to array where character positions are returned. */
PVOID      pInstance;  /*  Pointer to instance data. */
ULONG      lFunction;  /*  High-order WORD=flags; low-order WORD=NGreQueryCharPositions. */
BOOL      rc;        /*  Return Code. */
 
rc = GreQueryCharPositions(hdc, pptlStart,
      flOptions, cChars, pchString, pAdx,
      paptXY, pInstance, lFunction);
</PRE>


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

Latest revision as of 07:51, 5 March 2020

GreQueryCharPositions stores, at the location addressed by paptXY, an array of world coordinates identifying the start points at which the device is to place each character of a given string.

This function must be supported by the presentation driver. GreQueryCharPositions is called by GpiQueryCharStringPos, and is used to get the position where the next string output would occur relative to the current presentation space position. It also returns the starting position of each character within that string.

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

Syntax

GreQueryCharPositions(hdc, pptlStart, flOptions, cChars, pchString, pAdx,
      paptXY, pInstance, lFunction)

Parameters

hdc (HDC) - input
Device context handle.
pptlStart (PPOINTL) - input
Pointer to (X,Y) coordinates of optional starting position.
flOptions (ULONG) - input
Options flags.
The following flags can be set:
CHS_VECTOR: If set, increment vector is present.
CHS_START_XY: If set, starting position is present. Otherwise, pptlStart is ignored.
cChars (LONG) - input
Number of bytes in string.
pchString (PCH) - input
Pointer to character string.
pAdx (PLONG) - input
Pointer to Increment array.
Vector of increment values with one element for each character in the string. After writing a character, the increment specifies the absolute distance in world coordinates to get to the starting point of the next character.
paptXY (PPOINTL) - input
Pointer to array where character positions are returned.
Pointer to an array of (cChars+1) returned positions. The first value in the array is the initial current position; the last value is the current position on return.
pInstance (PVOID) - input
Pointer to instance data.
lFunction (ULONG) - input
High-order WORD=flags; low-order WORD=NGreQueryCharPositions.

Return Code

rc (BOOL) - returns
Return Code.
On completion, the handling routine must return a BOOLEAN value to indicate success or an error.
  • TRUE Successful
  • FALSE 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_COORDINATE_OVERFLOW
  • PMERR_DEV_FUNC_NOT_INSTALLED
  • PMERR_EXCEEDS_MAX_SEG_LENGTH
  • PMERR_HDC_BUSY
  • PMERR_INSUFFICIENT_MEMORY
  • PMERR_INV_CHAR_ANGLE_ATTR
  • PMERR_INV_CHAR_MODE_ATTR
  • PMERR_INV_CHAR_POS_OPTIONS
  • PMERR_INV_CODEPAGE
  • PMERR_INV_COORD_SPACE
  • PMERR_INV_HDC
  • PMERR_INV_LENGTH_OR_COUNT
  • PMERR_INV_MATRIX_ELEMENT
  • PMERR_INV_SETID
  • PMERR_INV_TRANSFORM_TYPE

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

Remarks

GreQueryCharPositions is required for the management of device fonts in CM_MODE2 only. When the presentation driver has no device fonts, the handling routine must post PMERR_DEV_FUNC_NOT_INSTALLED.