I'm in the process of writing a BibtexDBase class that will store the Bibtex
.bib files used by any open buffer. I think that the best place to store the
instance of this class is in LyX:
class LyX {
BibtexDBase & bibtex();
}
At present, however, I find that I cannot get to LyX from Buffer, where this
database would actually be used. In order to do so, I need to create two new
methods:
LyXGUI * LyXView::owner() const;
LyX * LyXGUI::owner() const;
Allowing me to write:
Buffer * buf = some_buffer;
LyX * lyx = buf->getUser()->owner()->owner()->owner();
ie Buffer -> BufferView -> LyXView -> LyXGUI -> LyX !
Phew, that was longwinded! Or is there a better way to get to this point?
Angus