Add helper to wrap long (template) class labels in dot graphs
g0dil [Thu, 26 Jul 2007 10:58:44 +0000 (10:58 +0000)]
git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@354 270642c3-0616-0410-b53a-bc976706d245

doclib/Doxyfile.global
doclib/dot [new file with mode: 0755]
doclib/dot-munge.pl [new file with mode: 0755]

index 5d8dbba..b2d6303 100644 (file)
@@ -36,13 +36,16 @@ GENERATE_XML           = YES
 
 HAVE_DOT               = YES
 CLASS_GRAPH            = YES
-COLLABORATION_GRAPH    = YES
-TEMPLATE_RELATIONS     = YES
+COLLABORATION_GRAPH    = NO
+TEMPLATE_RELATIONS     = NO
 INCLUDE_GRAPH          = YES
 INCLUDED_BY_GRAPH      = YES
+GROUP_GRAPHS           = NO
 MAX_DOT_GRAPH_WIDTH    = 800
-MAX_DOT_GRAPH_HEIGHT   = 1200
+MAX_DOT_GRAPH_HEIGHT   = 1600
 MAX_DOT_GRAPH_DEPTH    = 3
 DOT_MULTI_TARGETS      = YES
+DOT_CLEANUP            = NO
+DOT_PATH               = "$(TOPDIR)/doclib"
 
 @INCLUDE = "$(TOPDIR)/Doxyfile.local"
diff --git a/doclib/dot b/doclib/dot
new file mode 100755 (executable)
index 0000000..fca62c8
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+topdir="`dirname "$0"`"; topdir="`cd "$topdir/.."; pwd`"
+"$topdir/doclib/dot-munge.pl" "$1"
+exec dot "$@"
diff --git a/doclib/dot-munge.pl b/doclib/dot-munge.pl
new file mode 100755 (executable)
index 0000000..d11a556
--- /dev/null
@@ -0,0 +1,30 @@
+#!/usr/bin/perl -i -n
+
+# Reduce font size
+s/fontsize=10/fontsize=8/g; 
+
+# Wrap long labels (templates)
+if (/label=\"([^"]*)\"/) {                                 #"])){ # To make emacs happy ...
+    $pre=$`; 
+    $post=$';                                              #'     # To make emacs happy ...
+    $label=$1;
+
+    # Break at each komma
+    $label=~s/,/,\\r\\ \\ \\ \\ \\ \\ \\ \\ /g; 
+
+    # If more than one '<' is in the label, break after each '<'
+    if (($label=~tr/</</)>1) { 
+       $label=~s/</<\\r\\ \\ \\ \\ \\ \\ \\ \\ /g;
+    }
+
+    # If at least one break is in there ...
+    if ($label=~/\\r/) {
+       # Make last line flush right
+       $label.="\\r";
+       # and first line flush left
+       $label=~s/\\r/\\l/;
+    }
+    print "${pre}label=\"${label}\"${post}";
+} else { 
+    print;
+}