* completion support for mathed
* experimental completion support for text
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23104 a592a061-630c-0410-9148-cb99ea01b6c8
* 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
- 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
- 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
* 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
* 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
hope there are only conforming implementaions out there ;-}
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21312 a592a061-630c-0410-9148-cb99ea01b6c8
* 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
* 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
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
* 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
* 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
* buffer_funcs.{h,cpp}: new checkAndLoadLyXFile() transferred from BufferView::loadLyXFile().
* BufferView::loadLyXFile(): deleted.
* LyXView::loadLyXFile(): simplify logic and fix some issues:
- buggy child document leads to crash due to error list dialog.
- ensure that we switch to buffer if there's some errors.
- use LyXView::setBuffer() instead of repeating code.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18828 a592a061-630c-0410-9148-cb99ea01b6c8
Fix Bug 3860: Toc crash when loading a child documents.
* BufferView::loadLyXFile(): simplify, transfer last part to
LyXView::loadLyXFile().
Change return value to Buffer created by load (or 0 if none).
Ultimately, this should all be moved to buffer_funcs.cpp, as it is no
longer needed here.
* Buffer::setParentName(): small fix to avoid recursive includes.
* LyXView:
- setBuffer(): properly update the labels and the Toc if this is [LOAD Child
Document] command. Move buffer connection and disconnection, simplifying
earlier code.
- loadLyXFile(): get some code from BufferView::loadLyXFile() and from
LyXFunc::LFUN_BUFFER_CHILD_OPEN, properly handle the child document case.
There's a lot of overlap with setBuffer() here. This needs cleaning.
* LyXFunc: add optional argument to LFUN_BUFFER_CHILD_OPEN to indicate if
the document is being opened by LyX itself rather than the user (as on
View>DVI, for example).
* LyX: adapt to loadLyXFile() API changes.
* insets/InsetInclude: use LFUN_BUFFER_CHILD_OPEN rather than calling
loadLyXFile() directly. Make use of new optional argument.
With this in place, the only thing missing for proper multipart document support is to automatically update the parent Buffer when switching from the parent Buffer. This would be very useful when you work with multiple document sharing the same child documents (as I often do).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18825 a592a061-630c-0410-9148-cb99ea01b6c8
for translating keystrokes. Up until now, the switching was done in advance
in all kinds of situations, but not just before translating was actually done
--- which resulted in the KeyMap not always being switched on time...
This solves bug #3811 (http://bugzilla.lyx.org/show_bug.cgi?id=3811)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18744 a592a061-630c-0410-9148-cb99ea01b6c8
There is a user visible change with this commit: For text insets, the button stays "highlighted" as long as the mouse cursor is within the inset but not within a nested inset. Formerly the button was highlighted only when hovered. This new behaviour is better because we can now imagine funkier behaviour like inset color background change when hovered. Also the small math pink corners can be adapted to react to mouse hover in the future. Ideally we should also "highlight" the button when entering the inset via the keyboard or when the keyboard cursor is just before the inset (because we can then use Ctrl-i).
* BufferView:
- getCoveringInset(): new method.
- workAreaDispatch(): use getCoveringInset() instead of LyXText::checkInsetHit()
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17610 a592a061-630c-0410-9148-cb99ea01b6c8
* src/session.h/C: save pit instead of id
* src/lyxfunc.h/C: gotoBookmark function
* src/BufferView.h/C: proper update of bookmarks
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16647 a592a061-630c-0410-9148-cb99ea01b6c8
* 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
- 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
* 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
theCoords is now a thing of the past and all CoordCache accesses are done via BufferView::coordCache() now. I had to modify a number of methods to pass BufferView.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15324 a592a061-630c-0410-9148-cb99ea01b6c8
* rename output_changes to outputChanges
* rename tracking_changes to trackChanges
* add FIXMEs for later revision
* remove trackChanges(); the CT data structure will always be set up
* decouple LFUNs changes-output/change-accept/change-reject/
all-changes-accept/all-changes-reject from LFUN changes-track
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15261 a592a061-630c-0410-9148-cb99ea01b6c8
* BufferView
- layoutChanged: new boost signal.
- LyXView owner(), owner_: deleted
* text3.C
- emit BufferView::layoutChanged instead of calling LyXView::setLayout directly
- LFUN_MOUSE_RELEASE: delete LyXView updateMenubar() and updateToolbars() direct calls.
The update is of both bars is done in WorkArea::dispatch().
* WorkArea.C
- dispatch(): add LyXView updateMenubar() call.
* LyXView
- connects to BufferView::layoutChanged directly to Toolbars::setLayout()
- setLayout(): deleted.
* qt4/GuiImplementation: modify BufferView construction (without LyXView).
All other files: cleanup header declaration of LyXView.h
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15153 a592a061-630c-0410-9148-cb99ea01b6c8
The associated WorkArea is then responsible to connect these signals to its LyXView parent.
* BufferView:
- showDialog, showDialogWithData, showInsetDialog: new boost signals
* LyXView:
- connectBufferView(), disconnectBufferView(): new method in charge of the connection/disconnection of the above signal to associate private methods (showDialog(), etc).
* WorkArea
- setBufferView(): will connect/disconnect the BufferView to its LyXView parent.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15068 a592a061-630c-0410-9148-cb99ea01b6c8
* LyXView: save two setLayout() calls that are done in updateLayoutChoice() anyway.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14833 a592a061-630c-0410-9148-cb99ea01b6c8
Log:
* BufferView/pimpl:
- scrollDocView(): call to BufferView::update() deleted.
- scrollDocView(): second part is now in setCursorFromScrollbar()
- setCursorFromScrollbar(): new method.
* WorkArea:
- setBufferView(): show the cursor immediately
- redraw(): call to updateScrollbar()
- updateScrollbar(): new method
- scrollBufferView(): fix it and show the cursor immediately.
* qt4/GuiWorkArea
- setScrollbarParams(): now disable the Qt scrollbar tracking.
- paintEvent(): scrollbar related code deleted
* qt3/QWorkArea
- setScrollbarParams(): now disable the Qt scrollbar tracking.
* qt3/QContentPane
- paintEvent(): scrollbar related code deleted
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14704 a592a061-630c-0410-9148-cb99ea01b6c8
TODO 1: All occurrences of "LyXView::showErrorList()" in the "kernel" should be replaced by a boost signal emission (Buffer::errors()). This signal is already connected to this showErrorList() slot.
TODO 2: The ErrorList mechanism is used wrongly in a number of place, most notably in "Converter.C". Instead of replacing the ErrorList in the "Buffer" class, the "Converter" class should maintain its own list instead and connect directly to the LyXView::showErrorList() slot.
Buffer:
* errorList_: new private member and associated access methods.
* setErrorList(): new accessor method.
* addError(): apend an error to the errorList_.
* error(): deleted.
* errors(): new boost signal, unused for now. Shall be used instead of LyXView::showErrorList().
LyXView:
* getErrorList(), addError(), errorlist_, errorConnection_: deleted.
* errorsConnection_: new boost connection for the Buffer::errors() signal.
lyx_main.C:
* LyX::exec2(): manually print all errors.
BufferView.h: remove unneeded ErrorList forward declaration.
BufferView::pimpl::menuInsertLyXFile(): delete Buffer::error() connection and add a FIXME comment
text.C: Use Buffer::addError() instead of Buffer::error() signal emission.
ControlErrorList.C: get the ErrorList from the Buffer instead of LyXView
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14467 a592a061-630c-0410-9148-cb99ea01b6c8
With this change, the only difference between BufferView.h and BufferView_pimpl.h is "cursor.h" so I think it is time to merge the two classes at last.
BufferView:
* showErrorList(), getErrorList(): transfered to LyXView.
BufferView::pimpl
* addError(), showReadonly(), connectBuffer(), disconnectBuffer(): transfered to LyXView.
CutAndPaste.C: adapted to API changes
frontends/controllers/ControlErrorList.C: ditto
lyxfunc.C: ditto
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14458 a592a061-630c-0410-9148-cb99ea01b6c8
The performance may suffer a bit because we do the second drawing step in all cases. This could be possibly optimized out by checking the return value of the BufferView::update() method in "lyxfunc.C:1610". But it is maybe better to keep those two parts of the frontend ignorant of each other: the event handling and the drawing.
BufferView:
* needRedra(), need_redraw_: deleted.
* updateMetrics(): now public.
* update(): only do the first drawing step. Returns true if a full updateMetrics is needed before drawing on screen.
WorkArea:
* redraw(): no check on BufferView::needRedraw(), call updateMetrics() unconditionally.
* processKeySim(): uneeded "redraw()" call commented out. When/if the call to LyXView::redrawWorkArea() in "lyxfunc.C:1610" is not needed anymore, this line should be uncommented out.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14456 a592a061-630c-0410-9148-cb99ea01b6c8
* frontends/LyXView:
- redrawWorkArea(): new temporary method called from within
BufferView::pimpl::update() that calls WorkArea::redraw()
in order to do the actual screen redrawing.
* frontends/WorkArea:
- the redraw() method now check if the the attached bufferView
needs a screen redraw().
* BufferView:
- needsRedraw(): new method for WorkArea::redraw()
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14381 a592a061-630c-0410-9148-cb99ea01b6c8
* BufferView, BufferView::pimpl:
- metrics_info_: private variable holding ViewMetricsInfo
- viewMetricsInfo(): accessor function
- updateMetrics(): renamed from metrics(), sets metrics_info_
- update(): change to use updateMetrics()
* frontends/WorkArea:
- redraw(): get the ViewMetricsInfo through accessor to BufferView.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14331 a592a061-630c-0410-9148-cb99ea01b6c8