Angus Leeming <[EMAIL PROTECTED]> writes: | Lars Gullik Bjønnes wrote: >> | Angus Leeming wrote: >>>> Lars Gullik Bjxnnes wrote: >>>>> note the member function boost::any:type >>>> >>>> Bingo! No need for exceptions after all. >>>> Many thanks, Lars. >>> >> | Next iteration. I think that this is ready to convert into >> | InsetExternal code. However, I think that I'll also use it in the >> | documentation. >> >> Why are you using auto_ptr and not scoped_ptr? > | Because the code using it does exactly the same as Inset::clone. Just | passes a pointer around safely.
But you are not passing it... isn't it a static class variable? | It isn't. There are just lots of alternatives. The sample code can Resize | or Rotate the primary latex command and it can do so by generating either | a latex command or a latex option, as appropriate. > >> I am unable to read the code and just figure out what it is doing. >> What are you trying to achieve? > | I give up. I have not been exactly quite about my attempts to modify | InsetExternal so that the user can transform the output. quiet? I do not follow all discussions in detail. | A brief synopsis: | InsetExternal::Params struct holds a number of variables that enable the | user to transform the appearence of the InsetExternal, both on screen and | on paper. > | One such is | RotationData rotatiodata; | which simply stores the angle of rotation and the center of rotation. origin | LyX can use this variable as-is to alter the on-screen display, but the | various output formats (latex, linuxdoc, docbook) need to transform it | into an appropriate format. ok > | For example the latex snippet '\input{your_file.fig}' would become | \rotatebox[origin=<origin>]{<angle>}{\input{your_file.fig}} | Whilst the latex snippet '\includegraphics{your_file.eps}' becomes | \includegraphics[origin=<origin>,angle=<angle>]{your_file.eps} > | Ie, the same data is output in different ways depending not only on the | output target (latex, linuxdoc etc) but also on the actual piece of code | output by InsetExternal. ok | So, I have the concept of Transformers that act of the Data. > | I want InsetExternal to know as little as possible about these | Transformers. Essentially all it needs to know is that the Transformer | produces either | 'command-type' output with a front block and a back block | as for \input{} above, or | 'option-type' output which alters the primary command itself, | as for \includegraphics. ok | I can do that by storing the factory functions that generate the | transformers available to a particular output target in a vector | 'somehow'. The problem is the 'somehow'. The different factory functions | have different signatures, taking RotationData, ResizeData etc. very well. | This is where boost::any comes to the rescue. right. -- Lgb