#include "BufferView_pimpl.h"
#include "frontends/WorkArea.h"
#include "frontends/screen.h"
+#include "frontends/LyXScreenFactory.h"
+#include "frontends/WorkAreaFactory.h"
#include "frontends/Dialogs.h"
#include "frontends/Alert.h"
#include "frontends/FileDialog.h"
const unsigned int saved_positions_num = 20;
-inline
-void waitForX()
-{
- XSync(fl_get_display(), 0);
-}
-
-
-void SetXtermCursor(Window win)
-{
- static Cursor cursor;
- static bool cursor_undefined = true;
- if (cursor_undefined) {
- cursor = XCreateFontCursor(fl_get_display(), XC_xterm);
- XFlush(fl_get_display());
- cursor_undefined = false;
- }
- XDefineCursor(fl_get_display(), win, cursor);
- XFlush(fl_get_display());
-}
} // anon namespace
: bv_(b), owner_(o), buffer_(0), cursor_timeout(400),
using_xterm_cursor(false)
{
- workarea_.reset(new WorkArea(xpos, ypos, width, height));
- screen_.reset(new LScreen(workarea()));
+ workarea_.reset(WorkAreaFactory::create(xpos, ypos, width, height));
+ screen_.reset(LyXScreenFactory::create(workarea()));
// Setup the signals
workarea().scrollDocView.connect(boost::bind(&BufferView::Pimpl::scrollDocView, this, _1));
}
-LScreen & BufferView::Pimpl::screen() const
+LyXScreen & BufferView::Pimpl::screen() const
{
return *screen_.get();
}
void BufferView::Pimpl::updateScreen()
{
// Regenerate the screen.
- screen().reset();
+ screen().redraw(bv_->text, bv_);
}
screen().draw(bv_->text, bv_, value);
if (!lyxrc.cursor_follows_scrollbar) {
- waitForX();
return;
}
vbt->setCursorFromCoordinates(bv_, 0, first);
else if (vbt->cursor.y() > last)
vbt->setCursorFromCoordinates(bv_, 0, last);
-
- waitForX();
}
}
-void BufferView::Pimpl::workAreaKeyPress(KeySym key, key_modifier::state state)
+void BufferView::Pimpl::workAreaKeyPress(LyXKeySymPtr key,
+ key_modifier::state state)
{
bv_->owner()->getLyXFunc()->processKeySym(key, state);
}
LyXText * lt = bv_->getLyXText();
if (!lt->selection.set()) {
- if (owner_->getIntl()->getTrans().backspace()) {
+ if (owner_->getIntl()->getTransManager().backspace()) {
lt->backspace(bv_);
lt->selection.cursor = lt->cursor;
update(lt,
owner_->getLyXFunc()->handleKeyFunc(action);
} else {
owner_->getLyXFunc()->handleKeyFunc(action);
- owner_->getIntl()->getTrans()
+ owner_->getIntl()->getTransManager()
.TranslateAndInsert(argument[0], bv_->getLyXText());
update(bv_->getLyXText(),
BufferView::SELECT
}
break;
+ case LFUN_MATH:
+ mathDispatch(bv_, argument);
+ break;
+
case LFUN_MATH_MACRO:
mathDispatchMathMacro(bv_, argument);
break;
string::const_iterator cit = argument.begin();
string::const_iterator end = argument.end();
for (; cit != end; ++cit) {
- owner_->getIntl()->getTrans().TranslateAndInsert(*cit, lt);
+ owner_->getIntl()->getTransManager().
+ TranslateAndInsert(*cit, lt);
}
bv_->update(lt,