Commit Graph

38 Commits

Author SHA1 Message Date
Abdelrazak Younes
0405bfcf04 Fix bug 3194:
http://bugzilla.lyx.org/show_bug.cgi?id=3194

This also seems to fix the annoying mouse cursor movement bug 3023:

http://bugzilla.lyx.org/show_bug.cgi?id=3023


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17027 a592a061-630c-0410-9148-cb99ea01b6c8
2007-02-02 15:14:43 +00:00
Bo Peng
8b56166641 Persistent-selection (and fix bug 3162)
* src/CutAndPaste.h/C: add selectionBuffer to save selected text
	* src/text3.C: proper handling of paste
	* src/lyxfind.C: save selection
	* src/BufferView.C: save selection
	* src/text.C: save selection
	* src/cursor.C: save selection
	* src/insets/insettabular.C: save selection
	* src/mathed/InsetMathGrid.C: save selection
	* src/mathed/InsetMathHull.C: save selection
	* src/mathed/InsetMathNest.C: save selection


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17022 a592a061-630c-0410-9148-cb99ea01b6c8
2007-02-02 03:10:15 +00:00
Michael Schmitt
2cf58651ed * src/mathed/InsetMathNest.C: simplify call to innerText()
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17018 a592a061-630c-0410-9148-cb99ea01b6c8
2007-02-01 20:05:59 +00:00
Michael Schmitt
5d41611407 * BufferView.C:
* BufferView.h:
	* lyxfunc.C:
	* factory.C:
	* mathed/InsetMathNest.C:
	* mathed/InsetMathHull.C:
	* lyx_cb.C:
	* frontends/WorkArea.C: remove BufferView::getLyXText() methods, because their
	names were absolutely misleading; resolve indirection where needed


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17016 a592a061-630c-0410-9148-cb99ea01b6c8
2007-02-01 19:27:37 +00:00
Abdelrazak Younes
d6cc04e762 Fix cursor navigation in math.
* metricsinfo.h:
  - ScreenUpdateStrategy: new enum describing the screen update strategy (replace singlepar boolean).

* UpdateFlags.h:
  new Update::Decoration flag.

* BufferView.C
  - update(): takes Decoration flag into account (CoordCache is not cleared out). Fills in metrics_info_.update_strategy

* mathed/InsetMathNest.C: adjust the cursor flags to new strategy.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16774 a592a061-630c-0410-9148-cb99ea01b6c8
2007-01-20 01:23:07 +00:00
Georg Baum
3500af60ba Fix bug 2138: copy and paste should preserve formatting between different
LyX instances. This re-enables copy/paste from the internal clipboard on
OS X (currently broken since Clipboard::isInternal() always returns false for
some reason).

	* src/insets/insettabular.C
	(InsetTabular::doDispatch): adjust to clipboard interface change
	(InsetTabular::copySelection): ditto

	* src/mathed/InsetMathGrid.C
	(InsetMathGrid::doDispatch): ditto

	* src/mathed/InsetMathNest.C
	(InsetMathNest::doDispatch): ditto

	* src/buffer.[Ch]
	(Buffer::readString): New method: Read document from a string
	(Buffer::readFile): Change return value from bool to enum (needed
	for readString). Return wrongversion if we are reading from a string
	and the version does not match.
	(Buffer::do_writeFile): make public and rename to write

	* src/CutAndPaste.C
	(putClipboard): New helper, put stuff to the system clipboard
	(void copySelectionHelper): Use putClipboard instead of
	theClipboard().put()
	(void copySelection): ditto
	(void pasteClipboard): new method for pasting in text
	(void pasteParagraphList):

	* src/frontends/Clipboard.h
	(Clipboard::get): Rename to getAsText
	(Clipboard::getAsLyX): New method for getting the system clipboard
	in LyX format
	(Clipboard::hasLyXContents): New method telling whether there is LyX
	contents in the clipboard

	* src/frontends/qt4/GuiClipboard.[Ch]: Implement the new methods

	* src/text3.C
	(LyXText::dispatch): Use pasteClipboard for pasting the system
	clipboard


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16669 a592a061-630c-0410-9148-cb99ea01b6c8
2007-01-13 18:29:50 +00:00
Georg Baum
c3bb45648c include tabulars and math in the "paste recent" stack
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16611 a592a061-630c-0410-9148-cb99ea01b6c8
2007-01-08 18:40:37 +00:00
Georg Baum
3c323c1a37 The uncontroversal part of the selection fix: Always set the X selection
after selecting something with the mouse

	* src/insets/insettabular.C
	(InsetTabular::doDispatch): Set the X selection if there is a
	selection after release of the left mouse button

	* src/mathed/InsetMathNest.C
	(InsetMathNest::doDispatch): Set the X selection after double and
	triple click of the left mouse button
	(InsetMathNest::lfunMouseRelease): Set the X selection if there is a
	selection after release of the left mouse button


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16530 a592a061-630c-0410-9148-cb99ea01b6c8
2007-01-05 13:31:37 +00:00
Georg Baum
8f2243819a Let LFUN_PASTE always paste the most recent clipboard (internal or system)
* src/insets/insettabular.C
	(InsetTabular::doDispatch): Only paste the tabular clipboard if the
	system clipboard is not newer, else let the current cell paste the
	system clipboard
	(InsetTabular::getStatus): Only decide whether to enable LFUN_PASTE
	if the tabular clipboard is not empty and the system clipboard is
	not newer, else let the current cell decide.

	* src/mathed/InsetMathGrid.C
	(InsetMathGrid::doDispatch): Use the system clipboard for LFUN_PASTE
	if it is newer.

	* src/mathed/InsetMathNest.C
	(InsetMathNest::doDispatch): Use the system clipboard for LFUN_PASTE
	if it is newer.

	* src/text3.C
	(doInsertInset): Add a "0" argument to LFUN_PASTE, because we always
	want to use the internal clipboard here
	(LyXText::dispatch): ditto (when handling mouse button 2 press)
	(LyXText::dispatch): Use the system clipboard for LFUN_PASTE if it
	is newer.
	(LyXText::getStatus): Also enable LFUN_PASTE if the system clipboard
	is owned by another application


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16498 a592a061-630c-0410-9148-cb99ea01b6c8
2007-01-04 12:05:24 +00:00
Georg Baum
e873e7c0a9 * src/mathed/InsetMathNest.C
(InsetMathNest::lfunMouseRelease): Remove commented call of
	theSelection->put(), since that should never be called from the kernel


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16491 a592a061-630c-0410-9148-cb99ea01b6c8
2007-01-04 09:35:44 +00:00
Georg Baum
1557221505 remove obsolete comment
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16488 a592a061-630c-0410-9148-cb99ea01b6c8
2007-01-04 09:00:19 +00:00
Georg Baum
22eae5feb9 formatting
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16487 a592a061-630c-0410-9148-cb99ea01b6c8
2007-01-04 08:57:55 +00:00
Peter Kümmel
45e7e717d4 remove some msvc warnings
* src/mathed/InsetMathNest.C : 
	unreachable code
* src/aspell_local.h : 
	aspell is a Clibrary, no class keyword available
* src/texrow.h : 
	could not generate standard constructor
* development/cmake/CMakeLists.txt : 
	- disable same warnings
    - all size_t/int related warnings are disabled



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16446 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-30 21:05:44 +00:00
Jean-Marc Lasgouttes
ca6838b288 * InsetMathNest.C (handleFont): avoid crash on undo when
suppressing a font inset (bug 3019).



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16424 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-29 11:07:23 +00:00
Jürgen Spitzmüller
f55fde9bab * src/mathed/InsetMathNest.C (do_dispatch):
- catch LFUN_QUOTE_INSERT and output plain quote (bug 3044).

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16403 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-27 15:01:09 +00:00
Abdelrazak Younes
dd91a7f6b6 * InsetMathNest::lfunMouseRelease(): keep the optimization only if there is no selection. This allows to shorten the time when the cursor is initially set at the beginning of the math inset.
* InsetMathNest::lfunMousePress(): Disable optimization introduced in revision 16006. This is because we need the box corners when navigating inside formulas.

* InsetMathNest::doDispatch(): ditto.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16011 a592a061-630c-0410-9148-cb99ea01b6c8
2006-11-22 14:45:33 +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
Bo Peng
7880841888 BUG 686: delete empty math box with delete/backspace key
* src/cursor.C: remove nested empty math box
	* src/mathed/InsetMathNest.C: remove the whole empty math box if it 
	  can not be deleted from within


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15990 a592a061-630c-0410-9148-cb99ea01b6c8
2006-11-19 18:33:13 +00:00
Georg Baum
8c651169ef Revert revision 14819 and my faulty fix for it.
* src/mathed/InsetMathScript.C
	(InsetMathScript::write): Do not add braces to the nucleus

	* src/mathed/MathParser.C
	(Parser::parse1): Do not remove brace insets from the nucleus of
	script insets

	* src/mathed/InsetMathNest.C
	(InsetMathNest::script): ditto


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15859 a592a061-630c-0410-9148-cb99ea01b6c8
2006-11-11 15:26:31 +00:00
Abdelrazak Younes
0a48776a9a Forgot that!
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15615 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-30 10:47:59 +00:00
Abdelrazak Younes
73ed0b5203 * Painter.h:
* Painter: new ctor that sets drawing_enabled_ to true.
  * setDrawingEnabled(), isDrawingEnabled(): new methods.

* QLPainter.C: only draw if drawing is enabled.

* nullpainter.h: deleted.

* rawpainter.C::paintPar(): only draw if we are inside the Paragraph.

* InsetTabular::draw(): use new Painter method instead of a NullPainter.

* InsetMathNest::drawSelection(): ditto.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15613 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-30 10:09:59 +00:00
André Pönitz
de6418f377 use more unicode in math
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15462 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-22 10:15:23 +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
Georg Baum
62aedce851 Avoid an implicit character set conversion in cur.insert() in InsertChar
by changing the argument type to lyx::char_type.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15382 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-19 18:56:16 +00:00
Georg Baum
8b67659646 Use UTF8 for LaTeX export.
Known problems:
- No space is output after a \hfill. I probably broke this with the
  InsetCommand patch. I'll have a look later.
- Although the encoding is now UTF8 the arguments of the inputenc package
  are still the old ones, so LaTeX will not run.
- Labels and references with non-ASCII characters are broken. This needs to
  be fixed in lyx::support::escape(), but this is a file format change.
- Something seems to be wrong with index entries, but this is probably also
  due to the InsetCommand changes.

Have fun!


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15378 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-19 16:51:30 +00:00
Asger Ottar Alstrup
daae275cd1 - Fix math editing
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15377 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-19 16:38:13 +00:00
Abdelrazak Younes
4cc7a7708e This commit fixes a crash when accessing a math inset. This was due to an invalid CursorSlice::text() null pointer accessed in InsetMathNest::cursorPos():
CoordCache & coord_cache = sl.text()->bv()->coordCache();

As you can see, I used this indirection to access the BufferView::CoordCache(). Bad luck, the passed CursorSlice was not completely valid inside a mathed inset, hence the crash. My solution is to pass BufferView to InsetBase::cursorPos() and all its derivative.

* InsetBase::cursorPos(): pass BufferView const &

* bufferview_funcs::coordOffset(): ditto.




git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15356 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-17 16:23:27 +00:00
Abdelrazak Younes
52bd213992 More unicode conversion
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15355 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-17 14:46:45 +00:00
Abdelrazak Younes
562d55989a MacOSX compile fix: The class Point conflicted with a struct defined in MacTypes.h.
* coordcache.[Ch]: put everything in the LyX namespace.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15340 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-15 22:32:56 +00:00
Abdelrazak Younes
d37fae169c In order to support multiple LyXView each BufferView needs its own CoordCache. This is what's implemented in this commit.
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
2006-10-13 16:44:44 +00:00
Georg Baum
34b7650cbb Introduce wide streams. This fixes the remaining problems of plain text
export (e.g. the ToC) and the navigate menu.

	* src/insets/insetbase.h
	(InsetBase::plaintext): output to a docstream
	(InsetBase::textString): ditto

	* src/mathed/TextPainter.h
	(TextPainter::show): ditto

	* src/support/docstream.[Ch] New file and string streams for
	docstring. The file streams convert to UTF8 on the fly.

	* many more files: Adjust to the changes above


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15301 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-11 19:40:50 +00:00
Abdelrazak Younes
28ad960255 This commit cleans up everything related to singleton. The other important change is that lyx::dispatch() and lyx::getStatus become _the_ official way to use LyXFunc equivalent methods.
* lyxfunc.h:
  - theLyXFunc(): new function in the global namespace.
  - lyx::dispatch():  new function in the lyx namespace.
  - lyx::getStatus():  new function in the lyx namespace.

* bufferlist.h:
  - theBufferList(): new function in the global namespace.

* Clipboard.h:
  - theClipboard(): new function in the global namespace.

* Selection.h:
  - theSelection(): new function in the global namespace.

* FontLoader.h:
  - theFontLoader(): new function in the global namespace.

* FontMetrics.h:
  - theFontMetrics(LyXFont const &): new function in the global namespace.

* Application.C: implements the functions defined above.

* LyXView.h:
  - getLyXFunc(): deleted.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15298 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-11 17:24:46 +00:00
Georg Baum
deef368edc Fix bug 2789 (as discussed)
* src/mathed/InsetMathHull.C
	(InsetMathHull::doDispatch): move code for ref insert to InsetMathNest 
	(InsetMathHull::getStatus): move code for ref insert to InsetMathNest

	* src/mathed/InsetMathNest.C
	(InsetMathNest::doDispatch): move code from InsetMathHull here
	(InsetMathNest::getStatus): move code from InsetMathHull here


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15189 a592a061-630c-0410-9148-cb99ea01b6c8
2006-09-30 17:17:31 +00:00
Abdelrazak Younes
ca5411f913 This commit introduces Application_pimpl and cleanup the header includes of the affected .C files.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15182 a592a061-630c-0410-9148-cb99ea01b6c8
2006-09-29 22:06:28 +00:00
Abdelrazak Younes
b171e5f150 Free BufferView from LyXView!
* 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
2006-09-26 10:06:46 +00:00
Abdelrazak Younes
12a82dd4f2 This commit replaces BufferView->LyXView->Gui->[selection,clipboard] with theApp->[selection,clipboard]
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15125 a592a061-630c-0410-9148-cb99ea01b6c8
2006-09-22 15:02:41 +00:00
Abdelrazak Younes
311ac9b192 This is the continuation of my BufferView/LyXView cleanup. This commit replaces BufferView->LyXView->getDialogs().[show(), update()] with BufferView signal emissions.
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
2006-09-19 13:36:20 +00:00
André Pönitz
e89625ef28 rename mathed/math_xinset into mathed/InsetMathX
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15026 a592a061-630c-0410-9148-cb99ea01b6c8
2006-09-17 09:14:18 +00:00