Jump to content

GreDeviceInvalidateVisRegion: Difference between revisions

From EDM2
Created page with "GreDeviceInvalidateVisRegion notifies the presentation driver that the visible region and DC region of one or more DCs has changed, and that the affected DCs must revalidate t..."
 
Ak120 (talk | contribs)
mNo edit summary
 
Line 1: Line 1:
GreDeviceInvalidateVisRegion notifies the presentation driver that the visible region and DC region of one or more DCs has changed, and that the affected DCs must revalidate their visible regions before drawing in them.  
GreDeviceInvalidateVisRegion notifies the presentation driver that the visible region and DC region of one or more DCs has changed, and that the affected DCs must revalidate their visible regions before drawing in them.


Simulation support: This function is mandatory for display drivers. For other drivers, it is simulated by a handling routine in the graphics engine.  
Simulation support: This function is mandatory for display drivers. For other drivers, it is simulated by a handling routine in the graphics engine.


== Syntax ==  
== Syntax ==  
  GreDeviceInvalidateVisRegion(hdc, cArray, paBlock, pInstance, lFunction);
GreDeviceInvalidateVisRegion(hdc, cArray, paBlock, pInstance, lFunction)


== Parameters ==
== Parameters ==
;hdc (HDC) - input  
;hdc (HDC) - input:The device context handle.
:The device context handle.  
;cArray (LONG) - input:The number of elements in the array.
 
;paBlock (PDC_BLOCK) - input:A pointer to an array of DC_BLOCK structures:
;cArray (LONG) - input  
::hdc A device context handle.
:The number of elements in the array.  
::pDcI A pointer to instance data.
 
;pInstance (PVOID) - input:A pointer to instance data.
;paBlock (PDC_BLOCK) - input  
;lFunction (ULONG) - input:High-order WORD=flags; low-order WORD=NGreDeath.
:A pointer to an array of DC_BLOCK structures:  
 
;hdc A device context handle.  
:pDcI A pointer to instance data.  
 
;pInstance (PVOID) - input  
:A pointer to instance data.  
 
;lFunction (ULONG) - input  
:High-order WORD=flags; low-order WORD=NGreDeath.  


== Returns ==
== Returns ==
;fSuccess (BOOL) - returns  
;fSuccess (BOOL) - returns:Return codes.
:Return codes.  
:On completion, the handling routine must return BOOLEAN (fSuccess).
 
:*TRUE Successful
:On completion, the handling routine must return BOOLEAN (fSuccess).  
:*FALSE Error
 
:Possible Errors Detected: When an error is detected, the handling routine must call WinSetErrorInfo to post the condition. An error code for conditions that the handling routine is expected to check:
:*TRUE Successful  
:PMERR_DEV_FUNC_NOT_INSTALLED
:*FALSE Error  
 
:Possible Errors Detected: When an error is detected, the handling routine must call WinSetErrorInfo to post the condition. An error code for conditions that the handling routine is expected to check:  
 
:PMERR_DEV_FUNC_NOT_INSTALLED  


== Sample ==
== Sample ==
Line 55: Line 40:


== Remarks ==
== Remarks ==
The array identified by paBlock contains a series of structures, each of which identifies a DC and supplies the pointer (pInstance) to its instance data. The display driver responds by setting a flag (HDC_IS_DIRTY) in the instance data of each DC identified in the array. The handling routines for all drawing functions should check the HDC_IS_DIRTY flag before drawing. If the flag is set, VisRegionNotify must be called to revalidate the DC's visible region.  
The array identified by paBlock contains a series of structures, each of which identifies a DC and supplies the pointer (pInstance) to its instance data. The display driver responds by setting a flag (HDC_IS_DIRTY) in the instance data of each DC identified in the array. The handling routines for all drawing functions should check the HDC_IS_DIRTY flag before drawing. If the flag is set, VisRegionNotify must be called to revalidate the DC's visible region.


This function allows the system to defer the calculations caused by visible region changes. This enables menus and dialogs to perform more efficiently.  
This function allows the system to defer the calculations caused by visible region changes. This enables menus and dialogs to perform more efficiently.


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

Latest revision as of 00:13, 24 March 2020

GreDeviceInvalidateVisRegion notifies the presentation driver that the visible region and DC region of one or more DCs has changed, and that the affected DCs must revalidate their visible regions before drawing in them.

Simulation support: This function is mandatory for display drivers. For other drivers, it is simulated by a handling routine in the graphics engine.

Syntax

GreDeviceInvalidateVisRegion(hdc, cArray, paBlock, pInstance, lFunction)

Parameters

hdc (HDC) - input
The device context handle.
cArray (LONG) - input
The number of elements in the array.
paBlock (PDC_BLOCK) - input
A pointer to an array of DC_BLOCK structures:
hdc A device context handle.
pDcI A pointer to instance data.
pInstance (PVOID) - input
A pointer to instance data.
lFunction (ULONG) - input
High-order WORD=flags; low-order WORD=NGreDeath.

Returns

fSuccess (BOOL) - returns
Return codes.
On completion, the handling routine must return BOOLEAN (fSuccess).
  • TRUE Successful
  • FALSE Error
Possible Errors Detected: When an error is detected, the handling routine must call WinSetErrorInfo to post the condition. An error code for conditions that the handling routine is expected to check:
PMERR_DEV_FUNC_NOT_INSTALLED

Sample

#define INCL_GRE_DEVMISC2
#include <os2.h>

HDC          hdc;        /*  The device context handle. */
LONG         cArray;     /*  The number of elements in the array. */
PDC_BLOCK    paBlock;
PVOID        pInstance;  /*  A pointer to instance data. */
ULONG        lFunction;  /*  High-order WORD=flags; low-order WORD=NGreDeath. */
BOOL         fSuccess;   /*  Return codes. */

fSuccess = GreDeviceInvalidateVisRegion(hdc,
             cArray, paBlock, pInstance, lFunction);

Remarks

The array identified by paBlock contains a series of structures, each of which identifies a DC and supplies the pointer (pInstance) to its instance data. The display driver responds by setting a flag (HDC_IS_DIRTY) in the instance data of each DC identified in the array. The handling routines for all drawing functions should check the HDC_IS_DIRTY flag before drawing. If the flag is set, VisRegionNotify must be called to revalidate the DC's visible region.

This function allows the system to defer the calculations caused by visible region changes. This enables menus and dialogs to perform more efficiently.