Hi,
a quick note to two of the things you mentioned. Maybe someone can elaborate on the rest in detail.
Inkscape stores the transformation in the file as following:
- "move", "scale" doesn't apply a trans matrix but simply moves, scales
the coordinates. It also adds a second inkscape:perspective element. This one include a property "persp3d". This is related to the src/persp3d.cpp and the Persp3D class.
The persp3d reference only applies to 3D boxes (it points to a perspective stored in the defs which controls how 3D boxes appear on the screen). It has nothing to do with transformations in general so you can neglect it for your purposes.
I then tried to figure out how "move" transformation works: updatePageMove() takes the bounding box from the selection. This is a NR::Rect object (NR::Maybe template). NR stands for "new renderer" right? I follow up to here but then I get a bit confused in this line: double x = bbox->min()[NR::X]; NR::Rect::min() returns a member of the NR::Rect class.
No, NR::Rect::min() returns a NR::Point(). Namely, min() and max() respectively return the lower left and upper right corner of a rectangle (could also be the upper left and lower right, I don't know offhand), i.e. diagonally opposite corners. And NR::X/NR::Y are just enums with values 0/1 which are used as indices for the two coordinates of a point (see libnr/nr-dim2.h for their definition). So the above line simply stores the x-coordinate of the lower left corner of the bounding box (bbox) in a variable named 'x'.
Cheers, Max