QtView renamed to GuiView

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14154 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2006-06-20 09:33:01 +00:00
parent c7d3458f99
commit d46add7754
13 changed files with 61 additions and 61 deletions

View File

@ -12,14 +12,14 @@
#include "GuiImplementation.h" #include "GuiImplementation.h"
#include "GuiWorkArea.h" #include "GuiWorkArea.h"
#include "QtView.h" #include "GuiView.h"
using boost::shared_ptr; using boost::shared_ptr;
namespace lyx { namespace lyx {
namespace frontend { namespace frontend {
GuiImplementation::GuiImplementation(QtView & owner): owner_(owner), max_id_(0) GuiImplementation::GuiImplementation(GuiView & owner): owner_(owner), max_id_(0)
{ {
} }

View File

@ -24,7 +24,7 @@ namespace lyx {
namespace frontend { namespace frontend {
class GuiWorkArea; class GuiWorkArea;
class QtView; class GuiView;
/** /**
* The GuiImplementation class is the interface to all Qt4 components. * The GuiImplementation class is the interface to all Qt4 components.
@ -32,7 +32,7 @@ class QtView;
class GuiImplementation: public Gui class GuiImplementation: public Gui
{ {
public: public:
GuiImplementation(QtView & owner); GuiImplementation(GuiView & owner);
virtual ~GuiImplementation() {} virtual ~GuiImplementation() {}
Clipboard& clipboard(); Clipboard& clipboard();
@ -47,7 +47,7 @@ private:
/// ///
std::map<int, boost::shared_ptr<GuiWorkArea> > work_areas_; std::map<int, boost::shared_ptr<GuiWorkArea> > work_areas_;
/// ///
QtView & owner_; GuiView & owner_;
/// ///
size_t max_id_; size_t max_id_;
}; };

View File

@ -1,5 +1,5 @@
/** /**
* \file QtView.C * \file GuiView.C
* This file is part of LyX, the document processor. * This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING. * Licence details can be found in the file COPYING.
* *
@ -33,7 +33,7 @@
#include "support/convert.h" #include "support/convert.h"
#include <boost/bind.hpp> #include <boost/bind.hpp>
#include "QtView.h" #include "GuiView.h"
#include "QLMenubar.h" #include "QLMenubar.h"
#include "FontLoader.h" #include "FontLoader.h"
#include "QCommandBuffer.h" #include "QCommandBuffer.h"
@ -70,7 +70,7 @@ int const statusbar_timer_value = 3000;
} // namespace anon } // namespace anon
QtView::QtView(unsigned int width, unsigned int height) GuiView::GuiView(unsigned int width, unsigned int height)
: QMainWindow(), LyXView(), commandbuffer_(0), frontend_(*this) : QMainWindow(), LyXView(), commandbuffer_(0), frontend_(*this)
{ {
mainWidget_ = this; mainWidget_ = this;
@ -87,7 +87,7 @@ QtView::QtView(unsigned int width, unsigned int height)
statusBar()->setSizeGripEnabled(false); statusBar()->setSizeGripEnabled(false);
view_state_changed.connect(boost::bind(&QtView::update_view_state, this)); view_state_changed.connect(boost::bind(&GuiView::update_view_state, this));
connect(&statusbar_timer_, SIGNAL(timeout()), this, SLOT(update_view_state_qt())); connect(&statusbar_timer_, SIGNAL(timeout()), this, SLOT(update_view_state_qt()));
#ifndef Q_WS_MACX #ifndef Q_WS_MACX
@ -103,31 +103,31 @@ QtView::QtView(unsigned int width, unsigned int height)
} }
QtView::~QtView() GuiView::~GuiView()
{ {
} }
void QtView::updateMenu(QAction *action) void GuiView::updateMenu(QAction *action)
{ {
menubar_->update(); menubar_->update();
} }
void QtView::setWindowTitle(string const & t, string const & it) void GuiView::setWindowTitle(string const & t, string const & it)
{ {
QMainWindow::setWindowTitle(toqstr(t)); QMainWindow::setWindowTitle(toqstr(t));
QMainWindow::setWindowIconText(toqstr(it)); QMainWindow::setWindowIconText(toqstr(it));
} }
void QtView::addCommandBuffer(QToolBar * toolbar) void GuiView::addCommandBuffer(QToolBar * toolbar)
{ {
commandbuffer_ = new QCommandBuffer(this, *controlcommand_); commandbuffer_ = new QCommandBuffer(this, *controlcommand_);
focus_command_buffer.connect(boost::bind(&QtView::focus_command_widget, this)); focus_command_buffer.connect(boost::bind(&GuiView::focus_command_widget, this));
toolbar->addWidget(commandbuffer_); toolbar->addWidget(commandbuffer_);
} }
void QtView::message(string const & str) void GuiView::message(string const & str)
{ {
statusBar()->showMessage(toqstr(str)); statusBar()->showMessage(toqstr(str));
statusbar_timer_.stop(); statusbar_timer_.stop();
@ -135,27 +135,27 @@ void QtView::message(string const & str)
} }
void QtView::clearMessage() void GuiView::clearMessage()
{ {
update_view_state_qt(); update_view_state_qt();
} }
void QtView::focus_command_widget() void GuiView::focus_command_widget()
{ {
if (commandbuffer_) if (commandbuffer_)
commandbuffer_->focus_command(); commandbuffer_->focus_command();
} }
void QtView::update_view_state_qt() void GuiView::update_view_state_qt()
{ {
statusBar()->showMessage(toqstr(getLyXFunc().viewStatusMessage())); statusBar()->showMessage(toqstr(getLyXFunc().viewStatusMessage()));
statusbar_timer_.stop(); statusbar_timer_.stop();
} }
void QtView::update_view_state() void GuiView::update_view_state()
{ {
// let the user see the explicit message // let the user see the explicit message
if (statusbar_timer_.isActive()) if (statusbar_timer_.isActive())
@ -165,19 +165,19 @@ void QtView::update_view_state()
} }
void QtView::activated(FuncRequest const & func) void GuiView::activated(FuncRequest const & func)
{ {
getLyXFunc().dispatch(func); getLyXFunc().dispatch(func);
} }
bool QtView::hasFocus() const bool GuiView::hasFocus() const
{ {
return qApp->activeWindow() == this; return qApp->activeWindow() == this;
} }
void QtView::closeEvent(QCloseEvent *) void GuiView::closeEvent(QCloseEvent *)
{ {
QRect geometry = normalGeometry(); QRect geometry = normalGeometry();
Session & session = LyX::ref().session(); Session & session = LyX::ref().session();
@ -195,14 +195,14 @@ void QtView::closeEvent(QCloseEvent *)
} }
void QtView::show() void GuiView::show()
{ {
QMainWindow::setWindowTitle(qt_("LyX")); QMainWindow::setWindowTitle(qt_("LyX"));
QMainWindow::show(); QMainWindow::show();
} }
void QtView::busy(bool yes) const void GuiView::busy(bool yes) const
{ {
if (yes) if (yes)
QApplication::setOverrideCursor(Qt::WaitCursor); QApplication::setOverrideCursor(Qt::WaitCursor);
@ -210,15 +210,15 @@ void QtView::busy(bool yes) const
QApplication::restoreOverrideCursor(); QApplication::restoreOverrideCursor();
} }
QMainWindow* QtView::mainWidget() QMainWindow* GuiView::mainWidget()
{ {
return mainWidget_; return mainWidget_;
} }
QMainWindow* QtView::mainWidget_ = 0; QMainWindow* GuiView::mainWidget_ = 0;
} // namespace frontend } // namespace frontend
} // namespace lyx } // namespace lyx
#include "QtView_moc.cpp" #include "GuiView_moc.cpp"

View File

@ -1,6 +1,6 @@
// -*- C++ -*- // -*- C++ -*-
/** /**
* \file QtView.h * \file GuiView.h
* This file is part of LyX, the document processor. * This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING. * Licence details can be found in the file COPYING.
* *
@ -11,8 +11,8 @@
* Full author contact details are available in file CREDITS. * Full author contact details are available in file CREDITS.
*/ */
#ifndef QTVIEW_H #ifndef GUIVIEW_H
#define QTVIEW_H #define GUIVIEW_H
// Must be here because of moc. // Must be here because of moc.
#include <config.h> #include <config.h>
@ -41,17 +41,17 @@ class QCommandBuffer;
QWidget* mainWindow(); QWidget* mainWindow();
/** /**
* QtView - Qt implementation of LyXView * GuiView - Qt4 implementation of LyXView
* *
* Qt-private implementation of the main LyX window. * Qt-private implementation of the main LyX window.
*/ */
class QtView : public QMainWindow, public LyXView { class GuiView : public QMainWindow, public LyXView {
Q_OBJECT Q_OBJECT
public: public:
/// create a main window of the given dimensions /// create a main window of the given dimensions
QtView(unsigned int w, unsigned int h); GuiView(unsigned int w, unsigned int h);
~QtView(); ~GuiView();
/// show - display the top-level window /// show - display the top-level window
void show(); void show();
@ -117,4 +117,4 @@ private:
} // namespace frontend } // namespace frontend
} // namespace lyx } // namespace lyx
#endif // QTVIEW_H #endif // GUIVIEW_H

View File

@ -16,7 +16,7 @@
#include "GuiWorkArea.h" #include "GuiWorkArea.h"
#include "QLPainter.h" #include "QLPainter.h"
#include "QLyXKeySym.h" #include "QLyXKeySym.h"
#include "QtView.h" #include "GuiView.h"
#include "ColorCache.h" #include "ColorCache.h"
#include "qt_helpers.h" #include "qt_helpers.h"
@ -112,12 +112,12 @@ SyntheticMouseEvent::SyntheticMouseEvent()
GuiWorkArea::GuiWorkArea(LyXView & owner, int w, int h) GuiWorkArea::GuiWorkArea(LyXView & owner, int w, int h)
: QAbstractScrollArea(QtView::mainWidget()), WorkArea(owner, w, h), view_(owner), painter_(this) : QAbstractScrollArea(GuiView::mainWidget()), WorkArea(owner, w, h), view_(owner), painter_(this)
{ {
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
QtView::mainWidget()->setCentralWidget(this); GuiView::mainWidget()->setCentralWidget(this);
setAcceptDrops(true); setAcceptDrops(true);

View File

@ -12,7 +12,7 @@
// Qt defines a macro 'signals' that clashes with a boost namespace. // Qt defines a macro 'signals' that clashes with a boost namespace.
// All is well if the namespace is visible first. // All is well if the namespace is visible first.
#include "QtView.h" #include "GuiView.h"
#include "QCommandBuffer.h" #include "QCommandBuffer.h"
#include "QCommandEdit.h" #include "QCommandEdit.h"
@ -74,7 +74,7 @@ protected:
} // end of anon } // end of anon
QCommandBuffer::QCommandBuffer(QtView * view, ControlCommandBuffer & control, QWidget * parent) QCommandBuffer::QCommandBuffer(GuiView * view, ControlCommandBuffer & control, QWidget * parent)
: QWidget(parent), view_(view), controller_(control) : QWidget(parent), view_(view), controller_(control)
{ {
QPixmap qpup(toqstr(libFileSearch("images", "up", "xpm"))); QPixmap qpup(toqstr(libFileSearch("images", "up", "xpm")));

View File

@ -20,13 +20,13 @@ namespace lyx {
namespace frontend { namespace frontend {
class QCommandEdit; class QCommandEdit;
class QtView; class GuiView;
class ControlCommandBuffer; class ControlCommandBuffer;
class QCommandBuffer : public QWidget { class QCommandBuffer : public QWidget {
Q_OBJECT Q_OBJECT
public: public:
QCommandBuffer(QtView * view, ControlCommandBuffer & control, QWidget * parent=NULL); QCommandBuffer(GuiView * view, ControlCommandBuffer & control, QWidget * parent=NULL);
/// focus the edit widget /// focus the edit widget
void focus_command(); void focus_command();
@ -45,7 +45,7 @@ public slots:
void down(); void down();
private: private:
/// owning view /// owning view
QtView * view_; GuiView * view_;
/// controller /// controller
ControlCommandBuffer & controller_; ControlCommandBuffer & controller_;

View File

@ -12,7 +12,7 @@
// Qt defines a macro 'signals' that clashes with a boost namespace. // Qt defines a macro 'signals' that clashes with a boost namespace.
// All is well if the namespace is visible first. // All is well if the namespace is visible first.
#include "QtView.h" #include "GuiView.h"
#include "QLMenubar.h" #include "QLMenubar.h"
#include "QLPopupMenu.h" #include "QLPopupMenu.h"
@ -43,7 +43,7 @@ namespace frontend {
// MacOSX specific stuff is at the end. // MacOSX specific stuff is at the end.
QLMenubar::QLMenubar(LyXView * view, MenuBackend & mbe) QLMenubar::QLMenubar(LyXView * view, MenuBackend & mbe)
: owner_(static_cast<QtView*>(view)), menubackend_(mbe) : owner_(static_cast<GuiView*>(view)), menubackend_(mbe)
{ {
macxMenuBarInit(); macxMenuBarInit();
@ -114,7 +114,7 @@ void QLMenubar::openByName(string const & name)
void QLMenubar::update() void QLMenubar::update()
{ } { }
QtView * QLMenubar::view() GuiView * QLMenubar::view()
{ {
return owner_; return owner_;
} }

View File

@ -33,7 +33,7 @@ namespace lyx {
namespace frontend { namespace frontend {
class QtView; class GuiView;
class QLMenubar : public QObject, public Menubar { class QLMenubar : public QObject, public Menubar {
Q_OBJECT Q_OBJECT
@ -44,7 +44,7 @@ public:
void openByName(std::string const &); void openByName(std::string const &);
/// return the owning view /// return the owning view
QtView * view(); GuiView * view();
/// return the menu controller /// return the menu controller
MenuBackend const & backend(); MenuBackend const & backend();
@ -64,7 +64,7 @@ private:
void macxMenuBarInit(); void macxMenuBarInit();
/// owning view /// owning view
QtView * owner_; GuiView * owner_;
/// menu controller /// menu controller
MenuBackend & menubackend_; MenuBackend & menubackend_;

View File

@ -15,7 +15,7 @@
// Qt defines a macro 'signals' that clashes with a boost namespace. // Qt defines a macro 'signals' that clashes with a boost namespace.
// All is well if the namespace is visible first. // All is well if the namespace is visible first.
#include "QtView.h" #include "GuiView.h"
#include "Action.h" #include "Action.h"
#include "QLPopupMenu.h" #include "QLPopupMenu.h"

View File

@ -24,7 +24,7 @@
#include "gettext.h" #include "gettext.h"
#include "lyxfunc.h" #include "lyxfunc.h"
#include "QtView.h" #include "GuiView.h"
#include "QLToolbar.h" #include "QLToolbar.h"
#include "Action.h" #include "Action.h"
#include "qt_helpers.h" #include "qt_helpers.h"
@ -81,7 +81,7 @@ Qt::ToolBarArea getToolBarPosition(ToolbarBackend::Flags const & flags)
} // namespace anon } // namespace anon
QLayoutBox::QLayoutBox(QToolBar * toolbar, QtView & owner) QLayoutBox::QLayoutBox(QToolBar * toolbar, GuiView & owner)
: owner_(owner) : owner_(owner)
{ {
combo_ = new QComboBox; combo_ = new QComboBox;
@ -189,7 +189,7 @@ namespace lyx {
namespace frontend { namespace frontend {
QLToolbar::QLToolbar(ToolbarBackend::Toolbar const & tbb, LyXView & owner) QLToolbar::QLToolbar(ToolbarBackend::Toolbar const & tbb, LyXView & owner)
: owner_(dynamic_cast<QtView &>(owner)), : owner_(dynamic_cast<GuiView &>(owner)),
toolbar_(new QToolBar(qt_(tbb.gui_name), (QWidget*) &owner_)) //, getPosition(tbb.flags))) toolbar_(new QToolBar(qt_(tbb.gui_name), (QWidget*) &owner_)) //, getPosition(tbb.flags)))
{ {
/// \toto Move \a addToolBar call into QView because, in Qt4, /// \toto Move \a addToolBar call into QView because, in Qt4,

View File

@ -29,14 +29,14 @@ namespace lyx {
namespace frontend { namespace frontend {
class QLayoutBox; class QLayoutBox;
class QtView; class GuiView;
class Action; class Action;
class QLayoutBox : public QObject, public LayoutBox { class QLayoutBox : public QObject, public LayoutBox {
Q_OBJECT Q_OBJECT
public: public:
QLayoutBox(QToolBar *, QtView &); QLayoutBox(QToolBar *, GuiView &);
/// select the right layout in the combox. /// select the right layout in the combox.
void set(std::string const & layout); void set(std::string const & layout);
@ -54,7 +54,7 @@ private slots:
private: private:
QComboBox * combo_; QComboBox * combo_;
QtView & owner_; GuiView & owner_;
}; };
@ -77,7 +77,7 @@ signals:
private: private:
std::vector<Action *> ActionVector; std::vector<Action *> ActionVector;
QtView & owner_; GuiView & owner_;
QToolBar * toolbar_; QToolBar * toolbar_;
boost::scoped_ptr<QLayoutBox> layout_; boost::scoped_ptr<QLayoutBox> layout_;

View File

@ -39,7 +39,7 @@
#include <boost/bind.hpp> #include <boost/bind.hpp>
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include "QtView.h" #include "GuiView.h"
#include "ColorCache.h" #include "ColorCache.h"
#include "FontLoader.h" #include "FontLoader.h"
#include "QLImage.h" #include "QLImage.h"
@ -59,7 +59,7 @@
using lyx::support::ltrim; using lyx::support::ltrim;
using lyx::support::package; using lyx::support::package;
using lyx::frontend::QtView; using lyx::frontend::GuiView;
using lyx::frontend::Application; using lyx::frontend::Application;
namespace os = lyx::support::os; namespace os = lyx::support::os;
@ -194,10 +194,10 @@ void start(string const & batch, vector<string> const & files,
// this can't be done before because it needs the Languages object // this can't be done before because it needs the Languages object
initEncodings(); initEncodings();
boost::shared_ptr<QtView> view_ptr(new QtView(width, height)); boost::shared_ptr<GuiView> view_ptr(new GuiView(width, height));
LyX::ref().addLyXView(view_ptr); LyX::ref().addLyXView(view_ptr);
QtView & view = *view_ptr.get(); GuiView & view = *view_ptr.get();
view.init(); view.init();