2006-06-20 08:39:16 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
|
|
|
* \file GuiImplementation.h
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
|
|
|
* \author John Levon
|
|
|
|
* \author Abdelrazak Younes
|
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
2006-06-26 16:55:35 +00:00
|
|
|
#ifndef GUI_H
|
|
|
|
#define GUI_H
|
2006-06-20 08:39:16 +00:00
|
|
|
|
|
|
|
#include "frontends/Gui.h"
|
|
|
|
|
2006-10-23 16:29:24 +00:00
|
|
|
#include <QObject>
|
2006-06-20 08:39:16 +00:00
|
|
|
|
|
|
|
#include <map>
|
|
|
|
|
2006-06-26 16:55:35 +00:00
|
|
|
class LyXView;
|
|
|
|
|
2006-06-20 08:39:16 +00:00
|
|
|
namespace lyx {
|
|
|
|
namespace frontend {
|
|
|
|
|
|
|
|
class GuiWorkArea;
|
2006-06-20 09:33:01 +00:00
|
|
|
class GuiView;
|
2006-06-20 08:39:16 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The GuiImplementation class is the interface to all Qt4 components.
|
|
|
|
*/
|
2006-10-23 16:29:24 +00:00
|
|
|
class GuiImplementation: public QObject, public Gui
|
2006-06-20 08:39:16 +00:00
|
|
|
{
|
2006-10-23 16:29:24 +00:00
|
|
|
Q_OBJECT
|
|
|
|
|
2006-06-20 08:39:16 +00:00
|
|
|
public:
|
2006-06-26 16:55:35 +00:00
|
|
|
GuiImplementation();
|
2006-06-20 08:39:16 +00:00
|
|
|
virtual ~GuiImplementation() {}
|
|
|
|
|
2006-10-12 22:30:42 +00:00
|
|
|
int newView();
|
2006-06-26 16:55:35 +00:00
|
|
|
LyXView& view(int id);
|
|
|
|
int newWorkArea(unsigned int width, unsigned int height, int view_id);
|
2006-06-20 08:39:16 +00:00
|
|
|
WorkArea& workArea(int id);
|
|
|
|
|
2006-10-23 16:29:24 +00:00
|
|
|
private Q_SLOTS:
|
|
|
|
///
|
|
|
|
void cleanupViews(QObject * view);
|
2006-06-26 16:55:35 +00:00
|
|
|
|
2006-06-20 08:39:16 +00:00
|
|
|
private:
|
Split clipboard and X selection
* src/LyXAction.C
(LyXAction::init): handle new LFUN_CLIPBOARD_PASTE
* src/insets/insettabular.C
(InsetTabular::doDispatch): ditto
* src/insets/insetbox.C
(InsetBox::doDispatch): ditto
* src/insets/insetert.C
(InsetERT::doDispatch): ditto
(InsetERT::getStatus): ditto
* src/insets/insetcharstyle.C
(InsetCharStyle::doDispatch): ditto
* src/BufferView_pimpl.C
(BufferView::Pimpl::selectionRequest): stuff selection, not clipboard
* src/mathed/math_nestinset.C
(MathNestInset::lfunMousePress): get stuff selection, not clipboard
(MathNestInset::lfunMouseRelease): clipboard -> selection in
commented code
* src/CutAndPaste.C
(cutSelection): ditto
* src/frontends/{qt3,gtk}/GuiImplementation.C
(GuiImplementation::newWorkArea): create new selection, not clipboard,
since the clipboard is now an object
(GuiImplementation::destroyWorkArea): destroy selection, not clipboard
* src/frontends/{qt4,qt3,gtk}/GuiSelection.h: new, copied from
GuiClipboard.h
* src/frontends/{qt4,qt3,gtk}/GuiSelection.C: new, copied from
GuiClipboard.C
* src/frontends/{qt3,gtk}/GuiImplementation.h
(selection): new accessor for selection_
(selection_): new, the global selection object
* src/frontends/{qt4,qt3,gtk}/Makefile.am: add GuiSelection.C and
GuiSelection.h
* src/frontends/{qt4,qt3,gtk}/GuiClipboard.C
(GuiClipboard::get): return clipboard, not selection
(GuiClipboard::put): stuff clipboard, not selection
* src/frontends/{qt4,qt3,gtk}/GuiClipboard.h
(haveSelection): remove (this is now in GuiSelection)
* src/frontends/{qt3,gtk}/GuiClipboard.h
(old_work_area_): remove, since it is not needed anymore
* src/frontends/gtk/ghelpers.C
(getGTKStockIcon): handle LFUN_CLIPBOARD_PASTE
* src/frontends/Clipboard.h
(haveSelection): remove (this is now in Selection)
* src/frontends/qt4/GuiImplementation.[Ch]
(GuiImplementation::selection): new accessor for selection_
* src/frontends/Gui.h
(selection): New accessor for the global selection object
* src/frontends/Selection.h; new, copied from Clipboard.h
* src/frontends/Makefile.am: add Selection.h
* src/text3.C
(various): s/clipboard().haveSelection/selection().haveSelection/
(LyXText::dispatch): handle LFUN_CLIPBOARD_PASTE
(LyXText::getStatus): ditto
* src/lfuns.h: new lfun LFUN_CLIPBOARD_PASTE
* lib/ui/stdmenus.ui: add new lfun LFUN_CLIPBOARD_PASTE
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14408 a592a061-630c-0410-9148-cb99ea01b6c8
2006-07-10 11:32:25 +00:00
|
|
|
///
|
2006-10-23 16:29:24 +00:00
|
|
|
void buildViewIds();
|
|
|
|
|
|
|
|
/// Multiple views container.
|
|
|
|
/**
|
|
|
|
* Warning: This must not be a smart pointer as the destruction of the
|
|
|
|
* object is handled by Qt when the view is closed
|
|
|
|
* \sa Qt::WA_DeleteOnClose attribute.
|
|
|
|
*/
|
|
|
|
std::map<int, GuiView *> views_;
|
|
|
|
|
|
|
|
/// Multiple workareas container.
|
|
|
|
/**
|
|
|
|
* Warning: This must not be a smart pointer as the destruction of the
|
|
|
|
* object is handled by Qt when its parent view is closed.
|
|
|
|
*/
|
|
|
|
std::map<int, GuiWorkArea *> work_areas_;
|
2006-06-20 08:39:16 +00:00
|
|
|
///
|
2006-06-26 16:55:35 +00:00
|
|
|
size_t max_view_id_;
|
2006-06-20 08:39:16 +00:00
|
|
|
///
|
2006-06-26 16:55:35 +00:00
|
|
|
size_t max_wa_id_;
|
2006-06-20 08:39:16 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
|
|
|
|
2006-06-26 16:55:35 +00:00
|
|
|
#endif // GUI_H
|