From 32e1d9fd7b78b57687b1764caa4c14509664d7d0 Mon Sep 17 00:00:00 2001 From: Marco Biasini <marco.biasini@unibas.ch> Date: Fri, 14 Jan 2011 09:49:47 +0100 Subject: [PATCH] forward declarations are our friends --- modules/gui/pymod/export_gosty.cc | 8 +++++- modules/gui/pymod/export_perspective.cc | 3 +++ modules/gui/src/file_loader.cc | 7 +++--- modules/gui/src/gl_win.cc | 3 +++ modules/gui/src/gl_win.hh | 12 ++++----- modules/gui/src/gosty_app.cc | 7 ++++++ modules/gui/src/gosty_app.hh | 25 +++++++++++++------ .../gui/src/messages/message_box_widget.cc | 4 ++- modules/gui/src/panels/tabbed_panel_bar.cc | 3 ++- modules/gui/src/perspective.cc | 4 +++ modules/gui/src/perspective.hh | 24 +++++++++++------- modules/gui/src/scene_selection.cc | 9 +++---- modules/gui/src/tools/tool_bar.cc | 4 +++ 13 files changed, 80 insertions(+), 33 deletions(-) diff --git a/modules/gui/pymod/export_gosty.cc b/modules/gui/pymod/export_gosty.cc index 7bacc6373..b0307e91e 100644 --- a/modules/gui/pymod/export_gosty.cc +++ b/modules/gui/pymod/export_gosty.cc @@ -28,11 +28,15 @@ using namespace boost::python; #include <ost/gui/python_shell/python_shell.hh> #include <ost/gui/scene_win/scene_win.hh> #include <ost/gui/tools/tool_options_win.hh> +#include <ost/gui/scene_win/scene_win.hh> +#include <ost/gui/sequence_viewer/sequence_viewer.hh> +#include <ost/gui/messages/message_widget.hh> #include "transfer_ownership.hh" #include "sip_handler.hh" #if OST_IMG_ENABLED + #include <ost/gui/data_viewer/data_viewer.hh> #include <ost/img/data.hh> #include <ost/gui/data_viewer/data_viewer.hh> using namespace ost::img::gui; @@ -44,7 +48,9 @@ using namespace ost::gui; namespace { #if OST_IMG_ENABLED -DataViewer* app_create_data_viewer1(GostyApp* app, const ost::img::Data& d, const QString& name) +DataViewer* app_create_data_viewer1(GostyApp* app, + const ost::img::Data& d, + const QString& name) { return app->CreateDataViewer(d,name); } diff --git a/modules/gui/pymod/export_perspective.cc b/modules/gui/pymod/export_perspective.cc index bf5f14b3f..17d522f5e 100644 --- a/modules/gui/pymod/export_perspective.cc +++ b/modules/gui/pymod/export_perspective.cc @@ -22,6 +22,9 @@ #include <ost/gui/perspective.hh> #include <ost/gui/main_area.hh> +#include <ost/gui/panels/panel_manager.hh> +#include <ost/gui/panels/button_bar.hh> +#include <ost/gui/panels/panel_bar.hh> #include "sip_handler.hh" diff --git a/modules/gui/src/file_loader.cc b/modules/gui/src/file_loader.cc index 546f98975..74b4f240f 100644 --- a/modules/gui/src/file_loader.cc +++ b/modules/gui/src/file_loader.cc @@ -45,9 +45,10 @@ #include <ost/gui/sequence_viewer/sequence_viewer.hh> #if OST_IMG_ENABLED - #include <ost/io/img/load_map.hh> - #include <ost/gfx/map_iso.hh> - #include <ost/img/extent.hh> +# include <ost/io/img/load_map.hh> +# include <ost/gfx/map_iso.hh> +# include <ost/img/extent.hh> +# include <ost/gui/data_viewer/data_viewer.hh> #endif #include <QDir> diff --git a/modules/gui/src/gl_win.cc b/modules/gui/src/gl_win.cc index 25b1b9f1b..c2f544d7b 100644 --- a/modules/gui/src/gl_win.cc +++ b/modules/gui/src/gl_win.cc @@ -27,6 +27,9 @@ #include <ost/gui/tools/manipulator.hh> #include <ost/gui/tools/measure_tool.hh> #include <ost/gui/perspective.hh> +#include <ost/gui/gl_canvas.hh> +#include <ost/gui/tools/tool.hh> +#include <ost/gui/tools/tool_bar.hh> #if OST_IMG_ENABLED # include <ost/gui/tools/map_tool.hh> diff --git a/modules/gui/src/gl_win.hh b/modules/gui/src/gl_win.hh index a693ef1d9..eaaf248af 100644 --- a/modules/gui/src/gl_win.hh +++ b/modules/gui/src/gl_win.hh @@ -24,14 +24,9 @@ #include <ost/gui/module_config.hh> #include <ost/gui/widget.hh> -#include <ost/gui/gl_canvas.hh> -#include <ost/gui/tools/tool.hh> -#include <ost/gui/tools/tool_bar.hh> - -#include <QMainWindow> #include <QAction> - +#include <QGLFormat> #include <QActionGroup> #include <QStatusBar> @@ -40,6 +35,11 @@ */ namespace ost { namespace gui { + +class GLCanvas; +class ToolBar; +class Tool; + class DLLEXPORT_OST_GUI GLWin: public Widget, public gfx::SceneObserver { Q_OBJECT; diff --git a/modules/gui/src/gosty_app.cc b/modules/gui/src/gosty_app.cc index d6b6bfdd0..3136284c2 100644 --- a/modules/gui/src/gosty_app.cc +++ b/modules/gui/src/gosty_app.cc @@ -27,6 +27,13 @@ #include <ost/gui/main_area.hh> #include <ost/gui/python_shell/python_interpreter.hh> +#include <ost/gui/scene_win/scene_win.hh> +#include <ost/gui/sequence_viewer/sequence_viewer.hh> +#include <ost/gui/messages/message_widget.hh> + +#if OST_IMG_ENABLED + #include <ost/gui/data_viewer/data_viewer.hh> +#endif #include <QApplication> #include <QMainWindow> diff --git a/modules/gui/src/gosty_app.hh b/modules/gui/src/gosty_app.hh index 2723ad846..001777372 100644 --- a/modules/gui/src/gosty_app.hh +++ b/modules/gui/src/gosty_app.hh @@ -28,13 +28,7 @@ #include <ost/gui/module_config.hh> #include <ost/gui/main.hh> #include <ost/gui/widget_geom_handler.hh> -#include <ost/gui/scene_win/scene_win.hh> -#include <ost/gui/sequence_viewer/sequence_viewer.hh> -#include <ost/gui/messages/message_widget.hh> -#if OST_IMG_ENABLED - #include <ost/gui/data_viewer/data_viewer.hh> -#endif #include <QObject> #include <QString> @@ -45,13 +39,30 @@ class QMainWindow; class QMdiArea; class QWidget; -namespace ost { namespace gui { +namespace ost { + + +// forward declarations + +namespace img { + +class Data; + +namespace gui { +class DataViewer; + +}} + +namespace gui { class PythonShell; class GLWin; class TextLogger; class ToolOptionsWin; class Perspective; +class SequenceViewer; +class SceneWin; +class MessageWidget; /// The gosty app serves as a GUI Manager. It distinguishes between two types of /// windows: Windows that can only exist once (singletons) and windows with diff --git a/modules/gui/src/messages/message_box_widget.cc b/modules/gui/src/messages/message_box_widget.cc index 1be4b817c..0f75b337e 100644 --- a/modules/gui/src/messages/message_box_widget.cc +++ b/modules/gui/src/messages/message_box_widget.cc @@ -25,7 +25,7 @@ #include <ost/gui/perspective.hh> #include <ost/gui/widget_registry.hh> - +#include <ost/gui/messages/message_widget.hh> #include <ost/gui/panels/panel_manager.hh> #include "log_reader.hh" @@ -35,6 +35,8 @@ #include <QLabel> #include <QMenu> #include <QVBoxLayout> + + namespace ost {namespace gui { MessageLevel::MessageLevel(QPixmap icon, QWidget* parent): QWidget(parent), message_count_(0), count_label_(new QLabel(QString::number(message_count_)+" ",this)){ diff --git a/modules/gui/src/panels/tabbed_panel_bar.cc b/modules/gui/src/panels/tabbed_panel_bar.cc index 36ec6e2bc..2047af69a 100644 --- a/modules/gui/src/panels/tabbed_panel_bar.cc +++ b/modules/gui/src/panels/tabbed_panel_bar.cc @@ -21,12 +21,13 @@ #include <ost/gui/gosty_app.hh> #include <ost/gui/perspective.hh> #include <ost/gui/widget_registry.hh> - +#include <ost/gui/panels/panel_manager.hh> #include "tabbed_panel_bar.hh" #include <QApplication> #include <QSettings> #include <QDir> + namespace ost { namespace gui { TabbedPanelBar::TabbedPanelBar(PanelBar* parent): diff --git a/modules/gui/src/perspective.cc b/modules/gui/src/perspective.cc index 6af76c480..2df134c5a 100644 --- a/modules/gui/src/perspective.cc +++ b/modules/gui/src/perspective.cc @@ -25,6 +25,10 @@ #include <ost/gui/main_area.hh> #include <ost/gui/messages/message_box_widget.hh> +#include <ost/gui/panels/panel_manager.hh> +#include <ost/gui/panels/button_bar.hh> +#include <ost/gui/panels/panel_bar.hh> + #include <QTextEdit> #include <QSizeGrip> #include <QMainWindow> diff --git a/modules/gui/src/perspective.hh b/modules/gui/src/perspective.hh index b52a7c8f0..74cc10b81 100644 --- a/modules/gui/src/perspective.hh +++ b/modules/gui/src/perspective.hh @@ -19,13 +19,11 @@ #ifndef OST_GUI_PERSPECTIVE_HH #define OST_GUI_PERSPECTIVE_HH +/* + Author: Marco Biasini, Stefan Scheuber + */ -class QMainWindow; -class QTextEdit; -#include <ost/gui/panels/panel_manager.hh> -#include <ost/gui/panels/button_bar.hh> -#include <ost/gui/panels/panel_bar.hh> #include <ost/gui/module_config.hh> #include <QObject> @@ -34,15 +32,23 @@ class QTextEdit; #include <QString> #include <QMenu> #include <QStatusBar> -/* - Author: Marco Biasini, Stefan Scheuber - */ - + + +class QMenu; +class QMenuBar; +class QStatusBar; +class QMainWindow; +class QTextEdit; + namespace ost { namespace gui { + class SideBar; class ThinSplitter; class MainArea; +class PanelManager; +class MainArea; +class ButtonBar; /// The perspective manages the layout of the widgets inside the main window. /// It contains important classes which itself manages again a sub part of the whole layout. diff --git a/modules/gui/src/scene_selection.cc b/modules/gui/src/scene_selection.cc index 58018887d..c2ac7f630 100644 --- a/modules/gui/src/scene_selection.cc +++ b/modules/gui/src/scene_selection.cc @@ -29,11 +29,10 @@ #include <ost/gfx/entity.hh> #if OST_IMG_ENABLED - -#include <ost/gfx/map_iso.hh> -#include <ost/gui/main_area.hh> -#include <ost/gui/perspective.hh> - +# include <ost/gfx/map_iso.hh> +# include <ost/gui/main_area.hh> +# include <ost/gui/perspective.hh> +# include <ost/gui/data_viewer/data_viewer.hh> #endif #include <ost/gui/scene_win/scene_win.hh> diff --git a/modules/gui/src/tools/tool_bar.cc b/modules/gui/src/tools/tool_bar.cc index e4babc0ed..7a59970ff 100644 --- a/modules/gui/src/tools/tool_bar.cc +++ b/modules/gui/src/tools/tool_bar.cc @@ -20,11 +20,15 @@ #include <ost/gui/gosty_app.hh> #include <ost/mol/query_view_wrapper.hh> #include <ost/gui/tools/tool_manager.hh> + +#include <ost/gui/scene_win/scene_win.hh> + #include "tool_bar.hh" #include <QAction> #include <QDebug> #include <QActionGroup> + namespace ost { namespace gui { ToolBar::ToolBar(QWidget* parent): -- GitLab