Bo Peng wrote:
I am fairly sure that per-inset code using a few common helper function
would end up rather in the 20-30 lines range, and be more flexible in
the end as we do not have to stick to yet another framework.
I would happy to see this as well. There will be no conversion between
params and EmbeddedFileList if we get rid of params altogether. Even
if removing InsetCommand is too costly now, free InsetBibtex from
InsetCommand would be less work.
Please see my other message. What Andre envisages is rolling
InsetCommandParams into the insets. That could be done, of course, but
there are at least some reasons not to do it. The reasons not to do it
are the same as the reasons to have InsetGraphicsParams be separate from
InsetGraphics, so this has nothing to do with ICP as such.
Another option, perhaps the one you have in mind, is to ditch ICP
altogether here and do for InsetBibtex what is presently done for
InsetGraphics and InsetExternal, namely, to give them there own
parameter class built from scratch. But I can see no good reason to do
that. And at present, there is massive code duplication in those two
classes. I don't see why we should add to the chaos.
A different option is to subclass InsetCommandParams specially for
InsetBibtex. I do not see the need for that, either. The trade-off
between what you'd gain and the changes it would require elsewhere isn't
a good one. (I can explain this if necessary, but it'd be nice if
someone would take my word for something here. I do know a bit about
this part of the code.)
A better option, it seems to me, long term, is to recognize the source
of the problem: It's that we have a string-based parameter that
represents a list, so it's hard to work with. We also have this in
InsetCitation. The natural solution would be to make ICP aware that some
parameters represent lists, just as it is now aware that some parameters
can represent keys and values. (Just think how much that fact is going
to simplify the handling of listings parameters. I've been meaning to
mention that to you....) The all the code dealing with such conversions
can be encapsulated in ICP, and the access in InsetBibtex and
InsetCitation will be uniform and extensible.
Richard