summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Canvas.cpp87
-rw-r--r--src/Port.cpp17
-rw-r--r--src/boilerplate.h9
-rw-r--r--src/box.c22
-rw-r--r--src/circle.c23
-rw-r--r--src/edge.c22
-rw-r--r--src/fdgl.hpp5
-rw-r--r--src/ganv-private.h9
-rw-r--r--src/ganv_bench.cpp26
-rw-r--r--src/ganv_test.c4
-rw-r--r--src/group.c14
-rw-r--r--src/item.c19
-rw-r--r--src/module.c22
-rw-r--r--src/node.c22
-rw-r--r--src/port.c27
-rw-r--r--src/text.c30
-rw-r--r--src/widget.c17
17 files changed, 261 insertions, 114 deletions
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
diff --git a/src/box.c b/src/box.c
index 4ee8e29..01814d1 100644
--- a/src/box.c
+++ b/src/box.c
@@ -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))
diff --git a/src/edge.c b/src/edge.c
index 417030a..a1a5df2 100644
--- a/src/edge.c
+++ b/src/edge.c
@@ -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
diff --git a/src/item.c b/src/item.c
index c44085b..06db304 100644
--- a/src/item.c
+++ b/src/item.c
@@ -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; \
diff --git a/src/node.c b/src/node.c
index c93e116..81d10a6 100644
--- a/src/node.c
+++ b/src/node.c
@@ -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;
diff --git a/src/port.c b/src/port.c
index e06c64b..dcd3ac3 100644
--- a/src/port.c
+++ b/src/port.c
@@ -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;
diff --git a/src/text.c b/src/text.c
index 89e460e..058d765 100644
--- a/src/text.c
+++ b/src/text.c
@@ -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))