]> git.lyx.org Git - features.git/commitdiff
drop a few fitCursor() and draw() calls
authorAndré Pönitz <poenitz@gmx.net>
Mon, 18 Aug 2003 08:23:03 +0000 (08:23 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Mon, 18 Aug 2003 08:23:03 +0000 (08:23 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7563 a592a061-630c-0410-9148-cb99ea01b6c8

14 files changed:
src/BufferView.C
src/BufferView_pimpl.C
src/ChangeLog
src/frontends/ChangeLog
src/frontends/qt2/qscreen.C
src/frontends/qt2/qscreen.h
src/frontends/screen.C
src/frontends/screen.h
src/frontends/xforms/xscreen.C
src/frontends/xforms/xscreen.h
src/lyxfind.C
src/paragraph_funcs.C
src/rowpainter.C
src/text3.C

index 6850a52d6a10a55771c8c3ef2a7523f9a0a0c6dd..f5892cb2727bc215eca58a7f3cb35e035c3290ba 100644 (file)
@@ -444,7 +444,6 @@ void BufferView::replaceWord(string const & replacestring)
 
        // FIXME: should be done through LFUN
        buffer()->markDirty();
-       fitCursor();
        update();
 }
 
index 0e711c24b9e5d17fe5e239b680d7365e7f1c0caf..222c5a0b71dc31c02f3e7c7ee6f00be90ac6db10 100644 (file)
@@ -489,7 +489,8 @@ void BufferView::Pimpl::scrollDocView(int value)
 
        screen().hideCursor();
 
-       screen().draw(bv_->text, bv_, value);
+       bv_->text->top_y(value);
+       //screen().draw();
 
        if (!lyxrc.cursor_follows_scrollbar)
                return;
@@ -767,14 +768,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 +788,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 +818,7 @@ InsetOld * BufferView::Pimpl::getInsetByCode(InsetOld::Code code)
        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 +1180,6 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev_in)
                        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 +1201,8 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev_in)
                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 4a7891cba1a6dba4e8a0e855b9ce6a0689047769..0b29baf950b76929d4d8929d9bc18965606fd376 100644 (file)
@@ -1,17 +1,26 @@
 
+2003-08-18  André Pönitz  <poenitz@gmx.net>
+
+       * BufferView.C:
+       * BufferView_pimpl.C:
+       * lyxfind.C:
+       * paragraph_funcs.C:
+       * rowpainter.C:
+       * text3.C: remove LyXScreen::draw() and fitCursor calls
+
 2003-08-17  Martin Vermeer  <martin.vermeer@hut.fi>    
 
-       * src/BranchList.[Ch]:
-       * src/InsetList.[Ch]:
-       * src/LColor.[Ch]:
-       * src/LyXAction.C:
-       * src/Makefile.am:
-       * src/MenuBackend.[Ch]:
-       * src/bufferparams.[Ch]:
-       * src/factory.C:
-       * src/lfuns.h:
-       * src/lyxfunc.C:
-       * src/text3.C: implements the 'branch inset'
+       * BranchList.[Ch]:
+       * InsetList.[Ch]:
+       * LColor.[Ch]:
+       * LyXAction.C:
+       * Makefile.am:
+       * MenuBackend.[Ch]:
+       * bufferparams.[Ch]:
+       * factory.C:
+       * lfuns.h:
+       * lyxfunc.C:
+       * text3.C: implements the 'branch inset'
        idea. This allows the output of various versions of a document
        from a single source version, selectively outputing or suppressing
        output of parts of the text.
index 020cb74acffbc57aa403251201dea73611270b23..ae67922f43ae12db57ae20d6bbcfda053d7f16f7 100644 (file)
@@ -1,7 +1,11 @@
 
+2003-08-18  André Pönitz  <poenitz@gmx.net>
+
+       * screen.[Ch]: remove draw()
+
 2003-08-15  André Pönitz  <poenitz@gmx.net>
 
-       * screen.[Ch]: remove toggle selection
+       * screen.[Ch]: remove toggleSelection()
 
 2003-08-02  Jean-Marc Lasgouttes  <lasgouttes@freesurf.fr>
 
index 6afb4444baba056d70c6c1cfb2134d307236893b..71cdb0f23707566652156825e75589673f296fbb 100644 (file)
@@ -68,22 +68,6 @@ void QScreen::expose(int x, int y, int w, int h)
 }
 
 
-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 0ec97f94a94b7a9e0a3f02d884b87578e4a85338..e997633b5db3bfd63a239d6ba9f758589fd1a9c9 100644 (file)
@@ -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 33b3302b252823e16e384f9d89c86bba2e32e545..f2091f60f33341c0d55f9707d19cf67bb550573a 100644 (file)
@@ -236,8 +236,8 @@ bool LyXScreen::fitManualCursor(BufferView * bv, LyXText * text,
        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, BufferView * bv)
        // 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 434611a554497007aa33615a85b21418a5891878..5ba7bbf22233723acc97b980e152356ba2a60fe3 100644 (file)
@@ -38,14 +38,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
@@ -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 3ad462e4e824443f748570757219a64aef642637..36798322198b04f3e7155a51f5bb3de10c6d519e 100644 (file)
@@ -169,15 +169,3 @@ void XScreen::expose(int x, int y, int w, int h)
                  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 dbae69a21dc0a16f35b308f6a06776ef27bc97a6..4bbf03efe8bbcb63c8a4ab01c6ebe53d2d66ce70 100644 (file)
@@ -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_; }
index afc50357e892dec4c9ee811468d2d25c3d59653d..3cb76dc0c5cd17d40565edeaf308ef71b35144cb 100644 (file)
@@ -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 b0022860302479af902c9eaee405f3674b56de66..1b0a6b2efd0c0c809df6348fbfc685dd82cad361 100644 (file)
@@ -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 befec68a3e77c7c7950faeae3eb5c9cbcb86ba8e..bdf51b2912df931cec0dd0ae2bc0260c4882a364 100644 (file)
@@ -1068,7 +1068,7 @@ int getLengthMarkerHeight(BufferView const & bv, VSpace const & vsp)
 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 f0786b73799f318faef9feb154c5bb1a9c6b18d7..29c8d568133ce15f93f89ed0aa858af383860f8a 100644 (file)
@@ -1248,7 +1248,6 @@ InsetOld::RESULT LyXText::dispatch(FuncRequest const & cmd)
 
                bv->text->setSelection();
                bv->update();
-               bv->fitCursor();
                break;
        }
 
@@ -1424,7 +1423,7 @@ InsetOld::RESULT LyXText::dispatch(FuncRequest const & cmd)
                        // 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);