2008-01-04  Valek Filippov
	Backported ver4 and 5 pointer and chunk structures from vsdviewer.
	Fixed hardcoded chunk header length to variable.
	Fixed Text chunk offset (was mistakenly pre-summed with chunk header length).

2007-12-17  Valek Filippov

	All reverse-engineering efforts goes with vsdviewer now.
	Look at http://www.sk1project.org site.

2007-07-09  Valek Filippov
	Ported back some results of using pygtk-based viewer.
	
2007-02-08  Valek Filippov
	Revised 0x6* and 0x7* chunks.
	
2007-02-04  Valek Filippov
	UNKNOWN_0 == _NYI (0x81)
	UNKNOWN_1 == _ADD (2 args, 0x80)
	UNKNOWN_2 == _SUB (2 arg, 0x80)	
	UNKNOWN_4 == _DIV (2 args, 0x80)
	UNKNOWN_5 == _UPLUS (1 args, 0x80)
	UNKNOWN_6 == _UMINUS (1 args, 0x80)
	UNKNOWN_7 == _PCT (1 args, 0x80)
	UNKNOWN_23 == _FLT (2 args, 0x80)
	UNKNOWN_24 == _FLE (2 args, 0x80)
	UNKNOWN_25 == _FEQ (2 args, 0x80)
	UNKNOWN_26 == _FGE (2 args, 0x80)
	UNKNOWN_27 == _FGT (2 args, 0x80)
	UNKNOWN_28 == _FNE (2 args, 0x80)
	UNKNOWN_47 == _GLUELOC (4 args, 0x7a)
	UNKNOWN_48 == _GLUEPAR (4 args, 0x7a)
	UNKNOWN_54 == _UMARKER (2 args, 0x80)
	UNKNOWN_56 == _GLUELOCPCT (3 args, 0x7a)
	UNKNOWN_57 == _GLUEPARPCT (3 args, 0x7a)
	UNKNOWN_62 == _MOD (2 args, 0x80)
	UNKNOWN_67 == _ELT (2 args, 0x80)
	UNKNOWN_68 == _ELE (2 args, 0x80)
	UNKNOWN_69 == _EEQ (2 args, 0x80)	
	UNKNOWN_70 == _EGE (2 args, 0x80)
	UNKNOWN_71 == _EGT (2 args, 0x80)
	UNKNOWN_72 == _ENE (2 args, 0x80)
	UNKNOWN_73 == _CAT (2 args, 0x80)
	UNKNOWN_101 == _UCON_C1 (5 args, 0x80)
	UNKNOWN_102 == _UCON_C2 (2 args, 0x80)
	UNKNOWN_103 == _UCON_D1 (5 args, 0x80)
	UNKNOWN_104 == _UCON_D2 (2 args, 0x80)	
	UNKNOWN_105 == _UCON_X1 (10 args, 0x80)
	UNKNOWN_106 == _UCON_X2 (8 args, 0x80)	
	UNKNOWN_107 == _UCON_Y1 (10 args, 0x80)
	UNKNOWN_108 == _UCON_Y2 (8 args, 0x80)	
	UNKNOWN_109 == _UCON_SIMPLE (8 args, 0x80)
	UNKNOWN_110 == _UCON_BEGTYP (5 args, 0x80)
	UNKNOWN_111 == _UCON_ENDTYP (5 args, 0x80)
	UNKNOWN_113 == _SHAPEMIN (1 arg, 0x80)
	UNKNOWN_114 == _SHAPEMAX (1 arg, 0x80)
	UNKNOWN_116 == _UCON_C3 (2 args, 0x80)
	UNKNOWN_117 == _UCON_D3 (2 args, 0x80)
	UNKNOWN_118 == _UCON_X3 (9 args, 0x80)
	UNKNOWN_119 == _UCON_Y3 (9 args, 0x80)
	UNKNOWN_120 == _UCON_GEOTYP (2 args, 0x80)
	UNKNOWN_160 == _POLYARC (0x81)
							
2007-02-04  Valek Filippov
	UNKNOWN_112 == _WalkGlue (3 args)
	UNKNOWN_14 == LOC (1 arg)
	Found yet another 0x70 name (just skipped atm).

2007-02-01  Valek Filippov
	Found '%' operation (0x14).

2007-01-31  Valek Filippov
	Added AlignTop/Bottom/etc names (UNKNOWN23 -- UNKNOWN28).
	Recognized GetVal() function as a variant of 0x76.
	UNKNOWN_50 == _MARKER
	Chunk 0x9f is 'Alignment' section.
	Chunks 0x10, 0x11, and 0x12 store 'Data1','Data2', and 'Data3' strings with 2 leading 0 bytes.
	Chunk 0x4d seems to be 'Shape Type="Guide" '.
	Guides are implemented as an InfiniteLine.
	Found yet another 0x70 name and good example of Type5 blocks. Will decode and document them later.
	'OLE type' seems not to match between different files. 
	
2007-01-30  Valek Filippov
	Documented most values for 0x76 GetRef().
	UNKNOWN_30 == OR

2007-01-29  Valek Filippov
	UNKNOWN_155 == CALLTHIS
	Chunks 6a, 6b, 70: 0/1/54 -- trailer 8 bytes
	Operation '&' -- 8
	Quick workaround for GetRef ('function 0x76').
	Need to collect info about values in GetRef().
	
2007-01-29  Valek Filippov
	UNKNOWN_216 == SETATREF.
	'Documented' 0xb9 chunk.
	More workarounds for chunk terminators.

2007-01-28  Valek Filippov
	Decided to convert unknown bitmap format from Type 0x23 streams to .ICO.
	Found a lots of interesting nuances in regards of ICO documentation.
	In Type 0x23 streams one need to deRLE from the start of transparency bytes (offset 18),
	push transparency mask (W*H/8 bytes), pop deRLEed bytes and after that push transparency mask.
	Also instead of RGB .ico uses BGR0.

2007-01-27  Valek Filippov
	Found 0x70 names (documented) and another way of using NURBS() function
	(as a long blocks starts with 0x8a)

2007-01-26  Valek Filippov
	Documented '0xd' and '0x1f' chunks ('OLE_Info'? and 'OLEData').
	Found that OLE is stored in a different type of chunk (0x1f) and splitted to 8Kbytes peaces.
	ForeignType == 2 is 'OLE'.	
	The number of peaces is stored in 0xd chunk. One byte in '0xd' seems to be 'type of OLE file'.
	Guessed (not tested) values for OLE type are:
	1e -- xls, 24 -- ppt, 34 -- MS Chart, 52 -- doc. 

2007-01-25  Valek Filippov
	Found 'DEFAULTEVENT()' function. Found that UNKNOWN_29 is 'AND()'.
	Found _XFTRIGGER().
	Found that my 'guess' about 0x42 at 2006-12-12 is wrong.
	Really I didn't need to cut more than 4 bytes because
	'weird' files are EMFs wrapped into WMFs.
	There is a lots of strange things in Nortel stencil.
	The type1 blocks isn't dangerous, but Type2 blocks with never-seen-it-before
	slices definitely are. And it's quite hard to find the meaning of those things.
	
2007-01-24  Valek Filippov
	Visio version 6 (2k and 2k2) stores JPG and PCX as BMP with 18 bits pallete
	(i.e. w/o it), but instead of correct 'size of data' it includes 0.
	So 'offset to data' can be statically set to 0x36.
	AI, EPS, PNG and GIFs are stored as WMF files.
	PNG and GIF incorporate 18 bits BMPs into those WMFs.

2007-01-23  Valek Filippov
	ForeignType == 1 is 'Bitmap' (jpg, gif, png, tiff).
	ForeignType == 4 is 'EnchMetaFile (emf/wmf).
	
2007-01-23  Valek Filippov
	Added some formulas for conversion from Visio to cairo arguments for ArcTo and Ellipse
	(see cairo.txt).
	Need to figure out how to treat EllipticalArcTo args.
	Documented 0xc5, 0xc6 and 0xc7 chunks. Found more strange chunks (0x7*).
	Documented one more 'internal' function.
	Found some 'connection points' related chunk numbers on MSDN (!)
	Found where 'compression type' for 'Foreign' is set.
	So it's possible to implement saving of image files with correct name extensions.
	The only values for jpg, gif, png, and tiff are recognized at the moment.
	pcx/emf/wmf will be added soon.  

2007-01-03  Valek Filippov
	Found that 2k2/2k3 have another offsets to start of blocks for some chunks.
	My docs were 2k oriented. Now .tbl includes differences (lines start with 21).

2007-01-03  Valek Filippov
	Documented more 'Obj_names' for 0x72 names.
	Need to find right way to identify 'Var_names'.
	
2007-01-02  Valek Filippov
	Documented format of 72 and 74 names.
	Found that part of 74 names includes same numbers as 75.
		
2006-12-31  Valek Filippov
	Found that function numbers don't overlap betwen 0x7a, 0x7b, 0x80 and 0x81 group.
	
2006-12-30  Valek Filippov
	Fixed funcion description. Found that dword after flag in 0x7b and 0x81
	 is '# of args', an index of function is after that dword.
	Understood and partially documented AND()/OR() and IF() function
	("documented by examples").
	Found that '0xe4' is 'braces' operation.

2006-12-28  Valek Filippov
	Icons WxH can be any combinations of 32 and 64.
	Improved description of 'Foreign' chunk.
	Added some missed names, fixed mistake in 2 pairs of already documented.
	
2006-12-27  Valek Filippov
	Described format of icons.

2006-12-23  Valek Filippov
	Partially documented Types 0x2a (Window ID), 0x2f (EventItem), 0x26 (PageProps), 0xa (Some strings) streams.
	Found that Type 0x23 stream hold icon (unrecognize format yet).
	VDX stores base64-encoded ico files for that, but in VSD some type of compression (RLE?) is used.
	Some chunks were documented also.
	Need to find relations between chunks and 0x33/0xA streams, because some information for chunks are stored separately.
		
2006-12-22  Valek Filippov
	Found that split of function and data is a really usefull improvement.
	Now I vsdump file, check stdout for '1chunk'. It's 'chunk w/o description'.
	Add dumping of those chunks (just '18 0 0' before 'end').
	Check how their content looks like. For IEEE-754 fractions found here and there
	just need to add '9 offset Unknown<X>' now.
	Later it would be able to see to change of which value changes this one.
	
2006-12-16  Valek Filippov
	'Covered' part of file is less than all file.
	Most likely vsdump doesn't extract some pointers.
	Need to find what is not covered and why.
	Need to check that existance of trailer/separator is
	a function of chunk type.

2006-12-13  Valek Filippov
	Discovered that a lot of VSS-files I have is Version5 or ever Version4!
	Quickly found some diferences between Ver5 and Ver6, documented them.
	Decided not to spread so wide.

2006-12-12  Valek Filippov
	Decoding of stream type 53 added a lot of pointers from VSS files.
	As a result I found that there are "0x0c" streams with EMF file in them.
	The EMF file starts at offset 0x4 (the 1st dword is always a length of stream
	w/o this 1st dword) OR at offset 0x42. Atm I have no idea where to look for offset.
	So in code I implemented simple dirty check that works for at least one file =)
	Now vsdump utility saves every EMF in a different file.

2006-12-11  Valek Filippov
	Sorted 'Chunks format'.
	Improved 'XFrom', 'LineTo' docs.
	Decoded and documented 'Group', 'MoveTo' chunk.
	Decoded and documented 4 different 'Tabs' chunks. 

2006-12-10  Valek Filippov
	Improved 'Control' fields documentation.
	Decoded and documented 'Control (another type)', 'Hyperlink', 'Scratch', 'TextXForm',
	'Ellipse', 'InfiniteLine', 'CustomProps', 'User-defined Cells', 'EllipticalArcTo',
	'XFromID', 'ArcTo', 'SplineStart', 'SplineKnot', 'LayerMembership' chunks.
	Decoded and documented lots of codes for 'names' (see 'Names' sheet in the format.gnumeric file).
	Decoded and documented 'operations' (+,-,/,*,^) and comparisions (<,>,=,!=,<=,>=) for values in blocks.
	Found the method of pointing to another cells in ShapeSheet.
	Some guesses about Type 3 blocks usage for pointing.
	Found that bits in the last bytes preeceeding blocks are flags that encode 'direct/calculated' property
	of suitable mandatory values.  
	
2006-12-09 Valek Filippov
	Found 'ConnectionPoints' (0x99) chunk.
	Decoded and documented 'TextBlock', 'Event', 'Image', 'Layout' and 'ConnectionPoints' (2 types) fields.
	Improved 'Act ID' and 'Misc' fields documentation.
	Decoded and documented lots of codes for 'functions' (see 'Functions' sheet in the format.gnumeric file).
	There were found 3 types of the blocks to the moment:
	 'Type 2' -- ends with 0xFE, the value at offset 5 is an index of the variable this block is linked to. 
	 'Type 1' and 'Type 3' -- don't end with 0xFE, value at offset 5 don't seems to be index.
	 
2006-12-08 Valek Filippov
	The main work was on 'block' research. Some data about block structure and types were discovered.
	Relation (if any) between block and mandatory value was found. Collected more data about 'inheritance'
	values in block (like 'Width*<x>' is a block type 75 02, 'Height*<x> is a block type 75 03).
	Decoded and documented fields of 'Layer', 'Act', 'PageProps', 'Control', 'NURBSTo', 'NURBSTo E-cell',
	'XForm', 'Geometry' (chunk 0x89), 'Protection' and 'Misc' chunks.
	Found more quick way to decode fields.    

2006-12-07 Valek Filippov
	All mandatory fields of chunks 0xc0 (PageLayout) and 0xb7 (RulerGrid) were decoded and documented.
	
2006-12-06 Valek Filippov
	Found 'Event' (0x84) and 'Shape ID Type="Group"' (0x47) chunks.
	The stream 0x1a seems to store 'StyleSheet'-related chunks.
	The chunks in 0x15 and 0x1a share numbers (e.g. '0x84' is 'Event' both in 0x15 and 0x1a).
	There are some chunks 'linked' to other chunks (e.g. '0x6a' exists only with '0x95' (Para IX)).
	New recognised chunks:
	0x4a -- StyleSheet ID, 0x93 -- StyleProp, 0xbf -- Layout, 0xa4 -- Misc,
	0x88 -- Tabs (?), 0x6b -- linked to Tabs?, 0x6a -- linked to Para,
	0xa0 -- Protection, 0x84 -- Event, 0xa3 -- Help, 0xa7 -- LayerMem,
	0xb7 -- RulerGrid, 0xbd -- Image (0xc is 'Foreign Data'), 0xbe -- Group,
	0xc8 -- PrintProps. 

2006-12-05 Valek Filippov
	Ian Redfern test file most likely spots one more 'where to find chunks?' problem.
	Added some debug output to investigate it.

	A file with multiple images in different format was checked.
	So 'image num' stored in 'Shape ID Type="Foreign"' (chunk type 0x4e) element.
	For now I implemented counting to store file with different name.
	Ian pointed me to some tag in VXD where file format is clearly expressed, unfortunatelly
	I didn't find something similar in VSD yet.
	So chunk type 'Foreign' was partally described and parsed in the code.
	Also there are 'block'-part in this chunk that will be parsed later.
	
	Found NBURST chunk (0xc3) decomposed by hands, all values found, ready to implement parsing.
	This chunk contains a lot of blocks, some info about blocks was figured out as a result.  	

2006-12-04 Valek Filippov
	'Where find pointers' changed to 'format of (non-)compressed stream with pointers header'.
	Current code uses it. VSS file (version 6) was treated correctly.

2006-12-02 Valek Filippov
	'fo bf' before fractions in 1st part of stream15 is most likely 'bff0 0000 0000 0000',
	i.e. "-1". If so previous 8 bytes can be ieee-754 64 bits "0".
	Offset to start of blocks (if any) in the chunks seems to be constant for chunk type.
	For stream1a from Visio2k (decimal offset from start of data):
	0x85 - 34, 0x86 - 24, 0x87 - 70, 0x88 - 6, 0x92 - 156 and so on.
	Ones started blocks go to end of stream, so 'offset part' seems to store 'mandatory'
	values of chunk and 'blocks' store 'non-mandatory' values.
	
2006-12-02 Valek Filippov
	'Trailer/separator' issue seems to be workarounded.
	Jody: "I don't see any obvious vba in there".
	
2006-12-01 Valek Filippov
	'Where find chunks' changed to better idea for both Visio2k and Visio2k3.
	Found 'blocks' structures in the chunks.

2006-11-30 Valek Filippov
	Found mistake in format description. The chunks are started at value at offset _0x0c_ + 0x1b,
	(was wrong offset 0x08).
	Added Visio2k3 'where to find chunks'.
	
2006-11-28 Valek Filippov
	Recognized 0x48 as 'Shape' and 0x68 as 'Geom'.
	Found that MoveTo/LineTo/Ellipse/EllepticalArcTo/XFrom can
	use second set of fractions (ordered differently from 1st set)
	that describe such things like "0.2" in "<PinX F="Sheet.13!Width*0.2">".
	Those fractions are preceided by 0x60 [dword] 0x20 and trailed with 0x05 0xfe.
	dword (if any) is a number like 13 in "Sheet.13" above.
	It looks imposible to assign constant offsets for such fractions, will do some
	parsing for them instead.
	Found that '0x60' and '0xfe' quote values and string in type 0xa8 ('Layer')
	chunks (like 0x60 <content> 0xfe). 