Jump to content

GreSetupDC: Difference between revisions

From EDM2
Created page with "GreSetupDC initializes the device context to the region determined by flOptions. This function can be hooked by the presentation driver. ;Simulation support: This function..."
 
Ak120 (talk | contribs)
mNo edit summary
 
Line 1: Line 1:
GreSetupDC initializes the device context to the region determined by flOptions.  
GreSetupDC initializes the device context to the region determined by flOptions.


This function can be hooked by the presentation driver.  
This function can be hooked by the presentation driver.


;Simulation support: This function is simulated by a handling routine in the graphics engine.  
;Simulation support: This function is simulated by a handling routine in the graphics engine.


==Syntax==
==Syntax==
  GreSetupDC(hdc, hrgnVis, xOrg, yOrg, prclBounds, flOptions, pInstance, lFunction);
  GreSetupDC(hdc, hrgnVis, xOrg, yOrg, prclBounds, flOptions, pInstance, lFunction)
 
==Parameters==
==Parameters==
;hdc (HDC) - input  
;hdc (HDC) - input:Device context handle.
:Device context handle.  
;hrgnVis (HRGN) - input:Visible region handle.
 
;xOrg (LONG) - input:X-coordinate of DC origin, specified in screen coordinates.
;hrgnVis (HRGN) - input  
;yOrg (LONG) - input:Y-coordinate of DC origin, specified in screen coordinates.
:Visible region handle.  
;prclBounds (PRECTL) - input:Bounding rectangle in device coordinates.
 
;flOptions (ULONG) - input:Option flags.
;xOrg (LONG) - input  
:X-coordinate of DC origin, specified in screen coordinates.  
 
;yOrg (LONG) - input  
:Y-coordinate of DC origin, specified in screen coordinates.  
 
;prclBounds (PRECTL) - input  
:Bounding rectangle in device coordinates.  
 
;flOptions (ULONG) - input  
:Option flags.  
 
:These flags determine the region returned in prclBounds:  
:These flags determine the region returned in prclBounds:  
 
::SETUPDC_VISRGN Replace the contents of the visible region of hdc with the contents of hrgnVis.
::SETUPDC_VISRGN Replace the contents of the visible region of hdc with the contents of hrgnVis.  
::SETUPDC_ORIGIN Set the DC origin to (xOrg, yOrg).
 
::SETUPDC_ACCUMBOUNDSON Turn on bounds accumulation. This only affects the COM_ALT_BOUND flag. If COM_ALT_BOUND (see page Calling Conventions) is not set, the bounds rectangle is reset to an empty rectangle. If COM_ALT_BOUND is already set, the bounds rectangle is not changed.
::SETUPDC_ORIGIN Set the DC origin to (xOrg, yOrg).  
::SETUPDC_ACCUMBOUNDSOFF Turn off bounds accumulation.
 
::SETUPDC_REALCLIP Recalculate the true device clipping region. This bit is normally set, but can be 0 when immediate recalculation is not required.
::SETUPDC_ACCUMBOUNDSON Turn on bounds accumulation. This only affects the COM_ALT_BOUND flag. If COM_ALT_BOUND (see page Calling Conventions) is not set, the bounds rectangle is reset to an empty rectangle. If COM_ALT_BOUND is already set, the bounds rectangle is not changed.  
::SETUPDC_SETOWNER When this bit is set, the DC must belong to the current process.
 
::SETUPDC_CLEANDC When this bit is set, the simulation marks the visible regions as valid and calls GreNotifyClipChange in the presentation driver.
::SETUPDC_ACCUMBOUNDSOFF Turn off bounds accumulation.  
;pInstance (PVOID) - input:Pointer to instance data.
 
;lFunction (ULONG) - input:High-order WORD=flags; low-order WORD=NGreSetupDC.
::SETUPDC_REALCLIP Recalculate the true device clipping region. This bit is normally set, but can be 0 when immediate recalculation is not required.  
 
::SETUPDC_SETOWNER When this bit is set, the DC must belong to the current process.  
 
::SETUPDC_CLEANDC When this bit is set, the simulation marks the visible regions as valid and calls GreNotifyClipChange in the presentation driver.  
 
;pInstance (PVOID) - input  
:Pointer to instance data.  
 
;lFunction (ULONG) - input  
:High-order WORD=flags; low-order WORD=NGreSetupDC.  


==Return Code==
==Return Code==
;fSuccess (BOOL) - returns  
;fSuccess (BOOL) - returns:Return codes.
:Return codes.  
:This function returns BOOLEAN (fSuccess).
 
:*TRUE Successful
:This function returns BOOLEAN (fSuccess).  
:*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_HDC_BUSY
: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_HRGN_BUSY
 
:*PMERR_INSUFFICIENT_MEMORY
:*PMERR_COORDINATE_OVERFLOW  
:*PMERR_INV_COORD_SPACE
:*PMERR_DEV_FUNC_NOT_INSTALLED  
:*PMERR_INV_COORDINATE
:*PMERR_HDC_BUSY  
:*PMERR_INV_HDC
:*PMERR_HRGN_BUSY  
:*PMERR_INV_HRGN
:*PMERR_INSUFFICIENT_MEMORY  
:*PMERR_INV_LENGTH_OR_COUNT
:*PMERR_INV_COORD_SPACE  
:*PMERR_INV_RECT
:*PMERR_INV_COORDINATE  
:*PMERR_INV_REGION_CONTROL
:*PMERR_INV_HDC  
:*PMERR_REGION_IS_CLIP_REGION
:*PMERR_INV_HRGN  
:Refer to the "Error Explanations" section in the Presentation Manager Programming Reference for further explanation.
:*PMERR_INV_LENGTH_OR_COUNT  
:*PMERR_INV_RECT  
:*PMERR_INV_REGION_CONTROL  
:*PMERR_REGION_IS_CLIP_REGION  
 
:Refer to the "Error Explanations" section in the Presentation Manager Programming Reference for further explanation.  
 


==Declaration==
==Declaration==
Line 93: Line 64:
fSuccess = GreSetupDC(hdc, hrgnVis, xOrg, yOrg, prclBounds, flOptions, pInstance, lFunction);
fSuccess = GreSetupDC(hdc, hrgnVis, xOrg, yOrg, prclBounds, flOptions, pInstance, lFunction);
</PRE>
</PRE>
[[Category:Gre]]
[[Category:Gre]]

Latest revision as of 19:05, 5 April 2025

GreSetupDC initializes the device context to the region determined by flOptions.

This function can be hooked by the presentation driver.

Simulation support
This function is simulated by a handling routine in the graphics engine.

Syntax

GreSetupDC(hdc, hrgnVis, xOrg, yOrg, prclBounds, flOptions, pInstance, lFunction)

Parameters

hdc (HDC) - input
Device context handle.
hrgnVis (HRGN) - input
Visible region handle.
xOrg (LONG) - input
X-coordinate of DC origin, specified in screen coordinates.
yOrg (LONG) - input
Y-coordinate of DC origin, specified in screen coordinates.
prclBounds (PRECTL) - input
Bounding rectangle in device coordinates.
flOptions (ULONG) - input
Option flags.
These flags determine the region returned in prclBounds:
SETUPDC_VISRGN Replace the contents of the visible region of hdc with the contents of hrgnVis.
SETUPDC_ORIGIN Set the DC origin to (xOrg, yOrg).
SETUPDC_ACCUMBOUNDSON Turn on bounds accumulation. This only affects the COM_ALT_BOUND flag. If COM_ALT_BOUND (see page Calling Conventions) is not set, the bounds rectangle is reset to an empty rectangle. If COM_ALT_BOUND is already set, the bounds rectangle is not changed.
SETUPDC_ACCUMBOUNDSOFF Turn off bounds accumulation.
SETUPDC_REALCLIP Recalculate the true device clipping region. This bit is normally set, but can be 0 when immediate recalculation is not required.
SETUPDC_SETOWNER When this bit is set, the DC must belong to the current process.
SETUPDC_CLEANDC When this bit is set, the simulation marks the visible regions as valid and calls GreNotifyClipChange in the presentation driver.
pInstance (PVOID) - input
Pointer to instance data.
lFunction (ULONG) - input
High-order WORD=flags; low-order WORD=NGreSetupDC.

Return Code

fSuccess (BOOL) - returns
Return codes.
This function returns BOOLEAN (fSuccess).
  • 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_HDC_BUSY
  • PMERR_HRGN_BUSY
  • PMERR_INSUFFICIENT_MEMORY
  • PMERR_INV_COORD_SPACE
  • PMERR_INV_COORDINATE
  • PMERR_INV_HDC
  • PMERR_INV_HRGN
  • PMERR_INV_LENGTH_OR_COUNT
  • PMERR_INV_RECT
  • PMERR_INV_REGION_CONTROL
  • PMERR_REGION_IS_CLIP_REGION
Refer to the "Error Explanations" section in the Presentation Manager Programming Reference for further explanation.

Declaration

#define INCL_GRE_CLIP
#include <os2.h>

HDC       hdc;         /*  Device context handle. */
HRGN      hrgnVis;     /*  Visible region handle. */
LONG      xOrg;        /*  X-coordinate of DC origin, specified in screen coordinates. */
LONG      yOrg;        /*  Y-coordinate of DC origin, specified in screen coordinates. */
PRECTL    prclBounds;  /*  Bounding rectangle in device coordinates. */
ULONG     flOptions;   /*  Option flags. */
PVOID     pInstance;   /*  Pointer to instance data. */
ULONG     lFunction;   /*  High-order WORD=flags; low-order WORD=NGreSetupDC. */
BOOL      fSuccess;    /*  Return codes. */

fSuccess = GreSetupDC(hdc, hrgnVis, xOrg, yOrg, prclBounds, flOptions, pInstance, lFunction);