Progress on OOo GDI Metafile

Pierre pinaraf at pinaraf.info
Sat Apr 9 01:38:15 BST 2011


Hi

I could not spend a night with no progress on this :)
Here is a first specification draft. 
Are you okay with that formatting/presentation, or do you think something more 
formal is needed ?


Global file structure
=====================

The byte order of the file is Little Endian.
The SVM file is composed of two parts : the header, followed by a list of
actions.
Each of these contain objects, referenced in the last section of this document.

    * Header

- Signature, 6 bytes, equals to "VCLMTF" (without quotes)
- VersionCompat object
- compression mode, uint32
- MapMode object
- width, uint32
- height, uint32
- action count, uint32

    * List of actions

Each action starts with a type index, on uint16, identifying it. The following
data depends on that type.


Actions
=======

LibreOffice 3.3 implements about 52 different actions. I will describe here
only the ones I saw in my documents.

In almost every case (except the null action), an action starts with a
VersionCompat object, which I will name actionCompat in the following text.
Unless mentionned otherwise, each Action starts with such an object.

- Action 103 : draw rectangle
This action draws a rectangle of the given coordinates using the current paint
context. It contains the following objects :
    - topLeft Point
    - bottomRight Point



Objects
=======
- VersionCompat
A VersionCompat object contains two integers :
    - version, uint16
    - size (in bytes), uint32
The total size refers to the «current context». For instance, the VersionCompat
at the beginning of an action will refer to the size of the action.

- Point
A point contains two integers :
    - x, uint32
    - y, uint32

- Polygon

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/calligra-devel/attachments/20110409/1601be6e/attachment.sig>


More information about the calligra-devel mailing list