Angus Leeming wrote:

>>> That is, we need a 'prepare_for_export(LaTexFlavour const &)' member
>>> function in the insets or somesuch. The actual 'latex' member function
>>> will do no more than dump the appropriate text to the ostream.
>>  
>> But why the prepare_for_export must be latex-specific? Couldn't it be
>> prepare_for_export(string const & format) or something?
> 
> The point is that it's up to the inset to decide on the best output format
> for an image (etc). We would supply prepare_for_export with some
> identifier to enable the inset to decide this.

Oh, yes, I meant to pass the 'export' format of the buffer, i.e.
latex-for-xxx, docbook, etc... So, the 'backend name'.

> Because the second step depends on the first. There is only one conversion
> path for the second but possibly hundreds for the first. Only when these
> are all finished should the second start. Moreover, once the images have
> been converted once, they need not be converted again, unless the image
> changes. The entire mechanism exists already in the lyx::graphics stuff
> but we need the ability to specify the final format (no longer just
> pixmap).

Humm... you lost me (sorry for being thick). If the second step has only one
conversion path, why it "depends" on the first step? I mean, we could as
well do all toghether?

> Actually, I think that prepare_for_export could check whether the
> converted image has been generated and if not add some lines to an ostream
> that is eventually dumped as a shell script. That way we would need to
> monitor only one process and wouldn't run into system overload problems
> that your LoaderQueue was designed to overcome for on-screen display.

That's a good idea I think. We could have the convert code return directly
the command sequence for this purpose, instead of calling each converter in
the path. But I still don't see the need for this 'two pass' stuff.

Say we pass down 2 streams and a backend name: the actual output stream, and
the 'shell commands' stream. The graphics insets would look at the backend
name, add their part to the output stream (\begin{graphic} whatever) and
add the commands to convert the graphic on the second one. At the end of
the export, the second stream is executed.

Regards, Alfredo


Reply via email to