Commit Graph

147 Commits

Author SHA1 Message Date
André Pönitz
f2c9b56fb4 cosmetics/#include cleanup
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23747 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-15 00:22:54 +00:00
Richard Heck
a01cb111a0 Change the interface to a paragraph's layout. We still store a LayoutPtr, but now privately, and make a Layout const & available to clients.
The need for a LayoutPtr arises from the fact that (a) we do not want to give our clients a Layout &, since we do not want them to be able to change our Layout; but (b) we also need to be able to change which layout is ours. So we cannot store a Layout const &. Or so it seems to the compiler.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23522 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-06 21:31:27 +00:00
Richard Heck
f401ce5d29 Changes LayoutList from a vector<LayoutPtr> to a vector<Layout>.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23519 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-06 20:01:30 +00:00
Abdelrazak Younes
a4d5b78430 Transfer and bug fix LFUN_BUFFER_BEGIN/END_SELECT to BufferView.cpp
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23512 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-06 15:39:30 +00:00
Richard Heck
592f951ba0 Kill indexing into the list of layouts.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23505 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-06 05:59:21 +00:00
Pavel Sanda
701367b4c5 Remove the rest of LFUN_THEOREM_INSERT.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23471 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-05 08:58:58 +00:00
Jean-Marc Lasgouttes
0320d29531 fix some compiler warnings
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23443 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-04 14:04:59 +00:00
Abdelrazak Younes
7cd9525197 rev 23399: the fix was not fully correct because labels are not editable.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23400 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-02 18:49:49 +00:00
Abdelrazak Younes
6bf2052227 * Outline(): fix undo/redo for promote/demote
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23379 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-02 09:17:10 +00:00
Abdelrazak Younes
6b10b7fd33 * outline(): demote/promote all subsections for outline in/out.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23378 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-02 08:53:34 +00:00
Abdelrazak Younes
78d63575ca revert revision 23324 and implement a better more general fix in Cursor::insert().
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23325 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-28 15:36:48 +00:00
Abdelrazak Younes
f6e471fc8d Fix InsetQuotes creation. Not very clean but it does the job. Andre, I think we should require the Buffer at construction for all insets that needs it. A base InsetBuffer class comes to mind.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23324 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-28 15:24:37 +00:00
Richard Heck
d8a6b5bfd0 Remove TextClassPtr without losing the type safety it provided.
See these threads:
http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg136112.html
http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg136062.html
http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg135997.html
for some background.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23299 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-28 01:42:02 +00:00
André Pönitz
1cca0a86bd API cosmetics
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23295 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-27 23:03:26 +00:00
André Pönitz
db8c16d554 progress on buffer-reference-in-insets. beware of instabilities...
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23289 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-27 20:43:16 +00:00
Richard Heck
0362c6aae7 Andre's s/getTextClass/textClass/ cleanup.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23190 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-24 15:06:35 +00:00
Richard Heck
2e7d1199df Revert 23154.
Sorry, Andre, but this broke not only the modules stuff but the general handling of TextClasses. I'm not opposed to doing this sort of thing, but it's going to be a little more complicated. I'll do it when I get a bit of time, or I can explain what the issue is here if you want to do it.

I'll separately re-commit some of the cleanup here.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23189 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-24 14:59:23 +00:00
André Pönitz
0fb8f3fba1 mostly s/Paragraph::layout(...)/Paragraph::setLayout(...)/
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23159 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-23 16:45:38 +00:00
André Pönitz
b306e9a2e1 Replace the text class shared ptr by good old index-into-global-list.
Also a few cosmetical changes where I xould not resist.

Would be nice if the 'modules people' could verify that their baby 
is strill alive... 



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23154 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-23 11:36:15 +00:00
Stefan Schimanski
8527a08903 * simplify notifyCursorLeaves logic: We now only call it from strategic
places, i.e.
  - BufferView::setMouseCursor,
  - BufferView::mouseEventDispatch
  - LyXFunc::dispatch
  Before it was called from several dispatch handlers in the middle of the
  dispatch process. Because the cursor might get invalidated, this is
  not a good idea. We had plenty of crashes and odd behaviours because
  of this as nobody really understood those cases.

  This fixes (at least) #2069 and #4163.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23140 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-22 20:45:18 +00:00
Abdelrazak Younes
2ed1153c8c Text::dispatch(): Make sure the cursor is visible before doing anything.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23127 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-22 12:22:28 +00:00
Abdelrazak Younes
6564e9bb4e Fix this bug:
1. scroll a bit so that the cursor is not visible anymore
2. hit the keyboard arrow keys to move the cursor or type something

The problem was that TextMetrics::parMetric() automatically creates a new parmetrics on const access. This was needed in the old architecture but I don't think anymore.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23126 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-22 11:07:41 +00:00
Richard Heck
a8317afc4b This is the first of a series of commits that will make InsetLayout a real class.
In this commit, we do the minimal amount of work necessary to protect our data.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23116 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-22 02:32:52 +00:00
Dov Feldstern
deb86513df Fix typing of digits in RTL text, which was broken way back during the Font/Language separation (r21240).
The problem was that when typing a digit in RTL text, the language was being 
switched to LTR, which is wrong.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23037 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-16 18:39:20 +00:00
Abdelrazak Younes
371ed5aff5 * doInsertInset(): cosmetics
* Text::dispatch(): call updateLabels() where it makes sense.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22972 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-13 12:10:18 +00:00
Richard Heck
040f3431e7 Fix bug 4037 and related problems. The patch has been cleaned up a bit
from the one posted to the list.

The basic idea has two parts. First, we hard code an "empty layout"
(called PlainLayout, for want of a better name) in TextClass and read it
before doing anything else. It can therefore be customized by classes,
if they want---say, to make it left-aligned. Second, InsetText's are
divided into three types: (i) normal ones, that use the "default" layout
defined by the text class; (ii) highly restrictive ones, such as ERT and
(not quite an inset) table cells, which demand the empty layout; (iii)
middling ones, which default to an empty layout and use the empty layout
in place of the default. (This is so we don't get the same problem we
had with ERT in e.g. footnotes.) The type of inset is signaled by new
methods InsetText::forceEmptyLayout() and InsetText::useEmptyLayout().
(The latter might better be called: useEmptyLayoutInsteadOfDefault(),
but that's silly.) The old InsetText::forceDefaultParagraphs() has been
split into these, plus a new method InsetText::allowParagraphCustomization(). 
A lot of the changes just adapt to this change.

The other big change is in GuiToolbar: We want to show LyXDefault and
the "default" layout only when they're active.

There are a handful of places where I'm not entirely sure whether we
should be using forceEmptyLayout or !allowParagraphCustomization() or
both. The InsetCaption is one of these. These places, and some others,
are marked with FIXMEs, so I'd appreciate it if people would search
through the patch and let me know whether these need changing. If they
don't, the FIXMEs can be deleted.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22966 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-12 17:31:07 +00:00
Dov Feldstern
11a6b3c4c7 visual mode for bidi cursor movement
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22929 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-10 19:52:45 +00:00
Abdelrazak Younes
bd8cba506f * doInsertInset(): return early.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22891 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-09 10:45:49 +00:00
André Pönitz
225bf49cf9 some refactoring.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22890 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-09 10:41:49 +00:00
Stefan Schimanski
cf333f5ab4 * Support for graphics pasting (with most code in the frontend's GuiClipboard)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22762 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-03 10:43:03 +00:00
Stefan Schimanski
f85fccef65 * newlyxcommand support as LaTeX feature
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22281 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-23 16:32:00 +00:00
Stefan Schimanski
36dbec4506 * Lazy MathData to avoid unneeded interpretation of macro definitions
* DocIterator as MacroPosition
* Iterative search for macro in scope until a visible one is found.
This include the ability to resolve macro inside nested text insets.
* Speed up macro lookups by factor 2: only getMacro(name) call, no
further hasMacro(name) call before
* Both way child/master support
* Correct macro scope for multi-paragraph environments
* Correct macro scope for multi-depth-paragraphs
* Buffer::updateMacros made const
* Update macros when loaded (of master and child)
* Do not remove too many braces when unfolding a macro. This could
lead to a data loss because the relationship between arguments of
macros can be mixed up if nested macros are unfold at once.
* Reduce dependencies to MetricsInfo in MathMacro   
* Update macros when needed. Normally it's done just before doing
metrics. But in cases without a brace around some constructs (like
\left(bla\right)) there is some help needed.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22241 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-21 20:42:46 +00:00
Abdelrazak Younes
96d2d6fc50 * LyXFunc::dispatch(): invert BufferView::dispatch() and cursor::dispatch() calling.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22227 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-21 10:42:59 +00:00
Bo Peng
8d7ea1ceaa Add buffer name/path/class to InsetInfo
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22213 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-19 18:09:00 +00:00
Jürgen Spitzmüller
8672364e1e * fix bug 4055, overdue patch from Stefan Schimanski:
"The idea of the beforeDispX/Y_ variables in the Cursor is to hold the position
of the cursor on screen before the lyxfunc is dispatched. But to get this the
metrics must be valid. It's updated in Cursor::dispatch before the dispatch
loop.
After inserting/deleting stuff (like when deleting the selected text before
inserting the alpha) the metrics are invalid. But the handler for the alpha
calls Cursor::dispatch after the deletion and hence the crash with your second
patch.

Here is a patch fixing that:

The beforeDispatchXY variable do not belong into the Cursor::dispatch because
Cursor::dispatch is often called "manually" by many handlers to some followup
action. So this logic must go somewhere else where it is sure that is not
updated after the metrics got invalidated."

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22193 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-17 18:13:02 +00:00
Abdelrazak Younes
e7bb71ff4e header cleanup.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22178 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-16 22:09:28 +00:00
Abdelrazak Younes
7c392af6ea getting rid of superfluous lyx::support:: statements.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22106 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-12 19:57:42 +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
Jürgen Spitzmüller
61e1643821 Support for \slash and \nobreakdash-
* src/lfuns.h:
* src/Text3.cpp:
* src/insets/InsetMathNest.cpp:
* src/insets/insetCollapsable:
	- new LFUN_SPECIALCHAR_INSERT
	- nuke LFUN_HYPHENATION_POINT_INSERT, 
	  LFUN_LIGATURE_BREAK_INSERT,
	  LFUN_DOTS_INSERT,
               LFUN_END_OF_SENTENCE_PERIOD_INSERT,
	  LFUN_MENU_SEPARATOR_INSERT
	  (functions now handled as arguments of the above)

* src/insets/InsetSpecialChar.{cpp,h}:
	- implement \slash and \nobreakdash-

* src/Buffer.cpp:
	- increment format to 307.
* lib/lyx2lyx/LyX.py:
* lib/lyx2lyx/lyx_1_6.py:
	- reversion methods for SpecialChar \slash{} and
	  SpecialChar \nobreakdash-
* development/FORMAT:
	- document file format change

* lib/ui/stdmenus.inc:
* lib/ui/classic.ui:
	- add new SpecialChars to the menus, adapt lfuns to new scheme

* lib/bind/aqua.bind:
* lib/bind/cua.bind:
* lib/bind/emacs.bind:
* lib/bind/fi/menus.bind:
* lib/bind/mac.bind:
* lib/bind/menus.bind:
* lib/bind/sciword.bind:
* lib/bind/xemacs.bind:
	- add shortcuts for new SpecialChars, adapt lfuns to new scheme

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21989 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-06 11:04:56 +00:00
André Pönitz
2506e0d643 assimilate BOOST_CURRENT_FUNCTION
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21867 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-29 21:10:35 +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
Uwe Stöhr
12f7869ac0 support for \linebreak:
- fileformat change
- tex2lyx support
- rename LFUN_BREAK_LINE to LFUN_NEW_LINE because this is what the lfun does and to avoid confusions
- new menu entry
- new shortcut C-S-Return

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21778 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-25 18:34:37 +00:00
Uwe Stöhr
97aa558cac support for \pagebreak:
- rename former "pagebreak" to "newpage" since it produces a \newpage
- new LFUN
- menu entry
- tex2lyx support
- fileformat change


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21732 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-23 02:10:00 +00:00
André Pönitz
d5fc2425a9 consolidate showDialog() incarnations
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21662 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-18 00:39:15 +00:00
Abdelrazak Younes
bdf33a2a32 Fix mouse selection drawing by brute force.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21655 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-17 18:17:19 +00:00
Abdelrazak Younes
926abae753 Simplify single par drawing:
* ParagraphMetrics::computeRowSignature(): Integrate row's dimensions and selection status in the row signature.
* TextMetrics::drawParagraph(): compute the row signature here and rely on that to decide if a redraw is needed or not.
* BufferView::Private: get rid of the ViewMetricsInfo member. Just keep the ScreenUpdateStrategy.
* BufferView::draw(): full screen update even for singlePar case because the row signature will detect if something needs to be redrawn.
* Text3.cpp: get rid of hack following architecture update.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21650 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-17 11:27:03 +00:00
André Pönitz
e1ce2f92db reduce line noise
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21631 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-15 20:04:51 +00:00
Abdelrazak Younes
f46454fb7a Avoid unnecessary redraw when selecting text.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21629 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-15 18:01:04 +00:00