Commit Graph

3126 Commits

Author SHA1 Message Date
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
Abdelrazak Younes
205096733a This commit introduces the FontLoader interface class. In the future, I intend to extend it with a proper encapsulation of font metrics.
* frontends/FontLoader.h: new interface class.
* frontends/Application.h: new FontLoader() pure virtual method
* frontends/lyx_gui: update_fonts() and font_available() methods deleted

* [qt3/qt4/gtk]/GuiApplication: implement the new interface

* qt4/GuiFontLoader:
  - renamed from FontLoader
  - now derives from FontLoader
  - now in the lyx::frontend namespace

* qt3/qfont_loader
  - now derives from FontLoader

* gtk/xftFontLoader
  - now derives from FontLoader



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15220 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-03 16:17:32 +00:00
Abdelrazak Younes
1b8c2a95df use theApp directly for default fonts.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15214 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-03 14:21:15 +00:00
Abdelrazak Younes
f1d2dfadbc Put back doxygen comments deleted from lyx_gui.h.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15212 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-03 13:59:01 +00:00
Abdelrazak Younes
85d2e4b917 * lyx_gui: create_view(), start() and exit() functions deleted.
* lyx_main.C and lyx_cb.C: use Application methods directly instead of the above functions.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15211 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-03 13:38:28 +00:00
Abdelrazak Younes
046c9bb9e3 transfer lyx_gui::exit() to frontends/lyx_gui.C
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15209 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-03 11:42:33 +00:00
Abdelrazak Younes
63ad5449fb This commit creates a new "frontends/lyx_gui.C" that contains all functions that are not frontend dependent any more. It also creates 3 new pure virtual methods in Application:
virtual std::string const romanFontName() = 0;
virtual std::string const sansFontName() = 0;
virtual std::string const typewriterFontName() = 0;

My goal is to transfer all of "frontends/*/lyx_gui.C" to "frontends/lyx_gui.C". When this is done, "frontends/lyx_gui.C" can go altogether as its functions will then be replaced with direct calls to theApp->XXX().

* frontends/lyx_gui.C: new file with code transfered from [qt3,qt4,gtk]/lyx_gui.C

* frontends/Application: 3 new font related pure virtual methods

* [qt3,qt4,gtk]/GuiApplication: implement the above method with code transfered from lyx_gui.C


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15208 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-03 10:34:10 +00:00
Abdelrazak Younes
d1e7c7e0ab Integrate Application_pimpl into Application.C.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15206 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-03 08:43:32 +00:00
Georg Baum
2c72e0ecaa Fix bug 2868
* src/insets/insetgraphics.C
	(findTargetFormat): return pdf for vector graphics

	* src/format.h
	(Flags): new enum describing format flags
	(flags_): new member variable for format flags
	(vectorFormat): new, tell whether a format can contain vector graphics

	* src/format.C: adjust to flags changes

	* src/frontends/qt[34]/QPrefsDialog.C
	(QPrefsDialog::QPrefsDialog): handle new vector flag
	(QPrefsDialog::switch_format): ditto
	(QPrefsDialog::updateFormatsButtons): ditto
	(QPrefsDialog::new_format): ditto
	(QPrefsDialog::modify_format): ditto

	* src/frontends/qt3/ui/QPrefFileformatsModule.ui
	* src/frontends/qt4/ui/QPrefFileformatsUi.ui
	(vectorCB): new checkbox for vector flag

	* src/lyxrc.C
	(LyXRC::read): read vector flag
	(LyXRC::write): write vector flag

	* lib/doc/Customization.lyx: document format flags

	* lib/configure.py
	(checkFormatEntries): Add vector flag to some formats


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15205 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-03 08:34:59 +00:00
Enrico Forestieri
5070d2f660 Fix build on cygwin when using --without-x
* src/frontends/qt4/GuiView.C
	(setGeometry): replace test for Q_OS_WIN32 with Q_WS_WIN

	* src/support/fontutils.C:
	If X_DISPLAY_MISSING is defined, compile the code for Win32
	on cygwin, too.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15201 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-02 18:21:48 +00:00
Abdelrazak Younes
481e6a3ac7 A fix from Ozgur Ugras BARAN:
A trivial (looking) patch to correct inset behavior, which is broken
with revision 15068. Without this patch, it is not possible to modify
an existing inset. All modifications processed as new index. (see
lyxfunc.C:1420)


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15199 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-02 15:40:39 +00:00
Abdelrazak Younes
6a947f349b This commit moves system font initialization and restoration to new support/fontutils.[Ch].
These font related functions were identical for qt3 and qt4. They are not Qt dependent at all and could also apply to an eventual Win32 or MacOSX gtk port.

Jen-Marc says: It would be nice to convince fontconfig to do the same for linux.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15196 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-02 10:48:03 +00:00
Georg Baum
6eab6ea732 remove unneeded include
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15188 a592a061-630c-0410-9148-cb99ea01b6c8
2006-09-30 10:24:05 +00:00