mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-11 21:49:51 +00:00
f4857dab04
* LyXFunc: - dispatch(): transfer assertion on lyx_view_ to each LFUN on a case by case basis. - dispatch(): new LFUN_WINDOW_CLOSE - getStatus(): special treatment for LFUN_LYX_QUIT * LyX: - views_, addLyXView(): deleted - quit(): call saveGeometry() on each LyXView before exiting. * GuiApplication: - is now a QObject. - quitLyX(): new Qt slot for lastWindowClosed signal. * Gui.h: - destroyView(), destroyWorkArea(): deleted - viewIds(): new method * GuiImplementation: - implement above changes. - GuiImplementation is now a QObject - cleanupViews(): new private slot. - buildViewIds(): new helper method - views_ and work_areas_ are now maps of raw pointers instead of schared_ptr. * LyXView - now stores its id. - dispatch(): special treatment for LFUN_WINDOW_CLOSE. - workAreaIds(): new method. - close(): new pure virtual method. - saveGeometry(): new pure virtual method. * GuiView: - implements above changes. - GuiView(): set WA_DeleteOnClose and Qt::WA_QuitOnClose to let Qt manage the destruction on close(). - closeEvent(): session stuff transfered to saveGeometry() * WorkArea - now store its id. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15514 a592a061-630c-0410-9148-cb99ea01b6c8
64 lines
1.1 KiB
C++
64 lines
1.1 KiB
C++
// -*- C++ -*-
|
|
/**
|
|
* \file Gui.h
|
|
* This file is part of LyX, the document processor.
|
|
* Licence details can be found in the file COPYING.
|
|
*
|
|
* \author unknown
|
|
* \author John Levon
|
|
* \author Abdelrazak Younes
|
|
*
|
|
* Full author contact details are available in file CREDITS.
|
|
*/
|
|
|
|
#ifndef BASE_GUI_H
|
|
#define BASE_GUI_H
|
|
|
|
#include <boost/shared_ptr.hpp>
|
|
|
|
#include <map>
|
|
#include <vector>
|
|
|
|
namespace lyx {
|
|
|
|
class LyXView;
|
|
class BufferView;
|
|
|
|
namespace frontend {
|
|
|
|
class WorkArea;
|
|
|
|
|
|
/**
|
|
* A Gui class manages the different frontend elements.
|
|
*/
|
|
class Gui
|
|
{
|
|
public:
|
|
virtual ~Gui() {}
|
|
|
|
///
|
|
virtual int newView() = 0;
|
|
///
|
|
virtual LyXView & view(int id) = 0;
|
|
|
|
///
|
|
virtual int newWorkArea(unsigned int width, unsigned int height, int view_id) = 0;
|
|
///
|
|
virtual WorkArea & workArea(int id) = 0;
|
|
|
|
///
|
|
std::vector<int> const & viewIds() { return view_ids_; };
|
|
|
|
protected:
|
|
/// view of a buffer. Eventually there will be several.
|
|
std::map<int, boost::shared_ptr<BufferView> > buffer_views_;
|
|
|
|
std::vector<int> view_ids_;
|
|
};
|
|
|
|
} // namespace frontend
|
|
} // namespace lyx
|
|
|
|
#endif // BASE_GUI_H
|