From 4295f103d71d947e3ed92731e648ba409d3664ac Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 15 Dec 2020 13:20:11 +0100 Subject: Clean up includes --- ganv/Box.hpp | 7 +++++++ ganv/Canvas.hpp | 13 +++++++------ ganv/Circle.hpp | 19 +++++++++---------- ganv/Edge.hpp | 14 ++++++++------ ganv/Item.hpp | 16 ++++++++-------- ganv/Module.hpp | 18 ++++++++++-------- ganv/Node.hpp | 15 ++++++++++----- ganv/Port.hpp | 14 ++++++++------ ganv/box.h | 7 +++++++ ganv/canvas.h | 12 +++++++----- ganv/circle.h | 8 ++++++++ ganv/edge.h | 7 ++++++- ganv/ganv.h | 21 ++++++++++----------- ganv/ganv.hpp | 12 ++++++------ ganv/group.h | 6 ++++++ ganv/item.h | 10 +++++++--- ganv/module.h | 6 ++++++ ganv/node.h | 7 ++++++- ganv/port.h | 7 ++++++- ganv/text.h | 7 +++++++ ganv/types.hpp | 12 ++++++------ ganv/widget.h | 6 ++++++ ganv/wrap.hpp | 2 -- 23 files changed, 161 insertions(+), 85 deletions(-) (limited to 'ganv') diff --git a/ganv/Box.hpp b/ganv/Box.hpp index 6ea0392..fe24622 100644 --- a/ganv/Box.hpp +++ b/ganv/Box.hpp @@ -18,9 +18,16 @@ #include "ganv/Node.hpp" #include "ganv/box.h" +#include "ganv/node.h" +#include "ganv/types.h" +#include "ganv/wrap.hpp" + +#include namespace Ganv { +class Canvas; + class Box : public Node { public: diff --git a/ganv/Canvas.hpp b/ganv/Canvas.hpp index a862ae3..5dd91df 100644 --- a/ganv/Canvas.hpp +++ b/ganv/Canvas.hpp @@ -16,14 +16,16 @@ #ifndef GANV_CANVAS_HPP #define GANV_CANVAS_HPP -#include +#include "ganv/canvas.h" +#include "ganv/item.h" +#include "ganv/types.h" +#include "ganv/wrap.hpp" +#include +#include #include -#include #include - -#include "ganv/canvas.h" -#include "ganv/wrap.hpp" +#include /** Ganv namespace, everything is defined under this. * @@ -34,7 +36,6 @@ namespace Ganv { class Edge; class Item; class Node; -class Port; /** @defgroup Ganv Ganv * diff --git a/ganv/Circle.hpp b/ganv/Circle.hpp index 8534c0a..b60b89d 100644 --- a/ganv/Circle.hpp +++ b/ganv/Circle.hpp @@ -16,23 +16,22 @@ #ifndef GANV_CIRCLE_HPP #define GANV_CIRCLE_HPP -#include -#include -#include -#include - -#include - -#include "ganv/types.hpp" +#include "ganv/Canvas.hpp" #include "ganv/Node.hpp" #include "ganv/circle.h" +#include "ganv/item.h" +#include "ganv/node.h" +#include "ganv/wrap.hpp" + +#include + +#include +#include GANV_GLIB_WRAP(Circle) namespace Ganv { -class Canvas; - /** An elliptical Item which is Node. * * Unlike a Module, this doesn't contain ports, but is directly joinable itself diff --git a/ganv/Edge.hpp b/ganv/Edge.hpp index f7a50b1..c7056a3 100644 --- a/ganv/Edge.hpp +++ b/ganv/Edge.hpp @@ -16,21 +16,23 @@ #ifndef GANV_EDGE_HPP #define GANV_EDGE_HPP -#include - -#include - #include "ganv/Canvas.hpp" #include "ganv/Item.hpp" #include "ganv/Node.hpp" #include "ganv/edge.h" +#include "ganv/item.h" +#include "ganv/types.h" +#include "ganv/wrap.hpp" + +#include +#include + +#include GANV_GLIB_WRAP(Edge) namespace Ganv { -class Canvas; - /** A edge (line) between two Node objects. * * @ingroup Ganv diff --git a/ganv/Item.hpp b/ganv/Item.hpp index 8f0f9c2..09e2f13 100644 --- a/ganv/Item.hpp +++ b/ganv/Item.hpp @@ -16,23 +16,23 @@ #ifndef GANV_ITEM_HPP #define GANV_ITEM_HPP -#include +#include "ganv/Canvas.hpp" +#include "ganv/item.h" +#include "ganv/wrap.hpp" +#include +#include +#include #include - +#include +#include #include #include -#include "ganv/Canvas.hpp" -#include "ganv/item.h" -#include "ganv/wrap.hpp" - GANV_GLIB_WRAP(Item) namespace Ganv { -class Canvas; - /** An item on the canvas. */ class Item : public sigc::trackable { diff --git a/ganv/Module.hpp b/ganv/Module.hpp index 00d295d..8d13700 100644 --- a/ganv/Module.hpp +++ b/ganv/Module.hpp @@ -16,22 +16,24 @@ #ifndef GANV_MODULE_HPP #define GANV_MODULE_HPP -#include -#include - -#include - +#include "ganv/Box.hpp" #include "ganv/Canvas.hpp" -#include "ganv/Node.hpp" #include "ganv/Port.hpp" +#include "ganv/box.h" +#include "ganv/item.h" #include "ganv/module.h" +#include "ganv/types.h" +#include "ganv/wrap.hpp" + +#include +#include + +#include GANV_GLIB_WRAP(Module) namespace Ganv { -class Canvas; - /** A rectangular Item which can hold a Port. * * @ingroup Ganv diff --git a/ganv/Node.hpp b/ganv/Node.hpp index c40a7ea..311385e 100644 --- a/ganv/Node.hpp +++ b/ganv/Node.hpp @@ -16,18 +16,23 @@ #ifndef GANV_NODE_HPP #define GANV_NODE_HPP -#include -#include - -#include "ganv/node.h" #include "ganv/Item.hpp" +#include "ganv/item.h" +#include "ganv/node.h" +#include "ganv/types.h" +#include "ganv/wrap.hpp" + +#include +#include +#include +#include +#include GANV_GLIB_WRAP(Node) namespace Ganv { class Canvas; -class Node; /** An object a Edge can connect to. */ diff --git a/ganv/Port.hpp b/ganv/Port.hpp index 20a7e00..c665b08 100644 --- a/ganv/Port.hpp +++ b/ganv/Port.hpp @@ -16,14 +16,16 @@ #ifndef GANV_PORT_HPP #define GANV_PORT_HPP -#include - -#include - -#include - #include "ganv/Box.hpp" #include "ganv/port.h" +#include "ganv/types.h" +#include "ganv/wrap.hpp" + +#include +#include + +#include +#include GANV_GLIB_WRAP(Port) diff --git a/ganv/box.h b/ganv/box.h index ab166bf..c4a15b4 100644 --- a/ganv/box.h +++ b/ganv/box.h @@ -17,6 +17,11 @@ #define GANV_BOX_H #include "ganv/node.h" +#include "ganv/types.h" + +#include +#include +#include G_BEGIN_DECLS @@ -27,6 +32,8 @@ G_BEGIN_DECLS #define GANV_IS_BOX_CLASS(klass) (GTK_CHECK_CLASS_TYPE((klass), GANV_TYPE_BOX)) #define GANV_BOX_GET_CLASS(obj) (GTK_CHECK_GET_CLASS((obj), GANV_TYPE_BOX, GanvBoxClass)) +struct _GanvBoxClass; + typedef struct _GanvBoxClass GanvBoxClass; typedef struct _GanvBoxPrivate GanvBoxPrivate; diff --git a/ganv/canvas.h b/ganv/canvas.h index c978e24..089bb1d 100644 --- a/ganv/canvas.h +++ b/ganv/canvas.h @@ -16,15 +16,15 @@ #ifndef GANV_CANVAS_H #define GANV_CANVAS_H -#include +#include "ganv/item.h" +#include "ganv/types.h" #include +#include +#include +#include #include -#include "ganv/types.h" -#include "ganv/edge.h" -#include "ganv/item.h" - G_BEGIN_DECLS #define GANV_TYPE_CANVAS (ganv_canvas_get_type()) @@ -34,6 +34,8 @@ G_BEGIN_DECLS #define GANV_IS_CANVAS_CLASS(klass) (GTK_CHECK_CLASS_TYPE((klass), GANV_TYPE_CANVAS)) #define GANV_CANVAS_GET_CLASS(obj) (GTK_CHECK_GET_CLASS((obj), GANV_TYPE_CANVAS, GanvCanvasClass)) +struct _GanvCanvasClass; + typedef struct GanvCanvasImpl GanvCanvasPrivate; typedef struct _GanvCanvasClass GanvCanvasClass; diff --git a/ganv/circle.h b/ganv/circle.h index f181b54..6f4a301 100644 --- a/ganv/circle.h +++ b/ganv/circle.h @@ -17,6 +17,11 @@ #define GANV_CIRCLE_H #include "ganv/node.h" +#include "ganv/types.h" + +#include +#include +#include G_BEGIN_DECLS @@ -27,6 +32,9 @@ G_BEGIN_DECLS #define GANV_IS_CIRCLE_CLASS(klass) (GTK_CHECK_CLASS_TYPE((klass), GANV_TYPE_CIRCLE)) #define GANV_CIRCLE_GET_CLASS(obj) (GTK_CHECK_GET_CLASS((obj), GANV_TYPE_CIRCLE, GanvCircleClass)) +struct _GanvCircle; +struct _GanvCircleClass; + typedef struct _GanvCircle GanvCircle; typedef struct _GanvCircleClass GanvCircleClass; typedef struct _GanvCirclePrivate GanvCirclePrivate; diff --git a/ganv/edge.h b/ganv/edge.h index bf0fb14..a8f7657 100644 --- a/ganv/edge.h +++ b/ganv/edge.h @@ -17,9 +17,12 @@ #define GANV_EDGE_H #include "ganv/item.h" -#include "ganv/node.h" #include "ganv/types.h" +#include +#include +#include + G_BEGIN_DECLS #define GANV_TYPE_EDGE (ganv_edge_get_type()) @@ -29,6 +32,8 @@ G_BEGIN_DECLS #define GANV_IS_EDGE_CLASS(klass) (GTK_CHECK_CLASS_TYPE((klass), GANV_TYPE_EDGE)) #define GANV_EDGE_GET_CLASS(obj) (GTK_CHECK_GET_CLASS((obj), GANV_TYPE_EDGE, GanvEdgeClass)) +struct _GanvEdgeClass; + typedef struct _GanvEdgeClass GanvEdgeClass; typedef struct _GanvEdgePrivate GanvEdgePrivate; diff --git a/ganv/ganv.h b/ganv/ganv.h index 9a00143..f86165f 100644 --- a/ganv/ganv.h +++ b/ganv/ganv.h @@ -16,16 +16,15 @@ #ifndef GANV_GANV_H #define GANV_GANV_H -#include "ganv/box.h" -#include "ganv/canvas.h" -#include "ganv/circle.h" -#include "ganv/edge.h" -#include "ganv/ganv.h" -#include "ganv/group.h" -#include "ganv/module.h" -#include "ganv/node.h" -#include "ganv/port.h" -#include "ganv/text.h" -#include "ganv/types.h" +#include "ganv/box.h" // IWYU pragma: export +#include "ganv/canvas.h" // IWYU pragma: export +#include "ganv/circle.h" // IWYU pragma: export +#include "ganv/edge.h" // IWYU pragma: export +#include "ganv/group.h" // IWYU pragma: export +#include "ganv/module.h" // IWYU pragma: export +#include "ganv/node.h" // IWYU pragma: export +#include "ganv/port.h" // IWYU pragma: export +#include "ganv/text.h" // IWYU pragma: export +#include "ganv/types.h" // IWYU pragma: export #endif /* GANV_GANV_H */ diff --git a/ganv/ganv.hpp b/ganv/ganv.hpp index 9b0334d..3e3f259 100644 --- a/ganv/ganv.hpp +++ b/ganv/ganv.hpp @@ -16,11 +16,11 @@ #ifndef GANV_GANV_HPP #define GANV_GANV_HPP -#include "ganv/Canvas.hpp" -#include "ganv/Circle.hpp" -#include "ganv/Edge.hpp" -#include "ganv/Module.hpp" -#include "ganv/Node.hpp" -#include "ganv/Port.hpp" +#include "ganv/Canvas.hpp" // IWYU pragma: export +#include "ganv/Circle.hpp" // IWYU pragma: export +#include "ganv/Edge.hpp" // IWYU pragma: export +#include "ganv/Module.hpp" // IWYU pragma: export +#include "ganv/Node.hpp" // IWYU pragma: export +#include "ganv/Port.hpp" // IWYU pragma: export #endif // GANV_GANV_HPP diff --git a/ganv/group.h b/ganv/group.h index 0f835e4..d21a8ed 100644 --- a/ganv/group.h +++ b/ganv/group.h @@ -18,6 +18,9 @@ #include "ganv/item.h" +#include +#include + G_BEGIN_DECLS /* Based on GnomeCanvasGroup, by Federico Mena @@ -32,6 +35,9 @@ G_BEGIN_DECLS #define GANV_IS_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GANV_TYPE_GROUP)) #define GANV_GROUP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GANV_TYPE_GROUP, GanvGroupClass)) +struct _GanvGroup; +struct _GanvGroupClass; + typedef struct _GanvGroup GanvGroup; typedef struct _GanvGroupPrivate GanvGroupPrivate; typedef struct _GanvGroupClass GanvGroupClass; diff --git a/ganv/item.h b/ganv/item.h index 4605ffb..2433574 100644 --- a/ganv/item.h +++ b/ganv/item.h @@ -21,14 +21,18 @@ #ifndef GANV_ITEM_H #define GANV_ITEM_H -#include - #include +#include +#include +#include #include +#include + G_BEGIN_DECLS -struct _GanvCanvas; +struct _GanvItem; +struct _GanvItemClass; typedef struct _GanvItem GanvItem; typedef struct _GanvItemPrivate GanvItemPrivate; diff --git a/ganv/module.h b/ganv/module.h index 37fcf96..59c1909 100644 --- a/ganv/module.h +++ b/ganv/module.h @@ -16,10 +16,14 @@ #ifndef GANV_MODULE_H #define GANV_MODULE_H +#include "ganv/types.h" + +#include #include #include #include "ganv/box.h" +#include "ganv/canvas.h" G_BEGIN_DECLS @@ -30,6 +34,8 @@ G_BEGIN_DECLS #define GANV_IS_MODULE_CLASS(klass) (GTK_CHECK_CLASS_TYPE((klass), GANV_TYPE_MODULE)) #define GANV_MODULE_GET_CLASS(obj) (GTK_CHECK_GET_CLASS((obj), GANV_TYPE_MODULE, GanvModuleClass)) +struct _GanvModuleClass; + typedef struct _GanvModuleClass GanvModuleClass; typedef struct _GanvModulePrivate GanvModulePrivate; diff --git a/ganv/node.h b/ganv/node.h index b0dd82f..03cce5f 100644 --- a/ganv/node.h +++ b/ganv/node.h @@ -18,7 +18,10 @@ #include "ganv/item.h" #include "ganv/types.h" -#include "ganv/text.h" + +#include +#include +#include G_BEGIN_DECLS @@ -29,6 +32,8 @@ G_BEGIN_DECLS #define GANV_IS_NODE_CLASS(klass) (GTK_CHECK_CLASS_TYPE((klass), GANV_TYPE_NODE)) #define GANV_NODE_GET_CLASS(obj) (GTK_CHECK_GET_CLASS((obj), GANV_TYPE_NODE, GanvNodeClass)) +struct _GanvNodeClass; + typedef struct _GanvNodeClass GanvNodeClass; typedef struct _GanvNodePrivate GanvNodePrivate; diff --git a/ganv/port.h b/ganv/port.h index 03f4bb3..bfcd9da 100644 --- a/ganv/port.h +++ b/ganv/port.h @@ -17,8 +17,11 @@ #define GANV_PORT_H #include "ganv/box.h" +#include "ganv/types.h" -struct _GanvModule; +#include +#include +#include G_BEGIN_DECLS @@ -29,6 +32,8 @@ G_BEGIN_DECLS #define GANV_IS_PORT_CLASS(klass) (GTK_CHECK_CLASS_TYPE((klass), GANV_TYPE_PORT)) #define GANV_PORT_GET_CLASS(obj) (GTK_CHECK_GET_CLASS((obj), GANV_TYPE_PORT, GanvPortClass)) +struct _GanvPortClass; + typedef struct _GanvPortClass GanvPortClass; typedef struct _GanvPortPrivate GanvPortPrivate; diff --git a/ganv/text.h b/ganv/text.h index 6f03a1b..2aee253 100644 --- a/ganv/text.h +++ b/ganv/text.h @@ -18,6 +18,10 @@ #include "ganv/item.h" +#include +#include +#include + G_BEGIN_DECLS #define GANV_TYPE_TEXT (ganv_text_get_type()) @@ -27,6 +31,9 @@ G_BEGIN_DECLS #define GANV_IS_TEXT_CLASS(klass) (GTK_CHECK_CLASS_TYPE((klass), GANV_TYPE_TEXT)) #define GANV_TEXT_GET_CLASS(obj) (GTK_CHECK_GET_CLASS((obj), GANV_TYPE_TEXT, GanvTextClass)) +struct _GanvText; +struct _GanvTextClass; + typedef struct _GanvText GanvText; typedef struct _GanvTextClass GanvTextClass; typedef struct _GanvTextPrivate GanvTextPrivate; diff --git a/ganv/types.hpp b/ganv/types.hpp index 0e0e15e..ba797ba 100644 --- a/ganv/types.hpp +++ b/ganv/types.hpp @@ -18,12 +18,12 @@ namespace Ganv { -class Canvas; -class Edge; -class Item; -class Module; -class Node; -class Port; +class Canvas; // IWYU pragma: keep +class Edge; // IWYU pragma: keep +class Item; // IWYU pragma: keep +class Module; // IWYU pragma: keep +class Node; // IWYU pragma: keep +class Port; // IWYU pragma: keep } // namespace Ganv diff --git a/ganv/widget.h b/ganv/widget.h index 5b54ba4..213e669 100644 --- a/ganv/widget.h +++ b/ganv/widget.h @@ -22,6 +22,9 @@ #include "ganv/item.h" +#include +#include + G_BEGIN_DECLS #define GANV_TYPE_WIDGET (ganv_widget_get_type ()) @@ -31,6 +34,9 @@ G_BEGIN_DECLS #define GANV_IS_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GANV_TYPE_WIDGET)) #define GANV_WIDGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GANV_TYPE_WIDGET, GanvWidgetClass)) +struct _GanvWidget; +struct _GanvWidgetClass; + typedef struct _GanvWidget GanvWidget; typedef struct _GanvWidgetPrivate GanvWidgetPrivate; typedef struct _GanvWidgetClass GanvWidgetClass; diff --git a/ganv/wrap.hpp b/ganv/wrap.hpp index 80aa0d2..a71be41 100644 --- a/ganv/wrap.hpp +++ b/ganv/wrap.hpp @@ -16,8 +16,6 @@ #ifndef GANV_WRAP_HPP #define GANV_WRAP_HPP -#include - #define CONNECT_PROP_SIGNAL(gobj, name, notify, handler) \ g_signal_connect(gobj, "notify::" #name, \ G_CALLBACK(notify), &_signal_##name); \ -- cgit v1.2.1