#include "insets/insettext.h"
#include "frontends/Alert.h"
-#include "frontends/Clipboard.h"
-#include "frontends/Dialogs.h"
#include "frontends/FileDialog.h"
#include "frontends/font_metrics.h"
-#include "frontends/LyXView.h"
-#include "frontends/Selection.h"
#include "graphics/Previews.h"
#include <vector>
-using lyx::frontend::Clipboard;
-
using lyx::docstring;
using lyx::pos_type;
} // anon namespace
-BufferView::BufferView(LyXView * owner)
- : owner_(owner), buffer_(0), wh_(0),
+BufferView::BufferView()
+ : buffer_(0), wh_(0),
cursor_(*this),
multiparsel_cache_(false), anchor_ref_(0), offset_ref_(0),
intl_(new Intl)
}
-LyXView * BufferView::owner() const
-{
- return owner_;
-}
-
-
void BufferView::setBuffer(Buffer * b)
{
lyxerr[Debug::INFO] << BOOST_CURRENT_FUNCTION
#include "cursor.h"
#include "metricsinfo.h"
-#include "frontends/LyXKeySym.h"
-
#include "support/types.h"
#include <boost/utility.hpp>
class Language;
class LCursor;
class LyXText;
-class LyXView;
class ParIterator;
class ViewMetricsInfo;
*/
class BufferView : boost::noncopyable {
public:
- /**
- * Create a view with the given owner main window,
- * of the given dimensions.
- */
- BufferView(LyXView * owner);
+ BufferView();
~BufferView();
/// return the buffer being viewed
Buffer * buffer() const;
- /// return the owning main view
- LyXView * owner() const;
-
/// resize event has happened
void resize();
boost::signal<void(std::string name,
std::string data)> updateDialog;
+ /// This signal is emitted when the layout at the cursor is changed.
+ boost::signal<void(std::string layout)> layoutChanged;
+
private:
///
bool multiParSel();
///
ViewMetricsInfo metrics_info_;
- ///
- LyXView * owner_;
///
Buffer * buffer_;
#include "support/lstrings.h"
-#include "frontends/LyXView.h"
+#include "frontends/Application.h"
#include "frontends/Clipboard.h"
#include <boost/tuple/tuple.hpp>
#include "paragraph.h"
#include "tex-strings.h"
-#include "frontends/LyXView.h"
-
#include "support/lstrings.h"
#include <sstream>
#include "pariterator.h"
#include "frontends/Alert.h"
-#include "frontends/LyXView.h"
#include "insets/insetcommand.h"
#include "insets/insettext.h"
#include "support/limited_stack.h"
-#include "frontends/LyXView.h"
+#include "frontends/Application.h"
#include "frontends/font_metrics.h"
#include <boost/assert.hpp>
timerConnection_.disconnect();
readonlyConnection_.disconnect();
closingConnection_.disconnect();
+ layout_changed_connection_.disconnect();
}
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_.get(), _1));
}
}
-void LyXView::setLayout(string const & layout)
-{
- toolbars_->setLayout(layout);
-}
-
-
void LyXView::updateToolbars()
{
bool const math = work_area_->bufferView().cursor().inMathed();
/// set a buffer to the current workarea
void setBuffer(Buffer * b);
- /// sets the layout in the toolbar layout selection
- void setLayout(std::string const & layout);
/// updates the possible layouts selectable
void updateLayoutChoice();
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
// Skip these when selecting
if (cmd0.action != LFUN_MOUSE_MOTION) {
lyx_view_.updateLayoutChoice();
+ lyx_view_.updateMenubar();
lyx_view_.updateToolbars();
}
work_areas_[id].reset(new GuiWorkArea(w, h, *view));
// FIXME BufferView creation should be independant of WorkArea creation
- buffer_views_[id].reset(new BufferView(view));
+ buffer_views_[id].reset(new BufferView());
work_areas_[id]->setBufferView(buffer_views_[id].get());
view->setWorkArea(work_areas_[id].get());
#include "frontends/font_metrics.h"
#include "frontends/Painter.h"
-#include "frontends/LyXView.h"
using lyx::docstring;
using lyx::graphics::PreviewLoader;
#include "paragraph.h"
#include "frontends/Alert.h"
-#include "frontends/LyXView.h"
#include <sstream>
#include "outputparams.h"
#include "frontends/lyx_gui.h"
-#include "frontends/LyXView.h"
#include "graphics/PreviewLoader.h"
#include "sgml.h"
#include "frontends/Alert.h"
-#include "frontends/LyXView.h"
#include "support/convert.h"
#include "support/filetools.h"
#include "outputparams.h"
#include "frontends/Alert.h"
-#include "frontends/LyXView.h"
#include "frontends/Painter.h"
#include "graphics/PreviewImage.h"
#include "pariterator.h"
#include "sgml.h"
-#include "frontends/LyXView.h"
-
#include "support/lstrings.h"
#include "support/lyxalgo.h"
#include "support/std_ostream.h"
#include "outputparams.h"
#include "sgml.h"
-#include "frontends/LyXView.h"
+#include "frontends/Application.h"
#include "support/lstrings.h"
#include "support/convert.h"
#include "frontends/Alert.h"
+#include "frontends/Application.h"
#include "frontends/font_metrics.h"
-#include "frontends/LyXView.h"
#include "frontends/Clipboard.h"
#include "frontends/Painter.h"
#include "frontends/Selection.h"
#include "debug.h"
#include "frontends/Dialogs.h"
-#include "frontends/LyXView.h"
using std::string;
#include "undo.h"
#include "frontends/Alert.h"
-#include "frontends/LyXView.h"
#include "support/convert.h"
#include "insets/render_preview.h"
#include "insets/insetlabel.h"
-#include "frontends/Dialogs.h"
-#include "frontends/LyXView.h"
-
#include "graphics/PreviewImage.h"
#include "graphics/PreviewLoader.h"
#include "support/lstrings.h"
-#include "frontends/Dialogs.h"
-#include "frontends/LyXView.h"
+#include "frontends/Application.h"
#include "frontends/Painter.h"
#include "frontends/Selection.h"
#include "frontends/nullpainter.h"
#include "outputparams.h"
#include "sgml.h"
-#include "frontends/LyXView.h"
-#include "frontends/Dialogs.h"
-
using std::string;
using std::auto_ptr;
using std::endl;
-
RefInset::RefInset()
: CommandInset("ref")
{}
#include "frontends/font_metrics.h"
#include "frontends/nullpainter.h"
-#include "frontends/LyXView.h"
-#include "frontends/WorkArea.h"
#include "frontends/Painter.h"
#include "insets/insettext.h"
#include "WordLangTuple.h"
#include "frontends/font_metrics.h"
-#include "frontends/LyXView.h"
#include "frontends/Painter.h"
#include "insets/insettext.h"
#include "undo.h"
#include "vspace.h"
+#include "frontends/Application.h"
#include "frontends/font_metrics.h"
-#include "frontends/LyXView.h"
#include "insets/insetenv.h"
#include "vspace.h"
#include "pariterator.h"
-#include "frontends/Dialogs.h"
-#include "frontends/LyXView.h"
+#include "frontends/Application.h"
#include "frontends/Clipboard.h"
#include "frontends/Selection.h"
if (change_layout) {
current_layout = layout;
setLayout(cur, layout);
- bv->owner()->setLayout(layout);
+ // inform the GUI that the layout has changed.
+ bv->layoutChanged(layout);
bv->switchKeyMap();
}
break;
theApp->selection().haveSelection(cur.selection());
bv->switchKeyMap();
- bv->owner()->updateMenubar();
- bv->owner()->updateToolbars();
break;
}
#include "debug.h"
#include "undo.h"
-#include "frontends/LyXView.h"
-
#include "insets/insetfloat.h"
#include "insets/insetoptarg.h"
#include "insets/insetwrap.h"