Commit Graph

3138 Commits

Author SHA1 Message Date
Georg Baum
dc76f58590 more compile fixes
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15358 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-17 21:15:07 +00:00
Georg Baum
b02242bfaf Rework InsetCommandParams interface and file storage
* src/insets/insetcommandparams.[Ch]:
	(operator[]): New, access a parameter
	(clear): New, clear all parameters
	(info_): New, stire info about this command
	(cmdname): Rename to name_
	(contents, options, sec_options): Replace with params_. Parameters
	are now stored as docstring.
	(findInfo): New factor for command info for all commands
	(read, write): Use new syntax
	(parameter set and get methods): reimplemenmt for new parameter storage

	* src/insets/insetcommand.h
	(getParam): New, get a parameter
	(setParam): New, set a parameter
	(parameter set and get methods): Adjust to InsetCommandParams changes

	* src/insets/insetbibitem.[Ch]
	(write): Remove, not needed anymore
	(directWrite): ditto

	* src/insets/insetbibitem.C
	(InsetBibitem::read): Use InsetCommand::read

	* src/insets/insetref.C
	(InsetRef::latex): Use new InsetCommandParams interface

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

	* src/text3.C
	(LyXText::dispatch): ditto

	* src/factory.C
	(createInset): Create InsetCommandParams with command name
	(readInset): ditto
	(readInset): Remove error message for bibitem, since bibitem is
	now a normal command inset

	* src/buffer.C: Bump file format number

	* src/frontends/controllers/ControlCommand.[Ch]
	(ControlCommand): take an additional command name parameter

	* src/text.C
	(readParToken): Remove code for \bibitem

	* lib/lyx2lyx/LyX.py: Bump latest file format number

	* lib/lyx2lyx/lyx_1_5.py
	(convert_bibitem, convert_commandparams): new, convert to new format
	(revert_commandparams): new, convert to old format

	* development/FORMAT: document new format

	* many other files: Adjust to the changes above


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15357 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-17 21:07:16 +00:00
Jürgen Spitzmüller
a41bb78a0e fix bug 2910:
* src/frontends/qt3/QDocumentDialog.C (updateNumbering): don't include headings
	that have no counter in their label.
* src/frontends/qt3/ui/NumberingModuleBase.ui: show scrollbar when appropriate.

* src/frontends/qt4/QDocumentDialog.C (updateNumbering): don't include headings
	that have no counter in their label.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15352 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-16 16:21:52 +00:00
Georg Baum
80080dcfae partial compile fix
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15348 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-16 09:53:30 +00:00
Abdelrazak Younes
0823fb6f86 Fix Toc dialog crash when TOC is empty.
* QToc::update(): return early if no TOC type.

* QTocDialog::updateGui(): return early of the Type model is empty and disable the outline buttons.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15346 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-16 08:51:55 +00:00
Abdelrazak Younes
c7e365365e This commit saves the need to check for lyx::use_gui in a number of places.
* lyx_main.h: define "extern bool lyx::use_gui" here.

* NoGuiFontMetrics.h: new class for command-line LyX

* NoGuiFontLoader.h: new class for command-line LyX

* Application.C:
  - theFontMetrics(): returns the above dummy FontMetrics when use_gui is false.
  - theFontLoader(): returns the above dummy FontLoader when use_gui is false.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15339 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-15 21:47:29 +00:00
Georg Baum
3db6e94596 fix typos
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15336 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-15 09:20:25 +00:00
Abdelrazak Younes
c585c2421b Add comments WRT to where the function implementations are.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15334 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-14 19:58:42 +00:00
Abdelrazak Younes
3cb466603c add some assertions.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15330 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-14 13:15:46 +00:00
Abdelrazak Younes
c5dd10f93e * GuiApplication: explicitly clear out socket_callbacks_ in the destructor.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15325 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-13 16:48:12 +00:00
Abdelrazak Younes
1271f473f0 WorkArea::processKeySim(): ensure that LyXFunc holds the proper LyXView.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15322 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-13 14:15:31 +00:00
Abdelrazak Younes
e2eb1d9692 * Gui::newView(): cleanup unused arguments.
* qt4/GuiImplementation.h: remove duplicate unused newWorkArea() method definition.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15317 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-12 22:30:42 +00:00
Abdelrazak Younes
53bbb6ed7a * GuiApplication.C: align Windows with other platform. No more static trick!
* lyx_main:
  - LyX::application_ : new scoped_ptr member containing the Application instance.
  - LyX::priv_exec(): initialize application_.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15316 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-12 22:02:45 +00:00
Abdelrazak Younes
1384e32430 fix formatting issue.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15314 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-12 20:03:09 +00:00
Georg Baum
0891c2e99a Replace crash on startup with a memory leak.
* src/frontends/qt[34]/GuiApplication.C
	(lyx::frontend::Application * createApplication): Don't return the
	address of a temporary, but use the new operator.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15313 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-12 19:40:04 +00:00
Georg Baum
bd8fc3aed3 compile fix
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15311 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-12 16:50:47 +00:00
Abdelrazak Younes
eedd7bd25f ensure that theLyXFunc is set to the proper LyXView.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15310 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-12 15:23:49 +00:00
Abdelrazak Younes
6b256d52c4 preliminar support for multiple LyXView.
* LyXFunc: new setLyXView() method

* LyXView::dispatch(): call LyXFunc::setLyXView() before lyx::dispatch()

What remains to be done is to ensure that every call to lyx::dispatch that is LyXView dependant is replaced with LyXView::dispatch().


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15308 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-12 14:58:57 +00:00
Abdelrazak Younes
83ffa28e77 This commit is purely mechanical and get rid of lyx_gui.[Ch].
Only qt4 is guaranted to compile and work. I did not remove gtk and qt3 lyx_gui.C because they might be needed for reference to complete the header declarations in "GuiApplication.C".

 - lyx_gui::use_gui transfered to lyx::use_gui in lyx_main.C
 - all remaining lyx_gui functions transfered to Application and corresponding GuiApplication implementations. 


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15306 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-12 14:10:13 +00:00
Georg Baum
79c876d4c3 Convert labels to unicode
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15305 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-12 10:50:45 +00:00
Abdelrazak Younes
3b21b04e9c * LyX class (lyx_main.[Ch]):
- new buffer_list_ member and accessors
  - implementation of theBufferList() extern function

* Application: remove everything related to BufferList

* lyx_cb.C: test for lyx::use_gui before using theApp.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15303 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-11 22:30:31 +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
Georg Baum
e1d0ce0a6e qt3 compiles again
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15299 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-11 18:32:32 +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
Abdelrazak Younes
68ee23313a remove the focusInEvent() and focusOutEvent() that had so many bad side effect...
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15297 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-11 13:01:12 +00:00
Abdelrazak Younes
4803b5be6c MacOSX compilation fixes.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15295 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-10 15:56:41 +00:00
Abdelrazak Younes
4add252628 * frontends/Painter:
- text(): now returns drawn text width()

* rowpainter:
 - paintChars(): use the returned width from Painter::text() instead of recalculating it.

All other files: implement the API change. qt3 and gtk not 100% guaranted to compile nor work.






git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15294 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-10 13:24:08 +00:00
Abdelrazak Younes
f5f4b31f4a This commit is converting everything related to browsing to unicode (qt4 only).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15293 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-09 16:33:20 +00:00
Jean-Marc Lasgouttes
41d7e4c394 compilation fixes for qt3 after Abdel's latest changes
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15292 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-09 16:08:27 +00:00
Abdelrazak Younes
e7a64fb3e4 even more unicode work...
qt3 and gtk not guaranted to compile nor work.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15288 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-09 13:28:32 +00:00
Abdelrazak Younes
c594a2f9d8 incomplete qt3 and gtk support for Revision 15283
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15286 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-09 12:46:08 +00:00
Abdelrazak Younes
abca4c7a25 more unicode Work: Menubar and Toolbar.
No idea whether qt3 and gtk compiles.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15285 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-09 12:30:55 +00:00
Abdelrazak Younes
f9c4f9cca3 more unicode work.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15284 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-09 12:07:05 +00:00
Abdelrazak Younes
e6fea4b844 Patch 1 Log:
* controllers/Dialog.[Ch]
  - View::title_ is now a docstring (ctor and access functions changed)

* controllers/ControlLog.[Ch]
  - title() now returns a docstring

* controllers/ControlLog.[Ch]
  - title() now returns a docstring

* qt4/*: adapted to above changes.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15283 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-09 10:35:14 +00:00
Abdelrazak Younes
e7c4a0554c more unicode work.
* lstrings.[Ch]: new docstring trim() function

* qt4/validators.C: PathValidator::validate() and printable_list() converted to unicode.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15281 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-09 09:15:37 +00:00
Abdelrazak Younes
742cd190cb revert to revision 15266
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15280 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-08 14:24:12 +00:00
Abdelrazak Younes
c8e5745e20 * ControlChanges:
- getChangeAuthor() and getChangeDate(): converted to unicode.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15279 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-08 10:32:33 +00:00
Georg Baum
94c10102c0 Compile fix. This was easy, since the code is alsmost identical to qt4,
but I am not going to do gtk.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15271 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-08 07:39:02 +00:00
Georg Baum
3f0d2901c2 Avoid another name clash (probably #define check ...) on OS X with Qt 4.2.0
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15270 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-08 06:57:46 +00:00
Georg Baum
a774f10c0c remove double include
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15269 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-07 17:09:30 +00:00
Georg Baum
2b477c1f68 remove unused variable
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15268 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-07 17:07:46 +00:00
Georg Baum
6ada61e182 Rename namespace Alert to lyx::frontend::Alert.
This prevents a name clash with Qt 4.2.0 on OS X.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15267 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-07 16:47:54 +00:00
Abdelrazak Younes
a21259dd02 * qt_helpers:
- ucs4_to_qchar() and qchar_to_ucs4() have been inlined.
  - ucs4_to_qstring(): pass a QString to avoid a copy.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15266 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-07 16:30:26 +00:00
Abdelrazak Younes
00edcc582f This commit is a big rework of the FontLoader/FontMetrics interaction. Only Qt4 for now, I would be grateful is somebody steps up for qt3 and gtk.
Basically, I replaced all methods in the font_metrics namespace by a proper virtual interface FontMetrics. The FontLoader is _the_ container for FontMetrics.

This patch should also bring some optimizations in a number of place in the code. This is because we do not need any more to search for the LyXFont at each font_metrics call. In effect, the speed advantage is not as sensible and this is a bit deceiving considering that this was my primary motivation behind the patch. But I like the patch anyway as it cleans up the relation and interfacing between fonts, metrics and frontends.

* frontends/FontMetrics.h: new virtual interface. Renamed from font_metrics.h

* qt4/GuiFontMetrics: corresponding qt4 implememtation. Renamed from qfont_metrics.C. The smallCaps particular case treatment has been transfered here as well as the width cache for MacOSX and Windows.

* qt4/QLPainter.C: the smallCapsText has been reworked to return the width of the drawn text.C

all other files: replace font_metric helper function call with corresponding FontMetrics method calls.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15265 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-07 16:15:06 +00:00
Abdelrazak Younes
f2ca75b3ac remove LFUN_TOOLTIPS_TOGGLE and associated Dialog::tooltipsEnabled() method.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15263 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-06 21:49:13 +00:00
Abdelrazak Younes
f54f0e2d4c * lyx_gui: parse_lyxrc() and getStatus() methods deleted.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15256 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-05 16:52:04 +00:00
Abdelrazak Younes
c77b5dbee1 enable the font width cache for Windows also, it saves three seconds on the UserGuide test on my machine (18s versus 21 second).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15235 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-04 12:43:13 +00:00
Abdelrazak Younes
78135f7751 enable Font cache only for MacOSX and inline width() for other platform.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15233 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-04 10:08:51 +00:00
Abdelrazak Younes
6c2577d98d MacOSX compilation fix.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15230 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-04 09:34:56 +00:00
Georg Baum
b9f008e2ba compile fix
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15226 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-03 20:03:25 +00:00