Commit Graph

86 Commits

Author SHA1 Message Date
Jean-Marc Lasgouttes
11bea5a763 Use a set<string> instead of a vecctor<string> for list of features. This
allows to simplify the code to some extent.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22734 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-01 15:12:04 +00:00
Jürgen Spitzmüller
f62fbd05d2 * src/BufferParams.{cpp,h}:
- (paperSizeName): add missing paper sizes. Add an argument to the function
	  that returns context-sensitive information (depending on the purpose)
	- (paperSizeName): Do not hardcode "letter" for default paper size (bug 2098).
	- (dvips_options): pass purpose DVIPS to paperSizeName
* src/Converter.cpp:
	- (dvipdfm_options): pass purpose DVIPDFM to paperSizeName.
* src/Format.cpp:
	- (view): pass purpose XDVI to paperSizeName (fix bug 4432).

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22664 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-25 12:54:25 +00:00
Pavel Sanda
2eb75da023 PDFoptions: improve the functionality in case the hyperrref is
already loaded by the textclass.

Some corner cases still missing (see fixme and link below).
http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg134643.html


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22660 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-24 01:20:51 +00:00
Jean-Marc Lasgouttes
0df54152bc Move spacing code around (and fix a bug)
* LaTeXFeatures.cpp (getPackages): remove some specific spacing code;
	move listings support to simplefeatures array.

	* src/Spacing.cpp (writeEnvirBegin, writeEnvirEnd): code factorization
	(writePreamble): new method containing former code from LaTeXFeatures;
	use \setSpacing instead of \setSingleSpacing.

	* src/BufferParams.cpp (validate, writeLaTeX): handle spacing here.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22644 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-22 08:41:45 +00:00
Jürgen Spitzmüller
804e912910 Fix hyperref-soul conflict and sanitize hyperref management
* src/BufferParams.cpp:
	- always require hyperref if it's used.
	- only call PDFOptions::writeLaTeX if hyperref is required
	  (and not provided by textclass).
* src/PDFOptions.{cpp,h}:
	- (writeLaTeX): remove unneeded hyper_required argument
* src/LaTeXFeatures.cpp:
	- special definition for pdflatex ct markup when hyperref is used
	  (fix bug 4504).

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22629 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-19 11:17:12 +00:00
Richard Heck
7c28905b17 This commit adds some new functionality to the modules stuff. In particular, it introduces the concept of "required" and "excluded" modules: A given module may require one of some list of modules, or it may be incompatible with some other modules. (Complex Boolean combinations are not supported!!) These facts can be noted in the module file, and the UI responds appropriately: Required and excluded modules are noted in the description, and the "Add" button is enabled only if at least one of the required modules has already been selected and no excluded module is selected. Getting this to work involved a fair bit of cleanup of the existing code---including ways Angus, I think, had already pointed out were required---and also involved changing the syntax of the headers of the module files, but in ways that are probably best anyway.
None of the extant modules require any other modules, but the Theorem modules all exclude one another. (See the screenshot.) When I modularize the AMS classes---that is the next task---we'll have requires.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22456 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-09 18:51:02 +00:00
Jürgen Spitzmüller
9e5eebc14c *** Requires tag for classes, layouts and custom insets ***
* src/TextClass{cpp,h}:
	- implement Requires tag for class and InsetLayout.
* src/Layout.{cpp,h}:
	- implement Requires tag for layouts.
	- increase layouts format to 6.
* src/Paragraph.cpp:
	- request required features for paragraph layouts.
* src/LaTeXFeatures.cpp:
	- add some packages needed by modules.
	- remove Preamble method for InsetLayout. This is now done
	  in InsetFlex::validate.
* src/BufferParams.cpp (validate):
	- request required features for the class.
* src/insets/InsetLayout.h:
	- new member "requires".
* src/insets/InsetFlex.{cpp,h}:
	- implement validate method and request required features and preamble snippets.

* lib/layouts/*.{layout,module,inc}:
	- increase layouts format to 6.
	- use Requires tags in some modules (more can be done later).

* lib/doc/Customization.lyx:
	- document Requires tag.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22414 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-07 16:59:10 +00:00
Richard Heck
0fce3ff6bd Pass by const reference. Thanks Andre and Peter.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22405 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-06 18:17:25 +00:00
Richard Heck
ef86256c39 Remove commented out code.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22402 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-06 17:23:19 +00:00
Richard Heck
9a7cd29f5b Rationalize the handling of makeTextClass().
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22388 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-05 17:04:56 +00:00
Richard Heck
80e98c5b71 Implement checks for available modules both in BufferParams and in the gui.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22387 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-05 16:56:30 +00:00
Jean-Marc Lasgouttes
6376641f4e Move part of Buffer::validate into a new method BufferParams::validate.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22146 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-14 14:51:47 +00:00
Abdelrazak Younes
9abb7db468 getting rid of superfluous std:: statements.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22104 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-12 19:28:07 +00:00
Abdelrazak Younes
b89cc942eb 'using namespace lyx::support' instead of 'using support::xxx'
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22103 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-12 18:57:56 +00:00
Abdelrazak Younes
9383f4c3c6 'using namespace std' instead of 'using std::xxx'
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22097 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-12 10:16:00 +00:00
André Pönitz
cbaca4a129 fix typo
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22071 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-10 23:14:09 +00:00
Jürgen Spitzmüller
35cb68ba14 * src/BufferParams.cpp (readToken):
- initialize pair<bool, lyx::textclass_type> pp.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21939 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-03 16:42:43 +00:00
Jürgen Spitzmüller
433eda2cca * src/BufferParams.cpp (readToken):
- fix assertion introduced with rev. 21800 (bug 4395).

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21925 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-02 17:59:53 +00:00
André Pönitz
9d0ea8aeff Move debug.{cpp,h}, Messages.{cpp,h} and gettext.{cpp,h} to support/.
Now support/* should have no dependencies on src/* anymore.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21851 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-29 07:04:28 +00:00
Abdelrazak Younes
c886bc68c2 * FileName:
- introduce changeExtension(): the goal is to replace progressively the one in filetools.cpp
- get rid of internal_path() checking for Win32 as the path is always normalized with slashes with QFileInfo.

* BufferParams: get rid of filepath member. This was used only once and was fixing a path in BufferParam was wrong anyway.

* Buffer::filePath(): always regenerate instead of caching it in BufferParams.

 

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21847 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-28 15:25:07 +00:00
Bo Peng
3f30fe7421 If there exists a local layout file, use the local copy instead of the system one.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21800 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-26 15:45:54 +00:00
Jürgen Spitzmüller
fa07bad49c * LaTeXFeatures.cpp (useLanguage):
- require the CJK package for CJK languages.
* BufferParams.cpp (writeEncodingPreamble):
	- load CJK package if required.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21652 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-17 12:37:18 +00:00
Abdelrazak Younes
cdf1378200 Introducing TextClassPtr.h to minimize header dependencies.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21506 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-07 23:25:08 +00:00
André Pönitz
437693005c *sigh*
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21408 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-03 18:30:05 +00:00
André Pönitz
09df753df4 pimpl not needed here
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21395 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-02 23:42:27 +00:00
André Pönitz
a8cd9a4b8f cosmetics. mainly replace #include "dostring.h" by #include "strfwd.h"
in header files when possible. Adjust .cpp files.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21358 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-01 22:17:22 +00:00
Abdelrazak Younes
5ddc612b73 Splitup Font in saner bits:
* Font::FontBits -> FontInfo
* Font::FONT_XXX -> all enums transfered to FontEnums.h and renamed to FontXxx

I've replaced Font uses with FontInfo were the language() member was not needed, basically all draw() and metrics methods. There's one problematic cases with InsetQuotes which I solved by taking the Buffer main language.




git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21240 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-28 18:51:54 +00:00
Abdelrazak Younes
eea79637c7 Move Color::color enum to ColorCode.h
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21198 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-25 12:41:02 +00:00
André Pönitz
3b3ac62e58 create some helper functions in FileName
cosmetics;


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21022 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-17 22:21:50 +00:00
Uwe Stöhr
7075eaadef The huge URL patch:
- rename the lfun to href-insert.png
- rename the files to Hyperlink...
- the former URLUi produces now \href commands (hyperref)

Only missing thing is the lyx2lyx conversion routine - this will be done by Richard

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20950 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-13 19:06:09 +00:00
Uwe Stöhr
0b6fa6ef30 BufferParams.cpp: - load the japanese package only when japanese is not already provided.
- fix japanese babel handling

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20929 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-11 23:31:16 +00:00
Uwe Stöhr
392ddbfdbd BufferParams.cpp: babel must be loaded even when there is no given language parameter, due to the Japanese support package that does this later
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20880 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-09 23:03:14 +00:00
Uwe Stöhr
1484691640 BufferParams.cpp: empty the encodings when the Japanese plain encodings are used to prevent that inputenc is used (according to the suggestion by JMarc)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20879 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-09 22:26:17 +00:00
Uwe Stöhr
71ea6e7a8b BufferParams.cpp: next step for proper traditional Japanese support
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20861 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-09 00:59:16 +00:00
Uwe Stöhr
ae0f514870 support for the Vietnamese languages
fileformat increased to 291

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20738 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-04 23:20:39 +00:00
Uwe Stöhr
6081aa09fa BufferParams.cpp: add comment
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20591 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-29 15:16:45 +00:00
Uwe Stöhr
c57143d682 BufferParams.cpp: change the package loading to:
former                  now
needed packages         needed packages
---                     babel
hyperref                hyperref
LyX-specific stuff      LyX-specific stuff
user preamble           user preamble
babel                   ---

This is needed because hyperref should be loaded after babel but has to be loaded before the LyX-specific stuff. The LyX-specific stuff has to be loaded before the user preamble.

It shouldn't harm to load babel before the user preamble, I even think this is an advantage because many packages need the loaded babel for  translations and the users are able to change babel translation.

The new scheme compile fine with all LyX docs and my German math manual. When you have an example where this scheme doesn't work, please shout!

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20508 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-25 21:20:57 +00:00
Uwe Stöhr
39de8e95a4 BufferParams.cpp: whitespace
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20432 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-22 12:55:12 +00:00
Uwe Stöhr
9c59de3c67 PDFOptions.cpp: clean up the appearance of the parameters in the LaTeX-output
BufferParams.cpp: move the hyperref call to the right position

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20431 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-22 12:53:22 +00:00
Uwe Stöhr
f675f011be PDF-support patches by Pavel
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20429 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-22 11:39:19 +00:00
André Pönitz
1b79e53ffe cosmetics
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20392 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-20 22:42:16 +00:00
André Pönitz
3ff14b8300 Pavel Sanda's "PDFOptions" patch
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20389 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-20 22:31:18 +00:00
Richard Heck
e020bc1806 Fulfill promise to Andre: TextClass_ptr --> TextClassPtr.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20349 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-18 17:46:14 +00:00
Richard Heck
3ddc46bab0 Whitespace.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20266 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-13 22:25:37 +00:00
Richard Heck
411b7abcfa Fix crash when layout file cannot be read due to failure to call makeTextClass() in that case.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20153 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-08 17:50:09 +00:00
Richard Heck
ec29fd3461 Revert accidental commit.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20152 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-08 17:49:37 +00:00
Richard Heck
aebd5ebaf9 Fix crash when layout file cannot be read due to failure to call makeTextClass() in that case.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20150 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-08 17:46:02 +00:00
Richard Heck
8947e56702 Clarify comment.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20008 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-02 15:46:03 +00:00
Richard Heck
d7a33bc841 This patch continues 19964. It takes advantage of the work there to simplify a few things elsewhere. First, in ControlDocument::dispatchParams(), we're setting the TextClass and then dispatching the BufferParams, which sets it again now. So we can get rid of the first call. This, however, requires loading the TextClass somewhere other than LFUN_TEXTCLASS_APPLY, which I do in BufferParams::setBaseClass(), which is when you'd actually need to do it. So I've moved some of the loading logic there. (It seemed a good idea to make setBaseClass() return whether it was successful, then, though this isn't used at the moment.)
That makes another simplification both possible and desirable. For some reason, whenever you change the Document Class combobox in Document Settings, LyX tries to read whatever you choose _before_ you try to hit "Apply". Why? I see no good reason. You get the warning earlier that way, but maybe you weren't going to try to load it anyway and were going to change your mind. So I have removed that behavior, in which case you'll get the warning when you try to apply the parameters. This means we can also remove ControlDocument::loadTextclass().

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19965 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-01 04:03:24 +00:00
Bo Peng
cc6fe67c35 Embedding feature patch 3: basic gui support
*  lib/ui/stdmenus.inc: add menu item embedded files
	*  src/BufferParams.cpp: set default embedded status to false
	*  src/EmbeddedFiles.h|cpp: add a few member functions
	*  src/frontends/qt4/Dialogs.cpp: add embedding dialog
	*  src/frontends/qt4/GuiEmbeddedFiles.h|cpp: embedding dialog
	*  src/frontends/qt4/ui/EmbeddedFilesUi.ui: embedding dialog
	*  src/frontends/controllers/ControlEmbeddedFiles.h|cpp: embedding dialog control
	*  src/frontends/qt4/Makefile.am: build system update
	*  src/frontends/controllers/Makefile.am
	*  development/scons/scons_manifest.py


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19953 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-31 15:42:35 +00:00