From: g0dil Date: Fri, 20 Oct 2006 14:32:45 +0000 (+0000) Subject: Dia2Png Doxygen started X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=a8fdb0af3bf0de5fafb0b1f40496ce221d834b26;p=senf.git Dia2Png Doxygen started git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@148 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/Packets/Packet.hh b/Packets/Packet.hh index ef25f14..14345e3 100644 --- a/Packets/Packet.hh +++ b/Packets/Packet.hh @@ -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 index 0000000..5f8af49 --- /dev/null +++ b/satscons/Dia2Png.py @@ -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 diff --git a/satscons/Doxygen.py b/satscons/Doxygen.py index b954832..27131e3 100644 --- a/satscons/Doxygen.py +++ b/satscons/Doxygen.py @@ -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,//p\' \' \' -k4 && sed -ne \'/<\\/table>/,$$p\' annotated.html.new && mv annotated.html.new annotated.html', "touch $TARGET" ], source_scanner = SCons.Defaults.ObjSourceScan) ]) env.Clean(stamp, dir) diff --git a/satscons/SatSCons.py b/satscons/SatSCons.py index b14b2ac..224591d 100644 --- a/satscons/SatSCons.py +++ b/satscons/SatSCons.py @@ -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)