Commit Graph

64 Commits

Author SHA1 Message Date
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
Abdelrazak Younes
b52c339cce Bug fix: correctly redraw a Row containing and inset which Dimension slightly changed. This replace the need for the former leftEdgeFixed boolean in rowpainter.C:paintPar() before the removal of the wide() hack in revision 19834.
* Inset::dimension(): access to dim_

* TextMetrics::redoParagraph(): don't trust Inset::metrics() returned boolean as the internal dimension is changed down in the inheritance chain for InsetFoot->InsetCollapsable->InsetText.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19838 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-27 16:30:57 +00:00
Abdelrazak Younes
b3b6f44755 Gather ParagraphMetrics initialization in ParagraphMetrics::reset().
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19833 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-27 14:04:46 +00:00
André Pönitz
39c7e2faf0 rename Layout_ptr into LayoutPtr
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19758 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-23 19:59:07 +00:00
Abdelrazak Younes
0fcae6cc10 * BufferView::buffer() returns a reference instead of a pointer.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19691 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-21 13:03:55 +00:00
Abdelrazak Younes
f91f682ef9 * Text:
- singleWidth(Buffer...): transfered to TextMetrics.
- singleWidth(Paragraph...): transfered to ParagraphMetrics.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19639 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-18 21:17:10 +00:00
Abdelrazak Younes
861e1e4dc5 * TextMetrics.cpp
- access par_metrics_ directly instead of parMetrics()
- redoParagraph() simplify the changed calculation.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19638 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-18 21:10:45 +00:00
Abdelrazak Younes
98008dc568 * Layout.h
- leftMargin, rightMargin, labelsep, labelindent, parindent are now docstring.

* TextClass.h:
- leftMargin() and rightMargin(): now return a docstring.

All other files: adapt to change above.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19633 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-18 13:21:12 +00:00
Lars Gullik Bjønnes
5ae54ddafb Get rid of a few warnings.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19409 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-10 20:14:54 +00:00
Stefan Schimanski
a8c4376ae3 * Font are lightweight, so better do not change the other font, but a copy
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18733 a592a061-630c-0410-9148-cb99ea01b6c8
2007-06-10 15:34:00 +00:00
Stefan Schimanski
d43c859cd4 * Changing the font does not change the fontmetrics variable,
hence we have to set it manually. 
  (bug #3787: Huge fonts do not set the row height)


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18731 a592a061-630c-0410-9148-cb99ea01b6c8
2007-06-10 14:54:45 +00:00
Stefan Schimanski
6daaf5388b * local_bidi.patch: The bidi object in the class Text is only used in
places now where a ParagraphMetrics::computeRowMetrics call comes
before. And this function the Bidi object is updated. So it is a
little step now to remove the Text::bidi completely and use local
Bidi objects instead without more work to do.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18706 a592a061-630c-0410-9148-cb99ea01b6c8
2007-06-07 20:39:14 +00:00
Stefan Schimanski
ff8fcc268a * no_bidi_isboundary.patch: added isRTLBoundary as a replacement to several references to the Text::bidi object.
(fixes #3790, #3801, #3809)


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18704 a592a061-630c-0410-9148-cb99ea01b6c8
2007-06-07 19:50:02 +00:00