Commit Graph

187 Commits

Author SHA1 Message Date
Richard Heck
224e6ad0a3 baseclasslist --> BaseClassList singleton. Prep for further type safety.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23322 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-28 14:49:01 +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
Abdelrazak Younes
8c8ff137da Get rid of 'quitting' global variable. It is not needed anymore because all windows are closed in order now and the frontend/core is properly separated.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23280 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-27 12:30:41 +00:00
Abdelrazak Younes
8446d3dbfc Get rid of LyXFunc::closeBuffer()
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23274 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-27 11:05:58 +00:00
Richard Heck
b2475f6625 Replace boost::shared_ptr<TextClass> with a global cache of sorts of the TextClass's used by Buffers---or, more strictly, constructed by BufferParams::makeTextClass(). The action is in TextClass.{h,cpp}.
I've left the typedef in TextClassPtr.h. At the moment, it's kind of silly. But I've left it mostly because it helps to identify where the TextClass's stored in the TextClassBundle are used, and maybe it'd be worth having some sort of strong typedef like the one for BaseClassIndex here.

I need to check whether the textClass_ member of InsetCollapsable is needed now. I think not.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23232 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-25 19:31:31 +00:00
Abdelrazak Younes
0655e4d78f Should Fix crash on exit.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23218 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-25 07:32:02 +00:00
Richard Heck
4c6180d209 Try to make the distinction between base classes and text classes clearer in the code.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23198 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-24 16:59:49 +00:00
Richard Heck
69de04feac Restore Andre's TextClassIndex, but now in the form of BaseClassIndex. It seems worth distinguishing more clearly than we do at the moment between TextClass's and BaseClass's. The latter correspond to *.layout files; the former are based upon *.layout files but may be modified by modules.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23197 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-24 16:29:40 +00:00
Richard Heck
ebd4f002af Andre's s/getBaseClass/baseClass/ cleanup.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23191 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-24 15:12:41 +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
Bo Peng
1aaa96e6f1 Load local textclass in addTextClass(), reload local layout correctly in LFUN_TEXTCLASS_APPLY and LFUN_TEXTCLASS_LOAD
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23175 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-24 06:14:48 +00:00
Abdelrazak Younes
ee4dcf105a fix crash on quit with Ctr-Q. Patch by Horst Schirmeier (see http://bugzilla.lyx.org/show_bug.cgi?id=4572)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23162 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-23 18:10:52 +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
Stefan Schimanski
f5fdd7cdab * cosmetic
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23133 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-22 15:38:26 +00:00
Stefan Schimanski
1bf7b59d60 * completion infrastructure
* completion support for mathed
* experimental completion support for text


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23104 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-21 19:42:34 +00:00
Abdelrazak Younes
2a725d7c23 Introduce LFUN_CLOSE_TAB_GROUP.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23097 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-21 14:53:09 +00:00
Pavel Sanda
3d87d2f724 Squash RC warnings.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23096 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-21 14:34:41 +00:00
Abdelrazak Younes
9d40f89b58 Introducing LFUN_SPLIT_VIEW
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23084 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-20 21:46:49 +00:00
Abdelrazak Younes
f0b51ef8c9 Various small cleanup.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23064 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-19 09:10:59 +00:00
Abdelrazak Younes
2bf1c09376 header cleanup
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23049 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-18 07:14:42 +00:00
Pavel Sanda
10426cb833 Wrong status of ui-toggle. Spotted by Bennett.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22986 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-14 00:06:39 +00:00
Pavel Sanda
c6161cfdc6 Remove LFUN_FILE_NEW.
Obsoleted by LFUN_BUFFER_NEW, moreover its was currently buggy.

See http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg135371.html .


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22977 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-13 14:07:50 +00:00
Pavel Sanda
b9cf09838f Improve fullscreen capabilities ( http://bugzilla.lyx.org/show_bug.cgi?id=4146 ).
- adding frames, adding fullscreen switch.
- LFUN_MENUBAR_TOGGLE, LFUN_STATUSBAR_TOGGLE -> LFUN_UI_TOGGLE.

There are still limitations wrt Outlining in MAC OS - someone could check, 
see http://www.nabble.com/Fullscreen-mode-to15314676.html#a15367830 .




git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22893 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-09 11:58:01 +00:00
Abdelrazak Younes
28826a461c header cleanup
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22826 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-07 08:58:35 +00:00
Abdelrazak Younes
e6519eb5f6 Transfer some GUI oriented code from core to frontend.
* lyxFunc:
- doImport(): transfered to GuiView::inportDocument() together with LFUN_BUFFER_IMPORT


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22820 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-06 23:54:13 +00:00
Abdelrazak Younes
8d99df0c93 Transfer some GUI oriented code from core to frontend.
* Application/GuiApplication:
- restoreGuiSession(): new method for session restoration.

* LyXView/GuiView
- loadDocument(): new pure virtual interface

* lyxFunc:
- loadAndViewFile(): transfered to GuiView::loadDocument()
- openDocument(): transfered to GuiView.

* LyX.h
- Impl::files_to_load_ : now a simple vector<string>.
- restoreGuiSession(): removed.
- execBatchCommands(): simplified and make use of Application::restoreGuiSession().



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22816 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-06 23:02:57 +00:00
Pavel Sanda
c2e397cdee Add LFUN_MENUBAR_TOGGLE and LFUN_STATUSBAR_TOGGLE.
This partly solves the bug http://bugzilla.lyx.org/show_bug.cgi?id=4146 .


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22809 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-06 17:54:04 +00:00
Abdelrazak Younes
4b2c2f3578 header cleanup
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22750 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-02 15:48:58 +00:00
Stefan Schimanski
dd3842505b * a configuration value for the mouse wheel scrolling speed:
lyxrc.mouse_wheel_speed 


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22717 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-30 21:20:29 +00:00
Richard Heck
5bef46157c Add some comments, and change enum terminology to reflect actual purpose.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22685 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-26 20:25:25 +00:00
Richard Heck
20a5e94a86 Fix bug 4517.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22681 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-26 20:02:30 +00:00
Stefan Schimanski
8e212b98b4 * optional old-style editing mode for macros with a parameter list.
* combobox in the preferences dialog to choose the macro editing mode of choice.

The reason for the three choices (inline box, inline without box,
list) is that it seems that there are at least these three groups of
people, and each of them is very strong about their opinion what that
the best mode is. So here there are all of them, pick your favourite.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22670 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-25 22:02:38 +00:00
Stefan Schimanski
0a701fb254 * Option to make macro editing less "noisy" by hiding the grey box with the
macro name when the cursor is inside. The downside of the coin is that
you have to look into the statusbar to see which macro is used. But
some people prefer that than having the slight size change of macros
when the cursor enters.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22650 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-22 21:23:41 +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
d4dbefc749 Tiny comment.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22328 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-28 17:11:39 +00:00
Abdelrazak Younes
33eb188fb6 Add an RC setting to disable/enable the tooltips in the work area.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22313 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-26 13:52:56 +00:00
Stefan Schimanski
5caf1bb4de * Some dialogs are independent of the lyxview. Moreover it seems that
the Qt Mac application menu is handled differently such that no
  getStatus() is issued anymore later when opening it. Hence we have
  to return the correct (i.e. enable==true) value for those lfuns from
  the beginning.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22286 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-23 19:07:46 +00:00
Abdelrazak Younes
2b9153b8bc Fix navigation and bookmarks.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22255 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-22 10:19:26 +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
ddda272512 bug fix
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22228 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-21 11:22:17 +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
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
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
Abdelrazak Younes
b95a68d476 Revert 22023 and really fix bug 4410 (http://bugzilla.lyx.org/show_bug.cgi?id=4410).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22024 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-08 16:36:56 +00:00
Abdelrazak Younes
acbb1c9b8c Split LyXFunc::menuNew() into LyXView::newDocument() and buffer_funcs::newUnnamedFile().
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22002 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-07 11:57:13 +00:00