Commit Graph

374 Commits

Author SHA1 Message Date
Abdelrazak Younes
e918c00190 small cleanup while looking for a bug.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15622 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-30 14:15:05 +00:00
Jürgen Spitzmüller
6eeb83498c * QPrefScreenFontsUi.ui: assing label to the correct (and existing) buddy.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15621 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-30 14:05:06 +00:00
Abdelrazak Younes
fbcc021da6 small cleanup while looking for a bug.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15620 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-30 13:49:41 +00:00
Abdelrazak Younes
992fe1dba6 * QLPainter:
- ctor and dtor moved to public:
  - QLPainter(): takes a QPaintdevice instead of a QWidget.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15619 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-30 13:16:18 +00:00
Abdelrazak Younes
662974406a Forgot that also!
* QLPainter::~QLPainter: add virtual

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15616 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-30 11:04:37 +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
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
Peter Kümmel
32e777c786 remove warning, use shorter code
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15595 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-28 17:14:51 +00:00
Michael Schmitt
5d166accfe * qt4/GuiFontMetrics.C: remove qt3 compatibility code
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15594 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-28 16:01:12 +00:00
Abdelrazak Younes
37e8b2c0f4 Compilation fix for Mac and Linux:
* add QWidget header.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15593 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-28 15:28:18 +00:00
Abdelrazak Younes
3c296efd19 simplify paintText() interface.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15590 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-28 09:59:43 +00:00
Abdelrazak Younes
54bdecdb48 remove paperHeight() and paperWidth() in Painter and inherited classes.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15589 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-28 09:36:22 +00:00
Abdelrazak Younes
56be946751 delete unused code and comment.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15588 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-28 09:19:37 +00:00
Abdelrazak Younes
9b89f1d4ad stop/start the blinking cursor when the WorkArea get a focusInEvent or focusOutEvent.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15586 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-27 23:26:52 +00:00
Abdelrazak Younes
1372f311d3 replace the map based width cache with an array based one.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15585 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-27 22:46:36 +00:00
Abdelrazak Younes
7f94f08bbe * GuiFontMetrics: new metrics(QString) method
* QLPainter::paintText(): use GuiFontMetrics::metrics(QString) to avoid an ucs4 to QString conversion.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15584 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-27 21:27:03 +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
d916db37b0 MacOSX optimisation:
* QLPainter::paintText(): use the font width cache instead of the painter metrics.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15580 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-27 13:36:23 +00:00
Peter Kümmel
fe784fe9d3 when we use QDesktopWidget we should include it
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15577 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-27 11:47:59 +00:00
Peter Kümmel
a96cb88ccd GuiView.C: recover from silly window positions
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15574 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-27 08:40:08 +00:00
Georg Baum
fa1856440c Restore inputenc support
* src/encoding.h
	(encoding_table): remove, this is no longer needed with unicode
	(iconvName_): new member: name of the encoding in iconv syntax

	* src/exporter.C
	(Exporter::Export): Use return value of Buffer::makeLaTeXFile

	* src/buffer.[Ch]
	(Buffer::makeLaTeXFile): return whether the file has been created
	successfully

	* src/buffer.C
	(Buffer::makeLaTeXFile): Use a docstream that converts to the correct
	encoding
	Display an error dialog is something went wrong

	* src/bufferparams.C
	(BufferParams::writeLaTeX): Undo the utf8 inputenc hack

	* src/frontends/qt4/QDocumentDialog.C: Add some FIXMEs

	* src/support/unicode.[Ch]
	(eightbit_to_ucs4): New conversion function
	(ucs4_to_eightbit): New conversion function

	* src/support/docstream.[Ch]
	(utf8_codecvt_facet_exception): Move to header and rename to
	iconv_codecvt_facet_exception
	(odocfstream): Take the encoding as argument

	* src/support/docstream.C
	(utf8_codecvt_facet): Generalize to other encodings than utf8 and
	rename to iconv_codecvt_facet

	* src/encoding.C: Remove obsolete tables

	* src/output_latex.C
	(TeXOnePar): Convert the paragraph to different encoding if needed

	* lib/encodings: Remove obsolete tables


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15564 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-26 15:01:45 +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
Peter Kümmel
b6a7dd3aa7 src/frontends/qt4/GuiWorkArea.C:
use position returned by BufferView
src/bufferview_funcs.C: 
    adjust cursor x-position by hand



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15555 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-26 11:01:34 +00:00
Edwin Leuven
6b20411c6a add fixme for cursor positioning
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15544 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-25 09:20:07 +00:00
Abdelrazak Younes
8571d4c0b8 compile fix.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15543 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-25 07:48:48 +00:00
Michael Schmitt
fe2abd3846 * src/frontends/qt4/GuiWorkArea.C: fix cursor positioning
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15541 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-24 21:12:46 +00:00
Edwin Leuven
87b93ca808 add missing lyx::
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15539 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-24 19:05:26 +00:00
Edwin Leuven
d539ab8282 Layout improvements
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15538 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-24 17:52:37 +00:00
Abdelrazak Younes
b86a8d09b3 Fix cursor size...
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15537 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-24 16:38:17 +00:00
Abdelrazak Younes
55eae1a7f8 * Gui.h: new closeAll() pure virtual method.
* qt4/Alert_pimpl.C: make sure the proper Qt attributes are set.

* GuiApplication::quitLyx(): add the "force" argument to the funcRequest.

* GuiImplementation:
  - GuiImplementation(): remove the signal connection. This was triggered after the LastWindowClosed signal so was not useful.
  - cleanupViews(): renamed to unregisterView() and handle the WorkAreas as well.
  - closeAll(): new method (from LyXView).

* GuiView.C
  - clean up the includes order.
  - closeEvent(): make sure that theBufferList().quitWriteAll() is called if last window closed.

* lyx_main.C / LyX::quit():
  - remove noAsk argument
  - delete bufferList::quitWriteAll() call (this is handled in the frontend).
  - delete Session stuff (ditto)

* LyXFunc::dispatch()
  - LFUN_LYX_EXIT: close all window before exiting from user command (as opposed to last window closed).



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15535 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-24 15:01:07 +00:00
Edwin Leuven
163dcb1210 - implement sizeHint()
- set minimum width of QTreeWidget
- bit of cleanup

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15526 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-24 11:32:20 +00:00
Abdelrazak Younes
f4857dab04 new LFUN_WINDOW_CLOSE
* LyXFunc:
  - dispatch(): transfer assertion on lyx_view_ to each LFUN on a case by case basis.
  - dispatch(): new LFUN_WINDOW_CLOSE
  - getStatus(): special treatment for LFUN_LYX_QUIT

* LyX:
  - views_, addLyXView(): deleted
  - quit(): call saveGeometry() on each LyXView before exiting.

* GuiApplication:
  - is now a QObject.
  - quitLyX(): new Qt slot for lastWindowClosed signal.

* Gui.h:
  - destroyView(), destroyWorkArea(): deleted
  - viewIds(): new method

* GuiImplementation:
  - implement above changes.
  - GuiImplementation is now a QObject
  - cleanupViews(): new private slot.
  - buildViewIds(): new helper method
  - views_ and work_areas_ are now maps of raw pointers instead of schared_ptr.

* LyXView
  - now stores its id.
  - dispatch(): special treatment for LFUN_WINDOW_CLOSE.
  - workAreaIds(): new method.
  - close(): new pure virtual method.
  - saveGeometry(): new pure virtual method.

* GuiView:
  - implements above changes.
  - GuiView(): set WA_DeleteOnClose and Qt::WA_QuitOnClose to let Qt manage the destruction on close().
  - closeEvent(): session stuff transfered to saveGeometry()

* WorkArea
  - now store its id.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15514 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-23 16:29:24 +00:00
André Pönitz
5c4c5d9b05 cursor cosmetics
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15504 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-23 11:34:43 +00:00
André Pönitz
4774536389 cursor is no more damaging the background. L-shaped cursor is broken right now. will fix later
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15503 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-23 11:19:17 +00:00
André Pönitz
1852693005 do not draw to intermediate pixmap
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15501 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-23 08:46:09 +00:00
André Pönitz
8a1e6d6759 microoptimization
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15493 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-22 19:33:37 +00:00
Asger Ottar Alstrup
a127d540d3 - LyX is dead slow, so the least we can do is use anti-alised text
- Various micro-optimisations
- Revert Abdel's repaint instead of update for QPainter
- Get rid of unused methods in GuiWorkArea



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15491 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-22 18:49:18 +00:00
André Pönitz
153c997228 cosmetics
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15487 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-22 17:58:09 +00:00
André Pönitz
dc94575f2b make macrfos readable again
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15479 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-22 14:37:32 +00:00
Asger Ottar Alstrup
6bcdafcd9c - Do not use kerning, because that fucks up cursor positioning for good
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15474 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-22 13:10:12 +00:00
Asger Ottar Alstrup
9031593ae1 - fix broken behaviour of Scrollbar and MouseWheel when
changing between using it and the keyboard-cursor
  movements.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15473 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-22 12:36:31 +00:00
Abdelrazak Younes
4d3fbc113f My six month cleanup crusade is now paying off: LyX has now multiple windows support!
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15438 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-21 09:45:11 +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
4f3033ff91 - Comments
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15417 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-20 19:40:02 +00:00
Lars Gullik Bjønnes
b27bb5cb53 Change (and fix) the bullets in itemize to be more unicode friendly.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15416 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-20 19:26:23 +00:00
Georg Baum
3bbbc1437b Use the new InsetCommandParams interface (frontend part), from Ugras and me
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15408 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-20 13:53:43 +00:00
Enrico Forestieri
899fb06023 Fix some glitches with fixed size delimiters
* src/mathed/MathParser.C
	(parse1): behave correctly when a wrong delimiter is specified.

	* src/mathed/InsetMathBig.C
	(write): don't write a space before delimiter.

	* src/frontends/qt4/QDelimiterDialog.C
	(QDelimiterDialog): make translatable the string "Variable size".


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15397 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-20 10:43:53 +00:00
Asger Ottar Alstrup
542910316c - Boring promote and demote instead of the sexy in and out
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15374 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-19 15:30:18 +00:00
Abdelrazak Younes
f23082917e - Fix a crash when IN is clicked multiple time in a single line document.
- Polish the behavior when the TOC is empty (clearing the button and the TOC tree)


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15373 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-19 14:35:06 +00:00
Abdelrazak Younes
1f8fe29384 This commit transfers the singletons defined in the Application class to the private LyX::Singletons implementation. It also put the session_ member and top_level_keymap global variable into this Singleton structure.
This commit also modifies the LyXFunc class. A LyXView is not needed any more at construction. Neither is the top level keymap. The LyXFunc key sequences are initialized only if we are in GUI mode (lyx::use_gui = true).
The next step is to rename LyXFunc::owner to LyXFunc::lyx_view_ and to put some BOOST_ASSERT. A classification between Gui and Kernel oriented LFUNs would also be welcome.

*LyX/lyx_main.[Ch]:
 - LyX::Singletons: new private structure containing all the singletons (except the main LyX one of course).
 - buffer_list_, top_level_keymap, session_: transfered to the LyX::Singletons structure.

* LyXFunc:
  - LyXFunc: default constructor does not need any arguments.
  - setupLocalKeymap(): deleted (was not used anywhere).
  - initKeySequences(): new public method called from lyx_main.C, useful only in lyx::use_gui mode.
  - new private member accessor methods

* Application:
  - Application_pimpl: deleted (transfered to LyX)
  - global singleton accessors: transfered to lyx_main.C
  - start(): code transfered to LyX::priv_exec()


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15367 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-19 07:20:32 +00:00