mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-07 17:55:30 +00:00
ws cleanup
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3804 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
8283e978f8
commit
2b8ef58dc0
@ -1,5 +1,7 @@
|
|||||||
2002-03-21 Lars Gullik Bjønnes <larsbj@birdstep.com>
|
2002-03-21 Lars Gullik Bjønnes <larsbj@birdstep.com>
|
||||||
|
|
||||||
|
* most files: ws cleanup
|
||||||
|
|
||||||
* Makefile.am: remove ld -r stuff
|
* Makefile.am: remove ld -r stuff
|
||||||
|
|
||||||
2002-03-20 Lars Gullik Bjønnes <larsbj@birdstep.com>
|
2002-03-20 Lars Gullik Bjønnes <larsbj@birdstep.com>
|
||||||
@ -17,7 +19,7 @@
|
|||||||
|
|
||||||
* math_inset.C (metrics): parameter "mi" is never referenced. Removed.
|
* math_inset.C (metrics): parameter "mi" is never referenced. Removed.
|
||||||
* math_hullinset.C (metrics): ditto.
|
* math_hullinset.C (metrics): ditto.
|
||||||
|
|
||||||
|
|
||||||
2002-03-12 André Pönitz <poenitz@gmx.net>
|
2002-03-12 André Pönitz <poenitz@gmx.net>
|
||||||
|
|
||||||
@ -45,16 +47,16 @@
|
|||||||
|
|
||||||
2002-02-08 Otto Tronarp <otttr440@student.liu.se>
|
2002-02-08 Otto Tronarp <otttr440@student.liu.se>
|
||||||
|
|
||||||
* math_decorationinset.C:
|
* math_decorationinset.C:
|
||||||
|
|
||||||
* math_support.C:
|
* math_support.C:
|
||||||
|
|
||||||
* math_hash.C: Added \underrightarrow and \underleftarrow
|
* math_hash.C: Added \underrightarrow and \underleftarrow
|
||||||
|
|
||||||
2002-02-08 Martin Vermeer <martin.vermeer@hut.fi>
|
2002-02-08 Martin Vermeer <martin.vermeer@hut.fi>
|
||||||
|
|
||||||
* formulabase.C (localDispatch): fix umlaut handling
|
* formulabase.C (localDispatch): fix umlaut handling
|
||||||
|
|
||||||
* formulabase.C: pop up math panel on right mouse click
|
* formulabase.C: pop up math panel on right mouse click
|
||||||
|
|
||||||
2002-02-01 André Pönitz <poenitz@gmx.net>
|
2002-02-01 André Pönitz <poenitz@gmx.net>
|
||||||
@ -101,7 +103,7 @@
|
|||||||
2002-01-10 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
|
2002-01-10 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
|
||||||
|
|
||||||
* math_support.C: change latex_mathfontcmds to an array of
|
* math_support.C: change latex_mathfontcmds to an array of
|
||||||
kb_action.
|
kb_action.
|
||||||
|
|
||||||
2002-01-11 Angus Leeming <a.leeming@ic.ac.uk>
|
2002-01-11 Angus Leeming <a.leeming@ic.ac.uk>
|
||||||
|
|
||||||
@ -128,11 +130,11 @@
|
|||||||
2002-01-09 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
|
2002-01-09 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
|
||||||
|
|
||||||
* math_hullinset.C (validate): rename feature "amsstyle" to
|
* math_hullinset.C (validate): rename feature "amsstyle" to
|
||||||
"amsmath".
|
"amsmath".
|
||||||
|
|
||||||
2002-01-09 Martin Vermeer <martin.vermeer@hut.fi>
|
2002-01-09 Martin Vermeer <martin.vermeer@hut.fi>
|
||||||
|
|
||||||
* math_support.C: modified to support a mathed pop-up for math
|
* math_support.C: modified to support a mathed pop-up for math
|
||||||
size "styles" and font types.
|
size "styles" and font types.
|
||||||
|
|
||||||
2002-01-07 Angus Leeming <a.leeming@ic.ac.uk>
|
2002-01-07 Angus Leeming <a.leeming@ic.ac.uk>
|
||||||
@ -166,7 +168,7 @@
|
|||||||
|
|
||||||
* math_parser.C: user std::fill to fill the catcodes. (please
|
* math_parser.C: user std::fill to fill the catcodes. (please
|
||||||
check this one...), and some consts.
|
check this one...), and some consts.
|
||||||
|
|
||||||
2001-12-11 André Pönitz <poenitz@gmx.net>
|
2001-12-11 André Pönitz <poenitz@gmx.net>
|
||||||
|
|
||||||
* math_cursor.C: allow cut&paste of rectangular regions of cells
|
* math_cursor.C: allow cut&paste of rectangular regions of cells
|
||||||
@ -212,23 +214,23 @@
|
|||||||
* math_symbolinset.C:
|
* math_symbolinset.C:
|
||||||
* math_unknowninset.C: include math_streamstr.h and remove
|
* math_unknowninset.C: include math_streamstr.h and remove
|
||||||
unneeded c_str()
|
unneeded c_str()
|
||||||
|
|
||||||
* math_symbolinset.[Ch]: add constructor taking string
|
* math_symbolinset.[Ch]: add constructor taking string
|
||||||
|
|
||||||
* math_mathmlstream.C: move includes around
|
* math_mathmlstream.C: move includes around
|
||||||
|
|
||||||
* math_streamstr.[Ch]: add operator<<(Stream, string) for
|
* math_streamstr.[Ch]: add operator<<(Stream, string) for
|
||||||
NormalStream, MapleStream, MathMLStream and OctaveStream
|
NormalStream, MapleStream, MathMLStream and OctaveStream
|
||||||
|
|
||||||
* math_gridinset.C: user LyXLength::zero
|
* math_gridinset.C: user LyXLength::zero
|
||||||
|
|
||||||
2001-11-19 Angus Leeming <a.leeming@ic.ac.uk>
|
2001-11-19 Angus Leeming <a.leeming@ic.ac.uk>
|
||||||
|
|
||||||
* formula.C:
|
* formula.C:
|
||||||
* math_arrayinset.C: add using std::getline directive.
|
* math_arrayinset.C: add using std::getline directive.
|
||||||
|
|
||||||
2001-11-20 André Pönitz <poenitz@gmx.net>
|
2001-11-20 André Pönitz <poenitz@gmx.net>
|
||||||
|
|
||||||
* formulabase.C: fix mouse positioning using the cursor
|
* formulabase.C: fix mouse positioning using the cursor
|
||||||
|
|
||||||
2001-11-19 Dekel Tsur <dekelts@tau.ac.il>
|
2001-11-19 Dekel Tsur <dekelts@tau.ac.il>
|
||||||
@ -247,13 +249,13 @@
|
|||||||
|
|
||||||
2001-11-15 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
|
2001-11-15 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
|
||||||
|
|
||||||
* math_extern.C (extractNumber):
|
* math_extern.C (extractNumber):
|
||||||
(extractDiffExponent): add ugly .c_str()
|
(extractDiffExponent): add ugly .c_str()
|
||||||
|
|
||||||
2001-11-08 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
|
2001-11-08 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
|
||||||
|
|
||||||
* math_arrayinset.C (MathArrayInset):
|
* math_arrayinset.C (MathArrayInset):
|
||||||
* formula.C (pipeThroughMaple):
|
* formula.C (pipeThroughMaple):
|
||||||
(pipeThroughOctave): add ugly .c_str() to help compile
|
(pipeThroughOctave): add ugly .c_str() to help compile
|
||||||
with lyxstring
|
with lyxstring
|
||||||
|
|
||||||
@ -281,7 +283,7 @@
|
|||||||
* math_*inset.[Ch]: remove MathStyles cache from insets that
|
* math_*inset.[Ch]: remove MathStyles cache from insets that
|
||||||
don't need it
|
don't need it
|
||||||
|
|
||||||
* support.C:
|
* support.C:
|
||||||
formulabase.C: fix math font sizes in headings etc
|
formulabase.C: fix math font sizes in headings etc
|
||||||
|
|
||||||
* math_inset.[Ch]:
|
* math_inset.[Ch]:
|
||||||
@ -333,7 +335,7 @@
|
|||||||
2001-09-27 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
|
2001-09-27 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
|
||||||
|
|
||||||
* math_cursor.C: fix type mismatches with what was declared in
|
* math_cursor.C: fix type mismatches with what was declared in
|
||||||
math_cursor.h.
|
math_cursor.h.
|
||||||
|
|
||||||
2001-09-28 Dekel Tsur <dekelts@tau.ac.il>
|
2001-09-28 Dekel Tsur <dekelts@tau.ac.il>
|
||||||
|
|
||||||
@ -376,7 +378,7 @@
|
|||||||
'xxalignt', 'gather' and 'multiline' environments
|
'xxalignt', 'gather' and 'multiline' environments
|
||||||
|
|
||||||
* math_cursor.C: fix handling of | and \|
|
* math_cursor.C: fix handling of | and \|
|
||||||
|
|
||||||
2001-09-04 José Matos <jamatos@fep.up.pt>
|
2001-09-04 José Matos <jamatos@fep.up.pt>
|
||||||
|
|
||||||
* formulabase.C
|
* formulabase.C
|
||||||
@ -397,7 +399,7 @@
|
|||||||
2001-08-17 André Pönitz <poenitz@gmx.net>
|
2001-08-17 André Pönitz <poenitz@gmx.net>
|
||||||
|
|
||||||
* math_hash.C: Use std::map instead of faking it
|
* math_hash.C: Use std::map instead of faking it
|
||||||
|
|
||||||
* symbol_def.h: remove unneeded symbol definitions
|
* symbol_def.h: remove unneeded symbol definitions
|
||||||
|
|
||||||
* support.C: use the decorations' name for drawing
|
* support.C: use the decorations' name for drawing
|
||||||
@ -423,7 +425,7 @@
|
|||||||
2001-08-31 Dekel Tsur <dekelts@tau.ac.il>
|
2001-08-31 Dekel Tsur <dekelts@tau.ac.il>
|
||||||
|
|
||||||
* math_hash.C: Read symbols information from external file
|
* math_hash.C: Read symbols information from external file
|
||||||
many files: Add support for latex symbol fonts
|
many files: Add support for latex symbol fonts
|
||||||
|
|
||||||
2001-08-18 Dekel Tsur <dekelts@tau.ac.il>
|
2001-08-18 Dekel Tsur <dekelts@tau.ac.il>
|
||||||
|
|
||||||
@ -489,7 +491,7 @@
|
|||||||
* math_bigopinset.[Ch]: revival for things like \int, \sum
|
* math_bigopinset.[Ch]: revival for things like \int, \sum
|
||||||
|
|
||||||
* math_funcliminset.[Ch]: dedicated new inset for \lim, \max, \min...
|
* math_funcliminset.[Ch]: dedicated new inset for \lim, \max, \min...
|
||||||
|
|
||||||
* math_diminset.h: make cache variables mutable, remove const_cast
|
* math_diminset.h: make cache variables mutable, remove const_cast
|
||||||
|
|
||||||
* formulabase.[Ch]: remove unneeded convertFont()
|
* formulabase.[Ch]: remove unneeded convertFont()
|
||||||
@ -518,7 +520,7 @@
|
|||||||
the width_/ascent_/descent_ cache
|
the width_/ascent_/descent_ cache
|
||||||
|
|
||||||
2001-07-25 André Pönitz <poenitz@gmx.net>
|
2001-07-25 André Pönitz <poenitz@gmx.net>
|
||||||
|
|
||||||
* formulabase.C: re-enable 'space enlargement' feature
|
* formulabase.C: re-enable 'space enlargement' feature
|
||||||
|
|
||||||
* math_scriptinset.C:
|
* math_scriptinset.C:
|
||||||
@ -535,7 +537,7 @@
|
|||||||
* formulabase.C: fix memory leak
|
* formulabase.C: fix memory leak
|
||||||
|
|
||||||
* math_cursor.C: ^ now copies selection into new srriptinset
|
* math_cursor.C: ^ now copies selection into new srriptinset
|
||||||
|
|
||||||
* xarray.C: less crude MathXArray::x2pos for preciser cursor positioning
|
* xarray.C: less crude MathXArray::x2pos for preciser cursor positioning
|
||||||
using the mouse
|
using the mouse
|
||||||
|
|
||||||
@ -586,11 +588,11 @@
|
|||||||
|
|
||||||
* math_updowninset.[hC]: new base class for script and bigop insets
|
* math_updowninset.[hC]: new base class for script and bigop insets
|
||||||
*.[hC]: subsequent changes to all Metric() functions
|
*.[hC]: subsequent changes to all Metric() functions
|
||||||
|
|
||||||
* math_parser.C: small changes (\sqrt0 is read properly now)
|
* math_parser.C: small changes (\sqrt0 is read properly now)
|
||||||
|
|
||||||
2001-07-10 André Pönitz <poenitz@gmx.net>
|
2001-07-10 André Pönitz <poenitz@gmx.net>
|
||||||
|
|
||||||
* math_accentinset.[hC]: rewrite
|
* math_accentinset.[hC]: rewrite
|
||||||
|
|
||||||
* math_parser.C:
|
* math_parser.C:
|
||||||
@ -616,11 +618,11 @@
|
|||||||
2001-07-09 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
|
2001-07-09 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
|
||||||
|
|
||||||
* formulabase.C (mathDispatchInsertMath): remove bogus return
|
* formulabase.C (mathDispatchInsertMath): remove bogus return
|
||||||
statement.
|
statement.
|
||||||
|
|
||||||
2001-07-09 André Pönitz <poenitz@gmx.net>
|
2001-07-09 André Pönitz <poenitz@gmx.net>
|
||||||
|
|
||||||
* math_*inset.C: Change order of arguments in MathInset constructor
|
* math_*inset.C: Change order of arguments in MathInset constructor
|
||||||
|
|
||||||
* math_cursor.C: Remove broken "increase space" feature for a while
|
* math_cursor.C: Remove broken "increase space" feature for a while
|
||||||
|
|
||||||
@ -658,7 +660,7 @@
|
|||||||
|
|
||||||
* *.C: remove all "using namespace std" directives (not
|
* *.C: remove all "using namespace std" directives (not
|
||||||
good!!) and replaced it with relevant "using" directives.
|
good!!) and replaced it with relevant "using" directives.
|
||||||
|
|
||||||
* math_macrotemplate.C (Clone): change return type to MathInset*
|
* math_macrotemplate.C (Clone): change return type to MathInset*
|
||||||
|
|
||||||
2001-06-27 Lars Gullik Bjønnes <larsbj@birdstep.com>
|
2001-06-27 Lars Gullik Bjønnes <larsbj@birdstep.com>
|
||||||
@ -680,7 +682,7 @@
|
|||||||
* math_macrotemplate.C (Write): std:: qualify ostream
|
* math_macrotemplate.C (Write): std:: qualify ostream
|
||||||
|
|
||||||
* math_bigopinset.C (Metrics): std:: qualify max, and include
|
* math_bigopinset.C (Metrics): std:: qualify max, and include
|
||||||
functional
|
functional
|
||||||
|
|
||||||
* math_matrixinset.h: include vector and std:: qualify it.
|
* math_matrixinset.h: include vector and std:: qualify it.
|
||||||
|
|
||||||
@ -697,7 +699,7 @@
|
|||||||
* math_cursor.C (Right): Fixes for cursor movement.
|
* math_cursor.C (Right): Fixes for cursor movement.
|
||||||
|
|
||||||
* formula.C (draw): New background color for math.
|
* formula.C (draw): New background color for math.
|
||||||
|
|
||||||
* math_cursor.C: Fixes for toggling labels on/off in math.
|
* math_cursor.C: Fixes for toggling labels on/off in math.
|
||||||
Fixes for infinity and other symbols that didn't appear in
|
Fixes for infinity and other symbols that didn't appear in
|
||||||
LaTeX.
|
LaTeX.
|
||||||
@ -720,7 +722,7 @@
|
|||||||
|
|
||||||
* math_cursor.C: Cursor improvements after a few dead-ends
|
* math_cursor.C: Cursor improvements after a few dead-ends
|
||||||
in the evolution of cursor movement were tested and scrapped.
|
in the evolution of cursor movement were tested and scrapped.
|
||||||
|
|
||||||
2001-06-24 The LyX Project <Asger>
|
2001-06-24 The LyX Project <Asger>
|
||||||
|
|
||||||
* math_cursor.C: Renamed stack to path.
|
* math_cursor.C: Renamed stack to path.
|
||||||
@ -769,7 +771,7 @@
|
|||||||
declared in std:: namespace.
|
declared in std:: namespace.
|
||||||
|
|
||||||
* math_macrotemplate.h: do not use explicitely std::string, but
|
* math_macrotemplate.h: do not use explicitely std::string, but
|
||||||
string.
|
string.
|
||||||
|
|
||||||
* math_macroarg.C: avoid bringing the whole std:: namespace in
|
* math_macroarg.C: avoid bringing the whole std:: namespace in
|
||||||
global-land. When you do that, there is an ambiguity between
|
global-land. When you do that, there is an ambiguity between
|
||||||
@ -800,7 +802,7 @@
|
|||||||
* math_macro.[Ch]:
|
* math_macro.[Ch]:
|
||||||
* math_macrotable.[Ch]:
|
* math_macrotable.[Ch]:
|
||||||
* math_macroarg.[Ch]: restructuring of macro handling
|
* math_macroarg.[Ch]: restructuring of macro handling
|
||||||
* several files:
|
* several files:
|
||||||
|
|
||||||
2001-04-25 Angus Leeming <a.leeming@ic.ac.uk>
|
2001-04-25 Angus Leeming <a.leeming@ic.ac.uk>
|
||||||
|
|
||||||
@ -826,8 +828,8 @@
|
|||||||
|
|
||||||
2001-04-16 Allan Rae <rae@lyx.org>
|
2001-04-16 Allan Rae <rae@lyx.org>
|
||||||
|
|
||||||
* formula.C (Latex, getLabelList, LocalDispatch):
|
* formula.C (Latex, getLabelList, LocalDispatch):
|
||||||
* math_parser.C (mathed_parse):
|
* math_parser.C (mathed_parse):
|
||||||
* math_parinset.C (Write): #warning triggers an error on Sun CC 6.0 as
|
* math_parinset.C (Write): #warning triggers an error on Sun CC 6.0 as
|
||||||
an unrecognised preprocessor directive. So ensure they're wrapped.
|
an unrecognised preprocessor directive. So ensure they're wrapped.
|
||||||
|
|
||||||
@ -849,7 +851,7 @@
|
|||||||
* math_matrixinset.h:
|
* math_matrixinset.h:
|
||||||
* math_parinset.[Ch]:
|
* math_parinset.[Ch]:
|
||||||
* math_rowst.[Ch]: move MathedRowContainer::row_ to the base
|
* math_rowst.[Ch]: move MathedRowContainer::row_ to the base
|
||||||
|
|
||||||
2001-03-13 John Levon <moz@compsoc.man.ac.uk>
|
2001-03-13 John Levon <moz@compsoc.man.ac.uk>
|
||||||
|
|
||||||
* Makefile.am:
|
* Makefile.am:
|
||||||
@ -918,7 +920,7 @@
|
|||||||
|
|
||||||
2001-03-08 André Pönitz <poenitz@gmx.net>
|
2001-03-08 André Pönitz <poenitz@gmx.net>
|
||||||
|
|
||||||
* math_rowst.h: give MathedRowContainer an 'insert' method.
|
* math_rowst.h: give MathedRowContainer an 'insert' method.
|
||||||
|
|
||||||
* math_xiter.C: new 'container()' method to encapsulated access to
|
* math_xiter.C: new 'container()' method to encapsulated access to
|
||||||
the MathParInset's MathedRowContainer
|
the MathParInset's MathedRowContainer
|
||||||
@ -928,13 +930,13 @@
|
|||||||
|
|
||||||
* math_matrixinset.[hC]: remove copy constructr and destructor. Those
|
* math_matrixinset.[hC]: remove copy constructr and destructor. Those
|
||||||
automatically created by the compiler are ok now.
|
automatically created by the compiler are ok now.
|
||||||
|
|
||||||
2001-03-06 André Pönitz <poenitz@gmx.net>
|
2001-03-06 André Pönitz <poenitz@gmx.net>
|
||||||
|
|
||||||
* array.[Ch]: factor out deep_copy,
|
* array.[Ch]: factor out deep_copy,
|
||||||
remove third argument from raw_pointer_insert
|
remove third argument from raw_pointer_insert
|
||||||
|
|
||||||
* math_iter.[Ch]: remove unused function Clear()
|
* math_iter.[Ch]: remove unused function Clear()
|
||||||
|
|
||||||
* math_cursor.C: change signature of MathStackXIter:push()
|
* math_cursor.C: change signature of MathStackXIter:push()
|
||||||
whitespace changes
|
whitespace changes
|
||||||
@ -1002,7 +1004,7 @@
|
|||||||
shared_ptr, let constructor take a shared_ptr
|
shared_ptr, let constructor take a shared_ptr
|
||||||
|
|
||||||
* math_macro.C (MathMacro): take shared_ptr as arg, remove double
|
* math_macro.C (MathMacro): take shared_ptr as arg, remove double
|
||||||
initialization.
|
initialization.
|
||||||
(draw): remove unneded update, remove removed update of x,y
|
(draw): remove unneded update, remove removed update of x,y
|
||||||
(GetXY): call tmplates GetMacroXY directly
|
(GetXY): call tmplates GetMacroXY directly
|
||||||
(SetFocus): call Metrics() instead of update()
|
(SetFocus): call Metrics() instead of update()
|
||||||
@ -1022,7 +1024,7 @@
|
|||||||
|
|
||||||
* math_cursor.C: changes because of the above
|
* math_cursor.C: changes because of the above
|
||||||
* math_parser.C: changes because of the abobe
|
* math_parser.C: changes because of the abobe
|
||||||
|
|
||||||
* formulamacro.h: change tmacro_ to be a shared_ptr, remove
|
* formulamacro.h: change tmacro_ to be a shared_ptr, remove
|
||||||
default arg on constructor.
|
default arg on constructor.
|
||||||
* formulamacro.C: changes because of the above
|
* formulamacro.C: changes because of the above
|
||||||
@ -1109,7 +1111,7 @@
|
|||||||
(~MathFuncInset): remove
|
(~MathFuncInset): remove
|
||||||
|
|
||||||
* math_fracinset.h: make MathParInset den_ a real object and not a
|
* math_fracinset.h: make MathParInset den_ a real object and not a
|
||||||
pointer.
|
pointer.
|
||||||
|
|
||||||
* math_fracinset.C (MathFracInset): clean up, move initalization
|
* math_fracinset.C (MathFracInset): clean up, move initalization
|
||||||
to initialization list
|
to initialization list
|
||||||
@ -1117,7 +1119,7 @@
|
|||||||
(Clone): remove leak
|
(Clone): remove leak
|
||||||
|
|
||||||
* math_draw.C: delete file
|
* math_draw.C: delete file
|
||||||
|
|
||||||
* math_dotsinset.[Ch]: add pragma
|
* math_dotsinset.[Ch]: add pragma
|
||||||
|
|
||||||
* math_bigopinset.h: make protected variables private add '_' to vars.
|
* math_bigopinset.h: make protected variables private add '_' to vars.
|
||||||
@ -1146,14 +1148,14 @@
|
|||||||
* math_macroarg.C (MathMacroArgument): delete
|
* math_macroarg.C (MathMacroArgument): delete
|
||||||
* math_macro.C (~MathMacro): delete
|
* math_macro.C (~MathMacro): delete
|
||||||
* math_macrotemplate.C (~MathMacroTemplate): delete
|
* math_macrotemplate.C (~MathMacroTemplate): delete
|
||||||
|
|
||||||
* math_decorationinset.[Ch]: add pragma
|
* math_decorationinset.[Ch]: add pragma
|
||||||
* math_deliminset.[Ch]: likewise
|
* math_deliminset.[Ch]: likewise
|
||||||
* math_fracinset.[Ch]: likewise
|
* math_fracinset.[Ch]: likewise
|
||||||
* math_macroarg.[Ch]: likewise
|
* math_macroarg.[Ch]: likewise
|
||||||
* math_macrotemplate.[Ch]: likewise
|
* math_macrotemplate.[Ch]: likewise
|
||||||
* math_matrixinset.[Ch]: likewise
|
* math_matrixinset.[Ch]: likewise
|
||||||
|
|
||||||
* formulamacro.C (Read): set contents of tmacro_ to ar.
|
* formulamacro.C (Read): set contents of tmacro_ to ar.
|
||||||
|
|
||||||
* formulamacro.h: add '_' to private variables.
|
* formulamacro.h: add '_' to private variables.
|
||||||
@ -1174,7 +1176,7 @@
|
|||||||
* move MathIter::Copy(int, int) to MathArray::shrink(pos, pos)
|
* move MathIter::Copy(int, int) to MathArray::shrink(pos, pos)
|
||||||
|
|
||||||
* several files: subsequent changes
|
* several files: subsequent changes
|
||||||
|
|
||||||
* math_cursor.C: make selarray a proper MathArray
|
* math_cursor.C: make selarray a proper MathArray
|
||||||
|
|
||||||
* several files: Change "MathedArray *" to "MathedArray &"
|
* several files: Change "MathedArray *" to "MathedArray &"
|
||||||
@ -1187,7 +1189,7 @@
|
|||||||
2001-02-14 André Pönitz <poenitz@gmx.net>
|
2001-02-14 André Pönitz <poenitz@gmx.net>
|
||||||
|
|
||||||
* array.[Ch]: "deep" copy constructor and assignment operator for
|
* array.[Ch]: "deep" copy constructor and assignment operator for
|
||||||
MathArray
|
MathArray
|
||||||
|
|
||||||
* math_iter.[Ch]: seperate Copy() from Copy(int, int)
|
* math_iter.[Ch]: seperate Copy() from Copy(int, int)
|
||||||
|
|
||||||
@ -1197,7 +1199,7 @@
|
|||||||
2001-02-14 André Pönitz <poenitz@gmx.net>
|
2001-02-14 André Pönitz <poenitz@gmx.net>
|
||||||
|
|
||||||
* array.[Ch]: remove constructor and enums ARRAY_MIN_SIZE and
|
* array.[Ch]: remove constructor and enums ARRAY_MIN_SIZE and
|
||||||
ARRAY_STEP
|
ARRAY_STEP
|
||||||
|
|
||||||
* math_iter.C: default-construct and resize array
|
* math_iter.C: default-construct and resize array
|
||||||
|
|
||||||
@ -1211,7 +1213,7 @@
|
|||||||
of private variables.
|
of private variables.
|
||||||
|
|
||||||
* changes to several files because of the above.
|
* changes to several files because of the above.
|
||||||
|
|
||||||
2001-02-14 André Pönitz <poenitz@gmx.net>
|
2001-02-14 André Pönitz <poenitz@gmx.net>
|
||||||
|
|
||||||
* math_iter.[Ch]: hide fcode_
|
* math_iter.[Ch]: hide fcode_
|
||||||
@ -1230,7 +1232,7 @@
|
|||||||
|
|
||||||
* move funcs to more localized files, more general cleanup.
|
* move funcs to more localized files, more general cleanup.
|
||||||
Constify several local vars. Doxygen changes. Formatting.
|
Constify several local vars. Doxygen changes. Formatting.
|
||||||
|
|
||||||
2001-02-15 Lars Gullik Bjønnes <larsbj@lyx.org>
|
2001-02-15 Lars Gullik Bjønnes <larsbj@lyx.org>
|
||||||
|
|
||||||
* support.C: add some consts
|
* support.C: add some consts
|
||||||
@ -1242,7 +1244,7 @@
|
|||||||
|
|
||||||
2001-02-14 André Pönitz <poenitz@gmx.net>
|
2001-02-14 André Pönitz <poenitz@gmx.net>
|
||||||
|
|
||||||
* formula.C: reformatting
|
* formula.C: reformatting
|
||||||
|
|
||||||
* math_cursor.[Ch]:
|
* math_cursor.[Ch]:
|
||||||
math_iter.[Ch]:
|
math_iter.[Ch]:
|
||||||
@ -1250,44 +1252,44 @@
|
|||||||
|
|
||||||
2001-02-14 Lars Gullik Bjønnes <larsbj@lyx.org>
|
2001-02-14 Lars Gullik Bjønnes <larsbj@lyx.org>
|
||||||
|
|
||||||
* math_parser.C:
|
* math_parser.C:
|
||||||
* math_panel.C:
|
* math_panel.C:
|
||||||
* formula.C: remove cruft
|
* formula.C: remove cruft
|
||||||
|
|
||||||
* array.C (begin): new method
|
* array.C (begin): new method
|
||||||
(end): ditto
|
(end): ditto
|
||||||
|
|
||||||
2001-02-14 André Pönitz <poenitz@gmx.net>
|
2001-02-14 André Pönitz <poenitz@gmx.net>
|
||||||
|
|
||||||
* math_iter.[Ch]: remove 'insert', 'maxsize' and 'ARRAY_SIZE'
|
* math_iter.[Ch]: remove 'insert', 'maxsize' and 'ARRAY_SIZE'
|
||||||
|
|
||||||
* math_cursor.C: reformatting
|
* math_cursor.C: reformatting
|
||||||
|
|
||||||
2001-02-14 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
|
2001-02-14 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
|
||||||
|
|
||||||
* math_spaceinset.C:
|
* math_spaceinset.C:
|
||||||
* math_root.C:
|
* math_root.C:
|
||||||
* math_matrixinset.C:
|
* math_matrixinset.C:
|
||||||
* math_macrotemplate.C:
|
* math_macrotemplate.C:
|
||||||
* math_funcinset.C:
|
* math_funcinset.C:
|
||||||
* math_fracinset.C:
|
* math_fracinset.C:
|
||||||
* math_dotsinset.C:
|
* math_dotsinset.C:
|
||||||
* math_deliminset.C:
|
* math_deliminset.C:
|
||||||
* math_decorationinset.C:
|
* math_decorationinset.C:
|
||||||
* math_bigopinset.C:
|
* math_bigopinset.C:
|
||||||
* math_accentinset.C:
|
* math_accentinset.C:
|
||||||
* math_sqrtinset.C: include LOstream.h and add using directive.
|
* math_sqrtinset.C: include LOstream.h and add using directive.
|
||||||
|
|
||||||
2001-02-14 André Pönitz <poenitz@gmx.net>
|
2001-02-14 André Pönitz <poenitz@gmx.net>
|
||||||
|
|
||||||
* math_iter.C: reformatting
|
* math_iter.C: reformatting
|
||||||
|
|
||||||
2001-02-13 Lars Gullik Bjønnes <larsbj@lyx.org>
|
2001-02-13 Lars Gullik Bjønnes <larsbj@lyx.org>
|
||||||
|
|
||||||
* math_spaceinset.C (GetSpace): move here
|
* math_spaceinset.C (GetSpace): move here
|
||||||
|
|
||||||
* math_parinset.C: add debug.h, move several prev. inlined methods
|
* math_parinset.C: add debug.h, move several prev. inlined methods
|
||||||
here.
|
here.
|
||||||
|
|
||||||
* math_macrotable.C math_xiter.C support.C: add debug.h
|
* math_macrotable.C math_xiter.C support.C: add debug.h
|
||||||
|
|
||||||
@ -1347,28 +1349,28 @@
|
|||||||
2001-02-13 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
|
2001-02-13 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
|
||||||
|
|
||||||
* Makefile.am (libmathed_la_SOURCES): remove duplicate
|
* Makefile.am (libmathed_la_SOURCES): remove duplicate
|
||||||
math_sqrtinset.
|
math_sqrtinset.
|
||||||
|
|
||||||
* support.C:
|
* support.C:
|
||||||
* math_xiter.C:
|
* math_xiter.C:
|
||||||
* math_parinset.C: add a bunch of "using" directives.
|
* math_parinset.C: add a bunch of "using" directives.
|
||||||
|
|
||||||
* math_funcinset.h:
|
* math_funcinset.h:
|
||||||
* math_decorationinset.h:
|
* math_decorationinset.h:
|
||||||
* math_bigopinset.h:
|
* math_bigopinset.h:
|
||||||
* math_spaceinset.h: remove more couples of inline.
|
* math_spaceinset.h: remove more couples of inline.
|
||||||
|
|
||||||
2001-02-13 Lars Gullik Bjønnes <larsbj@lyx.org>
|
2001-02-13 Lars Gullik Bjønnes <larsbj@lyx.org>
|
||||||
|
|
||||||
* math_xiter.h: remove a couple of "inline"
|
* math_xiter.h: remove a couple of "inline"
|
||||||
|
|
||||||
* array.C (strange_copy): fix bug (hopefully)
|
* array.C (strange_copy): fix bug (hopefully)
|
||||||
* many files: add a lot of new files and move methods to the class
|
* many files: add a lot of new files and move methods to the class
|
||||||
files they belong to. Only first attempt at cleanup more will
|
files they belong to. Only first attempt at cleanup more will
|
||||||
follow.
|
follow.
|
||||||
|
|
||||||
2001-02-12 André Pönitz <poenitz@gmx.net>
|
2001-02-12 André Pönitz <poenitz@gmx.net>
|
||||||
|
|
||||||
* math_macro.[hC]: replace MathMacroArgument[] with
|
* math_macro.[hC]: replace MathMacroArgument[] with
|
||||||
std::vector<MathMacroArgument>
|
std::vector<MathMacroArgument>
|
||||||
* math_defs.h:
|
* math_defs.h:
|
||||||
@ -1376,7 +1378,7 @@
|
|||||||
* math_panel.h:
|
* math_panel.h:
|
||||||
* math_symbols.C: replace FL_OBJECTP[] with
|
* math_symbols.C: replace FL_OBJECTP[] with
|
||||||
std::vector<FL_OBJECT*>
|
std::vector<FL_OBJECT*>
|
||||||
|
|
||||||
2001-02-12 Lars Gullik Bjønnes <larsbj@lyx.org>
|
2001-02-12 Lars Gullik Bjønnes <larsbj@lyx.org>
|
||||||
|
|
||||||
* math_defs.h (struct MathedRowSt): make all private variables end
|
* math_defs.h (struct MathedRowSt): make all private variables end
|
||||||
@ -1392,7 +1394,7 @@
|
|||||||
environment.
|
environment.
|
||||||
|
|
||||||
2001-02-12 André Pönitz <poenitz@gmx.net>
|
2001-02-12 André Pönitz <poenitz@gmx.net>
|
||||||
|
|
||||||
* array.[hC]: replace private variable maxsize_ with call to
|
* array.[hC]: replace private variable maxsize_ with call to
|
||||||
bf_.size()
|
bf_.size()
|
||||||
* math_defs.h: replace int[] by std::vector<int> for
|
* math_defs.h: replace int[] by std::vector<int> for
|
||||||
@ -1406,11 +1408,11 @@
|
|||||||
changed name from LyxArrayBase to MathedArray.
|
changed name from LyxArrayBase to MathedArray.
|
||||||
changed name of some methods to start with lowerchar.
|
changed name of some methods to start with lowerchar.
|
||||||
moved inline methods to array.C
|
moved inline methods to array.C
|
||||||
|
|
||||||
* math_iter.C + several file: changes because of the above.
|
* math_iter.C + several file: changes because of the above.
|
||||||
|
|
||||||
* array.C: new file with the prev inline methods.
|
* array.C: new file with the prev inline methods.
|
||||||
|
|
||||||
2001-02-10 Dekel Tsur <dekelts@tau.ac.il>
|
2001-02-10 Dekel Tsur <dekelts@tau.ac.il>
|
||||||
|
|
||||||
* Many files: add support for the align environment from amsmath.
|
* Many files: add support for the align environment from amsmath.
|
||||||
@ -1418,7 +1420,7 @@
|
|||||||
2001-02-09 André Pönitz <poenitz@gmx.net>
|
2001-02-09 André Pönitz <poenitz@gmx.net>
|
||||||
|
|
||||||
* array.h: replace array buffer 'byte bf[]' by 'std::vector<byte> bf'
|
* array.h: replace array buffer 'byte bf[]' by 'std::vector<byte> bf'
|
||||||
* several files: subsequent changes
|
* several files: subsequent changes
|
||||||
* math_iter.h: remove unused prototype
|
* math_iter.h: remove unused prototype
|
||||||
* array.h: ditto.
|
* array.h: ditto.
|
||||||
|
|
||||||
@ -1439,7 +1441,7 @@
|
|||||||
|
|
||||||
2001-02-02 Dekel Tsur <dekelts@tau.ac.il>
|
2001-02-02 Dekel Tsur <dekelts@tau.ac.il>
|
||||||
|
|
||||||
* Many files: Add support for multline and alignat environments from
|
* Many files: Add support for multline and alignat environments from
|
||||||
amsmath.
|
amsmath.
|
||||||
|
|
||||||
2001-02-02 Dekel Tsur <dekelts@tau.ac.il>
|
2001-02-02 Dekel Tsur <dekelts@tau.ac.il>
|
||||||
@ -1459,4 +1461,3 @@
|
|||||||
2001-01-15 Dekel Tsur <dekelts@tau.ac.il>
|
2001-01-15 Dekel Tsur <dekelts@tau.ac.il>
|
||||||
|
|
||||||
* math_draw.C (Metrics): Use the correct GetString.
|
* math_draw.C (Metrics): Use the correct GetString.
|
||||||
|
|
||||||
|
@ -92,7 +92,7 @@ namespace {
|
|||||||
"eval(`latex/latex/*`)):\n";
|
"eval(`latex/latex/*`)):\n";
|
||||||
|
|
||||||
// remove spurious \\noalign{\\medskip} in matrix output
|
// remove spurious \\noalign{\\medskip} in matrix output
|
||||||
header +=
|
header +=
|
||||||
"`latex/latex/matrix`:= "
|
"`latex/latex/matrix`:= "
|
||||||
"subs(`\\\\\\\\\\\\noalign{\\\\medskip}` = `\\\\\\\\`,"
|
"subs(`\\\\\\\\\\\\noalign{\\\\medskip}` = `\\\\\\\\`,"
|
||||||
"eval(`latex/latex/matrix`)):\n";
|
"eval(`latex/latex/matrix`)):\n";
|
||||||
@ -111,7 +111,7 @@ namespace {
|
|||||||
//
|
//
|
||||||
// ... > echo "1A;" | mint -i 1 -S -s -q
|
// ... > echo "1A;" | mint -i 1 -S -s -q
|
||||||
// on line 1: 1A;
|
// on line 1: 1A;
|
||||||
// ^ syntax error -
|
// ^ syntax error -
|
||||||
// Probably missing an operator such as * p
|
// Probably missing an operator such as * p
|
||||||
//
|
//
|
||||||
lyxerr << "checking expr: '" << expr << "'\n";
|
lyxerr << "checking expr: '" << expr << "'\n";
|
||||||
@ -143,8 +143,8 @@ namespace {
|
|||||||
mathed_parse_cell(res, out);
|
mathed_parse_cell(res, out);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
MathArray pipeThroughOctave(string const &, MathArray const & ar)
|
MathArray pipeThroughOctave(string const &, MathArray const & ar)
|
||||||
{
|
{
|
||||||
ostringstream os;
|
ostringstream os;
|
||||||
@ -155,13 +155,13 @@ namespace {
|
|||||||
|
|
||||||
for (int i = 0; i < 100; ++i) { // at most 100 attempts
|
for (int i = 0; i < 100; ++i) { // at most 100 attempts
|
||||||
//
|
//
|
||||||
// try to fix missing '*' the hard way
|
// try to fix missing '*' the hard way
|
||||||
// parse error:
|
// parse error:
|
||||||
// >>> ([[1 2 3 ];[2 3 1 ];[3 1 2 ]])([[1 2 3 ];[2 3 1 ];[3 1 2 ]])
|
// >>> ([[1 2 3 ];[2 3 1 ];[3 1 2 ]])([[1 2 3 ];[2 3 1 ];[3 1 2 ]])
|
||||||
// ^
|
// ^
|
||||||
//
|
//
|
||||||
lyxerr << "checking expr: '" << expr << "'\n";
|
lyxerr << "checking expr: '" << expr << "'\n";
|
||||||
out = captureOutput("octave -q 2>&1", expr);
|
out = captureOutput("octave -q 2>&1", expr);
|
||||||
lyxerr << "checking out: '" << out << "'\n";
|
lyxerr << "checking out: '" << out << "'\n";
|
||||||
|
|
||||||
// leave loop if expression syntax is probably ok
|
// leave loop if expression syntax is probably ok
|
||||||
@ -234,7 +234,7 @@ namespace {
|
|||||||
lyxerr << "converter to '" << lang << "' not found\n";
|
lyxerr << "converter to '" << lang << "' not found\n";
|
||||||
return MathArray();
|
return MathArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
// run external sript
|
// run external sript
|
||||||
string out = captureOutput(file, data);
|
string out = captureOutput(file, data);
|
||||||
MathArray res;
|
MathArray res;
|
||||||
@ -255,7 +255,7 @@ InsetFormula::InsetFormula(MathInsetTypes t)
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
InsetFormula::InsetFormula(string const & s)
|
InsetFormula::InsetFormula(string const & s)
|
||||||
{
|
{
|
||||||
if (s.size()) {
|
if (s.size()) {
|
||||||
bool res = mathed_parse_normal(par_, s);
|
bool res = mathed_parse_normal(par_, s);
|
||||||
@ -388,7 +388,7 @@ InsetFormula::localDispatch(BufferView * bv, kb_action action,
|
|||||||
|
|
||||||
switch (action) {
|
switch (action) {
|
||||||
|
|
||||||
case LFUN_BREAKLINE:
|
case LFUN_BREAKLINE:
|
||||||
bv->lockedInsetStoreUndo(Undo::INSERT);
|
bv->lockedInsetStoreUndo(Undo::INSERT);
|
||||||
mathcursor->breakLine();
|
mathcursor->breakLine();
|
||||||
mathcursor->normalize();
|
mathcursor->normalize();
|
||||||
@ -496,11 +496,11 @@ InsetFormula::localDispatch(BufferView * bv, kb_action action,
|
|||||||
updateLocal(bv, true);
|
updateLocal(bv, true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case LFUN_PASTESELECTION:
|
case LFUN_PASTESELECTION:
|
||||||
{
|
{
|
||||||
string const clip = bv->getClipboard();
|
string const clip = bv->getClipboard();
|
||||||
if (!clip.empty())
|
if (!clip.empty())
|
||||||
mathed_parse_normal(par_, clip);
|
mathed_parse_normal(par_, clip);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -523,14 +523,14 @@ void InsetFormula::handleExtern(const string & arg)
|
|||||||
{
|
{
|
||||||
// where are we?
|
// where are we?
|
||||||
if (!mathcursor)
|
if (!mathcursor)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
string lang;
|
string lang;
|
||||||
string extra;
|
string extra;
|
||||||
istringstream iss(arg.c_str());
|
istringstream iss(arg.c_str());
|
||||||
iss >> lang >> extra;
|
iss >> lang >> extra;
|
||||||
if (extra.empty())
|
if (extra.empty())
|
||||||
extra = "noextra";
|
extra = "noextra";
|
||||||
|
|
||||||
bool selected = mathcursor->selection();
|
bool selected = mathcursor->selection();
|
||||||
|
|
||||||
@ -588,9 +588,9 @@ void InsetFormula::validate(LaTeXFeatures & features) const
|
|||||||
|
|
||||||
bool InsetFormula::insetAllowed(Inset::Code code) const
|
bool InsetFormula::insetAllowed(Inset::Code code) const
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
(code == Inset::LABEL_CODE && display())
|
(code == Inset::LABEL_CODE && display())
|
||||||
|| code == Inset::ERT_CODE;
|
|| code == Inset::ERT_CODE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -2,9 +2,9 @@
|
|||||||
/*
|
/*
|
||||||
* File: formula.h
|
* File: formula.h
|
||||||
* Purpose: Declaration of formula inset
|
* Purpose: Declaration of formula inset
|
||||||
* Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
|
* Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
|
||||||
* Created: January 1996
|
* Created: January 1996
|
||||||
* Description: Allows the edition of math paragraphs inside Lyx.
|
* Description: Allows the edition of math paragraphs inside Lyx.
|
||||||
*
|
*
|
||||||
* Copyright: 1996, Alejandro Aguilar Sierra
|
* Copyright: 1996, Alejandro Aguilar Sierra
|
||||||
*
|
*
|
||||||
@ -14,7 +14,7 @@
|
|||||||
* the GNU General Public Licence version 2 or later.
|
* the GNU General Public Licence version 2 or later.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef INSET_FORMULA_H
|
#ifndef INSET_FORMULA_H
|
||||||
#define INSET_FORMULA_H
|
#define INSET_FORMULA_H
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
|
@ -70,7 +70,7 @@ int hack_y;
|
|||||||
int hack_button;
|
int hack_button;
|
||||||
|
|
||||||
|
|
||||||
void handleFont(BufferView * bv, string const & arg, MathTextCodes t)
|
void handleFont(BufferView * bv, string const & arg, MathTextCodes t)
|
||||||
{
|
{
|
||||||
if (mathcursor->selection())
|
if (mathcursor->selection())
|
||||||
bv->lockedInsetStoreUndo(Undo::EDIT);
|
bv->lockedInsetStoreUndo(Undo::EDIT);
|
||||||
@ -133,14 +133,14 @@ void InsetFormulaBase::validate(LaTeXFeatures &) const
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
void InsetFormulaBase::metrics(BufferView * bv, LyXFont const & f) const
|
void InsetFormulaBase::metrics(BufferView * bv, LyXFont const & f) const
|
||||||
{
|
{
|
||||||
font_ = f;
|
font_ = f;
|
||||||
metrics(bv);
|
metrics(bv);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void InsetFormulaBase::metrics(BufferView * bv) const
|
void InsetFormulaBase::metrics(BufferView * bv) const
|
||||||
{
|
{
|
||||||
if (bv)
|
if (bv)
|
||||||
view_ = bv;
|
view_ = bv;
|
||||||
@ -279,7 +279,7 @@ void InsetFormulaBase::updateLocal(BufferView * bv, bool dirty)
|
|||||||
|
|
||||||
|
|
||||||
bool InsetFormulaBase::insetButtonRelease(BufferView * bv,
|
bool InsetFormulaBase::insetButtonRelease(BufferView * bv,
|
||||||
int /*x*/, int /*y*/, int /*button*/)
|
int /*x*/, int /*y*/, int /*button*/)
|
||||||
{
|
{
|
||||||
if (!mathcursor)
|
if (!mathcursor)
|
||||||
return false;
|
return false;
|
||||||
@ -328,7 +328,7 @@ void InsetFormulaBase::insetButtonPress(BufferView * bv,
|
|||||||
bv->getLyXText()->selectionAsString(bv->buffer(), false);
|
bv->getLyXText()->selectionAsString(bv->buffer(), false);
|
||||||
mathed_parse_cell(ar, sel);
|
mathed_parse_cell(ar, sel);
|
||||||
mathcursor->insert(ar);
|
mathcursor->insert(ar);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
*/
|
*/
|
||||||
case 3:
|
case 3:
|
||||||
@ -353,9 +353,9 @@ void InsetFormulaBase::insetMotionNotify(BufferView * bv,
|
|||||||
first_x = x;
|
first_x = x;
|
||||||
first_y = y;
|
first_y = y;
|
||||||
|
|
||||||
if (!mathcursor->selection())
|
if (!mathcursor->selection())
|
||||||
mathcursor->selStart();
|
mathcursor->selStart();
|
||||||
|
|
||||||
//lyxerr << "insetMotionNotify: " << x + xo_ << ' ' << y + yo_
|
//lyxerr << "insetMotionNotify: " << x + xo_ << ' ' << y + yo_
|
||||||
// << ' ' << button << "\n";
|
// << ' ' << button << "\n";
|
||||||
hideInsetCursor(bv);
|
hideInsetCursor(bv);
|
||||||
@ -378,7 +378,7 @@ InsetFormulaBase::localDispatch(BufferView * bv, kb_action action,
|
|||||||
//lyxerr << "InsetFormulaBase::localDispatch: act: " << action
|
//lyxerr << "InsetFormulaBase::localDispatch: act: " << action
|
||||||
// << " arg: '" << arg << "' cursor: " << mathcursor << "\n";
|
// << " arg: '" << arg << "' cursor: " << mathcursor << "\n";
|
||||||
|
|
||||||
if (!mathcursor)
|
if (!mathcursor)
|
||||||
return UNDISPATCHED;
|
return UNDISPATCHED;
|
||||||
|
|
||||||
if (mathcursor->asHyperActiveInset()) {
|
if (mathcursor->asHyperActiveInset()) {
|
||||||
@ -568,7 +568,7 @@ InsetFormulaBase::localDispatch(BufferView * bv, kb_action action,
|
|||||||
case LFUN_DEFAULT: handleFont(bv, arg, LM_TC_VAR); break;
|
case LFUN_DEFAULT: handleFont(bv, arg, LM_TC_VAR); break;
|
||||||
case LFUN_FREE: handleFont(bv, arg, LM_TC_TEXTRM); break;
|
case LFUN_FREE: handleFont(bv, arg, LM_TC_TEXTRM); break;
|
||||||
|
|
||||||
case LFUN_GREEK:
|
case LFUN_GREEK:
|
||||||
handleFont(bv, arg, LM_TC_GREEK1);
|
handleFont(bv, arg, LM_TC_GREEK1);
|
||||||
if (arg.size())
|
if (arg.size())
|
||||||
mathcursor->interpret(arg);
|
mathcursor->interpret(arg);
|
||||||
@ -618,7 +618,7 @@ InsetFormulaBase::localDispatch(BufferView * bv, kb_action action,
|
|||||||
updateLocal(bv, true);
|
updateLocal(bv, true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case LFUN_SUPERSCRIPT:
|
case LFUN_SUPERSCRIPT:
|
||||||
case LFUN_SUBSCRIPT:
|
case LFUN_SUBSCRIPT:
|
||||||
{
|
{
|
||||||
@ -627,7 +627,7 @@ InsetFormulaBase::localDispatch(BufferView * bv, kb_action action,
|
|||||||
updateLocal(bv, true);
|
updateLocal(bv, true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case LFUN_MATH_DELIM:
|
case LFUN_MATH_DELIM:
|
||||||
{
|
{
|
||||||
lyxerr << "formulabase::LFUN_MATH_DELIM, arg: '" << arg << "'\n";
|
lyxerr << "formulabase::LFUN_MATH_DELIM, arg: '" << arg << "'\n";
|
||||||
@ -825,7 +825,7 @@ bool InsetFormulaBase::searchForward(BufferView * bv, string const & str,
|
|||||||
//lyxerr << "reset lastformula to " << this << "\n";
|
//lyxerr << "reset lastformula to " << this << "\n";
|
||||||
lastformula = this;
|
lastformula = this;
|
||||||
laststr = str;
|
laststr = str;
|
||||||
current = ibegin(par().nucleus());
|
current = ibegin(par().nucleus());
|
||||||
ar.clear();
|
ar.clear();
|
||||||
mathed_parse_cell(ar, str);
|
mathed_parse_cell(ar, str);
|
||||||
} else {
|
} else {
|
||||||
@ -893,7 +893,7 @@ void mathDispatchCreation(BufferView * bv, string const & arg, bool display)
|
|||||||
} else {
|
} else {
|
||||||
// create a macro if we see "\\newcommand" somewhere, and an ordinary
|
// create a macro if we see "\\newcommand" somewhere, and an ordinary
|
||||||
// formula otherwise
|
// formula otherwise
|
||||||
if (sel.find("\\newcommand") == string::npos)
|
if (sel.find("\\newcommand") == string::npos)
|
||||||
f = new InsetFormula(sel);
|
f = new InsetFormula(sel);
|
||||||
else {
|
else {
|
||||||
string name;
|
string name;
|
||||||
@ -914,7 +914,7 @@ void mathDispatchMathDisplay(BufferView * bv, string const & arg)
|
|||||||
mathDispatchCreation(bv, arg, true);
|
mathDispatchCreation(bv, arg, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void mathDispatchMathMode(BufferView * bv, string const & arg)
|
void mathDispatchMathMode(BufferView * bv, string const & arg)
|
||||||
{
|
{
|
||||||
mathDispatchCreation(bv, arg, false);
|
mathDispatchCreation(bv, arg, false);
|
||||||
@ -944,20 +944,20 @@ void mathDispatchMathMacro(BufferView * bv, string const & arg)
|
|||||||
|
|
||||||
void mathDispatchMathDelim(BufferView * bv, string const & arg)
|
void mathDispatchMathDelim(BufferView * bv, string const & arg)
|
||||||
{
|
{
|
||||||
if (bv->available()) {
|
if (bv->available()) {
|
||||||
if (openNewInset(bv, new InsetFormula))
|
if (openNewInset(bv, new InsetFormula))
|
||||||
bv->theLockingInset()->localDispatch(bv, LFUN_MATH_DELIM, arg);
|
bv->theLockingInset()->localDispatch(bv, LFUN_MATH_DELIM, arg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void mathDispatchInsertMatrix(BufferView * bv, string const & arg)
|
void mathDispatchInsertMatrix(BufferView * bv, string const & arg)
|
||||||
{
|
{
|
||||||
if (bv->available()) {
|
if (bv->available()) {
|
||||||
if (openNewInset(bv, new InsetFormula))
|
if (openNewInset(bv, new InsetFormula))
|
||||||
bv->theLockingInset()->localDispatch(bv, LFUN_INSERT_MATRIX, arg);
|
bv->theLockingInset()->localDispatch(bv, LFUN_INSERT_MATRIX, arg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void mathDispatchInsertMath(BufferView * bv, string const & arg)
|
void mathDispatchInsertMath(BufferView * bv, string const & arg)
|
||||||
@ -974,16 +974,16 @@ void mathDispatchInsertMath(BufferView * bv, string const & arg)
|
|||||||
|
|
||||||
|
|
||||||
void mathDispatchGreek(BufferView * bv, string const & arg)
|
void mathDispatchGreek(BufferView * bv, string const & arg)
|
||||||
{
|
{
|
||||||
if (bv->available()) {
|
if (bv->available()) {
|
||||||
InsetFormula * f = new InsetFormula;
|
InsetFormula * f = new InsetFormula;
|
||||||
if (openNewInset(bv, f)) {
|
if (openNewInset(bv, f)) {
|
||||||
bv->theLockingInset()->localDispatch(bv, LFUN_GREEK, arg);
|
bv->theLockingInset()->localDispatch(bv, LFUN_GREEK, arg);
|
||||||
bv->unlockInset(f);
|
bv->unlockInset(f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void mathDispatch(BufferView *, kb_action, string const &)
|
void mathDispatch(BufferView *, kb_action, string const &)
|
||||||
{}
|
{}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
* Purpose: Common parts of the math LyX insets
|
* Purpose: Common parts of the math LyX insets
|
||||||
* Author: André Pönitz
|
* Author: André Pönitz
|
||||||
* Created: May 2001
|
* Created: May 2001
|
||||||
* Description: Allows the edition of math paragraphs inside Lyx.
|
* Description: Allows the edition of math paragraphs inside Lyx.
|
||||||
*
|
*
|
||||||
* Copyright: 2001, The LyX Project
|
* Copyright: 2001, The LyX Project
|
||||||
*
|
*
|
||||||
@ -12,7 +12,7 @@
|
|||||||
* the GNU General Public Licence version 2 or later.
|
* the GNU General Public Licence version 2 or later.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef INSET_FORMULABASE_H
|
#ifndef INSET_FORMULABASE_H
|
||||||
#define INSET_FORMULABASE_H
|
#define INSET_FORMULABASE_H
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
@ -87,10 +87,10 @@ public:
|
|||||||
virtual void insetMotionNotify(BufferView *, int x, int y, int state);
|
virtual void insetMotionNotify(BufferView *, int x, int y, int state);
|
||||||
///
|
///
|
||||||
virtual void insetUnlock(BufferView *);
|
virtual void insetUnlock(BufferView *);
|
||||||
|
|
||||||
/// To allow transparent use of math editing functions
|
/// To allow transparent use of math editing functions
|
||||||
virtual RESULT localDispatch(BufferView *, kb_action, string const &);
|
virtual RESULT localDispatch(BufferView *, kb_action, string const &);
|
||||||
|
|
||||||
///
|
///
|
||||||
virtual std::vector<string> const getLabelList() const;
|
virtual std::vector<string> const getLabelList() const;
|
||||||
///
|
///
|
||||||
@ -104,10 +104,10 @@ public:
|
|||||||
|
|
||||||
///
|
///
|
||||||
virtual bool searchForward(BufferView *, string const &,
|
virtual bool searchForward(BufferView *, string const &,
|
||||||
bool = true, bool = false);
|
bool = true, bool = false);
|
||||||
///
|
///
|
||||||
virtual bool searchBackward(BufferView *, string const &,
|
virtual bool searchBackward(BufferView *, string const &,
|
||||||
bool = true, bool = false);
|
bool = true, bool = false);
|
||||||
///
|
///
|
||||||
virtual bool isTextInset() const { return true; }
|
virtual bool isTextInset() const { return true; }
|
||||||
///
|
///
|
||||||
@ -123,7 +123,7 @@ private:
|
|||||||
void handleAccent(BufferView * bv, string const & arg, string const & name);
|
void handleAccent(BufferView * bv, string const & arg, string const & name);
|
||||||
|
|
||||||
///
|
///
|
||||||
mutable BufferView * view_;
|
mutable BufferView * view_;
|
||||||
///
|
///
|
||||||
mutable LyXFont font_;
|
mutable LyXFont font_;
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* Purpose: Implementation of the formula macro LyX inset
|
* Purpose: Implementation of the formula macro LyX inset
|
||||||
* Author: André Pönitz, based on ideas of Alejandro Aguilar Sierra
|
* Author: André Pönitz, based on ideas of Alejandro Aguilar Sierra
|
||||||
* Created: March 2001
|
* Created: March 2001
|
||||||
* Description: Allows the edition of math macros inside Lyx.
|
* Description: Allows the edition of math macros inside Lyx.
|
||||||
*
|
*
|
||||||
* Copyright: 2001 The LyX Project
|
* Copyright: 2001 The LyX Project
|
||||||
*
|
*
|
||||||
@ -76,7 +76,7 @@ void InsetFormulaMacro::write(Buffer const *, ostream & os) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int InsetFormulaMacro::latex(Buffer const *, ostream & os, bool fragile,
|
int InsetFormulaMacro::latex(Buffer const *, ostream & os, bool fragile,
|
||||||
bool /*free_spacing*/) const
|
bool /*free_spacing*/) const
|
||||||
{
|
{
|
||||||
WriteStream wi(os, fragile);
|
WriteStream wi(os, fragile);
|
||||||
@ -172,7 +172,7 @@ void InsetFormulaMacro::draw(BufferView * bv, LyXFont const & f,
|
|||||||
|
|
||||||
// label
|
// label
|
||||||
font.setColor(LColor::math);
|
font.setColor(LColor::math);
|
||||||
|
|
||||||
int const a = y - ascent(bv, font) + 1;
|
int const a = y - ascent(bv, font) + 1;
|
||||||
int const w = width(bv, font) - 2;
|
int const w = width(bv, font) - 2;
|
||||||
int const h = ascent(bv, font) + descent(bv, font) - 2;
|
int const h = ascent(bv, font) + descent(bv, font) - 2;
|
||||||
@ -193,4 +193,3 @@ void InsetFormulaMacro::draw(BufferView * bv, LyXFont const & f,
|
|||||||
yo_ = y;
|
yo_ = y;
|
||||||
par()->draw(pain, xo_, yo_);
|
par()->draw(pain, xo_, yo_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,9 +2,9 @@
|
|||||||
/*
|
/*
|
||||||
* File: formula.h
|
* File: formula.h
|
||||||
* Purpose: Declaration of formula inset
|
* Purpose: Declaration of formula inset
|
||||||
* Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
|
* Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
|
||||||
* Created: January 1996
|
* Created: January 1996
|
||||||
* Description: Allows the edition of math paragraphs inside Lyx.
|
* Description: Allows the edition of math paragraphs inside Lyx.
|
||||||
*
|
*
|
||||||
* Copyright: 1996, Alejandro Aguilar Sierra
|
* Copyright: 1996, Alejandro Aguilar Sierra
|
||||||
*
|
*
|
||||||
@ -14,7 +14,7 @@
|
|||||||
* the GNU General Public Licence version 2 or later.
|
* the GNU General Public Licence version 2 or later.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef INSET_FORMULA_MACRO_H
|
#ifndef INSET_FORMULA_MACRO_H
|
||||||
#define INSET_FORMULA_MACRO_H
|
#define INSET_FORMULA_MACRO_H
|
||||||
|
|
||||||
#include "formulabase.h"
|
#include "formulabase.h"
|
||||||
@ -26,7 +26,7 @@
|
|||||||
class MathMacroTemplate;
|
class MathMacroTemplate;
|
||||||
|
|
||||||
// InsetFormulaMacro's only knows its name and asks the global
|
// InsetFormulaMacro's only knows its name and asks the global
|
||||||
// MathMacroTable if it needs to know more.
|
// MathMacroTable if it needs to know more.
|
||||||
|
|
||||||
///
|
///
|
||||||
class InsetFormulaMacro: public InsetFormulaBase {
|
class InsetFormulaMacro: public InsetFormulaBase {
|
||||||
|
@ -67,7 +67,7 @@ void MathAMSArrayInset::metrics(MathMetricsInfo const & st) const
|
|||||||
|
|
||||||
|
|
||||||
void MathAMSArrayInset::draw(Painter & pain, int x, int y) const
|
void MathAMSArrayInset::draw(Painter & pain, int x, int y) const
|
||||||
{
|
{
|
||||||
MathGridInset::draw(pain, x + 6, y);
|
MathGridInset::draw(pain, x + 6, y);
|
||||||
int yy = y - ascent_;
|
int yy = y - ascent_;
|
||||||
mathed_draw_deco(pain, x + 1, yy, 5, height(), name_left());
|
mathed_draw_deco(pain, x + 1, yy, 5, height(), name_left());
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
|
|
||||||
class MathAMSArrayInset : public MathGridInset {
|
class MathAMSArrayInset : public MathGridInset {
|
||||||
public:
|
public:
|
||||||
///
|
///
|
||||||
MathAMSArrayInset(string const & name_, int m, int n);
|
MathAMSArrayInset(string const & name_, int m, int n);
|
||||||
///
|
///
|
||||||
|
@ -81,7 +81,7 @@ void MathArrayInset::write(WriteStream & os) const
|
|||||||
os << "\\protect";
|
os << "\\protect";
|
||||||
os << "\\begin{" << name_ << "}";
|
os << "\\begin{" << name_ << "}";
|
||||||
|
|
||||||
if (v_align_ == 't' || v_align_ == 'b')
|
if (v_align_ == 't' || v_align_ == 'b')
|
||||||
os << '[' << char(v_align_) << ']';
|
os << '[' << char(v_align_) << ']';
|
||||||
os << '{' << halign() << "}\n";
|
os << '{' << halign() << "}\n";
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
|
|
||||||
class MathArrayInset : public MathGridInset {
|
class MathArrayInset : public MathGridInset {
|
||||||
public:
|
public:
|
||||||
///
|
///
|
||||||
MathArrayInset(string const &, int m, int n);
|
MathArrayInset(string const &, int m, int n);
|
||||||
///
|
///
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* File: math_atom.C
|
* File: math_atom.C
|
||||||
* Purpose: Wrapper for MathInset *
|
* Purpose: Wrapper for MathInset *
|
||||||
* Author: André Pönitz
|
* Author: André Pönitz
|
||||||
* Created: July 2001
|
* Created: July 2001
|
||||||
*
|
*
|
||||||
|
@ -7,12 +7,12 @@
|
|||||||
#pragma interface
|
#pragma interface
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
The 'atom' is the major blob in math typesetting. And 'atom' consists
|
The 'atom' is the major blob in math typesetting. And 'atom' consists
|
||||||
of a nucleus, an optional superscript, and an optional subscript.
|
of a nucleus, an optional superscript, and an optional subscript.
|
||||||
|
|
||||||
Exactly where the subscript and superscript are drawn depends on the
|
Exactly where the subscript and superscript are drawn depends on the
|
||||||
size, and type, of the nucleus they are attached to.
|
size, and type, of the nucleus they are attached to.
|
||||||
|
|
||||||
Jules
|
Jules
|
||||||
|
|
||||||
@ -33,7 +33,7 @@ Andre'
|
|||||||
class MathInset;
|
class MathInset;
|
||||||
|
|
||||||
class MathAtom {
|
class MathAtom {
|
||||||
public:
|
public:
|
||||||
/// default constructor, object is useless, but we need it to put it into
|
/// default constructor, object is useless, but we need it to put it into
|
||||||
// std::containers
|
// std::containers
|
||||||
MathAtom();
|
MathAtom();
|
||||||
@ -42,7 +42,7 @@ public:
|
|||||||
/// copy constructor, invokes nucleus_->clone()
|
/// copy constructor, invokes nucleus_->clone()
|
||||||
MathAtom(MathAtom const &);
|
MathAtom(MathAtom const &);
|
||||||
/// we really need to clean up
|
/// we really need to clean up
|
||||||
~MathAtom();
|
~MathAtom();
|
||||||
/// assignment invokes nucleus_->clone()
|
/// assignment invokes nucleus_->clone()
|
||||||
void operator=(MathAtom const &);
|
void operator=(MathAtom const &);
|
||||||
/// change inset under the hood
|
/// change inset under the hood
|
||||||
|
@ -17,7 +17,7 @@ MathBigInset::MathBigInset(string const & name, string const & delim)
|
|||||||
|
|
||||||
|
|
||||||
MathInset * MathBigInset::clone() const
|
MathInset * MathBigInset::clone() const
|
||||||
{
|
{
|
||||||
return new MathBigInset(*this);
|
return new MathBigInset(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -53,7 +53,7 @@ void MathBigInset::metrics(MathMetricsInfo const & mi) const
|
|||||||
|
|
||||||
|
|
||||||
void MathBigInset::draw(Painter & pain, int x, int y) const
|
void MathBigInset::draw(Painter & pain, int x, int y) const
|
||||||
{
|
{
|
||||||
mathed_draw_deco(pain, x + 1, y - ascent_, 4, height(), delim_);
|
mathed_draw_deco(pain, x + 1, y - ascent_, 4, height(), delim_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ private:
|
|||||||
size_type size() const;
|
size_type size() const;
|
||||||
///
|
///
|
||||||
double increase() const;
|
double increase() const;
|
||||||
|
|
||||||
/// \bigl or what?
|
/// \bigl or what?
|
||||||
string const name_;
|
string const name_;
|
||||||
/// ( or [ or Vert...
|
/// ( or [ or Vert...
|
||||||
|
@ -20,7 +20,7 @@ MathBinaryOpInset::MathBinaryOpInset(char op)
|
|||||||
|
|
||||||
|
|
||||||
MathInset * MathBinaryOpInset::clone() const
|
MathInset * MathBinaryOpInset::clone() const
|
||||||
{
|
{
|
||||||
return new MathBinaryOpInset(*this);
|
return new MathBinaryOpInset(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -43,10 +43,10 @@ void MathBinaryOpInset::metrics(MathMetricsInfo const & mi) const
|
|||||||
|
|
||||||
|
|
||||||
void MathBinaryOpInset::draw(Painter & pain, int x, int y) const
|
void MathBinaryOpInset::draw(Painter & pain, int x, int y) const
|
||||||
{
|
{
|
||||||
xcell(0).draw(pain, x, y);
|
xcell(0).draw(pain, x, y);
|
||||||
drawChar(pain, LM_TC_CONST, mi_, x + xcell(0).width() , y, op_);
|
drawChar(pain, LM_TC_CONST, mi_, x + xcell(0).width() , y, op_);
|
||||||
xcell(1).draw(pain, x + width() - xcell(1).width(), y);
|
xcell(1).draw(pain, x + width() - xcell(1).width(), y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ MathBinomInset::MathBinomInset()
|
|||||||
|
|
||||||
|
|
||||||
MathInset * MathBinomInset::clone() const
|
MathInset * MathBinomInset::clone() const
|
||||||
{
|
{
|
||||||
return new MathBinomInset(*this);
|
return new MathBinomInset(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -41,8 +41,8 @@ void MathBinomInset::metrics(MathMetricsInfo const & st) const
|
|||||||
xcell(0).metrics(mi);
|
xcell(0).metrics(mi);
|
||||||
xcell(1).metrics(mi);
|
xcell(1).metrics(mi);
|
||||||
ascent_ = xcell(0).height() + 4 + 5;
|
ascent_ = xcell(0).height() + 4 + 5;
|
||||||
descent_ = xcell(1).height() + 4 - 5;
|
descent_ = xcell(1).height() + 4 - 5;
|
||||||
width_ = max(xcell(0).width(), xcell(1).width()) + 2 * dw() + 4;
|
width_ = max(xcell(0).width(), xcell(1).width()) + 2 * dw() + 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/** Binom like objects
|
/** Binom like objects
|
||||||
\author André Pönitz
|
\author André Pönitz
|
||||||
*/
|
*/
|
||||||
class MathBinomInset : public MathFracbaseInset {
|
class MathBinomInset : public MathFracbaseInset {
|
||||||
public:
|
public:
|
||||||
|
@ -19,7 +19,7 @@ MathBraceInset::MathBraceInset()
|
|||||||
|
|
||||||
|
|
||||||
MathInset * MathBraceInset::clone() const
|
MathInset * MathBraceInset::clone() const
|
||||||
{
|
{
|
||||||
return new MathBraceInset(*this);
|
return new MathBraceInset(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ void MathBraceInset::metrics(MathMetricsInfo const & mi) const
|
|||||||
|
|
||||||
|
|
||||||
void MathBraceInset::draw(Painter & pain, int x, int y) const
|
void MathBraceInset::draw(Painter & pain, int x, int y) const
|
||||||
{
|
{
|
||||||
drawChar(pain, font_, x, y, '{');
|
drawChar(pain, font_, x, y, '{');
|
||||||
xcell(0).draw(pain, x + wid_, y);
|
xcell(0).draw(pain, x + wid_, y);
|
||||||
drawChar(pain, font_, x + width_ - wid_, y, '}');
|
drawChar(pain, font_, x + width_ - wid_, y, '}');
|
||||||
@ -54,5 +54,3 @@ void MathBraceInset::normalize(NormalStream & os) const
|
|||||||
{
|
{
|
||||||
os << "[block " << cell(0) << ']';
|
os << "[block " << cell(0) << ']';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
#pragma interface
|
#pragma interface
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/** Extra nesting
|
/** Extra nesting
|
||||||
\author André Pönitz
|
\author André Pönitz
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ void MathCasesInset::metrics(MathMetricsInfo const & mi) const
|
|||||||
|
|
||||||
|
|
||||||
void MathCasesInset::draw(Painter & pain, int x, int y) const
|
void MathCasesInset::draw(Painter & pain, int x, int y) const
|
||||||
{
|
{
|
||||||
mathed_draw_deco(pain, x + 1, y - ascent(), 6, height(), "{");
|
mathed_draw_deco(pain, x + 1, y - ascent(), 6, height(), "{");
|
||||||
MathGridInset::draw(pain, x + 8, y);
|
MathGridInset::draw(pain, x + 8, y);
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
|
|
||||||
class MathCasesInset : public MathGridInset {
|
class MathCasesInset : public MathGridInset {
|
||||||
public:
|
public:
|
||||||
///
|
///
|
||||||
explicit MathCasesInset(row_type rows = 1u);
|
explicit MathCasesInset(row_type rows = 1u);
|
||||||
///
|
///
|
||||||
|
@ -57,7 +57,7 @@ MathTextCodes MathCharInset::nativeCode(char c)
|
|||||||
|
|
||||||
|
|
||||||
MathInset * MathCharInset::clone() const
|
MathInset * MathCharInset::clone() const
|
||||||
{
|
{
|
||||||
return new MathCharInset(*this);
|
return new MathCharInset(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -72,7 +72,7 @@ void MathCharInset::metrics(MathMetricsInfo const & mi) const
|
|||||||
|
|
||||||
|
|
||||||
void MathCharInset::draw(Painter & pain, int x, int y) const
|
void MathCharInset::draw(Painter & pain, int x, int y) const
|
||||||
{
|
{
|
||||||
//lyxerr << "drawing '" << char_ << "' code: " << code_ << endl;
|
//lyxerr << "drawing '" << char_ << "' code: " << code_ << endl;
|
||||||
if (isBinaryOp(char_, code_))
|
if (isBinaryOp(char_, code_))
|
||||||
x += lyxfont::width(' ', font_);
|
x += lyxfont::width(' ', font_);
|
||||||
@ -89,7 +89,7 @@ void MathCharInset::metricsT(TextMetricsInfo const &) const
|
|||||||
|
|
||||||
|
|
||||||
void MathCharInset::drawT(TextPainter & pain, int x, int y) const
|
void MathCharInset::drawT(TextPainter & pain, int x, int y) const
|
||||||
{
|
{
|
||||||
//lyxerr << "drawing text '" << char_ << "' code: " << code_ << endl;
|
//lyxerr << "drawing text '" << char_ << "' code: " << code_ << endl;
|
||||||
pain.draw(x, y, char_);
|
pain.draw(x, y, char_);
|
||||||
}
|
}
|
||||||
|
@ -358,7 +358,7 @@ void MathCursor::last()
|
|||||||
|
|
||||||
|
|
||||||
bool positionable(MathCursor::cursor_type const & cursor,
|
bool positionable(MathCursor::cursor_type const & cursor,
|
||||||
MathCursor::cursor_type const & anchor)
|
MathCursor::cursor_type const & anchor)
|
||||||
{
|
{
|
||||||
// avoid deeper nested insets when selecting
|
// avoid deeper nested insets when selecting
|
||||||
if (cursor.size() > anchor.size())
|
if (cursor.size() > anchor.size())
|
||||||
@ -946,12 +946,12 @@ void MathCursor::normalize()
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (idx() >= par()->nargs()) {
|
if (idx() >= par()->nargs()) {
|
||||||
lyxerr << "this should not really happen - 1: "
|
lyxerr << "this should not really happen - 1: "
|
||||||
<< idx() << " " << par()->nargs() << "\n";
|
<< idx() << " " << par()->nargs() << "\n";
|
||||||
dump("error 2");
|
dump("error 2");
|
||||||
}
|
}
|
||||||
idx() = min(idx(), par()->nargs() - 1);
|
idx() = min(idx(), par()->nargs() - 1);
|
||||||
|
|
||||||
if (pos() > size()) {
|
if (pos() > size()) {
|
||||||
lyxerr << "this should not really happen - 2: "
|
lyxerr << "this should not really happen - 2: "
|
||||||
@ -1238,7 +1238,7 @@ bool MathCursor::goUpDown(bool up)
|
|||||||
if (!popLeft()) {
|
if (!popLeft()) {
|
||||||
// no such inset found, just take something "above"
|
// no such inset found, just take something "above"
|
||||||
///lyxerr << "updown: handled by strange case\n";
|
///lyxerr << "updown: handled by strange case\n";
|
||||||
return
|
return
|
||||||
bruteFind(xo, yo,
|
bruteFind(xo, yo,
|
||||||
formula()->xlow(),
|
formula()->xlow(),
|
||||||
formula()->xhigh(),
|
formula()->xhigh(),
|
||||||
@ -1363,7 +1363,7 @@ bool MathCursor::interpret(string const & s)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// prevent entering of recursive macros
|
// prevent entering of recursive macros
|
||||||
if (formula()->lyxCode() == Inset::MATHMACRO_CODE
|
if (formula()->lyxCode() == Inset::MATHMACRO_CODE
|
||||||
&& formula()->getInsetName() == s.substr(1))
|
&& formula()->getInsetName() == s.substr(1))
|
||||||
{
|
{
|
||||||
lyxerr << "can't enter recursive macro\n";
|
lyxerr << "can't enter recursive macro\n";
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
/*
|
/*
|
||||||
* File: math_cursor.h
|
* File: math_cursor.h
|
||||||
* Purpose: Declaration of interaction classes for mathed
|
* Purpose: Declaration of interaction classes for mathed
|
||||||
* Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
|
* Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
|
||||||
* Created: January 1996
|
* Created: January 1996
|
||||||
* Description: MathCursor control all user interaction
|
* Description: MathCursor control all user interaction
|
||||||
*
|
*
|
||||||
@ -128,7 +128,7 @@ public:
|
|||||||
bool inMacroMode() const;
|
bool inMacroMode() const;
|
||||||
/// are we currently typing '#1' or '#2' or...?
|
/// are we currently typing '#1' or '#2' or...?
|
||||||
bool inMacroArgMode() const;
|
bool inMacroArgMode() const;
|
||||||
|
|
||||||
// Local selection methods
|
// Local selection methods
|
||||||
///
|
///
|
||||||
bool selection() const;
|
bool selection() const;
|
||||||
@ -158,7 +158,7 @@ public:
|
|||||||
void handleNest(MathInset * p);
|
void handleNest(MathInset * p);
|
||||||
/// splits cells and shifts right part to the next cell
|
/// splits cells and shifts right part to the next cell
|
||||||
void splitCell();
|
void splitCell();
|
||||||
/// splits line and insert new row of cell
|
/// splits line and insert new row of cell
|
||||||
void breakLine();
|
void breakLine();
|
||||||
/// read contents of line into an array
|
/// read contents of line into an array
|
||||||
void readLine(MathArray & ar) const;
|
void readLine(MathArray & ar) const;
|
||||||
@ -185,12 +185,12 @@ public:
|
|||||||
|
|
||||||
/// make sure cursor position is valid
|
/// make sure cursor position is valid
|
||||||
void normalize();
|
void normalize();
|
||||||
/// mark current cursor trace for redraw
|
/// mark current cursor trace for redraw
|
||||||
void touch();
|
void touch();
|
||||||
///
|
///
|
||||||
UpdatableInset * asHyperActiveInset() const;
|
UpdatableInset * asHyperActiveInset() const;
|
||||||
|
|
||||||
/// enter a MathInset
|
/// enter a MathInset
|
||||||
void push(MathAtom & par);
|
void push(MathAtom & par);
|
||||||
/// enter a MathInset from the front
|
/// enter a MathInset from the front
|
||||||
void pushLeft(MathAtom & par);
|
void pushLeft(MathAtom & par);
|
||||||
@ -236,7 +236,7 @@ public:
|
|||||||
void dump(char const * str) const;
|
void dump(char const * str) const;
|
||||||
///
|
///
|
||||||
void stripFromLastEqualSign();
|
void stripFromLastEqualSign();
|
||||||
/// moves on
|
/// moves on
|
||||||
void setSelection(cursor_type const & where, size_type n);
|
void setSelection(cursor_type const & where, size_type n);
|
||||||
///
|
///
|
||||||
void insert(char);
|
void insert(char);
|
||||||
@ -244,7 +244,7 @@ public:
|
|||||||
/// hack for reveal codes
|
/// hack for reveal codes
|
||||||
void markInsert();
|
void markInsert();
|
||||||
void markErase();
|
void markErase();
|
||||||
|
|
||||||
///
|
///
|
||||||
friend class Selection;
|
friend class Selection;
|
||||||
|
|
||||||
@ -268,7 +268,7 @@ private:
|
|||||||
MathInset::difference_type macroNamePos() const;
|
MathInset::difference_type macroNamePos() const;
|
||||||
///
|
///
|
||||||
void insert(char, MathTextCodes t);
|
void insert(char, MathTextCodes t);
|
||||||
/// can we enter the inset?
|
/// can we enter the inset?
|
||||||
bool openable(MathAtom const &, bool selection) const;
|
bool openable(MathAtom const &, bool selection) const;
|
||||||
/// write access to cursor cell position
|
/// write access to cursor cell position
|
||||||
pos_type & pos();
|
pos_type & pos();
|
||||||
|
@ -66,7 +66,7 @@ void MathArray::insert(size_type pos, MathArray const & ar)
|
|||||||
|
|
||||||
|
|
||||||
void MathArray::push_back(MathAtom const & t)
|
void MathArray::push_back(MathAtom const & t)
|
||||||
{
|
{
|
||||||
bf_.push_back(t);
|
bf_.push_back(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -85,7 +85,7 @@ void MathArray::clear()
|
|||||||
|
|
||||||
void MathArray::swap(MathArray & ar)
|
void MathArray::swap(MathArray & ar)
|
||||||
{
|
{
|
||||||
if (this != &ar)
|
if (this != &ar)
|
||||||
bf_.swap(ar.bf_);
|
bf_.swap(ar.bf_);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -176,7 +176,7 @@ void MathArray::validate(LaTeXFeatures & features) const
|
|||||||
|
|
||||||
|
|
||||||
void MathArray::pop_back()
|
void MathArray::pop_back()
|
||||||
{
|
{
|
||||||
if (!size()) {
|
if (!size()) {
|
||||||
lyxerr << "pop_back from empty array!\n";
|
lyxerr << "pop_back from empty array!\n";
|
||||||
return;
|
return;
|
||||||
@ -219,7 +219,7 @@ bool MathArray::matchpart(MathArray const & ar, pos_type pos) const
|
|||||||
{
|
{
|
||||||
if (size() < ar.size() + pos)
|
if (size() < ar.size() + pos)
|
||||||
return false;
|
return false;
|
||||||
const_iterator it = begin() + pos;
|
const_iterator it = begin() + pos;
|
||||||
for (const_iterator jt = ar.begin(); jt != ar.end(); ++jt, ++it)
|
for (const_iterator jt = ar.begin(); jt != ar.end(); ++jt, ++it)
|
||||||
if (!jt->nucleus()->match(it->nucleus()))
|
if (!jt->nucleus()->match(it->nucleus()))
|
||||||
return false;
|
return false;
|
||||||
@ -265,6 +265,6 @@ bool MathArray::contains(MathArray const & ar) const
|
|||||||
for (const_iterator it = begin(); it != end(); ++it)
|
for (const_iterator it = begin(); it != end(); ++it)
|
||||||
if (it->nucleus()->contains(ar))
|
if (it->nucleus()->contains(ar))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// -*- C++ -*-
|
// -*- C++ -*-
|
||||||
/*
|
/*
|
||||||
* Purpose: A general purpose resizable array.
|
* Purpose: A general purpose resizable array.
|
||||||
* Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
|
* Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
|
||||||
* Created: January 1996
|
* Created: January 1996
|
||||||
*
|
*
|
||||||
* Dependencies: None (almost)
|
* Dependencies: None (almost)
|
||||||
@ -33,7 +33,7 @@ class ReplaceData;
|
|||||||
|
|
||||||
/** \class MathArray
|
/** \class MathArray
|
||||||
\brief Low level container for math insets
|
\brief Low level container for math insets
|
||||||
|
|
||||||
\author Alejandro Aguilar Sierra
|
\author Alejandro Aguilar Sierra
|
||||||
\author André Pönitz
|
\author André Pönitz
|
||||||
\author Lars Gullik Bjønnes
|
\author Lars Gullik Bjønnes
|
||||||
@ -73,7 +73,7 @@ public:
|
|||||||
void clear();
|
void clear();
|
||||||
///
|
///
|
||||||
void swap(MathArray &);
|
void swap(MathArray &);
|
||||||
|
|
||||||
///
|
///
|
||||||
void insert(size_type pos, MathAtom const &);
|
void insert(size_type pos, MathAtom const &);
|
||||||
///
|
///
|
||||||
@ -126,9 +126,9 @@ public:
|
|||||||
///
|
///
|
||||||
void validate(LaTeXFeatures &) const;
|
void validate(LaTeXFeatures &) const;
|
||||||
///
|
///
|
||||||
const_iterator begin() const;
|
const_iterator begin() const;
|
||||||
///
|
///
|
||||||
const_iterator end() const;
|
const_iterator end() const;
|
||||||
///
|
///
|
||||||
iterator begin();
|
iterator begin();
|
||||||
///
|
///
|
||||||
|
@ -17,7 +17,7 @@ MathDecorationInset::MathDecorationInset(string const & name)
|
|||||||
|
|
||||||
|
|
||||||
MathInset * MathDecorationInset::clone() const
|
MathInset * MathDecorationInset::clone() const
|
||||||
{
|
{
|
||||||
return new MathDecorationInset(*this);
|
return new MathDecorationInset(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,7 +81,7 @@ void MathDecorationInset::metrics(MathMetricsInfo const & mi) const
|
|||||||
ascent_ = xcell(0).ascent();
|
ascent_ = xcell(0).ascent();
|
||||||
descent_ = xcell(0).descent();
|
descent_ = xcell(0).descent();
|
||||||
|
|
||||||
dh_ = 6; //mathed_char_height(LM_TC_VAR, mi(), 'I', ascent_, descent_);
|
dh_ = 6; //mathed_char_height(LM_TC_VAR, mi(), 'I', ascent_, descent_);
|
||||||
dw_ = 6; //mathed_char_width(LM_TC_VAR, mi, 'x');
|
dw_ = 6; //mathed_char_width(LM_TC_VAR, mi, 'x');
|
||||||
|
|
||||||
if (upper()) {
|
if (upper()) {
|
||||||
@ -95,9 +95,9 @@ void MathDecorationInset::metrics(MathMetricsInfo const & mi) const
|
|||||||
|
|
||||||
|
|
||||||
void MathDecorationInset::draw(Painter & pain, int x, int y) const
|
void MathDecorationInset::draw(Painter & pain, int x, int y) const
|
||||||
{
|
{
|
||||||
xcell(0).draw(pain, x, y);
|
xcell(0).draw(pain, x, y);
|
||||||
if (wide())
|
if (wide())
|
||||||
mathed_draw_deco(pain, x, y + dy_, width_, dh_, name_);
|
mathed_draw_deco(pain, x, y + dy_, width_, dh_, name_);
|
||||||
else
|
else
|
||||||
mathed_draw_deco(pain, x + (width_ - dw_) / 2, y + dy_, dw_, dh_, name_);
|
mathed_draw_deco(pain, x + (width_ - dw_) / 2, y + dy_, dw_, dh_, name_);
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
// -*- C++ -*-
|
// -*- C++ -*-
|
||||||
/*
|
/*
|
||||||
* File: math_defs.h
|
* File: math_defs.h
|
||||||
* Purpose: Math editor definitions
|
* Purpose: Math editor definitions
|
||||||
* Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
|
* Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
|
||||||
* Created: January 1996
|
* Created: January 1996
|
||||||
* Description: Math paragraph and objects for a WYSIWYG math editor.
|
* Description: Math paragraph and objects for a WYSIWYG math editor.
|
||||||
*
|
*
|
||||||
@ -14,7 +14,7 @@
|
|||||||
*
|
*
|
||||||
* You are free to use and modify this code under the terms of
|
* You are free to use and modify this code under the terms of
|
||||||
* the GNU General Public Licence version 2 or later.
|
* the GNU General Public Licence version 2 or later.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef MATH_DEFS
|
#ifndef MATH_DEFS
|
||||||
@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
///
|
///
|
||||||
enum MathTextCodes {
|
enum MathTextCodes {
|
||||||
///
|
///
|
||||||
LM_TC_MIN = 0,
|
LM_TC_MIN = 0,
|
||||||
/// internal code for variables
|
/// internal code for variables
|
||||||
LM_TC_VAR,
|
LM_TC_VAR,
|
||||||
@ -53,7 +53,7 @@ enum MathTextCodes {
|
|||||||
LM_TC_IT,
|
LM_TC_IT,
|
||||||
///
|
///
|
||||||
LM_TC_TEXTRM,
|
LM_TC_TEXTRM,
|
||||||
/// math mode TeX characters ",;:{}"
|
/// math mode TeX characters ",;:{}"
|
||||||
LM_TC_TEX,
|
LM_TC_TEX,
|
||||||
/// internal code when typing greek
|
/// internal code when typing greek
|
||||||
LM_TC_GREEK,
|
LM_TC_GREEK,
|
||||||
@ -80,13 +80,13 @@ enum MathTextCodes {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/// Types of lyx-math insets
|
/// Types of lyx-math insets
|
||||||
enum MathInsetTypes {
|
enum MathInsetTypes {
|
||||||
///
|
///
|
||||||
LM_OT_SIMPLE = 0,
|
LM_OT_SIMPLE = 0,
|
||||||
///
|
///
|
||||||
LM_OT_EQUATION,
|
LM_OT_EQUATION,
|
||||||
///
|
///
|
||||||
LM_OT_EQNARRAY,
|
LM_OT_EQNARRAY,
|
||||||
///
|
///
|
||||||
LM_OT_ALIGN,
|
LM_OT_ALIGN,
|
||||||
|
@ -21,7 +21,7 @@ MathDelimInset::MathDelimInset(string const & l, string const & r)
|
|||||||
|
|
||||||
|
|
||||||
MathInset * MathDelimInset::clone() const
|
MathInset * MathDelimInset::clone() const
|
||||||
{
|
{
|
||||||
return new MathDelimInset(*this);
|
return new MathDelimInset(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -68,7 +68,7 @@ void MathDelimInset::metrics(MathMetricsInfo const & mi) const
|
|||||||
|
|
||||||
|
|
||||||
void MathDelimInset::draw(Painter & pain, int x, int y) const
|
void MathDelimInset::draw(Painter & pain, int x, int y) const
|
||||||
{
|
{
|
||||||
int const w = dw();
|
int const w = dw();
|
||||||
int const b = y - ascent_;
|
int const b = y - ascent_;
|
||||||
xcell(0).draw(pain, x + w + 4, y);
|
xcell(0).draw(pain, x + w + 4, y);
|
||||||
@ -101,7 +101,7 @@ void MathDelimInset::maplize(MapleStream & os) const
|
|||||||
bool mat =
|
bool mat =
|
||||||
cell(0).size() == 1 && cell(0).begin()->nucleus()
|
cell(0).size() == 1 && cell(0).begin()->nucleus()
|
||||||
&& cell(0).begin()->nucleus()->asMatrixInset();
|
&& cell(0).begin()->nucleus()->asMatrixInset();
|
||||||
if (mat)
|
if (mat)
|
||||||
os << "linalg[det](" << cell(0) << ")";
|
os << "linalg[det](" << cell(0) << ")";
|
||||||
else
|
else
|
||||||
os << "abs(" << cell(0) << ")";
|
os << "abs(" << cell(0) << ")";
|
||||||
|
@ -39,7 +39,7 @@ void MathDiffInset::metrics(MathMetricsInfo const &) const
|
|||||||
|
|
||||||
|
|
||||||
void MathDiffInset::draw(Painter &, int, int) const
|
void MathDiffInset::draw(Painter &, int, int) const
|
||||||
{
|
{
|
||||||
lyxerr << "should not happen\n";
|
lyxerr << "should not happen\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -72,4 +72,3 @@ void MathDiffInset::write(WriteStream &) const
|
|||||||
{
|
{
|
||||||
lyxerr << "should not happen\n";
|
lyxerr << "should not happen\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
#include "math_diminset.h"
|
#include "math_diminset.h"
|
||||||
#include "Lsstream.h"
|
#include "Lsstream.h"
|
||||||
#include "textpainter.h"
|
#include "textpainter.h"
|
||||||
|
@ -10,9 +10,9 @@ class MathDimInset : public MathInset {
|
|||||||
public:
|
public:
|
||||||
/// not sure whether the initialization is really necessary
|
/// not sure whether the initialization is really necessary
|
||||||
MathDimInset() : width_(0), ascent_(0), descent_(0) {}
|
MathDimInset() : width_(0), ascent_(0), descent_(0) {}
|
||||||
/// read ascent value (should be inline according to gprof)
|
/// read ascent value (should be inline according to gprof)
|
||||||
int ascent() const { return ascent_; }
|
int ascent() const { return ascent_; }
|
||||||
/// read descent
|
/// read descent
|
||||||
int descent() const { return descent_; }
|
int descent() const { return descent_; }
|
||||||
/// read width
|
/// read width
|
||||||
int width() const { return width_; }
|
int width() const { return width_; }
|
||||||
|
@ -18,7 +18,7 @@ MathDotsInset::MathDotsInset(string const & name)
|
|||||||
MathInset * MathDotsInset::clone() const
|
MathInset * MathDotsInset::clone() const
|
||||||
{
|
{
|
||||||
return new MathDotsInset(*this);
|
return new MathDotsInset(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void MathDotsInset::metrics(MathMetricsInfo const & mi) const
|
void MathDotsInset::metrics(MathMetricsInfo const & mi) const
|
||||||
@ -32,7 +32,7 @@ void MathDotsInset::metrics(MathMetricsInfo const & mi) const
|
|||||||
case 'v': width_ /= 2;
|
case 'v': width_ /= 2;
|
||||||
case 'd': dh_ = ascent_; break;
|
case 'd': dh_ = ascent_; break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void MathDotsInset::draw(Painter & pain, int x, int y) const
|
void MathDotsInset::draw(Painter & pain, int x, int y) const
|
||||||
|
@ -29,5 +29,5 @@ protected:
|
|||||||
mutable int dh_;
|
mutable int dh_;
|
||||||
///
|
///
|
||||||
string const name_;
|
string const name_;
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
@ -25,7 +25,7 @@ void MathExFuncInset::metrics(MathMetricsInfo const & mi) const
|
|||||||
|
|
||||||
|
|
||||||
void MathExFuncInset::draw(Painter & pain, int x, int y) const
|
void MathExFuncInset::draw(Painter & pain, int x, int y) const
|
||||||
{
|
{
|
||||||
drawStr(pain, font_, x, y, name_);
|
drawStr(pain, font_, x, y, name_);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -58,5 +58,3 @@ void MathExFuncInset::write(WriteStream & os) const
|
|||||||
{
|
{
|
||||||
os << '\\' << name_ << '{' << cell(0) << '}';
|
os << '\\' << name_ << '{' << cell(0) << '}';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ bool MathExIntInset::hasScripts() const
|
|||||||
|
|
||||||
void MathExIntInset::normalize(NormalStream & os) const
|
void MathExIntInset::normalize(NormalStream & os) const
|
||||||
{
|
{
|
||||||
os << '[' << symbol_ << ' ' << cell(0) << ' ' << cell(1) << ' '
|
os << '[' << symbol_ << ' ' << cell(0) << ' ' << cell(1) << ' '
|
||||||
<< cell(2) << ' ' << cell(3) << ']';
|
<< cell(2) << ' ' << cell(3) << ']';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -56,7 +56,7 @@ void MathExIntInset::metrics(MathMetricsInfo const &) const
|
|||||||
|
|
||||||
|
|
||||||
void MathExIntInset::draw(Painter &, int, int) const
|
void MathExIntInset::draw(Painter &, int, int) const
|
||||||
{
|
{
|
||||||
lyxerr << "should not happen" << endl;
|
lyxerr << "should not happen" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -66,7 +66,7 @@ void MathExIntInset::maplize(MapleStream & os) const
|
|||||||
os << symbol_ << '(';
|
os << symbol_ << '(';
|
||||||
if (cell(0).size())
|
if (cell(0).size())
|
||||||
os << cell(0);
|
os << cell(0);
|
||||||
else
|
else
|
||||||
os << '1';
|
os << '1';
|
||||||
os << ',' << cell(1);
|
os << ',' << cell(1);
|
||||||
if (hasScripts())
|
if (hasScripts())
|
||||||
@ -80,7 +80,7 @@ void MathExIntInset::mathmlize(MathMLStream & os) const
|
|||||||
boost::scoped_ptr<MathSymbolInset> sym(new MathSymbolInset(symbol_));
|
boost::scoped_ptr<MathSymbolInset> sym(new MathSymbolInset(symbol_));
|
||||||
//if (hasScripts())
|
//if (hasScripts())
|
||||||
// mathmlize(sym, os);
|
// mathmlize(sym, os);
|
||||||
//else
|
//else
|
||||||
sym->mathmlize(os);
|
sym->mathmlize(os);
|
||||||
os << cell(0) << "<mo> ⁢ </mo>"
|
os << cell(0) << "<mo> ⁢ </mo>"
|
||||||
<< MTag("mrow") << "<mo> ⅆ </mo>"
|
<< MTag("mrow") << "<mo> ⅆ </mo>"
|
||||||
@ -92,4 +92,3 @@ void MathExIntInset::write(WriteStream &) const
|
|||||||
{
|
{
|
||||||
lyxerr << "should not happen" << endl;
|
lyxerr << "should not happen" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
// This file contains most of the magic that extracts "context
|
// This file contains most of the magic that extracts "context
|
||||||
// information" from the unstructered layout-oriented stuff in an
|
// information" from the unstructered layout-oriented stuff in an
|
||||||
// MathArray.
|
// MathArray.
|
||||||
@ -28,7 +27,7 @@ using std::find_if;
|
|||||||
|
|
||||||
ostream & operator<<(ostream & os, MathArray const & ar)
|
ostream & operator<<(ostream & os, MathArray const & ar)
|
||||||
{
|
{
|
||||||
NormalStream ns(os);
|
NormalStream ns(os);
|
||||||
ns << ar;
|
ns << ar;
|
||||||
return os;
|
return os;
|
||||||
}
|
}
|
||||||
@ -42,7 +41,7 @@ typedef MathInset * ReplaceArgumentFunc(const MathArray & ar);
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
// try to extract a super/subscript
|
// try to extract a super/subscript
|
||||||
// modify iterator position to point behind the thing
|
// modify iterator position to point behind the thing
|
||||||
bool extractScript(MathArray & ar,
|
bool extractScript(MathArray & ar,
|
||||||
MathArray::iterator & pos, MathArray::iterator last)
|
MathArray::iterator & pos, MathArray::iterator last)
|
||||||
@ -260,13 +259,13 @@ void replaceNested(
|
|||||||
ar.erase(it + 1, jt + 1);
|
ar.erase(it + 1, jt + 1);
|
||||||
(*it).reset(p);
|
(*it).reset(p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// split scripts into seperate super- and subscript insets. sub goes in
|
// split scripts into seperate super- and subscript insets. sub goes in
|
||||||
// front of super...
|
// front of super...
|
||||||
//
|
//
|
||||||
|
|
||||||
void splitScripts(MathArray & ar)
|
void splitScripts(MathArray & ar)
|
||||||
@ -286,13 +285,13 @@ void splitScripts(MathArray & ar)
|
|||||||
|
|
||||||
// create extra script inset and move superscript over
|
// create extra script inset and move superscript over
|
||||||
MathScriptInset * q = new MathScriptInset;
|
MathScriptInset * q = new MathScriptInset;
|
||||||
q->ensure(true);
|
q->ensure(true);
|
||||||
q->up().data_.swap(p->up().data_);
|
q->up().data_.swap(p->up().data_);
|
||||||
p->removeScript(true);
|
p->removeScript(true);
|
||||||
|
|
||||||
// insert new inset behind
|
// insert new inset behind
|
||||||
++i;
|
++i;
|
||||||
ar.insert(i, MathAtom(q));
|
ar.insert(i, MathAtom(q));
|
||||||
}
|
}
|
||||||
//lyxerr << "\nScripts to: " << ar << "\n";
|
//lyxerr << "\nScripts to: " << ar << "\n";
|
||||||
}
|
}
|
||||||
@ -385,10 +384,10 @@ void extractFunctions(MathArray & ar)
|
|||||||
|
|
||||||
string name;
|
string name;
|
||||||
// is it a function?
|
// is it a function?
|
||||||
if ((*it)->asFuncInset()) {
|
if ((*it)->asFuncInset()) {
|
||||||
// it certainly is if it is well known...
|
// it certainly is if it is well known...
|
||||||
name = (*it)->asFuncInset()->name();
|
name = (*it)->asFuncInset()->name();
|
||||||
} else {
|
} else {
|
||||||
// is this a user defined function?
|
// is this a user defined function?
|
||||||
// it it probably not, if it doesn't have a name.
|
// it it probably not, if it doesn't have a name.
|
||||||
if (!extractString((*it).nucleus(), name))
|
if (!extractString((*it).nucleus(), name))
|
||||||
@ -408,7 +407,7 @@ void extractFunctions(MathArray & ar)
|
|||||||
// 'sin' '^2' 'x' -> 'sin(x)' '^2'
|
// 'sin' '^2' 'x' -> 'sin(x)' '^2'
|
||||||
MathArray exp;
|
MathArray exp;
|
||||||
extractScript(exp, jt, ar.end());
|
extractScript(exp, jt, ar.end());
|
||||||
|
|
||||||
// create a proper inset as replacement
|
// create a proper inset as replacement
|
||||||
MathExFuncInset * p = new MathExFuncInset(name);
|
MathExFuncInset * p = new MathExFuncInset(name);
|
||||||
|
|
||||||
@ -417,7 +416,7 @@ void extractFunctions(MathArray & ar)
|
|||||||
|
|
||||||
// replace the function name by a real function inset
|
// replace the function name by a real function inset
|
||||||
(*it).reset(p);
|
(*it).reset(p);
|
||||||
|
|
||||||
// remove the source of the argument from the array
|
// remove the source of the argument from the array
|
||||||
ar.erase(it + 1, st);
|
ar.erase(it + 1, st);
|
||||||
|
|
||||||
@ -425,7 +424,7 @@ void extractFunctions(MathArray & ar)
|
|||||||
ar.insert(i + 1, exp);
|
ar.insert(i + 1, exp);
|
||||||
//lyxerr << "\nFunctions to: " << ar << "\n";
|
//lyxerr << "\nFunctions to: " << ar << "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -480,7 +479,7 @@ void extractIntegrals(MathArray & ar)
|
|||||||
// collect subscript if any
|
// collect subscript if any
|
||||||
MathArray::iterator st = it + 1;
|
MathArray::iterator st = it + 1;
|
||||||
if (st != ar.end())
|
if (st != ar.end())
|
||||||
if (MathScriptInset * sub = (*st)->asScriptInset())
|
if (MathScriptInset * sub = (*st)->asScriptInset())
|
||||||
if (sub->hasDown()) {
|
if (sub->hasDown()) {
|
||||||
p->cell(2) = sub->down().data_;
|
p->cell(2) = sub->down().data_;
|
||||||
++st;
|
++st;
|
||||||
@ -488,7 +487,7 @@ void extractIntegrals(MathArray & ar)
|
|||||||
|
|
||||||
// collect superscript if any
|
// collect superscript if any
|
||||||
if (st != ar.end())
|
if (st != ar.end())
|
||||||
if (MathScriptInset * sup = (*st)->asScriptInset())
|
if (MathScriptInset * sup = (*st)->asScriptInset())
|
||||||
if (sup->hasUp()) {
|
if (sup->hasUp()) {
|
||||||
p->cell(3) = sup->up().data_;
|
p->cell(3) = sup->up().data_;
|
||||||
++st;
|
++st;
|
||||||
@ -499,7 +498,7 @@ void extractIntegrals(MathArray & ar)
|
|||||||
|
|
||||||
// use the "thing" behind the 'd' as differential
|
// use the "thing" behind the 'd' as differential
|
||||||
MathArray::iterator tt = extractArgument(p->cell(1), jt + 1, ar.end());
|
MathArray::iterator tt = extractArgument(p->cell(1), jt + 1, ar.end());
|
||||||
|
|
||||||
// remove used parts
|
// remove used parts
|
||||||
ar.erase(it + 1, tt);
|
ar.erase(it + 1, tt);
|
||||||
(*it).reset(p);
|
(*it).reset(p);
|
||||||
@ -632,7 +631,7 @@ void extractDiff(MathArray & ar)
|
|||||||
// is this a "differential fraction"?
|
// is this a "differential fraction"?
|
||||||
if (!testDiffFrac(it->nucleus()))
|
if (!testDiffFrac(it->nucleus()))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
MathFracInset * f = (*it)->asFracInset();
|
MathFracInset * f = (*it)->asFracInset();
|
||||||
if (!f) {
|
if (!f) {
|
||||||
lyxerr << "should not happen\n";
|
lyxerr << "should not happen\n";
|
||||||
@ -643,20 +642,20 @@ void extractDiff(MathArray & ar)
|
|||||||
MathDiffInset * diff = new MathDiffInset;
|
MathDiffInset * diff = new MathDiffInset;
|
||||||
|
|
||||||
// collect function, let jt point behind last used item
|
// collect function, let jt point behind last used item
|
||||||
MathArray::iterator jt = it + 1;
|
MathArray::iterator jt = it + 1;
|
||||||
//int n = 1;
|
//int n = 1;
|
||||||
MathArray & numer = f->cell(0);
|
MathArray & numer = f->cell(0);
|
||||||
if (numer.size() > 1 && numer.at(1)->asScriptInset()) {
|
if (numer.size() > 1 && numer.at(1)->asScriptInset()) {
|
||||||
// this is something like d^n f(x) / d... or d^n / d...
|
// this is something like d^n f(x) / d... or d^n / d...
|
||||||
// FIXME
|
// FIXME
|
||||||
//n = 1;
|
//n = 1;
|
||||||
if (numer.size() > 2)
|
if (numer.size() > 2)
|
||||||
diff->cell(0) = MathArray(numer.begin() + 2, numer.end());
|
diff->cell(0) = MathArray(numer.begin() + 2, numer.end());
|
||||||
else
|
else
|
||||||
jt = extractArgument(diff->cell(0), jt, ar.end());
|
jt = extractArgument(diff->cell(0), jt, ar.end());
|
||||||
} else {
|
} else {
|
||||||
// simply d f(x) / d... or d/d...
|
// simply d f(x) / d... or d/d...
|
||||||
if (numer.size() > 1)
|
if (numer.size() > 1)
|
||||||
diff->cell(0) = MathArray(numer.begin() + 1, numer.end());
|
diff->cell(0) = MathArray(numer.begin() + 1, numer.end());
|
||||||
else
|
else
|
||||||
jt = extractArgument(diff->cell(0), jt, ar.end());
|
jt = extractArgument(diff->cell(0), jt, ar.end());
|
||||||
@ -725,7 +724,7 @@ void write(MathArray const & dat, WriteStream & wi)
|
|||||||
q->write2(p, wi);
|
q->write2(p, wi);
|
||||||
++it;
|
++it;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
p->write(wi);
|
p->write(wi);
|
||||||
}
|
}
|
||||||
@ -748,7 +747,7 @@ void octavize(MathArray const & dat, OctaveStream & os)
|
|||||||
if (it + 1 != ar.end()) {
|
if (it + 1 != ar.end()) {
|
||||||
if (MathScriptInset const * q = asScript(it)) {
|
if (MathScriptInset const * q = asScript(it)) {
|
||||||
q->octavize2(p, os);
|
q->octavize2(p, os);
|
||||||
++it;
|
++it;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -766,7 +765,7 @@ void maplize(MathArray const & dat, MapleStream & os)
|
|||||||
if (it + 1 != ar.end()) {
|
if (it + 1 != ar.end()) {
|
||||||
if (MathScriptInset const * q = asScript(it)) {
|
if (MathScriptInset const * q = asScript(it)) {
|
||||||
q->maplize2(p, os);
|
q->maplize2(p, os);
|
||||||
++it;
|
++it;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -790,7 +789,7 @@ void mathmlize(MathArray const & dat, MathMLStream & os)
|
|||||||
if (it + 1 != ar.end()) {
|
if (it + 1 != ar.end()) {
|
||||||
if (MathScriptInset const * q = asScript(it)) {
|
if (MathScriptInset const * q = asScript(it)) {
|
||||||
q->mathmlize2(p, os);
|
q->mathmlize2(p, os);
|
||||||
++it;
|
++it;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -799,4 +798,3 @@ void mathmlize(MathArray const & dat, MathMLStream & os)
|
|||||||
os << ETag("mrow");
|
os << ETag("mrow");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ MathAtom createMathInset(latexkeys const * l)
|
|||||||
return MathAtom(new MathStackrelInset);
|
return MathAtom(new MathStackrelInset);
|
||||||
case LM_TK_UNDERSET:
|
case LM_TK_UNDERSET:
|
||||||
return MathAtom(new MathUndersetInset);
|
return MathAtom(new MathUndersetInset);
|
||||||
case LM_TK_KERN:
|
case LM_TK_KERN:
|
||||||
return MathAtom(new MathKernInset);
|
return MathAtom(new MathKernInset);
|
||||||
case LM_TK_BINOM:
|
case LM_TK_BINOM:
|
||||||
case LM_TK_CHOOSE:
|
case LM_TK_CHOOSE:
|
||||||
@ -117,14 +117,14 @@ MathAtom createMathInset(string const & s)
|
|||||||
return MathAtom(new MathArrayInset(s, 1, 1));
|
return MathAtom(new MathArrayInset(s, 1, 1));
|
||||||
|
|
||||||
if (s == "pmatrix" || s == "bmatrix" || s == "vmatrix" || s == "Vmatrix" ||
|
if (s == "pmatrix" || s == "bmatrix" || s == "vmatrix" || s == "Vmatrix" ||
|
||||||
s == "matrix")
|
s == "matrix")
|
||||||
return MathAtom(new MathAMSArrayInset(s));
|
return MathAtom(new MathAMSArrayInset(s));
|
||||||
|
|
||||||
latexkeys const * l = in_word_set(s);
|
latexkeys const * l = in_word_set(s);
|
||||||
if (l)
|
if (l)
|
||||||
return createMathInset(l);
|
return createMathInset(l);
|
||||||
|
|
||||||
if (MathMacroTable::has(s))
|
if (MathMacroTable::has(s))
|
||||||
return MathAtom(new MathMacro(s));
|
return MathAtom(new MathMacro(s));
|
||||||
|
|
||||||
//cerr << "creating inset 2 with name: '" << s << "'\n";
|
//cerr << "creating inset 2 with name: '" << s << "'\n";
|
||||||
|
@ -12,7 +12,7 @@ class MathFracbaseInset : public MathNestInset {
|
|||||||
public:
|
public:
|
||||||
///
|
///
|
||||||
MathFracbaseInset();
|
MathFracbaseInset();
|
||||||
///
|
///
|
||||||
bool idxUpDown(idx_type &, bool up) const;
|
bool idxUpDown(idx_type &, bool up) const;
|
||||||
///
|
///
|
||||||
bool idxLeft(idx_type &, pos_type &) const;
|
bool idxLeft(idx_type &, pos_type &) const;
|
||||||
|
@ -18,7 +18,7 @@ MathFracInset::MathFracInset(bool atop)
|
|||||||
|
|
||||||
|
|
||||||
MathInset * MathFracInset::clone() const
|
MathInset * MathFracInset::clone() const
|
||||||
{
|
{
|
||||||
return new MathFracInset(*this);
|
return new MathFracInset(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -35,9 +35,9 @@ void MathFracInset::metrics(MathMetricsInfo const & mi) const
|
|||||||
smallerStyleFrac(m);
|
smallerStyleFrac(m);
|
||||||
xcell(0).metrics(m);
|
xcell(0).metrics(m);
|
||||||
xcell(1).metrics(m);
|
xcell(1).metrics(m);
|
||||||
width_ = max(xcell(0).width(), xcell(1).width()) + 2;
|
width_ = max(xcell(0).width(), xcell(1).width()) + 2;
|
||||||
ascent_ = xcell(0).height() + 2 + 5;
|
ascent_ = xcell(0).height() + 2 + 5;
|
||||||
descent_ = xcell(1).height() + 2 - 5;
|
descent_ = xcell(1).height() + 2 - 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -82,7 +82,7 @@ void MathFracInset::write(WriteStream & os) const
|
|||||||
|
|
||||||
void MathFracInset::normalize(NormalStream & os) const
|
void MathFracInset::normalize(NormalStream & os) const
|
||||||
{
|
{
|
||||||
if (atop_)
|
if (atop_)
|
||||||
os << "[atop ";
|
os << "[atop ";
|
||||||
else
|
else
|
||||||
os << "[frac ";
|
os << "[frac ";
|
||||||
|
@ -38,7 +38,7 @@ void MathFuncInset::setName(string const & n)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void MathFuncInset::metrics(MathMetricsInfo const & mi) const
|
void MathFuncInset::metrics(MathMetricsInfo const & mi) const
|
||||||
{
|
{
|
||||||
whichFont(font_, LM_TC_TEXTRM, mi);
|
whichFont(font_, LM_TC_TEXTRM, mi);
|
||||||
mathed_string_dim(font_, name_, ascent_, descent_, width_);
|
mathed_string_dim(font_, name_, ascent_, descent_, width_);
|
||||||
@ -46,7 +46,7 @@ void MathFuncInset::metrics(MathMetricsInfo const & mi) const
|
|||||||
|
|
||||||
|
|
||||||
void MathFuncInset::draw(Painter & pain, int x, int y) const
|
void MathFuncInset::draw(Painter & pain, int x, int y) const
|
||||||
{
|
{
|
||||||
drawStr(pain, font_, x, y, name_);
|
drawStr(pain, font_, x, y, name_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,6 +44,6 @@ void MathFuncLimInset::metrics(MathMetricsInfo const & mi) const
|
|||||||
|
|
||||||
|
|
||||||
void MathFuncLimInset::draw(Painter & pain, int x, int y) const
|
void MathFuncLimInset::draw(Painter & pain, int x, int y) const
|
||||||
{
|
{
|
||||||
drawStr(pain, font_, x, y, name_);
|
drawStr(pain, font_, x, y, name_);
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,7 @@ string verboseHLine(int n)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
MathGridInset::RowInfo::RowInfo()
|
MathGridInset::RowInfo::RowInfo()
|
||||||
@ -48,7 +48,7 @@ int MathGridInset::RowInfo::skipPixels() const
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
MathGridInset::ColInfo::ColInfo()
|
MathGridInset::ColInfo::ColInfo()
|
||||||
@ -56,14 +56,14 @@ MathGridInset::ColInfo::ColInfo()
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
MathGridInset::MathGridInset(char v, string const & h)
|
MathGridInset::MathGridInset(char v, string const & h)
|
||||||
: MathNestInset(guessColumns(h)), rowinfo_(2), colinfo_(guessColumns(h) + 1)
|
: MathNestInset(guessColumns(h)), rowinfo_(2), colinfo_(guessColumns(h) + 1)
|
||||||
{
|
{
|
||||||
setDefaults();
|
setDefaults();
|
||||||
valign(v);
|
valign(v);
|
||||||
halign(h);
|
halign(h);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -79,7 +79,7 @@ MathGridInset::MathGridInset(col_type m, row_type n, char v, string const & h)
|
|||||||
: MathNestInset(m * n), rowinfo_(n + 1), colinfo_(m + 1), v_align_(v)
|
: MathNestInset(m * n), rowinfo_(n + 1), colinfo_(m + 1), v_align_(v)
|
||||||
{
|
{
|
||||||
setDefaults();
|
setDefaults();
|
||||||
valign(v);
|
valign(v);
|
||||||
halign(h);
|
halign(h);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -124,7 +124,7 @@ void MathGridInset::halign(string const & hh)
|
|||||||
lyxerr << "unkown column separator: '" << c << "'\n";
|
lyxerr << "unkown column separator: '" << c << "'\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
col_type n = hh.size();
|
col_type n = hh.size();
|
||||||
if (n > ncols())
|
if (n > ncols())
|
||||||
@ -163,7 +163,7 @@ string MathGridInset::halign() const
|
|||||||
for (col_type col = 0; col < ncols(); ++col) {
|
for (col_type col = 0; col < ncols(); ++col) {
|
||||||
res += string(colinfo_[col].lines_, '|');
|
res += string(colinfo_[col].lines_, '|');
|
||||||
res += colinfo_[col].align_;
|
res += colinfo_[col].align_;
|
||||||
}
|
}
|
||||||
return res + string(colinfo_[ncols()].lines_, '|');
|
return res + string(colinfo_[ncols()].lines_, '|');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -240,7 +240,7 @@ void MathGridInset::metrics(MathMetricsInfo const & mi) const
|
|||||||
// compute vertical offsets
|
// compute vertical offsets
|
||||||
rowinfo_[0].offset_ = 0;
|
rowinfo_[0].offset_ = 0;
|
||||||
for (row_type row = 1; row <= nrows(); ++row) {
|
for (row_type row = 1; row <= nrows(); ++row) {
|
||||||
rowinfo_[row].offset_ =
|
rowinfo_[row].offset_ =
|
||||||
rowinfo_[row - 1].offset_ +
|
rowinfo_[row - 1].offset_ +
|
||||||
rowinfo_[row - 1].descent_ +
|
rowinfo_[row - 1].descent_ +
|
||||||
rowinfo_[row - 1].skipPixels() +
|
rowinfo_[row - 1].skipPixels() +
|
||||||
@ -263,12 +263,12 @@ void MathGridInset::metrics(MathMetricsInfo const & mi) const
|
|||||||
}
|
}
|
||||||
for (row_type row = 0; row <= nrows(); ++row)
|
for (row_type row = 0; row <= nrows(); ++row)
|
||||||
rowinfo_[row].offset_ -= h;
|
rowinfo_[row].offset_ -= h;
|
||||||
|
|
||||||
|
|
||||||
// compute absolute sizes of horizontal structure
|
// compute absolute sizes of horizontal structure
|
||||||
for (col_type col = 0; col < ncols(); ++col) {
|
for (col_type col = 0; col < ncols(); ++col) {
|
||||||
int wid = 0;
|
int wid = 0;
|
||||||
for (row_type row = 0; row < nrows(); ++row)
|
for (row_type row = 0; row < nrows(); ++row)
|
||||||
wid = max(wid, xcell(index(row, col)).width());
|
wid = max(wid, xcell(index(row, col)).width());
|
||||||
colinfo_[col].width_ = wid;
|
colinfo_[col].width_ = wid;
|
||||||
}
|
}
|
||||||
@ -279,30 +279,30 @@ void MathGridInset::metrics(MathMetricsInfo const & mi) const
|
|||||||
for (col_type col = 1; col <= ncols(); ++col) {
|
for (col_type col = 1; col <= ncols(); ++col) {
|
||||||
colinfo_[col].offset_ =
|
colinfo_[col].offset_ =
|
||||||
colinfo_[col - 1].offset_ +
|
colinfo_[col - 1].offset_ +
|
||||||
colinfo_[col - 1].width_ +
|
colinfo_[col - 1].width_ +
|
||||||
colinfo_[col - 1].skip_ +
|
colinfo_[col - 1].skip_ +
|
||||||
colsep() +
|
colsep() +
|
||||||
colinfo_[col].lines_ * vlinesep();
|
colinfo_[col].lines_ * vlinesep();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
width_ = colinfo_[ncols() - 1].offset_
|
width_ = colinfo_[ncols() - 1].offset_
|
||||||
+ colinfo_[ncols() - 1].width_
|
+ colinfo_[ncols() - 1].width_
|
||||||
+ vlinesep() * colinfo_[ncols()].lines_
|
+ vlinesep() * colinfo_[ncols()].lines_
|
||||||
+ border();
|
+ border();
|
||||||
|
|
||||||
ascent_ = - rowinfo_[0].offset_
|
ascent_ = - rowinfo_[0].offset_
|
||||||
+ rowinfo_[0].ascent_
|
+ rowinfo_[0].ascent_
|
||||||
+ hlinesep() * rowinfo_[0].lines_
|
+ hlinesep() * rowinfo_[0].lines_
|
||||||
+ border();
|
+ border();
|
||||||
|
|
||||||
descent_ = rowinfo_[nrows() - 1].offset_
|
descent_ = rowinfo_[nrows() - 1].offset_
|
||||||
+ rowinfo_[nrows() - 1].descent_
|
+ rowinfo_[nrows() - 1].descent_
|
||||||
+ hlinesep() * rowinfo_[nrows()].lines_
|
+ hlinesep() * rowinfo_[nrows()].lines_
|
||||||
+ border();
|
+ border();
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
// Increase ws_[i] for 'R' columns (except the first one)
|
// Increase ws_[i] for 'R' columns (except the first one)
|
||||||
for (int i = 1; i < nc_; ++i)
|
for (int i = 1; i < nc_; ++i)
|
||||||
if (align_[i] == 'R')
|
if (align_[i] == 'R')
|
||||||
@ -311,10 +311,10 @@ void MathGridInset::metrics(MathMetricsInfo const & mi) const
|
|||||||
if (align_[0] == 'C')
|
if (align_[0] == 'C')
|
||||||
if (ws_[0] < 7 * workwidth / 8)
|
if (ws_[0] < 7 * workwidth / 8)
|
||||||
ws_[0] = 7 * workwidth / 8;
|
ws_[0] = 7 * workwidth / 8;
|
||||||
|
|
||||||
// Adjust local tabs
|
// Adjust local tabs
|
||||||
width = colsep();
|
width = colsep();
|
||||||
for (cxrow = row_.begin(); cxrow; ++cxrow) {
|
for (cxrow = row_.begin(); cxrow; ++cxrow) {
|
||||||
int rg = COLSEP;
|
int rg = COLSEP;
|
||||||
int lf = 0;
|
int lf = 0;
|
||||||
for (int i = 0; i < nc_; ++i) {
|
for (int i = 0; i < nc_; ++i) {
|
||||||
@ -328,7 +328,7 @@ void MathGridInset::metrics(MathMetricsInfo const & mi) const
|
|||||||
lf = 0;
|
lf = 0;
|
||||||
break;
|
break;
|
||||||
case 'c':
|
case 'c':
|
||||||
lf = (ws_[i] - cxrow->getTab(i))/2;
|
lf = (ws_[i] - cxrow->getTab(i))/2;
|
||||||
break;
|
break;
|
||||||
case 'r':
|
case 'r':
|
||||||
case 'R':
|
case 'R':
|
||||||
@ -340,7 +340,7 @@ void MathGridInset::metrics(MathMetricsInfo const & mi) const
|
|||||||
else if (cxrow.is_last())
|
else if (cxrow.is_last())
|
||||||
lf = ws_[i] - cxrow->getTab(i);
|
lf = ws_[i] - cxrow->getTab(i);
|
||||||
else
|
else
|
||||||
lf = (ws_[i] - cxrow->getTab(i))/2;
|
lf = (ws_[i] - cxrow->getTab(i))/2;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
int const ww = (isvoid) ? lf : lf + cxrow->getTab(i);
|
int const ww = (isvoid) ? lf : lf + cxrow->getTab(i);
|
||||||
@ -380,7 +380,7 @@ void MathGridInset::metricsT(TextMetricsInfo const & mi) const
|
|||||||
{
|
{
|
||||||
// let the cells adjust themselves
|
// let the cells adjust themselves
|
||||||
//MathNestInset::metrics(mi);
|
//MathNestInset::metrics(mi);
|
||||||
for (idx_type i = 0; i < nargs(); ++i)
|
for (idx_type i = 0; i < nargs(); ++i)
|
||||||
xcell(i).metricsT(mi);
|
xcell(i).metricsT(mi);
|
||||||
|
|
||||||
// compute absolute sizes of vertical structure
|
// compute absolute sizes of vertical structure
|
||||||
@ -402,7 +402,7 @@ void MathGridInset::metricsT(TextMetricsInfo const & mi) const
|
|||||||
// compute vertical offsets
|
// compute vertical offsets
|
||||||
rowinfo_[0].offset_ = 0;
|
rowinfo_[0].offset_ = 0;
|
||||||
for (row_type row = 1; row <= nrows(); ++row) {
|
for (row_type row = 1; row <= nrows(); ++row) {
|
||||||
rowinfo_[row].offset_ =
|
rowinfo_[row].offset_ =
|
||||||
rowinfo_[row - 1].offset_ +
|
rowinfo_[row - 1].offset_ +
|
||||||
rowinfo_[row - 1].descent_ +
|
rowinfo_[row - 1].descent_ +
|
||||||
//rowinfo_[row - 1].skipPixels() +
|
//rowinfo_[row - 1].skipPixels() +
|
||||||
@ -425,12 +425,12 @@ void MathGridInset::metricsT(TextMetricsInfo const & mi) const
|
|||||||
}
|
}
|
||||||
for (row_type row = 0; row <= nrows(); ++row)
|
for (row_type row = 0; row <= nrows(); ++row)
|
||||||
rowinfo_[row].offset_ -= h;
|
rowinfo_[row].offset_ -= h;
|
||||||
|
|
||||||
|
|
||||||
// compute absolute sizes of horizontal structure
|
// compute absolute sizes of horizontal structure
|
||||||
for (col_type col = 0; col < ncols(); ++col) {
|
for (col_type col = 0; col < ncols(); ++col) {
|
||||||
int wid = 0;
|
int wid = 0;
|
||||||
for (row_type row = 0; row < nrows(); ++row)
|
for (row_type row = 0; row < nrows(); ++row)
|
||||||
wid = max(wid, xcell(index(row, col)).width());
|
wid = max(wid, xcell(index(row, col)).width());
|
||||||
colinfo_[col].width_ = wid;
|
colinfo_[col].width_ = wid;
|
||||||
}
|
}
|
||||||
@ -441,27 +441,27 @@ void MathGridInset::metricsT(TextMetricsInfo const & mi) const
|
|||||||
for (col_type col = 1; col <= ncols(); ++col) {
|
for (col_type col = 1; col <= ncols(); ++col) {
|
||||||
colinfo_[col].offset_ =
|
colinfo_[col].offset_ =
|
||||||
colinfo_[col - 1].offset_ +
|
colinfo_[col - 1].offset_ +
|
||||||
colinfo_[col - 1].width_ +
|
colinfo_[col - 1].width_ +
|
||||||
colinfo_[col - 1].skip_ +
|
colinfo_[col - 1].skip_ +
|
||||||
1 ; //colsep() +
|
1 ; //colsep() +
|
||||||
//colinfo_[col].lines_ * vlinesep();
|
//colinfo_[col].lines_ * vlinesep();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
width_ = colinfo_[ncols() - 1].offset_
|
width_ = colinfo_[ncols() - 1].offset_
|
||||||
+ colinfo_[ncols() - 1].width_
|
+ colinfo_[ncols() - 1].width_
|
||||||
//+ vlinesep() * colinfo_[ncols()].lines_
|
//+ vlinesep() * colinfo_[ncols()].lines_
|
||||||
+ 2;
|
+ 2;
|
||||||
|
|
||||||
ascent_ = - rowinfo_[0].offset_
|
ascent_ = - rowinfo_[0].offset_
|
||||||
+ rowinfo_[0].ascent_
|
+ rowinfo_[0].ascent_
|
||||||
//+ hlinesep() * rowinfo_[0].lines_
|
//+ hlinesep() * rowinfo_[0].lines_
|
||||||
+ 1;
|
+ 1;
|
||||||
|
|
||||||
descent_ = rowinfo_[nrows() - 1].offset_
|
descent_ = rowinfo_[nrows() - 1].offset_
|
||||||
+ rowinfo_[nrows() - 1].descent_
|
+ rowinfo_[nrows() - 1].descent_
|
||||||
//+ hlinesep() * rowinfo_[nrows()].lines_
|
//+ hlinesep() * rowinfo_[nrows()].lines_
|
||||||
+ 1;
|
+ 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -525,7 +525,7 @@ void MathGridInset::delRow(row_type row)
|
|||||||
if (nrows() == 1)
|
if (nrows() == 1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
cells_type::iterator it = cells_.begin() + row * ncols();
|
cells_type::iterator it = cells_.begin() + row * ncols();
|
||||||
cells_.erase(it, it + ncols());
|
cells_.erase(it, it + ncols());
|
||||||
|
|
||||||
rowinfo_.erase(rowinfo_.begin() + row);
|
rowinfo_.erase(rowinfo_.begin() + row);
|
||||||
@ -537,7 +537,7 @@ void MathGridInset::addCol(col_type newcol)
|
|||||||
const col_type nc = ncols();
|
const col_type nc = ncols();
|
||||||
const row_type nr = nrows();
|
const row_type nr = nrows();
|
||||||
cells_type new_cells((nc + 1) * nr);
|
cells_type new_cells((nc + 1) * nr);
|
||||||
|
|
||||||
for (row_type row = 0; row < nr; ++row)
|
for (row_type row = 0; row < nr; ++row)
|
||||||
for (col_type col = 0; col < nc; ++col)
|
for (col_type col = 0; col < nc; ++col)
|
||||||
new_cells[row * (nc + 1) + col + (col > newcol)]
|
new_cells[row * (nc + 1) + col + (col > newcol)]
|
||||||
@ -557,7 +557,7 @@ void MathGridInset::delCol(col_type col)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
cells_type tmpcells;
|
cells_type tmpcells;
|
||||||
for (col_type i = 0; i < nargs(); ++i)
|
for (col_type i = 0; i < nargs(); ++i)
|
||||||
if (i % ncols() != col)
|
if (i % ncols() != col)
|
||||||
tmpcells.push_back(cells_[i]);
|
tmpcells.push_back(cells_[i]);
|
||||||
swap(cells_, tmpcells);
|
swap(cells_, tmpcells);
|
||||||
@ -572,9 +572,9 @@ int MathGridInset::cellXOffset(idx_type idx) const
|
|||||||
int x = colinfo_[c].offset_;
|
int x = colinfo_[c].offset_;
|
||||||
char align = colinfo_[c].align_;
|
char align = colinfo_[c].align_;
|
||||||
if (align == 'r' || align == 'R')
|
if (align == 'r' || align == 'R')
|
||||||
x += colinfo_[c].width_ - xcell(idx).width();
|
x += colinfo_[c].width_ - xcell(idx).width();
|
||||||
if (align == 'c' || align == 'C')
|
if (align == 'c' || align == 'C')
|
||||||
x += (colinfo_[c].width_ - xcell(idx).width()) / 2;
|
x += (colinfo_[c].width_ - xcell(idx).width()) / 2;
|
||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -600,7 +600,7 @@ bool MathGridInset::idxUpDown(idx_type & idx, bool up) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool MathGridInset::idxLeft(idx_type & idx, pos_type & pos) const
|
bool MathGridInset::idxLeft(idx_type & idx, pos_type & pos) const
|
||||||
{
|
{
|
||||||
// leave matrix if on the left hand edge
|
// leave matrix if on the left hand edge
|
||||||
@ -610,8 +610,8 @@ bool MathGridInset::idxLeft(idx_type & idx, pos_type & pos) const
|
|||||||
pos = cell(idx).size();
|
pos = cell(idx).size();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool MathGridInset::idxRight(idx_type & idx, pos_type & pos) const
|
bool MathGridInset::idxRight(idx_type & idx, pos_type & pos) const
|
||||||
{
|
{
|
||||||
// leave matrix if on the right hand edge
|
// leave matrix if on the right hand edge
|
||||||
@ -632,7 +632,7 @@ bool MathGridInset::idxFirst(idx_type & idx, pos_type & pos) const
|
|||||||
case 'b':
|
case 'b':
|
||||||
idx = (nrows() - 1) * ncols();
|
idx = (nrows() - 1) * ncols();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
idx = ((nrows() - 1) / 2) * ncols();
|
idx = ((nrows() - 1) / 2) * ncols();
|
||||||
}
|
}
|
||||||
pos = 0;
|
pos = 0;
|
||||||
@ -714,14 +714,14 @@ void MathGridInset::idxDelete(idx_type & idx, bool & popit, bool & deleteit)
|
|||||||
// move cells if necessary
|
// move cells if necessary
|
||||||
for (idx_type i = index(row(idx), 0); i < idx; ++i)
|
for (idx_type i = index(row(idx), 0); i < idx; ++i)
|
||||||
cell(i).swap(cell(i + ncols()));
|
cell(i).swap(cell(i + ncols()));
|
||||||
|
|
||||||
delRow(row(idx));
|
delRow(row(idx));
|
||||||
|
|
||||||
if (idx >= nargs())
|
if (idx >= nargs())
|
||||||
idx = nargs() - 1;
|
idx = nargs() - 1;
|
||||||
|
|
||||||
// undo effect of Ctrl-Tab (i.e. pull next cell)
|
// undo effect of Ctrl-Tab (i.e. pull next cell)
|
||||||
//if (idx + 1 != nargs())
|
//if (idx + 1 != nargs())
|
||||||
// cell(idx).swap(cell(idx + 1));
|
// cell(idx).swap(cell(idx + 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -772,7 +772,7 @@ void MathGridInset::mathmlize(MathMLStream & os) const
|
|||||||
os << MTag("mtable");
|
os << MTag("mtable");
|
||||||
for (row_type row = 0; row < nrows(); ++row) {
|
for (row_type row = 0; row < nrows(); ++row) {
|
||||||
os << MTag("mtr");
|
os << MTag("mtr");
|
||||||
for (col_type col = 0; col < ncols(); ++col)
|
for (col_type col = 0; col < ncols(); ++col)
|
||||||
os << cell(index(row, col));
|
os << cell(index(row, col));
|
||||||
os << ETag("mtr");
|
os << ETag("mtr");
|
||||||
}
|
}
|
||||||
@ -784,7 +784,7 @@ void MathGridInset::write(WriteStream & os) const
|
|||||||
{
|
{
|
||||||
for (row_type row = 0; row < nrows(); ++row) {
|
for (row_type row = 0; row < nrows(); ++row) {
|
||||||
os << verboseHLine(rowinfo_[row].lines_);
|
os << verboseHLine(rowinfo_[row].lines_);
|
||||||
for (col_type col = 0; col < ncols(); ++col)
|
for (col_type col = 0; col < ncols(); ++col)
|
||||||
os << cell(index(row, col)) << eocString(col);
|
os << cell(index(row, col)) << eocString(col);
|
||||||
os << eolString(row);
|
os << eolString(row);
|
||||||
}
|
}
|
||||||
|
@ -40,7 +40,7 @@ class MathGridInset : public MathNestInset {
|
|||||||
|
|
||||||
// additional per-row information
|
// additional per-row information
|
||||||
struct ColInfo {
|
struct ColInfo {
|
||||||
///
|
///
|
||||||
ColInfo();
|
ColInfo();
|
||||||
/// currently possible: 'l', 'c', 'r'
|
/// currently possible: 'l', 'c', 'r'
|
||||||
char align_;
|
char align_;
|
||||||
@ -50,7 +50,7 @@ class MathGridInset : public MathNestInset {
|
|||||||
mutable int width_;
|
mutable int width_;
|
||||||
/// cached offset
|
/// cached offset
|
||||||
mutable int offset_;
|
mutable int offset_;
|
||||||
/// do we need a line to the left?
|
/// do we need a line to the left?
|
||||||
bool leftline_;
|
bool leftline_;
|
||||||
/// do we need a line to the right?
|
/// do we need a line to the right?
|
||||||
bool rightline_;
|
bool rightline_;
|
||||||
@ -60,7 +60,7 @@ class MathGridInset : public MathNestInset {
|
|||||||
int skip_;
|
int skip_;
|
||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/// constructor from columns description, creates one row
|
/// constructor from columns description, creates one row
|
||||||
MathGridInset(char valign, string const & halign);
|
MathGridInset(char valign, string const & halign);
|
||||||
/// Note: columns first!
|
/// Note: columns first!
|
||||||
@ -131,7 +131,7 @@ public:
|
|||||||
bool idxEnd(idx_type &, pos_type &) const;
|
bool idxEnd(idx_type &, pos_type &) const;
|
||||||
///
|
///
|
||||||
void idxDelete(idx_type &, bool &, bool &);
|
void idxDelete(idx_type &, bool &, bool &);
|
||||||
|
|
||||||
///
|
///
|
||||||
virtual void addRow(row_type);
|
virtual void addRow(row_type);
|
||||||
///
|
///
|
||||||
@ -187,7 +187,7 @@ protected:
|
|||||||
std::vector<RowInfo> rowinfo_;
|
std::vector<RowInfo> rowinfo_;
|
||||||
/// column info
|
/// column info
|
||||||
std::vector<ColInfo> colinfo_;
|
std::vector<ColInfo> colinfo_;
|
||||||
///
|
///
|
||||||
char v_align_; // add approp. type
|
char v_align_; // add approp. type
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ struct key_type {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
key_type wordlist_array[] =
|
key_type wordlist_array[] =
|
||||||
{
|
{
|
||||||
{"!", LM_TK_SPACE, 0},
|
{"!", LM_TK_SPACE, 0},
|
||||||
{"#", LM_TK_SPECIAL, '#'},
|
{"#", LM_TK_SPECIAL, '#'},
|
||||||
|
@ -65,7 +65,7 @@ namespace {
|
|||||||
if (s == "multline") return LM_OT_MULTLINE;
|
if (s == "multline") return LM_OT_MULTLINE;
|
||||||
if (s == "gather") return LM_OT_GATHER;
|
if (s == "gather") return LM_OT_GATHER;
|
||||||
return LM_OT_SIMPLE;
|
return LM_OT_SIMPLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
string normalName(MathInsetTypes t)
|
string normalName(MathInsetTypes t)
|
||||||
@ -83,7 +83,7 @@ namespace {
|
|||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
return "unknown";
|
return "unknown";
|
||||||
}
|
}
|
||||||
|
|
||||||
} // end anon namespace
|
} // end anon namespace
|
||||||
|
|
||||||
@ -165,7 +165,7 @@ void MathHullInset::metrics(MathMetricsInfo const & mi) const
|
|||||||
if (display()) {
|
if (display()) {
|
||||||
ascent_ += 12;
|
ascent_ += 12;
|
||||||
descent_ += 12;
|
descent_ += 12;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (numberedType()) {
|
if (numberedType()) {
|
||||||
whichFont(mi_.font, LM_TC_BF, mi_);
|
whichFont(mi_.font, LM_TC_BF, mi_);
|
||||||
@ -226,13 +226,13 @@ string MathHullInset::label(row_type row) const
|
|||||||
|
|
||||||
void MathHullInset::label(row_type row, string const & label)
|
void MathHullInset::label(row_type row, string const & label)
|
||||||
{
|
{
|
||||||
label_[row] = label;
|
label_[row] = label;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void MathHullInset::numbered(row_type row, bool num)
|
void MathHullInset::numbered(row_type row, bool num)
|
||||||
{
|
{
|
||||||
nonum_[row] = !num;
|
nonum_[row] = !num;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -246,7 +246,7 @@ bool MathHullInset::ams() const
|
|||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
/*
|
/*
|
||||||
return
|
return
|
||||||
objtype_ == LM_OT_ALIGN ||
|
objtype_ == LM_OT_ALIGN ||
|
||||||
objtype_ == LM_OT_MULTLINE ||
|
objtype_ == LM_OT_MULTLINE ||
|
||||||
objtype_ == LM_OT_GATHER ||
|
objtype_ == LM_OT_GATHER ||
|
||||||
@ -315,9 +315,9 @@ void MathHullInset::header_write(WriteStream & os) const
|
|||||||
|
|
||||||
case LM_OT_EQUATION:
|
case LM_OT_EQUATION:
|
||||||
if (n)
|
if (n)
|
||||||
os << "\\begin{equation" << star(n) << "}\n";
|
os << "\\begin{equation" << star(n) << "}\n";
|
||||||
else
|
else
|
||||||
os << "\\[\n";
|
os << "\\[\n";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LM_OT_EQNARRAY:
|
case LM_OT_EQNARRAY:
|
||||||
@ -339,7 +339,7 @@ void MathHullInset::header_write(WriteStream & os) const
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case LM_OT_XXALIGNAT:
|
case LM_OT_XXALIGNAT:
|
||||||
os << "\\begin{xxalignat}"
|
os << "\\begin{xxalignat}"
|
||||||
<< "{" << static_cast<unsigned int>(ncols()/2) << "}\n";
|
<< "{" << static_cast<unsigned int>(ncols()/2) << "}\n";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -368,9 +368,9 @@ void MathHullInset::footer_write(WriteStream & os) const
|
|||||||
|
|
||||||
case LM_OT_EQUATION:
|
case LM_OT_EQUATION:
|
||||||
if (n)
|
if (n)
|
||||||
os << "\\end{equation" << star(n) << "}\n";
|
os << "\\end{equation" << star(n) << "}\n";
|
||||||
else
|
else
|
||||||
os << "\\]\n";
|
os << "\\]\n";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LM_OT_EQNARRAY:
|
case LM_OT_EQNARRAY:
|
||||||
@ -407,7 +407,7 @@ void MathHullInset::footer_write(WriteStream & os) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void MathHullInset::addRow(row_type row)
|
void MathHullInset::addRow(row_type row)
|
||||||
{
|
{
|
||||||
nonum_.insert(nonum_.begin() + row + 1, !numberedType());
|
nonum_.insert(nonum_.begin() + row + 1, !numberedType());
|
||||||
label_.insert(label_.begin() + row + 1, string());
|
label_.insert(label_.begin() + row + 1, string());
|
||||||
@ -423,7 +423,7 @@ void MathHullInset::appendRow()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void MathHullInset::delRow(row_type row)
|
void MathHullInset::delRow(row_type row)
|
||||||
{
|
{
|
||||||
MathGridInset::delRow(row);
|
MathGridInset::delRow(row);
|
||||||
nonum_.erase(nonum_.begin() + row);
|
nonum_.erase(nonum_.begin() + row);
|
||||||
@ -541,7 +541,7 @@ void MathHullInset::mutate(MathInsetTypes newtype)
|
|||||||
setType(LM_OT_SIMPLE);
|
setType(LM_OT_SIMPLE);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LM_OT_ALIGN:
|
case LM_OT_ALIGN:
|
||||||
case LM_OT_ALIGNAT:
|
case LM_OT_ALIGNAT:
|
||||||
case LM_OT_XALIGNAT:
|
case LM_OT_XALIGNAT:
|
||||||
case LM_OT_XXALIGNAT: {
|
case LM_OT_XXALIGNAT: {
|
||||||
@ -549,7 +549,7 @@ void MathHullInset::mutate(MathInsetTypes newtype)
|
|||||||
MathGridInset::addCol(1);
|
MathGridInset::addCol(1);
|
||||||
|
|
||||||
// split it "nicely"
|
// split it "nicely"
|
||||||
pos_type pos = firstRelOp(cell(0));
|
pos_type pos = firstRelOp(cell(0));
|
||||||
cell(1) = cell(0);
|
cell(1) = cell(0);
|
||||||
cell(0).erase(pos, cell(0).size());
|
cell(0).erase(pos, cell(0).size());
|
||||||
cell(1).erase(0, pos);
|
cell(1).erase(0, pos);
|
||||||
@ -564,7 +564,7 @@ void MathHullInset::mutate(MathInsetTypes newtype)
|
|||||||
MathGridInset::addCol(1);
|
MathGridInset::addCol(1);
|
||||||
|
|
||||||
// split it "nicely" on the firest relop
|
// split it "nicely" on the firest relop
|
||||||
pos_type pos = firstRelOp(cell(0));
|
pos_type pos = firstRelOp(cell(0));
|
||||||
cell(1) = MathArray(cell(0), pos, cell(0).size());
|
cell(1) = MathArray(cell(0), pos, cell(0).size());
|
||||||
cell(0).erase(pos, cell(0).size());
|
cell(0).erase(pos, cell(0).size());
|
||||||
|
|
||||||
@ -633,7 +633,7 @@ void MathHullInset::mutate(MathInsetTypes newtype)
|
|||||||
setType(LM_OT_EQNARRAY);
|
setType(LM_OT_EQNARRAY);
|
||||||
mutate(newtype);
|
mutate(newtype);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LM_OT_ALIGNAT:
|
case LM_OT_ALIGNAT:
|
||||||
case LM_OT_XALIGNAT:
|
case LM_OT_XALIGNAT:
|
||||||
case LM_OT_XXALIGNAT:
|
case LM_OT_XXALIGNAT:
|
||||||
@ -684,11 +684,11 @@ void MathHullInset::mutate(MathInsetTypes newtype)
|
|||||||
void MathHullInset::write(WriteStream & os) const
|
void MathHullInset::write(WriteStream & os) const
|
||||||
{
|
{
|
||||||
header_write(os);
|
header_write(os);
|
||||||
|
|
||||||
bool n = numberedType();
|
bool n = numberedType();
|
||||||
|
|
||||||
for (row_type row = 0; row < nrows(); ++row) {
|
for (row_type row = 0; row < nrows(); ++row) {
|
||||||
for (col_type col = 0; col < ncols(); ++col)
|
for (col_type col = 0; col < ncols(); ++col)
|
||||||
os << cell(index(row, col)) << eocString(col);
|
os << cell(index(row, col)) << eocString(col);
|
||||||
if (n) {
|
if (n) {
|
||||||
if (!label_[row].empty())
|
if (!label_[row].empty())
|
||||||
@ -698,7 +698,7 @@ void MathHullInset::write(WriteStream & os) const
|
|||||||
}
|
}
|
||||||
os << eolString(row);
|
os << eolString(row);
|
||||||
}
|
}
|
||||||
|
|
||||||
footer_write(os);
|
footer_write(os);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -722,5 +722,3 @@ void MathHullInset::check() const
|
|||||||
lyx::Assert(nonum_.size() == nrows());
|
lyx::Assert(nonum_.size() == nrows());
|
||||||
lyx::Assert(label_.size() == nrows());
|
lyx::Assert(label_.size() == nrows());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
class LaTeXFeatures;
|
class LaTeXFeatures;
|
||||||
|
|
||||||
class MathHullInset : public MathGridInset {
|
class MathHullInset : public MathGridInset {
|
||||||
public:
|
public:
|
||||||
///
|
///
|
||||||
MathHullInset();
|
MathHullInset();
|
||||||
///
|
///
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
* File: math_inset.C
|
* File: math_inset.C
|
||||||
* Purpose: Implementation of insets for mathed
|
* Purpose: Implementation of insets for mathed
|
||||||
* Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
|
* Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
|
||||||
* Created: January 1996
|
* Created: January 1996
|
||||||
* Description:
|
* Description:
|
||||||
*
|
*
|
||||||
* Dependencies: Xlib, XForms
|
* Dependencies: Xlib, XForms
|
||||||
*
|
*
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
// -*- C++ -*-
|
// -*- C++ -*-
|
||||||
/*
|
/*
|
||||||
* File: math_inset.h
|
* File: math_inset.h
|
||||||
* Purpose: Declaration of insets for mathed
|
* Purpose: Declaration of insets for mathed
|
||||||
* Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
|
* Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
|
||||||
* Created: January 1996
|
* Created: January 1996
|
||||||
* Description: Math paragraph and objects for a WYSIWYG math editor.
|
* Description: Math paragraph and objects for a WYSIWYG math editor.
|
||||||
*
|
*
|
||||||
@ -35,7 +35,7 @@
|
|||||||
|
|
||||||
Abstract base class for all math objects. A math insets is for use of the
|
Abstract base class for all math objects. A math insets is for use of the
|
||||||
math editor only, it isn't a general LyX inset. It's used to represent all
|
math editor only, it isn't a general LyX inset. It's used to represent all
|
||||||
the math objects.
|
the math objects.
|
||||||
|
|
||||||
Math insets do not know there parents, a cursor position or things
|
Math insets do not know there parents, a cursor position or things
|
||||||
like that. The are dumb object that are contained in other math insets
|
like that. The are dumb object that are contained in other math insets
|
||||||
@ -80,7 +80,7 @@ class MathPosFinder;
|
|||||||
|
|
||||||
|
|
||||||
class MathInset {
|
class MathInset {
|
||||||
public:
|
public:
|
||||||
/// short of anything else reasonable
|
/// short of anything else reasonable
|
||||||
typedef MathArray::size_type size_type;
|
typedef MathArray::size_type size_type;
|
||||||
/// type for cursor positions differences within a cell
|
/// type for cursor positions differences within a cell
|
||||||
@ -163,7 +163,7 @@ public:
|
|||||||
virtual MathXArray & xcell(idx_type);
|
virtual MathXArray & xcell(idx_type);
|
||||||
/// return cell plus drawing cache given its number
|
/// return cell plus drawing cache given its number
|
||||||
virtual MathXArray const & xcell(idx_type) const;
|
virtual MathXArray const & xcell(idx_type) const;
|
||||||
|
|
||||||
/// the number of columns of this inset if it is grid-like
|
/// the number of columns of this inset if it is grid-like
|
||||||
virtual col_type ncols() const { return 1; }
|
virtual col_type ncols() const { return 1; }
|
||||||
/// the number of rows of this inset if it is grid-like
|
/// the number of rows of this inset if it is grid-like
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
#include "math_iterator.h"
|
#include "math_iterator.h"
|
||||||
@ -116,7 +115,7 @@ void MathIterator::operator++()
|
|||||||
|
|
||||||
// otherwise leave array, move on one position
|
// otherwise leave array, move on one position
|
||||||
// this might yield pos() == size(), but that's a ok.
|
// this might yield pos() == size(), but that's a ok.
|
||||||
pop();
|
pop();
|
||||||
// it certainly invalidates top
|
// it certainly invalidates top
|
||||||
++position().pos_;
|
++position().pos_;
|
||||||
}
|
}
|
||||||
@ -135,7 +134,7 @@ bool operator==(MathIterator const & it, MathIterator const & jt)
|
|||||||
//lyxerr << "==: " << it.cursor().size() << " " << jt.cursor().size() << endl;
|
//lyxerr << "==: " << it.cursor().size() << " " << jt.cursor().size() << endl;
|
||||||
if (it.cursor().size() != jt.cursor().size())
|
if (it.cursor().size() != jt.cursor().size())
|
||||||
return false;
|
return false;
|
||||||
return it.cursor() == jt.cursor();
|
return it.cursor() == jt.cursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -144,7 +143,7 @@ bool operator!=(MathIterator const & it, MathIterator const & jt)
|
|||||||
//lyxerr << "!=: " << it.cursor().size() << " " << jt.cursor().size() << endl;
|
//lyxerr << "!=: " << it.cursor().size() << " " << jt.cursor().size() << endl;
|
||||||
if (it.cursor().size() != jt.cursor().size())
|
if (it.cursor().size() != jt.cursor().size())
|
||||||
return true;
|
return true;
|
||||||
return it.cursor() != jt.cursor();
|
return it.cursor() != jt.cursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ public:
|
|||||||
/// read access to top most item
|
/// read access to top most item
|
||||||
MathArray const & cell() const;
|
MathArray const & cell() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/// own level down
|
/// own level down
|
||||||
void push(MathInset *);
|
void push(MathInset *);
|
||||||
/// own level up
|
/// own level up
|
||||||
|
@ -59,4 +59,3 @@ void MathKernInset::normalize(NormalStream & os) const
|
|||||||
{
|
{
|
||||||
os << "[kern " << wid_.asLatexString() << "]";
|
os << "[kern " << wid_.asLatexString() << "]";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ void MathLimitOpInset::metrics(MathMetricsInfo const &) const
|
|||||||
|
|
||||||
|
|
||||||
void MathLimitOpInset::draw(Painter &, int, int) const
|
void MathLimitOpInset::draw(Painter &, int, int) const
|
||||||
{
|
{
|
||||||
lyxerr << "should not happen\n";
|
lyxerr << "should not happen\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* File: math_macro.C
|
* File: math_macro.C
|
||||||
* Purpose: Implementation of macro class for mathed
|
* Purpose: Implementation of macro class for mathed
|
||||||
* Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
|
* Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
|
||||||
* Created: November 1996
|
* Created: November 1996
|
||||||
* Description: WYSIWYG math macros
|
* Description: WYSIWYG math macros
|
||||||
*
|
*
|
||||||
@ -98,7 +98,7 @@ void MathMacro::metrics(MathMetricsInfo const & mi) const
|
|||||||
descent_ += max(c.descent(), ldes) + 5;
|
descent_ += max(c.descent(), ldes) + 5;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
expanded_ = tmplate_->xcell(0);
|
expanded_ = tmplate_->xcell(0);
|
||||||
expanded_.data_.substitute(*this);
|
expanded_.data_.substitute(*this);
|
||||||
@ -214,7 +214,7 @@ void MathMacro::octavize(OctaveStream & os) const
|
|||||||
void MathMacro::normalize(NormalStream & os) const
|
void MathMacro::normalize(NormalStream & os) const
|
||||||
{
|
{
|
||||||
os << "[macro " << name() << " ";
|
os << "[macro " << name() << " ";
|
||||||
for (idx_type i = 0; i < nargs(); ++i)
|
for (idx_type i = 0; i < nargs(); ++i)
|
||||||
os << cell(i) << ' ';
|
os << cell(i) << ' ';
|
||||||
os << ']';
|
os << ']';
|
||||||
}
|
}
|
||||||
@ -225,7 +225,7 @@ void MathMacro::write(WriteStream & os) const
|
|||||||
os << '\\' << name();
|
os << '\\' << name();
|
||||||
for (idx_type i = 0; i < nargs(); ++i)
|
for (idx_type i = 0; i < nargs(); ++i)
|
||||||
os << '{' << cell(i) << '}';
|
os << '{' << cell(i) << '}';
|
||||||
if (nargs() == 0)
|
if (nargs() == 0)
|
||||||
os << ' ';
|
os << ' ';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
// -*- C++ -*-
|
// -*- C++ -*-
|
||||||
/*
|
/*
|
||||||
* File: math_macro.h
|
* File: math_macro.h
|
||||||
* Purpose: Declaration of macro class for mathed
|
* Purpose: Declaration of macro class for mathed
|
||||||
* Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
|
* Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
|
||||||
* Created: November 1996
|
* Created: November 1996
|
||||||
* Description: WYSIWYG math macros
|
* Description: WYSIWYG math macros
|
||||||
*
|
*
|
||||||
|
@ -77,4 +77,3 @@ void MathMacroArgument::substitute(MathMacro const & m)
|
|||||||
it->nucleus()->handleFont(code_);
|
it->nucleus()->handleFont(code_);
|
||||||
expanded_ = true;
|
expanded_ = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,14 +35,14 @@ void MathMacroTable::dump()
|
|||||||
MathAtom & MathMacroTable::provide(string const & name)
|
MathAtom & MathMacroTable::provide(string const & name)
|
||||||
{
|
{
|
||||||
builtinMacros();
|
builtinMacros();
|
||||||
|
|
||||||
table_type::iterator pos = macro_table.find(name);
|
table_type::iterator pos = macro_table.find(name);
|
||||||
|
|
||||||
if (pos == macro_table.end()) {
|
if (pos == macro_table.end()) {
|
||||||
lyxerr << "MathMacroTable::provideTemplate: no template with name '"
|
lyxerr << "MathMacroTable::provideTemplate: no template with name '"
|
||||||
<< name << "' available.\n";
|
<< name << "' available.\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
return pos->second;
|
return pos->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -75,9 +75,9 @@ bool MathMacroTable::has(string const & name)
|
|||||||
void MathMacroTable::builtinMacros()
|
void MathMacroTable::builtinMacros()
|
||||||
{
|
{
|
||||||
static bool built = false;
|
static bool built = false;
|
||||||
|
|
||||||
if (built)
|
if (built)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
built = true;
|
built = true;
|
||||||
//lyxerr[Debug::MATHED] << "Building macros\n";
|
//lyxerr[Debug::MATHED] << "Building macros\n";
|
||||||
|
@ -14,7 +14,7 @@ class MathMacro;
|
|||||||
/** This class contains the macro definition
|
/** This class contains the macro definition
|
||||||
\author Alejandro Aguilar Sierra
|
\author Alejandro Aguilar Sierra
|
||||||
*/
|
*/
|
||||||
//class MathMacroTemplate : public MathInset, boost::noncopyable
|
//class MathMacroTemplate : public MathInset, boost::noncopyable
|
||||||
|
|
||||||
class MathMacroTemplate : public MathNestInset {
|
class MathMacroTemplate : public MathNestInset {
|
||||||
public:
|
public:
|
||||||
|
@ -56,7 +56,7 @@ void MathMatrixInset::octavize(OctaveStream & os) const
|
|||||||
if (row)
|
if (row)
|
||||||
os << ';';
|
os << ';';
|
||||||
os << '[';
|
os << '[';
|
||||||
for (col_type col = 0; col < ncols(); ++col)
|
for (col_type col = 0; col < ncols(); ++col)
|
||||||
os << cell(index(row, col)) << ' ';
|
os << cell(index(row, col)) << ' ';
|
||||||
os << ']';
|
os << ']';
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
// "shortcut" for DelimInset("(",ArrayInset,")")
|
// "shortcut" for DelimInset("(",ArrayInset,")")
|
||||||
|
|
||||||
class MathMatrixInset : public MathArrayInset {
|
class MathMatrixInset : public MathArrayInset {
|
||||||
public:
|
public:
|
||||||
///
|
///
|
||||||
MathMatrixInset(MathArrayInset const &);
|
MathMatrixInset(MathArrayInset const &);
|
||||||
///
|
///
|
||||||
|
@ -182,4 +182,3 @@ bool MathNestInset::editing() const
|
|||||||
{
|
{
|
||||||
return mathcursor && mathcursor->isInside(this);
|
return mathcursor && mathcursor->isInside(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,14 +16,14 @@
|
|||||||
class LaTeXFeatures;
|
class LaTeXFeatures;
|
||||||
|
|
||||||
class MathNestInset : public MathDimInset {
|
class MathNestInset : public MathDimInset {
|
||||||
public:
|
public:
|
||||||
/// nestinsets have a fixed size to start with
|
/// nestinsets have a fixed size to start with
|
||||||
explicit MathNestInset(idx_type ncells);
|
explicit MathNestInset(idx_type ncells);
|
||||||
|
|
||||||
/// the size is usuall some sort of convex hull of the cells
|
/// the size is usuall some sort of convex hull of the cells
|
||||||
void metrics(MathMetricsInfo const & st) const;
|
void metrics(MathMetricsInfo const & st) const;
|
||||||
/// appends itself with macro arguments substituted
|
/// appends itself with macro arguments substituted
|
||||||
void substitute(MathMacro const & macro);
|
void substitute(MathMacro const & macro);
|
||||||
/// identifies NestInsets
|
/// identifies NestInsets
|
||||||
MathNestInset * asNestInset() { return this; }
|
MathNestInset * asNestInset() { return this; }
|
||||||
|
|
||||||
@ -58,7 +58,7 @@ public:
|
|||||||
MathXArray & xcell(idx_type);
|
MathXArray & xcell(idx_type);
|
||||||
/// direct access to the cell including the drawing cache
|
/// direct access to the cell including the drawing cache
|
||||||
MathXArray const & xcell(idx_type) const;
|
MathXArray const & xcell(idx_type) const;
|
||||||
|
|
||||||
/// can we move into this cell (see macroarg.h)
|
/// can we move into this cell (see macroarg.h)
|
||||||
bool isActive() const { return nargs() > 0; }
|
bool isActive() const { return nargs() > 0; }
|
||||||
/// request "external features"
|
/// request "external features"
|
||||||
|
@ -41,7 +41,7 @@ void MathNotInset::metrics(MathMetricsInfo const & mi) const
|
|||||||
|
|
||||||
|
|
||||||
void MathNotInset::draw(Painter & pain, int x, int y) const
|
void MathNotInset::draw(Painter & pain, int x, int y) const
|
||||||
{
|
{
|
||||||
if (math_font_available(LM_TC_CMSY))
|
if (math_font_available(LM_TC_CMSY))
|
||||||
drawChar(pain, font_, x, y, 54);
|
drawChar(pain, font_, x, y, 54);
|
||||||
else
|
else
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* File: math_parser.C
|
* File: math_parser.C
|
||||||
* Purpose: Parser for mathed
|
* Purpose: Parser for mathed
|
||||||
* Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
|
* Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
|
||||||
* Created: January 1996
|
* Created: January 1996
|
||||||
* Description: Parse LaTeX2e math mode code.
|
* Description: Parse LaTeX2e math mode code.
|
||||||
*
|
*
|
||||||
@ -15,7 +15,7 @@
|
|||||||
* the GNU General Public Licence version 2 or later.
|
* the GNU General Public Licence version 2 or later.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
||||||
If someone desperately needs partial "structures" (such as a few cells of
|
If someone desperately needs partial "structures" (such as a few cells of
|
||||||
an array inset or similar) (s)he could uses the following hack as starting
|
an array inset or similar) (s)he could uses the following hack as starting
|
||||||
@ -109,7 +109,7 @@ void add(MathArray & ar, char c, MathTextCodes code)
|
|||||||
|
|
||||||
// These are TeX's catcodes
|
// These are TeX's catcodes
|
||||||
enum CatCode {
|
enum CatCode {
|
||||||
catEscape, // 0 backslash
|
catEscape, // 0 backslash
|
||||||
catBegin, // 1 {
|
catBegin, // 1 {
|
||||||
catEnd, // 2 }
|
catEnd, // 2 }
|
||||||
catMath, // 3 $
|
catMath, // 3 $
|
||||||
@ -118,7 +118,7 @@ enum CatCode {
|
|||||||
catParameter, // 6 #
|
catParameter, // 6 #
|
||||||
catSuper, // 7 ^
|
catSuper, // 7 ^
|
||||||
catSub, // 8 _
|
catSub, // 8 _
|
||||||
catIgnore, // 9
|
catIgnore, // 9
|
||||||
catSpace, // 10 space
|
catSpace, // 10 space
|
||||||
catLetter, // 11 a-zA-Z
|
catLetter, // 11 a-zA-Z
|
||||||
catOther, // 12 none of the above
|
catOther, // 12 none of the above
|
||||||
@ -127,7 +127,7 @@ enum CatCode {
|
|||||||
catInvalid // 15 <delete>
|
catInvalid // 15 <delete>
|
||||||
};
|
};
|
||||||
|
|
||||||
CatCode theCatcode[256];
|
CatCode theCatcode[256];
|
||||||
|
|
||||||
|
|
||||||
inline CatCode catcode(unsigned char c)
|
inline CatCode catcode(unsigned char c)
|
||||||
@ -155,21 +155,21 @@ void catInit()
|
|||||||
fill(theCatcode + 'a', theCatcode + 'z' + 1, catLetter);
|
fill(theCatcode + 'a', theCatcode + 'z' + 1, catLetter);
|
||||||
fill(theCatcode + 'A', theCatcode + 'Z' + 1, catLetter);
|
fill(theCatcode + 'A', theCatcode + 'Z' + 1, catLetter);
|
||||||
|
|
||||||
theCatcode['\\'] = catEscape;
|
theCatcode['\\'] = catEscape;
|
||||||
theCatcode['{'] = catBegin;
|
theCatcode['{'] = catBegin;
|
||||||
theCatcode['}'] = catEnd;
|
theCatcode['}'] = catEnd;
|
||||||
theCatcode['$'] = catMath;
|
theCatcode['$'] = catMath;
|
||||||
theCatcode['&'] = catAlign;
|
theCatcode['&'] = catAlign;
|
||||||
theCatcode['\n'] = catNewline;
|
theCatcode['\n'] = catNewline;
|
||||||
theCatcode['#'] = catParameter;
|
theCatcode['#'] = catParameter;
|
||||||
theCatcode['^'] = catSuper;
|
theCatcode['^'] = catSuper;
|
||||||
theCatcode['_'] = catSub;
|
theCatcode['_'] = catSub;
|
||||||
theCatcode[''] = catIgnore;
|
theCatcode[''] = catIgnore;
|
||||||
theCatcode[' '] = catSpace;
|
theCatcode[' '] = catSpace;
|
||||||
theCatcode['\t'] = catSpace;
|
theCatcode['\t'] = catSpace;
|
||||||
theCatcode['\r'] = catSpace;
|
theCatcode['\r'] = catSpace;
|
||||||
theCatcode['~'] = catActive;
|
theCatcode['~'] = catActive;
|
||||||
theCatcode['%'] = catComment;
|
theCatcode['%'] = catComment;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -198,7 +198,7 @@ public:
|
|||||||
///
|
///
|
||||||
bool isCR() const;
|
bool isCR() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
///
|
///
|
||||||
string cs_;
|
string cs_;
|
||||||
///
|
///
|
||||||
@ -221,7 +221,7 @@ string Token::asString() const
|
|||||||
//bool operator==(Token const & s, Token const & t)
|
//bool operator==(Token const & s, Token const & t)
|
||||||
//{
|
//{
|
||||||
// return s.character() == t.character()
|
// return s.character() == t.character()
|
||||||
// && s.cat() == t.cat() && s.cs() == t.cs();
|
// && s.cat() == t.cat() && s.cs() == t.cs();
|
||||||
//}
|
//}
|
||||||
//
|
//
|
||||||
//bool operator!=(Token const & s, Token const & t)
|
//bool operator!=(Token const & s, Token const & t)
|
||||||
@ -433,9 +433,9 @@ string Parser::getArg(char lf, char rg)
|
|||||||
string result;
|
string result;
|
||||||
char c = getChar();
|
char c = getChar();
|
||||||
|
|
||||||
if (c != lf)
|
if (c != lf)
|
||||||
putback();
|
putback();
|
||||||
else
|
else
|
||||||
while ((c = getChar()) != rg && good())
|
while ((c = getChar()) != rg && good())
|
||||||
result += c;
|
result += c;
|
||||||
|
|
||||||
@ -476,7 +476,7 @@ void Parser::skipSpaceTokens(istream & is, char c)
|
|||||||
void Parser::tokenize(string const & buffer)
|
void Parser::tokenize(string const & buffer)
|
||||||
{
|
{
|
||||||
static bool init_done = false;
|
static bool init_done = false;
|
||||||
|
|
||||||
if (!init_done) {
|
if (!init_done) {
|
||||||
catInit();
|
catInit();
|
||||||
init_done = true;
|
init_done = true;
|
||||||
@ -490,13 +490,13 @@ void Parser::tokenize(string const & buffer)
|
|||||||
|
|
||||||
switch (catcode(c)) {
|
switch (catcode(c)) {
|
||||||
case catNewline: {
|
case catNewline: {
|
||||||
++lineno_;
|
++lineno_;
|
||||||
is.get(c);
|
is.get(c);
|
||||||
if (catcode(c) == catNewline)
|
if (catcode(c) == catNewline)
|
||||||
; //push_back(Token("par"));
|
; //push_back(Token("par"));
|
||||||
else {
|
else {
|
||||||
push_back(Token(' ', catSpace));
|
push_back(Token(' ', catSpace));
|
||||||
is.putback(c);
|
is.putback(c);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -504,7 +504,7 @@ void Parser::tokenize(string const & buffer)
|
|||||||
case catComment: {
|
case catComment: {
|
||||||
while (is.get(c) && catcode(c) != catNewline)
|
while (is.get(c) && catcode(c) != catNewline)
|
||||||
;
|
;
|
||||||
++lineno_;
|
++lineno_;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -519,7 +519,7 @@ void Parser::tokenize(string const & buffer)
|
|||||||
while (is.get(c) && catcode(c) == catLetter)
|
while (is.get(c) && catcode(c) == catLetter)
|
||||||
s += c;
|
s += c;
|
||||||
skipSpaceTokens(is, c);
|
skipSpaceTokens(is, c);
|
||||||
}
|
}
|
||||||
push_back(Token(s));
|
push_back(Token(s));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -558,7 +558,7 @@ void Parser::dump() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Parser::error(string const & msg)
|
void Parser::error(string const & msg)
|
||||||
{
|
{
|
||||||
lyxerr << "Line ~" << lineno_ << ": Math parse error: " << msg << endl;
|
lyxerr << "Line ~" << lineno_ << ": Math parse error: " << msg << endl;
|
||||||
dump();
|
dump();
|
||||||
@ -568,7 +568,7 @@ void Parser::error(string const & msg)
|
|||||||
|
|
||||||
|
|
||||||
bool Parser::parse_lines(MathAtom & t, bool numbered, bool outmost)
|
bool Parser::parse_lines(MathAtom & t, bool numbered, bool outmost)
|
||||||
{
|
{
|
||||||
MathGridInset * p = t->asGridInset();
|
MathGridInset * p = t->asGridInset();
|
||||||
if (!p) {
|
if (!p) {
|
||||||
dump();
|
dump();
|
||||||
@ -593,7 +593,7 @@ bool Parser::parse_lines(MathAtom & t, bool numbered, bool outmost)
|
|||||||
//lyxerr << "reading cell " << row << " " << col << " "
|
//lyxerr << "reading cell " << row << " " << col << " "
|
||||||
// << p->ncols() << "\n";
|
// << p->ncols() << "\n";
|
||||||
//lyxerr << "ncols: " << p->ncols() << "\n";
|
//lyxerr << "ncols: " << p->ncols() << "\n";
|
||||||
|
|
||||||
if (col >= p->ncols()) {
|
if (col >= p->ncols()) {
|
||||||
//lyxerr << "adding col " << col << "\n";
|
//lyxerr << "adding col " << col << "\n";
|
||||||
p->addCol(p->ncols());
|
p->addCol(p->ncols());
|
||||||
@ -612,7 +612,7 @@ bool Parser::parse_lines(MathAtom & t, bool numbered, bool outmost)
|
|||||||
// << row << " " << col << "\n";
|
// << row << " " << col << "\n";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// skip the ampersand
|
// skip the ampersand
|
||||||
getToken();
|
getToken();
|
||||||
}
|
}
|
||||||
@ -666,7 +666,7 @@ bool Parser::parse_lines(MathAtom & t, bool numbered, bool outmost)
|
|||||||
|
|
||||||
|
|
||||||
bool Parser::parse_lines2(MathAtom & t, bool braced)
|
bool Parser::parse_lines2(MathAtom & t, bool braced)
|
||||||
{
|
{
|
||||||
MathGridInset * p = t->asGridInset();
|
MathGridInset * p = t->asGridInset();
|
||||||
if (!p) {
|
if (!p) {
|
||||||
lyxerr << "error in Parser::parse_lines() 1\n";
|
lyxerr << "error in Parser::parse_lines() 1\n";
|
||||||
@ -677,7 +677,7 @@ bool Parser::parse_lines2(MathAtom & t, bool braced)
|
|||||||
// reading a row
|
// reading a row
|
||||||
for (MathInset::col_type col = 0; true; ++col) {
|
for (MathInset::col_type col = 0; true; ++col) {
|
||||||
//lyxerr << "reading cell " << row << " " << col << " " << p->ncols() << "\n";
|
//lyxerr << "reading cell " << row << " " << col << " " << p->ncols() << "\n";
|
||||||
|
|
||||||
if (col >= p->ncols()) {
|
if (col >= p->ncols()) {
|
||||||
//lyxerr << "adding col " << col << "\n";
|
//lyxerr << "adding col " << col << "\n";
|
||||||
p->addCol(p->ncols());
|
p->addCol(p->ncols());
|
||||||
@ -691,7 +691,7 @@ bool Parser::parse_lines2(MathAtom & t, bool braced)
|
|||||||
//lyxerr << "less cells read than normal in row/col: " << row << " " << col << "\n";
|
//lyxerr << "less cells read than normal in row/col: " << row << " " << col << "\n";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// skip the ampersand
|
// skip the ampersand
|
||||||
getToken();
|
getToken();
|
||||||
}
|
}
|
||||||
@ -750,7 +750,7 @@ bool Parser::parse_macro(string & name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
string arg = getArg('[', ']');
|
string arg = getArg('[', ']');
|
||||||
int narg = arg.empty() ? 0 : atoi(arg.c_str());
|
int narg = arg.empty() ? 0 : atoi(arg.c_str());
|
||||||
|
|
||||||
if (getToken().cat() != catBegin) {
|
if (getToken().cat() != catBegin) {
|
||||||
lyxerr << "'{' in \\newcommand expected (2)\n";
|
lyxerr << "'{' in \\newcommand expected (2)\n";
|
||||||
@ -906,7 +906,7 @@ void Parser::parse_into1(MathArray & array, unsigned flags, MathTextCodes code)
|
|||||||
|
|
||||||
while (good()) {
|
while (good()) {
|
||||||
Token const & t = getToken();
|
Token const & t = getToken();
|
||||||
|
|
||||||
#ifdef FILEDEBUG
|
#ifdef FILEDEBUG
|
||||||
lyxerr << "t: " << t << " flags: " << flags << "\n";
|
lyxerr << "t: " << t << " flags: " << flags << "\n";
|
||||||
//array.dump();
|
//array.dump();
|
||||||
@ -918,7 +918,7 @@ void Parser::parse_into1(MathArray & array, unsigned flags, MathTextCodes code)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
flags &= ~FLAG_ITEM;
|
flags &= ~FLAG_ITEM;
|
||||||
if (t.cat() == catBegin) {
|
if (t.cat() == catBegin) {
|
||||||
// skip the brace and collect everything to the next matching
|
// skip the brace and collect everything to the next matching
|
||||||
// closing brace
|
// closing brace
|
||||||
flags |= FLAG_BRACE_LAST;
|
flags |= FLAG_BRACE_LAST;
|
||||||
@ -978,7 +978,7 @@ void Parser::parse_into1(MathArray & array, unsigned flags, MathTextCodes code)
|
|||||||
// ignore braces around simple items
|
// ignore braces around simple items
|
||||||
if ((ar.size() == 1 && !ar.front()->needsBraces()
|
if ((ar.size() == 1 && !ar.front()->needsBraces()
|
||||||
|| (ar.size() == 2 && !ar.front()->needsBraces()
|
|| (ar.size() == 2 && !ar.front()->needsBraces()
|
||||||
&& ar.back()->asScriptInset()))
|
&& ar.back()->asScriptInset()))
|
||||||
|| (ar.size() == 0 && array.size() == 0))
|
|| (ar.size() == 0 && array.size() == 0))
|
||||||
{
|
{
|
||||||
array.push_back(ar);
|
array.push_back(ar);
|
||||||
@ -996,17 +996,17 @@ void Parser::parse_into1(MathArray & array, unsigned flags, MathTextCodes code)
|
|||||||
lyx::Assert(0);
|
lyx::Assert(0);
|
||||||
add(array, '}', LM_TC_TEX);
|
add(array, '}', LM_TC_TEX);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (t.cat() == catAlign) {
|
else if (t.cat() == catAlign) {
|
||||||
lyxerr << "found tab unexpectedly, array: '" << array << "'\n";
|
lyxerr << "found tab unexpectedly, array: '" << array << "'\n";
|
||||||
//lyxerr << "found tab unexpectedly\n";
|
//lyxerr << "found tab unexpectedly\n";
|
||||||
add(array, '&', LM_TC_TEX);
|
add(array, '&', LM_TC_TEX);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (t.cat() == catSuper || t.cat() == catSub) {
|
else if (t.cat() == catSuper || t.cat() == catSub) {
|
||||||
bool up = (t.cat() == catSuper);
|
bool up = (t.cat() == catSuper);
|
||||||
MathScriptInset * p = 0;
|
MathScriptInset * p = 0;
|
||||||
if (array.size())
|
if (array.size())
|
||||||
p = array.back()->asScriptInset();
|
p = array.back()->asScriptInset();
|
||||||
if (!p || p->has(up)) {
|
if (!p || p->has(up)) {
|
||||||
array.push_back(MathAtom(new MathScriptInset(up)));
|
array.push_back(MathAtom(new MathScriptInset(up)));
|
||||||
@ -1023,12 +1023,12 @@ void Parser::parse_into1(MathArray & array, unsigned flags, MathTextCodes code)
|
|||||||
|
|
||||||
else if (t.cat() == catOther)
|
else if (t.cat() == catOther)
|
||||||
add(array, t.character(), code);
|
add(array, t.character(), code);
|
||||||
|
|
||||||
//
|
//
|
||||||
// control sequences
|
// control sequences
|
||||||
//
|
//
|
||||||
else if (t.cs() == "protect")
|
else if (t.cs() == "protect")
|
||||||
// ignore \\protect, will be re-added during output
|
// ignore \\protect, will be re-added during output
|
||||||
;
|
;
|
||||||
|
|
||||||
else if (t.cs() == "end")
|
else if (t.cs() == "end")
|
||||||
@ -1046,13 +1046,13 @@ void Parser::parse_into1(MathArray & array, unsigned flags, MathTextCodes code)
|
|||||||
lyxerr << "found newline unexpectedly\n";
|
lyxerr << "found newline unexpectedly\n";
|
||||||
array.push_back(createMathInset("\\"));
|
array.push_back(createMathInset("\\"));
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (t.cs() == "limits")
|
else if (t.cs() == "limits")
|
||||||
limits = 1;
|
limits = 1;
|
||||||
|
|
||||||
else if (t.cs() == "nolimits")
|
else if (t.cs() == "nolimits")
|
||||||
limits = -1;
|
limits = -1;
|
||||||
|
|
||||||
else if (t.cs() == "nonumber")
|
else if (t.cs() == "nonumber")
|
||||||
curr_num_ = false;
|
curr_num_ = false;
|
||||||
|
|
||||||
@ -1071,7 +1071,7 @@ void Parser::parse_into1(MathArray & array, unsigned flags, MathTextCodes code)
|
|||||||
parse_into(array.back()->cell(0), FLAG_ITEM);
|
parse_into(array.back()->cell(0), FLAG_ITEM);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (t.cs() == "left") {
|
else if (t.cs() == "left") {
|
||||||
string l = getToken().asString();
|
string l = getToken().asString();
|
||||||
MathArray ar;
|
MathArray ar;
|
||||||
@ -1081,7 +1081,7 @@ void Parser::parse_into1(MathArray & array, unsigned flags, MathTextCodes code)
|
|||||||
dl->cell(0) = ar;
|
dl->cell(0) = ar;
|
||||||
array.push_back(dl);
|
array.push_back(dl);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (t.cs() == "right") {
|
else if (t.cs() == "right") {
|
||||||
if (!(flags & FLAG_RIGHT)) {
|
if (!(flags & FLAG_RIGHT)) {
|
||||||
//lyxerr << "got so far: '" << array << "'\n";
|
//lyxerr << "got so far: '" << array << "'\n";
|
||||||
@ -1091,24 +1091,24 @@ void Parser::parse_into1(MathArray & array, unsigned flags, MathTextCodes code)
|
|||||||
}
|
}
|
||||||
|
|
||||||
else if (t.cs() == "begin") {
|
else if (t.cs() == "begin") {
|
||||||
string const name = getArg('{', '}');
|
string const name = getArg('{', '}');
|
||||||
if (name == "array" || name == "subarray") {
|
if (name == "array" || name == "subarray") {
|
||||||
string const valign = getArg('[', ']') + 'c';
|
string const valign = getArg('[', ']') + 'c';
|
||||||
string const halign = getArg('{', '}');
|
string const halign = getArg('{', '}');
|
||||||
array.push_back(MathAtom(new MathArrayInset(name, valign[0], halign)));
|
array.push_back(MathAtom(new MathArrayInset(name, valign[0], halign)));
|
||||||
parse_lines(array.back(), false, false);
|
parse_lines(array.back(), false, false);
|
||||||
} else if (name == "split" || name == "cases" ||
|
} else if (name == "split" || name == "cases" ||
|
||||||
name == "gathered" || name == "aligned") {
|
name == "gathered" || name == "aligned") {
|
||||||
array.push_back(createMathInset(name));
|
array.push_back(createMathInset(name));
|
||||||
parse_lines(array.back(), false, false);
|
parse_lines(array.back(), false, false);
|
||||||
} else if (name == "matrix" || name == "pmatrix" || name == "bmatrix" ||
|
} else if (name == "matrix" || name == "pmatrix" || name == "bmatrix" ||
|
||||||
name == "vmatrix" || name == "Vmatrix") {
|
name == "vmatrix" || name == "Vmatrix") {
|
||||||
array.push_back(createMathInset(name));
|
array.push_back(createMathInset(name));
|
||||||
parse_lines2(array.back(), false);
|
parse_lines2(array.back(), false);
|
||||||
} else
|
} else
|
||||||
lyxerr << "unknow math inset begin '" << name << "'\n";
|
lyxerr << "unknow math inset begin '" << name << "'\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (t.cs() == "kern") {
|
else if (t.cs() == "kern") {
|
||||||
#ifdef WITH_WARNINGS
|
#ifdef WITH_WARNINGS
|
||||||
#warning A hack...
|
#warning A hack...
|
||||||
@ -1117,7 +1117,7 @@ void Parser::parse_into1(MathArray & array, unsigned flags, MathTextCodes code)
|
|||||||
while (1) {
|
while (1) {
|
||||||
Token const & t = getToken();
|
Token const & t = getToken();
|
||||||
if (!good()) {
|
if (!good()) {
|
||||||
putback();
|
putback();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
s += t.character();
|
s += t.character();
|
||||||
@ -1183,13 +1183,13 @@ void Parser::parse_into1(MathArray & array, unsigned flags, MathTextCodes code)
|
|||||||
//array.push_back(createMathInset(t.cs()));
|
//array.push_back(createMathInset(t.cs()));
|
||||||
array.push_back(MathAtom(new MathBoxInset(t.cs())));
|
array.push_back(MathAtom(new MathBoxInset(t.cs())));
|
||||||
// slurp in the argument of mbox
|
// slurp in the argument of mbox
|
||||||
|
|
||||||
MathBoxInset * p = array.back()->asBoxInset();
|
MathBoxInset * p = array.back()->asBoxInset();
|
||||||
//lyx::assert(p);
|
//lyx::assert(p);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
else if (t.cs().size()) {
|
else if (t.cs().size()) {
|
||||||
latexkeys const * l = in_word_set(t.cs());
|
latexkeys const * l = in_word_set(t.cs());
|
||||||
if (l) {
|
if (l) {
|
||||||
@ -1197,8 +1197,8 @@ void Parser::parse_into1(MathArray & array, unsigned flags, MathTextCodes code)
|
|||||||
//lyxerr << "starting font\n";
|
//lyxerr << "starting font\n";
|
||||||
//CatCode catSpaceSave = theCatcode[' '];
|
//CatCode catSpaceSave = theCatcode[' '];
|
||||||
//if (l->id == LM_TC_TEXTRM) {
|
//if (l->id == LM_TC_TEXTRM) {
|
||||||
// // temporarily change catcode
|
// // temporarily change catcode
|
||||||
// theCatcode[' '] = catLetter;
|
// theCatcode[' '] = catLetter;
|
||||||
//}
|
//}
|
||||||
|
|
||||||
MathArray ar;
|
MathArray ar;
|
||||||
@ -1229,7 +1229,7 @@ void Parser::parse_into1(MathArray & array, unsigned flags, MathTextCodes code)
|
|||||||
|
|
||||||
else {
|
else {
|
||||||
MathAtom p = createMathInset(t.cs());
|
MathAtom p = createMathInset(t.cs());
|
||||||
for (MathInset::idx_type i = 0; i < p->nargs(); ++i)
|
for (MathInset::idx_type i = 0; i < p->nargs(); ++i)
|
||||||
parse_into(p->cell(i), FLAG_ITEM);
|
parse_into(p->cell(i), FLAG_ITEM);
|
||||||
array.push_back(p);
|
array.push_back(p);
|
||||||
}
|
}
|
||||||
@ -1252,7 +1252,7 @@ void Parser::parse_into1(MathArray & array, unsigned flags, MathTextCodes code)
|
|||||||
|
|
||||||
if (panic) {
|
if (panic) {
|
||||||
lyxerr << " Math Panic, expect problems!\n";
|
lyxerr << " Math Panic, expect problems!\n";
|
||||||
// Search for the end command.
|
// Search for the end command.
|
||||||
Token t;
|
Token t;
|
||||||
do {
|
do {
|
||||||
t = getToken();
|
t = getToken();
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
/*
|
/*
|
||||||
* File: math_parser.h
|
* File: math_parser.h
|
||||||
* Purpose: Declaration of parsing utilities for mathed
|
* Purpose: Declaration of parsing utilities for mathed
|
||||||
* Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
|
* Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
|
||||||
* Created: January 1996
|
* Created: January 1996
|
||||||
* Description: Parse LaTeX2e math mode code.
|
* Description: Parse LaTeX2e math mode code.
|
||||||
*
|
*
|
||||||
@ -100,7 +100,7 @@ enum MathTokenEnum
|
|||||||
///
|
///
|
||||||
LM_TK_SPECIAL,
|
LM_TK_SPECIAL,
|
||||||
///
|
///
|
||||||
LM_TK_ARGUMENT,
|
LM_TK_ARGUMENT,
|
||||||
///
|
///
|
||||||
LM_TK_NEWCOMMAND,
|
LM_TK_NEWCOMMAND,
|
||||||
///
|
///
|
||||||
|
@ -92,5 +92,3 @@ bool operator<(MathCursorPos const & p, MathCursorPos const & q)
|
|||||||
return p.idx_ < q.idx_;
|
return p.idx_ < q.idx_;
|
||||||
return p.pos_ < q.pos_;
|
return p.pos_ < q.pos_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -5,12 +5,12 @@
|
|||||||
#include "math_xdata.h"
|
#include "math_xdata.h"
|
||||||
|
|
||||||
|
|
||||||
/// Description of a position
|
/// Description of a position
|
||||||
class MathCursorPos {
|
class MathCursorPos {
|
||||||
public:
|
public:
|
||||||
///
|
///
|
||||||
MathCursorPos();
|
MathCursorPos();
|
||||||
///
|
///
|
||||||
explicit MathCursorPos(MathInset *);
|
explicit MathCursorPos(MathInset *);
|
||||||
|
|
||||||
/// returns cell corresponding to this position
|
/// returns cell corresponding to this position
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* File: math_root.C
|
* File: math_root.C
|
||||||
* Purpose: Implementation of the root object
|
* Purpose: Implementation of the root object
|
||||||
* Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
|
* Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
|
||||||
* Created: January 1999
|
* Created: January 1999
|
||||||
* Description: Root math object
|
* Description: Root math object
|
||||||
*
|
*
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
// -*- C++ -*-
|
// -*- C++ -*-
|
||||||
/*
|
/*
|
||||||
* File: math_root.h
|
* File: math_root.h
|
||||||
* Purpose: Declaration of the root object
|
* Purpose: Declaration of the root object
|
||||||
* Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
|
* Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
|
||||||
* Created: January 1999
|
* Created: January 1999
|
||||||
* Description: Root math object
|
* Description: Root math object
|
||||||
*
|
*
|
||||||
|
@ -85,7 +85,7 @@ int MathScriptInset::dy0(MathInset const * nuc) const
|
|||||||
int des = down().ascent();
|
int des = down().ascent();
|
||||||
if (hasLimits(nuc))
|
if (hasLimits(nuc))
|
||||||
des += nd + 2;
|
des += nd + 2;
|
||||||
else
|
else
|
||||||
des = max(des, nd);
|
des = max(des, nd);
|
||||||
return des;
|
return des;
|
||||||
}
|
}
|
||||||
@ -99,7 +99,7 @@ int MathScriptInset::dy1(MathInset const * nuc) const
|
|||||||
int asc = up().descent();
|
int asc = up().descent();
|
||||||
if (hasLimits(nuc))
|
if (hasLimits(nuc))
|
||||||
asc += na + 2;
|
asc += na + 2;
|
||||||
else
|
else
|
||||||
asc = max(asc, na);
|
asc = max(asc, na);
|
||||||
asc = max(asc, mathed_char_ascent(font_, 'I'));
|
asc = max(asc, mathed_char_ascent(font_, 'I'));
|
||||||
return asc;
|
return asc;
|
||||||
@ -178,14 +178,14 @@ int MathScriptInset::ndes(MathInset const * nuc) const
|
|||||||
|
|
||||||
|
|
||||||
void MathScriptInset::metrics(MathMetricsInfo const & mi) const
|
void MathScriptInset::metrics(MathMetricsInfo const & mi) const
|
||||||
{
|
{
|
||||||
metrics(0, mi);
|
metrics(0, mi);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void MathScriptInset::metrics(MathInset const * nuc,
|
void MathScriptInset::metrics(MathInset const * nuc,
|
||||||
MathMetricsInfo const & mi) const
|
MathMetricsInfo const & mi) const
|
||||||
{
|
{
|
||||||
MathMetricsInfo m = mi;
|
MathMetricsInfo m = mi;
|
||||||
smallerStyleScript(m);
|
smallerStyleScript(m);
|
||||||
MathNestInset::metrics(m);
|
MathNestInset::metrics(m);
|
||||||
@ -199,21 +199,21 @@ void MathScriptInset::metrics(MathInset const * nuc,
|
|||||||
|
|
||||||
|
|
||||||
void MathScriptInset::draw(Painter & pain, int x, int y) const
|
void MathScriptInset::draw(Painter & pain, int x, int y) const
|
||||||
{
|
{
|
||||||
//lyxerr << "unexpected call to MathScriptInset::draw()\n";
|
//lyxerr << "unexpected call to MathScriptInset::draw()\n";
|
||||||
draw(0, pain, x, y);
|
draw(0, pain, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void MathScriptInset::metricsT(TextMetricsInfo const & mi) const
|
void MathScriptInset::metricsT(TextMetricsInfo const & mi) const
|
||||||
{
|
{
|
||||||
metricsT(0, mi);
|
metricsT(0, mi);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void MathScriptInset::metricsT(MathInset const * nuc,
|
void MathScriptInset::metricsT(MathInset const * nuc,
|
||||||
TextMetricsInfo const & mi) const
|
TextMetricsInfo const & mi) const
|
||||||
{
|
{
|
||||||
if (hasUp())
|
if (hasUp())
|
||||||
up().metricsT(mi);
|
up().metricsT(mi);
|
||||||
if (hasDown())
|
if (hasDown())
|
||||||
@ -228,7 +228,7 @@ void MathScriptInset::metricsT(MathInset const * nuc,
|
|||||||
|
|
||||||
void MathScriptInset::draw(MathInset const * nuc, Painter & pain,
|
void MathScriptInset::draw(MathInset const * nuc, Painter & pain,
|
||||||
int x, int y) const
|
int x, int y) const
|
||||||
{
|
{
|
||||||
if (nuc)
|
if (nuc)
|
||||||
nuc->draw(pain, x + dxx(nuc), y);
|
nuc->draw(pain, x + dxx(nuc), y);
|
||||||
else // if (editing())
|
else // if (editing())
|
||||||
@ -242,7 +242,7 @@ void MathScriptInset::draw(MathInset const * nuc, Painter & pain,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void MathScriptInset::drawT(TextPainter & pain, int x, int y) const
|
void MathScriptInset::drawT(TextPainter & pain, int x, int y) const
|
||||||
{
|
{
|
||||||
//lyxerr << "unexpected call to MathScriptInset::draw()\n";
|
//lyxerr << "unexpected call to MathScriptInset::draw()\n";
|
||||||
drawT(0, pain, x, y);
|
drawT(0, pain, x, y);
|
||||||
}
|
}
|
||||||
@ -250,7 +250,7 @@ void MathScriptInset::drawT(TextPainter & pain, int x, int y) const
|
|||||||
|
|
||||||
void MathScriptInset::drawT(MathInset const * nuc, TextPainter & pain,
|
void MathScriptInset::drawT(MathInset const * nuc, TextPainter & pain,
|
||||||
int x, int y) const
|
int x, int y) const
|
||||||
{
|
{
|
||||||
if (nuc)
|
if (nuc)
|
||||||
nuc->drawT(pain, x + dxx(nuc), y);
|
nuc->drawT(pain, x + dxx(nuc), y);
|
||||||
if (hasUp())
|
if (hasUp())
|
||||||
@ -269,12 +269,12 @@ bool MathScriptInset::hasLimits(MathInset const * nuc) const
|
|||||||
if (limits_ == -1)
|
if (limits_ == -1)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// we can only display limits if the nucleus wants some
|
// we can only display limits if the nucleus wants some
|
||||||
if (!nuc)
|
if (!nuc)
|
||||||
return false;
|
return false;
|
||||||
if (!nuc->isScriptable())
|
if (!nuc->isScriptable())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// per default \int has limits beside the \int even in displayed formulas
|
// per default \int has limits beside the \int even in displayed formulas
|
||||||
if (nuc->asSymbolInset())
|
if (nuc->asSymbolInset())
|
||||||
if (nuc->asSymbolInset()->name().find("int") != string::npos)
|
if (nuc->asSymbolInset()->name().find("int") != string::npos)
|
||||||
@ -341,7 +341,7 @@ bool MathScriptInset::idxLeft(MathInset::idx_type &,
|
|||||||
|
|
||||||
|
|
||||||
void MathScriptInset::write(WriteStream & os) const
|
void MathScriptInset::write(WriteStream & os) const
|
||||||
{
|
{
|
||||||
//lyxerr << "unexpected call to MathScriptInset::write()\n";
|
//lyxerr << "unexpected call to MathScriptInset::write()\n";
|
||||||
write2(0, os);
|
write2(0, os);
|
||||||
}
|
}
|
||||||
@ -372,7 +372,7 @@ void MathScriptInset::write2(MathInset const * nuc, WriteStream & os) const
|
|||||||
|
|
||||||
|
|
||||||
void MathScriptInset::normalize(NormalStream & os) const
|
void MathScriptInset::normalize(NormalStream & os) const
|
||||||
{
|
{
|
||||||
//lyxerr << "unexpected call to MathScriptInset::normalize()\n";
|
//lyxerr << "unexpected call to MathScriptInset::normalize()\n";
|
||||||
normalize2(0, os);
|
normalize2(0, os);
|
||||||
}
|
}
|
||||||
@ -383,11 +383,11 @@ void MathScriptInset::normalize2(MathInset const * nuc, NormalStream & os) const
|
|||||||
bool d = hasDown() && down().data_.size();
|
bool d = hasDown() && down().data_.size();
|
||||||
bool u = hasUp() && up().data_.size();
|
bool u = hasUp() && up().data_.size();
|
||||||
|
|
||||||
if (u)
|
if (u)
|
||||||
os << "[sup ";
|
os << "[sup ";
|
||||||
if (d)
|
if (d)
|
||||||
os << "[sub ";
|
os << "[sub ";
|
||||||
|
|
||||||
if (nuc)
|
if (nuc)
|
||||||
os << nuc << ' ';
|
os << nuc << ' ';
|
||||||
else
|
else
|
||||||
@ -395,7 +395,7 @@ void MathScriptInset::normalize2(MathInset const * nuc, NormalStream & os) const
|
|||||||
|
|
||||||
if (d)
|
if (d)
|
||||||
os << down().data_ << ']';
|
os << down().data_ << ']';
|
||||||
if (u)
|
if (u)
|
||||||
os << up().data_ << ']';
|
os << up().data_ << ']';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -446,5 +446,3 @@ void MathScriptInset::octavize2(MathInset const * nuc, OctaveStream & os) const
|
|||||||
if (hasUp() && up().data_.size())
|
if (hasUp() && up().data_.size())
|
||||||
os << "^(" << up().data_ << ')';
|
os << "^(" << up().data_ << ')';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -117,7 +117,7 @@ private:
|
|||||||
bool hasLimits(MathInset const * nuc) const;
|
bool hasLimits(MathInset const * nuc) const;
|
||||||
|
|
||||||
/// possible subscript (index 0) and superscript (index 1)
|
/// possible subscript (index 0) and superscript (index 1)
|
||||||
bool script_[2];
|
bool script_[2];
|
||||||
/// 1 - "limits", -1 - "nolimits", 0 - "default"
|
/// 1 - "limits", -1 - "nolimits", 0 - "default"
|
||||||
int limits_;
|
int limits_;
|
||||||
/// cached font
|
/// cached font
|
||||||
@ -125,4 +125,3 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ public:
|
|||||||
void normalize(NormalStream &) const;
|
void normalize(NormalStream &) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
///
|
///
|
||||||
latexkeys const * key_;
|
latexkeys const * key_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -35,20 +35,20 @@ void MathSpaceInset::metrics(MathMetricsInfo const &) const
|
|||||||
|
|
||||||
|
|
||||||
void MathSpaceInset::draw(Painter & pain, int x, int y) const
|
void MathSpaceInset::draw(Painter & pain, int x, int y) const
|
||||||
{
|
{
|
||||||
|
|
||||||
// XPoint p[4] = {{++x, y-3}, {x, y}, {x+width-2, y}, {x+width-2, y-3}};
|
// XPoint p[4] = {{++x, y-3}, {x, y}, {x+width-2, y}, {x+width-2, y-3}};
|
||||||
|
|
||||||
// Sadly, HP-UX CC can't handle that kind of initialization.
|
// Sadly, HP-UX CC can't handle that kind of initialization.
|
||||||
|
|
||||||
int xp[4];
|
int xp[4];
|
||||||
int yp[4];
|
int yp[4];
|
||||||
|
|
||||||
xp[0] = ++x; yp[0] = y - 3;
|
xp[0] = ++x; yp[0] = y - 3;
|
||||||
xp[1] = x; yp[1] = y;
|
xp[1] = x; yp[1] = y;
|
||||||
xp[2] = x + width_ - 2; yp[2] = y;
|
xp[2] = x + width_ - 2; yp[2] = y;
|
||||||
xp[3] = x + width_ - 2; yp[3] = y - 3;
|
xp[3] = x + width_ - 2; yp[3] = y - 3;
|
||||||
|
|
||||||
pain.lines(xp, yp, 4, space_ ? LColor::latex : LColor::math);
|
pain.lines(xp, yp, 4, space_ ? LColor::latex : LColor::math);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -82,5 +82,3 @@ void MathSpaceInset::write(WriteStream & os) const
|
|||||||
if (space_ >= 0 && space_ < 6)
|
if (space_ >= 0 && space_ < 6)
|
||||||
os << '\\' << latex_mathspace[space_] << ' ';
|
os << '\\' << latex_mathspace[space_] << ' ';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ MathSpecialCharInset::MathSpecialCharInset(char c)
|
|||||||
|
|
||||||
|
|
||||||
MathInset * MathSpecialCharInset::clone() const
|
MathInset * MathSpecialCharInset::clone() const
|
||||||
{
|
{
|
||||||
return new MathSpecialCharInset(*this);
|
return new MathSpecialCharInset(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -43,7 +43,7 @@ void MathSpecialCharInset::metrics(MathMetricsInfo const & mi) const
|
|||||||
|
|
||||||
|
|
||||||
void MathSpecialCharInset::draw(Painter & pain, int x, int y) const
|
void MathSpecialCharInset::draw(Painter & pain, int x, int y) const
|
||||||
{
|
{
|
||||||
drawChar(pain, font_, x, y, char_);
|
drawChar(pain, font_, x, y, char_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
#pragma interface
|
#pragma interface
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/** An inset for characters like {, #, and $ that need to be escaped
|
/** An inset for characters like {, #, and $ that need to be escaped
|
||||||
when written out, but can be inserted by a single keystroke
|
when written out, but can be inserted by a single keystroke
|
||||||
\author André Pönitz
|
\author André Pönitz
|
||||||
*/
|
*/
|
||||||
@ -27,7 +27,7 @@ public:
|
|||||||
void write(WriteStream & os) const;
|
void write(WriteStream & os) const;
|
||||||
///
|
///
|
||||||
void normalize(NormalStream &) const;
|
void normalize(NormalStream &) const;
|
||||||
///
|
///
|
||||||
int ascent() const;
|
int ascent() const;
|
||||||
///
|
///
|
||||||
int descent() const;
|
int descent() const;
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
|
|
||||||
class MathSplitInset : public MathGridInset {
|
class MathSplitInset : public MathGridInset {
|
||||||
public:
|
public:
|
||||||
///
|
///
|
||||||
explicit MathSplitInset(string const & name);
|
explicit MathSplitInset(string const & name);
|
||||||
///
|
///
|
||||||
|
@ -15,7 +15,7 @@ MathSqrtInset::MathSqrtInset()
|
|||||||
|
|
||||||
|
|
||||||
MathInset * MathSqrtInset::clone() const
|
MathInset * MathSqrtInset::clone() const
|
||||||
{
|
{
|
||||||
return new MathSqrtInset(*this);
|
return new MathSqrtInset(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -30,8 +30,8 @@ void MathSqrtInset::metrics(MathMetricsInfo const & mi) const
|
|||||||
|
|
||||||
|
|
||||||
void MathSqrtInset::draw(Painter & pain, int x, int y) const
|
void MathSqrtInset::draw(Painter & pain, int x, int y) const
|
||||||
{
|
{
|
||||||
xcell(0).draw(pain, x + 10, y);
|
xcell(0).draw(pain, x + 10, y);
|
||||||
int const a = ascent_;
|
int const a = ascent_;
|
||||||
int const d = descent_;
|
int const d = descent_;
|
||||||
int xp[4];
|
int xp[4];
|
||||||
@ -54,8 +54,8 @@ void MathSqrtInset::metricsT(TextMetricsInfo const & mi) const
|
|||||||
|
|
||||||
|
|
||||||
void MathSqrtInset::drawT(TextPainter & pain, int x, int y) const
|
void MathSqrtInset::drawT(TextPainter & pain, int x, int y) const
|
||||||
{
|
{
|
||||||
xcell(0).drawT(pain, x + 2, y);
|
xcell(0).drawT(pain, x + 2, y);
|
||||||
pain.horizontalLine(x + 2, y - xcell(0).ascent(), xcell(0).width(), '_');
|
pain.horizontalLine(x + 2, y - xcell(0).ascent(), xcell(0).width(), '_');
|
||||||
pain.verticalLine (x + 1, y - xcell(0).ascent() + 1, xcell(0).height());
|
pain.verticalLine (x + 1, y - xcell(0).ascent() + 1, xcell(0).height());
|
||||||
pain.draw(x, y + xcell(0).descent(), '\\');
|
pain.draw(x, y + xcell(0).descent(), '\\');
|
||||||
|
@ -15,7 +15,7 @@ MathStackrelInset::MathStackrelInset()
|
|||||||
|
|
||||||
|
|
||||||
MathInset * MathStackrelInset::clone() const
|
MathInset * MathStackrelInset::clone() const
|
||||||
{
|
{
|
||||||
return new MathStackrelInset(*this);
|
return new MathStackrelInset(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ void MathStackrelInset::metrics(MathMetricsInfo const & mi) const
|
|||||||
smallerStyleFrac(m);
|
smallerStyleFrac(m);
|
||||||
xcell(0).metrics(m);
|
xcell(0).metrics(m);
|
||||||
xcell(1).metrics(mi);
|
xcell(1).metrics(mi);
|
||||||
width_ = max(xcell(0).width(), xcell(1).width()) + 4;
|
width_ = max(xcell(0).width(), xcell(1).width()) + 4;
|
||||||
ascent_ = xcell(1).ascent() + xcell(0).height() + 4;
|
ascent_ = xcell(1).ascent() + xcell(0).height() + 4;
|
||||||
descent_ = xcell(1).descent();
|
descent_ = xcell(1).descent();
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
#pragma interface
|
#pragma interface
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/** Stackrel objects
|
/** Stackrel objects
|
||||||
\author André Pönitz
|
\author André Pönitz
|
||||||
*/
|
*/
|
||||||
class MathStackrelInset : public MathFracbaseInset {
|
class MathStackrelInset : public MathFracbaseInset {
|
||||||
|
@ -27,7 +27,7 @@ MathStringInset::MathStringInset(string const & s, MathTextCodes t)
|
|||||||
|
|
||||||
|
|
||||||
MathInset * MathStringInset::clone() const
|
MathInset * MathStringInset::clone() const
|
||||||
{
|
{
|
||||||
return new MathStringInset(*this);
|
return new MathStringInset(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -65,7 +65,7 @@ void MathStringInset::metrics(MathMetricsInfo const & mi) const
|
|||||||
|
|
||||||
|
|
||||||
void MathStringInset::draw(Painter & pain, int x, int y) const
|
void MathStringInset::draw(Painter & pain, int x, int y) const
|
||||||
{
|
{
|
||||||
//lyxerr << "drawing '" << str_ << "' code: " << code_ << endl;
|
//lyxerr << "drawing '" << str_ << "' code: " << code_ << endl;
|
||||||
drawStr(pain, font_, x, y, str_);
|
drawStr(pain, font_, x, y, str_);
|
||||||
}
|
}
|
||||||
@ -82,11 +82,11 @@ void MathStringInset::maplize(MapleStream & os) const
|
|||||||
if (code_ != LM_TC_VAR || str_.size() <= 1) {
|
if (code_ != LM_TC_VAR || str_.size() <= 1) {
|
||||||
os << ' ' << str_ << ' ';
|
os << ' ' << str_ << ' ';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// insert '*' between adjacent chars if type is LM_TC_VAR
|
// insert '*' between adjacent chars if type is LM_TC_VAR
|
||||||
os << str_[0];
|
os << str_[0];
|
||||||
for (string::size_type i = 1; i < str_.size(); ++i)
|
for (string::size_type i = 1; i < str_.size(); ++i)
|
||||||
os << '*' << str_[i];
|
os << '*' << str_[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -96,11 +96,11 @@ void MathStringInset::octavize(OctaveStream & os) const
|
|||||||
if (code_ != LM_TC_VAR || str_.size() <= 1) {
|
if (code_ != LM_TC_VAR || str_.size() <= 1) {
|
||||||
os << ' ' << str_ << ' ';
|
os << ' ' << str_ << ' ';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// insert '*' between adjacent chars if type is LM_TC_VAR
|
// insert '*' between adjacent chars if type is LM_TC_VAR
|
||||||
os << str_[0];
|
os << str_[0];
|
||||||
for (string::size_type i = 1; i < str_.size(); ++i)
|
for (string::size_type i = 1; i < str_.size(); ++i)
|
||||||
os << '*' << str_[i];
|
os << '*' << str_[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -120,10 +120,8 @@ void MathStringInset::mathmlize(MathMLStream & os) const
|
|||||||
|
|
||||||
void MathStringInset::write(WriteStream & os) const
|
void MathStringInset::write(WriteStream & os) const
|
||||||
{
|
{
|
||||||
if (math_font_name(code_))
|
if (math_font_name(code_))
|
||||||
os << '\\' << math_font_name(code_) << '{' << str_ << '}';
|
os << '\\' << math_font_name(code_) << '{' << str_ << '}';
|
||||||
else
|
else
|
||||||
os << str_;
|
os << str_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ public:
|
|||||||
void metrics(MathMetricsInfo const & st) const;
|
void metrics(MathMetricsInfo const & st) const;
|
||||||
///
|
///
|
||||||
void draw(Painter &, int x, int y) const;
|
void draw(Painter &, int x, int y) const;
|
||||||
///
|
///
|
||||||
int ascent() const;
|
int ascent() const;
|
||||||
///
|
///
|
||||||
int descent() const;
|
int descent() const;
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
|
|
||||||
class MathSubstackInset : public MathGridInset {
|
class MathSubstackInset : public MathGridInset {
|
||||||
public:
|
public:
|
||||||
///
|
///
|
||||||
MathSubstackInset();
|
MathSubstackInset();
|
||||||
///
|
///
|
||||||
|
@ -124,8 +124,8 @@ LyXFont const & whichFontBaseIntern(MathTextCodes type)
|
|||||||
mathed_init_fonts();
|
mathed_init_fonts();
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case LM_TC_SYMB:
|
case LM_TC_SYMB:
|
||||||
case LM_TC_BOLDSYMB:
|
case LM_TC_BOLDSYMB:
|
||||||
return MathFonts[FONT_SYMBOLI];
|
return MathFonts[FONT_SYMBOLI];
|
||||||
|
|
||||||
case LM_TC_VAR:
|
case LM_TC_VAR:
|
||||||
@ -495,8 +495,8 @@ named_deco_struct deco_table[] = {
|
|||||||
{"uparrow", arrow, 0 },
|
{"uparrow", arrow, 0 },
|
||||||
{"Uparrow", Arrow, 0 },
|
{"Uparrow", Arrow, 0 },
|
||||||
{"updownarrow", udarrow, 0 },
|
{"updownarrow", udarrow, 0 },
|
||||||
{"Updownarrow", Udarrow, 0 },
|
{"Updownarrow", Udarrow, 0 },
|
||||||
|
|
||||||
// Accents
|
// Accents
|
||||||
{"ddot", ddot, 0 },
|
{"ddot", ddot, 0 },
|
||||||
{"dddot", dddot, 0 },
|
{"dddot", dddot, 0 },
|
||||||
@ -510,7 +510,7 @@ named_deco_struct deco_table[] = {
|
|||||||
{"breve", parenth, 1 },
|
{"breve", parenth, 1 },
|
||||||
{"vec", arrow, 3 },
|
{"vec", arrow, 3 },
|
||||||
{"not", slash, 0 },
|
{"not", slash, 0 },
|
||||||
|
|
||||||
// Dots
|
// Dots
|
||||||
{"ldots", hline3, 0 },
|
{"ldots", hline3, 0 },
|
||||||
{"cdots", hline3, 0 },
|
{"cdots", hline3, 0 },
|
||||||
@ -618,22 +618,22 @@ void mathed_draw_deco(Painter & pain, int x, int y, int w, int h,
|
|||||||
pain.line(x + w/2, y, x + w/2, y + h,
|
pain.line(x + w/2, y, x + w/2, y + h,
|
||||||
LColor::mathcursor, Painter::line_onoffdash);
|
LColor::mathcursor, Painter::line_onoffdash);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
deco_struct const * mds = search_deco(name);
|
deco_struct const * mds = search_deco(name);
|
||||||
if (!mds) {
|
if (!mds) {
|
||||||
lyxerr << "Deco was not found. Programming error?\n";
|
lyxerr << "Deco was not found. Programming error?\n";
|
||||||
lyxerr << "name: '" << name << "'\n";
|
lyxerr << "name: '" << name << "'\n";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int const n = (w < h) ? w : h;
|
int const n = (w < h) ? w : h;
|
||||||
int const r = mds->angle;
|
int const r = mds->angle;
|
||||||
double const * d = mds->data;
|
double const * d = mds->data;
|
||||||
|
|
||||||
if (h > 70 && (name == "(" || name == ")"))
|
if (h > 70 && (name == "(" || name == ")"))
|
||||||
d = parenthHigh;
|
d = parenthHigh;
|
||||||
|
|
||||||
Matrix mt(r, w, h);
|
Matrix mt(r, w, h);
|
||||||
Matrix sqmt(r, n, n);
|
Matrix sqmt(r, n, n);
|
||||||
|
|
||||||
@ -750,7 +750,7 @@ char const * math_font_name(MathTextCodes code)
|
|||||||
"textrm"
|
"textrm"
|
||||||
};
|
};
|
||||||
|
|
||||||
if (code >= LM_TC_RM && code <= LM_TC_TEXTRM)
|
if (code >= LM_TC_RM && code <= LM_TC_TEXTRM)
|
||||||
return theFontNames[code - LM_TC_RM];
|
return theFontNames[code - LM_TC_RM];
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -773,5 +773,3 @@ string convertDelimToLatexName(string const & name)
|
|||||||
return name;
|
return name;
|
||||||
return "\\" + name + " ";
|
return "\\" + name + " ";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -98,7 +98,7 @@ void MathSymbolInset::metrics(MathMetricsInfo const & mi) const
|
|||||||
|
|
||||||
|
|
||||||
void MathSymbolInset::draw(Painter & pain, int x, int y) const
|
void MathSymbolInset::draw(Painter & pain, int x, int y) const
|
||||||
{
|
{
|
||||||
if (isRelOp())
|
if (isRelOp())
|
||||||
x += 3;
|
x += 3;
|
||||||
MathTextCodes Code = code();
|
MathTextCodes Code = code();
|
||||||
@ -117,7 +117,7 @@ void MathSymbolInset::draw(Painter & pain, int x, int y) const
|
|||||||
|
|
||||||
|
|
||||||
bool MathSymbolInset::isRelOp() const
|
bool MathSymbolInset::isRelOp() const
|
||||||
{
|
{
|
||||||
return sym_->type == "mathrel";
|
return sym_->type == "mathrel";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -200,5 +200,3 @@ void MathSymbolInset::infoize(ostream & os) const
|
|||||||
{
|
{
|
||||||
os << '\\' << name();
|
os << '\\' << name();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ MathUndersetInset::MathUndersetInset()
|
|||||||
|
|
||||||
|
|
||||||
MathInset * MathUndersetInset::clone() const
|
MathInset * MathUndersetInset::clone() const
|
||||||
{
|
{
|
||||||
return new MathUndersetInset(*this);
|
return new MathUndersetInset(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ void MathUndersetInset::metrics(MathMetricsInfo const & mi) const
|
|||||||
smallerStyleFrac(m);
|
smallerStyleFrac(m);
|
||||||
xcell(0).metrics(m);
|
xcell(0).metrics(m);
|
||||||
xcell(1).metrics(mi);
|
xcell(1).metrics(mi);
|
||||||
width_ = max(xcell(0).width(), xcell(1).width()) + 4;
|
width_ = max(xcell(0).width(), xcell(1).width()) + 4;
|
||||||
ascent_ = xcell(1).ascent();
|
ascent_ = xcell(1).ascent();
|
||||||
descent_ = xcell(1).descent() + xcell(0).height() + 4;
|
descent_ = xcell(1).descent() + xcell(0).height() + 4;
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
#pragma interface
|
#pragma interface
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/** Underset objects
|
/** Underset objects
|
||||||
\author André Pönitz
|
\author André Pönitz
|
||||||
*/
|
*/
|
||||||
class MathUndersetInset : public MathFracbaseInset {
|
class MathUndersetInset : public MathFracbaseInset {
|
||||||
|
@ -57,7 +57,7 @@ void MathUnknownInset::normalize(NormalStream & os) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void MathUnknownInset::metrics(MathMetricsInfo const & mi) const
|
void MathUnknownInset::metrics(MathMetricsInfo const & mi) const
|
||||||
{
|
{
|
||||||
whichFont(font_, LM_TC_TEX, mi);
|
whichFont(font_, LM_TC_TEX, mi);
|
||||||
mathed_string_dim(font_, name_, ascent_, descent_, width_);
|
mathed_string_dim(font_, name_, ascent_, descent_, width_);
|
||||||
@ -65,7 +65,7 @@ void MathUnknownInset::metrics(MathMetricsInfo const & mi) const
|
|||||||
|
|
||||||
|
|
||||||
void MathUnknownInset::draw(Painter & pain, int x, int y) const
|
void MathUnknownInset::draw(Painter & pain, int x, int y) const
|
||||||
{
|
{
|
||||||
drawStr(pain, font_, x, y, name_);
|
drawStr(pain, font_, x, y, name_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ MathXArrowInset::MathXArrowInset(string const & name)
|
|||||||
|
|
||||||
|
|
||||||
MathInset * MathXArrowInset::clone() const
|
MathInset * MathXArrowInset::clone() const
|
||||||
{
|
{
|
||||||
return new MathXArrowInset(*this);
|
return new MathXArrowInset(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -34,7 +34,7 @@ void MathXArrowInset::metrics(MathMetricsInfo const & st) const
|
|||||||
|
|
||||||
|
|
||||||
void MathXArrowInset::draw(Painter & pain, int x, int y) const
|
void MathXArrowInset::draw(Painter & pain, int x, int y) const
|
||||||
{
|
{
|
||||||
xcell(0).draw(pain, x + 5, y - 10);
|
xcell(0).draw(pain, x + 5, y - 10);
|
||||||
mathed_draw_deco(pain, x + 1, y - 7, width_ - 2, 5, name_);
|
mathed_draw_deco(pain, x + 1, y - 7, width_ - 2, 5, name_);
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ MathXArray::MathXArray()
|
|||||||
|
|
||||||
|
|
||||||
void MathXArray::touch() const
|
void MathXArray::touch() const
|
||||||
{
|
{
|
||||||
clean_ = false;
|
clean_ = false;
|
||||||
drawn_ = false;
|
drawn_ = false;
|
||||||
}
|
}
|
||||||
@ -58,16 +58,16 @@ void MathXArray::metrics(MathMetricsInfo const & mi) const
|
|||||||
q->metrics(p, mi);
|
q->metrics(p, mi);
|
||||||
ascent_ = max(ascent_, q->ascent2(p));
|
ascent_ = max(ascent_, q->ascent2(p));
|
||||||
descent_ = max(descent_, q->descent2(p));
|
descent_ = max(descent_, q->descent2(p));
|
||||||
width_ += q->width2(p);
|
width_ += q->width2(p);
|
||||||
++it;
|
++it;
|
||||||
} else {
|
} else {
|
||||||
p->metrics(mi);
|
p->metrics(mi);
|
||||||
ascent_ = max(ascent_, p->ascent());
|
ascent_ = max(ascent_, p->ascent());
|
||||||
descent_ = max(descent_, p->descent());
|
descent_ = max(descent_, p->descent());
|
||||||
width_ += p->width();
|
width_ += p->width();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//lyxerr << "MathXArray::metrics(): '" << ascent_ << " "
|
//lyxerr << "MathXArray::metrics(): '" << ascent_ << " "
|
||||||
// << descent_ << " " << width_ << "'\n";
|
// << descent_ << " " << width_ << "'\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -130,13 +130,13 @@ void MathXArray::metricsT(TextMetricsInfo const & mi) const
|
|||||||
q->metricsT(p, mi);
|
q->metricsT(p, mi);
|
||||||
ascent_ = max(ascent_, q->ascent2(p));
|
ascent_ = max(ascent_, q->ascent2(p));
|
||||||
descent_ = max(descent_, q->descent2(p));
|
descent_ = max(descent_, q->descent2(p));
|
||||||
width_ += q->width2(p);
|
width_ += q->width2(p);
|
||||||
++it;
|
++it;
|
||||||
} else {
|
} else {
|
||||||
p->metricsT(mi);
|
p->metricsT(mi);
|
||||||
ascent_ = max(ascent_, p->ascent());
|
ascent_ = max(ascent_, p->ascent());
|
||||||
descent_ = max(descent_, p->descent());
|
descent_ = max(descent_, p->descent());
|
||||||
width_ += p->width();
|
width_ += p->width();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -232,7 +232,7 @@ int MathXArray::dist(int x, int y) const
|
|||||||
else if (y > yo_ + descent_)
|
else if (y > yo_ + descent_)
|
||||||
yy = y - yo_ - descent_;
|
yy = y - yo_ - descent_;
|
||||||
|
|
||||||
return xx + yy;
|
return xx + yy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -248,7 +248,7 @@ void MathXArray::boundingBox(int & x1, int & x2, int & y1, int & y2)
|
|||||||
void MathXArray::findPos(MathPosFinder & f) const
|
void MathXArray::findPos(MathPosFinder & f) const
|
||||||
{
|
{
|
||||||
double x = xo_;
|
double x = xo_;
|
||||||
double y = yo_;
|
double y = yo_;
|
||||||
for (const_iterator it = begin(); it < end(); ++it) {
|
for (const_iterator it = begin(); it < end(); ++it) {
|
||||||
// check this position in the cell first
|
// check this position in the cell first
|
||||||
f.visit(x, y);
|
f.visit(x, y);
|
||||||
|
@ -77,7 +77,7 @@ public:
|
|||||||
const_iterator begin() const { return data_.begin(); }
|
const_iterator begin() const { return data_.begin(); }
|
||||||
/// end iterator of the underlying MathArray
|
/// end iterator of the underlying MathArray
|
||||||
const_iterator end() const { return data_.end(); }
|
const_iterator end() const { return data_.end(); }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/// the underlying MathArray
|
/// the underlying MathArray
|
||||||
MathArray data_;
|
MathArray data_;
|
||||||
|
@ -111,7 +111,7 @@ void MathXYArrowInset::draw(Painter & pain, int x, int y) const
|
|||||||
MathXArray const & t = targetCell();
|
MathXArray const & t = targetCell();
|
||||||
pain.line(s.xm(), s.ym(), t.xm(), t.ym(), LColor::math);
|
pain.line(s.xm(), s.ym(), t.xm(), t.ym(), LColor::math);
|
||||||
xcell(1).draw(pain, (s.xm() + t.xm())/2, (s.ym() + t.ym())/2);
|
xcell(1).draw(pain, (s.xm() + t.xm())/2, (s.ym() + t.ym())/2);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
class MathXYMatrixInset;
|
class MathXYMatrixInset;
|
||||||
|
|
||||||
class MathXYArrowInset : public MathNestInset {
|
class MathXYArrowInset : public MathNestInset {
|
||||||
public:
|
public:
|
||||||
///
|
///
|
||||||
MathXYArrowInset();
|
MathXYArrowInset();
|
||||||
///
|
///
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
|
|
||||||
class MathXYMatrixInset : public MathGridInset {
|
class MathXYMatrixInset : public MathGridInset {
|
||||||
public:
|
public:
|
||||||
///
|
///
|
||||||
MathXYMatrixInset();
|
MathXYMatrixInset();
|
||||||
///
|
///
|
||||||
|
Loading…
Reference in New Issue
Block a user