GreDeviceSetGlobalAttribute: Difference between revisions
Appearance
Created page with "GreDeviceSetGlobalAttribute sets the individual primitive attributes to the specified value in the line, area, character, image, and marker bundles. This function must be su..." |
mNo edit summary |
||
Line 1: | Line 1: | ||
GreDeviceSetGlobalAttribute sets the individual primitive attributes to the specified value in the line, area, character, image, and marker bundles. | GreDeviceSetGlobalAttribute sets the individual primitive attributes to the specified value in the line, area, character, image, and marker bundles. | ||
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 == | ||
GreDeviceSetGlobalAttribute(hdc, lAttrType, lAttribute, flOptions, pInstance, lFunction) | GreDeviceSetGlobalAttribute(hdc, lAttrType, lAttribute, flOptions, pInstance, lFunction) | ||
== Parameters == | == Parameters == | ||
; hdc (HDC) - input : Device context handle. | ;hdc (HDC) - input: Device context handle. | ||
;lAttrType (LONG) - input: Specifies the attribute. | |||
; lAttrType (LONG) - input : Specifies the attribute. | :Possible attribute types are: | ||
: Possible attribute types are: | :*ATYPE_COLOR Foreground color | ||
:*ATYPE_COLOR Foreground color | :*ATYPE_BACK_COLOR Background color | ||
:*ATYPE_BACK_COLOR Background color | :*ATYPE_MIX_MODE Foreground mix | ||
:*ATYPE_MIX_MODE Foreground mix | :*ATYPE_BACK_MIX_MODE Background mix ATYPE_BACK_COLOR and ATYPE_BACK_MIX_MODE do not apply to the line bundle. | ||
:*ATYPE_BACK_MIX_MODE Background mix ATYPE_BACK_COLOR and ATYPE_BACK_MIX_MODE do not apply to the line bundle. | ;lAttribute (LONG) - input: New attribute value. | ||
;flOptions (ULONG) - input: Options flag. | |||
; lAttribute (LONG) - input : New attribute value. | :The only allowable option is: | ||
::GATTR_DEFAULT When set, the attribute indicated by lAttrType is set to its default value. When this flag is not set, the attribute is set to the value of lAttribute. | |||
; flOptions (ULONG) - input : Options flag. | ;pInstance (PVOID) - input: Pointer to instance data. | ||
;lFunction (ULONG) - input: High-order WORD=flags; low-order WORD=NGreDeviceSetGlobalAttribute. | |||
: The only allowable option is: | |||
: GATTR_DEFAULT When set, the attribute indicated by lAttrType is set to its default value. When this flag is not set, the attribute is set to the value of lAttribute. | |||
; pInstance (PVOID) - input : Pointer to instance data. | |||
; lFunction (ULONG) - input : High-order WORD=flags; low-order WORD=NGreDeviceSetGlobalAttribute. | |||
== 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_BACKGROUND_COL_ATTR | |||
: 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_INV_BACKGROUND_MIX_ATTR | ||
:*PMERR_INV_COLOR_ATTR | |||
:*PMERR_DEV_FUNC_NOT_INSTALLED | :*PMERR_INV_HDC | ||
:*PMERR_INV_BACKGROUND_COL_ATTR | :*PMERR_INV_MIX_ATTR | ||
:*PMERR_INV_BACKGROUND_MIX_ATTR | Refer to the "Error Explanations" section in the ''Presentation Manager Programming Reference'' for further explanation. | ||
:*PMERR_INV_COLOR_ATTR | |||
:*PMERR_INV_HDC | |||
:*PMERR_INV_MIX_ATTR | |||
Refer to the "Error Explanations" section in the Presentation Manager Programming Reference for further explanation. | |||
== Sample == | == Sample == | ||
Line 68: | Line 55: | ||
== Remarks == | == Remarks == | ||
If this call sets any attributes to a value that is not in the defined range of values for that attribute, the handling routine must restore all attributes to the value they had on entry to this routine. | If this call sets any attributes to a value that is not in the defined range of values for that attribute, the handling routine must restore all attributes to the value they had on entry to this routine. | ||
[[Category:Gre]] | [[Category:Gre]] |
Latest revision as of 23:59, 23 March 2020
GreDeviceSetGlobalAttribute sets the individual primitive attributes to the specified value in the line, area, character, image, and marker bundles.
This function must be supported by the presentation driver.
- Simulation support
- None. This function is mandatory for all drivers.
Syntax
GreDeviceSetGlobalAttribute(hdc, lAttrType, lAttribute, flOptions, pInstance, lFunction)
Parameters
- hdc (HDC) - input
- Device context handle.
- lAttrType (LONG) - input
- Specifies the attribute.
- Possible attribute types are:
- ATYPE_COLOR Foreground color
- ATYPE_BACK_COLOR Background color
- ATYPE_MIX_MODE Foreground mix
- ATYPE_BACK_MIX_MODE Background mix ATYPE_BACK_COLOR and ATYPE_BACK_MIX_MODE do not apply to the line bundle.
- lAttribute (LONG) - input
- New attribute value.
- flOptions (ULONG) - input
- Options flag.
- The only allowable option is:
- GATTR_DEFAULT When set, the attribute indicated by lAttrType is set to its default value. When this flag is not set, the attribute is set to the value of lAttribute.
- pInstance (PVOID) - input
- Pointer to instance data.
- lFunction (ULONG) - input
- High-order WORD=flags; low-order WORD=NGreDeviceSetGlobalAttribute.
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_BACKGROUND_COL_ATTR
- PMERR_INV_BACKGROUND_MIX_ATTR
- PMERR_INV_COLOR_ATTR
- PMERR_INV_HDC
- PMERR_INV_MIX_ATTR
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 lAttrType; /* Specifies the attribute. */ LONG lAttribute; /* New attribute value. */ ULONG flOptions; /* Options flag. */ PVOID pInstance; /* Pointer to instance data. */ ULONG lFunction; BOOL rc; /* Return Codes. */ rc = GreDeviceSetGlobalAttribute(hdc, lAttrType, lAttribute, flOptions, pInstance, lFunction);
Remarks
If this call sets any attributes to a value that is not in the defined range of values for that attribute, the handling routine must restore all attributes to the value they had on entry to this routine.