Commit Graph

76 Commits

Author SHA1 Message Date
Abdelrazak Younes
5e8d4df0a5 Temporarily fix jumpy cursor.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20526 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-26 21:27:17 +00:00
Abdelrazak Younes
f93367f9e6 Fix RTL inset painting.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20449 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-23 15:35:06 +00:00
Abdelrazak Younes
0dc4a1fa97 Fix Cut&Paste bug.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20445 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-23 08:59:50 +00:00
Abdelrazak Younes
237c132c1e * Inset:
- get rid of the cached Dimension. Text inset dimensions are saved in ParagraphMetrics and mathed maintain their own dimension where needed.
- width(), ascent(), descent(): deleted.
- dimension(): now needs a valid BufferView.
- metrics(): now void.

* BufferView::getCoveringInset(): simplify.

* ParagraphMetrics(): now cache inset dimensions.




git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20420 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-21 20:39:47 +00:00
André Pönitz
82309f0c2d Remove a few includes from Text.h
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20386 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-20 20:44:08 +00:00
Abdelrazak Younes
ae7c588552 * TextMetrics:
- first() and last(): change return type because std::pair of reference didn't work (i.e. bug)

* BufferView::workAreaDispatch(): re-enable and fix 'mouse hover' feature.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20372 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-20 08:48:28 +00:00
Abdelrazak Younes
516ff470d8 Fix InsetBox drawing and remove remnant of the wide() hack.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20334 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-18 08:52:38 +00:00
Abdelrazak Younes
8d52aa5638 Give PageDown/Up scrolling a sane behaviour. Does not work with selection yet...
* BufferView:
- new scroll(), scrollDown() and scrollUp() method for pixel scrolling.
- new LFUN_SCREEN_UP/DOWN handling.
 
* TextMetrics: new helper and access methods.




git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20283 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-15 12:28:41 +00:00
Abdelrazak Younes
e6854f527f * bufferview_funcs.cpp:status(): use new TextMetrics::parPosition().
* TextMetrics::cursorNext(): compil fix.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20239 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-12 12:07:45 +00:00
Abdelrazak Younes
8319910995 Fix PageDown/Up temporarily.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20237 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-12 08:15:56 +00:00
Abdelrazak Younes
6ce171eec8 Transfer the Paragraph position cache from CoordCache to ParagraphMetrics and TextMetrics.
* ParagraphMetrics::position_: new private member (and associated access method).

* TextMetrics:
- origin_: new screen position cache.
- use origin_ and ParagraphMetrics::position() instead of the parPos cache.

* Cursor:
- comment out buggy bruteFind() method, will work on that later.

* BufferView::updateMetrics(): refactor and simplify to use new cache and to gather everything SinglePar related.





git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20214 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-11 16:04:10 +00:00
Abdelrazak Younes
c3e3534148 * TextMetrics::draw(): withdraw first row ascent before drawing because the convention is that the baseline of a multirow text is the baseline of the first row.
All other files: adapt to above change.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20177 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-09 20:21:43 +00:00
Abdelrazak Younes
d4bf8e0a21 * TextMetrics::drawSelection(): use parMetrics() instead of direct access just in case. Should fix crash on selection with PageUp.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20081 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-05 21:26:17 +00:00
Abdelrazak Younes
d1813ca269 * TextMetrics::draw(): get rid of the first par ascent offset.
* BufferView::draw(): adapt to above change.

* InsetCollapsable::draw(): ditto -> get rid of textdim_ member.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20068 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-05 13:45:58 +00:00
Abdelrazak Younes
eed6514dd0 Move selection painting closer to row painting. Single row painting is now possible for selection.
* Row:
- setSelection(): set selection begin and end for this row.
- sel_beg, sel_end: new public members.

* BufferView::draw()
- do not trigger a full repaint for selection.
- use TextMetrics::draw() instead of hand calling TextMetrics::drawParagraph().

* InsetText::draw(): don't call TextMetrics::drawSelection().

* InsetMathMBox::drawSelection(): remove.

* TextMetrics:
- drawSelection(): simplify a bit. Now private.
- redoParagraph(): memorize Row selection status.
- x2pos(): fix crash when selecting with PageDown.
- draw(): fill-in the ParPos cache before everything else and not in drawParagraph().
- drawParagraph(): take care of row selection painting.







git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20066 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-05 13:04:05 +00:00
Alfredo Braunstein
a8ed1add4d rename Paragraph::isRightToLeftPar -> isRTL for the sake of consistence
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20031 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-04 10:27:55 +00:00
Alfredo Braunstein
cdd5c1bb17 fix multi-cell selection
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20026 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-03 22:16:54 +00:00
Alfredo Braunstein
3b6eb864d5 enable some non-rtl optimization
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20021 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-03 13:34:26 +00:00
Alfredo Braunstein
15dc381ce9 optimization: save some font copying
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20016 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-02 23:37:11 +00:00
Abdelrazak Younes
2ea432bab1 * TextMetrics: getDisplayFont() and isRTLBoundary() takes pit instead of Paragraph.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20015 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-02 22:28:49 +00:00
Abdelrazak Younes
d35d25460b * Text: Move some more stuff from Text to TextMetrics:
- getFont() becomes TextMetrics::getDisplayFont()
- setCharFont() now needs a display font.
- setInsetFont() and setFont() now needs a BufferView, will be transferred to TextMetrics too.
- isRTL(): moved to TextMetrics
- isRTLBoundary(): ditto
- font_: ditto

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20014 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-02 21:48:49 +00:00
Alfredo Braunstein
052e9071e9 fix crash + shut up warning
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20011 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-02 18:05:37 +00:00
Abdelrazak Younes
bc6304d760 Don't save background color in Text. Hand it down at drawing time.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20002 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-02 14:34:15 +00:00
Abdelrazak Younes
af06ed5ff1 Transfer current_font and real_current_font from Text to Cursor.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19999 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-02 13:35:48 +00:00
Abdelrazak Younes
cb796d31b0 Transfer metrics and screen related methods from Text to TextMetrics.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19995 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-02 11:27:19 +00:00
Abdelrazak Younes
502b048246 Transfer metrics and screen related methods from Text to TextMetrics.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19994 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-02 11:21:33 +00:00
Abdelrazak Younes
8695368e29 Fix crash when selection begins or ends outside the visible screen.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19992 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-02 10:23:28 +00:00
Abdelrazak Younes
4048448236 Transfer metrics and screen related methods from Text to TextMetrics.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19991 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-02 09:44:08 +00:00
Alfredo Braunstein
aa670e90c8 metrics fix: reset some Row values to default in top of computeRowMetrics as the code there assumes it
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19990 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-02 09:07:07 +00:00
Abdelrazak Younes
d166ee8699 Temporarily remove the assertion because it doesn't work on new doc.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19983 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-01 22:01:34 +00:00
Abdelrazak Younes
53299d06f8 Re-implement the wide() hack in a clean way (at metrics level): an InsetText will have automatically occupy the full allowable width if there is more than one paragraph or more more than one row.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19975 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-01 14:49:08 +00:00
Abdelrazak Younes
087fc75a9d Fix wrapping bug within inset. dim_.wid was not set!
Add some commented out debug info.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19972 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-01 10:30:44 +00:00
Abdelrazak Younes
5aefefe0cf Improve painting debug info.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19971 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-01 09:36:53 +00:00
Abdelrazak Younes
4ed011dbd1 Improve painting debug info.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19970 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-01 09:33:57 +00:00
Abdelrazak Younes
fb74d5a476 * InsetCollapsable::metrics(): it seems we don't need to refit anymore. Saves an InsetText::metrics() call and enable single Row painting within opened inline insets.
* TextMetrics::drawParagraph(): force full repaint on Insets that are within the current repainting row.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19968 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-01 09:24:20 +00:00
Abdelrazak Younes
7d97e555fc Transfer Paragraph::hfillExpansion() to ParagraphMetrics. This also reduce the dependency to Row.h which is probably going to change in the near future.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19951 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-31 14:46:13 +00:00
Abdelrazak Younes
2bff0157b6 Transfer Text::drawSelection() to TextMetrics.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19940 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-31 10:05:12 +00:00
Abdelrazak Younes
a088c6754a Finally enable single row repainting within insets! The inset width needs to stay fixed of course.
* BufferView::draw(): makes use of PainterInfo::full_repaint
* TextMetrics::drawParagraph(): ditto.
* InsetText::drawSelection(): don't fillRectangle() if there's no selection.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19918 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-30 15:17:38 +00:00
Abdelrazak Younes
97f66c07f6 * RowPainter:
- paintOnlyInsets(): new public method for inset painting only in case the inset dimension didn't change within a Row.
- paintInset(): put out everything not strictly related to the inset painting itself.
- paintHfill(): new private method to cut the reduce code in paintText().

* TextMetrics::drawParagraph(): use paintOnlyInsets() when the Row text nor it's dimension changed.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19912 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-30 13:19:24 +00:00
Abdelrazak Younes
79ba8fe22a Bug fixes. changed_ was always true...
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19901 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-29 23:06:14 +00:00
Abdelrazak Younes
8239945aa7 Enable use of Row::changed()
* TextMetrics::redoParagraph(): crop the RowList if it is too big.
* ParagraphMetrics::reset():  don't clear its RowList.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19897 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-29 21:33:11 +00:00
Abdelrazak Younes
8175971041 Transfer ParagraphMetrics::rowChangeStatus() to Row::changed(). Prepare for fine grained row redrawing.
^ Row:
- changed_: new boolean to inform change status at draw time.
- crc_: new crc_ signature
- inline pos() and endpos()
- replace width(), ascent() and descent() direct access with dimension().

* ParagraphMetrics
- do not maintain row_signature_ anymore
- rename calculateRowSignature() to computeRowSignature() and make it public

* TextMetrics
- redoParagraph(): don't clear the ParagraphMetrics row list, reuse and update it.
- rowHeight(), rowWidth(), rowBreakPoint(): take first/end positions instead of Row.





git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19895 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-29 21:03:41 +00:00
Abdelrazak Younes
a40d6cd7bc Take Track-Change into account when calculating row signature.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19876 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-28 22:44:09 +00:00
Abdelrazak Younes
34aba4a42b Update comment.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19870 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-28 18:30:15 +00:00
Abdelrazak Younes
3f54edc200 * TextMetrics::redoParagraph(): we need to check the returned value of Inset::metrics() nevertheless because some changes don't involves a dimension change (especially in multiline InsetText).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19868 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-28 18:25:28 +00:00
Abdelrazak Younes
0e7ef480f7 Don't draw if there's nothing to draw.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19866 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-28 18:05:55 +00:00
Abdelrazak Younes
5440aad928 We are not forced to redraw the row each time the cursor is moved.
* TextMetrics.cpp: CursorOnRow() removed.
* TextMetrics::drawParagraph() do not check cursor position.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19859 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-28 16:39:46 +00:00
Abdelrazak Younes
be8de62ae2 Merge the Row and RowMetrics class. Those classes were separated in the 1.4 code base because the Row list was part of Paragraph. As it is now in ParagraphMetrics, there is no need to separate them. Also, only compute the rowmetrics once when the containing paragraph is redone.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19858 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-28 15:47:53 +00:00
Abdelrazak Younes
971c543b34 - Transfer rowpainter.cpp:paintPar() to TextMetrics::drawParagraph()
- move RowPainter class out of the anonymous namespace so that it can be used by TextMetrics::drawParagraph().


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19848 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-28 08:57:13 +00:00
Abdelrazak Younes
55f184563e - Transfer rowpainter.cpp:paintTextInset() to TextMetrics::draw()
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19842 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-27 22:36:20 +00:00