Andreas Klostermann wrote:

> Hi!
> I'm writing the reference dialog for the gtk frontend currently. For the
> documents dialog I need a way to get the current buffer.
> 
> Does somebody know how to do this?

Hello, Andreas.

Your dialog view will have the inheritence tree:

    Dialog::View
    GViewBase
    GViewGladeB
    GViewCB<ControlReference, GViewGladeB>
    GReference

src/frontends/controllers/Dialog.h:

class Dialog::View {
protected:
    Kernel & kernel() { return parent_.kernel(); }
    Kernel const & kernel() const { return parent_.kernel(); }
};    

src/frontends/controllers/Kernel.h:

class Kernel {
public:
    /** \name Kernel Nasties
     *  Unpleasantly public internals of the LyX kernel.
     *  We should aim to reduce/remove these from the interface.
     */
    //@{
    LyXView & lyxview() { return lyxview_; }
    LyXView const & lyxview() const { return lyxview_; }

    Buffer & buffer();
    Buffer const & buffer() const;

    BufferView * bufferview();
    BufferView const * bufferview() const;
    //@}
};

-- 
Angus

Reply via email to