+2002-02-26 John Levon <moz@compsoc.man.ac.uk>
+
+ * acconfig.h: nt/os2 defines moved
+
2002-02-04 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
* README: change reference to bugtracker
#endif
#ifdef __EMX__
-#include "os2_defines.h"
-#endif
-
-#ifdef VMS
-#include "vms_defines.h"
+#include "support/os2_defines.h"
#endif
#if defined(__CYGWIN__) || defined( __CYGWIN32__)
-#include "nt_defines.h"
+#include "support/nt_defines.h"
#endif
/* Some support for the boost library. */
+2002-02-21 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
+
+ * ui/default.ui: change Layout>LaTeX Preamble to Layout>Preamble.
+
2002-02-13 José Matos <jamatos@fep.up.pt>
* examples/linuxdoc_manpage.lyx: added
# Item "TeX Style|X" "tex-mode"
Separator
Item "Change Environment Depth|v" "depth-increment"
- Item "LaTeX Preamble...|L" "layout-preamble"
+ Item "Preamble...|r" "layout-preamble"
Item "Start Appendix here|A" "appendix"
End
src/CutAndPaste.C
src/debug.C
src/exporter.C
-src/ext_l10n.h
src/figure_form.C
src/figureForm.C
src/FontLoader.C
+2002-02-26 John Levon <moz@compsoc.man.ac.uk>
+
+ * Makefile.am:
+ * lyxserver.C:
+ * os2_defines.h:
+ * os2_errortable.h:
+ * nt_defines.h: move .h into support/
+
+ * vms_defines.h: remove
+
+ * WorkArea.C: add space in debug output
+
+ * text2.C:
+ * paragraph.C:
+ * buffer.C: add WITH_WARNINGS
+
+ * vc-backend.h:
+ * vc-backend.C:
+ * bufferlist.C: s/retrive/retrieve/, add docs
+
+ * vspace.h:
+ * vspace.C:
+ * kbmap.h:
+ * lyxlength.h:
+ * lyxgluelength.h:
+ * length_common.h:
+ * chset.h:
+ * chset.C: add docs
+
+ * lyxgui.C: add ID to X error handler
+
+ * lyxtestclass.c: fix typo
+
2002-02-26 Juergen Vigna <jug@sad.it>
* tabular_funcs.C (write_attribute): changed so that some default
main.C \
minibuffer.C \
minibuffer.h \
- nt_defines.h \
- os2_defines.h \
- os2_errortable.h \
paragraph.C \
paragraph.h \
paragraph_pimpl.C \
ErtComp ert_comp;
#endif
+#ifdef WITH_WARNINGS
#warning And _why_ is this here? (Lgb)
+#endif
int unknown_layouts;
int unknown_tokens;
// 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.
- RCS::retrive(s);
+ RCS::retrieve(s);
return loadLyXFile(filename, tolastfiles);
}
}
{
map_.clear();
name_.erase();
-
- if (fname.empty() || fname == "ascii")
- return true; // ascii 7-bit
+
+ // ascii 7-bit
+ if (fname.empty() || fname == "ascii")
+ return true;
// open definition file
lyxerr[Debug::KBMAP]
// -*- C++ -*-
+/**
+ * \file chset.h
+ * Copyright 2002 the LyX Team
+ * Read the file COPYING
+ */
+
#ifndef CHSET_H
#define CHSET_H
#include "LString.h"
-///
+/// a class for mapping char strings such as "\^{A}" to the integer value
class CharacterSet {
public:
- ///
- bool loadFile(string const &);
- ///
+ /**
+ * initialise this charset from the given .cdef file
+ * param charset the charset to look for
+ *
+ * Finds a .cdef file corresponding to the named charset
+ * and parses it. This function is only intended to be
+ * called once.
+ */
+ bool loadFile(string const & charset);
+ /// return the name of the current charset
string const & getName() const;
- ///
+ /**
+ * Return the encoded charset value of the given string.
+ *
+ * The bool value is false if an encoding could not be found
+ * in this charset, and true otherwise.
+ */
std::pair<bool, int> const encodeString(string const &) const;
private:
- ///
+ /// charset name
string name_;
///
typedef std::map<string, unsigned char> Cdef;
- ///
+ /// mapping from string representation to encoded value
Cdef map_;
};
#endif
+2002-02-21 Herbert Voss <voss@lyx.org>
+
+ * biblio.C: fix bug with commentlines in a bibentry
+
2002-02-20 Lars Gullik Bjønnes <larsbj@birdstep.com>
* Makefile.am: simpler obj. file compile
string const parseBibTeX(string data, string const & findkey)
{
string keyvalue;
- for (string::iterator it = data.begin(); it < data.end(); ++it) {
- if ((*it) == '\n' || (*it) == '\t')
- (*it)= ' ';
+ // at first we delete all characters right of '%' and
+ // replace tabs through a space and remove leading spaces
+ string data_;
+ int Entries = 0;
+ string dummy = token(data,'\n', Entries);
+ while (!dummy.empty()) {
+ dummy = subst(dummy, '\t', ' '); // no tabs
+ dummy = frontStrip(dummy); // no leading spaces
+ if (dummy.find('%') != string::npos) {
+ if (dummy.find('%') > 0)
+ data_ += dummy.substr(0,data.find('%'));
+ }
+ else
+ data_ += dummy;
+ dummy = token(data, '\n', ++Entries);
}
- data = frontStrip(data);
-
+ data = data_;
// now get only the important line of the bibtex entry.
// all entries are devided by ',' except the last one.
data += ','; // now we have same behaviour for all entries
// because the last one is "blah ... }"
- int Entries = 0;
- string dummy = token(data, ',', Entries);
+ Entries = 0;
+ dummy = token(data, ',', Entries);
while (!contains(lowercase(dummy), findkey) && !dummy.empty())
dummy = token(data, ',', ++Entries);
if (dummy.empty())
+2002-02-24 Juergen Spitzmueller <j.spitzmueller@gmx.de>
+
+ * forms/form_graphics.fd: Enlarge Restore button.
+ * FormGraphics.C: Set filter to bounding box input fields.
+
2002-02-20 Lars Gullik Bjønnes <larsbj@birdstep.com>
* Makefile.am: simpler obj. file compiling
fl_set_input_return (bbox_->input_bb_x1, FL_RETURN_CHANGED);
fl_set_input_return (bbox_->input_bb_y1, FL_RETURN_CHANGED);
+ fl_set_input_filter(bbox_->input_bb_x0, fl_unsigned_float_filter);
+ fl_set_input_filter(bbox_->input_bb_y0, fl_unsigned_float_filter);
+ fl_set_input_filter(bbox_->input_bb_x1, fl_unsigned_float_filter);
+
string const bb_units = "pt|cm|in";
fl_addto_choice(bbox_->choice_bb_units, bb_units.c_str());
bc().addReadOnly(bbox_->button_getBB);
FL_OBJECT *obj;
FD_form_graphics *fdui = new FD_form_graphics;
- fdui->form = fl_bgn_form(FL_NO_BOX, 510, 360);
+ fdui->form = fl_bgn_form(FL_NO_BOX, 510, 345);
fdui->form->u_vdata = this;
- obj = fl_add_box(FL_FLAT_BOX, 0, 0, 510, 360, "");
+ obj = fl_add_box(FL_FLAT_BOX, 0, 0, 510, 345, "");
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fdui->tabFolder = obj = fl_add_tabfolder(FL_TOP_TABFOLDER, 5, 5, 500, 270, _("Tabbed folder"));
fl_set_object_boxtype(obj, FL_FRAME_BOX);
fl_set_object_resize(obj, FL_RESIZE_ALL);
{
char const * const dummy = N_("Restore|#R");
- fdui->button_restore = obj = fl_add_button(FL_NORMAL_BUTTON, 5, 310, 80, 30, idex(_(dummy)));
+ fdui->button_restore = obj = fl_add_button(FL_NORMAL_BUTTON, 5, 310, 100, 30, idex(_(dummy)));
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
}
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
=============== FORM ===============
Name: form_graphics
Width: 510
-Height: 360
+Height: 345
Number of Objects: 7
--------------------
class: FL_BOX
type: FLAT_BOX
-box: 0 0 510 360
+box: 0 0 510 345
boxtype: FL_FLAT_BOX
colors: FL_COL1 FL_COL1
alignment: FL_ALIGN_CENTER
--------------------
class: FL_BUTTON
type: NORMAL_BUTTON
-box: 5 310 80 30
+box: 5 310 100 30
boxtype: FL_UP_BOX
colors: FL_COL1 FL_COL1
alignment: FL_ALIGN_CENTER
// -*- C++ -*-
-/* ======================================================================= *\
- File : kbmap.h, kbmap.h,v 1.3 1996/12/10 04:35:57 larsbj Exp
- Author : chb, 30.Oct.1995
- Docu : see kbmap.C
- Purpose: class definitions for XKeyEvent keymap handling
- \* ==================================================================== */
+/**
+ * \file kbmap.h
+ * Copyright 1995-2002 the LyX Team
+ * Read the file COPYING
+ *
+ * \author Lars Gullik Bjønnes <larsbj@lyx.org>
+ * \author John Levon <moz@compsoc.man.ac.uk>
+ */
#ifndef KBMAP_H
#define KBMAP_H
Table table;
};
-#endif
+#endif // KBMAP_H
// -*- C++ -*-
-#ifndef LENGHT_COMMON_H
-#define LENGHT_COMMON_H
+#ifndef LENGTH_COMMON_H
+#define LENGTH_COMMON_H
#include "LString.h"
#include "lyxlength.h"
+/// the number of units possible
extern int const num_units;
-// I am not sure if "mu" should be possible to select (Lgb)
+/**
+ * array of unit names
+ *
+ * FIXME: I am not sure if "mu" should be possible to select (Lgb)
+ */
extern char const *unit_name[];
+/// return the unit given a string representation such as "cm"
LyXLength::UNIT unitFromString(string const & data);
-#endif
+#endif // LENGTH_COMMON_H
// Get the reason for the crash.
char etxt[513];
XGetErrorText(display, xeev->error_code, etxt, 512);
- lyxerr << etxt << endl;
+ lyxerr << etxt << " id: " << xeev->resourceid << endl;
// By doing an abort we get a nice backtrace. (hopefully)
lyx::abort();
return 0; // Solaris CC wants us to return something
// -*- C++ -*-
-/* This file is part of
- * ======================================================
+/**
+ * \file lyxgluelength.h
+ * Copyright 1995-2002 the LyX Team
+ * Read the file COPYING
*
- * LyX, The Document Processor
- *
- * Copyright 1995 Matthias Ettrich
- * Copyright 1995-2001 The LyX Team.
- *
- * ====================================================== */
+ * \author Matthias Ettrich
+ */
+
#ifndef LYX_GLUE_LENGTH_H
#define LYX_GLUE_LENGTH_H
///
bool isValidGlueLength(string const & data, LyXGlueLength * result);
-#endif
+#endif // LYXGLUELENGTH_H
// -*- C++ -*-
-/* This file is part of
- * ======================================================
+/**
+ * \file lyxlength.h
+ * Copyright 1995-2002 the LyX Team
+ * Read the file COPYING
*
- * LyX, The Document Processor
- *
- * Copyright 1995 Matthias Ettrich
- * Copyright 1995-2001 The LyX Team.
- *
- * ====================================================== */
+ * \author Matthias Ettrich
+ */
+
#ifndef LYX_LENGTH_H
#define LYX_LENGTH_H
#include "LString.h"
-//
-/// LyXLength Class
-//
+/**
+ * LyXLength - Represents latex length measurement
+ */
class LyXLength {
public:
/// length units
enum UNIT {
- /// Scaled point (65536sp = 1pt) TeX's smallest unit.
- SP,
- /// Point = 1/72.27in = 0.351mm
- PT,
- /// Big point (72bp = 1in), also PostScript point
- BP,
- /// Didot point = 1/72 of a French inch, = 0.376mm
- DD,
- /// Millimeter = 2.845pt
- MM,
- /// Pica = 12pt = 4.218mm
- PC,
- /// Cicero = 12dd = 4.531mm
- CC,
- /// Centimeter = 10mm = 2.371pc
- CM,
- /// Inch = 25.4mm = 72.27pt = 6.022pc
- IN,
- /// Height of a small "x" for the current font.
- EX,
- /// Width of capital "M" in current font.
- EM,
- /// Math unit (18mu = 1em) for positioning in math mode
- MU,
- /// Percent of columnwidth both "%" or "%c"
- PW,
- ///
- PE,
- /// Percent of pagewidth
- PP,
- /// Percent of linewidth
- PL,
- /// no unit
- UNIT_NONE
+ SP, ///< Scaled point (65536sp = 1pt) TeX's smallest unit.
+ PT, ///< Point = 1/72.27in = 0.351mm
+ BP, ///< Big point (72bp = 1in), also PostScript point
+ DD, ///< Didot point = 1/72 of a French inch, = 0.376mm
+ MM, ///< Millimeter = 2.845pt
+ PC, ///< Pica = 12pt = 4.218mm
+ CC, ///< Cicero = 12dd = 4.531mm
+ CM, ///< Centimeter = 10mm = 2.371pc
+ IN, ///< Inch = 25.4mm = 72.27pt = 6.022pc
+ EX, ///< Height of a small "x" for the current font.
+ EM, ///< Width of capital "M" in current font.
+ MU, ///< Math unit (18mu = 1em) for positioning in math mode
+ PW, ///< Percent of columnwidth both "%" or "%c"
+ PE, ///< FIXME
+ PP, ///< Percent of pagewidth
+ PL, ///< Percent of linewidth
+ UNIT_NONE ///< no unit
};
///
void unit(LyXLength::UNIT unit);
///
bool zero() const;
- /// conversion
+ /// return string representation
string const asString() const;
- ///
+ /// return string representation for LaTeX
string const asLatexString() const;
- ///
+ /// return the on-screen size of this length
int inPixels(int default_width, int default_height) const;
/** If "data" is valid, the length represented by it is
bool operator!=(LyXLength const & l1, LyXLength const & l2);
///
bool isValidLength(string const & data, LyXLength * result);
-///
+/// return the name of the given unit number
char const * stringFromUnit(int unit);
-#endif
+#endif // LYXLENGTH_H
#define INCL_DOSNMPIPES
#define INCL_DOSERRORS
#include <os2.h>
-#include "os2_errortable.h"
+#include "support/os2_errortable.h"
#endif
using std::endl;
{
lyxerr[Debug::TCLASS] << "Reading style " << lay.name() << endl;
if (!lay.Read(lexrc, *this)) {
- // Reslove fonts
+ // Resolve fonts
lay.resfont = lay.font;
#ifndef INHERIT_LANGUAGE
lay.resfont.realize(defaultfont());
+++ /dev/null
-/* -*- C++ -*- */
-/* This file is part of
- * ======================================================
- *
- * LyX, the High Level Word Processor
- *
- * Copyright 1995 Matthias Ettrich
- * Copyright 1995-1998 The LyX Team.
- *
- * ======================================================
- A few prototypes and definitions needed for Windows NT */
-
-/* Hacks to get LyX running under Win-NT w. Cygnus b19 (steven@cs.uu.nl) */
-
-#ifndef NT_DEFINES_H
-#define NT_DEFINES_H
-
-
-#endif /* NT_DEFINES_H */
+++ /dev/null
-/* -*- C++ -*- */
-/* This file is part of
-* ======================================================
-*
-* LyX, The Document Processor
-*
-* Copyright 1995 Matthias Ettrich
-* Copyright 1995-2001 The LyX Team.
-*
-* ======================================================
- A few prototypes and definitions needed for OS/2 */
-
-#ifndef OS2_DEFINES_H
-#define OS2_DEFINES_H
-
-#if defined (__cplusplus)
-#include <cctype>
-#include <cstdlib>
-
-extern "C"
-inline int readlink(const char *, char *, size_t) {return -1;}
-
-#else
-#include <ctype.h>
-#include <stdlib.h>
-#define readlink(s, t, l) (-1)
-#endif
-#include <process.h>
-#include <unistd.h>
-#include <X11/Xlocale.h>
-/* #include <malloc.h> */
-#define lstat stat
-#define S_ISLNK(x) false
-#define S_ISBLK(x) false
-/*#define mkfifo(p, m) (0) *//* LyXserver is temporary disabled. */
-#define chdir _chdir2
-#define strcasecmp stricmp
-#if defined (__cplusplus)
-extern "C" {
-#endif
-const char* __XOS2RedirRoot(const char* pathname);
-#if defined (__cplusplus)
-}
-#endif
-#undef LYX_DIR
-#define LYX_DIR __XOS2RedirRoot("/XFree86/lib/X11/lyx")
-#undef LOCALEDIR
-#define LOCALEDIR __XOS2RedirRoot("/XFree86/lib/X11/locale")
-#undef TOP_SRCDIR
-#define TOP_SRCDIR ".."
-/* I have the slightest idea what I am doing here... */
-#define bindtextdomain bindtextdomain__
-#define textdomain textdomain__
-
-#endif /* _OS2_DEFINES_H */
+++ /dev/null
-/* -*- C++ -*- */
-/* This file is part of
-* ======================================================
-*
-* LyX, The Document Processor
-*
-* Copyright 1995 Matthias Ettrich
-* Copyright 1995-2001 The LyX Team.
-*
-* ======================================================
- A table for translating OS/2 API return code into errno.
- Copied from emx library source. */
-
-#ifndef OS2_ERRORTABLE_H
-#define OS2_ERRORTABLE_H
-//#ifndef _ERRNO_H
-#include <cerrno>
-//#endif
-
-namespace {
-
-unsigned char const errno_tab[] =
-{
- EINVAL, EINVAL, ENOENT, ENOENT, EMFILE, /* 0..4 */
- EACCES, EBADF, EIO, ENOMEM, EIO, /* 5..9 */
- EINVAL, ENOEXEC, EINVAL, EINVAL, EINVAL, /* 10..14 */
- ENOENT, EBUSY, EXDEV, ENOENT, EROFS, /* 15..19 */
- EIO, EIO, EIO, EIO, EIO, /* 20..24 */
- EIO, EIO, EIO, ENOSPC, EIO, /* 25..29 */
- EIO, EIO, EACCES, EACCES, EIO, /* 30..34 */
- EIO, EIO, EIO, EIO, ENOSPC, /* 35..39 */
- EIO, EIO, EIO, EIO, EIO, /* 40..44 */
- EIO, EIO, EIO, EIO, EIO, /* 45..49 */
- EIO, EIO, EIO, EIO, EBUSY, /* 50..54 */
- EIO, EIO, EIO, EIO, EIO, /* 55..59 */
- EIO, ENOSPC, ENOSPC, EIO, EIO, /* 60..64 */
- EACCES, EIO, EIO, EIO, EIO, /* 65..69 */
- EIO, EIO, EIO, EROFS, EIO, /* 70..74 */
- EIO, EIO, EIO, EIO, EIO, /* 75..79 */
- EEXIST, EIO, ENOENT, EIO, EIO, /* 80..84 */
- EIO, EIO, EINVAL, EIO, EAGAIN, /* 85..89 */
- EIO, EIO, EIO, EIO, EIO, /* 90..94 */
- EINTR, EIO, EIO, EIO, EACCES, /* 95..99 */
- ENOMEM, EINVAL, EINVAL, ENOMEM, EINVAL, /* 100..104 */
- EINVAL, ENOMEM, EIO, EACCES, EPIPE, /* 105..109 */
- ENOENT, E2BIG, ENOSPC, ENOMEM, EINVAL, /* 110..114 */
- EINVAL, EINVAL, EINVAL, EINVAL, EINVAL, /* 115..119 */
- EINVAL, EINVAL, EINVAL, ENOENT, EINVAL, /* 120..124 */
- ENOENT, ENOENT, ENOENT, ECHILD, ECHILD, /* 125..129 */
- EACCES, EINVAL, ESPIPE, EINVAL, EINVAL, /* 130..134 */
- EINVAL, EINVAL, EINVAL, EINVAL, EINVAL, /* 135..139 */
- EINVAL, EINVAL, EBUSY, EINVAL, EINVAL, /* 140..144 */
- EINVAL, EINVAL, EINVAL, EBUSY, EINVAL, /* 145..149 */
- EINVAL, EINVAL, ENOMEM, EINVAL, EINVAL, /* 150..154 */
- EINVAL, EINVAL, EINVAL, EINVAL, EINVAL, /* 155..159 */
- EINVAL, EINVAL, EINVAL, EINVAL, EAGAIN, /* 160..164 */
- EINVAL, EINVAL, EACCES, EINVAL, EINVAL, /* 165..169 */
- EBUSY, EINVAL, EINVAL, EINVAL, EINVAL, /* 170..174 */
- EINVAL, EINVAL, EINVAL, EINVAL, EINVAL, /* 175..179 */
- EINVAL, EINVAL, EINVAL, EINVAL, ECHILD, /* 180..184 */
- EINVAL, EINVAL, ENOENT, EINVAL, EINVAL, /* 185..189 */
- ENOEXEC, ENOEXEC, ENOEXEC, ENOEXEC, ENOEXEC, /* 190..194 */
- ENOEXEC, ENOEXEC, ENOEXEC, ENOEXEC, ENOEXEC, /* 195..199 */
- ENOEXEC, ENOEXEC, ENOEXEC, ENOENT, EINVAL, /* 200..204 */
- EINVAL, ENAMETOOLONG, EINVAL, EINVAL, EINVAL, /* 205..209 */
- EINVAL, EINVAL, EACCES, ENOEXEC, ENOEXEC, /* 210..214 */
- EINVAL, EINVAL, EINVAL, EINVAL, EINVAL, /* 215..219 */
- EINVAL, EINVAL, EINVAL, EINVAL, EINVAL, /* 220..224 */
- EINVAL, EINVAL, EINVAL, ECHILD, EINVAL, /* 225..229 */
- EINVAL, EBUSY, EAGAIN, ENOTCONN, EINVAL, /* 230..234 */
- EINVAL, EINVAL, EINVAL, EINVAL, EINVAL, /* 235..239 */
- EINVAL, EINVAL, EINVAL, EINVAL, EINVAL, /* 240..244 */
- EINVAL, EINVAL, EINVAL, EINVAL, EINVAL, /* 245..249 */
- EACCES, EACCES, EINVAL, ENOENT, EINVAL, /* 250..254 */
- EINVAL, EINVAL, EINVAL, EINVAL, EINVAL, /* 255..259 */
- EINVAL, EINVAL, EINVAL, EINVAL, EINVAL, /* 260..264 */
- EINVAL, EINVAL, EINVAL, EINVAL, EINVAL, /* 265..269 */
- EINVAL, EINVAL, EINVAL, EINVAL, EINVAL, /* 270..274 */
- EINVAL, EINVAL, EINVAL, EINVAL, EINVAL, /* 275..279 */
- EINVAL, EINVAL, EINVAL, EINVAL, EEXIST, /* 280..284 */
- EEXIST, EINVAL, EINVAL, EINVAL, EINVAL, /* 285..289 */
- ENOMEM, EMFILE, EINVAL, EINVAL, EINVAL, /* 290..294 */
- EINVAL, EINVAL, EINVAL, EINVAL, EINVAL, /* 295..299 */
- EINVAL, EBUSY, EINVAL, ESRCH, EINVAL, /* 300..304 */
- ESRCH, EINVAL, EINVAL, EINVAL, ESRCH, /* 305..309 */
- EINVAL, ENOMEM, EINVAL, EINVAL, EINVAL, /* 310..314 */
- EINVAL, E2BIG, ENOENT, EIO, EIO, /* 315..319 */
- EINVAL, EINVAL, EINVAL, EINVAL, EAGAIN, /* 320..324 */
- EINVAL, EINVAL, EINVAL, EIO, ENOENT, /* 325..329 */
- EACCES, EACCES, EACCES, ENOENT, ENOMEM /* 330..334 */
-};
-
-} // namespace anon
-
-
-inline
-int TranslateOS2Error(unsigned long rc)
-{
- if (rc >= sizeof (errno_tab))
- return EINVAL;
- else
- return errno_tab[rc];
-}
-
-#endif /* _OS2_ERRORTABLE_H */
// Fully instantiated font
LyXFont font = getFont(bparams, i);
- LyXFont const last_font = running_font;
+ LyXFont const & last_font = running_font;
// Spaces at end of font change are simulated to be
// outside font change, i.e. we write "\textXX{text} "
// rather than "\textXX{text }". (Asger)
if (open_font && c == ' ' && i <= size() - 2) {
- LyXFont const next_font = getFont(bparams, i + 1);
+ LyXFont const & next_font = getFont(bparams, i + 1);
if (next_font != running_font
&& next_font != font) {
font = next_font;
return getFirstFontSettings().language();
#else
Language const * lang = getFirstFontSettings().language();
+#ifdef WITH_WARNINGS
#warning We should make this somewhat better, any ideas? (Jug)
+#endif
if (lang == inherit_language || lang == ignore_language)
lang = bparams.language;
return lang;
+2002-02-26 John Levon <moz@compsoc.man.ac.uk>
+
+ * Makefile.am:
+ * os2_defines.h:
+ * os2_errortable.h:
+ * nt_defines.h: moved from src/
+
2002-02-18 Herbert Voss <voss@perce.de>
* filetools.C: (getExtFromContents) return the fileextension
lyxmanip.h \
$(LYXSTRING) lyxsum.C \
mkdir.C \
+ nt_defines.h \
+ os2_defines.h \
+ os2_errortable.h \
path.C \
path.h \
putenv.C \
--- /dev/null
+/* -*- C++ -*- */
+/* This file is part of
+ * ======================================================
+ *
+ * LyX, the High Level Word Processor
+ *
+ * Copyright 1995 Matthias Ettrich
+ * Copyright 1995-1998 The LyX Team.
+ *
+ * ======================================================
+ A few prototypes and definitions needed for Windows NT */
+
+/* Hacks to get LyX running under Win-NT w. Cygnus b19 (steven@cs.uu.nl) */
+
+#ifndef NT_DEFINES_H
+#define NT_DEFINES_H
+
+
+#endif /* NT_DEFINES_H */
--- /dev/null
+/* -*- C++ -*- */
+/* This file is part of
+* ======================================================
+*
+* LyX, The Document Processor
+*
+* Copyright 1995 Matthias Ettrich
+* Copyright 1995-2001 The LyX Team.
+*
+* ======================================================
+ A few prototypes and definitions needed for OS/2 */
+
+#ifndef OS2_DEFINES_H
+#define OS2_DEFINES_H
+
+#if defined (__cplusplus)
+#include <cctype>
+#include <cstdlib>
+
+extern "C"
+inline int readlink(const char *, char *, size_t) {return -1;}
+
+#else
+#include <ctype.h>
+#include <stdlib.h>
+#define readlink(s, t, l) (-1)
+#endif
+#include <process.h>
+#include <unistd.h>
+#include <X11/Xlocale.h>
+/* #include <malloc.h> */
+#define lstat stat
+#define S_ISLNK(x) false
+#define S_ISBLK(x) false
+/*#define mkfifo(p, m) (0) *//* LyXserver is temporary disabled. */
+#define chdir _chdir2
+#define strcasecmp stricmp
+#if defined (__cplusplus)
+extern "C" {
+#endif
+const char* __XOS2RedirRoot(const char* pathname);
+#if defined (__cplusplus)
+}
+#endif
+#undef LYX_DIR
+#define LYX_DIR __XOS2RedirRoot("/XFree86/lib/X11/lyx")
+#undef LOCALEDIR
+#define LOCALEDIR __XOS2RedirRoot("/XFree86/lib/X11/locale")
+#undef TOP_SRCDIR
+#define TOP_SRCDIR ".."
+/* I have the slightest idea what I am doing here... */
+#define bindtextdomain bindtextdomain__
+#define textdomain textdomain__
+
+#endif /* _OS2_DEFINES_H */
--- /dev/null
+/* -*- C++ -*- */
+/* This file is part of
+* ======================================================
+*
+* LyX, The Document Processor
+*
+* Copyright 1995 Matthias Ettrich
+* Copyright 1995-2001 The LyX Team.
+*
+* ======================================================
+ A table for translating OS/2 API return code into errno.
+ Copied from emx library source. */
+
+#ifndef OS2_ERRORTABLE_H
+#define OS2_ERRORTABLE_H
+//#ifndef _ERRNO_H
+#include <cerrno>
+//#endif
+
+namespace {
+
+unsigned char const errno_tab[] =
+{
+ EINVAL, EINVAL, ENOENT, ENOENT, EMFILE, /* 0..4 */
+ EACCES, EBADF, EIO, ENOMEM, EIO, /* 5..9 */
+ EINVAL, ENOEXEC, EINVAL, EINVAL, EINVAL, /* 10..14 */
+ ENOENT, EBUSY, EXDEV, ENOENT, EROFS, /* 15..19 */
+ EIO, EIO, EIO, EIO, EIO, /* 20..24 */
+ EIO, EIO, EIO, ENOSPC, EIO, /* 25..29 */
+ EIO, EIO, EACCES, EACCES, EIO, /* 30..34 */
+ EIO, EIO, EIO, EIO, ENOSPC, /* 35..39 */
+ EIO, EIO, EIO, EIO, EIO, /* 40..44 */
+ EIO, EIO, EIO, EIO, EIO, /* 45..49 */
+ EIO, EIO, EIO, EIO, EBUSY, /* 50..54 */
+ EIO, EIO, EIO, EIO, EIO, /* 55..59 */
+ EIO, ENOSPC, ENOSPC, EIO, EIO, /* 60..64 */
+ EACCES, EIO, EIO, EIO, EIO, /* 65..69 */
+ EIO, EIO, EIO, EROFS, EIO, /* 70..74 */
+ EIO, EIO, EIO, EIO, EIO, /* 75..79 */
+ EEXIST, EIO, ENOENT, EIO, EIO, /* 80..84 */
+ EIO, EIO, EINVAL, EIO, EAGAIN, /* 85..89 */
+ EIO, EIO, EIO, EIO, EIO, /* 90..94 */
+ EINTR, EIO, EIO, EIO, EACCES, /* 95..99 */
+ ENOMEM, EINVAL, EINVAL, ENOMEM, EINVAL, /* 100..104 */
+ EINVAL, ENOMEM, EIO, EACCES, EPIPE, /* 105..109 */
+ ENOENT, E2BIG, ENOSPC, ENOMEM, EINVAL, /* 110..114 */
+ EINVAL, EINVAL, EINVAL, EINVAL, EINVAL, /* 115..119 */
+ EINVAL, EINVAL, EINVAL, ENOENT, EINVAL, /* 120..124 */
+ ENOENT, ENOENT, ENOENT, ECHILD, ECHILD, /* 125..129 */
+ EACCES, EINVAL, ESPIPE, EINVAL, EINVAL, /* 130..134 */
+ EINVAL, EINVAL, EINVAL, EINVAL, EINVAL, /* 135..139 */
+ EINVAL, EINVAL, EBUSY, EINVAL, EINVAL, /* 140..144 */
+ EINVAL, EINVAL, EINVAL, EBUSY, EINVAL, /* 145..149 */
+ EINVAL, EINVAL, ENOMEM, EINVAL, EINVAL, /* 150..154 */
+ EINVAL, EINVAL, EINVAL, EINVAL, EINVAL, /* 155..159 */
+ EINVAL, EINVAL, EINVAL, EINVAL, EAGAIN, /* 160..164 */
+ EINVAL, EINVAL, EACCES, EINVAL, EINVAL, /* 165..169 */
+ EBUSY, EINVAL, EINVAL, EINVAL, EINVAL, /* 170..174 */
+ EINVAL, EINVAL, EINVAL, EINVAL, EINVAL, /* 175..179 */
+ EINVAL, EINVAL, EINVAL, EINVAL, ECHILD, /* 180..184 */
+ EINVAL, EINVAL, ENOENT, EINVAL, EINVAL, /* 185..189 */
+ ENOEXEC, ENOEXEC, ENOEXEC, ENOEXEC, ENOEXEC, /* 190..194 */
+ ENOEXEC, ENOEXEC, ENOEXEC, ENOEXEC, ENOEXEC, /* 195..199 */
+ ENOEXEC, ENOEXEC, ENOEXEC, ENOENT, EINVAL, /* 200..204 */
+ EINVAL, ENAMETOOLONG, EINVAL, EINVAL, EINVAL, /* 205..209 */
+ EINVAL, EINVAL, EACCES, ENOEXEC, ENOEXEC, /* 210..214 */
+ EINVAL, EINVAL, EINVAL, EINVAL, EINVAL, /* 215..219 */
+ EINVAL, EINVAL, EINVAL, EINVAL, EINVAL, /* 220..224 */
+ EINVAL, EINVAL, EINVAL, ECHILD, EINVAL, /* 225..229 */
+ EINVAL, EBUSY, EAGAIN, ENOTCONN, EINVAL, /* 230..234 */
+ EINVAL, EINVAL, EINVAL, EINVAL, EINVAL, /* 235..239 */
+ EINVAL, EINVAL, EINVAL, EINVAL, EINVAL, /* 240..244 */
+ EINVAL, EINVAL, EINVAL, EINVAL, EINVAL, /* 245..249 */
+ EACCES, EACCES, EINVAL, ENOENT, EINVAL, /* 250..254 */
+ EINVAL, EINVAL, EINVAL, EINVAL, EINVAL, /* 255..259 */
+ EINVAL, EINVAL, EINVAL, EINVAL, EINVAL, /* 260..264 */
+ EINVAL, EINVAL, EINVAL, EINVAL, EINVAL, /* 265..269 */
+ EINVAL, EINVAL, EINVAL, EINVAL, EINVAL, /* 270..274 */
+ EINVAL, EINVAL, EINVAL, EINVAL, EINVAL, /* 275..279 */
+ EINVAL, EINVAL, EINVAL, EINVAL, EEXIST, /* 280..284 */
+ EEXIST, EINVAL, EINVAL, EINVAL, EINVAL, /* 285..289 */
+ ENOMEM, EMFILE, EINVAL, EINVAL, EINVAL, /* 290..294 */
+ EINVAL, EINVAL, EINVAL, EINVAL, EINVAL, /* 295..299 */
+ EINVAL, EBUSY, EINVAL, ESRCH, EINVAL, /* 300..304 */
+ ESRCH, EINVAL, EINVAL, EINVAL, ESRCH, /* 305..309 */
+ EINVAL, ENOMEM, EINVAL, EINVAL, EINVAL, /* 310..314 */
+ EINVAL, E2BIG, ENOENT, EIO, EIO, /* 315..319 */
+ EINVAL, EINVAL, EINVAL, EINVAL, EAGAIN, /* 320..324 */
+ EINVAL, EINVAL, EINVAL, EIO, ENOENT, /* 325..329 */
+ EACCES, EACCES, EACCES, ENOENT, ENOMEM /* 330..334 */
+};
+
+} // namespace anon
+
+
+inline
+int TranslateOS2Error(unsigned long rc)
+{
+ if (rc >= sizeof (errno_tab))
+ return EINVAL;
+ else
+ return errno_tab[rc];
+}
+
+#endif /* _OS2_ERRORTABLE_H */
if (it != inset_owner) {
lyxerr << "InsetText is " << it << endl;
lyxerr << "inset_owner is " << inset_owner << endl;
+#ifdef WITH_WARNINGS
#warning I believe this code is wrong. (Lgb)
#warning Jürgen, have a look at this. (Lgb)
#warning Hmmm, I guess you are right but we
#warning should verify when this is needed
+#endif
// Jürgen, would you like to have a look?
// I guess we need to move the outer cursor
// and open and lock the inset (bla bla bla)
}
-void RCS::retrive(string const & file)
+void RCS::retrieve(string const & file)
{
- lyxerr[Debug::LYXVC] << "LyXVC::RCS: retrive.\n\t" << file << endl;
+ lyxerr[Debug::LYXVC] << "LyXVC::RCS: retrieve.\n\t" << file << endl;
VCS::doVCCommand("co -q -r \""
+ file + "\"",
string());
// -*- C++ -*-
+/**
+ * \file vc-backend.h
+ * Copyright 1995-2002 the LyX Team
+ * Read the file COPYING
+ *
+ * \author Lars Gullik Bjønnes
+ */
+
#ifndef VC_BACKEND_H
#define VC_BACKEND_H
class Buffer;
-///
+/// A simple version control system interface
class VCS {
public:
- ///
+ /// the status of the managed file
enum VCStatus {
- ///
UNLOCKED,
- ///
LOCKED
};
- ///
+
virtual ~VCS() {}
- ///
- virtual void scanMaster() = 0;
- ///
+
+ /// register a file for version control
virtual void registrer(string const & msg) = 0;
- ///
+ /// check in the current revision
virtual void checkIn(string const & msg) = 0;
- ///
+ /// check out for editing
virtual void checkOut() = 0;
- ///
+ /// revert current edits
virtual void revert() = 0;
- ///
+ /// FIXME
virtual void undoLast() = 0;
- ///
+ /**
+ * getLog - read the revision log into the given file
+ * @param fname file name to read into
+ */
virtual void getLog(string const &) = 0;
- ///
+ /// return the current version description
virtual string const versionString() const = 0;
- ///
+ /// return the current version
string const & version() const {
return version_;
}
- ///
+ /// return the user who has locked the file
string const & locker() const { return locker_; }
- ///
+ /// set the owning buffer
void owner(Buffer * b) { owner_ = b; }
- ///
+ /// return the owning buffer
Buffer * owner() const { return owner_; }
- ///
+ /// return the lock status of this file
VCStatus status() const { return vcstatus; }
protected:
- ///
- static int doVCCommand(string const &, string const &);
+ /// parse information from the version file
+ virtual void scanMaster() = 0;
+
+ /**
+ * doVCCommand - call out to the version control utility
+ * @param cmd the command to execute
+ * @param path the path from which to execute
+ * @return exit status
+ */
+ static int doVCCommand(string const & cmd, string const & path);
- /** The master VC file. For RCS this is *,v or RCS/ *,v. master should
- have full path.
- */
+ /**
+ * The master VC file. For RCS this is *,v or RCS/ *,v. master should
+ * have full path.
+ */
string master_;
/// The status of the VC controlled file.
VCStatus vcstatus;
- /** The version of the VC file. I am not sure if this can be a
- string of if it must be a
- float/int. */
+ /**
+ * The version of the VC file. I am not sure if this can be a
+ * string or if it must be a float/int.
+ */
string version_;
/// The user currently keeping the lock on the VC file.
///
class RCS : public VCS {
public:
- ///
+
explicit
RCS(string const & m);
- ///
+
+ /// return the revision file for the given file, if found
static string const find_file(string const & file);
- ///
- static void retrive(string const & file);
- ///
- virtual void scanMaster();
- ///
+
+ static void retrieve(string const & file);
+
virtual void registrer(string const & msg);
- ///
+
virtual void checkIn(string const & msg);
- ///
+
virtual void checkOut();
- ///
+
virtual void revert();
- ///
+
virtual void undoLast();
- ///
+
virtual void getLog(string const &);
- ///
+
virtual string const versionString() const {
return "RCS: " + version_;
}
+
+protected:
+ virtual void scanMaster();
};
///
explicit
CVS(string const & m, string const & f);
- ///
+
+ /// return the revision file for the given file, if found
static string const find_file(string const & file);
- ///
- virtual void scanMaster();
- ///
+
virtual void registrer(string const & msg);
- ///
+
virtual void checkIn(string const & msg);
- ///
+
virtual void checkOut();
- ///
+
virtual void revert();
- ///
+
virtual void undoLast();
- ///
+
virtual void getLog(string const &);
- ///
+
virtual string const versionString() const {
return "CVS: " + version_;
}
+
+protected:
+ virtual void scanMaster();
+
private:
string file_;
};
-#endif
+#endif // VCBACKEND_H
+++ /dev/null
-/* -*- C++ -*- */
-/* This file is part of
-* ======================================================
-*
-* LyX, the High Level Word Processor
-*
-* Copyright 1995 Matthias Ettrich
-* Copyright 1995-2001 The LyX Team.
-*
-* ======================================================
- A few prototypes and definitions needed for VMS / OpenVMS */
-
-#ifndef VMS_DEFINES_H
-#define VMS_DEFINES_H
-
-/* Currently empty. */
-
-#endif /* _VMS_DEFINES_H */
-/* This file is part of
- * ======================================================
+/**
+ * \file vspace.C
+ * Copyright 1995-2002 the LyX Team
+ * Read the file COPYING
*
- * LyX, The Document Processor
- *
- * Copyright 1995 Matthias Ettrich
- * Copyright 1995-2001 The LyX Team.
- *
- * ====================================================== */
+ * \author Matthias Ettrich
+ */
#include <config.h>
#include "lyxrc.h"
#include "lyxtext.h"
#include "BufferView.h"
+#include "support/LAssert.h"
#include "support/lstrings.h"
namespace {
-double number[4] = { 0, 0, 0, 0 };
-LyXLength::UNIT unit[4] = { LyXLength::UNIT_NONE,
- LyXLength::UNIT_NONE,
- LyXLength::UNIT_NONE,
- LyXLength::UNIT_NONE };
+/// used to return numeric values in parsing vspace
+double number[4] = { 0, 0, 0, 0 };
+/// used to return unit types in parsing vspace
+LyXLength::UNIT unit[4] = { LyXLength::UNIT_NONE,
+ LyXLength::UNIT_NONE,
+ LyXLength::UNIT_NONE,
+ LyXLength::UNIT_NONE };
+/// the current position in the number array
int number_index;
+/// the current position in the unit array
int unit_index;
+/// skip n characters of input
inline
void lyx_advance(string & data, string::size_type n)
{
data.erase(0, n);
}
-
+/// return true when the input is at the end
inline
bool isEndOfData(string const & data)
{
return frontStrip(data).empty();
}
-
+/**
+ * nextToken - return the next token in the input
+ * @param data input string
+ * @return a char representing the type of token returned
+ *
+ * The possible return values are :
+ * + stretch indicator for glue length
+ * - shrink indicator for glue length
+ * n a numeric value (stored in number array)
+ * u a unit type (stored in unit array)
+ * E parse error
+ */
char nextToken(string & data)
{
data = frontStrip(data);
}
+/// latex representation of a vspace
struct LaTeXLength {
char const * pattern;
int plus_val_index;
};
+/// the possible formats for a vspace string
LaTeXLength table[] = {
{ "nu", 0, 0, 0, 0 },
{ "nu+nu", 2, 0, 2, 0 },
bool isValidLength(string const & data, LyXLength * result)
{
- /// This is a trimmed down version of isValidGlueLength.
- /// The parser may seem overkill for lengths without
- /// glue, but since we already have it, using it is
- /// easier than writing something from scratch.
+ // This is a trimmed down version of isValidGlueLength.
+ // The parser may seem overkill for lengths without
+ // glue, but since we already have it, using it is
+ // easier than writing something from scratch.
if (data.empty())
return true;
case LENGTH: return keep_ ? "\\vspace*{" + len_.asLatexString() + '}'
: "\\vspace{" + len_.asLatexString() + '}';
}
- return string(); // should never be reached
+
+ lyx::Assert(0);
}
retval = 3 * default_height;
break;
- case LENGTH:
- {
+ case LENGTH: {
int const default_width = bv->workWidth();
retval = len_.len().inPixels(default_width, default_height);
break;
}
}
-
return retval;
}
// -*- C++ -*-
-/* This file is part of
- * ======================================================
+/**
+ * \file vspace.h
+ * Copyright 1995-2002 the LyX Team
+ * Read the file COPYING
*
- * LyX, The Document Processor
- *
- * Copyright 1995 Matthias Ettrich
- * Copyright 1995-2001 The LyX Team.
- *
- * ====================================================== */
+ * \author Matthias Ettrich
+ */
#ifndef VSPACE_H
#define VSPACE_H
class BufferView;
-///
+/// A class representing latex vertical spacing
class VSpace {
public:
/// The different kinds of spaces.
enum vspace_kind {
- ///
- NONE,
- ///
+ NONE, ///< no added vertical space
DEFSKIP,
- ///
SMALLSKIP,
- ///
MEDSKIP,
- ///
BIGSKIP,
- ///
VFILL,
- ///
- LENGTH
+ LENGTH ///< user-defined length
};
- /// Constructor
+
VSpace();
- /// Constructor
+
explicit VSpace(vspace_kind k);
- /// Constructor
+
explicit VSpace(LyXLength const & l);
- /// Constructor
+
explicit VSpace(LyXGlueLength const & l);
/// Constructor for reading from a .lyx file
explicit VSpace(string const & data);
- /// access functions
+ /// return the type of vertical space
vspace_kind kind() const;
- ///
+ /// return the length of this space
LyXGlueLength length() const;
// a flag that switches between \vspace and \vspace*
bool keep() const;
- ///
+ /// if set true, use \vspace* when type is not DEFSKIP
void setKeep(bool val);
///
bool operator==(VSpace const &) const;
// conversion
+
/// how it goes into the LyX file
string const asLyXCommand() const;
- ///
+ /// the latex representation
string const asLatexCommand(BufferParams const & params) const;
- ///
+ /// the size of the space on-screen
int inPixels(BufferView * bv) const;
private:
/// This VSpace kind
vspace_kind kind_;
- ///
+ /// the specified length
LyXGlueLength len_;
- ///
+ /// if true, use \vspace* type
bool keep_;
};