#include "insets/insetcommand.h" // ChangeRefs
#include "insets/insettext.h"
+
using lyx::support::bformat;
using lyx::cap::setSelectionRange;
extern BufferList bufferlist;
-BufferView::BufferView(LyXView * owner, int width, int height)
- : pimpl_(new Pimpl(*this, owner, width, height))
+BufferView::BufferView(LyXView * owner, lyx::frontend::WorkArea * workArea)
+ : pimpl_(new Pimpl(*this, owner, workArea))
{}
}
+ScrollbarParameters const & BufferView::scrollbarParameters() const
+{
+ return pimpl_->scrollbarParameters();
+}
+
+
void BufferView::scrollDocView(int value)
{
pimpl_->scrollDocView(value);
int BufferView::workWidth() const
{
- return pimpl_->workarea().width();
+ return pimpl_->width();
}
}
-void BufferView::workAreaResize()
+void BufferView::workAreaResize(int width, int height)
{
- pimpl_->workAreaResize();
+ pimpl_->workAreaResize(width, height);
}
int BufferView::workHeight() const
{
- return pimpl_->workarea().height();
+ return pimpl_->height();
}
namespace lyx {
namespace frontend {
class Painter;
+class WorkArea;
}
}
} // namespace
+/// Scrollbar Parameters
+struct ScrollbarParameters
+{
+ void reset(int h = 0, int p = 0, int l = 0)
+ {
+ height = h;
+ position = p;
+ lineScrollHeight = l;
+ }
+
+ /// The total document height in pixels
+ int height;
+ /// The current position in the document, in pixels
+ int position;
+ /// the line-scroll amount, in pixels
+ int lineScrollHeight;
+};
/**
* A buffer view encapsulates a view onto a particular
* Create a view with the given owner main window,
* of the given dimensions.
*/
- BufferView(LyXView * owner, int w, int h);
+ BufferView(LyXView * owner, lyx::frontend::WorkArea * workArea);
~BufferView();
bool fitCursor();
/// reset the scrollbar to reflect current view position
void updateScrollbar();
+ /// return the Scrollbar Parameters
+ ScrollbarParameters const & scrollbarParameters() const;
/// FIXME
bool available() const;
void selectionLost();
///
- void workAreaResize();
+ void workAreaResize(int width, int height);
- /// Receive a keypress
- void workAreaKeyPress(LyXKeySymPtr key, key_modifier::state state);
+ /// Receive a keypress
+ void workAreaKeyPress(LyXKeySymPtr key, key_modifier::state state);
/// a function should be executed from the workarea
bool workAreaDispatch(FuncRequest const & ev);
} // anon namespace
-BufferView::Pimpl::Pimpl(BufferView & bv, LyXView * owner,
- int width, int height)
- : bv_(&bv), owner_(owner), buffer_(0), wh_(0), cursor_timeout(400),
+BufferView::Pimpl::Pimpl(BufferView & bv, LyXView * owner, WorkArea * workArea)
+ : bv_(&bv), owner_(owner), workArea_(workArea), buffer_(0), wh_(0), cursor_timeout(400),
using_xterm_cursor(false), cursor_(bv),
anchor_ref_(0), offset_ref_(0)
{
xsel_cache_.set = false;
- workAreaId_ = owner_->gui().newWorkArea(width, height);
- workArea_ = & owner_->gui().workArea(workAreaId_);
-
// Setup the signals
timecon = cursor_timeout.timeout
.connect(boost::bind(&BufferView::Pimpl::cursorToggle, this));
-
+
cursor_timeout.start();
-
+
saved_positions.resize(saved_positions_num);
// load saved bookmarks
lyx::Session::BookmarkList & bmList = LyX::ref().session().loadBookmarks();
}
+int BufferView::Pimpl::width() const
+{
+ return width_;
+}
+
+
+int BufferView::Pimpl::height() const
+{
+ return height_;
+}
+
+
void BufferView::Pimpl::setBuffer(Buffer * b)
{
lyxerr[Debug::INFO] << BOOST_CURRENT_FUNCTION
}
update();
- updateScrollbar();
owner_->updateMenubar();
owner_->updateToolbars();
owner_->updateLayoutChoice();
// Reset the "Formatting..." message
owner_->clearMessage();
-
- updateScrollbar();
}
if (!bv_->text()) {
lyxerr[Debug::DEBUG] << BOOST_CURRENT_FUNCTION
<< " no text in updateScrollbar" << endl;
- workArea_->setScrollbarParams(0, 0, 0);
+ scrollbarParameters_.reset();
return;
}
// estimated average paragraph height:
if (wh_ == 0)
- wh_ = workArea_->height() / 4;
+ wh_ = height_ / 4;
int h = t.getPar(anchor_ref_).height();
// Normalize anchor/offset (MV):
int sumh = 0;
int nh = 0;
for (lyx::pit_type pit = anchor_ref_; pit <= parsize; ++pit) {
- if (sumh > workArea_->height())
+ if (sumh > height_)
break;
int const h2 = t.getPar(pit).height();
sumh += h2;
if (hav > wh_)
wh_ = hav;
- workArea_->setScrollbarParams((parsize + 1) * wh_,
- anchor_ref_ * wh_ + int(offset_ref_ * wh_ / float(h)),
- int(wh_ * defaultRowHeight() / float(h)));
+ scrollbarParameters_.height = (parsize + 1) * wh_;
+ scrollbarParameters_.position = anchor_ref_ * wh_ + int(offset_ref_ * wh_ / float(h));
+ scrollbarParameters_.lineScrollHeight = int(wh_ * defaultRowHeight() / float(h));
+}
+
+
+ScrollbarParameters const & BufferView::Pimpl::scrollbarParameters() const
+{
+ return scrollbarParameters_;
}
int const height = 2 * defaultRowHeight();
int const first = height;
- int const last = workArea_->height() - height;
+ int const last = height_ - height;
LCursor & cur = cursor_;
bv_funcs::CurStatus st = bv_funcs::status(bv_, cur);
// scrollDocView(new_top_y);
//
// // Update the scrollbar.
-// workArea_->.setScrollbarParams(t->height(), top_y(), defaultRowHeight());
+// workArea_->setScrollbarParams(t->height(), top_y(), defaultRowHeight());
}
}
-void BufferView::Pimpl::workAreaResize()
+void BufferView::Pimpl::workAreaResize(int width, int height)
{
- static int workArea_width;
- static int workArea_height;
-
- bool const widthChange = workArea_->width() != workArea_width;
- bool const heightChange = workArea_->height() != workArea_height;
+ bool const widthChange = width != width_;
+ bool const heightChange = height != height_;
// Update from work area
- workArea_width = workArea_->width();
- workArea_height = workArea_->height();
+ width_ = width;
+ height_ = height;
if (buffer_ && widthChange) {
// The visible LyXView need a resize
if (widthChange || heightChange)
update();
- // Always make sure that the scrollbar is sane.
- updateScrollbar();
owner_->updateLayoutChoice();
}
int const asc = font_metrics::maxAscent(font);
int const des = font_metrics::maxDescent(font);
Point const p = bv_funcs::getPos(cursor_, cursor_.boundary());
- if (p.y_ - asc >= 0 && p.y_ + des < workArea_->height())
+ if (p.y_ - asc >= 0 && p.y_ + des < height_)
return false;
}
center();
} else
workArea_->greyOut();
- // And the scrollbar
- updateScrollbar();
owner_->view_state_changed();
}
Paragraph const & par = bot.text()->paragraphs()[pit];
anchor_ref_ = pit;
offset_ref_ = bv_funcs::coordOffset(cursor_, cursor_.boundary()).y_
- + par.ascent() - workArea_->height() / 2;
+ + par.ascent() - height_ / 2;
}
// surrounding LyXText will handle this event.
// Build temporary cursor.
- cmd.y = min(max(cmd.y, -1), workArea_->height());
+ cmd.y = min(max(cmd.y, -1), height_);
InsetBase * inset = bv_->text()->editXY(cur, cmd.x, cmd.y);
//lyxerr << BOOST_CURRENT_FUNCTION
// << " * hit inset at tip: " << inset << endl;
class BufferView::Pimpl : public boost::signals::trackable {
public:
///
- Pimpl(BufferView & bv, LyXView * owner, int width, int height);
+ Pimpl(BufferView & bv, LyXView * owner, lyx::frontend::WorkArea * workArea);
///
lyx::frontend::Painter & painter() const;
///
///
bool loadLyXFile(std::string const &, bool);
///
- void workAreaResize();
+ void workAreaResize(int width, int height);
///
void updateScrollbar();
///
+ ScrollbarParameters const & scrollbarParameters() const;
+ ///
void scrollDocView(int value);
/// Wheel mouse scroll, move by multiples of text->defaultRowHeight().
void scroll(int lines);
/// the clipboard
lyx::frontend::Clipboard & clipboard() const;
+ /// Width and height of the BufferView in Pixels
+ /**
+ This is set externally by the workAreaResize method.
+ */
+ int width() const;
+ /// Height of the BufferView in Pixels
+ /**
+ This is set externally by the workAreaResize method.
+ */
+ int height() const;
+
private:
+ ///
+ int width_;
+ ///
+ int height_;
+ ///
+ ScrollbarParameters scrollbarParameters_;
+
/// An error list (replaces the error insets)
ErrorList errorlist_;
/// add an error to the list
void menuInsertLyXFile(std::string const & filen);
lyx::frontend::WorkArea * workArea_;
- int workAreaId_;
/// this is used to handle XSelection events in the right manner
struct {
#include "frontends/GuiCursor.h"
+#include <boost/shared_ptr.hpp>
+
+#include <map>
+
+class LyXView;
+
namespace lyx {
namespace frontend {
virtual ~Gui() {}
///
- virtual Clipboard& clipboard() = 0;
+ virtual Clipboard & clipboard() = 0;
+
+ ///
+ virtual int newView(unsigned int width, unsigned int height) = 0;
///
- virtual int newWorkArea(int w, int h) = 0;
+ virtual LyXView & view(int id) = 0;
///
- virtual WorkArea& workArea(int id) = 0;
+ virtual void destroyView(int id) = 0;
+
+ ///
+ virtual int newWorkArea(unsigned int width, unsigned int height, int view_id) = 0;
+ ///
+ virtual WorkArea & workArea(int id) = 0;
///
virtual void destroyWorkArea(int id) = 0;
///
GuiCursor & guiCursor() {return cursor_;}
+protected:
+ /// view of a buffer. Eventually there will be several.
+ std::map<int, boost::shared_ptr<BufferView> > buffer_views_;
+
private:
+ ///
GuiCursor cursor_;
};
#include "support/filetools.h" // LibFileSearch
-#include <boost/utility.hpp>
-#include <boost/bind.hpp>
-#include <boost/signals/trackable.hpp>
-
using lyx::support::libFileSearch;
using std::endl;
namespace frontend {
GuiCursor::GuiCursor()
- : cursor_visible_(false), work_area_(NULL)
+ : cursor_visible_(false), work_area_(0)
{
}
if (!bv.available())
return;
- Cursor_Shape shape = BAR_SHAPE;
+ CursorShape shape = BAR_SHAPE;
LyXText const & text = *bv.getLyXText();
LyXFont const & realfont = text.real_current_font;
} // namespace frontend
} // namespace lyx
-
* Full author contact details are available in file CREDITS.
*/
+// X11 use a define called CursorShape, and we really want to use
+// that name our selves. Therefore we do something similar to what is done
+// in kde/fixx11h.h:
+namespace X {
+#ifdef CursorShape
+#ifndef FIXX11H_CursorShape
+#define FIXX11H_CursorShape
+int const XCursorShape = CursorShape;
+#undef CursorShape
+int const CursorShape = CursorShape;
+#endif
+#undef CursorShape
+#endif
+
+} // namespace X
+
#ifndef GUI_CURSOR_H
#define GUI_CURSOR_H
class WorkArea;
/// types of cursor in work area
-enum Cursor_Shape {
+enum CursorShape {
/// normal I-beam
BAR_SHAPE,
/// L-shape for locked insets of a different language
#include <config.h>
#include "LyXView.h"
+#include "Gui.h"
#include "Dialogs.h"
#include "Timeout.h"
#include "Toolbars.h"
# include <unistd.h>
#endif
+using lyx::frontend::Gui;
+
using lyx::support::makeDisplayPath;
using lyx::support::onlyFilename;
string current_layout;
+Gui & LyXView::gui()
+{
+ return owner_;
+}
-LyXView::LyXView()
- : toolbars_(new Toolbars(*this)),
+LyXView::LyXView(Gui & owner)
+ : owner_(owner),
+ toolbars_(new Toolbars(*this)),
intl_(new Intl),
autosave_timeout_(new Timeout(5000)),
lyxfunc_(new LyXFunc(this)),
dialogs_(new Dialogs(*this)),
- controlcommand_(new ControlCommandBuffer(*this))
+ controlcommand_(new ControlCommandBuffer(*this)),
+ bufferview_(0)
{
lyxerr[Debug::INIT] << "Initializing LyXFunc" << endl;
}
+void LyXView::setBufferView(BufferView * buffer_view)
+{
+ bufferview_ = buffer_view;
+}
+
LyXView::~LyXView()
{
}
-boost::shared_ptr<BufferView> const & LyXView::view() const
+BufferView * LyXView::view() const
{
return bufferview_;
}
lyxerr[Debug::INFO] << "Running autoSave()" << endl;
if (view()->available()) {
- ::autoSave(view().get());
+ ::autoSave(view());
}
}
class FuncRequest;
namespace lyx {
-
namespace frontend {
class Gui;
-} // namespace frontend
-
-namespace frontend {
class ControlCommandBuffer;
} // namespace frontend
class LyXView : public boost::signals::trackable, boost::noncopyable {
public:
- LyXView();
+ LyXView(lyx::frontend::Gui & owner);
virtual ~LyXView();
+ void setBufferView(BufferView * buffer_view);
+
/**
* This is called after the concrete view has been created.
* We have to have the toolbar and the other stuff created
Returned as a shared_ptr so that anything wanting to cache the
buffer view can do so safely using a boost::weak_ptr.
*/
- boost::shared_ptr<BufferView> const & view() const;
+ BufferView * view() const;
/// return the buffer currently shown in this window
Buffer * buffer() const;
*/
Buffer const * const updateInset(InsetBase const *) const;
- // returns true if this view has the focus.
+ /// returns true if this view has the focus.
virtual bool hasFocus() const = 0;
- virtual lyx::frontend::Gui & gui() = 0;
+ ///
+ virtual lyx::frontend::Gui & gui();
protected:
- /// view of a buffer. Eventually there will be several.
- boost::shared_ptr<BufferView> bufferview_;
+ /// current bufferview (view of a buffer).
+ /**
+ \todo FIXME: this should be moved out of LyXView.
+ */
+ BufferView * bufferview_;
/// view's menubar
boost::scoped_ptr<Menubar> menubar_;
private:
+ lyx::frontend::Gui & owner_;
/**
* setWindowTitle - set title of window
* @param t main window title
loader_.reset(file);
}
-WorkArea::WorkArea(LyXView & owner, int w, int h)
- : greyed_out_(true)
+WorkArea::WorkArea(BufferView * buffer_view)
+ : buffer_view_(buffer_view), greyed_out_(true)
{
// Start loading the pixmap as soon as possible
if (lyxrc.show_banner) {
}
+void WorkArea::setBufferView(BufferView * buffer_view)
+{
+ buffer_view_ = buffer_view;
+}
+
+
void WorkArea::checkAndGreyOut()
{
if (greyed_out_)
{
greyed_out_ = false;
getPainter().start();
- paintText(bv, vi);
+ paintText(*buffer_view_, vi);
lyxerr[Debug::DEBUG] << "Redraw screen" << endl;
int const ymin = std::max(vi.y1, 0);
int const ymax =
#include "frontends/key_state.h"
#include "frontends/LyXKeySym.h"
-class LyXView;
-class FuncRequest;
class BufferView;
class ViewMetricsInfo;
*/
class WorkArea {
public:
- WorkArea(LyXView & owner, int w, int h);
+ WorkArea(BufferView * buffer_view = 0);
virtual ~WorkArea() {}
+ void setBufferView(BufferView * buffer_view);
+
/// return the painter object for this work area
virtual Painter & getPainter() = 0;
void greyOut();
/// paint the cursor and store the background
- virtual void showCursor(int x, int y, int h, Cursor_Shape shape) = 0;
+ virtual void showCursor(int x, int y, int h, CursorShape shape) = 0;
/// hide the cursor
virtual void removeCursor() = 0;
/// cause the display of the given area of the work area
virtual void expose(int x, int y, int w, int h) = 0;
+ ///
+ BufferView * buffer_view_;
+
private:
///
void checkAndGreyOut();
bool Kernel::isBufferAvailable() const
{
- if (!lyxview_.view().get())
+ if (!lyxview_.view())
return false;
return lyxview_.view()->available();
}
BufferView * Kernel::bufferview()
{
- return lyxview_.view().get();
+ return lyxview_.view();
}
BufferView const * Kernel::bufferview() const
{
- return lyxview_.view().get();
+ return lyxview_.view();
}
focusTimer_->timeout.connect(
boost::bind(&GMiniBuffer::focusTimeout, this));
idleTimer_->start();
- messageMode();
+ //messageMode();
}
XftFont * fontS = getXftFont(smallfont);
char c;
int tmpx = x;
- for (int i = 0; i < ls; ++i) {
+ for (unsigned int i = 0; i < ls; ++i) {
c = lyx::support::uppercase(s[i]);
if (c != s[i]) {
XftDrawString8(draw, xftClr, fontS, tmpx, y,
#include "frontends/font_metrics.h"
#include "frontends/Painter.h"
+#include "frontends/GuiCursor.h"
#include "insets/insettext.h"
}
-void GScreen::showCursor(int x, int y, int h, Cursor_Shape shape)
+void GScreen::showCursor(int x, int y, int h, CursorShape shape)
{
// Update the cursor color.
setCursorColor(owner_.getGC());
///
virtual void removeCursor();
///
- virtual void showCursor(int x, int y, int h, Cursor_Shape shape);
+ virtual void showCursor(int x, int y, int h, CursorShape shape);
/// Copies specified area of pixmap to screen
virtual void expose(int x, int y, int w, int h);
} // namespace anon
-GView::GView() : frontend_(*this)
+GView::GView(Gui & owner) : LyXView(owner)
{
// The physical store for the boxes making up the layout.
box_store_.push_back(BoxPtr(new Gtk::VBox));
// Define the components making up the window.
menubar_.reset(new GMenubar(this, menubackend));
getToolbars().init();
- bufferview_.reset(new BufferView(this, 300, 300));
minibuffer_.reset(new GMiniBuffer(this, *controlcommand_));
focus_command_buffer.connect(
}
set_default_size(width, height);
// Make sure the buttons are disabled if needed.
- updateToolbars();
+ //updateToolbars();
string const iconName =
support::libFileSearch("images", "lyx", "xpm");
if (!iconName.empty())
#include "frontends/LyXView.h"
-#include "GuiImplementation.h"
-
#include <gtkmm.h>
#include <map>
Center
};
- GView();
+ GView(Gui & owner);
~GView();
Gtk::Box & getBox(Position pos);
// returns true if this view has the focus.
virtual bool hasFocus() const;
- ///
- Gui & gui() { return frontend_; }
-
private:
void showViewState();
bool onFocusIn(GdkEventFocus * event);
boost::scoped_ptr<GMiniBuffer> minibuffer_;
Gtk::Widget * workArea_;
- ///
- GuiImplementation frontend_;
};
} // namespace frontend
gtk_im_context_set_client_window(
imContext_, workArea_.get_window()->gobj());
}
- view_.view()->workAreaResize();
+ view_.view()->workAreaResize(workArea_.get_width(), workArea_.get_height());
return true;
}
class GWorkArea : public sigc::trackable {
public:
GWorkArea(LyXView & owner, int width, int height);
- ~GWorkArea();
+ virtual ~GWorkArea();
virtual Painter & getPainter();
///
bool onKeyPress(GdkEventKey * event);
void onClipboardGet(Gtk::SelectionData & selection_data, guint info);
void onClipboardClear();
- LyXView & view_;
+ LyXView & view_;
Gtk::HBox hbox_;
Gtk::DrawingArea workArea_;
Gtk::VScrollbar vscrollbar_;
namespace lyx {
namespace frontend {
-typedef GWorkArea FWorkArea;
-
/**
* The GTK version of the Clipboard.
*/
class GuiClipboard: public lyx::frontend::Clipboard
{
public:
- GuiClipboard(FWorkArea * work_area)
+ GuiClipboard(GWorkArea * work_area)
: old_work_area_(work_area)
{
}
//@}
private:
- FWorkArea * old_work_area_;
+ GWorkArea * old_work_area_;
};
} // namespace frontend
--- /dev/null
+// -*- C++ -*-
+/**
+ * \file gtk/GuiImplementation.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author Abdelrazak Younes
+ *
+ * Full author contact details are available in file CREDITS.
+ */
+
+#include "GuiImplementation.h"
+
+#include "GView.h"
+#include "BufferView.h"
+
+namespace lyx {
+namespace frontend {
+
+int GuiImplementation::newView(unsigned int /*w*/, unsigned int /*h*/)
+{
+ view_.reset(new GView(*this));
+ return 0;
+}
+
+
+int GuiImplementation::newWorkArea(unsigned int w, unsigned int h, int /*view_id*/)
+{
+ old_work_area_.reset(new GWorkArea(*view_.get(), w, h));
+ old_screen_.reset(new GScreen(*old_work_area_.get()));
+ work_area_.reset(new GuiWorkArea(old_screen_.get(), old_work_area_.get()));
+ clipboard_.reset(new GuiClipboard(old_work_area_.get()));
+ guiCursor().connect(work_area_.get());
+
+ // FIXME BufferView creation should be independant of WorkArea creation
+ buffer_views_[0].reset(new BufferView(view_.get(), work_area_.get()));
+ work_area_->setBufferView(buffer_views_[0].get());
+ view_->setBufferView(buffer_views_[0].get());
+ return 0;
+}
+
+
+void GuiImplementation::destroyWorkArea(int /*id*/)
+{
+ clipboard_.reset();
+ work_area_.reset();
+ old_work_area_.reset();
+ old_screen_.reset();
+}
+
+} // namespace frontend
+} // namespace lyx
#include <boost/shared_ptr.hpp>
-#include <map>
-
namespace lyx {
namespace frontend {
-typedef GScreen FScreen;
-typedef GWorkArea FWorkArea;
-
/**
* The Gui class is the interface to all GTK components.
*/
class GuiImplementation: public lyx::frontend::Gui
{
public:
- GuiImplementation(LyXView & owner): owner_(owner)
+ GuiImplementation()
{
}
{
}
- lyx::frontend::Clipboard& clipboard()
+ lyx::frontend::Clipboard & clipboard()
{
return *clipboard_;
}
- int newWorkArea(int w, int h)
+ int newView(unsigned int w, unsigned int h);
+
+ LyXView & view(int /*id*/)
{
- old_work_area_.reset(new FWorkArea(owner_, w, h));
- old_screen_.reset(new FScreen(*old_work_area_.get()));
- work_area_.reset(new GuiWorkArea(owner_, w, h, old_screen_.get(), old_work_area_.get()));
- clipboard_.reset(new GuiClipboard(old_work_area_.get()));
- guiCursor().connect(work_area_.get());
- return 0;
+ return *view_;
}
- lyx::frontend::WorkArea& workArea(int id)
+ void destroyView(int /*id*/)
{
- return *work_area_;
+ view_.reset();
}
- void destroyWorkArea(int id)
+ int newWorkArea(unsigned int w, unsigned int h, int /*view_id*/);
+
+ lyx::frontend::WorkArea & workArea(int /*id*/)
{
- clipboard_.reset();
- work_area_.reset();
- old_work_area_.reset();
- old_screen_.reset();
+ return *work_area_;
}
+ void destroyWorkArea(int /*id*/);
+
private:
///
boost::shared_ptr<GuiClipboard> clipboard_;
///
boost::shared_ptr<GuiWorkArea> work_area_;
///
- boost::shared_ptr<FWorkArea> old_work_area_;
+ boost::shared_ptr<LyXView> view_;
///
- boost::shared_ptr<FScreen> old_screen_;
+ boost::shared_ptr<GWorkArea> old_work_area_;
///
- LyXView & owner_;
+ boost::shared_ptr<GScreen> old_screen_;
};
} // namespace frontend
namespace lyx {
namespace frontend {
-typedef GScreen FScreen;
-typedef GWorkArea FWorkArea;
-
/**
* Temporary wrapper around GWorkArea and GScreen.
* Please refer to the Qt4 implementation for a proper cleanup of the API.
*/
class GuiWorkArea: public lyx::frontend::WorkArea {
public:
- GuiWorkArea(LyXView & owner, int w, int h,
- FScreen * screen, FWorkArea * work_area)
- : lyx::frontend::WorkArea(owner, w, h),
- old_screen_(screen), old_work_area_(work_area)
+ GuiWorkArea(GScreen * screen, GWorkArea * work_area)
+ : old_screen_(screen), old_work_area_(work_area)
{
}
/// paint the cursor and store the background
- virtual void showCursor(int x, int y, int h, Cursor_Shape shape)
+ virtual void showCursor(int x, int y, int h, CursorShape shape)
{
old_screen_->showCursor(x, y, h, shape);
}
}
private:
- FScreen * old_screen_;
- FWorkArea * old_work_area_;
+ GScreen * old_screen_;
+ GWorkArea * old_work_area_;
};
} // namespace frontend
ghelpers.C \
ghelpers.h \
GuiImplementation.h \
+ GuiImplementation.C \
io_callback.C \
io_callback.h \
lyx_gui.C \
xftFontLoader.C \
xftFontLoader.h \
xftFontMetrics.C
-
#include "lyxsocket.h"
#include "BufferView.h"
+#include "GuiImplementation.h"
#include "GView.h"
#include "GtkmmX.h"
using lyx::support::package;
using lyx::frontend::colorCache;
+using lyx::frontend::Gui;
+using lyx::frontend::GuiImplementation;
using lyx::frontend::GView;
} // namespace anon
+class Application: public Gtk::Main
+{
+public:
+ ///
+ Application(int & argc, char * argv[]): Gtk::Main(argc, argv)
+ {}
+ ///
+ Gui & gui() { return gui_; }
+
+private:
+ ///
+ GuiImplementation gui_;
+};
+
+Application * theApp;
void lyx_gui::exec(int & argc, char * argv[])
{
- new Gtk::Main(argc, argv);
+ theApp = new Application(argc, argv);
using namespace lyx::graphics;
Image::newImage = boost::bind(&LyXGdkImage::newImage);
void lyx_gui::start(string const & batch, std::vector<string> const & files,
unsigned int width, unsigned int height, int posx, int posy, bool)
{
- boost::shared_ptr<GView> view_ptr(new GView);
- LyX::ref().addLyXView(view_ptr);
+ int view_id = theApp->gui().newView(width, height);
+ GView & view = static_cast<GView &> (theApp->gui().view(view_id));
+ theApp->gui().newWorkArea(width, height, 0);
+
+ LyX::ref().addLyXView(&view);
- GView & view = *view_ptr.get();
view.show();
view.init();
view.getLyXFunc().dispatch(lyxaction.lookupFunc(batch));
}
- Gtk::Main::run();
+ theApp->run();
// FIXME: breaks emergencyCleanup
delete lyxsocket;
void lyx_gui::exit(int /*status*/)
{
// FIXME: Don't ignore status
- Gtk::Main::quit();
+ theApp->quit();
}
#define GUI_IMPLEMENTATION_H
#include "frontends/Gui.h"
-#include "frontends/LyXView.h"
+#include "QtView.h"
#include "qscreen.h"
#include "QWorkArea.h"
#include "GuiClipboard.h"
#include "GuiWorkArea.h"
+#include "BufferView.h"
+
#include <boost/shared_ptr.hpp>
namespace lyx {
namespace frontend {
+typedef QtView FView;
typedef QScreen FScreen;
typedef QWorkArea FWorkArea;
class GuiImplementation: public lyx::frontend::Gui
{
public:
- GuiImplementation(LyXView & owner): owner_(owner)
+ GuiImplementation()
{
}
return *clipboard_;
}
- int newWorkArea(int w, int h)
+ int newView(unsigned int /*w*/, unsigned int /*h*/)
+ {
+ view_.reset(new FView(*this));
+ return 0;
+ }
+
+
+ LyXView& view(int /*id*/)
+ {
+ return *view_;
+ }
+
+
+ void destroyView(int /*id*/)
+ {
+ view_.reset();
+ }
+
+ int newWorkArea(unsigned int w, unsigned int h, int /*view_id*/)
{
- old_work_area_.reset(new FWorkArea(owner_, w, h));
+ old_work_area_.reset(new FWorkArea(*view_.get(), w, h));
old_screen_.reset(new FScreen(*old_work_area_.get()));
- work_area_.reset(new GuiWorkArea(owner_, w, h, old_screen_.get(), old_work_area_.get()));
+ work_area_.reset(new GuiWorkArea(old_screen_.get(), old_work_area_.get()));
clipboard_.reset(new GuiClipboard(old_work_area_.get()));
guiCursor().connect(work_area_.get());
+
+ // FIXME BufferView creation should be independant of WorkArea creation
+ buffer_views_[0].reset(new BufferView(view_.get(), work_area_.get()));
+ work_area_->setBufferView(buffer_views_[0].get());
+ view_->setBufferView(buffer_views_[0].get());
return 0;
}
- lyx::frontend::WorkArea& workArea(int id)
+ lyx::frontend::WorkArea& workArea(int /*id*/)
{
return *work_area_;
}
- void destroyWorkArea(int id)
+ void destroyWorkArea(int /*id*/)
{
clipboard_.reset();
work_area_.reset();
///
boost::shared_ptr<GuiWorkArea> work_area_;
///
+ boost::shared_ptr<FView> view_;
+ ///
boost::shared_ptr<FWorkArea> old_work_area_;
///
boost::shared_ptr<FScreen> old_screen_;
- ///
- LyXView & owner_;
};
} // namespace frontend
*/
class GuiWorkArea: public lyx::frontend::WorkArea {
public:
- GuiWorkArea(LyXView & owner, int w, int h,
- FScreen * screen, FWorkArea * work_area)
- : lyx::frontend::WorkArea(owner, w, h),
- old_screen_(screen), old_work_area_(work_area)
+ GuiWorkArea(FScreen * screen, FWorkArea * work_area)
+ : old_screen_(screen), old_work_area_(work_area)
{
}
/// paint the cursor and store the background
- virtual void showCursor(int x, int y, int h, Cursor_Shape shape)
+ virtual void showCursor(int x, int y, int h, CursorShape shape)
{
old_screen_->showCursor(x, y, h, shape);
}
}
pixmap_->resize(width(), height());
- wa_->view().view()->workAreaResize();
+ wa_->view().view()->workAreaResize(width(), height());
}
void QContentPane::paintEvent(QPaintEvent * e)
{
+ BufferView * buffer_view_ = wa_->view().view();
+
if (!pixmap_.get()) {
pixmap_.reset(new QPixmap(width(), height()));
- wa_->view().view()->workAreaResize();
+ buffer_view_->workAreaResize(width(), height());
return;
}
QPainter q(this);
q.drawPixmap(QPoint(r.x(), r.y()),
*pixmap_.get(), r);
+
+ buffer_view_->updateScrollbar();
+ ScrollbarParameters const & scroll_ = buffer_view_->scrollbarParameters();
+
+ wa_->scrollbar_->setTracking(false);
+ wa_->setScrollbarParams(scroll_.height, scroll_.position,
+ scroll_.lineScrollHeight);
+ wa_->scrollbar_->setTracking(true);
}
#include <qpixmap.h>
#include <qstatusbar.h>
-#include <algorithm>
-
using std::string;
FontLoader fontloader;
} // namespace anon
-
-QtView::QtView()
- : QMainWindow(), LyXView(), commandbuffer_(0), frontend_(*this)
+QtView::QtView(Gui & owner)
+ : QMainWindow(), LyXView(owner), commandbuffer_(0)
{
qApp->setMainWidget(this);
- bufferview_.reset(new BufferView(this, width(), height()));
+#ifndef Q_WS_MACX
+ // assign an icon to main form. We do not do it under Qt/Mac,
+ // since the icon is provided in the application bundle.
+ string const iconname = libFileSearch("images", "lyx", "xpm");
+ if (!iconname.empty())
+ setIcon(QPixmap(toqstr(iconname)));
+#endif
+}
+
+
+QtView::~QtView()
+{
+}
+
+void QtView::init()
+{
menubar_.reset(new QLMenubar(this, menubackend));
getToolbars().init();
view_state_changed.connect(boost::bind(&QtView::update_view_state, this));
connect(&statusbar_timer_, SIGNAL(timeout()), this, SLOT(update_view_state_qt()));
-#ifndef Q_WS_MACX
- // assign an icon to main form. We do not do it under Qt/Mac,
- // since the icon is provided in the application bundle.
- string const iconname = libFileSearch("images", "lyx", "xpm");
- if (!iconname.empty())
- setIcon(QPixmap(toqstr(iconname)));
-#endif
-
// make sure the buttons are disabled if needed
updateToolbars();
// allowing the toolbars to tear off is too easily done,
// and we don't save their orientation anyway. Disable the handle.
setToolBarsMovable(false);
-}
-
-
-QtView::~QtView()
-{
+
+ LyXView::init();
}
void QtView::moveEvent(QMoveEvent *)
{
- updateFloatingGeometry();
+ updateFloatingGeometry();
}
void QtView::closeEvent(QCloseEvent *)
{
- updateFloatingGeometry();
+ updateFloatingGeometry();
QRect geometry = floatingGeometry_;
Session & session = LyX::ref().session();
#ifndef QTVIEW_H
#define QTVIEW_H
-// Must be here because of moc.
#include <config.h>
#include "frontends/LyXView.h"
-#include "GuiImplementation.h"
-
#include <qmainwindow.h>
#include <qtimer.h>
class QtView : public QMainWindow, public LyXView {
Q_OBJECT
public:
- /// create a main window
- QtView();
+ /// create a main window of the given dimensions
+ QtView(Gui & owner);
~QtView();
+ /// initialise the object members (menubars, toolbars, etc..)
+ void init();
+
/// show - display the top-level window
void show();
// returns true if this view has the focus.
virtual bool hasFocus() const;
- //
- lyx::frontend::Gui & gui() { return frontend_; }
-
///
void initFloatingGeometry(QRect const &);
/// command buffer
QCommandBuffer * commandbuffer_;
- ///
- GuiImplementation frontend_;
-
///
void updateFloatingGeometry();
///
#include <boost/bind.hpp>
#include <boost/shared_ptr.hpp>
+#include "GuiImplementation.h"
#include "QtView.h"
#include "lcolorcache.h"
#include "qfont_loader.h"
using lyx::support::ltrim;
using lyx::support::package;
+using lyx::frontend::Gui;
+using lyx::frontend::GuiImplementation;
using lyx::frontend::QtView;
namespace os = lyx::support::os;
{
public:
LQApplication(int & argc, char ** argv);
+ //
+ Gui & gui() { return gui_; }
+
#ifdef Q_WS_X11
bool x11EventFilter (XEvent * ev) { return lyxX11EventFilter(ev); }
#endif
#ifdef Q_WS_MACX
bool macEventFilter(EventRef event);
#endif
+
+private:
+ ///
+ GuiImplementation gui_;
};
}
#endif
+LQApplication * theApp;
namespace lyx_gui {
FontLoader::initFontPath();
LQApplication app(argc, argv);
+ theApp = &app;
#if QT_VERSION >= 0x030200
// install translation file for Qt built-in dialogs
// this can't be done before because it needs the Languages object
initEncodings();
- boost::shared_ptr<QtView> view_ptr(new QtView);
- LyX::ref().addLyXView(view_ptr);
+ int view_id = theApp->gui().newView(width, height);
+ QtView & view = static_cast<QtView &> (theApp->gui().view(view_id));
+ theApp->gui().newWorkArea(width, height, 0);
- QtView & view = *view_ptr.get();
+ LyX::ref().addLyXView(&view);
view.init();
- if (width != -1 && height != -1) {
+ if (width != -1 && height != -1) {
view.initFloatingGeometry(QRect(posx, posy, width, height));
view.resize(width, height);
if (posx != -1 && posy != -1)
}
-void QScreen::showCursor(int x, int y, int h, Cursor_Shape shape)
+void QScreen::showCursor(int x, int y, int h, CursorShape shape)
{
if (!qApp->focusWidget())
return;
virtual void expose(int x, int y, int exp_width, int exp_height);
/// paint the cursor and store the background
- virtual void showCursor(int x, int y, int h, lyx::frontend::Cursor_Shape shape);
+ virtual void showCursor(int x, int y, int h, lyx::frontend::CursorShape shape);
/// hide the cursor
virtual void removeCursor();
#include <boost/bind.hpp>
-#include "LyXView.h"
+#include "frontends/LyXView.h"
#include "qt_helpers.h"
#include "Action.h"
QLFontInfo * fontinfo_[LyXFont::NUM_FAMILIES][2][4][10];
};
-extern FontLoader fontloader;
-
#endif // QFONT_LOADER_H
* Full author contact details are available in file CREDITS.
*/
+// This include must be declared before everything else because
+// of boost/Qt/LyX clash...
+#include "GuiView.h"
+
#include "GuiImplementation.h"
#include "GuiWorkArea.h"
-#include "GuiView.h"
+
+#include "BufferView.h"
using boost::shared_ptr;
namespace lyx {
namespace frontend {
-GuiImplementation::GuiImplementation(GuiView & owner): owner_(owner), max_id_(0)
+GuiImplementation::GuiImplementation(): max_view_id_(0), max_wa_id_(0)
{
}
}
-int GuiImplementation::newWorkArea(int w, int h)
+int GuiImplementation::newView(unsigned int /*w*/, unsigned int /*h*/)
{
- size_t const id = max_id_;
- ++max_id_;
- work_areas_[id].reset(new GuiWorkArea(owner_, w, h));
+ size_t const id = max_view_id_;
+ ++max_view_id_;
+
+ views_[id].reset(new GuiView(*this));
+
return id;
}
-WorkArea& GuiImplementation::workArea(int id)
+
+LyXView& GuiImplementation::view(int id)
{
- BOOST_ASSERT(work_areas_.find(id) != work_areas_.end());
+ BOOST_ASSERT(views_.find(id) != views_.end());
+
+ return *views_[id].get();
+}
+
+
+void GuiImplementation::destroyView(int id)
+{
+ views_.erase(id);
+}
+
+
+int GuiImplementation::newWorkArea(unsigned int w, unsigned int h, int view_id)
+{
+ size_t const id = max_wa_id_;
+ ++max_wa_id_;
+
+ GuiView * view = views_[view_id].get();
+
+ 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, work_areas_[id].get()));
+ work_areas_[id]->setBufferView(buffer_views_[id].get());
+ view->setBufferView(buffer_views_[id].get());
+
+ view->mainWidget()->setCentralWidget(work_areas_[id].get());
guiCursor().connect(work_areas_[id].get());
+ return id;
+}
+
+
+WorkArea& GuiImplementation::workArea(int id)
+{
+ BOOST_ASSERT(work_areas_.find(id) != work_areas_.end());
+
return *work_areas_[id].get();
}
* Full author contact details are available in file CREDITS.
*/
-#ifndef GUI_IMPLEMENTATION_H
-#define GUI_IMPLEMENTATION_H
+#ifndef GUI_H
+#define GUI_H
#include "frontends/Gui.h"
#include "GuiClipboard.h"
#include <map>
+class LyXView;
+
namespace lyx {
namespace frontend {
class GuiImplementation: public Gui
{
public:
- GuiImplementation(GuiView & owner);
+ GuiImplementation();
virtual ~GuiImplementation() {}
Clipboard& clipboard();
+ int newView(unsigned int width, unsigned int height);
+ LyXView& view(int id);
+ void destroyView(int id);
+ int newWorkArea(unsigned int width, unsigned int height, int view_id);
int newWorkArea(int w, int h);
WorkArea& workArea(int id);
void destroyWorkArea(int id);
+
private:
///
GuiClipboard clipboard_;
///
+ std::map<int, boost::shared_ptr<GuiView> > views_;
+ ///
std::map<int, boost::shared_ptr<GuiWorkArea> > work_areas_;
///
- GuiView & owner_;
+ size_t max_view_id_;
///
- size_t max_id_;
+ size_t max_wa_id_;
};
} // namespace frontend
} // namespace lyx
-#endif // GUI_IMPLEMENTATION_H
+#endif // GUI_H
#include <boost/bind.hpp>
#include "GuiView.h"
+#include "GuiImplementation.h"
#include "QLMenubar.h"
#include "FontLoader.h"
#include "QCommandBuffer.h"
#include <QToolBar>
#include <QCloseEvent>
#include <QAction>
+//#include <QMenu>
+//#include <QMenuBar>
#include "support/lstrings.h"
using std::string;
using std::endl;
-FontLoader fontloader;
-
namespace lyx {
using support::subst;
} // namespace anon
-GuiView::GuiView()
- : QMainWindow(), LyXView(), commandbuffer_(0), frontend_(*this)
+GuiView::GuiView(Gui & owner)
+ : QMainWindow(), LyXView(owner), commandbuffer_(0)
{
mainWidget_ = this;
// setToolButtonStyle(Qt::ToolButtonIconOnly);
// setIconSize(QSize(12,12));
- // -geometry could set the width and hight
- bufferview_.reset(new BufferView(this, geometry().width(), geometry().height()));
-
- menubar_.reset(new QLMenubar(this, menubackend));
- connect(menuBar(), SIGNAL(triggered(QAction *)), this, SLOT(updateMenu(QAction *)));
-
- getToolbars().init();
-
- statusBar()->setSizeGripEnabled(false);
-
- view_state_changed.connect(boost::bind(&GuiView::update_view_state, this));
- connect(&statusbar_timer_, SIGNAL(timeout()), this, SLOT(update_view_state_qt()));
+// bufferview_.reset(new BufferView(this, width, height));
#ifndef Q_WS_MACX
// assign an icon to main form. We do not do it under Qt/Mac,
if (!iconname.empty())
setWindowIcon(QPixmap(toqstr(iconname)));
#endif
-
- // make sure the buttons are disabled if needed
- updateToolbars();
}
{
}
+
+void GuiView::init()
+{
+ menubar_.reset(new QLMenubar(this, menubackend));
+ QObject::connect(menuBar(), SIGNAL(triggered(QAction *)), this, SLOT(updateMenu(QAction *)));
+
+ getToolbars().init();
+
+ statusBar()->setSizeGripEnabled(false);
+
+ view_state_changed.connect(boost::bind(&GuiView::update_view_state, this));
+ QObject::connect(&statusbar_timer_, SIGNAL(timeout()), this, SLOT(update_view_state_qt()));
+
+ // make sure the buttons are disabled if needed
+ updateToolbars();
+
+ LyXView::init();
+}
+
void GuiView::updateMenu(QAction *action)
{
menubar_->update();
* Full author contact details are available in file CREDITS.
*/
-#ifndef GUIVIEW_H
-#define GUIVIEW_H
+#ifndef GUI_VIEW_H
+#define GUI_VIEW_H
// Must be here because of moc.
#include <config.h>
-#include "GuiImplementation.h"
-
#include "frontends/LyXView.h"
#include "funcrequest.h"
/**
* GuiView - Qt4 implementation of LyXView
*
- * Qt-private implementation of the main LyX window.
+ * qt4-private implementation of the main LyX window.
*/
class GuiView : public QMainWindow, public LyXView {
Q_OBJECT
public:
- /// create a main window
- GuiView();
+ /// create a main window of the given dimensions
+ GuiView(Gui & owner);
~GuiView();
+ /// initialize the object
+ virtual void init();
+
/// show - display the top-level window
void show();
/// menu item has been selected
void activated(FuncRequest const &);
- // returns true if this view has the focus.
+ /// returns true if this view has the focus.
virtual bool hasFocus() const;
- //
- Gui & gui() { return frontend_; }
-
+ ///
static QMainWindow* mainWidget();
public slots:
///
static QMainWindow* mainWidget_;
- GuiImplementation frontend_;
-
///
void updateFloatingGeometry();
///
#include <boost/current_function.hpp>
+// This include must be declared before everything else because
+// of boost/Qt/LyX clash...
+#include "GuiView.h"
+
#include "GuiWorkArea.h"
#include "QLPainter.h"
#include "QLyXKeySym.h"
-#include "GuiView.h"
#include "ColorCache.h"
#include "qt_helpers.h"
#include <boost/bind.hpp>
-// Abdel (09/06/2006):
-// I want the drawing to be fast without Keyboard buffering so when working
-// on optimization, please set the following macro to 0:
-#define USE_KEY_BUFFERING 0
+// Abdel (26/06/2006):
+// On windows-XP the UserGuide PageDown scroll test is faster without event pruning (16 s)
+// than with it (23 s).
+#ifdef Q_WS_WIN
+ #define USE_EVENT_PRUNING 0
+#else
+ #define USE_EVENT_PRUNING 0
+#endif
using std::endl;
using std::string;
{}
-GuiWorkArea::GuiWorkArea(LyXView & owner, int w, int h)
-: QAbstractScrollArea(GuiView::mainWidget()), WorkArea(owner, w, h), view_(owner), painter_(this)
+GuiWorkArea::GuiWorkArea(int w, int h, QWidget * parent, BufferView * buffer_view)
+: QAbstractScrollArea(parent), WorkArea(buffer_view), painter_(this)
{
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
- GuiView::mainWidget()->setCentralWidget(this);
-
setAcceptDrops(true);
setMinimumSize(100, 70);
<< "\n viewport height\t" << viewport()->height()
<< endl;
- if (USE_KEY_BUFFERING) {
+ if (USE_EVENT_PRUNING) {
// This is the keyboard buffering stuff...
// I don't see any need for this under windows. The keyboard is reactive
// enough...
step_timer_.start(50, true);
}
- ///////////////////////////////////////////////////////////////////////
- // Specific stuff goes here...
-
-#if USE_INPUT_METHODS
- // to make qt-immodule work
- setInputMethodEnabled(true);
-#endif
-
+ // Enables input methods for asian languages.
+ // Must be set when creating custom text editing widgets.
+ setAttribute(Qt::WA_InputMethodEnabled, true);
}
GuiWorkArea::~GuiWorkArea()
{
}
+
void GuiWorkArea::setScrollbarParams(int h, int scroll_pos, int scroll_line_step)
{
// do what cursor movement does (some grey)
verticalScrollBar()->setLineStep(scroll_line_step);
}
+
void GuiWorkArea::adjustViewWithScrollBar(int)
{
/*
<< " linestep=" << verticalScrollBar()->lineStep()
<< endl;
*/
- view_.view()->scrollDocView(verticalScrollBar()->sliderPosition());
+ buffer_view_->scrollDocView(verticalScrollBar()->sliderPosition());
}
for (int i = 0; i!=files.size(); ++i) {
string const file = os::internal_path(fromqstr(files.at(i).toString()));
if (!file.empty())
- view_.view()->workAreaDispatch(FuncRequest(LFUN_FILE_OPEN, file));
+ buffer_view_->workAreaDispatch(FuncRequest(LFUN_FILE_OPEN, file));
}
}
FuncRequest cmd(LFUN_MOUSE_TRIPLE,
dc_event_.x, dc_event_.y,
q_button_state(dc_event_.state));
- view_.view()->workAreaDispatch(cmd);
+ buffer_view_->workAreaDispatch(cmd);
return;
}
FuncRequest const cmd(LFUN_MOUSE_PRESS, e->x(), e->y(),
q_button_state(e->button()));
- view_.view()->workAreaDispatch(cmd);
+ buffer_view_->workAreaDispatch(cmd);
}
FuncRequest const cmd(LFUN_MOUSE_RELEASE, e->x(), e->y(),
q_button_state(e->button()));
- view_.view()->workAreaDispatch(cmd);
+ buffer_view_->workAreaDispatch(cmd);
}
synthetic_mouse_event_.scrollbar_value_old = scrollbar_value;
// ... and dispatch the event to the LyX core.
- view_.view()->workAreaDispatch(cmd);
+ buffer_view_->workAreaDispatch(cmd);
}
}
synthetic_mouse_event_.scrollbar_value_old = scrollbar_value;
// ... and dispatch the event to the LyX core.
- view_.view()->workAreaDispatch(synthetic_mouse_event_.cmd);
+ buffer_view_->workAreaDispatch(synthetic_mouse_event_.cmd);
}
}
<< " key=" << e->key()
<< endl;
- if (USE_KEY_BUFFERING) {
+ if (USE_EVENT_PRUNING) {
keyeventQueue_.push(boost::shared_ptr<QKeyEvent>(new QKeyEvent(*e)));
}
else {
boost::shared_ptr<QLyXKeySym> sym(new QLyXKeySym);
sym->set(e);
- view_.view()->workAreaKeyPress(sym, q_key_state(e->state()));
+ buffer_view_->workAreaKeyPress(sym, q_key_state(e->state()));
}
}
-// This is used only if USE_KEY_BUFFERING is defined...
+
+// This is used only if USE_EVENT_PRUNING is defined...
void GuiWorkArea::keyeventTimeout()
{
bool handle_autos = true;
continue;
}
- boost::shared_ptr<QLyXKeySym> sym(new QLyXKeySym);
+ boost::shared_ptr<QLyXKeySym> sym(new QLyXKeySym);
sym->set(ev.get());
- lyxerr[Debug::GUI] << BOOST_CURRENT_FUNCTION
- << " count=" << ev->count()
- << " text=" << (const char *) ev->text()
- << " isAutoRepeat=" << ev->isAutoRepeat()
- << " key=" << ev->key()
- << endl;
+ lyxerr[Debug::GUI] << BOOST_CURRENT_FUNCTION
+ << " count=" << ev->count()
+ << " text=" << (const char *) ev->text()
+ << " isAutoRepeat=" << ev->isAutoRepeat()
+ << " key=" << ev->key()
+ << endl;
- view_.view()->workAreaKeyPress(sym, q_key_state(ev->state()));
+ buffer_view_->workAreaKeyPress(sym, q_key_state(ev->state()));
keyeventQueue_.pop();
handle_autos = false;
FuncRequest cmd(LFUN_MOUSE_DOUBLE,
dc_event_.x, dc_event_.y,
q_button_state(dc_event_.state));
- view_.view()->workAreaDispatch(cmd);
+ buffer_view_->workAreaDispatch(cmd);
}
// paint_device_ = QImage(viewport()->width(), viewport()->height(), QImage::Format_RGB32);
paint_device_ = QPixmap(viewport()->width(), viewport()->height());
- view_.view()->workAreaResize();
+ buffer_view_->workAreaResize(viewport()->width(), viewport()->height());
/*
lyxerr[Debug::GUI] << BOOST_CURRENT_FUNCTION
if (show_hcursor_)
q.drawPixmap(cursor_x_, cursor_y_ + cursor_h_ - 1, hcursor_);
+
+ buffer_view_->updateScrollbar();
+
+ ScrollbarParameters const & scroll_ = buffer_view_->scrollbarParameters();
+
+ verticalScrollBar()->setTracking(false);
+ setScrollbarParams(scroll_.height, scroll_.position,
+ scroll_.lineScrollHeight);
+ verticalScrollBar()->setTracking(true);
}
}
-void GuiWorkArea::showCursor(int x, int y, int h, Cursor_Shape shape)
+void GuiWorkArea::showCursor(int x, int y, int h, CursorShape shape)
{
if (!qApp->focusWidget())
return;
// We cache two pixmaps:
// 1 the vertical line of the cursor.
// 2 the horizontal line of the L-shaped cursor (if necessary).
-
+
// Draw the new (vertical) cursor.
vcursor_ = QPixmap(cursor_w_, cursor_h_);
vcursor_.fill(cursor_color_);
viewport()->update(cursor_x_, cursor_y_, cursor_w_, cursor_h_);
}
-///////////////////////////////////////////////////////////////
-///////////////////////////////////////////////////////////////
-// Specific stuff
-
-////////////////////////////////////////////////////////////////////////
-// qt-immodule specific stuff goes here...
-
-#if USE_INPUT_METHODS
-// to make qt-immodule work
void GuiWorkArea::inputMethodEvent(QInputMethodEvent * e)
{
- QString const text = e->text();
+ QString const & text = e->commitString();
if (!text.isEmpty()) {
+
+ lyxerr[Debug::KEY] << BOOST_CURRENT_FUNCTION
+ << " preeditString =" << (const char *) e->preeditString()
+ << " commitString =" << (const char *) e->commitString()
+ << endl;
+
int key = 0;
// needed to make math superscript work on some systems
// ideally, such special coding should not be necessary
}
e->accept();
}
-#endif
+
} // namespace frontend
} // namespace lyx
#ifndef WORKAREA_H
#define WORKAREA_H
-#if (defined(Q_WS_X11) && QT_VERSION >= 0x030200)
-#define USE_INPUT_METHODS 1
-#endif
-
#ifdef emit
#undef emit
#endif
-#include "frontends/LyXView.h"
#include "frontends/WorkArea.h"
#include "QLPainter.h"
namespace lyx {
namespace frontend {
+class GuiView;
+
/// for emulating triple click
class double_click {
public:
public:
- GuiWorkArea(LyXView & owner, int w, int h);
+ GuiWorkArea(int width, int height, QWidget * parent, BufferView * buffer_view = 0);
virtual ~GuiWorkArea();
/// return the width of the content pane
QPixmap is implicitely shared so no need to pass by reference.
*/
void drawScreen(int x, int y, QPixmap pixmap);
-
- LyXView & view() { return view_; }
/// copies specified area of pixmap to screen
virtual void expose(int x, int y, int exp_width, int exp_height);
/// paint the cursor and store the background
- virtual void showCursor(int x, int y, int h, Cursor_Shape shape);
+ virtual void showCursor(int x, int y, int h, CursorShape shape);
/// hide the cursor
virtual void removeCursor();
/// key press
void keyPressEvent(QKeyEvent * e);
-#if USE_INPUT_METHODS
protected:
/// IM events
void inputMethodEvent(QInputMethodEvent * e);
-#endif
public slots:
void adjustViewWithScrollBar(int action = 0);
private:
- ///
- LyXView & view_;
-
/// Buffer view width.
int workWidth_;
///
QColor cursor_color_;
///
- Cursor_Shape cursor_shape_;
+ CursorShape cursor_shape_;
};
} // namespace frontend
#include "GuiWorkArea.h"
#include "QLImage.h"
-
#include "ColorCache.h"
#include "FontLoader.h"
+#include "Application.h"
+
+#include "debug.h"
#include "language.h"
#include "LColor.h"
LyXFont smallfont(f);
smallfont.decSize().decSize().setShape(LyXFont::UP_SHAPE);
- QFont const & qfont = fontloader.get(f);
- QFont const & qsmallfont = fontloader.get(smallfont);
+ QFont const & qfont = theApp->fontLoader().get(f);
+ QFont const & qsmallfont = theApp->fontLoader().get(smallfont);
QFontMetrics const & qfontm = QFontMetrics(qfont);
QFontMetrics const & qsmallfontm = QFontMetrics(qsmallfont);
if (f.realShape() != LyXFont::SMALLCAPS_SHAPE) {
setQPainterPen(f.realColor());
- qp_->setFont(fontloader.get(f));
+ qp_->setFont(theApp->fontLoader().get(f));
// We need to draw the text as LTR as we use our own bidi code.
qp_->setLayoutDirection(Qt::LeftToRight);
qp_->drawText(x, y, str);
using lyx::support::ltrim;
using lyx::support::package;
+using lyx::frontend::GuiImplementation;
using lyx::frontend::GuiView;
using lyx::frontend::Application;
LyXServer * lyxserver;
LyXServerSocket * lyxsocket;
+lyx::frontend::Application * theApp;
+
namespace {
int getDPI()
Application app(argc, argv);
#endif
+ theApp = &app;
+
// install translation file for Qt built-in dialogs
// These are only installed since Qt 3.2.x
// this can't be done before because it needs the Languages object
initEncodings();
- boost::shared_ptr<GuiView> view_ptr(new GuiView);
+ int view_id = theApp->gui().newView(width, height);
+ GuiView & view = static_cast<GuiView &> (theApp->gui().view(view_id));
- LyX::ref().addLyXView(view_ptr);
+ // FIXME: for now we assume that there is only one LyXView with id = 0.
+ int workArea_id_ = theApp->gui().newWorkArea(width, height, 0);
+ //WorkArea * workArea_ = & theApp->gui().workArea(workArea_id_);
- GuiView & view = *view_ptr.get();
+ LyX::ref().addLyXView(&view);
view.init();
-
+
// only true when the -geometry option was NOT used
if (width != -1 && height != -1) {
if (posx != -1 && posy != -1) {
void update_fonts()
{
- fontloader.update();
+ theApp->fontLoader().update();
}
bool font_available(LyXFont const & font)
{
- return fontloader.available(font);
+ return theApp->fontLoader().available(font);
}
#include "frontends/lyx_gui.h"
#include "FontLoader.h"
+#include "Application.h"
#include "language.h"
{
if (!lyx_gui::use_gui)
return 1;
- return fontloader.metrics(f).ascent();
+ return theApp->fontLoader().metrics(f).ascent();
}
return 1;
// We add 1 as the value returned by QT is different than X
// See http://doc.trolltech.com/2.3/qfontmetrics.html#200b74
- return fontloader.metrics(f).descent() + 1;
+ return theApp->fontLoader().metrics(f).descent() + 1;
}
{
if (!lyx_gui::use_gui)
return 1;
- QRect const & r = fontloader.metrics(f).boundingRect(c);
+ QRect const & r = theApp->fontLoader().metrics(f).boundingRect(c);
// Qt/Win 3.2.1nc (at least) corrects the GetGlyphOutlineA|W y
// value by the height: (x, -y-height, width, height).
// Other versions return: (x, -y, width, height)
{
if (!lyx_gui::use_gui)
return 1;
- QRect const & r = fontloader.metrics(f).boundingRect(c);
+ QRect const & r = theApp->fontLoader().metrics(f).boundingRect(c);
// Qt/Win 3.2.1nc (at least) corrects the GetGlyphOutlineA|W y
// value by the height: (x, -y-height, width, height).
// Other versions return: (x, -y, width, height)
{
if (!lyx_gui::use_gui)
return 1;
- return fontloader.metrics(f).leftBearing(c);
+ return theApp->fontLoader().metrics(f).leftBearing(c);
}
{
if (!lyx_gui::use_gui)
return 1;
- QFontMetrics const & m = fontloader.metrics(f);
+ QFontMetrics const & m = theApp->fontLoader().metrics(f);
// Qt rbearing is from the right edge of the char's width().
return m.width(c) - m.rightBearing(c);
LyXFont smallfont = f;
smallfont.decSize().decSize().setShape(LyXFont::UP_SHAPE);
- QFontMetrics const & qm = fontloader.metrics(f);
- QFontMetrics const & qsmallm = fontloader.metrics(smallfont);
+ QFontMetrics const & qm = theApp->fontLoader().metrics(f);
+ QFontMetrics const & qsmallm = theApp->fontLoader().metrics(smallfont);
Encoding const * encoding = fontencoding(f);
return smallcapswidth(s, ls, f);
Encoding const * encoding = fontencoding(f);
- QLFontInfo & fi = fontloader.fontinfo(f);
+ QLFontInfo & fi = theApp->fontLoader().fontinfo(f);
if (ls == 1)
return fi.width(encoding->ucs(s[0]));
void rectText(string const & str, LyXFont const & f,
int & w, int & ascent, int & descent)
{
- QFontMetrics const & m = fontloader.metrics(f);
+ QFontMetrics const & m = theApp->fontLoader().metrics(f);
static int const d = 2;
w = width(str, f) + d * 2 + 2;
ascent = m.ascent() + d;
void buttonText(string const & str, LyXFont const & f,
int & w, int & ascent, int & descent)
{
- QFontMetrics const & m = fontloader.metrics(f);
+ QFontMetrics const & m = theApp->fontLoader().metrics(f);
static int const d = 3;
w = width(str, f) + d * 2 + 2;
ascent = m.ascent() + d;
namespace lyx {
namespace frontend {
-typedef XWorkArea FWorkArea;
-
/**
* The XForms version of the Clipboard.
*/
class GuiClipboard: public lyx::frontend::Clipboard
{
public:
- GuiClipboard(FWorkArea * work_area)
+ GuiClipboard(XWorkArea * work_area)
: old_work_area_(work_area)
{
}
//@}
private:
- FWorkArea * old_work_area_;
+ XWorkArea * old_work_area_;
};
} // namespace frontend
--- /dev/null
+// -*- C++ -*-
+/**
+ * \file xforms/GuiImplementation.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author Abdelrazak Younes
+ *
+ * Full author contact details are available in file CREDITS.
+ */
+
+#include "GuiImplementation.h"
+
+#include "XFormsView.h"
+#include "BufferView.h"
+
+
+namespace lyx {
+namespace frontend {
+
+int GuiImplementation::newView(unsigned int w, unsigned int h)
+{
+ view_.reset(new XFormsView(*this, w, h));
+ return 0;
+}
+
+
+int GuiImplementation::newWorkArea(unsigned int w, unsigned int h, int /*view_id*/)
+{
+ old_work_area_.reset(new XWorkArea(*view_.get(), w, h));
+ old_screen_.reset(new XScreen(*old_work_area_));
+ work_area_.reset(new GuiWorkArea(boost::static_pointer_cast<XScreen>(old_screen_).get(),
+ boost::static_pointer_cast<XWorkArea>(old_work_area_).get()));
+ clipboard_.reset(new GuiClipboard(boost::static_pointer_cast<XWorkArea>(old_work_area_).get()));
+ guiCursor().connect(work_area_.get());
+
+ // FIXME BufferView creation should be independant of WorkArea creation
+ buffer_views_[0].reset(new BufferView(view_.get(), work_area_.get()));
+ work_area_->setBufferView(buffer_views_[0].get());
+ view_->setBufferView(buffer_views_[0].get());
+ return 0;
+}
+
+
+void GuiImplementation::destroyWorkArea(int /*id*/)
+{
+ clipboard_.reset();
+ work_area_.reset();
+ old_work_area_.reset();
+ old_screen_.reset();
+}
+
+} // namespace frontend
+} // namespace lyx
#include <boost/shared_ptr.hpp>
-#include <map>
-
namespace lyx {
namespace frontend {
-typedef XScreen FScreen;
-typedef XWorkArea FWorkArea;
-
/**
* The Gui class is the interface to all XForms components.
*/
-class GuiImplementation: public lyx::frontend::Gui
+class GuiImplementation : public lyx::frontend::Gui
{
public:
- GuiImplementation(LyXView & owner): owner_(owner)
+ GuiImplementation()
{
}
{
}
- lyx::frontend::Clipboard& clipboard()
+ lyx::frontend::Clipboard & clipboard()
{
return *clipboard_;
}
- int newWorkArea(int w, int h)
+ int newView(unsigned int w, unsigned int h);
+
+
+ LyXView & view(int /*id*/)
{
- old_work_area_.reset(new FWorkArea(owner_, w, h));
- old_screen_.reset(new FScreen(*old_work_area_.get()));
- work_area_.reset(new GuiWorkArea(owner_, w, h, old_screen_.get(), old_work_area_.get()));
- clipboard_.reset(new GuiClipboard(old_work_area_.get()));
- guiCursor().connect(work_area_.get());
- return 0;
+ return *view_;
}
- lyx::frontend::WorkArea& workArea(int id)
+
+ void destroyView(int /*id*/)
{
- return *work_area_;
+ view_.reset();
}
- void destroyWorkArea(int id)
+ int newWorkArea(unsigned int w, unsigned int h, int view_id);
+
+ lyx::frontend::WorkArea & workArea(int /*id*/)
{
- clipboard_.reset();
- work_area_.reset();
- old_work_area_.reset();
- old_screen_.reset();
+ return *work_area_;
}
+ void destroyWorkArea(int id);
+
private:
///
boost::shared_ptr<GuiClipboard> clipboard_;
///
boost::shared_ptr<GuiWorkArea> work_area_;
///
- boost::shared_ptr<FWorkArea> old_work_area_;
+ boost::shared_ptr<LyXView> view_;
///
- boost::shared_ptr<FScreen> old_screen_;
+ boost::shared_ptr<XWorkArea> old_work_area_;
///
- LyXView & owner_;
+ boost::shared_ptr<XScreen> old_screen_;
};
} // namespace frontend
namespace lyx {
namespace frontend {
-typedef XScreen FScreen;
-typedef XWorkArea FWorkArea;
-
/**
* Temporary wrapper around XWorkArea and XScreen.
* Please refer to the Qt4 implementation for a proper cleanup of the API.
*/
class GuiWorkArea: public lyx::frontend::WorkArea {
public:
- GuiWorkArea(LyXView & owner, int w, int h,
- FScreen * screen, FWorkArea * work_area)
- : lyx::frontend::WorkArea(owner, w, h),
- old_screen_(screen), old_work_area_(work_area)
+ GuiWorkArea(XScreen * screen, XWorkArea * work_area)
+ : old_screen_(screen), old_work_area_(work_area)
{
}
/// paint the cursor and store the background
- virtual void showCursor(int x, int y, int h, Cursor_Shape shape)
+ virtual void showCursor(int x, int y, int h, CursorShape shape)
{
old_screen_->showCursor(x, y, h, shape);
}
}
private:
- FScreen * old_screen_;
- FWorkArea * old_work_area_;
+ XScreen * old_screen_;
+ XWorkArea * old_work_area_;
};
} // namespace frontend
FormWrap.h \
GuiClipboard.h \
GuiImplementation.h \
+ GuiImplementation.C \
GuiWorkArea.h \
LayoutEngine.C \
LayoutEngine.h \
}
-XFormsView::XFormsView(int width, int height)
- : LyXView(),
+XFormsView::XFormsView(Gui & owner, int width, int height)
+ : LyXView(owner),
window_(Box(width, height)),
- icon_pixmap_(0), icon_mask_(0), frontend_(*this)
+ icon_pixmap_(0), icon_mask_(0)
{
int const air = 2;
menubar_.reset(new XFormsMenubar(this, menubackend));
getToolbars().init();
- bufferview_.reset(new BufferView(this, width, height));
minibuffer_.reset(new XMiniBuffer(*this, *controlcommand_));
// Assign an icon to the main form.
focus_command_buffer.connect(boost::bind(&XMiniBuffer::focus, minibuffer_.get()));
// Make sure the buttons are disabled if needed.
- updateToolbars();
+ //updateToolbars();
redraw_con =
getDialogs().redrawGUI().connect(boost::bind(&XFormsView::redraw, this));
}
#ifndef LyXView_H
#define LyXView_H
-#include "GuiImplementation.h"
#include "LayoutEngine.h"
#include "forms_fwd.h"
};
/// create a main window of the given dimensions
- XFormsView(int w, int h);
+ XFormsView(Gui & owner, int w, int h);
~XFormsView();
// returns true if this view has the focus.
virtual bool hasFocus() const;
- ///
- Gui & gui() { return frontend_; }
-
private:
/**
* setWindowTitle - set title of window
Pixmap icon_pixmap_;
///
Pixmap icon_mask_;
- ///
- GuiImplementation frontend_;
};
} // namespace frontend
XWorkArea::XWorkArea(LyXView & owner, int w, int h)
- : view_(owner), workareapixmap(0), painter_(*this)
+ : view_(owner), workareapixmap(0), painter_(*this)
{
fl_freeze_all_forms();
FL_OBJECT * obj;
FL_OBJECT * frame;
+ XFormsView & xview = dynamic_cast<XFormsView &>(owner);
+
+ // Set the current form so that objects have something to get
+ // added to.
+ //fl_addto_form(fl_current_form);
+ fl_addto_form(xview.getForm());
+
// A frame around the work area.
frame = obj = fl_add_box(FL_BORDER_BOX, 0, 0, w, h, "");
fl_set_object_resize(obj, FL_RESIZE_ALL);
// Hand control of the layout of these widgets to the
// Layout Engine.
- XFormsView & xview = dynamic_cast<XFormsView &>(owner);
BoxList & boxlist = xview.getBox(XFormsView::Center)->children();
wa_box_ = boxlist.push_back(Box(0,0));
val.function = GXcopy;
copy_gc = XCreateGC(fl_get_display(), RootWindow(fl_get_display(), 0),
GCFunction, &val);
+
+ fl_end_form();
}
height,
fl_get_visual_depth());
- view_.view()->workAreaResize();
+ view_.view()->workAreaResize(width, height);
}
///
XWorkArea(LyXView & owner, int width, int height);
///
- ~XWorkArea();
+ virtual ~XWorkArea();
///
virtual Painter & getPainter() { return painter_; }
///
/// handles SelectionRequest X Event, to fill the clipboard
int event_cb(XEvent * xev);
private:
- LyXView & view_;
-
+ LyXView & view_;
+
/// generate the pixmap, and copy backing pixmap to it,
/// and send resize event if needed
void redraw(int, int);
#include "xfont_loader.h"
#include "xforms_helpers.h"
#include "xformsImage.h"
+#include "GuiImplementation.h"
#include "XFormsView.h"
#include "bufferlist.h"
using lyx::frontend::lyxColorHandler;
using lyx::frontend::LyXColorHandler;
using lyx::frontend::XformsColor;
+using lyx::frontend::Gui;
+using lyx::frontend::GuiImplementation;
using lyx::frontend::XFormsView;
namespace os = lyx::support::os;
lyxerr[Debug::GUI] << "Creating view: " << width << 'x' << height
<< '+' << posx << '+' << posy << endl;
- boost::shared_ptr<XFormsView> view(new XFormsView(width, height));
- LyX::ref().addLyXView(view);
+ GuiImplementation * gui = new GuiImplementation;
- view->show(posx == -1 ? (WidthOfScreen(s) - width) / 2 : posx,
+ int view_id = gui->newView(width, height);
+ XFormsView & view = static_cast<XFormsView &> (gui->view(view_id));
+ int workArea_id_ = gui->newWorkArea(width, height, 0);
+
+ LyX::ref().addLyXView(&view);
+
+ view.show(posx == -1 ? (WidthOfScreen(s) - width) / 2 : posx,
posy == -1 ? (HeightOfScreen(s) - height) / 2 : posy, "LyX");
- view->init();
+ view.init();
// FIXME: some code below needs moving
- lyxserver = new LyXServer(&view->getLyXFunc(), lyxrc.lyxpipes);
- lyxsocket = new LyXServerSocket(&view->getLyXFunc(),
+ lyxserver = new LyXServer(&view.getLyXFunc(), lyxrc.lyxpipes);
+ lyxsocket = new LyXServerSocket(&view.getLyXFunc(),
os::internal_path(package().temp_dir() + "/lyxsocket"));
for_each(files.begin(), files.end(),
- bind(&BufferView::loadLyXFile, view->view(), _1, true));
+ bind(&BufferView::loadLyXFile, view.view(), _1, true));
// handle the batch commands the user asked for
if (!batch.empty())
- view->getLyXFunc().dispatch(lyxaction.lookupFunc(batch));
+ view.getLyXFunc().dispatch(lyxaction.lookupFunc(batch));
// enter the event loop
while (!finished) {
}
-void XScreen::showCursor(int x, int y, int h, Cursor_Shape shape)
+void XScreen::showCursor(int x, int y, int h, CursorShape shape)
{
// Update the cursor color. (a little slow doing it like this ??)
setCursorColor();
#ifndef XSCREEN_H
#define XSCREEN_H
-#include "frontends/GuiCursor.h"
-
#include <X11/Xlib.h> // for Pixmap, GC
+#include "frontends/GuiCursor.h"
+
class WorkArea;
namespace lyx {
virtual void expose(int x, int y, int w, int h);
/// paint the cursor and store the background
- virtual void showCursor(int x, int y, int h, Cursor_Shape shape);
+ virtual void showCursor(int x, int y, int h, CursorShape shape);
/// hide the cursor
virtual void removeCursor();
string filename2 = (loader_format == format) ? filename
: changeExtension(filename,
formats.extension(loader_format));
- insertAsciiFile(lv->view().get(), filename2, as_paragraphs);
+ insertAsciiFile(lv->view(), filename2, as_paragraphs);
lv->dispatch(FuncRequest(LFUN_MARK_OFF));
}
}
-void LyX::addLyXView(boost::shared_ptr<LyXView> const & lyxview)
+void LyX::addLyXView(LyXView * lyxview)
{
views_.push_back(lyxview);
}
lyx::Session & session();
lyx::Session const & session() const;
- void addLyXView(boost::shared_ptr<LyXView> const & lyxview);
+ void addLyXView(LyXView * lyxview);
/** redraw \c inset in all the BufferViews in which it is currently
* visible. If successful return a pointer to the owning Buffer.
/// lyx session, containing lastfiles, lastfilepos, and lastopened
boost::scoped_ptr<lyx::Session> session_;
///
- typedef std::list<boost::shared_ptr<LyXView> > ViewList;
+ typedef std::list<LyXView *> ViewList;
ViewList views_;
- ///
+ ///
bool geometryOption_;
};
dispatch_buffer.erase();
// redraw the screen at the end (first of the two drawing steps).
- //This is done unless explicitely requested otherwise
+ //This is done unless explicitely requested otherwise
bool update = true;
// also do the second redrawing step. Only done if requested.
bool updateforce = false;
view()->center();
// see BufferView_pimpl::center()
- view()->updateScrollbar();
break;
}
BufferView * LyXFunc::view() const
{
BOOST_ASSERT(owner);
- return owner->view().get();
+ return owner->view();
}
updated |= cursorUp(cur);
}
- cur.bv().updateScrollbar();
finishUndo();
return updated;
}
updated |= cursorDown(cur);
}
- cur.bv().updateScrollbar();
finishUndo();
return updated;
}
cur.resetAnchor();
moveCursor(cur, false);
- bv->updateScrollbar();
break;
}