* src/Buffer.cpp (Buffer::readFile): save timestamp and checksum
of the original disk file, and not those of the file converted
to current format.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19916 a592a061-630c-0410-9148-cb99ea01b6c8
Design goal: Allow the use of layout "modules", which are to LaTeX packages as layout files are to LaTeX document classes. Thus, one could have a module that defined certain character styles, environments, commands, or what have you, and include it in various documents, each of which uses a different document class, without having to modify the layout files themselves. For example, a theorems.module could be used with article.layout to provide support for theorem-type environments, without having to modify article.layout itself, and the same module could be used with book.layout, etc.
This patch adds the backend. The ModuleList class holds a list of the available modules, which are retrieved from lyxmodules.lst, itself generated by configure.py. There are two LFUNs available: modules-clear and module-add, which do the obvious thing; you can test by typing these into the minibuffer, along with the name of one of the available modules: URL (a CharStyle), Endnote (a Custom Inset), and---with the spaces---End To Foot (View>LaTeX and look at the user preamble), which are themselves in lib/layouts. There are some others, too, that allow theorems to be added to classes like article and book.
The GUI will come next.
Issues: (i) The configure.py script could be improved. It'd be nice, for example, if it tested for the presence of the LaTeX packages a particular module needs. But this would mean re-working the LaTeX script, and I don't know how to do that. Note that at present, the packages are ignored. This will change shortly. (ii) I've used std::string in LyXModule, following what seemed to be a precedent in TextClass. If some of these should be docstrings, please let me know, and I'll change them. (iii) There is at present no distinction between LaTeX and DocBook modules. Should there be? That is: Should there be modules that are available when the document class is a LaTeX class and others that are available only when it is DocBook? Or should there just be one set of modules? Each module can of course indicate for what it is suitable in its description.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19893 a592a061-630c-0410-9148-cb99ea01b6c8
Design goal: Allow the use of layout "modules", which are to LaTeX packages as layout files are to LaTeX document classes. Thus, one could have a module that defined certain character styles, environments, commands, or what have you, and include it in various documents, each of which uses a different document class, without having to modify the layout files themselves. For example, a theorems.module could be used with article.layout to provide support for theorem-type environments, without having to modify article.layout itself, and the same module could be used with book.layout, etc.
This first patch does some reworking of the infrastructrue. We need to distinguish between the TextClass that a particular document is using and the layout of that document, since modules, in particular, can modify the layout. The solution adopted here is to add a TextClass pointer to BufferParams, which will hold the layout. The layout itself is then constructed from the TextClass the document is using. At present, this is completely trivial, but that will change when modules are added.
The pointer in question is a boost::shared_ptr. This is needed because CutAndPaste saves a copy of the layout with each cut or copied selection. We cannot assume the selection vanishes when the document is closed, so there are two options: (i) keep a list of all the layouts that have ever been used by any document; (ii) used some kind of smart pointer. The latter seems preferable, as the former would waste memory. More importantly, the use of a smart pointer allows modules to be modified on disk and then reloaded while LyX is running, and it will eventually allow the same for layout files.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19756 a592a061-630c-0410-9148-cb99ea01b6c8
* Buffer:
- get rid of cursor_ and anchor_
- ~Buffer(): update the labels of its master buffer before closing
- closing(): pass the Buffer address.
* BufferView():
- BufferView(): needs a valid Buffer (should be const in the future.
- most of the change is about removing all test of buffer_ nullity.
- resize(): deleted.
- setBuffer(): deleted.
* Application:
- newLyXView(): simplification
- updated design description in Application.h
* Gui/GuiImplementation: remove all WorkAreas and BufferView creation/Deletion. Workareas are directly handled by LyXView/GuiView and BufferView is created/delete by WorkArea.
* LyXView/GuiView: implement the new design
What is not working yet:
- the close tab button: it is implemented but does not show up.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19686 a592a061-630c-0410-9148-cb99ea01b6c8
The changes are essentially of three types.
First, the std::maps previously used here for storing BibTeX data have become full-fledged classes and so what were previously just a bunch of functions have now become methods of these new classes. This leads to a lot of minor changes in other files, to adapt to the new signature. The changes in insets/ are mostly of this kind.
Second, there are some slightly more substantial changes in src/insets/InsetBibtex.cpp. We now store lists of the field names and entry types that have been used.
Finally, there are the changes to the citation UI. These are mostly straightforward, though adding the new functionality exposed some inadequacies in the previous code that also had to be fixed.
One other change: BibTeX keys are now docstring. This solves some Unicode issues.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19657 a592a061-630c-0410-9148-cb99ea01b6c8
a structure representing field->value instead of just a single string with
all the data. The data structures are defined in src/Biblio_typedefs.h, and
the main changes are to the parser code in src/insets/InsetBibtex.cpp.
-src/Biblio_typedefs.h
Contains typedefs for new representation. Separating them out limits how much
gets #include'd by other files, and also resolves a circularity problem with
Buffer.h.
-src/Biblio.{h,cpp}
Signature changes and massive simplifications to routines that report
BibTeX data, since we now have an articulate representation.
-src/insets/InsetBibtex.{h,cpp}
Re-write the parser code so we store a key->value map of the BibTeX data
rather than just one long string. This is the main work.
-src/frontends/controllers/ControlCitation.{h,cpp}
-src/insets/InsetBibitem.{h,cpp}
-src/insets/InsetCitation.cpp
Adaptations and simplifications.
-src/insets/Inset.h
-src/Buffer.{h,cpp}
-src/insets/InsetInclude.{h,cpp}
Signature changes.
-src/Makefile.am
-development/scons/scons_manifest.py
Add src/Biblio_typedefs.h
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19598 a592a061-630c-0410-9148-cb99ea01b6c8
* Biblio.cpp: fillWithBibKeys(): ditto.
* InsetInclude.cpp: loadIfNeeded(): set the parent name in any case.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19586 a592a061-630c-0410-9148-cb99ea01b6c8
information is acquired. This involves (i) moving the bulk of fillWithBibKeys()
into Biblio.cpp, (ii) introducing a virtual method Inset::fillWithBibKeys() that,
by default, does nothing, and (iii) over-riding this method in the insets that do
need to do something.
This is all preparatory for a more substantial re-working of the BibTex code,
which should follow shortly.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19565 a592a061-630c-0410-9148-cb99ea01b6c8
in the view source panel
* Buffer.cpp (getSourceCode, writeLaTeXSource): fix sync between output and texrow
* frontends/controllers/ControlViewSource.{h,cpp} (getRows): new method to get the current selection in term of latex rows
* frontends/qt4/QViewSource.{h,cpp}: make a selection in the ViewSource widget
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19503 a592a061-630c-0410-9148-cb99ea01b6c8
* src/support/tempname.cpp: move code about HAVE_MKSTEMP here (only user)
* src/pch.h:
* src/Buffer.cpp:
* configure.ac: remove all traces of utime.h and HAVE_UTIME
* config/lyxinclude.m4: remove WITH_WARNING define (which be rendered useless in
a future commit from christian)
* development/scons/SConstruct: try to update.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19395 a592a061-630c-0410-9148-cb99ea01b6c8
* src/support/gzstream.h: re-introduce the stream we were using in
1.4.x. The boost iostream solution produces unreadable streams
on windows and we do not know why currently.
* src/support/Makefile.am:
* src/Buffer.cpp:
* src/Lexer.cpp:
* development/scons/scons_manifest.py: adapt.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19271 a592a061-630c-0410-9148-cb99ea01b6c8
* src/Changes.cpp:
* src/support/userinfo.cpp:
* src/Paragraph.cpp:
* src/Changes.h:
* src/Buffer.cpp:
* src/Paragraph.h:
* src/BufferParams.cpp: do not save the name of authors
in LyX documents, who have not made a single change in
change tracking mode
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19019 a592a061-630c-0410-9148-cb99ea01b6c8
- Split the language Arabic into "arabic_arabi" that uses the arabi-package and "arabic-arabtex" that uses the arabTeX-package to typeset Arabic. This is needed because both packages have some advantages over the other people need.
(This change is a consequence of a long and fruitful discussion with Mostafa, Dov, and me.)
Patch by Dov and me.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18887 a592a061-630c-0410-9148-cb99ea01b6c8
Fix Bug 3860: Toc crash when loading a child documents.
* BufferView::loadLyXFile(): simplify, transfer last part to
LyXView::loadLyXFile().
Change return value to Buffer created by load (or 0 if none).
Ultimately, this should all be moved to buffer_funcs.cpp, as it is no
longer needed here.
* Buffer::setParentName(): small fix to avoid recursive includes.
* LyXView:
- setBuffer(): properly update the labels and the Toc if this is [LOAD Child
Document] command. Move buffer connection and disconnection, simplifying
earlier code.
- loadLyXFile(): get some code from BufferView::loadLyXFile() and from
LyXFunc::LFUN_BUFFER_CHILD_OPEN, properly handle the child document case.
There's a lot of overlap with setBuffer() here. This needs cleaning.
* LyXFunc: add optional argument to LFUN_BUFFER_CHILD_OPEN to indicate if
the document is being opened by LyX itself rather than the user (as on
View>DVI, for example).
* LyX: adapt to loadLyXFile() API changes.
* insets/InsetInclude: use LFUN_BUFFER_CHILD_OPEN rather than calling
loadLyXFile() directly. Make use of new optional argument.
With this in place, the only thing missing for proper multipart document support is to automatically update the parent Buffer when switching from the parent Buffer. This would be very useful when you work with multiple document sharing the same child documents (as I often do).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18825 a592a061-630c-0410-9148-cb99ea01b6c8
- delete unneeded InsetList.h
- transfer the errorList to the private implementation.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18782 a592a061-630c-0410-9148-cb99ea01b6c8
language to be in the paragraph's language. This is necessary due to format
change 259, but the language was forgotten in lyx2lyx back then. It's important
for Bidi documents.
(fixes bug http://bugzilla.lyx.org/show_bug.cgi?id=3789)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18766 a592a061-630c-0410-9148-cb99ea01b6c8
* src/Buffer.cpp:
- make view-source string translatable
* src/frontends/controllers/ControlToc.h:
- make getGuiName public
* src/frontends/qt4/TocWidget.cpp:
- use getGuiName for the combo.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18505 a592a061-630c-0410-9148-cb99ea01b6c8
bug 3659 (crash when file contains only an InsetInclude).
Added checks for self-inclusion. The reason this is not a complete fix is that
recursive input could arise from something other than self-inclusion. Checking
for that will be much more complicated, however.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18445 a592a061-630c-0410-9148-cb99ea01b6c8
- when exporting with pdflatex
- when exporting with latex and dvipost is not available
rename two colors (strikeout => deletedtext, newtext => addedtext)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18284 a592a061-630c-0410-9148-cb99ea01b6c8
introduce 'semantic' TeX commands \lyxinserted and \lyxdeleted in order to decouple change tracking
output from dvipost. Raise user warning if dvipost is not installed (i.e. no changes are shown in TeX output)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18237 a592a061-630c-0410-9148-cb99ea01b6c8
Introduces new encodings for the CJK-languages.
The CJK-languages can now be selected from LyX's menu.
For remaining small problems, see the thread "Help needed for bug 3043" on the devel-list.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18216 a592a061-630c-0410-9148-cb99ea01b6c8
This is a part of the fix for bug 3043.
I got the OK from Georg, that this patch doesn't introduce conflicts as it only sets the infrastructure.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18206 a592a061-630c-0410-9148-cb99ea01b6c8
- add new encoding utf8-plain for the sake of XeTeX users (bug 3526)
* src/BufferParams.cpp:
- implement new encoding (skip inputenc)
- fix logic error with thailatex
* src/Buffer.cpp:
* lib/lyx2lyx/LyX.py:
* lib/lyx2lyx/lyx_1_5.pyx:
* development/FORMAT:
- format increment to 267
- reset encoding to utf8 on reversion.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18198 a592a061-630c-0410-9148-cb99ea01b6c8
Please note that method B_ (translate text to buffer language) is presently broken (at least on Windows)!
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18143 a592a061-630c-0410-9148-cb99ea01b6c8