Dia stuff

My page about things related to Dia, an open-source diagram editor.

Handles and Lines and ConnectionPoints, oh my!

It took me a lot of work to figure out how lines and connections worked internally, and after I made up a diagram to help myself piece it together, I thought it'd be helpful for others too. The diagram involves a Box and three Lines. The "grammar" of the diagram is this: every rectangle represents a chunk of memory. Above the rectangle in italic Times is the type of the chunk, and to its left in upright Courier is its name (if any). DO and CP are abbreviations of DiaObject and ConnectionPoint, respectively. If a rectangle is inside another rectangle, that means the memory is actually contained (i.e. it's included as a struct), not just logically related. Arrows represent pointers. NULL pointers are represented with an X through the rectangle. The size of the typename is not significant except that I've enlarged the ones I think you'll most want to see. I've omitted a number of the member variables (with line attributes, locations, etc) for legibility.

Anything in black is part of the core shape, and would be there even if nothing were connected. The pointers and objects that collectively represent the connections are colour-coded; the three active connections are circled in red, green, and blue in the reference image, and pointers involved in representing each connection are coloured to match. The connection stuff is in a separate layer in the Dia file, which you can make invisible if you want to see the underlying memory layout better.