mirror of https://github.com/apache/poi.git
Start on processing the commands stored within a HDGF chunk, plus initial tests for it
git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@549588 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
71a6a7d7ac
commit
aa1b5c9dd4
|
@ -329,6 +329,14 @@ under the License.
|
|||
<include name="*.ppt" />
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<!-- Copy HDGF Resources over -->
|
||||
<property name="hdgf.chunks" value="org/apache/poi/hdgf/chunks" />
|
||||
<copy todir="${scratchpad.output.dir}/${hdgf.chunks}">
|
||||
<fileset dir="${scratchpad.src}/${hdgf.chunks}">
|
||||
<include name="*.tbl" />
|
||||
</fileset>
|
||||
</copy>
|
||||
</target>
|
||||
|
||||
<target name="compile-contrib" depends="init">
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
/**
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; version 3 of the License.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
/* ====================================================================
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; version 3 of the License.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
==================================================================== */
|
||||
package org.apache.poi.hdgf;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
==================================================================== */
|
||||
package org.apache.poi.hdgf.chunks;
|
||||
|
||||
import org.apache.poi.hdgf.chunks.ChunkFactory.CommandDefinition;
|
||||
|
||||
/**
|
||||
* Base of all chunks, which hold data, flags etc
|
||||
*/
|
||||
|
@ -30,6 +32,8 @@ public class Chunk {
|
|||
private ChunkTrailer trailer;
|
||||
/** May be null */
|
||||
private ChunkSeparator separator;
|
||||
/** The possible different commands we can hold */
|
||||
protected CommandDefinition[] commandDefinitions;
|
||||
|
||||
public Chunk(ChunkHeader header, ChunkTrailer trailer, ChunkSeparator separator, byte[] contents) {
|
||||
this.header = header;
|
||||
|
@ -52,6 +56,13 @@ public class Chunk {
|
|||
public ChunkTrailer getTrailer() {
|
||||
return trailer;
|
||||
}
|
||||
/**
|
||||
* Gets the command definitions, which define and describe much
|
||||
* of the data held by the chunk.
|
||||
*/
|
||||
public CommandDefinition[] getCommandDefinitions() {
|
||||
return commandDefinitions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the size of the chunk, including any
|
||||
|
|
|
@ -16,18 +16,80 @@
|
|||
==================================================================== */
|
||||
package org.apache.poi.hdgf.chunks;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Hashtable;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
/**
|
||||
* Factor class to create the appropriate chunks, which
|
||||
* needs the version of the file to process the chunk header
|
||||
* and trailer areas.
|
||||
* Makes use of chunks_parse_cmds.tbl from vsdump to be able
|
||||
* to c
|
||||
* to process the chunk value area
|
||||
*/
|
||||
public class ChunkFactory {
|
||||
/** The version of the currently open document */
|
||||
private int version;
|
||||
public ChunkFactory(int version) {
|
||||
/**
|
||||
* Key is a Chunk's type, value is an array of its CommandDefinitions
|
||||
*/
|
||||
private Hashtable chunkCommandDefinitions = new Hashtable();
|
||||
/** What the name is of the chunk table */
|
||||
private static String chunkTableName =
|
||||
"/org/apache/poi/hdgf/chunks/chunks_parse_cmds.tbl";
|
||||
|
||||
public ChunkFactory(int version) throws IOException {
|
||||
this.version = version;
|
||||
|
||||
processChunkParseCommands();
|
||||
}
|
||||
|
||||
/**
|
||||
* Open chunks_parse_cmds.tbl and process it, to get the definitions
|
||||
* of all the different possible chunk commands.
|
||||
*/
|
||||
private void processChunkParseCommands() throws IOException {
|
||||
String line;
|
||||
InputStream cpd = ChunkFactory.class.getResourceAsStream(chunkTableName);
|
||||
BufferedReader inp = new BufferedReader(new InputStreamReader(cpd));
|
||||
while( (line = inp.readLine()) != null ) {
|
||||
if(line.startsWith("#")) continue;
|
||||
if(line.startsWith(" ")) continue;
|
||||
if(line.startsWith("\t")) continue;
|
||||
if(line.length() == 0) continue;
|
||||
|
||||
// Start xxx
|
||||
if(!line.startsWith("start")) {
|
||||
throw new IllegalStateException("Expecting start xxx, found " + line);
|
||||
}
|
||||
int chunkType = Integer.parseInt(line.substring(6));
|
||||
ArrayList defsL = new ArrayList();
|
||||
|
||||
// Data entries
|
||||
while( ! (line = inp.readLine()).startsWith("end") ) {
|
||||
StringTokenizer st = new StringTokenizer(line, " ");
|
||||
int defType = Integer.parseInt(st.nextToken());
|
||||
int offset = Integer.parseInt(st.nextToken());
|
||||
String name = st.nextToken("\uffff").substring(1);
|
||||
|
||||
CommandDefinition def = new CommandDefinition(defType,offset,name);
|
||||
defsL.add(def);
|
||||
}
|
||||
|
||||
CommandDefinition[] defs = (CommandDefinition[])
|
||||
defsL.toArray(new CommandDefinition[defsL.size()]);
|
||||
|
||||
// Add to the hashtable
|
||||
chunkCommandDefinitions.put(new Integer(chunkType), defs);
|
||||
}
|
||||
inp.close();
|
||||
cpd.close();
|
||||
}
|
||||
|
||||
public int getVersion() { return version; }
|
||||
|
||||
/**
|
||||
|
@ -88,9 +150,36 @@ public class ChunkFactory {
|
|||
Chunk chunk = new Chunk(header, trailer, separator, contents);
|
||||
|
||||
// Feed in the stuff from chunks_parse_cmds.tbl
|
||||
// TODO
|
||||
CommandDefinition[] defs = (CommandDefinition[])
|
||||
chunkCommandDefinitions.get(new Integer(header.getType()));
|
||||
chunk.commandDefinitions = defs;
|
||||
|
||||
// All done
|
||||
return chunk;
|
||||
}
|
||||
|
||||
/**
|
||||
* The definition of a Command, which a chunk may hold.
|
||||
* The Command holds the value, this describes it.
|
||||
*/
|
||||
public class CommandDefinition {
|
||||
private int type;
|
||||
private int offset;
|
||||
private String name;
|
||||
public CommandDefinition(int type, int offset, String name) {
|
||||
this.type = type;
|
||||
this.offset = offset;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
public int getOffset() {
|
||||
return offset;
|
||||
}
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,964 @@
|
|||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 3 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
#
|
||||
# version 0.0.26
|
||||
#
|
||||
# Need to extend with 'format' field for conversion length (inch->mm), angles(rad->degree) and enums (e.g.
|
||||
# for aligns -- left/right/justify etc.
|
||||
#
|
||||
# The Format description for .tbl file.
|
||||
# Lines start with # are comments.
|
||||
# Every list of commands starts with 'start ch_type'
|
||||
# and ends with 'end'.
|
||||
# In between start and end are space-separeted lines
|
||||
# with 'type', 'offset', 'name' values.
|
||||
# Atm I use 'atoi', so only decimal value is allowed for ch_type, type and offset.
|
||||
# The possible values for 'type' are:
|
||||
# 0..7 - flag at bit 0..7 at offset 'offset'
|
||||
# 8 - 1 byte value
|
||||
# 9 - 8 bytes IEEE-754 fraction
|
||||
# 10(a) - name of chunk (we must start with a name atm, because with parse for printing)
|
||||
# 11(b) - offset to start of blocks
|
||||
# 12(c) - text block
|
||||
# 13(d) - some "name" from the list
|
||||
# 14(e) - one byte "function" from the list
|
||||
# 15(f) - some "function" from the list
|
||||
# 16 - string, next byte is length terminating '0' wasn't added to length
|
||||
# 17 - 'ForeignData'
|
||||
# 18 - Dump it to file as-is
|
||||
# 25 - 2 bytes LE
|
||||
# 26 - 4 bytes LE
|
||||
# 27 - Tabs? [experimental]
|
||||
# 21 - offset to start of blocks in version 11
|
||||
# 28 - extension for image files [experimental]
|
||||
# 29 - num of parts and type for OLE [experimental]
|
||||
|
||||
# Quick workaround for losing of 1st table
|
||||
start 10
|
||||
end
|
||||
|
||||
start 12
|
||||
17 0 ForeignData
|
||||
end
|
||||
|
||||
start 13
|
||||
10 0 OLE_Info
|
||||
29 0 0
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 14
|
||||
10 0 Text
|
||||
12 27 0
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 16
|
||||
10 0 Data1
|
||||
12 0 0
|
||||
end
|
||||
|
||||
start 17
|
||||
10 0 Data2
|
||||
12 0 0
|
||||
end
|
||||
|
||||
start 18
|
||||
10 0 Data3
|
||||
12 0 0
|
||||
end
|
||||
|
||||
start 21
|
||||
10 0 Stream15
|
||||
9 53 Center X
|
||||
9 61 Center Y
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 24
|
||||
10 0 Stream18
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 25
|
||||
10 0 FaceName
|
||||
16 24 0
|
||||
end
|
||||
|
||||
start 26
|
||||
10 0 Stream1a
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 31
|
||||
17 0 OLEData
|
||||
end
|
||||
|
||||
start 40
|
||||
10 0 Unknown 0x28
|
||||
9 39 Unknown1
|
||||
9 47 Unknown2
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 44
|
||||
10 0 Unknown 0x2c
|
||||
18 0 0
|
||||
end
|
||||
|
||||
#seems to be text string
|
||||
start 45
|
||||
10 0 Unknown 0x2d
|
||||
12 0 0
|
||||
end
|
||||
|
||||
start 49
|
||||
10 0 Stream31
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 66
|
||||
10 0 Unknown 0x42
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 70
|
||||
10 0 PageSheet
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 71
|
||||
10 0 Shape ID Type="Group"
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 72
|
||||
10 0 Shape ID Type="Shape"
|
||||
26 53 LineStyle
|
||||
26 61 FillStyle
|
||||
26 69 TextStyle
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 74
|
||||
10 0 StyleSheet
|
||||
26 53 LineStyle
|
||||
26 61 FillStyle
|
||||
26 69 TextStyle
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 77
|
||||
10 0 Shape ID Type="Guide"
|
||||
18 0 0
|
||||
end
|
||||
|
||||
|
||||
start 78
|
||||
10 0 Shape ID Type="Foreign"
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 79
|
||||
10 0 DocumentSheet
|
||||
26 53 LineStyle
|
||||
26 61 FillStyle
|
||||
26 69 TextStyle
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 100
|
||||
10 0 Unknown 0x64
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 101
|
||||
10 0 Unknown 0x65
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 102
|
||||
10 0 Unknown 0x66
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 103
|
||||
10 0 Unknown 0x67
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 104
|
||||
10 0 Unknown 0x68
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 105
|
||||
10 0 Unknown 0x69
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 106
|
||||
10 0 Unknown 0x6a
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 107
|
||||
10 0 Unknown 0x6b
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 108
|
||||
10 0 Unknown 0x6c
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 109
|
||||
10 0 Unknown 0x6d
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 110
|
||||
10 0 Unknown 0x6e
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 111
|
||||
10 0 Unknown 0x6f
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 112
|
||||
10 0 Unknown 0x70
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 113
|
||||
10 0 Unknown 0x71
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 114
|
||||
10 0 Unknown 0x72
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 115
|
||||
10 0 Unknown 0x73
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 116
|
||||
10 0 Unknown 0x74
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 117
|
||||
10 0 Unknown 0x75
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 118
|
||||
10 0 Unknown 0x76
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 130
|
||||
10 0 Unknown 0x82
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 131
|
||||
10 0 Unknown 0x83
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 132
|
||||
10 0 Event
|
||||
8 20 TheText
|
||||
11 36 BlockStarts
|
||||
21 36 BlockStarts
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 133
|
||||
10 0 Line
|
||||
31 19 LineWeight
|
||||
8 28 LineColor
|
||||
8 33 LinePattern
|
||||
9 35 Rounding
|
||||
8 43 EndArrowSize
|
||||
8 44 BeginArrow
|
||||
8 45 EndArrow
|
||||
8 47 BeginArrowSize
|
||||
1 50 Color
|
||||
2 50 Pattern
|
||||
3 50 RoundingCap
|
||||
4 50 LineEndEnd
|
||||
5 50 LineEndBegin
|
||||
6 50 EndSize
|
||||
7 50 SqueareCap
|
||||
0 51 BeginSize
|
||||
11 54 BlockStarts
|
||||
21 54 BlockStarts
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 134
|
||||
10 0 Fill
|
||||
8 19 FillForegnd
|
||||
30 25 FillBkgnd
|
||||
8 29 FillPattern
|
||||
30 31 ShdwForegnd
|
||||
8 35 ShdwBkgnd
|
||||
8 40 ShdwPattern
|
||||
31 42 ShapeShdwOffsetX
|
||||
31 51 ShapeShdwOffsetY
|
||||
9 69 ShapeShdwScaleFactor
|
||||
11 44 BlockStarts
|
||||
21 80 BlockStarts
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 135
|
||||
10 0 TextBlock
|
||||
31 19 LeftMargin
|
||||
31 28 RightMargin
|
||||
31 37 TopMargin
|
||||
31 46 BottomMargin
|
||||
8 55 VerticalAlign
|
||||
30 56 TextBkgnd
|
||||
9 62 DefaultTabStop
|
||||
8 82 TextDirection
|
||||
11 90 BlockStarts
|
||||
21 111 BlockStarts
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 136
|
||||
10 0 Tabs
|
||||
11 26 BlocksStart
|
||||
21 26 BlocksStart
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 137
|
||||
10 0 Geometry
|
||||
0 20 NoFill
|
||||
1 20 NoLine
|
||||
2 20 NoShow
|
||||
3 20 NoSnap
|
||||
21 22 BlocksStart
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 138
|
||||
10 0 MoveTo
|
||||
9 20 X
|
||||
9 29 Y
|
||||
11 39 BlocksStart
|
||||
21 39 BlocksStart
|
||||
end
|
||||
|
||||
start 139
|
||||
10 0 LineTo
|
||||
9 20 X
|
||||
9 29 Y
|
||||
11 39 BlocksStart
|
||||
21 39 BlocksStart
|
||||
end
|
||||
|
||||
start 140
|
||||
10 0 ArcTo
|
||||
9 20 X
|
||||
9 29 Y
|
||||
9 38 A
|
||||
11 48 BlocksStart
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 141
|
||||
10 0 InfiniteLine
|
||||
9 20 X
|
||||
9 29 Y
|
||||
9 37 A
|
||||
9 45 B
|
||||
11 57 BlocksStart
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 143
|
||||
10 0 Ellipse
|
||||
9 20 X
|
||||
9 29 Y
|
||||
9 38 A
|
||||
9 47 B
|
||||
9 56 C
|
||||
9 65 D
|
||||
11 75 BlocksStart
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 144
|
||||
10 0 EllipticalArcTo
|
||||
31 19 X
|
||||
31 28 Y
|
||||
31 37 A
|
||||
31 46 B
|
||||
31 55 C
|
||||
31 64 D
|
||||
11 75 BlocksStart
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 146
|
||||
10 0 PageProps
|
||||
9 20 PageWidth
|
||||
9 29 PageHeight
|
||||
9 38 ShdwOffsetX
|
||||
9 47 ShdwOffsetY
|
||||
9 56 PageScale
|
||||
9 65 DrawingScale
|
||||
8 73 DrawingSizeType
|
||||
8 74 DrawingScaleType
|
||||
0 93 InhibitSnap
|
||||
11 150 BlockStarts
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 147
|
||||
10 0 StyleProp
|
||||
8 19 EnableLineProps
|
||||
8 20 EnableFillProps
|
||||
8 21 EnableTextProps
|
||||
8 22 HideForApply
|
||||
11 26 BlocksStart
|
||||
21 26 BlocksStart
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 148
|
||||
10 0 Char
|
||||
25 23 FontNum
|
||||
30 26 Color
|
||||
8 29 Transparency*255/100%
|
||||
0 30 Bold
|
||||
1 30 Italic
|
||||
2 30 Underline
|
||||
3 30 Smallcaps
|
||||
0 31 AllCaps
|
||||
1 31 InitCaps
|
||||
0 32 Subscript
|
||||
1 32 Superscipt
|
||||
25 33 Scale*100 %
|
||||
8 35 LangCode
|
||||
31 36 Size
|
||||
25 46 Spacing pt*200
|
||||
25 56 AsianFont
|
||||
25 58 ComplexScriptFont
|
||||
8 60 LocalizeFont
|
||||
25 88 LangID
|
||||
11 54 BlocksStart
|
||||
21 107 BlocksStart
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 149
|
||||
10 0 Para
|
||||
31 23 IndFirst
|
||||
31 32 IndLeft
|
||||
31 41 IndRight
|
||||
31 50 SpLine
|
||||
31 59 SpBefore
|
||||
31 68 SpAfter
|
||||
8 77 HorizAlign
|
||||
8 78 Bullet
|
||||
11 92 BlockStarts
|
||||
21 142 BlockStarts
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 150
|
||||
10 0 Tabs
|
||||
27 0 TabsID
|
||||
11 48 BlockStarts
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 151
|
||||
10 0 Tabs
|
||||
27 0 TabsID
|
||||
11 139 BlockStarts
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 181
|
||||
10 0 Tabs
|
||||
27 0 TabsID
|
||||
11 708 BlockStarts
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 152
|
||||
10 0 Foreign
|
||||
9 20 IndFirst
|
||||
9 29 IndLeft
|
||||
9 38 IndRight
|
||||
9 47 SpLine
|
||||
28 68 Ext
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 153
|
||||
10 0 Connection
|
||||
31 19 Width
|
||||
31 28 Height
|
||||
31 37 DirX/A
|
||||
31 46 DirY/B
|
||||
8 55 Type/C
|
||||
11 67 BlockStarts
|
||||
21 67 BlockStarts
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 155
|
||||
10 0 XForm
|
||||
9 20 PinX
|
||||
9 29 PinY
|
||||
9 38 Width
|
||||
9 47 Height
|
||||
9 56 LocPinX
|
||||
9 65 LocPinY
|
||||
9 74 Angle
|
||||
8 82 FlipX
|
||||
8 83 FlipY
|
||||
8 84 ResizeMode
|
||||
11 88 BlockStarts
|
||||
21 88 BlockStarts
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 156
|
||||
10 0 TextXForm
|
||||
9 20 TxtPinX
|
||||
9 29 TxtPinY
|
||||
31 37 TxtWidth
|
||||
9 47 TxtHeight
|
||||
9 56 TxtLocPinX
|
||||
9 65 TxtLocPinY
|
||||
9 74 TxtAngle
|
||||
11 88 BlockStarts
|
||||
21 88 BlockStarts
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 157
|
||||
10 0 XForm1D
|
||||
9 20 BeginX
|
||||
9 29 BeginY
|
||||
9 38 EndX
|
||||
9 47 EndY
|
||||
11 57 BlockStarts
|
||||
21 57 BlockStarts
|
||||
end
|
||||
|
||||
start 158
|
||||
10 0 Scratch
|
||||
9 20 X
|
||||
9 29 Y
|
||||
9 38 A
|
||||
9 47 B
|
||||
9 56 C
|
||||
9 65 D
|
||||
11 75 BlockStarts
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 159
|
||||
10 0 Alignment
|
||||
9 20 AlignLeft
|
||||
9 29 AlignCenter
|
||||
9 38 AlignRight
|
||||
9 47 AlignTop
|
||||
9 56 AlignMiddle
|
||||
9 65 AlignBottom
|
||||
11 75 BlockStarts
|
||||
21 79 BlockStarts
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 160
|
||||
10 0 Protection
|
||||
8 19 LockWidth
|
||||
8 20 LockHeight
|
||||
8 21 LockMoveX
|
||||
8 22 LockMoveY
|
||||
8 23 LockAspect
|
||||
8 24 LockDelete
|
||||
8 25 LockBegin
|
||||
8 26 LockEnd
|
||||
8 27 LockRotate
|
||||
8 28 LockCrop
|
||||
8 29 LockVtxEdit
|
||||
8 30 LockTextEdit
|
||||
8 31 LockFormat
|
||||
8 32 LockGroup
|
||||
8 33 LockCalcWH
|
||||
8 34 LockSelect
|
||||
8 35 LockCustProp
|
||||
11 43 BlockStarts
|
||||
21 43 BlockStarts
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 161
|
||||
10 0 TextFields
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 162
|
||||
10 0 Control
|
||||
9 20 X
|
||||
9 29 Y
|
||||
9 38 XDyn
|
||||
9 47 YDyn
|
||||
8 55 XCon
|
||||
8 56 YCon
|
||||
0 57 CanGlue
|
||||
11 60 BlockStarts
|
||||
21 60 BlockStarts
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 163
|
||||
10 0 Help
|
||||
11 49 BlockStarts
|
||||
21 49 BlockStarts
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 164
|
||||
10 0 Misc
|
||||
0 19 NoObjHandles
|
||||
1 19 NonPrinting
|
||||
2 19 NoCtlHandles
|
||||
3 19 NoAlignBox
|
||||
4 19 UpdateAlignBox
|
||||
5 19 HideText
|
||||
8 20 DynFeedback
|
||||
8 21 GlueType
|
||||
8 22 WalkPreference
|
||||
25 25 ObjType
|
||||
0 35 IsDropSource
|
||||
1 35 NoLiveDynamics
|
||||
25 37 LangID
|
||||
11 42 BlockStarts
|
||||
21 64 BlockStarts
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 165
|
||||
10 0 SplineStart
|
||||
9 20 X
|
||||
9 29 Y
|
||||
9 37 A
|
||||
9 45 B
|
||||
9 53 C
|
||||
8 61 D
|
||||
11 65 BlockStarts
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 166
|
||||
10 0 SplineKnot
|
||||
9 20 X
|
||||
9 29 Y
|
||||
9 37 A
|
||||
11 47 BlockStarts
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 167
|
||||
10 0 LayerMem
|
||||
11 25 BlockStarts
|
||||
21 25 BlockStarts
|
||||
18 0 0
|
||||
end
|
||||
|
||||
# Transparency 255 - 100%
|
||||
start 168
|
||||
10 0 Layer
|
||||
30 27 Color
|
||||
8 31 Transparency
|
||||
8 33 Visible
|
||||
8 34 Print
|
||||
8 35 Active
|
||||
8 36 Lock
|
||||
8 37 Snap
|
||||
8 38 Glue
|
||||
11 52 BlockStarts
|
||||
21 52 BlockStarts
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 169
|
||||
10 0 Act
|
||||
8 40 Checked
|
||||
8 41 Disabled
|
||||
0 42 ReadOnly
|
||||
1 42 Invisible
|
||||
2 42 BeginGroup
|
||||
11 47 BlockStarts
|
||||
21 76 BlockStarts
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 170
|
||||
10 0 Control
|
||||
9 20 X
|
||||
9 29 Y
|
||||
9 38 XDyn
|
||||
9 47 YDyn
|
||||
8 55 XBehavior
|
||||
8 56 YBehavior
|
||||
0 57 CanGlue
|
||||
11 66 BlockStarts
|
||||
21 66 BlockStarts
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 180
|
||||
10 0 User-defined Cells
|
||||
9 20 Value
|
||||
11 34 BlockStarts
|
||||
21 34 BlockStarts
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 182
|
||||
10 0 CustomProps
|
||||
9 20 Value
|
||||
8 44 Type
|
||||
0 46 Invisible
|
||||
1 46 Ask
|
||||
11 55 BlockStarts
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 183
|
||||
10 0 RulerGrid
|
||||
8 19 XRulerDensity
|
||||
8 20 XRulerDensity
|
||||
31 21 Unknown1
|
||||
31 30 Unknown2
|
||||
31 39 XRulerOrigin
|
||||
31 48 YRulerOrigin
|
||||
8 57 XGridDensity
|
||||
8 58 YGridDensity
|
||||
31 59 XGridSpacing
|
||||
31 68 YGridSpacing
|
||||
31 77 XGridOrigin
|
||||
31 86 YGridOrigin
|
||||
11 98 BlockStarts
|
||||
21 98 BlockStarts
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 185
|
||||
10 0 Connection
|
||||
31 19 Width
|
||||
31 28 Height
|
||||
31 37 DirX/A
|
||||
31 46 DirY/B
|
||||
8 55 Type/C
|
||||
11 67 BlockStarts
|
||||
21 67 BlockStarts
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 186
|
||||
10 0 ConnectionPoints
|
||||
9 20 Width
|
||||
9 29 Height
|
||||
11 79 BlockStarts
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 188
|
||||
10 0 DocProps
|
||||
25 24 DocLangID
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 189
|
||||
10 0 Image
|
||||
9 19 Gamma
|
||||
25 27 Contrast*100 (%)
|
||||
25 29 Brightness*100 (%)
|
||||
25 31 Sharpen*100 (%)
|
||||
25 33 Blur*100 (%)
|
||||
25 35 Denoise*100 (%)
|
||||
25 37 Transparency*100 (%)
|
||||
11 64 BlockStarts
|
||||
21 64 BlockStarts
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 190
|
||||
10 0 Group
|
||||
8 19 SelectMode
|
||||
8 20 DisplayMode
|
||||
0 21 IsDropTarget
|
||||
1 21 IsSnapTarget
|
||||
2 21 IsTextEditTarget
|
||||
3 21 DontMoveChildren
|
||||
11 44 BlocksStart
|
||||
21 44 BlocksStart
|
||||
end
|
||||
|
||||
start 191
|
||||
10 0 Layout
|
||||
0 19 ShapePermeableX
|
||||
1 19 ShapePermeableY
|
||||
2 19 ShapePermeablePlace
|
||||
8 20 ShapeFixedCode
|
||||
8 21 ShapePlowCode
|
||||
8 22 ShapeRouteStyle
|
||||
8 24 ConFixedCode
|
||||
8 25 ConLineJumpCode
|
||||
8 26 ConLineJumpStyle
|
||||
8 28 ConLineJumpDirX
|
||||
8 29 ConLineJumpDirY
|
||||
11 57 BlockStarts
|
||||
21 57 BlockStarts
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 192
|
||||
10 0 PageLayout
|
||||
0 19 ResizePage
|
||||
1 19 EnableGrid
|
||||
2 19 DynamicOff
|
||||
3 19 CtrlAsInput
|
||||
8 20 PlaceStyle
|
||||
8 21 RouteStyle
|
||||
8 22 PlaceDepth
|
||||
8 23 PlowCode
|
||||
8 24 LineJumpCode
|
||||
8 25 LineJumpStyle
|
||||
8 26 PageLineJumpDirX
|
||||
8 27 PageLineJumpDirY
|
||||
9 29 LineToNodeX
|
||||
9 38 LineToNodeY
|
||||
9 47 BlockSizeX
|
||||
9 56 BlockSizeY
|
||||
9 65 AvenueSizeX
|
||||
9 74 AvenueSizeY
|
||||
9 83 LineToLineX
|
||||
9 92 LineToLineY
|
||||
9 100 LineJumpFactorX
|
||||
9 108 LineJumpFactorY
|
||||
8 116 LineAdjustFrom
|
||||
8 117 LineAdjustTo
|
||||
11 163 Blocks start
|
||||
21 163 Blocks start
|
||||
end
|
||||
|
||||
start 193
|
||||
10 0 Unknown 0xc1
|
||||
9 20 Unknown1
|
||||
9 29 Unknown2
|
||||
18 0 0
|
||||
end
|
||||
|
||||
|
||||
start 195
|
||||
10 0 NURBSTo
|
||||
9 20 X
|
||||
9 29 Y
|
||||
9 37 A
|
||||
9 45 B
|
||||
9 53 C
|
||||
9 61 D
|
||||
11 80 BlocksStart
|
||||
21 80 BlocksStart
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 196
|
||||
10 0 Hyperlink
|
||||
0 39 NewWindow
|
||||
2 39 Default
|
||||
11 65 BlocksStart
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 197
|
||||
10 0 Reviewer
|
||||
8 28 ColorRed
|
||||
8 29 ColorGreen
|
||||
8 30 ColorBlue
|
||||
26 31 ReviewerID
|
||||
26 35 CurrentIndex
|
||||
11 57 BlocksStart
|
||||
21 57 BlocksStart
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 198
|
||||
10 0 Unknown 0xc6
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 199
|
||||
10 0 Unknown 0xc7
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 200
|
||||
10 0 PrintProps
|
||||
31 19 PageLeftMargin
|
||||
31 28 PageRightMargin
|
||||
31 37 PageTopMargin
|
||||
31 46 PageBottomMargin
|
||||
9 55 ScaleX
|
||||
9 63 ScaleY
|
||||
25 71 PagesX
|
||||
25 73 PagesY
|
||||
8 76 PrintPageOrientation
|
||||
25 77 PaperKind
|
||||
25 79 PaperSource
|
||||
11 91 BlocksStart
|
||||
21 91 BlocksStart
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 201
|
||||
10 0 Unknown 0xc9
|
||||
18 0 0
|
||||
end
|
||||
|
||||
start 209
|
||||
10 0 NURBSTo E-cell
|
||||
9 35 1st fr of NURBSTo
|
||||
9 43 3 bytes are here, need to map
|
||||
9 51 2nd fr
|
||||
9 59 3rd fr
|
||||
9 67 4th byte
|
||||
9 75 5th byte
|
||||
9 83 4th fr
|
||||
9 91 5th fr
|
||||
9 99 6th byte
|
||||
9 107 7th byte
|
||||
9 115 6th fr
|
||||
9 123 7th fr
|
||||
9 131 8th byte
|
||||
9 139 9th byte
|
||||
18 0 0
|
||||
end
|
|
@ -132,6 +132,56 @@ public static final byte[] data_b = new byte[] { 70, 0, 0, 0,
|
|||
// Should be 19 + length + 8 + 4 big
|
||||
assertEquals(68, chunk.getHeader().getLength());
|
||||
assertEquals(68+19+8+4, chunk.getOnDiskSize());
|
||||
|
||||
// Type is 70, or 0x46
|
||||
assertEquals(70, chunk.getHeader().getType());
|
||||
assertEquals(0x46, chunk.getHeader().getType());
|
||||
|
||||
// Should have two different chunk commands, a
|
||||
// 10 (page sheet) and an 18
|
||||
assertEquals(2, chunk.commandDefinitions.length);
|
||||
|
||||
assertEquals(10, chunk.commandDefinitions[0].getType());
|
||||
assertEquals(0, chunk.commandDefinitions[0].getOffset());
|
||||
assertEquals("PageSheet", chunk.commandDefinitions[0].getName());
|
||||
|
||||
assertEquals(18, chunk.commandDefinitions[1].getType());
|
||||
assertEquals(0, chunk.commandDefinitions[1].getOffset());
|
||||
assertEquals("0", chunk.commandDefinitions[1].getName());
|
||||
}
|
||||
|
||||
public void testAnotherChunk() throws Exception {
|
||||
ChunkFactory cf = new ChunkFactory(11);
|
||||
|
||||
// Go for the 2nd chunk in the stream
|
||||
int offset = 0;
|
||||
Chunk chunk = cf.createChunk(data_b, offset);
|
||||
offset += chunk.getOnDiskSize();
|
||||
chunk = cf.createChunk(data_b, offset);
|
||||
|
||||
assertNotNull(chunk.getHeader());
|
||||
assertNotNull(chunk.getTrailer());
|
||||
assertNotNull(chunk.getSeparator());
|
||||
|
||||
// Should be 19 + length + 8 + 4 big
|
||||
assertEquals(32, chunk.getHeader().getLength());
|
||||
assertEquals(32+19+8+4, chunk.getOnDiskSize());
|
||||
|
||||
// Type is 104, or 0x68
|
||||
assertEquals(104, chunk.getHeader().getType());
|
||||
assertEquals(0x68, chunk.getHeader().getType());
|
||||
|
||||
// Should have two different chunk commands, a
|
||||
// 10 (Unknown) and an 18
|
||||
assertEquals(2, chunk.commandDefinitions.length);
|
||||
|
||||
assertEquals(10, chunk.commandDefinitions[0].getType());
|
||||
assertEquals(0, chunk.commandDefinitions[0].getOffset());
|
||||
assertEquals("Unknown 0x68", chunk.commandDefinitions[0].getName());
|
||||
|
||||
assertEquals(18, chunk.commandDefinitions[1].getType());
|
||||
assertEquals(0, chunk.commandDefinitions[1].getOffset());
|
||||
assertEquals("0", chunk.commandDefinitions[1].getName());
|
||||
}
|
||||
|
||||
public void testManyChunks() throws Exception {
|
||||
|
|
Loading…
Reference in New Issue