Commit Graph

110 Commits

Author SHA1 Message Date
André Pönitz
a8cd9a4b8f cosmetics. mainly replace #include "dostring.h" by #include "strfwd.h"
in header files when possible. Adjust .cpp files.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21358 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-01 22:17:22 +00:00
Dov Feldstern
b4372a37d9 Getting rid of LTR bias --- part 2/?
This is a continuation of r21128. This round fixes the "Word" movement
functions and LFUNS.

Behavior should remain unchanged by this fix.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21244 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-28 20:35:57 +00:00
Abdelrazak Younes
5ddc612b73 Splitup Font in saner bits:
* Font::FontBits -> FontInfo
* Font::FONT_XXX -> all enums transfered to FontEnums.h and renamed to FontXxx

I've replaced Font uses with FontInfo were the language() member was not needed, basically all draw() and metrics methods. There's one problematic cases with InsetQuotes which I solved by taking the Buffer main language.




git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21240 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-28 18:51:54 +00:00
Abdelrazak Younes
eea79637c7 Move Color::color enum to ColorCode.h
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21198 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-25 12:41:02 +00:00
Abdelrazak Younes
604bf56374 small simplification.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21169 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-24 08:32:20 +00:00
Abdelrazak Younes
1297114b73 Introducing Paragraph::changeCase().
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21167 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-24 07:49:24 +00:00
Abdelrazak Younes
ce1ec3edd2 small optimization.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21166 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-24 07:32:25 +00:00
Abdelrazak Younes
d7c3ab3203 * Paragraph: Move more things to Paragraph::Private
- remove META_INSET from Paragraph.h
- move text_ container to Private. I know this put there for performance reason but I don't see any penalty with this move. I guess this is because Buffer loading doesn't use Paragraph::getChar() anymore. I will move performance critical code to Paragraph::Private when/if we detect them.
- replace Paragraph::value_type with straight char_type: this was more noise than anything.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21163 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-24 07:08:55 +00:00
Dov Feldstern
662b58497e Getting rid of LTR bias --- part 1/?
This is the first patch in a series meant to remove LTR bias from the code.
Currently, there are many places in the code where "right" and "left" are used,
but where we actually mean "forward" and "backwards" --- which is the same 
thing in LTR text, but not in RTL/Bidi text.

See full details in http://permalink.gmane.org/gmane.editors.lyx.devel/97550.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21128 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-22 22:18:52 +00:00
Abdelrazak Younes
e6f059a132 * Paragraph:
- simpleTeXOnePar(): renamed to latex(), beginning of de-spaghettization by truly splitting inset and character cases.
- appendChar(), appendString(): new method for buffer reading.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21117 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-22 13:09:16 +00:00
André Pönitz
f762cbf3c6 mainly cosmetics
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21079 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-20 10:03:45 +00:00
Abdelrazak Younes
6725b2db59 Reduce header dependencies in Paragraph.h
- Move Changes.h out of Paragraph.h
- pimpl the inset list.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21033 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-18 15:29:51 +00:00
Abdelrazak Younes
55beda376a Refactor Undo/Redo framework into an Undo class owned by a Buffer. This reduces header dependencies from Undo.h which was including lots of stuff previously. This also solves the bug where undo/redo were reset upon buffer switching. Now, each buffer has a truly independant undo/redo architecture.
In the future, when Cursor has been fixed to work correctly with multiple views of the same Buffer, we could transfer the Undo owner from Buffer to Cursor.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21031 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-18 11:51:17 +00:00
Abdelrazak Younes
f7b1c86393 Move Inset::Code to InsetCode.h
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20936 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-13 09:04:52 +00:00
Abdelrazak Younes
9a458ec6e9 Move private part of BufferView to a private implementation.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20896 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-11 09:59:01 +00:00
Jean-Marc Lasgouttes
1a53e1099a * src/paragraph_funcs.cpp (breakParagraph): change parameter 'flag' to
simpler 'keep_layout'

	* src/Text.cpp (breakParagraph): change parameter keep_layout to 
	inverse_logic.

	* src/Text3.cpp (dispatch): remove LFUN_BREAK_PARAGRAPH_KEEP_LAYOUT;
	implement "inverse" flag to LFUN_BREAK_PARAGRAPH.

	* src/LyXAction.cpp:
	* src/insets/InsetCaption.cpp (doDispatch):
	* src/insets/InsetFlex.cpp (doDispatch):
	* src/insets/InsetTabular.cpp (doDispatch): 
	* src/insets/InsetIndex.cpp (doDispatch):
	* src/lfuns.h: remove all traces of LFUN_BREAK_PARAGRAPH_KEEP_LAYOUT.

	* lib/bind/cua.bind:
	* lib/bind/xemacs.bind: 
	* lib/bind/emacs.bind:
	* lib/bind/mac.bind: adapt bindings.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20846 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-08 13:17:15 +00:00
André Pönitz
b847b8c7df the delegate patch
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20667 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-02 18:27:20 +00:00
Richard Heck
e020bc1806 Fulfill promise to Andre: TextClass_ptr --> TextClassPtr.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20349 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-18 17:46:14 +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
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
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
13e8185afa header cleanup.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19997 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-02 11:46:05 +00:00
Abdelrazak Younes
67fc32064f header cleanup.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19996 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-02 11:33:04 +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
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
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
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
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
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
Richard Heck
6e93e77f22 This is one of a series of patches that will merge the layout modules development in personal/branches/rgheck back into the tree.
Design goal: Allow the use of layout "modules", which are to LaTeX packages as layout files are to LaTeX document classes. Thus, one could have a module that defined certain character styles, environments, commands, or what have you, and include it in various documents, each of which uses a different document class, without having to modify the layout files themselves. For example, a theorems.module could be used with article.layout to provide support for theorem-type environments, without having to modify article.layout itself, and the same module could be used with book.layout, etc.

This first patch does some reworking of the infrastructrue. We need to distinguish between the TextClass that a particular document is using and the layout of that document, since modules, in particular, can modify the layout. The solution adopted here is to add a TextClass pointer to BufferParams, which will hold the layout. The layout itself is then constructed from the TextClass the document is using. At present, this is completely trivial, but that will change when modules are added.

The pointer in question is a boost::shared_ptr. This is needed because CutAndPaste saves a copy of the layout with each cut or copied selection. We cannot assume the selection vanishes when the document is closed, so there are two options: (i) keep a list of all the layouts that have ever been used by any document; (ii) used some kind of smart pointer. The latter seems preferable, as the former would waste memory. More importantly, the use of a smart pointer allows modules to be modified on disk and then reloaded while LyX is running, and it will eventually allow the same for layout files.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19756 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-23 16:41:13 +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
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
Abdelrazak Younes
8f83eab31f Fix crash when the Outline dialog is opened on an empty document. This was caused by the commented out updateLabels() in LyXFunc::menuNew().
* Text: new empty() method.

* buffer_funcs.cpp:updateLabels(): return early in case of empty document.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19566 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-14 16:59:59 +00:00
Alfredo Braunstein
bc0a64efc3 * DocIterator.h (forwardPosNoDescend): remove method
* DocIterator.cpp (forwardPos, backwardPos): move the 'flat' part to...
* CursorSlice.{h,cpp} (forwardPos, backwardPos, at_end, at_begin): new methods, the first two are part of their DocIterator homonym
* Text2.cpp (setFont): receive CursorSlice arguments as the function is not recursive, adapt
* Text.cpp:
* lyxfind.cpp (findNextChange):
* insets/InsetCollapsable.cpp: adapt



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19500 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-13 13:36:19 +00:00
José Matox
f130c13c7b Increase the file format, now every \\begin_deeper has a corresponding \\end_deeper.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19461 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-12 14:56:49 +00:00
Christian Ridderström
1050cc4471 Converted '#warning ...' into FIXME-comments
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19397 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-10 11:47:12 +00:00
Abdelrazak Younes
4a53fa6e01 Allow unicode in Layout names.
* Layout.h:
  - name_, obsoleted_by_, depends_on_ are now docstrings.

All other changes results from the above string -> docstring changes. In particular, we now try to translate the layout names only if possible (i.e. if they are ASCII only).



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19042 a592a061-630c-0410-9148-cb99ea01b6c8
2007-07-11 13:39:08 +00:00
Abdelrazak Younes
f1a6378d72 Fix bug 3719: TOC skip-to points out of sync with document
http://bugzilla.lyx.org/show_bug.cgi?id=3719

The problem is that the full toc is not regenerated when creating standard (i.e unnembered) paragraph. As the TocBackEnd use ParIterator for in buffer jumps, this can get out of sync. The partial updateLabel() is my doing and comes before the TocBackend stuf. 


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19040 a592a061-630c-0410-9148-cb99ea01b6c8
2007-07-11 13:20:19 +00:00
Jean-Marc Lasgouttes
ae9dad1770 remove obsolete references to saveSelection
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19024 a592a061-630c-0410-9148-cb99ea01b6c8
2007-07-10 10:54:42 +00:00
Dov Feldstern
72535633e3 Fix bug 3889 (justification of Bidi text in the GUI)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19016 a592a061-630c-0410-9148-cb99ea01b6c8
2007-07-09 17:18:35 +00:00
Alfredo Braunstein
7bc7431b49 Fix to bug 3886
acceptChanges:

* move the bulk of acceptChanges without the call to DEPM to 
paragraph_funcs

copySelectionHelper:

* call this new acceptChanges

pasteParagraphList:

* use Text::setCursor(Cusor,...) instead of Text::setCursor(CursorSlice...) 
in order to have DEPM invoked at the end of the insertion



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18892 a592a061-630c-0410-9148-cb99ea01b6c8
2007-06-26 14:11:42 +00:00
Uwe Stöhr
d8993d2d6c - Fileformat change: rename "arabic" to "arabic_arabtex"
- Split the language Arabic into "arabic_arabi" that uses the arabi-package and "arabic-arabtex" that uses the arabTeX-package to typeset Arabic. This is needed because both packages have some advantages over the other people need.
(This change is a consequence of a long and fruitful discussion with Mostafa, Dov, and me.)

Patch by Dov and me.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18887 a592a061-630c-0410-9148-cb99ea01b6c8
2007-06-26 00:11:03 +00:00
Alfredo Braunstein
cc30726cc4 whitespace
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18883 a592a061-630c-0410-9148-cb99ea01b6c8
2007-06-25 12:01:25 +00:00
Stefan Schimanski
3aa79562d0 * Magic to switch language of a space directly in front of a RTL<->LTR
boundary, when the user enters text directly behind the boundary
  (patch by Dov Feldstern)
  


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18717 a592a061-630c-0410-9148-cb99ea01b6c8
2007-06-08 14:24:57 +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
Stefan Schimanski
aa64f8da68 * Make the selection drawing algorithm in Text aware of RTL and LTR mixed in a paragraph
(fixes bug 3550: Selection in mixed RTL-LTR paragraphs is broken)


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18668 a592a061-630c-0410-9148-cb99ea01b6c8
2007-06-04 18:41:56 +00:00
Stefan Schimanski
de15c267e3 * Added another isRTL variant which takes a CursorSlice
* Use the isRTL information to compute the cursor position correctly around
  insets in RTL text. Those insets are positioned to the right of the cursor position
  in the text.
  (fixes issue (3) of bug 3551: Cursor movement in and around insets in RTL paragraphs)


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18667 a592a061-630c-0410-9148-cb99ea01b6c8
2007-06-04 18:40:06 +00:00
José Matox
35eb5ddb22 Add support for Farsi (thanks to Mostafa Vahedi).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18599 a592a061-630c-0410-9148-cb99ea01b6c8
2007-05-31 18:53:01 +00:00
Lars Gullik Bjønnes
897436efbb Whitespace cleanup
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18550 a592a061-630c-0410-9148-cb99ea01b6c8
2007-05-28 22:27:45 +00:00
Bo Peng
72e0b87a90 Separate caption and label from InsetListingsParams and handle them separately in listings and Include dialog, from Jurgen
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18324 a592a061-630c-0410-9148-cb99ea01b6c8
2007-05-14 20:42:14 +00:00
Jürgen Spitzmüller
a8010a4dc6 fix bug 2758:
* src/Paragraph.cpp:
	- make sure removed bibitems (inside a par) are restored correctly
	  (in pos 0).
* src/Text.{cpp,h} (handleBibitems):
	- new member, used by erase and backspace.
* src/Text3.cpp (getStatus):
	- allow inserting of bibitems only in pos 0.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18304 a592a061-630c-0410-9148-cb99ea01b6c8
2007-05-14 09:24:17 +00:00
Richard Heck
7753dd6e6f Fix for bug 2951. Adds default fn: prefix tolabels in footnotes.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18235 a592a061-630c-0410-9148-cb99ea01b6c8
2007-05-08 15:10:08 +00:00
Abdelrazak Younes
2640b21228 * Inset and derivatives: insetName() -> name()
* InsetMath::name(): deleted.

* buffer_funcs.cpp:setCaptions() fix potential bug by using docstring copy instead of reference while using Inset::name.





git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18119 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-30 14:39:09 +00:00
André Pönitz
e0d54dd3b4 LyXText -> Text
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18103 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-29 23:33:02 +00:00