gpi12.hlp (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
GpiSetDefAttrs (1.2)
Function Group  Overview                          Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_GPIDEFAULTS
 
BOOL GpiSetDefAttrs(hps, lPrimType, flAttrMask, pbunAttrs)
HPS hps;              /* presentation-space handle                    */
LONG lPrimType;       /* primitive type                               */
ULONG flAttrMask;     /* attributes mask                              */
PBUNDLE pbunAttrs;    /* pointer to structure with default attributes */
 
The GpiSetDefAttrs function sets the default attributes for a primitive. The
default attributes define the values given to the attributes of a
presentation space when that presentation space is reset. The default
attributes also define the value of attributes when they are explicitly set
to the default using the GpiSetAttrs function.
 
Parameter   Description
────────────────────────────────────────────────────────────────────────────
 
hps         Identifies the presentation space.
 
lPrimType   Specifies which primitive type to set default attributes for. It
            can be one of the following values:
 
            Value        Meaning
            ────────────────────────────────────────────────────────────────
            PRIM_AREA    Area primitives
 
            PRIM_CHAR    Character primitives
 
            PRIM_IMAGE   Image primitives
 
            PRIM_LINE    Line and arc primitives
 
            PRIM_MARKER  Marker primitives
 
flAttrMask  Specifies which default attributes to set. The values for this
            parameter depend on the primitive type specified by the
            lPrimType parameter. This parameter can be any combination of
            the following values for a specific type:
 
            Type         Values
            ────────────────────────────────────────────────────────────────
            PRIM_AREA    ABB_COLOR, ABB_BACK_COLOR, ABB_MIX_MODE,
                         ABB_BACK_MIX_MODE, ABB_SET, ABB_SYMBOL,
                         ABB_REF_POINT
 
            PRIM_CHAR    CBB_COLOR, CBB_BACK_COLOR, CBB_MIX_MODE,
                         CBB_BACK_MIX_MODE, CBB_SET, CBB_MODE, CBB_BOX,
                         CBB_ANGLE, CBB_SHEAR, CBB_DIRECTION
 
            PRIM_IMAGE   IBB_COLOR, IBB_BACK_COLOR, IBB_MIX_MODE,
                         IBB_BACK_MIX_MODE
 
            PRIM_LINE    LBB_COLOR, LBB_MIX_MODE, LBB_WIDTH, LBB_GEOM_WIDTH,
                         LBB_TYPE, LBB_END, LBB_JOIN
 
            PRIM_MARKER  MBB_COLOR, MBB_BACK_COLOR, MBB_BACK_MIX_MODE,
                         MBB_SET, MBB_SYMBOL, MBB_BOX, MBB_MIX_MODE
 
            If this parameter is zero, no attributes are set, regardless of
            the value of the pbunAttrs parameter.
 
pbunAttrs   Points to the buffer that contains attribute values for each
            default attribute specified by the flAttrMask parameter. The
            buffer format depends on the primitive type specified by the
            lPrimType parameter. The following structures can be used for
            the specified primitive types:
 
            Type         Structure
            ────────────────────────────────────────────────────────────────
            PRIM_AREA    AREABUNDLE
 
            PRIM_CHAR    CHARBUNDLE
 
            PRIM_IMAGE   IMAGEBUNDLE
 
            PRIM_LINE    LINEBUNDLE
 
            PRIM_MARKER  MARKERBUNDLE
 
Return Value
 
The return value is GPI_OK if the function is successful or GPI_ERROR if an
error occurs.
 
Errors
 
Use the WinGetLastError function to retrieve the error value, which may be
one of the following:
 
    PMERR_HUGE_FONTS_NOT_SUPPORTED
    PMERR_INV_BACKGROUND_COL_ATTR
    PMERR_INV_CHAR_ANGLE_ATTR
    PMERR_INV_CHAR_DIRECTION_ATTR
    PMERR_INV_CHAR_MODE_ATTR
    PMERR_INV_CHAR_SET_ATTR
    PMERR_INV_CHAR_SHEAR_ATTR
    PMERR_INV_COLOR_ATTR
    PMERR_INV_COORDINATE
    PMERR_INV_GEOM_LINE_WIDTH_ATTR
    PMERR_INV_HPS
    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_ATTR
    PMERR_INV_PATTERN_SET_ATTR
    PMERR_INV_PATTERN_SET_FONT
    PMERR_INV_PRIMITIVE_TYPE
    PMERR_PS_BUSY
    PMERR_UNSUPPORTED_ATTR
    PMERR_UNSUPPORTED_ATTR_VALUE
 
Comments
 
Setting the default attributes for a primitive does not immediately affect
the current attributes. The system uses the default attributes only when the
presentation space is reset or when the GpiSetAttrs function is used to set
the defaults. The default attributes are reset when the presentation space
is reset using the GRES_SEGMENT or GRES_ALL options of the GpiResetPS
function.
 
If an attempt is made to set an invalid default value, none of the specified
default attribute values change. Some invalid default attribute values (for
example, certain color and mix values), however, may not be detected until
the attribute is used.
 
See Also
 
GpiQueryDefAttrs, GpiSetAttrs, WinGetLastError, AREABUNDLE, CHARBUNDLE,
IMAGEBUNDLE, LINEBUNDLE, MARKERBUNDLE