Commit Graph

2351 Commits

Author SHA1 Message Date
Martin Vermeer
e4a160c6cf Make Richard happy, add inset layout parm 'Decoration'
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19786 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-25 09:57:32 +00:00
Martin Vermeer
89287ef7ee Oops -- cut off wrong part of label
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19771 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-24 14:42:41 +00:00
Alfredo Braunstein
09b0a337ca move forwardIdx to CursorSlice from DocIterator, as it was the only one able to travel into an invalid cursor position
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19763 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-23 21:35:40 +00:00
André Pönitz
39c7e2faf0 rename Layout_ptr into LayoutPtr
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19758 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-23 19:59:07 +00:00
Richard Heck
6e93e77f22 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
2007-08-23 16:41:13 +00:00
Martin Vermeer
e38b581bcb add preamble snippets to charstyles
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19732 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-22 18:55:03 +00:00
Martin Vermeer
612af5c5f0 inset configurability: ERT
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19702 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-21 21:29:13 +00:00
Abdelrazak Younes
0fcae6cc10 * BufferView::buffer() returns a reference instead of a pointer.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19691 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-21 13:03:55 +00:00
Abdelrazak Younes
1356543c45 The BufferView/WorkArea/LyXView reorg a.k.a Multiple WorkAreas:
* 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
2007-08-21 07:33:46 +00:00
Bo Peng
f982b5e051 Fix crash when a user removes a formula when its preview is being generated. (Another signal/destructor/gcc3 bug)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19667 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-20 21:30:33 +00:00
Martin Vermeer
f289399bf5 Inset configurability, LaTeX work
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19665 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-20 19:02:38 +00:00
Richard Heck
cd772c60a5 Biblio.{h,cpp} --> BiblioInfo.{h,cpp}
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19660 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-20 17:04:36 +00:00
Richard Heck
b3bff4232a Improvements to the citation dialog UI. It is now possible to search particular fields (author, title, etc) and to filter keys by entry types (article, book, etc).
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
2007-08-20 16:30:02 +00:00
Martin Vermeer
063a289171 small Note cleanup
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19655 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-20 04:58:29 +00:00
Martin Vermeer
5c1ffabd05 Cleanup 3: move dispatch stuff from CharStyle to Collapsable
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19654 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-20 04:56:04 +00:00
Martin Vermeer
2b927e1575 Cleanup 2: moving more stuff charstyle -> collapsable
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19648 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-19 15:45:35 +00:00
Martin Vermeer
d39896da58 Small cleanup
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19642 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-19 10:08:09 +00:00
Martin Vermeer
3c504502bf Further inset configurability, moving charstyle stuff to collapsable
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19640 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-18 23:26:07 +00:00
Martin Vermeer
dc2a40e7e9 Partial merge of CharStyle and InsetLayout stuff, first part
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19621 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-17 15:38:58 +00:00
Abdelrazak Younes
f32757e3ef * InsetCollapsable::geometry(): shut up warning by returning a dummy value and cosmetics.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19620 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-17 12:11:32 +00:00
Bo Peng
81031b4cea Fix crash when a user removes the underlying figure of a graphic inset that has been copied and pasted (Bug 4108). Revert Andel's fix r19591
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19612 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-16 18:37:38 +00:00
Martin Vermeer
f0ece382e4 Streamlining CollapseStatus stuff
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19610 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-16 16:36:50 +00:00
Jean-Marc Lasgouttes
7fe51efeb8 remove annoying debug message
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19605 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-16 12:42:56 +00:00
Jean-Marc Lasgouttes
f756c02329 The counters labelstring patch. Part 2: Use the new code.
* src/Paragraph.cpp (expandLabel): if the labelstring is empty,
	use \thecounter instead; when processing @layout@ tokens, pass the
	process_appendix boolean.

	* src/buffer_funcs.cpp (setLabel):
	* src/insets/InsetFoot.cpp (updateLabels): 
	* src/insets/InsetCaption.cpp (updateLabels): use
	Counters::theCounter.

	* src/insets/InsetBibitem.cpp: remove the ad-hoc numbering code
	and replace it with a proper updateLabels-based solution.

	* src/insets/InsetCommands.cpp (refresh): new method.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19603 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-16 11:12:56 +00:00
Richard Heck
5bb22d9498 Re-write of the BibTeX representation. The main change is that we now have
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
2007-08-16 01:59:20 +00:00
Abdelrazak Younes
bf33e34869 fix signal crash with gcc 3.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19591 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-15 15:13:22 +00:00
Abdelrazak Younes
5958daf51b Fix child document labeling (const missing from overloaded updateLabels()).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19589 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-15 12:15:16 +00:00
Abdelrazak Younes
eb14ee5e22 * Buffer.cpp: load all child documents in one go where it makes sense. This has the advantage to call updateLabels() only once for the master buffer. We can think of maintaining a child document list in the future.
* 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
2007-08-15 08:55:36 +00:00
Richard Heck
de373da67b Add LFUN_PARAGRAPH_PARAMS (= paragraph-params), used for changing a paragraph's alignment, spacing, etc. This is complementary to LFUN_PARAGRAPH_PARAMS_APPLY, which sets the parameters. The difference is that APPLY over-rides all existing parameters, setting any not given to the default, whereas this one simply changes those that are given. So
paragraph-params \align right
will align the paragraph right, leaving spacing, etc, as they were, whereas
  paragraph-params-apply \align right
will align the paragraph right but also reset all other parameters to defaults. Note, by the way, that this means that
  paragraph-params-apply
sets everything to default.

Some new arguments have also been introduced. These are:
  \indent
  \indent-toggle
  \spacing default
Of course, none of these are found in valid LyX files, but they are useful in menu bindings, etc.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19581 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-15 02:21:09 +00:00
Richard Heck
a3f613f0ca Cosmetics.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19567 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-14 17:01:22 +00:00
Richard Heck
8a221dc70c Move the lyx::biblio namespace into src/. Also make changes to how the BibTeX
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
2007-08-14 16:50:51 +00:00
Abdelrazak Younes
92ee23acb4 cosmetics
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19561 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-14 14:41:06 +00:00
Martin Vermeer
249e97e216 fixing the 580 fix also for trunk
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19559 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-14 14:21:46 +00:00
Abdelrazak Younes
32268e2632 cosmetics + move frontends/* to frontend namespace.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19553 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-14 09:54:59 +00:00
Jean-Marc Lasgouttes
b0d1a6b717 Fix bug 409 (Add support for numbered footnotes)
* src/insets/InsetFoot.cpp (updateLabels): number the footnote if
	(1) the footnote counter exists and (2) it is not in a title
	layout

	* lib/layouts/stdcounters.inc: add a footnote counter.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19524 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-13 20:29:33 +00:00
Jean-Marc Lasgouttes
eca0637e51 compilation warning
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19523 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-13 20:12:52 +00:00
Abdelrazak Younes
4e7e580f54 I forget this in rev 19515.
* InsetInclude: loadIfNeeded()
- make it non anonymous (used in loadChildDocuments()).
- now return the loaded buffer.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19520 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-13 19:40:54 +00:00
Richard Heck
236badeac0 Fix update bug when leaving a wide inset with up or down arrow.
Override notifyCursorLeaves() in InsetText to force update when
inset was wide. Should be removed if and when wide is.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19511 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-13 17:23:42 +00:00
Jean-Marc Lasgouttes
ded1c011f2 * inset/InsetTabular.cpp (doDispatch): LFUN_MOUSE_PRESS: let Text::dispatch
do the work, unless we really have a reason not to (fixes bug 4133)

	* mathed/InsetMathNest.cpp (lfunMousePress): refactor the code to use
	BufferView::mouseSetCursor.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19506 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-13 15:38:32 +00:00
Alfredo Braunstein
bc0a64efc3 * DocIterator.h (forwardPosNoDescend): remove method
* DocIterator.cpp (forwardPos, backwardPos): move the 'flat' part to...
* CursorSlice.{h,cpp} (forwardPos, backwardPos, at_end, at_begin): new methods, the first two are part of their DocIterator homonym
* Text2.cpp (setFont): receive CursorSlice arguments as the function is not recursive, adapt
* Text.cpp:
* lyxfind.cpp (findNextChange):
* insets/InsetCollapsable.cpp: adapt



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19500 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-13 13:36:19 +00:00
Alfredo Braunstein
f1923a7b35 fix compilation
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19499 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-13 13:11:49 +00:00
Martin Vermeer
2bd998c29e Prepare for inset configurability
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19498 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-13 12:13:17 +00:00
Jean-Marc Lasgouttes
601a8e0192 Rewrite the label numbering code.
* buffer_funcs.cpp (updateLabels): new function taking a buffer and
	a ParIterator as arguments. This one is used to update labels
	into an InsetText. Cleanup the code to reset depth. Call setLabel
	for each paragraph, and then updateLabel on each inset it contains.
	(setCaptionLabels, setCaptions): removed.
	(setLabel): use Counters::current_float to make caption paragraphs
	labels.

	* insets/Inset.h (updateLabels): new virtual method, empty by
	default; this numbers the inset itself (if relevant) and then all
	the paragraphs it may contain.

	* insets/InsetText.cpp (updateLabels): basically calls
	lyx::updateLabels from buffer_func.cpp.

	* insets/InsetCaption.cpp (addToToc): use the label constructed by
	updateLabels.
	(computeFullLabel): removed.
	(metrics, plaintext): don't use computeFullLabel.
	(updateLabels): new method; set the label from
	Counters::current_float.

	* insets/InsetWrap.cpp (updateLabels):
	* insets/InsetFloat.cpp (updateLabel): new method; sets
	Counters::current_float to the float type.

	* insets/InsetBranch.cpp (updateLabels): new method; the numbering
	is reset afterwards if the branch is inactive. (bug 2671)

	* insets/InsetNote.cpp (updateLabels): new method; the numbering
	is reset after the underlying InsetText has been numbered.
	(bug 2671)

	* insets/InsetTabular.cpp (updateLabels): new method (also handles
	longtable)

	* insets/InsetListings.cpp (updateLabels): new method; mimics what
	is done for Floats (although Listings are not floats technically)

	* insets/InsetInclude.cpp (getScreenLabel): in the listings case,
	use the computed label.
	(updateLabels): new method; that either renumbers the child
	document or number the current listing.

	* LyXFunc.cpp (menuNew): do not updateLabels on empty documents
	(why do we do that at all?)


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19482 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-12 21:43:58 +00:00
José Matox
ca81b43f03 Fix bug 518 (thanks to Jean Marc and Martin for the help)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19455 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-12 13:25:36 +00:00
André Pönitz
2caa98bee0 disable some tests for standard C++ features; add a line counting stream for lates output
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19446 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-12 08:57:17 +00:00
André Pönitz
5d80a87ceb merge {mathed,insets,graphics}/Makefile.am into src/Makefile.am
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19424 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-11 10:32:36 +00:00
André Pönitz
67e61a3956 enable building of shared libraries. reduces final linktime. also combine boost stuff into a single library
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19410 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-10 22:33:54 +00:00
Lars Gullik Bjønnes
5ae54ddafb Get rid of a few warnings.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19409 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-10 20:14:54 +00:00
Christian Ridderström
1050cc4471 Converted '#warning ...' into FIXME-comments
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19397 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-10 11:47:12 +00:00
Jean-Marc Lasgouttes
35fa399edd Syncronize with 1.5. This stuff was uncommitted in y tree actually.
* src/BufferView.cpp (workAreaDispatch): set selection status here

	* src/Text3.cpp (dispatch):
	* src/InsetTabular.cpp (doDispatch): and not here


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19396 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-10 10:21:09 +00:00