Andre Poenitz wrote: > "More than one lyxview" would need some generic solution as e.g. mathed > can't cope with that anyway (and I doubt graphics will - or anything > caching a bv_ privately for that matter). That's solidly a few years in > the future, if at all...
The graphics loading stuff does not use BufferView at all. Granted, the things _using_ the graphics cache do (PreviewedInset and GraphicsInset), but if you can come up with a generic inset solution, aka pass the BufferView, then these will use it too. In fact, the results below look pretty good in this respect. $ grep BufferView graphics/* insets/graphicinset.[Ch] graphics/PreviewedInset.C:#include "BufferView.h" graphics/PreviewedInset.C:BufferView * PreviewedInset::view() const graphics/PreviewedInset.h:class BufferView; graphics/PreviewedInset.h: BufferView * view() const; insets/graphicinset.C:#include "BufferView.h" insets/graphicinset.C:void GraphicInset::view(BufferView * bv) const insets/graphicinset.C:BufferView * GraphicInset::view() const insets/graphicinset.C: // Cache the BufferView. insets/graphicinset.h:class BufferView; insets/graphicinset.h: void view(BufferView *) const; insets/graphicinset.h: BufferView * view() const; insets/graphicinset.h: mutable boost::weak_ptr<BufferView> view_; $ grep "view()" graphics/* insets/graphicinset.* graphics/PreviewedInset.C: return inset_.view(); graphics/PreviewedInset.C: !view() || !view()->buffer()) graphics/PreviewedInset.C: grfx::PreviewLoader & loader = previews.loader(view()->buffer()); graphics/PreviewedInset.C: if (!view() || !view()->buffer() || snippet_.empty()) graphics/PreviewedInset.C: grfx::PreviewLoader & loader = previews.loader(view()->buffer()); graphics/PreviewedInset.C: !view() || !view()->buffer()) graphics/PreviewedInset.C: grfx::Previews::get().loader(view()->buffer()); graphics/PreviewedInset.C: if (view()) graphics/PreviewedInset.C: view()->updateInset(&inset_); graphics/PreviewedInset.h: BufferView * view() const; insets/graphicinset.C: view_ = bv->owner()->view(); insets/graphicinset.C:BufferView * GraphicInset::view() const insets/graphicinset.h: BufferView * view() const; --