Jump to content

GreGetAttributes: Difference between revisions

From EDM2
Created page with "This function returns the current value of the attributes indicated in flAttrsMask. This function is supported by the graphics engine. ==Syntax== GreGetAttributes(hdc, lP..."
 
Ak120 (talk | contribs)
mNo edit summary
 
Line 1: Line 1:
This function returns the current value of the attributes indicated in flAttrsMask.  
This function returns the current value of the attributes indicated in flAttrsMask.


This function is supported by the graphics engine.  
This function is supported by the graphics engine.
==Syntax==
==Syntax==
  GreGetAttributes(hdc, lPrimType, flAttrsMask, pAttrs, pInstance, lFunction);
GreGetAttributes(hdc, lPrimType, flAttrsMask, pAttrs, pInstance, lFunction)


==Parameters==
==Parameters==
;hdc (HDC) - input  
;hdc (HDC) - input:Device context handle.
:Device context handle.  
;lPrimType (LONG) - input:Bundle primitive type.
:Indicates the bundle type. Valid primitive values are:
:*PRIM_LINE Line attribute bundle
:*PRIM_CHAR Character attribute bundle
:*PRIM_MARKER Marker attribute bundle
:*PRIM_AREA Pattern attribute bundle
:*PRIM_IMAGE Image attribute bundle
;flAttrsMask (ULONG) - input:Attribute mask.
:Specifies the attributes to be returned. This mask contains a bit corresponding to each attribute in the bundle record. For each set bit, the graphics engine returns the corresponding attribute values and default mask bits.
;pAttrs (PBUNDLE) - input:The returned attribute value (bundle).
:Pointer to the fixed format bundle record containing the attributes returned. The only fields that are updated are those whose corresponding flags in flAttrsMask have been set.
;pInstance (PVOID) - input:Pointer to instance data.
;lFunction (ULONG) - input:High-order WORD=flags; low-order WORD=NGreGetAttributes.


;lPrimType (LONG) - input
:Bundle primitive type.
:Indicates the bundle type. Valid primitive values are:
:*PRIM_LINE Line attribute bundle
:*PRIM_CHAR Character attribute bundle
:*PRIM_MARKER Marker attribute bundle
:*PRIM_AREA Pattern attribute bundle
:*PRIM_IMAGE Image attribute bundle
;flAttrsMask (ULONG) - input
:Attribute mask.
:Specifies the attributes to be returned. This mask contains a bit corresponding to each attribute in the bundle record. For each set bit, the graphics engine returns the corresponding attribute values and default mask bits.
;pAttrs (PBUNDLE) - input
:The returned attribute value (bundle).
:Pointer to the fixed format bundle record containing the attributes returned. The only fields that are updated are those whose corresponding flags in flAttrsMask have been set.
;pInstance (PVOID) - input
:Pointer to instance data.
;lFunction (ULONG) - input
:High-order WORD=flags; low-order WORD=NGreGetAttributes.
==Return Code==
==Return Code==
;rc (LONG) - returns  
;rc (LONG) - returns:This function returns the default attribute bit mask. Only bits with corresponding set bits in flAttrsMask are updated. Otherwise, this function returns the error, GPI_ALTERROR.
:This function returns the default attribute bit mask. Only bits with corresponding set bits in flAttrsMask are updated. Otherwise, this function returns the error, GPI_ALTERROR.  


:Possible Errors Detected:   When an error is detected, the graphics engine calls WinSetErrorInfo to post the condition. Reasons for failure of this function include:  
Possible Errors Detected: When an error is detected, the graphics engine calls WinSetErrorInfo to post the condition. Reasons for failure of this function include:
 
*PMERR_HDC_BUSY
:*PMERR_HDC_BUSY  
*PMERR_INV_HDC
:*PMERR_INV_HDC  


==Remarks==
==Remarks==
When a specified attribute is currently set to its default value, the corresponding flag in the returned defaults mask is set and the returned value for this attribute is undefined.  
When a specified attribute is currently set to its default value, the corresponding flag in the returned defaults mask is set and the returned value for this attribute is undefined.
 
The graphics engine either:
 
*Returns the value of each specified attribute and resets the corresponding bit in the returned mask, or
*Sets the bit in the returned mask to indicate that the specified attribute is set to its default. Note that the corresponding value in the attribute buffer is not valid and is likely to have been overwritten by the engine.
 
 
==Sample Code==
<PRE>
 
#define INCL_GRE_DEVSUPPORT
#include <os2.h>
 
HDC        hdc;          /*  Device context handle. */
LONG      lPrimType;    /*  Bundle primitive type. */
ULONG      flAttrsMask;  /*  Attribute mask. */
PBUNDLE    pAttrs;      /*  The returned attribute value (bundle). */
PVOID      pInstance;    /*  Pointer to instance data. */
ULONG      lFunction;    /*  High-order WORD=flags; low-order WORD=NGreGetAttributes. */
LONG      rc;


rc = GreGetAttributes(hdc, lPrimType, flAttrsMask,
The graphics engine either:
      pAttrs, pInstance, lFunction);
*Returns the value of each specified attribute and resets the corresponding bit in the returned mask, or
</PRE>
*Sets the bit in the returned mask to indicate that the specified attribute is set to its default. Note that the corresponding value in the attribute buffer is not valid and is likely to have been overwritten by the engine.


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

Latest revision as of 08:53, 2 January 2020

This function returns the current value of the attributes indicated in flAttrsMask.

This function is supported by the graphics engine.

Syntax

GreGetAttributes(hdc, lPrimType, flAttrsMask, pAttrs, pInstance, lFunction)

Parameters

hdc (HDC) - input
Device context handle.
lPrimType (LONG) - input
Bundle primitive type.
Indicates the bundle type. Valid primitive values are:
  • PRIM_LINE Line attribute bundle
  • PRIM_CHAR Character attribute bundle
  • PRIM_MARKER Marker attribute bundle
  • PRIM_AREA Pattern attribute bundle
  • PRIM_IMAGE Image attribute bundle
flAttrsMask (ULONG) - input
Attribute mask.
Specifies the attributes to be returned. This mask contains a bit corresponding to each attribute in the bundle record. For each set bit, the graphics engine returns the corresponding attribute values and default mask bits.
pAttrs (PBUNDLE) - input
The returned attribute value (bundle).
Pointer to the fixed format bundle record containing the attributes returned. The only fields that are updated are those whose corresponding flags in flAttrsMask have been set.
pInstance (PVOID) - input
Pointer to instance data.
lFunction (ULONG) - input
High-order WORD=flags; low-order WORD=NGreGetAttributes.

Return Code

rc (LONG) - returns
This function returns the default attribute bit mask. Only bits with corresponding set bits in flAttrsMask are updated. Otherwise, this function returns the error, GPI_ALTERROR.

Possible Errors Detected: When an error is detected, the graphics engine calls WinSetErrorInfo to post the condition. Reasons for failure of this function include:

  • PMERR_HDC_BUSY
  • PMERR_INV_HDC

Remarks

When a specified attribute is currently set to its default value, the corresponding flag in the returned defaults mask is set and the returned value for this attribute is undefined.

The graphics engine either:

  • Returns the value of each specified attribute and resets the corresponding bit in the returned mask, or
  • Sets the bit in the returned mask to indicate that the specified attribute is set to its default. Note that the corresponding value in the attribute buffer is not valid and is likely to have been overwritten by the engine.