From 978f65391e03cf36710527145c6c99d10474a1cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Wed, 19 Sep 2007 22:37:22 +0000 Subject: [PATCH] reduce #includes git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20363 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/BufferParams.h | 3 +-- src/CutAndPaste.cpp | 1 - src/CutAndPaste.h | 2 +- src/LyXFunc.cpp | 23 ++++++++++++----------- src/LyXFunc.h | 2 +- src/Makefile.am | 1 - src/ServerSocket.h | 2 +- src/TextClass.h | 6 ++++++ src/TextClassPtr.h | 28 ---------------------------- src/frontends/LyXView.h | 10 +++++----- src/frontends/Toolbars.cpp | 2 +- src/frontends/Toolbars.h | 2 +- src/frontends/qt4/GuiPopupMenu.cpp | 5 ++--- src/frontends/qt4/GuiToolbar.cpp | 6 ++++-- src/frontends/qt4/GuiView.cpp | 4 ++-- src/frontends/qt4/GuiView.h | 2 +- 16 files changed, 38 insertions(+), 61 deletions(-) delete mode 100644 src/TextClassPtr.h diff --git a/src/BufferParams.h b/src/BufferParams.h index ec3ed4e9bf..62a481961d 100644 --- a/src/BufferParams.h +++ b/src/BufferParams.h @@ -17,7 +17,6 @@ #include "BiblioInfo.h" #include "TextClass.h" -#include "TextClassPtr.h" #include "paper.h" #include "insets/InsetQuotes.h" @@ -106,7 +105,7 @@ public: ///by modules. TextClass const & getTextClass() const; ///Returns a pointer to the TextClass currently in use: the BaseClass - ///as modified by modules. (See \file TextClassPtr.h for the typedef.) + ///as modified by modules. (See \file TextClass.h for the typedef.) TextClassPtr getTextClassPtr() const; ///Set the LyX TextClass---layout file---this document is using. ///This does NOT call makeTextClass() and so should be used with diff --git a/src/CutAndPaste.cpp b/src/CutAndPaste.cpp index 7d8bf1d313..20fafc2a25 100644 --- a/src/CutAndPaste.cpp +++ b/src/CutAndPaste.cpp @@ -30,7 +30,6 @@ #include "LyXFunc.h" #include "LyXRC.h" #include "Text.h" -#include "TextClassPtr.h" #include "TextClassList.h" #include "Paragraph.h" #include "paragraph_funcs.h" diff --git a/src/CutAndPaste.h b/src/CutAndPaste.h index 4a1c68dbea..ff7aacd261 100644 --- a/src/CutAndPaste.h +++ b/src/CutAndPaste.h @@ -15,7 +15,7 @@ #define CUTANDPASTE_H #include "support/docstring.h" -#include "TextClassPtr.h" +#include "TextClass.h" #include diff --git a/src/LyXFunc.cpp b/src/LyXFunc.cpp index d0826210b9..8bdc6216f0 100644 --- a/src/LyXFunc.cpp +++ b/src/LyXFunc.cpp @@ -23,12 +23,14 @@ #include "LyXFunc.h" #include "BranchList.h" -#include "Buffer.h" #include "buffer_funcs.h" +#include "Buffer.h" #include "BufferList.h" #include "BufferParams.h" -#include "BufferView.h" #include "bufferview_funcs.h" +#include "BufferView.h" +#include "callback.h" +#include "Color.h" #include "Cursor.h" #include "CutAndPaste.h" #include "debug.h" @@ -45,21 +47,20 @@ #include "Intl.h" #include "KeyMap.h" #include "Language.h" -#include "Color.h" -#include "Session.h" -#include "LyX.h" -#include "callback.h" +#include "Lexer.h" #include "LyXAction.h" #include "lyxfind.h" -#include "Lexer.h" +#include "LyX.h" #include "LyXRC.h" -#include "Row.h" -#include "Server.h" -#include "TextClassList.h" #include "LyXVC.h" #include "Paragraph.h" -#include "ParIterator.h" #include "ParagraphParameters.h" +#include "ParIterator.h" +#include "Row.h" +#include "Server.h" +#include "Session.h" +#include "TextClassList.h" +#include "ToolbarBackend.h" #include "Undo.h" #include "insets/InsetBox.h" diff --git a/src/LyXFunc.h b/src/LyXFunc.h index 84dc9c58fd..56c5f7cf7e 100644 --- a/src/LyXFunc.h +++ b/src/LyXFunc.h @@ -17,7 +17,7 @@ #include "KeySequence.h" #include "lfuns.h" -#include "TextClassPtr.h" +#include "TextClass.h" #include "support/docstring.h" diff --git a/src/Makefile.am b/src/Makefile.am index bf1af936ba..df2a355c13 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -254,7 +254,6 @@ liblyxcore_la_SOURCES = \ Text3.cpp \ TextClass.cpp \ TextClass.h \ - TextClass_ptr.h \ TextClassList.cpp \ TextClassList.h \ TextMetrics.cpp \ diff --git a/src/ServerSocket.h b/src/ServerSocket.h index 0678d6dbfd..da98ebe916 100644 --- a/src/ServerSocket.h +++ b/src/ServerSocket.h @@ -16,7 +16,6 @@ #include "support/FileName.h" #include "support/socktools.h" -#include "LyXFunc.h" #include @@ -27,6 +26,7 @@ namespace lyx { class LyXDataSocket; +class LyXFunc; /** Sockets can be in two states: listening and connected. diff --git a/src/TextClass.h b/src/TextClass.h index d9a13e84c4..951d9a8aae 100644 --- a/src/TextClass.h +++ b/src/TextClass.h @@ -275,6 +275,12 @@ private: /// convert page sides option to text 1 or 2 std::ostream & operator<<(std::ostream & os, TextClass::PageSides p); +/** Shared pointer for possibly modular layout. Needed so that paste, + * for example, will still be able to retain the pointer, even when + * the buffer itself is closed. + */ +typedef boost::shared_ptr TextClassPtr; + } // namespace lyx diff --git a/src/TextClassPtr.h b/src/TextClassPtr.h deleted file mode 100644 index 6ff307c3b9..0000000000 --- a/src/TextClassPtr.h +++ /dev/null @@ -1,28 +0,0 @@ -// -*- C++ -*- -/** - * \file TextClass_ptr.h - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author Richard Heck - * - * Full author contact details are available in file CREDITS. - */ - -#ifndef TEXTCLASS_PTR_H -#define TEXTCLASS_PTR_H - -#include - -namespace lyx { - -class TextClass; - -/** Shared pointer for possibly modular layout. Needed so that paste, - * for example, will still be able to retain the pointer, even when - * the buffer itself is closed. - */ -typedef boost::shared_ptr TextClassPtr; - -} -#endif diff --git a/src/frontends/LyXView.h b/src/frontends/LyXView.h index 0ad2fbfb06..ec76fdf364 100644 --- a/src/frontends/LyXView.h +++ b/src/frontends/LyXView.h @@ -14,9 +14,7 @@ #define LYXVIEW_H #include "frontends/Application.h" -#include "frontends/Toolbars.h" - -#include "LyXFunc.h" +#include "support/docstring.h" #include #include @@ -33,13 +31,15 @@ class Buffer; class BufferView; class FuncRequest; class Inset; -class LyXFunc; class Timeout; +class ToolbarInfo; namespace frontend { class Dialogs; class WorkArea; +class Toolbar; +class Toolbars; /** * LyXView - main LyX window @@ -110,7 +110,7 @@ public: /// show busy cursor virtual void busy(bool) = 0; - virtual Toolbars::ToolbarPtr makeToolbar(ToolbarInfo const & tbinfo, bool newline) = 0; + virtual Toolbar * makeToolbar(ToolbarInfo const & tbinfo, bool newline) = 0; //@{ generic accessor functions diff --git a/src/frontends/Toolbars.cpp b/src/frontends/Toolbars.cpp index a3736c082a..f82ab0b988 100644 --- a/src/frontends/Toolbars.cpp +++ b/src/frontends/Toolbars.cpp @@ -316,7 +316,7 @@ void Toolbars::clearLayoutList() void Toolbars::add(ToolbarInfo const & tbinfo, bool newline) { - ToolbarPtr tb_ptr = owner_.makeToolbar(tbinfo, newline); + ToolbarPtr tb_ptr(owner_.makeToolbar(tbinfo, newline)); toolbars_[tbinfo.name] = tb_ptr; if (tbinfo.flags & ToolbarInfo::ON) diff --git a/src/frontends/Toolbars.h b/src/frontends/Toolbars.h index d6252c0ce7..1568607327 100644 --- a/src/frontends/Toolbars.h +++ b/src/frontends/Toolbars.h @@ -23,7 +23,7 @@ #ifndef TOOLBARS_H #define TOOLBARS_H -#include "TextClassPtr.h" +#include "TextClass.h" #include "ToolbarBackend.h" #include "Session.h" diff --git a/src/frontends/qt4/GuiPopupMenu.cpp b/src/frontends/qt4/GuiPopupMenu.cpp index 620ea13276..b03110eeca 100644 --- a/src/frontends/qt4/GuiPopupMenu.cpp +++ b/src/frontends/qt4/GuiPopupMenu.cpp @@ -11,8 +11,6 @@ #include -#include - // Qt defines a macro 'signals' that clashes with a boost namespace. // All is well if the namespace is visible first. #include "GuiView.h" @@ -21,6 +19,7 @@ #include "GuiPopupMenu.h" #include "GuiMenubar.h" #include "qt_helpers.h" +#include "LyXFunc.h" #include "MenuBackend.h" #include "support/lstrings.h" @@ -51,7 +50,7 @@ GuiPopupMenu::GuiPopupMenu(GuiMenubar * owner, void GuiPopupMenu::updateView() { - LYXERR(Debug::GUI) << BOOST_CURRENT_FUNCTION << endl; + LYXERR(Debug::GUI) << "GuiPopupMenu::updateView()" << endl; LYXERR(Debug::GUI) << "\tTriggered menu: " << to_utf8(name_) << endl; clear(); diff --git a/src/frontends/qt4/GuiToolbar.cpp b/src/frontends/qt4/GuiToolbar.cpp index c51a6976fb..42e850f8ef 100644 --- a/src/frontends/qt4/GuiToolbar.cpp +++ b/src/frontends/qt4/GuiToolbar.cpp @@ -20,8 +20,9 @@ #include "FuncRequest.h" #include "FuncStatus.h" #include "gettext.h" -#include "LyXFunc.h" #include "IconPalette.h" +#include "LyXFunc.h" +#include "ToolbarBackend.h" #include "GuiView.h" #include "GuiCommandBuffer.h" @@ -30,10 +31,11 @@ #include "Action.h" #include "qt_helpers.h" #include "InsertTableWidget.h" + #include "support/filetools.h" #include "support/lstrings.h" + #include "controllers/ControlMath.h" -#include "ToolbarBackend.h" #include #include diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index 0b9ea5c98d..448b1c2e92 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -774,7 +774,7 @@ void GuiViewBase::busy(bool yes) } -Toolbars::ToolbarPtr GuiViewBase::makeToolbar(ToolbarInfo const & tbinfo, bool newline) +Toolbar * GuiViewBase::makeToolbar(ToolbarInfo const & tbinfo, bool newline) { GuiToolbar * toolBar = new GuiToolbar(tbinfo, *this); @@ -817,7 +817,7 @@ Toolbars::ToolbarPtr GuiViewBase::makeToolbar(ToolbarInfo const & tbinfo, bool n toolBar->move(tbinfo.posx, tbinfo.posy); */ - return Toolbars::ToolbarPtr(toolBar); + return toolBar; } diff --git a/src/frontends/qt4/GuiView.h b/src/frontends/qt4/GuiView.h index 428f9325f1..fbe48cc74b 100644 --- a/src/frontends/qt4/GuiView.h +++ b/src/frontends/qt4/GuiView.h @@ -64,7 +64,7 @@ public: virtual void saveGeometry(); virtual void busy(bool); /// add toolbar, if newline==true, add a toolbar break before the toolbar - Toolbars::ToolbarPtr makeToolbar(ToolbarInfo const & tbinfo, bool newline); + Toolbar * makeToolbar(ToolbarInfo const & tbinfo, bool newline); virtual void updateStatusBar(); virtual void message(docstring const & str); virtual void clearMessage();