#include "Menubar.h"
#include "buffer.h"
+#include "bufferparams.h"
#include "BufferView.h"
#include "bufferview_funcs.h"
#include "debug.h"
#include <sys/time.h>
#include <unistd.h>
-using namespace lyx::support;
+using lyx::support::MakeDisplayPath;
+using lyx::support::OnlyFilename;
+
using std::endl;
+using std::string;
string current_layout;
void LyXView::updateToolbar()
{
- bool const math = mathcursor;
+ bool const math = inMathed();
bool const table =
- !getLyXFunc().getStatus(LFUN_LAYOUT_TABULAR).disabled();
+ !getLyXFunc().getStatus(FuncRequest(LFUN_LAYOUT_TABULAR)).disabled();
toolbar_->update(math, table);
}
}
// update the layout display
- if (toolbar_->updateLayoutList(buffer()->params.textclass)) {
- current_layout = buffer()->params.getLyXTextClass().defaultLayoutName();
+ if (toolbar_->updateLayoutList(buffer()->params().textclass)) {
+ current_layout = buffer()->params().getLyXTextClass().defaultLayoutName();
}
string const & layout =
- bufferview_->getLyXText()->cursor.par()->layout()->name();
+ bufferview_->getLyXText()->cursorPar()->layout()->name();
if (layout != current_layout) {
toolbar_->setLayout(layout);
}
-void LyXView::dispatch(FuncRequest const & req)
+void LyXView::dispatch(FuncRequest const & cmd)
+{
+ getLyXFunc().dispatch(cmd);
+}
+
+
+Buffer const * const LyXView::updateInset(InsetOld const * inset) const
{
- // substitute the correct BufferView here
- FuncRequest r = req;
- r.setView(view().get());
- getLyXFunc().dispatch(r);
+ Buffer const * buffer_ptr = 0;
+ if (inset) {
+ buffer_ptr = bufferview_->buffer();
+ bufferview_->update();
+ }
+ return buffer_ptr;
}