FOCanvas File Format
Note: the formats described on this page are highly subject to change, see /ScratchPad for random ideas that are floating around
FOCanvas will Internally Use 2 Objects, An array of pngs (also a possibility: XCF; gimps format... once gimp switches to svn it might be possible to use gimps own code for this), and an XML Form of all the changes, that format will be described in the following Section
XML ChangeSet Format
Note: This is what we will use in the ../Protocol to send changes.
The format allows you to recreate the drawing from a blank canvas, it consists of Many ChangeSets. lets start with an example of a ChangeSet since those are always effective at giving an overview:
<ChangeSet author="Kyle" rev="10"> <Change width="100" height="40" hpos="90" vpos="1">(base-64 encoded pixel data)</Change> <Change ...>...</Change> ... </ChangeSet>
Pretty straight Forward, but I'll explain it too:
ChangeSet Element
a ChangeSet Element represents a set of changes (duh), it contains any number of Change Elements, as well as author and rev Attributes, which are explained below (Off-Topic Note: typically in the protocol the client will send a single ChangeSet element which contains the changes since it last synced with the server)
Attributes:
author: the Author of the changes in the changeset, can be any UTF-8 string
rev: the Revision of said change, currently how this is used is undefined
Change Element
a Change Element represents a change, currently this element is highly subject to change since I havn't thought about this yet, but heres the explaination of the current attributes:
width, height: the width and height a change covers, yes a change must be rectangular
hpos, vpos: the horizontal and vertical position of the start of the change, starts at 1,1 in the upper-left corner