Jump to content

GreCopyClipRegion: Difference between revisions

From EDM2
Created page with "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 pre..."
 
No edit summary
Line 9: Line 9:


== Parameters ==
== Parameters ==
;hdc (HDC) - input
:Device context handle.


hdc (HDC) - input  
;hrgn (HRGN) - input  
Device context handle.  
:Visible region handle.  


hrgn (HRGN) - input  
;prclBounds (PRECTL) - input  
Visible region handle.  
:Pointer to the bounding rectangle of the returned region.  


prclBounds (PRECTL) - 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.  
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:


flOptions (ULONG) - input
:;COPYCRGN_ALLINTERSECT
These flags determine the type of region to be returned in hrgn:  
::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.


COPYCRGN_ALLINTERSECT
;pInstance (PVOID) - input
The function must return the intersection of all clipping. This value describes the DC region and is expressed in screen coordinates.
:Pointer to instance data.  
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
;lFunction (ULONG) - input  
Pointer to instance data.
:High-order WORD=flags; low-order WORD=NGreCopyClipRegion.  
 
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:  
:This function returns an integer (lComplexity) indicating the complexity of the region:  


RGN_ERROR Error  
:*RGN_ERROR Error  
RGN_NULL Null region  
:*RGN_NULL Null region  
RGN_RECT Rectangular region  
:*RGN_RECT Rectangular region  
RGN_COMPLEX Complex region (more than one rectangle)  
:*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:  
: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_DEV_FUNC_NOT_INSTALLED  
PMERR_HDC_BUSY  
:*PMERR_HDC_BUSY  
PMERR_HRGN_BUSY  
:*PMERR_HRGN_BUSY  
PMERR_INSUFFICIENT_MEMORY  
:*PMERR_INSUFFICIENT_MEMORY  
PMERR_INV_COORDINATE  
:*PMERR_INV_COORDINATE  
PMERR_INV_HDC  
:*PMERR_INV_HDC  
PMERR_INV_HRGN  
:*PMERR_INV_HRGN  
PMERR_INV_RECT  
:*PMERR_INV_RECT  
PMERR_REGION_IS_CLIP_REGION  
:*PMERR_REGION_IS_CLIP_REGION  


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


== Sample ==
== Sample ==

Revision as of 19:16, 17 January 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);