mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 05:16:21 +00:00
ws cleanup
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3803 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
a654de29ea
commit
8283e978f8
@ -1,8 +1,8 @@
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
*
|
||||
* Copyright 1995 Matthias Ettrich
|
||||
* Copyright 1995-2001 The LyX Team.
|
||||
*
|
||||
@ -53,7 +53,7 @@ LyXView * BufferView::owner() const
|
||||
}
|
||||
|
||||
|
||||
Painter & BufferView::painter()
|
||||
Painter & BufferView::painter()
|
||||
{
|
||||
return pimpl_->painter();
|
||||
}
|
||||
@ -199,19 +199,19 @@ void BufferView::insetUnlock()
|
||||
|
||||
bool BufferView::focus() const
|
||||
{
|
||||
return pimpl_->focus();
|
||||
return pimpl_->focus();
|
||||
}
|
||||
|
||||
|
||||
void BufferView::focus(bool f)
|
||||
{
|
||||
pimpl_->focus(f);
|
||||
pimpl_->focus(f);
|
||||
}
|
||||
|
||||
|
||||
bool BufferView::active() const
|
||||
{
|
||||
return pimpl_->active();
|
||||
return pimpl_->active();
|
||||
}
|
||||
|
||||
|
||||
@ -221,7 +221,7 @@ int BufferView::workWidth() const
|
||||
}
|
||||
|
||||
|
||||
bool BufferView::belowMouse() const
|
||||
bool BufferView::belowMouse() const
|
||||
{
|
||||
return pimpl_->belowMouse();
|
||||
}
|
||||
@ -251,7 +251,7 @@ void BufferView::toggleToggle()
|
||||
}
|
||||
|
||||
|
||||
void BufferView::center()
|
||||
void BufferView::center()
|
||||
{
|
||||
pimpl_->center();
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ public:
|
||||
///
|
||||
CHANGE = 4
|
||||
};
|
||||
|
||||
|
||||
///
|
||||
BufferView(LyXView * owner, int , int , int, int);
|
||||
///
|
||||
@ -73,7 +73,7 @@ public:
|
||||
void updateScrollbar();
|
||||
///
|
||||
Inset * checkInsetHit(LyXText *, int & x, int & y);
|
||||
///
|
||||
///
|
||||
void redoCurrentBuffer();
|
||||
///
|
||||
int resizeCurrentBuffer();
|
||||
@ -81,16 +81,16 @@ public:
|
||||
void cursorPrevious(LyXText *);
|
||||
///
|
||||
void cursorNext(LyXText *);
|
||||
///
|
||||
///
|
||||
bool available() const;
|
||||
///
|
||||
LyXView * owner() const;
|
||||
///
|
||||
void beforeChange(LyXText *);
|
||||
///
|
||||
void savePosition(unsigned int i);
|
||||
///
|
||||
void restorePosition(unsigned int i);
|
||||
///
|
||||
void savePosition(unsigned int i);
|
||||
///
|
||||
void restorePosition(unsigned int i);
|
||||
///
|
||||
bool isSavedPosition(unsigned int i);
|
||||
/** This holds the mapping between buffer paragraphs and screen rows.
|
||||
@ -108,7 +108,7 @@ public:
|
||||
///
|
||||
UpdatableInset * theLockingInset() const;
|
||||
///
|
||||
void theLockingInset(UpdatableInset * inset);
|
||||
void theLockingInset(UpdatableInset * inset);
|
||||
///
|
||||
void updateInset(Inset * inset, bool mark_dirty);
|
||||
///
|
||||
@ -184,7 +184,7 @@ public:
|
||||
void toggleToggle();
|
||||
///
|
||||
void center();
|
||||
|
||||
|
||||
///
|
||||
bool focus() const;
|
||||
///
|
||||
@ -200,7 +200,7 @@ public:
|
||||
void setState();
|
||||
|
||||
///
|
||||
bool ChangeInsets(Inset::Code code, string const & from,
|
||||
bool ChangeInsets(Inset::Code code, string const & from,
|
||||
string const & to);
|
||||
///
|
||||
bool ChangeRefsIfUnique(string const & from, string const & to);
|
||||
|
@ -1,8 +1,8 @@
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
*
|
||||
* Copyright 1995 Matthias Ettrich
|
||||
* Copyright 1995-2001 The LyX Team.
|
||||
*
|
||||
@ -73,7 +73,7 @@ bool BufferView::insertLyXFile(string const & filen)
|
||||
MakeDisplayPath(fname, 50));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
beforeChange(text);
|
||||
|
||||
ifstream ifs(fname.c_str());
|
||||
@ -83,9 +83,9 @@ bool BufferView::insertLyXFile(string const & filen)
|
||||
MakeDisplayPath(fname, 50));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
int const c = ifs.peek();
|
||||
|
||||
|
||||
LyXLex lex(0, 0);
|
||||
lex.setStream(ifs);
|
||||
|
||||
@ -95,7 +95,7 @@ bool BufferView::insertLyXFile(string const & filen)
|
||||
lyxerr[Debug::INFO] << "Will insert file with header" << endl;
|
||||
res = buffer()->readFile(lex, text->cursor.par());
|
||||
} else {
|
||||
lyxerr[Debug::INFO] << "Will insert file without header"
|
||||
lyxerr[Debug::INFO] << "Will insert file without header"
|
||||
<< endl;
|
||||
res = buffer()->readLyXformat2(lex, text->cursor.par());
|
||||
}
|
||||
@ -171,7 +171,7 @@ bool BufferView::removeAutoInsets()
|
||||
cursor_par = cursor_par_prev;
|
||||
cursor_pos = cursor_par_prev->size();
|
||||
cursor_par_prev = cursor_par->previous();
|
||||
// cursor_par_next remains the same
|
||||
// cursor_par_next remains the same
|
||||
} else if (cursor_par_next) {
|
||||
// First step below may occur before while{}
|
||||
// .
|
||||
@ -254,13 +254,13 @@ void BufferView::insertErrors(TeXErrors & terr)
|
||||
int const errorrow = cit->error_in_line;
|
||||
|
||||
// Insert error string for row number
|
||||
int tmpid = -1;
|
||||
int tmpid = -1;
|
||||
int tmppos = -1;
|
||||
|
||||
if (buffer()->texrow.getIdFromRow(errorrow, tmpid, tmppos)) {
|
||||
buffer()->texrow.increasePos(tmpid, tmppos);
|
||||
}
|
||||
|
||||
|
||||
Paragraph * texrowpar = 0;
|
||||
|
||||
if (tmpid == -1) {
|
||||
@ -285,7 +285,7 @@ void BufferView::insertErrors(TeXErrors & terr)
|
||||
|
||||
void BufferView::setCursorFromRow(int row)
|
||||
{
|
||||
int tmpid = -1;
|
||||
int tmpid = -1;
|
||||
int tmppos = -1;
|
||||
|
||||
buffer()->texrow.getIdFromRow(row, tmpid, tmppos);
|
||||
@ -356,7 +356,7 @@ void BufferView::menuRedo()
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
if (available()) {
|
||||
owner()->message(_("Redo"));
|
||||
hideCursor();
|
||||
@ -423,14 +423,14 @@ void BufferView::paste()
|
||||
toggleSelection();
|
||||
text->clearSelection();
|
||||
update(text, BufferView::SELECT|BufferView::FITCUR);
|
||||
|
||||
|
||||
// paste
|
||||
text->pasteSelection(this);
|
||||
update(text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
|
||||
// why fake a selection only I think it should be a real one and not only
|
||||
// a painted one (Jug 20020318).
|
||||
#if 0
|
||||
// clear the selection
|
||||
// clear the selection
|
||||
toggleSelection();
|
||||
text->clearSelection();
|
||||
update(text, BufferView::SELECT|BufferView::FITCUR);
|
||||
@ -438,7 +438,7 @@ void BufferView::paste()
|
||||
}
|
||||
|
||||
|
||||
/* these functions are for the spellchecker */
|
||||
/* these functions are for the spellchecker */
|
||||
string const BufferView::nextWord(float & value)
|
||||
{
|
||||
if (!available()) {
|
||||
@ -449,11 +449,11 @@ string const BufferView::nextWord(float & value)
|
||||
return text->selectNextWordToSpellcheck(this, value);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void BufferView::selectLastWord()
|
||||
{
|
||||
if (!available()) return;
|
||||
|
||||
|
||||
LyXCursor cur = text->selection.cursor;
|
||||
hideCursor();
|
||||
beforeChange(text);
|
||||
@ -467,7 +467,7 @@ void BufferView::selectLastWord()
|
||||
void BufferView::endOfSpellCheck()
|
||||
{
|
||||
if (!available()) return;
|
||||
|
||||
|
||||
hideCursor();
|
||||
beforeChange(text);
|
||||
text->selectSelectedWord(this);
|
||||
@ -483,15 +483,15 @@ void BufferView::replaceWord(string const & replacestring)
|
||||
LyXText * tt = getLyXText();
|
||||
hideCursor();
|
||||
update(tt, BufferView::SELECT|BufferView::FITCUR);
|
||||
|
||||
/* clear the selection (if there is any) */
|
||||
|
||||
/* clear the selection (if there is any) */
|
||||
toggleSelection(false);
|
||||
update(tt, BufferView::SELECT|BufferView::FITCUR);
|
||||
|
||||
/* clear the selection (if there is any) */
|
||||
|
||||
/* clear the selection (if there is any) */
|
||||
toggleSelection(false);
|
||||
tt->replaceSelectionWithString(this, replacestring);
|
||||
|
||||
|
||||
tt->setSelectionOverString(this, replacestring);
|
||||
|
||||
// Go back so that replacement string is also spellchecked
|
||||
@ -560,7 +560,7 @@ void BufferView::showLockedInsetCursor(int x, int y, int asc, int desc)
|
||||
(cursor.par()->getInset(cursor.pos() - 1) ==
|
||||
locking_inset))
|
||||
text->setCursor(this, cursor,
|
||||
cursor.par(), cursor.pos() - 1);
|
||||
cursor.par(), cursor.pos() - 1);
|
||||
LyXScreen::Cursor_Shape shape = LyXScreen::BAR_SHAPE;
|
||||
LyXText * txt = getLyXText();
|
||||
if (locking_inset->isTextInset() &&
|
||||
@ -610,7 +610,7 @@ int BufferView::unlockInset(UpdatableInset * inset)
|
||||
return 0;
|
||||
} else if (inset && theLockingInset() &&
|
||||
theLockingInset()->unlockInsetInInset(this, inset)) {
|
||||
// owner inset has updated the layout combo
|
||||
// owner inset has updated the layout combo
|
||||
finishUndo();
|
||||
return 0;
|
||||
}
|
||||
@ -625,8 +625,8 @@ void BufferView::lockedInsetStoreUndo(Undo::undo_kind kind)
|
||||
if (kind == Undo::EDIT) // in this case insets would not be stored!
|
||||
kind = Undo::FINISH;
|
||||
setUndo(this, kind,
|
||||
text->cursor.par(),
|
||||
text->cursor.par()->next());
|
||||
text->cursor.par(),
|
||||
text->cursor.par()->next());
|
||||
}
|
||||
|
||||
|
||||
@ -664,7 +664,7 @@ bool BufferView::ChangeInsets(Inset::Code code,
|
||||
need_update = true;
|
||||
|
||||
// FIXME
|
||||
|
||||
|
||||
// The test it.size()==1 was needed to prevent crashes.
|
||||
// How to set the cursor corretly when it.size()>1 ??
|
||||
if (it.size() == 1) {
|
||||
@ -696,10 +696,10 @@ bool BufferView::ChangeCitationsIfUnique(string const & from,
|
||||
string const & to)
|
||||
{
|
||||
typedef pair<string, string> StringPair;
|
||||
|
||||
vector<StringPair> keys = buffer()->getBibkeyList();
|
||||
if (count_if(keys.begin(), keys.end(),
|
||||
lyx::equal_1st_in_pair<StringPair>(from))
|
||||
|
||||
vector<StringPair> keys = buffer()->getBibkeyList();
|
||||
if (count_if(keys.begin(), keys.end(),
|
||||
lyx::equal_1st_in_pair<StringPair>(from))
|
||||
> 1)
|
||||
return false;
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -46,7 +46,7 @@ struct BufferView::Pimpl : public SigC::Object {
|
||||
void update();
|
||||
//
|
||||
void update(LyXText *, BufferView::UpdateCodes);
|
||||
/// Update pixmap of screen
|
||||
/// Update pixmap of screen
|
||||
void updateScreen();
|
||||
///
|
||||
void workAreaExpose();
|
||||
@ -60,7 +60,7 @@ struct BufferView::Pimpl : public SigC::Object {
|
||||
* If hit, the coordinates are changed relative to the inset.
|
||||
*/
|
||||
Inset * checkInsetHit(LyXText *, int & x, int & y);
|
||||
///
|
||||
///
|
||||
int scrollUp(long time);
|
||||
///
|
||||
int scrollDown(long time);
|
||||
@ -143,12 +143,12 @@ private:
|
||||
* if one exists. If so, the inset is returned, and the co-ordinates are
|
||||
* made relative. Otherwise, 0 is returned.
|
||||
*/
|
||||
Inset * checkInset(LyXText const & text, LyXCursor const & cursor, int & x, int & y) const;
|
||||
Inset * checkInset(LyXText const & text, LyXCursor const & cursor, int & x, int & y) const;
|
||||
///
|
||||
friend class BufferView;
|
||||
/// open and lock an updatable inset
|
||||
bool open_new_inset(UpdatableInset * new_inset, bool behind = false);
|
||||
///
|
||||
///
|
||||
void specialChar(InsetSpecialChar::Kind);
|
||||
///
|
||||
void newline();
|
||||
@ -201,7 +201,7 @@ private:
|
||||
std::vector<Position> saved_positions;
|
||||
///
|
||||
void moveCursorUpdate(bool selecting);
|
||||
/// Get next inset of this class from current cursor position
|
||||
/// Get next inset of this class from current cursor position
|
||||
Inset * getInsetByCode(Inset::Code code);
|
||||
///
|
||||
void MenuInsertLyXFile(string const & filen);
|
||||
|
14
src/Bullet.C
14
src/Bullet.C
@ -3,7 +3,7 @@
|
||||
* generate the bullets in the bullet-panel's.
|
||||
*
|
||||
* This file is part of
|
||||
* ======================================================
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
@ -54,7 +54,7 @@ Bullet::Bullet(int f, int c, int s)
|
||||
|
||||
|
||||
|
||||
Bullet::Bullet(string const & t)
|
||||
Bullet::Bullet(string const & t)
|
||||
: font(MIN), character(MIN), size(MIN), user_text(1), text(t)
|
||||
{
|
||||
#ifdef ENABLE_ASSERTIONS
|
||||
@ -215,7 +215,7 @@ string const Bullet::bulletSize(int s)
|
||||
// See additional comments in bulletEntry() below.
|
||||
|
||||
static char const * BulletSize[SIZEMAX] = {
|
||||
"\\tiny", "\\scriptsize", "\\footnotesize", "\\small", "\\normalsize",
|
||||
"\\tiny", "\\scriptsize", "\\footnotesize", "\\small", "\\normalsize",
|
||||
"\\large", "\\Large", "\\LARGE", "\\huge", "\\Huge"
|
||||
};
|
||||
|
||||
@ -238,10 +238,10 @@ string const Bullet::bulletEntry(int f, int c)
|
||||
// to get around a compiler bug in an earler version of gcc (< 2.7.2.1)
|
||||
// static string const BulletPanels[FONTMAX][CHARMAX] = {
|
||||
static char const * BulletPanel0[CHARMAX] = {
|
||||
/* standard */
|
||||
/* standard */
|
||||
"\\normalfont\\bfseries{--}", "\\(\\vdash\\)",
|
||||
"\\(\\dashv\\)", "\\(\\flat\\)", "\\(\\natural\\)",
|
||||
"\\(\\sharp\\)", "\\(\\ast\\)", "\\(\\star\\)",
|
||||
"\\(\\sharp\\)", "\\(\\ast\\)", "\\(\\star\\)",
|
||||
"\\(\\bullet\\)", "\\(\\circ\\)", "\\(\\cdot\\)",
|
||||
"\\(\\dagger\\)", "\\(\\bigtriangleup\\)",
|
||||
"\\(\\bigtriangledown\\)", "\\(\\triangleleft\\)",
|
||||
@ -249,9 +249,9 @@ string const Bullet::bulletEntry(int f, int c)
|
||||
"\\(\\oplus\\)", "\\(\\ominus\\)", "\\(\\otimes\\)",
|
||||
"\\(\\oslash\\)", "\\(\\odot\\)", "\\(\\spadesuit\\)",
|
||||
"\\(\\diamond\\)", "\\(\\Diamond\\)", "\\(\\Box\\)",
|
||||
"\\(\\diamondsuit\\)", "\\(\\heartsuit\\)",
|
||||
"\\(\\diamondsuit\\)", "\\(\\heartsuit\\)",
|
||||
"\\(\\clubsuit\\)", "\\(\\rightarrow\\)", "\\(\\leadsto\\)",
|
||||
"\\(\\rightharpoonup\\)", "\\(\\rightharpoondown\\)",
|
||||
"\\(\\rightharpoonup\\)", "\\(\\rightharpoondown\\)",
|
||||
"\\(\\Rightarrow\\)", "\\(\\succ\\)"
|
||||
};
|
||||
static char const * BulletPanel1[CHARMAX] = {
|
||||
|
20
src/Bullet.h
20
src/Bullet.h
@ -1,7 +1,7 @@
|
||||
// -*- C++ -*-
|
||||
/* This is the bullet class definition file.
|
||||
* This file is part of
|
||||
* ======================================================
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
@ -60,7 +60,7 @@ private:
|
||||
This enum makes adding additional panels or changing panel sizes
|
||||
easier. Since you only need change these values for all tests to
|
||||
be correct for the new values.
|
||||
|
||||
|
||||
Note: MAX means the size of the array so to test you need:
|
||||
(x < MAX) *not* (x <= MAX)
|
||||
*/
|
||||
@ -74,33 +74,33 @@ private:
|
||||
///
|
||||
SIZEMAX = 10
|
||||
};
|
||||
|
||||
|
||||
///
|
||||
void generateText() const;
|
||||
///
|
||||
static string const bulletSize(int);
|
||||
///
|
||||
static string const bulletEntry(int, int);
|
||||
|
||||
|
||||
///
|
||||
int font;
|
||||
///
|
||||
int character;
|
||||
///
|
||||
int size;
|
||||
|
||||
// size, character and font are array indices to access
|
||||
|
||||
// size, character and font are array indices to access
|
||||
// the predefined arrays of LaTeX equivalent strings.
|
||||
|
||||
|
||||
/** flag indicates if user has control of text (1)
|
||||
or if I can use it to generate strings (0)
|
||||
or have already (-1)
|
||||
*/
|
||||
mutable short user_text;
|
||||
|
||||
mutable short user_text;
|
||||
|
||||
//NOTE: Arranging these four shorts above to be together
|
||||
// like this should ensure they are in a single cache line
|
||||
|
||||
|
||||
/** text may contain a user-defined LaTeX symbol command
|
||||
or one generated internally from the font, character
|
||||
and size settings.
|
||||
|
@ -1,5 +1,7 @@
|
||||
2002-03-21 Lars Gullik Bjønnes <larsbj@birdstep.com>
|
||||
|
||||
* most files: ws cleanup
|
||||
|
||||
* buffer.[Ch]: ws changes
|
||||
|
||||
* Makefile.am (LYX_CONV_LIBS): remove ld -r stuff.
|
||||
|
10
src/Chktex.C
10
src/Chktex.C
@ -1,14 +1,14 @@
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
* Copyright 1995 Matthias Ettrich
|
||||
* Copyright 1995-2001 The LyX Team.
|
||||
*
|
||||
* This file is Copyright 1997-1998
|
||||
* Asger Alstrup
|
||||
*
|
||||
* ======================================================
|
||||
* ======================================================
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
@ -49,7 +49,7 @@ int Chktex::run(TeXErrors &terr)
|
||||
// run bibtex
|
||||
string log = OnlyFilename(ChangeExtension(file, ".log"));
|
||||
string tmp = cmd + " -q -v0 -b0 -x " + file + " -o " + log;
|
||||
Systemcall one;
|
||||
Systemcall one;
|
||||
int result= one.startscript(Systemcall::Wait, tmp);
|
||||
if (result == 0) {
|
||||
result = scanLogFile(terr);
|
||||
|
10
src/Chktex.h
10
src/Chktex.h
@ -1,7 +1,7 @@
|
||||
// -*- C++ -*-
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
* Copyright 1995 Matthias Ettrich
|
||||
@ -10,7 +10,7 @@
|
||||
* This file is Copyright 1997
|
||||
* Asger Alstrup
|
||||
*
|
||||
* ======================================================
|
||||
* ======================================================
|
||||
*/
|
||||
|
||||
#ifndef CHKTEX_H
|
||||
@ -35,7 +35,7 @@ public:
|
||||
*/
|
||||
Chktex(string const & cmd, string const & file,
|
||||
string const & path);
|
||||
|
||||
|
||||
/** Runs chktex.
|
||||
@return -1 if fail, number of messages otherwise.
|
||||
*/
|
||||
@ -49,7 +49,7 @@ private:
|
||||
|
||||
///
|
||||
string file;
|
||||
|
||||
|
||||
///
|
||||
string path;
|
||||
};
|
||||
|
@ -1,8 +1,8 @@
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
*
|
||||
* Copyright 1998-2001 The LyX Team
|
||||
*
|
||||
*======================================================*/
|
||||
@ -25,14 +25,14 @@
|
||||
using std::endl;
|
||||
|
||||
|
||||
LyXColorHandler::LyXColorHandler()
|
||||
LyXColorHandler::LyXColorHandler()
|
||||
{
|
||||
display = GUIRunTime::x11Display();
|
||||
drawable = XCreatePixmap(display,
|
||||
RootWindow(display, GUIRunTime::x11Screen()),
|
||||
10, 10,
|
||||
GUIRunTime::x11VisualDepth());
|
||||
|
||||
|
||||
colormap = GUIRunTime::x11Colormap();
|
||||
// Clear the GC cache
|
||||
for (int i = 0; i <= LColor::ignore; ++i) {
|
||||
@ -72,8 +72,8 @@ GC LyXColorHandler::getGCForeground(LColor::color c)
|
||||
//if (lyxerr.debugging()) {
|
||||
// lyxerr << "Painter drawable: " << drawable() << endl;
|
||||
//}
|
||||
|
||||
if (colorGCcache[c] != 0)
|
||||
|
||||
if (colorGCcache[c] != 0)
|
||||
return colorGCcache[c];
|
||||
|
||||
XColor xcol;
|
||||
@ -83,7 +83,7 @@ GC LyXColorHandler::getGCForeground(LColor::color c)
|
||||
|
||||
// Look up the RGB values for the color, and an approximate
|
||||
// color that we can hope to get on this display.
|
||||
if (XLookupColor(display, colormap, s.c_str(), &xcol, &ccol) == 0) {
|
||||
if (XLookupColor(display, colormap, s.c_str(), &xcol, &ccol) == 0) {
|
||||
lyxerr << _("LyX: Unknown X11 color ") << s
|
||||
<< _(" for ") << lcolor.getGUIName(c) << '\n'
|
||||
<< _(" Using black instead, sorry!") << endl;
|
||||
@ -94,7 +94,7 @@ GC LyXColorHandler::getGCForeground(LColor::color c)
|
||||
} else if (XAllocColor(display, colormap, &xcol) != 0) {
|
||||
if (lyxerr.debugging(Debug::GUI)) {
|
||||
lyxerr << _("LyX: X11 color ") << s
|
||||
<< _(" allocated for ")
|
||||
<< _(" allocated for ")
|
||||
<< lcolor.getGUIName(c) << endl;
|
||||
}
|
||||
val.foreground = xcol.pixel;
|
||||
@ -120,13 +120,13 @@ GC LyXColorHandler::getGCForeground(LColor::color c)
|
||||
double closest_distance = 1e20; // we want to minimize this
|
||||
double distance = 0;
|
||||
for (int t = 0; t < vi->map_entries; ++t) {
|
||||
// The Euclidean distance between two points in
|
||||
// The Euclidean distance between two points in
|
||||
// a three-dimensional space, the RGB color-cube,
|
||||
// is used as the distance measurement between two
|
||||
// colors.
|
||||
|
||||
// Since square-root is monotonous, we don't have to
|
||||
// take the square-root to find the minimum, and thus
|
||||
// take the square-root to find the minimum, and thus
|
||||
// we use the squared distance instead to be faster.
|
||||
|
||||
// If we want to get fancy, we could convert the RGB
|
||||
@ -140,17 +140,17 @@ GC LyXColorHandler::getGCForeground(LColor::color c)
|
||||
closest_pixel = t;
|
||||
}
|
||||
}
|
||||
lyxerr << _("LyX: Couldn't allocate '") << s
|
||||
lyxerr << _("LyX: Couldn't allocate '") << s
|
||||
<< _("' for ") << lcolor.getGUIName(c)
|
||||
<< _(" with (r,g,b)=(")
|
||||
<< _(" with (r,g,b)=(")
|
||||
<< xcol.red << "," << xcol.green << ","
|
||||
<< xcol.blue << ").\n"
|
||||
<< _(" Using closest allocated "
|
||||
"color with (r,g,b)=(")
|
||||
"color with (r,g,b)=(")
|
||||
<< cmap[closest_pixel].red << ","
|
||||
<< cmap[closest_pixel].green << ","
|
||||
<< cmap[closest_pixel].blue << _(") instead.\n")
|
||||
<< _("Pixel [") << closest_pixel << _("] is used.")
|
||||
<< _("Pixel [") << closest_pixel << _("] is used.")
|
||||
<< endl;
|
||||
val.foreground = cmap[closest_pixel].pixel;
|
||||
}
|
||||
@ -168,7 +168,7 @@ GC LyXColorHandler::getGCLinepars(PainterBase::line_style ls,
|
||||
//if (lyxerr.debugging()) {
|
||||
// lyxerr << "Painter drawable: " << drawable() << endl;
|
||||
//}
|
||||
|
||||
|
||||
int index = lw + (ls << 1) + (c << 6);
|
||||
|
||||
LineGCCache::iterator it = lineGCcache.find(index);
|
||||
@ -177,7 +177,7 @@ GC LyXColorHandler::getGCLinepars(PainterBase::line_style ls,
|
||||
|
||||
XGCValues val;
|
||||
XGetGCValues(display, getGCForeground(c), GCForeground, &val);
|
||||
|
||||
|
||||
switch (lw) {
|
||||
case PainterBase::line_thin:
|
||||
val.line_width = 0;
|
||||
@ -186,7 +186,7 @@ GC LyXColorHandler::getGCLinepars(PainterBase::line_style ls,
|
||||
val.line_width = 2;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
switch (ls) {
|
||||
case PainterBase::line_solid:
|
||||
val.line_style = LineSolid;
|
||||
@ -205,8 +205,8 @@ GC LyXColorHandler::getGCLinepars(PainterBase::line_style ls,
|
||||
val.function = GXcopy;
|
||||
|
||||
return lineGCcache[index] =
|
||||
XCreateGC(display, drawable,
|
||||
GCForeground | GCLineStyle | GCLineWidth |
|
||||
XCreateGC(display, drawable,
|
||||
GCForeground | GCLineStyle | GCLineWidth |
|
||||
GCCapStyle | GCJoinStyle | GCFunction, &val);
|
||||
}
|
||||
|
||||
@ -236,7 +236,7 @@ void LyXColorHandler::updateColor (LColor::color c)
|
||||
PainterBase::line_width(lw), c);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -1,9 +1,9 @@
|
||||
// -*- C++ -*-
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
*
|
||||
* Copyright 1995-2001 The LyX Team
|
||||
*
|
||||
* ======================================================*/
|
||||
|
@ -1,8 +1,8 @@
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
*
|
||||
* Copyright 1995-2001 The LyX Team.
|
||||
*
|
||||
* ====================================================== */
|
||||
@ -65,9 +65,9 @@ void DeleteBuffer()
|
||||
{
|
||||
if (!buf)
|
||||
return;
|
||||
|
||||
|
||||
Paragraph * tmppar;
|
||||
|
||||
|
||||
while (buf) {
|
||||
tmppar = buf;
|
||||
buf = buf->next();
|
||||
@ -80,17 +80,17 @@ void DeleteBuffer()
|
||||
|
||||
|
||||
bool CutAndPaste::cutSelection(Paragraph * startpar, Paragraph ** endpar,
|
||||
int start, int & end, char tc, bool doclear,
|
||||
int start, int & end, char tc, bool doclear,
|
||||
bool realcut)
|
||||
{
|
||||
if (!startpar || (start > startpar->size()))
|
||||
return false;
|
||||
|
||||
|
||||
if (realcut)
|
||||
DeleteBuffer();
|
||||
|
||||
|
||||
textclass = tc;
|
||||
|
||||
|
||||
if (!(*endpar) || startpar == (*endpar)) {
|
||||
// only within one paragraph
|
||||
if (realcut) {
|
||||
@ -103,7 +103,7 @@ bool CutAndPaste::cutSelection(Paragraph * startpar, Paragraph ** endpar,
|
||||
for (; i < end; ++i) {
|
||||
if (realcut)
|
||||
startpar->copyIntoMinibuffer(*current_view->buffer(),
|
||||
start);
|
||||
start);
|
||||
startpar->erase(start);
|
||||
if (realcut)
|
||||
buf->insertFromMinibuffer(buf->size());
|
||||
@ -112,13 +112,13 @@ bool CutAndPaste::cutSelection(Paragraph * startpar, Paragraph ** endpar,
|
||||
} else {
|
||||
// more than one paragraph
|
||||
(*endpar)->breakParagraphConservative(current_view->buffer()->params,
|
||||
end);
|
||||
end);
|
||||
*endpar = (*endpar)->next();
|
||||
end = 0;
|
||||
|
||||
|
||||
startpar->breakParagraphConservative(current_view->buffer()->params,
|
||||
start);
|
||||
|
||||
start);
|
||||
|
||||
// store the selection
|
||||
if (realcut) {
|
||||
buf = startpar->next();
|
||||
@ -127,12 +127,12 @@ bool CutAndPaste::cutSelection(Paragraph * startpar, Paragraph ** endpar,
|
||||
startpar->next()->previous(0);
|
||||
}
|
||||
(*endpar)->previous()->next(0);
|
||||
|
||||
|
||||
// cut the selection
|
||||
startpar->next(*endpar);
|
||||
|
||||
|
||||
(*endpar)->previous(startpar);
|
||||
|
||||
|
||||
// the cut selection should begin with standard layout
|
||||
if (realcut) {
|
||||
buf->params().clear();
|
||||
@ -160,15 +160,15 @@ bool CutAndPaste::cutSelection(Paragraph * startpar, Paragraph ** endpar,
|
||||
|
||||
|
||||
bool CutAndPaste::copySelection(Paragraph * startpar, Paragraph * endpar,
|
||||
int start, int end, char tc)
|
||||
int start, int end, char tc)
|
||||
{
|
||||
if (!startpar || (start > startpar->size()))
|
||||
return false;
|
||||
|
||||
|
||||
DeleteBuffer();
|
||||
|
||||
|
||||
textclass = tc;
|
||||
|
||||
|
||||
if (!endpar || startpar == endpar) {
|
||||
// only within one paragraph
|
||||
buf = new Paragraph;
|
||||
@ -186,7 +186,7 @@ bool CutAndPaste::copySelection(Paragraph * startpar, Paragraph * endpar,
|
||||
Paragraph * tmppar = startpar;
|
||||
buf = new Paragraph(*tmppar, false);
|
||||
Paragraph * tmppar2 = buf;
|
||||
|
||||
|
||||
while (tmppar != endpar
|
||||
&& tmppar->next()) {
|
||||
tmppar = tmppar->next();
|
||||
@ -195,12 +195,12 @@ bool CutAndPaste::copySelection(Paragraph * startpar, Paragraph * endpar,
|
||||
tmppar2 = tmppar2->next();
|
||||
}
|
||||
tmppar2->next(0);
|
||||
|
||||
|
||||
// the buf paragraph is too big
|
||||
pos_type tmpi2 = start;
|
||||
for (; tmpi2; --tmpi2)
|
||||
buf->erase(0);
|
||||
|
||||
|
||||
// now tmppar 2 is too big, delete all after end
|
||||
tmpi2 = end;
|
||||
while (tmppar2->size() > tmpi2) {
|
||||
@ -218,14 +218,14 @@ bool CutAndPaste::copySelection(Paragraph * startpar, Paragraph * endpar,
|
||||
|
||||
|
||||
bool CutAndPaste::pasteSelection(Paragraph ** par, Paragraph ** endpar,
|
||||
int & pos, char tc)
|
||||
int & pos, char tc)
|
||||
{
|
||||
if (!checkPastePossible(*par))
|
||||
return false;
|
||||
|
||||
|
||||
if (pos > (*par)->size())
|
||||
pos = (*par)->size();
|
||||
|
||||
|
||||
#if 0
|
||||
// Paragraph * tmpbuf;
|
||||
Paragraph * tmppar = *par;
|
||||
@ -235,7 +235,7 @@ bool CutAndPaste::pasteSelection(Paragraph ** par, Paragraph ** endpar,
|
||||
if (!buf->next()) {
|
||||
// only within a paragraph
|
||||
Paragraph * tmpbuf = new Paragraph(*buf, false);
|
||||
|
||||
|
||||
// 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
|
||||
@ -263,12 +263,12 @@ bool CutAndPaste::pasteSelection(Paragraph ** par, Paragraph ** endpar,
|
||||
#endif
|
||||
{
|
||||
// many paragraphs
|
||||
|
||||
|
||||
// make a copy of the simple cut_buffer
|
||||
Paragraph * tmpbuf = buf;
|
||||
Paragraph * simple_cut_clone = new Paragraph(*tmpbuf, false);
|
||||
Paragraph * tmpbuf2 = simple_cut_clone;
|
||||
|
||||
|
||||
while (tmpbuf->next()) {
|
||||
tmpbuf = tmpbuf->next();
|
||||
tmpbuf2->next(new Paragraph(*tmpbuf, false));
|
||||
@ -321,42 +321,42 @@ bool CutAndPaste::pasteSelection(Paragraph ** par, Paragraph ** endpar,
|
||||
}
|
||||
// now reset it to 0
|
||||
buf->previous(0);
|
||||
|
||||
|
||||
// make sure there is no class difference
|
||||
SwitchLayoutsBetweenClasses(textclass, tc, buf,
|
||||
current_view->buffer()->params);
|
||||
|
||||
current_view->buffer()->params);
|
||||
|
||||
// make the buf exactly the same layout than
|
||||
// the cursor paragraph
|
||||
buf->makeSameLayout(*par);
|
||||
|
||||
|
||||
// find the end of the buffer
|
||||
Paragraph * lastbuffer = buf;
|
||||
while (lastbuffer->next())
|
||||
lastbuffer = lastbuffer->next();
|
||||
|
||||
|
||||
bool paste_the_end = false;
|
||||
|
||||
|
||||
// open the paragraph for inserting the buf
|
||||
// if necessary
|
||||
if (((*par)->size() > pos) || !(*par)->next()) {
|
||||
(*par)->breakParagraphConservative(current_view->buffer()->params,
|
||||
pos);
|
||||
pos);
|
||||
paste_the_end = true;
|
||||
}
|
||||
// set the end for redoing later
|
||||
*endpar = (*par)->next()->next();
|
||||
|
||||
|
||||
// paste it!
|
||||
lastbuffer->next((*par)->next());
|
||||
(*par)->next()->previous(lastbuffer);
|
||||
|
||||
|
||||
(*par)->next(buf);
|
||||
buf->previous(*par);
|
||||
|
||||
|
||||
if ((*par)->next() == lastbuffer)
|
||||
lastbuffer = *par;
|
||||
|
||||
|
||||
(*par)->pasteParagraph(current_view->buffer()->params);
|
||||
// store the new cursor position
|
||||
*par = lastbuffer;
|
||||
@ -377,7 +377,7 @@ bool CutAndPaste::pasteSelection(Paragraph ** par, Paragraph ** endpar,
|
||||
// restore the simple cut buffer
|
||||
buf = simple_cut_clone;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -386,7 +386,7 @@ int CutAndPaste::nrOfParagraphs()
|
||||
{
|
||||
if (!buf)
|
||||
return 0;
|
||||
|
||||
|
||||
int n = 1;
|
||||
Paragraph * tmppar = buf;
|
||||
while (tmppar->next()) {
|
||||
@ -411,9 +411,9 @@ int CutAndPaste::SwitchLayoutsBetweenClasses(textclass_type c1,
|
||||
par = *it;
|
||||
string const name = par->layout();
|
||||
LyXTextClass const & tclass = textclasslist[c2];
|
||||
|
||||
|
||||
bool hasLayout = tclass.hasLayout(name);
|
||||
|
||||
|
||||
string lay = tclass.defaultLayoutName();
|
||||
if (hasLayout) {
|
||||
lay = name;
|
||||
@ -422,7 +422,7 @@ int CutAndPaste::SwitchLayoutsBetweenClasses(textclass_type c1,
|
||||
lay = tclass.defaultLayoutName();
|
||||
}
|
||||
par->layout(lay);
|
||||
|
||||
|
||||
if (name != par->layout()) {
|
||||
++ret;
|
||||
string const s = _("Layout had to be changed from\n")
|
||||
@ -447,6 +447,6 @@ int CutAndPaste::SwitchLayoutsBetweenClasses(textclass_type c1,
|
||||
bool CutAndPaste::checkPastePossible(Paragraph *)
|
||||
{
|
||||
if (!buf) return false;
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -1,9 +1,9 @@
|
||||
// -*- C++ -*-
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
*
|
||||
* Copyright 1995-2001 the LyX Team.
|
||||
*
|
||||
* ====================================================== */
|
||||
@ -40,13 +40,13 @@ public:
|
||||
static
|
||||
int nrOfParagraphs();
|
||||
/** needed to switch between different classes this works
|
||||
for a list of paragraphs beginning with the specified par
|
||||
for a list of paragraphs beginning with the specified par
|
||||
return value is the number of wrong conversions
|
||||
*/
|
||||
static
|
||||
int SwitchLayoutsBetweenClasses(lyx::textclass_type class1,
|
||||
lyx::textclass_type class2,
|
||||
Paragraph * par,
|
||||
lyx::textclass_type class2,
|
||||
Paragraph * par,
|
||||
BufferParams const & bparams);
|
||||
///
|
||||
static
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
* Copyright 1995 Matthias Ettrich
|
||||
* Copyright 1995-2001 The LyX Team.
|
||||
@ -9,7 +9,7 @@
|
||||
* Lars Gullik Bjønnes
|
||||
* Ben Stanley
|
||||
*
|
||||
* ======================================================
|
||||
* ======================================================
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
@ -68,7 +68,7 @@ void DepTable::insert(string const & fi, bool upd)
|
||||
lyxerr[Debug::DEPEND] << " Already in DepTable" << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void DepTable::update()
|
||||
{
|
||||
@ -94,13 +94,13 @@ void DepTable::update()
|
||||
// file doesn't exist
|
||||
// remove stale files - if it's re-created, it
|
||||
// will be re-inserted by deplog.
|
||||
lyxerr[Debug::DEPEND] << itr->first
|
||||
lyxerr[Debug::DEPEND] << itr->first
|
||||
<< " doesn't exist. removing from DepTable." << endl;
|
||||
DepList::iterator doomed = itr++;
|
||||
deplist.erase(doomed);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if (lyxerr.debugging(Debug::DEPEND)) {
|
||||
if (di.changed())
|
||||
lyxerr << " +";
|
||||
@ -238,7 +238,7 @@ void DepTable::read(string const & f)
|
||||
dep_info di;
|
||||
// This doesn't change through the loop.
|
||||
di.crc_prev = 0;
|
||||
|
||||
|
||||
while (ifs >> nome >> di.crc_cur >> di.mtime_cur) {
|
||||
if (lyxerr.debugging(Debug::DEPEND)) {
|
||||
lyxerr << "Read dep: "
|
||||
@ -249,4 +249,3 @@ void DepTable::read(string const & f)
|
||||
deplist[nome] = di;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,16 +1,16 @@
|
||||
// -*- C++ -*-
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
* Copyright 1995 Matthias Ettrich
|
||||
* Copyright 1995-2001 The LyX Team.
|
||||
*
|
||||
*
|
||||
* This file is Copyright 1996-2001
|
||||
* Lars Gullik Bjønnes
|
||||
* Ben Stanley
|
||||
*
|
||||
* ======================================================
|
||||
* ======================================================
|
||||
*/
|
||||
|
||||
#ifndef DEP_TABLE_H
|
||||
@ -71,4 +71,3 @@ private:
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -27,7 +27,7 @@ FloatList::FloatList()
|
||||
{
|
||||
// Insert the latex builtin float-types
|
||||
// (these will later be read from a layout file)
|
||||
|
||||
|
||||
// table
|
||||
Floating table("table", "htbp", "lot", "", "plain", "Table", true);
|
||||
newFloat(table);
|
||||
@ -35,7 +35,7 @@ FloatList::FloatList()
|
||||
// figure
|
||||
Floating figure("figure", "htbp", "lof", "", "plain", "Figure", true);
|
||||
newFloat(figure);
|
||||
|
||||
|
||||
// And we add algorithm too since LyX has
|
||||
// supported that for a long time,
|
||||
// but support for this should probably be moved to a layout file.
|
||||
@ -45,13 +45,13 @@ FloatList::FloatList()
|
||||
}
|
||||
|
||||
|
||||
FloatList::const_iterator FloatList::begin() const
|
||||
FloatList::const_iterator FloatList::begin() const
|
||||
{
|
||||
return list.begin();
|
||||
}
|
||||
|
||||
|
||||
FloatList::const_iterator FloatList::end() const
|
||||
FloatList::const_iterator FloatList::end() const
|
||||
{
|
||||
return list.end();
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
// -*- C++ -*-
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
* Copyright 1998-2001 The LyX Team.
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
* Copyright 1998-2001 The LyX Team.
|
||||
@ -17,7 +17,7 @@
|
||||
#include "Floating.h"
|
||||
|
||||
|
||||
Floating::Floating()
|
||||
Floating::Floating()
|
||||
{}
|
||||
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
// -*- C++ -*-
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
* Copyright 1998-2001 The LyX Team.
|
||||
|
@ -1,8 +1,8 @@
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
*
|
||||
* Copyright 1997 Asger Alstrup
|
||||
* and the LyX Team.
|
||||
*
|
||||
@ -67,13 +67,13 @@ string const FontInfo::getFontname(int size)
|
||||
|
||||
// We use the closest match
|
||||
lyxerr[Debug::FONT] << "Using closest font match to get size "
|
||||
<< size
|
||||
<< size
|
||||
<< " with\n" << strings[closestind] << endl;
|
||||
return strings[closestind];
|
||||
}
|
||||
|
||||
|
||||
/// Build newly sized font string
|
||||
/// Build newly sized font string
|
||||
string const FontInfo::resize(string const & font, int size) const
|
||||
{
|
||||
string ret(font);
|
||||
@ -134,7 +134,7 @@ void FontInfo::query()
|
||||
for (int i = 0; i < matches; ++i) {
|
||||
string name(list[i]);
|
||||
lyxerr[Debug::FONT] << "match #" << i << " "
|
||||
<< name << endl;
|
||||
<< name << endl;
|
||||
sizes[i] = lyx::atoi(token(name, '-', 7));
|
||||
strings[i] = name;
|
||||
if (sizes[i] == 0) {
|
||||
|
@ -1,16 +1,16 @@
|
||||
// -*- C++ -*-
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
*
|
||||
* Copyright 1997 Asger Alstrup
|
||||
* and the LyX Team.
|
||||
*
|
||||
* ====================================================== */
|
||||
|
||||
#ifndef FONTINFO_H
|
||||
#define FONTINFO_H
|
||||
#define FONTINFO_H
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface
|
||||
@ -21,7 +21,7 @@
|
||||
#include <boost/smart_ptr.hpp>
|
||||
|
||||
/** This class manages a font.
|
||||
The idea is to create a FontInfo object with a font name pattern with a
|
||||
The idea is to create a FontInfo object with a font name pattern with a
|
||||
wildcard at the size field. Then this object can host request for font-
|
||||
instances of any given size. If no exact match is found, the closest size
|
||||
is chosen instead. If the font is scalable, the flag
|
||||
@ -86,7 +86,7 @@ private:
|
||||
/// Ask X11 about this font pattern
|
||||
void query();
|
||||
|
||||
/// Build newly sized font string
|
||||
/// Build newly sized font string
|
||||
string const resize(string const &, int size) const;
|
||||
};
|
||||
#endif
|
||||
|
@ -1,8 +1,8 @@
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
*
|
||||
* Copyright 1997 Asger Alstrup
|
||||
* and the LyX Team.
|
||||
*
|
||||
@ -72,7 +72,7 @@ void FontLoader::reset()
|
||||
|
||||
|
||||
// Unload all fonts
|
||||
void FontLoader::unload()
|
||||
void FontLoader::unload()
|
||||
{
|
||||
// Unload all fonts
|
||||
for (int i1 = 0; i1 < LyXFont::NUM_FAMILIES; ++i1)
|
||||
@ -95,8 +95,8 @@ void FontLoader::unload()
|
||||
// Get font info
|
||||
/* Takes care of finding which font that can match the given request. Tries
|
||||
different alternatives. */
|
||||
void FontLoader::getFontinfo(LyXFont::FONT_FAMILY family,
|
||||
LyXFont::FONT_SERIES series,
|
||||
void FontLoader::getFontinfo(LyXFont::FONT_FAMILY family,
|
||||
LyXFont::FONT_SERIES series,
|
||||
LyXFont::FONT_SHAPE shape)
|
||||
{
|
||||
// Do we have the font info already?
|
||||
@ -104,7 +104,7 @@ void FontLoader::getFontinfo(LyXFont::FONT_FAMILY family,
|
||||
return;
|
||||
|
||||
// Special fonts
|
||||
switch (family)
|
||||
switch (family)
|
||||
{
|
||||
case LyXFont::SYMBOL_FAMILY:
|
||||
fontinfo[family][series][shape] =
|
||||
@ -137,19 +137,19 @@ void FontLoader::getFontinfo(LyXFont::FONT_FAMILY family,
|
||||
return;
|
||||
|
||||
case LyXFont::MSB_FAMILY:
|
||||
fontinfo[family][series][shape] =
|
||||
fontinfo[family][series][shape] =
|
||||
new FontInfo("-*-msbm10-*-*-*-*-*-*-*-*-*-*-*-*");
|
||||
return;
|
||||
|
||||
case LyXFont::EUFRAK_FAMILY:
|
||||
fontinfo[family][series][shape] =
|
||||
fontinfo[family][series][shape] =
|
||||
new FontInfo("-*-eufm10-medium-*-*-*-*-*-*-*-*-*-*-*");
|
||||
return;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Normal font. Let's search for an existing name that matches.
|
||||
string ffamily;
|
||||
@ -259,19 +259,19 @@ bool dummyXFontStructisGood = false;
|
||||
} // namespace anon
|
||||
|
||||
/// Do load font
|
||||
XFontStruct * FontLoader::doLoad(LyXFont::FONT_FAMILY family,
|
||||
LyXFont::FONT_SERIES series,
|
||||
LyXFont::FONT_SHAPE shape,
|
||||
XFontStruct * FontLoader::doLoad(LyXFont::FONT_FAMILY family,
|
||||
LyXFont::FONT_SERIES series,
|
||||
LyXFont::FONT_SHAPE shape,
|
||||
LyXFont::FONT_SIZE size)
|
||||
{
|
||||
if (!lyxrc.use_gui) {
|
||||
if (!dummyXFontStructisGood) {
|
||||
// no character specific info
|
||||
dummyXFontStruct.per_char = 0;
|
||||
dummyXFontStruct.per_char = 0;
|
||||
// unit ascent on character displays
|
||||
dummyXFontStruct.ascent = 1;
|
||||
dummyXFontStruct.ascent = 1;
|
||||
// no descent on character displays
|
||||
dummyXFontStruct.descent = 0;
|
||||
dummyXFontStruct.descent = 0;
|
||||
dummyXFontStructisGood = true;
|
||||
}
|
||||
|
||||
@ -279,7 +279,7 @@ XFontStruct * FontLoader::doLoad(LyXFont::FONT_FAMILY family,
|
||||
}
|
||||
|
||||
getFontinfo(family, series, shape);
|
||||
int fsize = int((lyxrc.font_sizes[size] * lyxrc.dpi *
|
||||
int fsize = int((lyxrc.font_sizes[size] * lyxrc.dpi *
|
||||
(lyxrc.zoom/100.0)) / 72.27 + 0.5);
|
||||
|
||||
string font = fontinfo[family][series][shape]->getFontname(fsize);
|
||||
@ -295,7 +295,7 @@ XFontStruct * FontLoader::doLoad(LyXFont::FONT_FAMILY family,
|
||||
current_view->owner()->messagePush(_("Loading font into X-Server..."));
|
||||
|
||||
fs = XLoadQueryFont(GUIRunTime::x11Display(), font.c_str());
|
||||
|
||||
|
||||
if (fs == 0) {
|
||||
if (font == "fixed") {
|
||||
lyxerr << "We're doomed. Can't get 'fixed' font." << endl;
|
||||
@ -315,7 +315,7 @@ XFontStruct * FontLoader::doLoad(LyXFont::FONT_FAMILY family,
|
||||
f.setUnderbar(LyXFont::INHERIT);
|
||||
f.setNoun(LyXFont::INHERIT);
|
||||
f.setColor(LColor::inherit);
|
||||
lyxerr << "Font '" << f.stateText(0)
|
||||
lyxerr << "Font '" << f.stateText(0)
|
||||
<< "' matched by\n" << font << endl;
|
||||
}
|
||||
|
||||
|
@ -1,16 +1,16 @@
|
||||
// -*- C++ -*-
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
*
|
||||
* Copyright 1997 Asger Alstrup
|
||||
* and the LyX Team.
|
||||
* and the LyX Team.
|
||||
*
|
||||
* ====================================================== */
|
||||
|
||||
#ifndef FONTLOADER_H_
|
||||
#define FONTLOADER_H_
|
||||
#define FONTLOADER_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface
|
||||
@ -22,10 +22,10 @@
|
||||
|
||||
class FontInfo;
|
||||
|
||||
/** This class takes care of loading fonts. It uses FontInfo to make
|
||||
intelligent guesses about matching font size, and it tries different tags
|
||||
itself in order to match the font loading demands. Later, I plan to extend
|
||||
this with support for T1Lib, probably via a new class building on this.
|
||||
/** This class takes care of loading fonts. It uses FontInfo to make
|
||||
intelligent guesses about matching font size, and it tries different tags
|
||||
itself in order to match the font loading demands. Later, I plan to extend
|
||||
this with support for T1Lib, probably via a new class building on this.
|
||||
(Asger) */
|
||||
class FontLoader {
|
||||
public:
|
||||
@ -39,9 +39,9 @@ public:
|
||||
void update();
|
||||
|
||||
/// Load font
|
||||
XFontStruct * load(LyXFont::FONT_FAMILY family,
|
||||
LyXFont::FONT_SERIES series,
|
||||
LyXFont::FONT_SHAPE shape,
|
||||
XFontStruct * load(LyXFont::FONT_FAMILY family,
|
||||
LyXFont::FONT_SERIES series,
|
||||
LyXFont::FONT_SHAPE shape,
|
||||
LyXFont::FONT_SIZE size) {
|
||||
if (fontstruct[family][series][shape][size] != 0)
|
||||
return fontstruct[family][series][shape][size];
|
||||
@ -50,7 +50,7 @@ public:
|
||||
};
|
||||
/// Do we have anything matching?
|
||||
bool available(LyXFont const & f);
|
||||
|
||||
|
||||
private:
|
||||
/// Array of font structs
|
||||
XFontStruct * fontstruct[LyXFont::NUM_FAMILIES][2][4][10];
|
||||
@ -65,14 +65,14 @@ private:
|
||||
void unload();
|
||||
|
||||
/// Get font info
|
||||
void getFontinfo(LyXFont::FONT_FAMILY family,
|
||||
LyXFont::FONT_SERIES series,
|
||||
void getFontinfo(LyXFont::FONT_FAMILY family,
|
||||
LyXFont::FONT_SERIES series,
|
||||
LyXFont::FONT_SHAPE shape);
|
||||
|
||||
/** Does the actual loading of a font. Updates fontstruct. */
|
||||
XFontStruct * doLoad(LyXFont::FONT_FAMILY family,
|
||||
LyXFont::FONT_SERIES series,
|
||||
LyXFont::FONT_SHAPE shape,
|
||||
XFontStruct * doLoad(LyXFont::FONT_FAMILY family,
|
||||
LyXFont::FONT_SERIES series,
|
||||
LyXFont::FONT_SHAPE shape,
|
||||
LyXFont::FONT_SIZE size);
|
||||
};
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
*
|
||||
* Copyright 2001 The LyX Team.
|
||||
*
|
||||
* ====================================================== */
|
||||
@ -50,7 +50,7 @@ bool FuncStatus::unknown () const
|
||||
FuncStatus & FuncStatus::disabled (bool b)
|
||||
{
|
||||
if (b)
|
||||
v_ |= DISABLED;
|
||||
v_ |= DISABLED;
|
||||
else
|
||||
v_ &= !DISABLED;
|
||||
return *this;
|
||||
@ -71,7 +71,7 @@ void FuncStatus::setOnOff (bool b)
|
||||
|
||||
bool FuncStatus::onoff (bool b) const
|
||||
{
|
||||
if (b)
|
||||
if (b)
|
||||
return (v_ & ON);
|
||||
else
|
||||
return (v_ & OFF);
|
||||
|
@ -34,7 +34,7 @@ public:
|
||||
FuncStatus & unknown(bool b);
|
||||
///
|
||||
bool unknown() const;
|
||||
|
||||
|
||||
///
|
||||
FuncStatus & disabled (bool b);
|
||||
///
|
||||
|
@ -1,8 +1,8 @@
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
*
|
||||
* Copyright 1998-2001 The LyX Team
|
||||
*
|
||||
*======================================================*/
|
||||
@ -125,7 +125,7 @@ string const LColor::getGUIName(LColor::color c) const
|
||||
string const LColor::getX11Name(LColor::color c) const
|
||||
{
|
||||
InfoTab::const_iterator ici = infotab.find(c);
|
||||
if (ici != infotab.end())
|
||||
if (ici != infotab.end())
|
||||
return ici->second.x11name;
|
||||
|
||||
lyxerr << "LyX internal error: Missing color"
|
||||
@ -195,7 +195,7 @@ LColor::color LColor::getFromGUIName(string const & guiname) const
|
||||
|
||||
LColor::color LColor::getFromLyXName(string const & lyxname) const
|
||||
{
|
||||
|
||||
|
||||
InfoTab::const_iterator ici = infotab.begin();
|
||||
InfoTab::const_iterator end = infotab.end();
|
||||
for (; ici != end; ++ici) {
|
||||
|
24
src/LColor.h
24
src/LColor.h
@ -1,9 +1,9 @@
|
||||
// -*- C++ -*-
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
*
|
||||
* Copyright 1998-2001 The LyX Team
|
||||
*
|
||||
*======================================================*/
|
||||
@ -20,11 +20,11 @@
|
||||
#include "LString.h"
|
||||
|
||||
/**
|
||||
This is a stateless class.
|
||||
This is a stateless class.
|
||||
|
||||
It has one basic purposes:
|
||||
To serve as a color-namespace container (the Color enum).
|
||||
|
||||
|
||||
|
||||
*/
|
||||
/**
|
||||
@ -38,7 +38,7 @@
|
||||
* - A real, predefined color, such as black, white, red or green.
|
||||
* - A logical color, such as no color, inherit, math
|
||||
*/
|
||||
|
||||
|
||||
class LColor // : public boost::noncopyable {
|
||||
// made copyable for same reasons as LyXRC was made copyable. See there for
|
||||
// explanation.
|
||||
@ -116,7 +116,7 @@ public:
|
||||
|
||||
/// caption frame color
|
||||
captionframe,
|
||||
|
||||
|
||||
/// collapsable insets text
|
||||
collapsable,
|
||||
/// collapsable insets frame
|
||||
@ -158,7 +158,7 @@ public:
|
||||
/// Color used for bottom background
|
||||
buttonbg,
|
||||
|
||||
// Logical attributes
|
||||
// Logical attributes
|
||||
|
||||
/// Color is inherited
|
||||
inherit,
|
||||
@ -172,19 +172,19 @@ public:
|
||||
void setColor(LColor::color col, string const & x11name);
|
||||
/// set the given LyX color to the color defined by the X11 name given
|
||||
bool setColor(string const & lyxname, string const & x11name);
|
||||
|
||||
|
||||
/// Get GUI name of color
|
||||
string const getGUIName(LColor::color c) const;
|
||||
|
||||
|
||||
/// Get X11 name of color
|
||||
string const getX11Name(LColor::color c) const;
|
||||
|
||||
|
||||
/// Get LaTeX name of color
|
||||
string const getLaTeXName(LColor::color c) const;
|
||||
|
||||
|
||||
/// Get LyX name of color
|
||||
string const getLyXName(LColor::color c) const;
|
||||
|
||||
|
||||
/// get the color from the GUI name
|
||||
LColor::color getFromGUIName(string const & guiname) const;
|
||||
/// get the color from the LyX name
|
||||
|
@ -1,16 +1,16 @@
|
||||
// -*- C++ -*-
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
*
|
||||
* Copyright 1995 Matthias Ettrich
|
||||
* Copyright 1995-2001 The LyX Team.
|
||||
*
|
||||
* ====================================================== */
|
||||
|
||||
#ifndef LSTRING_H
|
||||
#define LSTRING_H
|
||||
#define LSTRING_H
|
||||
|
||||
#ifndef _CONFIG_H
|
||||
#error The <config.h> header should always be included before LString.h
|
||||
|
66
src/LaTeX.C
66
src/LaTeX.C
@ -1,14 +1,14 @@
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
* Copyright 1995 Matthias Ettrich
|
||||
* Copyright 1995-2001 The LyX Team.
|
||||
*
|
||||
* This file is Copyright 1996-2001
|
||||
* Lars Gullik Bjønnes
|
||||
*
|
||||
* ======================================================
|
||||
* ======================================================
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
@ -62,7 +62,7 @@ extern BufferList bufferlist;
|
||||
void TeXErrors::insertError(int line, string const & error_desc,
|
||||
string const & error_text)
|
||||
{
|
||||
Error newerr(line, error_desc, error_text);
|
||||
Error newerr(line, error_desc, error_text);
|
||||
errors.push_back(newerr);
|
||||
}
|
||||
|
||||
@ -104,7 +104,7 @@ void LaTeX::deleteFilesOnError() const
|
||||
// makeindex file
|
||||
string ind = ChangeExtension(ofname, ".ind");
|
||||
lyx::unlink(ind);
|
||||
|
||||
|
||||
// Also remove the aux file
|
||||
string aux = ChangeExtension(ofname, ".aux");
|
||||
lyx::unlink(aux);
|
||||
@ -124,12 +124,12 @@ int LaTeX::run(TeXErrors & terr, LyXFunc * lfun)
|
||||
const unsigned int MAX_RUN = 6;
|
||||
DepTable head; // empty head
|
||||
bool rerun = false; // rerun requested
|
||||
|
||||
|
||||
// The class LaTeX does not know the temp path.
|
||||
bufferlist.updateIncludedTeXfiles(lyx::getcwd()); //GetCWD());
|
||||
|
||||
|
||||
// Never write the depfile if an error was encountered.
|
||||
|
||||
|
||||
// 0
|
||||
// first check if the file dependencies exist:
|
||||
// ->If it does exist
|
||||
@ -191,7 +191,7 @@ int LaTeX::run(TeXErrors & terr, LyXFunc * lfun)
|
||||
str << _("LaTeX run number") << ' ' << count;
|
||||
lfun->dispatch(LFUN_MESSAGE, str.str().c_str());
|
||||
}
|
||||
|
||||
|
||||
this->operator()();
|
||||
scanres = scanLogFile(terr);
|
||||
if (scanres & ERROR_RERUN) {
|
||||
@ -219,7 +219,7 @@ int LaTeX::run(TeXErrors & terr, LyXFunc * lfun)
|
||||
// And if there were undefined citations or changes in references
|
||||
// the .aux file is checked for signs of bibtex. Bibtex is then run
|
||||
// if needed.
|
||||
|
||||
|
||||
// run makeindex
|
||||
if (head.haschanged(OnlyFilename(ChangeExtension(file, ".idx")))) {
|
||||
// no checks for now
|
||||
@ -227,7 +227,7 @@ int LaTeX::run(TeXErrors & terr, LyXFunc * lfun)
|
||||
if (lfun) {
|
||||
lfun->dispatch(LFUN_MESSAGE, _("Running MakeIndex."));
|
||||
}
|
||||
|
||||
|
||||
rerun = runMakeIndex(OnlyFilename(ChangeExtension(file, ".idx")));
|
||||
}
|
||||
|
||||
@ -242,7 +242,7 @@ int LaTeX::run(TeXErrors & terr, LyXFunc * lfun)
|
||||
if (lfun) {
|
||||
lfun->dispatch(LFUN_MESSAGE, _("Running BibTeX."));
|
||||
}
|
||||
|
||||
|
||||
updateBibtexDependencies(head, bibtex_info);
|
||||
rerun |= runBibTeX(bibtex_info);
|
||||
} else if (!had_depfile) {
|
||||
@ -251,7 +251,7 @@ int LaTeX::run(TeXErrors & terr, LyXFunc * lfun)
|
||||
/// insert the .bib and .bst files into the .dep-pdf file.
|
||||
updateBibtexDependencies(head, bibtex_info);
|
||||
}
|
||||
|
||||
|
||||
// 1
|
||||
// we know on this point that latex has been run once (or we just
|
||||
// returned) and the question now is to decide if we need to run
|
||||
@ -276,14 +276,14 @@ int LaTeX::run(TeXErrors & terr, LyXFunc * lfun)
|
||||
str << _("LaTeX run number") << ' ' << count;
|
||||
lfun->dispatch(LFUN_MESSAGE, str.str().c_str());
|
||||
}
|
||||
|
||||
|
||||
this->operator()();
|
||||
scanres = scanLogFile(terr);
|
||||
if (scanres & ERRORS) {
|
||||
deleteFilesOnError();
|
||||
return scanres; // return on error
|
||||
}
|
||||
|
||||
|
||||
// update the depedencies
|
||||
deplog(head); // reads the latex log
|
||||
head.update();
|
||||
@ -298,7 +298,7 @@ int LaTeX::run(TeXErrors & terr, LyXFunc * lfun)
|
||||
// again to make sure everything is redone correctly.
|
||||
// Also there should be no need to run the external programs any
|
||||
// more after this.
|
||||
|
||||
|
||||
// run makeindex if the <file>.idx has changed or was generated.
|
||||
if (head.haschanged(OnlyFilename(ChangeExtension(file, ".idx")))) {
|
||||
// no checks for now
|
||||
@ -306,10 +306,10 @@ int LaTeX::run(TeXErrors & terr, LyXFunc * lfun)
|
||||
if (lfun) {
|
||||
lfun->dispatch(LFUN_MESSAGE, _("Running MakeIndex."));
|
||||
}
|
||||
|
||||
|
||||
rerun = runMakeIndex(OnlyFilename(ChangeExtension(file, ".idx")));
|
||||
}
|
||||
|
||||
|
||||
// 2
|
||||
// we will only run latex more if the log file asks for it.
|
||||
// or if the sumchange() is true.
|
||||
@ -320,7 +320,7 @@ int LaTeX::run(TeXErrors & terr, LyXFunc * lfun)
|
||||
// -> rerun not asked for:
|
||||
// just return (fall out of bottom of func)
|
||||
//
|
||||
while ((head.sumchange() || rerun || (scanres & RERUN))
|
||||
while ((head.sumchange() || rerun || (scanres & RERUN))
|
||||
&& count < MAX_RUN) {
|
||||
// Yes rerun until message goes away, or until
|
||||
// MAX_RUNS are reached.
|
||||
@ -332,14 +332,14 @@ int LaTeX::run(TeXErrors & terr, LyXFunc * lfun)
|
||||
str << _("LaTeX run number") << ' ' << count;
|
||||
lfun->dispatch(LFUN_MESSAGE, str.str().c_str());
|
||||
}
|
||||
|
||||
|
||||
this->operator()();
|
||||
scanres = scanLogFile(terr);
|
||||
if (scanres & ERRORS) {
|
||||
deleteFilesOnError();
|
||||
return scanres; // return on error
|
||||
}
|
||||
|
||||
|
||||
// keep this updated
|
||||
head.update();
|
||||
}
|
||||
@ -358,7 +358,7 @@ int LaTeX::operator()()
|
||||
#else // cmd.exe (OS/2) causes SYS0003 error at "/dev/null"
|
||||
string tmp = cmd + ' ' + file + " > nul";
|
||||
#endif
|
||||
Systemcall one;
|
||||
Systemcall one;
|
||||
return one.startscript(Systemcall::Wait, tmp);
|
||||
}
|
||||
|
||||
@ -385,7 +385,7 @@ vector<Aux_Info> const
|
||||
LaTeX::scanAuxFiles(string const & file)
|
||||
{
|
||||
vector<Aux_Info> result;
|
||||
|
||||
|
||||
result.push_back(scanAuxFile(file));
|
||||
|
||||
for (int i = 1; i < 1000; ++i) {
|
||||
@ -490,7 +490,7 @@ void LaTeX::updateBibtexDependencies(DepTable & dep,
|
||||
string file = findtexfile(*it2, "bst");
|
||||
if (!file.empty())
|
||||
dep.insert(file, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -526,7 +526,7 @@ int LaTeX::scanLogFile(TeXErrors & terr)
|
||||
string token;
|
||||
while (getline(ifs, token)) {
|
||||
lyxerr[Debug::LATEX] << "Log line: " << token << endl;
|
||||
|
||||
|
||||
if (token.empty())
|
||||
continue;
|
||||
|
||||
@ -666,7 +666,7 @@ void LaTeX::deplog(DepTable & head)
|
||||
// Writing index file sample.idx
|
||||
LRegex reg5("Writing index file ([^ ]+).*");
|
||||
LRegex unwanted("^.*\\.(aux|log|dvi|bbl|ind|glo)$");
|
||||
|
||||
|
||||
ifstream ifs(logfile.c_str());
|
||||
while (ifs) {
|
||||
// Ok, the scanning of files here is not sufficient.
|
||||
@ -679,7 +679,7 @@ void LaTeX::deplog(DepTable & head)
|
||||
getline(ifs, token);
|
||||
token = strip(token, '\r');
|
||||
if (token.empty()) continue;
|
||||
|
||||
|
||||
if (reg1.exact_match(token)) {
|
||||
LRegex::SubMatches const & sub = reg1.exec(token);
|
||||
foundfile = LSubstring(token, sub[1].first,
|
||||
@ -706,21 +706,21 @@ void LaTeX::deplog(DepTable & head)
|
||||
|
||||
// convert from native os path to unix path
|
||||
foundfile = os::internal_path(foundfile);
|
||||
|
||||
lyxerr[Debug::DEPEND] << "Found file: "
|
||||
|
||||
lyxerr[Debug::DEPEND] << "Found file: "
|
||||
<< foundfile << endl;
|
||||
|
||||
|
||||
// Ok now we found a file.
|
||||
// Now we should make sure that this is a file that we can
|
||||
// access through the normal paths.
|
||||
// We will not try any fancy search methods to
|
||||
// find the file.
|
||||
|
||||
|
||||
// (1) foundfile is an
|
||||
// absolute path and should
|
||||
// be inserted.
|
||||
if (AbsolutePath(foundfile)) {
|
||||
lyxerr[Debug::DEPEND] << "AbsolutePath file: "
|
||||
lyxerr[Debug::DEPEND] << "AbsolutePath file: "
|
||||
<< foundfile << endl;
|
||||
// On initial insert we want to do the update at once
|
||||
// since this file can not be a file generated by
|
||||
|
22
src/LaTeX.h
22
src/LaTeX.h
@ -1,15 +1,15 @@
|
||||
// -*- C++ -*-
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
* Copyright 1995 Matthias Ettrich
|
||||
* Copyright 1995-2001 The Lyx Team
|
||||
*
|
||||
* This file is Copyright 1996-2001
|
||||
* Lars Gullik Bjønnes
|
||||
*
|
||||
* ======================================================
|
||||
* ======================================================
|
||||
*/
|
||||
|
||||
#ifndef LATEX_H
|
||||
@ -100,7 +100,7 @@ bool operator!=(Aux_Info const & a, Aux_Info const & o)
|
||||
class LaTeX : boost::noncopyable {
|
||||
public:
|
||||
/** Return values from scanLogFile() and run() (to come)
|
||||
|
||||
|
||||
This enum should be enlarged a bit so that one could
|
||||
get more feedback from the LaTeX run.
|
||||
*/
|
||||
@ -140,7 +140,7 @@ public:
|
||||
///
|
||||
WARNINGS = TEX_WARNING + LATEX_WARNING + PACKAGE_WARNING
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
cmd = the latex command, file = name of the (temporary) latex file,
|
||||
@ -150,7 +150,7 @@ public:
|
||||
|
||||
///
|
||||
virtual ~LaTeX() {}
|
||||
|
||||
|
||||
/// runs LaTeX several times
|
||||
int run(TeXErrors &, LyXFunc *);
|
||||
|
||||
@ -181,7 +181,7 @@ protected:
|
||||
|
||||
///
|
||||
void scanAuxFile(string const &, Aux_Info &);
|
||||
|
||||
|
||||
///
|
||||
void updateBibtexDependencies(DepTable &,
|
||||
std::vector<Aux_Info> const &);
|
||||
@ -191,19 +191,19 @@ protected:
|
||||
|
||||
///
|
||||
void deleteFilesOnError() const;
|
||||
|
||||
|
||||
///
|
||||
string cmd;
|
||||
|
||||
///
|
||||
string file;
|
||||
|
||||
|
||||
///
|
||||
string path;
|
||||
|
||||
/// used by scanLogFile
|
||||
int num_errors;
|
||||
|
||||
|
||||
/// The name of the final output file.
|
||||
string output_file;
|
||||
};
|
||||
|
@ -1,8 +1,8 @@
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
*
|
||||
* Copyright 1995 Matthias Ettrich
|
||||
* Copyright 1995-2001 the LyX Team.
|
||||
*
|
||||
@ -46,7 +46,7 @@ void LaTeXFeatures::require(string const & name)
|
||||
{
|
||||
if (isRequired(name))
|
||||
return;
|
||||
|
||||
|
||||
features.push_back(name);
|
||||
}
|
||||
|
||||
@ -59,7 +59,7 @@ void LaTeXFeatures::useLayout(string const & lyt)
|
||||
|
||||
bool LaTeXFeatures::isRequired(string const & name) const
|
||||
{
|
||||
FeaturesList::const_iterator i = find(features.begin(),
|
||||
FeaturesList::const_iterator i = find(features.begin(),
|
||||
features.end(),
|
||||
name);
|
||||
return i != features.end();
|
||||
@ -91,25 +91,25 @@ void LaTeXFeatures::useLanguage(Language const * lang)
|
||||
}
|
||||
|
||||
|
||||
void LaTeXFeatures::includeFile(string const & key, string const & name)
|
||||
void LaTeXFeatures::includeFile(string const & key, string const & name)
|
||||
{
|
||||
IncludedFiles[key] = name;
|
||||
}
|
||||
|
||||
|
||||
bool LaTeXFeatures::hasLanguages()
|
||||
bool LaTeXFeatures::hasLanguages()
|
||||
{
|
||||
return !UsedLanguages.empty();
|
||||
}
|
||||
|
||||
|
||||
string LaTeXFeatures::getLanguages() const
|
||||
string LaTeXFeatures::getLanguages() const
|
||||
{
|
||||
ostringstream languages;
|
||||
|
||||
for (LanguageList::const_iterator cit =
|
||||
UsedLanguages.begin();
|
||||
cit != UsedLanguages.end();
|
||||
cit != UsedLanguages.end();
|
||||
++cit)
|
||||
languages << (*cit)->babel() << ',';
|
||||
|
||||
@ -117,7 +117,7 @@ string LaTeXFeatures::getLanguages() const
|
||||
}
|
||||
|
||||
|
||||
set<string> LaTeXFeatures::getEncodingSet(string const & doc_encoding)
|
||||
set<string> LaTeXFeatures::getEncodingSet(string const & doc_encoding)
|
||||
{
|
||||
set<string> encodings;
|
||||
for (LanguageList::const_iterator it =
|
||||
@ -129,7 +129,7 @@ set<string> LaTeXFeatures::getEncodingSet(string const & doc_encoding)
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
||||
|
||||
char const * simplefeatures[] = {
|
||||
"array",
|
||||
"verbatim",
|
||||
@ -164,7 +164,7 @@ string const LaTeXFeatures::getPackages() const
|
||||
<< simplefeatures[i]
|
||||
<< "}\n";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* The rest of these packages are somewhat more complicated
|
||||
* than those above.
|
||||
@ -174,17 +174,17 @@ string const LaTeXFeatures::getPackages() const
|
||||
&& ! tclass.provides(LyXTextClass::amsmath)) {
|
||||
packages << "\\usepackage{amsmath}\n";
|
||||
}
|
||||
|
||||
|
||||
// color.sty
|
||||
if (isRequired("color")) {
|
||||
if (params.graphicsDriver == "default")
|
||||
packages << "\\usepackage{color}\n";
|
||||
else
|
||||
packages << "\\usepackage["
|
||||
packages << "\\usepackage["
|
||||
<< params.graphicsDriver
|
||||
<< "]{color}\n";
|
||||
}
|
||||
|
||||
|
||||
// makeidx.sty
|
||||
if (isRequired("makeidx")) {
|
||||
if (! tclass.provides(LyXTextClass::makeidx))
|
||||
@ -197,7 +197,7 @@ string const LaTeXFeatures::getPackages() const
|
||||
if (params.graphicsDriver == "default")
|
||||
packages << "\\usepackage{graphicx}\n";
|
||||
else
|
||||
packages << "\\usepackage["
|
||||
packages << "\\usepackage["
|
||||
<< params.graphicsDriver
|
||||
<< "]{graphicx}\n";
|
||||
}
|
||||
@ -254,7 +254,7 @@ string const LaTeXFeatures::getPackages() const
|
||||
}
|
||||
packages << "]{natbib}\n";
|
||||
}
|
||||
|
||||
|
||||
packages << externalPreambles;
|
||||
|
||||
return packages.str().c_str();
|
||||
@ -266,10 +266,10 @@ string const LaTeXFeatures::getMacros() const
|
||||
ostringstream macros;
|
||||
|
||||
// always include this
|
||||
if (true || isRequired("lyx"))
|
||||
if (true || isRequired("lyx"))
|
||||
macros << lyx_def << '\n';
|
||||
|
||||
if (isRequired("lyxline"))
|
||||
if (isRequired("lyxline"))
|
||||
macros << lyxline_def << '\n';
|
||||
|
||||
if (isRequired("noun"))
|
||||
@ -278,7 +278,7 @@ string const LaTeXFeatures::getMacros() const
|
||||
if (isRequired("lyxarrow"))
|
||||
macros << lyxarrow_def << '\n';
|
||||
|
||||
// quotes.
|
||||
// quotes.
|
||||
if (isRequired("quotesinglbase"))
|
||||
macros << quotesinglbase_def << '\n';
|
||||
if (isRequired("quotedblbase"))
|
||||
@ -291,21 +291,21 @@ string const LaTeXFeatures::getMacros() const
|
||||
macros << guillemotleft_def << '\n';
|
||||
if (isRequired("guillemotright"))
|
||||
macros << guillemotright_def << '\n';
|
||||
|
||||
// Math mode
|
||||
|
||||
// Math mode
|
||||
if (isRequired("boldsymbol") && !isRequired("amsmath"))
|
||||
macros << boldsymbol_def << '\n';
|
||||
if (isRequired("binom") && !isRequired("amsmath"))
|
||||
macros << binom_def << '\n';
|
||||
if (isRequired("mathcircumflex"))
|
||||
macros << mathcircumflex_def << '\n';
|
||||
|
||||
|
||||
// other
|
||||
if (isRequired("NeedLyXMinipageIndent"))
|
||||
macros << minipageindent_def;
|
||||
if (isRequired("ParagraphIndent"))
|
||||
if (isRequired("ParagraphIndent"))
|
||||
macros << paragraphindent_def;
|
||||
if (isRequired("NeedLyXFootnoteCode"))
|
||||
if (isRequired("NeedLyXFootnoteCode"))
|
||||
macros << floatingfootnote_def;
|
||||
|
||||
// floats
|
||||
@ -324,7 +324,7 @@ string const LaTeXFeatures::getMacros() const
|
||||
|
||||
string const LaTeXFeatures::getTClassPreamble() const
|
||||
{
|
||||
// the text class specific preamble
|
||||
// the text class specific preamble
|
||||
LyXTextClass const & tclass = textclasslist[params.textclass];
|
||||
ostringstream tcpreamble;
|
||||
|
||||
@ -335,9 +335,9 @@ string const LaTeXFeatures::getTClassPreamble() const
|
||||
for (; cit != end; ++cit) {
|
||||
tcpreamble << tclass[*cit].preamble();
|
||||
}
|
||||
|
||||
|
||||
return tcpreamble.str().c_str();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
string const LaTeXFeatures::getLyXSGMLEntities() const
|
||||
@ -396,10 +396,10 @@ void LaTeXFeatures::getFloatDefinitions(ostream & os) const
|
||||
// ostringstream floats;
|
||||
for (; cit != end; ++cit) {
|
||||
Floating const & fl = floatList.getType((*cit));
|
||||
|
||||
|
||||
// For builtin floats we do nothing.
|
||||
if (fl.builtin()) continue;
|
||||
|
||||
|
||||
// We have to special case "table" and "figure"
|
||||
if (fl.type() == "tabular" || fl.type() == "figure") {
|
||||
// Output code to modify "table" or "figure"
|
||||
@ -419,7 +419,7 @@ void LaTeXFeatures::getFloatDefinitions(ostream & os) const
|
||||
}
|
||||
} else {
|
||||
// The other non builtin floats.
|
||||
|
||||
|
||||
string const type = fl.type();
|
||||
string const placement = fl.placement();
|
||||
string const ext = fl.ext();
|
||||
@ -434,7 +434,7 @@ void LaTeXFeatures::getFloatDefinitions(ostream & os) const
|
||||
os << "\n"
|
||||
<< "\\floatname{" << type << "}{"
|
||||
<< name << "}\n";
|
||||
|
||||
|
||||
// What missing here is to code to minimalize the code
|
||||
// output so that the same floatstyle will not be
|
||||
// used several times, when the same style is still in
|
||||
|
@ -1,9 +1,9 @@
|
||||
// -*- C++ -*-
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
*
|
||||
* Copyright 1995 Matthias Ettrich
|
||||
* Copyright 1995-2001 the LyX Team.
|
||||
*
|
||||
@ -26,7 +26,7 @@
|
||||
#include <list>
|
||||
#include <map>
|
||||
|
||||
class BufferParams;
|
||||
class BufferParams;
|
||||
struct Language;
|
||||
|
||||
/** The packages and commands that a buffer needs. This class
|
||||
@ -35,11 +35,11 @@ struct Language;
|
||||
|
||||
i.e require("amssymb")
|
||||
|
||||
To add support you should only need to require() the package name as
|
||||
To add support you should only need to require() the package name as
|
||||
packages which don't have special requirements are handled automatically.
|
||||
If your new package does need special consideration you'll need to alter
|
||||
string const getPackages() const;
|
||||
Remember to update the validate function in buffer.C and paragraph.C
|
||||
Remember to update the validate function in buffer.C and paragraph.C
|
||||
when you do so.
|
||||
*/
|
||||
class LaTeXFeatures {
|
||||
@ -62,7 +62,7 @@ public:
|
||||
void getFloatDefinitions(std::ostream & os) const;
|
||||
/// Print requirements to lyxerr
|
||||
void showStruct() const;
|
||||
///
|
||||
///
|
||||
void addExternalPreamble(string const &);
|
||||
/// Provide a string name-space to the requirements
|
||||
void require(string const & name);
|
||||
|
@ -1,16 +1,16 @@
|
||||
// -*- C++ -*-
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
*
|
||||
* Copyright 1995 Matthias Ettrich
|
||||
* Copyright 1995-2001 The LyX Team.
|
||||
*
|
||||
* ====================================================== */
|
||||
|
||||
#ifndef LSSTREAM_H
|
||||
#define LSSTREAM_H
|
||||
#define LSSTREAM_H
|
||||
|
||||
// Since we will include a string header anyway, we'd better do it
|
||||
// right now so that <string> is not loaded before lyxstring.h. (JMarc)
|
||||
|
@ -1,8 +1,8 @@
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
*
|
||||
* Copyright 1995 Matthias Ettrich
|
||||
* Copyright 1995-2001 The LyX Team.
|
||||
*
|
||||
@ -22,12 +22,12 @@
|
||||
using std::ostream;
|
||||
using std::endl;
|
||||
|
||||
/*
|
||||
/*
|
||||
NAMING RULES FOR USER-COMMANDS
|
||||
Here's the set of rules to apply when a new command name is introduced:
|
||||
|
||||
|
||||
1) Use the object.event order. That is, use `word-forward'
|
||||
instead of `forward-word'.
|
||||
instead of `forward-word'.
|
||||
2) Don't introduce an alias for an already named object. Same for events.
|
||||
3) Forward movement or focus is called `forward' (not `right').
|
||||
4) Backward movement or focus is called `backward' (not `left').
|
||||
@ -35,20 +35,20 @@ using std::endl;
|
||||
6) Downward movement is called `down'.
|
||||
7) The begin of an object is called `begin' (not `start').
|
||||
8) The end of an object is called `end'.
|
||||
|
||||
|
||||
(May 19 1996, 12:04, RvdK)
|
||||
*/
|
||||
|
||||
// These are globals.
|
||||
// These are globals.
|
||||
LyXAction lyxaction;
|
||||
|
||||
// Small helper function
|
||||
inline
|
||||
bool isPseudoAction(int a)
|
||||
{
|
||||
return a > int(LFUN_LASTACTION);
|
||||
{
|
||||
return a > int(LFUN_LASTACTION);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void LyXAction::newFunc(kb_action action, string const & name,
|
||||
@ -70,7 +70,7 @@ void LyXAction::init()
|
||||
// times. Since the array is not static we get back the memory it
|
||||
// occupies after the init is completed. It compiles several
|
||||
// magnitudes faster.
|
||||
|
||||
|
||||
static bool init;
|
||||
if (init) return;
|
||||
|
||||
@ -117,7 +117,7 @@ void LyXAction::init()
|
||||
{ LFUN_BREAKPARAGRAPHKEEPLAYOUT, "break-paragraph-keep-layout",
|
||||
"", Noop },
|
||||
{ LFUN_BREAKPARAGRAPH_SKIP, "break-paragraph-skip", "", Noop },
|
||||
{ LFUN_BUILDPROG, "build-program",
|
||||
{ LFUN_BUILDPROG, "build-program",
|
||||
N_("Build program"), ReadOnly },
|
||||
{ LFUN_AUTOSAVE, "buffer-auto-save", N_("Autosave"), Noop },
|
||||
{ LFUN_BEGINNINGBUF, "buffer-begin",
|
||||
@ -145,7 +145,7 @@ void LyXAction::init()
|
||||
{ LFUN_MENUPRINT, "buffer-print", N_("Print"), ReadOnly },
|
||||
{ LFUN_MENURELOAD, "buffer-reload",
|
||||
N_("Revert to saved"), ReadOnly },
|
||||
{ LFUN_SWITCHBUFFER, "buffer-switch",
|
||||
{ LFUN_SWITCHBUFFER, "buffer-switch",
|
||||
N_("Switch to an open document"), ReadOnly },
|
||||
{ LFUN_READ_ONLY_TOGGLE, "buffer-toggle-read-only",
|
||||
N_("Toggle read-only"), ReadOnly },
|
||||
@ -230,7 +230,7 @@ void LyXAction::init()
|
||||
ReadOnly },
|
||||
{ LFUN_HFILL, "hfill-insert",
|
||||
N_("Insert horizontal fill"), Noop },
|
||||
{ LFUN_HELP_OPEN, "help-open", N_("Open a Help file"),
|
||||
{ LFUN_HELP_OPEN, "help-open", N_("Open a Help file"),
|
||||
NoBuffer|Argument},
|
||||
{ LFUN_HTMLURL, "html-insert", "", Noop },
|
||||
{ LFUN_HYPHENATION, "hyphenation-point-insert",
|
||||
@ -316,13 +316,13 @@ void LyXAction::init()
|
||||
{ LFUN_INSET_MINIPAGE, "minipage-insert", "", Noop },
|
||||
{ LFUN_INSERT_NOTE, "note-insert", "", Noop },
|
||||
{ LFUN_GOTONOTE, "note-next", "", ReadOnly },
|
||||
{ LFUN_INSET_TOGGLE, "inset-toggle",
|
||||
{ LFUN_INSET_TOGGLE, "inset-toggle",
|
||||
N_("toggle inset"), ReadOnly },
|
||||
{ LFUN_DOWN_PARAGRAPH, "paragraph-down",
|
||||
N_("Go one paragraph down"), ReadOnly },
|
||||
{ LFUN_DOWN_PARAGRAPHSEL, "paragraph-down-select",
|
||||
N_("Select next paragraph"), ReadOnly },
|
||||
{ LFUN_GOTO_PARAGRAPH, "paragraph-goto",
|
||||
{ LFUN_GOTO_PARAGRAPH, "paragraph-goto",
|
||||
N_("Go to paragraph"), ReadOnly },
|
||||
{ LFUN_PARAGRAPH_SPACING, "paragraph-spacing", "", Noop },
|
||||
{ LFUN_UP_PARAGRAPH, "paragraph-up",
|
||||
@ -473,7 +473,7 @@ int LyXAction::searchActionArg(kb_action action, string const & arg) const
|
||||
|
||||
if (aci == pit->second.end()) {
|
||||
// the action does not have any pseudoactions with this arg
|
||||
lyxerr[Debug::ACTION]
|
||||
lyxerr[Debug::ACTION]
|
||||
<< "Action " << action
|
||||
<< "does not have any pseudoactions with arg "
|
||||
<< arg << endl;
|
||||
@ -481,8 +481,8 @@ int LyXAction::searchActionArg(kb_action action, string const & arg) const
|
||||
}
|
||||
|
||||
// pseudo action exist
|
||||
lyxerr[Debug::ACTION] << "Pseudoaction exist["
|
||||
<< action << '|'
|
||||
lyxerr[Debug::ACTION] << "Pseudoaction exist["
|
||||
<< action << '|'
|
||||
<< arg << "] = " << aci->second << endl;
|
||||
|
||||
return aci->second;
|
||||
@ -514,7 +514,7 @@ int LyXAction::getPseudoAction(kb_action action, string const & arg) const
|
||||
lyxerr[Debug::ACTION] << "Creating new pseudoaction "
|
||||
<< pseudo_counter << " for [" << action
|
||||
<< '|' << arg << "]\n";
|
||||
|
||||
|
||||
return pseudo_counter;
|
||||
}
|
||||
|
||||
@ -525,9 +525,9 @@ kb_action LyXAction::retrieveActionArg(int pseudo, string & arg) const
|
||||
{
|
||||
arg.erase(); // clear it to be sure.
|
||||
|
||||
if (!isPseudoAction(pseudo))
|
||||
if (!isPseudoAction(pseudo))
|
||||
return static_cast<kb_action>(pseudo);
|
||||
|
||||
|
||||
pseudo_map::const_iterator pit = lyx_pseudo_map.find(pseudo);
|
||||
|
||||
if (pit != lyx_pseudo_map.end()) {
|
||||
@ -582,21 +582,21 @@ int LyXAction::getApproxFunc(string const & func) const
|
||||
// Checking for prefix is not so simple, but
|
||||
// using a simple bounding function gives
|
||||
// a similar result. [ale 19981103]
|
||||
func_map::const_iterator fit =
|
||||
lyx_func_map.lower_bound(func);
|
||||
|
||||
if (fit != lyx_func_map.end()) {
|
||||
func_map::const_iterator fit =
|
||||
lyx_func_map.lower_bound(func);
|
||||
|
||||
if (fit != lyx_func_map.end()) {
|
||||
action = fit->second;
|
||||
}
|
||||
} else { // Go get the next function
|
||||
func_map::const_iterator fit =
|
||||
lyx_func_map.upper_bound(func);
|
||||
|
||||
if (fit != lyx_func_map.end()) {
|
||||
func_map::const_iterator fit =
|
||||
lyx_func_map.upper_bound(func);
|
||||
|
||||
if (fit != lyx_func_map.end()) {
|
||||
action = fit->second;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return action;
|
||||
}
|
||||
|
||||
@ -617,14 +617,14 @@ string const LyXAction::getActionName(int action) const
|
||||
ac = retrieveActionArg(action, arg);
|
||||
if (!arg.empty())
|
||||
arg.insert(0, " ");
|
||||
|
||||
|
||||
info_map::const_iterator iit = lyx_info_map.find(ac);
|
||||
|
||||
if (iit != lyx_info_map.end()) {
|
||||
string ret(iit->second.name);
|
||||
ret += arg;
|
||||
return ret;
|
||||
} else
|
||||
} else
|
||||
return string();
|
||||
}
|
||||
|
||||
@ -665,8 +665,8 @@ string const LyXAction::helpText(int pseudoaction) const
|
||||
}
|
||||
|
||||
|
||||
bool LyXAction::funcHasFlag(kb_action action,
|
||||
LyXAction::func_attrib flag) const
|
||||
bool LyXAction::funcHasFlag(kb_action action,
|
||||
LyXAction::func_attrib flag) const
|
||||
{
|
||||
info_map::const_iterator ici = lyx_info_map.find(action);
|
||||
|
||||
@ -681,13 +681,13 @@ bool LyXAction::funcHasFlag(kb_action action,
|
||||
}
|
||||
|
||||
|
||||
LyXAction::const_func_iterator LyXAction::func_begin() const
|
||||
LyXAction::const_func_iterator LyXAction::func_begin() const
|
||||
{
|
||||
return lyx_func_map.begin();
|
||||
}
|
||||
|
||||
|
||||
LyXAction::const_func_iterator LyXAction::func_end() const
|
||||
LyXAction::const_func_iterator LyXAction::func_end() const
|
||||
{
|
||||
return lyx_func_map.end();
|
||||
}
|
||||
|
@ -51,37 +51,37 @@ public:
|
||||
Noop = 0,
|
||||
/// can be used in RO mode (perhaps this should change)
|
||||
ReadOnly = 1, // ,
|
||||
/// Can be used when there is no document open
|
||||
NoBuffer = 2,
|
||||
/// Can be used when there is no document open
|
||||
NoBuffer = 2,
|
||||
//Interactive = 2, // Is interactive (requires a GUI)
|
||||
///
|
||||
Argument = 4 // Requires argument
|
||||
//MathOnly = 8, // Only math mode
|
||||
//EtcEtc = ... // Or other attributes...
|
||||
};
|
||||
|
||||
|
||||
///
|
||||
LyXAction();
|
||||
|
||||
|
||||
/** Returns an pseudoaction from a string
|
||||
If you include arguments in func_name, a new psedoaction will be
|
||||
If you include arguments in func_name, a new psedoaction will be
|
||||
created if needed. */
|
||||
int LookupFunc(string const & func_name) const;
|
||||
int LookupFunc(string const & func_name) const;
|
||||
|
||||
/** Returns an action tag which name is the most similar to a string.
|
||||
/** Returns an action tag which name is the most similar to a string.
|
||||
Don't include arguments, they would be ignored. */
|
||||
int getApproxFunc(string const & func) const;
|
||||
int getApproxFunc(string const & func) const;
|
||||
|
||||
/** Returns an action name the most similar to a string.
|
||||
/** Returns an action name the most similar to a string.
|
||||
Don't include arguments, they would be ignored. */
|
||||
string const getApproxFuncName(string const & func) const;
|
||||
string const getApproxFuncName(string const & func) const;
|
||||
|
||||
/// Returns a pseudo-action given an action and its argument.
|
||||
int getPseudoAction(kb_action action, string const & arg) const;
|
||||
|
||||
/// Retrieves the real action and its argument.
|
||||
kb_action retrieveActionArg(int i, string & arg) const;
|
||||
|
||||
|
||||
/// Search for an existent pseudoaction, return -1 if it doesn't exist.
|
||||
int searchActionArg(kb_action action, string const & arg) const;
|
||||
|
||||
@ -103,24 +103,24 @@ private:
|
||||
///
|
||||
void newFunc(kb_action, string const & name,
|
||||
string const & helpText, unsigned int attrib);
|
||||
|
||||
|
||||
/** This is a list of all the LyXFunc names with the
|
||||
coresponding action number. It is usually only used by the
|
||||
minibuffer or when assigning commands to keys during init. */
|
||||
func_map lyx_func_map;
|
||||
|
||||
|
||||
/** This is a mapping from action number to an object holding
|
||||
info about this action. f.ex. helptext, command name (string),
|
||||
command attributes (ro) */
|
||||
info_map lyx_info_map;
|
||||
|
||||
|
||||
/** A mapping from the automatically created pseudo action number
|
||||
to the real action and its argument. */
|
||||
mutable pseudo_map lyx_pseudo_map;
|
||||
|
||||
|
||||
/** A (multi) mapping from the lyx action to all the generated
|
||||
pseudofuncs and the arguments the action should use. */
|
||||
mutable arg_map lyx_arg_map;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -1,9 +1,8 @@
|
||||
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
*
|
||||
* Copyright 1995 Matthias Ettrich
|
||||
* Copyright 1995-2001 The LyX Team.
|
||||
*
|
||||
@ -75,7 +74,7 @@ LyXView::~LyXView()
|
||||
}
|
||||
|
||||
|
||||
void LyXView::resize()
|
||||
void LyXView::resize()
|
||||
{
|
||||
view()->resize();
|
||||
}
|
||||
@ -148,7 +147,7 @@ Menubar * LyXView::getMenubar() const
|
||||
}
|
||||
|
||||
|
||||
void LyXView::updateMenubar()
|
||||
void LyXView::updateMenubar()
|
||||
{
|
||||
if ((!view() || !view()->buffer())
|
||||
&& menubackend.hasMenu("main_nobuffer"))
|
||||
@ -194,7 +193,7 @@ void LyXView::updateLayoutChoice()
|
||||
// document is loaded.
|
||||
if (!view() || !view()->buffer()) {
|
||||
toolbar->clearLayoutList();
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
// Update the layout display
|
||||
|
@ -69,7 +69,7 @@ public:
|
||||
void messagePush(string const & str);
|
||||
///
|
||||
void messagePop();
|
||||
|
||||
|
||||
///
|
||||
Menubar * getMenubar() const;
|
||||
|
||||
@ -100,13 +100,13 @@ public:
|
||||
protected:
|
||||
///
|
||||
Menubar * menubar;
|
||||
///
|
||||
///
|
||||
Toolbar * toolbar;
|
||||
/** This is supposed to be a pointer or a list of pointers to the
|
||||
BufferViews currently being shown in the LyXView. So far
|
||||
this is not used, but that should change pretty soon. (Lgb) */
|
||||
BufferView * bufferview;
|
||||
///
|
||||
///
|
||||
MiniBuffer * minibuffer;
|
||||
///
|
||||
Intl * intl;
|
||||
@ -117,7 +117,7 @@ protected:
|
||||
///
|
||||
void invalidateLayoutChoice();
|
||||
private:
|
||||
///
|
||||
///
|
||||
LyXFunc * lyxfunc;
|
||||
///
|
||||
Dialogs * dialogs_;
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
* Copyright 1995 Matthias Ettrich
|
||||
@ -46,8 +46,8 @@ using std::sort;
|
||||
MenuBackend menubackend;
|
||||
|
||||
|
||||
MenuItem::MenuItem(Kind kind, string const & label,
|
||||
string const & command, bool optional)
|
||||
MenuItem::MenuItem(Kind kind, string const & label,
|
||||
string const & command, bool optional)
|
||||
: kind_(kind), label_(label), optional_(optional)
|
||||
{
|
||||
switch (kind) {
|
||||
@ -67,11 +67,11 @@ MenuItem::MenuItem(Kind kind, string const & label,
|
||||
|
||||
if (action_ == LFUN_UNKNOWN_ACTION) {
|
||||
lyxerr << "MenuItem(): LyX command `"
|
||||
<< command << "' does not exist." << endl;
|
||||
<< command << "' does not exist." << endl;
|
||||
}
|
||||
if (optional_)
|
||||
lyxerr[Debug::GUI] << "Optional item "
|
||||
<< command << endl;
|
||||
lyxerr[Debug::GUI] << "Optional item "
|
||||
<< command << endl;
|
||||
break;
|
||||
case Submenu:
|
||||
submenu_ = command;
|
||||
@ -80,15 +80,15 @@ MenuItem::MenuItem(Kind kind, string const & label,
|
||||
}
|
||||
|
||||
|
||||
string const MenuItem::label() const
|
||||
{
|
||||
return token(label_, '|', 0);
|
||||
string const MenuItem::label() const
|
||||
{
|
||||
return token(label_, '|', 0);
|
||||
}
|
||||
|
||||
|
||||
string const MenuItem::shortcut() const
|
||||
{
|
||||
return token(label_, '|', 1);
|
||||
{
|
||||
return token(label_, '|', 1);
|
||||
}
|
||||
|
||||
|
||||
@ -128,7 +128,7 @@ Menu & Menu::read(LyXLex & lex)
|
||||
{ "importformats", md_importformats },
|
||||
{ "item", md_item },
|
||||
{ "lastfiles", md_lastfiles },
|
||||
{ "optitem", md_optitem },
|
||||
{ "optitem", md_optitem },
|
||||
{ "separator", md_separator },
|
||||
{ "submenu", md_submenu },
|
||||
{ "toc", md_toc },
|
||||
@ -153,7 +153,7 @@ Menu & Menu::read(LyXLex & lex)
|
||||
string const name = _(lex.getString());
|
||||
lex.next(true);
|
||||
string const command = lex.getString();
|
||||
add(MenuItem(MenuItem::Command, name,
|
||||
add(MenuItem(MenuItem::Command, name,
|
||||
command, optional));
|
||||
optional = false;
|
||||
break;
|
||||
@ -198,7 +198,7 @@ Menu & Menu::read(LyXLex & lex)
|
||||
case md_floatinsert:
|
||||
add(MenuItem(MenuItem::FloatInsert));
|
||||
break;
|
||||
|
||||
|
||||
case md_submenu: {
|
||||
lex.next(true);
|
||||
string const mlabel = _(lex.getString());
|
||||
@ -254,7 +254,7 @@ namespace {
|
||||
class compare_format {
|
||||
public:
|
||||
bool operator()(Format const * p1, Format const * p2) {
|
||||
return *p1 < *p2;
|
||||
return *p1 < *p2;
|
||||
}
|
||||
};
|
||||
|
||||
@ -270,7 +270,7 @@ void Menu::expand(Menu & tomenu, Buffer * buf) const
|
||||
int ii = 1;
|
||||
LastFiles::const_iterator lfit = lastfiles->begin();
|
||||
LastFiles::const_iterator end = lastfiles->end();
|
||||
|
||||
|
||||
for (; lfit != end && ii < 10; ++lfit, ++ii) {
|
||||
string const label = tostr(ii) + ". "
|
||||
+ MakeDisplayPath((*lfit), 30)
|
||||
@ -283,12 +283,12 @@ void Menu::expand(Menu & tomenu, Buffer * buf) const
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case MenuItem::Documents: {
|
||||
typedef vector<string> Strings;
|
||||
|
||||
|
||||
Strings const names = bufferlist.getFileNames();
|
||||
|
||||
|
||||
if (names.empty()) {
|
||||
tomenu.add(MenuItem(MenuItem::Command,
|
||||
_("No Documents Open!"),
|
||||
@ -315,9 +315,9 @@ void Menu::expand(Menu & tomenu, Buffer * buf) const
|
||||
case MenuItem::UpdateFormats:
|
||||
case MenuItem::ExportFormats: {
|
||||
typedef vector<Format const *> Formats;
|
||||
|
||||
|
||||
Formats formats;
|
||||
|
||||
|
||||
kb_action action;
|
||||
switch (cit->kind()) {
|
||||
case MenuItem::ImportFormats:
|
||||
@ -325,22 +325,22 @@ void Menu::expand(Menu & tomenu, Buffer * buf) const
|
||||
action = LFUN_IMPORT;
|
||||
break;
|
||||
case MenuItem::ViewFormats:
|
||||
formats = Exporter::GetExportableFormats(buf, true);
|
||||
formats = Exporter::GetExportableFormats(buf, true);
|
||||
action = LFUN_PREVIEW;
|
||||
break;
|
||||
case MenuItem::UpdateFormats:
|
||||
formats = Exporter::GetExportableFormats(buf, true);
|
||||
formats = Exporter::GetExportableFormats(buf, true);
|
||||
action = LFUN_UPDATE;
|
||||
break;
|
||||
default:
|
||||
formats = Exporter::GetExportableFormats(buf, false);
|
||||
formats = Exporter::GetExportableFormats(buf, false);
|
||||
action = LFUN_EXPORT;
|
||||
}
|
||||
sort(formats.begin(), formats.end(), compare_format());
|
||||
|
||||
Formats::const_iterator fit = formats.begin();
|
||||
Formats::const_iterator end = formats.end();
|
||||
|
||||
|
||||
for (; fit != end ; ++fit) {
|
||||
if ((*fit)->dummy())
|
||||
continue;
|
||||
@ -388,7 +388,7 @@ void Menu::expand(Menu & tomenu, Buffer * buf) const
|
||||
string const label = cit->second.name();
|
||||
tomenu.add(MenuItem(MenuItem::Command,
|
||||
label, action));
|
||||
|
||||
|
||||
// and the wide version
|
||||
int const action2 = lyxaction
|
||||
.getPseudoAction(LFUN_INSET_WIDE_FLOAT,
|
||||
@ -399,7 +399,7 @@ void Menu::expand(Menu & tomenu, Buffer * buf) const
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
tomenu.add(*cit);
|
||||
}
|
||||
@ -448,7 +448,7 @@ void MenuBackend::read(LyXLex & lex)
|
||||
|
||||
while (lex.isOK() && !quit) {
|
||||
switch (lex.lex()) {
|
||||
case md_menubar:
|
||||
case md_menubar:
|
||||
menubar = true;
|
||||
// fallback to md_menu
|
||||
case md_menu: {
|
||||
@ -461,7 +461,7 @@ void MenuBackend::read(LyXLex & lex)
|
||||
lex.printError("Cannot append to menu `$$Token' unless it is of the same type");
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
} else {
|
||||
Menu menu(name, menubar);
|
||||
menu.read(lex);
|
||||
add(menu);
|
||||
@ -486,7 +486,7 @@ void MenuBackend::defaults()
|
||||
{
|
||||
menulist_.clear();
|
||||
|
||||
lyxerr[Debug::GUI] << "MenuBackend::defaults: using default values"
|
||||
lyxerr[Debug::GUI] << "MenuBackend::defaults: using default values"
|
||||
<< endl;
|
||||
|
||||
Menu file("file");
|
||||
@ -506,7 +506,7 @@ void MenuBackend::defaults()
|
||||
.add(MenuItem(MenuItem::Command,
|
||||
_("LinuxDoc...|L"), "buffer-import linuxdoc"));
|
||||
add(import);
|
||||
|
||||
|
||||
Menu edit("edit");
|
||||
edit
|
||||
.add(MenuItem(MenuItem::Command, _("Cut"), "cut"))
|
||||
@ -534,8 +534,8 @@ void MenuBackend::defaults()
|
||||
if (lyxerr.debugging(Debug::GUI)) {
|
||||
for (const_iterator cit = begin();
|
||||
cit != end() ; ++cit)
|
||||
lyxerr << "Menu name: " << cit->name()
|
||||
<< ", Menubar: " << cit->menubar()
|
||||
lyxerr << "Menu name: " << cit->name()
|
||||
<< ", Menubar: " << cit->menubar()
|
||||
<< endl;
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* This file is part of -*- C++ -*-
|
||||
* ======================================================
|
||||
*
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
* Copyright 1995 Matthias Ettrich
|
||||
@ -63,17 +63,17 @@ public:
|
||||
FloatInsert
|
||||
};
|
||||
/// Create a Command type MenuItem
|
||||
MenuItem(Kind kind,
|
||||
string const & label = string(),
|
||||
string const & command = string(),
|
||||
MenuItem(Kind kind,
|
||||
string const & label = string(),
|
||||
string const & command = string(),
|
||||
bool optional = false);
|
||||
MenuItem(Kind kind,
|
||||
string const & label,
|
||||
int action,
|
||||
string const & label,
|
||||
int action,
|
||||
bool optional = false)
|
||||
: kind_(kind), label_(label),
|
||||
action_(action), submenu_(), optional_(optional) {}
|
||||
|
||||
|
||||
/// The label of a given menuitem
|
||||
string const label() const;
|
||||
/// The keyboard shortcut (usually underlined in the entry)
|
||||
@ -81,7 +81,7 @@ public:
|
||||
/// The complete label, with label and shortcut separated by a '|'
|
||||
string const fulllabel() const { return label_;}
|
||||
/// The kind of entry
|
||||
Kind kind() const { return kind_; }
|
||||
Kind kind() const { return kind_; }
|
||||
/// the action (if relevant)
|
||||
int action() const { return action_; }
|
||||
/// the description of the submenu (if relevant)
|
||||
@ -110,7 +110,7 @@ public:
|
||||
///
|
||||
typedef ItemList::const_iterator const_iterator;
|
||||
///
|
||||
explicit Menu(string const & name = string(), bool mb = false)
|
||||
explicit Menu(string const & name = string(), bool mb = false)
|
||||
: menubar_(mb), name_(name) {}
|
||||
///
|
||||
Menu & add(MenuItem const &);
|
||||
@ -122,9 +122,9 @@ public:
|
||||
ViewFormats, ExportFormats, UpdateFormats
|
||||
*/
|
||||
void expand(Menu & tomenu, Buffer *) const;
|
||||
///
|
||||
///
|
||||
bool menubar() const { return menubar_; }
|
||||
///
|
||||
///
|
||||
string const & name() const { return name_; }
|
||||
///
|
||||
bool empty() const { return items_.empty(); }
|
||||
@ -132,18 +132,18 @@ public:
|
||||
ItemList::size_type size() const { return items_.size(); }
|
||||
///
|
||||
bool hasSubmenu(string const &) const;
|
||||
///
|
||||
const_iterator begin() const {
|
||||
return items_.begin();
|
||||
}
|
||||
///
|
||||
const_iterator end() const {
|
||||
return items_.end();
|
||||
}
|
||||
///
|
||||
const_iterator begin() const {
|
||||
return items_.begin();
|
||||
}
|
||||
///
|
||||
const_iterator end() const {
|
||||
return items_.end();
|
||||
}
|
||||
|
||||
// Check whether the menu shortcuts are unique
|
||||
void checkShortcuts() const;
|
||||
|
||||
|
||||
private:
|
||||
///
|
||||
ItemList items_;
|
||||
@ -175,14 +175,14 @@ public:
|
||||
Menu const & getMenu (string const &) const;
|
||||
//
|
||||
bool empty() const { return menulist_.empty(); }
|
||||
///
|
||||
const_iterator begin() const {
|
||||
return menulist_.begin();
|
||||
}
|
||||
///
|
||||
const_iterator end() const {
|
||||
return menulist_.end();
|
||||
}
|
||||
///
|
||||
const_iterator begin() const {
|
||||
return menulist_.begin();
|
||||
}
|
||||
///
|
||||
const_iterator end() const {
|
||||
return menulist_.end();
|
||||
}
|
||||
private:
|
||||
///
|
||||
MenuList menulist_;
|
||||
|
@ -1,8 +1,8 @@
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
*
|
||||
* Copyright 1998-2001 The LyX Team
|
||||
*
|
||||
*======================================================*/
|
||||
@ -41,7 +41,7 @@ using std::max;
|
||||
namespace {
|
||||
|
||||
inline
|
||||
Display * display()
|
||||
Display * display()
|
||||
{
|
||||
return GUIRunTime::x11Display();
|
||||
}
|
||||
@ -69,7 +69,7 @@ PainterBase & Painter::line(int x1, int y1, int x2, int y2,
|
||||
enum line_style ls,
|
||||
enum line_width lw)
|
||||
{
|
||||
XDrawLine(display(), owner.getPixmap(),
|
||||
XDrawLine(display(), owner.getPixmap(),
|
||||
lyxColorHandler->getGCLinepars(ls, lw, col),
|
||||
x1, y1, x2, y2);
|
||||
return *this;
|
||||
@ -82,18 +82,18 @@ PainterBase & Painter::lines(int const * xp, int const * yp, int np,
|
||||
enum line_width lw)
|
||||
{
|
||||
boost::scoped_array<XPoint> points(new XPoint[np]);
|
||||
|
||||
|
||||
for (int i = 0; i < np; ++i) {
|
||||
points[i].x = xp[i];
|
||||
points[i].y = yp[i];
|
||||
}
|
||||
|
||||
XDrawLines(display(), owner.getPixmap(),
|
||||
lyxColorHandler->getGCLinepars(ls, lw, col),
|
||||
|
||||
XDrawLines(display(), owner.getPixmap(),
|
||||
lyxColorHandler->getGCLinepars(ls, lw, col),
|
||||
points.get(), np, CoordModeOrigin);
|
||||
|
||||
|
||||
return *this;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
PainterBase & Painter::rectangle(int x, int y, int w, int h,
|
||||
@ -102,7 +102,7 @@ PainterBase & Painter::rectangle(int x, int y, int w, int h,
|
||||
enum line_width lw)
|
||||
{
|
||||
XDrawRectangle(display(), owner.getPixmap(),
|
||||
lyxColorHandler->getGCLinepars(ls, lw, col),
|
||||
lyxColorHandler->getGCLinepars(ls, lw, col),
|
||||
x, y, w, h);
|
||||
return *this;
|
||||
}
|
||||
@ -121,39 +121,39 @@ PainterBase & Painter::fillPolygon(int const * xp, int const * yp, int np,
|
||||
LColor::color col)
|
||||
{
|
||||
boost::scoped_array<XPoint> points(new XPoint[np]);
|
||||
|
||||
|
||||
for (int i = 0; i < np; ++i) {
|
||||
points[i].x = xp[i];
|
||||
points[i].y = yp[i];
|
||||
}
|
||||
|
||||
|
||||
XFillPolygon(display(), owner.getPixmap(),
|
||||
lyxColorHandler->getGCForeground(col), points.get(), np,
|
||||
lyxColorHandler->getGCForeground(col), points.get(), np,
|
||||
Nonconvex, CoordModeOrigin);
|
||||
|
||||
|
||||
return *this;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
PainterBase & Painter::arc(int x, int y,
|
||||
unsigned int w, unsigned int h,
|
||||
int a1, int a2, LColor::color col)
|
||||
{
|
||||
XDrawArc(display(), owner.getPixmap(),
|
||||
XDrawArc(display(), owner.getPixmap(),
|
||||
lyxColorHandler->getGCForeground(col),
|
||||
x, y, w, h, a1, a2);
|
||||
x, y, w, h, a1, a2);
|
||||
return *this;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// Draw lines from x1,y1 to x2,y2. They are arrays
|
||||
PainterBase & Painter::segments(int const * x1, int const * y1,
|
||||
PainterBase & Painter::segments(int const * x1, int const * y1,
|
||||
int const * x2, int const * y2, int ns,
|
||||
LColor::color col,
|
||||
enum line_style ls, enum line_width lw)
|
||||
{
|
||||
boost::scoped_array<XSegment> s(new XSegment[ns]);
|
||||
|
||||
|
||||
for (int i = 0; i < ns; ++i) {
|
||||
s[i].x1 = x1[i];
|
||||
s[i].y1 = y1[i];
|
||||
@ -163,7 +163,7 @@ PainterBase & Painter::segments(int const * x1, int const * y1,
|
||||
XDrawSegments(display(), owner.getPixmap(),
|
||||
lyxColorHandler->getGCLinepars(ls, lw, col),
|
||||
s.get(), ns);
|
||||
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
@ -217,7 +217,7 @@ PainterBase & Painter::text(int x, int y, char const * s, size_t ls,
|
||||
text(x , y, xs.get(), ls, font);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
GC gc = lyxColorHandler->getGCForeground(f.realColor());
|
||||
if (f.realShape() != LyXFont::SMALLCAPS_SHAPE) {
|
||||
lyxfont::XSetFont(display(), gc, f);
|
||||
@ -241,11 +241,11 @@ PainterBase & Painter::text(int x, int y, char const * s, size_t ls,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (f.underbar() == LyXFont::ON) {
|
||||
underline(f, x, y, lyxfont::width(s, ls, f));
|
||||
}
|
||||
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
@ -282,11 +282,11 @@ PainterBase & Painter::text(int x, int y, XChar2b const * s, int ls,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (f.underbar() == LyXFont::ON) {
|
||||
underline(f, x, y, lyxfont::width(s, ls, f));
|
||||
}
|
||||
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
// -*- C++ -*-
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
*
|
||||
* Copyright 1995-2001 The LyX Team
|
||||
*
|
||||
* ======================================================*/
|
||||
@ -30,69 +30,69 @@ class WorkArea;
|
||||
*/
|
||||
class Painter : public PainterBase {
|
||||
public:
|
||||
/// Constructor
|
||||
/// Constructor
|
||||
explicit Painter(WorkArea &);
|
||||
|
||||
|
||||
/// Draw a line from point to point
|
||||
PainterBase & line(int x1, int y1, int x2, int y2,
|
||||
PainterBase & line(int x1, int y1, int x2, int y2,
|
||||
LColor::color = LColor::foreground,
|
||||
enum line_style = line_solid,
|
||||
enum line_width = line_thin);
|
||||
|
||||
|
||||
/// Here xp and yp are arrays of points
|
||||
PainterBase & lines(int const * xp, int const * yp, int np,
|
||||
LColor::color = LColor::foreground,
|
||||
enum line_style = line_solid,
|
||||
enum line_width = line_thin);
|
||||
|
||||
|
||||
/// Here xp and yp are arrays of points
|
||||
PainterBase & fillPolygon(int const * xp, int const * yp, int np,
|
||||
LColor::color = LColor::foreground);
|
||||
|
||||
|
||||
/// Draw lines from x1,y1 to x2,y2. They are arrays
|
||||
PainterBase & segments(int const * x1, int const * y1,
|
||||
PainterBase & segments(int const * x1, int const * y1,
|
||||
int const * x2, int const * y2, int ns,
|
||||
LColor::color = LColor::foreground,
|
||||
enum line_style = line_solid,
|
||||
enum line_width = line_thin);
|
||||
|
||||
/// Draw a rectangle
|
||||
|
||||
/// Draw a rectangle
|
||||
PainterBase & rectangle(int x, int y, int w, int h,
|
||||
LColor::color = LColor::foreground,
|
||||
enum line_style = line_solid,
|
||||
enum line_width = line_thin);
|
||||
|
||||
|
||||
/// Draw an arc
|
||||
PainterBase & arc(int x, int y, unsigned int w, unsigned int h,
|
||||
PainterBase & arc(int x, int y, unsigned int w, unsigned int h,
|
||||
int a1, int a2,
|
||||
LColor::color = LColor::foreground);
|
||||
|
||||
|
||||
/// Draw a pixel
|
||||
PainterBase & point(int x, int y, LColor::color = LColor::foreground);
|
||||
|
||||
|
||||
/// Fill a rectangle
|
||||
PainterBase & fillRectangle(int x, int y, int w, int h,
|
||||
LColor::color);
|
||||
|
||||
|
||||
/// For the graphics inset.
|
||||
PainterBase & image(int x, int y, int w, int h,
|
||||
grfx::GImage const & image);
|
||||
|
||||
|
||||
/// Draw a string at position x, y (y is the baseline)
|
||||
PainterBase & text(int x, int y,
|
||||
string const & str, LyXFont const & f);
|
||||
|
||||
|
||||
/** Draw a string at position x, y (y is the baseline)
|
||||
This is just for fast drawing */
|
||||
PainterBase & text(int x, int y, char const * str, size_t l,
|
||||
LyXFont const & f);
|
||||
|
||||
|
||||
/// Draw a char at position x, y (y is the baseline)
|
||||
PainterBase & text(int x, int y, char c, LyXFont const & f);
|
||||
|
||||
|
||||
/// Draw a wide string at position x, y
|
||||
PainterBase & text(int x, int y, XChar2b const * str, int l,
|
||||
LyXFont const & f);
|
||||
LyXFont const & f);
|
||||
private:
|
||||
/// Check the font, and if set, draw an underline
|
||||
void underline(LyXFont const & f, int x, int y, int width);
|
||||
|
@ -1,8 +1,8 @@
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
*
|
||||
* Copyright 1998-2001 The LyX Team
|
||||
*
|
||||
*======================================================*/
|
||||
@ -64,13 +64,13 @@ PainterBase & PainterBase::buttonFrame(int x, int y, int w, int h)
|
||||
{
|
||||
// Width of a side of the button
|
||||
int d = 2;
|
||||
|
||||
|
||||
fillRectangle(x, y, w, d, LColor::top);
|
||||
fillRectangle(x, (y+h-d), w, d, LColor::bottom);
|
||||
|
||||
|
||||
// Now a couple of trapezoids
|
||||
int x1[4], y1[4];
|
||||
|
||||
|
||||
x1[0] = x + d; y1[0] = y + d;
|
||||
x1[1] = x + d; y1[1] = (y + h - d);
|
||||
x1[2] = x; y1[2] = y + h;
|
||||
@ -87,8 +87,8 @@ PainterBase & PainterBase::buttonFrame(int x, int y, int w, int h)
|
||||
}
|
||||
|
||||
|
||||
PainterBase & PainterBase::rectText(int x, int baseline,
|
||||
string const & str,
|
||||
PainterBase & PainterBase::rectText(int x, int baseline,
|
||||
string const & str,
|
||||
LyXFont const & font,
|
||||
LColor::color back,
|
||||
LColor::color frame)
|
||||
@ -96,10 +96,10 @@ PainterBase & PainterBase::rectText(int x, int baseline,
|
||||
int width;
|
||||
int ascent;
|
||||
int descent;
|
||||
|
||||
|
||||
lyxfont::rectText(str, font, width, ascent, descent);
|
||||
rectangle(x, baseline - ascent, width, ascent + descent, frame);
|
||||
fillRectangle(x + 1, baseline - ascent + 1, width - 1,
|
||||
fillRectangle(x + 1, baseline - ascent + 1, width - 1,
|
||||
ascent + descent - 1, back);
|
||||
text(x + 3, baseline, str, font);
|
||||
return *this;
|
||||
@ -107,13 +107,13 @@ PainterBase & PainterBase::rectText(int x, int baseline,
|
||||
|
||||
|
||||
PainterBase & PainterBase::buttonText(int x, int baseline,
|
||||
string const & str,
|
||||
string const & str,
|
||||
LyXFont const & font)
|
||||
{
|
||||
int width;
|
||||
int ascent;
|
||||
int descent;
|
||||
|
||||
|
||||
lyxfont::buttonText(str, font, width, ascent, descent);
|
||||
button(x, baseline - ascent, width, descent + ascent);
|
||||
text(x + 4, baseline, str, font);
|
||||
|
@ -1,9 +1,9 @@
|
||||
// -*- C++ -*-
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
*
|
||||
* Copyright 1998-2001 The LyX Team
|
||||
*
|
||||
*======================================================*/
|
||||
@ -25,15 +25,15 @@ namespace grfx {
|
||||
}
|
||||
|
||||
/** A painter class to encapsulate all graphics parameters and operations
|
||||
|
||||
Every graphics operation in LyX should be made by this class. It will
|
||||
|
||||
Every graphics operation in LyX should be made by this class. It will
|
||||
be initialized and managed by the Screen class, and will be passed
|
||||
as a parameter to inset.
|
||||
|
||||
|
||||
It hides low level windows system parameters so insets and other
|
||||
clients don't have to worry about them and we can control graphics and
|
||||
GUI toolkit dependent drawing functions inside this single class.
|
||||
|
||||
|
||||
*/
|
||||
class PainterBase {
|
||||
public:
|
||||
@ -44,7 +44,7 @@ public:
|
||||
///
|
||||
line_thick
|
||||
};
|
||||
|
||||
|
||||
///
|
||||
enum line_style {
|
||||
///
|
||||
@ -54,13 +54,13 @@ public:
|
||||
///
|
||||
line_onoffdash
|
||||
};
|
||||
|
||||
|
||||
///
|
||||
explicit PainterBase(WorkArea & wa) : owner(wa) {}
|
||||
|
||||
|
||||
///
|
||||
virtual ~PainterBase() {}
|
||||
|
||||
|
||||
/* Screen geometry */
|
||||
///
|
||||
int paperMargin() const;
|
||||
@ -68,14 +68,14 @@ public:
|
||||
int paperWidth() const;
|
||||
///
|
||||
int paperHeight() const;
|
||||
|
||||
|
||||
/// Draw a line from point to point
|
||||
virtual PainterBase & line(
|
||||
int x1, int y1, int x2, int y2,
|
||||
int x1, int y1, int x2, int y2,
|
||||
LColor::color = LColor::foreground,
|
||||
enum line_style = line_solid,
|
||||
enum line_width = line_thin) = 0;
|
||||
|
||||
|
||||
/** Draw the lines between the lines in xp and yp.
|
||||
xp and yp are arrays of points, and np is the
|
||||
number of them. */
|
||||
@ -84,86 +84,86 @@ public:
|
||||
LColor::color = LColor::foreground,
|
||||
enum line_style = line_solid,
|
||||
enum line_width = line_thin) = 0;
|
||||
|
||||
|
||||
/// Here xp and yp are arrays of points
|
||||
virtual PainterBase & fillPolygon(
|
||||
int const * xp, int const * yp,
|
||||
int np,
|
||||
LColor::color = LColor::foreground) = 0;
|
||||
|
||||
|
||||
/// Draw lines from x1,y1 to x2,y2. They are arrays
|
||||
virtual PainterBase & segments(
|
||||
int const * x1, int const * y1,
|
||||
virtual PainterBase & segments(
|
||||
int const * x1, int const * y1,
|
||||
int const * x2, int const * y2, int ns,
|
||||
LColor::color = LColor::foreground,
|
||||
enum line_style = line_solid,
|
||||
enum line_width = line_thin) = 0;
|
||||
|
||||
/// Draw a rectangle
|
||||
|
||||
/// Draw a rectangle
|
||||
virtual PainterBase & rectangle(
|
||||
int x, int y, int w, int h,
|
||||
LColor::color = LColor::foreground,
|
||||
enum line_style = line_solid,
|
||||
enum line_width = line_thin) = 0;
|
||||
|
||||
|
||||
/// Draw a circle, d is the diameter, not the radious
|
||||
virtual PainterBase & circle(
|
||||
int x, int y, unsigned int d,
|
||||
LColor::color = LColor::foreground);
|
||||
|
||||
|
||||
/// Draw an ellipse
|
||||
virtual PainterBase & ellipse(
|
||||
int x, int y,
|
||||
unsigned int w, unsigned int h,
|
||||
LColor::color = LColor::foreground);
|
||||
|
||||
|
||||
/// Draw an arc
|
||||
virtual PainterBase & arc(
|
||||
int x, int y,
|
||||
unsigned int w, unsigned int h,
|
||||
unsigned int w, unsigned int h,
|
||||
int a1, int a2,
|
||||
LColor::color = LColor::foreground) = 0;
|
||||
|
||||
|
||||
/// Draw a pixel
|
||||
virtual PainterBase & point(
|
||||
int x, int y,
|
||||
LColor::color = LColor::foreground) = 0;
|
||||
|
||||
|
||||
/// Fill a rectangle
|
||||
virtual PainterBase & fillRectangle(
|
||||
int x, int y, int w, int h,
|
||||
LColor::color) = 0;
|
||||
|
||||
|
||||
/// A filled rectangle with the shape of a 3D button
|
||||
virtual PainterBase & button(int x, int y, int w, int h);
|
||||
|
||||
///
|
||||
virtual PainterBase & buttonFrame(int x, int y, int w, int h);
|
||||
|
||||
|
||||
|
||||
///
|
||||
virtual PainterBase & buttonFrame(int x, int y, int w, int h);
|
||||
|
||||
|
||||
// For the figure inset
|
||||
virtual PainterBase & image(int x, int y, int w, int h,
|
||||
grfx::GImage const & image) = 0;
|
||||
|
||||
|
||||
/// Draw a string at position x, y (y is the baseline)
|
||||
virtual PainterBase & text(int x, int y,
|
||||
string const & str, LyXFont const & f) = 0;
|
||||
|
||||
|
||||
/** Draw a string at position x, y (y is the baseline)
|
||||
This is just for fast drawing */
|
||||
virtual PainterBase & text(int x, int y, char const * str, size_t l,
|
||||
LyXFont const & f) = 0;
|
||||
|
||||
|
||||
/// Draw a char at position x, y (y is the baseline)
|
||||
virtual PainterBase & text(int x, int y, char c, LyXFont const & f)=0;
|
||||
|
||||
|
||||
/** Draws a string and encloses it inside a rectangle. */
|
||||
PainterBase & rectText(int x, int baseline,
|
||||
string const & string,
|
||||
PainterBase & rectText(int x, int baseline,
|
||||
string const & string,
|
||||
LyXFont const & font,
|
||||
LColor::color back,
|
||||
LColor::color frame);
|
||||
|
||||
|
||||
/** Draw a string and encloses it inside a button frame. */
|
||||
PainterBase & buttonText(int x, int baseline, string const & s,
|
||||
LyXFont const & font);
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#ifdef __GNUG__
|
||||
@ -36,14 +35,14 @@ void ParagraphParameters::clear()
|
||||
tmp.labelwidthstring.erase();
|
||||
tmp.start_of_appendix = false;
|
||||
#ifndef NO_PEXTRA_REALLY
|
||||
//tmp.pextra_type = PEXTRA_NONE;
|
||||
tmp.pextra_type = 0;
|
||||
tmp.pextra_width.erase();
|
||||
tmp.pextra_widthp.erase();
|
||||
//tmp.pextra_alignment = MINIPAGE_ALIGN_TOP;
|
||||
tmp.pextra_alignment = 0;
|
||||
tmp.pextra_hfill = false;
|
||||
tmp.pextra_start_minipage = false;
|
||||
//tmp.pextra_type = PEXTRA_NONE;
|
||||
tmp.pextra_type = 0;
|
||||
tmp.pextra_width.erase();
|
||||
tmp.pextra_widthp.erase();
|
||||
//tmp.pextra_alignment = MINIPAGE_ALIGN_TOP;
|
||||
tmp.pextra_alignment = 0;
|
||||
tmp.pextra_hfill = false;
|
||||
tmp.pextra_start_minipage = false;
|
||||
#endif
|
||||
set_from_struct(tmp);
|
||||
}
|
||||
@ -62,18 +61,18 @@ bool ParagraphParameters::sameLayout(ParagraphParameters const & pp) const
|
||||
param->spacing == pp.param->spacing &&
|
||||
#ifndef NO_PEXTRA_REALLY
|
||||
param->pextra_type == pp.param->pextra_type &&
|
||||
param->pextra_width == pp.param->pextra_width &&
|
||||
param->pextra_widthp == pp.param->pextra_widthp &&
|
||||
param->pextra_alignment == pp.param->pextra_alignment &&
|
||||
param->pextra_hfill == pp.param->pextra_hfill &&
|
||||
param->pextra_start_minipage == pp.param->pextra_start_minipage &&
|
||||
param->pextra_width == pp.param->pextra_width &&
|
||||
param->pextra_widthp == pp.param->pextra_widthp &&
|
||||
param->pextra_alignment == pp.param->pextra_alignment &&
|
||||
param->pextra_hfill == pp.param->pextra_hfill &&
|
||||
param->pextra_start_minipage == pp.param->pextra_start_minipage &&
|
||||
#endif
|
||||
param->noindent == pp.param->noindent &&
|
||||
param->depth == pp.param->depth;
|
||||
}
|
||||
|
||||
|
||||
void ParagraphParameters::set_from_struct(ParameterStruct const & ps)
|
||||
void ParagraphParameters::set_from_struct(ParameterStruct const & ps)
|
||||
{
|
||||
// get new param from container with tmp as template
|
||||
param = container.get(ps);
|
||||
|
@ -36,7 +36,7 @@ struct ParameterStruct {
|
||||
///
|
||||
LyXAlignment align;
|
||||
///
|
||||
depth_type depth;
|
||||
depth_type depth;
|
||||
///
|
||||
bool start_of_appendix;
|
||||
///
|
||||
@ -46,18 +46,18 @@ struct ParameterStruct {
|
||||
///
|
||||
string labelwidthstring;
|
||||
#ifndef NO_PEXTRA_REALLY
|
||||
///
|
||||
int pextra_type;
|
||||
///
|
||||
string pextra_width;
|
||||
///
|
||||
string pextra_widthp;
|
||||
///
|
||||
int pextra_alignment;
|
||||
///
|
||||
bool pextra_hfill;
|
||||
///
|
||||
bool pextra_start_minipage;
|
||||
///
|
||||
int pextra_type;
|
||||
///
|
||||
string pextra_width;
|
||||
///
|
||||
string pextra_widthp;
|
||||
///
|
||||
int pextra_alignment;
|
||||
///
|
||||
bool pextra_hfill;
|
||||
///
|
||||
bool pextra_start_minipage;
|
||||
#endif
|
||||
};
|
||||
|
||||
@ -77,7 +77,7 @@ ParameterStruct::ParameterStruct()
|
||||
|
||||
inline
|
||||
bool operator==(ParameterStruct const & ps1,
|
||||
ParameterStruct const & ps2)
|
||||
ParameterStruct const & ps2)
|
||||
{
|
||||
return ps1.added_space_top == ps2.added_space_top
|
||||
&& ps1.added_space_bottom == ps2.added_space_bottom
|
||||
@ -102,7 +102,7 @@ bool operator==(ParameterStruct const & ps1,
|
||||
&& ps1.pextra_start_minipage == ps2.pextra_start_minipage
|
||||
#endif
|
||||
;
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -1,9 +1,9 @@
|
||||
// -*- C++ -*-
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
*
|
||||
* Copyright 1995 Matthias Ettrich
|
||||
* Copyright 1995-2001 The LyX Team
|
||||
*
|
||||
@ -73,11 +73,11 @@ struct PrinterParams {
|
||||
///
|
||||
bool unsorted_copies;
|
||||
///
|
||||
int count_copies;
|
||||
int count_copies;
|
||||
// The settings below should allow us to print any read-only doc in
|
||||
// whatever size/orientation we want it -- overriding the documents
|
||||
// settings.
|
||||
// Override the documents orientation
|
||||
// Override the documents orientation
|
||||
// bool orientation;
|
||||
// Print n pages per physical sheet
|
||||
// unsigned int nup;
|
||||
@ -104,7 +104,7 @@ struct PrinterParams {
|
||||
}
|
||||
switch (target) {
|
||||
case PRINTER:
|
||||
// Assert(!printer_name.empty());
|
||||
// Assert(!printer_name.empty());
|
||||
break;
|
||||
case FILE:
|
||||
lyx::Assert(!file_name.empty());
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#ifdef __GNUG__
|
||||
|
@ -66,7 +66,7 @@ private:
|
||||
return p.unique();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/** Remove all unique items.
|
||||
This removes all elements from params that is only referenced
|
||||
from the private container. This can be considered a memory
|
||||
@ -78,7 +78,7 @@ private:
|
||||
isUnique());
|
||||
params.erase(it, params.end());
|
||||
}
|
||||
|
||||
|
||||
/// The actual container.
|
||||
mutable Params params;
|
||||
};
|
||||
|
@ -1,8 +1,8 @@
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
*
|
||||
* Copyright 1995 Matthias Ettrich
|
||||
* Copyright 1995-2001 The LyX Team.
|
||||
*
|
||||
@ -23,8 +23,8 @@ using std::ostream;
|
||||
|
||||
string const Spacing::spacing_string[]
|
||||
= {"single", "onehalf", "double", "other"};
|
||||
|
||||
float Spacing::getValue() const
|
||||
|
||||
float Spacing::getValue() const
|
||||
{
|
||||
switch (space) {
|
||||
case Default: // nothing special should happen with this...
|
||||
@ -63,9 +63,9 @@ void Spacing::set(Spacing::Space sp, string const & val)
|
||||
void Spacing::writeFile(ostream & os, bool para) const
|
||||
{
|
||||
if (space == Default) return;
|
||||
|
||||
|
||||
string cmd = para ? "\\paragraph_spacing " : "\\spacing ";
|
||||
|
||||
|
||||
if (getSpace() == Spacing::Other) {
|
||||
os.setf(ios::showpoint|ios::fixed);
|
||||
os.precision(2);
|
||||
@ -73,7 +73,7 @@ void Spacing::writeFile(ostream & os, bool para) const
|
||||
<< " " << getValue() << " \n";
|
||||
} else {
|
||||
os << cmd << spacing_string[getSpace()] << " \n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
// -*- C++ -*-
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
*
|
||||
* Copyright 1995 Matthias Ettrich
|
||||
* Copyright 1995-2001 The LyX Team.
|
||||
*
|
||||
@ -63,7 +63,7 @@ public:
|
||||
string const writeEnvirBegin() const;
|
||||
///
|
||||
string const writeEnvirEnd() const;
|
||||
|
||||
|
||||
private:
|
||||
///
|
||||
Space space;
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
* Copyright 1995 Matthias Ettrich
|
||||
* Copyright 1995-2001 The LyX Team
|
||||
*
|
||||
|
@ -1,8 +1,8 @@
|
||||
// -*- C++ -*-
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
* Copyright 1995 Matthias Ettrich
|
||||
* Copyright 1995-2001 The LyX Team
|
||||
*
|
||||
@ -59,7 +59,7 @@
|
||||
// I believe there are only three possible scenarios where the two first
|
||||
// are also covered by the third.
|
||||
// - The simplest scenario is what we have now, a single
|
||||
// BufferView only.
|
||||
// BufferView only.
|
||||
// o Opening
|
||||
// Nothing to do with the TextCache is done when opening a file.
|
||||
// o Switching
|
||||
@ -114,7 +114,7 @@ class TextCache {
|
||||
public:
|
||||
///
|
||||
typedef std::map<Buffer *, std::pair<int,LyXText *> > Cache;
|
||||
|
||||
|
||||
///
|
||||
typedef Cache::value_type value_type;
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
#ifdef HAVE_LIBAIKSAURUS
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
|
||||
using std::sort;
|
||||
|
||||
Thesaurus::Thesaurus()
|
||||
@ -36,14 +36,14 @@ Thesaurus::Meanings Thesaurus::lookup(string const & text)
|
||||
return meanings;
|
||||
|
||||
// weird api, but ...
|
||||
|
||||
|
||||
int prev_meaning = -1;
|
||||
int cur_meaning;
|
||||
string meaning;
|
||||
|
||||
// correct, returns "" at the end
|
||||
// correct, returns "" at the end
|
||||
string ret = aik_->next(cur_meaning);
|
||||
|
||||
|
||||
while (!ret.empty()) {
|
||||
if (cur_meaning != prev_meaning) {
|
||||
meaning = ret;
|
||||
@ -52,9 +52,9 @@ Thesaurus::Meanings Thesaurus::lookup(string const & text)
|
||||
} else {
|
||||
if (ret != text) {
|
||||
meanings[meaning].push_back(ret);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ret = aik_->next(cur_meaning);
|
||||
}
|
||||
|
||||
@ -62,7 +62,7 @@ Thesaurus::Meanings Thesaurus::lookup(string const & text)
|
||||
it != meanings.end(); ++it) {
|
||||
sort(it->second.begin(), it->second.end());
|
||||
}
|
||||
|
||||
|
||||
return meanings;
|
||||
}
|
||||
|
||||
@ -71,13 +71,13 @@ Thesaurus::Meanings Thesaurus::lookup(string const & text)
|
||||
Thesaurus::Thesaurus()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Thesaurus::~Thesaurus()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
Thesaurus::Meanings Thesaurus::lookup(string const &)
|
||||
{
|
||||
return Meanings();
|
||||
@ -86,4 +86,4 @@ Thesaurus::Meanings Thesaurus::lookup(string const &)
|
||||
#endif // HAVE_LIBAIKSAURUS
|
||||
|
||||
// Global instance
|
||||
Thesaurus thesaurus;
|
||||
Thesaurus thesaurus;
|
||||
|
@ -9,15 +9,15 @@
|
||||
|
||||
#ifndef THESAURUS_H
|
||||
#define THESAURUS_H
|
||||
|
||||
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
|
||||
#include "LString.h"
|
||||
#ifdef HAVE_LIBAIKSAURUS
|
||||
#include "Aiksaurus.h"
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* This class provides an interface to whatever thesauri we might support.
|
||||
*/
|
||||
@ -30,7 +30,7 @@ public:
|
||||
~Thesaurus();
|
||||
|
||||
typedef std::map<string, std::vector<string> > Meanings;
|
||||
|
||||
|
||||
/**
|
||||
* look up some text in the thesaurus
|
||||
*/
|
||||
@ -41,7 +41,7 @@ private:
|
||||
Aiksaurus * aik_;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
extern Thesaurus thesaurus;
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
* Copyright 1995 Matthias Ettrich
|
||||
@ -62,7 +62,7 @@ void ToolbarDefaults::add(int action)
|
||||
}
|
||||
|
||||
|
||||
void ToolbarDefaults::init()
|
||||
void ToolbarDefaults::init()
|
||||
{
|
||||
add(LAYOUTS);
|
||||
add(LFUN_FILE_OPEN);
|
||||
@ -75,19 +75,19 @@ void ToolbarDefaults::init()
|
||||
add(LFUN_COPY);
|
||||
add(LFUN_PASTE);
|
||||
add(SEPARATOR);
|
||||
|
||||
|
||||
add(LFUN_EMPH);
|
||||
add(LFUN_NOUN);
|
||||
add(LFUN_FREE);
|
||||
add(SEPARATOR);
|
||||
|
||||
|
||||
add(LFUN_INSET_FOOTNOTE);
|
||||
add(LFUN_INSET_MARGINAL);
|
||||
|
||||
add(LFUN_DEPTH_PLUS);
|
||||
add(SEPARATOR);
|
||||
|
||||
add(LFUN_MATH_MODE);
|
||||
add(LFUN_MATH_MODE);
|
||||
add(SEPARATOR);
|
||||
|
||||
add(LFUN_INSET_GRAPHICS);
|
||||
@ -95,7 +95,7 @@ void ToolbarDefaults::init()
|
||||
}
|
||||
|
||||
|
||||
void ToolbarDefaults::read(LyXLex & lex)
|
||||
void ToolbarDefaults::read(LyXLex & lex)
|
||||
{
|
||||
//consistency check
|
||||
if (compare_no_case(lex.getString(), "toolbar")) {
|
||||
@ -104,9 +104,9 @@ void ToolbarDefaults::read(LyXLex & lex)
|
||||
}
|
||||
|
||||
defaults.clear();
|
||||
|
||||
|
||||
bool quit = false;
|
||||
|
||||
|
||||
lex.pushTable(toolTags, TO_LAST - 1);
|
||||
|
||||
if (lyxerr.debugging(Debug::PARSER))
|
||||
@ -123,19 +123,19 @@ void ToolbarDefaults::read(LyXLex & lex)
|
||||
add(func);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case TO_SEPARATOR:
|
||||
add(SEPARATOR);
|
||||
break;
|
||||
|
||||
|
||||
case TO_LAYOUTS:
|
||||
add(LAYOUTS);
|
||||
break;
|
||||
|
||||
|
||||
case TO_NEWLINE:
|
||||
add(NEWLINE);
|
||||
break;
|
||||
|
||||
|
||||
case TO_ENDTOOLBAR:
|
||||
quit = true;
|
||||
break;
|
||||
@ -155,7 +155,7 @@ void ToolbarDefaults::add(string const & func)
|
||||
|
||||
if (tf == -1) {
|
||||
lyxerr << "Toolbar::add: no LyX command called `"
|
||||
<< func << "' exists!" << endl;
|
||||
<< func << "' exists!" << endl;
|
||||
} else {
|
||||
add(tf);
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
// -*- C++ -*-
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
* Copyright 1995 Matthias Ettrich
|
||||
@ -27,7 +27,7 @@ class LyXLex;
|
||||
///
|
||||
class ToolbarDefaults {
|
||||
public:
|
||||
/// The special toolbar actions
|
||||
/// The special toolbar actions
|
||||
enum ItemType {
|
||||
/// adds space between buttons in the toolbar
|
||||
SEPARATOR=-3,
|
||||
|
@ -1,8 +1,8 @@
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
*
|
||||
* Copyright 1995 Matthias Ettrich
|
||||
* Copyright 1995-2001 the LyX Team.
|
||||
*
|
||||
@ -22,7 +22,7 @@ void Variables::set(string const & var, string const & val)
|
||||
{
|
||||
// We want to use const_iterator (Lgb)
|
||||
Vars::iterator cit = vars_.find(var);
|
||||
if (cit != vars_.end())
|
||||
if (cit != vars_.end())
|
||||
vars_.erase(var);
|
||||
vars_[var] = val;;
|
||||
}
|
||||
@ -31,9 +31,9 @@ void Variables::set(string const & var, string const & val)
|
||||
string const Variables::get(string const & var) const
|
||||
{
|
||||
Vars::const_iterator cit = vars_.find(var);
|
||||
if (cit != vars_.end())
|
||||
if (cit != vars_.end())
|
||||
return cit->second;
|
||||
else
|
||||
else
|
||||
return string();
|
||||
}
|
||||
|
||||
@ -41,7 +41,7 @@ string const Variables::get(string const & var) const
|
||||
bool Variables::isSet(string const & var) const
|
||||
{
|
||||
Vars::const_iterator cit = vars_.find(var);
|
||||
return (cit != vars_.end());
|
||||
return (cit != vars_.end());
|
||||
}
|
||||
|
||||
|
||||
@ -80,4 +80,3 @@ int main() {
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
// -*- C++ -*-
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
*
|
||||
* Copyright 1995 Matthias Ettrich
|
||||
* Copyright 1995-2001 the LyX Team.
|
||||
*
|
||||
@ -23,13 +23,13 @@
|
||||
///
|
||||
class Variables {
|
||||
public:
|
||||
///
|
||||
///
|
||||
void set(string const &, string const &);
|
||||
///
|
||||
///
|
||||
string const get(string const &) const;
|
||||
///
|
||||
bool isSet(string const & var) const;
|
||||
///
|
||||
///
|
||||
string const expand(string const &) const;
|
||||
private:
|
||||
///
|
||||
|
@ -1,8 +1,8 @@
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
*
|
||||
* Copyright 1995 Matthias Ettrich
|
||||
* Copyright 1995-2001 The LyX Team.
|
||||
*
|
||||
@ -34,7 +34,7 @@
|
||||
// xforms doesn't define this (but it should be in <forms.h>).
|
||||
extern "C"
|
||||
FL_APPEVENT_CB fl_set_preemptive_callback(Window, FL_APPEVENT_CB, void *);
|
||||
|
||||
|
||||
using std::endl;
|
||||
using std::abs;
|
||||
using std::hex;
|
||||
@ -54,26 +54,26 @@ extern "C" {
|
||||
// Just a bunch of C wrappers around static members of WorkArea
|
||||
static
|
||||
void C_WorkArea_scroll_cb(FL_OBJECT * ob, long buf)
|
||||
{
|
||||
{
|
||||
WorkArea::scroll_cb(ob, buf);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
static
|
||||
int C_WorkArea_work_area_handler(FL_OBJECT * ob, int event,
|
||||
FL_Coord, FL_Coord,
|
||||
FL_Coord, FL_Coord,
|
||||
int key, void * xev)
|
||||
{
|
||||
{
|
||||
return WorkArea::work_area_handler(ob, event,
|
||||
0, 0, key, xev);
|
||||
}
|
||||
}
|
||||
|
||||
static
|
||||
int C_WorkAreaEventCB(FL_FORM * form, void * xev) {
|
||||
WorkArea * wa = static_cast<WorkArea*>(form->u_vdata);
|
||||
int ret = wa->event_cb(static_cast<XEvent*>(xev));
|
||||
int ret = wa->event_cb(static_cast<XEvent*>(xev));
|
||||
lyxerr << "Pending: " << XPending(fl_get_display()) << endl;
|
||||
|
||||
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
@ -115,7 +115,7 @@ WorkArea::WorkArea(int xpos, int ypos, int width, int height)
|
||||
int const splash_y = ypos + (height - splash_h) / 2;
|
||||
splash_ = obj =
|
||||
fl_add_pixmapbutton(FL_NORMAL_BUTTON,
|
||||
splash_x, splash_y,
|
||||
splash_x, splash_y,
|
||||
splash_w, splash_h, "");
|
||||
fl_set_pixmapbutton_file(obj, splash_file.c_str());
|
||||
fl_set_pixmapbutton_focus_outline(obj, 3);
|
||||
@ -148,7 +148,7 @@ WorkArea::WorkArea(int xpos, int ypos, int width, int height)
|
||||
obj->u_vdata = this;
|
||||
fl_set_object_callback(obj, C_WorkArea_scroll_cb, 0);
|
||||
setScrollbarBounds(0.0, 0.0);
|
||||
|
||||
|
||||
///
|
||||
/// The free object
|
||||
|
||||
@ -162,7 +162,7 @@ WorkArea::WorkArea(int xpos, int ypos, int width, int height)
|
||||
<< xpos + bw << '+' << ypos + bw << ' '
|
||||
<< width - 15 - 2 * bw << 'x'
|
||||
<< height - 2 * bw << endl;
|
||||
|
||||
|
||||
work_area = obj = fl_add_free(FL_ALL_FREE,
|
||||
xpos + bw, ypos + bw,
|
||||
width - 15 - 2 * bw, // scrollbarwidth
|
||||
@ -177,8 +177,8 @@ WorkArea::WorkArea(int xpos, int ypos, int width, int height)
|
||||
|
||||
/// X selection hook - xforms gets it wrong
|
||||
fl_current_form->u_vdata = this;
|
||||
fl_register_raw_callback(fl_current_form, FL_ALL_EVENT, C_WorkAreaEventCB);
|
||||
|
||||
fl_register_raw_callback(fl_current_form, FL_ALL_EVENT, C_WorkAreaEventCB);
|
||||
|
||||
fl_unfreeze_all_forms();
|
||||
}
|
||||
|
||||
@ -208,7 +208,7 @@ bool WorkArea::belowMouse() const
|
||||
void WorkArea::resize(int xpos, int ypos, int width, int height)
|
||||
{
|
||||
fl_freeze_all_forms();
|
||||
|
||||
|
||||
int const bw = int(abs(fl_get_border_width()));
|
||||
|
||||
// a box
|
||||
@ -245,7 +245,7 @@ void destroy_object(FL_OBJECT * obj)
|
||||
fl_free_object(obj);
|
||||
}
|
||||
} // namespace anon
|
||||
|
||||
|
||||
|
||||
void WorkArea::createPixmap(int width, int height)
|
||||
{
|
||||
@ -264,7 +264,7 @@ void WorkArea::createPixmap(int width, int height)
|
||||
|
||||
if (cur_width == width && cur_height == height && workareapixmap)
|
||||
return;
|
||||
|
||||
|
||||
cur_width = width;
|
||||
cur_height = height;
|
||||
|
||||
@ -274,11 +274,11 @@ void WorkArea::createPixmap(int width, int height)
|
||||
if (lyxerr.debugging(Debug::WORKAREA))
|
||||
lyxerr << "Creating pixmap ("
|
||||
<< width << 'x' << height << ")" << endl;
|
||||
|
||||
|
||||
workareapixmap = XCreatePixmap(fl_get_display(),
|
||||
RootWindow(fl_get_display(), 0),
|
||||
width,
|
||||
height,
|
||||
height,
|
||||
fl_get_visual_depth());
|
||||
if (lyxerr.debugging(Debug::WORKAREA))
|
||||
lyxerr << "\tpixmap=" << workareapixmap << endl;
|
||||
@ -339,12 +339,12 @@ int WorkArea::work_area_handler(FL_OBJECT * ob, int event,
|
||||
static int x_old = -1;
|
||||
static int y_old = -1;
|
||||
static long scrollbar_value_old = -1;
|
||||
|
||||
|
||||
XEvent * ev = static_cast<XEvent*>(xev);
|
||||
WorkArea * area = static_cast<WorkArea*>(ob->u_vdata);
|
||||
|
||||
if (!area) return 1;
|
||||
|
||||
|
||||
switch (event) {
|
||||
case FL_DRAW:
|
||||
if (!area->work_area ||
|
||||
@ -362,7 +362,7 @@ int WorkArea::work_area_handler(FL_OBJECT * ob, int event,
|
||||
ev->xbutton.y - ob->y,
|
||||
ev->xbutton.button);
|
||||
//area->workAreaKeyPress(XK_Pointer_Button1, ev->xbutton.state);
|
||||
break;
|
||||
break;
|
||||
case FL_RELEASE:
|
||||
if (!ev || ev->xbutton.button == 0) break;
|
||||
// Should really have used xbutton.state
|
||||
@ -394,7 +394,7 @@ int WorkArea::work_area_handler(FL_OBJECT * ob, int event,
|
||||
#endif
|
||||
{
|
||||
lyxerr[Debug::WORKAREA] << "Workarea event: KEYBOARD" << endl;
|
||||
|
||||
|
||||
KeySym keysym = 0;
|
||||
char dummy[1];
|
||||
XKeyEvent * xke = reinterpret_cast<XKeyEvent *>(ev);
|
||||
@ -410,7 +410,7 @@ int WorkArea::work_area_handler(FL_OBJECT * ob, int event,
|
||||
char const * tmp2 = XKeysymToString(keysym);
|
||||
string const stm = (tmp ? tmp : "");
|
||||
string const stm2 = (tmp2 ? tmp2 : "");
|
||||
|
||||
|
||||
lyxerr[Debug::KEY] << "WorkArea: Key is `" << stm << "' ["
|
||||
<< key << "]" << endl;
|
||||
lyxerr[Debug::KEY] << "WorkArea: Keysym is `" << stm2 << "' ["
|
||||
@ -456,7 +456,7 @@ int WorkArea::work_area_handler(FL_OBJECT * ob, int event,
|
||||
<< endl;
|
||||
//}
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
unsigned int const ret_state = xke->state;
|
||||
|
||||
@ -489,7 +489,7 @@ int WorkArea::work_area_handler(FL_OBJECT * ob, int event,
|
||||
last_time_pressed = xke->time;
|
||||
last_key_pressed = xke->keycode;
|
||||
last_state_pressed = ret_state;
|
||||
|
||||
|
||||
area->workAreaKeyPress(ret_key, ret_state);
|
||||
}
|
||||
break;
|
||||
@ -535,7 +535,7 @@ int WorkArea::work_area_handler(FL_OBJECT * ob, int event,
|
||||
lyxerr[Debug::WORKAREA] << "Workarea event: OTHER" << endl;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -546,13 +546,13 @@ string clipboard_selection;
|
||||
bool clipboard_read = false;
|
||||
|
||||
extern "C" {
|
||||
|
||||
|
||||
static
|
||||
int request_clipboard_cb(FL_OBJECT * /*ob*/, long /*type*/,
|
||||
void const * data, long size)
|
||||
void const * data, long size)
|
||||
{
|
||||
clipboard_selection.erase();
|
||||
|
||||
|
||||
if (size > 0)
|
||||
clipboard_selection.reserve(size);
|
||||
for (int i = 0; i < size; ++i)
|
||||
@ -580,7 +580,7 @@ int WorkArea::event_cb(XEvent * xev)
|
||||
lyxerr[Debug::GUI] << "Lost selection." << endl;
|
||||
selectionLost.emit();
|
||||
// ret = 1;
|
||||
break;
|
||||
break;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@ -592,24 +592,24 @@ void WorkArea::haveSelection(bool yes) const
|
||||
XSetSelectionOwner(fl_get_display(), XA_PRIMARY, None, CurrentTime);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
XSetSelectionOwner(fl_get_display(), XA_PRIMARY, FL_ObjWin(work_area), CurrentTime);
|
||||
}
|
||||
|
||||
|
||||
string const WorkArea::getClipboard() const
|
||||
|
||||
string const WorkArea::getClipboard() const
|
||||
{
|
||||
clipboard_read = false;
|
||||
|
||||
|
||||
if (fl_request_clipboard(work_area, 0, request_clipboard_cb) == -1)
|
||||
return string();
|
||||
|
||||
XEvent ev;
|
||||
|
||||
|
||||
while (!clipboard_read) {
|
||||
if (fl_check_forms() == FL_EVENT) {
|
||||
fl_XNextEvent(&ev);
|
||||
lyxerr << "Received unhandled X11 event" << endl;
|
||||
lyxerr << "Received unhandled X11 event" << endl;
|
||||
lyxerr << "Type: 0x" << hex << ev.xany.type <<
|
||||
" Target: 0x" << hex << ev.xany.window << endl;
|
||||
}
|
||||
@ -617,11 +617,11 @@ string const WorkArea::getClipboard() const
|
||||
return clipboard_selection;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void WorkArea::putClipboard(string const & s) const
|
||||
{
|
||||
static string hold;
|
||||
hold = s;
|
||||
|
||||
|
||||
fl_stuff_clipboard(work_area, 0, hold.data(), hold.size(), 0);
|
||||
}
|
||||
|
@ -1,9 +1,9 @@
|
||||
// -*- C++ -*-
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
*
|
||||
* Copyright 1995 Matthias Ettrich
|
||||
* Copyright 1995-2001 The LyX Team.
|
||||
*
|
||||
@ -130,16 +130,16 @@ public:
|
||||
SigC::Signal0<void> selectionRequested;
|
||||
/// emitted when another X client has stolen our selection
|
||||
SigC::Signal0<void> selectionLost;
|
||||
|
||||
|
||||
/// handles SelectionRequest X Event, to fill the clipboard
|
||||
int event_cb(XEvent * xev);
|
||||
private:
|
||||
///
|
||||
void createPixmap(int, int);
|
||||
|
||||
|
||||
///
|
||||
FL_OBJECT * backgroundbox;
|
||||
///
|
||||
///
|
||||
FL_OBJECT * work_area;
|
||||
///
|
||||
FL_OBJECT * scrollbar;
|
||||
|
@ -1,9 +1,8 @@
|
||||
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
*
|
||||
* Copyright 1995 Matthias Ettrich
|
||||
* Copyright 1995-2001 The LyX Team.
|
||||
*
|
||||
@ -41,13 +40,13 @@ extern void QuitLyX();
|
||||
BufferView * current_view;
|
||||
|
||||
extern "C" {
|
||||
|
||||
|
||||
static
|
||||
int C_XFormsView_atCloseMainFormCB(FL_FORM * form, void * p)
|
||||
{
|
||||
return XFormsView::atCloseMainFormCB(form, p);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -62,7 +61,7 @@ XFormsView::XFormsView(int width, int height)
|
||||
&LyXFunc::miniDispatch));
|
||||
minibuffer->timeout.connect(SigC::slot(getLyXFunc(),
|
||||
&LyXFunc::initMiniBuffer));
|
||||
|
||||
|
||||
// Make sure the buttons are disabled if needed.
|
||||
updateToolbar();
|
||||
}
|
||||
@ -113,10 +112,10 @@ void XFormsView::show(int place, int border, string const & title)
|
||||
void XFormsView::create_form_form_main(int width, int height)
|
||||
/* to make this work as it should, .lyxrc should have been
|
||||
* read first; OR maybe this one should be made dynamic.
|
||||
* Hmmmm. Lgb.
|
||||
* Hmmmm. Lgb.
|
||||
* We will probably not have lyxrc before the main form is
|
||||
* initialized, because error messages from lyxrc parsing
|
||||
* are presented (and rightly so) in GUI popups. Asger.
|
||||
* initialized, because error messages from lyxrc parsing
|
||||
* are presented (and rightly so) in GUI popups. Asger.
|
||||
*/
|
||||
{
|
||||
// the main form
|
||||
@ -128,7 +127,7 @@ void XFormsView::create_form_form_main(int width, int height)
|
||||
// Parameters for the appearance of the main form
|
||||
int const air = 2;
|
||||
int const bw = abs(fl_get_border_width());
|
||||
|
||||
|
||||
//
|
||||
// THE MENUBAR
|
||||
//
|
||||
@ -158,7 +157,7 @@ void XFormsView::create_form_form_main(int width, int height)
|
||||
// MINIBUFFER
|
||||
//
|
||||
|
||||
minibuffer = new MiniBuffer(this, air, height - (25 + air),
|
||||
minibuffer = new MiniBuffer(this, air, height - (25 + air),
|
||||
width - (2 * air), 25);
|
||||
|
||||
//
|
||||
@ -166,12 +165,12 @@ void XFormsView::create_form_form_main(int width, int height)
|
||||
//
|
||||
|
||||
autosave_timeout->timeout.connect(SigC::slot(this, &XFormsView::AutoSave));
|
||||
|
||||
|
||||
//
|
||||
// Misc
|
||||
//
|
||||
|
||||
// assign an icon to main form
|
||||
// assign an icon to main form
|
||||
string iconname = LibFileSearch("images", "lyx", "xpm");
|
||||
if (!iconname.empty()) {
|
||||
unsigned int w, h;
|
||||
@ -189,10 +188,10 @@ void XFormsView::create_form_form_main(int width, int height)
|
||||
|
||||
// set min size
|
||||
fl_set_form_minsize(form_, 50, 50);
|
||||
|
||||
|
||||
fl_end_form();
|
||||
|
||||
minibuffer->dd_init();
|
||||
minibuffer->dd_init();
|
||||
}
|
||||
|
||||
|
||||
@ -202,7 +201,7 @@ void XFormsView::init()
|
||||
invalidateLayoutChoice();
|
||||
updateLayoutChoice();
|
||||
updateMenubar();
|
||||
|
||||
|
||||
// Start autosave timer
|
||||
if (lyxrc.autosave) {
|
||||
autosave_timeout->setTimeout(lyxrc.autosave * 1000);
|
||||
@ -233,14 +232,14 @@ void XFormsView::prohibitInput() const
|
||||
|
||||
static Cursor cursor;
|
||||
static bool cursor_undefined = true;
|
||||
|
||||
|
||||
if (cursor_undefined) {
|
||||
cursor = XCreateFontCursor(fl_get_display(), XC_watch);
|
||||
XFlush(fl_get_display());
|
||||
cursor_undefined = false;
|
||||
}
|
||||
|
||||
/* set the cursor to the watch for all forms and the canvas */
|
||||
|
||||
/* set the cursor to the watch for all forms and the canvas */
|
||||
XDefineCursor(fl_get_display(), getForm()->window, cursor);
|
||||
|
||||
XFlush(fl_get_display());
|
||||
@ -251,7 +250,7 @@ void XFormsView::prohibitInput() const
|
||||
void XFormsView::allowInput() const
|
||||
{
|
||||
/* reset the cursor from the watch for all forms and the canvas */
|
||||
|
||||
|
||||
XUndefineCursor(fl_get_display(), getForm()->window);
|
||||
|
||||
XFlush(fl_get_display());
|
||||
|
@ -1,9 +1,9 @@
|
||||
// -*- C++ -*-
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
*
|
||||
* Copyright 1995 Matthias Ettrich
|
||||
* Copyright 1995-2001 The LyX Team.
|
||||
*
|
||||
@ -53,7 +53,7 @@ private:
|
||||
virtual void setWindowTitle(string const &, string const &);
|
||||
/// makes the main form.
|
||||
void create_form_form_main(int width, int height);
|
||||
/// A pointer to the form.
|
||||
/// A pointer to the form.
|
||||
FL_FORM * form_;
|
||||
};
|
||||
#endif
|
||||
|
@ -24,7 +24,7 @@ bool Box::contained(int x, int y)
|
||||
y1 < y && y2 > y);
|
||||
}
|
||||
|
||||
|
||||
|
||||
ostream & operator<<(ostream & o, Box const & b)
|
||||
{
|
||||
return o << "x1,y1: " << b.x1 << "," << b.y1
|
||||
|
@ -36,8 +36,8 @@ struct Box {
|
||||
*/
|
||||
bool contained(int x, int y);
|
||||
};
|
||||
|
||||
|
||||
|
||||
std::ostream & operator<<(std::ostream &, Box const &);
|
||||
|
||||
|
||||
#endif // BOX_H
|
||||
|
@ -1,13 +1,13 @@
|
||||
/* -*- C++ -*- */
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
*
|
||||
* Copyright 1995 Matthias Ettrich
|
||||
* Copyright 1995-2001 The LyX Team
|
||||
*
|
||||
* ======================================================
|
||||
* ======================================================
|
||||
A few prototypes missing from Sun and SCO 3.2v4 header files */
|
||||
|
||||
#ifndef BROKEN_HEADERS_H
|
||||
|
@ -1,15 +1,15 @@
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Word Processor
|
||||
*
|
||||
* Copyright 1995 Matthias Ettrich
|
||||
* Copyright 1995-2001 The LyX Team.
|
||||
* Copyright 1995-2001 The LyX Team.
|
||||
*
|
||||
* This file is Copyright 1996-2001
|
||||
* Lars Gullik Bjønnes
|
||||
*
|
||||
* ======================================================
|
||||
* ======================================================
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
@ -124,7 +124,7 @@ bool BufferList::qwriteOne(Buffer * buf, string const & fname,
|
||||
if (buf->isUnnamed()) {
|
||||
removeAutosaveFile(buf->fileName());
|
||||
}
|
||||
|
||||
|
||||
unsaved_list += MakeDisplayPath(fname, 50) + "\n";
|
||||
return true;
|
||||
case 3: // Cancel
|
||||
@ -134,7 +134,7 @@ bool BufferList::qwriteOne(Buffer * buf, string const & fname,
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool BufferList::qwriteAll()
|
||||
{
|
||||
string unsaved;
|
||||
@ -151,10 +151,10 @@ bool BufferList::qwriteAll()
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!unsaved.empty() && lyxrc.exit_confirmation) {
|
||||
return Alert::askQuestion(_("Some documents were not saved:"),
|
||||
unsaved, _("Exit anyway?"));
|
||||
unsaved, _("Exit anyway?"));
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -167,7 +167,7 @@ void BufferList::closeAll()
|
||||
// Since we are closing we can just as well delete all
|
||||
// in the textcache this will also speed the closing/quiting up a bit.
|
||||
textcache.clear();
|
||||
|
||||
|
||||
while (!bstore.empty()) {
|
||||
close(bstore.front());
|
||||
}
|
||||
@ -178,14 +178,14 @@ void BufferList::closeAll()
|
||||
bool BufferList::close(Buffer * buf)
|
||||
{
|
||||
lyx::Assert(buf);
|
||||
|
||||
|
||||
// CHECK
|
||||
// Trace back why we need to use buf->getUser here.
|
||||
// Perhaps slight rewrite is in order? (Lgb)
|
||||
|
||||
if (buf->getUser())
|
||||
|
||||
if (buf->getUser())
|
||||
buf->getUser()->insetUnlock();
|
||||
|
||||
|
||||
if (buf->paragraph && !buf->isLyxClean() && !quitting) {
|
||||
if (buf->getUser())
|
||||
buf->getUser()->owner()->prohibitInput();
|
||||
@ -260,7 +260,7 @@ Buffer * BufferList::getBuffer(unsigned int choice)
|
||||
int BufferList::unlockInset(UpdatableInset * inset)
|
||||
{
|
||||
lyx::Assert(inset);
|
||||
|
||||
|
||||
BufferStorage::iterator it = bstore.begin();
|
||||
BufferStorage::iterator end = bstore.end();
|
||||
for (; it != end; ++it) {
|
||||
@ -298,21 +298,21 @@ void BufferList::emergencyWriteAll()
|
||||
}
|
||||
|
||||
|
||||
void BufferList::emergencyWrite(Buffer * buf)
|
||||
void BufferList::emergencyWrite(Buffer * buf)
|
||||
{
|
||||
// assert(buf) // this is not good since C assert takes an int
|
||||
// and a pointer is a long (JMarc)
|
||||
// and a pointer is a long (JMarc)
|
||||
assert(buf != 0); // use c assert to avoid a loop
|
||||
|
||||
|
||||
|
||||
// No need to save if the buffer has not changed.
|
||||
if (buf->isLyxClean())
|
||||
return;
|
||||
|
||||
|
||||
lyxerr << fmt(_("lyx: Attempting to save document %s as..."),
|
||||
buf->isUnnamed() ? OnlyFilename(buf->fileName()).c_str()
|
||||
: buf->fileName().c_str()) << endl;
|
||||
|
||||
|
||||
// We try to save three places:
|
||||
|
||||
// 1) Same place as document. Unless it is an unnamed doc.
|
||||
@ -328,7 +328,7 @@ void BufferList::emergencyWrite(Buffer * buf)
|
||||
lyxerr << _(" Save failed! Trying...") << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 2) In HOME directory.
|
||||
string s = AddName(GetEnvPath("HOME"), buf->fileName());
|
||||
s += ".emergency";
|
||||
@ -338,9 +338,9 @@ void BufferList::emergencyWrite(Buffer * buf)
|
||||
lyxerr << _(" Save seems successful. Phew.") << endl;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
lyxerr << _(" Save failed! Trying...") << endl;
|
||||
|
||||
|
||||
// 3) In "/tmp" directory.
|
||||
// MakeAbsPath to prepend the current
|
||||
// drive letter on OS/2
|
||||
@ -366,11 +366,11 @@ Buffer * BufferList::readFile(string const & s, bool ronly)
|
||||
FileInfo fileInfo2(s);
|
||||
|
||||
if (!fileInfo2.exist()) {
|
||||
Alert::alert(_("Error!"), _("Cannot open file"),
|
||||
Alert::alert(_("Error!"), _("Cannot open file"),
|
||||
MakeDisplayPath(s));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Buffer * b = bstore.newBuffer(s, ronly);
|
||||
|
||||
// Check if emergency save file exists and is newer.
|
||||
@ -443,7 +443,7 @@ bool BufferList::exists(string const & s) const
|
||||
bool BufferList::isLoaded(Buffer const * b) const
|
||||
{
|
||||
lyx::Assert(b);
|
||||
|
||||
|
||||
BufferStorage::const_iterator cit =
|
||||
find(bstore.begin(), bstore.end(), b);
|
||||
return cit != bstore.end();
|
||||
@ -495,7 +495,7 @@ Buffer * BufferList::newFile(string const & name, string tname, bool isNamed)
|
||||
}
|
||||
|
||||
b->setReadonly(false);
|
||||
|
||||
|
||||
return b;
|
||||
}
|
||||
|
||||
@ -511,7 +511,7 @@ Buffer * BufferList::loadLyXFile(string const & filename, bool tolastfiles)
|
||||
|
||||
// file already open?
|
||||
if (exists(s)) {
|
||||
if (Alert::askQuestion(_("Document is already open:"),
|
||||
if (Alert::askQuestion(_("Document is already open:"),
|
||||
MakeDisplayPath(s, 50),
|
||||
_("Do you want to reload that document?"))) {
|
||||
// Reload is accomplished by closing and then loading
|
||||
@ -520,7 +520,7 @@ Buffer * BufferList::loadLyXFile(string const & filename, bool tolastfiles)
|
||||
}
|
||||
// Fall through to new load. (Asger)
|
||||
} else {
|
||||
// Here, we pretend that we just loaded the
|
||||
// Here, we pretend that we just loaded the
|
||||
// open document
|
||||
return getBuffer(s);
|
||||
}
|
||||
@ -542,7 +542,7 @@ Buffer * BufferList::loadLyXFile(string const & filename, bool tolastfiles)
|
||||
if (LyXVC::file_not_found_hook(s)) {
|
||||
// Ask if the file should be checked out for
|
||||
// viewing/editing, if so: load it.
|
||||
if (Alert::askQuestion(_("Do you want to retrieve file under version control?"))) {
|
||||
if (Alert::askQuestion(_("Do you want to retrieve file under version control?"))) {
|
||||
// How can we know _how_ to do the checkout?
|
||||
// With the current VC support it has to be,
|
||||
// a RCS file since CVS do not have special ,v files.
|
||||
@ -550,7 +550,7 @@ Buffer * BufferList::loadLyXFile(string const & filename, bool tolastfiles)
|
||||
return loadLyXFile(filename, tolastfiles);
|
||||
}
|
||||
}
|
||||
if (Alert::askQuestion(_("Cannot open specified file:"),
|
||||
if (Alert::askQuestion(_("Cannot open specified file:"),
|
||||
MakeDisplayPath(s, 50),
|
||||
_("Create new document with this name?")))
|
||||
{
|
||||
|
@ -87,7 +87,7 @@ private:
|
||||
class BufferList : boost::noncopyable {
|
||||
public:
|
||||
///
|
||||
BufferList();
|
||||
BufferList();
|
||||
|
||||
/// state info
|
||||
enum list_state {
|
||||
@ -99,7 +99,7 @@ public:
|
||||
|
||||
/// returns the state of the bufferlist
|
||||
list_state getState() const { return state_; }
|
||||
|
||||
|
||||
/**
|
||||
Loads a LyX file or...
|
||||
|
||||
@ -107,22 +107,22 @@ public:
|
||||
\param tolastfiles Wether the file should be put in the
|
||||
last opened files list or not.
|
||||
\return The newly loaded LyX file.
|
||||
*/
|
||||
Buffer * loadLyXFile(string const & filename,
|
||||
*/
|
||||
Buffer * loadLyXFile(string const & filename,
|
||||
bool tolastfiles = true);
|
||||
|
||||
|
||||
///
|
||||
bool empty() const;
|
||||
|
||||
///
|
||||
bool qwriteAll();
|
||||
bool qwriteAll();
|
||||
|
||||
/// Close all open buffers.
|
||||
void closeAll();
|
||||
|
||||
/**
|
||||
Read a file into a buffer readonly or not.
|
||||
\return
|
||||
\return
|
||||
*/
|
||||
Buffer * readFile(string const &, bool ro);
|
||||
|
||||
@ -139,7 +139,7 @@ public:
|
||||
|
||||
///
|
||||
void emergencyWriteAll();
|
||||
|
||||
|
||||
/**
|
||||
Close buffer.
|
||||
\param buf the buffer that should be closed
|
||||
@ -149,13 +149,13 @@ public:
|
||||
|
||||
///
|
||||
Buffer * first();
|
||||
|
||||
|
||||
/// returns true if the buffer exists already
|
||||
bool exists(string const &) const;
|
||||
|
||||
/// returns true if the buffer is loaded
|
||||
bool isLoaded(Buffer const * b) const;
|
||||
|
||||
|
||||
/// returns a pointer to the buffer with the given name.
|
||||
Buffer * getBuffer(string const &);
|
||||
/// returns a pointer to the buffer with the given number.
|
||||
@ -163,11 +163,11 @@ public:
|
||||
private:
|
||||
/// ask to save a buffer on quit
|
||||
bool qwriteOne(Buffer * buf, string const & fname,
|
||||
string & unsaved_list);
|
||||
string & unsaved_list);
|
||||
|
||||
///
|
||||
BufferStorage bstore;
|
||||
|
||||
|
||||
///
|
||||
list_state state_;
|
||||
///
|
||||
|
@ -1,8 +1,8 @@
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
*
|
||||
* Copyright 1995 Matthias Ettrich
|
||||
* Copyright 1995-2001 The LyX Team.
|
||||
*
|
||||
@ -39,7 +39,7 @@ BufferParams::BufferParams()
|
||||
: textclass(textclasslist.NumberOfClass("article").second)
|
||||
{
|
||||
paragraph_separation = PARSEP_INDENT;
|
||||
defskip = VSpace(VSpace::MEDSKIP);
|
||||
defskip = VSpace(VSpace::MEDSKIP);
|
||||
quotes_language = InsetQuotes::EnglishQ;
|
||||
quotes_times = InsetQuotes::DoubleQ;
|
||||
fontsize = "default";
|
||||
@ -74,9 +74,9 @@ void BufferParams::writeFile(ostream & os) const
|
||||
// The top of the file is written by the buffer.
|
||||
// Prints out the buffer info into the .lyx file given by file
|
||||
|
||||
// the textclass
|
||||
os << "\\textclass " << textclasslist[textclass].name() << '\n';
|
||||
|
||||
// the textclass
|
||||
os << "\\textclass " << textclasslist[textclass].name() << '\n';
|
||||
|
||||
// then the the preamble
|
||||
if (!preamble.empty()) {
|
||||
// remove '\n' from the end of preamble
|
||||
@ -85,12 +85,12 @@ void BufferParams::writeFile(ostream & os) const
|
||||
<< tmppreamble
|
||||
<< "\n\\end_preamble\n";
|
||||
}
|
||||
|
||||
/* the options */
|
||||
|
||||
/* the options */
|
||||
if (!options.empty()) {
|
||||
os << "\\options " << options << '\n';
|
||||
}
|
||||
|
||||
|
||||
/* then the text parameters */
|
||||
if (language != ignore_language)
|
||||
os << "\\language " << language->lang() << '\n';
|
||||
@ -113,31 +113,31 @@ void BufferParams::writeFile(ostream & os) const
|
||||
<< "\n\\use_numerical_citations " << use_numerical_citations
|
||||
<< "\n\\paperorientation " << string_orientation[orientation]
|
||||
<< '\n';
|
||||
if (!paperwidth.empty())
|
||||
if (!paperwidth.empty())
|
||||
os << "\\paperwidth "
|
||||
<< VSpace(paperwidth).asLyXCommand() << '\n';
|
||||
if (!paperheight.empty())
|
||||
if (!paperheight.empty())
|
||||
os << "\\paperheight "
|
||||
<< VSpace(paperheight).asLyXCommand() << '\n';
|
||||
if (!leftmargin.empty())
|
||||
if (!leftmargin.empty())
|
||||
os << "\\leftmargin "
|
||||
<< VSpace(leftmargin).asLyXCommand() << '\n';
|
||||
if (!topmargin.empty())
|
||||
if (!topmargin.empty())
|
||||
os << "\\topmargin "
|
||||
<< VSpace(topmargin).asLyXCommand() << '\n';
|
||||
if (!rightmargin.empty())
|
||||
if (!rightmargin.empty())
|
||||
os << "\\rightmargin "
|
||||
<< VSpace(rightmargin).asLyXCommand() << '\n';
|
||||
if (!bottommargin.empty())
|
||||
if (!bottommargin.empty())
|
||||
os << "\\bottommargin "
|
||||
<< VSpace(bottommargin).asLyXCommand() << '\n';
|
||||
if (!headheight.empty())
|
||||
if (!headheight.empty())
|
||||
os << "\\headheight "
|
||||
<< VSpace(headheight).asLyXCommand() << '\n';
|
||||
if (!headsep.empty())
|
||||
if (!headsep.empty())
|
||||
os << "\\headsep "
|
||||
<< VSpace(headsep).asLyXCommand() << '\n';
|
||||
if (!footskip.empty())
|
||||
if (!footskip.empty())
|
||||
os << "\\footskip "
|
||||
<< VSpace(footskip).asLyXCommand() << '\n';
|
||||
os << "\\secnumdepth " << secnumdepth
|
||||
@ -151,7 +151,7 @@ void BufferParams::writeFile(ostream & os) const
|
||||
// An output operator for insetquotes would be nice
|
||||
case InsetQuotes::SingleQ:
|
||||
os << "\\quotes_times 1\n"; break;
|
||||
case InsetQuotes::DoubleQ:
|
||||
case InsetQuotes::DoubleQ:
|
||||
os << "\\quotes_times 2\n"; break;
|
||||
}
|
||||
os << "\\papercolumns " << columns
|
||||
@ -223,7 +223,7 @@ void BufferParams::useClassDefaults()
|
||||
bool BufferParams::hasClassDefaults() const
|
||||
{
|
||||
LyXTextClass const & tclass = textclasslist[textclass];
|
||||
|
||||
|
||||
return (sides == tclass.sides()
|
||||
&& columns == tclass.columns()
|
||||
&& pagestyle == tclass.pagestyle()
|
||||
@ -246,7 +246,7 @@ void BufferParams::readPreamble(LyXLex & lex)
|
||||
void BufferParams::readLanguage(LyXLex & lex)
|
||||
{
|
||||
if (!lex.next()) return;
|
||||
|
||||
|
||||
string const tmptok = lex.getString();
|
||||
|
||||
// check if tmptok is part of tex_babel in tex-defs.h
|
||||
@ -264,14 +264,14 @@ void BufferParams::readLanguage(LyXLex & lex)
|
||||
void BufferParams::readGraphicsDriver(LyXLex & lex)
|
||||
{
|
||||
if (!lex.next()) return;
|
||||
|
||||
|
||||
string const tmptok = lex.getString();
|
||||
// check if tmptok is part of tex_graphics in tex_defs.h
|
||||
int n = 0;
|
||||
while (true) {
|
||||
string const test = tex_graphics[n++];
|
||||
|
||||
if (test == tmptok) {
|
||||
|
||||
if (test == tmptok) {
|
||||
graphicsDriver = tmptok;
|
||||
break;
|
||||
} else if (test == "last_item") {
|
||||
@ -280,6 +280,6 @@ void BufferParams::readGraphicsDriver(LyXLex & lex)
|
||||
" Setting graphics driver to `default'.\n");
|
||||
graphicsDriver = "default";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,9 @@
|
||||
// -*- C++ -*-
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
*
|
||||
* Copyright 1995 Matthias Ettrich
|
||||
* Copyright 1995-2001 The LyX Team.
|
||||
*
|
||||
@ -130,19 +130,19 @@ public:
|
||||
/** Wether paragraphs are separated by using a indent like in
|
||||
articles or by using a little skip like in letters.
|
||||
*/
|
||||
PARSEP paragraph_separation;
|
||||
PARSEP paragraph_separation;
|
||||
///
|
||||
InsetQuotes::quote_language quotes_language;
|
||||
///
|
||||
InsetQuotes::quote_times quotes_times;
|
||||
///
|
||||
string fontsize;
|
||||
string fontsize;
|
||||
///
|
||||
lyx::textclass_type textclass;
|
||||
lyx::textclass_type textclass;
|
||||
|
||||
/* this are for the PaperLayout */
|
||||
/// the general papersize (papersize2 or paperpackage
|
||||
char papersize; // add apprip. signedness
|
||||
char papersize; // add apprip. signedness
|
||||
/// the selected Geometry papersize
|
||||
char papersize2; // add approp. signedness
|
||||
/// a special paperpackage .sty-file
|
||||
|
@ -1,8 +1,8 @@
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
*
|
||||
* Copyright 1995 Matthias Ettrich
|
||||
* Copyright 1995-2001 The LyX Team.
|
||||
*
|
||||
@ -81,7 +81,7 @@ void changeDepth(BufferView * bv, LyXText * text, int decInc)
|
||||
{
|
||||
if (!bv->available() || !text)
|
||||
return;
|
||||
|
||||
|
||||
bv->hideCursor();
|
||||
bv->update(bv->text, BufferView::SELECT|BufferView::FITCUR);
|
||||
if (decInc >= 0)
|
||||
@ -124,7 +124,7 @@ void styleReset(BufferView * bv)
|
||||
{
|
||||
#ifndef INHERIT_LANG
|
||||
LyXFont font(LyXFont::ALL_INHERIT, ignore_language);
|
||||
#else
|
||||
#else
|
||||
LyXFont font(LyXFont::ALL_INHERIT);
|
||||
#endif
|
||||
toggleAndShow(bv, font);
|
||||
@ -147,12 +147,12 @@ void fontSize(BufferView * bv, string const & size)
|
||||
}
|
||||
|
||||
|
||||
// Returns the current font and depth as a message.
|
||||
// Returns the current font and depth as a message.
|
||||
string const currentState(BufferView * bv)
|
||||
{
|
||||
ostringstream state;
|
||||
|
||||
if (bv->available()) {
|
||||
if (bv->available()) {
|
||||
// I think we should only show changes from the default
|
||||
// font. (Asger)
|
||||
LyXText * text = bv->getLyXText();
|
||||
@ -164,12 +164,12 @@ string const currentState(BufferView * bv)
|
||||
|
||||
state << _("Font:") << ' '
|
||||
<< font.stateText(&buffer->params);
|
||||
|
||||
|
||||
// The paragraph depth
|
||||
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()) {
|
||||
@ -180,7 +180,7 @@ string const currentState(BufferView * bv)
|
||||
switch (cur_space) {
|
||||
case Spacing::Single:
|
||||
state << _("Single");
|
||||
|
||||
|
||||
break;
|
||||
case Spacing::Onehalf:
|
||||
state << _("Onehalf");
|
||||
@ -211,7 +211,7 @@ string const currentState(BufferView * bv)
|
||||
*/
|
||||
void toggleAndShow(BufferView * bv, LyXFont const & font, bool toggleall)
|
||||
{
|
||||
if (bv->available()) {
|
||||
if (bv->available()) {
|
||||
if (bv->theLockingInset()) {
|
||||
bv->theLockingInset()->setFont(bv, font, toggleall);
|
||||
return;
|
||||
@ -229,7 +229,7 @@ void toggleAndShow(BufferView * bv, LyXFont const & font, bool toggleall)
|
||||
font.number() != LyXFont::IGNORE) {
|
||||
LyXCursor & cursor = text->cursor;
|
||||
text->computeBidiTables(bv->buffer(), cursor.row());
|
||||
if (cursor.boundary() !=
|
||||
if (cursor.boundary() !=
|
||||
text->isBoundary(bv->buffer(), cursor.par(), cursor.pos(),
|
||||
text->real_current_font))
|
||||
text->setCursor(bv, cursor.par(), cursor.pos(),
|
||||
|
@ -1,9 +1,9 @@
|
||||
// -*- C++ -*-
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
*
|
||||
* Copyright 1995 Matthias Ettrich
|
||||
* Copyright 1995-2001 The LyX Team.
|
||||
*
|
||||
@ -50,7 +50,7 @@ extern void styleReset(BufferView *);
|
||||
extern void underline(BufferView *);
|
||||
///
|
||||
extern void fontSize(BufferView *, string const &);
|
||||
/// Returns the current font and depth as a message.
|
||||
/// Returns the current font and depth as a message.
|
||||
extern string const currentState(BufferView *);
|
||||
///
|
||||
extern void toggleAndShow(BufferView *, LyXFont const &,
|
||||
|
@ -23,11 +23,11 @@ bool CharacterSet::loadFile(string const & fname)
|
||||
{
|
||||
map_.clear();
|
||||
name_.erase();
|
||||
|
||||
|
||||
// ascii 7-bit
|
||||
if (fname.empty() || fname == "ascii")
|
||||
return true;
|
||||
|
||||
|
||||
// open definition file
|
||||
lyxerr[Debug::KBMAP]
|
||||
<< "Reading character set file " << fname << ".cdef" << endl;
|
||||
@ -38,12 +38,12 @@ bool CharacterSet::loadFile(string const & fname)
|
||||
return true; // no definition, use 7-bit ascii
|
||||
}
|
||||
name_ = fname;
|
||||
|
||||
|
||||
string line;
|
||||
// Ok, I'll be the first to admit that this is probably not
|
||||
// the fastest way to parse the cdef files, but I though it
|
||||
// was a bit neat. Anyway it is wrong to use the lyxlex parse
|
||||
// without the use of a keyword table.
|
||||
// without the use of a keyword table.
|
||||
LRegex reg("^([12][0-9][0-9])[ \t]+\"([^ ]+)\".*");
|
||||
while (getline(ifs, line)) {
|
||||
if (reg.exact_match(line)) {
|
||||
|
@ -113,7 +113,7 @@ enum kb_action {
|
||||
LFUN_UMLAUT,
|
||||
LFUN_DOT,
|
||||
LFUN_OGONEK,
|
||||
LFUN_VECTOR, // 90 // Alejandro 040696
|
||||
LFUN_VECTOR, // 90 // Alejandro 040696
|
||||
LFUN_SELFINSERT,
|
||||
LFUN_GETBUFNAME,
|
||||
LFUN_GETXY,
|
||||
@ -214,8 +214,8 @@ enum kb_action {
|
||||
LFUN_CHILDOPEN, // Ale 970528
|
||||
LFUN_TOC_INSERT, // Lgb 97-05-27
|
||||
LFUN_FLOAT_LIST, // Lgb 20010503
|
||||
LFUN_READ_ONLY_TOGGLE, // Lgb 97-05-27
|
||||
LFUN_BIBDB_ADD, // Ale 970530
|
||||
LFUN_READ_ONLY_TOGGLE, // Lgb 97-05-27
|
||||
LFUN_BIBDB_ADD, // Ale 970530
|
||||
LFUN_BIBDB_DEL, // Ale 970530
|
||||
LFUN_BIBTEX_STYLE, // 190 // Ale 970530
|
||||
LFUN_GETTIP, // Ale 970603
|
||||
@ -259,7 +259,7 @@ enum kb_action {
|
||||
LFUN_LOFVIEW, // 230 // Dekel 20000519
|
||||
LFUN_LOTVIEW, // Dekel 20000519
|
||||
LFUN_LOAVIEW, // Dekel 20000519
|
||||
LFUN_SET_COLOR, // SLior 20000611
|
||||
LFUN_SET_COLOR, // SLior 20000611
|
||||
LFUN_INSET_EXTERNAL, // Alstrup 20000609
|
||||
LFUN_INSET_MARGINAL, // Lgb 20000626
|
||||
LFUN_INSET_MINIPAGE, // Lgb 20000627
|
||||
|
@ -1,8 +1,8 @@
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
*
|
||||
* Copyright 1995 Matthias Ettrich
|
||||
* Copyright 1995-2001 The LyX Team.
|
||||
*
|
||||
@ -72,7 +72,7 @@ bool Format::isChildFormat() const
|
||||
{
|
||||
if (name_.empty())
|
||||
return false;
|
||||
return isdigit(name_[name_.length() - 1]);
|
||||
return isdigit(name_[name_.length() - 1]);
|
||||
}
|
||||
|
||||
|
||||
@ -116,10 +116,10 @@ void Formats::add(string const & name)
|
||||
}
|
||||
|
||||
|
||||
void Formats::add(string const & name, string const & extension,
|
||||
void Formats::add(string const & name, string const & extension,
|
||||
string const & prettyname, string const & shortcut)
|
||||
{
|
||||
FormatList::iterator it =
|
||||
FormatList::iterator it =
|
||||
find_if(formatlist.begin(), formatlist.end(),
|
||||
lyx::compare_memfun(&Format::name, name));
|
||||
if (it == formatlist.end())
|
||||
@ -134,7 +134,7 @@ void Formats::add(string const & name, string const & extension,
|
||||
|
||||
void Formats::erase(string const & name)
|
||||
{
|
||||
FormatList::iterator it =
|
||||
FormatList::iterator it =
|
||||
find_if(formatlist.begin(), formatlist.end(),
|
||||
lyx::compare_memfun(&Format::name, name));
|
||||
if (it != formatlist.end())
|
||||
@ -185,10 +185,10 @@ bool Formats::view(Buffer const * buffer, string const & filename,
|
||||
if (paper_size == "letter")
|
||||
paper_size = "us";
|
||||
command += " " + paper_size;
|
||||
if (buffer->params.orientation
|
||||
if (buffer->params.orientation
|
||||
== BufferParams::ORIENTATION_LANDSCAPE)
|
||||
command += 'r';
|
||||
}
|
||||
}
|
||||
|
||||
command += " " + QuoteName(OnlyFilename((filename)));
|
||||
|
||||
@ -325,7 +325,7 @@ void Converters::add(string const & from, string const & to,
|
||||
converter.flags = flags;
|
||||
}
|
||||
converter.readFlags();
|
||||
|
||||
|
||||
if (converter.latex && (latex_command_.empty() || to == "dvi"))
|
||||
latex_command_ = subst(command, token_from, "");
|
||||
// If we have both latex & pdflatex, we set latex_command to latex.
|
||||
@ -355,10 +355,10 @@ void Converters::erase(string const & from, string const & to)
|
||||
// This method updates the pointers From and To in all the converters.
|
||||
// The code is not very efficient, but it doesn't matter as the number
|
||||
// of formats and converters is small.
|
||||
// Furthermore, this method is called only on startup, or after
|
||||
// Furthermore, this method is called only on startup, or after
|
||||
// adding/deleting a format in FormPreferences (the latter calls can be
|
||||
// eliminated if the formats in the Formats class are stored using a map or
|
||||
// a list (instead of a vector), but this will cause other problems).
|
||||
// a list (instead of a vector), but this will cause other problems).
|
||||
void Converters::update(Formats const & formats)
|
||||
{
|
||||
ConverterList::iterator it = converterlist_.begin();
|
||||
@ -419,7 +419,7 @@ Converters::getReachableTo(string const & target, bool clear_visited)
|
||||
if (i != s || target != "lyx") {
|
||||
result.push_back(&formats.get(i));
|
||||
}
|
||||
|
||||
|
||||
vector<int>::iterator it = vertices_[i].in_vertices.begin();
|
||||
vector<int>::iterator end = vertices_[i].in_vertices.end();
|
||||
for (; it != end; ++it) {
|
||||
@ -523,7 +523,7 @@ Converters::getPath(string const & from, string const & to)
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
vector<int>::const_iterator beg =
|
||||
vertices_[i].out_vertices.begin();
|
||||
vector<int>::const_iterator cit = beg;
|
||||
@ -615,8 +615,8 @@ bool Converters::convert(Buffer const * buffer,
|
||||
} else {
|
||||
if (conv.need_aux && !run_latex
|
||||
&& !latex_command_.empty()) {
|
||||
lyxerr[Debug::FILES]
|
||||
<< "Running " << latex_command_
|
||||
lyxerr[Debug::FILES]
|
||||
<< "Running " << latex_command_
|
||||
<< " to update aux file"<< endl;
|
||||
runLaTeX(buffer, latex_command_);
|
||||
}
|
||||
@ -704,11 +704,11 @@ bool Converters::convert(Buffer const * buffer,
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} else
|
||||
} else
|
||||
return move(outfile, to_file, conv.latex);
|
||||
}
|
||||
|
||||
// If from = /path/file.ext and to = /path2/file2.ext2 then this method
|
||||
// If from = /path/file.ext and to = /path2/file2.ext2 then this method
|
||||
// moves each /path/file*.ext file to /path2/file2*.ext2'
|
||||
bool Converters::move(string const & from, string const & to, bool copy)
|
||||
{
|
||||
@ -728,7 +728,7 @@ bool Converters::move(string const & from, string const & to, bool copy)
|
||||
string from2 = path + *it;
|
||||
string to2 = to_base + it->substr(base.length());
|
||||
to2 = ChangeExtension(to2, to_extension);
|
||||
lyxerr[Debug::FILES] << "moving " << from2
|
||||
lyxerr[Debug::FILES] << "moving " << from2
|
||||
<< " to " << to2 << endl;
|
||||
bool moved = (copy)
|
||||
? lyx::copy(from2, to2)
|
||||
@ -848,7 +848,7 @@ bool Converters::runLaTeX(Buffer const * buffer, string const & command)
|
||||
|
||||
// do the LaTeX run(s)
|
||||
string name = buffer->getLatexName();
|
||||
LaTeX latex(command, name, buffer->filePath());
|
||||
LaTeX latex(command, name, buffer->filePath());
|
||||
TeXErrors terr;
|
||||
int result = latex.run(terr,
|
||||
bv ? bv->owner()->getLyXFunc() : 0);
|
||||
@ -888,12 +888,12 @@ bool Converters::runLaTeX(Buffer const * buffer, string const & command)
|
||||
|
||||
if (bv)
|
||||
bv->owner()->allowInput();
|
||||
|
||||
int const ERROR_MASK =
|
||||
|
||||
int const ERROR_MASK =
|
||||
LaTeX::NO_LOGFILE |
|
||||
LaTeX::ERRORS |
|
||||
LaTeX::NO_OUTPUT;
|
||||
|
||||
|
||||
return (result & ERROR_MASK) == 0;
|
||||
|
||||
}
|
||||
|
@ -1,9 +1,9 @@
|
||||
// -*- C++ -*-
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
*
|
||||
* Copyright 1995 Matthias Ettrich
|
||||
* Copyright 1995-2001 The LyX Team.
|
||||
*
|
||||
@ -84,8 +84,8 @@ bool operator<(Format const & a, Format const & b)
|
||||
///
|
||||
class Formats {
|
||||
public:
|
||||
///
|
||||
typedef std::vector<Format> FormatList;
|
||||
///
|
||||
typedef std::vector<Format> FormatList;
|
||||
///
|
||||
typedef FormatList::const_iterator const_iterator;
|
||||
///
|
||||
@ -99,7 +99,7 @@ public:
|
||||
///
|
||||
void add(string const & name);
|
||||
///
|
||||
void add(string const & name, string const & extension,
|
||||
void add(string const & name, string const & extension,
|
||||
string const & prettyname, string const & shortcut);
|
||||
///
|
||||
void erase(string const & name);
|
||||
@ -176,7 +176,7 @@ public:
|
||||
///
|
||||
class Converters {
|
||||
public:
|
||||
typedef std::vector<Converter> ConverterList;
|
||||
typedef std::vector<Converter> ConverterList;
|
||||
///
|
||||
typedef ConverterList::const_iterator const_iterator;
|
||||
///
|
||||
@ -241,7 +241,7 @@ public:
|
||||
}
|
||||
private:
|
||||
///
|
||||
bool scanLog(Buffer const * buffer, string const & command,
|
||||
bool scanLog(Buffer const * buffer, string const & command,
|
||||
string const & filename);
|
||||
///
|
||||
bool runLaTeX(Buffer const * buffer, string const & command);
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
* Copyright 1995 Matthias Ettrich
|
||||
@ -58,7 +58,7 @@ void Counter::reset()
|
||||
}
|
||||
|
||||
|
||||
Counters::~Counters()
|
||||
Counters::~Counters()
|
||||
{
|
||||
// We need this since we store the Counter's as pointers in
|
||||
// the counterList.
|
||||
@ -106,7 +106,7 @@ void Counters::newCounter(string const & newc, string const & oldc)
|
||||
}
|
||||
|
||||
|
||||
void Counters::set(string const & ctr, int val)
|
||||
void Counters::set(string const & ctr, int val)
|
||||
{
|
||||
CounterList::iterator it = counterList.find(ctr);
|
||||
if (it == counterList.end()) {
|
||||
@ -128,7 +128,7 @@ void Counters::addto(string const & ctr, int val)
|
||||
}
|
||||
|
||||
|
||||
int Counters::value(string const & ctr) const
|
||||
int Counters::value(string const & ctr) const
|
||||
{
|
||||
CounterList::const_iterator cit = counterList.find(ctr);
|
||||
if (cit == counterList.end()) {
|
||||
|
@ -1,7 +1,7 @@
|
||||
// -*- C++ -*-
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
* Copyright 1995 Matthias Ettrich
|
||||
|
16
src/debug.C
16
src/debug.C
@ -1,8 +1,8 @@
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
*
|
||||
* Copyright 1999-2001 The LyX Team.
|
||||
*
|
||||
* ====================================================== */
|
||||
@ -64,7 +64,7 @@ int const numErrorTags = sizeof(errorTags)/sizeof(error_item);
|
||||
|
||||
} // namespace anon
|
||||
|
||||
|
||||
|
||||
Debug::type const Debug::ANY = Debug::type(
|
||||
Debug::INFO | Debug::INIT | Debug::KEY | Debug::GUI |
|
||||
Debug::PARSER | Debug::LYXRC | Debug::KBMAP | Debug::LATEX |
|
||||
@ -74,7 +74,7 @@ Debug::type const Debug::ANY = Debug::type(
|
||||
Debug::INSETTEXT | Debug::GRAPHICS);
|
||||
|
||||
|
||||
Debug::type Debug::value(string const & val)
|
||||
Debug::type Debug::value(string const & val)
|
||||
{
|
||||
type l = Debug::NONE;
|
||||
string v(val);
|
||||
@ -84,11 +84,11 @@ Debug::type Debug::value(string const & val)
|
||||
if (tmp.empty())
|
||||
break;
|
||||
// Is it a number?
|
||||
if (isStrInt(tmp))
|
||||
if (isStrInt(tmp))
|
||||
l |= static_cast<type>(strToInt(tmp));
|
||||
else
|
||||
// Search for an explicit name
|
||||
for (int i = 0 ; i < numErrorTags ; ++i)
|
||||
for (int i = 0 ; i < numErrorTags ; ++i)
|
||||
if (tmp == errorTags[i].name) {
|
||||
l |= errorTags[i].level;
|
||||
break;
|
||||
@ -112,7 +112,7 @@ void Debug::showLevel(ostream & o, Debug::type level)
|
||||
}
|
||||
|
||||
|
||||
void Debug::showTags(ostream & os)
|
||||
void Debug::showTags(ostream & os)
|
||||
{
|
||||
for (int i = 0 ; i < numErrorTags ; ++i)
|
||||
os << setw(7) << errorTags[i].level
|
||||
|
12
src/debug.h
12
src/debug.h
@ -1,9 +1,9 @@
|
||||
// -*- C++ -*-
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
*
|
||||
* Copyright 1995 Matthias Ettrich
|
||||
* Copyright 1995-2001 The LyX Team.
|
||||
*
|
||||
@ -80,10 +80,10 @@ struct Debug {
|
||||
/** A function to convert symbolic string names on debug levels
|
||||
to their numerical value.
|
||||
*/
|
||||
static Debug::type value(string const & val);
|
||||
static Debug::type value(string const & val);
|
||||
|
||||
/** Display the tags and descriptions of the current debug level
|
||||
of ds
|
||||
/** Display the tags and descriptions of the current debug level
|
||||
of ds
|
||||
*/
|
||||
static void showLevel(std::ostream & o, type level);
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
*
|
||||
* Copyright 1995 Matthias Ettrich
|
||||
* Copyright 1995-2001 The LyX Team.
|
||||
*
|
||||
@ -74,7 +74,7 @@ Uchar tab_symbol[256] = {
|
||||
|
||||
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
|
||||
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
|
||||
|
||||
|
||||
0xffff, 0x03d2, 0x2032, 0x2264, 0x2215, 0x221e, 0xffff, 0x2663,
|
||||
0x2666, 0x2665, 0x2660, 0x2194, 0x2190, 0x2191, 0x2192, 0x2193,
|
||||
|
||||
@ -113,16 +113,16 @@ unsigned char arabic_table2[63][4] = {
|
||||
{0x4e, 0xc0, 0xbe, 0xbf}, // 0xce = khaa
|
||||
{0x4f, 0xa6, 0xa6, 0xa6}, // 0xcf = dal
|
||||
|
||||
{0x50, 0xa7, 0xa7, 0xa7}, // 0xd0 = thal
|
||||
{0x51, 0xa8, 0xa8, 0xa8}, // 0xd1 = ra
|
||||
{0x52, 0xa9, 0xa9, 0xa9}, // 0xd2 = zain
|
||||
{0x53, 0xc3, 0xc1, 0xc2}, // 0xd3 = seen
|
||||
{0x50, 0xa7, 0xa7, 0xa7}, // 0xd0 = thal
|
||||
{0x51, 0xa8, 0xa8, 0xa8}, // 0xd1 = ra
|
||||
{0x52, 0xa9, 0xa9, 0xa9}, // 0xd2 = zain
|
||||
{0x53, 0xc3, 0xc1, 0xc2}, // 0xd3 = seen
|
||||
{0x54, 0xc6, 0xc4, 0xc5}, // 0xd4 = sheen
|
||||
{0x55, 0xc9, 0xc7, 0xc8}, // 0xd5 = sad
|
||||
{0x56, 0xcc, 0xca, 0xcb}, // 0xd6 = dad
|
||||
{0x57, 0xcf, 0xcd, 0xce}, // 0xd7 = tah
|
||||
{0x58, 0xd2, 0xd0, 0xd1}, // 0xd8 = zah
|
||||
{0x59, 0xd5, 0xd3, 0xd4}, // 0xd9 = ain
|
||||
{0x55, 0xc9, 0xc7, 0xc8}, // 0xd5 = sad
|
||||
{0x56, 0xcc, 0xca, 0xcb}, // 0xd6 = dad
|
||||
{0x57, 0xcf, 0xcd, 0xce}, // 0xd7 = tah
|
||||
{0x58, 0xd2, 0xd0, 0xd1}, // 0xd8 = zah
|
||||
{0x59, 0xd5, 0xd3, 0xd4}, // 0xd9 = ain
|
||||
{0x5a, 0xd8, 0xd6, 0xd7}, // 0xda = ghain
|
||||
{0,0,0,0}, // 0xdb
|
||||
{0,0,0,0}, // 0xdc
|
||||
@ -130,17 +130,17 @@ unsigned char arabic_table2[63][4] = {
|
||||
{0,0,0,0}, // 0xde
|
||||
{0,0,0,0}, // 0xdf
|
||||
|
||||
{0,0,0,0}, // 0xe0
|
||||
{0x61, 0xdb, 0xd9, 0xda}, // 0xe1 = fa
|
||||
{0x62, 0xde, 0xdc, 0xdd}, // 0xe2 = qaf
|
||||
{0x63, 0xe1, 0xdf, 0xe0}, // 0xe3 = kaf
|
||||
{0x64, 0xe4, 0xe2, 0xe3}, // 0xe4 = lam
|
||||
{0x65, 0xe7, 0xe5, 0xe6}, // 0xe5 = meem
|
||||
{0x66, 0xea, 0xe8, 0xe9}, // 0xe6 = noon
|
||||
{0x67, 0xed, 0xeb, 0xec}, // 0xe7 = ha
|
||||
{0x68, 0xaa, 0xaa, 0xaa}, // 0xe8 = waw
|
||||
{0,0,0,0}, // 0xe0
|
||||
{0x61, 0xdb, 0xd9, 0xda}, // 0xe1 = fa
|
||||
{0x62, 0xde, 0xdc, 0xdd}, // 0xe2 = qaf
|
||||
{0x63, 0xe1, 0xdf, 0xe0}, // 0xe3 = kaf
|
||||
{0x64, 0xe4, 0xe2, 0xe3}, // 0xe4 = lam
|
||||
{0x65, 0xe7, 0xe5, 0xe6}, // 0xe5 = meem
|
||||
{0x66, 0xea, 0xe8, 0xe9}, // 0xe6 = noon
|
||||
{0x67, 0xed, 0xeb, 0xec}, // 0xe7 = ha
|
||||
{0x68, 0xaa, 0xaa, 0xaa}, // 0xe8 = waw
|
||||
{0x69, 0xab, 0xab, 0xab}, // 0xe9 = alef maksura
|
||||
{0x6a, 0xf0, 0xee, 0xef}, // 0xea = ya
|
||||
{0x6a, 0xf0, 0xee, 0xef}, // 0xea = ya
|
||||
{0x6b, 0x6b, 0x6b, 0x6b}, // 0xeb = fathatan
|
||||
{0x6c, 0x6c, 0x6c, 0x6c}, // 0xec = dammatan
|
||||
{0x6d, 0x6d, 0x6d, 0x6d}, // 0xed = kasratan
|
||||
@ -275,7 +275,7 @@ unsigned char Encodings::TransformChar(unsigned char c,
|
||||
|
||||
Encoding const * Encodings::getEncoding(string const & encoding) const
|
||||
{
|
||||
EncodingList::const_iterator it = encodinglist.find(encoding);
|
||||
EncodingList::const_iterator it = encodinglist.find(encoding);
|
||||
if (it != encodinglist.end())
|
||||
return &it->second;
|
||||
else
|
||||
@ -285,7 +285,7 @@ Encoding const * Encodings::getEncoding(string const & encoding) const
|
||||
Encodings::Encodings()
|
||||
{
|
||||
encodinglist["iso8859-1"] = Encoding("iso8859-1", "latin1", tab_iso8859_1);
|
||||
symbol_encoding_ =
|
||||
symbol_encoding_ =
|
||||
#ifdef USE_UNICODE_FOR_SYMBOLS
|
||||
Encoding("symbol", "", tab_symbol);
|
||||
#else
|
||||
|
@ -1,9 +1,9 @@
|
||||
// -*- C++ -*-
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
*
|
||||
* Copyright 1995 Matthias Ettrich
|
||||
* Copyright 1995-2001 The LyX Team.
|
||||
*
|
||||
|
@ -1,8 +1,8 @@
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
*
|
||||
* Copyright 1995 Matthias Ettrich
|
||||
* Copyright 1995-2001 The LyX Team.
|
||||
*
|
||||
@ -69,7 +69,7 @@ bool Exporter::Export(Buffer * buffer, string const & format,
|
||||
string filename = buffer->getLatexName(false);
|
||||
if (!buffer->tmppath.empty())
|
||||
filename = AddName(buffer->tmppath, filename);
|
||||
filename = ChangeExtension(filename,
|
||||
filename = ChangeExtension(filename,
|
||||
formats.extension(backend_format));
|
||||
|
||||
// Ascii backend
|
||||
@ -138,7 +138,7 @@ vector<Format const *> const
|
||||
Exporter::GetExportableFormats(Buffer const * buffer, bool only_viewable)
|
||||
{
|
||||
vector<string> backends = Backends(buffer);
|
||||
vector<Format const *> result =
|
||||
vector<Format const *> result =
|
||||
converters.getReachable(backends[0], only_viewable, true);
|
||||
for (vector<string>::const_iterator it = backends.begin() + 1;
|
||||
it != backends.end(); ++it) {
|
||||
|
@ -1,9 +1,9 @@
|
||||
// -*- C++ -*-
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
*
|
||||
* Copyright 1995 Matthias Ettrich
|
||||
* Copyright 1995-2001 The LyX Team.
|
||||
*
|
||||
|
22
src/font.C
22
src/font.C
@ -1,8 +1,8 @@
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
*
|
||||
* Copyright 1995 Matthias Ettrich
|
||||
* Copyright 1995-2001 The LyX Team.
|
||||
*
|
||||
@ -60,7 +60,7 @@ int lyxfont::ascent(char c, LyXFont const & f)
|
||||
unsigned int uc = static_cast<unsigned char>(c);
|
||||
if (finfo->per_char
|
||||
&& uc >= finfo->min_char_or_byte2
|
||||
&& uc <= finfo->max_char_or_byte2+256*finfo->max_byte1)
|
||||
&& uc <= finfo->max_char_or_byte2+256*finfo->max_byte1)
|
||||
return finfo->per_char[uc - finfo->min_char_or_byte2].ascent;
|
||||
else
|
||||
return finfo->ascent;
|
||||
@ -73,7 +73,7 @@ int lyxfont::descent(char c, LyXFont const & f)
|
||||
unsigned int uc = static_cast<unsigned char>(c);
|
||||
if (finfo->per_char
|
||||
&& uc >= finfo->min_char_or_byte2
|
||||
&& uc <= finfo->max_char_or_byte2+256*finfo->max_byte1)
|
||||
&& uc <= finfo->max_char_or_byte2+256*finfo->max_byte1)
|
||||
return finfo->per_char[uc - finfo->min_char_or_byte2].descent;
|
||||
else
|
||||
return finfo->descent;
|
||||
@ -86,7 +86,7 @@ int lyxfont::lbearing(char c, LyXFont const & f)
|
||||
unsigned int uc = static_cast<unsigned char>(c);
|
||||
if (finfo->per_char
|
||||
&& uc >= finfo->min_char_or_byte2
|
||||
&& uc <= finfo->max_char_or_byte2+256*finfo->max_byte1)
|
||||
&& uc <= finfo->max_char_or_byte2+256*finfo->max_byte1)
|
||||
return finfo->per_char[uc - finfo->min_char_or_byte2].lbearing;
|
||||
else
|
||||
return 0;
|
||||
@ -99,7 +99,7 @@ int lyxfont::rbearing(char c, LyXFont const & f)
|
||||
unsigned int uc = static_cast<unsigned char>(c);
|
||||
if (finfo->per_char
|
||||
&& uc >= finfo->min_char_or_byte2
|
||||
&& uc <= finfo->max_char_or_byte2+256*finfo->max_byte1)
|
||||
&& uc <= finfo->max_char_or_byte2+256*finfo->max_byte1)
|
||||
return finfo->per_char[uc - finfo->min_char_or_byte2].rbearing;
|
||||
else
|
||||
return width(c, f);
|
||||
@ -126,7 +126,7 @@ int lyxfont::width(char const * s, size_t n, LyXFont const & f)
|
||||
Uchar c = encoding->ucs(s[i]);
|
||||
xs[i].byte1 = c >> 8;
|
||||
xs[i].byte2 = c & 0xff;
|
||||
}
|
||||
}
|
||||
int result = width(xs.get(), n, font);
|
||||
return result;
|
||||
}
|
||||
@ -167,7 +167,7 @@ int lyxfont::width(XChar2b const * s, int n, LyXFont const & f)
|
||||
{
|
||||
if (!lyxrc.use_gui)
|
||||
return n;
|
||||
|
||||
|
||||
if (f.realShape() != LyXFont::SMALLCAPS_SHAPE) {
|
||||
return ::XTextWidth16(getXFontstruct(f), s, n);
|
||||
} else {
|
||||
@ -205,7 +205,7 @@ int lyxfont::XTextWidth16(LyXFont const & f, XChar2b const * str, int count)
|
||||
}
|
||||
|
||||
|
||||
void lyxfont::XSetFont(Display * display, GC gc, LyXFont const & f)
|
||||
void lyxfont::XSetFont(Display * display, GC gc, LyXFont const & f)
|
||||
{
|
||||
::XSetFont(display, gc, getFontID(f));
|
||||
}
|
||||
@ -226,7 +226,7 @@ void lyxfont::buttonText(string const & str, LyXFont const & font,
|
||||
int & width, int & ascent, int & descent)
|
||||
{
|
||||
static int const d = 3;
|
||||
|
||||
|
||||
width = lyxfont::width(str, font) + d * 2 + 2;
|
||||
ascent = lyxfont::maxAscent(font) + d;
|
||||
descent = lyxfont::maxDescent(font) + d;
|
||||
|
@ -1,9 +1,9 @@
|
||||
// -*- C++ -*-
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
*
|
||||
* Copyright 1995 Matthias Ettrich
|
||||
* Copyright 1995-2001 The LyX Team.
|
||||
*
|
||||
|
@ -1,8 +1,8 @@
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
*
|
||||
* Copyright 1995 Matthias Ettrich
|
||||
* Copyright 1995-2001 The LyX Team.
|
||||
*
|
||||
@ -38,7 +38,7 @@ char const * _(char const * str)
|
||||
}
|
||||
|
||||
|
||||
string const _(string const & str)
|
||||
string const _(string const & str)
|
||||
{
|
||||
if (!str.empty()) {
|
||||
int const s = str.length();
|
||||
@ -65,7 +65,7 @@ void locale_init()
|
||||
|
||||
void gettext_init(string const & localedir)
|
||||
{
|
||||
bindtextdomain(PACKAGE, localedir.c_str());
|
||||
bindtextdomain(PACKAGE, localedir.c_str());
|
||||
textdomain(PACKAGE);
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,7 @@
|
||||
2002-03-21 Lars Gullik Bjønnes <larsbj@birdstep.com>
|
||||
|
||||
* most files: ws cleanup
|
||||
|
||||
* Makefile.am: remove ld -r stuff
|
||||
|
||||
2002-03-20 Lars Gullik Bjønnes <larsbj@birdstep.com>
|
||||
@ -99,7 +101,7 @@
|
||||
2002-01-17 John Levon <moz@compsoc.man.ac.uk>
|
||||
|
||||
* ImageLoaderXPM.C: don't set XpmColorKey flag if we don't use it
|
||||
|
||||
|
||||
2001-12-19 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
|
||||
|
||||
* GraphicsCacheItem.h: do not include <config.h> in header files
|
||||
@ -147,7 +149,7 @@
|
||||
2001-07-03 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
|
||||
|
||||
* ImageLoaderXPM.C (runImageLoader): get display information from
|
||||
GUIRunTime.
|
||||
GUIRunTime.
|
||||
|
||||
2001-06-14 Angus Leeming <a.leeming@ic.ac.uk>
|
||||
|
||||
@ -165,8 +167,8 @@
|
||||
2001-04-16 Allan Rae <rae@lyx.org>
|
||||
|
||||
* ImageLoaderXPM.C (runImageLoader): #warning triggers an error on Sun
|
||||
CC 6.0 as an unrecognised preprocessor directive. So ensure they're
|
||||
wrapped.
|
||||
CC 6.0 as an unrecognised preprocessor directive. So ensure they're
|
||||
wrapped.
|
||||
|
||||
2001-04-02 Baruch Even <baruch@lyx.org>
|
||||
|
||||
|
@ -147,7 +147,7 @@ GCache::find(InsetGraphics const & inset)
|
||||
if (it->second->referencedBy(inset))
|
||||
return it;
|
||||
}
|
||||
|
||||
|
||||
return cache->end();
|
||||
}
|
||||
|
||||
@ -161,7 +161,7 @@ GCache::find(InsetGraphics const & inset) const
|
||||
if (it->second->referencedBy(inset))
|
||||
return it;
|
||||
}
|
||||
|
||||
|
||||
return cache->end();
|
||||
}
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
*
|
||||
* grfx::GCache is the manager of the image cache.
|
||||
* It is responsible for creating the grfx::GCacheItem's and maintaining them.
|
||||
*
|
||||
*
|
||||
* grfx::GCache is a singleton class. It is possible to have only one
|
||||
* instance of it at any moment.
|
||||
*/
|
||||
@ -93,7 +93,7 @@ private:
|
||||
*/
|
||||
CacheType * cache;
|
||||
};
|
||||
|
||||
|
||||
} // namespace grfx
|
||||
|
||||
|
||||
|
@ -48,7 +48,7 @@ GCacheItem::GCacheItem(InsetGraphics const & inset, GParams const & params)
|
||||
namespace {
|
||||
|
||||
typedef GCacheItem::ModifiedItemPtr ModifiedItemPtr;
|
||||
|
||||
|
||||
class Compare_Params {
|
||||
public:
|
||||
Compare_Params(GParams const & p) : p_(p) {}
|
||||
@ -112,7 +112,7 @@ void GCacheItem::modify(InsetGraphics const & inset, GParams const & params)
|
||||
(*it)->add(inset);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// If no ModifiedItem exists with these params, then create one.
|
||||
ModifiedItemPtr item(new ModifiedItem(inset, params, image_));
|
||||
modified_images.push_back(item);
|
||||
@ -187,7 +187,7 @@ ImagePtr const GCacheItem::image(InsetGraphics const & inset) const
|
||||
// find a ModifiedItem that is referenced by this inset.
|
||||
ListType::const_iterator begin = modified_images.begin();
|
||||
ListType::const_iterator end = modified_images.end();
|
||||
ListType::const_iterator it =
|
||||
ListType::const_iterator it =
|
||||
std::find_if(begin, end, Find_Inset(inset));
|
||||
|
||||
// Someone's being daft.
|
||||
@ -212,7 +212,7 @@ ImageStatus GCacheItem::status(InsetGraphics const & inset) const
|
||||
// find a ModifiedItem that is referenced by this inset.
|
||||
ListType::const_iterator begin = modified_images.begin();
|
||||
ListType::const_iterator end = modified_images.end();
|
||||
ListType::const_iterator it =
|
||||
ListType::const_iterator it =
|
||||
std::find_if(begin, end, Find_Inset(inset));
|
||||
|
||||
// Someone's being daft.
|
||||
@ -270,7 +270,7 @@ void GCacheItem::changeDisplay(bool changed_background)
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
ListType temp_list;
|
||||
|
||||
for (ListType::iterator it = begin; it != end; ++it) {
|
||||
@ -399,7 +399,7 @@ string const findTargetFormat(string const & from)
|
||||
typedef GImage::FormatList FormatList;
|
||||
FormatList const & formats = GImage::loadableFormats();
|
||||
|
||||
// There must be a format to load from.
|
||||
// There must be a format to load from.
|
||||
lyx::Assert(!formats.empty());
|
||||
|
||||
// First ascertain if we can load directly with no conversion
|
||||
@ -425,7 +425,7 @@ string const findTargetFormat(string const & from)
|
||||
|
||||
} // anon namespace
|
||||
|
||||
|
||||
|
||||
void GCacheItem::convertToDisplayFormat()
|
||||
{
|
||||
setStatus(Converting);
|
||||
@ -439,16 +439,16 @@ void GCacheItem::convertToDisplayFormat()
|
||||
setStatus(ErrorNoFile);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// maybe that other zip extensions also be useful, especially the
|
||||
// ones that may be declared in texmf/tex/latex/config/graphics.cfg.
|
||||
// for example:
|
||||
/* -----------snip-------------
|
||||
{\DeclareGraphicsRule{.pz}{eps}{.bb}{}%
|
||||
\DeclareGraphicsRule{.eps.Z}{eps}{.eps.bb}{}%
|
||||
\DeclareGraphicsRule{.ps.Z}{eps}{.ps.bb}{}%
|
||||
\DeclareGraphicsRule{.ps.gz}{eps}{.ps.bb}{}%
|
||||
\DeclareGraphicsRule{.eps.gz}{eps}{.eps.bb}{}}}%
|
||||
{\DeclareGraphicsRule{.pz}{eps}{.bb}{}%
|
||||
\DeclareGraphicsRule{.eps.Z}{eps}{.eps.bb}{}%
|
||||
\DeclareGraphicsRule{.ps.Z}{eps}{.ps.bb}{}%
|
||||
\DeclareGraphicsRule{.ps.gz}{eps}{.ps.bb}{}%
|
||||
\DeclareGraphicsRule{.eps.gz}{eps}{.eps.bb}{}}}%
|
||||
-----------snip-------------*/
|
||||
|
||||
lyxerr[Debug::GRAPHICS]
|
||||
@ -488,7 +488,7 @@ void GCacheItem::convertToDisplayFormat()
|
||||
|
||||
// Take only the filename part of the file, without path or extension.
|
||||
string const temp = ChangeExtension(OnlyFilename(filename), string());
|
||||
|
||||
|
||||
// Add some stuff to create a uniquely named temporary file.
|
||||
// This file is deleted in loadImage after it is loaded into memory.
|
||||
string const to_file_base = lyx::tempName(string(), temp);
|
||||
@ -555,7 +555,7 @@ ImagePtr const ModifiedItem::image() const
|
||||
|
||||
void ModifiedItem::modify(ImagePtr const & new_image)
|
||||
{
|
||||
if (!new_image.get())
|
||||
if (!new_image.get())
|
||||
return;
|
||||
|
||||
original_image_ = new_image;
|
||||
@ -576,7 +576,7 @@ void ModifiedItem::modify(ImagePtr const & new_image)
|
||||
|
||||
void ModifiedItem::setPixmap()
|
||||
{
|
||||
if (!modified_image_.get())
|
||||
if (!modified_image_.get())
|
||||
return;
|
||||
|
||||
if (params().display == GParams::NONE) {
|
||||
@ -635,7 +635,7 @@ ModifiedItemPtr ModifiedItem::changeDisplay()
|
||||
// Loop over the list of insets. Compare the updated params for each
|
||||
// with params(). If different, move into a new list.
|
||||
ListType::iterator begin = insets.begin();
|
||||
ListType::iterator end = insets.end();
|
||||
ListType::iterator end = insets.end();
|
||||
ListType::iterator it =
|
||||
std::remove_if(begin, end, Params_Changed(params()));
|
||||
|
||||
|
@ -33,7 +33,7 @@
|
||||
#pragma interface
|
||||
#endif
|
||||
|
||||
#include "GraphicsTypes.h"
|
||||
#include "GraphicsTypes.h"
|
||||
#include <list>
|
||||
#include "LString.h"
|
||||
#include <boost/utility.hpp>
|
||||
@ -46,7 +46,7 @@ namespace grfx {
|
||||
|
||||
class GParams;
|
||||
class ModifiedItem;
|
||||
|
||||
|
||||
/// A grfx::GCache item holder.
|
||||
class GCacheItem : boost::noncopyable, public SigC::Object {
|
||||
public:
|
||||
@ -70,7 +70,7 @@ public:
|
||||
|
||||
/// The name of the original image file.
|
||||
string const & filename() const;
|
||||
|
||||
|
||||
/// Is this image file referenced by this inset?
|
||||
bool referencedBy(InsetGraphics const &) const;
|
||||
|
||||
@ -123,7 +123,7 @@ private:
|
||||
void imageLoaded(bool);
|
||||
|
||||
/// How far have we got in loading the original, unmodified image?
|
||||
ImageStatus status() const;
|
||||
ImageStatus status() const;
|
||||
|
||||
/** Sets the status of the loading process. Also notifies
|
||||
* listeners that the status has chacnged.
|
||||
@ -244,7 +244,7 @@ private:
|
||||
ImagePtr modified_image_;
|
||||
///
|
||||
ImageStatus status_;
|
||||
///
|
||||
///
|
||||
boost::shared_ptr<GParams> p_;
|
||||
};
|
||||
|
||||
|
@ -50,7 +50,7 @@ string const move_file(string const & from_file, string const & to_file)
|
||||
|
||||
} // namespace anon
|
||||
|
||||
|
||||
|
||||
namespace grfx {
|
||||
|
||||
GConverter & GConverter::get()
|
||||
@ -58,7 +58,7 @@ GConverter & GConverter::get()
|
||||
static GConverter singleton;
|
||||
return singleton;
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool GConverter::isReachable(string const & from_format_name,
|
||||
string const & to_format_name) const
|
||||
@ -99,7 +99,7 @@ void GConverter::convert(string const & from_file, string const & to_file_base,
|
||||
on_finish->emit(string());
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
fs << script.str().c_str();
|
||||
fs.close();
|
||||
|
||||
@ -115,7 +115,7 @@ void GConverter::convert(string const & from_file, string const & to_file_base,
|
||||
|
||||
// Launch the conversion process.
|
||||
ConvProcessPtr shared_ptr;
|
||||
shared_ptr.reset(new ConvProcess(script_file, script_command,
|
||||
shared_ptr.reset(new ConvProcess(script_file, script_command,
|
||||
to_file, on_finish));
|
||||
all_processes_.push_back(shared_ptr);
|
||||
}
|
||||
@ -124,7 +124,7 @@ void GConverter::convert(string const & from_file, string const & to_file_base,
|
||||
namespace {
|
||||
|
||||
typedef boost::shared_ptr<ConvProcess> ConvProcessPtr;
|
||||
|
||||
|
||||
class Find_Ptr {
|
||||
public:
|
||||
Find_Ptr(ConvProcess * ptr) : ptr_(ptr) {}
|
||||
@ -139,7 +139,7 @@ private:
|
||||
};
|
||||
|
||||
} // namespace anon
|
||||
|
||||
|
||||
|
||||
void GConverter::erase(ConvProcess * process)
|
||||
{
|
||||
@ -155,7 +155,7 @@ void GConverter::erase(ConvProcess * process)
|
||||
}
|
||||
|
||||
|
||||
bool GConverter::build_script(string const & from_file,
|
||||
bool GConverter::build_script(string const & from_file,
|
||||
string const & to_file_base,
|
||||
string const & from_format,
|
||||
string const & to_format,
|
||||
@ -219,7 +219,7 @@ bool GConverter::build_script(string const & from_file,
|
||||
// Store in the shell script
|
||||
script << "\n" << command << "\n\n";
|
||||
|
||||
// Test that this was successful. If not, remove
|
||||
// Test that this was successful. If not, remove
|
||||
// ${outfile} and exit the shell script
|
||||
script << "if [ $? -ne 0 ]; then\n"
|
||||
<< "\t'rm' -f ${outfile}\n"
|
||||
@ -253,7 +253,7 @@ bool GConverter::build_script(string const & from_file,
|
||||
}
|
||||
|
||||
|
||||
ConvProcess::ConvProcess(string const & script_file,
|
||||
ConvProcess::ConvProcess(string const & script_file,
|
||||
string const & script_command,
|
||||
string const & to_file, SignalTypePtr on_finish)
|
||||
: script_file_(script_file), to_file_(to_file), on_finish_(on_finish)
|
||||
@ -261,7 +261,7 @@ ConvProcess::ConvProcess(string const & script_file,
|
||||
Forkedcall::SignalTypePtr convert_ptr;
|
||||
convert_ptr.reset(new Forkedcall::SignalType);
|
||||
|
||||
convert_ptr->connect(SigC::slot(this, &ConvProcess::converted));
|
||||
convert_ptr->connect(SigC::slot(this, &ConvProcess::converted));
|
||||
|
||||
Forkedcall call;
|
||||
int retval = call.startscript(script_command, convert_ptr);
|
||||
|
@ -49,7 +49,7 @@ GImage::getScaledDimensions(GParams const & params) const
|
||||
height = width * getHeight() / getWidth();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (width == 0 || height == 0)
|
||||
// Something is wrong!
|
||||
return std::make_pair(getWidth(), getHeight());
|
||||
@ -57,4 +57,3 @@ GImage::getScaledDimensions(GParams const & params) const
|
||||
return std::make_pair(width, height);
|
||||
}
|
||||
} // namespace grfx
|
||||
|
||||
|
@ -83,10 +83,10 @@ public:
|
||||
|
||||
/// Clip the image using params.
|
||||
virtual void clip(GParams const & params) = 0;
|
||||
|
||||
|
||||
/// Rotate the image using params.
|
||||
virtual void rotate(GParams const & params) = 0;
|
||||
|
||||
|
||||
/// Scale the image using params.
|
||||
virtual void scale(GParams const & params) = 0;
|
||||
|
||||
|
@ -124,7 +124,7 @@ void GImageXPM::load(string const & filename, GImage::SignalTypePtr on_finish)
|
||||
break;
|
||||
|
||||
case XpmNoMemory:
|
||||
lyxerr[Debug::GRAPHICS]
|
||||
lyxerr[Debug::GRAPHICS]
|
||||
<< "Insufficient memory to read in XPM file"
|
||||
<< std::endl;
|
||||
break;
|
||||
@ -135,7 +135,7 @@ void GImageXPM::load(string const & filename, GImage::SignalTypePtr on_finish)
|
||||
delete xpm_image;
|
||||
|
||||
lyxerr[Debug::GRAPHICS]
|
||||
<< "Error reading XPM file '"
|
||||
<< "Error reading XPM file '"
|
||||
<< XpmGetErrorString(success) << "'"
|
||||
<< std::endl;
|
||||
} else {
|
||||
@ -200,15 +200,15 @@ bool GImageXPM::setPixmap(GParams const & params)
|
||||
// Load up the pixmap
|
||||
XpmImage xpm_image = image_.get();
|
||||
int const status =
|
||||
XpmCreatePixmapFromXpmImage(display,
|
||||
XRootWindowOfScreen(screen),
|
||||
&xpm_image,
|
||||
XpmCreatePixmapFromXpmImage(display,
|
||||
XRootWindowOfScreen(screen),
|
||||
&xpm_image,
|
||||
&pixmap, &mask, &attrib);
|
||||
|
||||
XpmFreeAttributes(&attrib);
|
||||
|
||||
if (status != XpmSuccess) {
|
||||
lyxerr << "Error creating pixmap from xpm_image '"
|
||||
lyxerr << "Error creating pixmap from xpm_image '"
|
||||
<< XpmGetErrorString(status) << "'"
|
||||
<< std::endl;
|
||||
pixmap_status_ = PIXMAP_FAILED;
|
||||
@ -298,7 +298,7 @@ void GImageXPM::rotate(GParams const & params)
|
||||
max_y = std::max(max_y, y_rot); min_y = std::min(min_y, y_rot);
|
||||
|
||||
typedef unsigned int dimension;
|
||||
|
||||
|
||||
dimension const new_width = 1 + int(max_x - min_x); // round up!
|
||||
dimension const new_height = 1 + int(max_y - min_y);
|
||||
|
||||
@ -382,7 +382,7 @@ bool contains_color_none(XpmImage const & image);
|
||||
|
||||
string const unique_color_string(XpmImage const & image);
|
||||
|
||||
// create a copy (using malloc and strcpy). If (!in) return 0;
|
||||
// create a copy (using malloc and strcpy). If (!in) return 0;
|
||||
char * clone_c_string(char const * in);
|
||||
|
||||
// Given a string of the form #ff0571 create appropriate grayscale and
|
||||
@ -638,7 +638,7 @@ char * clone_c_string(char const * in)
|
||||
if (!in)
|
||||
return 0;
|
||||
|
||||
// Don't forget the '\0'
|
||||
// Don't forget the '\0'
|
||||
char * out = static_cast<char *>(malloc(strlen(in) + 1));
|
||||
return strcpy(out, in);
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ public:
|
||||
|
||||
/// Get the image width
|
||||
unsigned int getWidth() const;
|
||||
|
||||
|
||||
/// Get the image height
|
||||
unsigned int getHeight() const;
|
||||
|
||||
@ -62,10 +62,10 @@ public:
|
||||
|
||||
/// Clip the image using params.
|
||||
void clip(GParams const & params);
|
||||
|
||||
|
||||
/// Rotate the image using params.
|
||||
void rotate(GParams const & params);
|
||||
|
||||
|
||||
/// Scale the image using params.
|
||||
void scale(GParams const & params);
|
||||
|
||||
@ -82,7 +82,7 @@ private:
|
||||
* c_color together with g_color and m_color entries for each c_color
|
||||
* entry when it is first stored.
|
||||
*/
|
||||
class Data
|
||||
class Data
|
||||
{
|
||||
public:
|
||||
/// Default c-tor. Initialise everything to zero.
|
||||
@ -132,7 +132,7 @@ private:
|
||||
|
||||
unsigned int color_none_id() const;
|
||||
};
|
||||
|
||||
|
||||
Data image_;
|
||||
|
||||
/// The pixmap itself.
|
||||
@ -147,7 +147,7 @@ private:
|
||||
///
|
||||
PIXMAP_SUCCESS
|
||||
};
|
||||
|
||||
|
||||
PixmapStatus pixmap_status_;
|
||||
};
|
||||
|
||||
|
@ -28,7 +28,7 @@ GParams::GParams(InsetGraphicsParams const & iparams)
|
||||
{
|
||||
if (iparams.clip)
|
||||
bb = iparams.bb;
|
||||
|
||||
|
||||
if (iparams.rotate)
|
||||
angle = int(iparams.rotateAngle);
|
||||
|
||||
@ -119,7 +119,7 @@ BoundingBox::BoundingBox(string const & bb)
|
||||
return;
|
||||
|
||||
LyXLength const length_yb(tmp1);
|
||||
|
||||
|
||||
tmp2 = split(tmp2, tmp1, ' ');
|
||||
if (!isValidLength(tmp1) || !isValidLength(tmp2))
|
||||
return;
|
||||
@ -148,7 +148,7 @@ BoundingBox::BoundingBox(string const & bb)
|
||||
}
|
||||
|
||||
|
||||
bool BoundingBox::empty() const
|
||||
bool BoundingBox::empty() const
|
||||
{
|
||||
return (!xl && !yb && !xr && !yt);
|
||||
}
|
||||
|
@ -6,7 +6,7 @@
|
||||
*
|
||||
* \author Angus Leeming <a.leeming@ic.ac.uk>
|
||||
*
|
||||
* Used internally by the GraphicsCache.
|
||||
* Used internally by the GraphicsCache.
|
||||
* Only a subset of InsetGraphicsParams is needed for display purposes.
|
||||
* The GraphicsParams c-tor also interrogates lyxrc to ascertain whether
|
||||
* to display or not.
|
||||
@ -47,7 +47,7 @@ struct BoundingBox {
|
||||
bool operator==(BoundingBox const &, BoundingBox const &);
|
||||
bool operator!=(BoundingBox const &, BoundingBox const &);
|
||||
|
||||
struct GParams
|
||||
struct GParams
|
||||
{
|
||||
GParams(InsetGraphicsParams const &);
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
/* This file is part of
|
||||
* ======================================================
|
||||
*
|
||||
* ======================================================
|
||||
*
|
||||
* LyX, The Document Processor
|
||||
*
|
||||
*
|
||||
* Copyright 1995 Matthias Ettrich
|
||||
* Copyright 1995-2001 The LyX Team.
|
||||
*
|
||||
@ -34,7 +34,7 @@ extern BufferList bufferlist;
|
||||
extern void InsertAsciiFile(BufferView *, string const &, bool);
|
||||
|
||||
|
||||
bool Importer::Import(LyXView * lv, string const & filename,
|
||||
bool Importer::Import(LyXView * lv, string const & filename,
|
||||
string const & format)
|
||||
{
|
||||
string const displaypath = MakeDisplayPath(filename);
|
||||
@ -103,7 +103,7 @@ bool Importer::IsImportable(string const & format)
|
||||
vector<Format const *> const Importer::GetImportableFormats()
|
||||
{
|
||||
vector<string> loaders = Loaders();
|
||||
vector<Format const *> result =
|
||||
vector<Format const *> result =
|
||||
converters.getReachableTo(loaders[0], true);
|
||||
for (vector<string>::const_iterator it = loaders.begin() + 1;
|
||||
it != loaders.end(); ++it) {
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user