|
<?xml version="1.0" ?>
<!DOCTYPE binary_file_format SYSTEM "BinaryFileFormat.dtd">
<binary_file_format name="HEG_File" type_name="" comment="">
<define_struct type_name="square" comment="" expr="({this.dx} X {this.dy}) at ({this.x}, {this.y})">
<data type="int" name="flags" format="unsigned" len="1" display="hex" domain="this == 0" />
<data type="int" name="colid" format="unsigned" len="2" />
<data type="real" name="x" format="ieee" len="4" />
<data type="real" name="y" format="ieee" len="4" />
<data type="real" name="dx" format="ieee" len="4" domain="this > 0.0" />
<data type="real" name="dy" format="ieee" len="4" domain="this > 0.0" />
</define_struct>
<define_struct type_name="circle" comment="" expr="radius=this.radius at ({this.x}, {this.y})">
<data type="int" name="flags" format="unsigned" len="1" display="hex" domain="this == 0" />
<data type="int" name="colid" format="unsigned" len="2" />
<data type="real" name="x" format="ieee" len="4" />
<data type="real" name="y" format="ieee" len="4" />
<data type="real" name="radius" format="ieee" len="4" domain="this > 0.0" />
</define_struct>
<define_struct type_name="group" comment="" expr="{this.count} sub-objects">
<data type="int" name="flags" format="unsigned" len="1" display="hex" domain="this == 0" />
<data type="int" name="count" format="unsigned" len="2" comment="Number of grouped objects." />
<data type="real" name="x" format="ieee" len="4" />
<data type="real" name="y" format="ieee" len="4" />
<for name="object" count="count" stop_test="" type_name="" comment="">
<struct name="" type_name="" comment="">
<data type="int" name="next_type" format="signed" len="1" />
<if test="next_type == 1" comment="">
<use_struct name="sub_square" type_name="square" comment="" />
</if>
<if test="next_type == 2" comment="">
<use_struct name="sub_circle" type_name="circle" comment="" />
</if>
<if test="next_type == 10" comment="">
<use_struct name="sub_group" type_name="group" comment="" />
</if>
</struct>
</for>
</define_struct>
<struct name="header" type_name="" comment="">
<data type="int" name="magic" format="unsigned" len="4" domain="this == 0x16071958" display="hex"
comment="HEG file magic number - should always be 16071958 hex." />
<data type="date" name="created" format="c" comment="When the image was created." />
<data type="date" name="modified" format="c" comment="When the image was last changed."
domain="this > created" />
<data type="int" name="colour_table_address" format="unsigned" len="4" display="hex" comment="Address in the file of the colours table." />
</struct>
<for name="object" count="" stop_test="this.next_type == 0" type_name="" comment="">
<struct name="" type_name="" comment="" expr="{this.next_type == 1 ? "SQUARE" : (this.next_type == 2 ? "CIRCLE" : (this.next_type == 10 ? "GROUP" : "END"))}">
<data type="int" name="next_type" format="unsigned" len="1" />
<if test="next_type == 1" comment="">
<use_struct name="square" type_name="square" comment="" />
</if>
<if test="next_type == 2" comment="">
<use_struct name="circle" type_name="circle" comment="" />
</if>
<if test="next_type == 10" comment="">
<use_struct name="group" type_name="group" comment="" />
</if>
</struct>
</for>
<data type="none" name="dummy" len="1" comment="Extra byte for word alignment." />
<data type="int" name="num_cols" format="unsigned" len="2" domain="this > 0" />
<for name="col" count="num_cols" stop_test="" type_name="" comment="">
<struct name="" type_name="" comment="">
<data type="string" name="name" format="ascii" len="13" />
<data type="int" name="red" format="unsigned" len="1" />
<data type="int" name="green" format="unsigned" len="1" />
<data type="int" name="blue" format="unsigned" len="1" />
</struct>
</for>
</binary_file_format>
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Andrew has a BSc (1983) from Sydney University in Computer Science and Mathematics. Andrew began programming professionally in C in 1984 and has since used many languages but mainly C, C++, and C#.
Andrew has a particular interest in STL, .Net, and Agile Development. He has written articles on STL for technical journals such as the C/C++ User's Journal.
In 1997 Andrew began using MFC and released the source code for a Windows binary file editor called HexEdit, which was downloaded more than 1 million times. From 2001 there was a shareware version of HexEdit (later called HexEdit Pro). HexEdit has been updated to uses the new MFC (based on BCG) and is once more open source.