function [ options, devices, extensions, classes, colorDevs, destinations, descriptions] = tables( pj )
%TABLES Method to create cell arrays of data on drivers and options available.
%   Tables are for use in input validation of arguments to PRINT command.
%
%   See also PRINT

%   Copyright (c) 1984-98 by The MathWorks, Inc.
%   $Revision: 1.2 $  $Date: 1998/06/26 21:07:06 $

if nargin ~= 1 | ~isa(pj,'printjob')
    error('Requires PrintJob object')
end

% List of all supported devices used for input validation.
%
%The first column contains the device name
%the second column contains the default filename extension, 
%the third column indicates what type of output device is employed, 
%the fourth indicates Monochrome or Color device, and
%the last is what do do with output for that driver, P for print or X for export
%
device_table = [
    %Postscript device options
    {'ps'           'ps'   'PS'   'M'    'P'  ''}
    {'psc'          'ps'   'PS'   'C'    'P'  ''}
    {'ps2'          'ps'   'PS'   'M'    'P'  ''}
    {'ps2c'         'ps'   'PS'   'C'    'P'  ''}
    {'psc2'         'ps'   'PS'   'C'    'P'  ''}
    {'eps'          'eps'  'EP'   'M'    'X'  'EPS file'}
    {'epsc'         'eps'  'EP'   'C'    'X'  'EPS Color file'}
    {'eps2'         'eps'  'EP'   'M'    'X'  'EPS Level 2 file'}
    {'eps2c'        'eps'  'EP'   'C'    'X'  ''}
    {'epsc2'        'eps'  'EP'   'C'    'X'  'EPS Level 2 Color file'}
    
    %Other built-in device options
    {'hpgl'              'hgl'  'BI'   'C'    'P'  ''}
    {'ill'               'ai'   'BI'   'C'    'X'  'Adobe Illustrator file'}
    {'mfile'             ''     'BI'   'C'    'X'  ''}
    {'jpeg'              'jpg'  'IM'   'C'    'X'  'JPEG image'}
    {'tiff'              'tif'  'IM'   'C'    'X'  'TIFF image'}
    {'tiffnocompression' 'tif'  'IM'   'C'    'X'  'TIFF no compression image'}
    {'bmp'               'bmp'  'IM'   'C'    'X'  ''}
    {'hdf'               'hdf'  'IM'   'C'    'X'  ''}
    {'png'               'png'  'IM'   'C'    'X'  'Portable Network Graphics file'}
 ];


%GhostScript device options
device_table = [ device_table ; 
    {'laserjet'     'jet'  'GS'   'M'    'P'  ''}
    {'ljetplus'     'jet'  'GS'   'M'    'P'  ''}
    {'ljet2p'       'jet'  'GS'   'M'    'P'  ''}
    {'ljet3'        'jet'  'GS'   'M'    'P'  ''}
    {'cdeskjet'     'jet'  'GS'   'C'    'P'  ''}
    {'cdjcolor'     'jet'  'GS'   'C'    'P'  ''}
    {'cdjmono'      'jet'  'GS'   'M'    'P'  ''}
    {'deskjet'      'jet'  'GS'   'M'    'P'  ''}
    {'cdj550'       'jet'  'GS'   'C'    'P'  ''}
    {'djet500'      'jet'  'GS'   'M'    'P'  ''}
    {'paintjet'     'jet'  'GS'   'C'    'P'  ''}
    {'pjetxl'       'jet'  'GS'   'C'    'P'  ''}
    {'pjxl'         'jet'  'GS'   'C'    'P'  ''}
    {'pjxl300'      'jet'  'GS'   'C'    'P'  ''}
    {'cdj500'       'jet'  'GS'   'C'    'P'  ''}
    {'dnj650c'      'jet'  'GS'   'C'    'P'  ''}
    {'bj10e'        'jet'  'GS'   'M'    'P'  ''}
    {'bj200'        'jet'  'GS'   'C'    'P'  ''}
    {'bjc600'       'jet'  'GS'   'C'    'P'  ''}
    {'epson'        'ep'   'GS'   'M'    'P'  ''}
    {'epsonc'       'ep'   'GS'   'C'    'P'  ''}
    {'eps9high'     'ep'   'GS'   'M'    'P'  ''}
    {'ibmpro'       'ibm'  'GS'   'M'    'P'  ''}
    {'ln03'         'ln3'  'GS'   'M'    'P'  ''}
    {'pcxmono'      'pcx'  'GS'   'M'    'X'  ''}
    {'pcx16'        'pcx'  'GS'   'C'    'X'  ''}
    {'pcx256'       'pcx'  'GS'   'C'    'X'  ''}
    {'pcx24b'       'pcx'  'GS'   'C'    'X'  'Paintbrush 24-bit file'}
    {'bmp16m'       'bmp'  'GS'   'C'    'X'  ''}
    {'bmp256'       'bmp'  'GS'   'C'    'X'  ''}
    {'pbm'          'pbm'  'GS'   'C'    'X'  'Portable Bitmap file'}
    {'pbmraw'       'pbm'  'GS'   'C'    'X'  ''}
    {'pgm'          'pgm'  'GS'   'C'    'X'  'Portable Graymap file'}
    {'pgmraw'       'pgm'  'GS'   'C'    'X'  ''}
    {'ppm'          'ppm'  'GS'   'C'    'X'  'Portable Pixmap file'}
    {'ppmraw'       'ppm'  'GS'   'C'    'X'  ''}
    {'sgirgb'       'sgi'  'GS'   'C'    'X'  ''}
    {'tifflzw'      'tif'  'GS'   'C'    'X'  ''} %Can we get it working everywhere?
    {'tiffpack'     'tif'  'GS'   'C'    'X'  ''} %ditto
];

if strcmp( computer, 'PCWIN' )
    platform_device_table = [
        {'win'      ''      'MW'    'M'    'P'  ''}
        {'winc'     ''      'MW'    'C'    'P'  ''}
        {'meta'     'emf'   'MW'    'C'    'X'  'Enhanced metafile'}
        {'bitmap'   'bmp'   'MW'    'C'    'X'  'Bitmap file'}
        {'setup'    ''      'MW'    'M'    ''   ''}
    ];
    
else %Unix
    %no Unix specific Ghostscript devices
    platform_device_table = {};
end

device_table = [ platform_device_table ; device_table ];

%Set them in table as cell arrays of cell arrays for convience of entry,
%now break them up into individual cell arrays for ease of use.
devices = device_table(:, 1 );
extensions = device_table(:, 2 );
classes = device_table(:, 3 );
colorDevs = device_table(:, 4 );
destinations = device_table(:, 5 );
descriptions = device_table(:, 6 );

%
% Set up print options table
%
options = { 
    'loose'
    'tiff'
    'append'
    'adobecset'
    'cmyk'
    'r'
    'noui'
    'painters'
    'zbuffer'
    'DEBUG'    %Undocumented, prints out diagnostic information
};

if strcmp( computer, 'PCWIN' )
    platform_options = { 'v' };
    
else %must be unix
    platform_options = {};
end

options = [ options ; platform_options ];
