Appendix:appendix

Graphic constants Foundation

This section contains tables listing constants for the GRA engine. They are defined in the file GRA.CH and are mainly used to set attributes for graphic primitives.

#define-constants for colors by Gra functions
Constants Color
GRA_CLR_WHITE White
GRA_CLR_BLACK Black
GRA_CLR_BLUE Blue
GRA_CLR_RED Red
GRA_CLR_PINK Pink
GRA_CLR_GREEN Green
GRA_CLR_CYAN Cyan
GRA_CLR_YELLOW Yellow
GRA_CLR_DARKGRAY Dark gray
GRA_CLR_DARKBLUE Dark blue
GRA_CLR_DARKRED Dark red
GRA_CLR_DARKPINK Dark pink
GRA_CLR_DARKGREEN Dark green
GRA_CLR_DARKCYAN Dark cyan
GRA_CLR_BROWN Dark brown
GRA_CLR_PALEGRAY Pale gray
GRA_CLR_BACKGROUND Background color of the presentation space
GRA_CLR_NEUTRAL Contrast color for GRA_CLR_BACKGROUND

Mix attributes for foreground colors
Constants Description
GRA_FGMIX_OVERPAINT Paints over existing colors
GRA_FGMIX_LEAVEALONE Uses existing colors
GRA_FGMIX_OR Color mix from new and existing color
by bitwise OR of color bits
GRA_FGMIX_XOR Color mix from new and existing color
by bitwise XOR of color bits
GRA_FGMIX_AND Color mix from new and existing color
by bitwise AND of color bits
GRA_FGMIX_NOTMERGESRC Inverse color mix from GRA_FGMIX_OR
GRA_FGMIX_NOTMASKSRC Inverse color mix from GRA_FGMIX_AND
GRA_FGMIX_NOTXORSRC Inverse color mix from GRA_FGMIX_XOR
GRA_FGMIX_INVERT Inverts existing color
GRA_FGMIX_NOTCOPYSRC Inverts new color
GRA_FGMIX_SUBTRACT Inverts new color and mixes with existing
color by bitwise AND
GRA_FGMIX_MERGENOTSRC Inverts new color and mixes with existing
color by bitwise OR
GRA_FGMIX_MASKSRCNOT Inverts existing color and mixes with new
color by bitwise AND
GRA_FGMIX_MERGESRCNOT Inverts existing color and mixes with new
color by bitwise OR
GRA_FGMIX_ZERO Resulting color is black
(all color bits are set on 0)
GRA_FGMIX_ONE Resulting color is white
(all color bits are set on 1)

Mix attributes for background colors
Constants Description
GRA_BGMIX_OVERPAINT Paints over existing colors
GRA_BGMIX_LEAVEALONE Uses existing colors
GRA_BGMIX_OR *) Color mix from new and existing color
by bitwise OR of the color bits
GRA_BGMIX_XOR *) Color mix from new and existing color
by bitwise XOR of the color bits
  1. Is not supported by Windows

Constants for fill patterns of areas
Constants Fill patterns
GRA_SYM_DENSE1 10% background color
GRA_SYM_DENSE2 20% background color
GRA_SYM_DENSE3 30% background color
GRA_SYM_DENSE4 40% background color
GRA_SYM_DENSE5 50% background color
GRA_SYM_DENSE6 60% background color
GRA_SYM_DENSE7 70% background color
GRA_SYM_DENSE8 80% background color
GRA_SYM_NOSHADE 100% background color
GRA_SYM_SOLID 100% foreground color
GRA_SYM_HALFTONE 50% background color
GRA_SYM_VERT Vertical lines
GRA_SYM_HORIZ Horizontal lines
GRA_SYM_DIAG1 Diagonal lines
GRA_SYM_DIAG2 Diagonal lines
GRA_SYM_DIAG3 Diagonal lines
GRA_SYM_DIAG4 Diagonal lines
GRA_SYM_HATCH Special hatching
GRA_SYM_DIAGHATCH Special hatching

Constants for line width
Constants Line width
GRA_LINEWIDTH_NORMAL Normal line
GRA_LINEWIDTH_THICK Thick line

Constants for line types
Constants Line type
GRA_LINETYPE_DOT Dotted
GRA_LINETYPE_SHORTDASH Short dash
GRA_LINETYPE_DASHDOT Dash dot
GRA_LINETYPE_DOUBLEDOT *) Double dot
GRA_LINETYPE_LONGDASH *) Long dash
GRA_LINETYPE_DASHDOUBLEDOT Dash and double dot
GRA_LINETYPE_SOLID Solid
GRA_LINETYPE_INVISIBLE Invisible
GRA_LINETYPE_ALTERNATE *) Alternating pixels
  1. Is not supported by Windows

Constants for marker symbols
Constants Marker symbol
GRA_MARKSYM_CROSS Cross
GRA_MARKSYM_PLUS Plus sign
GRA_MARKSYM_DIAMOND Diamond
GRA_MARKSYM_SQUARE Square
GRA_MARKSYM_SIXPOINTSTAR Star with 6 points
GRA_MARKSYM_EIGHTPOINTSTAR Star with 8 points
GRA_MARKSYM_SOLIDDIAMOND Solid diamond
GRA_MARKSYM_SOLIDSQUARE Solid square
GRA_MARKSYM_DOT Dot
GRA_MARKSYM_SMALLCIRCLE Small circle
GRA_MARKSYM_BLANK Transparent

Constants for the output direction of characters
Constants Description
GRA_CHDIRN_LEFTRIGHT Display from left to right
GRA_CHDIRN_TOPBOTTOM *) Display from top to bottom
GRA_CHDIRN_RIGHTLEFT *) Display from right to left
GRA_CHDIRN_BOTTOMTOP *) Display from bottom to top
  1. Is not supported by Windows

Constants for horizontal alignment of characters
Constants Description
GRA_HALIGN_LEFT Aligned left
GRA_HALIGN_CENTER Centered
GRA_HALIGN_RIGHT Aligned right

Constants for vertical alignment of characters
Constants Description
GRA_VALIGN_TOP Alignment top
GRA_VALIGN_HALF Alignment to half height
GRA_VALIGN_BASE Alignment on the base line
GRA_VALIGN_BOTTOM Alignment bottom
  1. Is not supported by Windows

Constants for error codes of the GRA engine (GraError())
Constant Description
GRA_ERR_NO_ERROR No error
GRA_ERR_GENERIC Generic error. No further information
is available.
GRA_ERR_PS_CONTEXT The PS currently is in a wrong state.
(e.g: an attempt is made to make nested
calls to GraPathBegin() or GraSegOpen()
without calling GraPathEnd() or GraSegClose
first)
GRA_ERR_COORDINATE Coordinates are not valid for PS or DC
GRA_ERR_DC_STATE The DC currently is in a wrong state for the operation.
(e.g: the DC is associated with a PS.
In this case oDC:destroy() fails)
GRA_ERR_DEVICE_DRIVER A device driver could not be found or a
driver specific error occured.
GRA_ERR_SYS_RESOURCES The operating system is unable to allocate
resources for this operation. (e.g. a graphic
segment exceeds the size limit for segments
or a font is too large to be loaded)
GRA_ERR_RESOURCE_ACCESS A resource is currently not available.
(e.g.: a bitmap is used in one thread
and cannot be used in a second one.
GRA_ERR_MISMATCH A meta file has a different page unit
or a bitmap has a different color depth
than the target PS.
GRA_ERR_INVALID_ATTRIB One or more attributes for graphic primitives
are invalid or not supported by DC or PS.
GRA_ERR_PARAMETER_VALUE One or more parameters for graphic primitives
are invalid (e.g: the angle for GraArc()
or the viewport for oXbpPS:setViewPort()
have been specified incorrectly).
GRA_ERR_MICROPS_OPERATION The operation is not allowed in a Micro PS.
(e.g. an attempt was made to execute GraPathBegin()
or GraSegOpen() with a Micro PS).
GRA_ERR_PRINTING An error occured while spooling a print job
(e.g: :startDoc() was not executed or the
print job was cancelled or incorrect data
for the device have been specified during the
creation of an XbpPrinter object which are not
supported by the device driver).
GRA_ERR_DATA_ERROR Graphic data to be processed are incorrect or
corrupted (e.g. a meta file is corrupted).
GRA_ERR_SEGMENTS Error with graphic segment (e.g. a non existing
segment ID was specified or a segment ID is
used in a meta file that already is defined
in the Xbase++ application).

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.