GreSetDefaultAttributes: Difference between revisions
Appearance
Created page with "GreSetDefaultAttributes sets the default attributes for the specified primitive type according to the flags set in flAttrsMask. This function is supported by the graphics en..." |
mNo edit summary |
||
Line 1: | Line 1: | ||
GreSetDefaultAttributes sets the default attributes for the specified primitive type according to the flags set in flAttrsMask. | GreSetDefaultAttributes sets the default attributes for the specified primitive type according to the flags set in flAttrsMask. | ||
This function is supported by the graphics engine. | This function is supported by the graphics engine. | ||
==Syntax== | ==Syntax== | ||
Line 9: | Line 9: | ||
==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 | ||
:Bundle primitive type. | ::PRIM_CHAR Character attribute bundle | ||
::PRIM_MARKER Marker attribute bundle | |||
:Indicates the bundle type. Valid primitive values are: | ::PRIM_AREA Pattern attribute bundle | ||
::PRIM_IMAGE Image attribute bundle | |||
::PRIM_LINE Line attribute bundle | ;flAttrsMask (ULONG) - input:Flags indicating which attributes are to be modified. | ||
::PRIM_CHAR Character attribute bundle | ;pAttrs (PBUNDLE) - input:Pointer. | ||
::PRIM_MARKER Marker attribute bundle | ;This is a pointer to the fixed-format bundle record containing the attribute values to be set as specified by flAttrsMask. Only the attribute fields corresponding to attribute flags set in flAttrsMask contain valid values. | ||
::PRIM_AREA Pattern attribute bundle | ;pInstance (PVOID) - input:Pointer to instance data. | ||
::PRIM_IMAGE Image attribute bundle | ;lFunction (ULONG) - input:High-order WORD=flags; low-order WORD=NGreSetDefaultAttributes. | ||
;flAttrsMask (ULONG) - input | |||
:Flags indicating which attributes are to be modified. | |||
;pAttrs (PBUNDLE) - input | |||
:Pointer. | |||
;This is a pointer to the fixed-format bundle record containing the attribute values to be set as specified by flAttrsMask. Only the attribute fields corresponding to attribute flags set in flAttrsMask contain valid values. | |||
;pInstance (PVOID) - input | |||
;lFunction (ULONG) - input | |||
:High-order WORD=flags; low-order WORD=NGreSetDefaultAttributes. | |||
==Return Code== | ==Return Code== | ||
;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 graphics engine calls WinSetErrorInfo to post the condition. Reasons for failure of this function include: | |||
:*TRUE Successful | :*PMERR_COORDINATE_OVERFLOW | ||
:*FALSE Error | :*PMERR_DEV_FUNC_NOT_INSTALLED | ||
:*PMERR_EXCEEDS_MAX_SEG_LENGTH | |||
:Possible Errors Detected: | :*PMERR_HDC_BUSY | ||
:*PMERR_HUGE_FONTS_NOT_SUPPORTED | |||
:*PMERR_COORDINATE_OVERFLOW | :*PMERR_INSUFFICIENT_MEMORY | ||
:*PMERR_DEV_FUNC_NOT_INSTALLED | :*PMERR_INV_BACKGROUND_COL_ATTR | ||
:*PMERR_EXCEEDS_MAX_SEG_LENGTH | :*PMERR_INV_BACKGROUND_MIX_ATTR | ||
:*PMERR_HDC_BUSY | :*PMERR_INV_CHAR_DIRECTION_ATTR | ||
:*PMERR_HUGE_FONTS_NOT_SUPPORTED | :*PMERR_INV_CHAR_MODE_ATTR | ||
:*PMERR_INSUFFICIENT_MEMORY | :*PMERR_INV_CHAR_SET_ATTR | ||
:*PMERR_INV_BACKGROUND_COL_ATTR | :*PMERR_INV_CHAR_SHEAR_ATTR | ||
:*PMERR_INV_BACKGROUND_MIX_ATTR | :*PMERR_INV_CODEPAGE | ||
:*PMERR_INV_CHAR_DIRECTION_ATTR | :*PMERR_INV_COLOR_ATTR | ||
:*PMERR_INV_CHAR_MODE_ATTR | :*PMERR_INV_COORD_SPACE | ||
:*PMERR_INV_CHAR_SET_ATTR | :*PMERR_INV_GEOM_LINE_WIDTH_ATTR | ||
:*PMERR_INV_CHAR_SHEAR_ATTR | :*PMERR_INV_HDC | ||
:*PMERR_INV_CODEPAGE | :*PMERR_INV_LENGTH_OR_COUNT | ||
:*PMERR_INV_COLOR_ATTR | :*PMERR_INV_LINE_END_ATTR | ||
:*PMERR_INV_COORD_SPACE | :*PMERR_INV_LINE_JOIN_ATTR | ||
:*PMERR_INV_GEOM_LINE_WIDTH_ATTR | |||
:*PMERR_INV_HDC | |||
:*PMERR_INV_LENGTH_OR_COUNT | |||
:*PMERR_INV_LINE_END_ATTR | |||
:*PMERR_INV_LINE_JOIN_ATTR | |||
:*PMERR_INV_LINE_TYPE_ATTR | :*PMERR_INV_LINE_TYPE_ATTR | ||
:*PMERR_INV_LINE_WIDTH_ATTR | :*PMERR_INV_LINE_WIDTH_ATTR | ||
:*PMERR_INV_MARKER_SET_ATTR | :*PMERR_INV_MARKER_SET_ATTR | ||
:*PMERR_INV_MARKER_SYMBOL_ATTR | :*PMERR_INV_MARKER_SYMBOL_ATTR | ||
:*PMERR_INV_MIX_ATTR | :*PMERR_INV_MIX_ATTR | ||
:*PMERR_INV_PATTERN_REF_PT_ATTR | :*PMERR_INV_PATTERN_REF_PT_ATTR | ||
:*PMERR_INV_PATTERN_SET_ATTR | :*PMERR_INV_PATTERN_SET_ATTR | ||
:*PMERR_INV_PATTERN_SET_FONT | :*PMERR_INV_PATTERN_SET_FONT | ||
:*PMERR_INV_PRIMITIVE_TYPE | :*PMERR_INV_PRIMITIVE_TYPE | ||
:*PMERR_INV_SETID | :*PMERR_INV_SETID | ||
:*PMERR_UNSUPPORTED_ATTR | :*PMERR_UNSUPPORTED_ATTR | ||
:*PMERR_UNSUPPORTED_ATTR_VALUE | :*PMERR_UNSUPPORTED_ATTR_VALUE | ||
:Refer to the "Error Explanations" section of the Presentation Manager Programming Reference for further explanation. | |||
:Refer to the "Error Explanations" section of the Presentation Manager Programming Reference for further explanation. | |||
==Remarks== | ==Remarks== | ||
Only attributes whose flags are set in flAttrsMask are modified. They are set to the value specified by pAttrs. | Only attributes whose flags are set in flAttrsMask are modified. They are set to the value specified by pAttrs. | ||
When this function occurs within a path bracket, it must not be used to set the geometric line width for line attributes. In addition, it must not be used to set the foreground and background colors and mixes for character and marker attributes. | When this function occurs within a path bracket, it must not be used to set the geometric line width for line attributes. In addition, it must not be used to set the foreground and background colors and mixes for character and marker attributes. | ||
==Sample Code== | ==Sample Code== |
Latest revision as of 18:21, 5 April 2025
GreSetDefaultAttributes sets the default attributes for the specified primitive type according to the flags set in flAttrsMask.
This function is supported by the graphics engine.
Syntax
GreSetDefaultAttributes(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
- Flags indicating which attributes are to be modified.
- pAttrs (PBUNDLE) - input
- Pointer.
- This is a pointer to the fixed-format bundle record containing the attribute values to be set as specified by flAttrsMask. Only the attribute fields corresponding to attribute flags set in flAttrsMask contain valid values.
- pInstance (PVOID) - input
- Pointer to instance data.
- lFunction (ULONG) - input
- High-order WORD=flags; low-order WORD=NGreSetDefaultAttributes.
Return Code
- 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 graphics engine calls WinSetErrorInfo to post the condition. Reasons for failure of this function include:
- PMERR_COORDINATE_OVERFLOW
- PMERR_DEV_FUNC_NOT_INSTALLED
- PMERR_EXCEEDS_MAX_SEG_LENGTH
- PMERR_HDC_BUSY
- PMERR_HUGE_FONTS_NOT_SUPPORTED
- PMERR_INSUFFICIENT_MEMORY
- PMERR_INV_BACKGROUND_COL_ATTR
- PMERR_INV_BACKGROUND_MIX_ATTR
- PMERR_INV_CHAR_DIRECTION_ATTR
- PMERR_INV_CHAR_MODE_ATTR
- PMERR_INV_CHAR_SET_ATTR
- PMERR_INV_CHAR_SHEAR_ATTR
- PMERR_INV_CODEPAGE
- PMERR_INV_COLOR_ATTR
- PMERR_INV_COORD_SPACE
- PMERR_INV_GEOM_LINE_WIDTH_ATTR
- PMERR_INV_HDC
- PMERR_INV_LENGTH_OR_COUNT
- PMERR_INV_LINE_END_ATTR
- PMERR_INV_LINE_JOIN_ATTR
- PMERR_INV_LINE_TYPE_ATTR
- PMERR_INV_LINE_WIDTH_ATTR
- PMERR_INV_MARKER_SET_ATTR
- PMERR_INV_MARKER_SYMBOL_ATTR
- PMERR_INV_MIX_ATTR
- PMERR_INV_PATTERN_REF_PT_ATTR
- PMERR_INV_PATTERN_SET_ATTR
- PMERR_INV_PATTERN_SET_FONT
- PMERR_INV_PRIMITIVE_TYPE
- PMERR_INV_SETID
- PMERR_UNSUPPORTED_ATTR
- PMERR_UNSUPPORTED_ATTR_VALUE
- Refer to the "Error Explanations" section of the Presentation Manager Programming Reference for further explanation.
Remarks
Only attributes whose flags are set in flAttrsMask are modified. They are set to the value specified by pAttrs.
When this function occurs within a path bracket, it must not be used to set the geometric line width for line attributes. In addition, it must not be used to set the foreground and background colors and mixes for character and marker attributes.
Sample Code
#define INCL_GRE_DEVSUPPORT #include <os2.h> HDC hdc; /* Device context handle. */ LONG lPrimType; /* Bundle primitive type. */ ULONG flAttrsMask; /* Flags indicating which attributes are to be modified. */ PBUNDLE pAttrs; /* Pointer. */ PVOID pInstance; /* Pointer to instance data. */ ULONG lFunction; /* High-order WORD=flags; low-order WORD=NGreSetDefaultAttributes. */ BOOL fSuccess; /* Return codes. */ fSuccess = GreSetDefaultAttributes(hdc, lPrimType, flAttrsMask, pAttrs, pInstance, lFunction);