diff options
author | David Robillard <d@drobilla.net> | 2020-12-15 13:20:11 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-12-15 18:32:12 +0100 |
commit | 4295f103d71d947e3ed92731e648ba409d3664ac (patch) | |
tree | 868aa0b684edc5f64400721188901da6b7c6269b | |
parent | 93fee4579d013ba36d1eedc273fc2d9385d76e19 (diff) | |
download | ganv-4295f103d71d947e3ed92731e648ba409d3664ac.tar.gz ganv-4295f103d71d947e3ed92731e648ba409d3664ac.tar.bz2 ganv-4295f103d71d947e3ed92731e648ba409d3664ac.zip |
Clean up includes
-rw-r--r-- | ganv/Box.hpp | 7 | ||||
-rw-r--r-- | ganv/Canvas.hpp | 13 | ||||
-rw-r--r-- | ganv/Circle.hpp | 19 | ||||
-rw-r--r-- | ganv/Edge.hpp | 14 | ||||
-rw-r--r-- | ganv/Item.hpp | 16 | ||||
-rw-r--r-- | ganv/Module.hpp | 18 | ||||
-rw-r--r-- | ganv/Node.hpp | 15 | ||||
-rw-r--r-- | ganv/Port.hpp | 14 | ||||
-rw-r--r-- | ganv/box.h | 7 | ||||
-rw-r--r-- | ganv/canvas.h | 12 | ||||
-rw-r--r-- | ganv/circle.h | 8 | ||||
-rw-r--r-- | ganv/edge.h | 7 | ||||
-rw-r--r-- | ganv/ganv.h | 21 | ||||
-rw-r--r-- | ganv/ganv.hpp | 12 | ||||
-rw-r--r-- | ganv/group.h | 6 | ||||
-rw-r--r-- | ganv/item.h | 10 | ||||
-rw-r--r-- | ganv/module.h | 6 | ||||
-rw-r--r-- | ganv/node.h | 7 | ||||
-rw-r--r-- | ganv/port.h | 7 | ||||
-rw-r--r-- | ganv/text.h | 7 | ||||
-rw-r--r-- | ganv/types.hpp | 12 | ||||
-rw-r--r-- | ganv/widget.h | 6 | ||||
-rw-r--r-- | ganv/wrap.hpp | 2 | ||||
-rw-r--r-- | src/Canvas.cpp | 87 | ||||
-rw-r--r-- | src/Port.cpp | 17 | ||||
-rw-r--r-- | src/boilerplate.h | 9 | ||||
-rw-r--r-- | src/box.c | 22 | ||||
-rw-r--r-- | src/circle.c | 23 | ||||
-rw-r--r-- | src/edge.c | 22 | ||||
-rw-r--r-- | src/fdgl.hpp | 5 | ||||
-rw-r--r-- | src/ganv-private.h | 9 | ||||
-rw-r--r-- | src/ganv_bench.cpp | 26 | ||||
-rw-r--r-- | src/ganv_test.c | 4 | ||||
-rw-r--r-- | src/group.c | 14 | ||||
-rw-r--r-- | src/item.c | 19 | ||||
-rw-r--r-- | src/module.c | 22 | ||||
-rw-r--r-- | src/node.c | 22 | ||||
-rw-r--r-- | src/port.c | 27 | ||||
-rw-r--r-- | src/text.c | 30 | ||||
-rw-r--r-- | src/widget.c | 17 |
40 files changed, 422 insertions, 199 deletions
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 <glib.h> 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 <string> +#include "ganv/canvas.h" +#include "ganv/item.h" +#include "ganv/types.h" +#include "ganv/wrap.hpp" +#include <cairo.h> +#include <gdkmm/event.h> #include <glib.h> -#include <glibmm.h> #include <gtkmm/layout.h> - -#include "ganv/canvas.h" -#include "ganv/wrap.hpp" +#include <sigc++/signal.h> /** 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 <algorithm> -#include <map> -#include <string> -#include <stdint.h> - -#include <gdkmm/types.h> - -#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 <glib.h> + +#include <cstdint> +#include <string> 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 <stdint.h> - -#include <gdk/gdkevents.h> - #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 <glib-object.h> +#include <glib.h> + +#include <cstdint> 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 <assert.h> +#include "ganv/Canvas.hpp" +#include "ganv/item.h" +#include "ganv/wrap.hpp" +#include <gdk/gdk.h> +#include <gdkmm/event.h> +#include <glib-object.h> #include <glib.h> - +#include <gobject/gclosure.h> +#include <gtk/gtk.h> #include <sigc++/signal.h> #include <sigc++/trackable.h> -#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 <string> -#include <vector> - -#include <gtkmm/container.h> - +#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 <glib.h> +#include <gtkmm/widget.h> + +#include <string> 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 <glib.h> -#include <assert.h> - -#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 <glib-object.h> +#include <glib.h> +#include <glibmm/object.h> +#include <gobject/gclosure.h> +#include <sigc++/signal.h> 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 <stdint.h> - -#include <string> - -#include <gdkmm/types.h> - #include "ganv/Box.hpp" #include "ganv/port.h" +#include "ganv/types.h" +#include "ganv/wrap.hpp" + +#include <glib.h> +#include <sigc++/signal.h> + +#include <cstdint> +#include <string> GANV_GLIB_WRAP(Port) @@ -17,6 +17,11 @@ #define GANV_BOX_H #include "ganv/node.h" +#include "ganv/types.h" + +#include <glib-object.h> +#include <glib.h> +#include <gtk/gtk.h> 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 <stdarg.h> +#include "ganv/item.h" +#include "ganv/types.h" #include <cairo.h> +#include <gdk/gdk.h> +#include <glib-object.h> +#include <glib.h> #include <gtk/gtk.h> -#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 <glib-object.h> +#include <glib.h> +#include <gtk/gtk.h> 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 <glib-object.h> +#include <glib.h> +#include <gtk/gtk.h> + 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 <glib-object.h> +#include <glib.h> + G_BEGIN_DECLS /* Based on GnomeCanvasGroup, by Federico Mena <federico@nuclecu.unam.mx> @@ -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 <stdarg.h> - #include <cairo.h> +#include <gdk/gdk.h> +#include <glib-object.h> +#include <glib.h> #include <gtk/gtk.h> +#include <stdarg.h> + 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 <glib-object.h> #include <glib.h> #include <gtk/gtk.h> #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 <glib-object.h> +#include <glib.h> +#include <gtk/gtk.h> 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 <glib-object.h> +#include <glib.h> +#include <gtk/gtk.h> 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 <glib-object.h> +#include <glib.h> +#include <gtk/gtk.h> + 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 <glib-object.h> +#include <glib.h> + 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 <glib.h> - #define CONNECT_PROP_SIGNAL(gobj, name, notify, handler) \ g_signal_connect(gobj, "notify::" #name, \ G_CALLBACK(notify), &_signal_##name); \ diff --git a/src/Canvas.cpp b/src/Canvas.cpp index 4e83507..f3b2499 100644 --- a/src/Canvas.cpp +++ b/src/Canvas.cpp @@ -21,42 +21,66 @@ #define _POSIX_C_SOURCE 200809L // strdup #define _XOPEN_SOURCE 600 // isascii on BSD -#include <math.h> -#include <stdio.h> -#include <string.h> - -#include <algorithm> -#include <cassert> -#include <cmath> -#include <iostream> -#include <map> -#include <set> -#include <sstream> -#include <string> -#include <vector> - -#include <cairo.h> -#include <gdk/gdkkeysyms.h> -#include <gtk/gtk.h> -#include <gtk/gtkstyle.h> -#include <gtkmm/widget.h> +#include "color.h" +#include "ganv-marshal.h" +#include "ganv-private.h" +#include "gettext.h" #include "ganv/Canvas.hpp" -#include "ganv/Circle.hpp" #include "ganv/Edge.hpp" -#include "ganv/Module.hpp" -#include "ganv/Port.hpp" +#include "ganv/Item.hpp" +#include "ganv/Node.hpp" #include "ganv/box.h" #include "ganv/canvas.h" +#include "ganv/circle.h" #include "ganv/edge.h" #include "ganv/group.h" +#include "ganv/item.h" +#include "ganv/module.h" #include "ganv/node.h" +#include "ganv/port.h" +#include "ganv/types.h" #include "ganv_config.h" -#include "./color.h" -#include "./ganv-marshal.h" -#include "./ganv-private.h" -#include "./gettext.h" +#include <cairo-pdf.h> +#include <cairo-ps.h> +#include <cairo-svg.h> +#include <cairo.h> +#include <gdk/gdk.h> +#include <gdk/gdkkeysyms-compat.h> +#include <gdkmm/event.h> +#include <gdkmm/gc.h> +#include <gdkmm/screen.h> +#include <gdkmm/window.h> +#include <glib-object.h> +#include <glib.h> +#include <glibmm/object.h> +#include <gobject/gclosure.h> +#include <gtk/gtk.h> +#include <gtkmm/layout.h> +#include <gtkmm/object.h> +#include <gtkmm/style.h> +#include <gtkmm/widget.h> +#include <pango/pango-font.h> +#include <pango/pango-types.h> +#include <pangomm/fontdescription.h> +#include <sigc++/signal.h> + +#include <algorithm> +#include <cassert> +#include <cfloat> +#include <clocale> +#include <cmath> +#include <cstdint> +#include <cstdio> +#include <cstdlib> +#include <cstring> +#include <iostream> +#include <map> +#include <set> +#include <string> +#include <utility> +#include <vector> #ifdef HAVE_AGRAPH // Deal with graphviz API amateur hour... @@ -64,7 +88,10 @@ # define _dll_import 0 # define _BLD_cdt 0 # define _PACKAGE_ast 0 +# include <arith.h> # include <gvc.h> +# include <gvcext.h> +# include <types.h> #endif #ifdef GANV_FDGL # include "./fdgl.hpp" @@ -74,6 +101,8 @@ static const double GANV_CANVAS_PAD = 8.0; +struct GanvCanvasImpl; + typedef struct { int x; int y; @@ -1777,11 +1806,7 @@ Canvas::get_edge(Node* tail, Node* head) const extern "C" { -#include "ganv/canvas.h" - -#include "./boilerplate.h" -#include "./color.h" -#include "./gettext.h" +#include "boilerplate.h" G_DEFINE_TYPE_WITH_CODE(GanvCanvas, ganv_canvas, GTK_TYPE_LAYOUT, G_ADD_PRIVATE(GanvCanvas)) diff --git a/src/Port.cpp b/src/Port.cpp index 3506039..c17afe5 100644 --- a/src/Port.cpp +++ b/src/Port.cpp @@ -13,15 +13,22 @@ * with Ganv. If not, see <http://www.gnu.org/licenses/>. */ -#include <string> - -#include <glib.h> +#include "color.h" -#include "ganv/Canvas.hpp" +#include "ganv/Box.hpp" #include "ganv/Module.hpp" #include "ganv/Port.hpp" +#include "ganv/box.h" +#include "ganv/port.h" +#include "ganv/types.h" -#include "./color.h" +#include <glib-object.h> +#include <gobject/gclosure.h> +#include <sigc++/signal.h> + +#include <cstddef> +#include <cstdint> +#include <string> namespace Ganv { diff --git a/src/boilerplate.h b/src/boilerplate.h index a419711..770b286 100644 --- a/src/boilerplate.h +++ b/src/boilerplate.h @@ -13,6 +13,13 @@ * with Ganv. If not, see <http://www.gnu.org/licenses/>. */ +#ifndef GANV_BOILERPLATE_H +#define GANV_BOILERPLATE_H + +#include "ganv/item.h" + +#include <glib.h> + typedef gpointer gobject; /** @@ -41,3 +48,5 @@ typedef gpointer gobject; case PROP_##prop: \ g_value_set_##type(value, field); \ break; + +#endif // GANV_BOILERPLATE_H @@ -13,17 +13,23 @@ * with Ganv. If not, see <http://www.gnu.org/licenses/>. */ -#include <math.h> -#include <string.h> - -#include <cairo.h> +#include "boilerplate.h" +#include "color.h" +#include "ganv-private.h" +#include "gettext.h" #include "ganv/box.h" +#include "ganv/item.h" +#include "ganv/node.h" +#include "ganv/types.h" -#include "./boilerplate.h" -#include "./color.h" -#include "./gettext.h" -#include "./ganv-private.h" +#include <cairo.h> +#include <glib-object.h> +#include <glib.h> +#include <gtk/gtk.h> + +#include <math.h> +#include <string.h> static const double STACKED_OFFSET = 4.0; diff --git a/src/circle.c b/src/circle.c index 5cd9cb9..723b229 100644 --- a/src/circle.c +++ b/src/circle.c @@ -13,16 +13,27 @@ * with Ganv. If not, see <http://www.gnu.org/licenses/>. */ -#include <math.h> -#include <string.h> +#include "boilerplate.h" +#include "color.h" +#include "ganv-private.h" +#include "gettext.h" #include "ganv/canvas.h" #include "ganv/circle.h" +#include "ganv/item.h" +#include "ganv/node.h" +#include "ganv/text.h" +#include "ganv/types.h" + +#include <cairo.h> +#include <glib-object.h> +#include <glib.h> +#include <gtk/gtk.h> -#include "./color.h" -#include "./boilerplate.h" -#include "./gettext.h" -#include "./ganv-private.h" +#include <float.h> +#include <math.h> +#include <stdarg.h> +#include <string.h> G_DEFINE_TYPE_WITH_CODE(GanvCircle, ganv_circle, GANV_TYPE_NODE, G_ADD_PRIVATE(GanvCircle)) @@ -13,21 +13,25 @@ * with Ganv. If not, see <http://www.gnu.org/licenses/>. */ -#include <math.h> -#include <string.h> - -#include <cairo.h> +#include "boilerplate.h" +#include "color.h" +#include "ganv-private.h" +#include "gettext.h" #include "ganv/canvas.h" #include "ganv/edge.h" +#include "ganv/item.h" #include "ganv/node.h" +#include "ganv/types.h" -#include "./boilerplate.h" -#include "./color.h" -#include "./gettext.h" +#include <cairo.h> +#include <glib-object.h> +#include <glib.h> +#include <gtk/gtk.h> +#include <stdarg.h> -#include "color.h" -#include "ganv-private.h" +#include <math.h> +#include <string.h> #define ARROW_DEPTH 32 #define ARROW_BREADTH 32 diff --git a/src/fdgl.hpp b/src/fdgl.hpp index 38fded1..1ea5e9d 100644 --- a/src/fdgl.hpp +++ b/src/fdgl.hpp @@ -13,8 +13,9 @@ * with Ganv. If not, see <http://www.gnu.org/licenses/>. */ -#include <float.h> -#include <math.h> +#include "ganv-private.h" + +#include <cmath> static const double CHARGE_KE = 4000000.0; static const double EDGE_K = 16.0; diff --git a/src/ganv-private.h b/src/ganv-private.h index df611a9..3d0b7e0 100644 --- a/src/ganv-private.h +++ b/src/ganv-private.h @@ -20,12 +20,17 @@ extern "C" { #endif -#include <cairo.h> - #include "ganv/canvas.h" +#include "ganv/item.h" #include "ganv/text.h" #include "ganv/types.h" +#include <cairo.h> +#include <gdk/gdk.h> +#include <glib.h> +#include <gtk/gtk.h> +#include <pango/pango-layout.h> + #define GANV_CLOSE_ENOUGH 1 extern guint signal_moved; diff --git a/src/ganv_bench.cpp b/src/ganv_bench.cpp index 5f723b3..1ad00f2 100644 --- a/src/ganv_bench.cpp +++ b/src/ganv_bench.cpp @@ -13,16 +13,30 @@ * with Ganv. If not, see <http://www.gnu.org/licenses/>. */ -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -#include <glibmm.h> +#include "ganv/Canvas.hpp" +#include "ganv/Circle.hpp" +#include "ganv/Edge.hpp" +#include "ganv/Module.hpp" +#include "ganv/Port.hpp" + +#include <glibmm/main.h> +#include <gtkmm/layout.h> #include <gtkmm/main.h> +#include <gtkmm/object.h> #include <gtkmm/scrolledwindow.h> #include <gtkmm/window.h> +#include <sigc++/functors/ptr_fun.h> + +#include <algorithm> +#include <cstdio> +#include <cstdlib> +#include <ctime> +#include <iosfwd> +#include <vector> -#include "ganv/ganv.hpp" +namespace Ganv { +class Node; +} using namespace std; using namespace Ganv; diff --git a/src/ganv_test.c b/src/ganv_test.c index ec1b0a8..c2e1534 100644 --- a/src/ganv_test.c +++ b/src/ganv_test.c @@ -13,10 +13,10 @@ * with Ganv. If not, see <http://www.gnu.org/licenses/>. */ -#include <gtk/gtk.h> - #include "ganv/ganv.h" +#include <gtk/gtk.h> + static void on_window_destroy(GtkWidget* widget, void* data) { diff --git a/src/group.c b/src/group.c index b60495b..54a3765 100644 --- a/src/group.c +++ b/src/group.c @@ -18,13 +18,19 @@ * Copyright 1997-2000 Free Software Foundation */ -#include <math.h> +#include "ganv-private.h" -#include "ganv/canvas.h" #include "ganv/group.h" +#include "ganv/item.h" + +#include <cairo.h> +#include <float.h> +#include <glib-object.h> +#include <glib.h> +#include <gtk/gtk.h> -#include "./gettext.h" -#include "./ganv-private.h" +#include <math.h> +#include <stddef.h> enum { GROUP_PROP_0 @@ -18,13 +18,20 @@ * Copyright 1997-2000 Free Software Foundation */ -#include "ganv/canvas.h" -#include "ganv/node.h" +#include "ganv-marshal.h" +#include "ganv-private.h" +#include "gettext.h" -#include "./boilerplate.h" -#include "./ganv-marshal.h" -#include "./ganv-private.h" -#include "./gettext.h" +#include "ganv/item.h" +#include "ganv/types.h" + +#include <gdk/gdk.h> +#include <glib-object.h> +#include <glib.h> +#include <gtk/gtk.h> + +#include <stdarg.h> +#include <stdio.h> /* All canvas items are derived from GanvItem. The only information a GanvItem * contains is its parent canvas, its parent canvas item, its bounding box in diff --git a/src/module.c b/src/module.c index a33b27c..e96932e 100644 --- a/src/module.c +++ b/src/module.c @@ -13,18 +13,28 @@ * with Ganv. If not, see <http://www.gnu.org/licenses/>. */ -#include <stdlib.h> -#include <string.h> +#include "ganv-private.h" +#include "ganv/box.h" #include "ganv/canvas.h" +#include "ganv/item.h" #include "ganv/module.h" +#include "ganv/node.h" #include "ganv/port.h" +#include "ganv/text.h" +#include "ganv/types.h" #include "ganv/widget.h" -#include "./color.h" -#include "./boilerplate.h" -#include "./gettext.h" -#include "./ganv-private.h" +#include <cairo.h> +#include <glib-object.h> +#include <glib.h> +#include <gobject/gclosure.h> +#include <gtk/gtk.h> + +#include <stdarg.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> #define FOREACH_PORT(ports, i) \ for (GanvPort** i = (GanvPort**)ports->pdata; \ @@ -13,14 +13,26 @@ * with Ganv. If not, see <http://www.gnu.org/licenses/>. */ +#include "boilerplate.h" +#include "color.h" +#include "ganv-marshal.h" +#include "ganv-private.h" +#include "gettext.h" + #include "ganv/canvas.h" +#include "ganv/edge.h" +#include "ganv/item.h" #include "ganv/node.h" +#include "ganv/text.h" +#include "ganv/types.h" + +#include <cairo.h> +#include <gdk/gdk.h> +#include <glib-object.h> +#include <glib.h> +#include <gtk/gtk.h> -#include "./boilerplate.h" -#include "./color.h" -#include "./ganv-marshal.h" -#include "./ganv-private.h" -#include "./gettext.h" +#include <stddef.h> guint signal_moved; @@ -13,17 +13,30 @@ * with Ganv. If not, see <http://www.gnu.org/licenses/>. */ -#include <math.h> -#include <stdlib.h> +#include "boilerplate.h" +#include "color.h" +#include "ganv-private.h" +#include "gettext.h" +#include "ganv/box.h" #include "ganv/canvas.h" -#include "ganv/port.h" +#include "ganv/edge.h" +#include "ganv/item.h" #include "ganv/module.h" +#include "ganv/node.h" +#include "ganv/port.h" +#include "ganv/text.h" +#include "ganv/types.h" -#include "./boilerplate.h" -#include "./color.h" -#include "./ganv-private.h" -#include "./gettext.h" +#include <cairo.h> +#include <gdk/gdk.h> +#include <glib-object.h> +#include <glib.h> +#include <gtk/gtk.h> + +#include <math.h> +#include <stdarg.h> +#include <stdlib.h> static const double PORT_LABEL_HPAD = 4.0; static const double PORT_LABEL_VPAD = 1.0; @@ -13,20 +13,30 @@ * with Ganv. If not, see <http://www.gnu.org/licenses/>. */ -#include <math.h> -#include <stdint.h> -#include <stdlib.h> -#include <string.h> - -#include <gtk/gtkstyle.h> +#include "boilerplate.h" +#include "color.h" +#include "ganv-private.h" +#include "gettext.h" #include "ganv/canvas.h" +#include "ganv/item.h" +#include "ganv/node.h" #include "ganv/text.h" +#include "ganv/types.h" + +#include <cairo.h> +#include <glib-object.h> +#include <glib.h> +#include <gtk/gtk.h> +#include <pango/pango-font.h> +#include <pango/pango-fontmap.h> +#include <pango/pango-layout.h> +#include <pango/pango-types.h> +#include <pango/pangocairo.h> -#include "./color.h" -#include "./boilerplate.h" -#include "./gettext.h" -#include "./ganv-private.h" +#include <math.h> +#include <stdlib.h> +#include <string.h> G_DEFINE_TYPE_WITH_CODE(GanvText, ganv_text, GANV_TYPE_ITEM, G_ADD_PRIVATE(GanvText)) diff --git a/src/widget.c b/src/widget.c index 5828922..e67a485 100644 --- a/src/widget.c +++ b/src/widget.c @@ -17,15 +17,22 @@ * Copyright 1997-2000 Free Software Foundation */ -#include <math.h> - -#include <gtk/gtksignal.h> +#include "ganv-private.h" +#include "gettext.h" #include "ganv/canvas.h" +#include "ganv/item.h" #include "ganv/widget.h" -#include "./gettext.h" -#include "./ganv-private.h" +#include <cairo.h> +#include <glib-object.h> +#include <glib.h> +#include <gobject/gclosure.h> +#include <gtk/gtk.h> +#include <gtk/gtktypebuiltins.h> + +#include <math.h> +#include <stddef.h> G_DEFINE_TYPE_WITH_CODE(GanvWidget, ganv_widget, GANV_TYPE_ITEM, G_ADD_PRIVATE(GanvWidget)) |