Commit Graph

363 Commits

Author SHA1 Message Date
Abdelrazak Younes
8106f1809f Optimize buffer-switch: do first updateLabels() on opening instead of at each buffer switching.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16645 a592a061-630c-0410-9148-cb99ea01b6c8
2007-01-11 08:34:23 +00:00
Abdelrazak Younes
31cbae750d fix cursor movements.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16638 a592a061-630c-0410-9148-cb99ea01b6c8
2007-01-10 10:59:18 +00:00
Georg Baum
fed31122c4 Tell X the selection status also after it is changed by the keyboard, since
we got a consensus on this on the list.
Some calls of haveSelection are still missing, but we need to decide the
"persistent selection" question before those can be implemented properly.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16572 a592a061-630c-0410-9148-cb99ea01b6c8
2007-01-07 14:44:44 +00:00
Abdelrazak Younes
fc86d802ee update comments.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16558 a592a061-630c-0410-9148-cb99ea01b6c8
2007-01-06 23:24:55 +00:00
Abdelrazak Younes
063fdd118b This commit fixes the singlePar optimization which was disabled due to the ParagraphMetrics cleanup.
* rowpainter.C::paintPar(): don't calculate row signature here. Use ParagraphMetrics::rowChangeStatus() instead.

* RowList_fwd.h: RowSignature is now a vector.

* ParagraphMetrics
  - rowChangeStatus(), updateRowChangeStatus(), calculateRowSignature(): new methods.
  - row_signature_: new member
  - rowSignature_: renamed to row_signature_

* TextMetrics::redoParagraph(): call ParagraphMetrics::updateRowChangeStatus()

* BufferView::updateMetrics(): simplify the singlePar case.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16543 a592a061-630c-0410-9148-cb99ea01b6c8
2007-01-06 09:15:59 +00:00
Abdelrazak Younes
0b995c888f The bug-fix in revision 16531 introduced another bug. This is the right fix. I did not understood correctly what was anchor_ref_.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16536 a592a061-630c-0410-9148-cb99ea01b6c8
2007-01-05 15:35:10 +00:00
Abdelrazak Younes
7d4edd3f79 Fix screen update when deleting insets:
http://bugzilla.lyx.org/show_bug.cgi?id=3071


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16531 a592a061-630c-0410-9148-cb99ea01b6c8
2007-01-05 14:31:59 +00:00
Georg Baum
9e49efd593 * src/BufferView.C
(BufferView::clearSelection): Trigger a redraw so that the cleared
	selection becomes visible


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16524 a592a061-630c-0410-9148-cb99ea01b6c8
2007-01-05 09:21:30 +00:00
Michael Schmitt
57609ac606 * src/BufferView.C: fix typo in comment
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16514 a592a061-630c-0410-9148-cb99ea01b6c8
2007-01-04 19:59:58 +00:00
Bo Peng
a8e914b500 Fix crashes caused by invalid last_inset_ due to keyboard editing
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16485 a592a061-630c-0410-9148-cb99ea01b6c8
2007-01-03 23:05:27 +00:00
Abdelrazak Younes
ad84c0ce5d delete unused variables.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16443 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-30 15:53:19 +00:00
Abdelrazak Younes
ceb51f7f76 Sanitize the DEPM!
* BufferView:
  - checkDepm(): new method for DEPM mechanism.
  - mouseSetCursor(): use checkDepm().

* text2.C:
  - use BufferView::checkDepm() instead of using LyXText::deleteEmptyParagraphMechanism() directly.
  - deleteEmptyParagraphMechanism(): prepare for conversion to DocIterator (code transferred to BufferView::checkDepm()).


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16442 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-30 15:05:15 +00:00
Abdelrazak Younes
b2126408cf This commit do the Model/View separation of the LyXText and Paragraph classes. The separation is mostly complete for the Paragraph class but some more transfer should occur for the LyXText class.
* ParagraphMetrics.[Ch]: new files

* TextMetrics.[Ch]: new files.

* lyxtext.h/text2.C/text3.C: some code transferred to the TextMetrics class.

* paragraph.[Ch]: all screen oriented code transfered to ParagraphMetrics class.

* BufferView:
 - text_metrics_: new TextMetrics cache private member.
 - textMetrics(): new access method.
 - parMetrics(): ditto.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16433 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-29 23:54:48 +00:00
Georg Baum
979fdf7456 Fix strange bibtex problem by converting some more functions to use FileName
instead of std::string

	* src/support/lyxlib.h
	* src/support/getcwd.C
	(getcwd): return a FileName, not a std::string in filesystem encoding

	* src/support/filetools.[Ch]
	(makeAbsPath): return a FileName, not a std::string in undefined encoding

	* src/support/lyxlib.h
	* src/support/tempName.C
	(makeAbsPath): return a FileName, not a std::string in undefined encoding

	* many other files: Adjust to the changes above


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16399 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-27 10:56:11 +00:00
Georg Baum
c6f0c8d0b6 convert author names and status messages to docstring
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16363 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-21 13:58:28 +00:00
Bo Peng
7df29f6562 minor style change: use 0 instead of NULL
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16293 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-15 21:39:57 +00:00
Bo Peng
e78b1cf6d7 BufferView.h/C: use member variable last_inset_ instead of static variable in workAreaDispatch to avoid potential mutliple window problems
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16285 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-15 16:48:09 +00:00
Abdelrazak Younes
b802e94208 Fix cursor repositioning when a Window is resized or when switching Windows showing the same Buffer (this bug was not visible if "Cursor follow mouse" was set).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16282 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-15 16:16:20 +00:00
Bo Peng
50d1ba117a add a comment in workAreaResize
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16280 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-15 15:39:57 +00:00
Jürgen Spitzmüller
fc30e9f6bb Fix dEPM crash:
* src/BufferView.[Ch]: 
	- make mouseSetCursor a bool and pass dEPM return value.

* src/text3.C (doDispatch):
	- LFUN_MOUSE_PRESS: request update if mouseSetCursor
	  (i.e. dEPM) returned true.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16240 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-11 13:59:40 +00:00
Abdelrazak Younes
5ce7ae1883 * BufferView:
- update(): return bool only, and cleanup of the DOX comments.
  - workAreaDispatch(): return bool only, cleanup of the DOX comments, change update() call to updateMetrics() and add some FIXMEs.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16197 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-07 11:46:27 +00:00
Bo Peng
f5c6da2b51 Fix a button hover bug, remove button frame
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16194 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-06 22:51:39 +00:00
Georg Baum
3314702bf1 more unicode filenames
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16171 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-04 14:45:17 +00:00
Bo Peng
7c184e5426 Button face-lift: use mouse hover-buttons.
* src/insets/insetbase.h: add setMouseHover function
	* src/insets/insetcommand.h/C: handle setMouseHover
	* src/insets/insetcollapsable.h/C: handle setMouseHover
	* src/LColor.h/C: redefine some colors
	* src/insets/render_base.h: add state_
	* src/insets/render_button.C: draw differently according to state_
	* src/frontends/Painter.h/C: hover-stype button
	* src/frontends/qt4/GuiWorkArea.C: enable mouse tracking
	* src/BufferView.C: track mouse_motion without button events


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16162 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-04 04:31:18 +00:00
Georg Baum
ed99f752f9 more unicode filenames
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16133 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-02 16:07:15 +00:00
Georg Baum
8e6e970d7b Next step of true unicode filenames: Use support::FileName instead of
std::string at many places (not all yet).


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16069 a592a061-630c-0410-9148-cb99ea01b6c8
2006-11-26 21:30:39 +00:00
Michael Schmitt
286a8e2676 * src/text3.C:
* src/BufferView.C: add comments on why several
	change tracking-related LFUNs are always enabled


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16034 a592a061-630c-0410-9148-cb99ea01b6c8
2006-11-24 23:01:24 +00:00
Abdelrazak Younes
1278f826c9 * BufferView::update(): handle the special case Flag == FitCursor.
* InsetMathNest.C: adjust update flags in order to avoid unneeded screen redrawing.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16006 a592a061-630c-0410-9148-cb99ea01b6c8
2006-11-21 16:58:45 +00:00
Abdelrazak Younes
6ed456cfdf Fix full screen repaint on Buffer-load.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15999 a592a061-630c-0410-9148-cb99ea01b6c8
2006-11-20 17:10:44 +00:00
Abdelrazak Younes
37ee9727f7 Fix crash when closing the last buffer and add a FIXME.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15998 a592a061-630c-0410-9148-cb99ea01b6c8
2006-11-20 16:43:36 +00:00
Abdelrazak Younes
34600f5055 * Status.15x: updates.
* buffer.h: changed() signal do not have an argument now.

* BufferView.C:
  - setBuffer(): changed update() call to updateMetrics().
  - update(): sanitize how the flags are used.
  - scrollDocView():  add a call to updateMetrics() at the end.

* LyXFunc::dispatch(): adjust changed() signal emission.

* LyXText/text3.C:
  - cursorPrevious(): delete BufferView::update call; adjust cursor flag.
  - cursorNext(): ditto.

* frontends/LyXView.C: adjust Buffer::changed() signal connection.

* frontends/WorkArea.[Ch]:
  - redraw(): no need to re-update the metrics if we don't change views.
  

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15997 a592a061-630c-0410-9148-cb99ea01b6c8
2006-11-20 14:42:18 +00:00
Abdelrazak Younes
c66d2f1ee5 Optimize drawing.
* BufferView:
  - update(): returns a pair of bools in order to inform for singlePar cases.
  - workAreaDispatch(): ditto and simplify the logic by using cursor update flags.

* text.C
  - breakParagraph(): change the cursor update flag as needed.
  - insertChar(): ditto.
  - erase(): ditto
  - redoParagraph(): now returns true if there is a height change.

* text3.C: dispatch():
  - initialize the cursor flag at the beginning
  - LFUN_MOUSE_PRESS: no need to update.
  - LFUN_MOUSE_RELEASE: ditto.
  - add some FIXMEs and comments.

* LyXFunc::dispatch(): simplify the BufferView update.

* insets/insetcollapsable.C: clarify and simplify the logic in doDispatch().

* WorkArea::dispatch(): redraw only if needed.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15958 a592a061-630c-0410-9148-cb99ea01b6c8
2006-11-17 17:42:52 +00:00
Georg Baum
2734cc1548 Extend the navigate menu to child docs
* src/buffer_funcs.h
	(updateLabels): Add bool childonly argument

	* src/insets/insetbase.h
	(addToToc): New virtual method

	* src/insets/insetinclude.[Ch]
	(addToToc): New virtual method
	(updateLabels): New method

	* src/TocBackend.h: reorganize classes so that we can forward
	declare TocList

	* src/insets/insetfloat.[Ch]
	* src/insets/insetwrap.[Ch]
	(addToToc): Adjust to type changes in TocBackend.h

	* src/frontends/qt4/TocModel.[Ch]: ditto

	* src/frontends/controllers/ControlToc.[Ch]: ditto

	* src/TocBackend.C: ditto
	(TocBackend::update) Remove test for float and wrap inset,
	call virtual method instead

	* src/BufferView.C
	(BufferView::dispatch): make LFUN_PARAGRAPH_GOTO work even if the
	target paragraph is in a different buffer

	* src/MenuBackend.C: Adjust to type changes in TocBackend.h
	(expandToc): Add an entry for the master doc in child docs

	* src/buffer_funcs.C
	(setLabel): Add text class parameter
	(updateLabels): handle included docs if requested by the caller


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15904 a592a061-630c-0410-9148-cb99ea01b6c8
2006-11-13 16:53:49 +00:00
Abdelrazak Younes
a1d0ad06df * BufferView::workAreaDispatch(): prepare for finer grained updates.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15889 a592a061-630c-0410-9148-cb99ea01b6c8
2006-11-12 16:14:45 +00:00
Georg Baum
c0725c5beb Fix bug 2982 (two undo steps are needed to undo inset-dissolve)
* src/CutAndPaste.C
	(pasteParagraphList): Don't record undo info here...

	* src/BufferView.C
	(BufferView::menuInsertLyXFile): ... but here instead


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15886 a592a061-630c-0410-9148-cb99ea01b6c8
2006-11-12 15:48:33 +00:00
Abdelrazak Younes
1fc6b32689 * text.C:
- LyXText::breakParagraph(): Redo paragraphs before setCursor()
  - LyXText::insertChar(): ditto

* lyxfunc.C: take into account BufferView::update() returned value for WorkArea redrawing.

* BufferView::update(): we also need a second step in singlePar mode.

* WorkArea.C
  - startBlinkingCursor(): also show the cursor
  - stopBlinkingCursor(): also remove the visible cursor
  - processKeySym(): stop and start the cursor blinking instead of merely hide and show it.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15884 a592a061-630c-0410-9148-cb99ea01b6c8
2006-11-12 14:47:20 +00:00
Asger Ottar Alstrup
44b212878b - Avoid lyxerr[] like the plague. Use if (lyxerr.debugging( ... )) instead.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15792 a592a061-630c-0410-9148-cb99ea01b6c8
2006-11-07 21:31:33 +00:00
Abdelrazak Younes
2fe0529df8 Forgot this...
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15698 a592a061-630c-0410-9148-cb99ea01b6c8
2006-11-03 00:21:48 +00:00
Bo Peng
f49f2f6e22 New bookmarks implementation:
* src/lyxfunc.C: handle LFUN_BOOKMARK_GOTO and LFUN_BOOKMARK_CLEAR
	* src/session.h/C: store bookmarks here.
	* src/lfuns.h, src/LyXAction.C: add LFUN_BOOKMARK_CLEAR
	* src/BufferView.h/C: remove saved_positions, move LFUN_BOOKMARK_GOTO to lyxfunc.C
	* src/MenuBackend.h/C: add Bookmarks menu type
	* lib/ui/stdmenus.ui: change bookmarks menu items


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15673 a592a061-630c-0410-9148-cb99ea01b6c8
2006-11-01 15:55:17 +00:00
Abdelrazak Younes
eb651c3d61 Move BufferView cached pointer out of LyXText:
* LyXText
  - bv(), bv_owner, : deleted.
  - These methods now need a (Buffer const &) argument: getFont(), applyOuterFont(), getLayoutFont(), getLabelFont(), setCharFont(), setLayout(), singleWidth(), leftMargin(), rightMargin(), computeRowMetrics(), isMainText(), spacing(), isRTL(), cursorX(), rowBreakPoint(), setRowWidth(), labelFill(), labelEnd().
  - These methods now need a (BufferView const &) argument and are propably candidates for future removal when 1.6 is opened for development: redoParagraph(), x2pos(), getRowNearY(), getColumnNearX(), checkInsetHit(), setHeightOfRow().
  - recUndo(): now need a LCursor argument.
 
* CoordCache::get(LyXText const *, pit_type):
  - now const.
  - use const_iterator instead of iterator.

* FontIterator:
  - add (Buffer const &) argument to ctor
  - buffer_: new const reference to applicable BufferView.

* InsetBase
  - xo(), yo(), covers() and neverIndent() are now const.

* InsetText::setViewCache(): deleted

All other changes are due to the LyXText and InsetBase API changes.



 
  

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15618 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-30 12:45:33 +00:00
Bo Peng
b9c604e968 session: rename some functions
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15607 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-29 20:01:00 +00:00
Georg Baum
7fd7b25a3c Fix more member variable initialization order warnings from gcc.
Does nobody care about this???



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15604 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-29 16:16:00 +00:00
Bo Peng
0fc684e6e6 class session reorganization
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15581 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-27 14:18:03 +00:00
Abdelrazak Younes
128a8ef3e8 This commit fixes 3 crashes when reverting a document:
1) crash in GuiWorkArea::paintEvent(), this one is solved by by encapsulating the file loading in LyXView by busy(true)/busy(false) and by disabling/enabling the work area update in GuiView::busy().

2) crash in the cursor blinking because the cursor is timed out at the moment you click on "Revert". So the blinking cursor is now disabled/enabled in GuiView::busy().

3) crash in BufferView::setBuffer() because the current buffer was already closed folling the "revert" command. 
* BufferView::loadLyXFile(): set buffer_ to 0 in case of a reload (when document is reverted)

* LyXView:
  - busy() is not const anymore (work_area_ is modified in GuiView) 
  - loadLyXFile(): encapsulate the file loading with busy(true)/busy(false)
  - setBuffer(): encapsulate the buffer-switching with busy(true)/busy(false)

* GuiView::busy()
  - disable/enable workarea updates.
  - disable/enable blinking cursor.

* WorkArea: new startBlinkingCursor() and stopBlinkingCursor() methods.

* rowpainter.C:
  - paintText(): make sure there is a Buffer from which to paint.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15556 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-26 13:29:10 +00:00
Abdelrazak Younes
e0c193fa92 add some initialization and some assertion.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15554 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-26 08:10:22 +00:00
Asger Ottar Alstrup
2c0d4b31ee - Fix sign error in Cursor::setSelection
- Add debugging input
- If cursor::dispatch does not handle the func, then it should not request an update
- Dump metrics cache after redraw


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15443 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-21 11:29:34 +00:00
Asger Ottar Alstrup
6ac15c5bb9 - Dump the inset position cache as well
- More debugging printing stuff


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15441 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-21 10:56:36 +00:00
André Pönitz
6c300f72a2 move everything into namespace lyx
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15422 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-21 00:16:43 +00:00
Asger Ottar Alstrup
e035d673ff - Dump parpos cache if you use -dbg workarea on command line
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15419 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-20 20:57:21 +00:00
Georg Baum
ffe7cb1b78 Use the new InsetCommandParams interface (inset part), from Ugras and me
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15413 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-20 16:12:49 +00:00