Jump to content

DEVESC RAWDATA: Difference between revisions

From EDM2
Created page with "{{DISPLAYTITLE:DEVESC_RAWDATA}} GreEscape DEVESC_RAWDATA sends device-specific data directly to the spooler or device. ;Simulation support: This function is mandatory for hardcopy drivers and must be implemented in order to have a valid OS/2 hardcopy driver. For other drivers, it is simulated by a handling routine in the graphics engine. ==Syntax== GreEscape(hdc, lEscape, cInCount, pInData, pcOutCount, pOutData, pInstance, lFunction); ==Parameters== ;''hdc'' (HDC..."
 
Ak120 (talk | contribs)
mNo edit summary
Line 5: Line 5:


==Syntax==
==Syntax==
  GreEscape(hdc, lEscape, cInCount, pInData, pcOutCount, pOutData, pInstance, lFunction);
  GreEscape(hdc, lEscape, cInCount, pInData, pcOutCount, pOutData, pInstance, lFunction)


==Parameters==
==Parameters==
;''hdc'' ([[HDC]]) - input: Device context handle.
;''hdc'' ([[HDC]]) - input: Device context handle.
;''lEscape'' ([[LONG]]) - input: DEVESC_RAWDATA escape code.
;''lEscape'' ([[LONG]]) - input: DEVESC_RAWDATA escape code.
 
;''cInCount'' (LONG) - input: Number of bytes pointed to by pInData.
;''cInCount'' ([[LONG]]) - input: Number of bytes pointed to by pInData.
 
;''pInData'' ([[PBYTE]]) - input: Pointer to raw data.
;''pInData'' ([[PBYTE]]) - input: Pointer to raw data.
;''pcOutCount'' ([[PLONG]]) - input: The handling routine ignores this parameter.
;''pcOutCount'' ([[PLONG]]) - input: The handling routine ignores this parameter.
 
;''pOutData'' (PLONG) - input: The handling routine ignores this parameter.
;''pOutData'' ([[PLONG]]) - input: The handling routine ignores this parameter.
 
;''pInstance'' ([[PVOID]]) - input: Pointer to instance data.
;''pInstance'' ([[PVOID]]) - input: Pointer to instance data.
;''lFunction'' ([[ULONG]]) - input: High-order WORD=flags; low-order WORD=NGreEscape.
;''lFunction'' ([[ULONG]]) - input: High-order WORD=flags; low-order WORD=NGreEscape.


Line 27: Line 20:
;''rc'' ([[LONG]]) - returns: Return Code.
;''rc'' ([[LONG]]) - returns: Return Code.
:The handling routine returns:
:The handling routine returns:
:;DEV_OK
::DEV_OK - Successful
::Successful
::DEVESC_NOTIMPLEMENTED - Escape not implemented for specified code
:;DEVESC_NOTIMPLEMENTED
::DEVESC_ERROR - Error
::Escape not implemented for specified code
:;DEVESC_ERROR
::Error


==Remarks==
==Remarks==
Line 59: Line 49:
LONG    rc;          /* Return Code. */
LONG    rc;          /* Return Code. */


rc = GreEscape(hdc, lEscape, cInCount, pInData,
rc = GreEscape(hdc, lEscape, cInCount, pInData, pcOutCount, pOutData, pInstance, lFunction);
      pcOutCount, pOutData, pInstance, lFunction);
</pre>
</pre>


[[Category:DEVESC]]
[[Category:DEVESC]]

Revision as of 13:45, 7 August 2025

GreEscape DEVESC_RAWDATA sends device-specific data directly to the spooler or device.

Simulation support
This function is mandatory for hardcopy drivers and must be implemented in order to have a valid OS/2 hardcopy driver. For other drivers, it is simulated by a handling routine in the graphics engine.

Syntax

GreEscape(hdc, lEscape, cInCount, pInData, pcOutCount, pOutData, pInstance, lFunction)

Parameters

hdc (HDC) - input
Device context handle.
lEscape (LONG) - input
DEVESC_RAWDATA escape code.
cInCount (LONG) - input
Number of bytes pointed to by pInData.
pInData (PBYTE) - input
Pointer to raw data.
pcOutCount (PLONG) - input
The handling routine ignores this parameter.
pOutData (PLONG) - input
The handling routine ignores this parameter.
pInstance (PVOID) - input
Pointer to instance data.
lFunction (ULONG) - input
High-order WORD=flags; low-order WORD=NGreEscape.

Returns

rc (LONG) - returns
Return Code.
The handling routine returns:
DEV_OK - Successful
DEVESC_NOTIMPLEMENTED - Escape not implemented for specified code
DEVESC_ERROR - Error

Remarks

The action taken by the handling routine is determined by the DC type. For example, an OD_DIRECT DC would send the raw data directly to the device using the PrtXXX APIs. See File System Emulation.

This escape code is metafiled and recorded.

As a general rule, an application should use DEVESC_RAWDATA only for a complete document or frame within a document. DEVESC_RAWDATA must not be mixed with other drawing functions. If DEVESC_RAWDATA and other drawing functions are called in a single frame, the results are dependent on the implementation. For example, the presentation driver might choose to print the raw data and ignore the other drawing calls.

Note: For an OD_QUEUED device with PM_Q_STD data, the spooler records this call in the buffer, but does not pass it on to the presentation driver.

Source Code Sample

Declaration:

#define INCL_GRE_DEVICE
#include <os2.h>

HDC      hdc;         /* Device context handle. */
LONG     lEscape;     /* DEVESC_RAWDATA escape code. */
LONG     cInCount;    /* Number of bytes pointed to by pInData. */
PBYTE    pInData;     /* Pointer to raw data. */
PLONG    pcOutCount;  /* The handling routine ignores this parameter. */
PLONG    pOutData;    /* The handling routine ignores this parameter. */
PVOID    pInstance;   /* Pointer to instance data. */
ULONG    lFunction;   /* High-order WORD=flags; low-order WORD=NGreEscape. */
LONG     rc;          /* Return Code. */

rc = GreEscape(hdc, lEscape, cInCount, pInData, pcOutCount, pOutData, pInstance, lFunction);