GEMLIB  0.44.0
Functions
VDI attribute functions

attribute functions More...

Functions

void vs_color (VdiHdl, short color_idx, short rgb[])
 
short vswr_mode (VdiHdl, short mode)
 
short vsf_color (VdiHdl, short color_idx)
 
short vsf_interior (VdiHdl, short style)
 
short vsf_perimeter (VdiHdl, short vis)
 
short vsf_xperimeter (VdiHdl, short vis, short style)
 
short vsf_style (VdiHdl, short style)
 
void vsf_udpat (VdiHdl, short pat[], short planes)
 
short vsl_color (VdiHdl, short color_idx)
 
void vsl_ends (VdiHdl, short begstyle, short endstyle)
 
short vsl_type (VdiHdl, short style)
 
void vsl_udsty (VdiHdl, short pat)
 
short vsl_width (VdiHdl, short width)
 
short vsm_color (VdiHdl, short color_idx)
 
short vsm_height (VdiHdl, short height)
 
short vsm_type (VdiHdl, short symbol)
 
void vst_alignment (VdiHdl, short hin, short vin, short *hout, short *vout)
 
short vst_color (VdiHdl, short color_idx)
 
short vst_effects (VdiHdl, short effects)
 
void vst_error (VdiHdl, short mode, short *errorvar)
 
short vst_font (VdiHdl, short font)
 
void vst_height (VdiHdl, short height, short *charw, short *charh, short *cellw, short *cellh)
 
short vst_point (VdiHdl, short point, short *charw, short *charh, short *cellw, short *cellh)
 
short vst_rotation (VdiHdl, short ang)
 
void vst_scratch (VdiHdl, short mode)
 

Detailed Description

attribute functions

todo: add description here

Function Documentation

void vs_color ( short  handle,
short  index,
short  rgb[] 
)

Set Color Representation

Parameters
handleDevice handle
indexcolor index (pen)
rgbcontain the intensity of red, green, blue as following:
  • rgb[0] : Red color intensity (in tenths percent, 0-1000).
  • rgb[1] : Green color intensity.
  • rgb[2] : Blue color intensity
Since
all VDI versions

This function sets the RGB color associated with a color index. The intensity of red, green and blue is set in per mille (0-1000). If the device driver has a CLUT, the new setting will immediately change the color of all pixels with color index index.

If a device has more than 256 simultaneously displayable colors, it usually does not have a CLUT. In this case the pixels do not contain a color value or index but a direct color value in RGB (e.g. a pixel with 32 bits has 8 unused bits, 8 bits for red, 8 bits for green and 8 bits for blue). This means that the VDI creates a pseudo CLUT with 256 pens and calling vs_color() for one of these pens will not change the color of the pixels which have been drawn with this pen, but it will change the color of new pixels drawn with this pen. Note that the palettes are handled per workstation which means, that each workstation has its own palette (pseudo CLUT) and changing the RGB value for a color index on one workstation will not change the value of the same pen in another workstation.

References VDI_CNTRLMAX.

short vsf_color ( short  handle,
short  index 
)

sets the color index for filled areas

Parameters
handleDevice handle
indexrequested fill color. If the index is invalid, color index 1 will be selected. If you use a colored pattern (see vsf_udpat()) the color index will be ignored; you should set it to 1.
Returns
realized color
Since
all VDI versions

References VDI_CNTRLMAX.

short vsf_interior ( short  handle,
short  style 
)

selects the fill type for filled graphic objects

Parameters
handleDevice handle
stylerequested fill type :
  • FIS_HOLLOW (0) : fills the interior with the current background color (index 0).
  • FIS_SOLID (1) : fills the area with the currently selected fill color.
  • FIS_PATTERN (2)
  • FIS_HATCH (3)
  • FIS_USER (4)
If the requested type is invalid, type 0 (hollow) will be selected.
Returns
selected fill type
Since
all VDI versions

References VDI_CNTRLMAX.

short vsf_perimeter ( short  handle,
short  vis 
)

turns the outline of a filled area (rectangle, polygone, ellipse, ...) on or off.

Parameters
handleDevice handle
visperimeter flag
  • PERIMETER_OFF (0) : invisible
  • PERIMETER_ON (1) : visible
Any nonzero value of the visibility flag causes the perimeter to be visible.
Returns
perimeter flag
Since
all VDI versions

When visibility is on (the default at Open Workstation) the border of a fill area is drawn in the current fill area color with a solid line. When visibility is off, no outline is drawn.

References VDI_CNTRLMAX.

Referenced by v_opnvwk().

short vsf_style ( short  handle,
short  style 
)

sets the style index based on the fill interior style. This index has no effect if the interior style is hollow, solid, or user-defined.

Parameters
handleDevice handle
stylerequested style index, range from 1 to a device-dependent maximum. If the requested index is not available, GEM VDI uses index style 1.The index references a hatch style if the selected fill interior style is hatch, or a pattern if the selected interior fill style is pattern.
Returns
selected style index
Since
all VDI versions

References VDI_CNTRLMAX.

void vsf_udpat ( short  handle,
short  pat[],
short  planes 
)

is the function which allows you to set a user-defined 16*16 pixel pattern.

Parameters
handleDevice handle
patFor the pattern data, bit 15 of word 1 is the upper left bit of the pattern. Bit 0 of word 16 is the lower right bit of the pattern. Bit zero is the Least Significant Bit of the word. Words are stored in the same format as 16-bit integers (ie pat[0] correspond to the top line of the pattern, and pat[15] correspond to the bottom line of the pattern).
For a single plane pattern, a bit value of 1 indicates foreground color. A bit value of 0 indicates the background color. The color used for the foreground is determined by the current fill area color index.
Patterns with multiple colors have to be stored in standard format and must have the same number of planes as the device. Exception: If the device is a Hicolor or Truecolor device (direct color mapping) you always pass a pattern width 32-bit pixels (xrgb).
Note that the writing mode must be set to replace (mode MR_REPLACE = 1), when using a multiplane fill pattern.
planes
Since
all VDI versions
Note
If you use a pattern with multiple colors you should select color index 1 and writing mode 1.

References VDI_CNTRLMAX.

short vsf_xperimeter ( short  handle,
short  vis,
short  style 
)

turns the outline of a filled area (rectangle, polygone, ellipse, ...) on or off, and set the line type for this outline.

Parameters
handleDevice handle
visperimeter flag
  • PERIMETER_OFF (0) : invisible
  • PERIMETER_ON (1) : visible
Any nonzero value of the visibility flag causes the perimeter to be visible.
stylesame as vsl_type().
Returns
perimeter flag
Since
PC/GEM3

This call is similar to vsf_perimeter(), but one can choose the line type used to draw the perimeter. vsf_perimeter() only allow to draw solid lines.

References VDI_CNTRLMAX.

short vsl_color ( short  handle,
short  index 
)

sets the color index for lines

Parameters
handleDevice handle
indexrequested line color. If the index is invalid, color index 1 will be selected.
Returns
realized line color
Since
all VDI versions

References VDI_CNTRLMAX.

void vsl_ends ( short  handle,
short  begstyle,
short  endstyle 
)

changes the style of the line ends

Parameters
handleDevice handle
begstyleend style for the first point
endstyleend style for the last point
end style should be one of the following value:
  • SQUARE (0)
  • ARROWED (1)
  • ROUND (2)
Since
all VDI versions
Note
The TOS 4.04 (other versions were not investigated) requires the intout array to be set. Otherwise it crashes.

References VDI_CNTRLMAX.

Referenced by v_opnvwk().

short vsl_type ( short  handle,
short  style 
)

sets the line type for polyline operations

Parameters
handleDevice handle
stylerequested line type :
  • SOLID (1) : %1111111111111111 (solid line)
  • LDASHED (2) : %1111111111110000 (long dash)
  • DOTTED (3) : %1110000011100000 (dots)
  • DASHDOT (4) : %1111111100011000 (dash, dot)
  • DASH (5) : %1111111100000000 (dash)
  • DASHDOTDOT (6) : %1111000110011000 (dash, dot, dot)
  • USERLINE (7) : user-defined, via vsl_udsty()
If the requested line type is not available, line type 1 will be selected (solid).
Returns
realized line type
Since
all VDI versions

References VDI_CNTRLMAX.

void vsl_udsty ( short  handle,
short  pat 
)

set the pattern for the user-defined line type

Parameters
handleDevice handle
patuser-defined line pattern specified in this 16-bit word. The Most Significant Bit (MSB) of the pattern word is the first pixel in the line. This line style is used for subsequent polyline operations when the application selects user defined line style, index 7.
Since
all VDI versions

References VDI_CNTRLMAX.

short vsl_width ( short  handle,
short  width 
)

sets the width of lines for polyline operations

Parameters
handleDevice handle
widthrequested line width
Returns
selected line width, which is always an odd value (1, 3, 5 or ...), which means that even values are rounded down.
Since
all VDI versions
Note
The line width is always in relation to the horizontal pixel size (if the aspect ratio is not 1:1, the height is corrected so that a horizontal and a vertical line seem to have the same width, though horizontal and vertical pixel size are different - e.g. in ST mid ).

Most device drivers ignore the line type and draw solid lines if the line is more than one pixel wide.

References VDI_CNTRLMAX.

Referenced by v_opnvwk().

short vsm_color ( short  handle,
short  index 
)

sets the color index for markers

Parameters
handleDevice handle
indexmarker color. If the index is invalid, color index 1 will be selected.
Returns
selected color
Since
all VDI versions

References VDI_CNTRLMAX.

short vsm_height ( short  handle,
short  height 
)

sets the marker height

Parameters
handleDevice handle
heightrequested marker height. If the requested height does not exist, the next smaller height will be selected. Marker type 1 (dot) is always 1 pixel high.
Returns
realized marker height
Since
all VDI versions

References VDI_CNTRLMAX.

Referenced by v_opnvwk().

short vsm_type ( short  handle,
short  symbol 
)

selects the kind of marker for v_pmarker().

Parameters
handleDevice handle
symbolrequested marker type. If the requested marker kind is not available, type 3 is used. The total number of markers available is device dependent, but GEM VDI always defines at least six marker types:
  • MRKR_DOT (1) : dot
  • MRKR_PLUS (2) : plus
  • MRKR_ASTERISK (3) : asterisk
  • MRKR_BOX (4) : square
  • MRKR_CROSS (5) : diagonal cross
  • MRKR_DIAMOND (6) : diamond
  • (7..n) : device-dependent
Returns
selected marker type
Since
all VDI versions

References VDI_CNTRLMAX.

void vst_alignment ( short  handle,
short  hin,
short  vin,
short *  hout,
short *  vout 
)

sets the horizontal and vertical alignment for graphic text

Parameters
handleDevice handle
hinrequested horizontal alignment. If an invalid horizontal alignment is requested, the text will be left justified.
  • TA_LEFT (0) : left justified
  • TA_CENTER (1) : centered
  • TA_RIGHT (2) : right justified
vinrequested vertical alignment. If an invalid vertical alignment is requested, the text will be aligned to the baseline.
  • TA_BASE (0) : baseline
  • TA_HALF (1) : half line
  • TA_ASCENT (2) : ascent line
  • TA_BOTTOM (3) : bottom
  • TA_DESCENT (4) : descent
  • TA_TOP (5) : top
houtselected horizontal alignment
[option CHECK_NULLPTR] hout may be NULL
voutselected vertical alignment
[option CHECK_NULLPTR] vout may be NULL
Since
all VDI versions

References VDI_CNTRLMAX.

short vst_color ( short  handle,
short  index 
)

sets the color index for text output

Parameters
handleDevice handle
indexrequested color index. If the index is invalid, color index 1 will be selected.
Returns
selected color index
Since
all VDI versions

References VDI_CNTRLMAX.

short vst_effects ( short  handle,
short  effects 
)

sets special text effects (really?).

Parameters
handleDevice handle
effectsrequested text effects. effects is one, or any combination of the following values:
  • TXT_NORMAL (0x0000)
  • TXT_THICKENED (0x0001)
  • TXT_LIGHT (0x0002)
  • TXT_SKEWED (0x0004)
  • TXT_UNDERLINED (0x0008)
  • TXT_OUTLINED (0x0010)
  • TXT_SHADOWED (0x0020)
Returns
selected text effects
Since
all VDI versions

References VDI_CNTRLMAX.

Referenced by v_opnvwk().

void vst_error ( short  handle,
short  mode,
short *  errorvar 
)
Parameters
handleDevice handle
mode
errorvar
Since
See also

References VDI_CNTRLMAX, VDI_INTOUTMAX, and VDI_PTSOUTMAX.

short vst_font ( short  handle,
short  font 
)

selects a font for text output

Parameters
handleDevice handle
fontrequested font. If a font with the requested does not exist, the system font will be chosen.
Returns
selected font
Since
all VDI versions

References VDI_CNTRLMAX.

void vst_height ( short  handle,
short  height,
short *  charw,
short *  charh,
short *  cellw,
short *  cellh 
)

sets the character height in pixels

Parameters
handleDevice handle
heightrequested character height. The height is specified as the distance between baseline and the top of the character cell.
charwselected character width
[option CHECK_NULLPTR] charw may be NULL
charhselected character height
[option CHECK_NULLPTR] charh may be NULL
cellwselected character cell width
[option CHECK_NULLPTR] cellw may be NULL
cellhselected character cell height
[option CHECK_NULLPTR] cellh may be NULL
Returns
AFAIK, nothing... who know what VDI puts in vdi_intout[0] ?
Since
all VDI versions
Note
NVDI doc says that if the font is a bitmap and the requested height does not exist, the VDI scales the bitmap.
original VDI doc says that if the desired character height does not map exactly to a device size, GEM VDI selects the closest character size that does not exceed the requested size.
NVDI doc says that if the font is a vector font, char_width and cell_width are not the exact character widths but only rounded values.
original VDI doc says that For proportional faces, GEM VDI returns the width of the widest character and the width of the widest character cell in the face.

References VDI_CNTRLMAX.

Referenced by v_opnvwk().

short vst_point ( short  handle,
short  point,
short *  charw,
short *  charh,
short *  cellw,
short *  cellh 
)

sets the character cell height in points (1 pt = 1/72"). For bitmap font this function selects the closest height which is smaller or equal to the requested size. If the font is a vector font, only predefined heights can be selected (usually 8, 9, 10, 11, 12, 14, 18, 24, 36, and 48 pt).

Parameters
handleDevice handle
pointrequested character cell height (1/72"). The specified height is the distance between the baseline of one line of text and the baseline of the next line of text, which is the character cell height.
charwselected character width
charhselected character height
cellwselected character cell width
cellhselected character cell height
Returns
selected character cell height (1/72")
Since
all VDI versions

References VDI_CNTRLMAX.

short vst_rotation ( short  handle,
short  ang 
)

enables text rotation in 1/10 of degrees. If the selected font is a bitmap font, rotation works only in steps of 90 degrees

Parameters
handleDevice handle
angrequested angle
Returns
realized angle
Since
all VDI versions
This function is not required and may not be supported on all devices. The Extended Inquire function returns the availability of this function.

References VDI_CNTRLMAX.

void vst_scratch ( short  handle,
short  mode 
)
Parameters
handleDevice handle
mode
Returns
Since
See also

References VDI_CNTRLMAX.

short vswr_mode ( short  handle,
short  mode 
)

selects the writing mode for graphic operations

Parameters
handleDevice handle
moderequested writing mode. The writing mode specifies the operation performed between the color indices of the current pixel (source) and the existing pixel (destination), thus affecting the way new pixels from lines, markers, filled areas, and text are placed on the display. Four modes exist:
  • MD_REPLACE (1)
  • MD_TRANS (2)
  • MD_XOR (3)
  • MD_ERASE (4)
If you try to select a mode number which is out of range, mode 1 (MD_REPLACE) will be selected.
Returns
selected writing mode
Since
all VDI versions

References VDI_CNTRLMAX.