Commit Graph

273 Commits

Author SHA1 Message Date
Abdelrazak Younes
2f54e2b75f LFUN_PARAGRAPH_GOTO: break/continue early. Force a full redraw.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22954 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-12 08:04:59 +00:00
Abdelrazak Younes
76ec27281b * BufferView::putSelectionAt(): Ensure a redraw in any case.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22927 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-10 19:18:57 +00:00
Abdelrazak Younes
149778a0a5 Ensure that the cursor is visible when searching text. Should fix the spellchecker and a few other bugs.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22926 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-10 19:05:09 +00:00
Abdelrazak Younes
02e8322c79 Fix LFUN_WORD_FIND
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22925 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-10 18:52:32 +00:00
Abdelrazak Younes
288b939274 More sensible default margins for fullscreen mode.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22913 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-10 10:01:16 +00:00
Abdelrazak Younes
6cdf6bd6ab Support full screen in BufferView
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22899 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-09 17:20:23 +00:00
André Pönitz
24fdfc7d5e start work on less-likely-to-misuse iterators.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22898 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-09 15:23:05 +00:00
José Matox
03fb3b0aec Patch to please gcc 4.3. Less bloat in the include headers means that
we need to include explicitly some header files now.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22846 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-07 17:04:06 +00:00
Abdelrazak Younes
28826a461c header cleanup
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22826 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-07 08:58:35 +00:00
Stefan Schimanski
bfd3a964b3 * show anchor paragraph completely if the whole buffer is visible.
We need some better handling of the case when the cursor is in the
very first line, but the line is not completely visible. If the line
is not heigher than the BufferView we should scroll up to show it
completely.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22790 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-05 14:23:59 +00:00
Stefan Schimanski
0364c6c3cb * Make sure the cursor is completely visible when the BufferView get's its initial size.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22786 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-05 13:14:53 +00:00
Abdelrazak Younes
ddec18ca01 * BufferView::scrollDocView(): take care of the general case before the particular top and bottom cases as those don't work very well when the document starts or ends with a big inset.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22710 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-29 13:34:18 +00:00
Abdelrazak Younes
b78acb0b9d * BufferView::scrollDocView(): simplify by using showCursor() and add some comments.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22708 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-29 10:17:41 +00:00
Abdelrazak Younes
81e06f7bc9 Fix scrolling to top and bottom of the document.
* BufferView
- showCursor(DocIterator): new DocIterator argument.
- showCursor(): use above method.
- scrollDocView(): take care of top and bottom special cases early in the method.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22707 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-29 09:51:12 +00:00
Stefan Schimanski
ab1a045d10 * fix random jumps when scrolling very fast using a touchpad or mouse wheel.
The problem was this: The value in BufferView::scrollDocView(int value) is
relative to the d->scrollbarParameters_.min/max interval and _not_ absolute.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22675 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-26 00:47:22 +00:00
Pavel Sanda
f0f485e40d Get rid of ugly strings in .po file
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22625 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-18 22:50:19 +00:00
Abdelrazak Younes
ae0667c112 More scrolling work. Now the scrollbar parameters are normalized against the screen geometry and coordinates. This simplifies the logic and the code significantly.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22614 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-17 17:06:55 +00:00
Abdelrazak Younes
68d11a0b29 scrolling tweaks...
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22600 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-16 15:15:26 +00:00
Abdelrazak Younes
bc3029bcf4 scrolling tweaks... asymptotically tending towards scrolling correctness...
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22599 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-16 14:31:00 +00:00
Abdelrazak Younes
2db839d7bb Scrolling fixes...
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22598 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-16 09:06:36 +00:00
Bo Peng
c20f5a64d9 Embedding: simplify the interface of EmbeddedFiles, which will be later merged to EmbeddedFileList
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22444 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-08 18:33:43 +00:00
Abdelrazak Younes
e40499d5df BufferView::showCursor(): better fix.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22438 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-08 15:49:03 +00:00
Pavel Sanda
922aa7b1e8 Add characters counting.
Introduce LFUN_STATISTICS.
see http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg134033.html .


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22433 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-08 15:18:00 +00:00
Abdelrazak Younes
8379c2b70f Fix anchor bug.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22432 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-08 14:55:11 +00:00
Bo Peng
ed2b1631db Showing a message box after embedding status is changed.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22349 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-03 16:41:06 +00:00
Abdelrazak Younes
5587709f0e Introduce LFUN_SCROLL.
Santa-clauss.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22324 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-27 11:37:07 +00:00
Abdelrazak Younes
88942bcae4 Fix a crash with depm.
* BufferView::checkDepm(): update d->cursor_ in case of depm.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22322 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-27 10:39:25 +00:00
Abdelrazak Younes
f3326796a1 Fix next-inset-toggle after scrolling work.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22321 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-27 09:44:39 +00:00
Abdelrazak Younes
02fd454216 header cleanup.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22316 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-26 14:21:50 +00:00
Abdelrazak Younes
ebdd03d477 Properly fix undo/redo following scroll work.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22315 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-26 14:10:24 +00:00
Abdelrazak Younes
e1033d4ad6 Fix undo/redo following scroll work.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22314 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-26 14:00:55 +00:00
Abdelrazak Younes
fc2658eff0 initial basic context menu support.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22309 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-26 12:40:58 +00:00
Abdelrazak Younes
518871a52b Don't pretend we have multiple menu backends: transfer the singleton to GuiApplication.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22303 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-25 22:27:32 +00:00
Abdelrazak Younes
02110a3d5b Prepare the code for context menu support.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22300 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-25 20:12:07 +00:00
Abdelrazak Younes
7c832d2d84 Implement tooltips for visible insets.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22298 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-25 18:53:38 +00:00
Abdelrazak Younes
2b9153b8bc Fix navigation and bookmarks.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22255 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-22 10:19:26 +00:00
Abdelrazak Younes
3b368687f9 Another fix for cursor movement up with big insets.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22252 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-22 09:10:49 +00:00
Abdelrazak Younes
62799a6707 Some fixes.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22251 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-22 09:04:53 +00:00
Stefan Schimanski
36dbec4506 * Lazy MathData to avoid unneeded interpretation of macro definitions
* DocIterator as MacroPosition
* Iterative search for macro in scope until a visible one is found.
This include the ability to resolve macro inside nested text insets.
* Speed up macro lookups by factor 2: only getMacro(name) call, no
further hasMacro(name) call before
* Both way child/master support
* Correct macro scope for multi-paragraph environments
* Correct macro scope for multi-depth-paragraphs
* Buffer::updateMacros made const
* Update macros when loaded (of master and child)
* Do not remove too many braces when unfolding a macro. This could
lead to a data loss because the relationship between arguments of
macros can be mixed up if nested macros are unfold at once.
* Reduce dependencies to MetricsInfo in MathMacro   
* Update macros when needed. Normally it's done just before doing
metrics. But in cases without a brace around some constructs (like
\left(bla\right)) there is some help needed.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22241 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-21 20:42:46 +00:00
Abdelrazak Younes
7280d67126 More scrolling tweaks.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22233 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-21 13:38:09 +00:00
Abdelrazak Younes
4fe31abd06 Fixed size line scrolling gives a better user experience.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22232 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-21 13:24:57 +00:00
Abdelrazak Younes
f833ad1d2c scrolling tweaks.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22231 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-21 13:03:45 +00:00
Abdelrazak Younes
96d2d6fc50 * LyXFunc::dispatch(): invert BufferView::dispatch() and cursor::dispatch() calling.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22227 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-21 10:42:59 +00:00
Abdelrazak Younes
b8be6be268 Fix LFUN_BUFFER_END
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22226 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-21 10:11:32 +00:00
Abdelrazak Younes
d3980b14a8 code simplification.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22225 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-21 09:45:04 +00:00
Abdelrazak Younes
2e8fdbb54b rename BufferView::center() to showCursor().
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22222 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-21 08:35:43 +00:00
Abdelrazak Younes
7998dfd948 Close to perfect scrolling. Some bugs fixing and behaviour tweaking remains but we are on a much saner ground.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22221 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-21 08:28:18 +00:00
Abdelrazak Younes
a84b8ca6be Fix PageDown/Up scrolling.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22212 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-19 08:41:16 +00:00
Abdelrazak Younes
65dc5e8337 Fix some scrolling issues.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22211 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-19 07:47:03 +00:00
Abdelrazak Younes
9abb7db468 getting rid of superfluous std:: statements.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22104 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-12 19:28:07 +00:00
Abdelrazak Younes
b89cc942eb 'using namespace lyx::support' instead of 'using support::xxx'
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22103 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-12 18:57:56 +00:00
Abdelrazak Younes
9383f4c3c6 'using namespace std' instead of 'using std::xxx'
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22097 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-12 10:16:00 +00:00
Abdelrazak Younes
0743f576cb * BufferView:
- dispatch(): transfer LFUN_FILE_INSERT_PLAINTEXT_* to GuiView::dispatch()
- insertPlaintextFile(): split in BufferView::insertPlaintextFile() and GuiView::insertPlaintextFile()

This patch get rid of FileDialog use in BufferView. Remains Buffer, Converters and LyXFunc.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21930 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-02 20:05:17 +00:00
Abdelrazak Younes
c68601da9f * BufferView:
- dispatch(): transfer LFUN_FILE_INSERT to GuiView::dispatch()
- menuInsertLyXFile(): split in BufferView::insertLyXFile() and GuiView::insertLyXFile()


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21923 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-02 17:50:08 +00:00
Abdelrazak Younes
b1db731a98 * FileName::fileContents(): new argument to define the file encoding.
* BufferView:
- insertPlaintextString(): now accept a FileName.
- contentsOfPlaintextFile(): ditto and use FileName::fileContents().
 

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21915 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-02 11:55:25 +00:00
Abdelrazak Younes
334a76e1d7 compile fix.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21873 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-30 08:35:54 +00:00
André Pönitz
2506e0d643 assimilate BOOST_CURRENT_FUNCTION
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21867 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-29 21:10:35 +00:00
André Pönitz
9d0ea8aeff Move debug.{cpp,h}, Messages.{cpp,h} and gettext.{cpp,h} to support/.
Now support/* should have no dependencies on src/* anymore.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21851 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-29 07:04:28 +00:00
André Pönitz
d95451ae5c s/isFileReadable/isReadableFile;
introduce isReadableDirectory
replace isReadable by either isReadableFile or isReadableDirectory
remove isReadable


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21769 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-25 11:18:16 +00:00
Pavel Sanda
cf5ff50617 Fix dialog handling of Insert Plain Text
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21737 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-23 10:54:19 +00:00
Abdelrazak Younes
c0a9d2587c Painting tweaks:
- avoid one redraw on file loading due to a resize event.
- fix the initial offset_ref_ value of BufferView.
- add new TabWorkArea::addWorkArea() method.
- avoid tab bar flashing when only one file is opened.




git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21674 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-19 10:04:14 +00:00
André Pönitz
d5fc2425a9 consolidate showDialog() incarnations
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21662 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-18 00:39:15 +00:00
Abdelrazak Younes
926abae753 Simplify single par drawing:
* ParagraphMetrics::computeRowSignature(): Integrate row's dimensions and selection status in the row signature.
* TextMetrics::drawParagraph(): compute the row signature here and rely on that to decide if a redraw is needed or not.
* BufferView::Private: get rid of the ViewMetricsInfo member. Just keep the ScreenUpdateStrategy.
* BufferView::draw(): full screen update even for singlePar case because the row signature will detect if something needs to be redrawn.
* Text3.cpp: get rid of hack following architecture update.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21650 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-17 11:27:03 +00:00
André Pönitz
e1ce2f92db reduce line noise
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21631 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-15 20:04:51 +00:00
André Pönitz
f625dd7ea0 cosmetics
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21593 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-13 23:50:28 +00:00
André Pönitz
a88884aaa2 simplification
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21483 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-06 22:20:05 +00:00
Jürgen Spitzmüller
ddbcee01ac * src/BufferView.cpp:
- move the LFUN_OUTLINE_*'s out of here ...
* src/Text3.cpp:
	- to this place. This fixes a crash (bug 4330).

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21475 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-06 17:13:43 +00:00
Abdelrazak Younes
bac194f5db Revision 21471: Forgot that.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21472 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-06 14:18:09 +00:00
Abdelrazak Younes
0b0c27ef59 * BufferView: Make use of ScreenUpdateStrategy::NoScreenUpdate, avoid a screen redraw when it is not really needed.
* Painter.h: move isDrawingEnabled() to public Area.

* TextMetrics::drawParagraph(): backup and restore original drawing state of the Painter.

* InsetTabular::draw(): ditto.

* InsetMathNest::drawSelection(): ditto.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21471 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-06 14:07:49 +00:00
Abdelrazak Younes
e660f44001 Current update architecture doesn't need multiParSel() special case anymore.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21467 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-06 09:34:16 +00:00
Abdelrazak Younes
257117ac1e Oups...
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21464 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-06 08:57:48 +00:00
Abdelrazak Younes
f84080f01c * Bufferview::updateMetrics(): Separate out the SinglePar optimization.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21463 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-06 08:32:25 +00:00
Dov Feldstern
ddd82f7aa4 Getting rid of LTR bias --- part 3/4
This is a continuation of r21128, r21244


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21448 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-05 19:41:16 +00:00
André Pönitz
09b7e6e60a some std::string -> filename changes
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21404 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-03 17:37:37 +00:00
André Pönitz
f370da4113 some de-boostification
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21387 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-02 19:59:08 +00:00
Stefan Schimanski
1231489798 * dynamic macros as described in http://1stein.org/download/dynmacro.pdf
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21328 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-01 11:13:07 +00:00
Martin Vermeer
325da0a915 Update current font when moving cursor by clicking mouse
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21267 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-29 18:57:56 +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
André Pönitz
9be03a87f9 start some work on file dialogs
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21238 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-28 16:32:20 +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
Richard Heck
2f4d0ae27e Remove methods marked for removal from InsetCommandParams. Yeah, we can do that now. ;-)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21154 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-23 18:51:04 +00:00
Bo Peng
b89d3f2cc2 Embedding: add LFUN_BUFFER_TOGGLE_EMBEDDING
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21106 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-21 20:06:44 +00:00
André Pönitz
f934b86850 cosmetics
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21097 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-21 10:50:56 +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
André Pönitz
a02653e4dd isome more FileName shuffling
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21048 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-18 23:03:51 +00:00
Abdelrazak Younes
d3e167c75f oups...
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21034 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-18 15:38:12 +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
61dba28fc4 please Angus.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20935 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-13 07:33:07 +00:00
Bo Peng
62c98f2ffc InsetInfo: add InsetInfo (core)
* src/insets/Inset.cpp: add InsetInfo
	* src/insets/Inset.h
	* src/insets/InsetInfo.cpp
	* src/insets/InsetInfo.h
	* src/LyXAction.cpp: add LFUN_INFO_INSERT
	* src/lfuns.h
	* src/BufferView.cpp: 
	* src/factory.cpp
	* src/Text3.cpp: insert InsetInfo with selected text
	* development/scons/scons_manifest.py: build tools update
	* src/Makefile.am


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20904 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-11 14:52:00 +00:00
Abdelrazak Younes
a800da1bfe initial support for shift + right-mouse-click selection.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20903 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-11 14:46:53 +00:00
Abdelrazak Younes
70b938bf5a Transfer some LFUNs from LyXFunc::getStatus() to BufferView::getStatus(). What a mess!
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20902 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-11 13:20:21 +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
Abdelrazak Younes
e3032e7d0e * BufferView::update(): renamed to processUpdateFlags() to clarify the intent. Also get rid of the default argument which added to the confusion as to what was the purpose of update(). Now also emit Buffer::changed() signal internally instead of assuming that the caller will act upon the returned boolean.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20884 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-10 08:52:55 +00:00
Abdelrazak Younes
86e8f751e1 Small API cleanup: as BufferView already use Buffer::changed() make it use it some more instead of WorkArea.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20747 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-05 09:38:40 +00:00
André Pönitz
58ab972f71 last commit was incomplete... not sure how I managed this..
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20710 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-03 20:15:49 +00:00
André Pönitz
095cf23394 shuffle some code around
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20706 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-03 18:56:37 +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
André Pönitz
83cf9ed0a9 I don't think that a single function that's only use once should have a
pair of files of its own


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20599 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-29 20:25:50 +00:00
André Pönitz
5aaf4dce20 move font related stuff from bufferview_funcs to Font
delete bufferview_funcs, since it's now empty


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20579 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-29 11:00:18 +00:00
André Pönitz
122f32ea29 cosmetics
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20578 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-29 09:22:17 +00:00
André Pönitz
f1687373b1 cosmetics
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20577 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-29 08:02:37 +00:00
André Pönitz
bd03eaa571 make some bufferview related stuff more local
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20576 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-29 07:34:42 +00:00
Abdelrazak Younes
2417d9d911 * BufferView::updateMetrics(): split up the method in two for the SinglePar case.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20563 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-28 09:11:24 +00:00
Abdelrazak Younes
e0f7fde3b6 * BufferView::updateMetrics(): allows the SinglePar optimization to proceed if the paragraph height did not change.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20562 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-28 08:19:03 +00:00
Abdelrazak Younes
b64f836199 * BufferView::update(): fitCursor() optimization.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20560 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-28 07:32:19 +00:00
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
585b3217f5 Remove unused code and comment.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20485 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-25 09:35:36 +00:00
Abdelrazak Younes
a622a0645c * BufferView::workAreaDispatch(): reconstruct the ViewMetricsInfo in any case when a mouse hovering event is detected. It seems that the anchor/offset_ref_ are modified behind our back...
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20483 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-25 08:47:54 +00:00
Abdelrazak Younes
8df72fdd0f * BufferView::workAreaDispatch(): restore anchor when mouse hovering. The problem is that scrollbar update modified the offset_ref_.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20482 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-25 08:09:11 +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
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
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
Abdelrazak Younes
df6dca574e temporarily disabling mouse hover feature as it is causing painting problems.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20330 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-17 22:11:13 +00:00
Lars Gullik Bjønnes
9e770f6e53 Whitespace changes only
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20305 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-16 10:38:25 +00:00
Abdelrazak Younes
f53592dd60 LFUN_SCREEN_UP/DOWN: Take into account the off-screen cursor case.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20288 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-15 14:33:37 +00:00
Abdelrazak Younes
78b78ec6e1 Give a sane behaviour to page up/down scrolling when clicking in the page scroll area of the scrollbar.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20287 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-15 13:59:26 +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
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
Jürgen Spitzmüller
59c2e75e41 * src/insets/InsetCommand.{cpp,h}:
- implement edit function that opens the inset's dialog.
* src/BufferView.cpp (doDispatch):
	- call inset->edit (i.e. open dialog) for EDITABLE insets on next-inset-toggle (bug 2907)
* src/Text3.cpp (doDispatch: INDEX_INSERT):
	- move inset->edit to where it belongs.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20193 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-10 16:06:01 +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
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
762d087396 fix warning.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20067 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-05 13:29:31 +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
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
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
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
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
b45bc7944d Fix DEPM crash within inset.
* BufferView::updateMetrics(): always clear the full text_metrics_ when doing a full update.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19919 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-30 16:48:47 +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
4590960f02 header cleanup.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19855 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-28 15:32:39 +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
a43e822c98 Transfer rowpainter.cpp:paintText() to BufferView::draw()
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19843 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-27 22:53:16 +00:00
Abdelrazak Younes
91f8cbe204 * BufferView::workAreaResize(): renamed to resize.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19766 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-24 07:05:19 +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
65e16cdb27 add comments and remove dead code from revision 19721.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19726 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-22 14:44:34 +00:00
Abdelrazak Younes
7e6d5cb553 bug fix.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19725 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-22 14:38:25 +00:00
Abdelrazak Younes
e809647c77 simplify BufferView::moveToPosition() use for the external use (in LyXView and LyXFunc).
* BufferView::moveToPosition()
- now only return success boolean
- now schedule a screen centering
- now set the current font to the new position.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19722 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-22 14:25:51 +00:00
Abdelrazak Younes
5203c56db4 Fix bug 3427:
http://bugzilla.lyx.org/show_bug.cgi?id=3427

The problem was that offset_ref_ was calculated based on an empty metrics. The solution is delay the calculation up until the next metrics update.

* BufferView:
- center(): now just set the anchor_ref and program a new screen recentering.
- updateOffsetRef(): update the offset_ref_


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19721 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-22 14:14:52 +00:00
Abdelrazak Younes
8202f63160 transfer cursor position saving (in the session) from ~WorkArea to ~BufferView.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19719 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-22 09:06: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
1356543c45 The BufferView/WorkArea/LyXView reorg a.k.a Multiple WorkAreas:
* Buffer:
- get rid of cursor_ and anchor_
- ~Buffer(): update the labels of its master buffer before closing
- closing(): pass the Buffer address.

* BufferView():
- BufferView(): needs a valid Buffer (should be const in the future.
- most of the change is about removing all test of buffer_ nullity.
- resize(): deleted.
- setBuffer(): deleted.

* Application:
- newLyXView(): simplification
- updated design description in Application.h

* Gui/GuiImplementation: remove all WorkAreas and BufferView creation/Deletion. Workareas are directly handled by  LyXView/GuiView and BufferView is created/delete by WorkArea.

* LyXView/GuiView: implement the new design

What is not working yet:
- the close tab button: it is implemented but does not show up.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19686 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-21 07:33:46 +00:00
Jean-Marc Lasgouttes
35fa399edd Syncronize with 1.5. This stuff was uncommitted in y tree actually.
* src/BufferView.cpp (workAreaDispatch): set selection status here

	* src/Text3.cpp (dispatch):
	* src/InsetTabular.cpp (doDispatch): and not here


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19396 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-10 10:21:09 +00:00
Richard Heck
eacbcb3f3a Fix bug 4096. Don't disconnect the buffer until we're ready to connect again.
Also, clean up the code a little.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19287 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-03 14:07:39 +00:00
Abdelrazak Younes
ada0bd00f0 more std declaration fixes.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19103 a592a061-630c-0410-9148-cb99ea01b6c8
2007-07-17 17:40:44 +00:00
Abdelrazak Younes
0b555eba87 * BufferView::setCursorFromRow(): reset the Cursor to the main InsetText because that is what is expected afterwards.
This fixes this crash reported by Bennett:

I'm using pdfsync via lyxpipe to have LyX jump to where I click in the .pdf file of an open LyX document. Recently I've been getting crashes. Here's the console output:

Assertion triggered in void lyx::Text::setCursorIntern(lyx::Cursor&, lyx::pit_type, lyx::pos_type, bool, bool) by failing check "this == cur.text()" in file Text2.cpp:746


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19093 a592a061-630c-0410-9148-cb99ea01b6c8
2007-07-17 08:37:47 +00:00
Jean-Marc Lasgouttes
1d51120eb4 Restore the persistent selection feature (disabled because of bug 3877)
See also http://www.lyx.org/trac/changeset/19003

	* BufferView.cpp (setBuffer): save selection before switching buffer
	(mouseSetCursor): save selection before resetting it
	(putSelectionAt): no need to save selection

	* Cursor.cpp (selHandle): save selection before resetting it

	* CutAndPaste.cpp (cutSelection, eraseSelection): save selection before
	deleting it.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19026 a592a061-630c-0410-9148-cb99ea01b6c8
2007-07-10 12:44:19 +00:00
Alfredo Braunstein
2932434aaa * Fix to Bug 3903
When moving the cursor with a mouse click, notify all left insets, not 
just the top one


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18850 a592a061-630c-0410-9148-cb99ea01b6c8
2007-06-21 21:56:43 +00:00
Stefan Schimanski
557521034f * Clear the paragraph metrics cache as well on redraw:
On fullscreen redraw the metrics of all visible paragraphs are
  recreated and stored in the TextMetrics object. If the number of
  paragraphs on screen does not change everything is fine because the
  paragraph metrics cache is just updated. But if the number decreases
  it can happen that old paragraph metrics remain in the cache. If this
  happened because e.g. a paragraph was deleted, it's possible that the
  cached paragraph is longer than the one which is actually at the
  position now. Using the Row objects from the cached paragraphs then
  can trigger accesses to positions which would have been valid in the
  old paragraph, but go over the end of the paragraph which is there
  now. 


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18841 a592a061-630c-0410-9148-cb99ea01b6c8
2007-06-21 06:41:55 +00:00