Jump to content

GreDeviceGetAttributes: Difference between revisions

From EDM2
Created page with "GreDeviceGetAttributes queries the attribute values currently set in the device. This function must be supported by the presentation driver. ; Simulation support: None. Th..."
 
Ak120 (talk | contribs)
mNo edit summary
 
Line 1: Line 1:
GreDeviceGetAttributes queries the attribute values currently set in the device.  
GreDeviceGetAttributes queries the attribute values currently set in the device.


This function must be supported by the presentation driver.  
This function must be supported by the presentation driver.


; Simulation support: None. This function is mandatory for all drivers.  
;Simulation support: None. This function is mandatory for all drivers.


== Syntax ==  
== Syntax ==  
  GreDeviceGetAttributes(hdc, lPrimType, flAttrsMask, pAttrs, pInstance, lFunction);
  GreDeviceGetAttributes(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:
; lPrimType (LONG) - input  
* PRIM_LINE Line attribute bundle (see Line Attributes.
: Bundle primitive type.  
* PRIM_CHAR Character attribute bundle see Character Attributes.
 
* PRIM_MARKER Marker attribute bundle see Marker Attributes.
Indicates the bundle type. Valid primitive values are:  
* PRIM_AREA Area (Pattern) attribute bundle see Area (Pattern) Attributes.
 
* PRIM_IMAGE Image attribute bundle see Image Attributes.
* PRIM_LINE Line attribute bundle (see Line Attributes.  
;flAttrsMask (ULONG) - input: Attribute mask.
* PRIM_CHAR Character attribute bundle see Character Attributes.  
:Specifies the attributes to be returned. This mask contains a bit corresponding to each attribute in the bundle record that is required. For each set bit, the handling routine must return the corresponding attribute values and default mask bits. Only the foreground color and background color attributes can be requested for any primitive type.
* PRIM_MARKER Marker attribute bundle see Marker Attributes.  
;pAttrs (PBUNDLE) - input: Pointer to the fixed-format bundle record to which the attributes are returned. Fields other than those indicated by flAttrsMask must not be modified.
* PRIM_AREA Area (Pattern) attribute bundle see Area (Pattern) Attributes.  
;pInstance (PVOID) - input: Pointer to instance data.
* PRIM_IMAGE Image attribute bundle see Image Attributes.  
;lFunction (ULONG) - input: High-order WORD=flags; low-order WORD=NGreDeviceGetAttributes.
 
; flAttrsMask (ULONG) - input : Attribute mask.  
:Specifies the attributes to be returned. This mask contains a bit corresponding to each attribute in the bundle record that is required. For each set bit, the handling routine must return the corresponding attribute values and default mask bits. Only the foreground color and background color attributes can be requested for any primitive type.  
 
; pAttrs (PBUNDLE) - input : Pointer to the fixed-format bundle record to which the attributes are returned. Fields other than those indicated by flAttrsMask must not be modified.  
 
; pInstance (PVOID) - input : Pointer to instance data.  
 
; lFunction (ULONG) - input : High-order WORD=flags; low-order WORD=NGreDeviceGetAttributes.  


== Returns ==
== Returns ==
; rc (BOOL) - returns : Return Codes.  
;rc (BOOL) - returns : Return Codes.
 
:On completion, the handling routine must return a BOOLEAN value to indicate success or an error.
On completion, the handling routine must return a BOOLEAN value to indicate success or an error.  
* TRUE Successful
 
* FALSE Error
* TRUE Successful  
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:
* FALSE Error  
* PMERR_DEV_FUNC_NOT_INSTALLED
 
* PMERR_INV_HDC
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:  
Refer to the "Error Explanations" section in the ''Presentation Manager Programming Reference'' for further explanation.
 
* PMERR_DEV_FUNC_NOT_INSTALLED  
* PMERR_INV_HDC  
 
Refer to the "Error Explanations" section in the Presentation Manager Programming Reference for further explanation.  
 


== Sample ==
== Sample ==
Line 64: Line 49:
       flAttrsMask, pAttrs, pInstance, lFunction);
       flAttrsMask, pAttrs, pInstance, lFunction);
</pre>
</pre>


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

Latest revision as of 00:15, 24 March 2020

GreDeviceGetAttributes queries the attribute values currently set in the device.

This function must be supported by the presentation driver.

Simulation support
None. This function is mandatory for all drivers.

Syntax

GreDeviceGetAttributes(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 (see Line Attributes.
  • PRIM_CHAR Character attribute bundle see Character Attributes.
  • PRIM_MARKER Marker attribute bundle see Marker Attributes.
  • PRIM_AREA Area (Pattern) attribute bundle see Area (Pattern) Attributes.
  • PRIM_IMAGE Image attribute bundle see Image Attributes.
flAttrsMask (ULONG) - input
Attribute mask.
Specifies the attributes to be returned. This mask contains a bit corresponding to each attribute in the bundle record that is required. For each set bit, the handling routine must return the corresponding attribute values and default mask bits. Only the foreground color and background color attributes can be requested for any primitive type.
pAttrs (PBUNDLE) - input
Pointer to the fixed-format bundle record to which the attributes are returned. Fields other than those indicated by flAttrsMask must not be modified.
pInstance (PVOID) - input
Pointer to instance data.
lFunction (ULONG) - input
High-order WORD=flags; low-order WORD=NGreDeviceGetAttributes.

Returns

rc (BOOL) - returns
Return Codes.
On completion, the handling routine must return a BOOLEAN value to indicate success or an error.
  • 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_DEV_FUNC_NOT_INSTALLED
  • PMERR_INV_HDC

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

Sample

#define INCL_GRE_DEVMISC1
#include <os2.h>

HDC        hdc;          /*  Device context handle. */
LONG       lPrimType;    /*  Bundle primitive type. */
ULONG      flAttrsMask;  /*  Attribute mask. */
PBUNDLE    pAttrs;
PVOID      pInstance;    /*  Pointer to instance data. */
ULONG      lFunction;
BOOL       rc;           /*  Return Codes. */

rc = GreDeviceGetAttributes(hdc, lPrimType,
       flAttrsMask, pAttrs, pInstance, lFunction);