2 |
File Format .ag |
Anyware shares the same Applixware file formats.
This chapter describes the generic ASCII file format of all Version 4.3, 4.4 and 5.0 Applixware documents and the Applixware Graphics internal file format.
The following topics are described:
· tokens
· syntax
· file format
· future considerations
The Applixware Graphics file format is an ASCII, token-based format, with a maximum line length of 255 characters. The six different token classes are:
COMMENT: COMMENTs begin with the character '#' and continue to the end of the line. COMMENTs are bound to the object which follows or contains them. COMMENTs can be found anywhere in the document, and should not interfere with document parsing.
BASE: BASE tokens consist of a sequence of characters, starting with an letter from A to Z. Case is ignored, with material converted to uppercase before parsing. Valid characters are letters from A to Z, numbers, '*', '-', or '_'. Other characters will terminate the token.
STRING: STRINGS are typically delimited by '"'. a '\' is used as an escape character, and characters outside the range of 32 to 126 will be escaped and their ASCII code will be used instead (7BIT encoding only). '"' characters are escaped, as are newlines and '\' (\", \n, and \\ respectively). Strings that exceed one line in length are "wrapped" by inserting a newline and a space in the character stream. These 2 characters should be ignored while parsing. Case is preserved for STRING tokens.
NUMBER: NUMBER tokens are a sequence of digits, optionally preceded by a '+' or a '-'. A non-digit or a non-decimal terminates the number. Only one decimal is allowed per number.
META: A META token is like a BASE token, whose value is defined by the Applixware file format beyond the context of the Graphics file format. META tokens begin with a '*' and are expected to be located after a newline (or at the start of the file).
RASTER: RASTER data has a width and height, specified in pixels. It also has a depth. Depth 1 images use the default colormap and have 1 bit per pixel. Color images must have a colormap, and have 8 bits per pixel. RASTER material is encoded in HEX (4 bits per character) or BIT6 (6 bits per character) format, and may be compressed (run-length or LZW). RASTER tokens are unique in that all the information regarding the RASTER must be parsed before the RASTER itself may be parsed.
The Applixware RASTER is organized in a very traditional manner. Each horizontal "scanline" of an image is composed of an even number of 8-bit bytes running from left to right. The MSB of each byte is displayed to the left of its LSB. A sequence of scanlines, running from its top to its bottom form the complete image. Each scanline is represented by a string of ASCII characters. The ASCII string represents a series of bytes. Newline characters are ignored, but due to mail and buffering constraints should be used to break the data into manageable lines. After any newline is inserted, a space character should also be inserted. This space will also be ignored while parsing the RASTER. Each scanline must be terminated with a '.' (period). If a scanline is terminated early with a '.', then the rest of the scanline is assumed to contain zeros. If the scanline presents more data than can fit in a scanline (it's width), then the excess data is ignored. As a result, here should be height periods in the RASTER.
RASTER material is compressed before it is encoded and written into the file. The compression formats are NONE, RUN-LENGTH, or LZW. If the compression is NONE, the data is encoded in it's raw format. RUN-LENGTH encoding uses the following standard technique:
RASTER encoding takes two forms: HEX or BIT6. HEX encoding represents RASTER data bytes as pairs of ASCII hex characters (0123456789ABCDEF). Using HEX encoding, an uncompressed 512 x 512 raster uses approximately 65535 hexadecimal characters. BIT6 encoding stores 6 bits of the RASTER data in each character. It uses the ASCII characters '0' through 'o'. Using BIT6 encoding, the same 512 x 512 RASTER uses approximately 43691 characters. The following demonstrate the encoding and decoding process:
write_byte_hex(datum)
int datum;
{
char outchar;
/* Finish the scanline */
if ( datum < 0 ) {
fputc('.', outfile);
return;
}
/* High Nibble */
outchar = (datum >> 4) & 0xF;
if (9 < outchar)
outchar += 7;
fputc('0' + outchar, outfile);
/* Low Nibble */
outchar = datum & 0xF;
if ( 9 < outchar )
outchar += 7;
fputc('0' + outchar, outfile);
}
write_byte_bit6 (datum)
int datum;
{
static char bits_used = 0;
static char outchar = 0;
/* Finish the scanline */
if ( datum < 0 ) {
if (bits_used) {
fputc('0' + outchar, outfile);
outchar = bits_used = 0;
}
fputc('.', outfile);
return;
}
/* Complete last character */
bits_used += 2;
outchar |= (datum >> bits_used) & 0x3F;
fputc('0' + outchar, outfile);
outchar = 0;
/* Form next character */
outchar = datum << 6 - bits_used) & 0x3F;
if ( bits_used == 6 ) {
fputc('0' + outchar, outfile);
outchar = bits_used = 0;
}
}
sixbit_to_byte()
{
static char bits_used, inchar;
char result;
int ch;
do {
ch = fgetc(infile);
} while ((ch == ' ') || (ch == '\n'));
if (ch == '.') {
bits_used = 0;
return (-1);
}
ch = (ch - '0') & 0x3F;
switch (bits_used) {
case 0:
inchar = ch << 2;
do {
ch = fgetc(infile);
} while ((ch == ' ') || (ch == '\n'));
ch = (ch - '0') & 0x3F;
inchar |= ch >> 4;
result = inchar;
inchar = ch << 4;
bits_used = 4;
break;
case 2:
inchar |= ch;
result = inchar;
inchar = ch << 8;
bits_used = 0;
break;
case 4:
inchar |= ch >> 2;
result = inchar;
inchar = ch << 6;
bits_used = 2;
break;
}
return (result & 0xFF);
}
Only the above sequences are valid for generating tokens. All other character sequences are ignored, and are treated as delimiters. Common delimiters are ' ', '(', ')', and','.
The following conventions are used in this document:
NOTE: Order is important for graphic_material
Graphics_file :=file_header
graphic_material
file_footer
file_header :=*BEGIN
GRAPHICS VERSION=revnum
ENCODING=encoding
comments
hooks
links
insets
revnum := current
revnum/minimum revnum
current revnum = 440 or 500
minimum revnum = 420
encoding :=7BIT
(encode non-ascii characters) or NONE
(raw)
comments :=[** "comment_name" comment_content]
[...]
comment_name :=STRING (bounded with quotes)
comment_content :=STRING
(terminated by the end of the
line)
hooks :=[*HOOK hook_type hook_name]
[...]
hook_type :=STRING (no spaces allowed)
hook_name :=STRING (no spaces allowed)
links :=[*LINK link_pathname]
[...]
link_pathname :=STRING (terminated by the end of the line)
insets :=[*BEGIN
inset_type
inset_material
*END inset_type]
[...]
inset_type :=WORDS
| GRAPHICS | SPREADSHEETS |
EQUATIONS |ASCII | BINARY
inset_material :=depends on type of inset
graphic_material := colormap_segment
font_segment
callback_segment
fill_segment
grad_segment
style_segment
hdrftr_segment
session_segment
slide_master_segment
handout_master_segment
outline_master_segment
notes_master_segment
chart_segment
part_segment
pages_segment
file_footer :=*END GRAPHICS
colormap_segment :=[COLORMAP
colormap_material
[...]
END COLORMAP]
[...]
colormap_material :=<"color_name"
ink_type cyan magenta
yellow black see_thru>
color_name :=STRING (bounded by quotes)
ink_type :=0 (process color) or 1 (spot color)
cyan :=NUMBER
from 0 to 255 (0 indicating no color,
255 indicating max color)
magenta :=NUMBER
from 0 to 255 (0 indicating no color,
255 indicating max color)
yellow :=NUMBER
from 0 to 255 (0 indicating no color,
255 indicating max color)
black :=NUMBER
from 0 to 255 (0 indicating no color,
255 indicating max color)
see_thru :=0 (opaque) or 1 (transparent)
Documents contain at leaset 1 colormap, plus an additional colormap for each color image. If the file does not contain a colormap_segment, a single default colormap is assumed. The default colormap is:
COLORMAP
<"Transparent" 0 0 0 0 0 1>
<"Black" 0 0 0 0 255 0>
<"White" 0 0 0 0 0 0>
<"Grey 95" 0 0 0 0 13 0>
<"Grey 87" 0 0 0 0 33 0>
<"Grey 75" 0 0 0 0 64 0>
<"Grey 50" 0 0 0 0 128 0>
<"Red" 0 0 255 255 0 0>
<"Red 95" 0 13 255 255 0 0>
<"Red 87" 0 33 255 255 0 0>
<"Red 75" 0 64 255 255 0 0>
<"Red 50" 0 128 255 255 0 0>
<"Green" 0 255 0 255 0 0>
<"Green 95" 0 255 13 255 0 0>
<"Green 87" 0 255 33 255 0 0>
<"Green 75" 0 255 64 255 0 0>
<"Green 50" 0 255 128 255 0 0>
<"Blue" 0 255 255 0 0 0>
<"Blue 95" 0 255 255 13 0 0>
<"Blue 87" 0 255 255 33 0 0>
<"Blue 75" 0 255 255 64 0 0>
<"Blue 50" 0 255 255 128 0 0>
<"Yellow" 0 0 0 255 0 0>
<"Yellow 95" 0 0 0 255 13 0>
<"Yellow 87" 0 0 0 255 33 0>
<"Yellow 75" 0 0 0 255 64 0>
<"Yellow 50" 0 0 0 255 128 0>
<"Magenta" 0 0 255 0 0 0>
<"Magenta 95" 0 0 255 0 13 0>
<"Magenta 87" 0 0 255 0 33 0>
<"Magenta 75" 0 0 255 0 64 0>
<"Magenta 50" 0 0 255 0 128 0>
<"Cyan" 0 255 0 0 0 0>
<"Cyan 95" 0 255 0 0 13 0>
<"Cyan 87" 0 255 0 0 33 0>
<"Cyan 75" 0 255 0 0 64 0>
<"Cyan 50" 0 255 0 0 128 0>
<"Tan" 0 0 57 131 0 0>
<"Clay" 0 0 74 74 57 0>
<"Brown" 0 30 100 220 30 0>
<"Dark Brown" 0 60 135 190 65 0>
<"Olive" 0 90 65 190 65 0>
<"Light Orange" 0 0 33 255 0 0>
<"Orange" 0 0 90 255 0 0>
<"Dark Orange" 0 0 132 255 0 0>
<"Light Purple" 0 31 153 0 0 0>
<"Purple" 0 80 208 0 15 0>
<"Dark Purple" 0 25 126 0 44 0>
END COLORMAP
Documents containing color images must have fully described colormap information. A Graphics_file with color images and no colormap_segments is an invalid file.
font_segment := [FONTS
font_material
[...]
END FONTS]
font_material := STRING (bounded by quotes)
Documents contain one font list. If the Graphics_file does not contain a font_segment, a default one is assumed. The default font_segment is:
FONT
"Times"
END FONT
callback_segment :=[CBACK
callback_material
[...]
END CBACK]
callback_material :=MACRO
<macros_name use_handle
use_position>["arg"
[...]]
macro_name :=STRING
(contains no spaces, the name of a
macro)
use_handle := 0
(pass the object handle to the macro) or 1
(don't pass the handle)
use_position :=0
(pass the object position to the macro) or 1
(don't pass the position)
arg := STRING (bounded by quotes, passed to the macro)
fill_segment :=[FILLNAMES
fill_material
[...]
END FILLNAMES]
fill_material :=<"fill_name"
height width colormap_index
raster_ecoding>
raster_data
fill_name :=STRING (bounded by quotes)
height :=height of the raster in pixels
width :=width of the raster in pixels
colormap_index :=0
(1 bit per pixel) or NUMBER greater than 0
(colormap index, 8 bits per pixel)
raster_encoding := 0 (hex) or 1 (bit 6)
raster_data := RASTER
NOTE: raster_data in fill_segment is never compressed.
grad_segment :=[GRAD
grad_material
[...]
END GRAD]
grad_material :=<"grad_name" grad_type angle x_off y_off>
grad_name :=STRING (bounded by quotes)
grad_type :=type
of gradient - 0 (linear gradient)
1 (radial gradient)
2 (rectangular gradient )
3 ( bilinear gradient)
x_off :=Offset in horizontal direction in percentage
y_off :=Offset in vertical direction in percentage
style_segment := [STYS "style_name"
attribute_material
END STYS]
[...]
style_name := STRING (bounded by quotes).
attribute_material :=[STYS style_index]
[COLORMAP colormap_index]
[BACKFILL fill_pattern_material]
[LINEFILL fill_pattern_material]
[SHADOW shadow_material]
[THICKNESS line_thickness]
[STYLE line_style_index]
[L_ARROW arrow_index]
[R_ARROW arrow_index]
[MARKER marker_index]
[PARA para_material]
[V_SPACE space_material]
[FONT font_index]
[SIZE font_size]
[UNDERLINE underline_index]
[THRU ON|OFF]
[BOLD ON|OFF]
[ITALICS ON|OFF]
[XYOFFS xyoffs_material]
[SUBSUP subsup_material]
[HOR_JUST LEFT|CENTER|RIGHT|JUSTIFIED]
[VER_JUST TOP|BASELINE|BOTTOM|JUSTIFIED]
[LINE_SPACE line_space_size]
[MARGINS margin_material]
[SCALE scale_numerator]
[SHEAR shear_numerator]
[ANGLE angle_material]
[FLD_XYSCALE <scale_numerator scale_numerator]
[SHR_ANG <shear_numerator angle_material]
style_index :=NUMBER indicating style in style list.
colormap_index :=NUMBER indicating colormap in colormap list.
fill_pattern_material :=<fg_color
bg_color fill_type fill_id
angle_material x_offset y_offset>
fg_color :=NUMBER
indicating foreground color in current
colormap
bg_color :=NUMBER
indicating background color in current
colormap
fill_type :=0
(built-in fill) | 1 (user defined fill) | 2 (linear
gradient) | 3 (radial gradient) | 4 (rectangular
gradient) | 5 (percentage/greyscale) | 6
(custom gradient)
fill_id :=if
fill_type is 0, id is NUMBER from 0 to 25
if fill_type is 1, id is NUMBER indicating fill in fill_list
if fill_type is 5, id is NUMBER from 0 to 1000
indicating tenths of percent of fg_color used in
"solid" fill
if fill_type is 6, id is NUMBER indicating gradient in
grad_list
angle_material :=NUMBER
indicating angle in ten thousandths of a
degree
x_offset :=NUMBER indicating x offset in dots
y_offset :=NUMBER indicating y offset in dots
shadow_material :=<fg_color
shadow_index x_offset
y_offset>
shadow_index :=0
(no shadow) | 1 (local drop shadow) | 2
(background drop shadow) | 3 (backgound emboss
shadow) | 4 (local emboss shadow)
line_thickness :=NUMBER indicating thickness of line in dots
line_style_index :=0
(solid) | 1 (dashed) | 2 (fat dotted) | 3 (dot dash)
| 4 (dotted) |5 (dot dot dash) | 6 (long dash)
arrow_index :=NUMBER indicating arrow in arrow list
marker_index :=NUMBER indicating marker in marker list
para_material :=
<left_indent left_indent2 right_indent
bullet bullet_scale bullet_color
bullet_font bullet glyph>
left_indent := NUMBER indicating first left indent
left_indent2 := NUMBER indicating second left indent
right_indent := NUMBER indicationg right indent
use_bullet := 0 (don`t use bullet) 1 (use bullet)
bullet_scale := NUMBER indicationg bullet scale value
bullet_font := NUMBER indicating font in font list
bullet_glyph :=NUMBER indicationg the ascii character
space_material :=<s_above s_inside s_below>
s_above := NUMBER indicating space above a paragraph
s_inside := NUMBER indicationg space between paragrph
s_below := NUMBER indicating space below a paragraph
font_index :=NUMBER indicating font in font list
font_size :=NUMBER
indicating font size in ten thousandths
of a point
underline_index :=0
(none) | 1 (single underline) | 2 (double
underline)
xyoff_material :=<x_offset y_offset>
subsup_material :=<x_offset y_offset>
line_space_size :=NUMBER indicating line spacing in points
margin_material :=<l_marg r_marg t_marg b_marg>
l_marg :=NUMBER indicating left text field margin in dots
r_marg :=NUMBER indicating right text field margin in dots
t_marg :=NUMBER indicating top text field margin in dots
b_marg := NUMBER indicating bottom text field margin in dots
scale_numerator :=NUMBER
when divided by 10000
indicates scale factor
shear_numerator :=NUMBER
when divided by 10000
indicates shear factor
Attribute_material is sparce in the file. The file maintains a current set of attributes, so if an attribute is left unspecified, the current (i.e. last-used) values will be applied. The default attribute assumed is:
COLORMAP 0
STYS 0
BACKFILL <1 0 0 0 0 0 0>
LINEFILL <1 2 5 1000 0 0 0>
SHADOW <6 0 15 15>
THICKNESS 1
STYLE 0
L_ARROW 0
R_ARROW 0
MARKER 0
PARA <0 0 0 0 1000 1 0 111>
V_SPACE <0 250 0>
FONT 0
SIZE 180000
UNDERLINE 0
THRU OFF
BOLD OFF
ITALIC OFF
XYOFFS <0 0>
SUBSUP <0 0>
HOR_JUST LEFT
VER_JUST BASELINE
LINE_SPACE 18
MARGINS <125 125 250 62>
SCALE 10000
SHEAR 0
ANGLE 0
FLD_XYSCALE <10000 10000>
SHR_ANG <0 0>
hdrftr_segment :=[HDRFTR
hdtftr_material
END HDRFTR]
hdrftr_material :=[USE FIRST]
[USE EVENODD]
[USE FINAL]
[FIRST
hdrftr_page_material
END FIRST]
[BASE
hdrftr_page_material
END BASE]
[EVEN
hdrftr_page_material
END EVEN]
[FINAL
hdrftr_page_material
END FINAL]
hdrftr_page_material :=hdr_page_material ftr_page_material
hdr_page_material :=HEADER
OFFSET x_offset
NLINES NUMBER
(indicating number of
lines in header)
hdrftr_line_material [...]
END HEADER
ftr_page_material :=FOOTER
OFFSET x_offset
NLINES NUMBER
(indicating number of
lines in footer)
hdrftr_line_material [...]
END FOOTER
hdrftr_line_material :=INNER
hdrftr_string
END INNER
CENTER
hdrftr_string
END CENTER
OUTER
hdrftr_string
END OUTER
hdrftr_string :=TEXT STRING (bounded by quotes)
FONT font_index
FORE_COLOR fg_color
BOLD ON|OFF
ITALICS ON|OFF
THRU ON|OFF
UNDERLINE underline_index
WORDSONLY ON|OFF
session_segment :=[SESSION
session_material
END SESSION]
session_material :=[WIN_SIZE window_size]
[STICKY ON|OFF]
[AUTOGRID ON|OFF]
[VIEW view_material]
[IMAGE_FMT image_format]
[GRID_DPI NUMBER (dots per inch)]
[GRID_FACTOR NUMBER (dots per grid)]
[UNITS unit_material]
[L_WITDTHS l_width_material]
[PAGEXY page_position]
[PAGEZEROS page_position]
[PAGEWID
NUMBER (width of printable
area in dots)]
[PAGEHYT
NUMBER (height of printable
area in dots)]
[PRINTWID
NUMBER (width of output
paper in dots)]
[PRINTHYT
NUMBER (height of output
paper in dots)]
[PRINTLAND ON|OFF]
[PRINTMARG paper_margins]
[PRINTMARKS print_marks]
[PRINTBLEED
NUMBER (bleed area in
dots)]
[NPAGEXY page_position]
[NPAGEZEROS page_position]
[NPAGEWID
NUMBER (width of printable
area in dots)]
[NPAGEHYT
NUMBER (height of printable
area in dots)]
[NPRINTWID NUMBER (width of output
paper in dots)]
[NPRINTHYT
NUMBER (height of output
paper in dots)]
[NPRINTLAND ON|OFF]
[NPRINTMARG paper_margins]
[NPRINTMARKS print_marks]
[NPRINTBLEED
NUMBER (bleed area in
dots)]
[HPAGEXY page_position]
[HPAGEZEROS page_position]
[HPAGEWID
NUMBER (width of printable
area in dots)]
[HPAGEHYT
NUMBER (height of printable
area in dots)]
[HPRINTWID NUMBER (width of output
paper in dots)]
[HPRINTHYT
NUMBER (height of output
paper in dots)]
[HPRINTLAND ON|OFF]
[HPRINTMARG paper_margins]
[HPRINTMARKS print_marks]
[HPRINTBLEED
NUMBER (bleed area in
dots)]
[OPAGEXY page_position]
[OPAGEZEROS page_position]
[OPAGEWID
NUMBER (width of printable
area in dots)]
[OPAGEHYT
NUMBER (height of printable
area in dots)]
[OPRINTWID NUMBER (width of output
paper in dots)]
[OPRINTHYT
NUMBER (height of output
paper in dots)]
[OPRINTLAND ON|OFF]
[OPRINTMARG paper_margins]
[OPRINTMARKS print_marks]
[OPRINTBLEED
NUMBER (bleed area in
dots)]
[SLIDE_SHOW slide_show_nfo]
[SLIDE_CYCLE ]
[SLIDE_STYLE slide_style_info]
[CURRENT_PAGE current_page_info]
[attribute_material]
[RUN_MACRO
run_macro_info]
[REZ zoom_nfo]
window_size :=<NUMBER
(window width in dots) NUMBER
(window height in dots)>
view_material :=<ruler_flag page_flag readout_flag grid_flag>
ruler_flag :=0 (rulers off) | 1 (rulers on)
page_flag :=0 (display page breaks off) | 1 ( page breaks on)
readout_flag :=0 (coordinate readout off) | 1 (readout on)
grid_flag :=0 (grids off) | 1 (grids on)
image_format :=3
(raw hex) | 2 (compressed hex) | 1 (raw bit6) | 0
(compressed bit6)
unit_material :=<unit_size unit_precision unit_name>
unit_size :=NUMBER (dots per unit)
unit_precision :=NUMBER (post zero radix places)
unit_name :=STRING
l_width_material:=<custom_line custom_line custom_line>
custom_line :=NUMBER
(line width associated with line buttons
on palette, in dots)
page_position :=<NUMBER
(x position in dots) NUMBER (y
position in dots)>
paper_margins :=<margin_x1 margin_y1 margin_x2 margin_y2>
margin_x1 :=NUMBER (left margin in dots)
margin_y1 :=NUMBER (top margin in dots)
margin_x2 :=NUMBER (right margin in dots)
margin_y2 :=NUMBER (bottom margin in dots)
print_marks :=<border_flag crop_flag regis_flag>
border_flag :=0 (don't print content border) | 1 (print border)
crop_flag :=0 (don't print crop marks) | 1 (print crop marks)
regis_flag :=0
(don't print registration marks) | 1 (print
registration marks)
slide_show_info :=<full_screen all_pages page1 pageN end>
full_screen :=0 (no full screen) | 1 (full_screen)
all_pages :=0 (no all_pages) | 1 (all_pages)
page1 :=NUMBER (starting page no)
pageN :=NUMBER (Ending page no)
end :=0 (wait) | 1 (restart) | 2 (exit)
NOTE: if all pages is set page1 and pageN is ignored.
slide_style_info :=<slide_effect slide_delay slide_throttle>
slide_effect := type of transistion
slide_delay :=NUMBER
(delay in seconds)
-1 (advance on mouse click
slide_throttle := Number indicating speed of transistion
current_page_info:=NUMBER(page number to open )
zoom_info :=<zoom_to_fit x_zoom y_zoom x y>
zoom_to_fitt :=0 (open at saved zoom) | 1 (open zoomed to fit)
x_zoom :=NUMBER (zoom in x direction)
y_zoom :=NUMBER (zoom in y direction)
x :=NUMBER (window origin)
y :=NUMBER (window origin)
The session_segment has a default value. Tokens in the session_segment of a file modify these default values, which are:
STICKY OFF
AUTOGRID OFF
VIEW <0 0 0 0>
IMAGE_FMT 0
GRID_DPI 1000
GRID_FACTOR 250
UNITS <1000 3 "in.">
L_WITDTHS <28 42 56>
PAGEXY <0 0>
PAGEZEROS <500 1000>
PAGEWID 8500
PAGEHYT 11000
PRINTWID 8500
PRINTHYT 11000
PRINTLAND OFF
PRINTMARG <500 1000 500 1000>
PRINTMARKS <0 0 0>
PRINTBLEED 0
NPAGEXY <0 0>
NPAGEZEROS <500 1000>
NPAGEWID 8500
NPAGEHYT 11000
NPRINTWID 8500
NPRINTHYT 11000
NPRINTLAND OFF
NPRINTMARG <500 1000 500 1000>
NPRINTMARKS <0 0 0>
NPRINTBLEED 0
HPAGEXY <0 0>
HPAGEZEROS <500 1000>
HPAGEWID 8500
HPAGEHYT 11000
HPRINTWID 8500
HPRINTHYT 11000
HPRINTLAND OFF
HPRINTMARG <500 1000 500 1000>
HPRINTMARKS <0 0 0>
HPRINTBLEED 0
OPAGEXY <0 0>
OPAGEZEROS <500 1000>
OPAGEWID 8500
OPAGEHYT 11000
OPRINTWID 8500
OPRINTHYT 11000
OPRINTLAND OFF
OPRINTMARG <500 1000 500 1000>
OPRINTMARKS <0 0 0>
OPRINTBLEED 0
SLIDE_SHOW
<1 1 1 1 0>
SLIDE_STYLE <0 5 1>
CURRENT_PAGE 0
layer_segment :=[LAYERS
layer_material
[...]
END LAYERS]
layer_material :=<"layer_name"
locked_flag hidden_flag
prints_flag background_flag>
layer_name :=STRING (bounded by quotes)
locked_flag :=0 (not locked) or 1 (locked)
hidden_flag := 0 (not hidden) or 1 (hidden)
prints_flag :=0 (doesn't print) or 1 (prints)
background_flag :=0 ( layer not a template) or 1 (layer is a template)
Documents contain one layer list. If the Graphics_file does not contain a layer_segment, a default one is assumed. The default layer_segment is:
LAYERS
<"Default" 0 0 1 0>
END LAYERS
slide_master_segment :=[SLIDE_MASTER
slide_master_material
END SLIDE_MASTER]
slide_master_material :=[ S_EXT1 slide_heading]
[T_ATTR0
attribute_material
END T_ATTR0]
[T_ATTR1
attribute_material
END T_ATTR1]
[S_ATTR0
attribute_material
END S_ATTR0]
[S_ATTR1
attribute_material
END S_ATTR1]
[S_ATTR2
attribute_material
END S_ATTR2]
[S_ATTR3
attribute_material
END S_ATTR3]
[S_ATTR4
attribute_material
END S_ATTR4]
[S_ATTR5
attribute_material
END S_ATTR5]
[slide_info_segment]
[layer_segment]
[thing_segment]
handout_master_segment :=[HANDOUT_MASTER
handout_master_material
END HANDOUT_MASTER]
handout_master_material
:=[slide_info_segment]
[layer_segment]
[thing_segment]
outline_master_segment :=[OUTLINE_MASTER
outline_master_material
END OUTLINE_MASTER]
outline_master_material
:=[slide_info_segment]
[ layer_segment]
[thing_segment]
notes_master_segment :=[NOTES_MASTER
notes_master_material
END NOTES_MASTER]
notes_master_material :=[
N_EXT1 slide_heading]
[N_ATTR0
attribute_material
END N_ATTR0]
[N_ATTR1
attribute_material
END N_ATTR1]
[N_ATTR2
attribute_material
END N_ATTR2]
[N_ATTR3
attribute_material
END N_ATTR3]
[N_ATTR4
attribute_material
END N_ATTR4]
[N_ATTR5
attribute_material
END N_ATTR5]
[slide_info_segment]
[ layer_segment]
[thing_segment]
chart_segment :=[CHART chart_name
chart_material
END CHART]
[...]
chart_name :=STRING (bounded by quotes)
chart_material :=TYPE type_material
[TITLE STRING (bounded by quotes)]
[SUBTITLE STRING (bounded by quotes)]
[FOOT STRING (bounded by quotes)]
TITLE_ALIGN talign_material
CLOSE close_material
GRIDS grids_material
OFFSET offset_material
EXTENT extent_material
MARGIN margin_material
CHART_COUNTS count_material
[NULL_FMT PLOT| SUBS | SPAN | GAP)]
THREE_D three_d_material
CHART_INFO cinfo_material
MISC_CHART_INFO <0 (no redraw) |1 (redraw)>
[ROW_DAT row_data_material ]
[...]
[SH_ARR sh_arr_material ]
[..]
COLUMNS column material
[X_AXIS STRING
axis_material
END X_AXIS]
[...]
[Y_AXIS STRING
axis_material
END Y_AXIS]
[...]
[Z_AXIS STRING
axis_material
END Z_AXIS]
[...]
[OLD_GRP old_grp_material]
[..]
[DATGROUP <STRING 0(enabled) | 1(disabled)>
group_material
END DATGROUP]
[...]
LEGEND STRING
legend_material
END LEGEND
DEFATR attribute_material
MAJHRZ attribute_material
MINHRZ attribute_material
MAJVRT attribute_material
MINVRT attribute_material
MAJDPT attribute_material
MINDPT attribute_material
TITLEATR attribute_material
SUBTITLEATR attribute_material
FOOTATR attribute_material
type_material :=<chart_type orientation old_orientation>
chart_type :=0
(percent) | 1 (cat-val) | 2 (val-val) | 3 (histo) | 4
(spider) | 5 (cat-val2)
orientation :=0 (horizontal) | 1 (vertical)
old_orientation := 0 (horizontal) | 1 (vertical)
talign_material :=<align_flag
(title) align_flag (subtitle)
align_flag(footer) expand_flag(title
expand_flag(subtitle) expand_flag(footer)>
align_flag :=0 (left) | 1 (center) | 2 (right)
expand_flag := 0 (FALSE) | 1 (TRUE)
close_material :=<close_flag
(top) close_flag (bottom)
close_flag(left) close_flag (right)
close_flag(background)
close_flag(foreground)>
close_flag :=0 (don't close) | 1 (close)
grids_material :=<gridflag(maj
horz) gridflag(min horz) gridflag(maj
vert) gridflag(min vert) gridflag(major-z)
gridflag(minor-z)>
gridflag :=0 (no grid displayed) | 1 (grid displayed)
offset_material :=
<offset-x(default) offset_y(default)
offset-x(title) offset_y(title)
offset-x(subtitle) offset_y(subtitle)
offset-x(footer) offset_y(footer) >
extent_material :=<NUMBER
NUMBER (x1 y1 in dots) NUMBER
NUMBER (x2 y2 in dots)>
margin_material :=<margin_x1 margin_y1 margin_x2 margin_y2>
count_material :=<n_x_axes
n_y_axes n_z_axes n_groups
chart_type (current rendering)>
n_x_axes :=NUMBER
(number of x axes at time of current
rendering)
n_y_axes :=NUMBER
(number of y axes at time of current
rendering)
n_z_axes :=NUMBER
(number of z axes at time of current
rendering)
n_groups :=NUMBER
(number of groups at time of current
rendering)
three_d_material :=<n_enable
o_enable n_pitch o_pitch
n_yaw o_yaw n_proj o_proj n_depth
o_depth >
n_enable := current state 0 (not enabled) 1 (enabled)
o_enable :=old_state 0 (not enabled) 1 (enabled)
n_pitch := NUMBER indicating current pitch( -90 to 90)
o_pitch := NUMBER indicating old pitch( -90 to 90)
n_yaw := NUMBER indicating current yaw( -90 to 90)
o_yaw := NUMBER indicating old yaw( -90 to 90)
n_proj := NUMBER indicating current proj( 0 to 100)
o_proj := NUMBER indicating old proj( 0 to 100)
n_depth := NUMBER indicating current depth( 0 to 100)
o_depth := NUMBER indicating old depth( 0 to 100)
cinfo_material :=<
stacked_strata bar_margin bar_overlap
start_angle def_type data_src_type
data_src_index >
stacked_strata := NUMBER
bar_margin := double {0...500%}
bar_overlap := double { -100% ... 100%}
start_angle := NUMBER /* Tenths of a degree */
def_type := NUMBER
data_src_type := NUMBER
data_src_index := NUMBER
row_data_material := <data1 data2 ..>
data1, data2 := STRING (bounded by quotes)
sh_arr_material :=
<part_name >
ARR <arra info >
ELEM element_name
part_name :=STRING (bounded by quotes)
element_name :=STRING (bounded by quotes)
array_info :=STRING (bounded by quotes)
column_material := size .. size
size :=Number indicating the column size
axis_material := TIK_TYPE tiik_type_material
TIK_ALIGN tik_align_material
AXIS_FORMAT axis_format_material
AXIS_MAJOR axis_major_material
AXIS_MINOR axis_minor_material
NUM_FMT numder_format_material
BAR_INFO bar_info_material
LABEL_FILTER 0 (no display) | 1( display all )
LABEL label_name
AXATTR attribute_material
AXTIKATTR attribute_material
AXLABATTR attribute_material
AXTIKLABATTR attribute_material
tik_type_material := <axis_type x_offset y_offset tik_margin>
axis_type := NUMBER
indicating axis type
cat_axis 0
val_axis 1
val_log_axis 2
log_axis 3
hst_axis 4
str_axis 5
x_off_set/y_offset := NUMBER
indicating position of next
axis of same type
tik_margin := NUMBER indicating margin between
tik and label
tik_align_material := <label_align tik_align tight_label tight_tiks>
label_align := NUMBER
indicating alignment
left 0
center 1
right 2
tik_align := NUMBER indicating alignment
tight_label := 0 | 1 /* used to position axis */
tight_tiks := 0 | 1 /* used to position axis */
axis_format_material
:= < hidden auto_max auto_min
auto_bas n_major_tiks
n_minor_tiks major_tik_fmt minor_tik_fmt
position pos_val min_val max_val
bas_val frst_delta invalid_tiks>
hidden := 0 ( not hidden) | 1(hidden)
auto_max, auto_min,
auto_bas := 0 (no auto) | 1 (auto )
n_major_tiks, n_minor_tiks := 0 ( don`t show tiks)
|
1 show tiks
major_tik_fmt,
minor_tik_fmt := enum { none, inside,
,outside, both}
position := enum {left, right, bot, top, h_val, v_val }
pos_val := double
min_val := double
max_val := double
bas_val := double
first_delta := double
invalid_tiks := enum {false, true}
axis_major_material
:= <maj_size n_maj_steps
maj_delta maj_steps>
maj_size := NUMBER
n_maj_steps := NUMBER
maj_delta := double
maj_steps := NUMBER
axis_minor_material
:= <min_size n_min_steps
min_delta min_steps>
min_size := NUMBER
n_min_steps := NUMBER
min_delta := double
min_steps := NUMBER
number_format_material
:= < id aux_id display_fmt_errs
trim_string units
n_radix_places prefix suffix
am pm true
false t_separator d_separator >
id := enum {
unstyled, currency, comma, fixed,
general, scientific, percentage, date, boolean,
graph, time, custom}
aux_id := enum
{date1, date2, date3, date4, date5, date6,
enum { time1, time2, time3, time4, time5, time6 }
enum { money1, money2 }
display_fmt_errs := 0 ( don`t display )| 1( display )
trim_string := NUMBER
units := Number /* scale factor def:1 */
n_radix_places := NUMBER /* def = 2 */
prefix := STRING (bounded by quotes)
suffix := STRING (bounded by quotes)
am, pm, true, false := STRING (bounded by quotes)
t_separator := ascii
d_separator := ascii
bar_info_material := <bar_margin bar_overlap>
bar_margin := double {0...500%}
bar_overlap := double { -100% ... 100%}
old_grp_material :=<n type stack_id stack_ax>
n := NUMBER
type :=
NUMBER indicating group type
LINE 0
CURVE 1
BAR 2
LEAGUE_BAR 3
CUSTOM_BAR 4
BUBBLE 5
HLCO1 6
STRATA 7
PIE 8
HLCO2 9
STACKED_BAR 10
STACKED_CBAR 11
STACKED_STRATA 12
HILO1 13
HILO2 14
TREND 15
HLCO3 16
HILO3 17
stack_id := NUMBER
stack_ax := NUMBER
group_material := LABEL label_name
DATATYPE data_type_material
TREND trend_material
AXES axes_material
NUM_FMT number_format_material
DATALABEL data_label_material
[DAT data_material]
[..]
GRPLABATTR attribute_material
GRPATTR attribute_material
data_type_material := <type stack_id part_name>
type := NUMBER
indicating group type
stack_id := NUMBER
part_name := String
trend_material :=
< type order r_suared
n_correlations correlation_vals>
type := enum {LINEAR, LOG10, POWER,
EXPONENT, POLYNOMIAL,
MOVING_AVERAGE}
order := integer {valid vals: 2,3,4,...12}
r_squared := double
n_correlations := integer
correlation_vals := double
Comments: This information is available only if data
group type is TREND. Also, correlation
vals must equal number of
correlations.
axes_material := <x_axis_id y_axis_id z_axis_id >
x_axis_id := integer
y_axis_id := integer
z_axis_id := integer
data_label_material := <label_type, x_offset, y_offset, align >
label_type := enum { none, value, percent string }
x_offset := integer /* in mils */
y_offset := integer /* in mils */
align := enum { left, center, right }
dat_material :=
<display_flag label_str
label_x_off label_y_off>
display_flag := enum {plot, subs, span, gap, null }
label_str := alpha_numeric
label_x_offset := integer /* in mils */
label_y_offset := integer /* in mils */
X := <double double, double..>
Y := <double double, double..>
Z := <double double, double..>
legend_material := LEGALIGN legend_align_material
LEGFMT legend_format_material
LEGMARG legend_margin_material
LEGBOXATTR attribute_material
LEGLABATTR attribute_material
LEGTITATTR attribute_material
legend_align_material
:= < h_align, h_offset, v_align,
v_offset, title_align>
h_align := enum {left, center, right}
h_offset := integer /* in mils */
v_align := enum { top, middle, bottom}
v_offset := integer /* in mils */
title_align := enum {left, center, right}
legend_format_material
:= <dont_show x_space_eat y_space_eat
txt_before_sample arrange_by_row
max_per_row_or_col >
dont_show := enum {true, false }
x_space_eat := integer
y_space_eat := integer
txt_before_sample := enum {true, false }
arrange_by_row := enum{true, false }
max_per_row_or_col := integer
legend_margin_material
:= <top bottom left right
row_margin col_margin auto_margin>
top := integer /* in mils */
bottom := integer /* in mils */
left := integer /* in mils */
ritght := integer /* in mils */
row_margin := integer
col_margin := integer
auto_margin := 0 (no auto) | 1 (auto )
part_segment :=[PART
part_name .GRP
thing_marks
attribute_material
layer_info
object_segment[...]
END .GRP]
[...]
part_name :=STRING (bounded by quotes)
pages_segment :=[page_info]
[...]
page_info :=[slide_info_segment
layer_segment
audio_segment
picture_segment
notes_segment]
slide_info_segment :=[SLIDE_INFO
[SLIDE_OUTLINE STRING]
[SLIDE_STYLE slide_style_info]
[LAYOUT_ID layout_info]
[HIDE_OBJECTS 1]
[HIDE_BACKGD 1]
[PAGE_BACKGD fill_pattern_material]
[C_SCHEME color_scheme_info]
[BUILD_INFO <build_info_material>]
[HIDE_SLIDE 1
END SLIDE_INFO]
audio_segment :=[AUDIO1
audio_info
END AUDIO1]
picture_segment :=[PICTURE
object_segment[...]
END PICTURE]
notes_segment := [NOTES
thing_segment
END NOTES]
layout_info :=<layout_ix
object1 object2 object3 object4>
layout_ix :=NUMBER representing layout style
0 - title page
1 - basic page
2 -2 column page
3 - 2 row page
4 - split column and column page
5 - column and split column page
6 - split row over row page
7 - row over split row page
8 - 4 objects page
9 - blank page
object1 :=NUMBER representing type of object1
object2 :=NUMBER representing type of object2
object3 :=NUMBER representing type of object3
object4 :=NUMBER representing type of object4
0 - other
1 - text
2 - bulleted list
3 - clipart
4 - chart
5 - 11 reserved
12 - none
color_scheme_info := < t_fg
t_bg txt_fg txt_bg l_fg l_bg f_fg f_bg
a1 a2 a3 a4 a5 a6 a7
a8 a9 a10 a11 a12 a13 s_fg>
t_fg :=NUMBER indicating title foreground color in
current colormap
t_bg :=NUMBER indicating title background color in
current colormap
txt_fg :=NUMBER
indicating text foreground color in
current colormap
txt_bg :=NUMBER
indicating text background color in
current colormap
l_fg :=NUMBER indicating line foreground color in
current colormap
l_bg :=NUMBER indicating line background color in
current colormap
f_fg :=NUMBER
indicating fill foreground color in
current colormap
f_bg :=NUMBER
indicating fill background color in
current colormap
a1 ... a13 :=NUMBER indicating accent color in
current colormap
s_fg :=NUMBER indicating shadow color in
current colormap
audio_info :=
<play type index volume>
play :=0 (disable audio) | 1 (enable audio)
type :=1 (links) | 2 (insets)
index := NUMBER (index into link or inset list)
volume := NUMBER (volume level for the audio ( 0-100))
build_info_material :=
< enable_build reverse_build build_effect
build_rule build_size build_delay
use_inactive_color inactive_color
sequence build_throttle audio_play
audio_type audio_index audio_volume>
enable_builld :=0 (disable build ) | 1(enablle
build
reverse_build :=0 (forward build ) | 1(reverse buid)
build_rule := Number indicationg size of paragraph
build_size := 0
build_effect := type of transistion
build_delay :=NUMBER (delay in seconds)
-1 (advance on mouse click
build_throttle
:= Number indicating speed of transistion
use_inactive_color :=0 (disable inactive color) | 1(enable)
inactive_color :=NUMBER indicating inactive color in
current colormap
use_inactive_color :=0
(disable inactive color) | 1 (enable color)
audio_play :=0
(disable audio) | 1 (enable audio)
audio_type :=1
(links) | 2 (insets)
audio_index :=
NUMBER (index into link or inset list)
audio_volume :=
NUMBER (volume level for the audio ( 0-100))
object_segment :=[ tag_name
thing_segment]
tag_name := #STRING(bounded by quotes)
thing_segment :=empty_thing |
text_thing |
textbox_thing |
image_thing |
poly_thing |
stroke_thing |
line_thing |
rectangle_thing |
ellipse_thing |
regular_poly_thing |
inset_thing |
group_thing |
template_thing
empty_thing :=.VOID
text_thing :=.STR
attribute_material
STRING
textbox_thing :=.TXT AT coordinate
thing_marks
attribute_material
layer_info
[TXTXYOFF <x_offset y_offset>]
path | transform
[H_SPACE Number(field_width)]
text_thing [...]
clippath
image_thing :=.IMG AT coordinate
thing_marks
attribute_material
layer_info
[path]
transform
[eps_segment]
WIDTH
NUMBER (indicating width in pixels of
RASTER)
HEIGHT
NUMBER (indicating height in pixels of
RASTER)
DEPTH 1 | 8 (indicating bits per pixel of RASTER)
[COMPRESSION RAW | RUN | LZW]
[ENCODING HEX | BIT6]
DATA
RASTER
clippath
poly_thing :=.POL AT coordinate
thing_marks
attribute_material
layer_info
path
clippath
stroke_thing :=.STK AT coordinate
thing_marks
attribute_material
layer_info
path
clippath
line_thing :=.LINE AT coordinate
thing_marks
attribute_material
layer_info
path
clippath
rectangle_thing :=.RECT AT coordinate
thing_marks
attribute_material
layer_info
[XYRAD
<NUMBER (x corner radius) NUMBER (y
corner radius)>]
[SCALE_CORNERS 0 | 1]
[POSITION <NUMBER
(x corner numerator)
NUMBER (y corner numerator)>]
path
clippath
ellipse_thing :=.ELL AT coordinate
thing_marks
attribute_material
layer_info
[START_ANGLE
NUMBER from 0 to 3600 (tenths
of degrees)]
[END_ANGLE NUMBER
from 0 to 7200 (tenths of
degrees)]
path
clippath
regular_poly_thing :=.RPOL AT coordinate
thing_marks
attribute_material
layer_info
[START_ANGLE
NUMBER from 0 to 3600 (tenths
of degrees)]
[NSIDES NUMBER
(number of sides in regular
poly)]
path
clippath
inset_thing :=.INS AT coordinate
thing_marks
attribute_material
layer_info
INSET_AREA <x1 y1 x2 y2 >
INS_REF
<type index saved_state doc_type icon
exec filter scale_mode propotional
centered x_zoom y_zoom
inset_info >
type = 1 (link) | 2 (inset)
index = (index into link or inset list)
saved_state = 1TRUEor FALSE
doc_type = Number indicating document type
icon = 1(display as icon) or 0(display inset)
exec = STRING
filter = STRING
scale_mode = Number
propotional = 1 or 0
centered = 1 or 0
x_zoom = Number (0- 1000)
y_zoom = Number (0 - 1000 )
inset_info = STRING
group_thing :=.GRP
AT coordinate
group_info
thing_marks
attribute_material
layer_info
object_segment[...]
END .GRP
template_thing :=.TMP
AT coordinate
thing_marks
layer_info
[TEMPLATE_FLAGS template_flags_info]
[T_POS template_position_info]
[BUILD_INFO build_info_material
]
thing_segment[...]
layer_info :=LAYER layer_index
group_info :=GRP_INFO chart_index
thing_marks :=[CBACK
callback_index]
[HIDDEN ON]
[LOCKED ON]
[FIXED ON]
[RECOLOR ON]
[TEMPLATED ON]
[TOP_ATTR ON]
[ISA_TITLE ON]
[ISA_SUBTITLE ON]
[ISA_FOOTER ON]
[ISA_BODY ON]
[ISA_LEGEND ON]
[ISA_AXIS ON]
[ISA_AXLAB ON]
[ISA_DATGRP ON]
[ISA_DATLAB ON]
[ISA_GRID ON]
[CLASS class_index]
template_flag_info :=
<type size inactive chart_index>
template_position_info:= <x1 y1 x2 y2>
layer_index :=NUMBER
indicating layer in layer list
chart_index :=NUMBER indicating chart in chart list
callback_index :=NUMBER indicating callback in callback list
path :=PNTS
coordinate [...]
[CTLS coordinate [...]]
transform :=T_PNTS
coordinate [...]
[T_CTLS coordinate [...]]
eps_segment :=[ EPS
eps_material
END EPS]
clippath :=[CLIPPATH
<clippath_points>]
clippath_points := (x0,y0)(x1,y1) (x2,y2)(x3,y3)(x4,y4)
x0,y0 := Number
in dots indicationg x position and y position
of left hand corner of the clip rectangle
x1,y1 := Number in
dots indicationg x position and y position
of right hand corner of the clip rectangle
x2, y2 := Number
in dots indicationg x position and y position
of right hand bottom corner of the clip rectangle
x3, y3 := Number
in dots indicationg x position and y position
of left hand bottom corner of the clip rectangle
x4, y4 := Number
in dots indicationg x position and y position
of left hand corner of the clip rectangle
inset_info :=
<type index saved_state doc_type icon exec filter
scale_mode propotional centered x_zoom y_zoom
Inset_info>
coordinate := (NUMBER
in dots indicating x
position,NUMBER in dots indiacting y position)
coordinate_info :=AT (coordinate)
The coordinate preceded by AT is a reference point. Paths and
transforms are relative to this point.
NOTE:
A Graphics_file should contain a picture_segment even if
nothing is drawn in it!
All graphic segments begin with a TOKEN and end with an END TOKEN. Readers of Graphics files should be prepared to scan ahead to the matching END TOKEN if a segment TOKEN is expected but an unknown TOKEN is found instead.
All TOKENS contained within a <> pair should be read as a block. If the number of TOKENS within the block exceeds the amount expected, excess material should be discarded. Likewise, if there is an underflow, some default value should be assigned or the entire TOKEN should be ignord.
All new BASE TOKENS will be bound to an argument TOKEN. If while reading TOKENS from within a segment an unknown BASE TOKEN is encountered, the next TOKEN in the stream should be discarded with parsing resuming at the following TOKEN.