Today is a sad day, LyXView has passed over... long live GuiView!

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33393 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2010-02-09 17:06:40 +00:00
parent a932148ce4
commit d77a22e2f9
14 changed files with 51 additions and 131 deletions

View File

@ -653,7 +653,6 @@ src_frontends_header_files = Split('''
FontMetrics.h
KeyModifier.h
KeySymbol.h
LyXView.h
mouse_state.h
Painter.h
Selection.h

View File

@ -971,7 +971,7 @@ Buffer::ReadStatus Buffer::readFile(Lexer & lex, FileName const & filename,
}
// Should probably be moved to somewhere else: BufferView? LyXView?
// Should probably be moved to somewhere else: BufferView? GuiView?
bool Buffer::save() const
{
// We don't need autosaves in the immediate future. (Asger)

View File

@ -38,7 +38,6 @@ extern bool use_gui;
namespace frontend {
class Application;
class LyXView;
}
namespace graphics {
@ -55,9 +54,6 @@ public:
/// Execute LyX.
int exec(int & argc, char * argv[]);
///
frontend::LyXView * newLyXView();
private:
/// noncopyable
LyX(LyX const &);

View File

@ -1110,7 +1110,7 @@ void Server::callback(string const & msg)
// The correct solution would be to have a
// specialized (non-gui) BufferView. But how do
// we do it now? Probably we should just let it
// connect to the lyxfunc in the single LyXView we
// connect to the lyxfunc in the single GuiView we
// support currently. (Lgb)
FuncRequest const fr(lyxaction.lookupFunc(cmd), arg);

View File

@ -39,8 +39,6 @@ namespace frontend {
class Clipboard;
class FontLoader;
class Gui;
class LyXView;
class Selection;
/// The main application class
@ -59,7 +57,7 @@ initialisation should be done before the instanciation of this class.
Application (this is the frontend really, should probably be renamed).
|
LyXView-1 (one or more in case of split-view mode).
GuiView-1 (one or more in case of split-view mode).
| |
| <tab-widget-1-1>
| | |
@ -77,7 +75,7 @@ initialisation should be done before the instanciation of this class.
| |
| <tab-widget-1-2>
|
LyXView-2 (one or more in case of split-view mode).
GuiView-2 (one or more in case of split-view mode).
| |
| <tab-widget-2-1>
| | |
@ -136,14 +134,14 @@ initialisation should be done before the instanciation of this class.
- etc.
4) The Window: \c LyXView (and its qt4 specialisation \c GuiView)
4) The Window: \c GuiView
This is a full window containing a menubar, toolbars and a central
widget. A LyXView is in charge of creating and closing a View for a
widget. A GuiView is in charge of creating and closing a View for a
given Buffer.
In the qt4 specialisation, \c GuiView, the central widget is a tab
widget. Each tab is reverved to the visualisation of one Buffer and
contains one WorkArea. In the qt4 frontend, one LyXView thus contains
contains one WorkArea. In the qt4 frontend, one GuiView thus contains
multiple WorkAreas but this number can limited to one for another
frontend. The idea is that the kernel should not know how a Buffer
is displayed on screen; it's the frontend business.
@ -171,8 +169,6 @@ public:
Application() {}
///
virtual ~Application() {}
///
virtual LyXView * currentWindow() = 0;
/// LyX dispatcher: executes lyx actions and does necessary
/// screen updates depending on results.

View File

@ -1,91 +0,0 @@
// -*- C++ -*-
/**
* \file LyXView.h
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* \author Lars Gullik Bjønnes
* \author John Levon
*
* Full author contact details are available in file CREDITS.
*/
#ifndef LYXVIEW_H
#define LYXVIEW_H
#include "support/strfwd.h"
namespace lyx {
namespace support { class FileName; }
class Buffer;
class BufferView;
class Cursor;
class DispatchResult;
class FuncStatus;
class FuncRequest;
class Inset;
namespace frontend {
/**
* LyXView - main LyX window
*
* This class represents the main LyX window and provides
* accessor functions to its content.
*
* The eventual intention is that LyX will support a number
* of containing LyXViews. Currently a lot of code still
* relies on there being a single top-level view.
*
* Additionally we would like to support multiple views
* in a single LyXView.
*/
class LyXView
{
public:
///
virtual ~LyXView() {}
/// \name Generic accessor functions
//@{
/// The current BufferView refers to the BufferView that has the focus,
/// including for example the one that is created when you use the
/// advanced search and replace pane.
/// \return the currently selected buffer view.
virtual BufferView * currentBufferView() = 0;
virtual BufferView const * currentBufferView() const = 0;
/// The document BufferView always refers to the view's main document
/// BufferView. So, even if the BufferView in e.g., the advanced
/// search and replace pane has the focus.
/// \return the current document buffer view.
virtual BufferView * documentBufferView() = 0;
virtual BufferView const * documentBufferView() const = 0;
//@}
/// display a message in the view
virtual void message(docstring const &) = 0;
///
virtual bool getStatus(FuncRequest const & cmd, FuncStatus & flag) = 0;
/// dispatch command.
/// \return true if the \c FuncRequest has been dispatched.
virtual void dispatch(FuncRequest const & cmd, DispatchResult & dr) = 0;
///
virtual void restartCursor() = 0;
/// Update the completion popup and the inline completion state.
/// If \c start is true, then a new completion might be started.
/// If \c keep is true, an active completion will be kept active
/// even though the cursor moved. The update flags of \c cur might
/// be changed.
virtual void updateCompletion(Cursor & cur, bool start, bool keep) = 0;
};
} // namespace frontend
} // namespace lyx
#endif // LYXVIEW_H

View File

@ -16,7 +16,6 @@ liblyxfrontends_a_SOURCES = \
Delegates.h \
KeyModifier.h \
KeySymbol.h \
LyXView.h \
Painter.h \
Clipboard.h \
Selection.h \

View File

@ -15,7 +15,6 @@
#define BASE_WORKAREA_H
#include "frontends/KeyModifier.h"
#include "frontends/LyXView.h"
namespace lyx {

View File

@ -287,7 +287,7 @@ protected:
private:
/** The Dialog's name is the means by which a dialog identifies
* itself to the LyXView.
* itself to the GuiView.
*/
QString const name_;
///

View File

@ -826,12 +826,6 @@ docstring GuiApplication::iconName(FuncRequest const & f, bool unknown)
}
LyXView * GuiApplication::currentWindow()
{
return current_view_;
}
FuncStatus GuiApplication::getStatus(FuncRequest const & cmd) const
{
FuncStatus flag;
@ -857,7 +851,7 @@ FuncStatus GuiApplication::getStatus(FuncRequest const & cmd) const
switch (cmd.action) {
// This could be used for the no-GUI version. The GUI version is handled in
// LyXView::getStatus(). See above.
// GuiView::getStatus(). See above.
/*
case LFUN_BUFFER_WRITE:
case LFUN_BUFFER_WRITE_AS: {
@ -1082,7 +1076,7 @@ void GuiApplication::dispatch(FuncRequest const & cmd)
void GuiApplication::gotoBookmark(unsigned int idx, bool openFile, bool switchToBuffer)
{
LyXView * lv = current_view_;
GuiView * lv = current_view_;
LASSERT(lv, /**/);
if (!theSession().bookmarks().isValid(idx))
return;
@ -1551,7 +1545,7 @@ void GuiApplication::dispatch(FuncRequest const & cmd, DispatchResult & dr)
if (lv == 0)
return;
// Let the current LyXView dispatch its own actions.
// Let the current GuiView dispatch its own actions.
lv->dispatch(cmd, dr);
if (dr.dispatched() && lv )
return;

View File

@ -33,7 +33,6 @@ class KeySymbol;
namespace frontend {
class GuiView;
class LyXView;
class GlobalMenuBar;
class GuiWorkArea;
class Menus;
@ -61,7 +60,6 @@ public:
void dispatch(FuncRequest const &);
void dispatch(FuncRequest const &, DispatchResult & dr);
FuncStatus getStatus(FuncRequest const & cmd) const;
LyXView * currentWindow();
void dispatchDelayed(FuncRequest const &);
void resetGui();
void restoreGuiSession();
@ -161,7 +159,7 @@ private:
///
void setGuiLanguage();
/// This LyXView is the one receiving Clipboard and Selection
/// This GuiView is the one receiving Clipboard and Selection
/// events
GuiView * current_view_;

View File

@ -3272,7 +3272,7 @@ bool isValidName(string const & name)
void GuiView::resetDialogs()
{
// Make sure that no LFUN uses any LyXView.
// Make sure that no LFUN uses any GuiView.
guiApp->setCurrentView(0);
saveLayout();
menuBar()->clear();

View File

@ -16,7 +16,6 @@
#define GUI_VIEW_H
#include "frontends/Delegates.h"
#include "frontends/LyXView.h"
#include "support/strfwd.h"
@ -31,7 +30,15 @@ class QShowEvent;
namespace lyx {
namespace support { class FileName; }
class Buffer;
class BufferView;
class Cursor;
class DispatchResult;
class FuncStatus;
class FuncRequest;
class Inset;
namespace frontend {
@ -44,15 +51,16 @@ class TocModels;
class ToolbarInfo;
/**
* GuiView - Qt4 implementation of LyXView
* GuiView - Qt4 main LyX window
*
* qt4-private implementation of the main LyX window.
* This class represents the main LyX window and provides
* accessor functions to its content.
*
* Note: a QObject emits a destroyed(QObject *) Qt signal when it
* is deleted. This might be useful for closing other dialogs
* depending on a given GuiView.
*/
class GuiView : public QMainWindow, public LyXView, public GuiBufferViewDelegate,
class GuiView : public QMainWindow, public GuiBufferViewDelegate,
public GuiBufferDelegate
{
Q_OBJECT
@ -62,28 +70,50 @@ public:
~GuiView();
/// \name LyXView inherited methods.
//@{
int id() const { return id_; }
void setBusy(bool);
/// \name Generic accessor functions
//@{
/// The current BufferView refers to the BufferView that has the focus,
/// including for example the one that is created when you use the
/// advanced search and replace pane.
/// \return the currently selected buffer view.
BufferView * currentBufferView();
BufferView const * currentBufferView() const;
/// The document BufferView always refers to the view's main document
/// BufferView. So, even if the BufferView in e.g., the advanced
/// search and replace pane has the focus.
/// \return the current document buffer view.
BufferView * documentBufferView();
BufferView const * documentBufferView() const;
void newDocument(std::string const & filename,
bool fromTemplate);
/// display a message in the view
/// could be called from any thread
void message(docstring const &);
/// must be called from GUI thread
void updateMessage(QString const & str);
bool getStatus(FuncRequest const & cmd, FuncStatus & flag);
/// dispatch command.
/// \return true if the \c FuncRequest has been dispatched.
void dispatch(FuncRequest const & cmd, DispatchResult & dr);
void restartCursor();
/// Update the completion popup and the inline completion state.
/// If \c start is true, then a new completion might be started.
/// If \c keep is true, an active completion will be kept active
/// even though the cursor moved. The update flags of \c cur might
/// be changed.
void updateCompletion(Cursor & cur, bool start, bool keep);
///
void setFocus();
//@}
///
void focusInEvent(QFocusEvent * e);

View File

@ -117,7 +117,7 @@ public:
void setGuiView(GuiView &);
///
void setFullScreen(bool full_screen);
/// is LyXView in fullscreen mode?
/// is GuiView in fullscreen mode?
bool isFullScreen();
///
void scheduleRedraw() { schedule_redraw_ = true; }