GEMLIB  0.44.0
Functions
VDI control functions

control functions More...

Functions

void v_clrwk (VdiHdl)
 
void v_clsvwk (VdiHdl)
 
void v_clswk (VdiHdl)
 
short v_flushcache (VdiHdl)
 
short v_loadcache (VdiHdl, const char *filename, short mode)
 
void v_opnvwk (short work_in[], VdiHdl *, short work_out[])
 
void v_opnwk (short work_in[], VdiHdl *, short work_out[])
 
short v_savecache (VdiHdl, const char *filename)
 
void v_set_app_buff (VdiHdl, void *buf_p, short size)
 
void v_updwk (VdiHdl)
 
void vs_clip (VdiHdl, short clip_flag, short pxy[])
 
void vs_clip_pxy (VdiHdl, PXY pxy[])
 
void vs_clip_off (VdiHdl)
 
short vst_load_fonts (VdiHdl, short)
 
void vst_unload_fonts (VdiHdl, short)
 

Detailed Description

control functions

todo: add description here

Function Documentation

void v_clrwk ( short  handle)

erases the screen or - if the device is a printer or plotter - advances the page and clears the printing buffer.

Parameters
handleDevice handle
Since
all VDI versions
Note
With GEM VDI, you do not need to do a Clear Workstation after an Open Workstation because the display is cleared at Open Workstation.

References VDI_CNTRLMAX.

void v_clsvwk ( short  handle)

closes a virtual workstation

Parameters
handleDevice handle
Since
all VDI versions

References VDI_CNTRLMAX.

void v_clswk ( short  handle)

closes a physical workstation

Parameters
handleDevice handle
Since
all VDI versions

If you call v_clswk() for a printer driver and if you have not called v_updwk() or v_clear_disp_list() before, buffered commands will be executed and sent to the printer.

References VDI_CNTRLMAX.

short v_flushcache ( short  handle)
Parameters
handleDevice handle
Returns
Since
See also

References VDI_CNTRLMAX.

short v_loadcache ( short  handle,
const char *  filename,
short  mode 
)
Parameters
handleDevice handle
filename
mode
Returns
Since
all VDI versions
See also

References VDI_CNTRLMAX, VDI_INTINMAX, VDI_INTOUTMAX, VDI_PTSOUTMAX, and vdi_str2array_n().

void v_opnvwk ( short  work_in[],
short *  handle,
short  work_out[] 
)

opens a virtual workstation on an already opened physical device (the screen). The attributes for each (virtual) workstation are maintained separately.

Parameters
work_insame as v_opnwk()
handlebefore the call, handle specifies the handle of the physical workstation (returned by graf_handle).
After the call, handle will contain the handle of the virtual workstation
work_outsame as v_opnwk()
Since
all VDI versions

References PERIMETER_ON, VDI_CNTRLMAX, vsf_perimeter(), vsl_ends(), vsl_width(), vsm_height(), vst_effects(), and vst_height().

void v_opnwk ( short  work_in[],
short *  handle,
short  work_out[] 
)

loads a device driver and opens a physical workstation. The driver is loaded according to ASSING.SYS and the device is initialized with parameters in the input array.

Parameters
work_inwork_in Meaning of work_in[0..10]:
  • work_in[0]: Device ID number. This value determines which device driver will be opened.
    • 1-10: Screen
    • ab 11: Plotter
    • ab 21: Printer
    • ab 31: Metafile
    • ab 41: Kamera
    • ab 51: Tablet
    • ab 61: Memory
  • work_in[1]: Line type
  • work_in[2]: Line color index
  • work_in[3]: Marker type
  • work_in[4]: Marker color index
  • work_in[5]: font id
  • work_in[6]: text color index
  • work_in[7]: fill interior style
  • work_in[8]: fill style index
  • work_in[9]: fill color index
  • work_in[10]:transformation flag 0: NDC , 2: RC
Meaning of work_in[11..15]:
  • work_in[11]: page size
    • PAGE_DEFAULT (0) use default setting
    • PAGE_A3 (1) DIN A3
    • PAGE_A4 (2) DIN A4
    • PAGE_A5 (3) DIN A5
    • PAGE_B5 (4) DIN B5
    • PAGE_LETTER (16) Letter size
    • PAGE_HALF (17) Half size
    • PAGE_LEGAL (18) Legal size
    • PAGE_DOUBLE (19) Double size
    • PAGE_BROAD (20) Broad sheet size
  • work_in[12/13]: pointer to a GEMDOS file name (C string) or 0L
  • work_in[14]: 0, reserved
  • work_in[15]: 0, reserved
handlebefore the call, handle should contain 0 or 1. after the call, handle will contain the handle of the physical workstation, or 0 if an error has occured.
work_outMeaning of work_out[0..56]:
  • work_out[0]: Maximum addressable width (0 - xmax)
  • work_out[1]: Maximum addressable height (0 - ymax)
  • work_out[2]: Device Coordinate units flag
    • 0: Device capable of producing a precisely scaled image (e.g. screen)
    • 1: Device not capable of producing a precisely scaled image (e.g. film recorder)
  • work_out[3]: Pixel width in microns
  • work_out[4]: Pixel height in microns
  • work_out[5]: Number of character heights (0: continous scaling)
  • work_out[6]: Number of line types
  • work_out[7]: Number of line widths (0: continous scaling)
  • work_out[8]: Number of marker types
  • work_out[9]: Number of marker heights (0: continous scaling)
  • work_out[10]: Number of accessible fonts
  • work_out[11]: Number of patterns
  • work_out[12]: Number of hatch styles
  • work_out[13]: Number of simultaneously displayed colors (e.g. 256 on an 8 bit screen)
  • work_out[14]: Number of GDPs
  • work_out[15] to work_out[24]: List of the supported GDPs. -1 indicates the end of the list.
  • work_out[25] to work_out[34]: List of attributes associated with each GDP:
    • 0: Line
    • 1: Marker
    • 2: Text
    • 3: Fill area
    • 4: no attributes
  • work_out[35]: Color capability flag
  • work_out[36]: Text rotation capability flag
  • work_out[37]: Fill area capability falg
  • work_out[38]: CELLARRAY flag
  • work_out[39]: Number of color levels (0: more than 32767)
  • work_out[40]: Number of locator devices available
    • 1: Keyboard
    • 2: Keyboard and mouse (or other devices)
  • work_out[41]: Number of valuator devices available
    • 1: Keyboard
    • 2: another device is available
  • work_out[42]: Number of choice devices available
    • 1: Function keys
    • 2: another button pad
  • work_out[43]: Number of string devices available
    • 1: Keyboard
  • work_out[44]: Device type
    • 0: Output only
    • 1: Input only
    • 2: Input and Output
    • 4: Metafile output
  • work_out[45]: minimum character width
  • work_out[46]: minimum character height
  • work_out[47]: maximum character width
  • work_out[48]: maximum character height
  • work_out[49]: minimum line with
  • work_out[50]: 0
  • work_out[51]: maximum line width
  • work_out[52]: 0
  • work_out[53]: minimum marker width
  • work_out[54]: minimum marker height
  • work_out[55]: maximum marker width
  • work_out[56]: maximum marker height
Since
all VDI versions

Important: The screen driver is opened by the AES after all programs in the AUTO folder have been executed. Therefore applications have to call v_opnvwk()

If you open a NVDI printer or IMG driver, you can set the page size and the GEMDOS output device. The Metafile driver ignores the page size (it should be 0) but it uses the device name.

References VDI_CNTRLMAX.

short v_savecache ( short  handle,
const char *  filename 
)
Parameters
handleDevice handle
filename
Returns
Since
See also

References VDI_CNTRLMAX, VDI_INTINMAX, and vdi_str2array_n().

void v_set_app_buff ( short  handle,
void *  buf_p,
short  size 
)
Parameters
handleDevice handle
buf_p
size
Since
See also

References VDI_CNTRLMAX.

void v_updwk ( short  handle)

starts output on devices like printers or plotters, which buffer VDI commands in a display list and do not execute them immediately

Parameters
handleDevice handle
Since
all VDI versions

The screen driver executes VDI commands immediately and therefore you do not have to call "UPDATE WORKSTATION".

Note: The picture is drawn to the printer but no new page occurs. A Clear Workstation causes a new page.

References VDI_CNTRLMAX.

void vs_clip ( short  handle,
short  clip_flag,
short  pxy[] 
)

You can limit the area for graphic operations by calling this function. If you enable clipping graphic operations will only take place in the clipping rectangle.

Parameters
handleDevice handle
clip_flagturn on/off the clipping as follow:
  • 0 : turn clipping off. Warning: Do not switch off clipping because a graphic object which is drawn outside of the visible screen area will overwrite memory or cause a bus error.
  • 1 (or any nonzero value) : turn clipping on
pxyclipping rectangle
Since
all VDI versions

References VDI_CNTRLMAX.

void vs_clip_off ( short  handle)

same as vs_clip(handle,0,dummy)

Parameters
handleDevice handle

References VDI_CNTRLMAX.

void vs_clip_pxy ( short  handle,
PXY  pxy[] 
)

same as vs_clip(handle,1,pxy)

Parameters
handleDevice handle
pxysame as vs_clip()

References VDI_CNTRLMAX.

short vst_load_fonts ( short  handle,
short  select 
)

loads the fonts for the device specified by handle and returns the number of additional fonts.

Parameters
handleDevice handle
select0 (reserved)
Returns
number of additional fonts
Since
all VDI versions

Before you call vst_load_fonts(), call vq_gdos() and make sure that the VDI can load additional fonts.

References VDI_CNTRLMAX.

void vst_unload_fonts ( short  handle,
short  select 
)

The memory for the additional fonts is freed.

Parameters
handleDevice handle
select0 (reserved)
Since
all VDI versions

If the fonts are being shared by other virtual workstations with the same root device handle, the fonts are not unloaded from memory until one of the following conditions is met:

  • all workstations that share the fonts are closed
  • all workstations that share the external fonts request that the external fonts be unloaded

The default system fonts for the workstation remain loaded and available.

References VDI_CNTRLMAX.