Asger Kunuk Alstrup wrote: > On Mon, 4 Aug 2003, Angus Leeming wrote: > >> > What about the idea to just remember which one was used the last >> > time across sessions? I think that's much simpler to implement, and >> > it will work wonders. >> >> I think we have different notions of 'simple to implement'. I would >> have to create a new machinery to cache/retrieve such information. >> Now, I can certainly do that, but is it something we really want to >> have? > > Well, you know about std::ifstream and std::ofstream, right? > > Seriously, a feature to save such information in the .lyx directory > would be nice. It would also be nice to have for saving the last > cursor position in docs. We already store the lastfiles in a file, so it's > not entirely new territory. > > Oh, you probably mean in the front-ends? Well, can't the front-ends > access global information? I would suggest to make a singleton class for > this stuff. On construction, it would load the file. On destruction, > it would save the file. Whenever the external dialog opens, it asks > for the last template. Whenever the external dialog changes, it tells > the singleton what happened. > > It seems like something you can manage, you are a big boy now.
Like I said, I know how to go about it. I can also see that this would be useful functionality. However, my question boils down to, "Is it extendable?" Which is another way of asking, "What is the grammar?" This, or something like it, might do: <qt> <dialog name="external"> <widget name="externalCO"> <display>xfig</display> </widget> </dialog> </qt> Given that there seems to be a push to use xml for the lyx file format, it seems reasonable to not invent yet another language where xml will fit the bill. However, my knowledge of xml is very limited and I don't want to reinvent the wheel here. So, what should we use to do the input/output? A quick search of google throws up lots of GNU-compatible libraries. The first three are: libxml2 http://xmlsoft.org/ The Common C++ library http://www.gnu.org/software/commonc++/ Sablotron http://www.gingerall.com/charlie/ga/xml/p_sab.xml -- Angus