Le Sun, Jun 02, 2002, à 11:12:02PM -0700, James Michael DuPont a écrit:
> > adding a standard
> > property of type URL, and, why not, tying it to
> > Object (this would require
> > bumping up the plugin API version which is fine for
> > the time being),
> where are the standard attributes stored? in Object? I
> will look into it.
Yes. Look also in lib/properties.h and friends. You will have to add a new
property type, URL, probably best derived from STRING. You will need to
reserve storage for this property into Object. You will need to declare
this property to OBJECT_COMMON_PROPERTIES and
OBJECT_COMMON_PROPERTIES_OFFSETS (for experimental purposes, you may even
simply declare them as PROP_TYPE_STRING until you actually derive URL out of
STRING).
Then, you will "simply" have to retrieve the property value from the object
you want to export, find the relevant shape, size and position of your
object, and then create the relevant image map magic out of that.
> > then find a way (renderer ?) to pass this URL to a
> > PNG+ImageMap export
> > plug-in.
> Yes, well the layout engines will also need to get
> thier extra attributes. The URL is also an attribute,
> but needed by the renderer...
> Also some form of unique id for each node, that would
> be great for clickable graphs.
You may use the object pointer as an ID for the image map export. For the
attribute, it's very simple. You build a GPtrArray* of one property list of
type and name "url", and call object->ops->get_props(obj,proplist). Once
this call returns, your property will hold the value of the object's URL
link.
Of course, once you get this working, we'll want to tweak the UI, to show
that an objects has a non-nil URL property (eg like MS Word does, put a
small "link" icon on the upper left corner of the object when it's
selected). But this is gold-plating at the moment.
-- Cyrille
--
Grumpf.