Jump to content

GreCopyClipRegion: Difference between revisions

From EDM2
No edit summary
Ak120 (talk | contribs)
mNo edit summary
 
Line 1: Line 1:
GreCopyClipRegion copies the visible region, clip region, or DC region, and returns the complexity and bounds of the resulting region.  
GreCopyClipRegion copies the visible region, clip region, or DC region, and returns the complexity and bounds of the resulting region.


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 ==  
  GreCopyClipRegion(hdc, hrgn, prclBounds, flOptions, pInstance, lFunction);
  GreCopyClipRegion(hdc, hrgn, prclBounds, flOptions, pInstance, lFunction)


== Parameters ==
== Parameters ==
;hdc (HDC) - input  
;hdc (HDC) - input:Device context handle.
:Device context handle.  
;hrgn (HRGN) - input:Visible region handle.
 
;prclBounds (PRECTL) - input:Pointer to the bounding rectangle of the returned region.
;hrgn (HRGN) - input  
:The bounding rectangle is returned in the same coordinate system as the region defined by flOptions. This rectangle is inclusive at the bottom and left boundaries, exclusive at the top and right boundaries. When specified as NULL, the bounding rectangle is not returned.
:Visible region handle.  
;flOptions (ULONG) - input:These flags determine the type of region to be returned in hrgn:
 
:;COPYCRGN_ALLINTERSECT:The function must return the intersection of all clipping. This value describes the DC region and is expressed in screen coordinates.
;prclBounds (PRECTL) - input  
:;COPYCRGN_VISRGN:The function must return a copy of the visible region only. This value is returned in screen coordinates.
:Pointer to the bounding rectangle of the returned region.  
:;COPYCRGN_CLIPRGN:The function must return a copy of the clip region only. The clip region is expressed in device coordinates.
 
;pInstance (PVOID) - input:Pointer to instance data.
:The bounding rectangle is returned in the same coordinate system as the region defined by flOptions. This rectangle is inclusive at the bottom and left boundaries, exclusive at the top and right boundaries. When specified as NULL, the bounding rectangle is not returned.  
;lFunction (ULONG) - input:High-order WORD=flags; low-order WORD=NGreCopyClipRegion.
 
;flOptions (ULONG) - input  
:These flags determine the type of region to be returned in hrgn:  
 
:;COPYCRGN_ALLINTERSECT  
::The function must return the intersection of all clipping. This value describes the DC region and is expressed in screen coordinates.  
:;COPYCRGN_VISRGN  
::The function must return a copy of the visible region only. This value is returned in screen coordinates.  
:;COPYCRGN_CLIPRGN  
::The function must return a copy of the clip region only. The clip region is expressed in device coordinates.  
 
;pInstance (PVOID) - input  
:Pointer to instance data.  
 
;lFunction (ULONG) - input  
:High-order WORD=flags; low-order WORD=NGreCopyClipRegion.  


== Returns ==
== Returns ==
;rc (LONG) - returns  
;rc (LONG) - returns:Return codes.
:Return codes.  
:This function returns an integer (lComplexity) indicating the complexity of the region:
 
:*RGN_ERROR Error
:This function returns an integer (lComplexity) indicating the complexity of the region:  
:*RGN_NULL Null region
 
:*RGN_RECT Rectangular region
:*RGN_ERROR Error  
:*RGN_COMPLEX Complex region (more than one rectangle)
:*RGN_NULL Null region  
: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:
:*RGN_RECT Rectangular region  
:*PMERR_DEV_FUNC_NOT_INSTALLED
:*RGN_COMPLEX Complex region (more than one rectangle)  
:*PMERR_HDC_BUSY
 
:*PMERR_HRGN_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_INSUFFICIENT_MEMORY
 
:*PMERR_INV_COORDINATE
:*PMERR_DEV_FUNC_NOT_INSTALLED  
:*PMERR_INV_HDC
:*PMERR_HDC_BUSY  
:*PMERR_INV_HRGN
:*PMERR_HRGN_BUSY  
:*PMERR_INV_RECT
:*PMERR_INSUFFICIENT_MEMORY  
:*PMERR_REGION_IS_CLIP_REGION
:*PMERR_INV_COORDINATE  
:Refer to the "Error Explanations" section in the ''Presentation Manager Programming Reference'' for further explanation.
:*PMERR_INV_HDC  
:*PMERR_INV_HRGN  
:*PMERR_INV_RECT  
:*PMERR_REGION_IS_CLIP_REGION  
 
:Refer to the "Error Explanations" section in the Presentation Manager Programming Reference for further explanation.  


== Sample ==
== Sample ==
Line 74: Line 52:
LONG      rc;          /*  Return codes. */
LONG      rc;          /*  Return codes. */


rc = GreCopyClipRegion(hdc, hrgn, prclBounds,
rc = GreCopyClipRegion(hdc, hrgn, prclBounds, flOptions, pInstance, lFunction);
      flOptions, pInstance, lFunction);
</pre>
</pre>


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

Latest revision as of 02:12, 24 March 2020

GreCopyClipRegion copies the visible region, clip region, or DC region, and returns the complexity and bounds of the resulting region.

This function can be hooked by the presentation driver.

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

Syntax

GreCopyClipRegion(hdc, hrgn, prclBounds, flOptions, pInstance, lFunction)

Parameters

hdc (HDC) - input
Device context handle.
hrgn (HRGN) - input
Visible region handle.
prclBounds (PRECTL) - input
Pointer to the bounding rectangle of the returned region.
The bounding rectangle is returned in the same coordinate system as the region defined by flOptions. This rectangle is inclusive at the bottom and left boundaries, exclusive at the top and right boundaries. When specified as NULL, the bounding rectangle is not returned.
flOptions (ULONG) - input
These flags determine the type of region to be returned in hrgn:
COPYCRGN_ALLINTERSECT
The function must return the intersection of all clipping. This value describes the DC region and is expressed in screen coordinates.
COPYCRGN_VISRGN
The function must return a copy of the visible region only. This value is returned in screen coordinates.
COPYCRGN_CLIPRGN
The function must return a copy of the clip region only. The clip region is expressed in device coordinates.
pInstance (PVOID) - input
Pointer to instance data.
lFunction (ULONG) - input
High-order WORD=flags; low-order WORD=NGreCopyClipRegion.

Returns

rc (LONG) - returns
Return codes.
This function returns an integer (lComplexity) indicating the complexity of the region:
  • RGN_ERROR Error
  • RGN_NULL Null region
  • RGN_RECT Rectangular region
  • RGN_COMPLEX Complex region (more than one rectangle)
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_DEV_FUNC_NOT_INSTALLED
  • PMERR_HDC_BUSY
  • PMERR_HRGN_BUSY
  • PMERR_INSUFFICIENT_MEMORY
  • PMERR_INV_COORDINATE
  • PMERR_INV_HDC
  • PMERR_INV_HRGN
  • PMERR_INV_RECT
  • PMERR_REGION_IS_CLIP_REGION
Refer to the "Error Explanations" section in the Presentation Manager Programming Reference for further explanation.

Sample

#define INCL_GRE_CLIP
#include <os2.h>

HDC       hdc;         /*  Device context handle. */
HRGN      hrgn;        /*  Visible region handle. */
PRECTL    prclBounds;  /*  Pointer to the bounding rectangle of the returned region. */
ULONG     flOptions;   /*  These flags determine the type of region to be returned in hrgn: */
PVOID     pInstance;   /*  Pointer to instance data. */
ULONG     lFunction;   /*  High-order WORD=flags; low-order WORD=NGreCopyClipRegion. */
LONG      rc;          /*  Return codes. */

rc = GreCopyClipRegion(hdc, hrgn, prclBounds, flOptions, pInstance, lFunction);