& some small stuff
-- Those who desire to give up Freedom in order to gain Security, will not have, nor do they deserve, either one. (T. Jefferson or B. Franklin or both...)
? .BufferView_pimpl.C.swp ? 1.diff ? parrows.diff ? frontends/.LyXView.C.swp Index: BufferView.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/BufferView.C,v retrieving revision 1.178 diff -u -p -r1.178 BufferView.C --- BufferView.C 15 Aug 2003 10:24:36 -0000 1.178 +++ BufferView.C 18 Aug 2003 07:59:55 -0000 @@ -444,7 +444,6 @@ void BufferView::replaceWord(string cons // FIXME: should be done through LFUN buffer()->markDirty(); - fitCursor(); update(); } Index: BufferView_pimpl.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/BufferView_pimpl.C,v retrieving revision 1.415 diff -u -p -r1.415 BufferView_pimpl.C --- BufferView_pimpl.C 15 Aug 2003 22:46:29 -0000 1.415 +++ BufferView_pimpl.C 18 Aug 2003 07:59:55 -0000 @@ -489,7 +493,8 @@ void BufferView::Pimpl::scrollDocView(in screen().hideCursor(); - screen().draw(bv_->text, bv_, value); + bv_->text->top_y(value); + //screen().draw(); if (!lyxrc.cursor_follows_scrollbar) return; @@ -767,14 +772,14 @@ void BufferView::Pimpl::insetUnlock() void BufferView::Pimpl::center() { - LyXText * t = bv_->text; + LyXText * text = bv_->text; - beforeChange(t); + beforeChange(text); int const half_height = workarea().workHeight() / 2; int new_y = 0; - if (t->cursor.y() > half_height) - new_y = t->cursor.y() - half_height; + if (text->cursor.y() > half_height) + new_y = text->cursor.y() - half_height; // FIXME: look at this comment again ... @@ -787,8 +792,8 @@ void BufferView::Pimpl::center() // and also might have moved top_y() must make sure to call // updateScrollbar() currently. Never mind that this is a // pretty obfuscated way of updating t->top_y() - screen().draw(t, bv_, new_y); - + text->top_y(new_y); + //screen().draw(); update(); } @@ -817,7 +822,7 @@ InsetOld * BufferView::Pimpl::getInsetBy return it != buffer_->inset_iterator_end() ? (*it) : 0; #else // Ok, this is a little bit too brute force but it - // should work for now. Better infrastructure is comming. (Lgb) + // should work for now. Better infrastructure is coming. (Lgb) Buffer * b = bv_->buffer(); LyXCursor cursor = bv_->getLyXText()->cursor; @@ -1179,7 +1184,6 @@ bool BufferView::Pimpl::dispatch(FuncReq if (name == "bibitem") { // We need to do a redraw because the maximum // InsetBibitem width could have changed - bv_->fitCursor(); #warning check whether the update() is needed at all bv_->update(); } @@ -1201,12 +1205,8 @@ bool BufferView::Pimpl::dispatch(FuncReq break; case LFUN_LAYOUT_PARAGRAPH: { - Paragraph const * par = &*bv_->getLyXText()->cursor.par(); - if (!par) - break; - string data; - params2string(*par, data); + params2string(*bv_->getLyXText()->cursor.par(), data); data = "show\n" + data; bv_->owner()->getDialogs().show("paragraph", data); Index: lyxfind.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyxfind.C,v retrieving revision 1.45 diff -u -p -r1.45 lyxfind.C --- lyxfind.C 15 Aug 2003 10:24:38 -0000 1.45 +++ lyxfind.C 18 Aug 2003 07:59:55 -0000 @@ -208,7 +208,6 @@ int replace(BufferView * bv, // FIXME: should be called via an LFUN bv->buffer()->markDirty(); - bv->fitCursor(); bv->update(); return replace_count; @@ -263,7 +262,6 @@ bool find(BufferView * bv, bv->unlockInset(bv->theLockingInset()); found = false; } - bv->fitCursor(); bv->update(); return found; @@ -397,7 +395,6 @@ bool findNextChange(BufferView * bv) found = false; } - bv->fitCursor(); bv->update(); return found; Index: paragraph_funcs.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/paragraph_funcs.C,v retrieving revision 1.58 diff -u -p -r1.58 paragraph_funcs.C --- paragraph_funcs.C 15 Aug 2003 08:03:50 -0000 1.58 +++ paragraph_funcs.C 18 Aug 2003 07:59:55 -0000 @@ -472,8 +472,8 @@ TeXOnePar(Buffer const * buf, LatexRunParams const & runparams, string const & everypar) { - lyxerr[Debug::LATEX] << "TeXOnePar... " << &*pit << " '" << everypar -<< "'" << endl; + lyxerr[Debug::LATEX] << "TeXOnePar... " << &*pit << " '" + << everypar << "'" << endl; BufferParams const & bparams = buf->params; InsetOld const * in = pit->inInset(); @@ -481,10 +481,10 @@ TeXOnePar(Buffer const * buf, LyXLayout_ptr style; // well we have to check if we are in an inset with unlimited - // lenght (all in one row) if that is true then we don't allow + // length (all in one row) if that is true then we don't allow // any special options in the paragraph and also we don't allow // any environment other then "Standard" to be valid! - if ((in == 0) || !in->forceDefaultParagraphs(in)) { + if (in == 0 || !in->forceDefaultParagraphs(in)) { style = pit->layout(); if (pit->params().startOfAppendix()) { @@ -740,7 +740,7 @@ void latexParagraphs(Buffer const * buf, // length (all in one row) if that is true then we don't allow // any special options in the paragraph and also we don't allow // any environment other then "Standard" to be valid! - if ((in == 0) || !in->forceDefaultParagraphs(in)) { + if (in == 0 || !in->forceDefaultParagraphs(in)) { LyXLayout_ptr const & layout = par->layout(); if (layout->intitle) { Index: rowpainter.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/rowpainter.C,v retrieving revision 1.49 diff -u -p -r1.49 rowpainter.C --- rowpainter.C 15 Aug 2003 14:54:17 -0000 1.49 +++ rowpainter.C 18 Aug 2003 07:59:55 -0000 @@ -1068,7 +1068,7 @@ int getLengthMarkerHeight(BufferView con int paintRows(BufferView const & bv, LyXText const & text, RowList::iterator rit, int xo, int y, int yf, int y2, int yo) { - //lyxerr << "paintRows: rit: " << &*rit << endl; + lyxerr << " paintRows: rit: " << &*rit << endl; const_cast<LyXText&>(text).updateRowPositions(); int yy = yf - y; Index: text3.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text3.C,v retrieving revision 1.117 diff -u -p -r1.117 text3.C --- text3.C 17 Aug 2003 11:28:20 -0000 1.117 +++ text3.C 18 Aug 2003 07:59:55 -0000 @@ -1248,7 +1248,6 @@ InsetOld::RESULT LyXText::dispatch(FuncR bv->text->setSelection(); bv->update(); - bv->fitCursor(); break; } @@ -1424,7 +1423,7 @@ InsetOld::RESULT LyXText::dispatch(FuncR // stack. They don't *have* to // alter the document... // (Joacim) - // ...or maybe the SetCursorParUndo() + // ...or maybe the recordUndo() // below isn't necessary at all anylonger? if (inset_hit->lyxCode() == InsetOld::REF_CODE) recordUndo(bv, Undo::ATOMIC); Index: frontends/screen.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/screen.C,v retrieving revision 1.61 diff -u -p -r1.61 screen.C --- frontends/screen.C 15 Aug 2003 10:24:39 -0000 1.61 +++ frontends/screen.C 18 Aug 2003 07:59:55 -0000 @@ -236,8 +236,8 @@ bool LyXScreen::fitManualCursor(BufferVi if (newtop == text->top_y()) return false; - draw(text, bv, newtop); text->top_y(newtop); + //draw(); return true; } @@ -289,10 +289,9 @@ bool LyXScreen::fitCursor(LyXText * text // Is a change necessary? int const newtop = topCursorVisible(text); bool const result = (newtop != text->top_y()); - if (result) { - draw(text, bv, newtop); - } - + text->top_y(newtop); + //if (result) + // draw(); return result; } @@ -309,7 +308,7 @@ void LyXScreen::redraw(BufferView & bv) workarea().getPainter().start(); bv.text->updateRowPositions(); - drawFromTo(bv.text, &bv, 0, workarea().workHeight(), 0, 0); + drawFromTo(bv.text, &bv); expose(0, 0, workarea().workWidth(), workarea().workHeight()); workarea().getPainter().end(); @@ -340,32 +339,27 @@ void LyXScreen::greyOut() workarea().getPainter().image(x, y, w, h, *splash_image); - string const & splash_text = splash.text(); - LyXFont const & splash_font = splash.font(); - x += 260; y += 265; - workarea().getPainter().text(x, y, splash_text, splash_font); + workarea().getPainter().text(x, y, splash.text(), splash.font()); } expose(0, 0, workarea().workWidth(), workarea().workHeight()); workarea().getPainter().end(); } -void LyXScreen::drawFromTo(LyXText * text, BufferView * bv, - int y1, int y2, int yo, int xo) +void LyXScreen::drawFromTo(LyXText * text, BufferView * bv) { - lyxerr[Debug::GUI] << "screen: drawFromTo " << y1 << '-' << y2 << endl; hideCursor(); - + int const y2 = workarea().workHeight(); int const topy = text->top_y(); - int y_text = topy + y1; + int y_text = topy; ParagraphList::iterator dummypit; RowList::iterator rit = text->getRowNearY(y_text, dummypit); int y = y_text - topy; - y = paintRows(*bv, *text, rit, xo, y, y, y2, yo); + y = paintRows(*bv, *text, rit, 0, y, y, y2, 0); // maybe we have to clear the screen at the bottom if (y < y2 && !text->isInInset()) { Index: frontends/screen.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/screen.h,v retrieving revision 1.22 diff -u -p -r1.22 screen.h --- frontends/screen.h 15 Aug 2003 10:24:39 -0000 1.22 +++ frontends/screen.h 18 Aug 2003 07:59:55 -0000 @@ -39,14 +39,6 @@ public: virtual ~LyXScreen(); /** - * draw the screen from a given position - * @param y the text position to draw from - * - * Uses as much of the already printed pixmap as possible - */ - virtual void draw(LyXText *, BufferView *, unsigned int y) = 0; - - /** * fit the cursor onto the visible work area, scrolling if necessary * @param bv the buffer view * @param vheight the height of the visible region @@ -115,11 +107,10 @@ protected: /// hide the cursor virtual void removeCursor() = 0; +private: /// y1 and y2 are coordinates of the screen - void drawFromTo(LyXText *, BufferView *, int y1, int y2, - int y_offset = 0, int x_offset = 0); + void drawFromTo(LyXText *, BufferView *); -private: /// grey out (no buffer) void greyOut(); Index: frontends/qt2/qscreen.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/qscreen.C,v retrieving revision 1.20 diff -u -p -r1.20 qscreen.C --- frontends/qt2/qscreen.C 15 Aug 2003 13:12:24 -0000 1.20 +++ frontends/qt2/qscreen.C 18 Aug 2003 07:59:55 -0000 @@ -68,22 +68,6 @@ void QScreen::expose(int x, int y, int w } -void QScreen::draw(LyXText * text, BufferView * bv, unsigned int y) -{ - QPixmap * p = owner_.getPixmap(); - - owner_.getPainter().start(); - - text->top_y(y); - - // not needed in the xforms frontend anymore - //drawFromTo(text, bv, 0, owner_.height(), 0, 0); - repaint(); - - owner_.getPainter().end(); -} - - void QScreen::showCursor(int x, int y, int h, Cursor_Shape shape) { cursor_x_ = x; Index: frontends/qt2/qscreen.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/qscreen.h,v retrieving revision 1.8 diff -u -p -r1.8 qscreen.h --- frontends/qt2/qscreen.h 3 May 2003 18:05:48 -0000 1.8 +++ frontends/qt2/qscreen.h 18 Aug 2003 07:59:55 -0000 @@ -29,14 +29,6 @@ public: virtual ~QScreen(); - /** - * draw the screen from a given position - * @param y the text position to draw from - * - * Uses as much of the already printed pixmap as possible - */ - virtual void draw(LyXText *, BufferView *, unsigned int y); - protected: /// get the work area virtual WorkArea & workarea() const { return owner_; } Index: frontends/xforms/xscreen.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/xscreen.C,v retrieving revision 1.19 diff -u -p -r1.19 xscreen.C --- frontends/xforms/xscreen.C 15 Aug 2003 12:53:57 -0000 1.19 +++ frontends/xforms/xscreen.C 18 Aug 2003 07:59:55 -0000 @@ -169,15 +169,3 @@ void XScreen::expose(int x, int y, int w x + owner_.xpos(), y + owner_.ypos()); } - - -void XScreen::draw(LyXText * text, BufferView * bv, unsigned int y) -{ - text->top_y(y); - - // make a dumb new-draw - //drawFromTo(text, bv, 0, owner_.workHeight(), 0, 0); - //expose(0, 0, owner_.workWidth(), owner_.workHeight()); - - XSync(fl_get_display(), 0); -} Index: frontends/xforms/xscreen.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/xscreen.h,v retrieving revision 1.10 diff -u -p -r1.10 xscreen.h --- frontends/xforms/xscreen.h 3 May 2003 18:05:48 -0000 1.10 +++ frontends/xforms/xscreen.h 18 Aug 2003 07:59:55 -0000 @@ -35,10 +35,6 @@ public: /// Sets the cursor color to LColor::cursor. virtual void setCursorColor(); - /** Draws the screen form textposition y. Uses as much of - the already printed pixmap as possible */ - virtual void draw(LyXText *, BufferView *, unsigned int y); - protected: /// get the work area virtual WorkArea & workarea() const { return owner_; }