On Tue, 8 Feb 2000, James Henstridge wrote:
> I was thinking of ways to get rid of the object/shape distinction in the
> .sheet files (it would be nice if the sheet code didn't even have to know
> what a `shape' file was).
>
> What I was thinking of was to add two fields to the ObjectType structure
> -- a pixmap_file one where an external xpm file could be specified for an
> object, and a default_user_data field that would give the default for the
> user_data field of the SheetObject.
>
> These would be placed at the end of the structure, so that it won't break
> compatibility with current code (the fields would be set to zero in
> current code).
>
> The other thing the custom sheet code gets from the shape files is the
> object description. As this can also be specified in the sheet files, I
> was thinking that it might be a good idea to eliminate the <description>
> tags from custom shape files. This would also reduce the number of files
> translators would have to work with (only the sheet files, rather than all
> the shape files as well).
>
> This would also allow splitting off the custom object code into a normal
> dia plugin like it was before.
>
> What does everyone think of this idea?
I'm not entierly at home in the sheet/custom code, but it seems like a
good idea.
> Another idea I was thinking of was to rework the plugin loading interface.
> The idea is to allow the plugin to describe what it can do. Maybe also
> add the ability to suppress loading of a plug-in (this may be useful when
> the number of dia plugins grows).
Yes, this would probably be a good idea. There is starting to be a lot of
libraries to load now. The obvious way is to call some special function
in each plugin. Something like "dia_register_plugin()" which then uses
some APIs to register different types of resources (object type, export
filters, import filters etc.). These resources, and the .so-file they
are in is then saved in some persistant file in ~/.dia. The plugin probing
can be done lazily such that the libraries are only loaded if needed or if
the datestamp on the .so files has changed.
/ Alex