]> git.lyx.org Git - features.git/commit
This is one of a series of patches that will merge the layout modules development...
authorRichard Heck <rgheck@comcast.net>
Thu, 23 Aug 2007 16:41:13 +0000 (16:41 +0000)
committerRichard Heck <rgheck@comcast.net>
Thu, 23 Aug 2007 16:41:13 +0000 (16:41 +0000)
commit6e93e77f229fbda5c6af6c04325c5cd157e15957
tree2abac9db3defee08e6b19d6b76a2583711a9ff29
parent24a36d01a0723788748d3526b083333650f5e885
This is one of a series of patches that will merge the layout modules development in personal/branches/rgheck back into the tree.

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
19 files changed:
development/scons/scons_manifest.py
src/Buffer.cpp
src/BufferParams.cpp
src/BufferParams.h
src/BufferView.cpp
src/CutAndPaste.cpp
src/CutAndPaste.h
src/LyXFunc.cpp
src/Makefile.am
src/Text.cpp
src/TextClass_ptr.h [new file with mode: 0644]
src/buffer_funcs.cpp
src/buffer_funcs.h
src/frontends/LyXView.cpp
src/frontends/Toolbars.cpp
src/frontends/Toolbars.h
src/frontends/controllers/ControlDocument.cpp
src/frontends/qt4/QDocument.cpp
src/insets/InsetInclude.cpp