•  Back 
  •  VDI Workstation 
  •  Index 
  •  Tree View 
  •  Cross references 
  •  %About 
  •  Show info about hypertext 
  •  View a new file 
Topic       : The ATARI Compendium
Author      : Scott Sanders / JAY Software
Version     : 1.25 (20/6/2003)
Subject     : Documentation
Nodes       : 1117
Index Size  : 32614
HCP-Version : 6
Compiled on : Atari
@charset    : UTF-8
@lang       : en
@default    : 
@help       : %About
@options    : +g -i -t4 +y +z
@width      : 100
View Ref-Filev_opnwk()
vq_extnd()
v_clsvwk()
V_Opnvwk()
v_opnvwk()                                                              VDI

Syntax

VOID v_opnvwk( work_in, handle, work_out )
WORD *work_in, *handle, *work_out;

Function      v_opnvwk() opens a virtual VDI workstation.

              dev() a pointer to a virtual VDI workstation.

Opcode        100

Availability  Supported by all drivers.

Parameters    work_in is a pointer to an array of 11 WORDs which define the
              inital defaults for the workstation as follows:

              work_in                       Meaning
               [ x ]

                 0   Device identification number. This indicates the
                     physical device ID of the device (the line number of
                     the driver in ASSIGN.SYS when using GDOS). For screen
                     devices you should normally use the value of 1.

                 1   Default line type (same as vsl_type() ).

                 2   Default line color (same as vsl_color() ).

                 3   Default marker type (same as vsm_type() ).

                 4   Default marker color (same as vsm_color() ).

                 5   Default font (same as vst_font() ).

                 6   Default text color (same as vst_color() ).

                 7   Default fill interior.

                 8   Default fill style.

                 9   Default fill color.

                10   Coordinate type flag. A value of 0 specifies NDC
                     'Normalized Device Coordinates' coordinates whereas
                     a value of 2 specifies RC 'Raster Coordinates'. All
                     other values are reserved. NDC coordinates are only
                     available when using external drivers with GDOS.

              handle should be set to the current handle (not the device ID)
              of the physical workstation for this device. For screen
              devices this is the value returned by graf_handle(). On exit
              handle will be filled in the VDI workstation handle allocated,
              if successful, or 0 if the workstation could not be
              opened. work_out points to an array of 57 WORDs which on exit
              will be filled in by the VDI with information regarding the
              allocated workstation as follows (a structure name is listed
              beside its array member for those using the 'C' style
              VDI_Workstation structure instead of the array):


              work_out     VDI        Meaning
               [ x ]    Structure
                         Member

                 0      xres          Width of device in pixels - 1.

                 1      yres          Height of device in pixels - 1.

                 2      noscale       Device coordinate units flag:

                                      0 = Device capable of producing
                                          a precisely scaled image
                                          (screen, printer, etc...)
                                      1 = Device not capable of producing
                                          a precisely scaled image
                                          (film recorder, etc...)

                 3      wpixel        Width of pixel in microns
                                      (1/25400 inch).

                 4      hpixel        Height of pixel in microns
                                      (1/25400 inch).

                 5      cheights      Number of character heights
                                      (0 = continuous scaling).

                 6      linetypes     Number of line types.

                 7      linewidths    Number of line widths
                                      (0 = continous  scaling).

                 8      markertypes   Number of marker types.

                 9      markersizes   Number of marker sizes
                                      (0 = continous  scaling).

                10      faces         Number of faces supported by the
                                      device.

                11      patterns      Number of available patterns.

                12      hatches       Number of available hatches.

                13      colors        Number of predefined colors/pens:

                                      ST High        2
                                      ST Medium      4
                                      TT Low       256
                                      True Color   256

                14      ngdps         Number of supported GDP's

              15-24     cangdps[10]   cangdps[ 0 - (ngdps - 1)] contains
                                      a list of the GDP's the device
                                      supports as follows:

                                       1   Bar
                                       2   Arc
                                       3   Pie Slice
                                       4   Circle
                                       5   Ellipse
                                       6   Elliptical Arc
                                       7   Elliptical Pie
                                       8   Rounded Rectangle
                                       9   Filled Rounded Rectangle
                                      10   Justified Graphics Text

              25-34     gdpattr[10]   For each GDP as listed above,
                                      gdpattr[ 0 - (ngdps - 1)] indicates
                                      the attributes which are applied to
                                      that GDP as follows:

                                       1   Polyline (vsl_...)
                                       2   Polymarker (vsm_...)
                                       3   Text (vst_...)
                                       4   Fill Area (vsf_...)
                                       5   None

                35      cancolor      Color capability flag.

                                       0 =  No
                                       1 = Yes

                36      cantextrot    Text rotation flag.

                                       0 =  No
                                       1 = Yes

                 37     canfillarea   Fill area capability flag.

                                       0 =  No
                                       1 = Yes

                38      cancellarray  Cell array capability flag.

                                       0 =  No
                                       1 = Yes

                39      palette       Number of available colors in
                                      palette.

                                       0 =  > 32767 colors
                                       2 =  Monochrome
                                      >2 =  Color

                40      locators      Number of locator devices.

                                       1 = Keyboard only.
                                       2 = Keyboard and other.

                41      valuators     Number of valuator devices.

                                       1 = Keyboard only.
                                       2 = Keyboard and other.

                 42     choicedevs    Number of choice devices.

                                       1 = Function keys.
                                       2 = Function keys + keypad.

                43      stringdevs    Number of string devices.

                                       1 = Keyboard.

                44      wstype        Workstation type.

                                       0 = Output only
                                       1 = Input only
                                       2 = Input/Output
                                       3 = Metafile

                45      minwchar      Minimum character width in pixels.

                46      minhchar      Minimum character height in pixels.

                47      maxwchar      Maximum character width in pixels.

                48      maxhchar      Maximum character height in pixels.

                49      minwline      Minimum line width.

                50      zero5         Reserved (0).

                51      maxwline      Maximum line width.

                52      zero7         Reserved (0).

                53      minwmark      Minimum marker width.

                54      minhmark      Minimum marker height.

                55      maxwmark      Maximum marker width.

                56      maxhmark      Maximum marker height.

Binding       WORD i;

              contrl[0] = 100;
              contrl[1] = 0;
              contrl[3] = 11;
              contrl[6] = *handle;

              for(i = 0;i < 11;i++)
               intin[i] = work_in[i];

              vdi();

              *handle = contrl[6];

              for(i = 0;i < 45;i++)
               work_out[i] = intout[i];

              for(i = 0;i < 13;i++)
               work_out[45+i] = intout[i];

Caveats       The VDI included with TOS versions less than 2.06 sometimes
              returned the same handle for consecutive calls using the same
              physical handle.

Comments      Using multiple virtual workstations provides the benefit of
              being able to define multiple sets of default line types,
              text faces, etc... without having to constantly set them. The
              VDI_Workstation structure method is the recommended method of
              using this function. See the VDI entry for V_Opnwk() and
              V_Opnvwk(). Desk accessories running under TOS versions below
              1.4 should not leave a workstation open across any call which
              might surrender control to GEM (evnt_button(), evnt_multi(),
              etc... ). This could give GEM time to change screen
              resolutions and TOS versions below 1.4 did not release memory
              allocated by a desk accessory (including workstations) when
              a resolution change occurred.

See Also      v_opnwk(), vq_extnd(), v_clsvwk(), V_Opnvwk()

Group         VDI Workstation