From 9e91a8991e233af12beec82e5568b9ec4601d707 Mon Sep 17 00:00:00 2001 From: wmayer Date: Wed, 9 Mar 2022 01:25:29 +0100 Subject: [PATCH] Gui: Optimize includes to reduce compile time --- src/Gui/ActiveObjectList.h | 2 +- src/Gui/Application.cpp | 1 + src/Gui/Document.h | 6 ++-- src/Gui/EditorView.h | 1 + src/Gui/MDIView.h | 4 ++- src/Gui/Tree.h | 21 +----------- src/Gui/TreeItemMode.h | 49 ++++++++++++++++++++++++++++ src/Gui/View3DPy.cpp | 1 + src/Gui/ViewProviderTextDocument.cpp | 1 + src/Mod/Drawing/Gui/DrawingView.cpp | 2 ++ src/Mod/Image/Gui/ImageView.cpp | 2 ++ src/Mod/Part/Gui/TaskCheckGeometry.h | 1 + src/Mod/TechDraw/Gui/QGIViewPart.h | 1 + 13 files changed, 66 insertions(+), 26 deletions(-) create mode 100644 src/Gui/TreeItemMode.h diff --git a/src/Gui/ActiveObjectList.h b/src/Gui/ActiveObjectList.h index 5ddfc7d89a..bddcdf3dc6 100644 --- a/src/Gui/ActiveObjectList.h +++ b/src/Gui/ActiveObjectList.h @@ -27,7 +27,7 @@ #define GUI_ActiveObjectList_H #include -#include "Tree.h" +#include namespace App { diff --git a/src/Gui/Application.cpp b/src/Gui/Application.cpp index ffe28968df..7398057791 100644 --- a/src/Gui/Application.cpp +++ b/src/Gui/Application.cpp @@ -32,6 +32,7 @@ # include # include # include +# include # include # include # include diff --git a/src/Gui/Document.h b/src/Gui/Document.h index 91acf213bd..6bf167787c 100644 --- a/src/Gui/Document.h +++ b/src/Gui/Document.h @@ -27,13 +27,13 @@ #include #include #include +#include #include - +#include class SoNode; class SoPath; -class QString; namespace Base { class Matrix4D; @@ -56,8 +56,6 @@ class ViewProviderDocumentObject; class Application; class DocumentPy; class TransactionViewProvider; -enum class HighlightMode; -enum class TreeItemMode; /** The Gui Document * This is the document on GUI level. Its main responsibility is keeping diff --git a/src/Gui/EditorView.h b/src/Gui/EditorView.h index cc249fe2aa..2ab987124d 100644 --- a/src/Gui/EditorView.h +++ b/src/Gui/EditorView.h @@ -28,6 +28,7 @@ #include "Window.h" QT_BEGIN_NAMESPACE +class QLineEdit; class QPlainTextEdit; class QPrinter; class QHBoxLayout; diff --git a/src/Gui/MDIView.h b/src/Gui/MDIView.h index d065696ec9..8ab7e6a5a4 100644 --- a/src/Gui/MDIView.h +++ b/src/Gui/MDIView.h @@ -23,8 +23,10 @@ #ifndef GUI_MDIVIEW_H #define GUI_MDIVIEW_H +#include #include -#include "ActiveObjectList.h" +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/Gui/Tree.h b/src/Gui/Tree.h index 4812812a49..5dae3a93e8 100644 --- a/src/Gui/Tree.h +++ b/src/Gui/Tree.h @@ -35,6 +35,7 @@ #include #include #include +#include class QLineEdit; @@ -47,26 +48,6 @@ typedef std::shared_ptr DocumentObjectDataPtr; class DocumentItem; -/// highlight modes for the tree items -enum class HighlightMode { - Underlined, - Italic, - Overlined, - Bold, - Blue, - LightBlue, - UserDefined -}; - -/// highlight modes for the tree items -enum class TreeItemMode { - ExpandItem, - ExpandPath, - CollapseItem, - ToggleItem -}; - - /** Tree view that allows drag & drop of document objects. * @author Werner Mayer */ diff --git a/src/Gui/TreeItemMode.h b/src/Gui/TreeItemMode.h new file mode 100644 index 0000000000..2947b79c55 --- /dev/null +++ b/src/Gui/TreeItemMode.h @@ -0,0 +1,49 @@ +/*************************************************************************** + * Copyright (c) 2004 Jürgen Riegel * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + + +#ifndef GUI_TREEITEMMODE_H +#define GUI_TREEITEMMODE_H + +namespace Gui { + + /// highlight modes for the tree items + enum class HighlightMode { + Underlined, + Italic, + Overlined, + Bold, + Blue, + LightBlue, + UserDefined + }; + + /// highlight modes for the tree items + enum class TreeItemMode { + ExpandItem, + ExpandPath, + CollapseItem, + ToggleItem + }; +} + +#endif // GUI_TREEITEMMODE_H diff --git a/src/Gui/View3DPy.cpp b/src/Gui/View3DPy.cpp index 4eb4892e6d..65092891d4 100644 --- a/src/Gui/View3DPy.cpp +++ b/src/Gui/View3DPy.cpp @@ -30,6 +30,7 @@ # include #endif +#include #include #include #include diff --git a/src/Gui/ViewProviderTextDocument.cpp b/src/Gui/ViewProviderTextDocument.cpp index daeaca323c..46d454f9ae 100644 --- a/src/Gui/ViewProviderTextDocument.cpp +++ b/src/Gui/ViewProviderTextDocument.cpp @@ -27,6 +27,7 @@ # include #endif +#include #include #include "ViewProviderTextDocument.h" diff --git a/src/Mod/Drawing/Gui/DrawingView.cpp b/src/Mod/Drawing/Gui/DrawingView.cpp index 69bcded867..ff3b9dfdb2 100644 --- a/src/Mod/Drawing/Gui/DrawingView.cpp +++ b/src/Mod/Drawing/Gui/DrawingView.cpp @@ -54,9 +54,11 @@ #endif #include "DrawingView.h" +#include #include #include #include +#include #include #include #include diff --git a/src/Mod/Image/Gui/ImageView.cpp b/src/Mod/Image/Gui/ImageView.cpp index 02d59d3c71..bb8ee34b14 100644 --- a/src/Mod/Image/Gui/ImageView.cpp +++ b/src/Mod/Image/Gui/ImageView.cpp @@ -30,6 +30,8 @@ #include "ImageView.h" #include "../App/ImageBase.h" #include "XpmImages.h" +#include +#include using namespace ImageGui; diff --git a/src/Mod/Part/Gui/TaskCheckGeometry.h b/src/Mod/Part/Gui/TaskCheckGeometry.h index 31a5ac6a42..8bcddf3e89 100644 --- a/src/Mod/Part/Gui/TaskCheckGeometry.h +++ b/src/Mod/Part/Gui/TaskCheckGeometry.h @@ -39,6 +39,7 @@ class SoSeparator; class SoSwitch; class QCheckBox; class QTextEdit; +class QTreeView; namespace PartGui { diff --git a/src/Mod/TechDraw/Gui/QGIViewPart.h b/src/Mod/TechDraw/Gui/QGIViewPart.h index bb9a0b0e99..2d693efa31 100644 --- a/src/Mod/TechDraw/Gui/QGIViewPart.h +++ b/src/Mod/TechDraw/Gui/QGIViewPart.h @@ -25,6 +25,7 @@ #include #include +#include #include #include "QGIView.h"