This fixes a few of the gaping holes of the previous changes (and opens a few new ones).
On the good side: - most (all?) of the immediate 'click on inset crashes' are fixed. - mathed is working again (using the global cursor!) - C-m in mathed now opens some lightweight 'real' inset MBoxInset based on LyXText (coordinates are off and read/write is not working yet, though) - insets now use absolute screen coordinates instead of their own - some of the previous makeshift code (as insetFromCoords, the 'theTempCursor' hack, ...) is gone - BufferView::Pimpl::workAreaDispatch is much simpler now - the setting of the inset x/y position cache is a bit more organized now. - the MathHullInset/MathNestInset combo now took over almost all functionality of InsetFormulaBase and InsetFormula On the bad side: - mouse selection is off - in a few places some +/- bv->top_y() is missing - math macros are still not working. I think the most interesting aspect is the new MathMBoxInset as this is 'proof of concept': We now can (somehow) nest 'real' text in math, i.e. the global cursor 'works'. Alfredo, I certainly would not mind if you had a look at the coordinate business. It's currently somewhere in the limbo between 'screen absolute' and 'document absolute' and I wouldn't be surprised if there were a place or two left that relies on 'inset relative' coordinates. Most notably, I have commented out your //y += cached_y_ fix in LCursor::getPos() as I was not sure anymore how it worked exactly. There are two slight shifts in responsibility regarding mouse lfun handling: 1. InsetFoo::edit(LCursor & cur, x, y) now builds the LCursor 'cur' 'decentralized'. This 'cur' is not the real cursor but the replacement of 'theTempCursor'. This moves 'decentral' knowledge off the LCursor. 2. LCursor::dispatch does not set the global cursor anymore on MOUSE_PRESS. Rather an inset that decides to interpret MOUSE_PRESS as 'place global cursor here' can/must do as it wishes. Again, this moves hard-codes decentral knowledge from the Cursor to the insets. And maybe a few calming words at the end: We are basically through. There will still be a few patches needed, but the actual bugfixing will be only a line or two. Monster patches are to be expected, but that'll be only renaming etc. [For one, I'd like to rename all 'MathFooInset' to 'InsetMathFoo' as cosmetical part of IU] There's one bit left that's not IU-ed, and that's import/export (read, write, latex, docbook..). There is no conceptual problem here, but I currently like neither the 'old' version (same output parameters for all formats) nor the mathed version (the 'FooStreams' aren't exactly streams...), so I don't really know in which direction to proceed. Andre'
1.diff.gz
Description: application/gunzip