The attached patch replaces the signal/slot connections between Buffer
and BufferView to LyXView by ordinary delegates.

There has always been only (at most) a single connection of each type
with known endpoints, so full-blown signal/slot was overkill anyway -
at least given the price of boost's signal/slot:

As boost/signal pulls in roughly 50 kLOC into both Buffer.h and
BufferView.h which in turn heavily used throughout the code.
So the change reduces "TLOCC" from 24.6M to 22.5M, i.e. by more than 9%!

There might be a few simplifications possible after that, but I wanted
to keep the patch small.

Andre'
Index: insets/InsetTheorem.cpp
===================================================================
--- insets/InsetTheorem.cpp     (revision 20587)
+++ insets/InsetTheorem.cpp     (working copy)
@@ -1,5 +1,6 @@
+#if 0
 /**
- * \file Inset.heorem.cpp
+ * \file InsetTheorem.cpp
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
@@ -10,7 +11,7 @@
 
 #include <config.h>
 
-#include "Inset.heorem.h"
+#include "InsetTheorem.h"
 #include "insets/InsetText.h"
 
 #include "debug.h"
@@ -100,3 +101,5 @@
 
 
 } // namespace lyx
+
+#endif
Index: insets/InsetTheorem.h
===================================================================
--- insets/InsetTheorem.h       (revision 20587)
+++ insets/InsetTheorem.h       (working copy)
@@ -9,9 +9,10 @@
  * Full author contact details are available in file CREDITS.
  */
 
-#ifndef Inset.heorem_H
-#define Inset.heorem_H
+#if 0
 
+#ifndef INSETTHEOREM_H
+#define INSETTHEOREM_H
 
 #include "InsetCollapsable.h"
 
@@ -49,3 +50,5 @@
 } // namespace lyx
 
 #endif
+
+#endif
Index: BufferView.cpp
===================================================================
--- BufferView.cpp      (revision 20599)
+++ BufferView.cpp      (working copy)
@@ -59,6 +59,7 @@
 #include "insets/InsetText.h"
 
 #include "frontends/alert.h"
+#include "frontends/Delegates.h"
 #include "frontends/FileDialog.h"
 #include "frontends/FontMetrics.h"
 #include "frontends/Painter.h"
@@ -74,6 +75,7 @@
 
 #include <boost/bind.hpp>
 #include <boost/current_function.hpp>
+#include <boost/next_prior.hpp>
 
 #include <functional>
 #include <vector>
@@ -339,7 +341,8 @@
        : width_(0), height_(0), buffer_(buf), wh_(0),
          cursor_(*this),
          multiparsel_cache_(false), anchor_ref_(0), offset_ref_(0),
-         need_centering_(false), intl_(new Intl), last_inset_(0)
+         need_centering_(false), intl_(new Intl), last_inset_(0),
+         gui_(0)
 {
        xsel_cache_.set = false;
        intl_->initKeyMapper(lyxrc.use_kbmap);
@@ -1972,4 +1975,55 @@
                        height_ - metrics_info_.y2, Color::bottomarea);
 }
 
+
+void BufferView::message(docstring const & msg)
+{
+       if (gui_)
+               gui_->message(msg);
+}
+
+
+void BufferView::showDialog(std::string const & name)
+{
+       if (gui_)
+               gui_->showDialog(name);
+}
+
+
+void BufferView::showDialogWithData(std::string const & name,
+       std::string const & data)
+{
+       if (gui_)
+               gui_->showDialogWithData(name, data);
+}
+
+
+void BufferView::showInsetDialog(std::string const & name,
+       std::string const & data, Inset * inset)
+{
+       if (gui_)
+               gui_->showInsetDialog(name, data, inset);
+}
+
+
+void BufferView::updateDialog(std::string const & name, std::string const & 
data)
+{
+       if (gui_)
+               gui_->updateDialog(name, data);
+}
+
+
+void BufferView::layoutChanged(docstring const & layout)
+{
+       if (gui_)
+               gui_->layoutChanged(layout);
+}
+
+
+void BufferView::setGuiDelegate(frontend::GuiBufferViewDelegate * gui)
+{
+       gui_ = gui;
+}
+
+
 } // namespace lyx
Index: Text2.cpp
===================================================================
--- Text2.cpp   (revision 20598)
+++ Text2.cpp   (working copy)
@@ -59,6 +59,7 @@
 #include "support/textutils.h"
 
 #include <boost/current_function.hpp>
+#include <boost/next_prior.hpp>
 
 #include <sstream>
 
Index: mathed/MathData.cpp
===================================================================
--- mathed/MathData.cpp (revision 20587)
+++ mathed/MathData.cpp (working copy)
@@ -29,6 +29,7 @@
 #include "frontends/Painter.h"
 
 #include <boost/assert.hpp>
+#include <boost/next_prior.hpp>
 
 
 namespace lyx {
Index: output_docbook.cpp
===================================================================
--- output_docbook.cpp  (revision 20598)
+++ output_docbook.cpp  (working copy)
@@ -31,7 +31,9 @@
 #include "support/convert.h"
 #include "support/types.h"
 
+#include <boost/next_prior.hpp>
 
+
 namespace lyx {
 
 using support::subst;
Index: TextMetrics.cpp
===================================================================
--- TextMetrics.cpp     (revision 20598)
+++ TextMetrics.cpp     (working copy)
@@ -1281,7 +1281,8 @@
        int yy = pm.position() - pm.ascent();
        BOOST_ASSERT(!pm.rows().empty());
        RowList::const_iterator rit = pm.rows().begin();
-       RowList::const_iterator const rlast = boost::prior(pm.rows().end());
+       RowList::const_iterator rlast = pm.rows().end();
+       --rlast;
        for (; rit != rlast; yy += rit->height(), ++rit)
                if (yy + rit->height() > y)
                        break;
Index: Buffer.h
===================================================================
--- Buffer.h    (revision 20587)
+++ Buffer.h    (working copy)
@@ -21,7 +21,6 @@
 #include "support/docstream.h"
 
 #include <boost/scoped_ptr.hpp>
-#include <boost/signal.hpp>
 
 #include <iosfwd>
 #include <string>
@@ -40,7 +39,6 @@
 class Font;
 class Lexer;
 class LyXRC;
-class Text;
 class LyXVC;
 class LaTeXFeatures;
 class Language;
@@ -49,12 +47,15 @@
 class ParConstIterator;
 class ParIterator;
 class ParagraphList;
+class Text;
 class TeXErrors;
 class TexRow;
 class TocBackend;
 class Undo;
 
+namespace frontend { class GuiBufferDelegate; }
 
+
 /** The buffer object.
  * This is the buffer object. It contains all the informations about
  * a document loaded into LyX.
@@ -141,25 +142,27 @@
        bool hasParWithID(int id) const;
 
        /// This signal is emitted when the buffer is changed.
-       boost::signal<void()> changed;
+       void changed() const;
        /// This signal is emitted when the buffer structure is changed.
-       boost::signal<void()> structureChanged;
+       void structureChanged() const;
        /// This signal is emitted when an embedded file is changed
-       boost::signal<void()> embeddingChanged;
+       void embeddingChanged() const;
        /// This signal is emitted when some parsing error shows up.
-       boost::signal<void(std::string)> errors;
+       void errors(std::string const &) const;
        /// This signal is emitted when some message shows up.
-       boost::signal<void(docstring)> message;
+       void message(docstring const &) const;
        /// This signal is emitted when the buffer busy status change.
-       boost::signal<void(bool)> busy;
+       void busy(bool) const;
        /// This signal is emitted when the buffer readonly status change.
-       boost::signal<void(bool)> readonly;
+       void readonly(bool) const;
        /// Update window titles of all users.
-       boost::signal<void()> updateTitles;
+       void updateTitles() const;
        /// Reset autosave timers for all users.
-       boost::signal<void()> resetAutosaveTimers;
+       void resetAutosaveTimers() const;
        /// This signal is emitting if the buffer is being closed.
-       boost::signal<void(Buffer *)> closing;
+       void closing(Buffer *) const;
+       ///
+       void setGuiDelegate(frontend::GuiBufferDelegate *);
 
 
        /** Save file.
@@ -422,6 +425,8 @@
        /// A cache for the bibfiles (including bibfiles of loaded child
        /// documents), needed for appropriate update of natbib labels.
        mutable std::vector<support::FileName> bibfilesCache_;
+
+       frontend::GuiBufferDelegate * gui_;
 };
 
 
Index: Text.cpp
===================================================================
--- Text.cpp    (revision 20587)
+++ Text.cpp    (working copy)
@@ -68,6 +68,7 @@
 #include "support/convert.h"
 
 #include <boost/current_function.hpp>
+#include <boost/next_prior.hpp>
 
 #include <sstream>
 
Index: frontends/LyXView.h
===================================================================
--- frontends/LyXView.h (revision 20641)
+++ frontends/LyXView.h (working copy)
@@ -14,10 +14,9 @@
 #define LYXVIEW_H
 
 #include "frontends/Application.h"
+#include "frontends/Delegates.h"
 #include "support/docstring.h"
 
-#include <boost/signal.hpp>
-#include <boost/signals/trackable.hpp>
 #include <boost/noncopyable.hpp>
 
 #include <vector>
@@ -54,7 +53,9 @@
  * Additionally we would like to support multiple views
  * in a single LyXView.
  */
-class LyXView : public boost::signals::trackable, boost::noncopyable {
+class LyXView : boost::noncopyable,
+       public GuiBufferViewDelegate, public GuiBufferDelegate
+{
 public:
        ///
        LyXView(int id);
@@ -155,6 +156,8 @@
        /// update the status bar
        virtual void updateStatusBar() = 0;
 
+       void layoutChanged(docstring const &);
+
        /// display a message in the view
        virtual void message(docstring const &) = 0;
 
@@ -181,7 +184,29 @@
        /// show the error list to the user
        void showErrorList(std::string const &);
 
-protected:
+       
+       //
+       // GuiBufferDelegate
+       //
+       /// This function is called when the buffer is changed.
+       void changed();
+       /// This function is called if the buffer is being closed.
+       void closing(Buffer *);
+       /// This function is called when the buffer structure is changed.
+       void structureChanged() { updateToc(); }
+       /// This function is called when an embedded file is changed
+       void embeddingChanged() { updateEmbeddedFiles(); }
+       /// This function is called when some parsing error shows up.
+       void errors(std::string const & err) { showErrorList(err); }
+       /// This function is called when the buffer busy status change.
+       //void busy(bool);
+       /// This function is called when the buffer readonly status change.
+       void readonly(bool on) { showReadonly(on); }
+       /// Update window titles of all users.
+       void updateTitles() { updateWindowTitle(); }
+       /// Reset autosave timers for all users.
+       void resetAutosaveTimers() { resetAutosaveTimer(); }
+
        /// connect to signals in the given BufferView
        void connectBufferView(BufferView & bv);
        /// disconnect from signals in the given BufferView
@@ -210,33 +235,6 @@
        /// dialogs for this view
        Dialogs * dialogs_;
 
-       /// buffer structure changed signal connection
-       boost::signals::connection bufferStructureChangedConnection_;
-       /// embedded file change signal connection
-       boost::signals::connection bufferEmbeddingChangedConnection_;
-       /// buffer errors signal connection
-       boost::signals::connection errorsConnection_;
-       /// buffer messages signal connection
-       boost::signals::connection messageConnection_;
-       /// buffer busy status signal connection
-       boost::signals::connection busyConnection_;
-       /// buffer title changed signal connection
-       boost::signals::connection titleConnection_;
-       /// buffer reset timers signal connection
-       boost::signals::connection timerConnection_;
-       /// buffer readonly status changed signal connection
-       boost::signals::connection readonlyConnection_;
-
-       /// BufferView messages signal connection
-       //@{
-       boost::signals::connection message_connection_;
-       boost::signals::connection show_dialog_connection_;
-       boost::signals::connection show_dialog_with_data_connection_;
-       boost::signals::connection show_inset_dialog_connection_;
-       boost::signals::connection update_dialog_connection_;
-       boost::signals::connection layout_changed_connection_;
-       //@}
-
        /// Bind methods for BufferView messages signal connection
        //@{
        void showDialog(std::string const & name);
Index: frontends/WorkArea.h
===================================================================
--- frontends/WorkArea.h        (revision 20641)
+++ frontends/WorkArea.h        (working copy)
@@ -15,12 +15,11 @@
 #define BASE_WORKAREA_H
 
 #include "frontends/key_state.h"
+#include "frontends/Delegates.h"
 
 #include "support/Timeout.h"
 #include "support/docstring.h"
 
-#include <boost/signals/trackable.hpp>
-
 #undef CursorShape
 
 namespace lyx {
@@ -106,10 +105,6 @@
        ///
        void dispatch(FuncRequest const & cmd0,
                key_modifier::state = key_modifier::none);
-
-       /// close this work area.
-       /// Slot for Buffer::closing boost signal.
-       void close();
        ///
        void resizeBufferView();
        /// hide the visible cursor, if it is visible
@@ -136,11 +131,6 @@
 
        ///
        Timeout cursor_timeout_;
-
-       /// buffer changed signal connection
-       boost::signals::connection bufferChangedConnection_;
-       /// buffer closing signal connection
-       boost::signals::connection bufferClosingConnection_;
 };
 
 } // namespace frontend
Index: frontends/Delegates.h
===================================================================
--- frontends/Delegates.h       (revision 0)
+++ frontends/Delegates.h       (revision 0)
@@ -0,0 +1,82 @@
+// -*- C++ -*-
+/**
+ * \file Delegates.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author André Pönitz
+ *
+ * Full author contact details are available in file CREDITS.
+ */
+
+#ifndef DELEGATES_H
+#define DELEGATES_H
+
+#include "support/docstring.h"
+
+namespace lyx {
+
+class Buffer;
+class Inset;
+
+namespace frontend {
+
+class GuiBufferViewDelegate 
+{
+public:
+       virtual ~GuiBufferViewDelegate() {}
+
+       /// This function is called when some message shows up.
+       virtual void message(docstring const & msg) = 0;
+
+       /// This function is called when some dialog needs to be shown.
+       virtual void showDialog(std::string const & name) = 0;
+
+       /// This function is called when some dialog needs to be shown with
+       /// some data.
+       virtual void showDialogWithData(std::string const & name,
+               std::string const & data) = 0;
+
+       /// This function is called when some inset dialogs needs to be shown.
+       virtual void showInsetDialog(std::string const & name,
+               std::string const & data, Inset * inset) = 0;
+
+       /// This function is called when some dialogs needs to be updated.
+       virtual void updateDialog(std::string const & name,
+               std::string const & data) = 0;
+
+       /// This function is called when the layout at the cursor is changed.
+       virtual void layoutChanged(docstring const & layout) = 0;
+};
+
+
+class GuiBufferDelegate
+{
+public:
+       virtual ~GuiBufferDelegate() {}
+       /// This function is called when the buffer is changed.
+       virtual void changed() = 0;
+       /// This function is called when the buffer structure is changed.
+       virtual void structureChanged() = 0;
+       /// This function is called when an embedded file is changed
+       virtual void embeddingChanged() = 0;
+       /// This function is called when some parsing error shows up.
+       virtual void errors(std::string const &) = 0;
+       /// This function is called when some message shows up.
+       virtual void message(docstring const &) = 0;
+       /// This function is called when the buffer busy status change.
+       virtual void busy(bool) = 0;
+       /// This function is called when the buffer readonly status change.
+       virtual void readonly(bool) = 0;
+       /// Update window titles of all users.
+       virtual void updateTitles() = 0;
+       /// Reset autosave timers for all users.
+       virtual void resetAutosaveTimers() = 0;
+       /// This signal is emitting if the buffer is being closed.
+       virtual void closing(Buffer *) = 0;
+};
+
+} // namespace frontend
+} // namespace lyx
+
+#endif
Index: frontends/LyXView.cpp
===================================================================
--- frontends/LyXView.cpp       (revision 20641)
+++ frontends/LyXView.cpp       (working copy)
@@ -167,93 +167,44 @@
 
 void LyXView::connectBuffer(Buffer & buf)
 {
-       if (errorsConnection_.connected())
-               disconnectBuffer();
-
-       bufferStructureChangedConnection_ =
-               buf.getMasterBuffer()->structureChanged.connect(
-                       boost::bind(&LyXView::updateToc, this));
-
-       bufferEmbeddingChangedConnection_ =
-               buf.embeddingChanged.connect(
-                       boost::bind(&LyXView::updateEmbeddedFiles, this));
-
-       errorsConnection_ =
-               buf.errors.connect(
-                       boost::bind(&LyXView::showErrorList, this, _1));
-
-       messageConnection_ =
-               buf.message.connect(
-                       boost::bind(&LyXView::message, this, _1));
-
-       busyConnection_ =
-               buf.busy.connect(
-                       boost::bind(&LyXView::busy, this, _1));
-
-       titleConnection_ =
-               buf.updateTitles.connect(
-                       boost::bind(&LyXView::updateWindowTitle, this));
-
-       timerConnection_ =
-               buf.resetAutosaveTimers.connect(
-                       boost::bind(&LyXView::resetAutosaveTimer, this));
-
-       readonlyConnection_ =
-               buf.readonly.connect(
-                       boost::bind(&LyXView::showReadonly, this, _1));
+       buf.setGuiDelegate(this);
 }
 
 
 void LyXView::disconnectBuffer()
 {
-       errorsConnection_.disconnect();
-       bufferStructureChangedConnection_.disconnect();
-       bufferEmbeddingChangedConnection_.disconnect();
-       messageConnection_.disconnect();
-       busyConnection_.disconnect();
-       titleConnection_.disconnect();
-       timerConnection_.disconnect();
-       readonlyConnection_.disconnect();
-       layout_changed_connection_.disconnect();
+       if (WorkArea * work_area = currentWorkArea())
+               work_area->bufferView().setGuiDelegate(0);
 }
 
 
 void LyXView::connectBufferView(BufferView & bv)
 {
-       message_connection_ = bv.message.connect(
-                       boost::bind(&LyXView::message, this, _1));
-       show_dialog_connection_ = bv.showDialog.connect(
-                       boost::bind(&LyXView::showDialog, this, _1));
-       show_dialog_with_data_connection_ = bv.showDialogWithData.connect(
-                       boost::bind(&LyXView::showDialogWithData, this, _1, 
_2));
-       show_inset_dialog_connection_ = bv.showInsetDialog.connect(
-                       boost::bind(&LyXView::showInsetDialog, this, _1, _2, 
_3));
-       update_dialog_connection_ = bv.updateDialog.connect(
-                       boost::bind(&LyXView::updateDialog, this, _1, _2));
-       layout_changed_connection_ = bv.layoutChanged.connect(
-                       boost::bind(&Toolbars::setLayout, toolbars_, _1));
+       bv.setGuiDelegate(this);
 }
 
 
 void LyXView::disconnectBufferView()
 {
-       message_connection_.disconnect();
-       show_dialog_connection_.disconnect();
-       show_dialog_with_data_connection_.disconnect();
-       show_inset_dialog_connection_.disconnect();
-       update_dialog_connection_.disconnect();
+       if (WorkArea * work_area = currentWorkArea())
+               work_area->bufferView().setGuiDelegate(0);
 }
 
 
 void LyXView::showErrorList(string const & error_type)
 {
        ErrorList & el = buffer()->errorList(error_type);
-       if (!el.empty()) {
+       if (!el.empty())
                getDialogs().show("errorlist", error_type);
-       }
 }
 
 
+void LyXView::layoutChanged(docstring const & layout)
+{
+       toolbars_->setLayout(layout);
+}
+
+
 void LyXView::showDialog(string const & name)
 {
        getDialogs().show(name);
@@ -449,5 +400,20 @@
        return toolbars_->visible(id);
 }
 
+
+void LyXView::changed()
+{
+       if (WorkArea * wa = currentWorkArea())
+               wa->redraw();
+}
+
+
+void LyXView::closing(Buffer *)
+{
+       if (WorkArea * wa = currentWorkArea())
+               removeWorkArea(wa);
+}
+
+
 } // namespace frontend
 } // namespace lyx
Index: frontends/WorkArea.cpp
===================================================================
--- frontends/WorkArea.cpp      (revision 20641)
+++ frontends/WorkArea.cpp      (working copy)
@@ -72,38 +72,16 @@
        timecon = cursor_timeout_.timeout
                .connect(boost::bind(&WorkArea::toggleCursor, this));
 
-       bufferChangedConnection_ =
-               buffer.changed.connect(
-                       boost::bind(&WorkArea::redraw, this));
-
-       bufferClosingConnection_ =
-               buffer.closing.connect(
-               boost::bind(&WorkArea::close, this));
-
        cursor_timeout_.start();
 }
 
 
 WorkArea::~WorkArea()
 {
-       bufferChangedConnection_.disconnect();
-       bufferClosingConnection_.disconnect();
-
        delete buffer_view_;
 }
 
 
-void WorkArea::close()
-{
-       lyx_view_->removeWorkArea(this);
-}
-
-//void WorkArea::setLyXView(LyXView * lyx_view)
-//{
-//     lyx_view_ = lyx_view;
-//}
-
-
 BufferView & WorkArea::bufferView()
 {
        return *buffer_view_;
Index: CutAndPaste.cpp
===================================================================
--- CutAndPaste.cpp     (revision 20587)
+++ CutAndPaste.cpp     (working copy)
@@ -51,6 +51,7 @@
 
 #include <boost/current_function.hpp>
 #include <boost/tuple/tuple.hpp>
+#include <boost/next_prior.hpp>
 
 #include <string>
 
Index: BufferList.cpp
===================================================================
--- BufferList.cpp      (revision 20587)
+++ BufferList.cpp      (working copy)
@@ -330,7 +330,9 @@
 {
        // Use ::assert to avoid a loop, BOOST_ASSERT ends up calling ::assert
        // compare with 0 to avoid pointer/interger comparison
-       assert(buf != 0);
+       // ::assert(buf != 0);
+       if (!buf)
+               return;
 
        // No need to save if the buffer has not changed.
        if (buf->isClean())
Index: pch.h
===================================================================
--- pch.h       (revision 20608)
+++ pch.h       (working copy)
@@ -13,9 +13,6 @@
 #include <boost/scoped_array.hpp>
 #include <boost/scoped_ptr.hpp>
 #include <boost/shared_ptr.hpp>
-#include <boost/signal.hpp>
-#include <boost/signals/connection.hpp>
-#include <boost/signals/trackable.hpp>
 #include <boost/tokenizer.hpp>
 #include <boost/tuple/tuple.hpp>
 #include <boost/noncopyable.hpp>
Index: output_latex.cpp
===================================================================
--- output_latex.cpp    (revision 20598)
+++ output_latex.cpp    (working copy)
@@ -31,6 +31,7 @@
 
 #include "support/lstrings.h"
 
+#include <boost/next_prior.hpp>
 
 namespace lyx {
 
Index: BufferView.h
===================================================================
--- BufferView.h        (revision 20608)
+++ BufferView.h        (working copy)
@@ -23,9 +23,7 @@
 
 #include "support/types.h"
 
-#include <boost/tuple/tuple.hpp>
 #include <boost/noncopyable.hpp>
-#include <boost/signal.hpp>
 
 #include <utility>
 #include <string>
@@ -36,6 +34,7 @@
 namespace support { class FileName; }
 
 namespace frontend { class Painter; }
+namespace frontend { class GuiBufferViewDelegate; }
 
 class Buffer;
 class Change;
@@ -89,7 +88,7 @@
 public:
        ///
        BufferView(Buffer & buffer);
-
+       ///
        ~BufferView();
 
        /// return the buffer being viewed.
@@ -234,28 +233,32 @@
        ///
        Intl const & getIntl() const { return *intl_.get(); }
 
+       //
+       // Messages to the GUI
+       //
        /// This signal is emitted when some message shows up.
-       boost::signal<void(docstring)> message;
+       void message(docstring const & msg);
 
        /// This signal is emitted when some dialog needs to be shown.
-       boost::signal<void(std::string name)> showDialog;
+       void showDialog(std::string const & name);
 
        /// This signal is emitted when some dialog needs to be shown with
        /// some data.
-       boost::signal<void(std::string name,
-               std::string data)> showDialogWithData;
+       void showDialogWithData(std::string const & name, std::string const & 
data);
 
        /// This signal is emitted when some inset dialogs needs to be shown.
-       boost::signal<void(std::string name, std::string data,
-               Inset * inset)> showInsetDialog;
+       void showInsetDialog(std::string const & name, std::string const & data,
+               Inset * inset);
 
        /// This signal is emitted when some dialogs needs to be updated.
-       boost::signal<void(std::string name,
-               std::string data)> updateDialog;
+       void updateDialog(std::string const & name, std::string const & data);
 
        /// This signal is emitted when the layout at the cursor is changed.
-       boost::signal<void(docstring layout)> layoutChanged;
+       void layoutChanged(docstring const & layout);
 
+       ///
+       void setGuiDelegate(frontend::GuiBufferViewDelegate *);
+
 private:
        // the position relative to (0, baseline) of outermost paragraph
        Point coordOffset(DocIterator const & dit, bool boundary) const;
@@ -320,6 +323,9 @@
        /// A map from a Text to the associated text metrics
        typedef std::map<Text const *, TextMetrics> TextMetricsCache;
        mutable TextMetricsCache text_metrics_;
+
+       // Whom to notify. Not owned, so don't delete.
+       frontend::GuiBufferViewDelegate * gui_;
 };
 
 /// some space for drawing the 'nested' markers (in pixel)
Index: Buffer.cpp
===================================================================
--- Buffer.cpp  (revision 20598)
+++ Buffer.cpp  (working copy)
@@ -68,6 +68,7 @@
 #include "mathed/MathSupport.h"
 
 #include "frontends/alert.h"
+#include "frontends/Delegates.h"
 
 #include "graphics/Previews.h"
 
@@ -225,7 +226,7 @@
 
 
 Buffer::Buffer(string const & file, bool readonly)
-       : pimpl_(new Impl(*this, FileName(file), readonly))
+       : pimpl_(new Impl(*this, FileName(file), readonly)), gui_(0)
 {
        LYXERR(Debug::INFO) << "Buffer::Buffer()" << endl;
 }
@@ -1893,4 +1894,79 @@
 }
 
 
+void Buffer::changed() const
+{
+       if (gui_)
+               gui_->changed();
+}
+
+
+void Buffer::structureChanged() const
+{
+       if (gui_)
+               gui_->structureChanged();
+}
+
+
+void Buffer::embeddingChanged() const
+{
+       if (gui_)
+               gui_->embeddingChanged();
+}
+
+
+void Buffer::errors(std::string const & err) const
+{
+       if (gui_)
+               gui_->errors(err);
+}
+
+
+void Buffer::message(docstring const & msg) const
+{
+       if (gui_)
+               gui_->message(msg);
+}
+
+
+void Buffer::busy(bool on) const
+{
+       if (gui_)
+               gui_->busy(on);
+}
+
+
+void Buffer::readonly(bool on) const
+{
+       if (gui_)
+               gui_->readonly(on);
+}
+
+
+void Buffer::updateTitles() const
+{
+       if (gui_)
+               gui_->updateTitles();
+}
+
+
+void Buffer::resetAutosaveTimers() const
+{
+       if (gui_)
+               gui_->resetAutosaveTimers();
+}
+
+
+void Buffer::closing(Buffer * buf) const
+{
+       if (gui_)
+               gui_->closing(buf);
+}
+
+
+void Buffer::setGuiDelegate(frontend::GuiBufferDelegate * gui)
+{
+       gui_ = gui;
+}
+
 } // namespace lyx

Reply via email to