No unique IDs for objects??



In trying to add text annotation support for several plugin object types, I've come up against a bit of a quandry, which I hope someone here will be able to answer for me. First off, I can't seem to find where the numeric 'id' attribute values present in the Dia XML output are generated; I'm assuming they're simply assigned in a linear fashion by iterating through the objects in each layer, but haven't found the code where it happens. Secondly, assuming that my assumption about how the id attribute is assigned is valid, I'm sort of stuck on trying to get annotations working in general fashion.

Ideally, I'd like to have an identifier (number, string, or otherwise) that would stay with an object through its entire lifecycle (create, save, load, etc.); this would help immensely in keeping the annotation text tied to a certain object, as well as in trying to process the output files with an external filter. At this point, I'm thinking that I may just have to define a new AnnotatedObject type, which has an 'id' property which I can use to correlate objects to notes from outside the standard property editor. That, however, means I lose access to the SVG-defined object types for my plugin.

Would it be too extreme a change for me to dig into the base Object type definition and operations, and add a simple integer ID field? As a starting point, the values could just be generated by incrementing a counter in the current diagram. Are there any other areas of the application that could benefit from this kind of secondary handle to an object?

Thanks,

Lennon Day-Reynolds
Software Engineer
Kestrel Institute





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]