LyX Drinkers Union: patch 1

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2141 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2001-06-25 00:06:33 +00:00
parent c789eecdba
commit d1182f17da
197 changed files with 10300 additions and 10901 deletions

View File

@ -1,3 +1,7 @@
2001-06-23 The LyX Project <jug@sad.it>
* templates/dinbrief.lyx: remove obsolete \cursor tag
2001-06-18 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
* tex/cv.cls:

View File

@ -47,6 +47,25 @@
\bind "M-m 8" "math-insert infty"
\bind "M-m v" "accent-vector"
\bind "M-m t t" "math-mutate dump"
\bind "M-m t a" "math-mutate align"
\bind "M-m t i" "math-mutate inline"
\bind "M-m t d" "math-mutate display"
\bind "M-m t e" "math-mutate eqnarray"
\bind "M-m c i" "math-column-insert"
\bind "M-m c d" "math-column-delete"
\bind "M-m w i" "math-row-insert"
\bind "M-m w d" "math-row-delete"
\bind "M-m a v t" "math-valign top"
\bind "M-m a v c" "math-valign center"
\bind "M-m a v b" "math-valign bottom"
\bind "M-m a h l" "math-halign left"
\bind "M-m a h c" "math-halign center"
\bind "M-m a h r" "math-halign right"
# The accent-circumflex is 'h' for 'hat', which is what most math
# folks call it verbally.

View File

@ -37,7 +37,6 @@
\newline
<Deine Stadt>
\layout Stadt
\cursor 17
<Stadt für Datum>
\layout Datum

View File

@ -146,14 +146,14 @@ Menuset
End
Menu "edit_math"
Item "Make eqnarray|e" "break-line e"
Item "Make multline|m" "break-line m"
Item "Make align 1 column|1" "break-line 1"
Item "Make align 2 columns|2" "break-line 2"
Item "Make align 3 columns|3" "break-line 3"
Item "Make alignat 2 columns|2" "break-line B"
Item "Make alignat 3 columns|3" "break-line C"
Separator
# Item "Make eqnarray|e" "break-line e"
# Item "Make multline|m" "break-line m"
# Item "Make align 1 column|1" "break-line 1"
# Item "Make align 2 columns|2" "break-line 2"
# Item "Make align 3 columns|3" "break-line 3"
# Item "Make alignat 2 columns|2" "break-line B"
# Item "Make alignat 3 columns|3" "break-line C"
# Separator
Item "Toggle numbering|n" "math-number"
Item "Toggle numbering of line|u" "math-nonumber"
Item "Toggle limits|l" "math-limits"
@ -163,8 +163,12 @@ Menuset
# INSERT MENU
#
Menu "insert"
Item "Math Formula|h" "math-mode"
Item "Display Formula|D" "math-display"
Item "Math Formula|h" "math-mode simple"
Item "Display Formula|D" "math-mode display"
Item "Change to Inline Math Formula|q" "math-mutate simple"
Item "Change to Displayed Math Formula|q" "math-mutate equation"
Item "Change to Eqnarray Environment|q" "math-mutate eqnarray"
Item "Change to Align Environment|g" "math-mutate align"
Separator
Submenu "Special Character|S" "insert_special"
Item "Citation Reference...|C" "citation-insert"

View File

@ -244,8 +244,8 @@ Menuset
Item "Sum|u" "math-insert sum"
Item "Integral|I" "math-insert int"
Separator
Item "Math mode|M" "math-mode"
Item "Display|D" "math-display"
Item "Math mode|M" "math-mode simple"
Item "Display|D" "math-mode display"
Separator
Item "Math Panel...|P" "math-panel"
End

View File

@ -10,8 +10,8 @@ src/CutAndPaste.C
src/debug.C
src/exporter.C
src/ext_l10n.h
src/figureForm.C
src/figure_form.C
src/figureForm.C
src/FontLoader.C
src/frontends/controllers/ButtonController.h
src/frontends/controllers/character.C
@ -89,67 +89,67 @@ src/frontends/qt2/paragraphdlgimpl.C
src/frontends/qt2/tabularcreatedlgimpl.C
src/frontends/xforms/combox.C
src/frontends/xforms/FileDialog.C
src/frontends/xforms/FormBibitem.C
src/frontends/xforms/form_bibitem.C
src/frontends/xforms/FormBibtex.C
src/frontends/xforms/FormBibitem.C
src/frontends/xforms/form_bibtex.C
src/frontends/xforms/FormBibtex.C
src/frontends/xforms/form_browser.C
src/frontends/xforms/FormCharacter.C
src/frontends/xforms/form_character.C
src/frontends/xforms/FormCitation.C
src/frontends/xforms/FormCharacter.C
src/frontends/xforms/form_citation.C
src/frontends/xforms/FormCopyright.C
src/frontends/xforms/FormCitation.C
src/frontends/xforms/form_copyright.C
src/frontends/xforms/FormCredits.C
src/frontends/xforms/FormCopyright.C
src/frontends/xforms/form_credits.C
src/frontends/xforms/FormDocument.C
src/frontends/xforms/FormCredits.C
src/frontends/xforms/form_document.C
src/frontends/xforms/FormError.C
src/frontends/xforms/FormDocument.C
src/frontends/xforms/form_error.C
src/frontends/xforms/FormExternal.C
src/frontends/xforms/FormError.C
src/frontends/xforms/form_external.C
src/frontends/xforms/FormFiledialog.C
src/frontends/xforms/FormExternal.C
src/frontends/xforms/form_filedialog.C
src/frontends/xforms/FormGraphics.C
src/frontends/xforms/FormFiledialog.C
src/frontends/xforms/form_graphics.C
src/frontends/xforms/FormInclude.C
src/frontends/xforms/FormGraphics.C
src/frontends/xforms/form_include.C
src/frontends/xforms/FormIndex.C
src/frontends/xforms/FormInclude.C
src/frontends/xforms/form_index.C
src/frontends/xforms/FormIndex.C
src/frontends/xforms/FormLog.C
src/frontends/xforms/FormMathsBitmap.C
src/frontends/xforms/FormMathsDeco.C
src/frontends/xforms/form_maths_deco.C
src/frontends/xforms/FormMathsDelim.C
src/frontends/xforms/FormMathsDeco.C
src/frontends/xforms/form_maths_delim.C
src/frontends/xforms/FormMathsMatrix.C
src/frontends/xforms/FormMathsDelim.C
src/frontends/xforms/form_maths_matrix.C
src/frontends/xforms/FormMathsPanel.C
src/frontends/xforms/FormMathsMatrix.C
src/frontends/xforms/form_maths_panel.C
src/frontends/xforms/FormMathsSpace.C
src/frontends/xforms/FormMathsPanel.C
src/frontends/xforms/form_maths_space.C
src/frontends/xforms/FormMinipage.C
src/frontends/xforms/FormMathsSpace.C
src/frontends/xforms/form_minipage.C
src/frontends/xforms/FormParagraph.C
src/frontends/xforms/FormMinipage.C
src/frontends/xforms/form_paragraph.C
src/frontends/xforms/FormPreamble.C
src/frontends/xforms/FormParagraph.C
src/frontends/xforms/form_preamble.C
src/frontends/xforms/FormPreferences.C
src/frontends/xforms/FormPreamble.C
src/frontends/xforms/form_preferences.C
src/frontends/xforms/FormPrint.C
src/frontends/xforms/FormPreferences.C
src/frontends/xforms/form_print.C
src/frontends/xforms/FormRef.C
src/frontends/xforms/FormPrint.C
src/frontends/xforms/form_ref.C
src/frontends/xforms/FormSearch.C
src/frontends/xforms/FormRef.C
src/frontends/xforms/form_search.C
src/frontends/xforms/FormTabular.C
src/frontends/xforms/FormSearch.C
src/frontends/xforms/form_tabular.C
src/frontends/xforms/FormTabularCreate.C
src/frontends/xforms/FormTabular.C
src/frontends/xforms/form_tabular_create.C
src/frontends/xforms/FormToc.C
src/frontends/xforms/FormTabularCreate.C
src/frontends/xforms/form_toc.C
src/frontends/xforms/FormUrl.C
src/frontends/xforms/FormToc.C
src/frontends/xforms/form_url.C
src/frontends/xforms/FormUrl.C
src/frontends/xforms/FormVCLog.C
src/frontends/xforms/input_validators.C
src/frontends/xforms/Menubar_pimpl.C

View File

@ -19,6 +19,7 @@
#include "LString.h"
#include "undo.h"
#include "commandtags.h"
#include "insets/inset.h"
#include <boost/utility.hpp>
class LyXView;
@ -28,6 +29,8 @@ class Buffer;
class LyXScreen;
class WorkArea;
class Language;
class Painter;
class UpdatableInset;
///
class BufferView : boost::noncopyable {

View File

@ -8,11 +8,11 @@
*
* ====================================================== */
#include <config.h>
#include <fstream>
#include <algorithm>
#include <config.h>
#include "BufferView.h"
#include "buffer.h"
#include "lyxcursor.h"
@ -98,7 +98,7 @@ bool BufferView::insertLyXFile(string const & filen)
bool BufferView::removeAutoInsets()
{
LyXParagraph * par = buffer()->paragraph;
Paragraph * par = buffer()->paragraph;
LyXCursor tmpcursor = text->cursor;
LyXCursor cursor;
@ -107,12 +107,12 @@ bool BufferView::removeAutoInsets()
while (par) {
// this has to be done before the delete
text->SetCursor(this, cursor, par, 0);
if (par->AutoDeleteInsets()){
text->setCursor(this, cursor, par, 0);
if (par->autoDeleteInsets()){
a = true;
text->RedoParagraphs(this, cursor,
text->redoParagraphs(this, cursor,
cursor.par()->next());
text->FullRebreak(this);
text->fullRebreak(this);
}
par = par->next();
}
@ -121,7 +121,7 @@ bool BufferView::removeAutoInsets()
if (tmpcursor.pos() > tmpcursor.par()->size())
tmpcursor.pos(tmpcursor.par()->size());
text->SetCursorIntern(this, tmpcursor.par(), tmpcursor.pos());
text->setCursorIntern(this, tmpcursor.par(), tmpcursor.pos());
return a;
}
@ -148,25 +148,25 @@ void BufferView::insertErrors(TeXErrors & terr)
buffer()->texrow.increasePos(tmpid, tmppos);
}
LyXParagraph * texrowpar = 0;
Paragraph * texrowpar = 0;
if (tmpid == -1) {
texrowpar = text->FirstParagraph();
texrowpar = text->firstParagraph();
tmppos = 0;
} else {
texrowpar = text->GetParFromID(tmpid);
texrowpar = text->getParFromID(tmpid);
}
if (texrowpar == 0)
continue;
InsetError * new_inset = new InsetError(msgtxt);
text->SetCursorIntern(this, texrowpar, tmppos);
text->InsertInset(this, new_inset);
text->FullRebreak(this);
text->setCursorIntern(this, texrowpar, tmppos);
text->insertInset(this, new_inset);
text->fullRebreak(this);
}
// Restore the cursor position
text->SetCursorIntern(this, cursor.par(), cursor.pos());
text->setCursorIntern(this, cursor.par(), cursor.pos());
}
@ -177,15 +177,15 @@ void BufferView::setCursorFromRow(int row)
buffer()->texrow.getIdFromRow(row, tmpid, tmppos);
LyXParagraph * texrowpar;
Paragraph * texrowpar;
if (tmpid == -1) {
texrowpar = text->FirstParagraph();
texrowpar = text->firstParagraph();
tmppos = 0;
} else {
texrowpar = text->GetParFromID(tmpid);
texrowpar = text->getParFromID(tmpid);
}
text->SetCursor(this, texrowpar, tmppos);
text->setCursor(this, texrowpar, tmppos);
}
@ -209,7 +209,7 @@ bool BufferView::gotoLabel(string const & label)
if (find(labels.begin(),labels.end(),label)
!= labels.end()) {
beforeChange(text);
text->SetCursor(this, it.getPar(), it.getPos());
text->setCursor(this, it.getPar(), it.getPos());
text->selection.cursor = text->cursor;
update(text, BufferView::SELECT|BufferView::FITCUR);
return true;
@ -226,7 +226,7 @@ void BufferView::menuUndo()
hideCursor();
beforeChange(text);
update(text, BufferView::SELECT|BufferView::FITCUR);
if (!text->TextUndo(this))
if (!text->textUndo(this))
owner()->message(_("No forther undo information"));
else
update(text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
@ -247,7 +247,7 @@ void BufferView::menuRedo()
hideCursor();
beforeChange(text);
update(text, BufferView::SELECT|BufferView::FITCUR);
if (!text->TextRedo(this))
if (!text->textRedo(this))
owner()->message(_("No further redo information"));
else
update(text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
@ -262,7 +262,7 @@ void BufferView::copyEnvironment()
text->copyEnvironmentType();
// clear the selection, even if mark_set
toggleSelection();
text->ClearSelection(this);
text->clearSelection(this);
update(text, BufferView::SELECT|BufferView::FITCUR);
owner()->message(_("Paragraph environment type copied"));
}
@ -282,10 +282,10 @@ void BufferView::pasteEnvironment()
void BufferView::copy()
{
if (available()) {
text->CopySelection(this);
text->copySelection(this);
// clear the selection, even if mark_set
toggleSelection();
text->ClearSelection(this);
text->clearSelection(this);
update(text, BufferView::SELECT|BufferView::FITCUR);
owner()->message(_("Copy"));
}
@ -297,7 +297,7 @@ void BufferView::cut()
if (available()) {
hideCursor();
update(text, BufferView::SELECT|BufferView::FITCUR);
text->CutSelection(this);
text->cutSelection(this);
update(text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
owner()->message(_("Cut"));
}
@ -313,16 +313,16 @@ void BufferView::paste()
hideCursor();
// clear the selection
toggleSelection();
text->ClearSelection(this);
text->clearSelection(this);
update(text, BufferView::SELECT|BufferView::FITCUR);
// paste
text->PasteSelection(this);
text->pasteSelection(this);
update(text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
// clear the selection
toggleSelection();
text->ClearSelection(this);
text->clearSelection(this);
update(text, BufferView::SELECT|BufferView::FITCUR);
}
@ -334,7 +334,7 @@ void BufferView::insertCorrectQuote()
char c;
if (text->cursor.pos())
c = text->cursor.par()->GetChar(text->cursor.pos() - 1);
c = text->cursor.par()->getChar(text->cursor.pos() - 1);
else
c = ' ';
@ -350,7 +350,7 @@ string const BufferView::nextWord(float & value)
return string();
}
return text->SelectNextWord(this, value);
return text->selectNextWord(this, value);
}
@ -360,7 +360,7 @@ void BufferView::selectLastWord()
hideCursor();
beforeChange(text);
text->SelectSelectedWord(this);
text->selectSelectedWord(this);
toggleSelection(false);
update(text, BufferView::SELECT|BufferView::FITCUR);
}
@ -372,8 +372,8 @@ void BufferView::endOfSpellCheck()
hideCursor();
beforeChange(text);
text->SelectSelectedWord(this);
text->ClearSelection(this);
text->selectSelectedWord(this);
text->clearSelection(this);
update(text, BufferView::SELECT|BufferView::FITCUR);
}
@ -391,13 +391,13 @@ void BufferView::replaceWord(string const & replacestring)
/* clear the selection (if there is any) */
toggleSelection(false);
text->ReplaceSelectionWithString(this, replacestring);
text->replaceSelectionWithString(this, replacestring);
text->SetSelectionOverString(this, replacestring);
text->setSelectionOverString(this, replacestring);
// Go back so that replacement string is also spellchecked
for (string::size_type i = 0; i < replacestring.length() + 1; ++i) {
text->CursorLeft(this);
text->cursorLeft(this);
}
update(text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
}
@ -421,11 +421,11 @@ void BufferView::showLockedInsetCursor(int x, int y, int asc, int desc)
if (theLockingInset() && available()) {
LyXCursor cursor = text->cursor;
if ((cursor.pos() - 1 >= 0) &&
(cursor.par()->GetChar(cursor.pos() - 1) ==
LyXParagraph::META_INSET) &&
(cursor.par()->GetInset(cursor.pos() - 1) ==
(cursor.par()->getChar(cursor.pos() - 1) ==
Paragraph::META_INSET) &&
(cursor.par()->getInset(cursor.pos() - 1) ==
theLockingInset()->GetLockingInset()))
text->SetCursor(this, cursor,
text->setCursor(this, cursor,
cursor.par(), cursor.pos() - 1);
LyXScreen::Cursor_Shape shape = LyXScreen::BAR_SHAPE;
LyXText * txt = getLyXText();
@ -468,11 +468,11 @@ int BufferView::unlockInset(UpdatableInset * inset)
if (inset && theLockingInset() == inset) {
inset->InsetUnlock(this);
theLockingInset(0);
text->FinishUndo();
text->finishUndo();
return 0;
} else if (inset && theLockingInset() &&
theLockingInset()->UnlockInsetInInset(this, inset)) {
text->FinishUndo();
text->finishUndo();
return 0;
}
return bufferlist.unlockInset(inset);
@ -485,7 +485,7 @@ void BufferView::lockedInsetStoreUndo(Undo::undo_kind kind)
return; // shouldn't happen
if (kind == Undo::EDIT) // in this case insets would not be stored!
kind = Undo::FINISH;
text->SetUndo(buffer(), kind,
text->setUndo(buffer(), kind,
text->cursor.par()->previous(),
text->cursor.par()->next());
}
@ -501,7 +501,7 @@ bool BufferView::ChangeInsets(Inset::Code code,
string const & from, string const & to)
{
bool flag = false;
LyXParagraph * par = buffer()->paragraph;
Paragraph * par = buffer()->paragraph;
LyXCursor cursor = text->cursor;
LyXCursor tmpcursor = cursor;
cursor.par(tmpcursor.par());
@ -509,7 +509,7 @@ bool BufferView::ChangeInsets(Inset::Code code,
while (par) {
bool flag2 = false;
for (LyXParagraph::inset_iterator it = par->inset_iterator_begin();
for (Paragraph::inset_iterator it = par->inset_iterator_begin();
it != par->inset_iterator_end(); ++it) {
if ((*it)->LyxCode() == code) {
InsetCommand * inset = static_cast<InsetCommand *>(*it);
@ -523,14 +523,14 @@ bool BufferView::ChangeInsets(Inset::Code code,
flag = true;
// this is possible now, since SetCursor takes
// care about footnotes
text->SetCursorIntern(this, par, 0);
text->RedoParagraphs(this, text->cursor,
text->setCursorIntern(this, par, 0);
text->redoParagraphs(this, text->cursor,
text->cursor.par()->next());
text->FullRebreak(this);
text->fullRebreak(this);
}
par = par->next();
}
text->SetCursorIntern(this, cursor.par(), cursor.pos());
text->setCursorIntern(this, cursor.par(), cursor.pos());
return flag;
}
@ -602,6 +602,6 @@ LyXText * BufferView::getParentText(Inset * inset) const
Language const * BufferView::getParentLanguage(Inset * inset) const
{
LyXText * text = getParentText(inset);
return text->cursor.par()->GetFontSettings(buffer()->params,
return text->cursor.par()->getFontSettings(buffer()->params,
text->cursor.pos()).language();
}

File diff suppressed because it is too large Load Diff

View File

@ -10,6 +10,7 @@
#include "commandtags.h"
#include "frontends/Timeout.h"
#include "WorkArea.h"
#include "paragraph.h"
#ifdef __GNUG__
#pragma interface
@ -178,11 +179,11 @@ private:
/// Cursor paragraph Id
int par_id;
/// Cursor position
LyXParagraph::size_type par_pos;
Paragraph::size_type par_pos;
///
Position() : par_id(0), par_pos(0) {}
///
Position(string const & f, int id, LyXParagraph::size_type pos)
Position(string const & f, int id, Paragraph::size_type pos)
: filename(f), par_id(id), par_pos(pos) {}
};
///

View File

@ -1,3 +1,85 @@
2001-06-24 The LyX Project <jug@sad.it>
* lyxlex_pimpl.C (compare_tags): use compare_ascii_no_case instead
of compare_no_case
2001-06-24 Lars Gullik Bjønnes <larsbj@birdstep.com>
* lyxtext.h: rename most methods to begin with a small char.
Lots of changes because of this.
* paragraph.C (Paragraph): do not call fitToSize
(erase): call Pimpl::erase
(insertChar): call Pimpl::insertChar
(insertInset): call Pipl::insertInset
(breakParagraph): do not call fitToSize
(breakParagraphConservative): do not call fitToSize
(fitToSize): remove method
* buffer.C (parseSingleLyXformat2Token): do not call fitToSize
2001-06-24 The LyX Project <Asger>
* Fix Qt compilation^2
2001-06-24 The LyX Project <jug@sad.it>
* paragraph.[Ch] (outerHook): new method. mostly equivalent to
depthHook(getDepth()-1).
* paragraph.h:
* ParagraphParameters.h:
* ParameterStruct.h: change type of depth to unsigned int ==
depth_type. Many adaptations to other files before of that.
2001-06-24 The LyX Project <Asger>
* Fix Qt compilation.
2001-06-24 Lars Gullik Bjønnes <larsbj@birdstep.com>
* paragraph.h: renamed several methods to begin with small letter.
several changes to many parts of the code because of this.
2001-06-23 The LyX Project <jug@sad.it>
* text2.C (InsertStringAsLines): renamed from InsertStringA;
rewritten to discard all double spaces when KeepEmpty is off
(InsertStringAsParagraphs): renamed from InsertStringB; rewritten
to only handle newlines but not fiddle with spaces and friends.
* lyxfunc.C (MenuNew): when doing 'new from template', use
template_path as default directory
2001-06-23 The LyX Project <Asger>
* Clean-up of header file includes all over
* paragraph.h: Move some of the stuff into paragraph_pimpl.h
2001-06-23 Lars Gullik Bjønnes <larsbj@birdstep.com>
* paragraph.h: renamed from lyxparagraph.h
2001-06-23 Asger <lyx@violet.home.sad.it>
* Buffer.h: Removed Buffer::resize
* BufferList.h: Removed BufferList::resize
* LyXView.h: Added LyXView::resize. This way, we will only reflow
the document lazily when we change the width, or the font settings.
2001-06-22 John Levon <moz@compsoc.man.ac.uk>
* lyxfunc.C: silently ignore empty dispatches from the minibuffer
2001-06-22 John Levon <moz@compsoc.man.ac.uk>
* buffer.h: remove out of date comment
2001-06-22 John Levon <moz@compsoc.man.ac.uk>
* lyxscreen.h:
* screen.C: fix "theoretical" GC leak
2001-06-20 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
* LaTeX.C (scanAuxFile):
@ -42,7 +124,7 @@
2001-06-14 Angus Leeming <a.leeming@ic.ac.uk>
* BufferView.C:
* Bullet.C
* Bullet.C:
* ColorHandler.C:
* FontInfo.C:
* FontLoader.C:

View File

@ -25,7 +25,10 @@
class LyXFont;
class WorkArea;
///
/**
* This is a factory class that can produce GCs with a specific
* color. It will cache GCs for performance.
*/
class LyXColorHandler {
public:
///

View File

@ -12,7 +12,7 @@
#include "CutAndPaste.h"
#include "BufferView.h"
#include "buffer.h"
#include "lyxparagraph.h"
#include "paragraph.h"
#include "insets/inseterror.h"
#include "lyx_gui_misc.h"
#include "lyxcursor.h"
@ -30,7 +30,7 @@ extern BufferView * current_view;
// of selections cut/copied. So IMHO later we should have a
// list/vector/deque that we could store
// struct selection_item {
// LyXParagraph * buf;
// Paragraph * buf;
// LyXTextClassList::size_type textclass;
// };
// in and some method of choosing beween them (based on the first few chars
@ -47,7 +47,7 @@ extern BufferView * current_view;
namespace {
LyXParagraph * buf = 0;
Paragraph * buf = 0;
LyXTextClassList::size_type textclass = 0;
// for now here this should be in another Cut&Paste Class!
@ -56,23 +56,23 @@ LyXTextClassList::size_type textclass = 0;
// Perhaps it even should take a parameter? (Lgb)
void DeleteBuffer()
{
if (!buf)
if (!buf)
return;
LyXParagraph * tmppar;
Paragraph * tmppar;
while (buf) {
while (buf) {
tmppar = buf;
buf = buf->next();
delete tmppar;
}
buf = 0;
}
buf = 0;
}
} // namespace anon
bool CutAndPaste::cutSelection(LyXParagraph * startpar, LyXParagraph ** endpar,
bool CutAndPaste::cutSelection(Paragraph * startpar, Paragraph ** endpar,
int start, int & end, char tc, bool doclear)
{
if (!startpar || (start > startpar->size()))
@ -85,26 +85,26 @@ bool CutAndPaste::cutSelection(LyXParagraph * startpar, LyXParagraph ** endpar,
if (!(*endpar) ||
startpar == (*endpar)) {
// only within one paragraph
buf = new LyXParagraph;
LyXParagraph::size_type i = start;
buf = new Paragraph;
Paragraph::size_type i = start;
if (end > startpar->size())
end = startpar->size();
for (; i < end; ++i) {
startpar->CopyIntoMinibuffer(*current_view->buffer(),
startpar->copyIntoMinibuffer(*current_view->buffer(),
start);
startpar->Erase(start);
startpar->erase(start);
buf->InsertFromMinibuffer(buf->size());
buf->insertFromMinibuffer(buf->size());
}
end = start - 1;
} else {
// more than one paragraph
(*endpar)->BreakParagraphConservative(current_view->buffer()->params,
(*endpar)->breakParagraphConservative(current_view->buffer()->params,
end);
*endpar = (*endpar)->next();
end = 0;
startpar->BreakParagraphConservative(current_view->buffer()->params,
startpar->breakParagraphConservative(current_view->buffer()->params,
start);
// store the selection
@ -119,14 +119,14 @@ bool CutAndPaste::cutSelection(LyXParagraph * startpar, LyXParagraph ** endpar,
(*endpar)->previous(startpar);
// the cut selection should begin with standard layout
buf->Clear();
buf->clear();
// paste the paragraphs again, if possible
if (doclear)
startpar->next()->StripLeadingSpaces(textclass);
if (startpar->HasSameLayout(startpar->next()) ||
startpar->next()->stripLeadingSpaces(textclass);
if (startpar->hasSameLayout(startpar->next()) ||
!startpar->next()->size()) {
startpar->PasteParagraph(current_view->buffer()->params);
startpar->pasteParagraph(current_view->buffer()->params);
(*endpar) = startpar; // this because endpar gets deleted here!
}
}
@ -134,7 +134,7 @@ bool CutAndPaste::cutSelection(LyXParagraph * startpar, LyXParagraph ** endpar,
}
bool CutAndPaste::copySelection(LyXParagraph * startpar, LyXParagraph * endpar,
bool CutAndPaste::copySelection(Paragraph * startpar, Paragraph * endpar,
int start, int end, char tc)
{
if (!startpar || (start > startpar->size()))
@ -147,46 +147,46 @@ bool CutAndPaste::copySelection(LyXParagraph * startpar, LyXParagraph * endpar,
if (!endpar ||
startpar == endpar) {
// only within one paragraph
buf = new LyXParagraph;
LyXParagraph::size_type i = start;
buf = new Paragraph;
Paragraph::size_type i = start;
if (end > startpar->size())
end = startpar->size();
for (; i < end; ++i) {
startpar->CopyIntoMinibuffer(*current_view->buffer(), i);
buf->InsertFromMinibuffer(buf->size());
startpar->copyIntoMinibuffer(*current_view->buffer(), i);
buf->insertFromMinibuffer(buf->size());
}
} else {
// copy more than one paragraph
// clone the paragraphs within the selection
LyXParagraph * tmppar = startpar;
buf = new LyXParagraph(*tmppar);
LyXParagraph * tmppar2 = buf;
Paragraph * tmppar = startpar;
buf = new Paragraph(*tmppar);
Paragraph * tmppar2 = buf;
while (tmppar != endpar
&& tmppar->next()) {
tmppar = tmppar->next();
tmppar2->next(new LyXParagraph(*tmppar));
tmppar2->next(new Paragraph(*tmppar));
tmppar2->next()->previous(tmppar2);
tmppar2 = tmppar2->next();
}
tmppar2->next(0);
// the buf paragraph is too big
LyXParagraph::size_type tmpi2 = start;
Paragraph::size_type tmpi2 = start;
for (; tmpi2; --tmpi2)
buf->Erase(0);
buf->erase(0);
// now tmppar 2 is too big, delete all after end
tmpi2 = end;
while (tmppar2->size() > tmpi2) {
tmppar2->Erase(tmppar2->size() - 1);
tmppar2->erase(tmppar2->size() - 1);
}
}
return true;
}
bool CutAndPaste::pasteSelection(LyXParagraph ** par, LyXParagraph ** endpar,
bool CutAndPaste::pasteSelection(Paragraph ** par, Paragraph ** endpar,
int & pos, char tc)
{
if (!checkPastePossible(*par))
@ -195,15 +195,15 @@ bool CutAndPaste::pasteSelection(LyXParagraph ** par, LyXParagraph ** endpar,
if (pos > (*par)->size())
pos = (*par)->size();
// LyXParagraph * tmpbuf;
LyXParagraph * tmppar = *par;
// Paragraph * tmpbuf;
Paragraph * tmppar = *par;
int tmppos = pos;
// There are two cases: cutbuffer only one paragraph or many
if (!buf->next()) {
// only within a paragraph
LyXParagraph * tmpbuf = new LyXParagraph(*buf);
Paragraph * tmpbuf = new Paragraph(*buf);
// Some provisions should be done here for checking
// if we are inserting at the beginning of a
// paragraph. If there are a space at the beginning
@ -214,12 +214,12 @@ bool CutAndPaste::pasteSelection(LyXParagraph ** par, LyXParagraph ** endpar,
// This is an attempt to fix the
// "never insert a space at the
// beginning of a paragraph" problem.
if (!tmppos && buf->IsLineSeparator(0)) {
buf->Erase(0);
if (!tmppos && buf->isLineSeparator(0)) {
buf->erase(0);
} else {
buf->CutIntoMinibuffer(current_view->buffer()->params, 0);
buf->Erase(0);
if (tmppar->InsertFromMinibuffer(tmppos))
buf->cutIntoMinibuffer(current_view->buffer()->params, 0);
buf->erase(0);
if (tmppar->insertFromMinibuffer(tmppos))
++tmppos;
}
}
@ -231,13 +231,13 @@ bool CutAndPaste::pasteSelection(LyXParagraph ** par, LyXParagraph ** endpar,
// many paragraphs
// make a copy of the simple cut_buffer
LyXParagraph * tmpbuf = buf;
LyXParagraph * simple_cut_clone = new LyXParagraph(*tmpbuf);
LyXParagraph * tmpbuf2 = simple_cut_clone;
Paragraph * tmpbuf = buf;
Paragraph * simple_cut_clone = new Paragraph(*tmpbuf);
Paragraph * tmpbuf2 = simple_cut_clone;
while (tmpbuf->next()) {
tmpbuf = tmpbuf->next();
tmpbuf2->next(new LyXParagraph(*tmpbuf));
tmpbuf2->next(new Paragraph(*tmpbuf));
tmpbuf2->next()->previous(tmpbuf2);
tmpbuf2 = tmpbuf2->next();
}
@ -247,10 +247,10 @@ bool CutAndPaste::pasteSelection(LyXParagraph ** par, LyXParagraph ** endpar,
// make the buf exactly the same layout than
// the cursor paragraph
buf->MakeSameLayout(*par);
buf->makeSameLayout(*par);
// find the end of the buffer
LyXParagraph * lastbuffer = buf;
Paragraph * lastbuffer = buf;
while (lastbuffer->next())
lastbuffer = lastbuffer->next();
@ -259,7 +259,7 @@ bool CutAndPaste::pasteSelection(LyXParagraph ** par, LyXParagraph ** endpar,
// open the paragraph for inserting the buf
// if necessary
if (((*par)->size() > pos) || !(*par)->next()) {
(*par)->BreakParagraphConservative(current_view->buffer()->params,
(*par)->breakParagraphConservative(current_view->buffer()->params,
pos);
paste_the_end = true;
}
@ -276,22 +276,22 @@ bool CutAndPaste::pasteSelection(LyXParagraph ** par, LyXParagraph ** endpar,
if ((*par)->next() == lastbuffer)
lastbuffer = *par;
(*par)->PasteParagraph(current_view->buffer()->params);
(*par)->pasteParagraph(current_view->buffer()->params);
// store the new cursor position
*par = lastbuffer;
pos = lastbuffer->size();
// maybe some pasting
if (lastbuffer->next() && paste_the_end) {
if (lastbuffer->next()->HasSameLayout(lastbuffer)) {
lastbuffer->PasteParagraph(current_view->buffer()->params);
if (lastbuffer->next()->hasSameLayout(lastbuffer)) {
lastbuffer->pasteParagraph(current_view->buffer()->params);
} else if (!lastbuffer->next()->size()) {
lastbuffer->next()->MakeSameLayout(lastbuffer);
lastbuffer->PasteParagraph(current_view->buffer()->params);
lastbuffer->next()->makeSameLayout(lastbuffer);
lastbuffer->pasteParagraph(current_view->buffer()->params);
} else if (!lastbuffer->size()) {
lastbuffer->MakeSameLayout(lastbuffer->next());
lastbuffer->PasteParagraph(current_view->buffer()->params);
lastbuffer->makeSameLayout(lastbuffer->next());
lastbuffer->pasteParagraph(current_view->buffer()->params);
} else
lastbuffer->next()->StripLeadingSpaces(tc);
lastbuffer->next()->stripLeadingSpaces(tc);
}
// restore the simple cut buffer
buf = simple_cut_clone;
@ -305,9 +305,9 @@ int CutAndPaste::nrOfParagraphs()
{
if (!buf)
return 0;
int n = 1;
LyXParagraph * tmppar = buf;
Paragraph * tmppar = buf;
while(tmppar->next()) {
++n;
tmppar = tmppar->next();
@ -318,13 +318,13 @@ int CutAndPaste::nrOfParagraphs()
int CutAndPaste::SwitchLayoutsBetweenClasses(LyXTextClassList::size_type c1,
LyXTextClassList::size_type c2,
LyXParagraph * par)
Paragraph * par)
{
int ret = 0;
if (!par || c1 == c2)
int ret = 0;
if (!par || c1 == c2)
return ret;
while (par) {
while (par) {
string const name = textclasslist.NameOfLayout(c1,
par->layout);
int lay = 0;
@ -347,17 +347,17 @@ int CutAndPaste::SwitchLayoutsBetweenClasses(LyXTextClassList::size_type c1,
+ textclasslist.NameOfClass(c1) + _(" to ")
+ textclasslist.NameOfClass(c2);
InsetError * new_inset = new InsetError(s);
par->InsertInset(0, new_inset);
par->insertInset(0, new_inset);
}
par = par->next();
}
return ret;
}
return ret;
}
bool CutAndPaste::checkPastePossible(LyXParagraph *)
bool CutAndPaste::checkPastePossible(Paragraph *)
{
if (!buf) return false;
return true;
if (!buf) return false;
return true;
}

View File

@ -17,22 +17,22 @@
#include "layout.h"
class LyXParagraph;
class Paragraph;
///
class CutAndPaste {
public:
///
static
bool cutSelection(LyXParagraph * startpar, LyXParagraph ** endpar,
bool cutSelection(Paragraph * startpar, Paragraph ** endpar,
int start, int & end, char tc, bool doclear = false);
///
static
bool copySelection(LyXParagraph * startpar, LyXParagraph * endpar,
bool copySelection(Paragraph * startpar, Paragraph * endpar,
int start, int end, char tc);
///
static
bool pasteSelection(LyXParagraph ** par, LyXParagraph ** endpar,
bool pasteSelection(Paragraph ** par, Paragraph ** endpar,
int & pos, char tc);
///
static
@ -44,10 +44,10 @@ public:
static
int SwitchLayoutsBetweenClasses(LyXTextClassList::size_type class1,
LyXTextClassList::size_type class2,
LyXParagraph * par);
Paragraph * par);
///
static
bool checkPastePossible(LyXParagraph *);
bool checkPastePossible(Paragraph *);
};
#endif

View File

@ -71,7 +71,7 @@ LaTeXFeatures::LaTeXFeatures(BufferParams const & p, LyXTextClass::size_type n)
boldsymbol = false;
// special features
LyXParagraphIndent = false;
ParagraphIndent = false;
NeedLyXFootnoteCode = false;
NeedLyXMinipageIndent = false;
}
@ -321,7 +321,7 @@ string const LaTeXFeatures::getMacros() const
// other
if (NeedLyXMinipageIndent)
macros << minipageindent_def;
if (LyXParagraphIndent)
if (ParagraphIndent)
macros << paragraphindent_def;
if (NeedLyXFootnoteCode)
macros << floatingfootnote_def;

View File

@ -126,7 +126,7 @@ struct LaTeXFeatures {
std::vector<bool> layout;
///
bool LyXParagraphIndent;
bool ParagraphIndent;
///
bool NeedLyXFootnoteCode;
///

View File

@ -288,12 +288,19 @@ void LyXAction::init()
N_("Insert math symbol"), Noop },
{ LFUN_MATH_LIMITS, "math-limits", "", Noop },
{ LFUN_MATH_MACRO, "math-macro", "", Noop },
{ LFUN_MATH_MUTATE, "math-mutate", "", Noop },
{ LFUN_MATH_MACROARG, "math-macro-arg", "", Noop },
{ LFUN_INSERT_MATRIX, "math-matrix", "", Noop },
{ LFUN_MATH_MODE, "math-mode", N_("Math mode"), Noop },
{ LFUN_MATH_NONUMBER, "math-nonumber", "", Noop },
{ LFUN_MATH_NUMBER, "math-number", "", Noop },
{ LFUN_MATH_EXTERN, "math-extern", "", Noop },
{ LFUN_MATH_VALIGN, "math-valign", "", Noop },
{ LFUN_MATH_HALIGN, "math-halign", "", Noop },
{ LFUN_MATH_ROW_INSERT, "math-row-insert", "", Noop },
{ LFUN_MATH_ROW_DELETE, "math-row-delete", "", Noop },
{ LFUN_MATH_COLUMN_INSERT, "math-column-insert", "", Noop },
{ LFUN_MATH_COLUMN_DELETE, "math-column-delete", "", Noop },
{ LFUN_MATH_PANEL, "math-panel", "", Noop },
{ LFUN_MATH_SIZE, "math-size", "", Noop },
{ LFUN_MENU_OPEN_BY_NAME, "menu-open", "", NoBuffer },

View File

@ -13,6 +13,7 @@
#include "gettext.h"
#include "bufferview_funcs.h"
#include "exporter.h"
#include "BufferView.h"
extern FD_form_sendto * fd_form_sendto;
extern BufferView * current_view;

View File

@ -1,3 +1,4 @@
/* This file is part of
* ======================================================
*
@ -39,6 +40,7 @@
#include "bufferview_funcs.h" // CurrentState()
#include "gettext.h"
#include "lyxfunc.h"
#include "BufferView.h"
using std::endl;
@ -102,6 +104,12 @@ void LyXView::redraw() {
}
void LyXView::resize()
{
view()->resize();
}
/// returns the buffer currently shown in the main form.
Buffer * LyXView::buffer() const
{
@ -368,7 +376,7 @@ void LyXView::updateLayoutChoice()
LyXTextClass::size_type layout =
bufferview->text->cursor.par()->GetLayout();
bufferview->text->cursor.par()->getLayout();
if (layout != current_layout){
toolbar->setLayout(layout);

View File

@ -59,6 +59,9 @@ public:
/// Redraw the main form.
void redraw();
/// Resize all BufferViews in this LyXView (because the width changed)
void resize();
/// returns the buffer currently shown in the main form.
Buffer * buffer() const;

View File

@ -154,7 +154,6 @@ lyx_SOURCES = \
lyxlex_pimpl.h \
lyxlookup.C \
lyxlookup.h \
lyxparagraph.h \
lyxrc.C \
lyxrc.h \
lyxrow.C \
@ -172,6 +171,9 @@ lyx_SOURCES = \
os2_defines.h \
os2_errortable.h \
paragraph.C \
paragraph.h \
paragraph_pimpl.C \
paragraph_pimpl.h \
print_form.C \
print_form.h \
screen.C \
@ -200,6 +202,8 @@ lyx_SOURCES = \
trans_mgr.h \
undo.C \
undo.h \
undostack.C \
undostack.h \
vc-backend.C \
vc-backend.h \
version.h \

View File

@ -231,7 +231,7 @@ void ParagraphParameters::align(LyXAlignment la)
}
void ParagraphParameters::depth(char d)
void ParagraphParameters::depth(depth_type d)
{
ParameterStruct tmp(*param);
tmp.depth = d;

View File

@ -63,9 +63,11 @@ public:
///
void align(LyXAlignment);
///
char depth() const;
typedef ParameterStruct::depth_type depth_type;
///
void depth(char);
depth_type depth() const;
///
void depth(depth_type);
///
bool startOfAppendix() const;
///
@ -119,7 +121,7 @@ private:
inline
char ParagraphParameters::depth() const
ParagraphParameters::depth_type ParagraphParameters::depth() const
{
return param->depth;
}

View File

@ -9,6 +9,8 @@
///
struct ParameterStruct {
///
typedef unsigned int depth_type;
///
VSpace added_space_top;
///
@ -28,7 +30,7 @@ struct ParameterStruct {
///
LyXAlignment align;
///
char depth; // wrong type (Lgb)
depth_type depth;
///
bool start_of_appendix;
///

View File

@ -36,7 +36,7 @@
//
// Q. What are we caching?
// A. We are caching the screen representations (LyXText) of the
// documents (Buffer,LyXParagraph) for specific BufferView widths.
// documents (Buffer,Paragraph) for specific BufferView widths.
// Q. Why the cache?
// A. It is not really needed, but it speeds things up a lot
// when you have more than one document loaded at once since a total

View File

@ -6,7 +6,7 @@
#include "UpdateInset.h"
#include "BufferView.h"
//#include "insets/lyxinset.h"
//#include "insets/inset.h"
void UpdateInset::update(BufferView * bv)
{

File diff suppressed because it is too large Load Diff

View File

@ -10,15 +10,6 @@
*
* ====================================================== */
// Change Log:
// ===========
// 23/03/98 Heinrich Bauer (heinrich.bauer@t-mobil.de)
// Spots marked "changed Heinrich Bauer, 23/03/98" modified due to the
// following bug: dvi file export did not work after printing (or previewing)
// and vice versa as long as the same file was concerned. This happened
// every time the LyX-file was left unchanged between the two actions mentioned
// above.
#ifndef BUFFER_H
#define BUFFER_H
@ -27,13 +18,14 @@
#endif
#include "LString.h"
#include "BufferView.h"
#include "undo.h"
#include "undostack.h"
#include "lyxvc.h"
#include "bufferparams.h"
#include "texrow.h"
#include "paragraph.h"
class BufferView;
class LyXRC;
class TeXErrors;
class LaTeXFeatures;
@ -50,7 +42,7 @@ struct DEPCLEAN {
};
/** The buffer object.
The is is the buffer object. It contains all the informations about
This is the buffer object. It contains all the informations about
a document loaded into LyX. I am not sure if the class is complete or
minimal, probably not.
\author Lars Gullik Bjønnes
@ -69,7 +61,7 @@ public:
*/
explicit Buffer(string const & file, bool b = false);
/// Destrucotr
/// Destructor
~Buffer();
/** Save the buffer's parameters as user default.
@ -88,8 +80,6 @@ public:
/// Maybe we know the function already by number...
bool Dispatch(int ac, string const & argument);
/// Should be changed to work for a list.
void resize();
///
void resizeInsets(BufferView *);
@ -120,22 +110,23 @@ public:
\param par if != 0 insert the file.
\return \c false if method fails.
*/
bool readFile(LyXLex &, LyXParagraph * par = 0);
bool readFile(LyXLex &, Paragraph * par = 0);
/** Reads a file without header.
\param par if != 0 insert the file.
\return \c false if file is not completely read.
*/
bool readLyXformat2(LyXLex &, LyXParagraph * par = 0);
bool readLyXformat2(LyXLex &, Paragraph * par = 0);
/// This parses a single LyXformat-Token.
bool parseSingleLyXformat2Token(LyXLex &, LyXParagraph *& par,
LyXParagraph *& return_par,
bool parseSingleLyXformat2Token(LyXLex &, Paragraph *& par,
Paragraph *& return_par,
string const & token, int & pos,
char & depth, LyXFont &);
Paragraph::depth_type & depth,
LyXFont &);
private:
/// Parse a single inset.
void readInset(LyXLex &, LyXParagraph *& par, int & pos, LyXFont &);
void readInset(LyXLex &, Paragraph *& par, int & pos, LyXFont &);
public:
/** Save file.
Takes care of auto-save files and backup file if requested.
@ -151,7 +142,7 @@ public:
///
void writeFileAscii(std::ostream &, int);
///
string const asciiParagraph(LyXParagraph const *,
string const asciiParagraph(Paragraph const *,
unsigned int linelen) const;
///
void makeLaTeXFile(string const & filename,
@ -160,13 +151,13 @@ public:
/** LaTeX all paragraphs from par to endpar.
\param \a endpar if == 0 then to the end
*/
void latexParagraphs(std::ostream & os, LyXParagraph * par,
LyXParagraph * endpar, TexRow & texrow) const;
void latexParagraphs(std::ostream & os, Paragraph * par,
Paragraph * endpar, TexRow & texrow) const;
///
void SimpleDocBookOnePar(std::ostream &, string & extra,
LyXParagraph * par, int & desc_on,
int depth) const ;
Paragraph * par, int & desc_on,
Paragraph::depth_type depth) const ;
///
int runChktex();
@ -260,10 +251,10 @@ public:
std::vector<std::pair<string, string> > const getBibkeyList();
///
struct TocItem {
TocItem(LyXParagraph * p, int d, string const & s)
TocItem(Paragraph * p, int d, string const & s)
: par(p), depth(d), str(s) {}
///
LyXParagraph * par;
Paragraph * par;
///
int depth;
///
@ -300,7 +291,7 @@ public:
This is a linked list of paragraph, this list holds the
whole contents of the document.
*/
LyXParagraph * paragraph;
Paragraph * paragraph;
/// LyX version control object.
LyXVC lyxvc;
@ -321,19 +312,20 @@ public:
private:
///
void DocBookHandleCaption(std::ostream & os, string & inner_tag,
int depth, int desc_on,
LyXParagraph * & par);
Paragraph::depth_type depth, int desc_on,
Paragraph * & par);
/// Open SGML/XML tag.
void sgmlOpenTag(std::ostream & os, int depth,
void sgmlOpenTag(std::ostream & os, Paragraph::depth_type depth,
string const & latexname) const;
/// Closes SGML/XML tag.
void sgmlCloseTag(std::ostream & os, int depth,
void sgmlCloseTag(std::ostream & os, Paragraph::depth_type depth,
string const & latexname) const;
///
void LinuxDocError(LyXParagraph * par, int pos,
void LinuxDocError(Paragraph * par, int pos,
string const & message);
///
void SimpleLinuxDocOnePar(std::ostream & os, LyXParagraph * par, int depth);
void SimpleLinuxDocOnePar(std::ostream & os, Paragraph * par,
Paragraph::depth_type depth);
/// is save needed
mutable bool lyx_clean;
@ -378,12 +370,12 @@ public:
///
inset_iterator() : par(0) /*, it(0)*/ {}
//
inset_iterator(LyXParagraph * paragraph) : par(paragraph) {
inset_iterator(Paragraph * paragraph) : par(paragraph) {
SetParagraph();
}
///
inset_iterator(LyXParagraph * paragraph,
LyXParagraph::size_type pos);
inset_iterator(Paragraph * paragraph,
Paragraph::size_type pos);
///
inset_iterator & operator++() { // prefix ++
if (par) {
@ -411,9 +403,9 @@ public:
Inset * operator*() { return *it; }
///
LyXParagraph * getPar() { return par; }
Paragraph * getPar() { return par; }
///
LyXParagraph::size_type getPos() const { return it.getPos(); }
Paragraph::size_type getPos() const { return it.getPos(); }
///
friend
bool operator==(inset_iterator const & iter1,
@ -422,9 +414,9 @@ public:
///
void SetParagraph();
///
LyXParagraph * par;
Paragraph * par;
///
LyXParagraph::inset_iterator it;
Paragraph::inset_iterator it;
};
///
@ -452,14 +444,6 @@ void Buffer::delUser(BufferView *)
}
inline
void Buffer::redraw()
{
users->redraw();
users->fitCursor(users->text);
}
inline
Language const * Buffer::GetLanguage() const
{

View File

@ -34,6 +34,7 @@
#include "lyxtext.h"
#include "lyx_cb.h"
#include "bufferview_funcs.h"
#include "BufferView.h"
#include "gettext.h"
#include "LyXView.h"
#include "vc-backend.h"
@ -161,12 +162,6 @@ void BufferList::closeAll()
}
void BufferList::resize()
{
for_each(bstore.begin(), bstore.end(), mem_fun(&Buffer::resize));
}
bool BufferList::close(Buffer * buf)
{
lyx::Assert(buf);
@ -461,10 +456,10 @@ Buffer * BufferList::newFile(string const & name, string tname, bool isNamed)
WriteAlert(_("Error!"), _("Unable to open template"),
MakeDisplayPath(tname));
// no template, start with empty buffer
b->paragraph = new LyXParagraph;
b->paragraph = new Paragraph;
}
} else { // start with empty buffer
b->paragraph = new LyXParagraph;
b->paragraph = new Paragraph;
}
if (!lyxrc.new_ask_filename && !isNamed) {

View File

@ -101,9 +101,6 @@ public:
/// Close all open buffers.
void closeAll();
///
void resize();
/// Read a file into a buffer readonly or not.
Buffer * readFile(string const &, bool ro);

View File

@ -17,7 +17,7 @@
#include "bufferview_funcs.h"
#include "LyXView.h"
#include "BufferView.h"
#include "lyxparagraph.h"
#include "paragraph.h"
#include "lyxfont.h"
#include "lyx_gui_misc.h"
#include "lyxtext.h"
@ -26,7 +26,7 @@
#include "lyx_cb.h"
#include "language.h"
#include "gettext.h"
#include "ParagraphParameters.h"
void Emph(BufferView * bv)
{
@ -90,9 +90,9 @@ void changeDepth(BufferView * bv, LyXText * text, int decInc)
bv->hideCursor();
bv->update(bv->text, BufferView::SELECT|BufferView::FITCUR);
if (decInc >= 0)
text->IncDepth(bv);
text->incDepth(bv);
else
text->DecDepth(bv);
text->decDepth(bv);
if (text->inset_owner)
bv->updateInset((Inset *)text->inset_owner, true);
bv->update(bv->text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
@ -209,15 +209,15 @@ string const CurrentState(BufferView * bv)
<< font.stateText(&buffer->params);
// The paragraph depth
int depth = text->GetDepth();
int depth = text->getDepth();
if (depth > 0)
state << _(", Depth: ") << depth;
// The paragraph spacing, but only if different from
// buffer spacing.
if (!text->cursor.par()->params.spacing().isDefault()) {
if (!text->cursor.par()->params().spacing().isDefault()) {
Spacing::Space cur_space =
text->cursor.par()->params.spacing().getSpace();
text->cursor.par()->params().spacing().getSpace();
state << _(", Spacing: ");
switch (cur_space) {
@ -233,7 +233,7 @@ string const CurrentState(BufferView * bv)
break;
case Spacing::Other:
state << _("Other (")
<< text->cursor.par()->params.spacing().getValue()
<< text->cursor.par()->params().spacing().getValue()
<< ")";
break;
case Spacing::Default:
@ -262,7 +262,7 @@ void ToggleAndShow(BufferView * bv, LyXFont const & font, bool toggleall)
bv->hideCursor();
bv->update(text, BufferView::SELECT|BufferView::FITCUR);
text->ToggleFree(bv, font, toggleall);
text->toggleFree(bv, font, toggleall);
bv->update(text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
if (font.language() != ignore_language ||
@ -270,11 +270,11 @@ void ToggleAndShow(BufferView * bv, LyXFont const & font, bool toggleall)
font.number() != LyXFont::IGNORE)
{
LyXCursor & cursor = text->cursor;
text->ComputeBidiTables(bv->buffer(), cursor.row());
text->computeBidiTables(bv->buffer(), cursor.row());
if (cursor.boundary() !=
text->IsBoundary(bv->buffer(), cursor.par(), cursor.pos(),
text->isBoundary(bv->buffer(), cursor.par(), cursor.pos(),
text->real_current_font) )
text->SetCursor(bv, cursor.par(), cursor.pos(),
text->setCursor(bv, cursor.par(), cursor.pos(),
false, !cursor.boundary());
}
}

View File

@ -141,8 +141,15 @@ enum kb_action {
LFUN_MATH_SIZE, // Alejandro 150896
LFUN_MATH_MACRO, // ale970510
LFUN_MATH_MACROARG, // ale970510 // 120
LFUN_MATH_EXTERN, // Andre' 20010424
LFUN_MATH_PANEL,
LFUN_MATH_EXTERN, // Andre' 20010424
LFUN_MATH_PANEL, // Andre' 20010522
LFUN_MATH_VALIGN, // Andre' 20010522
LFUN_MATH_HALIGN, // Andre' 20010522
LFUN_MATH_ROW_INSERT, // Andre' 20010522
LFUN_MATH_ROW_DELETE, // Andre' 20010522
LFUN_MATH_COLUMN_INSERT, // Andre' 20010522
LFUN_MATH_COLUMN_DELETE, // Andre' 20010522
LFUN_MATH_MUTATE, // Andre' 20010523
LFUN_FIGURE,
LFUN_DELETE_WORD_FORWARD,
LFUN_DELETE_WORD_BACKWARD,

View File

@ -29,6 +29,7 @@
#include "lyx_cb.h" // ShowMessage()
#include "support/lyxfunctional.h"
#include "gettext.h"
#include "BufferView.h"
using std::vector;
using std::queue;

View File

@ -63,24 +63,24 @@ void FigureApplyCB(FL_OBJECT *, long)
current_view->update(current_view->text, BufferView::SELECT|BufferView::FITCUR);
current_view->beforeChange(current_view->text);
current_view->text->SetCursorParUndo(current_view->buffer());
current_view->text->FreezeUndo();
current_view->text->setCursorParUndo(current_view->buffer());
current_view->text->freezeUndo();
current_view->text->BreakParagraph(current_view);
current_view->text->breakParagraph(current_view);
current_view->update(current_view->text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
if (current_view->text->cursor.par()->size()) {
current_view->text->CursorLeft(current_view);
current_view->text->cursorLeft(current_view);
current_view->text->BreakParagraph(current_view);
current_view->text->breakParagraph(current_view);
current_view->update(current_view->text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
}
// The standard layout should always be numer 0;
current_view->text->SetLayout(current_view, 0);
current_view->text->setLayout(current_view, 0);
current_view->text->
SetParagraph(current_view, 0, 0,
setParagraph(current_view, 0, 0,
0, 0,
VSpace (0.3 * buffer->params.spacing.getValue(),
LyXLength::CM),
@ -96,7 +96,7 @@ void FigureApplyCB(FL_OBJECT *, long)
new_inset->Edit(current_view, 0, 0, 0);
current_view->update(current_view->text, BufferView::SELECT|BufferView::FITCUR);
current_view->owner()->message(_("Figure inserted"));
current_view->text->UnFreezeUndo();
current_view->text->unFreezeUndo();
current_view->setState();
}

View File

@ -1,3 +1,7 @@
2001-06-22 John Levon <moz@compsoc.man.ac.uk>
* Makefile.am: remove kde frontend
2001-06-15 Angus Leeming <a.leeming@ic.ac.uk>
* Dialogs.h: removed unused signal showCharacter.

View File

@ -44,7 +44,7 @@ class InsetInfo;
class InsetTabular;
class InsetCommand;
class InsetMinipage;
class LyXParagraph;
class Paragraph;
/** Container of all dialogs and signals a LyXView needs or uses to access them
The list of dialog signals isn't comprehensive but should be a good guide

View File

@ -34,10 +34,9 @@ libfrontends_la_SOURCES=\
Toolbar.C \
Toolbar.h
EXTRA_DIST = kde qt2 gnome
EXTRA_DIST = qt2 gnome
dist-hook:
@cd $(distdir) ; \
rm -rf `find kde -name \*CVS\*`; \
rm -rf `find qt2 -name \*CVS\*`; \
rm -rf `find gnome -name \*CVS\*`

View File

@ -25,6 +25,7 @@
#include "Dialogs.h"
#include "LyXView.h"
#include "buffer.h"
#include "BufferView.h"
using SigC::slot;

View File

@ -25,6 +25,7 @@
#include "Dialogs.h"
#include "LyXView.h"
#include "buffer.h"
#include "BufferView.h"
using SigC::slot;

View File

@ -24,6 +24,7 @@
#include "bufferview_funcs.h" // ToggleAndShow
#include "gettext.h"
#include "language.h"
#include "BufferView.h"
using Liason::setMinibuffer;
using SigC::slot;

View File

@ -24,6 +24,7 @@
#include "Dialogs.h"
#include "LyXView.h"
#include "lyxfunc.h"
#include "BufferView.h"
ControlCommand::ControlCommand(LyXView & lv, Dialogs & d, kb_action ac)
: ControlInset<InsetCommand, InsetCommandParams>(lv, d),

View File

@ -49,7 +49,7 @@ protected:
#include "LyXView.h"
#include "BufferView.h"
template <class Base>
ControlDialog<Base>::ControlDialog(LyXView & lv, Dialogs & d)

View File

@ -33,6 +33,7 @@
#include "frontends/FileDialog.h"
#include "lyx_gui_misc.h" // WriteAlert
#include "gettext.h"
#include "BufferView.h"
using std::make_pair;
using std::vector;

View File

@ -31,6 +31,7 @@
#include "support/FileInfo.h" // for FileInfo
#include "helper_funcs.h" // for browseFile
#include "support/filetools.h" // for AddName
#include "BufferView.h"
using std::pair;
using std::make_pair;

View File

@ -19,6 +19,7 @@
#include "ButtonControllerBase.h"
#include "ControlInclude.h"
#include "buffer.h"
#include "BufferView.h"
#include "Dialogs.h"
#include "LyXView.h"
#include "gettext.h"

View File

@ -24,6 +24,7 @@
#include "LyXView.h"
#include "Dialogs.h"
#include "lyxrc.h"
#include "BufferView.h"
using SigC::slot;

View File

@ -23,6 +23,7 @@
#include "Dialogs.h"
#include "LyXView.h"
#include "buffer.h"
#include "BufferView.h"
using std::vector;
using SigC::slot;

View File

@ -21,7 +21,7 @@
#include "lyxrc.h"
#include "Liason.h"
#include "gettext.h"
#include "BufferView.h"
ControlPreamble::ControlPreamble(LyXView & lv, Dialogs & d)
: ControlDialog<ControlConnectBD>(lv, d),

View File

@ -30,6 +30,7 @@
#include "helper_funcs.h" // browseFile
#include "lyx_gui_misc.h" // WriteAlert
#include "gettext.h"
#include "BufferView.h"
using Liason::printBuffer;
using Liason::getPrinterParams;

View File

@ -27,6 +27,7 @@
#include "lyxfind.h"
#include "debug.h"
#include "gettext.h"
#include "BufferView.h"
using Liason::setMinibuffer;
using SigC::slot;

View File

@ -26,6 +26,7 @@
#include "lyxfunc.h"
#include "support/lstrings.h" // tostr
#include "gettext.h"
#include "BufferView.h"
using std::vector;
using SigC::slot;

View File

@ -24,6 +24,7 @@
#include "ButtonControllerBase.h"
#include "ControlVCLog.h"
#include "buffer.h"
#include "BufferView.h"
#include "LyXView.h"
#include "Dialogs.h"
#include "lyxrc.h"

View File

@ -60,7 +60,7 @@ void FormParagraph::update(bool switched)
if (!text)
text = lv_->view()->text;
LyXParagraph const * par = text->cursor.par();
Paragraph const * par = text->cursor.par();
int align = par->GetAlign();
@ -69,7 +69,7 @@ void FormParagraph::update(bool switched)
#if 0
// Just remove this and change physpar to par
LyXParagraph const * physpar = par;
Paragraph const * physpar = par;
if (physpar->params.spaceTop().kind() == VSpace::LENGTH) {
LyXGlueLength above = physpar->params.spaceTop().length();

View File

@ -16,7 +16,7 @@
#include "paraextradlg.h"
#include "vspace.h"
#include "lyxparagraph.h"
#include "paragraph.h"
#include "debug.h"
#include "dlg/paradlgdata.h"

View File

@ -19,6 +19,7 @@
#include "lyxtext.h"
#include "language.h"
#include "support/lstrings.h"
#include "BufferView.h"
using SigC::slot;
using Liason::setMinibuffer;

View File

@ -18,6 +18,8 @@
#include "QtLyXView.h"
#include "lyxtext.h"
#include "debug.h"
#include "BufferView.h"
#include "ParagraphParameters.h"
using SigC::slot;
using Liason::setMinibuffer;
@ -65,14 +67,14 @@ void FormParagraph::update(bool switched)
if (!text)
text = lv_->view()->text;
LyXParagraph * par = text->cursor.par();
Paragraph * par = text->cursor.par();
int align = par->GetAlign();
int align = par->getAlign();
if (align==LYX_ALIGN_LAYOUT)
align = textclasslist.Style(buf->params.textclass, par->GetLayout()).align;
align = textclasslist.Style(buf->params.textclass, par->getLayout()).align;
ParagraphParameters * params = &(par->params);
ParagraphParameters * params = &(par->params());
if (params->spaceTop().kind() == VSpace::LENGTH) {
LyXGlueLength above = params->spaceTop().length();
@ -90,7 +92,7 @@ void FormParagraph::update(bool switched)
} else
dialog_->setBelowLength(0.0, 0.0, 0.0, LyXLength::UNIT_NONE, LyXLength::UNIT_NONE, LyXLength::UNIT_NONE);
dialog_->setLabelWidth(text->cursor.par()->GetLabelWidthString().c_str());
dialog_->setLabelWidth(text->cursor.par()->getLabelWidthString().c_str());
dialog_->setAlign(align);
dialog_->setChecks(params->lineTop(), params->lineBottom(),
params->pagebreakTop(), params->pagebreakBottom(), params->noindent());
@ -102,7 +104,7 @@ void FormParagraph::update(bool switched)
LyXLength extrawidth;
float val = 0.0;
LyXLength::UNIT unit = LyXLength::CM;
params = &(par->params);
params = &(par->params());
if (isValidLength(params->pextraWidth(), &extrawidth)) {
lyxerr[Debug::GUI] << "Reading extra width \"" << extrawidth.asString() << "\"" << endl;
val = extrawidth.value();
@ -115,7 +117,7 @@ void FormParagraph::update(bool switched)
params->pextraAlignment(),
params->pextraHfill(),
params->pextraStartMinipage(),
static_cast<LyXParagraph::PEXTRA_TYPE>(params->pextraType()));
static_cast<Paragraph::PEXTRA_TYPE>(params->pextraType()));
}

View File

@ -19,6 +19,7 @@
#include "lyxfind.h"
//#include "language.h"
#include "support/lstrings.h"
#include "BufferView.h"
using Liason::setMinibuffer;

View File

@ -166,9 +166,9 @@ void ParagraphDlgImpl::setBelowLength(float val, float plus, float minus,
void ParagraphDlgImpl::setExtra(float widthval, LyXLength::UNIT units, const string percent, int align,
bool hfill, bool startminipage, LyXParagraph::PEXTRA_TYPE type)
bool hfill, bool startminipage, Paragraph::PEXTRA_TYPE type)
{
if (type!=LyXParagraph::PEXTRA_NONE) {
if (type!=Paragraph::PEXTRA_NONE) {
lyxerr[Debug::GUI] << "percent : $" << percent << "$ widthval " << widthval << " unit " << long(units) << endl;
if (percent != "") {
extraWidth->setText(percent.c_str());
@ -181,32 +181,32 @@ void ParagraphDlgImpl::setExtra(float widthval, LyXLength::UNIT units, const str
extraWidth->setText("");
switch (type) {
case LyXParagraph::PEXTRA_NONE:
case Paragraph::PEXTRA_NONE:
extraType->setCurrentItem(0);
break;
case LyXParagraph::PEXTRA_MINIPAGE:
case Paragraph::PEXTRA_MINIPAGE:
extraType->setCurrentItem(1);
enable_extraOptions(1);
enable_minipageOptions(1);
break;
case LyXParagraph::PEXTRA_FLOATFLT:
case Paragraph::PEXTRA_FLOATFLT:
extraType->setCurrentItem(2);
enable_extraOptions(2);
break;
case LyXParagraph::PEXTRA_INDENT:
case Paragraph::PEXTRA_INDENT:
extraType->setCurrentItem(3);
enable_extraOptions(3);
break;
}
switch (align) {
case LyXParagraph::MINIPAGE_ALIGN_TOP:
case Paragraph::MINIPAGE_ALIGN_TOP:
minipageValign->setCurrentItem(0);
break;
case LyXParagraph::MINIPAGE_ALIGN_MIDDLE:
case Paragraph::MINIPAGE_ALIGN_MIDDLE:
minipageValign->setCurrentItem(1);
break;
case LyXParagraph::MINIPAGE_ALIGN_BOTTOM:
case Paragraph::MINIPAGE_ALIGN_BOTTOM:
minipageValign->setCurrentItem(2);
break;
}
@ -331,23 +331,23 @@ VSpace::vspace_kind ParagraphDlgImpl::getSpaceBelowKind() const {
}
LyXParagraph::PEXTRA_TYPE ParagraphDlgImpl::getExtraType() const {
Paragraph::PEXTRA_TYPE ParagraphDlgImpl::getExtraType() const {
switch (extraType->currentItem()) {
case 0: return LyXParagraph::PEXTRA_NONE;
case 1: return LyXParagraph::PEXTRA_MINIPAGE;
case 2: return LyXParagraph::PEXTRA_FLOATFLT;
case 3: return LyXParagraph::PEXTRA_INDENT;
case 0: return Paragraph::PEXTRA_NONE;
case 1: return Paragraph::PEXTRA_MINIPAGE;
case 2: return Paragraph::PEXTRA_FLOATFLT;
case 3: return Paragraph::PEXTRA_INDENT;
}
return LyXParagraph::PEXTRA_NONE;
return Paragraph::PEXTRA_NONE;
}
LyXParagraph::MINIPAGE_ALIGNMENT ParagraphDlgImpl::getExtraAlign() const {
Paragraph::MINIPAGE_ALIGNMENT ParagraphDlgImpl::getExtraAlign() const {
switch (minipageValign->currentItem()) {
case 0: return LyXParagraph::MINIPAGE_ALIGN_TOP;
case 1: return LyXParagraph::MINIPAGE_ALIGN_MIDDLE;
case 2: return LyXParagraph::MINIPAGE_ALIGN_BOTTOM;
default: return LyXParagraph::MINIPAGE_ALIGN_BOTTOM;
case 0: return Paragraph::MINIPAGE_ALIGN_TOP;
case 1: return Paragraph::MINIPAGE_ALIGN_MIDDLE;
case 2: return Paragraph::MINIPAGE_ALIGN_BOTTOM;
default: return Paragraph::MINIPAGE_ALIGN_BOTTOM;
}
}

View File

@ -14,7 +14,7 @@
#include "paragraphdlg.h"
#include "vspace.h"
#include "lyxparagraph.h"
#include "paragraph.h"
class FormParagraph;
@ -35,7 +35,7 @@ public:
void setSpace(VSpace::vspace_kind, VSpace::vspace_kind, bool, bool);
void setAboveLength(float, float, float, LyXGlueLength::UNIT, LyXGlueLength::UNIT, LyXGlueLength::UNIT);
void setBelowLength(float, float, float, LyXGlueLength::UNIT, LyXGlueLength::UNIT, LyXGlueLength::UNIT);
void setExtra(float, LyXGlueLength::UNIT, const string, int, bool, bool, LyXParagraph::PEXTRA_TYPE);
void setExtra(float, LyXGlueLength::UNIT, const string, int, bool, bool, Paragraph::PEXTRA_TYPE);
LyXGlueLength getAboveLength() const;
LyXGlueLength getBelowLength() const;
LyXLength getExtraWidth() const;
@ -52,8 +52,8 @@ public:
bool getNoIndent() const;
VSpace::vspace_kind getSpaceAboveKind() const;
VSpace::vspace_kind getSpaceBelowKind() const;
LyXParagraph::PEXTRA_TYPE getExtraType() const;
LyXParagraph::MINIPAGE_ALIGNMENT getExtraAlign() const;
Paragraph::PEXTRA_TYPE getExtraType() const;
Paragraph::MINIPAGE_ALIGNMENT getExtraAlign() const;
bool getHfillBetween() const;
bool getStartNewMinipage() const;

View File

@ -25,6 +25,8 @@
#include "buffer.h"
#include "lyxtext.h"
#include "xforms_helpers.h"
#include "BufferView.h"
#include "ParagraphParameters.h"
using Liason::setMinibuffer;
using SigC::slot;
@ -55,7 +57,7 @@ void FormParagraph::disconnect()
}
LyXParagraph const * FormParagraph::getCurrentParagraph() const
Paragraph const * FormParagraph::getCurrentParagraph() const
{
LyXText * text = 0;
@ -70,7 +72,7 @@ LyXParagraph const * FormParagraph::getCurrentParagraph() const
void FormParagraph::changedParagraph()
{
/// Record the paragraph
LyXParagraph const * const p = getCurrentParagraph();
Paragraph const * const p = getCurrentParagraph();
if (p == 0 || p == par_)
return;
@ -268,7 +270,7 @@ void FormParagraph::general_apply()
text = lv_->view()->theLockingInset()->getLyXText(lv_->view());
if (!text)
text = lv_->view()->text;
text->SetParagraph(lv_->view(), line_top, line_bottom, pagebreak_top,
text->setParagraph(lv_->view(), line_top, line_bottom, pagebreak_top,
pagebreak_bottom, space_top, space_bottom, align,
labelwidthstring, noindent);
}
@ -285,16 +287,16 @@ void FormParagraph::general_update()
par_ = getCurrentParagraph();
fl_set_input(general_->input_labelwidth,
par_->GetLabelWidthString().c_str());
par_->getLabelWidthString().c_str());
fl_set_button(general_->radio_align_right, 0);
fl_set_button(general_->radio_align_left, 0);
fl_set_button(general_->radio_align_center, 0);
fl_set_button(general_->radio_align_block, 0);
int align = par_->GetAlign();
int align = par_->getAlign();
if (align == LYX_ALIGN_LAYOUT)
align = textclasslist.Style(buf->params.textclass,
par_->GetLayout()).align;
par_->getLayout()).align;
switch (align) {
case LYX_ALIGN_RIGHT:
@ -313,7 +315,7 @@ void FormParagraph::general_update()
LyXAlignment alignpos =
textclasslist.Style(buf->params.textclass,
par_->GetLayout()).alignpossible;
par_->getLayout()).alignpossible;
setEnabled(general_->radio_align_block, bool(alignpos & LYX_ALIGN_BLOCK));
setEnabled(general_->radio_align_center, bool(alignpos & LYX_ALIGN_CENTER));
@ -321,19 +323,19 @@ void FormParagraph::general_update()
setEnabled(general_->radio_align_right, bool(alignpos & LYX_ALIGN_RIGHT));
fl_set_button(general_->check_lines_top,
par_->params.lineTop());
par_->params().lineTop());
fl_set_button(general_->check_lines_bottom,
par_->params.lineBottom());
par_->params().lineBottom());
fl_set_button(general_->check_pagebreaks_top,
par_->params.pagebreakTop());
par_->params().pagebreakTop());
fl_set_button(general_->check_pagebreaks_bottom,
par_->params.pagebreakBottom());
par_->params().pagebreakBottom());
fl_set_button(general_->check_noindent,
par_->params.noindent());
par_->params().noindent());
fl_set_input (general_->input_space_above, "");
switch (par_->params.spaceTop().kind()) {
switch (par_->params().spaceTop().kind()) {
case VSpace::NONE:
fl_set_choice (general_->choice_space_above, 1);
break;
@ -355,15 +357,15 @@ void FormParagraph::general_update()
case VSpace::LENGTH:
fl_set_choice (general_->choice_space_above, 7);
fl_set_input(general_->input_space_above, par_->
params.spaceTop().length().asString().c_str());
params().spaceTop().length().asString().c_str());
break;
}
fl_set_button (general_->check_space_above,
par_->params.spaceTop().keep());
par_->params().spaceTop().keep());
fl_set_input (general_->input_space_below, "");
switch (par_->params.spaceBottom().kind()) {
switch (par_->params().spaceBottom().kind()) {
case VSpace::NONE:
fl_set_choice (general_->choice_space_below, 1);
break;
@ -385,13 +387,13 @@ void FormParagraph::general_update()
case VSpace::LENGTH:
fl_set_choice (general_->choice_space_below, 7);
fl_set_input(general_->input_space_below, par_->
params.spaceBottom().length().asString().c_str());
params().spaceBottom().length().asString().c_str());
break;
}
fl_set_button(general_->check_space_below,
par_->params.spaceBottom().keep());
par_->params().spaceBottom().keep());
fl_set_button(general_->check_noindent,
par_->params.noindent());
par_->params().noindent());
}

View File

@ -21,7 +21,7 @@
#include "FormBaseDeprecated.h"
class LyXParagraph;
class Paragraph;
struct FD_form_tabbed_paragraph;
struct FD_form_paragraph_general;
struct FD_form_paragraph_extra;
@ -54,7 +54,7 @@ private:
///
void changedParagraph();
///
LyXParagraph const * getCurrentParagraph() const;
Paragraph const * getCurrentParagraph() const;
///
virtual FL_FORM * form() const;
@ -78,8 +78,8 @@ private:
/// Changed Paragraph connection.
SigC::Connection cp_;
/// The current LyXParagraph
LyXParagraph const * par_;
/// The current Paragraph
Paragraph const * par_;
};

View File

@ -25,8 +25,7 @@
#include "ButtonController.h"
class xformsBC : public GuiBC<FL_OBJECT, FL_OBJECT>
{
class xformsBC : public GuiBC<FL_OBJECT, FL_OBJECT> {
public:
///
xformsBC(string const &, string const &);

View File

@ -25,6 +25,7 @@
#include "support/filetools.h"
#include "lyx_gui_misc.h" //WriteAlert
#include "gettext.h"
#include "BufferView.h"
using std::vector;
using std::find;

View File

@ -1,3 +1,20 @@
2001-06-24 The LyX Project <Asger>
* insettabular.C (getMaxWidth): We cache a mapping from
inset to cell in order to speed this method up.
2001-06-24 The LyX Project <Asger>
* insettext.C: Optimized InsetText::draw or something.
2001-06-23 The LyX Project <lyx@rose.home.sad.it>
* insettext.C (LocalDispatch): fixed inserting of 'normal chars'
2001-06-23 Lars Gullik Bjønnes <larsbj@birdstep.com>
* inset.h: name change from lyxinset.h
2001-06-22 Dekel Tsur <dekelts@tau.ac.il>
* insetfloat.C (Validate): Add a call to InsetCollapsable::Validate

View File

@ -13,6 +13,7 @@ libinsets_la_SOURCES = \
figinset.C \
figinset.h \
inset.C \
inset.h \
insetbib.C \
insetbib.h \
insetbutton.C \
@ -78,5 +79,4 @@ libinsets_la_SOURCES = \
insettoc.C \
insettoc.h \
inseturl.C \
inseturl.h \
lyxinset.h
inseturl.h

View File

@ -64,6 +64,7 @@
#include "ColorHandler.h"
#include "converter.h"
#include "frontends/Dialogs.h" // redrawGUI
#include "BufferView.h"
using std::ostream;
using std::istream;

View File

@ -11,7 +11,7 @@
#include "LString.h"
#include "buffer.h"
#include "LaTeXFeatures.h"
#include "insets/lyxinset.h"
#include "insets/inset.h"
#include <sigc++/signal_system.h>
/* the rest is figure stuff */

View File

@ -11,10 +11,10 @@
#include <config.h>
#ifdef __GNUG__
#pragma implementation "lyxinset.h"
#pragma implementation
#endif
#include "lyxinset.h"
#include "inset.h"
#include "debug.h"
#include "BufferView.h"
#include "support/lstrings.h"
@ -22,6 +22,7 @@
#include "commandtags.h"
#include "support/lstrings.h"
#include "gettext.h"
#include "lyxfont.h"
using std::endl;

View File

@ -8,25 +8,24 @@
*
* ====================================================== */
#ifndef LYXINSET_H
#define LYXINSET_H
#ifndef INSET_H
#define INSET_H
#ifdef __GNUG__
#pragma interface
#endif
#include <vector>
#include "LString.h"
#include <X11/Xlib.h>
#include "lyxfont.h"
#include "lyxlex.h"
#include "commandtags.h"
class LyXFont;
class BufferView;
class Buffer;
class Painter;
class LyXText;
class LyXLex;
struct LaTeXFeatures;

View File

@ -255,7 +255,7 @@ int bibitemMaxWidth(BufferView * bv, LyXFont const & font)
{
int w = 0;
// Does look like a hack? It is! (but will change at 0.13)
LyXParagraph * par = bv->buffer()->paragraph;
Paragraph * par = bv->buffer()->paragraph;
while (par) {
if (par->bibkey) {
@ -273,7 +273,7 @@ string const bibitemWidest(Buffer const * buffer)
{
int w = 0;
// Does look like a hack? It is! (but will change at 0.13)
LyXParagraph * par = buffer->paragraph;
Paragraph * par = buffer->paragraph;
InsetBibKey * bkey = 0;
LyXFont font;

View File

@ -19,6 +19,7 @@
#include "BufferView.h"
#include "Painter.h"
#include "support/LAssert.h"
#include "lyxfont.h"
using std::ostream;
using std::endl;

View File

@ -16,7 +16,7 @@
#pragma interface
#endif
#include "lyxinset.h"
#include "inset.h"
#include "LString.h"
/** Used to provide an inset that looks like a button.

View File

@ -17,7 +17,7 @@
#pragma interface
#endif
#include "lyxinset.h"
#include "inset.h"
#include "insettext.h"
#include "lyxfont.h"
#include "LColor.h"

View File

@ -17,6 +17,7 @@
#include "insetcommand.h"
#include "debug.h"
#include "Painter.h"
#include "lyxlex.h"
using std::ostream;
using std::endl;

View File

@ -16,7 +16,7 @@
#pragma interface
#endif
#include "lyxinset.h"
#include "inset.h"
#include "LString.h"
#include <sigc++/signal_system.h>

View File

@ -17,7 +17,7 @@
#pragma interface
#endif
#include "insets/lyxinset.h"
#include "insets/inset.h"
#include "insets/insetgraphicsParams.h"
#include "graphics/GraphicsCacheItem.h"
#include <boost/smart_ptr.hpp>

View File

@ -12,6 +12,7 @@
#include "insetinclude.h"
#include "buffer.h"
#include "bufferlist.h"
#include "BufferView.h"
#include "debug.h"
#include "support/filetools.h"
#include "lyxrc.h"

View File

@ -17,7 +17,7 @@
#endif
#include "insetinfo.h"
#include "lyxparagraph.h"
#include "paragraph.h"
#include "debug.h"
#include "gettext.h"
#include "lyx_gui_misc.h" // CancelCloseBoxCB
@ -25,6 +25,7 @@
#include "support/lstrings.h"
#include "Painter.h"
#include "font.h"
#include "BufferView.h"
using std::ostream;
using std::endl;

View File

@ -16,9 +16,10 @@
#pragma interface
#endif
#include "lyxinset.h"
#include "inset.h"
#include FORMS_H_LOCATION
#include "LString.h"
#include "lyxfont.h"
/** Info. Handles the note insets.

View File

@ -21,6 +21,7 @@
#include "lyxtext.h"
#include "buffer.h"
#include "gettext.h"
#include "BufferView.h"
using std::ostream;
using std::vector;
@ -56,7 +57,7 @@ void InsetLabel::Edit(BufferView * bv, int, int, unsigned int)
bool flag = bv->ChangeRefsIfUnique(getContents(),
new_contents);
setContents(new_contents);
bv->text->RedoParagraph(bv);
bv->text->redoParagraph(bv);
if (flag) {
bv->redraw();
bv->fitCursor(getLyXText(bv));

View File

@ -15,7 +15,7 @@
#pragma interface
#endif
#include "lyxinset.h"
#include "inset.h"
#include "LString.h"
#include "lyxlex.h"

View File

@ -25,6 +25,7 @@
#include "Painter.h"
#include "font.h"
#include "language.h"
#include "BufferView.h"
using std::ostream;
using std::endl;
@ -85,8 +86,8 @@ InsetQuotes::InsetQuotes(char c, BufferParams const & params)
// Decide whether left or right
switch (c) {
case ' ': case '(': case '{': case '[': case '-': case ':':
case LyXParagraph::META_HFILL:
case LyXParagraph::META_NEWLINE:
case Paragraph::META_HFILL:
case Paragraph::META_NEWLINE:
side = InsetQuotes::LeftQ; // left quote
break;
default:

View File

@ -16,7 +16,7 @@
#pragma interface
#endif
#include "lyxinset.h"
#include "inset.h"
class BufferParams;

View File

@ -13,6 +13,7 @@
#include "LyXView.h"
#include "frontends/Dialogs.h"
#include "lyxfunc.h"
#include "BufferView.h"
using std::ostream;

View File

@ -15,7 +15,7 @@
#pragma interface
#endif
#include "lyxinset.h"
#include "inset.h"
#include "LString.h"
struct LaTeXFeatures;

View File

@ -14,6 +14,7 @@
#include <algorithm>
#include <cstdlib>
#include <map>
#ifdef __GNUG__
#pragma implementation
@ -36,6 +37,7 @@
#include "WorkArea.h"
#include "gettext.h"
#include "language.h"
#include "BufferView.h"
using std::ostream;
using std::ifstream;
@ -499,7 +501,7 @@ void InsetTabular::Edit(BufferView * bv, int x, int y, unsigned int button)
inset_y = 0;
setPos(bv, x, y);
sel_cell_start = sel_cell_end = actcell;
bv->text->FinishUndo();
bv->text->finishUndo();
if (InsetHit(bv, x, y) && (button != 3)) {
ActivateCellInsetAbs(bv, x, y, button);
}
@ -957,7 +959,7 @@ InsetTabular::LocalDispatch(BufferView * bv,
case LFUN_CUT:
if (!copySelection(bv))
break;
bv->text->SetUndo(bv->buffer(), Undo::DELETE,
bv->text->setUndo(bv->buffer(), Undo::DELETE,
bv->text->cursor.par()->previous(),
bv->text->cursor.par()->next());
cutSelection();
@ -966,12 +968,12 @@ InsetTabular::LocalDispatch(BufferView * bv,
case LFUN_COPY:
if (!hasSelection())
break;
bv->text->FinishUndo();
bv->text->finishUndo();
copySelection(bv);
break;
case LFUN_PASTESELECTION:
{
string clip(bv->getClipboard());
string const clip(bv->getClipboard());
if (clip.empty())
break;
@ -1037,7 +1039,7 @@ InsetTabular::LocalDispatch(BufferView * bv,
}
case LFUN_PASTE:
if (hasPasteBuffer()) {
bv->text->SetUndo(bv->buffer(), Undo::INSERT,
bv->text->setUndo(bv->buffer(), Undo::INSERT,
bv->text->cursor.par()->previous(),
bv->text->cursor.par()->next());
pasteSelection(bv);
@ -1299,7 +1301,7 @@ void InsetTabular::resetPos(BufferView * bv) const
} else if (the_locking_inset &&
(tabular->GetWidthOfColumn(actcell) > bv->workWidth()-20))
{
int xx = cursor.x() - offset + bv->text->GetRealCursorX(bv);
int xx = cursor.x() - offset + bv->text->getRealCursorX(bv);
if (xx > (bv->workWidth()-20)) {
scroll(bv, -(xx - bv->workWidth() + 60));
UpdateLocal(bv, FULL, false);
@ -1481,12 +1483,12 @@ void InsetTabular::SetFont(BufferView * bv, LyXFont const & font, bool tall,
}
if (hasSelection()) {
bool frozen;
bv->text->SetUndo(bv->buffer(), Undo::EDIT,
bv->text->setUndo(bv->buffer(), Undo::EDIT,
bv->text->cursor.par()->previous(),
bv->text->cursor.par()->next());
frozen = bv->text->undo_frozen;
if (!frozen)
bv->text->FreezeUndo();
bv->text->freezeUndo();
// apply the fontchange on the whole selection
int sel_row_start;
int sel_row_end;
@ -1499,7 +1501,7 @@ void InsetTabular::SetFont(BufferView * bv, LyXFont const & font, bool tall,
}
}
if (!frozen)
bv->text->UnFreezeUndo();
bv->text->unFreezeUndo();
UpdateLocal(bv, INIT, true);
}
if (the_locking_inset)
@ -1582,7 +1584,7 @@ void InsetTabular::TabularFeatures(BufferView * bv,
sel_col_start = sel_col_end = tabular->column_of_cell(actcell);
sel_row_start = sel_row_end = tabular->row_of_cell(actcell);
}
bv->text->SetUndo(bv->buffer(), Undo::FINISH,
bv->text->setUndo(bv->buffer(), Undo::FINISH,
bv->text->cursor.par()->previous(),
bv->text->cursor.par()->next());
@ -1902,12 +1904,28 @@ int InsetTabular::GetMaxWidthOfCell(BufferView * bv, int cell) const
int InsetTabular::getMaxWidth(BufferView * bv,
UpdatableInset const * inset) const
{
int const n = tabular->GetNumberOfCells();
int cell = 0;
for (; cell < n; ++cell) {
if (tabular->GetCellInset(cell) == inset)
break;
typedef std::map<UpdatableInset const *, int> Cache;
static Cache cache;
int cell = -1;
Cache::const_iterator ci = cache.find(inset);
if (ci != cache.end()) {
cell = (*ci).second;
if (tabular->GetCellInset(cell) != inset) {
cell = -1;
}
}
int const n = tabular->GetNumberOfCells();
if (cell == -1) {
cell = 0;
for (; cell < n; ++cell) {
if (tabular->GetCellInset(cell) == inset)
break;
}
cache[inset] = cell;
}
if (cell >= n)
return -1;
int w = GetMaxWidthOfCell(bv, cell);
@ -1917,11 +1935,13 @@ int InsetTabular::getMaxWidth(BufferView * bv,
return w;
}
void InsetTabular::deleteLyXText(BufferView * bv, bool recursive) const
{
resizeLyXText(bv, recursive);
}
void InsetTabular::resizeLyXText(BufferView * bv, bool force) const
{
if (force) {
@ -2329,6 +2349,7 @@ bool InsetTabular::isRightToLeft(BufferView *bv )
return bv->getParentLanguage(this)->RightToLeft();
}
bool InsetTabular::nodraw() const
{
if (!UpdatableInset::nodraw() && the_locking_inset)
@ -2336,6 +2357,7 @@ bool InsetTabular::nodraw() const
return UpdatableInset::nodraw();
}
int InsetTabular::scroll(bool recursive) const
{
int sx = UpdatableInset::scroll(false);
@ -2346,11 +2368,13 @@ int InsetTabular::scroll(bool recursive) const
return sx;
}
bool InsetTabular::doClearArea() const
{
return !locked || (need_update & (FULL|INIT));
}
void InsetTabular::getSelection(int & srow, int & erow, int & scol, int & ecol) const
{
srow = tabular->row_of_cell(sel_cell_start);

View File

@ -52,7 +52,7 @@
#pragma interface
#endif
#include "lyxinset.h"
#include "inset.h"
#include "tabular.h"
#include "LString.h"
#include "lyxcursor.h"

View File

@ -20,7 +20,7 @@
#endif
#include "insettext.h"
#include "lyxparagraph.h"
#include "paragraph.h"
#include "lyxlex.h"
#include "debug.h"
#include "lyxfont.h"
@ -47,6 +47,7 @@
#include "WorkArea.h"
#include "gettext.h"
#include "lyxfunc.h"
#include "ParagraphParameters.h"
using std::ostream;
using std::ifstream;
@ -60,7 +61,7 @@ extern int greek_kb_flag;
InsetText::InsetText()
{
par = new LyXParagraph;
par = new Paragraph;
init();
}
@ -104,7 +105,7 @@ void InsetText::init(InsetText const * ins)
autoBreakRows = ins->autoBreakRows;
drawFrame_ = ins->drawFrame_;
}
par->SetInsetOwner(this);
par->setInsetOwner(this);
frame_color = LColor::insetframe;
locked = false;
old_par = 0;
@ -123,7 +124,7 @@ InsetText::~InsetText()
}
while (par) {
LyXParagraph * tmp = par->next();
Paragraph * tmp = par->next();
delete par;
par = tmp;
}
@ -140,11 +141,11 @@ void InsetText::clear()
}
while (par) {
LyXParagraph * tmp = par->next();
Paragraph * tmp = par->next();
delete par;
par = tmp;
}
par = new LyXParagraph;
par = new Paragraph;
}
@ -172,8 +173,8 @@ void InsetText::Read(Buffer const * buf, LyXLex & lex)
{
string token;
int pos = 0;
LyXParagraph * return_par = 0;
char depth = 0; // signed or unsigned?
Paragraph * return_par = 0;
Paragraph::depth_type depth = 0;
LyXFont font(LyXFont::ALL_INHERIT);
clear();
@ -197,7 +198,7 @@ void InsetText::Read(Buffer const * buf, LyXLex & lex)
return_par = par;
par = return_par;
while(return_par) {
return_par->SetInsetOwner(this);
return_par->setInsetOwner(this);
return_par = return_par->next();
}
@ -212,7 +213,7 @@ void InsetText::Read(Buffer const * buf, LyXLex & lex)
int InsetText::ascent(BufferView * bv, LyXFont const &) const
{
int y_temp = 0;
Row * row = TEXT(bv)->GetRowNearY(y_temp);
Row * row = TEXT(bv)->getRowNearY(y_temp);
insetAscent = row->ascent_of_text() + TEXT_TO_INSET_OFFSET;
return insetAscent;
}
@ -221,7 +222,7 @@ int InsetText::ascent(BufferView * bv, LyXFont const &) const
int InsetText::descent(BufferView * bv, LyXFont const &) const
{
int y_temp = 0;
Row * row = TEXT(bv)->GetRowNearY(y_temp);
Row * row = TEXT(bv)->getRowNearY(y_temp);
insetDescent = TEXT(bv)->height - row->ascent_of_text() +
TEXT_TO_INSET_OFFSET;
return insetDescent;
@ -326,14 +327,14 @@ void InsetText::draw(BufferView * bv, LyXFont const & f,
}
if (!cleared && (need_update == CURSOR) && !TEXT(bv)->selection.set()) {
drawFrame(pain, cleared);
x += width(bv, f);
x += last_width; // was width(bv, f);
need_update = NONE;
return;
}
x += TEXT_TO_INSET_OFFSET;
int y = 0;
Row * row = TEXT(bv)->GetRowNearY(y);
Row * row = TEXT(bv)->getRowNearY(y);
int y_offset = baseline - row->ascent_of_text();
int ph = pain.paperHeight();
int first = 0;
@ -350,7 +351,7 @@ void InsetText::draw(BufferView * bv, LyXFont const & f,
int yf = y_offset;
y = 0;
while ((row != 0) && (yf < ph)) {
TEXT(bv)->GetVisibleRow(bv, y+y_offset, int(x), row,
TEXT(bv)->getVisibleRow(bv, y+y_offset, int(x), row,
y+first, cleared);
y += row->height();
yf += row->height();
@ -359,7 +360,7 @@ void InsetText::draw(BufferView * bv, LyXFont const & f,
} else if (!locked) {
if (need_update & CURSOR) {
bv->screen()->ToggleSelection(TEXT(bv), bv, true, y_offset,int(x));
TEXT(bv)->ClearSelection(bv);
TEXT(bv)->clearSelection(bv);
TEXT(bv)->selection.cursor = TEXT(bv)->cursor;
}
bv->screen()->Update(TEXT(bv), bv, y_offset, int(x));
@ -369,7 +370,7 @@ void InsetText::draw(BufferView * bv, LyXFont const & f,
bv->screen()->ToggleToggle(TEXT(bv), bv, y_offset, int(x));
else if (need_update & CURSOR) {
bv->screen()->ToggleSelection(TEXT(bv), bv, true, y_offset,int(x));
TEXT(bv)->ClearSelection(bv);
TEXT(bv)->clearSelection(bv);
TEXT(bv)->selection.cursor = TEXT(bv)->cursor;
}
bv->screen()->Update(TEXT(bv), bv, y_offset, int(x));
@ -383,7 +384,7 @@ void InsetText::draw(BufferView * bv, LyXFont const & f,
drawFrame(pain, cleared);
else if (need_update & CLEAR_FRAME)
clearFrame(pain, cleared);
x += width(bv, f) - TEXT_TO_INSET_OFFSET;
x += last_width /* was width(bv, f) */ - TEXT_TO_INSET_OFFSET;
if (bv->text->status==LyXText::CHANGED_IN_DRAW) {
need_update |= INIT;
} else if (need_update != INIT)
@ -452,7 +453,7 @@ void InsetText::update(BufferView * bv, LyXFont const & font, bool reinit)
if ((need_update&CURSOR_PAR) && (TEXT(bv)->status==LyXText::UNCHANGED) &&
the_locking_inset)
{
TEXT(bv)->UpdateInset(bv, the_locking_inset);
TEXT(bv)->updateInset(bv, the_locking_inset);
}
if (TEXT(bv)->status == LyXText::NEED_MORE_REFRESH)
@ -477,20 +478,20 @@ void InsetText::SetUpdateStatus(BufferView * bv, int what) const
// this to not draw a selection when we redraw all of it!
if ((need_update & (INIT|FULL)) && (need_update & CURSOR))
TEXT(bv)->ClearSelection(bv);
TEXT(bv)->clearSelection(bv);
}
void InsetText::UpdateLocal(BufferView * bv, int what, bool mark_dirty)
{
TEXT(bv)->FullRebreak(bv);
TEXT(bv)->fullRebreak(bv);
SetUpdateStatus(bv, what);
if ((need_update != CURSOR) || (TEXT(bv)->status != LyXText::UNCHANGED) ||
TEXT(bv)->selection.set())
bv->updateInset(this, mark_dirty);
bv->owner()->showState();
if (old_par != cpar(bv)) {
bv->owner()->setLayout(cpar(bv)->GetLayout());
bv->owner()->setLayout(cpar(bv)->getLayout());
old_par = cpar(bv);
}
}
@ -519,10 +520,10 @@ void InsetText::Edit(BufferView * bv, int x, int y, unsigned int button)
old_par = 0;
int tmp_y = (y < 0)?0:y;
if (!checkAndActivateInset(bv, x, tmp_y, button))
TEXT(bv)->SetCursorFromCoordinates(bv, x - drawTextXOffset,
TEXT(bv)->setCursorFromCoordinates(bv, x - drawTextXOffset,
y + insetAscent);
TEXT(bv)->selection.cursor = TEXT(bv)->cursor;
bv->text->FinishUndo();
bv->text->finishUndo();
ShowInsetCursor(bv);
UpdateLocal(bv, CURSOR, false);
@ -549,13 +550,13 @@ void InsetText::InsetUnlock(BufferView * bv)
locked = false;
int code = CURSOR|CLEAR_FRAME;
if (TEXT(bv)->selection.set()) {
TEXT(bv)->ClearSelection(bv);
TEXT(bv)->clearSelection(bv);
code = FULL;
} else if (owner())
bv->owner()->setLayout(owner()->getLyXText(bv)
->cursor.par()->GetLayout());
->cursor.par()->getLayout());
else
bv->owner()->setLayout(bv->text->cursor.par()->GetLayout());
bv->owner()->setLayout(bv->text->cursor.par()->getLayout());
UpdateLocal(bv, code, false);
}
@ -566,7 +567,7 @@ bool InsetText::LockInsetInInset(BufferView * bv, UpdatableInset * inset)
<< inset << "): ";
if (!inset)
return false;
if (inset == cpar(bv)->GetInset(cpos(bv))) {
if (inset == cpar(bv)->getInset(cpos(bv))) {
lyxerr[Debug::INSETS] << "OK" << endl;
the_locking_inset = inset;
inset_x = cx(bv) - top_x + drawTextXOffset;
@ -575,7 +576,7 @@ bool InsetText::LockInsetInInset(BufferView * bv, UpdatableInset * inset)
inset_par = cpar(bv);
inset_boundary = cboundary(bv);
#if 0
TEXT(bv)->ClearSelection(bv);
TEXT(bv)->clearSelection(bv);
TEXT(bv)->sel_cursor = TEXT(bv)->cursor;
TEXT(bv)->UpdateInset(bv, the_locking_inset);
#else
@ -606,7 +607,7 @@ bool InsetText::UnlockInsetInInset(BufferView * bv, UpdatableInset * inset,
return false;
if (the_locking_inset == inset) {
the_locking_inset->InsetUnlock(bv);
TEXT(bv)->UpdateInset(bv, inset);
TEXT(bv)->updateInset(bv, inset);
the_locking_inset = 0;
if (lr)
moveRight(bv, false);
@ -626,12 +627,12 @@ bool InsetText::UpdateInsetInInset(BufferView * bv, Inset * inset)
if (!the_locking_inset)
return false;
if (the_locking_inset != inset) {
TEXT(bv)->UpdateInset(bv, the_locking_inset);
TEXT(bv)->updateInset(bv, the_locking_inset);
SetUpdateStatus(bv, CURSOR_PAR);
return the_locking_inset->UpdateInsetInInset(bv, inset);
}
// UpdateLocal(bv, FULL, false);
if (TEXT(bv)->UpdateInset(bv, inset))
if (TEXT(bv)->updateInset(bv, inset))
UpdateLocal(bv, CURSOR_PAR, false);
if (cpar(bv) == inset_par && cpos(bv) == inset_pos) {
inset_x = cx(bv) - top_x + drawTextXOffset;
@ -696,11 +697,11 @@ void InsetText::InsetButtonPress(BufferView * bv, int x, int y, int button)
LocalDispatch(bv, LFUN_COPY, "");
paste_internally = true;
}
TEXT(bv)->SetCursorFromCoordinates(bv, x-drawTextXOffset,
TEXT(bv)->setCursorFromCoordinates(bv, x-drawTextXOffset,
y + insetAscent);
TEXT(bv)->selection.cursor = TEXT(bv)->cursor;
UpdateLocal(bv, CURSOR, false);
bv->owner()->setLayout(cpar(bv)->GetLayout());
bv->owner()->setLayout(cpar(bv)->getLayout());
old_par = cpar(bv);
// Insert primary selection with middle mouse
// if there is a local selection in the current buffer,
@ -727,8 +728,8 @@ void InsetText::InsetButtonRelease(BufferView * bv, int x, int y, int button)
x - inset_x, y - inset_y,
button);
} else {
if (cpar(bv)->GetChar(cpos(bv)) == LyXParagraph::META_INSET) {
inset = static_cast<UpdatableInset*>(cpar(bv)->GetInset(cpos(bv)));
if (cpar(bv)->getChar(cpos(bv)) == Paragraph::META_INSET) {
inset = static_cast<UpdatableInset*>(cpar(bv)->getInset(cpos(bv)));
if (inset->Editable() == Inset::HIGHLY_EDITABLE) {
inset->InsetButtonRelease(bv,
x - inset_x,
@ -759,9 +760,9 @@ void InsetText::InsetMotionNotify(BufferView * bv, int x, int y, int state)
return;
}
HideInsetCursor(bv);
TEXT(bv)->SetCursorFromCoordinates(bv, x - drawTextXOffset,
TEXT(bv)->setCursorFromCoordinates(bv, x - drawTextXOffset,
y + insetAscent);
TEXT(bv)->SetSelection(bv);
TEXT(bv)->setSelection(bv);
if (TEXT(bv)->toggle_cursor.par()!=TEXT(bv)->toggle_end_cursor.par() ||
TEXT(bv)->toggle_cursor.pos()!=TEXT(bv)->toggle_end_cursor.pos())
UpdateLocal(bv, SELECTION, false);
@ -780,7 +781,7 @@ void InsetText::InsetKeyPress(XKeyEvent * xke)
UpdatableInset::RESULT
InsetText::LocalDispatch(BufferView * bv,
kb_action action, string const & arg)
kb_action action, string const & arg)
{
no_selection = false;
UpdatableInset::RESULT
@ -829,7 +830,7 @@ InsetText::LocalDispatch(BufferView * bv,
HideInsetCursor(bv);
switch (action) {
// Normal chars
case LFUN_UNKNOWN_ACTION:
case LFUN_SELFINSERT:
if (bv->buffer()->isReadonly()) {
// setErrorMessage(N_("Document is read only"));
break;
@ -841,16 +842,16 @@ InsetText::LocalDispatch(BufferView * bv,
* "auto_region_delete", which defaults to
* true (on). */
bv->text->SetUndo(bv->buffer(), Undo::INSERT,
bv->text->setUndo(bv->buffer(), Undo::INSERT,
bv->text->cursor.par()->previous(),
bv->text->cursor.par()->next());
bv->setState();
if (lyxrc.auto_region_delete) {
if (TEXT(bv)->selection.set()) {
TEXT(bv)->CutSelection(bv, false);
TEXT(bv)->cutSelection(bv, false);
}
}
TEXT(bv)->ClearSelection(bv);
TEXT(bv)->clearSelection(bv);
for (string::size_type i = 0; i < arg.length(); ++i) {
if (greek_kb_flag) {
if (!math_insert_greek(bv, arg[i])) {
@ -869,88 +870,88 @@ InsetText::LocalDispatch(BufferView * bv,
break;
// --- Cursor Movements -----------------------------------
case LFUN_RIGHTSEL:
bv->text->FinishUndo();
bv->text->finishUndo();
moveRight(bv, false, true);
TEXT(bv)->SetSelection(bv);
TEXT(bv)->setSelection(bv);
UpdateLocal(bv, SELECTION, false);
break;
case LFUN_RIGHT:
result = moveRight(bv);
bv->text->FinishUndo();
bv->text->finishUndo();
UpdateLocal(bv, CURSOR, false);
break;
case LFUN_LEFTSEL:
bv->text->FinishUndo();
bv->text->finishUndo();
moveLeft(bv, false, true);
TEXT(bv)->SetSelection(bv);
TEXT(bv)->setSelection(bv);
UpdateLocal(bv, SELECTION, false);
break;
case LFUN_LEFT:
bv->text->FinishUndo();
bv->text->finishUndo();
result = moveLeft(bv);
UpdateLocal(bv, CURSOR, false);
break;
case LFUN_DOWNSEL:
bv->text->FinishUndo();
bv->text->finishUndo();
moveDown(bv);
TEXT(bv)->SetSelection(bv);
TEXT(bv)->setSelection(bv);
UpdateLocal(bv, SELECTION, false);
break;
case LFUN_DOWN:
bv->text->FinishUndo();
bv->text->finishUndo();
result = moveDown(bv);
UpdateLocal(bv, CURSOR, false);
break;
case LFUN_UPSEL:
bv->text->FinishUndo();
bv->text->finishUndo();
moveUp(bv);
TEXT(bv)->SetSelection(bv);
TEXT(bv)->setSelection(bv);
UpdateLocal(bv, SELECTION, false);
break;
case LFUN_UP:
bv->text->FinishUndo();
bv->text->finishUndo();
result = moveUp(bv);
UpdateLocal(bv, CURSOR, false);
break;
case LFUN_HOME:
bv->text->FinishUndo();
TEXT(bv)->CursorHome(bv);
bv->text->finishUndo();
TEXT(bv)->cursorHome(bv);
UpdateLocal(bv, CURSOR, false);
break;
case LFUN_END:
TEXT(bv)->CursorEnd(bv);
TEXT(bv)->cursorEnd(bv);
UpdateLocal(bv, CURSOR, false);
break;
case LFUN_BACKSPACE:
bv->text->SetUndo(bv->buffer(), Undo::DELETE,
bv->text->setUndo(bv->buffer(), Undo::DELETE,
bv->text->cursor.par()->previous(),
bv->text->cursor.par()->next());
if (TEXT(bv)->selection.set())
TEXT(bv)->CutSelection(bv);
TEXT(bv)->cutSelection(bv);
else
TEXT(bv)->Backspace(bv);
TEXT(bv)->backspace(bv);
UpdateLocal(bv, CURSOR_PAR, true);
break;
case LFUN_DELETE:
bv->text->SetUndo(bv->buffer(), Undo::DELETE,
bv->text->setUndo(bv->buffer(), Undo::DELETE,
bv->text->cursor.par()->previous(),
bv->text->cursor.par()->next());
if (TEXT(bv)->selection.set())
TEXT(bv)->CutSelection(bv);
TEXT(bv)->cutSelection(bv);
else
TEXT(bv)->Delete(bv);
UpdateLocal(bv, CURSOR_PAR, true);
break;
case LFUN_CUT:
bv->text->SetUndo(bv->buffer(), Undo::DELETE,
bv->text->setUndo(bv->buffer(), Undo::DELETE,
bv->text->cursor.par()->previous(),
bv->text->cursor.par()->next());
TEXT(bv)->CutSelection(bv);
TEXT(bv)->cutSelection(bv);
UpdateLocal(bv, CURSOR_PAR, true);
break;
case LFUN_COPY:
bv->text->FinishUndo();
TEXT(bv)->CopySelection(bv);
bv->text->finishUndo();
TEXT(bv)->copySelection(bv);
UpdateLocal(bv, CURSOR_PAR, false);
break;
case LFUN_PASTESELECTION:
@ -960,9 +961,9 @@ InsetText::LocalDispatch(BufferView * bv,
if (clip.empty())
break;
if (arg == "paragraph") {
TEXT(bv)->InsertStringB(bv, clip);
TEXT(bv)->insertStringAsParagraphs(bv, clip);
} else {
TEXT(bv)->InsertStringA(bv, clip);
TEXT(bv)->insertStringAsLines(bv, clip);
}
UpdateLocal(bv, CURSOR_PAR, true);
break;
@ -978,31 +979,31 @@ InsetText::LocalDispatch(BufferView * bv,
break;
}
}
bv->text->SetUndo(bv->buffer(), Undo::INSERT,
bv->text->setUndo(bv->buffer(), Undo::INSERT,
bv->text->cursor.par()->previous(),
bv->text->cursor.par()->next());
TEXT(bv)->PasteSelection(bv);
TEXT(bv)->pasteSelection(bv);
UpdateLocal(bv, CURSOR_PAR, true);
break;
case LFUN_BREAKPARAGRAPH:
if (!autoBreakRows)
return DISPATCHED;
TEXT(bv)->BreakParagraph(bv, 0);
TEXT(bv)->breakParagraph(bv, 0);
UpdateLocal(bv, FULL, true);
break;
case LFUN_BREAKPARAGRAPHKEEPLAYOUT:
if (!autoBreakRows)
return DISPATCHED;
TEXT(bv)->BreakParagraph(bv, 1);
TEXT(bv)->breakParagraph(bv, 1);
UpdateLocal(bv, FULL, true);
break;
case LFUN_BREAKLINE:
if (!autoBreakRows)
return DISPATCHED;
bv->text->SetUndo(bv->buffer(), Undo::INSERT,
bv->text->setUndo(bv->buffer(), Undo::INSERT,
bv->text->cursor.par()->previous(),
bv->text->cursor.par()->next());
TEXT(bv)->InsertChar(bv, LyXParagraph::META_NEWLINE);
TEXT(bv)->insertChar(bv, Paragraph::META_NEWLINE);
UpdateLocal(bv, CURSOR_PAR, true);
break;
case LFUN_LAYOUT:
@ -1034,13 +1035,13 @@ InsetText::LocalDispatch(BufferView * bv,
if (cur_layout != layout.second) {
cur_layout = layout.second;
TEXT(bv)->SetLayout(bv, layout.second);
bv->owner()->setLayout(cpar(bv)->GetLayout());
TEXT(bv)->setLayout(bv, layout.second);
bv->owner()->setLayout(cpar(bv)->getLayout());
UpdateLocal(bv, CURSOR_PAR, true);
}
} else {
// reset the layout box
bv->owner()->setLayout(cpar(bv)->GetLayout());
bv->owner()->setLayout(cpar(bv)->getLayout());
}
break;
case LFUN_PARAGRAPH_SPACING:
@ -1048,11 +1049,11 @@ InsetText::LocalDispatch(BufferView * bv,
// it also seems to me that the paragraphs inside the insettext
// inherit bufferparams/paragraphparams in a strange way. (Lgb)
{
LyXParagraph * par = TEXT(bv)->cursor.par();
Spacing::Space cur_spacing = par->params.spacing().getSpace();
Paragraph * par = TEXT(bv)->cursor.par();
Spacing::Space cur_spacing = par->params().spacing().getSpace();
float cur_value = 1.0;
if (cur_spacing == Spacing::Other) {
cur_value = par->params.spacing().getValue();
cur_value = par->params().spacing().getValue();
}
std::istringstream istr(arg.c_str());
@ -1083,7 +1084,7 @@ InsetText::LocalDispatch(BufferView * bv,
<< arg << endl;
}
if (cur_spacing != new_spacing || cur_value != new_value) {
par->params.spacing(Spacing(new_spacing, new_value));
par->params().spacing(Spacing(new_spacing, new_value));
//TEXT(bv)->RedoParagraph(owner->view());
UpdateLocal(bv, CURSOR_PAR, true);
//bv->update(BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
@ -1123,7 +1124,7 @@ int InsetText::Latex(Buffer const * buf, ostream & os, bool, bool) const
int InsetText::Ascii(Buffer const * buf, ostream & os, int linelen) const
{
LyXParagraph * p = par;
Paragraph * p = par;
unsigned int lines = 0;
while (p) {
@ -1138,7 +1139,7 @@ int InsetText::Ascii(Buffer const * buf, ostream & os, int linelen) const
int InsetText::DocBook(Buffer const * buf, ostream & os) const
{
LyXParagraph * p = par;
Paragraph * p = par;
unsigned int lines = 0;
int desc = 0;
@ -1154,7 +1155,7 @@ int InsetText::DocBook(Buffer const * buf, ostream & os) const
void InsetText::Validate(LaTeXFeatures & features) const
{
LyXParagraph * p = par;
Paragraph * p = par;
while (p) {
p->validate(features);
p = p->next();
@ -1162,13 +1163,13 @@ void InsetText::Validate(LaTeXFeatures & features) const
}
int InsetText::BeginningOfMainBody(Buffer const * buf, LyXParagraph * p) const
int InsetText::BeginningOfMainBody(Buffer const * buf, Paragraph * p) const
{
if (textclasslist.Style(buf->params.textclass,
p->GetLayout()).labeltype != LABEL_MANUAL)
p->getLayout()).labeltype != LABEL_MANUAL)
return 0;
else
return p->BeginningOfMainBody();
return p->beginningOfMainBody();
}
@ -1196,7 +1197,7 @@ void InsetText::ToggleInsetCursor(BufferView * bv)
return;
}
LyXFont const font(TEXT(bv)->GetFont(bv->buffer(), cpar(bv), cpos(bv)));
LyXFont const font(TEXT(bv)->getFont(bv->buffer(), cpar(bv), cpos(bv)));
int const asc = lyxfont::maxAscent(font);
int const desc = lyxfont::maxDescent(font);
@ -1217,7 +1218,7 @@ void InsetText::ShowInsetCursor(BufferView * bv, bool show)
}
if (!isCursorVisible()) {
LyXFont const font =
TEXT(bv)->GetFont(bv->buffer(), cpar(bv), cpos(bv));
TEXT(bv)->getFont(bv->buffer(), cpar(bv), cpos(bv));
int const asc = lyxfont::maxAscent(font);
int const desc = lyxfont::maxDescent(font);
@ -1269,7 +1270,7 @@ InsetText::moveRightIntern(BufferView * bv, bool behind,
return FINISHED;
if (activate_inset && checkAndActivateInset(bv, behind))
return DISPATCHED;
TEXT(bv)->CursorRight(bv);
TEXT(bv)->cursorRight(bv);
if (!selecting)
TEXT(bv)->selection.cursor = TEXT(bv)->cursor;
return DISPATCHED_NOUPDATE;
@ -1282,7 +1283,7 @@ InsetText::moveLeftIntern(BufferView * bv, bool behind,
{
if (!cpar(bv)->previous() && (cpos(bv) <= 0))
return FINISHED;
TEXT(bv)->CursorLeft(bv);
TEXT(bv)->cursorLeft(bv);
if (!selecting)
TEXT(bv)->selection.cursor = TEXT(bv)->cursor;
if (activate_inset && checkAndActivateInset(bv, behind))
@ -1296,7 +1297,7 @@ InsetText::moveUp(BufferView * bv)
{
if (!crow(bv)->previous())
return FINISHED;
TEXT(bv)->CursorUp(bv);
TEXT(bv)->cursorUp(bv);
return DISPATCHED_NOUPDATE;
}
@ -1306,7 +1307,7 @@ InsetText::moveDown(BufferView * bv)
{
if (!crow(bv)->next())
return FINISHED;
TEXT(bv)->CursorDown(bv);
TEXT(bv)->cursorDown(bv);
return DISPATCHED_NOUPDATE;
}
@ -1318,14 +1319,14 @@ bool InsetText::InsertInset(BufferView * bv, Inset * inset)
return the_locking_inset->InsertInset(bv, inset);
return false;
}
bv->text->SetUndo(bv->buffer(), Undo::INSERT,
bv->text->setUndo(bv->buffer(), Undo::INSERT,
bv->text->cursor.par()->previous(),
bv->text->cursor.par()->next());
inset->setOwner(this);
HideInsetCursor(bv);
TEXT(bv)->InsertInset(bv, inset);
TEXT(bv)->insertInset(bv, inset);
#if 0
if ((cpar(bv)->GetChar(cpos(bv)) != LyXParagraph::META_INSET) ||
if ((cpar(bv)->GetChar(cpos(bv)) != Paragraph::META_INSET) ||
(cpar(bv)->GetInset(cpos(bv)) != inset))
TEXT(bv)->CursorLeft(bv);
#endif
@ -1364,10 +1365,10 @@ std::vector<string> const InsetText::getLabelList() const
{
std::vector<string> label_list;
LyXParagraph * tpar = par;
Paragraph * tpar = par;
while (tpar) {
LyXParagraph::inset_iterator beg = tpar->inset_iterator_begin();
LyXParagraph::inset_iterator end = tpar->inset_iterator_end();
Paragraph::inset_iterator beg = tpar->inset_iterator_begin();
Paragraph::inset_iterator end = tpar->inset_iterator_end();
for (; beg != end; ++beg) {
std::vector<string> const l = (*beg)->getLabelList();
label_list.insert(label_list.end(), l.begin(), l.end());
@ -1386,15 +1387,15 @@ void InsetText::SetFont(BufferView * bv, LyXFont const & font, bool toggleall,
return;
}
if (TEXT(bv)->selection.set()) {
bv->text->SetUndo(bv->buffer(), Undo::EDIT,
bv->text->setUndo(bv->buffer(), Undo::EDIT,
bv->text->cursor.par()->previous(),
bv->text->cursor.par()->next());
}
if (selectall)
selectAll(bv);
TEXT(bv)->SetFont(bv, font, toggleall);
TEXT(bv)->setFont(bv, font, toggleall);
if (selectall)
TEXT(bv)->ClearSelection(bv);
TEXT(bv)->clearSelection(bv);
bv->fitCursor(TEXT(bv));
if (selectall || TEXT(bv)->selection.set())
UpdateLocal(bv, FULL, true);
@ -1405,15 +1406,15 @@ void InsetText::SetFont(BufferView * bv, LyXFont const & font, bool toggleall,
bool InsetText::checkAndActivateInset(BufferView * bv, bool behind)
{
if (cpar(bv)->GetChar(cpos(bv)) == LyXParagraph::META_INSET) {
if (cpar(bv)->getChar(cpos(bv)) == Paragraph::META_INSET) {
unsigned int x;
unsigned int y;
Inset * inset =
static_cast<UpdatableInset*>(cpar(bv)->GetInset(cpos(bv)));
static_cast<UpdatableInset*>(cpar(bv)->getInset(cpos(bv)));
if (!inset || inset->Editable() != Inset::HIGHLY_EDITABLE)
return false;
LyXFont const font =
TEXT(bv)->GetFont(bv->buffer(), cpar(bv), cpos(bv));
TEXT(bv)->getFont(bv->buffer(), cpar(bv), cpos(bv));
if (behind) {
x = inset->width(bv, font);
y = font.isRightToLeft() ? 0 : inset->descent(bv, font);
@ -1436,10 +1437,9 @@ bool InsetText::checkAndActivateInset(BufferView * bv, bool behind)
bool InsetText::checkAndActivateInset(BufferView * bv, int x, int y,
int button)
{
int dummyx, dummyy;
dummyx = x = x - drawTextXOffset;
dummyy = y + insetAscent;
x -= drawTextXOffset;
int dummyx = x;
int dummyy = y + insetAscent;
Inset * inset = bv->checkInsetHit(TEXT(bv), dummyx, dummyy, button);
if (inset) {
@ -1475,7 +1475,7 @@ int InsetText::getMaxWidth(BufferView * bv, UpdatableInset const * inset) const
}
void InsetText::SetParagraphData(LyXParagraph * p)
void InsetText::SetParagraphData(Paragraph * p)
{
// delete all instances of LyXText before deleting the paragraps used
// by it.
@ -1485,20 +1485,20 @@ void InsetText::SetParagraphData(LyXParagraph * p)
}
while (par) {
LyXParagraph * tmp = par->next();
Paragraph * tmp = par->next();
delete par;
par = tmp;
}
par = new LyXParagraph(*p);
par->SetInsetOwner(this);
LyXParagraph * np = par;
par = new Paragraph(*p);
par->setInsetOwner(this);
Paragraph * np = par;
while (p->next()) {
p = p->next();
np->next(new LyXParagraph(*p));
np->next(new Paragraph(*p));
np->next()->previous(np);
np = np->next();
np->SetInsetOwner(this);
np->setInsetOwner(this);
}
need_update = INIT;
@ -1510,7 +1510,7 @@ void InsetText::SetText(string const & data)
clear();
LyXFont font(LyXFont::ALL_SANE);
for (unsigned int i=0; i < data.length(); ++i)
par->InsertChar(i, data[i], font);
par->insertChar(i, data[i], font);
}
@ -1550,7 +1550,7 @@ int InsetText::cx(BufferView * bv) const
LyXText * text = TEXT(bv);
int x = text->cursor.x() + top_x + TEXT_TO_INSET_OFFSET;
if (the_locking_inset) {
LyXFont font = text->GetFont(bv->buffer(),
LyXFont font = text->getFont(bv->buffer(),
text->cursor.par(),
text->cursor.pos());
if (font.isVisibleRightToLeft())
@ -1567,13 +1567,13 @@ int InsetText::cy(BufferView * bv) const
}
LyXParagraph::size_type InsetText::cpos(BufferView * bv) const
Paragraph::size_type InsetText::cpos(BufferView * bv) const
{
return TEXT(bv)->cursor.pos();
}
LyXParagraph * InsetText::cpar(BufferView * bv) const
Paragraph * InsetText::cpar(BufferView * bv) const
{
return TEXT(bv)->cursor.par();
}
@ -1606,7 +1606,7 @@ LyXText * InsetText::getLyXText(BufferView const * lbv,
lt->init(bv);
cache[bv] = lt;
if (the_locking_inset) {
lt->SetCursor(bv, inset_par, inset_pos, true, inset_boundary);
lt->setCursor(bv, inset_par, inset_pos, true, inset_boundary);
if (recursive)
return the_locking_inset->getLyXText(bv);
}
@ -1622,7 +1622,7 @@ void InsetText::deleteLyXText(BufferView * bv, bool recursive) const
cache.erase(bv);
if (recursive) {
/// then remove all LyXText in text-insets
LyXParagraph * p = par;
Paragraph * p = par;
for (; p; p = p->next()) {
p->deleteInsetsLyXText(bv);
}
@ -1640,12 +1640,12 @@ void InsetText::resizeLyXText(BufferView * bv, bool force) const
if ((cache.find(bv) == cache.end()) || !cache[bv])
return;
LyXParagraph * lpar = 0;
LyXParagraph * selstartpar = 0;
LyXParagraph * selendpar = 0;
LyXParagraph::size_type pos = 0;
LyXParagraph::size_type selstartpos = 0;
LyXParagraph::size_type selendpos = 0;
Paragraph * lpar = 0;
Paragraph * selstartpar = 0;
Paragraph * selendpar = 0;
Paragraph::size_type pos = 0;
Paragraph::size_type selstartpos = 0;
Paragraph::size_type selendpos = 0;
bool boundary = false;
bool selstartboundary = false;
bool selendboundary = false;
@ -1675,15 +1675,15 @@ void InsetText::resizeLyXText(BufferView * bv, bool force) const
* Mechanism when setting the cursor */
TEXT(bv)->selection.mark(mark_set);
if (selection) {
TEXT(bv)->SetCursor(bv, selstartpar, selstartpos,
TEXT(bv)->setCursor(bv, selstartpar, selstartpos,
true, selstartboundary);
TEXT(bv)->selection.cursor = TEXT(bv)->cursor;
TEXT(bv)->SetCursor(bv, selendpar, selendpos,
TEXT(bv)->setCursor(bv, selendpar, selendpos,
true, selendboundary);
TEXT(bv)->SetSelection(bv);
TEXT(bv)->SetCursor(bv, lpar, pos);
TEXT(bv)->setSelection(bv);
TEXT(bv)->setCursor(bv, lpar, pos);
} else {
TEXT(bv)->SetCursor(bv, lpar, pos, true, boundary);
TEXT(bv)->setCursor(bv, lpar, pos, true, boundary);
TEXT(bv)->selection.cursor = TEXT(bv)->cursor;
TEXT(bv)->selection.set(false);
}
@ -1697,7 +1697,7 @@ void InsetText::resizeLyXText(BufferView * bv, bool force) const
/// then resize all LyXText in text-insets
inset_x = cx(bv) - top_x + drawTextXOffset;
inset_y = cy(bv) + drawTextYOffset;
for (LyXParagraph * p = par; p; p = p->next()) {
for (Paragraph * p = par; p; p = p->next()) {
p->resizeInsetsLyXText(bv);
}
}
@ -1707,10 +1707,10 @@ void InsetText::resizeLyXText(BufferView * bv, bool force) const
void InsetText::removeNewlines()
{
for (LyXParagraph * p = par; p; p = p->next()) {
for (Paragraph * p = par; p; p = p->next()) {
for (int i = 0; i < p->size(); ++i) {
if (p->GetChar(i) == LyXParagraph::META_NEWLINE)
p->Erase(i);
if (p->getChar(i) == Paragraph::META_NEWLINE)
p->erase(i);
}
}
}
@ -1740,19 +1740,22 @@ bool InsetText::doClearArea() const
return !locked || (need_update & (FULL|INIT));
}
void InsetText::selectAll(BufferView * bv)
{
TEXT(bv)->CursorTop(bv);
TEXT(bv)->cursorTop(bv);
TEXT(bv)->selection.cursor = TEXT(bv)->cursor;
TEXT(bv)->CursorBottom(bv);
TEXT(bv)->SetSelection(bv);
TEXT(bv)->cursorBottom(bv);
TEXT(bv)->setSelection(bv);
}
void InsetText::clearSelection(BufferView * bv)
{
TEXT(bv)->ClearSelection(bv);
TEXT(bv)->clearSelection(bv);
}
void InsetText::clearInset(Painter & pain, int baseline, bool & cleared) const
{
int w = insetWidth;

View File

@ -19,7 +19,7 @@
#pragma interface
#endif
#include "lyxinset.h"
#include "inset.h"
#include "LString.h"
#include "lyxcursor.h"
@ -27,7 +27,7 @@ class Painter;
class BufferView;
class Buffer;
class LyXCursor;
class LyXParagraph;
class Paragraph;
class LColor;
class LyXText;
class LyXScreen;
@ -161,7 +161,7 @@ public:
///
void WriteParagraphData(Buffer const *, std::ostream &) const;
///
void SetParagraphData(LyXParagraph *);
void SetParagraphData(Paragraph *);
///
void SetText(string const &);
///
@ -195,7 +195,7 @@ public:
///
void clearSelection(BufferView *bv);
LyXParagraph * par;
Paragraph * par;
///
mutable int need_update;
@ -219,7 +219,7 @@ private:
///
typedef Cache::value_type value_type;
///
int BeginningOfMainBody(Buffer const *, LyXParagraph * par) const;
int BeginningOfMainBody(Buffer const *, Paragraph * par) const;
///
void ShowInsetCursor(BufferView *, bool show=true);
///
@ -259,9 +259,9 @@ private:
///
int cy(BufferView *) const;
///
LyXParagraph::size_type cpos(BufferView *) const;
Paragraph::size_type cpos(BufferView *) const;
///
LyXParagraph * cpar(BufferView *) const;
Paragraph * cpar(BufferView *) const;
///
bool cboundary(BufferView *) const;
///
@ -293,9 +293,9 @@ private:
///
mutable int top_y;
///
LyXParagraph * inset_par;
Paragraph * inset_par;
///
LyXParagraph::size_type inset_pos;
Paragraph::size_type inset_pos;
///
bool inset_boundary;
///
@ -311,7 +311,7 @@ private:
///
UpdatableInset * the_locking_inset;
///
LyXParagraph * old_par;
Paragraph * old_par;
/// The cache.
mutable Cache cache;
///

View File

@ -33,6 +33,7 @@
#include "support/path.h"
#include "support/syscall.h"
#include "gettext.h"
#include "BufferView.h"
using std::vector;
using std::ifstream;
@ -461,9 +462,9 @@ void InsertAsciiFile(BufferView * bv, string const & f, bool asParagraph)
// clear the selection
bv->beforeChange(bv->text);
if (!asParagraph)
bv->text->InsertStringA(bv, tmpstr);
bv->text->insertStringAsLines(bv, tmpstr);
else
bv->text->InsertStringB(bv, tmpstr);
bv->text->insertStringAsParagraphs(bv, tmpstr);
bv->update(bv->text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
}
@ -473,16 +474,16 @@ void MenuInsertLabel(BufferView * bv, string const & arg)
string label(arg);
ProhibitInput(bv);
if (label.empty()) {
LyXParagraph * par = bv->text->cursor.par();
Paragraph * par = bv->text->cursor.par();
LyXLayout const * layout =
&textclasslist.Style(bv->buffer()->params.textclass,
par->GetLayout());
par->getLayout());
if (layout->latextype == LATEX_PARAGRAPH && par->previous()) {
LyXParagraph * par2 = par->previous();
Paragraph * par2 = par->previous();
LyXLayout const * layout2 =
&textclasslist.Style(bv->buffer()->params.textclass,
par2->GetLayout());
par2->getLayout());
if (layout2->latextype != LATEX_PARAGRAPH) {
par = par2;
layout = layout2;
@ -496,7 +497,7 @@ void MenuInsertLabel(BufferView * bv, string const & arg)
if (layout->latextype == LATEX_PARAGRAPH ||
lyxrc.label_init_length < 0)
text.erase();
string par_text = par->String(bv->buffer(), false);
string par_text = par->asString(bv->buffer(), false);
for (int i = 0; i < lyxrc.label_init_length; ++i) {
if (par_text.empty())
break;

View File

@ -15,7 +15,6 @@
#pragma implementation
#endif
//#include <fcntl.h>
#include "lyx_gui.h"
#include FORMS_H_LOCATION
#include "support/filetools.h"
@ -28,6 +27,7 @@
#include "version.h"
#include "LyXView.h"
#include "buffer.h"
#include "BufferView.h"
#include "lyxserver.h"
#include "lyxrc.h"
#include "gettext.h"

View File

@ -23,31 +23,31 @@ LyXCursor::LyXCursor() : par_(0), pos_(0), boundary_(false),
}
void LyXCursor::par(LyXParagraph * p)
void LyXCursor::par(Paragraph * p)
{
par_ = p;
}
LyXParagraph * LyXCursor::par()
Paragraph * LyXCursor::par()
{
return par_;
}
LyXParagraph * LyXCursor::par() const
Paragraph * LyXCursor::par() const
{
return par_;
}
void LyXCursor::pos(LyXParagraph::size_type p)
void LyXCursor::pos(Paragraph::size_type p)
{
pos_ = p;
}
LyXParagraph::size_type LyXCursor::pos() const
Paragraph::size_type LyXCursor::pos() const
{
return pos_;
}

View File

@ -16,7 +16,7 @@
#pragma interface
#endif
#include "lyxparagraph.h"
#include "paragraph.h"
struct Row;
@ -26,15 +26,15 @@ class LyXCursor {
public:
LyXCursor();
///
void par(LyXParagraph * p);
void par(Paragraph * p);
///
LyXParagraph * par();
Paragraph * par();
///
LyXParagraph * par() const;
Paragraph * par() const;
///
void pos(LyXParagraph::size_type p);
void pos(Paragraph::size_type p);
///
LyXParagraph::size_type pos() const;
Paragraph::size_type pos() const;
///
void boundary(bool b);
///
@ -59,9 +59,9 @@ public:
Row * row() const;
private:
/// The paragraph the cursor is in.
LyXParagraph * par_;
Paragraph * par_;
/// The position inside the paragraph
LyXParagraph::size_type pos_;
Paragraph::size_type pos_;
///
bool boundary_;
///

View File

@ -39,8 +39,8 @@ int LyXReplace(BufferView * bv,
// start at top if replaceall
bool fw = forward;
if (replaceall) {
bv->text->ClearSelection(bv);
bv->text->CursorTop(bv);
bv->text->clearSelection(bv);
bv->text->cursorTop(bv);
// override search direction because we search top to bottom
fw = true;
}
@ -58,8 +58,8 @@ int LyXReplace(BufferView * bv,
bv->hideCursor();
bv->update(bv->text, BufferView::SELECT|BufferView::FITCUR);
bv->toggleSelection(false);
bv->text->ReplaceSelectionWithString(bv, replacestr);
bv->text->SetSelectionOverString(bv, replacestr);
bv->text->replaceSelectionWithString(bv, replacestr);
bv->text->setSelectionOverString(bv, replacestr);
bv->update(bv->text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
++replace_count;
found = LyXFind(bv, searchstr, casesens, matchwrd, fw);
@ -95,8 +95,8 @@ bool LyXFind(BufferView * bv,
: SearchBackward(bv, searchstr, casesens, matchwrd)) {
bv->update(bv->text, BufferView::SELECT|BufferView::FITCUR);
bv->toggleSelection();
bv->text->ClearSelection(bv);
bv->text->SetSelectionOverString(bv, searchstr);
bv->text->clearSelection(bv);
bv->text->setSelectionOverString(bv, searchstr);
bv->toggleSelection(false);
found = true;
};
@ -109,7 +109,7 @@ bool LyXFind(BufferView * bv,
// returns true if the specified string is at the specified position
bool IsStringInText(LyXParagraph * par, LyXParagraph::size_type pos,
bool IsStringInText(Paragraph * par, Paragraph::size_type pos,
string const & str, bool const & cs,
bool const & mw)
{
@ -117,22 +117,21 @@ bool IsStringInText(LyXParagraph * par, LyXParagraph::size_type pos,
return false;
string::size_type size = str.length();
LyXParagraph::size_type i = 0;
Paragraph::size_type i = 0;
while (((pos + i) < par->size())
&& (string::size_type(i) < size)
&& (cs ? (str[i] == par->GetChar(pos + i))
: (toupper(str[i]) == toupper(par->GetChar(pos + i)))))
&& (cs ? (str[i] == par->getChar(pos + i))
: (toupper(str[i]) == toupper(par->getChar(pos + i)))))
{
++i;
}
if (size == string::size_type(i)) {
// if necessary, check whether string matches word
if (!mw ||
(mw && ((pos <= 0 || !IsLetterCharOrDigit(par->GetChar(pos - 1)))
&& (pos + size >= par->size()
|| !IsLetterCharOrDigit(par->GetChar(pos + size))))
)
)
(mw && ((pos <= 0 || !IsLetterCharOrDigit(par->getChar(pos - 1)))
&& (pos + Paragraph::size_type(size) >= par->size()
|| !IsLetterCharOrDigit(par->getChar(pos + size))))
))
return true;
}
return false;
@ -144,8 +143,8 @@ bool IsStringInText(LyXParagraph * par, LyXParagraph::size_type pos,
bool SearchForward(BufferView * bv, string const & str,
bool const & cs, bool const & mw)
{
LyXParagraph * par = bv->text->cursor.par();
LyXParagraph::size_type pos = bv->text->cursor.pos();
Paragraph * par = bv->text->cursor.par();
Paragraph::size_type pos = bv->text->cursor.pos();
while (par && !IsStringInText(par, pos, str, cs, mw)) {
if (pos < par->size() - 1)
@ -156,7 +155,7 @@ bool SearchForward(BufferView * bv, string const & str,
}
}
if (par) {
bv->text->SetCursor(bv, par, pos);
bv->text->setCursor(bv, par, pos);
return true;
}
else
@ -170,8 +169,8 @@ bool SearchForward(BufferView * bv, string const & str,
bool SearchBackward(BufferView * bv, string const & str,
bool const & cs, bool const & mw)
{
LyXParagraph * par = bv->text->cursor.par();
LyXParagraph::size_type pos = bv->text->cursor.pos();
Paragraph * par = bv->text->cursor.par();
Paragraph::size_type pos = bv->text->cursor.pos();
do {
if (pos > 0)
@ -187,7 +186,7 @@ bool SearchBackward(BufferView * bv, string const & str,
} while (par && !IsStringInText(par, pos, str, cs, mw));
if (par) {
bv->text->SetCursor(bv, par, pos);
bv->text->setCursor(bv, par, pos);
return true;
} else
return false;

View File

@ -7,7 +7,7 @@
#endif
#include "LString.h"
#include "lyxparagraph.h"
#include "paragraph.h"
class BufferView;
@ -18,7 +18,7 @@ bool LyXFind(BufferView * bv, string const &, bool const &, bool const &,
bool const &);
/// returns true if the specified string is at the specified position
bool IsStringInText(LyXParagraph * par, LyXParagraph::size_type pos,
bool IsStringInText(Paragraph * par, Paragraph::size_type pos,
string const & str, bool const & = true,
bool const & = false);

View File

@ -19,7 +19,6 @@
#include <cstdlib>
#include <cctype>
//#include <cstring>
#ifdef __GNUG__
#pragma implementation
@ -30,6 +29,7 @@
#include "kbmap.h"
#include "lyxfunc.h"
#include "bufferlist.h"
#include "BufferView.h"
#include "ColorHandler.h"
#include "lyxserver.h"
#include "figure_form.h"
@ -181,7 +181,7 @@ inline
void LyXFunc::moveCursorUpdate(bool flag, bool selecting)
{
if (selecting || TEXT(flag)->selection.mark()) {
TEXT(flag)->SetSelection(owner->view());
TEXT(flag)->setSelection(owner->view());
if (TEXT(flag)->bv_owner)
owner->view()->toggleToggle();
}
@ -190,7 +190,6 @@ void LyXFunc::moveCursorUpdate(bool flag, bool selecting)
/* ---> Everytime the cursor is moved, show the current font state. */
// should this too me moved out of this func?
//owner->showState();
owner->view()->setState();
}
@ -232,8 +231,6 @@ void LyXFunc::processKeySym(KeySym keysym, unsigned int state)
if (keysym == NoSymbol) {
lyxerr[Debug::KEY] << "Empty kbd action (probably composing)"
<< endl;
//return 0;
//return FL_PREEMPT;
return;
}
@ -243,7 +240,6 @@ void LyXFunc::processKeySym(KeySym keysym, unsigned int state)
// all of them should be explictly mentioned?
if ((keysym >= XK_Shift_L && keysym <= XK_Hyper_R)
|| keysym == XK_Mode_switch || keysym == 0x0) {
//return 0;
return;
}
@ -312,7 +308,6 @@ void LyXFunc::processKeySym(KeySym keysym, unsigned int state)
}
if (action == -1) {
owner->message(_("Unknown function."));
//return 0;
return;
}
}
@ -364,12 +359,12 @@ LyXFunc::func_status LyXFunc::getStatus(int ac) const
LyXFunc::func_status LyXFunc::getStatus(int ac,
string const & not_to_use_arg) const
{
kb_action action;
func_status flag = LyXFunc::OK;
string argument;
Buffer * buf = owner->buffer();
kb_action action;
func_status flag = LyXFunc::OK;
string argument;
Buffer * buf = owner->buffer();
if (lyxaction.isPseudoAction(ac))
if (lyxaction.isPseudoAction(ac))
action = lyxaction.retrieveActionArg(ac, argument);
else {
action = static_cast<kb_action>(ac);
@ -539,7 +534,9 @@ LyXFunc::func_status LyXFunc::getStatus(int ac,
// temporary dispatch method
void LyXFunc::miniDispatch(string const & s)
{
Dispatch(s);
if (!s.empty()) {
Dispatch(s);
}
}
@ -548,7 +545,7 @@ string const LyXFunc::Dispatch(string const & s)
// Split command string into command and argument
string cmd;
string line = frontStrip(s);
string arg = strip(frontStrip(split(line, cmd, ' ')));
string const arg = strip(frontStrip(split(line, cmd, ' ')));
return Dispatch(lyxaction.LookupFunc(cmd), arg);
}
@ -657,10 +654,10 @@ string const LyXFunc::Dispatch(int ac,
owner->view()->unlockInset(inset);
owner->view()->menuUndo();
if (TEXT()->cursor.par()->
IsInset(TEXT()->cursor.pos())) {
isInset(TEXT()->cursor.pos())) {
inset = static_cast<UpdatableInset*>(
TEXT()->cursor.par()->
GetInset(TEXT()->
getInset(TEXT()->
cursor.pos()));
} else {
inset = 0;
@ -678,7 +675,7 @@ string const LyXFunc::Dispatch(int ac,
owner->view()->menuRedo();
inset = static_cast<UpdatableInset*>(
TEXT()->cursor.par()->
GetInset(TEXT()->
getInset(TEXT()->
cursor.pos()));
if (inset)
inset->Edit(owner->view(),slx,sly,0);
@ -695,29 +692,29 @@ string const LyXFunc::Dispatch(int ac,
case LFUN_UNKNOWN_ACTION:
case LFUN_BREAKPARAGRAPH:
case LFUN_BREAKLINE:
TEXT()->CursorRight(owner->view());
TEXT()->cursorRight(owner->view());
owner->view()->setState();
owner->showState();
break;
case LFUN_RIGHT:
if (!TEXT()->cursor.par()->isRightToLeftPar(owner->buffer()->params)) {
TEXT()->CursorRight(owner->view());
TEXT()->cursorRight(owner->view());
moveCursorUpdate(true, false);
owner->showState();
}
return string();
case LFUN_LEFT:
if (TEXT()->cursor.par()->isRightToLeftPar(owner->buffer()->params)) {
TEXT()->CursorRight(owner->view());
TEXT()->cursorRight(owner->view());
moveCursorUpdate(true, false);
owner->showState();
}
return string();
case LFUN_DOWN:
if (TEXT()->cursor.row()->next())
TEXT()->CursorDown(owner->view());
TEXT()->cursorDown(owner->view());
else
TEXT()->CursorRight(owner->view());
TEXT()->cursorRight(owner->view());
moveCursorUpdate(true, false);
owner->showState();
return string();
@ -744,7 +741,7 @@ string const LyXFunc::Dispatch(int ac,
if (tli == lock) {
owner->view()->unlockInset(tli);
TEXT()->CursorRight(owner->view());
TEXT()->cursorRight(owner->view());
moveCursorUpdate(true, false);
owner->showState();
} else {
@ -780,12 +777,12 @@ string const LyXFunc::Dispatch(int ac,
// ??? Needed ???
// clear the selection (if there is any)
owner->view()->toggleSelection();
TEXT()->ClearSelection(owner->view());
TEXT()->clearSelection(owner->view());
// Move cursor so that successive C-s 's will not stand in place.
if (action == LFUN_WORDFINDFORWARD )
TEXT()->CursorRightOneWord(owner->view());
TEXT()->FinishUndo();
TEXT()->cursorRightOneWord(owner->view());
TEXT()->finishUndo();
moveCursorUpdate(true, false);
// ??? Needed ???
@ -1247,12 +1244,12 @@ string const LyXFunc::Dispatch(int ac,
int id;
istr >> id;
LyXParagraph * par = TEXT()->GetParFromID(id);
Paragraph * par = TEXT()->getParFromID(id);
if (par == 0)
break;
// Set the cursor
TEXT()->SetCursor(owner->view(), par, 0);
TEXT()->setCursor(owner->view(), par, 0);
owner->view()->setState();
owner->showState();
@ -1328,6 +1325,7 @@ string const LyXFunc::Dispatch(int ac,
case LFUN_MATH_EXTERN:
case LFUN_MATH_NUMBER:
case LFUN_MATH_NONUMBER:
case LFUN_MATH_LIMITS:
{
setErrorMessage(N_("This is only allowed in math mode!"));
@ -1424,8 +1422,8 @@ string const LyXFunc::Dispatch(int ac,
fontloader.update();
// Of course we should only do the resize and the textcache.clear
// if values really changed...but not very important right now. (Lgb)
// All buffers will need resize
bufferlist.resize();
// All visible buffers will need resize
owner->resize();
// We also need to empty the textcache so that
// the buffer will be formatted correctly after
// a zoom change.
@ -1610,7 +1608,7 @@ void LyXFunc::MenuNew(bool fromTemplate)
string(lyxrc.template_path)));
FileDialog::Result result =
fileDlg.Select(initpath,
fileDlg.Select(lyxrc.template_path,
_("*.lyx|LyX Documents (*.lyx)"));
if (result.first == FileDialog::Later)

View File

@ -11,7 +11,7 @@
#include FORMS_H_LOCATION
#include "commandtags.h"
#include "kbsequence.h"
#include "insets/lyxinset.h"
#include "insets/inset.h"
#include "LString.h"
class LyXView;

View File

@ -22,7 +22,10 @@ struct compare_tags {
// used by lower_bound, sort and sorted
inline
int operator()(keyword_item const & a, keyword_item const & b) const {
return compare_no_case(a.tag, b.tag) < 0;
// we use the ascii version, because in turkish, 'i'
// is not the lowercase version of 'I', and thus
// turkish locale breaks parsing of tags.
return compare_ascii_no_case(a.tag, b.tag) < 0;
}
};
// } // end of anon namespace
@ -44,7 +47,7 @@ string const LyXLex::Pimpl::GetString() const
void LyXLex::Pimpl::printError(string const & message) const
{
string tmpmsg = subst(message, "$$Token", GetString());
string const tmpmsg = subst(message, "$$Token", GetString());
lyxerr << "LyX: " << tmpmsg << " [around line " << lineno
<< " of file " << MakeDisplayPath(name) << ']' << endl;
}
@ -170,7 +173,7 @@ bool LyXLex::Pimpl::next(bool esc /* = false */)
lyxerr[Debug::LYXLEX] << "Comment read: `" << c
<< buff << "'" << endl;
#else
// unfortunately is ignore buggy (Lgb)
// unfortunately ignore is buggy (Lgb)
is.ignore(100, '\n');
#endif
++lineno;

View File

@ -1,605 +0,0 @@
// -*- C++ -*-
/* This file is part of
* ======================================================
*
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
* Copyright 1995-2001 The LyX Team.
*
* ====================================================== */
#ifndef LYXPARAGRAPH_H
#define LYXPARAGRAPH_H
#ifdef __GNUG__
#pragma interface
#endif
#include "LString.h"
#include <vector>
#include <list>
#include <boost/array.hpp>
#include "insets/lyxinset.h"
#include "ParagraphParameters.h"
#include "support/LAssert.h"
class BufferParams;
class LyXBuffer;
class TexRow;
struct LaTeXFeatures;
class InsetBibKey;
class BufferView;
class Language;
// After 1.2.0 is released, during 1.3.0cvs, we enable this. And after
// a while we verify that reading of 1.2.x files work perfectly we remove
// this code completely. (Lgb)
//#define NO_PEXTRA_REALLY 1
// Define this if you want to try out the new storage container for
// paragraphs. std::container instead of obfuscated homegrown
// linked list. (Lgb)
// This is non working and far from finished.
// #define NO_NEXT 1
/// A LyXParagraph holds all text, attributes and insets in a text paragraph
class LyXParagraph {
public:
#ifndef NO_PEXTRA_REALLY
///
enum PEXTRA_TYPE {
///
PEXTRA_NONE,
///
PEXTRA_INDENT,
///
PEXTRA_MINIPAGE,
///
PEXTRA_FLOATFLT
};
///
enum MINIPAGE_ALIGNMENT {
///
MINIPAGE_ALIGN_TOP,
///
MINIPAGE_ALIGN_MIDDLE,
///
MINIPAGE_ALIGN_BOTTOM
};
#endif
///
enum META_KIND {
///
META_HFILL = 1,
///
META_NEWLINE,
///
META_INSET
};
///
typedef char value_type;
///
typedef std::vector<value_type> TextContainer;
///
/* This should be TextContainer::size_type, but we need
signed values for now.
*/
typedef TextContainer::difference_type size_type;
///
LyXParagraph();
/// this constructor inserts the new paragraph in a list
explicit
LyXParagraph(LyXParagraph * par);
///
LyXParagraph(LyXParagraph const &);
/// the destructor removes the new paragraph from the list
~LyXParagraph();
///
Language const * getParLanguage(BufferParams const &) const;
///
bool isRightToLeftPar(BufferParams const &) const;
///
void ChangeLanguage(BufferParams const & bparams,
Language const * from, Language const * to);
///
bool isMultiLingual(BufferParams const &);
///
string const String(Buffer const *, bool label);
///
string const String(Buffer const *, size_type beg, size_type end);
///
void writeFile(Buffer const *, std::ostream &, BufferParams const &,
char) const;
///
void validate(LaTeXFeatures &) const;
///
int id() const;
///
void id(int id_arg);
///
void read();
///
LyXParagraph * TeXOnePar(Buffer const *, BufferParams const &,
std::ostream &, TexRow & texrow,
bool moving_arg);
///
bool SimpleTeXOnePar(Buffer const *, BufferParams const &,
std::ostream &, TexRow & texrow, bool moving_arg);
///
LyXParagraph * TeXEnvironment(Buffer const *, BufferParams const &,
std::ostream &, TexRow & texrow);
///
bool HasSameLayout(LyXParagraph const * par) const;
///
void MakeSameLayout(LyXParagraph const * par);
/// Is it the first par with same depth and layout?
bool IsFirstInSequence() const;
/** Check if the current paragraph is the last paragraph in a
proof environment */
int GetEndLabel(BufferParams const &) const;
///
Inset * InInset();
///
void SetInsetOwner(Inset * i);
///
void deleteInsetsLyXText(BufferView *);
///
void resizeInsetsLyXText(BufferView *);
private:
///
TextContainer text;
///
Inset * inset_owner;
public:
///
inline
size_type size() const;
///
void fitToSize();
///
void setContentsFromPar(LyXParagraph * par);
///
void clearContents();
ParagraphParameters params;
///
LyXTextClass::LayoutList::size_type layout;
private:
///
boost::array<int, 10> counter_;
public:
///
void setCounter(int i, int v);
///
int getCounter(int i) const;
///
void incCounter(int i);
///
char enumdepth;
///
char itemdepth;
private:
///
LyXParagraph * next_;
///
LyXParagraph * previous_;
public:
///
InsetBibKey * bibkey; // ale970302
///
void next(LyXParagraph *);
/** these function are able to hide closed footnotes
*/
LyXParagraph * next();
///
LyXParagraph const * next() const;
///
void previous(LyXParagraph *);
///
LyXParagraph * previous();
///
LyXParagraph const * previous() const;
/// for the environments
LyXParagraph * DepthHook(int depth);
/// for the environments
LyXParagraph const * DepthHook(int depth) const;
///
int BeginningOfMainBody() const;
///
string const & GetLabelstring() const;
/// the next two functions are for the manual labels
string const GetLabelWidthString() const;
///
void SetLabelWidthString(string const & s);
///
inline
LyXTextClass::LayoutList::size_type GetLayout() const;
///
char GetAlign() const;
///
char GetDepth() const;
///
void SetLayout(LyXTextClass::LayoutList::size_type new_layout);
///
void SetOnlyLayout(LyXTextClass::LayoutList::size_type new_layout);
///
int GetFirstCounter(int i) const;
///
void Erase(size_type pos);
/** the flag determines wether the layout should be copied
*/
void BreakParagraph(BufferParams const &, size_type pos, int flag);
///
void BreakParagraphConservative(BufferParams const &, size_type pos);
/** Get unistantiated font setting. Returns the difference
between the characters font and the layoutfont.
This is what is stored in the fonttable
*/
LyXFont const
GetFontSettings(BufferParams const &, size_type pos) const;
///
LyXFont const GetFirstFontSettings() const;
/** Get fully instantiated font. If pos == -1, use the layout
font attached to this paragraph.
If pos == -2, use the label font of the layout attached here.
In all cases, the font is instantiated, i.e. does not have any
attributes with values LyXFont::INHERIT, LyXFont::IGNORE or
LyXFont::TOGGLE.
*/
LyXFont const getFont(BufferParams const &, size_type pos) const;
///
value_type GetChar(size_type pos) const;
///
value_type GetUChar(BufferParams const &, size_type pos) const;
/// The position must already exist.
void SetChar(size_type pos, value_type c);
///
void SetFont(size_type pos, LyXFont const & font);
///
string const GetWord(size_type &) const;
/// Returns the height of the highest font in range
LyXFont::FONT_SIZE HighestFontInRange(size_type startpos,
size_type endpos) const;
///
void InsertChar(size_type pos, value_type c);
///
void InsertChar(size_type pos, value_type c, LyXFont const &);
///
void InsertInset(size_type pos, Inset * inset);
///
void InsertInset(size_type pos, Inset * inset, LyXFont const &);
///
bool InsertInsetAllowed(Inset * inset);
///
Inset * GetInset(size_type pos);
///
Inset const * GetInset(size_type pos) const;
/** important for cut and paste
Temporary change from BufferParams to Buffer. Will revert when we
get rid of the argument to Inset::Clone(Buffer const &) */
void CopyIntoMinibuffer(Buffer const &, size_type pos) const;
///
void CutIntoMinibuffer(BufferParams const &, size_type pos);
///
bool InsertFromMinibuffer(size_type pos);
///
bool IsHfill(size_type pos) const;
///
bool IsInset(size_type pos) const;
///
bool IsNewline(size_type pos) const;
///
bool IsSeparator(size_type pos) const;
///
bool IsLineSeparator(size_type pos) const;
///
bool IsKomma(size_type pos) const;
/// Used by the spellchecker
bool IsLetter(size_type pos) const;
///
bool IsWord(size_type pos) const;
/** This one resets all layout and dtp switches but not the font
of the single characters
*/
void Clear();
/** paste this paragraph with the next one
be carefull, this doesent make any check at all
*/
void PasteParagraph(BufferParams const &);
/// used to remove the error messages
int AutoDeleteInsets();
/// returns -1 if inset not found
int GetPositionOfInset(Inset * inset) const;
///
int StripLeadingSpaces(LyXTextClassList::size_type tclass);
#ifndef NO_PEXTRA_REALLY
/* If I set a PExtra Indent on one paragraph of a ENV_LIST-TYPE
I have to set it on each of it's elements */
///
void SetPExtraType(BufferParams const &, int type,
string const & width, string const & widthp);
///
void UnsetPExtraType(BufferParams const &);
#endif
///
bool linuxDocConvertChar(char c, string & sgml_string);
private:
///
struct InsetTable {
///
size_type pos;
///
Inset * inset;
///
InsetTable(size_type p, Inset * i) : pos(p), inset(i) {}
};
///
friend struct matchIT;
///
struct matchIT {
/// used by lower_bound and upper_bound
inline
int operator()(LyXParagraph::InsetTable const & a,
LyXParagraph::InsetTable const & b) const {
return a.pos < b.pos;
}
};
/** A font entry covers a range of positions. Notice that the
entries in the list are inserted in random order.
I don't think it's worth the effort to implement a more effective
datastructure, because the number of different fonts in a paragraph
is limited. (Asger)
Nevertheless, I decided to store fontlist using a sorted vector:
fontlist = { {pos_1,font_1} , {pos_2,font_2} , ... } where
pos_1 < pos_2 < ..., font_{i-1} != font_i for all i,
and font_i covers the chars in positions pos_{i-1}+1,...,pos_i
(font_1 covers the chars 0,...,pos_1) (Dekel)
*/
struct FontTable {
///
FontTable(size_type p, LyXFont const & f)
: pos_(p)
{
font_ = container.get(f);
}
///
size_type pos() const { return pos_; }
///
void pos(size_type p) { pos_ = p; }
///
LyXFont const & font() const { return *font_; }
///
void font(LyXFont const & f) { font_ = container.get(f);}
private:
/// End position of paragraph this font attribute covers
size_type pos_;
/** Font. Interpretation of the font values:
If a value is LyXFont::INHERIT_*, it means that the font
attribute is inherited from either the layout of this
paragraph or, in the case of nested paragraphs, from the
layout in the environment one level up until completely
resolved.
The values LyXFont::IGNORE_* and LyXFont::TOGGLE are NOT
allowed in these font tables.
*/
boost::shared_ptr<LyXFont> font_;
///
static ShareContainer<LyXFont> container;
};
///
friend struct matchFT;
///
struct matchFT {
/// used by lower_bound and upper_bound
inline
int operator()(LyXParagraph::FontTable const & a,
LyXParagraph::FontTable const & b) const {
return a.pos() < b.pos();
}
};
///
typedef std::vector<FontTable> FontList;
///
FontList fontlist;
///
typedef std::vector<InsetTable> InsetList;
///
InsetList insetlist;
///
LyXParagraph * TeXDeeper(Buffer const *, BufferParams const &,
std::ostream &, TexRow & texrow);
///
void SimpleTeXBlanks(std::ostream &, TexRow & texrow,
size_type const i,
int & column, LyXFont const & font,
LyXLayout const & style);
///
void SimpleTeXSpecialChars(Buffer const *, BufferParams const &,
std::ostream &, TexRow & texrow,
bool moving_arg,
LyXFont & font, LyXFont & running_font,
LyXFont & basefont, bool & open_font,
LyXLayout const & style,
size_type & i,
int & column, value_type const c);
///
unsigned int id_;
///
static unsigned int paragraph_id;
public:
///
class inset_iterator {
public:
///
inset_iterator() {}
//
inset_iterator(InsetList::iterator const & iter) : it(iter) {};
///
inset_iterator & operator++() {
++it;
return *this;
}
///
Inset * operator*() { return (*it).inset; }
///
size_type getPos() const {return (*it).pos; }
///
bool operator==(inset_iterator const & iter) const {
return it == iter.it;
}
///
bool operator!=(inset_iterator const & iter) const {
return it != iter.it;
}
private:
///
InsetList::iterator it;
};
///
inset_iterator inset_iterator_begin();
///
inset_iterator inset_iterator_end();
///
inset_iterator InsetIterator(size_type pos);
};
inline
LyXParagraph::size_type LyXParagraph::size() const
{
return text.size();
}
inline
LyXParagraph::value_type
LyXParagraph::GetChar(LyXParagraph::size_type pos) const
{
lyx::Assert(pos <= size());
// This is stronger, and I belive that this is the assertion
// that we should really use. (Lgb)
//Assert(pos < size());
// Then this has no meaning. (Lgb)
if (!size() || pos == size()) return '\0';
return text[pos];
}
inline
int LyXParagraph::id() const
{
return id_;
}
inline
void LyXParagraph::id(int id_arg)
{
id_ = id_arg;
}
inline
LyXTextClass::size_type LyXParagraph::GetLayout() const
{
return layout;
}
inline
bool LyXParagraph::IsFirstInSequence() const
{
LyXParagraph const * dhook = DepthHook(GetDepth());
return (dhook == this
|| dhook->GetLayout() != GetLayout()
|| dhook->GetDepth() != GetDepth());
}
inline
Inset * LyXParagraph::InInset()
{
return inset_owner;
}
inline
void LyXParagraph::clearContents()
{
text.clear();
}
inline
void LyXParagraph::setCounter(int i, int v)
{
counter_[i] = v;
}
inline
int LyXParagraph::getCounter(int i) const
{
return counter_[i];
}
inline
void LyXParagraph::incCounter(int i)
{
counter_[i]++;
}
inline
void LyXParagraph::SetChar(size_type pos, value_type c)
{
text[pos] = c;
}
inline
LyXParagraph::inset_iterator LyXParagraph::inset_iterator_begin()
{
return inset_iterator(insetlist.begin());
}
inline
LyXParagraph::inset_iterator LyXParagraph::inset_iterator_end()
{
return inset_iterator(insetlist.end());
}
#endif

View File

@ -23,19 +23,19 @@ Row::Row()
{}
void Row::par(LyXParagraph * p)
void Row::par(Paragraph * p)
{
par_ = p;
}
void Row::pos(LyXParagraph::size_type p)
void Row::pos(Paragraph::size_type p)
{
pos_ = p;
}
LyXParagraph::size_type Row::pos() const
Paragraph::size_type Row::pos() const
{
return pos_;
}

Some files were not shown because too many files have changed in this diff Show More