// FIXME: should be done through LFUN
buffer()->markDirty();
- fitCursor();
update();
}
screen().hideCursor();
- screen().draw(bv_->text, bv_, value);
+ bv_->text->top_y(value);
+ //screen().draw();
if (!lyxrc.cursor_follows_scrollbar)
return;
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 ...
// 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();
}
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;
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();
}
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);
+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.
+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>
}
-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;
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_; }
if (newtop == text->top_y())
return false;
- draw(text, bv, newtop);
text->top_y(newtop);
+ //draw();
return true;
}
// 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;
}
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();
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()) {
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
/// 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();
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);
-}
/// 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_; }
// FIXME: should be called via an LFUN
bv->buffer()->markDirty();
- bv->fitCursor();
bv->update();
return replace_count;
bv->unlockInset(bv->theLockingInset());
found = false;
}
- bv->fitCursor();
bv->update();
return found;
found = false;
}
- bv->fitCursor();
bv->update();
return found;
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();
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()) {
// 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) {
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;
bv->text->setSelection();
bv->update();
- bv->fitCursor();
break;
}
// 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);