From 797d87b4513088a66b17c7ac653b84e36ea80458 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20Gullik=20Bj=C3=B8nnes?= Date: Mon, 7 Aug 2000 20:58:24 +0000 Subject: [PATCH] make doc++ able to generate the source documentation for lyx git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@956 a592a061-630c-0410-9148-cb99ea01b6c8 --- ChangeLog | 11 + development/Code_rules/Rules | 71 ++++++ src/BackStack.h | 8 +- src/BufferView.h | 23 +- src/BufferView_pimpl.h | 8 +- src/Bullet.h | 2 + src/Chktex.h | 9 +- src/ColorHandler.h | 4 +- src/CutAndPaste.C | 4 +- src/CutAndPaste.h | 12 +- src/FloatList.h | 1 + src/FontInfo.h | 12 +- src/FontLoader.h | 1 + src/ImportNoweb.h | 3 +- src/LColor.h | 15 +- src/LaTeX.h | 10 +- src/LaTeXFeatures.h | 37 +-- src/Literate.h | 1 + src/LyXAction.h | 11 +- src/MenuBackend.h | 1 - src/Painter.h | 6 - src/PainterBase.h | 15 +- src/PrinterParams.h | 37 +-- src/Sectioning.h | 1 - src/TextCache.h | 2 +- src/Timeout.h | 2 + src/ToolbarDefaults.h | 2 +- src/WorkArea.h | 42 ++-- src/buffer.h | 114 +++++---- src/bufferlist.h | 17 +- src/bufferparams.h | 28 ++- src/combox.h | 6 +- src/encoding.h | 17 +- src/filedlg.h | 6 +- src/font.h | 32 +-- src/frontends/DialogBase.h | 11 +- src/frontends/Liason.h | 16 +- src/frontends/Menubar.h | 2 + src/frontends/Toolbar.h | 2 + src/frontends/gnome/FormCopyright.h | 15 +- src/frontends/kde/FormCopyright.h | 12 +- src/frontends/xforms/FormCommand.h | 20 +- src/frontends/xforms/FormCopyright.h | 15 +- src/frontends/xforms/FormGraphics.h | 121 +++++----- src/gettext.h | 4 + src/graphics/GraphicsCache.h | 16 +- src/graphics/GraphicsCacheItem.h | 2 +- src/insets/ExternalTemplate.h | 15 +- src/insets/insetcommand.h | 2 + src/intl.h | 3 +- src/language.h | 11 +- src/lastfiles.h | 46 ++-- src/layout.h | 44 +++- src/lyx_cb.h | 3 + src/lyx_gui.h | 66 ++---- src/lyx_gui_misc.h | 8 +- src/lyx_main.h | 19 +- src/lyx_sty.h | 15 ++ src/lyxcursor.h | 4 +- src/lyxfont.h | 47 ++-- src/lyxfr0.h | 1 - src/lyxfr1.h | 11 +- src/lyxfunc.h | 14 +- src/lyxlex.h | 68 +++--- src/lyxlookup.h | 6 +- src/lyxparagraph.h | 40 ++-- src/lyxrc.h | 13 +- src/lyxscreen.h | 16 +- src/lyxserver.h | 23 +- src/lyxtext.h | 33 ++- src/lyxvc.h | 1 - src/mathed/array.h | 9 +- src/mathed/math_defs.h | 30 +-- src/mathed/math_iter.h | 69 +++--- src/mathed/math_macro.h | 70 +++--- src/mathed/math_panel.h | 53 ++++- src/mathed/math_parser.h | 136 +++++++---- src/mathed/math_root.h | 4 +- src/mathed/symbol_def.h | 337 +++++++++++++++++++++++++-- src/minibuffer.h | 12 +- src/spellchecker.h | 8 - src/support/DebugStream.h | 30 +-- src/support/FileInfo.h | 17 +- src/support/LAssert.h | 9 +- src/support/LRegex.h | 16 -- src/support/StrPool.h | 7 +- src/support/block.h | 21 ++ src/support/filetools.h | 2 +- src/support/lstrings.h | 16 +- src/support/lxtl.h | 8 +- src/support/lyxlib.h | 2 + src/support/lyxstring.h | 4 +- src/support/path.h | 6 +- src/support/utility.hpp | 10 +- src/table.h | 89 +++++-- src/tabular.h | 118 ++++++++-- src/tex-strings.h | 4 +- src/texrow.C | 1 + src/tracer.h | 5 + src/trans.h | 7 +- src/trans_decl.h | 25 +- src/trans_mgr.h | 22 +- src/vc-backend.h | 1 - src/version.h | 3 + src/vspace.h | 41 ++-- 105 files changed, 1600 insertions(+), 908 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6c38709abf..52bacc1e78 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2000-08-07 Lars Gullik Bjønnes + + * src/CutAndPaste.[Ch]: make all metods static. + + * development/Code_rules/Rules: more work, added section on + Exceptions, and a References section. + + * a lot of header files: work to make doc++ able to generate the + source documentation, some workarounds of doc++ problems. Doc++ is + now able to generate the documentation. + 2000-08-07 Juergen Vigna * src/insets/insettabular.C (recomputeTextInsets): removed function diff --git a/development/Code_rules/Rules b/development/Code_rules/Rules index 52d29fbcca..7e2ed08ab3 100644 --- a/development/Code_rules/Rules +++ b/development/Code_rules/Rules @@ -34,6 +34,7 @@ that you: - take advantage of the C++ standard library. especially don't use custom containers when a standard container is usable, learn to use the algorithms and functors in the standard library. +- be aware of exceptions and write exception safe code. See Exceptions. - document all variables, methods, functions, classes etc. We are using the source documentation program doc++, a program that handles javadoc syntax, to document sources. See Source Documentation. @@ -114,6 +115,70 @@ in C++. T add(...); +Exceptions +---------- + +Even if LyX currently is not using exceptions we need to be aware of +them. One important thing to realize is that you often do not have to +use throw,try or catch to be exception safe. Let's look at the +different types of exceptions safety: (These are taken from Herb +Sutters book[ExC++] + +" +1. Basic guarantee: Even in te presence of exceptions thrown by T or +other exceptions, Stack objects don't leak resources. + Note that this also implies that the container will be + destructible and usable even if an exception is thrown wile + performing some container operation. However, if an exception + is thrown, the container will be in a consistent, but not + necessarily predictable, state. Containers that support the + basic guarantee can work safely in some settings. + +2. Strong guarantee: If an operation terminates because of an +exception, program state will remain uncanged. + This always implies commit-or-rollback samantics, including + that no references or iterators into the container be + invalidated if an operation fails. For example, if a Stack + client calls Top and then attempts a Push that fails because + of an exception, then the state of the Stack object must be + unchanged and the reference returned from the prior call to + Top must still be valid. For more information on there + guarantees, see Dave Abrahams's documentation of the SGI + exception-safe standard library adaption at: + http://www.metabyte.com/~fbp/stl/eg_contract.html + + Probably te most interesting point here is tat wen you + implement the basic guarantee, the strong guarantee often + comes for free. For example, in our Stack implementation, + alost everything we did was needed to satisfy just the basic + guarantee -- and wath's presented above very nearly satisfires + the strong guarantee, with little of no extra work. Not half + bad, considering all the trouble we went to. + + In addition to tese two guarantees, there is one more + guarantee that certain functions must provide in order to make + overall exception safety possible: + +3. Nothrow guarantee: Te function will not emit an exception under any + circumstances. + Overall exception safety isn't possible unless certain + functions are guaranteed not to throw. In particualr, we've + seen that this is true for destructors; later in tis + miniseries, we'll see that it's also needed in certain helper + functions, such as Swap(). +" + +For all cases where we might be able to write exception safe functions +without using try,throw or catch we should do so. In particular we +should look over all destructors to ensure that they are as exception +safe at possible. + +Later when more compiler support exceptions sufficiently well we will +begin using them too. One reason for this is that the C++ standard +library actually requires exceptions, e.g. "new" will throw +bad_allocation if the requested memory is not available. + + Formatting ---------- @@ -297,3 +362,9 @@ existing member functions. That will help maintainability in the future. (I'll fill in more from Scott Meyers article when time allows.) + +References +---------- + +[ExC++] Sutter, Herb. Exceptional C++: 47 engineering puzzles, + programming problems, and solutions. ISBN 0-201-61562-2 diff --git a/src/BackStack.h b/src/BackStack.h index d1dc6f973c..ca5a1b5264 100644 --- a/src/BackStack.h +++ b/src/BackStack.h @@ -15,9 +15,9 @@ #include "LString.h" -// Created by Alejandro Aguilar Sierra, 970806 - /** Utility to get back from a reference or from a child document. + @author Alejandro Aguilar Sierra + @version 970806 */ class BackStack { private: @@ -50,7 +50,9 @@ public: stakk.pop(); return bit.fname; } - /// + /** + @return returns #true# if the stack is empty, #false# otherwise. + */ bool empty() const { return stakk.empty(); } diff --git a/src/BufferView.h b/src/BufferView.h index dd923183f0..e1b3bc6218 100644 --- a/src/BufferView.h +++ b/src/BufferView.h @@ -32,9 +32,13 @@ class BufferView : public noncopyable { public: /// enum UpdateCodes { + /// UPDATE = 0, + /// SELECT = 1, + /// FITCUR = 2, + /// CHANGE = 4 }; @@ -62,12 +66,13 @@ public: void fitCursor(); /// void update(); - /// + // void update(UpdateCodes uc); /// void updateScrollbar(); /// - Inset * checkInsetHit(LyXText *, int & x, int & y, unsigned int button); + Inset * checkInsetHit(LyXText *, int & x, int & y, + unsigned int button); /// void redoCurrentBuffer(); /// @@ -172,14 +177,17 @@ public: void insertErrors(TeXErrors & terr); /// void setCursorFromRow(int row); - /** Insert an inset into the buffer - Insert inset into buffer, placing it in a layout of lout, - if no_table make sure that it doesn't end up in a table. */ + /** Insert an inset into the buffer. + Placie it in a layout of lout, + if no_table make sure that it doesn't end up in a table. + */ bool insertInset(Inset * inset, string const & lout = string(), bool no_table = false); /// open and lock an updatable inset bool open_new_inset(UpdatableInset * new_inset); - /// Inserts a lyx file at cursor position. Returns false if it fails. + /** Inserts a lyx file at cursor position. + @return #false# if it fails. + */ bool insertLyXFile(string const & file); /// bool lockInset(UpdatableInset * inset); @@ -244,11 +252,14 @@ public: void stuffClipboard(string const &) const; private: struct Pimpl; + /// friend struct BufferView::Pimpl; + /// Pimpl * pimpl_; }; +/// BufferView::UpdateCodes operator|(BufferView::UpdateCodes uc1, BufferView::UpdateCodes uc2); diff --git a/src/BufferView_pimpl.h b/src/BufferView_pimpl.h index 4358e20197..7de82ef77a 100644 --- a/src/BufferView_pimpl.h +++ b/src/BufferView_pimpl.h @@ -20,7 +20,9 @@ class LyXScreen; using SigC::Object; #endif +/// struct BufferView::Pimpl : public Object { + /// Pimpl(BufferView * i, LyXView * o, int xpos, int ypos, int width, int height); /// @@ -41,7 +43,7 @@ struct BufferView::Pimpl : public Object { int resizeCurrentBuffer(); /// void update(); - /// + // void update(BufferView::UpdateCodes); /// void gotoError(); @@ -54,7 +56,8 @@ struct BufferView::Pimpl : public Object { /// void scrollCB(double value); /// - Inset * checkInsetHit(LyXText *, int & x, int & y, unsigned int button); + Inset * checkInsetHit(LyXText *, int & x, int & y, + unsigned int button); /// int scrollUp(long time); /// @@ -142,6 +145,7 @@ struct BufferView::Pimpl : public Object { /// void stuffClipboard(string const &) const; private: + /// bool using_xterm_cursor; }; #endif diff --git a/src/Bullet.h b/src/Bullet.h index 446f18b1e5..f761dd8cf2 100644 --- a/src/Bullet.h +++ b/src/Bullet.h @@ -60,6 +60,7 @@ public: } protected: #ifdef ENABLE_ASSERTIONS + /// void testInvariant() const { Assert(font >= MIN); Assert(font < FONTMAX); @@ -254,6 +255,7 @@ char const * Bullet::c_str() const /*-----------------End Bullet Member Functions-----------------*/ +/// extern Bullet const ITEMIZE_DEFAULTS[]; diff --git a/src/Chktex.h b/src/Chktex.h index 3770d0f1f9..745e8b4493 100644 --- a/src/Chktex.h +++ b/src/Chktex.h @@ -29,14 +29,15 @@ class TeXErrors; class Chktex { public: /** - cmd = the chktex command, file = name of the (temporary) latex file, - path = name of the files original path. - */ + @param cmd the chktex command. + @param file name of the (temporary) latex file. + @param path name of the files original path. + */ Chktex(string const & cmd, string const & file, string const & path); /** Runs chktex. - Returns -1 if fail, number of messages otherwise. + @return -1 if fail, number of messages otherwise. */ int run(TeXErrors &); private: diff --git a/src/ColorHandler.h b/src/ColorHandler.h index b9e2640839..0af42d70dc 100644 --- a/src/ColorHandler.h +++ b/src/ColorHandler.h @@ -15,9 +15,6 @@ #pragma interface #endif -//#include "config.h" -//#include "LString.h" - // This is only included to provide stuff for the non-public sections #include @@ -60,6 +57,7 @@ private: Pixmap drawable; }; +/// extern LyXColorHandler * lyxColorHandler; #endif diff --git a/src/CutAndPaste.C b/src/CutAndPaste.C index 0987745ca1..de95af7932 100644 --- a/src/CutAndPaste.C +++ b/src/CutAndPaste.C @@ -448,7 +448,7 @@ bool CutAndPaste::pasteSelection(LyXParagraph ** par, LyXParagraph ** endpar, } -int CutAndPaste::nrOfParagraphs() const +int CutAndPaste::nrOfParagraphs() { if (!buf) return 0; @@ -503,7 +503,7 @@ int CutAndPaste::SwitchLayoutsBetweenClasses(LyXTextClassList::size_type c1, } -bool CutAndPaste::checkPastePossible(LyXParagraph * par, int) const +bool CutAndPaste::checkPastePossible(LyXParagraph * par, int) { if (!buf) return false; diff --git a/src/CutAndPaste.h b/src/CutAndPaste.h index c0888e89f7..825b11d210 100644 --- a/src/CutAndPaste.h +++ b/src/CutAndPaste.h @@ -23,26 +23,32 @@ class LyXParagraph; class CutAndPaste { public: /// + static bool cutSelection(LyXParagraph * startpar, LyXParagraph ** endpar, int start, int & end, char tc, bool doclear = false); /// + static bool copySelection(LyXParagraph * startpar, LyXParagraph * endpar, int start, int end, char tc); /// + static bool pasteSelection(LyXParagraph ** par, LyXParagraph ** endpar, int & pos, char tc); /// - int nrOfParagraphs() const; + static + int nrOfParagraphs(); /** needed to switch between different classes this works for a list of paragraphs beginning with the specified par return value is the number of wrong conversions - */ + */ + static int SwitchLayoutsBetweenClasses(LyXTextClassList::size_type class1, LyXTextClassList::size_type class2, LyXParagraph * par); /// - bool checkPastePossible(LyXParagraph *, int pos) const; + static + bool checkPastePossible(LyXParagraph *, int pos); }; #endif diff --git a/src/FloatList.h b/src/FloatList.h index c231d52521..aed0dfa79b 100644 --- a/src/FloatList.h +++ b/src/FloatList.h @@ -41,6 +41,7 @@ private: List list; }; +/// extern FloatList floatList; #endif diff --git a/src/FontInfo.h b/src/FontInfo.h index 49fbbfe299..d3d2e8b0a0 100644 --- a/src/FontInfo.h +++ b/src/FontInfo.h @@ -19,11 +19,13 @@ #include "LString.h" /** This class manages a font. -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 lyxrc.use_scalable_fonts -determines whether to allow scalable fonts to give an exact match. */ + 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 + lyxrc.use_scalable_fonts determines whether to allow scalable fonts to + give an exact match. +*/ class FontInfo { public: /// diff --git a/src/FontLoader.h b/src/FontLoader.h index 189a0b986b..fce75a74b1 100644 --- a/src/FontLoader.h +++ b/src/FontLoader.h @@ -74,6 +74,7 @@ private: LyXFont::FONT_SIZE size); }; +/// extern FontLoader fontloader; #endif diff --git a/src/ImportNoweb.h b/src/ImportNoweb.h index 551e2b7643..c83d148341 100644 --- a/src/ImportNoweb.h +++ b/src/ImportNoweb.h @@ -41,7 +41,8 @@ private: /// string documentclass(); /// - enum { + enum { + /// BUFSIZE = 512 }; }; diff --git a/src/LColor.h b/src/LColor.h index 1875816b78..e282761c1b 100644 --- a/src/LColor.h +++ b/src/LColor.h @@ -18,6 +18,7 @@ #include #include "LString.h" +#include "support/utility.hpp" /** This is a stateless class. @@ -31,8 +32,7 @@ - A logical color, such as no color, inherit, math */ - -class LColor { +class LColor : public noncopyable { public: /// Names of colors, including all logical colors enum color { @@ -55,7 +55,7 @@ public: /// yellow, - /// Needed interface colors + // Needed interface colors /// Background color background, @@ -161,7 +161,7 @@ public: /// Color used for bottom background buttonbg, - /// Logical attributes + // Logical attributes /// Color is inherited inherit, @@ -193,9 +193,13 @@ public: private: /// struct information { + /// string guiname; + /// string latexname; + /// string x11name; + /// string lyxname; }; @@ -206,10 +210,11 @@ private: /// typedef std::map InfoTab; - + /// InfoTab infotab; }; +/// extern LColor lcolor; #endif diff --git a/src/LaTeX.h b/src/LaTeX.h index fdc9f52332..89325b2a26 100644 --- a/src/LaTeX.h +++ b/src/LaTeX.h @@ -64,10 +64,10 @@ private: class LaTeX { 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. - */ + + This enum should be enlarged a bit so that one could + get more feedback from the LaTeX run. + */ enum log_status { /// NO_ERRORS = 0, @@ -154,7 +154,7 @@ protected: /// string path; - // used by scanLogFile + /// used by scanLogFile int num_errors; }; diff --git a/src/LaTeXFeatures.h b/src/LaTeXFeatures.h index cee55913a1..f8cc2e63ae 100644 --- a/src/LaTeXFeatures.h +++ b/src/LaTeXFeatures.h @@ -27,10 +27,11 @@ class LyXTextClass; struct Language; /** The packages and commands that a buffer needs. This struct - contains an entry for each of the latex packages and - commands that a buffer might need. This struct is supposed to be - extended as the need arises. Remember to update the validate function - in buffer.C and paragraph.C when you do so. */ + contains an entry for each of the latex packages and + commands that a buffer might need. This struct is supposed to be + extended as the need arises. Remember to update the validate function + in buffer.C and paragraph.C when you do so. +*/ struct LaTeXFeatures { /// LaTeXFeatures(BufferParams const &, int n) ; @@ -52,8 +53,6 @@ struct LaTeXFeatures { /// Static preamble bits from the external material insets string externalPreambles; - //@Man: Packages - //@{ /// bool array; /// @@ -92,11 +91,7 @@ struct LaTeXFeatures { bool prettyref; // prettyref.sty /// bool chess; // chess.sty - //@} - - //@Man: Commands - //@{ /// bool lyx; /// @@ -105,10 +100,7 @@ struct LaTeXFeatures { bool noun; /// \lyxarrow bool lyxarrow; - //@} - - //@Man: Quotes - //@{ + /// bool quotesinglbase; /// @@ -121,25 +113,17 @@ struct LaTeXFeatures { bool guillemotleft; /// bool guillemotright; - //@} - - //@Man: Math mode - //@{ + /// bool amsstyle; /// bool boldsymbol; /// bool binom; - //@} - //@Man: Layouts - //@{ std::vector layout; - //@} - - //@Man: Special features - //@{ + + /// bool LyXParagraphIndent; /// bool NeedLyXFootnoteCode; @@ -157,9 +141,10 @@ struct LaTeXFeatures { typedef std::map FileMap; /// FileMap IncludedFiles; - //@} + /// BufferParams const & bufferParams() const; private: + /// BufferParams const & params; }; diff --git a/src/Literate.h b/src/Literate.h index 9027db10d0..73688ddd8e 100644 --- a/src/Literate.h +++ b/src/Literate.h @@ -22,6 +22,7 @@ class MiniBuffer; /// class Literate : public LaTeX { public: + /// Literate(string const & cmd, string const & file, string const & path, string const & litfile, string const & literate_cmd, string const & literate_filter, diff --git a/src/LyXAction.h b/src/LyXAction.h index 4fadb5c048..19790c32e5 100644 --- a/src/LyXAction.h +++ b/src/LyXAction.h @@ -10,21 +10,27 @@ #include "commandtags.h" #include "LString.h" +#include "support/utility.hpp" /** This class encapsulates LyX action and user command operations. */ -class LyXAction { +class LyXAction : public noncopyable { private: /// struct func_info { + /// string name; + /// unsigned int attrib; + /// string helpText; }; /// struct pseudo_func { + /// kb_action action; + /// string arg; }; public: @@ -48,7 +54,8 @@ public: /// Can be used when there is no document open NoBuffer = 2, //Interactive = 2, // Is interactive (requires a GUI) - Argument=4 // Requires argument + /// + Argument = 4 // Requires argument //MathOnly = 8, // Only math mode //EtcEtc = ... // Or other attributes... }; diff --git a/src/MenuBackend.h b/src/MenuBackend.h index 161d9283df..29e004bf98 100644 --- a/src/MenuBackend.h +++ b/src/MenuBackend.h @@ -108,7 +108,6 @@ private: bool menubar_; /// string name_; - /// }; diff --git a/src/Painter.h b/src/Painter.h index 7bba9cdde2..1becb41462 100644 --- a/src/Painter.h +++ b/src/Painter.h @@ -36,7 +36,6 @@ public: /// Constructor explicit Painter(WorkArea &); - /**@Basic drawing routines */ /// Draw a line from point to point PainterBase & line(int x1, int y1, int x2, int y2, LColor::color = LColor::foreground, @@ -78,13 +77,9 @@ public: PainterBase & fillRectangle(int x, int y, int w, int h, LColor::color = LColor::background); - /**@Image stuff */ - /// For the figure inset PainterBase & pixmap(int x, int y, int w, int h, Pixmap bitmap); - /**@String functions */ - /// Draw a string at position x, y (y is the baseline) PainterBase & text(int x, int y, string const & str, LyXFont const & f); @@ -104,7 +99,6 @@ private: /// Check the font, and if set, draw an underline void underline(LyXFont const & f, int x, int y, int width); - /**@Low level X parameters */ /// Display * display; }; diff --git a/src/PainterBase.h b/src/PainterBase.h index 22f3a0782b..11624821e7 100644 --- a/src/PainterBase.h +++ b/src/PainterBase.h @@ -35,7 +35,11 @@ class LyXFont; class PainterBase { protected: /// - static int dummy1, dummy2, dummy3; + static int dummy1; + /// + static int dummy2; + /// + static int dummy3; public: /// enum line_width { @@ -61,7 +65,7 @@ public: /// virtual ~PainterBase() {} - /** Screen geometry */ + /* Screen geometry */ /// int paperMargin() const; /// @@ -69,7 +73,6 @@ public: /// int paperHeight() const; - /**@Basic drawing routines */ /// Draw a line from point to point virtual PainterBase & line( int x1, int y1, int x2, int y2, @@ -141,16 +144,13 @@ public: /// virtual PainterBase & buttonFrame(int x, int y, int w, int h); - /**@Image stuff */ - /// For the figure inset + // For the figure inset // This can't be part of the base since we don't know what window // system we will be useing, or if are going to use pixmaps at all. //virtual PainterBase & pixmap(int x, int y, Pixmap bitmap)=0; - /**@String functions */ - /// 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; @@ -184,6 +184,7 @@ public: int & ascent = PainterBase::dummy2, int & descent = PainterBase::dummy3); protected: + /// WorkArea & owner; }; diff --git a/src/PrinterParams.h b/src/PrinterParams.h index 2c19c0af74..90ce2f9a00 100644 --- a/src/PrinterParams.h +++ b/src/PrinterParams.h @@ -33,15 +33,27 @@ */ struct PrinterParams { /// - enum Target{PRINTER, FILE}; + enum Target{ + /// + PRINTER, + /// + FILE + }; /// Target target; /// string printer_name; /// string file_name; - ///We allow printing of even pages in a range and so on. - enum WhichPages{ALL, ODD, EVEN}; + /// We allow printing of even pages in a range and so on. + enum WhichPages{ + /// + ALL, + /// + ODD, + /// + EVEN + }; /// WhichPages which_pages; /** Print a page range. Both from_page and to_page used to be strings @@ -63,15 +75,13 @@ struct PrinterParams { // 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 - //bool orientation; - /// Print n pages per physical sheet - //unsigned int nup; - /// Override document settings for duplex. - //bool duplex; + // Override the documents orientation + // bool orientation; + // Print n pages per physical sheet + // unsigned int nup; + // Override document settings for duplex. + // bool duplex; - //@name Constructors and Deconstructors - //@{ /// PrinterParams(Target const & t = PRINTER, string const & pname = lyxrc.printer, @@ -108,15 +118,11 @@ struct PrinterParams { { testInvariant(); } - //@} - // do we need these? // friend bool operator==(PrinterParams const &, PrinterParams const &); // friend bool operator<(PrinterParams const &, PrinterParams const &); - //@name Invariant Test Method - //@{ /** Test that all the fields contain valid entries. It's unlikely that the internal code will get this wrong (at least for the xforms code anyway) however new ports and external scripts @@ -157,7 +163,6 @@ struct PrinterParams { } #endif } - //@} }; #endif diff --git a/src/Sectioning.h b/src/Sectioning.h index ca1dd134b0..59df9a90d2 100644 --- a/src/Sectioning.h +++ b/src/Sectioning.h @@ -47,7 +47,6 @@ private: /// class SectioningList { -public: private: /// typedef std::map List_; diff --git a/src/TextCache.h b/src/TextCache.h index c65111d45b..b18aabf3ca 100644 --- a/src/TextCache.h +++ b/src/TextCache.h @@ -138,6 +138,6 @@ private: Cache cache; }; -// bla bla +/// extern TextCache textcache; #endif diff --git a/src/Timeout.h b/src/Timeout.h index d4c538a327..178aed8d41 100644 --- a/src/Timeout.h +++ b/src/Timeout.h @@ -30,7 +30,9 @@ class Timeout { public: /// enum Type { + /// ONETIME, + /// CONTINOUS }; /// diff --git a/src/ToolbarDefaults.h b/src/ToolbarDefaults.h index 00f3c9182a..2f98e4f1b6 100644 --- a/src/ToolbarDefaults.h +++ b/src/ToolbarDefaults.h @@ -74,7 +74,7 @@ private: Defaults defaults; }; -//The global instance +/// The global instance extern ToolbarDefaults toolbardefaults; diff --git a/src/WorkArea.h b/src/WorkArea.h index 651b2a033c..85c85629c1 100644 --- a/src/WorkArea.h +++ b/src/WorkArea.h @@ -30,7 +30,7 @@ class BufferView; - +/// class WorkArea { public: /// @@ -106,26 +106,26 @@ public: BufferView * owner() const { return owner_; } // Signals - /// - //Signal0 workAreaExpose; - /// - //Signal3 workAreaButtonPress; - /// - //Signal3 workAreaButtonRelease; - /// - //Signal3 workAreaMotionNotify; - /// - //Signal0 workAreaFocus; - /// - //Signal0 workAreaUnfocus; - /// - //Signal0 workAreaEnter; - /// - //Signal0 workAreaLeave; - /// - //Signal3 workAreaDoubleClick; - /// - //Signal3 workAreaTripleClick; + // + // Signal0 workAreaExpose; + // + // Signal3 workAreaButtonPress; + // + // Signal3 workAreaButtonRelease; + // + // Signal3 workAreaMotionNotify; + // + // Signal0 workAreaFocus; + // + // Signal0 workAreaUnfocus; + // + // Signal0 workAreaEnter; + // + // Signal0 workAreaLeave; + // + // Signal3 workAreaDoubleClick; + // + // Signal3 workAreaTripleClick; private: /// void createPixmap(int, int); diff --git a/src/buffer.h b/src/buffer.h index 598ea56015..1404bfc90b 100644 --- a/src/buffer.h +++ b/src/buffer.h @@ -56,27 +56,21 @@ struct DEPCLEAN { */ class Buffer { public: - /**@name Constructors and destructor */ - //@{ /// explicit Buffer(string const & file, bool b = false); /// ~Buffer(); - //@} - - /**@name Methods */ - //@{ /** save the buffer's parameters as user default - This function saves a file user_lyxdir/templates/defaults.lyx + This function saves a file #user_lyxdir/templates/defaults.lyx# which parameters are those of the current buffer. This file is used as a default template when creating a new - file. Returns true on success. + file. Returns #true# on success. */ bool saveParamsAsDefaults(); - /** high-level interface to buffer functionality + /** High-level interface to buffer functionality. This function parses a command string and executes it */ bool Dispatch(string const & command); @@ -89,6 +83,7 @@ public: /// should be changed to work for a list. void resize(); + /// void resizeInsets(BufferView *); /// Update window titles of all users @@ -98,12 +93,12 @@ public: void resetAutosaveTimers() const; /** Adds the BufferView to the users list. - Later this func will insert the BufferView into a real list, + Later this func will insert the #BufferView# into a real list, not just setting a pointer. */ void addUser(BufferView * u) { users = u; } - /** Removes the BufferView from the users list. + /** Removes the #BufferView# from the users list. Since we only can have one at the moment, we just reset it. */ void delUser(BufferView *) { users = 0; } @@ -119,16 +114,18 @@ public: void loadAutoSaveFile(); /** Reads a file. - Returns false if it fails. - If par is given, the file is inserted. */ + @param par if != 0 insert the file. + @return #false# if method fails. + */ bool readFile(LyXLex &, LyXParagraph * par = 0); /** Reads a file without header. - Returns false, if file is not completely read. - If par is given, the file is inserted. */ + @param par if != 0 insert the file. + @return false if file is not completely read. + */ bool readLyXformat2(LyXLex &, LyXParagraph * par = 0); - /* This parses a single LyXformat-Token */ + /// This parses a single LyXformat-Token. bool parseSingleLyXformat2Token(LyXLex &, LyXParagraph *& par, LyXParagraph *& return_par, string const & token, int & pos, @@ -139,16 +136,16 @@ public: #endif ); private: - // Parse a single inset. + /// Parse a single inset. void readInset(LyXLex &, LyXParagraph *& par, int & pos, LyXFont &); public: /** Save file Takes care of auto-save files and backup file if requested. - Returns true if the save is successful, false otherwise. + Returns #true# if the save is successful, #false# otherwise. */ bool save() const; - /// Write file. Returns false if unsuccesful. + /// Write file. Returns #false# if unsuccesful. bool writeFile(string const &, bool) const; /// @@ -158,12 +155,11 @@ public: void makeLaTeXFile(string const & filename, string const & original_path, bool nice, bool only_body = false); - // - // LaTeX all paragraphs from par to endpar, - // if endpar == 0 then to the end - // - void latexParagraphs(std::ostream & os, LyXParagraph *par, - LyXParagraph *endpar, TexRow & texrow) const; + /** LaTeX all paragraphs from par to endpar. + @param endpar if == 0 then to the end + */ + void latexParagraphs(std::ostream & os, LyXParagraph * par, + LyXParagraph * endpar, TexRow & texrow) const; /// int runLaTeX(); @@ -249,7 +245,8 @@ public: string const & fileName() const { return filename; } /** A transformed version of the file name, adequate for LaTeX - The path is stripped if no_path is true (default) */ + The path is stripped if no_path is true (default) + */ string getLatexName(bool no_path = true) const; /// Change name of buffer. Updates "read-only" flag. @@ -264,16 +261,16 @@ public: /// Set buffer read-only flag void setReadonly(bool flag = true); - /// returns true if the buffer contains a LaTeX document + /// returns #true# if the buffer contains a LaTeX document bool isLatex() const; - /// returns true if the buffer contains a LinuxDoc document + /// returns #true# if the buffer contains a LinuxDoc document bool isLinuxDoc() const; - /// returns true if the buffer contains a DocBook document + /// returns #true# if the buffer contains a DocBook document bool isDocBook() const; - /** returns true if the buffer contains either a LinuxDoc + /** returns #true# if the buffer contains either a LinuxDoc or DocBook document */ bool isSGML() const; - /// returns true if the buffer contains a Wed document + /// returns #true# if the buffer contains a Wed document bool isLiterate() const; /// @@ -281,7 +278,7 @@ public: /** Validate a buffer for LaTeX. This validates the buffer, and returns a struct for use by - makeLaTeX and others. Its main use is to figure out what + #makeLaTeX# and others. Its main use is to figure out what commands and packages need to be included in the LaTeX file. It (should) also check that the needed constructs are there (i.e. that the \refs points to coresponding \labels). It @@ -296,8 +293,11 @@ public: std::vector > getBibkeyList(); /// struct TocItem { + /// LyXParagraph * par; + /// int depth; + /// string str; }; /// @@ -325,8 +325,6 @@ public: /// bool isMultiLingual(); - //@} - /// Does this mean that this is buffer local? UndoStack undostack; @@ -406,7 +404,7 @@ private: /// is this a unnamed file (New...) bool unnamed; - /// is regenerating .tex necessary + /// is regenerating #.tex# necessary DEPCLEAN * dep_clean; /// buffer is r/o @@ -422,19 +420,25 @@ private: Why not keep a list of the BufferViews that use this buffer? At least then we don't have to do a lot of magic like: - buffer->lyx_gui->bufferview->updateLayoutChoice. Just ask each - of the buffers in the list of users to do a updateLayoutChoice. + #buffer->lyx_gui->bufferview->updateLayoutChoice#. Just ask each + of the buffers in the list of users to do a #updateLayoutChoice#. */ BufferView * users; public: + /// class inset_iterator { public: + /// inset_iterator() : par(0) /*, it(0)*/ {} + // inset_iterator(LyXParagraph * paragraph) : par(paragraph) { SetParagraph(); } - inset_iterator(LyXParagraph * paragraph, LyXParagraph::size_type pos); + /// + inset_iterator(LyXParagraph * paragraph, + LyXParagraph::size_type pos); + /// inset_iterator & operator++() { if (par) { ++it; @@ -445,23 +449,26 @@ public: } return *this; } + /// Inset * operator*() {return *it; } + /// LyXParagraph * getPar() { return par; } + /// LyXParagraph::size_type getPos() {return it.getPos(); } + /// friend bool operator==(inset_iterator const & iter1, - inset_iterator const & iter2) { - return iter1.par == iter2.par - && (iter1.par == 0 || iter1.it == iter2.it); - } + inset_iterator const & iter2); + /// friend bool operator!=(inset_iterator const & iter1, - inset_iterator const & iter2) { - return !(iter1 == iter2); - } + inset_iterator const & iter2); private: + /// void SetParagraph(); + /// LyXParagraph * par; + /// LyXParagraph::inset_iterator it; }; @@ -482,6 +489,7 @@ void Buffer::setParentName(string const & name) params.parentname = name; } +/// inline bool operator==(Buffer::TocItem const & a, Buffer::TocItem const & b) { return a.par == b.par && a.str == b.str; @@ -489,10 +497,26 @@ bool operator==(Buffer::TocItem const & a, Buffer::TocItem const & b) { } +/// inline bool operator!=(Buffer::TocItem const & a, Buffer::TocItem const & b) { return !(a == b); // No need to compare depth. } +/// +inline +bool operator==(Buffer::inset_iterator const & iter1, + Buffer::inset_iterator const & iter2) { + return iter1.par == iter2.par + && (iter1.par == 0 || iter1.it == iter2.it); +} + +/// +inline +bool operator!=(Buffer::inset_iterator const & iter1, + Buffer::inset_iterator const & iter2) { + return !(iter1 == iter2); +} #endif + diff --git a/src/bufferlist.h b/src/bufferlist.h index f5155b370e..e397611607 100644 --- a/src/bufferlist.h +++ b/src/bufferlist.h @@ -20,6 +20,7 @@ #include "buffer.h" #include "debug.h" +#include "support/utility.hpp" /** A class to hold all the buffers in a structure The point of this class is to hide from bufferlist what kind @@ -29,7 +30,7 @@ This class should ideally be enclosed inside class BufferList, but that gave me an "internal gcc error". */ -class BufferStorage { +class BufferStorage : public noncopyable { public: /// typedef std::vector Container; @@ -63,12 +64,9 @@ private: }; -/** The class governing all the open buffers - This class governs all the currently open buffers. Currently all the buffer - are located in a static array, soon this will change and we will have a - linked list instead. +/** The class govern all open buffers. */ -class BufferList { +class BufferList : public noncopyable { public: /// BufferList(); @@ -121,10 +119,11 @@ public: /// void emergencyWriteAll(); - /** closes buffer - Returns false if operation was canceled + /** Close buffer. + @param buf the buffer that should be closed + @return #false# if operation was canceled */ - bool close(Buffer *); + bool close(Buffer * buf); /// Buffer * first(); diff --git a/src/bufferparams.h b/src/bufferparams.h index 72d601b508..70d147c242 100644 --- a/src/bufferparams.h +++ b/src/bufferparams.h @@ -25,14 +25,14 @@ #include "layout.h" #include "support/block.h" -/** - This class contains all the parameters for this a buffer uses. Some - work needs to be done on this class to make it nice. Now everything - is in public. - */ struct Language; +/** Buffer parameters. + This class contains all the parameters for this a buffer uses. Some + work needs to be done on this class to make it nice. Now everything + is in public. +*/ class BufferParams { public: /// @@ -104,11 +104,8 @@ public: /// ORIENTATION_LANDSCAPE }; - //@Man: Constructors and Deconstructors - //@{ /// BufferParams(); - //@} /// void writeFile(std::ostream &) const; @@ -136,12 +133,12 @@ public: LyXTextClassList::size_type textclass; /* this are for the PaperLayout */ - /// - char papersize; /* the general papersize (papersize2 or paperpackage */ // add approp. signedness - /// - char papersize2; /* the selected Geometry papersize */ // add approp. signedness - /// - char paperpackage; /* a special paperpackage .sty-file */ // add approp. signedness + /// the general papersize (papersize2 or paperpackage + char papersize; // add apprip. signedness + /// the selected Geometry papersize + char papersize2; // add approp. signedness + /// a special paperpackage .sty-file + char paperpackage; // add approp. signedness /// PAPER_ORIENTATION orientation; // add approp. signedness /// @@ -212,7 +209,8 @@ private: /// friend class Buffer; /** This is the amount of space used for paragraph_separation "skip", - and for detached paragraphs in "indented" documents. */ + and for detached paragraphs in "indented" documents. + */ VSpace defskip; }; diff --git a/src/combox.h b/src/combox.h index 70974c8f06..8668797a74 100644 --- a/src/combox.h +++ b/src/combox.h @@ -56,7 +56,8 @@ public: ~Combox(); /** To add this object to a form. Note that there are two heights - for normal (button) and expanded (browser) mode each. */ + for normal (button) and expanded (browser) mode each. + */ void add(int x, int y, int w, int hmin, int hmax); /// Add lines. Same as for fl_browser object @@ -85,7 +86,8 @@ public: void remove(); /** Assign a callback to this object. The callback should be a void - function with a int and a void pointer as parameters. */ + function with a int and a void pointer as parameters. + */ void setcallback(FL_COMBO_CB, void *); /// Pre handler diff --git a/src/encoding.h b/src/encoding.h index 5b4d661749..eb37f642ad 100644 --- a/src/encoding.h +++ b/src/encoding.h @@ -19,15 +19,21 @@ #include "LString.h" #include "lyxrc.h" +/// typedef unsigned short int Uchar; +/// class Encoding { public: /// enum Letter_Form { + /// FORM_ISOLATED, + /// FORM_FINAL, + /// FORM_INITIAL, + /// FORM_MEDIAL }; /// @@ -60,16 +66,25 @@ private: Uchar const * encoding_table; }; - +/// extern Encoding iso8859_1; +/// extern Encoding iso8859_2; +/// extern Encoding iso8859_3; +/// extern Encoding iso8859_4; +/// extern Encoding iso8859_6; +/// extern Encoding iso8859_7; +/// extern Encoding iso8859_9; +/// extern Encoding cp1255; +/// extern Encoding koi8; +/// extern Encoding symbol_encoding; #endif diff --git a/src/filedlg.h b/src/filedlg.h index 43b8660f82..75ff15f698 100644 --- a/src/filedlg.h +++ b/src/filedlg.h @@ -23,11 +23,13 @@ #include "form1.h" /// LyXDirEntry internal structure definition -class LyXDirEntry -{ +class LyXDirEntry { public: + /// string pszName; + /// string pszDisplayed; + /// string pszLsEntry; }; diff --git a/src/font.h b/src/font.h index 89f04fa99d..98f0013f52 100644 --- a/src/font.h +++ b/src/font.h @@ -24,58 +24,58 @@ class LyXFont; //namespace lyx { //namespace font { - +/// struct lyxfont { - + /// static int maxAscent(LyXFont const & f); - + /// static int maxDescent(LyXFont const & f); - + /// static int ascent(char c, LyXFont const & f); - + /// static int descent(char c, LyXFont const & f); - + /// static int lbearing(char c, LyXFont const & f); - + /// static int rbearing(char c, LyXFont const & f); - + /// static int width(char c, LyXFont const & f) { return width(&c, 1, f); } - + /// static int width(char const * s, int n, LyXFont const & f); - + /// static int width(string const & s, LyXFont const & f) { if (s.empty()) return 0; return width(s.c_str(), s.length(), f); } - + /// static int width(char const * s, LyXFont const & f) { return width(s, strlen(s), f); } - + /// static int signedWidth(string const & s, LyXFont const & f); - + /// static int XTextWidth(LyXFont const & f, char * str, int count); - + /// static int width(XChar2b const * s, int n, LyXFont const & f); - + /// static int XTextWidth16(LyXFont const & f, XChar2b * str, int count); - + /// static void XSetFont(Display * display, GC gc, LyXFont const & f); }; diff --git a/src/frontends/DialogBase.h b/src/frontends/DialogBase.h index f110645d3e..f25f738f1f 100644 --- a/src/frontends/DialogBase.h +++ b/src/frontends/DialogBase.h @@ -24,6 +24,8 @@ #ifdef SIGC_CXX_NAMESPACES using SigC::Connection; using SigC::slot; +using SigC::Object; + #endif @@ -33,13 +35,7 @@ using SigC::slot; satisfy that request. Thus a dialog will have to "pull" the necessary details from the core of the program. */ -#ifdef SIGC_CXX_NAMESPACES -/// -class DialogBase : public SigC::Object -#else -/// class DialogBase : public Object -#endif { public: /**@name Constructors and Deconstructors */ @@ -60,8 +56,11 @@ public: /// enum EnumDialogStatus { + /// DIALOG_UNMODIFIED, + /// DIALOG_MODIFIED, + /// DIALOG_READONLY }; }; diff --git a/src/frontends/Liason.h b/src/frontends/Liason.h index 2fab06fc68..2b2adbcada 100644 --- a/src/frontends/Liason.h +++ b/src/frontends/Liason.h @@ -34,14 +34,14 @@ class PrinterParams; class Buffer; /** Temporary namespace to hold the various frontend functions - * until XTL and the compilers of the world are ready for something more - * elaborate. This is basically the Communicator class from the lyx cvs module - * all over again. - * - * Eventually, we will switch back to the XTL+LyXFunc combination that - * worked so nicely on a very small number of compilers and systems. - * See the "dialogbase" branch of lyx-devel cvs module for xtl implementation. - */ + until XTL and the compilers of the world are ready for something more + elaborate. This is basically the Communicator class from the lyx cvs module + all over again. + + Eventually, we will switch back to the XTL+LyXFunc combination that + worked so nicely on a very small number of compilers and systems. + See the "dialogbase" branch of lyx-devel cvs module for xtl implementation. +*/ #ifdef CXX_WORKING_NAMESPACES namespace Liason { diff --git a/src/frontends/Menubar.h b/src/frontends/Menubar.h index 4d24b4deca..c343cb44e9 100644 --- a/src/frontends/Menubar.h +++ b/src/frontends/Menubar.h @@ -42,8 +42,10 @@ public: //with compaq cxx. (Jean-Marc) // Is this a new comment? (Lgb) struct Pimpl; + /// friend struct Pimpl; private: + /// Pimpl * pimpl_; }; #endif diff --git a/src/frontends/Toolbar.h b/src/frontends/Toolbar.h index 121f3cecc1..513ba45f42 100644 --- a/src/frontends/Toolbar.h +++ b/src/frontends/Toolbar.h @@ -64,7 +64,9 @@ public: private: struct Pimpl; + /// friend struct Toolbar::Pimpl; + /// Pimpl * pimpl_; }; #endif diff --git a/src/frontends/gnome/FormCopyright.h b/src/frontends/gnome/FormCopyright.h index 6d807f7c0f..a21b48d51c 100644 --- a/src/frontends/gnome/FormCopyright.h +++ b/src/frontends/gnome/FormCopyright.h @@ -16,6 +16,7 @@ #include "DialogBase.h" #include +#include "support/utility.hpp" class Dialogs; // same arguement as in Dialogs.h s/LyX/UI/ @@ -23,31 +24,20 @@ class LyXView; /** This class provides an GTK-- implementation of the FormCopyright Dialog. */ -class FormCopyright : public DialogBase { +class FormCopyright : public DialogBase, public noncopyable { public: - /**@name Constructors and Destructors */ - //@{ /// #FormCopyright x(LyXFunc ..., Dialogs ...);# FormCopyright(LyXView *, Dialogs *); /// ~FormCopyright(); - //@} - private: - FormCopyright() {} - FormCopyright(FormCopyright &) : DialogBase() {} - - /**@name Slot Methods */ - //@{ /// Create the dialog if necessary, update it and display it. void show(); /// Hide the dialog. void hide(); /// Not used but we've got to implement it. void update() {} - //@} - //@{ /// Real GUI implementation. Gnome::About * dialog_; /** Which LyXFunc do we use? @@ -63,7 +53,6 @@ private: Connection h_; /// Destroy connection. Connection destroy_; - //@} }; #endif diff --git a/src/frontends/kde/FormCopyright.h b/src/frontends/kde/FormCopyright.h index 4952433fbd..359fa0822b 100644 --- a/src/frontends/kde/FormCopyright.h +++ b/src/frontends/kde/FormCopyright.h @@ -20,32 +20,27 @@ #include "DialogBase.h" -/** - *@author Jürgen Vigna - */ class Dialogs; class LyXFunc; class FormCopyrightDialog; +/** + @author Jürgen Vigna + */ class FormCopyright : public DialogBase { public: FormCopyright(LyXFunc *, Dialogs *); ~FormCopyright(); private: - /**@name Slot Methods */ - //@{ /// Create the dialog if necessary, update it and display it. void show(); /// Hide the dialog. void hide(); /// Not used but we've got to implement it. void update() {} - //@} - /**@name Private Data */ - //@{ /// Real GUI implementation. FormCopyrightDialog * dialog_; /** Which LyXFunc do we use? @@ -59,7 +54,6 @@ private: Dialogs * d_; /// Hide connection. SigC::Connection h_; - //@} }; #endif diff --git a/src/frontends/xforms/FormCommand.h b/src/frontends/xforms/FormCommand.h index a5ea17fdb6..d7c02e7663 100644 --- a/src/frontends/xforms/FormCommand.h +++ b/src/frontends/xforms/FormCommand.h @@ -32,23 +32,21 @@ public: /// Constructor FormCommand(LyXView *, Dialogs *, string const & ); - /**@name Real per-instance Callback Methods */ - //@{ + /// static int WMHideCB(FL_FORM *, void *); + /// static void OKCB(FL_OBJECT *, long); + /// static void ApplyCB(FL_OBJECT *, long); + /// static void CancelCB(FL_OBJECT *, long); + /// static void InputCB(FL_OBJECT *, long); - //@} - protected: - /**@name Slot Methods */ - //@{ /// Slot launching dialog to (possibly) create a new inset void createInset( string const & ); /// Slot launching dialog to an existing inset void showInset( InsetCommand * const ); - //@} /// Build the dialog virtual void build() = 0; @@ -65,8 +63,6 @@ protected: /// Pointer to the actual instantiation of the xform's form virtual FL_FORM * const form() const = 0; - /**@name Protected Data */ - //@{ /** Which LyXFunc do we use? We could modify Dialogs to have a visible LyXFunc* instead and save a couple of bytes per dialog. @@ -80,17 +76,12 @@ protected: InsetCommand * inset_; /// the nitty-griity. What is modified and passed back InsetCommandParams params; - //@} - private: /// Create the dialog if necessary, update it and display it. void show(); /// Hide the dialog. void hide(); - - /**@name Private Data */ - //@{ /// Update connection. Connection u_; /// Hide connection. @@ -101,7 +92,6 @@ private: bool dialogIsOpen; /// dialog title, displayed by WM. string title; - //@} }; #endif diff --git a/src/frontends/xforms/FormCopyright.h b/src/frontends/xforms/FormCopyright.h index dffdafd21d..c2181599e6 100644 --- a/src/frontends/xforms/FormCopyright.h +++ b/src/frontends/xforms/FormCopyright.h @@ -34,30 +34,22 @@ struct FD_form_copyright; */ class FormCopyright : public DialogBase, public noncopyable { public: - /**@name Constructors and Destructors */ - //@{ /// #FormCopyright x(LyXFunc ..., Dialogs ...);# FormCopyright(LyXView *, Dialogs *); /// ~FormCopyright(); - //@} - /**@name Real per-instance Callback Methods */ - //@{ + /// static int WMHideCB(FL_FORM *, void *); + /// static void OKCB(FL_OBJECT *, long); - //@} - private: - /**@name Slot Methods */ - //@{ /// Create the dialog if necessary, update it and display it. void show(); /// Hide the dialog. void hide(); /// Not used but we've got to implement it. void update() {} - //@} /// Build the dialog void build(); @@ -66,8 +58,6 @@ private: /// Explicitly free the dialog. void free(); - /**@name Private Data */ - //@{ /// Real GUI implementation. FD_form_copyright * dialog_; /** Which LyXFunc do we use? @@ -81,7 +71,6 @@ private: Dialogs * d_; /// Hide connection. Connection h_; - //@} }; #endif diff --git a/src/frontends/xforms/FormGraphics.h b/src/frontends/xforms/FormGraphics.h index b2642cc129..6375e4c69f 100644 --- a/src/frontends/xforms/FormGraphics.h +++ b/src/frontends/xforms/FormGraphics.h @@ -39,74 +39,85 @@ struct FD_form_graphics; */ class FormGraphics: public DialogBase { public: - /**@name Constructors and Destructors */ - //@{ /// #FormGraphics x(LyXFunc ..., Dialogs ...);# FormGraphics(LyXView *, Dialogs *); /// ~FormGraphics(); - //@} - - /**@name Real per-instance Callback Methods */ - //@{ + /// static int WMHideCB(FL_FORM *, void *); + /// static void OKCB(FL_OBJECT *, long); - static void ApplyCB(FL_OBJECT *, long); - static void CancelCB(FL_OBJECT *, long); - static void BrowseCB(FL_OBJECT *, long); - static void AdvancedOptionsCB(FL_OBJECT *, long); - static void InputCB(FL_OBJECT *, long); - //@} + /// + static void ApplyCB(FL_OBJECT *, long); + /// + static void CancelCB(FL_OBJECT *, long); + /// + static void BrowseCB(FL_OBJECT *, long); + /// + static void AdvancedOptionsCB(FL_OBJECT *, long); + /// + static void InputCB(FL_OBJECT *, long); private: - FormGraphics() : widthButtons(5), heightButtons(4), displayButtons(4) {} - FormGraphics(FormGraphics &) : DialogBase() {} + /// + FormGraphics() + : widthButtons(5), heightButtons(4), displayButtons(4) {} + // + FormGraphics(FormGraphics const &) : DialogBase() {} - /**@name Define enum constants */ - //@{ - /// The maximum digits for the image width (cm, inch, percent) - enum { WIDTH_MAXDIGITS = 3 }; - /// The maximum digits for the image height (cm, inch, percent) - enum { HEIGHT_MAXDIGITS = 3 }; - /// The maximum characters in the rotation angle (minus sign and 3 digits) - enum { ROTATE_MAXCHARS = 4 }; - /// The maximum characters in a filename. - enum { FILENAME_MAXCHARS = 1024 }; - //@} - + /// The maximum digits for the image width (cm, inch, percent) + enum { + /// + WIDTH_MAXDIGITS = 3 + }; + /// The maximum digits for the image height (cm, inch, percent) + enum { + /// + HEIGHT_MAXDIGITS = 3 + }; + /// The maximum characters in the rotation angle (minus sign and 3 digits) + enum { + /// + ROTATE_MAXCHARS = 4 + }; + /// The maximum characters in a filename. + enum { + /// + FILENAME_MAXCHARS = 1024 + }; /**@name Slot Methods */ //@{ /// Save the active inset and show the dialog. void showDialog(InsetGraphics * inset); /// Create the dialog if necessary, update it and display it. - void show(); + void show(); /// Hide the dialog. void hide(); /// Update the dialog void update(); //@} - /**@name Callback methods */ - //@{ - /// Apply the changes to the inset. - void apply(); - /// Verify that the input is correct. If not disable ok/apply buttons. - void input(); - /// Open the file browse dialog to select an image file. - void browse(); - /// Build the dialog + /**@name Callback methods */ + //@{ + /// Apply the changes to the inset. + void apply(); + /// Verify that the input is correct. If not disable ok/apply buttons. + void input(); + /// Open the file browse dialog to select an image file. + void browse(); //@} - void build(); + /// Build the dialog + void build(); /// FD_form_graphics * build_graphics(); /// Explicitly free the dialog. void free(); - /// Display a file browser dialog and return the file chosen. - string browseFile(string const & filename); + /// Display a file browser dialog and return the file chosen. + string browseFile(string const & filename); - /**@name Private Data */ + /**@name Data */ //@{ /// Real GUI implementation. FD_form_graphics * dialog_; @@ -119,23 +130,25 @@ private: Used so we can get at the signals we have to connect to. */ Dialogs * d_; - /** Which Inset do we belong to? - * Used to set and update data to/from the inset. - */ - InsetGraphics * inset_; - /// The radio buttons groups - RadioButtonGroup widthButtons; - RadioButtonGroup heightButtons; - RadioButtonGroup displayButtons; + /** Which Inset do we belong to? + Used to set and update data to/from the inset. + */ + InsetGraphics * inset_; + /// The radio buttons groups + RadioButtonGroup widthButtons; + /// + RadioButtonGroup heightButtons; + /// + RadioButtonGroup displayButtons; - /// Inset Hide connection, connected to the calling inset hide signal. - Connection ih_; + /// Inset Hide connection, connected to the calling inset hide signal. + Connection ih_; /// Hide connection. Connection h_; - /// Update connection. - Connection u_; - /// Last used figure path - string last_image_path; + /// Update connection. + Connection u_; + /// Last used figure path + string last_image_path; //@} }; diff --git a/src/gettext.h b/src/gettext.h index db7e61e226..a8908d1a2e 100644 --- a/src/gettext.h +++ b/src/gettext.h @@ -53,9 +53,13 @@ # define gettext_init() { bindtextdomain (PACKAGE, lyx_localedir.c_str()); \ textdomain (PACKAGE); } #else +/// # define _(str) (str) +/// # define N_(str) (str) +/// # define locale_init() +/// # define gettext_init() #endif diff --git a/src/graphics/GraphicsCache.h b/src/graphics/GraphicsCache.h index d64df5f5d3..eba3413b19 100644 --- a/src/graphics/GraphicsCache.h +++ b/src/graphics/GraphicsCache.h @@ -20,14 +20,15 @@ #include "LString.h" #include "GraphicsCacheItem.h" +#include "support/utility.hpp" /** GraphicsCache is the manager of the image cache, it is responsible to - * create the GraphicsCacheItem's and maintain them. - * - * GraphicsCache is a singleton class, there should be only one instance of - * it at any moment. - */ -class GraphicsCache { + create the GraphicsCacheItem's and maintain them. + + GraphicsCache is a singleton class, there should be only one instance of + it at any moment. +*/ +class GraphicsCache : public noncopyable { public: /// Get the instance of the class. static GraphicsCache * getInstance(); @@ -47,8 +48,9 @@ private: /// Holder of the single instance of the class. static GraphicsCache * singleton; - + /// typedef std::map CacheType; + /// CacheType cache; }; #endif diff --git a/src/graphics/GraphicsCacheItem.h b/src/graphics/GraphicsCacheItem.h index e139fbffc4..49aaa28de9 100644 --- a/src/graphics/GraphicsCacheItem.h +++ b/src/graphics/GraphicsCacheItem.h @@ -22,7 +22,7 @@ public: private: /// GraphicsCacheItem() {} - // + /// friend class GraphicsCache; }; diff --git a/src/insets/ExternalTemplate.h b/src/insets/ExternalTemplate.h index b9b0ae749a..a0dfcbd7f9 100644 --- a/src/insets/ExternalTemplate.h +++ b/src/insets/ExternalTemplate.h @@ -19,9 +19,11 @@ #include #include #include "LString.h" +#include "support/utility.hpp" class LyXLex; +/// struct ExternalTemplate { /// What is the name of this template in the LyX format? string lyxName; @@ -52,12 +54,13 @@ struct ExternalTemplate { /// This constructor has to default a command for safety reasons! FormatTemplate(); }; + /// void readTemplate(LyXLex &); - + /// typedef std::map Formats; - + /// Formats formats; - + /// void dumpFormats(std::ostream &) const; /// We have to have default commands for safety reasons! @@ -67,9 +70,9 @@ struct ExternalTemplate { /** - * A singleton class that manages the external inset templates - */ -class ExternalTemplateManager { + A singleton class that manages the external inset templates +*/ +class ExternalTemplateManager : public noncopyable { public: /// Map from the LyX name of the template to the template structure typedef std::map Templates; diff --git a/src/insets/insetcommand.h b/src/insets/insetcommand.h index 4fb9df7d97..bc040acd22 100644 --- a/src/insets/insetcommand.h +++ b/src/insets/insetcommand.h @@ -77,8 +77,10 @@ private: }; +/// class InsetCommand : public InsetButton, public noncopyable { public: + /// explicit InsetCommand(InsetCommandParams const &); /// diff --git a/src/intl.h b/src/intl.h index e85036ceab..8432bfcd1a 100644 --- a/src/intl.h +++ b/src/intl.h @@ -28,8 +28,7 @@ class TransManager; classes. Probably should the gui class just have a pointer to the non gui class. */ -class Intl -{ +class Intl { public: /// Intl(); diff --git a/src/language.h b/src/language.h index 68f87abd9d..0fe01ff608 100644 --- a/src/language.h +++ b/src/language.h @@ -27,7 +27,8 @@ public: /// Language() : RightToLeft_(false) {} /// - Language(string const & l, string const & d, bool rtl, Encoding const * e) + Language(string const & l, string const & d, + bool rtl, Encoding const * e) : lang_(l), display_(d), RightToLeft_(rtl) , encoding_(e) {} /// string const & lang() const { @@ -57,6 +58,7 @@ private: }; #if 0 +/// bool operator==(Language const & l1, Language const & l2) { return l1.lang == l2.lang @@ -65,17 +67,20 @@ bool operator==(Language const & l1, Language const & l2) && l1.encoding_ == l2.encoding_; } - +/// bool operator!=(Language const l1, Language const & l2) { return !(l1 == l2); } #endif - +/// typedef std::map Languages; +/// extern Languages languages; +/// extern Language const * default_language; +/// extern Language const *ignore_language; #endif diff --git a/src/lastfiles.h b/src/lastfiles.h index 8f095fac1c..6e9bd81fab 100644 --- a/src/lastfiles.h +++ b/src/lastfiles.h @@ -19,13 +19,15 @@ #include #include "LString.h" +#include "support/utility.hpp" -/** The latest documents loaded +/** The latest documents loaded. This class takes care of the last .lyx files used by the LyX user. It both reads and writes this information to a file. The number of files kept are user defined, but defaults to four. + @author Lars Gullik Bjønnes */ -class LastFiles { +class LastFiles : public noncopyable { public: /// typedef std::deque Files; @@ -33,26 +35,22 @@ public: /// typedef Files::const_iterator const_iterator; - /**@name Constructors and Deconstructors */ - //@{ - /** - Parameters are: name of file to read. Whether LastFiles should - check for file existance, and the number of files to remember. + /** Read the lastfiles file. + @param file The file to read the lastfiles form. + @param dostat Whether to check for file existance. + @param num number of files to remember. */ explicit - LastFiles(string const &, + LastFiles(string const & file, bool dostat = true, unsigned int num = 4); - //@} - /**@name Methods */ - //@{ /** This funtion inserts #file# into the last files list. If the file already exist it is moved to the top of the list, else exist it is placed on the top of the list. If the list is full the last file in the list is popped from the end. */ - void newFile(string const &); + void newFile(string const & file); /** Writes the lastfiles table to disk. One file on each line, this way we can at least have some special chars (e.g. space), but newline in filenames are thus not allowed. @@ -64,14 +62,16 @@ public: Files::const_iterator begin() const { return files.begin(); } /// Files::const_iterator end() const { return files.end(); } - //@} private: - /**@name const variables */ - //@{ - enum { - /// + /** Local constants. + It is more portable among different C++ compilers to use + an enum instead of #int const XXX# + */ + enum local_constants { + /// Default number of lastfiles. DEFAULTFILES = 4, - /** There is no point in keeping more than this number + /** Max number of lastfiles. + There is no point in keeping more than this number of files at the same time. However perhaps someday someone finds use for more files and wants to change it. Please do. But don't show the files in @@ -79,21 +79,16 @@ private: */ ABSOLUTEMAXLASTFILES = 20 }; - //@} - /**@name Variables */ - //@{ /// a list of lastfiles Files files; /// number of files in the lastfiles list. unsigned int num_files; /// check for file existance or not. bool dostat; - //@} - /**@name Methods */ - //@{ - /** reads the .lyx_lastfiles at the beginning of the LyX session. + /** Read the lastfiles file. + Reads the .lyx_lastfiles at the beginning of the LyX session. This will read the lastfiles file (usually .lyx_lastfiles). It will normally discard files that don't exist anymore, unless LastFiles has been initialized with dostat = false. @@ -101,6 +96,5 @@ private: void readFile(string const &); /// used by the constructor to set the number of stored last files. void setNumberOfFiles(unsigned int num); - //@} }; #endif diff --git a/src/layout.h b/src/layout.h index 641aad24c5..2eb47cef59 100644 --- a/src/layout.h +++ b/src/layout.h @@ -21,12 +21,13 @@ #include "lyxlex.h" #include "lyxfont.h" #include "Spacing.h" +#include "support/utility.hpp" /// Reads the style files extern void LyXSetStyle(); /// -enum { // no good name for this +enum no_good_name_for_this { /// LYX_ENVIRONMENT_DEFAULT = 97, /// @@ -85,7 +86,7 @@ enum LyXAlignment { LYX_ALIGN_SPECIAL = 32 }; - +/// inline void operator|=(LyXAlignment & la1, LyXAlignment la2) { la1 = static_cast(la1 | la2); @@ -145,6 +146,7 @@ enum LYX_LABEL_TYPES { LABEL_COUNTER_ENUMIV }; +/// enum LYX_END_LABEL_TYPES { /// END_LABEL_NO_LABEL, @@ -180,7 +182,7 @@ enum LYX_END_LABEL_TYPES { */ -/// Attributes of a layout/paragraph environment +// Attributes of a layout/paragraph environment class LyXTextClass; /// @@ -191,21 +193,37 @@ public: /// bool Read (LyXLex &, LyXTextClass const &); + /// void readAlign(LyXLex &); + /// void readAlignPossible(LyXLex &); + /// void readLabelType(LyXLex &); + /// void readEndLabelType(LyXLex &); + /// void readMargin(LyXLex &); + /// void readLatexType(LyXLex &); + /// void readSpacing(LyXLex &); + /// string const & name() const { return name_; } + /// void name(string const & n) { name_ = n; } + /// string const & obsoleted_by() const { return obsoleted_by_; } + /// string const & latexname() const { return latexname_; } + /// string const & labelstring() const { return labelstring_; } + /// string const & endlabelstring() const { return endlabelstring_; } + /// string const & preamble() const { return preamble_; } + /// string const & latexparam() const { return latexparam_; } + /// string const & labelstring_appendix() const { return labelstring_appendix_; } @@ -303,8 +321,8 @@ public: /// bool free_spacing; - /// true when the fragile commands in the paragraph need to be - /// \protect'ed. + /** true when the fragile commands in the paragraph need to be + \protect'ed. */ bool needprotect; /// true when empty paragraphs should be kept. bool keepempty; @@ -378,8 +396,11 @@ public: /// bool Read(string const & filename, bool merge = false); + /// void readOutputType(LyXLex &); + /// void readMaxCounter(LyXLex &); + /// void readClassOptions(LyXLex &); /// bool hasLayout(string const & name) const; @@ -412,18 +433,25 @@ public: /// Packages that are already loaded by the class enum Provides { + /// nothing = 0, + /// amsmath = 1, + /// makeidx = 2, + /// url = 4 }; + /// bool provides(Provides p) const { return provides_ & p; } /// unsigned int columns() const { return columns_; } /// enum PageSides { + /// OneSide, + /// TwoSides }; /// @@ -506,7 +534,7 @@ private: bool loaded; }; - +/// inline void operator|=(LyXTextClass::Provides & p1, LyXTextClass::Provides p2) { @@ -519,7 +547,7 @@ std::ostream & operator<<(std::ostream & os, LyXTextClass::PageSides p); /// -class LyXTextClassList { +class LyXTextClassList : public noncopyable { public: /// typedef std::vector ClassList; @@ -580,7 +608,7 @@ private: void Add (LyXTextClass const &); }; -/// Should not be declared here!! (Lgb) Why not? (Asger) +/// extern LyXTextClassList textclasslist; #endif diff --git a/src/lyx_cb.h b/src/lyx_cb.h index e0fcb07b7a..d15e788e18 100644 --- a/src/lyx_cb.h +++ b/src/lyx_cb.h @@ -6,11 +6,14 @@ class BufferParams; /// extern bool quitting; +/// extern bool toggleall; // When still false after reading lyxrc, warn user //about failing \bind_file command. RVDK_PATCH_5 +/// extern bool BindFileSet; +/// extern LyXFont UserFreeFont(BufferParams const & params); #endif diff --git a/src/lyx_gui.h b/src/lyx_gui.h index 55968e6342..17dedf9edf 100644 --- a/src/lyx_gui.h +++ b/src/lyx_gui.h @@ -12,6 +12,8 @@ #ifndef LYX_GUI_H #define LYX_GUI_H +#include "support/utility.hpp" + #ifdef __GNUG__ #pragma interface #endif @@ -21,71 +23,49 @@ class LyX; class Buffer; /** - This class is going to be the entry point to {\em all} GUI funcionality. - From this object will all the things going on be initiated. However I - have not clearly figured out how this class is going to be, suggestions - are welcome. (Lgb) - */ -class LyXGUI { + This class is going to be the entry point to {\em all} GUI funcionality. + From this object will all the things going on be initiated. However I + have not clearly figured out how this class is going to be, suggestions + are welcome. (Lgb) +*/ +class LyXGUI : public noncopyable { public: - /**@name Constructor */ - //@{ - - /** The only constructor allowed - - If gui is false, LyX will operate in non-X mode - */ - LyXGUI(LyX *owner, int *argc, char *argv[], bool gui); + /** The only constructor allowed. + If gui is false, LyX will operate in non-X mode + */ + LyXGUI(LyX * owner, int * argc, char * argv[], bool gui); /// ~LyXGUI(); - //@} - /**@name Members */ - //@{ /** - This functions starts the ball. For XForms it runs a loop of - fl_check_forms(). For QT this will probably be .exec(). - */ + This functions starts the ball. For XForms it runs a loop of + fl_check_forms(). For QT this will probably be .exec(). + */ void runTime(); /** This will take care of the initializaton done after the - main initialization. - */ + main initialization. + */ void init(); - + /// Register the buffer with the first found LyXView in lyxViews - void regBuf(Buffer*); - + void regBuf(Buffer *); + /// Access to (first?) LyXView LyXView * getLyXView() const; - //@} private: - /**@name Construcor */ - //@{ - /// not allowed - LyXGUI(); // don't allow this - /// not allowed - LyXGUI(const LyXGUI&); // nor this - //@} - - /**@name Members */ - //@{ /// void setDefaults(); /// void create_forms(); - //@} - - /**@name Variables */ - //@{ + /// The LyX that owns this GUI. - LyX *_owner; + LyX * _owner; /// - LyXView *lyxViews; // or something so that several views + LyXView * lyxViews; // or something so that several views // on the same time can be allowed. /// Do we have a gui? bool gui; - //@} }; #endif diff --git a/src/lyx_gui_misc.h b/src/lyx_gui_misc.h index 0c399bd876..7ce10aa5a4 100644 --- a/src/lyx_gui_misc.h +++ b/src/lyx_gui_misc.h @@ -34,14 +34,15 @@ void CloseAllBufferRelatedDialogs(); void updateAllVisibleBufferRelatedDialogs(); /* These shortcut extractors should be shifted to frontends/xforms/ eventually */ + /// Extract shortcut from | string char const * flyx_shortcut_extract(char const * sc); -/// Make a shortnamed version of the above func +/// Shortcut for flyx_shortcut_extract #define scex flyx_shortcut_extract /// Extract shortcut from | string char const * flyx_ident_extract(char const * sc); -/// Make a shortnamed versjon of the above func +/// Shortcut for flyx_ident_extract #define idex flyx_ident_extract /// Show message @@ -70,8 +71,7 @@ void WarnReadonly(string const & file); /// Get the dpi setting of the current screen float getScreenDPI(); -// inlined functions -// rings the audio bell. +/// rings the audio bell. inline void LyXBell() { // if (audio()) ON/OFF switch yet to be implemented diff --git a/src/lyx_main.h b/src/lyx_main.h index c68c87185d..0ba6779ef7 100644 --- a/src/lyx_main.h +++ b/src/lyx_main.h @@ -30,10 +30,13 @@ class LastFiles; class Buffer; class kb_keymap; +/// extern string system_lyxdir; +/// extern string user_lyxdir; +/// extern string system_tempdir; - +/// extern LastFiles * lastfiles; /* we should hopefully be able to move this * inside the LyX class */ @@ -43,29 +46,18 @@ extern LastFiles * lastfiles; /* we should hopefully be able to move this */ class LyX : public noncopyable { public: - /**@name Constructors and Deconstructors */ - //@{ /// the only allowed constructor LyX(int * argc, char * argv[]); // constructor - // Always is useful a destructor + /// Always is useful a destructor ~LyX(); - //@} - /**@name Pointers to... */ - //@{ /// LyXGUI * lyxGUI; // should be only one of this - //@} private: - /**@name Private variables */ - //@{ /// does this user start lyx for the first time? bool first_start; /// string batch_command; - //@} - /**@name Private Members */ - //@{ /// void runtime(); /// @@ -84,7 +76,6 @@ private: void ReadUIFile(string const & name); /// bool easyParse(int * argc, char * argv[]); - //@} }; #endif diff --git a/src/lyx_sty.h b/src/lyx_sty.h index 56def33a5d..9166d19121 100644 --- a/src/lyx_sty.h +++ b/src/lyx_sty.h @@ -32,20 +32,35 @@ // another object. I'll let some others have a look now... (Lgb) // include this always +/// extern string const lyx_def; +/// extern string const lyxline_def; +/// extern string const noun_def; +/// extern string const lyxarrow_def; +/// extern string const quotedblbase_def; +/// extern string const quotesinglbase_def; +/// extern string const guillemotleft_def; +/// extern string const guillemotright_def; +/// extern string const guilsinglleft_def; +/// extern string const guilsinglright_def; +/// extern string const paragraphindent_def; +/// extern string const floatingfootnote_def; +/// extern string const minipageindent_def; +/// extern string const boldsymbol_def; +/// extern string const binom_def; #endif diff --git a/src/lyxcursor.h b/src/lyxcursor.h index 9137f48d4e..60ad1e0bfb 100644 --- a/src/lyxcursor.h +++ b/src/lyxcursor.h @@ -73,7 +73,7 @@ private: Row * row_; }; - +/// inline bool operator==(LyXCursor const & a, LyXCursor const & b) { @@ -82,7 +82,7 @@ bool operator==(LyXCursor const & a, LyXCursor const & b) && a.boundary() == b.boundary(); } - +/// inline bool operator!=(LyXCursor const & a, LyXCursor const & b) { diff --git a/src/lyxfont.h b/src/lyxfont.h index 62e5da13f2..4123fa3513 100644 --- a/src/lyxfont.h +++ b/src/lyxfont.h @@ -155,7 +155,7 @@ public: /// LyXFont(); - /// LyXFont x(LyXFont ...) and LyXFont x = LyXFont ... + // LyXFont x(LyXFont ...) and LyXFont x = LyXFont ... LyXFont(LyXFont const & x); /// Shortcut initialization @@ -264,16 +264,15 @@ public: /// Returns size of font in LaTeX text notation string latexSize() const; - /** Updates font settings according to request. If an - attribute is IGNORE, the attribute is left as it is. */ - /* - * When toggleall = true, all properties that matches the font in use - * will have the effect that the properties is reset to the - * default. If we have a text that is TYPEWRITER_FAMILY, and is - * update()'ed with TYPEWRITER_FAMILY, the operation will be as if - * a INHERIT_FAMILY was asked for. This is necessary for the - * toggle-user-defined-style button on the toolbar. - */ + /** Updates font settings according to request. + If an attribute is IGNORE, the attribute is left as it is. + When toggleall = true, all properties that matches the font in use + will have the effect that the properties is reset to the + default. If we have a text that is TYPEWRITER_FAMILY, and is + update()'ed with TYPEWRITER_FAMILY, the operation will be as if + a INHERIT_FAMILY was asked for. This is necessary for the + toggle-user-defined-style button on the toolbar. + */ void update(LyXFont const & newfont, Language const * default_lang, bool toggleall = false); @@ -317,16 +316,11 @@ public: /// friend - bool operator==(LyXFont const & font1, LyXFont const & font2) { - return font1.bits == font2.bits && - font1.lang == font2.lang; - } + bool operator==(LyXFont const & font1, LyXFont const & font2); /// friend - bool operator!=(LyXFont const & font1, LyXFont const & font2) { - return !(font1 == font2); - } + bool operator!=(LyXFont const & font1, LyXFont const & font2); /// compares two fonts, ignoring the setting of the Latex part. bool equalExceptLatex(LyXFont const &) const; @@ -378,9 +372,22 @@ private: LyXFont::FONT_MISC_STATE org); }; - +/// std::ostream & operator<<(std::ostream &, LyXFont::FONT_MISC_STATE); +/// +inline +bool operator==(LyXFont const & font1, LyXFont const & font2) { + return font1.bits == font2.bits && + font1.lang == font2.lang; +} + +/// +inline +bool operator!=(LyXFont const & font1, LyXFont const & font2) { + return !(font1 == font2); +} + inline LyXFont::LyXFont() @@ -420,6 +427,8 @@ LyXFont::LyXFont(LyXFont::FONT_INIT3) bits = sane; lang = default_language; } + + inline LyXFont::LyXFont(LyXFont::FONT_INIT1, Language const * l) { diff --git a/src/lyxfr0.h b/src/lyxfr0.h index d3ddfc93bd..bf549062db 100644 --- a/src/lyxfr0.h +++ b/src/lyxfr0.h @@ -33,7 +33,6 @@ class LyXFindReplace; - regex searches (I'm working on that -- dnaber, 1999-02-24) */ - class SearchForm { public: /// diff --git a/src/lyxfr1.h b/src/lyxfr1.h index edfbfdb3c2..872854ac20 100644 --- a/src/lyxfr1.h +++ b/src/lyxfr1.h @@ -11,12 +11,11 @@ class LyXText; -/** - LyXFindReplace" - - This class implements Find & Replace in LyXText texts. It is based on - LyXFindReplace0, which implements the form related stuff. (see lyxfr0.h) - */ +/** Find and replace in LyXText texts. + + This class implements Find & Replace in LyXText texts. It is based on + LyXFindReplace0, which implements the form related stuff. (see lyxfr0.h) +*/ class LyXFindReplace { public: /// diff --git a/src/lyxfunc.h b/src/lyxfunc.h index 6913a51df2..ec0685a265 100644 --- a/src/lyxfunc.h +++ b/src/lyxfunc.h @@ -24,10 +24,15 @@ class LyXFunc { public: /// The status of a function. enum func_status { - OK = 0, // No problem + /// No problem + OK = 0, + /// Unknown = 1, - Disabled = 2, // Command cannot be executed + /// Command cannot be executed + Disabled = 2, + /// ToggleOn = 4, + /// ToggleOff = 8 }; /// @@ -44,7 +49,7 @@ public: bool Dispatch(int action, auto_mem_buffer &); /// A keyboard event is processed to execute a lyx action. - int processKeyEvent(XEvent * ev); + int processKeyEvent(XEvent * ev); /// func_status getStatus(int ac) const; @@ -115,6 +120,7 @@ private: /// void doImport(string const &); + /// void doImportHelper(string const &, string const &, string const &, bool func(BufferView *, string const &) ); @@ -172,7 +178,7 @@ void LyXFunc::setHintMessage(bool hm) show_sc = hm; } - +/// inline void operator|=(LyXFunc::func_status & fs, LyXFunc::func_status f) { diff --git a/src/lyxlex.h b/src/lyxlex.h index 42714c3af0..9825fc962e 100644 --- a/src/lyxlex.h +++ b/src/lyxlex.h @@ -24,11 +24,10 @@ struct keyword_item { short code; }; -/*@Doc: - Generalized simple lexical analizer. - It can be used for simple syntax parsers, like lyxrc, - texclass and others to come. - See lyxrc.C for an example of usage. +/** Generalized simple lexical analizer. + It can be used for simple syntax parsers, like lyxrc, + texclass and others to come. + @see lyxrc.C for an example of usage. */ class LyXLex : public noncopyable { public: @@ -64,13 +63,14 @@ public: int lex(); /** Just read athe next word. If esc is true remember that - some chars might be escaped: "\ atleast */ + some chars might be escaped: "\ atleast + */ bool next(bool esc = false); /** Read next token. This one is almost the same as next, - but it will consider " as a regular character and always - split a word if it contains a backslash. - */ + but it will consider " as a regular character and always + split a word if it contains a backslash. + */ bool nextToken(); /// Push a token, that next token got from lyxlex. void pushToken(string const &); @@ -87,14 +87,13 @@ public: /// string const GetString() const; - /** - * Get a long string, ended by the tag `endtag' - * This string can span several lines. The first line - * serves as a template for how many spaces the lines - * are indented. This much white space is skipped from - * each following line. This mechanism does not work - * perfectly if you use tabs. - */ + /** Get a long string, ended by the tag `endtag'. + This string can span several lines. The first line + serves as a template for how many spaces the lines + are indented. This much white space is skipped from + each following line. This mechanism does not work + perfectly if you use tabs. + */ string const getLongString(string const & endtag); /// @@ -110,31 +109,35 @@ public: /** Pushes a token list on a stack and replaces it with a new one. */ void pushTable(keyword_item *, int); - + /** Pops a token list into void and replaces it with the one now - on top of the stack. - */ + on top of the stack. + */ void popTable(); /** Prints an error message with the corresponding line number - and file name. If message contains the substring `$$Token', - it is replaced with the value of GetString() - */ + and file name. If message contains the substring `$$Token', + it is replaced with the value of GetString() + */ void printError(string const & message) const; /** - Prints the current token table on the supplied ostream. - */ + Prints the current token table on the supplied ostream. + */ void printTable(std::ostream &); private: struct Pimpl; + /// Pimpl * pimpl_; }; -// This is needed to ensure that the pop is done upon exit from methods -// with more than one exit point or that can return as a response to -// exceptions. (Lgb) +/** Use to enable multipe exit points. + This is needed to ensure that the pop is done upon exit from methods + with more than one exit point or that can return as a response to + exceptions. + @autor Lgb +*/ struct pushpophelper { pushpophelper(LyXLex & lexrc, keyword_item * i, int s) : lex(lexrc) { lex.pushTable(i, s); @@ -144,10 +147,11 @@ struct pushpophelper { } LyXLex & lex; }; -// To avoid wrong usage: -// pushpophelper(...); // wrong -// pushpophelper pph(...); // right -// we add this macro: +/** Avoid wrong usage of pushpophelper. + To avoid wrong usage: + pushpophelper(...); // wrong + pushpophelper pph(...); // right +*/ #define pushpophelper(x, y, z) unnamed_pushpophelper; // Tip gotten from Bobby Schmidt's column in C/C++ Users Journal diff --git a/src/lyxlookup.h b/src/lyxlookup.h index 5ed0e2e203..a2495b1993 100644 --- a/src/lyxlookup.h +++ b/src/lyxlookup.h @@ -19,13 +19,13 @@ #include -// Initialize the compose key handling +/// Initialize the compose key handling extern void InitLyXLookup(Display *, Window ) ; -// Read a keysym and/or a string (like XLookupString) +/// Read a keysym and/or a string (like XLookupString) extern int LyXLookupString(XEvent * event, char * buffer_return, int bytes_buffer, KeySym * keysym_return); -// Call this when you destroy your window +/// Call this when you destroy your window extern void CloseLyXLookup(); diff --git a/src/lyxparagraph.h b/src/lyxparagraph.h index dcccb3cd75..31589a68bf 100644 --- a/src/lyxparagraph.h +++ b/src/lyxparagraph.h @@ -89,7 +89,7 @@ public: #endif /// META_NEWLINE, - /// + // //META_PROTECTED_SEPARATOR, /// META_INSET @@ -220,6 +220,7 @@ public: void SetInsetOwner(Inset * i); /// void deleteInsetsLyXText(BufferView *); + /// void resizeInsetsLyXText(BufferView *); private: /// @@ -267,8 +268,6 @@ public: /// footnote, margin, fig, tab footnote_kind footnotekind; #endif - //@Man: the LyX- DTP-switches - //@{ /// bool line_top; @@ -296,7 +295,9 @@ private: public: /// void setCounter(int i, int v) { counter_[i] = v; } + /// int getCounter(int i) const { return counter_[i]; } + /// void incCounter(int i) { counter_[i]++; } /// bool start_of_appendix; @@ -329,7 +330,6 @@ public: /// string labelwidthstring; - //@} /// LyXParagraph * next; @@ -423,12 +423,12 @@ public: LyXFont GetFirstFontSettings() const; /** Get fully instantiated font. If pos == -1, use the layout - font attached to this paragraph. - If pos == -2, use the label font of the layout attached here. - In all cases, the font is instantiated, i.e. does not have any - attributes with values LyXFont::INHERIT, LyXFont::IGNORE or - LyXFont::TOGGLE. - */ + font attached to this paragraph. + If pos == -2, use the label font of the layout attached here. + In all cases, the font is instantiated, i.e. does not have any + attributes with values LyXFont::INHERIT, LyXFont::IGNORE or + LyXFont::TOGGLE. + */ LyXFont getFont(BufferParams const &, size_type pos) const; /// value_type GetChar(size_type pos) const; @@ -523,11 +523,11 @@ public: #ifndef NEW_INSETS /** A paragraph following a footnote is a "dummy". A paragraph - with a footnote in it is stored as three paragraphs: - First a paragraph with the text up to the footnote, then - one (or more) paragraphs with the footnote, and finally - the a paragraph with the text after the footnote. Only the - first paragraph keeps information about layoutparameters, */ + with a footnote in it is stored as three paragraphs: + First a paragraph with the text up to the footnote, then + one (or more) paragraphs with the footnote, and finally + the a paragraph with the text after the footnote. Only the + first paragraph keeps information about layoutparameters, */ bool IsDummy() const; #endif /* If I set a PExtra Indent on one paragraph of a ENV_LIST-TYPE @@ -598,6 +598,7 @@ private: /// FontTable(size_type p, LyXFont const & f) {pos = p; font = f;} }; + /// friend struct matchFT; /// struct matchFT { @@ -662,23 +663,32 @@ private: /// static unsigned int paragraph_id; public: + /// class inset_iterator { public: + /// inset_iterator() {} + // inset_iterator(InsetList::iterator const & iter) : it(iter) {}; + /// inset_iterator & operator++() { ++it; return *this; } + /// Inset * operator*() { return (*it).inset; } + /// size_type getPos() {return (*it).pos; } + /// bool operator==(inset_iterator const & iter) const { return it == iter.it; } + /// bool operator!=(inset_iterator const & iter) const { return it != iter.it; } private: + /// InsetList::iterator it; }; /// diff --git a/src/lyxrc.h b/src/lyxrc.h index 4844a92efe..79a08efd84 100644 --- a/src/lyxrc.h +++ b/src/lyxrc.h @@ -17,10 +17,12 @@ #endif #include "bufferparams.h" +#include "support/utility.hpp" /// This contains the runtime configuration of LyX -class LyXRC { +class LyXRC : public noncopyable { public: + /// LyXRC(); /// void setDefaults(); @@ -92,10 +94,13 @@ public: string dvi_to_ps_command; /// program for performing literate programming string literate_command; + /// string literate_extension; + /// string literate_error_filter; /// program for compiling string build_command; + /// string build_error_filter; /// program for running relyx string relyx_command; @@ -163,11 +168,16 @@ public: string popup_font_name; /// string font_norm; + /// enum FontEncoding { + /// ISO_10646_1, + /// ISO_8859_6_8, + /// OTHER_ENCODING }; + /// FontEncoding font_norm_type; /// void set_font_norm_type(); @@ -251,6 +261,7 @@ public: string docbook_to_pdf_command; }; +/// extern LyXRC lyxrc; #endif diff --git a/src/lyxscreen.h b/src/lyxscreen.h index 26e695533f..89e8cb01f1 100644 --- a/src/lyxscreen.h +++ b/src/lyxscreen.h @@ -20,12 +20,15 @@ #include class LyXText; -struct Row; -typedef unsigned short Dimension; - class WorkArea; class Buffer; +struct Row; + +/// +typedef unsigned short Dimension; + + /** The class LyXScreen is used for the main Textbody. Concretely, the screen is held in a pixmap. This pixmap is kept up to date and used to optimize drawing on the screen. @@ -33,7 +36,7 @@ class Buffer; */ class LyXScreen { public: - + /// enum Cursor_Shape { /// BAR_SHAPE, @@ -44,7 +47,7 @@ public: }; /// - LyXScreen(WorkArea &); //, LyXText * text_ptr); + LyXScreen(WorkArea &); /** Draws the screen form textposition y. Uses as much of the already printed pixmap as possible */ @@ -64,7 +67,8 @@ public: /// void CursorToggle(LyXText const *); /// - void ShowManualCursor(LyXText const *, long x, long y, int asc, int desc, + void ShowManualCursor(LyXText const *, long x, long y, + int asc, int desc, Cursor_Shape shape); /// returns 1 if first has changed, otherwise 0 bool FitManualCursor(LyXText *, long, long, int, int); diff --git a/src/lyxserver.h b/src/lyxserver.h index 800f93eb3b..9390f5e23d 100644 --- a/src/lyxserver.h +++ b/src/lyxserver.h @@ -29,8 +29,7 @@ class LyXServer; This class encapsulates all the dirty communication and thus provides a clean string interface. */ -class LyXComm -{ +class LyXComm { public: /** When we receive a message, we send it to a client. This is one of the small things that would have been a lot @@ -40,8 +39,7 @@ public: /// Construct with pipe-basename and callback to receive messages LyXComm(string const & pip, LyXServer * cli, ClientCallbackfct ccb = 0) - : pipename(pip), client(cli), clientcb(ccb) - { + : pipename(pip), client(cli), clientcb(ccb) { ready = false; openConnection(); } @@ -85,22 +83,22 @@ private: /* --- prototypes -------------------------------------------------------- */ -class LyXServer -{ +/// +class LyXServer { public: // FIXME IN 0.13 // Hack! This should be changed in 0.13 - /// The lyx server should not take an argument "LyXFunc" but this is + // The lyx server should not take an argument "LyXFunc" but this is // how it will be done for 0.12. In 0.13 we must write a non-gui // bufferview. // IMO lyxserver is atypical, and for the moment the only one, non-gui // bufferview. We just have to find a way to handle situations like if // lyxserver is using a buffer that is being edited with a bufferview. // With a common buffer list this is not a problem, maybe. (Alejandro) + /// LyXServer(LyXFunc * f, string const & pip) - : numclients(0), func(f), pipes(pip, (this), callback) - { } + : numclients(0), func(f), pipes(pip, (this), callback) {} /// ~LyXServer(); /// @@ -109,8 +107,13 @@ private: /// static void callback(LyXServer *, string const & msg); /// Names and number of current clients - enum { MAX_CLIENTS = 10 }; + enum { + /// + MAX_CLIENTS = 10 + }; + /// string clients[MAX_CLIENTS]; + /// int numclients; /// LyXFunc * func; diff --git a/src/lyxtext.h b/src/lyxtext.h index 1a0d5c4cfa..1afc30597c 100644 --- a/src/lyxtext.h +++ b/src/lyxtext.h @@ -48,6 +48,7 @@ public: /// Constructor LyXText(BufferView *); + /// LyXText(InsetText *); /// Destructor @@ -58,6 +59,7 @@ public: mutable int number_of_rows; /// mutable long height; + /// mutable unsigned int width; /// the current font settings mutable LyXFont current_font; @@ -182,7 +184,8 @@ public: /** returns the column near the specified x-coordinate of the row x is set to the real beginning of this column */ - int GetColumnNearX(BufferView *, Row * row, int & x, bool & boundary) const; + int GetColumnNearX(BufferView *, Row * row, + int & x, bool & boundary) const; /** returns a pointer to a specified row. y is set to the beginning of the row @@ -247,7 +250,7 @@ public: LyXParagraph::size_type pos, bool setfont = true, bool boundary = false) const; - + /// void SetCursor(BufferView *, LyXCursor &, LyXParagraph * par, LyXParagraph::size_type pos, bool boundary = false) const; @@ -269,6 +272,7 @@ public: /// void SetCursorFromCoordinates(BufferView *, int x, long y) const; + /// void SetCursorFromCoordinates(BufferView *, LyXCursor &, int x, long y) const; /// @@ -313,10 +317,13 @@ public: void DeleteLineForward(BufferView *); /// bool SelectWordWhenUnderCursor(BufferView *); - + /// enum TextCase { + /// text_lowercase = 0, + /// text_capitalization = 1, + /// text_uppercase = 2 }; /// Change the case of the word at cursor position. @@ -385,6 +392,7 @@ public: LyXAlignment align, string labelwidthstring, bool noindent); + /// void SetParagraphExtraOpt(BufferView *, int type, char const * width, char const * widthp, @@ -412,6 +420,7 @@ public: /** if the string can be found: return true and set the cursor to the new position */ bool SearchForward(BufferView *, char const * str) const; + /// bool SearchBackward(BufferView *, char const * str) const; /// needed to insert the selection @@ -522,7 +531,7 @@ public: else return vis2log_list[pos-bidi_start]; } - + /// inline int bidi_level(LyXParagraph::size_type pos) const { if (bidi_start == -1) @@ -530,7 +539,7 @@ public: else return bidi_levels[pos-bidi_start]; } - + /// inline bool bidi_InRange(LyXParagraph::size_type pos) const { return bidi_start == -1 || @@ -544,14 +553,14 @@ private: /// mutable Row * lastrow; - /** Copybuffer for copy environment type + /** Copybuffer for copy environment type. Asger has learned that this should be a buffer-property instead Lgb has learned that 'char' is a lousy type for non-characters */ LyXTextClass::size_type copylayouttype; /** inserts a new row behind the specified row, increments - * the touched counters */ + the touched counters */ void InsertRow(Row * row, LyXParagraph * par, LyXParagraph::size_type pos) const; /** removes the row and reset the touched counters */ @@ -561,7 +570,8 @@ private: void RemoveParagraph(Row * row) const; /** insert the specified paragraph behind the specified row */ - void InsertParagraph(BufferView *, LyXParagraph * par, Row * row) const; + void InsertParagraph(BufferView *, + LyXParagraph * par, Row * row) const; /** appends the implizit specified paragraph behind the specified row, * start at the implizit given position */ @@ -684,13 +694,12 @@ private: /// void charInserted(); - /// - /// special owner functions + // + // special owner functions /// LyXParagraph * OwnerParagraph() const; - /// + // LyXParagraph * OwnerParagraph(LyXParagraph *) const; - /// }; #endif diff --git a/src/lyxvc.h b/src/lyxvc.h index 706a5639f1..8f3272f699 100644 --- a/src/lyxvc.h +++ b/src/lyxvc.h @@ -91,7 +91,6 @@ public: static void logClose(FL_OBJECT *, long); /// static void logUpdate(FL_OBJECT *, long); -protected: private: /// Buffer * owner_; diff --git a/src/mathed/array.h b/src/mathed/array.h index 32e50c8650..4683fc13ac 100644 --- a/src/mathed/array.h +++ b/src/mathed/array.h @@ -20,11 +20,10 @@ #define byte unsigned char #endif -/*@Doc: A resizable array - Why is it called "LyXArrayBase" if it is generic? (Lgb) - Initially I thought it could be the base class for both mathed's - and LyX' kernels data buffer. (Ale) - +/** A resizable array. + A general purpose resizable array. + @author Alejandro Aguilar Sierra + @version January 1996 */ class LyxArrayBase { public: diff --git a/src/mathed/math_defs.h b/src/mathed/math_defs.h index a53709a1eb..bebf604daf 100644 --- a/src/mathed/math_defs.h +++ b/src/mathed/math_defs.h @@ -142,6 +142,7 @@ enum MathedTextCodes { LM_TC_MAX }; +/// std::ostream & operator<<(std::ostream &, MathedTextCodes mtc); /// @@ -383,11 +384,11 @@ class MathParInset: public MathedInset { // virtual void SetLabel(char const *) {} /// virtual void SetStyle(short); - /// + /// virtual MathedRowSt * getRowSt() const { return 0; } - /// + /// virtual void setRowSt(MathedRowSt *) {} - /// + /// virtual bool Permit(short f) { return bool(f & flag); } protected: @@ -416,7 +417,7 @@ class MathParInset: public MathedInset { }; -/* The physical structure of a row and aditional information is stored here. +/** The physical structure of a row and aditional information is stored here. It allows to manage the extra info independently of the paragraph data. Only used for multiline paragraphs. */ @@ -554,70 +555,70 @@ int MathedLookupBOP(short); /************************ Inline functions ********************************/ +/// inline bool MathIsInset(short x) { return LM_TC_INSET <= x && x <= LM_TC_ACTIVE_INSET; } - +/// inline bool MathIsFont(short x) { return LM_TC_CONST <= x && x <= LM_TC_BSYM; } - +/// inline bool MathIsAlphaFont(short x) { return LM_TC_VAR <= x && x <= LM_TC_TEXTRM; } - +/// inline bool MathIsActive(short x) { return LM_TC_INSET < x && x <= LM_TC_ACTIVE_INSET; } - +/// inline bool MathIsUp(short x) { return x == LM_TC_UP; } - +/// inline bool MathIsDown(short x) { return x == LM_TC_DOWN; } - +/// inline bool MathIsScript(short x) { return x == LM_TC_DOWN || x == LM_TC_UP; } - +/// inline bool MathIsBOPS(short x) { return MathedLookupBOP(x) > LMB_NONE; } - - +/// inline bool MathIsBinary(short x) { return x == LM_TC_BOP || x == LM_TC_BOPS; } - +/// inline bool MathIsSymbol(short x) { return LM_TC_SYMB <= x && x <= LM_TC_BSYM; @@ -631,6 +632,7 @@ MathedInset::MathedInset(char const * nm, short ot, short st): width = ascent = descent = 0; } + inline bool MathParInset::Inside(int x, int y) { diff --git a/src/mathed/math_iter.h b/src/mathed/math_iter.h index effa8200cc..dd4b1cb982 100644 --- a/src/mathed/math_iter.h +++ b/src/mathed/math_iter.h @@ -28,22 +28,20 @@ /// enum mathIterFlags { - /// Allow newlines + /// Allow newlines MthIF_CR = 1, /// Allow tabs MthIF_Tabs = 2 }; -/** - Specialized array iterator for amth paragraph. Used for - storing and querying data operations - */ +/** Specialized array iterator for math paragraph. + Used for storing and querying data operations +*/ class MathedIter { public: /// - MathedIter() - { + MathedIter() { pos = 0; fcode = 0; array = 0; @@ -54,11 +52,11 @@ class MathedIter { explicit MathedIter(LyxArrayBase *); /// - virtual ~MathedIter() { } + virtual ~MathedIter() {} /// bool goNextCode(MathedTextCodes); /// - void goPosRel(int); + void goPosRel(int); /// void goPosAbs(int); /// @@ -139,14 +137,15 @@ class MathedIter { LyxArrayBase *array; // one element stack struct MIState { - /// + /// short fcode; - /// + /// int x, y; - /// + /// int pos, row, col; - } stck; - + }; + /// + MIState stck; /// Saves the current state of the iterator virtual void ipush(); /// Recover previous state @@ -166,13 +165,16 @@ class MathedIter { class MathedXIter: public MathedIter { public: /// - MathedXIter() : MathedIter(), sx(0), sw(0) { x = y = size = 0; p = 0; crow = 0; } - /// - MathedXIter(MathParInset*); + MathedXIter() + : MathedIter(), sx(0), sw(0) { + x = y = size = 0; p = 0; crow = 0; + } + // + MathedXIter(MathParInset *); /// void SetData(MathParInset *); /// - MathParInset *getPar() { return p; } + MathParInset * getPar() { return p; } /// bool Next(); /// @@ -191,12 +193,12 @@ class MathedXIter: public MathedIter { void Adjust(); /// inline - void GetPos(int&, int&); + void GetPos(int &, int &); /// inline - void GetIncPos(int&, int&); + void GetIncPos(int &, int &); /// - byte* GetString(int&); + byte * GetString(int &); /// int GetX(); /// @@ -206,22 +208,19 @@ class MathedXIter: public MathedIter { /// void fitCoord(int, int); /// - void getAD(int& a, int& d); + void getAD(int & a, int & d); /// Create a new row and insert #ncols# tabs. void addRow(); - /// - void delRow(); + /// + void delRow(); - /**$ These two functions will be moved from here */ - //@{ - /// + /// bool setLabel(char* label); - /// + /// bool setNumbered(bool); - //@} - /// + /// void setTab(int, int); /// Merge the array at current position void Merge(LyxArrayBase*); @@ -229,7 +228,7 @@ class MathedXIter: public MathedIter { void Clean(int pos2); MathedRowSt *adjustVerticalSt(); - private: +private: /// This function is not recursive, as MathPar::Metrics is void IMetrics(int, int&, int&, int&); /// Font size (display, text, script, script2) @@ -248,16 +247,16 @@ class MathedXIter: public MathedIter { bool limits; /// Type of previous script short s_type; - + /// void ipush(); - + /// void ipop(); - protected: +protected: /// MathedRowSt *crow; - private: +private: /// friend class MathedCursor; }; diff --git a/src/mathed/math_macro.h b/src/mathed/math_macro.h index 5e9773acc6..bd87b701af 100644 --- a/src/mathed/math_macro.h +++ b/src/mathed/math_macro.h @@ -48,56 +48,56 @@ public: void draw(Painter &, int, int); /// void Metrics(); - /// + /// MathedInset * Clone(); - /// + /// void Write(std::ostream &, bool fragile); - /// + /// bool setArgumentIdx(int); - /// + /// int getArgumentIdx(); - /// + /// int getMaxArgumentIdx(); - /// + /// int GetColumns(); - /// + /// void GetXY(int &, int &) const; - /// + /// void SetFocus(int, int); - /// + /// LyxArrayBase * GetData(); - /// + /// MathedRowSt * getRowSt() const { return args[idx].row; } - /// + /// void SetData(LyxArrayBase *); - /// + /// MathedTextCodes getTCode() { return tcode; } - /// + /// bool Permit(short); private: + /// + MathMacroTemplate * tmplate; + /// + struct MacroArgumentBase { + /// Position of the macro + int x, y; /// - MathMacroTemplate * tmplate; + MathedRowSt * row; /// - struct MacroArgumentBase { - /// Position of the macro - int x, y; - /// - MathedRowSt * row; - /// - LyxArrayBase * array; - /// - MacroArgumentBase() { x = y = 0; array = 0; row = 0; } - }; - MacroArgumentBase * args; + LyxArrayBase * array; /// - int idx; - /// - int nargs; - /// - MathedTextCodes tcode; - /// - friend class MathMacroTemplate; + MacroArgumentBase() { x = y = 0; array = 0; row = 0; } + }; + MacroArgumentBase * args; + /// + int idx; + /// + int nargs; + /// + MathedTextCodes tcode; + /// + friend class MathMacroTemplate; }; @@ -117,11 +117,11 @@ public: ~MathMacroArgument() { lyxerr << "help, destroyme!" << std::endl; } /// MathedInset * Clone() { return this; } - /// + /// void Metrics(); - /// + /// void draw(Painter &, int x, int baseline); - /// + /// void Write(std::ostream &, bool fragile); /// void setNumber(int n) { number = n; } diff --git a/src/mathed/math_panel.h b/src/mathed/math_panel.h index def59e64bd..c84c5e3e76 100644 --- a/src/mathed/math_panel.h +++ b/src/mathed/math_panel.h @@ -23,21 +23,53 @@ #include "bmtable.h" /// -enum { - MM_GREEK, MM_ARROW, MM_BOP, MM_BRELATS, MM_VARSIZE, MM_MISC, - MM_FRAC, MM_SQRT, MM_DELIM, MM_MATRIX, MM_EQU, - MM_DECO, MM_SPACE, MM_DOTS, MM_FUNC, - MM_MAX, - MM_CLOSE = 1024, - MM_APPLY, MM_OK +enum SomeMathValues { + /// + MM_GREEK, + /// + MM_ARROW, + /// + MM_BOP, + /// + MM_BRELATS, + /// + MM_VARSIZE, + /// + MM_MISC, + /// + MM_FRAC, + /// + MM_SQRT, + /// + MM_DELIM, + /// + MM_MATRIX, + /// + MM_EQU, + /// + MM_DECO, + /// + MM_SPACE, + /// + MM_DOTS, + /// + MM_FUNC, + /// + MM_MAX, + /// + MM_CLOSE = 1024, + /// + MM_APPLY, + /// + MM_OK }; - +/// typedef FL_OBJECT * FL_OBJECTP; /// Class to manage bitmap menu bars class BitmapMenu { - /// + /// static BitmapMenu * active; /// friend int peek_event(FL_FORM *, void *); @@ -82,7 +114,7 @@ protected: int GetIndex(FL_OBJECT * ob); }; -// This is just a wrapper around peek_event() +/// This is just a wrapper around peek_event() extern "C" int C_peek_event(FL_FORM * form, void * ptr); @@ -102,6 +134,7 @@ void BitmapMenu::Next() { #include "math_forms.h" +/// extern FD_panel * create_math_panel(void); #endif /* FD_math_panel_h_ */ diff --git a/src/mathed/math_parser.h b/src/mathed/math_parser.h index 474a484ebc..3a283b48e7 100644 --- a/src/mathed/math_parser.h +++ b/src/mathed/math_parser.h @@ -25,75 +25,111 @@ #include "symbol_def.h" - +/// #define LM_TK_OPEN '{' - +/// #define LM_TK_CLOSE '}' - +/// enum MathTokenEnum { - LM_TK_BOP = 256, - LM_TK_ALPHA, - LM_TK_STR, - LM_TK_SYM, - LM_TK_FRAC, - LM_TK_SQRT, - LM_TK_BEGIN, - LM_TK_END, - LM_TK_NEWLINE, - LM_TK_UNDEF, - LM_TK_FONT, - LM_TK_LEFT, - LM_TK_RIGHT, - LM_TK_ACCENT, - LM_TK_WIDE, - LM_TK_FUNC, - LM_TK_FUNCLIM, - LM_TK_BIGSYM, - LM_TK_LABEL, - LM_TK_NONUM, - LM_TK_SPACE, - LM_TK_DOTS, - LM_TK_LIMIT, - LM_TK_STY, - LM_TK_PMOD, - LM_TK_BMOD, - LM_TK_MACRO, - LM_TK_SPECIAL, - LM_TK_ARGUMENT, - LM_TK_NEWCOMMAND, - LM_TK_STACK + /// + LM_TK_BOP = 256, + /// + LM_TK_ALPHA, + /// + LM_TK_STR, + /// + LM_TK_SYM, + /// + LM_TK_FRAC, + /// + LM_TK_SQRT, + /// + LM_TK_BEGIN, + /// + LM_TK_END, + /// + LM_TK_NEWLINE, + /// + LM_TK_UNDEF, + /// + LM_TK_FONT, + /// + LM_TK_LEFT, + /// + LM_TK_RIGHT, + /// + LM_TK_ACCENT, + /// + LM_TK_WIDE, + /// + LM_TK_FUNC, + /// + LM_TK_FUNCLIM, + /// + LM_TK_BIGSYM, + /// + LM_TK_LABEL, + /// + LM_TK_NONUM, + /// + LM_TK_SPACE, + /// + LM_TK_DOTS, + /// + LM_TK_LIMIT, + /// + LM_TK_STY, + /// + LM_TK_PMOD, + /// + LM_TK_BMOD, + /// + LM_TK_MACRO, + /// + LM_TK_SPECIAL, + /// + LM_TK_ARGUMENT, + /// + LM_TK_NEWCOMMAND, + /// + LM_TK_STACK }; +/// struct latexkeys { - char const * name; - short token; - int id; + /// + char const * name; + /// + short token; + /// + int id; }; +/// latexkeys * in_word_set (register char const * str, register int len); - +/// latexkeys * lm_get_key(int index); - +/// latexkeys * lm_get_key_by_id(int id, short tc = LM_TK_SYM); - -typedef union{ - -unsigned char c; - -char * s; - -int i; - -latexkeys * l; -} YYSTYPE; +/// +union YYSTYPE { + /// + unsigned char c; + /// + char * s; + /// + int i; + /// + latexkeys * l; +}; extern YYSTYPE yylval; diff --git a/src/mathed/math_root.h b/src/mathed/math_root.h index 497adc0804..5a8aa95bc4 100644 --- a/src/mathed/math_root.h +++ b/src/mathed/math_root.h @@ -26,7 +26,7 @@ /// class MathRootInset: public MathSqrtInset { - public: +public: /// explicit MathRootInset(short st = LM_ST_TEXT); @@ -59,7 +59,7 @@ class MathRootInset: public MathSqrtInset { /// void SetStyle(short); - protected: +protected: /// int idx; /// diff --git a/src/mathed/symbol_def.h b/src/mathed/symbol_def.h index b2d4ea9ff1..af66744584 100644 --- a/src/mathed/symbol_def.h +++ b/src/mathed/symbol_def.h @@ -4,157 +4,446 @@ #define SYMBOL_DEF // Symbols that do exist in X11 symbol font +/// #define LM_Gamma 0x47 +/// #define LM_Delta 0x44 +/// #define LM_Theta 0x51 +/// #define LM_Lambda 0x4c +/// #define LM_Xi 0x58 +/// #define LM_Pi 0x50 +/// #define LM_Sigma 0x53 //#define LM_Upsilon 0x55 +/// #define LM_Upsilon 0xa1 +/// #define LM_Phi 0x46 +/// #define LM_Psi 0x59 +/// #define LM_Omega 0x57 +/// #define LM_alpha 0x61 +/// #define LM_beta 0x62 +/// #define LM_gamma 0x67 +/// #define LM_delta 0x64 +/// #define LM_varepsilon 0x65 +/// #define LM_eta 0x68 +/// #define LM_theta 0x71 +/// #define LM_vartheta 0x4a +/// #define LM_iota 0x69 +/// #define LM_kappa 0x6b +/// #define LM_lambda 0x6c +/// #define LM_mu 0x6d +/// #define LM_nu 0x6e +/// #define LM_xi 0x78 +/// #define LM_pi 0x70 +/// #define LM_varpi 0x76 +/// #define LM_rho 0x72 +/// #define LM_sigma 0x73 +/// #define LM_tau 0x74 +/// #define LM_varsigma 0x56 +/// #define LM_zeta 0x7a +/// #define LM_upsilon 0x75 +/// #define LM_phi 0x66 +/// #define LM_varphi 0x6a +/// #define LM_chi 0x63 +/// #define LM_psi 0x79 +/// #define LM_omega 0x77 +/// #define LM_downarrow 0xaf +/// #define LM_leftarrow 0xac +/// #define LM_Downarrow 0xdf +/// #define LM_Leftarrow 0xdc +/// #define LM_rightarrow 0xae +/// #define LM_uparrow 0xad +/// #define LM_Rightarrow 0xde +/// #define LM_Uparrow 0xdd +/// #define LM_Leftrightarrow 0xdb +/// #define LM_leftrightarrow 0xab +/// #define LM_leq 0xa3 +/// #define LM_geq 0xb3 +/// #define LM_equiv 0xba +/// #define LM_subset 0xcc +/// #define LM_supset 0xc9 +/// #define LM_approx 0xbb +/// #define LM_subseteq 0xcd +/// #define LM_supseteq 0xca +/// #define LM_cong 0x40 +/// #define LM_neq 0xb9 +/// #define LM_in 0xce +/// #define LM_propto 0xb5 +/// #define LM_pm 0xb1 +/// #define LM_cap 0xc7 +/// #define LM_diamond 0xe0 +/// #define LM_oplus 0xc5 +/// #define LM_cup 0xc8 +/// #define LM_times 0xb4 +/// #define LM_otimes 0xc4 +/// #define LM_div 0xb8 +/// #define LM_oslash 0xc6 +/// #define LM_cdot 0xd7 +/// #define LM_wedge 0xd9 +/// #define LM_bullet 0xb7 +/// #define LM_sum 0xe5 +/// #define LM_int 0xf2 +/// #define LM_prod 0xd5 +/// #define LM_nabla 0xd1 +/// #define LM_partial 0xb6 +/// #define LM_infty 0xa5 +/// #define LM_prime 0xa2 //#define LM_emptyset 0xc6 +/// #define LM_exists 0x24 +/// #define LM_forall 0x22 +/// #define LM_Re 0xc2 +/// #define LM_Im 0xc1 +/// #define LM_aleph 0xc0 +/// #define LM_wp 0xc3 +/// #define LM_bot 0x5e +/// #define LM_neg 0xd8 +/// #define LM_sharp 0x23 +/// #define LM_surd 0xd6 +/// #define LM_diamondsuit 0xa8 +/// #define LM_heartsuit 0xa9 +/// #define LM_clubsuit 0xa7 +/// #define LM_spadesuit 0xaa +/// #define LM_langle 0xe1 +/// #define LM_lceil 0xe9 +/// #define LM_lfloor 0xeb +/// #define LM_rangle 0xf1 +/// #define LM_rceil 0xf9 +/// #define LM_rfloor 0xfb +/// #define LM_mid 0x7c - +/// #define LM_angle 0xd0 +/// #define LM_vee 0xda //#define LM_backslash '\\' -// Symbols that don't exist in X11 symbol font +/// Symbols that don't exist in X11 symbol font enum Math_Symbols_enum { + /// LM_NoFont = 256, + /// LM_epsilon, - LM_hookleftarrow, LM_hookrightarrow, LM_updownarrow, LM_leftharpoonup, - LM_rightharpoonup, LM_rightleftharpoons, LM_Updownarrow, - LM_leftharpoondown, LM_rightharpoondown, LM_mapsto, LM_Longleftarrow, - LM_Longrightarrow, LM_Longleftrightarrow, LM_longleftrightarrow, - LM_longleftarrow, LM_longrightarrow, LM_longmapsto, LM_nwarrow, - LM_nearrow, LM_swarrow, LM_searrow, - LM_models, LM_prec, LM_succ, LM_sim, LM_perp, LM_preceq, LM_succeq, - LM_simeq, LM_ll, LM_gg, LM_asymp, LM_parallel, LM_smile, - LM_frown, LM_sqsubseteq, LM_sqsupseteq, LM_doteq, LM_ni, LM_notin, - LM_vdash, LM_dashv, LM_bowtie, - LM_mp, LM_bigtriangleup, LM_ominus, LM_uplus, LM_bigtriangledown, - LM_sqcap, LM_triangleright, LM_sqcup, LM_triangleleft, LM_odot, LM_star, - LM_amalg, LM_bigcirc, LM_setminus, LM_dagger, LM_circ, LM_wr, + /// + LM_hookleftarrow, + /// + LM_hookrightarrow, + /// + LM_updownarrow, + /// + LM_leftharpoonup, + /// + LM_rightharpoonup, + /// + LM_rightleftharpoons, + /// + LM_Updownarrow, + /// + LM_leftharpoondown, + /// + LM_rightharpoondown, + /// + LM_mapsto, + /// + LM_Longleftarrow, + /// + LM_Longrightarrow, + /// + LM_Longleftrightarrow, + /// + LM_longleftrightarrow, + /// + LM_longleftarrow, + /// + LM_longrightarrow, + /// + LM_longmapsto, + /// + LM_nwarrow, + /// + LM_nearrow, + /// + LM_swarrow, + /// + LM_searrow, + /// + LM_models, + /// + LM_prec, + /// + LM_succ, + /// + LM_sim, + /// + LM_perp, + /// + LM_preceq, + /// + LM_succeq, + /// + LM_simeq, + /// + LM_ll, + /// + LM_gg, + /// + LM_asymp, + /// + LM_parallel, + /// + LM_smile, + /// + LM_frown, + /// + LM_sqsubseteq, + /// + LM_sqsupseteq, + /// + LM_doteq, + /// + LM_ni, + /// + LM_notin, + /// + LM_vdash, + /// + LM_dashv, + /// + LM_bowtie, + /// + LM_mp, + /// + LM_bigtriangleup, + /// + LM_ominus, + /// + LM_uplus, + /// + LM_bigtriangledown, + /// + LM_sqcap, + /// + LM_triangleright, + /// + LM_sqcup, + /// + LM_triangleleft, + /// + LM_odot, + /// + LM_star, + /// + LM_amalg, + /// + LM_bigcirc, + /// + LM_setminus, + /// + LM_dagger, + /// + LM_circ, + /// + LM_wr, + /// LM_ddagger, - LM_oint, LM_coprod, LM_bigsqcup, LM_bigotimes, LM_bigodot, LM_bigoplus, - LM_bigcap, LM_bigcup, LM_biguplus, LM_bigvee, LM_bigwedge, - LM_ell, LM_imath, LM_jmath, LM_hbar, LM_top, LM_Vert, LM_flat, - LM_natural, LM_triangle, - LM_widehat, LM_widetilde, LM_underline, LM_overline, LM_underbrace, - LM_overbrace, LM_overleftarrow, LM_overightarrow, - LM_ldots, LM_cdots, LM_vdots, LM_ddots, - LM_backslash, LM_emptyset, + /// + LM_oint, + /// + LM_coprod, + /// + LM_bigsqcup, + /// + LM_bigotimes, + /// + LM_bigodot, + /// + LM_bigoplus, + /// + LM_bigcap, + /// + LM_bigcup, + /// + LM_biguplus, + /// + LM_bigvee, + /// + LM_bigwedge, + /// + LM_ell, + /// + LM_imath, + /// + LM_jmath, + /// + LM_hbar, + /// + LM_top, + /// + LM_Vert, + /// + LM_flat, + /// + LM_natural, + /// + LM_triangle, + /// + LM_widehat, + /// + LM_widetilde, + /// + LM_underline, + /// + LM_overline, + /// + LM_underbrace, + /// + LM_overbrace, + /// + LM_overleftarrow, + /// + LM_overightarrow, + /// + LM_ldots, + /// + LM_cdots, + /// + LM_vdots, + /// + LM_ddots, + /// + LM_backslash, + /// + LM_emptyset, + /// LM_last_symbol }; // Accents +/// #define LM_acute '\'' +/// #define LM_grave '`' +/// #define LM_hat '^' +/// #define LM_tilde '~' +/// #define LM_dot '.' +/// #define LM_bar '-' +/// enum Math_Accent_enum { + /// LM_ddot = LM_last_symbol, - LM_check, LM_vec, LM_breve, LM_not + /// + LM_check, + /// + LM_vec, + /// + LM_breve, + /// + LM_not }; +/// #define LM_quad 4 +/// #define LM_qquad 5 #endif diff --git a/src/minibuffer.h b/src/minibuffer.h index 34a92e59da..80cfc15ccb 100644 --- a/src/minibuffer.h +++ b/src/minibuffer.h @@ -55,17 +55,17 @@ public: int, void *); private: /// - LyXView *owner; + LyXView * owner; /// string text; /// string text_stored; /// - FL_OBJECT *add(int, FL_Coord, FL_Coord, FL_Coord, FL_Coord); + FL_OBJECT * add(int, FL_Coord, FL_Coord, FL_Coord, FL_Coord); /// - FL_OBJECT *timer; + FL_OBJECT * timer; /// - FL_OBJECT *the_buffer; + FL_OBJECT * the_buffer; /// string cur_cmd; /// @@ -76,7 +76,9 @@ private: int history_idx, history_cnt; /// void addHistory(string const &cmd) { - if (history_cnt == 0 || (history_cnt>0 && cmd!= history[(history_cnt-1) % MAX_HISTORY])) { + if (history_cnt == 0 + || (history_cnt > 0 + && cmd != history[(history_cnt - 1) % MAX_HISTORY])) { history[history_cnt % MAX_HISTORY] = cmd; ++history_cnt; } diff --git a/src/spellchecker.h b/src/spellchecker.h index 8593ff6e63..ed6af5c6e0 100644 --- a/src/spellchecker.h +++ b/src/spellchecker.h @@ -20,14 +20,6 @@ class BufferView; -/** MarkLastWord should only be used immidiately after NextWord(). - If you give control back to the user, you _have_ to call EndOfSpellCheck() - or SelectLastWord(), otherwise segfaults should appear. - */ -//void EndOfSpellCheck(); -/// -//void SelectLastWord(); - /** This function has to be implemented by the spell checker. It will show the spellcheker form*/ void ShowSpellChecker(BufferView *); diff --git a/src/support/DebugStream.h b/src/support/DebugStream.h index efb7c58b22..fd361cd514 100644 --- a/src/support/DebugStream.h +++ b/src/support/DebugStream.h @@ -18,27 +18,19 @@ #include "LOstream.h" +// I don't really like this, but too please doc++...(Lgb) +using std::ostream; + #ifdef TEST_DEBUGSTREAM #include -/// struct Debug { - /// enum type { - /// NONE = 0, - /// INFO = (1 << 0), // 1 - /// WARN = (1 << 1), // 2 - /// CRIT = (1 << 2) // 4 }; - /// static const type ANY = type(INFO | WARN | CRIT); - - /** A function to convert symbolic string names on debug levels - to their numerical value. - */ static Debug::type value(string const & val) { if (val == "NONE") return Debug::NONE; if (val == "INFO") return Debug::INFO; @@ -46,7 +38,6 @@ struct Debug { if (val == "CRIT") return Debug::CRIT; return Debug::NONE; } - }; #endif @@ -87,18 +78,11 @@ struct Debug { debug[Debug::type(Debug::INFO | Debug::CRIT)] << "...info/crit...\n"; */ - +class DebugStream : public ostream +{ // This workaround is needed only for gcc 2.8.1 (and possibly egcs // 1.0.x), which generates a compiler error when subclassing from // std::. (JMarc) -#ifdef CXX_WORKING_NAMESPACES -/// -class DebugStream : public std::ostream -#else -/// -class DebugStream : public ostream -#endif -{ public: /// Constructor, sets the debug level to t. explicit DebugStream(Debug::type t = Debug::NONE); @@ -108,8 +92,8 @@ public: DebugStream(char const * f, Debug::type t = Debug::NONE); /// - virtual ~DebugStream(); - + ~DebugStream(); + /// Sets the debug level to t. void level(Debug::type t) { dt = Debug::type(t & Debug::ANY); diff --git a/src/support/FileInfo.h b/src/support/FileInfo.h index 47802465ba..b2f8caad18 100644 --- a/src/support/FileInfo.h +++ b/src/support/FileInfo.h @@ -24,7 +24,8 @@ #include "LString.h" -/** Use objects of this class to get information about files. */ +/** Use objects of this class to get information about files. + */ class FileInfo { public: /// @@ -90,10 +91,14 @@ public: /// Permission flags enum perm_test { - rperm = R_OK, // test for read permission - wperm = W_OK, // test for write permission - xperm = X_OK, // test for execute (search) permission - eperm = F_OK // test for existence of file + /// test for read permission + rperm = R_OK, + /// test for write permission + wperm = W_OK, + /// test for execute (search) permission + xperm = X_OK, + /// test for existence of file + eperm = F_OK }; /// Test whether the current user has a given set of permissions bool access(int p); @@ -122,7 +127,7 @@ public: /// int getError() const; /// - enum { + enum Err { /// NoErr = -1 }; diff --git a/src/support/LAssert.h b/src/support/LAssert.h index f44f9ceaa2..a62e16b343 100644 --- a/src/support/LAssert.h +++ b/src/support/LAssert.h @@ -10,6 +10,11 @@ extern void emergencySave(); +/** Live assertion. + This is a debug tool to ensure that the assertion holds. If it don't hole + we run #emergencySave()# and then #lyx::abort". + @param assertion this should evaluate to true unless you want an abort. +*/ template inline void Assert(A assertion) @@ -22,6 +27,9 @@ void Assert(A assertion) #else +/** Dummy assertion. + When compiling without assertions we use this no-op function. +*/ template inline void Assert(A /*assertion*/) {} @@ -30,4 +38,3 @@ void Assert(A /*assertion*/) {} //} // end of namespace LyX #endif /* LASSERT_H */ - diff --git a/src/support/LRegex.h b/src/support/LRegex.h index ae1d41b448..6db4f41059 100644 --- a/src/support/LRegex.h +++ b/src/support/LRegex.h @@ -56,20 +56,4 @@ private: Impl * impl; }; - -// We comment out these, we can comment them in when we need them. -#if 0 -// some built in regular expressions - -extern const LRegex LRXwhite; // = "[ \n\t\r\v\f]+" -extern const LRegex LRXint; // = "-?[0-9]+" -extern const LRegex LRXdouble; // = "-?\\(\\([0-9]+\\.[0-9]*\\)\\| - // \\([0-9]+\\)\\|\\(\\.[0-9]+\\)\\) - // \\([eE][---+]?[0-9]+\\)?" -//extern const LRegex LRXalpha; // = "[A-Za-z]+" -//extern const LRegex LRXlowercase; // = "[a-z]+" -//extern const LRegex LRXuppercase; // = "[A-Z]+" -//extern const LRegex LRXalphanum; // = "[0-9A-Za-z]+" -extern const LRegex LRXidentifier; // = "[A-Za-z_][A-Za-z0-9_]*" -#endif #endif diff --git a/src/support/StrPool.h b/src/support/StrPool.h index 826e985841..d97a1f35e0 100644 --- a/src/support/StrPool.h +++ b/src/support/StrPool.h @@ -19,15 +19,18 @@ #include "LString.h" #include +/// class StrPool { public: - // delete all the strings that have been allocated by add() + /// delete all the strings that have been allocated by add() ~StrPool(); - // Make a copy of the string, and remember it in the pool + /// Make a copy of the string, and remember it in the pool char const * add(string const & str); private: + /// typedef std::vector Pool; + /// Pool pool_; }; diff --git a/src/support/block.h b/src/support/block.h index cfb67731bd..87315c5adf 100644 --- a/src/support/block.h +++ b/src/support/block.h @@ -5,34 +5,50 @@ #include "LAssert.h" +/// template class block { public: + /// typedef T value_type; + /// typedef size_t size_type; + /// typedef T * pointer; + /// typedef T const * const_pointer; + /// typedef T & reference; + /// typedef T const & const_reference; + /// typedef T * iterator; + /// typedef T const * const_iterator; + /// size_type size() const { return s; } + /// reference at(int i) { Assert(i >= 0 && i < s); return arr[i]; } + /// const_reference at(int i) const { Assert(i >= 0 && i < s); return arr[i]; } + /// reference operator[](int i) { return arr[i]; } + /// const_reference operator[](int i) const { return arr[i]; } + /// void operator=(block const & b) { Assert(b.size() == size()); for (size_t i = 0; i < size(); ++i) { arr[i] == b[i]; } } + /// bool operator==(block const & b) const { Assert(b.size() == size()); for (size_t i = 0; i < size(); ++i) { @@ -40,11 +56,16 @@ public: } return true; } + /// iterator begin() { return arr[0]; } + /// iterator end() { return arr[s]; } + /// const_iterator begin() const { return arr[0]; } + /// const_iterator end() const { return arr[s]; } private: + /// T arr[s]; }; diff --git a/src/support/filetools.h b/src/support/filetools.h index 2e2aa0060b..289e702e80 100644 --- a/src/support/filetools.h +++ b/src/support/filetools.h @@ -58,7 +58,7 @@ string const FileSearch(string const & path, string const & name, 1: dir writeable 0: not writeable -1: error- couldn't find out, or unsure - */ +*/ int IsDirWriteable (string const & path); /** Is a file readable ? diff --git a/src/support/lstrings.h b/src/support/lstrings.h index eea7fdbf49..1c90c07598 100644 --- a/src/support/lstrings.h +++ b/src/support/lstrings.h @@ -1,8 +1,9 @@ // -*- C++ -*- -/** This is a collection of string helper functions that works - together with string (and later also with STL String. Some of these - would certainly benefit from a rewrite/optimization. +/* + This is a collection of string helper functions that works + together with string (and later also with STL String. Some of these + would certainly benefit from a rewrite/optimization. */ #ifndef LSTRINGS_H @@ -30,22 +31,20 @@ int compare_no_case(string const & s, string const & s2); /// int compare_no_case(string const & s, string const & s2, unsigned int len); - +/// inline int compare(char const * a, char const * b) { return strcmp(a, b); } - - +/// inline int compare(char const * a, char const * b, unsigned int len) { return strncmp(a, b, len); } - /// bool isStrInt(string const & str); @@ -70,7 +69,7 @@ string const lowercase(string const &); /// string const uppercase(string const &); -// convert T to string +/// convert T to string template inline string const tostr(T const & t) @@ -94,6 +93,7 @@ string const tostr(T const & t) #endif } +/// inline string const tostr(bool b) { diff --git a/src/support/lxtl.h b/src/support/lxtl.h index 52f2361a03..c7974f0547 100644 --- a/src/support/lxtl.h +++ b/src/support/lxtl.h @@ -24,16 +24,16 @@ // XDR_format causes an abort that's hard to track down. GDB says the abort // occurs in code from a different function to the one being run before the // abort! (XTL-1.3.pl.11) +/// typedef GIOP_format gui_format; -//@name XTL assistants -//@{ -/** Simplify the use of the XTL. The caller is responsible for creating their +/* Simplify the use of the XTL. The caller is responsible for creating their own memory buffer. The buffer type isn't a template parameter because I need/want the forward declared buffer class in some other header files thereby avoiding an extra file dependency. ARRae 20000423 */ + /// Externalize a structure into a buffer. template void getInMem(Input const & in, auto_mem_buffer & mb) { @@ -50,6 +50,6 @@ void setFromMem(Input & in, auto_mem_buffer & mb) { obj_input input(gf); input.simple(in); } -//@} + #endif diff --git a/src/support/lyxlib.h b/src/support/lyxlib.h index 3933cf0b63..cfde2af5ba 100644 --- a/src/support/lyxlib.h +++ b/src/support/lyxlib.h @@ -20,6 +20,7 @@ // This should have been a namespace #ifdef CXX_WORKING_NAMESPACES +/// namespace lyx { /// char * getcwd(char * buffer, size_t size); @@ -41,6 +42,7 @@ namespace lyx { int putenv(char const * str); } #else +/// struct lyx { /// static char * getcwd(char * buffer, size_t size); diff --git a/src/support/lyxstring.h b/src/support/lyxstring.h index c594ed99b5..d8b0df2cbd 100644 --- a/src/support/lyxstring.h +++ b/src/support/lyxstring.h @@ -33,7 +33,7 @@ #include // for size_t -/* A string class for LyX +/** A string class for LyX This is a permanent String class. It is modeled closely after the C++ STL string class. In comparison with STL string lyxstring lack support for @@ -159,7 +159,7 @@ public: /// #lyxstring x("abc", 2) -> "ab"# lyxstring(value_type const *, size_type n); - /// #lyxstring x("abc")# + // #lyxstring x("abc")# lyxstring(value_type const *); /// lyxstring(5, 'n') -> "nnnnn" diff --git a/src/support/path.h b/src/support/path.h index 2a2dc0b216..d2480670c3 100644 --- a/src/support/path.h +++ b/src/support/path.h @@ -3,15 +3,16 @@ #define PATH_H #include "LString.h" -#include "support/filetools.h" +#include "filetools.h" #include "lyxlib.h" +#include "utility.hpp" #ifdef __GNUG__ #pragma interface #endif /// -class Path { +class Path : public noncopyable { public: /// explicit @@ -50,6 +51,7 @@ private: // Path("/tmp"); // wrong // Path p("/tmp"); // right // we add this macro: +/// #define Path(x) unnamed_Path; // Tip gotten from Bobby Schmidt's column in C/C++ Users Journal diff --git a/src/support/utility.hpp b/src/support/utility.hpp index cdbcb3529e..4ee99278b5 100644 --- a/src/support/utility.hpp +++ b/src/support/utility.hpp @@ -52,14 +52,14 @@ // Contributed by Dave Abrahams - class noncopyable - { - protected: +class noncopyable +{ +protected: noncopyable(){} - private: // emphasize the following members are private +private: // emphasize the following members are private noncopyable( const noncopyable& ); const noncopyable& operator=( const noncopyable& ); - }; // noncopyable +}; // noncopyable //} // namespace boost diff --git a/src/table.h b/src/table.h index 997103a902..68b93307c2 100644 --- a/src/table.h +++ b/src/table.h @@ -26,50 +26,84 @@ class LyXTable { public: // Are the values of these enums important? (Lgb) + /// enum { + /// APPEND_ROW = 0, + /// APPEND_COLUMN = 1, + /// DELETE_ROW = 2, + /// DELETE_COLUMN = 3, + /// TOGGLE_LINE_TOP = 4, + /// TOGGLE_LINE_BOTTOM = 5, + /// TOGGLE_LINE_LEFT = 6, + /// TOGGLE_LINE_RIGHT = 7, + /// ALIGN_LEFT = 8, // what are these alignment enums used for? + /// ALIGN_RIGHT = 9, + /// ALIGN_CENTER = 10, + /// DELETE_TABLE = 11, + /// MULTICOLUMN = 12, + /// SET_ALL_LINES = 13, + /// UNSET_ALL_LINES = 14, + /// SET_LONGTABLE = 15, + /// UNSET_LONGTABLE = 16, + /// SET_PWIDTH = 17, + /// APPEND_CONT_ROW = 18, + /// SET_ROTATE_TABLE = 19, + /// UNSET_ROTATE_TABLE = 20, + /// SET_ROTATE_CELL = 21, + /// UNSET_ROTATE_CELL = 22, + /// SET_LINEBREAKS = 23, + /// SET_LTHEAD = 24, + /// SET_LTFIRSTHEAD = 25, + /// SET_LTFOOT = 26, + /// SET_LTLASTFOOT = 27, + /// SET_LTNEWPAGE = 28, + /// SET_SPECIAL_COLUMN = 29, + /// SET_SPECIAL_MULTI = 30 }; - + /// enum { + /// CELL_NORMAL = 0, + /// CELL_BEGIN_OF_MULTICOLUMN = 1, + /// CELL_PART_OF_MULTICOLUMN = 2 }; /* konstruktor */ /// LyXTable(int columns_arg, int rows_arg); /// - /// LyXTable(LyXTable const &); /// explicit @@ -171,7 +205,7 @@ public: /// void Reinit(); - /// + /// void Init(int columns_arg, int rows_arg); /// @@ -181,9 +215,10 @@ public: /// int Latex(std::ostream &); - // cell <0 will tex the preamble - // returns the number of printed newlines - /// + /** + @param cell < 0 will tex the preamble + @return the number of printed newlines + */ int TexEndOfCell(std::ostream &, int cell); /// int DocBookEndOfCell(std::ostream &, int cell, int & depth); @@ -230,8 +265,9 @@ public: void AppendContRow(int cell); /// bool IsContRow(int cell); - /// returns the number of the cell which continues - /// or -1 if no ContRow + /** + @return number of the cell which coninues or -1 if no ContRow + */ int CellHasContRow(int cell); /// bool RowHasContRow(int cell); @@ -251,8 +287,8 @@ public: void SetLinebreaks(int cell, bool what); /// bool Linebreaks(int cell); - /// - /// Long Table Options + // + // Long Table Options /// void SetLTHead(int cell, bool first); /// @@ -269,9 +305,7 @@ public: void SetLTNewPage(int cell, bool what); /// bool LTNewPage(int cell); - /// - -private: ////////////////////////////////////////////////////////////////// +private: /// struct cellstruct { /// @@ -313,9 +347,13 @@ private: ////////////////////////////////////////////////////////////////// rowstruct & operator=(rowstruct const &); /// bool top_line; + /// bool bottom_line; + /// bool is_cont_row; + /// int ascent_of_row; + /// int descent_of_row; /// This are for longtables only bool newpage; @@ -330,10 +368,15 @@ private: ////////////////////////////////////////////////////////////////// columnstruct & operator=(columnstruct const &); /// int alignment; // add approp. signedness + /// bool left_line; + /// bool right_line; + /// int width_of_column; + /// string p_width; + /// string align_special; }; /// @@ -350,21 +393,25 @@ private: ////////////////////////////////////////////////////////////////// cellstruct ** cell_info; /// int width_of_table; + // + // for long tables + /// row of endhead + int endhead; + /// row of endfirst head + int endfirsthead; + /// row of endfoot + int endfoot; + /// row of endlastfoot + int endlastfoot; /// - /// for long tables - /// - int endhead; // row of endhead - int endfirsthead; // row of endfirsthead - int endfoot; // row of endfoot - int endlastfoot; // row of endlastfoot - /// - void set_row_column_number_info(); /// Returns true if a complete update is necessary, otherwise false bool SetWidthOfMulticolCell(int cell, int new_width); + /// void recalculateMulticolCells(int cell, int new_width); /// Returns true if change bool calculate_width_of_column(int column); + /// bool calculate_width_of_column_NMC(int column); // no multi cells /// void calculate_width_of_table(); diff --git a/src/tabular.h b/src/tabular.h index cb2381ad3c..e3966812c9 100644 --- a/src/tabular.h +++ b/src/tabular.h @@ -30,58 +30,106 @@ class Buffer; /// class LyXTabular { public: - + /// enum { + /// APPEND_ROW = 0, + /// APPEND_COLUMN, + /// DELETE_ROW, + /// DELETE_COLUMN, + /// TOGGLE_LINE_TOP, + /// TOGGLE_LINE_BOTTOM, + /// TOGGLE_LINE_LEFT, + /// TOGGLE_LINE_RIGHT, + /// ALIGN_LEFT, + /// ALIGN_RIGHT, + /// ALIGN_CENTER, + /// VALIGN_TOP, + /// VALIGN_BOTTOM, + /// VALIGN_CENTER, + /// M_TOGGLE_LINE_TOP, + /// M_TOGGLE_LINE_BOTTOM, + /// M_TOGGLE_LINE_LEFT, + /// M_TOGGLE_LINE_RIGHT, + /// M_ALIGN_LEFT, + /// M_ALIGN_RIGHT, + /// M_ALIGN_CENTER, + /// M_VALIGN_TOP, + /// M_VALIGN_BOTTOM, + /// M_VALIGN_CENTER, + /// DELETE_TABULAR, + /// MULTICOLUMN, + /// SET_ALL_LINES, + /// UNSET_ALL_LINES, + /// SET_LONGTABULAR, + /// UNSET_LONGTABULAR, + /// SET_PWIDTH, + /// SET_MPWIDTH, + /// SET_ROTATE_TABULAR, + /// UNSET_ROTATE_TABULAR, + /// SET_ROTATE_CELL, + /// UNSET_ROTATE_CELL, + /// SET_USEBOX, + /// SET_LTHEAD, + /// SET_LTFIRSTHEAD, + /// SET_LTFOOT, + /// SET_LTLASTFOOT, + /// SET_LTNEWPAGE, + /// SET_SPECIAL_COLUMN, + /// SET_SPECIAL_MULTI, + /// LAST_ACTION }; - + /// enum { + /// CELL_NORMAL = 0, + /// CELL_BEGIN_OF_MULTICOLUMN, + /// CELL_PART_OF_MULTICOLUMN }; @@ -99,7 +147,6 @@ public: /// LyXTabular(InsetTabular *, int columns_arg, int rows_arg); /// - /// LyXTabular(InsetTabular *, LyXTabular const &); /// explicit @@ -211,12 +258,15 @@ public: void Read(Buffer const *, LyXLex &); /// void OldFormatRead(LyXLex &, string const &); - /// - /// helper function for Latex returns number of newlines + // + // helper function for Latex returns number of newlines /// int TeXTopHLine(std::ostream &, int row) const; + /// int TeXBottomHLine(std::ostream &, int row) const; + /// int TeXCellPreamble(std::ostream &, int cell) const; + /// int TeXCellPostamble(std::ostream &, int cell) const; /// int Latex(Buffer const *, std::ostream &, bool, bool) const; @@ -273,8 +323,8 @@ public: void SetUsebox(int cell, int what); /// int GetUsebox(int cell) const; - /// - /// Long Tabular Options + // + // Long Tabular Options /// void SetLTHead(int cell, bool first); /// @@ -307,10 +357,10 @@ private: ////////////////////////////////////////////////////////////////// struct cellstruct { /// cellstruct(); - /// #ifdef INSET_POINTER - ~cellstruct(); /// + ~cellstruct(); + // cellstruct(cellstruct const &); /// cellstruct & operator=(cellstruct const &); @@ -333,11 +383,12 @@ private: ////////////////////////////////////////////////////////////////// bool left_line; /// bool right_line; - /// - /// 0 ... don't use a box - /// 1 ... use a parbox - /// 2 ... use a minipage - /// + /** + 0 ... don't use a box + 1 ... use a parbox + 2 ... use a minipage + This should be made into an enum (Lgb) + */ int usebox; /// int rotate; @@ -348,44 +399,57 @@ private: ////////////////////////////////////////////////////////////////// /// InsetText inset; }; + /// typedef std::vector cell_vector; + /// typedef std::vector cell_vvector; /// struct rowstruct { /// rowstruct(); - /// + // //~rowstruct(); - /// + // // rowstruct & operator=(rowstruct const &); /// bool top_line; + /// bool bottom_line; + /// int ascent_of_row; + /// int descent_of_row; /// This are for longtabulars only bool newpage; }; + /// typedef std::vector row_vector; /// struct columnstruct { /// columnstruct(); - /// + // //~columnstruct(); - /// + // //columnstruct & operator=(columnstruct const &); /// int alignment; + /// int valignment; + /// bool left_line; + /// bool right_line; + /// int width_of_column; + /// string p_width; + /// string align_special; }; + /// typedef std::vector column_vector; /// @@ -408,15 +472,18 @@ private: ////////////////////////////////////////////////////////////////// int width_of_tabular; /// int rotate; - /// - /// for long tabulars + // + // for long tabulars /// int is_long_tabular; - /// - int endhead; // row of endhead - int endfirsthead; // row of endfirsthead - int endfoot; // row of endfoot - int endlastfoot; // row of endlastfoot + /// row of endhead + int endhead; + /// row of endfirsthead + int endfirsthead; + /// row of endfoot + int endfoot; + /// row of endlastfoot + int endlastfoot; /// InsetTabular * owner_; @@ -431,6 +498,7 @@ private: ////////////////////////////////////////////////////////////////// void recalculateMulticolCells(int cell, int new_width); /// Returns true if change bool calculate_width_of_column(int column); + /// bool calculate_width_of_column_NMC(int column); // no multi cells /// void calculate_width_of_tabular(); diff --git a/src/tex-strings.h b/src/tex-strings.h index 24e888d873..486f372eab 100644 --- a/src/tex-strings.h +++ b/src/tex-strings.h @@ -37,8 +37,8 @@ extern char const * string_align[]; // used all over. As it happens, that meant that these strings were included // 27 times in the object file. (Asger) -/// -//extern char const * tex_babel[]; +// +// extern char const * tex_babel[]; /// extern char const * tex_graphics[]; diff --git a/src/texrow.C b/src/texrow.C index c223cb6b41..8a1f5b7f4f 100644 --- a/src/texrow.C +++ b/src/texrow.C @@ -21,6 +21,7 @@ #include "debug.h" using std::find_if; +using std::endl; // Delete linked list void TexRow::reset() diff --git a/src/tracer.h b/src/tracer.h index a467efb568..1e2ced161e 100644 --- a/src/tracer.h +++ b/src/tracer.h @@ -19,8 +19,10 @@ #include "debug.h" #include "LString.h" +/// class DebugTracer { public: + /// explicit DebugTracer(string const & s) : str(s) { lyxerr << string(depth, ' ') << "Trace begin : " @@ -28,13 +30,16 @@ public: ++depth; } + /// ~DebugTracer() { --depth; lyxerr << string(depth, ' ') << "Trace end : " << str << std::endl; } private: + /// string str; + /// static int depth; }; diff --git a/src/trans.h b/src/trans.h index 3c7628bd71..9c9f4e2731 100644 --- a/src/trans.h +++ b/src/trans.h @@ -32,14 +32,14 @@ public: on tex-accents. Monostate */ class DefaultTrans : public TransInterface { -private: - /// - static bool init_; public: /// DefaultTrans(); /// virtual string process(char, TransManager &); +private: + /// + static bool init_; }; @@ -95,6 +95,7 @@ private: }; +/// char * Trans::Match(unsigned char c) { return keymap_[c]; diff --git a/src/trans_decl.h b/src/trans_decl.h index e4052f975a..df36f7cb0d 100644 --- a/src/trans_decl.h +++ b/src/trans_decl.h @@ -5,26 +5,33 @@ #include "LString.h" #include "tex-accent.h" +/// struct Keyexc { - char c; /* character to make exception */ - string data; /* exception data */ + /// character to make exception + char c; + /// exception data + string data; Keyexc * next; - bool combined; // Combination with another deadkey - tex_accent accent; // The accent combined with + /// Combination with another deadkey + bool combined; + /// The accent comined with + tex_accent accent; }; /// typedef Keyexc * KmodException; -// -// -// - +/// struct KmodInfo { + /// string data; + /// tex_accent accent; + /// string allowed; - KmodException exception_list; + /// + KmodException exception_list; + /// KmodInfo(); }; diff --git a/src/trans_mgr.h b/src/trans_mgr.h index 1a6917386f..f3abf31c13 100644 --- a/src/trans_mgr.h +++ b/src/trans_mgr.h @@ -61,9 +61,7 @@ public: /// Init State -class TransInitState : - virtual public TransFSMData, - public TransState { +class TransInitState : virtual public TransFSMData, public TransState { public: /// TransInitState(); @@ -77,9 +75,7 @@ public: /// Deadkey State -class TransDeadkeyState : - virtual public TransFSMData, - public TransState { +class TransDeadkeyState : virtual public TransFSMData, public TransState { public: /// TransDeadkeyState(); @@ -96,9 +92,7 @@ public: /// Combined State -class TransCombinedState: - virtual public TransFSMData, - public TransState { +class TransCombinedState : virtual public TransFSMData, public TransState { public: /// TransCombinedState(); @@ -119,12 +113,10 @@ public: /// -class TransFSM : - virtual public TransFSMData, - public TransInitState, - public TransDeadkeyState, - public TransCombinedState -{ +class TransFSM : virtual public TransFSMData, + public TransInitState, + public TransDeadkeyState, + public TransCombinedState { public: /// TransFSM(); diff --git a/src/vc-backend.h b/src/vc-backend.h index 830b055ed9..0e8652763b 100644 --- a/src/vc-backend.h +++ b/src/vc-backend.h @@ -96,7 +96,6 @@ public: virtual void undoLast(); /// virtual void getLog(string const &); -private: }; diff --git a/src/version.h b/src/version.h index 1c7572a9e1..a6982d20d8 100644 --- a/src/version.h +++ b/src/version.h @@ -1,5 +1,8 @@ /* Version and release date definition */ +/// #define LYX_VERSION "1.1.6cvs" +/// #define LYX_RELEASE "Tue, Jun 6, 2000" /* This version string is intended to be used in files created by LyX */ +/// #define LYX_DOCVERSION "LyX 1.1" diff --git a/src/vspace.h b/src/vspace.h index e16f6fe793..fce31b09fd 100644 --- a/src/vspace.h +++ b/src/vspace.h @@ -54,24 +54,19 @@ public: UNIT_NONE }; - //@Man: constructors - //@{ /// LyXLength() : val(0), uni(LyXLength::PT) {} + /// LyXLength(float v, LyXLength::UNIT u) : val(v), uni(u) {} /** "data" must be a decimal number, followed by a unit. */ explicit LyXLength(string const & data); - //@} - //@Man: selectors - //@{ /// float value() const { return val; }; /// LyXLength::UNIT unit() const { return uni; }; - //@} /// conversion virtual string asString() const; @@ -91,7 +86,7 @@ protected: LyXLength::UNIT uni; }; - +/// inline bool operator==(LyXLength const & l1, LyXLength const & l2) { @@ -99,15 +94,14 @@ bool operator==(LyXLength const & l1, LyXLength const & l2) && l1.unit() == l2.unit(); } - +/// extern LyXLength::UNIT unitFromString (string const & data); +/// extern bool isValidLength(string const & data, LyXLength * result); /// LyXGlueLength class class LyXGlueLength : public LyXLength { public: - //@Man: constructors - //@{ /// LyXGlueLength(float v, LyXLength::UNIT u, @@ -127,10 +121,7 @@ public: 4cm plus 10pt minus 10pt */ explicit LyXGlueLength(string const & data); - //@} - //@Man: selectors - //@{ /// float plusValue() const { return plus_val; }; /// @@ -139,7 +130,6 @@ public: float minusValue() const { return minus_val; }; /// LyXLength::UNIT minusUnit() const { return minus_uni; }; - //@} /// conversion virtual string asString() const; @@ -159,7 +149,7 @@ protected: LyXLength::UNIT plus_uni, minus_uni; }; - +/// inline bool operator==(LyXGlueLength const & l1, LyXGlueLength const & l2) { @@ -172,16 +162,29 @@ bool operator==(LyXGlueLength const & l1, LyXGlueLength const & l2) } - +/// extern bool isValidGlueLength(string const & data, LyXGlueLength * result); /// VSpace class class VSpace { public: /// - enum vspace_kind { NONE, DEFSKIP, - SMALLSKIP, MEDSKIP, BIGSKIP, - VFILL, LENGTH }; + enum vspace_kind { + /// + NONE, + /// + DEFSKIP, + /// + SMALLSKIP, + /// + MEDSKIP, + /// + BIGSKIP, + /// + VFILL, + /// + LENGTH + }; /// constructors VSpace() : kin (NONE),