}
-#if 0
-void BufferView::smallUpdate(signed char f)
-{
- pimpl_->smallUpdate(f);
-}
-#endif
-
-
void BufferView::setState()
{
pimpl_->setState();
void update();
///
void update(signed char f);
-#if 0
- ///
- void smallUpdate(signed char f);
-#endif
///
void updateScrollbar();
///
}
-#if 0
-void BufferView::Pimpl::smallUpdate(signed char f)
-{
-#if 1
- update(f);
-#else
- screen->SmallUpdate();
- if (screen->TopCursorVisible()
- != screen->first) {
- update(f);
- return;
- }
-
- fitCursor();
- //updateScrollbar();
-
- if (!bv_->text->selection)
- bv_->text->sel_cursor = bv_->text->cursor;
-
- if (f == 1 || f == -1) {
- if (buffer_->isLyxClean()) {
- buffer_->markDirty();
- owner_->getMiniBuffer()->setTimer(4);
- } else {
- buffer_->markDirty();
- }
- }
-#endif
-}
-#endif
-
-
// Callback for cursor timer
void BufferView::Pimpl::cursorToggle()
{
void update();
///
void update(signed char f);
-#if 0
- ///
- void smallUpdate(signed char f);
-#endif
///
void gotoError();
/// Update pixmap of screen
case LFUN_BREAKLINE:
owner->view()->beforeChange();
owner->view()->text->InsertChar(LyXParagraph::META_NEWLINE);
-#if 1
owner->view()->update(1);
-#else
- owner->view()->smallUpdate(1);
-#endif
SetUpdateTimer(0.01);
moveCursorUpdate(false);
break;
owner->view()->text->Delete();
owner->view()->text->sel_cursor =
owner->view()->text->cursor;
-#if 1
owner->view()->update(1);
-#else
- owner->view()->smallUpdate(1);
-#endif
// It is possible to make it a lot faster still
// just comment out the lone below...
owner->view()->showCursor();
owner->view()->text->Delete();
owner->view()->text->sel_cursor =
owner->view()->text->cursor;
-#if 1
owner->view()->update(1);
-#else
- owner->view()->smallUpdate(1);
-#endif
}
} else {
owner->view()->text->Delete();
owner->view()->text->sel_cursor =
owner->view()->text->cursor;
-#if 1
owner->view()->update(1);
-#else
- owner->view()->smallUpdate(1);
-#endif
}
} else {
owner->view()->cut();
owner->view()->text->Backspace();
owner->view()->text->sel_cursor =
owner->view()->text->cursor;
-#if 1
owner->view()->update(1);
-#else
- owner->view()->smallUpdate(1);
-#endif
// It is possible to make it a lot faster still
// just comment out the lone below...
owner->view()->showCursor();
owner->view()->text->Backspace();
owner->view()->text->sel_cursor
= cursor;
-#if 1
owner->view()->update(1);
-#else
- owner->view()->smallUpdate (1);
-#endif
}
} else
owner->view()->cut();
{
owner->view()->beforeChange();
owner->view()->text->BreakParagraph(0);
-#if 1
owner->view()->update(1);
-#else
- owner->view()->smallUpdate(1);
-#endif
SetUpdateTimer(0.01);
owner->view()->text->sel_cursor =
owner->view()->text->cursor;
{
owner->view()->beforeChange();
owner->view()->text->BreakParagraph(1);
-#if 1
owner->view()->update(1);
-#else
- owner->view()->smallUpdate(1);
-#endif
SetUpdateTimer(0.01);
owner->view()->text->sel_cursor =
owner->view()->text->cursor;
}
else {
owner->view()->text->BreakParagraph(0);
-#if 1
owner->view()->update(1);
-#else
- owner->view()->smallUpdate(1);
-#endif
}
SetUpdateTimer(0.01);
owner->view()->text->sel_cursor = cursor;
case LFUN_QUOTE:
owner->view()->beforeChange();
owner->view()->text->InsertChar('\"'); // This " matches the single quote in the code
-#if 1
owner->view()->update(1);
-#else
- owner->view()->smallUpdate(1);
-#endif
SetUpdateTimer();
moveCursorUpdate(false);
break;
case LFUN_CIRCLE:
case LFUN_OGONEK:
{
- char c;
+ char c = 0;
if (keyseq.length == -1 && keyseq.getiso() != 0)
c = keyseq.getiso();
- else
- c = 0;
owner->getIntl()->getTrans()->
deadkey(c, get_accent(action).accent,
keyseq.length = 0;
// copied verbatim from do_accent_char
-#if 1
owner->view()->update(1);
-#else
- owner->view()->smallUpdate(1);
-#endif
+
SetUpdateTimer();
owner->view()->text->sel_cursor =
owner->view()->text->cursor;
owner->view()->text->InsertChar(argument[i]);
// This needs to be in the loop, or else we
// won't break lines correctly. (Asger)
-#if 1
owner->view()->update(1);
-#else
- owner->view()->smallUpdate(1);
-#endif
}
SetUpdateTimer();
owner->view()->text->sel_cursor =
datetmp_len = (int) strftime(datetmp, 32, arg.c_str(), now_tm);
for (int i = 0; i < datetmp_len; i++) {
owner->view()->text->InsertChar(datetmp[i]);
-#if 1
owner->view()->update(1);
-#else
- owner->view()->smallUpdate(1);
-#endif
}
SetUpdateTimer();
owner->view()->text->sel_cursor = owner->view()->text->cursor;
owner->getIntl()->getTrans()->TranslateAndInsert(argument[i], owner->view()->text);
}
-#if 1
owner->view()->update(1);
-#else
- owner->view()->smallUpdate(1);
-#endif
SetUpdateTimer();
owner->view()->text->sel_cursor =
we only update the current row. */
void Update();
-#if 0
- /** Updates part of the screen. Updates till row with cursor,
- or only current row */
- void SmallUpdate();
-#endif
/// first visible pixel-row
unsigned long first;
/// y1 and y2 are coordinates of the screen
void DrawFromTo(int y1, int y2);
-#if 1
/// y is a coordinate of the text
void DrawOneRow(Row * row, long y_text);
-#else
- /// y is a coordinate of the text
- void DrawOneRow(Row * row, long & y_text);
-#endif
///
WorkArea & owner;
}
-#if 1
void LyXScreen::DrawOneRow(Row * row, long y_text)
{
long y = y_text - first;
if (y + row->height > 0 && y - row->height <= long(owner.height())) {
- /* ok there is something visible */
+ // ok there is something visible
text->GetVisibleRow(y, row, y + first);
}
}
-#else
-void LyXScreen::DrawOneRow(Row * row, long & y_text)
-{
- long y = y_text - first;
-
- if (y + row->height > 0 && y - row->height <= long(owner.height())) {
- /* ok there is something visible */
- text->GetVisibleRow(y, row, y + first);
- }
- y_text += row->height;
-}
-#endif
/* draws the screen, starting with textposition y. uses as much already
void LyXScreen::Update()
{
-#if 1
switch(text->status) {
case LyXText::NEED_MORE_REFRESH:
{
// Nothing needs done
break;
}
-#else
- if (text->status == LyXText::NEED_MORE_REFRESH
- || screen_refresh_y > -1 ) {
- long y = 0;
- if (screen_refresh_y > -1
- && screen_refresh_y < text->refresh_y)
- y = screen_refresh_y;
- else
- y = text->refresh_y;
-
- //if (y < first) y = first;
- y = max(y, long(first));
-
- DrawFromTo(y - first, owner.height());
- text->refresh_y = 0;
- text->status = LyXText::UNCHANGED;
- screen_refresh_y = -1;
- expose(0, y - first,
- owner.workWidth(), owner.height() - (y - first));
- } else if (text->status == LyXText::NEED_VERY_LITTLE_REFRESH) {
- /* ok I will update the current cursor row */
- long y = text->refresh_y;
- DrawOneRow(text->refresh_row, y);
- text->status = LyXText::UNCHANGED;
- expose(0, text->refresh_y - first,
- owner.workWidth(), text->refresh_row->height);
- }
-#endif
}
-#if 0
-void LyXScreen::SmallUpdate()
-{
-#if 1
- Update();
-#else
- if (text->status == LyXText::NEED_MORE_REFRESH) {
- /* ok I will update till the current cursor row */
- Row * row = text->refresh_row;
- long y = text->refresh_y;
- long y2 = y;
-
- if (y > long(text->cursor.y)) {
- Update();
- return;
- }
-
- while (row
- && row != text->cursor.row
- && y < long(first + owner.height())) {
- DrawOneRow(row, y);
- row = row->next;
- }
-
- DrawOneRow(row, y);
- screen_refresh_y = y;
- screen_refresh_row = row->next;
- text->status = LyXText::UNCHANGED;
- // Is the right regin exposed?
- expose(0, y2 - first,
- owner.workWidth(), y - y2);
- } else if (text->status == LyXText::NEED_VERY_LITTLE_REFRESH) {
- /* ok I will update the current cursor row */
- long y = text->refresh_y;
- DrawOneRow(text->refresh_row, y);
- text->status = LyXText::UNCHANGED;
- expose(0, text->refresh_y - first,
- owner.workWidth(), text->refresh_row->height);
- }
-#endif
-}
-#endif
-
-
void LyXScreen::ToggleSelection(bool kill_selection)
{
/* only if there is a selection */