Dia2Png Doxygen started
g0dil [Fri, 20 Oct 2006 14:32:45 +0000 (14:32 +0000)]
git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@148 270642c3-0616-0410-b53a-bc976706d245

Packets/Packet.hh
satscons/Dia2Png.py [new file with mode: 0644]
satscons/Doxygen.py
satscons/SatSCons.py

index ef25f14..14345e3 100644 (file)
@@ -38,7 +38,7 @@
 // implementation.
 
 
-/** \mainpage The SatCom Packet Framework
+/** \mainpage The SENF Packet Library
 
     \section arch Overall Architecture
 
diff --git a/satscons/Dia2Png.py b/satscons/Dia2Png.py
new file mode 100644 (file)
index 0000000..5f8af49
--- /dev/null
@@ -0,0 +1,37 @@
+"""Dia2Png SCons Builder: Build a PNG file given a DIA file.
+
+Support the specification of a scalefactor in the DIA2PNGDPI Environment variable.
+
+"""
+
+import os
+import SCons.Builder
+
+def dia_getSize(env,source):
+    size = None
+    for line in popen(env['DIACOM']+" -e /proc/self/fd/1 -t eps "+source[0],"r"):
+        if line.startswith("%%BoundingBox:"):
+            size=map(int,line.split()[4:])
+    return size
+
+def dia2png_generator(source, target, env, for_signature):
+    if for_signature:
+        return "$DIACOM -t png -s $DIA2PNGDPI $TARGET $SOURCE"
+    size = dia_getSize(env,source)
+    if not size: return None;
+    size[0] = size[0]*72/int(env['DIA2PNGDPI'])
+    size[1] = size[1]*72/int(env['$DIA2PNGDPI'])
+    return env.Action("$DIACOM -t png -s %dx%d $TARGET $SOURCE" % size)
+
+Dia2Png = SCons.Builder.Builder(suffix = ".png",
+                                src_suffix = ".dia",
+                                generator = dia2png_generator,
+                                single_source = 1)
+
+def generate(env):
+    env['BUILDERS']['Dia2Png'] = Dia2Png
+    env['DIACOM'] = "dia"
+    env['DIA2PNGDPI'] = 115
+
+def exists(env):
+    return 1
index b954832..27131e3 100644 (file)
@@ -19,7 +19,6 @@ def Doxygen(env, target, source, image=[]):
                   for img in image ] +
                 [ env.Command(stamp, source,
                               [ 'cd $TARGET.dir && $DOXYGENCOM',
-                                # 'cd $TARGET.dir/doc/html && (sed -ne \'1,/<table>/p\' <annotated.html && grep -F \'<tr>\' <annotated.html | sort -ft\'>\' -k4 && sed -ne \'/<\\/table>/,$$p\' <annotated.html) >annotated.html.new && mv annotated.html.new annotated.html',
                                 "touch $TARGET" ],
                               source_scanner = SCons.Defaults.ObjSourceScan) ])
     env.Clean(stamp, dir)
index b14b2ac..224591d 100644 (file)
@@ -139,13 +139,13 @@ def Objects(env, sources, testSources = None, LIBS = []):
 
     return objects
 
-def Doxygen(env, sources, testSources = None, image = []):
+def Doxygen(env, sources, testSources = None, target='doc', image = []):
     if type(sources) == type(()):
         testSources = sources[1]
         sources = sources[0]
 
     doc = env.Doxygen(
-        target = 'doc',
+        target = target,
         source = sources,
         image = image)