summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMelvin Vermeeren2016-02-22 21:02:43 +0100
committerMelvin Vermeeren2016-02-22 21:03:14 +0100
commit9ce0e7952cbaca0891c995863505e5a57e735ce9 (patch)
tree531c4f4a3417cc1f12b0f4683de1068d8781c56b
downloadaur-9ce0e7952cbaca0891c995863505e5a57e735ce9.tar.gz
DrawTiming 0.7.1 with patches.
-rw-r--r--.SRCINFO39
-rw-r--r--0001-gcc43.patch11
-rw-r--r--0002-switch_LDFLAGS_LDADD.patch36
-rw-r--r--0003-highlight_rows.patch203
-rw-r--r--0004-drawtiming_cairo.patch672
-rw-r--r--0005-drawtiming-color-support.patch183
-rw-r--r--0006-analog_values.patch105
-rw-r--r--0007-transition_percentage.patch263
-rw-r--r--0008-grid.patch88
-rw-r--r--0009-manpage-fix.patch62
-rw-r--r--PKGBUILD65
11 files changed, 1727 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..58c1ee31c52
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,39 @@
+# Generated by mksrcinfo v8
+# Mon Feb 22 20:02:36 UTC 2016
+pkgbase = drawtiming
+ pkgdesc = Tool that converts ASCII to UML Timing Diagrams.
+ pkgver = 0.7.1
+ pkgrel = 1
+ url = http://drawtiming.sourceforge.net/
+ arch = i686
+ arch = x86_64
+ license = GPL2
+ makedepends = subversion
+ depends = imagemagick
+ depends = ghostscript
+ depends = cairo
+ source = https://downloads.sourceforge.net/project/drawtiming/drawtiming/0.7.1/drawtiming-0.7.1.tar.gz
+ source = https://downloads.sourceforge.net/project/drawtiming/drawtiming/0.7.1/drawtiming-0.7.1.tar.gz.asc
+ source = 0001-gcc43.patch
+ source = 0002-switch_LDFLAGS_LDADD.patch
+ source = 0003-highlight_rows.patch
+ source = 0004-drawtiming_cairo.patch
+ source = 0005-drawtiming-color-support.patch
+ source = 0006-analog_values.patch
+ source = 0007-transition_percentage.patch
+ source = 0008-grid.patch
+ source = 0009-manpage-fix.patch
+ sha256sums = ae35a369f71f03b219d23f56329ced73100f79ffda38dd8d31d1e9e510f3cf6e
+ sha256sums = SKIP
+ sha256sums = e2fc55753c003233ed3797d1b7c1e53cb0d38792cfb94d49b139049f1555da84
+ sha256sums = 088407c2e04b7a0df73cdaeb3a31d2270c5056102b6f9bf2ab38e6b996a47140
+ sha256sums = 917d344f23000f9d53773ef3a5cdc8a0ab5348b2ef6ef4cb47c41c27e4fedca5
+ sha256sums = 2815283a41b6b832aca82e7a26110f358bd01d428dfd5c86e622e8996252c7e0
+ sha256sums = 31eac54da13f61a9c17aceac645f37e98baef9ae3ed840f8c8c5275d70abded2
+ sha256sums = 4ca14d1dbf67ebcd42f449a29a7db36070e19083352de2d11c1dc41989118bb1
+ sha256sums = 2c40999feea0fa1e91f6100c8bc4bab517e5d19182fab6b4f13b2f81a1861005
+ sha256sums = e19f9d86b550b0d14f9805e79b41d99973aa5ec3999443ee5cf0a5b64eccbc82
+ sha256sums = 29881f7bbac6b06d75813c726132b6971c699e2aefa515720809de06d6acfbb7
+
+pkgname = drawtiming
+
diff --git a/0001-gcc43.patch b/0001-gcc43.patch
new file mode 100644
index 00000000000..9e3bcf726ca
--- /dev/null
+++ b/0001-gcc43.patch
@@ -0,0 +1,11 @@
+diff -ur drawtiming-0.7//src/timing.cc drawtiming-0.7_orig//src/timing.cc
+--- src/timing.cc 2008-05-18 02:09:56.000000000 +0200
++++ src/timing.cc 2008-08-15 12:05:19.000000000 +0200
+@@ -20,6 +20,7 @@
+ #include "timing.h"
+ #include <map>
+ #include <fstream>
++#include <cstring>
+ using namespace std;
+ using namespace timing;
+ using namespace Magick;
diff --git a/0002-switch_LDFLAGS_LDADD.patch b/0002-switch_LDFLAGS_LDADD.patch
new file mode 100644
index 00000000000..8ae536630de
--- /dev/null
+++ b/0002-switch_LDFLAGS_LDADD.patch
@@ -0,0 +1,36 @@
+Description: Switch LDADD with LDFLAGS
+ This change is to move the objects before the libs. to fix an FTBFS when
+ --as-needed is passed to gcc.
+Author: أحمد المحمودي (Ahmed El-Mahmoudy) <aelmahmoudy@sabily.org>
+Forwarded: yes
+--- drawtiming-0.7.1.orig/src/Makefile.am
++++ drawtiming-0.7.1/src/Makefile.am
+@@ -3,7 +3,7 @@
+
+ bin_PROGRAMS = drawtiming
+ drawtiming_SOURCES = main.cc globals.h parser.yy scanner.ll timing.cc timing.h
+-drawtiming_LDFLAGS = @MAGICK_LIBS@
++drawtiming_LDADD = @MAGICK_LIBS@
+
+ EXTRA_DIST = parser.h
+ BUILT_SOURCES = parser.h
+--- drawtiming-0.7.1.orig/src/Makefile.in
++++ drawtiming-0.7.1/src/Makefile.in
+@@ -51,7 +51,7 @@
+ am_drawtiming_OBJECTS = main.$(OBJEXT) parser.$(OBJEXT) \
+ scanner.$(OBJEXT) timing.$(OBJEXT)
+ drawtiming_OBJECTS = $(am_drawtiming_OBJECTS)
+-drawtiming_LDADD = $(LDADD)
++drawtiming_LDADD = @MAGICK_LIBS@ $(LDADD)
+ DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+ depcomp = $(SHELL) $(top_srcdir)/depcomp
+ am__depfiles_maybe = depfiles
+@@ -159,7 +159,7 @@
+ AM_CXXFLAGS = @MAGICK_CFLAGS@ -DYYDEBUG=1
+ AM_YFLAGS = -d
+ drawtiming_SOURCES = main.cc globals.h parser.yy scanner.ll timing.cc timing.h
+-drawtiming_LDFLAGS = @MAGICK_LIBS@
++drawtiming_LDFLAGS = @LDFLAGS@
+ EXTRA_DIST = parser.h
+ BUILT_SOURCES = parser.h
+ all: $(BUILT_SOURCES)
diff --git a/0003-highlight_rows.patch b/0003-highlight_rows.patch
new file mode 100644
index 00000000000..f4fd1d6834a
--- /dev/null
+++ b/0003-highlight_rows.patch
@@ -0,0 +1,203 @@
+--- src/main.cc 2009-04-02 20:01:53.000000000 -0700
++++ src/main.cc 2010-03-31 16:30:41.213731000 -0700
+@@ -35,6 +35,7 @@
+ #define FLAG_PAGESIZE 1
+ #define FLAG_SCALE 2
+ #define FLAG_ASPECT 4
++#define FLAG_HIGHLIGHT_ROWS 8
+
+ extern FILE *yyin;
+ extern int yydebug;
+@@ -61,7 +62,8 @@
+ OPT_SCALE,
+ OPT_PAGESIZE,
+ OPT_VERBOSE,
+- OPT_VERSION
++ OPT_VERSION,
++ OPT_HIGHLIGHT_ROWS
+ };
+
+ #ifdef HAVE_GETOPT_H
+@@ -79,6 +81,7 @@
+ {"pagesize", required_argument, NULL, OPT_PAGESIZE},
+ {"verbose", no_argument, NULL, OPT_VERBOSE},
+ {"version", no_argument, NULL, OPT_VERSION},
++ {"highlight-rows",no_argument, NULL, OPT_HIGHLIGHT_ROWS},
+ {0, 0, 0, 0}
+ };
+ #endif
+@@ -87,9 +90,9 @@
+ int width, int height, double scale)
+ {
+ if (flags & FLAG_PAGESIZE)
+- render (gc, data, width, height, (flags & FLAG_ASPECT));
++ render (gc, data, width, height, (flags & FLAG_ASPECT),(flags & FLAG_HIGHLIGHT_ROWS));
+ else
+- render (gc, data, scale);
++ render (gc, data, scale,(flags & FLAG_HIGHLIGHT_ROWS));
+ }
+
+ int main (int argc, char *argv[]) {
+@@ -151,7 +154,10 @@
+ case 'w':
+ case OPT_CELL_WIDTH:
+ timing::vCellW = atoi (optarg);
+- break;
++ break;
++ case OPT_HIGHLIGHT_ROWS:
++ flags |= FLAG_HIGHLIGHT_ROWS;
++ break;
+ }
+
+ if (optind >= argc) {
+@@ -274,6 +280,8 @@
+ << "-v" << endl
+ << "--verbose" << endl
+ << " Increases the quantity of diagnostic output." << endl
++ << "--highlight-rows" << endl
++ << " Whether rows should be highlighted different colors for readability." << endl
+ << "-c" << endl
+ << "--cell-height" << endl
+ << " Height of the signal (pixels) [48]." << endl
+diff -u -r src/timing.cc src/timing.cc
+--- src/timing.cc 2009-04-02 20:02:21.000000000 -0700
++++ src/timing.cc 2010-03-31 16:47:16.117173000 -0700
+@@ -603,19 +603,34 @@
+ gc.font (vFont);
+ gc.point_size (vFontPointsize);
+ gc.stroke_width (vLineWidth);
+- gc.stroke_color ("black");
++
+
+ int labelWidth = label_width (d);
+
+ // draw a "scope-like" diagram for each signal
+ map<signame,int> ypos;
+ int y = 0;
++ const int num_row_colors = 4;
++ string row_colors[] = { "white","grey", "white","CornflowerBlue"};
++ int cur_row_color_idx = 0;
+ for (signal_sequence::const_iterator i = d.sequence.begin ();
+ i != d.sequence.end (); ++ i) {
+ const sigdata &sig = d.find_signal (*i);
+- push_text (gc, vCellWrm, y + vCellHtxt, *i);
+ ypos[*i] = y;
+ int x = labelWidth + vCellWtsep;
++ if (gc.highlightRows) {
++ string cur_row_color = row_colors[cur_row_color_idx];
++ gc.stroke_color (cur_row_color);
++ gc.fill_color(cur_row_color);
++ gc.drawrect(0,y,x+sig.data.size()*vCellW,y+vCellHt);
++ gc.stroke_color ("black");
++ gc.fill_color("black");
++ cur_row_color_idx++;
++ cur_row_color_idx = cur_row_color_idx%num_row_colors;
++ }
++ push_text (gc, vCellWrm, y + vCellHtxt, *i);
+ sigvalue last;
+ for (value_sequence::const_iterator j = sig.data.begin ();
+ j != sig.data.end (); ++ j) {
+@@ -649,24 +664,26 @@
+
+ // ------------------------------------------------------------
+
+-void timing::render (gc &gc, const data &d, double scale) {
++void timing::render (gc &gc, const data &d, double scale, bool highlightRows) {
+ int base_width, base_height;
+ base_size (d, base_width, base_height);
+
+ gc.width = (int)(scale * base_width);
+ gc.height = (int)(scale * base_height);
++ gc.highlightRows = highlightRows;
+
+ render_common (gc, d, scale, scale);
+ }
+
+ // ------------------------------------------------------------
+
+-void timing::render (gc &gc, const data &d, int w, int h, bool fixAspect) {
++void timing::render (gc &gc, const data &d, int w, int h, bool fixAspect, bool highlightRows) {
+ int base_width, base_height;
+ base_size (d, base_width, base_height);
+
+ gc.width = w;
+ gc.height = h;
++ gc.highlightRows = highlightRows;
+
+ double hscale = w / (double)base_width;
+ double vscale = h / (double)base_height;
+@@ -715,6 +732,10 @@
+ drawables.push_back (DrawableLine (x1, y1, x2, y2));
+ }
+
++void magick_gc::drawrect(int x1, int y1, int x2, int y2) {
++ drawables.push_back (DrawableRectangle (x1,y1,x2,y2));
++}
++
+ // ------------------------------------------------------------
+
+ void magick_gc::point_size (int size) {
+@@ -831,6 +852,17 @@
+ ps_text << "stroke\n";
+ }
+
++void postscript_gc::drawrect(int x1, int y1, int x2, int y2) {
++ std::list<Magick::Coordinate> points;
++ points.push_back (Magick::Coordinate (x1, y1));
++ points.push_back (Magick::Coordinate (x1, y2));
++ points.push_back (Magick::Coordinate (x2, y2));
++ points.push_back (Magick::Coordinate (x2, y1));
++ points.push_back (Magick::Coordinate (x1, y1));
++
++ polygon (points);
++}
++
+ // ------------------------------------------------------------
+
+ void postscript_gc::point_size (int size) {
+diff -u -r src/timing.h src/timing.h
+--- src/timing.h 2009-04-02 20:02:40.000000000 -0700
++++ src/timing.h 2010-03-31 16:47:43.243827000 -0700
+@@ -125,6 +125,7 @@
+ class gc {
+ public:
+ int width, height;
++ bool highlightRows;
+
+ gc (void) : width(0), height(0) { }
+ virtual ~gc() { }
+@@ -142,6 +143,7 @@
+ virtual void stroke_color (const std::string &name) = 0;
+ virtual void stroke_width (int w) = 0;
+ virtual void text (int x, int y, const std::string &text) = 0;
++ virtual void drawrect (int x1, int y1, int x2, int y2) = 0;
+ };
+
+ #ifndef LITE
+@@ -156,6 +158,7 @@
+ void fill_opacity (int op);
+ void font (const std::string &name);
+ void line (int x1, int y1, int x2, int y2);
++ void drawrect (int x1, int y1, int x2, int y2);
+ void point_size (int size);
+ void polygon (const std::list<Magick::Coordinate> &points);
+ void pop (void);
+@@ -181,6 +184,7 @@
+ void fill_opacity (int op);
+ void font (const std::string &name);
+ void line (int x1, int y1, int x2, int y2);
++ void drawrect (int x1, int y1, int x2, int y2);
+ void point_size (int size);
+ void polygon (const std::list<Magick::Coordinate> &points);
+ void pop (void);
+@@ -196,8 +200,8 @@
+ static bool has_ps_ext (const std::string& filename);
+ };
+
+- void render (gc &gc, const data &d, double scale);
+- void render (gc &gc, const data &d, int w, int h, bool fixAspect);
++ void render (gc &gc, const data &d, double scale, bool highlightRows);
++ void render (gc &gc, const data &d, int w, int h, bool fixAspect,bool highlightRows);
+ };
+
+ std::ostream &operator<< (std::ostream &f, const timing::data &d); \ No newline at end of file
diff --git a/0004-drawtiming_cairo.patch b/0004-drawtiming_cairo.patch
new file mode 100644
index 00000000000..f55af07f908
--- /dev/null
+++ b/0004-drawtiming_cairo.patch
@@ -0,0 +1,672 @@
+? drawtiming_cairo.diff
+? ylwrap
+Index: configure.in
+===================================================================
+RCS file: /cvsroot/drawtiming/drawtiming/configure.in,v
+retrieving revision 1.7
+diff -u -r1.7 configure.in
+--- configure.in 5 May 2007 16:26:58 -0000 1.7
++++ configure.in 7 Jul 2007 09:44:10 -0000
+@@ -9,6 +9,8 @@
+ AC_CHECK_LIB(gnugetopt, getopt_long)
+ AC_CHECK_HEADERS(getopt.h)
+
++PKG_CHECK_MODULES([CAIROMM], [cairomm-1.0 >= 1.2.0])
++
+ # define Magick++ compile flags
+ MAGICK_CPPFLAGS=$(Magick++-config --cppflags)
+ MAGICK_CXXFLAGS=$(Magick++-config --cxxflags)
+Index: src/Makefile.am
+===================================================================
+RCS file: /cvsroot/drawtiming/drawtiming/src/Makefile.am,v
+retrieving revision 1.2
+diff -u -r1.2 Makefile.am
+--- src/Makefile.am 22 Sep 2004 18:31:50 -0000 1.2
++++ src/Makefile.am 7 Jul 2007 09:44:10 -0000
+@@ -1,9 +1,9 @@
+-AM_CXXFLAGS = @MAGICK_CPPFLAGS@ @MAGICK_CXXFLAGS@ -DYYDEBUG=1
++AM_CXXFLAGS = @MAGICK_CPPFLAGS@ @MAGICK_CXXFLAGS@ @CAIROMM_CFLAGS@ -DYYDEBUG=1
+ AM_YFLAGS = -d
+
+ bin_PROGRAMS = drawtiming
+ drawtiming_SOURCES = main.cc globals.h parser.yy scanner.ll timing.cc timing.h
+-drawtiming_LDADD = @MAGICK_LIBS@
++drawtiming_LDADD = @MAGICK_LIBS@ @CAIROMM_LIBS@
+ drawtiming_LDFLAGS = @MAGICK_LDFLAGS@
+
+ EXTRA_DIST = parser.h
+Index: src/main.cc
+===================================================================
+RCS file: /cvsroot/drawtiming/drawtiming/src/main.cc,v
+retrieving revision 1.7
+diff -u -r1.7 main.cc
+--- src/main.cc 5 May 2007 16:26:58 -0000 1.7
++++ src/main.cc 7 Jul 2007 09:44:10 -0000
+@@ -29,6 +29,10 @@
+ #define FLAG_PAGESIZE 1
+ #define FLAG_SCALE 2
+ #define FLAG_ASPECT 4
++#define FLAG_SVG 8
++#define FLAG_PS 16
++#define FLAG_PDF 32
++#define FLAG_CAIROPNG 64
+
+ extern FILE *yyin;
+ extern int yydebug;
+@@ -41,6 +45,7 @@
+ timing::data data;
+ timing::signal_sequence deps;
+ timing::diagram diagram;
++timing::cairodiagram cairodiagram;
+ string outfile;
+ int verbose = 0;
+
+@@ -58,7 +63,11 @@
+ OPT_SCALE,
+ OPT_PAGESIZE,
+ OPT_VERBOSE,
+- OPT_VERSION
++ OPT_VERSION,
++ OPT_SVG,
++ OPT_PS,
++ OPT_PDF,
++ OPT_CAIROPNG
+ };
+
+ struct option opts[] = {
+@@ -74,6 +83,10 @@
+ {"pagesize", required_argument, NULL, OPT_PAGESIZE},
+ {"verbose", no_argument, NULL, OPT_VERBOSE},
+ {"version", no_argument, NULL, OPT_VERSION},
++ {"svg", no_argument, NULL, OPT_SVG},
++ {"ps", no_argument, NULL, OPT_PS},
++ {"pdf", no_argument, NULL, OPT_PDF},
++ {"cairopng", no_argument, NULL, OPT_CAIROPNG},
+ {0, 0, 0, 0}
+ };
+ #endif
+@@ -138,6 +151,18 @@
+ case OPT_CELL_WIDTH:
+ timing::vCellW = atoi (optarg);
+ break;
++ case OPT_SVG:
++ flags |= FLAG_SVG;
++ break;
++ case OPT_PS:
++ flags |= FLAG_PS;
++ break;
++ case OPT_PDF:
++ flags |= FLAG_PDF;
++ break;
++ case OPT_CAIROPNG:
++ flags |= FLAG_CAIROPNG;
++ break;
+ }
+
+ if (optind >= argc) {
+@@ -183,14 +208,29 @@
+ if (outfile.empty ())
+ return 0;
+
+- if (flags & FLAG_PAGESIZE)
+- diagram.render (data, width, height, (flags & FLAG_ASPECT));
+- else
+- diagram.render (data, scale);
+-
+- Image img (Geometry (diagram.width, diagram.height), "white");
+- img.draw (diagram);
+- img.write (outfile);
++ if (flags & (FLAG_SVG | FLAG_PS | FLAG_PDF | FLAG_CAIROPNG)) {
++ if (flags & FLAG_PAGESIZE)
++ cairodiagram.set_scale (data, width, height, (flags & FLAG_ASPECT));
++ else
++ cairodiagram.set_scale (data, scale);
++ if (flags & FLAG_SVG)
++ cairodiagram.render_to_svg (data, outfile);
++ else if (flags & FLAG_PS)
++ cairodiagram.render_to_ps (data, outfile);
++ else if (flags & FLAG_PDF)
++ cairodiagram.render_to_pdf (data, outfile);
++ else if (flags & FLAG_CAIROPNG)
++ cairodiagram.render_to_png (data, outfile);
++ } else {
++ if (flags & FLAG_PAGESIZE)
++ diagram.render (data, width, height, (flags & FLAG_ASPECT));
++ else
++ diagram.render (data, scale);
++
++ Image img (Geometry (diagram.width, diagram.height), "white");
++ img.draw (diagram);
++ img.write (outfile);
++ }
+ }
+ catch (Magick::Exception &err) {
+ cerr << "caught Magick++ exception: " << err.what () << endl;
+Index: src/timing.cc
+===================================================================
+RCS file: /cvsroot/drawtiming/drawtiming/src/timing.cc,v
+retrieving revision 1.9
+diff -u -r1.9 timing.cc
+--- src/timing.cc 5 May 2007 16:26:58 -0000 1.9
++++ src/timing.cc 7 Jul 2007 09:44:11 -0000
+@@ -677,3 +677,468 @@
+ push_back (DrawablePopGraphicContext ());
+ }
+
++// ------------------------------------------------------------
++
++cairodiagram::cairodiagram (void)
++ : m_xmin(numeric_limits<double>::max()),
++ m_xmax(numeric_limits<double>::min()),
++ m_ymin(numeric_limits<double>::max()),
++ m_ymax(numeric_limits<double>::min()),
++ m_xscale(1.0), m_yscale(1.0)
++{
++}
++
++cairodiagram::cairodiagram (const cairodiagram &d) {
++ *this = d;
++}
++
++// ------------------------------------------------------------
++
++cairodiagram &cairodiagram::operator= (const cairodiagram &d) {
++ m_xmin = d.m_xmin;
++ m_xmax = d.m_xmax;
++ m_ymin = d.m_ymin;
++ m_ymax = d.m_ymax;
++ m_xscale = d.m_xscale;
++ m_yscale = d.m_yscale;
++ return *this;
++}
++
++// ------------------------------------------------------------
++
++void cairodiagram::set_scale (const data &d, double scale) {
++ Cairo::RefPtr<Cairo::Surface> surface = Cairo::ImageSurface::create (Cairo::FORMAT_RGB24, 10, 10);
++ m_xmin = numeric_limits<double>::max ();
++ m_xmax = numeric_limits<double>::min ();
++ m_ymin = numeric_limits<double>::max ();
++ m_ymax = numeric_limits<double>::min ();
++ m_context = Cairo::Context::create (surface);
++ render_common (d);
++ m_context.clear ();
++ m_xscale = m_yscale = scale;
++}
++
++// ------------------------------------------------------------
++
++void cairodiagram::set_scale (const data &d, int w, int h, bool fixAspect) {
++ Cairo::RefPtr<Cairo::Surface> surface = Cairo::ImageSurface::create (Cairo::FORMAT_RGB24, 10, 10);
++ m_xmin = numeric_limits<double>::max ();
++ m_xmax = numeric_limits<double>::min ();
++ m_ymin = numeric_limits<double>::max ();
++ m_ymax = numeric_limits<double>::min ();
++ m_context = Cairo::Context::create (surface);
++ render_common (d);
++ m_context.clear ();
++
++ m_xscale = w / (double)max (0.1, m_xmax - m_xmin);
++ m_yscale = h / (double)max (0.1, m_ymax - m_ymin);
++
++ if (fixAspect) {
++ // to maintain aspect ratio, and fit the image:
++ m_xscale = m_yscale = min (m_xscale, m_yscale);
++ }
++}
++
++// ------------------------------------------------------------
++
++void cairodiagram::render_to_png (const data &d, const std::string& outfile) {
++ Cairo::RefPtr<Cairo::ImageSurface> surface = Cairo::ImageSurface::create (Cairo::FORMAT_RGB24,
++ (int)ceil ((m_xmax - m_xmin) * m_xscale),
++ (int)ceil ((m_ymax - m_ymin) * m_yscale));
++ m_context = Cairo::Context::create (surface);
++ m_context->translate (-m_xmin, -m_ymin);
++ m_context->scale (m_xscale, m_yscale);
++ render_common (d);
++ m_context.clear ();
++ surface->write_to_png(outfile);
++}
++
++// ------------------------------------------------------------
++
++void cairodiagram::render_to_svg (const data &d, const std::string& outfile) {
++ Cairo::RefPtr<Cairo::Surface> surface = Cairo::SvgSurface::create (outfile, (m_xmax - m_xmin) * m_xscale, (m_ymax - m_ymin) * m_yscale);
++ m_context = Cairo::Context::create (surface);
++ m_context->translate (-m_xmin, -m_ymin);
++ m_context->scale (m_xscale, m_yscale);
++ render_common (d);
++ m_context.clear ();
++}
++
++// ------------------------------------------------------------
++
++void cairodiagram::render_to_ps (const data &d, const std::string& outfile) {
++ Cairo::RefPtr<Cairo::Surface> surface = Cairo::PsSurface::create (outfile, (m_xmax - m_xmin) * m_xscale, (m_ymax - m_ymin) * m_yscale);
++ m_context = Cairo::Context::create (surface);
++ m_context->translate (-m_xmin, -m_ymin);
++ m_context->scale (m_xscale, m_yscale);
++ render_common (d);
++ m_context.clear ();
++}
++
++// ------------------------------------------------------------
++
++void cairodiagram::render_to_pdf (const data &d, const std::string& outfile) {
++ Cairo::RefPtr<Cairo::Surface> surface = Cairo::PdfSurface::create (outfile, (m_xmax - m_xmin) * m_xscale, (m_ymax - m_ymin) * m_yscale);
++ m_context = Cairo::Context::create (surface);
++ m_context->translate (-m_xmin, -m_ymin);
++ m_context->scale (m_xscale, m_yscale);
++ render_common (d);
++ m_context.clear ();
++}
++
++// ------------------------------------------------------------
++
++void cairodiagram::render_common (const data &d) {
++
++ vCellHsep = vCellHt / 8;
++ vCellH=vCellHt-vCellHsep;
++ vCellHtxt=vCellHt*3/4;
++ vCellHdel = vCellHt * 3/8;
++ vCellHtdel=vCellHt/4;
++ vCellWtsep=vCellW/4;
++ vCellWrm=vCellW/8;
++
++ m_context->select_font_face (vFont, Cairo::FONT_SLANT_NORMAL, Cairo::FONT_WEIGHT_NORMAL);
++ m_context->set_font_size (vFontPointsize);
++ m_context->set_line_width (vLineWidth);
++ m_context->set_source_rgb (0.0, 0.0, 0.0);
++
++
++ double labelWidth = label_width (d);
++
++ // draw a "scope-like" cairodiagram for each signal
++ map<signame,double> ypos;
++ double y = 0;
++ for (signal_sequence::const_iterator i = d.sequence.begin ();
++ i != d.sequence.end (); ++ i) {
++ const sigdata &sig = d.find_signal (*i);
++ render_text (vCellWrm, y + vCellHtxt, *i);
++ ypos[*i] = y;
++ double x = labelWidth + vCellWtsep;
++ sigvalue last;
++ for (value_sequence::const_iterator j = sig.data.begin ();
++ j != sig.data.end (); ++ j) {
++ draw_transition (x, y, last, *j);
++ last = *j;
++ x += vCellW;
++ }
++ y += vCellHt + vCellHdel * sig.maxdelays;
++ }
++
++ // draw the smooth arrows indicating the triggers for signal changes
++ for (list<depdata>::const_iterator i = d.dependencies.begin ();
++ i != d.dependencies.end (); ++ i)
++ draw_dependency (labelWidth + vCellWtsep + vCellWrm + vCellW * i->n_trigger,
++ vCellHt/2 + ypos[i->trigger],
++ labelWidth + vCellWtsep + vCellWrm + vCellW * i->n_effect,
++ vCellHt/2 + ypos[i->effect]);
++
++ // draw the timing delay annotations
++ for (list<delaydata>::const_iterator i = d.delays.begin ();
++ i != d.delays.end (); ++ i)
++ draw_delay (labelWidth + vCellWtsep + vCellWrm + vCellW * i->n_trigger,
++ vCellHt/2 + ypos[i->trigger],
++ labelWidth + vCellWtsep + vCellWrm + vCellW * i->n_effect,
++ vCellHt/2 + ypos[i->effect],
++ ypos[i->trigger] + vCellHt + vCellHdel * i->offset + vCellHtdel,
++ i->text);
++
++}
++
++// ------------------------------------------------------------
++// add text to the cairodiagram
++
++void cairodiagram::render_text (double xpos, double ypos, const string &text) {
++ m_context->save ();
++ m_context->set_line_width (1);
++ m_context->move_to (xpos, ypos);
++ Cairo::TextExtents te;
++ m_context->get_text_extents (text, te);
++ m_xmin = min (m_xmin, xpos);
++ m_xmax = max (m_xmax, xpos + te.width);
++ m_ymin = min (m_ymin, ypos);
++ m_ymax = max (m_ymax, ypos + te.height);
++ m_context->show_text (text);
++ m_context->restore ();
++}
++
++// ------------------------------------------------------------
++// render line
++
++void cairodiagram::render_line (double x1, double y1, double x2, double y2)
++{
++ m_context->move_to (x1, y1);
++ m_context->line_to (x2, y2);
++ stroke ();
++}
++
++// ------------------------------------------------------------
++// render polygon
++
++void cairodiagram::render_poly (double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4, bool fill)
++{
++ m_context->move_to (x1, y1);
++ m_context->line_to (x2, y2);
++ m_context->line_to (x3, y3);
++ m_context->line_to (x4, y4);
++ m_context->close_path ();
++ if (fill)
++ m_context->fill_preserve ();
++ stroke ();
++}
++
++// ------------------------------------------------------------
++// render bezier curve
++
++void cairodiagram::render_bezier (double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4)
++{
++ m_context->move_to (x1, y1);
++ m_context->curve_to (x2, y2, x3, y3, x4, y4);
++ stroke ();
++}
++
++// ------------------------------------------------------------
++// stroke (and destroy) the current path
++
++void cairodiagram::stroke (void) {
++ double x1, x2, y1, y2;
++ m_context->get_stroke_extents (x1, y1, x2, y2);
++ m_xmin = min (m_xmin, x1);
++ m_xmax = max (m_xmax, x2);
++ m_ymin = min (m_ymin, y1);
++ m_ymax = max (m_ymax, y2);
++ m_context->stroke ();
++}
++
++// ------------------------------------------------------------
++// calculate the required label width
++
++double cairodiagram::label_width (const data &d) const {
++ double labelWidth = 0.0;
++ Cairo::TextExtents te;
++
++ m_context->select_font_face (vFont, Cairo::FONT_SLANT_NORMAL, Cairo::FONT_WEIGHT_NORMAL);
++ m_context->set_font_size (vFontPointsize);
++ for (signal_sequence::const_iterator i = d.sequence.begin ();
++ i != d.sequence.end (); ++ i) {
++ m_context->get_text_extents (*i, te);
++ labelWidth = max (labelWidth, te.width);
++ }
++ return labelWidth;
++}
++
++// ------------------------------------------------------------
++
++void cairodiagram::draw_transition (double x, double y, const sigvalue &last,
++ const sigvalue &value) {
++
++ switch (value.type) {
++ case ZERO:
++ switch (last.type) {
++ default:
++ render_line (x, y + vCellH, x + vCellW, y + vCellH);
++ break;
++
++ case ONE:
++ render_line (x, y + vCellHsep, x + vCellW/4, y + vCellH);
++ render_line (x + vCellW/4, y + vCellH, x + vCellW, y + vCellH);
++ break;
++
++ case Z:
++ render_line (x, y + vCellHt/2, x + vCellW/4, y + vCellH);
++ render_line (x + vCellW/4, y + vCellH, x + vCellW, y + vCellH);
++ break;
++
++ case STATE:
++ render_line (x, y + vCellHsep, x + vCellW/4, y + vCellH);
++ render_line (x, y + vCellH, x + vCellW, y + vCellH);
++ break;
++ }
++ break;
++
++ case ONE:
++ switch (last.type) {
++ default:
++ render_line (x, y + vCellHsep, x + vCellW, y + vCellHsep);
++ break;
++
++ case ZERO:
++ case TICK:
++ case PULSE:
++ render_line (x, y + vCellH, x + vCellW/4, y + vCellHsep);
++ render_line (x + vCellW/4, y + vCellHsep, x + vCellW, y + vCellHsep);
++ break;
++
++ case Z:
++ render_line (x, y + vCellHt/2, x + vCellW/4, y + vCellHsep);
++ render_line (x + vCellW/4, y + vCellHsep, x + vCellW, y + vCellHsep);
++ break;
++
++ case STATE:
++ render_line (x, y + vCellH, x + vCellW/4, y + vCellHsep);
++ render_line (x, y + vCellHsep, x + vCellW, y + vCellHsep);
++ break;
++ }
++ break;
++
++ case TICK:
++ case PULSE:
++ switch (last.type) {
++ default:
++ render_line (x, y + vCellH, x + vCellW/4, y + vCellHsep);
++ render_line (x + vCellW/4, y + vCellHsep, x + vCellW/2, y + vCellHsep);
++ render_line (x + vCellW/2, y + vCellHsep, x + vCellW*3/4, y + vCellH);
++ render_line (x + vCellW*3/4, y + vCellH, x + vCellW, y + vCellH);
++ break;
++
++ case ONE:
++ case X:
++ render_line (x, y + vCellHsep, x + vCellW/2, y + vCellHsep);
++ render_line (x + vCellW/2, y + vCellHsep, x + vCellW*3/4, y + vCellH);
++ render_line (x + vCellW*3/4, y + vCellH, x + vCellW, y + vCellH);
++ break;
++
++ case Z:
++ render_line (x, y + vCellHt/2, x + vCellW/4, y + vCellHsep);
++ render_line (x + vCellW/4, y + vCellHsep, x + vCellW/2, y + vCellHsep);
++ render_line (x + vCellW/2, y + vCellHsep, x + vCellW*3/4, y + vCellH);
++ render_line (x + vCellW*3/4, y + vCellH, x + vCellW, y + vCellH);
++ break;
++
++ case STATE:
++ render_line (x, y + vCellH, x + vCellW/4, y + vCellHsep);
++ render_line (x, y + vCellHsep, x + vCellW/2, y + vCellHsep);
++ render_line (x + vCellW/2, y + vCellHsep, x + vCellW*3/4, y + vCellH);
++ render_line (x + vCellW*3/4, y + vCellH, x + vCellW, y + vCellH);
++ break;
++ }
++ break;
++
++ case UNDEF:
++ case X:
++ for (int i = 0; i < 4; ++ i) {
++ render_line (x+i*(vCellW/4), y + vCellH,
++ x+(i+1)*(vCellW/4), y + vCellHsep);
++ render_line (x+i*(vCellW/4), y + vCellHsep,
++ x+(i+1)*(vCellW/4), y + vCellH);
++ }
++ break;
++
++ case Z:
++ switch (last.type) {
++ default:
++ render_line (x, y + vCellHt/2, x + vCellW, y + vCellHt/2);
++ break;
++
++ case ZERO:
++ case TICK:
++ case PULSE:
++ render_line (x, y + vCellH, x + vCellW/4, y + vCellHt/2);
++ render_line (x + vCellW/4, y + vCellHt/2, x + vCellW, y + vCellHt/2);
++ break;
++
++ case ONE:
++ render_line (x, y + vCellHsep, x + vCellW/4, y + vCellHt/2);
++ render_line (x + vCellW/4, y + vCellHt/2, x + vCellW, y + vCellHt/2);
++ break;
++
++ case STATE:
++ render_line (x, y + vCellHsep, x + vCellW/8, y + vCellHt/2);
++ render_line (x, y + vCellH, x + vCellW/8, y + vCellHt/2);
++ render_line (x + vCellW/8, y + vCellHt/2, x + vCellW, y + vCellHt/2);
++ break;
++ }
++ break;
++
++ case STATE:
++ switch (last.type) {
++ default:
++ if (value.text != last.text) {
++ render_line (x, y + vCellHsep, x + vCellW/4, y + vCellH);
++ render_line (x, y + vCellH, x + vCellW/4, y + vCellHsep);
++ render_line (x + vCellW/4, y + vCellHsep, x + vCellW, y + vCellHsep);
++ render_line (x + vCellW/4, y + vCellH, x + vCellW, y + vCellH);
++ render_text (x + vCellW/4, y + vCellHtxt, value.text);
++ }
++ else {
++ render_line (x, y + vCellHsep, x + vCellW, y + vCellHsep);
++ render_line (x, y + vCellH, x + vCellW, y + vCellH);
++ }
++ break;
++
++ case ZERO:
++ case TICK:
++ case PULSE:
++ render_line (x, y + vCellH, x + vCellW/4, y + vCellHsep);
++ render_line (x + vCellW/4, y + vCellHsep, x + vCellW, y + vCellHsep);
++ render_line (x, y + vCellH, x + vCellW, y + vCellH);
++ render_text (x + vCellW/4, y + vCellHtxt, value.text);
++ break;
++
++ case ONE:
++ render_line (x, y + vCellHsep, x + vCellW/4, y + vCellH);
++ render_line (x + vCellW/4, y + vCellH, x + vCellW, y + vCellH);
++ render_line (x, y + vCellHsep, x + vCellW, y + vCellHsep);
++ render_text (x + vCellW/4, y + vCellHtxt, value.text);
++ break;
++
++ case Z:
++ render_line (x, y + vCellW/4, x + vCellW/8, y + vCellH);
++ render_line (x, y + vCellW/4, x + vCellW/8, y + vCellHsep);
++ render_line (x + vCellW/8, y + vCellH, x + vCellW, y + vCellH);
++ render_line (x + vCellW/8, y + vCellHsep, x + vCellW, y + vCellHsep);
++ render_text (x + vCellW/8, y + vCellHtxt, value.text);
++ break;
++ }
++ }
++}
++
++// ------------------------------------------------------------
++
++void cairodiagram::draw_dependency (double x0, double y0, double x1, double y1) {
++ m_context->save ();
++ m_context->set_source_rgb (0.0, 0.0, 1.0);
++
++ if (x0 == x1) {
++ double w = vCellW*(1.0/20), h = vCellHt*(1.0/6), h2 = vCellHt*(1.0/10);
++
++ if (y0 < y1) {
++ y1 -= vCellHt*(1.0/4);
++ render_line (x0, y0, x1, y1);
++ render_poly (x1, y1, x1 - w, y1 - h, x1, y1 - h2, x1 + w, y1 - h, true);
++ }
++ else {
++ y1 += vCellHt*(1.0/4);
++ render_line (x0, y0, x1, y1);
++ render_poly (x1, y1, x1 - w, y1 + h, x1, y1 + h2, x1 + w, y1 + h, true);
++ }
++ }
++ else {
++ double h = vCellHt*(1.0/10), w1 = vCellW*(1.0/12), w2 = vCellW*(1.0/20);
++ x1 -= vCellW*(1.0/16);
++ render_bezier (x0, y0, (x0 + x1) / 2, y1, (x0 + x1) / 2, y1, x1, y1);
++ render_poly (x1, y1, x1 - w1, y1 - h, x1 - w2, y1, x1 - w1, y1 + h, true);
++ }
++
++ m_context->restore ();
++}
++
++// ------------------------------------------------------------
++
++void cairodiagram::draw_delay (double x0, double y0, double x1, double y1, double y2,
++ const string &text) {
++ m_context->save ();
++ m_context->set_source_rgb (0.0, 0.0, 1.0);
++
++ if (x0 == x1)
++ render_line (x0, y0, x1, y1);
++ else {
++ render_text (x0 + vCellWtsep, y2 - vCellHt*(1.0/16), text);
++ render_line (x0, y0, x0, y2 + vCellHt*(1.0/8));
++ render_line (x1, y1, x1, y2 - vCellHt*(1.0/8));
++ render_line (x0, y2, x1, y2);
++ render_poly (x1, y2, x1 - vCellW*(1.0/12), y2 - vCellHt*(1.0/10), x1 - vCellW*(1.0/20), y2, x1 - vCellW*(1.0/12), y2 + vCellHt*(1.0/10), true);
++ }
++ m_context->restore ();
++}
++
+Index: src/timing.h
+===================================================================
+RCS file: /cvsroot/drawtiming/drawtiming/src/timing.h,v
+retrieving revision 1.8
+diff -u -r1.8 timing.h
+--- src/timing.h 5 May 2007 16:26:58 -0000 1.8
++++ src/timing.h 7 Jul 2007 09:44:11 -0000
+@@ -24,6 +24,7 @@
+ #include <iostream>
+ #include <exception>
+ #include <Magick++.h>
++#include <cairomm/cairomm.h>
+
+ namespace timing {
+
+@@ -123,6 +124,36 @@
+ void render (const data &d, int w, int h, bool fixAspect);
+ };
+
++ class cairodiagram {
++ void draw_transition (double x, double y, const sigvalue &last, const sigvalue &value);
++ void draw_dependency (double x0, double y0, double x1, double y1);
++ void draw_delay (double x0, double y0, double x1, double y1, double y2, const std::string &text);
++ double label_width (const data &d) const;
++ void render_text (double xpos, double ypos, const std::string &text);
++ void render_line (double x1, double y1, double x2, double y2);
++ void render_poly (double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4, bool fill);
++ void render_bezier (double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4);
++ void stroke (void);
++ void render_common (const data &d);
++
++ Cairo::RefPtr<Cairo::Surface> m_surface;
++ Cairo::RefPtr<Cairo::Context> m_context;
++ double m_xmin, m_xmax, m_ymin, m_ymax;
++ double m_xscale, m_yscale;
++
++ public:
++ cairodiagram (void);
++ cairodiagram (const cairodiagram &);
++ cairodiagram &operator= (const cairodiagram &);
++ void set_scale (const data &d, double scale);
++ void set_scale (const data &d, int w, int h, bool fixAspect);
++ void render_to_svg (const data &d, const std::string& outfile);
++ void render_to_ps (const data &d, const std::string& outfile);
++ void render_to_pdf (const data &d, const std::string& outfile);
++ void render_to_png (const data &d, const std::string& outfile);
++
++ };
++
+ };
+
+ std::ostream &operator<< (std::ostream &f, const timing::data &d);
diff --git a/0005-drawtiming-color-support.patch b/0005-drawtiming-color-support.patch
new file mode 100644
index 00000000000..13d9dc53363
--- /dev/null
+++ b/0005-drawtiming-color-support.patch
@@ -0,0 +1,183 @@
+Index: trunk/drawtiming/doc/drawtiming.1
+===================================================================
+--- trunk/drawtiming/doc/drawtiming.1 (revision 67)
++++ trunk/drawtiming/doc/drawtiming.1 (working copy)
+@@ -30,6 +30,9 @@
+ .Op Fl -aspect
+ .Op Fl -cell-height Ar H
+ .Op Fl -cell-width Ar W
++.Op Fl -color-bg Ar Cbg
++.Op Fl -color-fg Ar Cfg
++.Op Fl -color-dep Ar Cdp
+ .Op Fl -font-size Ar pts
+ .Op Fl -line-width Ar W
+ .Fl -output Ar target
+@@ -60,7 +63,13 @@
+ .It Fl -cell-height Ar H
+ Height of the each signal in pixels. Default is 32.
+ .It Fl -cell-width Ar W
+-Width for the time unit in pixels. Defaults is 64.
++Width for the time unit in pixels. Default is 64.
++.It Fl -color-bg Ar Cbg
++Background color name. Default is white.
++.It Fl -color-fg Ar Cfg
++Foreground color name. Default is black.
++.It Fl -color-dep Ar Cdp
++Dependency color name. Default is blue.
+ .It Fl -font-size Ar pts
+ Font size in pts. Default is 18.
+ .It Fl -line-width Ar W
+Index: trunk/drawtiming/src/main.cc
+===================================================================
+--- trunk/drawtiming/src/main.cc (revision 67)
++++ trunk/drawtiming/src/main.cc (working copy)
+@@ -52,6 +52,9 @@
+ OPT_CELL_WIDTH,
+ OPT_FONT,
+ OPT_FONT_SIZE,
++ OPT_COLOR_BACKGROUND,
++ OPT_COLOR_FOREGROUND,
++ OPT_COLOR_DEPEND,
+ OPT_HELP,
+ OPT_LINE_WIDTH,
+ OPT_OUTPUT,
+@@ -65,6 +68,9 @@
+ {"aspect", no_argument, NULL, OPT_ASPECT},
+ {"cell-height", required_argument, NULL, OPT_CELL_HEIGHT},
+ {"cell-width", required_argument, NULL, OPT_CELL_WIDTH},
++ {"color-bg", required_argument, NULL, OPT_COLOR_BACKGROUND},
++ {"color-fg", required_argument, NULL, OPT_COLOR_FOREGROUND},
++ {"color-dep", required_argument, NULL, OPT_COLOR_DEPEND},
+ {"font", required_argument, NULL, OPT_FONT},
+ {"font-size", required_argument, NULL, OPT_FONT_SIZE},
+ {"help", no_argument, NULL, OPT_HELP},
+@@ -94,6 +100,15 @@
+ case OPT_CELL_HEIGHT:
+ timing::vCellHt = atoi (optarg);
+ break;
++ case OPT_COLOR_BACKGROUND:
++ timing::vColor_Bg=optarg;
++ break;
++ case OPT_COLOR_FOREGROUND:
++ timing::vColor_Fg=optarg;
++ break;
++ case OPT_COLOR_DEPEND:
++ timing::vColor_Dep=optarg;
++ break;
+ case OPT_FONT:
+ timing::vFont = optarg;
+ break;
+@@ -188,7 +203,7 @@
+ else
+ diagram.render (data, scale);
+
+- Image img (Geometry (diagram.width, diagram.height), "white");
++ Image img (Geometry (diagram.width, diagram.height), timing::vColor_Bg);
+ img.draw (diagram);
+ img.write (outfile);
+ }
+@@ -251,7 +266,13 @@
+ << "-w" << endl
+ << "--cell-width" << endl
+ << " Width of the time unit (pixels) [64]." << endl
+- << "--font <name>" << endl
++ << "--color-bg" << endl
++ << " Background color name [white]." << endl
++ << "--color-fg" << endl
++ << " Foreground color name [black]." << endl
++ << "--color-dep" << endl
++ << " Dependency ground color name [blue]." << endl
++ << "--font <name>" << endl
+ << " Font [Helvetica]" << endl
+ << "-f" << endl
+ << "--font-size" << endl
+Index: trunk/drawtiming/src/timing.cc
+===================================================================
+--- trunk/drawtiming/src/timing.cc (revision 67)
++++ trunk/drawtiming/src/timing.cc (working copy)
+@@ -27,6 +27,9 @@
+ int timing::vCellHt = 32;
+ int timing::vCellW = 64;
+ string timing::vFont = "Helvetica";
++string timing::vColor_Bg = "white";
++string timing::vColor_Fg = "black";
++string timing::vColor_Dep = "blue";
+
+ static int vCellHsep, vCellH, vCellHtxt, vCellHdel, vCellHtdel, vCellWtsep,
+ vCellWrm;
+@@ -338,7 +341,7 @@
+ push_back (DrawableFont (vFont, AnyStyle, 100, AnyStretch));
+ push_back (DrawablePointSize (vFontPointsize));
+ push_back (DrawableStrokeWidth(vLineWidth));
+- push_back (DrawableStrokeColor ("black"));
++ push_back (DrawableStrokeColor (timing::vColor_Fg));
+
+ int labelWidth = label_width (d);
+
+@@ -605,7 +608,7 @@
+ list<Coordinate> shaft, head;
+
+ push_back (DrawablePushGraphicContext ());
+- push_back (DrawableStrokeColor ("blue"));
++ push_back (DrawableStrokeColor (timing::vColor_Dep));
+
+ if (x0 == x1) {
+ int w = vCellW/20, h = vCellHt/6, h2 = vCellHt/10;
+@@ -613,7 +616,7 @@
+ if (y0 < y1) {
+ y1 -= vCellHt/4;
+ push_back (DrawableLine (x0, y0, x1, y1));
+- push_back (DrawableFillColor ("blue"));
++ push_back (DrawableFillColor (timing::vColor_Dep));
+ head.push_back (Coordinate (x1, y1));
+ head.push_back (Coordinate (x1 - w, y1 - h));
+ head.push_back (Coordinate (x1, y1 - h2));
+@@ -623,7 +626,7 @@
+ else {
+ y1 += vCellHt/4;
+ push_back (DrawableLine (x0, y0, x1, y1));
+- push_back (DrawableFillColor ("blue"));
++ push_back (DrawableFillColor (timing::vColor_Dep));
+ head.push_back (Coordinate (x1, y1));
+ head.push_back (Coordinate (x1 - w, y1 + h));
+ head.push_back (Coordinate (x1, y1 + h2));
+@@ -641,7 +644,7 @@
+ shaft.push_back (Coordinate ((x0 + x1) / 2, y1));
+ shaft.push_back (Coordinate (x1, y1));
+ push_back (DrawableBezier (shaft));
+- push_back (DrawableFillColor ("blue"));
++ push_back (DrawableFillColor (timing::vColor_Dep));
+ head.push_back (Coordinate (x1, y1));
+ head.push_back (Coordinate (x1 - w1, y1 - h));
+ head.push_back (Coordinate (x1 - w2, y1));
+@@ -659,7 +662,7 @@
+ list<Coordinate> head;
+
+ push_back (DrawablePushGraphicContext ());
+- push_back (DrawableStrokeColor ("blue"));
++ push_back (DrawableStrokeColor (timing::vColor_Dep));
+
+ if (x0 == x1)
+ push_back (DrawableLine (x0, y0, x1, y1));
+@@ -668,7 +671,7 @@
+ push_back (DrawableLine (x0, y0, x0, y2 + vCellHt/8));
+ push_back (DrawableLine (x1, y1, x1, y2 - vCellHt/8));
+ push_back (DrawableLine (x0, y2, x1, y2));
+- push_back (DrawableFillColor ("blue"));
++ push_back (DrawableFillColor (timing::vColor_Dep));
+ head.push_back (Coordinate (x1, y2));
+ head.push_back (Coordinate (x1 - vCellW/12, y2 - vCellHt/10));
+ head.push_back (Coordinate (x1 - vCellW/20, y2));
+Index: trunk/drawtiming/src/timing.h
+===================================================================
+--- trunk/drawtiming/src/timing.h (revision 67)
++++ trunk/drawtiming/src/timing.h (working copy)
+@@ -43,7 +43,7 @@
+ typedef std::list<sigvalue> value_sequence;
+
+ extern int vFontPointsize, vLineWidth, vCellHt, vCellW;
+- extern std::string vFont;
++ extern std::string vFont, vColor_Bg, vColor_Fg, vColor_Dep;
+
+ class exception : public std::exception {
+ };
diff --git a/0006-analog_values.patch b/0006-analog_values.patch
new file mode 100644
index 00000000000..acaf61eacca
--- /dev/null
+++ b/0006-analog_values.patch
@@ -0,0 +1,105 @@
+Index: src/timing.cc
+===================================================================
+--- src/timing.cc (revision 76)
++++ src/timing.cc (working copy)
+@@ -18,6 +18,7 @@
+ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ #include "timing.h"
++#include "string.h"
+ #include <map>
+ #include <fstream>
+ using namespace std;
+@@ -61,21 +62,40 @@
+ sigvalue::sigvalue (const std::string &s, valuetype n) {
+ text = s;
+ type = n;
+- if (type == UNDEF) {
+- if (text == "0" || text == "false")
++ if (type == UNDEF) {
++ if (text == "0" || text == "false") {
+ type = ZERO;
+- else if (text == "1" || text == "true")
++ val = 0.0;
++ } else if (text == "1" || text == "true") {
+ type = ONE;
+- else if (text == "pulse")
++ val = 1.0;
++ } else if (text == "pulse") {
+ type = PULSE;
+- else if (text == "tick")
++ val = 0.0;
++ } else if (text == "tick") {
+ type = TICK;
+- else if (text == "X")
++ val = 0.0;
++ } else if (text == "X") {
+ type = X;
+- else if (text == "Z")
++ val = 0.5;
++ } else if (text == "Z") {
+ type = Z;
+- else
+- type = STATE;
++ val = 0.5;
++ } else {
++ float ana;
++ int n = sscanf(text.c_str(), "%f", &ana);
++ if(n > 0) {
++ val = ana;
++ if(text[text.length()-1] == 'S') {
++ type = ANA_STEP;
++ } else {
++ type = ANA;
++ }
++ } else {
++ type = STATE;
++ val = 0.5;
++ }
++ }
+ }
+ }
+
+@@ -84,6 +104,7 @@
+ sigvalue &sigvalue::operator= (const sigvalue &t) {
+ type = t.type;
+ text = t.text;
++ val = t.val;
+ return *this;
+ }
+
+@@ -338,6 +359,16 @@
+ const sigvalue &value) {
+
+ switch (value.type) {
++
++ case ANA:
++ gc.line(x, y + (int) (vCellH * (1.0 - last.val)), x+vCellW, y + (int) (vCellH * (1.0 - value.val)));
++ break;
++
++ case ANA_STEP:
++ gc.line(x, y + (int) (vCellH * (1.0 - last.val)), x, y + (int) (vCellH * (1.0 - value.val)));
++ gc.line(x, y + (int) (vCellH * (1.0 - value.val)), x+vCellW, y + (int) (vCellH * (1.0 - value.val)));
++ break;
++
+ case ZERO:
+ switch (last.type) {
+ default:
+Index: src/timing.h
+===================================================================
+--- src/timing.h (revision 76)
++++ src/timing.h (working copy)
+@@ -29,11 +29,12 @@
+
+ namespace timing {
+
+- enum valuetype {UNDEF, ZERO, ONE, X, Z, PULSE, TICK, STATE};
++ enum valuetype {UNDEF, ZERO, ONE, X, Z, PULSE, TICK, STATE, ANA, ANA_STEP};
+
+ struct sigvalue {
+ valuetype type;
+ std::string text;
++ float val;
+ sigvalue (void);
+ sigvalue (const sigvalue &);
+ sigvalue (const std::string &s, valuetype n = UNDEF);
diff --git a/0007-transition_percentage.patch b/0007-transition_percentage.patch
new file mode 100644
index 00000000000..77fad0ea3f9
--- /dev/null
+++ b/0007-transition_percentage.patch
@@ -0,0 +1,263 @@
+Index: src/main.cc
+===================================================================
+--- src/main.cc (revision 76)
++++ src/main.cc (working copy)
+@@ -57,6 +57,7 @@
+ OPT_OUTPUT,
+ OPT_SCALE,
+ OPT_PAGESIZE,
++ OPT_TRANSITION_PERCENT,
+ OPT_VERBOSE,
+ OPT_VERSION
+ };
+@@ -72,6 +73,7 @@
+ {"output", required_argument, NULL, OPT_OUTPUT},
+ {"scale", required_argument, NULL, OPT_SCALE},
+ {"pagesize", required_argument, NULL, OPT_PAGESIZE},
++ {"transition", required_argument, NULL, OPT_TRANSITION_PERCENT},
+ {"verbose", no_argument, NULL, OPT_VERBOSE},
+ {"version", no_argument, NULL, OPT_VERSION},
+ {0, 0, 0, 0}
+@@ -128,6 +130,10 @@
+ flags |= FLAG_PAGESIZE;
+ sscanf (optarg, "%dx%d", &width, &height);
+ break;
++ case 't':
++ case OPT_TRANSITION_PERCENT:
++ sscanf (optarg, "%f", &timing::vCellTrans);
++ break;
+ case 'x':
+ case OPT_SCALE:
+ flags |= FLAG_SCALE;
+Index: src/timing.cc
+===================================================================
+--- src/timing.cc (revision 76)
++++ src/timing.cc (working copy)
+@@ -18,6 +18,7 @@
+ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ #include "timing.h"
++#include <string.h>
+ #include <map>
+ #include <fstream>
+ using namespace std;
+@@ -28,6 +29,7 @@
+ int timing::vLineWidth = 1;
+ int timing::vCellHt = 32;
+ int timing::vCellW = 64;
++float timing::vCellTrans = 0.25;
+ string timing::vFont = "Helvetica";
+
+ static int vCellHsep, vCellH, vCellHtxt, vCellHdel, vCellHtdel, vCellWtsep,
+@@ -337,6 +339,8 @@
+ static void draw_transition (gc &gc, int x, int y, const sigvalue &last,
+ const sigvalue &value) {
+
++ int transW = (int) (vCellW * vCellTrans);
++
+ switch (value.type) {
+ case ZERO:
+ switch (last.type) {
+@@ -345,17 +349,17 @@
+ break;
+
+ case ONE:
+- gc.line (x, y + vCellHsep, x + vCellW/4, y + vCellH);
+- gc.line (x + vCellW/4, y + vCellH, x + vCellW, y + vCellH);
++ gc.line (x, y + vCellHsep, x + transW, y + vCellH);
++ gc.line (x + transW, y + vCellH, x + vCellW, y + vCellH);
+ break;
+
+ case Z:
+- gc.line (x, y + vCellHt/2, x + vCellW/4, y + vCellH);
+- gc.line (x + vCellW/4, y + vCellH, x + vCellW, y + vCellH);
++ gc.line (x, y + vCellHt/2, x + transW/2, y + vCellH);
++ gc.line (x + transW/2, y + vCellH, x + vCellW, y + vCellH);
+ break;
+
+ case STATE:
+- gc.line (x, y + vCellHsep, x + vCellW/4, y + vCellH);
++ gc.line (x, y + vCellHsep, x + transW, y + vCellH);
+ gc.line (x, y + vCellH, x + vCellW, y + vCellH);
+ break;
+ }
+@@ -370,17 +374,17 @@
+ case ZERO:
+ case TICK:
+ case PULSE:
+- gc.line (x, y + vCellH, x + vCellW/4, y + vCellHsep);
+- gc.line (x + vCellW/4, y + vCellHsep, x + vCellW, y + vCellHsep);
++ gc.line (x, y + vCellH, x + transW, y + vCellHsep);
++ gc.line (x + transW, y + vCellHsep, x + vCellW, y + vCellHsep);
+ break;
+
+ case Z:
+- gc.line (x, y + vCellHt/2, x + vCellW/4, y + vCellHsep);
+- gc.line (x + vCellW/4, y + vCellHsep, x + vCellW, y + vCellHsep);
++ gc.line (x, y + vCellHt/2, x + transW/2, y + vCellHsep);
++ gc.line (x + transW/2, y + vCellHsep, x + vCellW, y + vCellHsep);
+ break;
+
+ case STATE:
+- gc.line (x, y + vCellH, x + vCellW/4, y + vCellHsep);
++ gc.line (x, y + vCellH, x + transW, y + vCellHsep);
+ gc.line (x, y + vCellHsep, x + vCellW, y + vCellHsep);
+ break;
+ }
+@@ -390,42 +394,45 @@
+ case PULSE:
+ switch (last.type) {
+ default:
+- gc.line (x, y + vCellH, x + vCellW/4, y + vCellHsep);
+- gc.line (x + vCellW/4, y + vCellHsep, x + vCellW/2, y + vCellHsep);
+- gc.line (x + vCellW/2, y + vCellHsep, x + vCellW*3/4, y + vCellH);
+- gc.line (x + vCellW*3/4, y + vCellH, x + vCellW, y + vCellH);
++ gc.line (x, y + vCellH, x + transW, y + vCellHsep);
++ gc.line (x + transW, y + vCellHsep, x + vCellW/2, y + vCellHsep);
++ gc.line (x + vCellW/2, y + vCellHsep, x + vCellW/2 + transW, y + vCellH);
++ gc.line (x + vCellW/2 + transW, y + vCellH, x + vCellW, y + vCellH);
+ break;
+
+ case ONE:
+ case X:
+ gc.line (x, y + vCellHsep, x + vCellW/2, y + vCellHsep);
+- gc.line (x + vCellW/2, y + vCellHsep, x + vCellW*3/4, y + vCellH);
+- gc.line (x + vCellW*3/4, y + vCellH, x + vCellW, y + vCellH);
++ gc.line (x + vCellW/2, y + vCellHsep, x + vCellW/2 + transW, y + vCellH);
++ gc.line (x + vCellW/2 + transW, y + vCellH, x + vCellW, y + vCellH);
+ break;
+
+ case Z:
+- gc.line (x, y + vCellHt/2, x + vCellW/4, y + vCellHsep);
+- gc.line (x + vCellW/4, y + vCellHsep, x + vCellW/2, y + vCellHsep);
+- gc.line (x + vCellW/2, y + vCellHsep, x + vCellW*3/4, y + vCellH);
+- gc.line (x + vCellW*3/4, y + vCellH, x + vCellW, y + vCellH);
++ gc.line (x, y + vCellHt/2, x + transW, y + vCellHsep);
++ gc.line (x + transW, y + vCellHsep, x + vCellW/2, y + vCellHsep);
++ gc.line (x + vCellW/2, y + vCellHsep, x + vCellW/2 + transW, y + vCellH);
++ gc.line (x + vCellW/2 + transW, y + vCellH, x + vCellW, y + vCellH);
+ break;
+
+ case STATE:
+- gc.line (x, y + vCellH, x + vCellW/4, y + vCellHsep);
++ gc.line (x, y + vCellH, x + transW, y + vCellHsep);
+ gc.line (x, y + vCellHsep, x + vCellW/2, y + vCellHsep);
+- gc.line (x + vCellW/2, y + vCellHsep, x + vCellW*3/4, y + vCellH);
+- gc.line (x + vCellW*3/4, y + vCellH, x + vCellW, y + vCellH);
++ gc.line (x + vCellW/2, y + vCellHsep, x + vCellW/2 + transW, y + vCellH);
++ gc.line (x + vCellW/2 + transW, y + vCellH, x + vCellW, y + vCellH);
+ break;
+ }
+ break;
+
+ case UNDEF:
+ case X:
+- for (int i = 0; i < 4; ++ i) {
+- gc.line (x+i*(vCellW/4), y + vCellH,
+- x+(i+1)*(vCellW/4), y + vCellHsep);
+- gc.line (x+i*(vCellW/4), y + vCellHsep,
+- x+(i+1)*(vCellW/4), y + vCellH);
++ int n, w;
++ n = (int) (1.0 / vCellTrans); // calculate the number of transitions
++ w = (int) (vCellW / n); // calculate the step size
++ for (int i = 0; i < n; ++ i) {
++ gc.line (x+i*vCellW/n, y + vCellH,
++ x+(i+1)*vCellW/n, y + vCellHsep);
++ gc.line (x+i*vCellW/n, y + vCellHsep,
++ x+(i+1)*vCellW/n, y + vCellH);
+ }
+ break;
+
+@@ -438,19 +445,19 @@
+ case ZERO:
+ case TICK:
+ case PULSE:
+- gc.line (x, y + vCellH, x + vCellW/4, y + vCellHt/2);
+- gc.line (x + vCellW/4, y + vCellHt/2, x + vCellW, y + vCellHt/2);
++ gc.line (x, y + vCellH, x + transW/2, y + vCellHt/2);
++ gc.line (x + transW/2, y + vCellHt/2, x + vCellW, y + vCellHt/2);
+ break;
+
+ case ONE:
+- gc.line (x, y + vCellHsep, x + vCellW/4, y + vCellHt/2);
+- gc.line (x + vCellW/4, y + vCellHt/2, x + vCellW, y + vCellHt/2);
++ gc.line (x, y + vCellHsep, x + transW/2, y + vCellHt/2);
++ gc.line (x + transW/2, y + vCellHt/2, x + vCellW, y + vCellHt/2);
+ break;
+
+ case STATE:
+- gc.line (x, y + vCellHsep, x + vCellW/8, y + vCellHt/2);
+- gc.line (x, y + vCellH, x + vCellW/8, y + vCellHt/2);
+- gc.line (x + vCellW/8, y + vCellHt/2, x + vCellW, y + vCellHt/2);
++ gc.line (x, y + vCellHsep, x + transW/2, y + vCellHt/2);
++ gc.line (x, y + vCellH, x + transW/2, y + vCellHt/2);
++ gc.line (x + transW/2, y + vCellHt/2, x + vCellW, y + vCellHt/2);
+ break;
+ }
+ break;
+@@ -459,11 +466,11 @@
+ switch (last.type) {
+ default:
+ if (value.text != last.text) {
+- gc.line (x, y + vCellHsep, x + vCellW/4, y + vCellH);
+- gc.line (x, y + vCellH, x + vCellW/4, y + vCellHsep);
+- gc.line (x + vCellW/4, y + vCellHsep, x + vCellW, y + vCellHsep);
+- gc.line (x + vCellW/4, y + vCellH, x + vCellW, y + vCellH);
+- push_text (gc, x + vCellW/4, y + vCellHtxt, value.text);
++ gc.line (x, y + vCellHsep, x + transW, y + vCellH);
++ gc.line (x, y + vCellH, x + transW, y + vCellHsep);
++ gc.line (x + transW, y + vCellHsep, x + vCellW, y + vCellHsep);
++ gc.line (x + transW, y + vCellH, x + vCellW, y + vCellH);
++ push_text (gc, x + transW, y + vCellHtxt, value.text);
+ }
+ else {
+ gc.line (x, y + vCellHsep, x + vCellW, y + vCellHsep);
+@@ -474,25 +481,25 @@
+ case ZERO:
+ case TICK:
+ case PULSE:
+- gc.line (x, y + vCellH, x + vCellW/4, y + vCellHsep);
+- gc.line (x + vCellW/4, y + vCellHsep, x + vCellW, y + vCellHsep);
++ gc.line (x, y + vCellH, x + transW, y + vCellHsep);
++ gc.line (x + transW, y + vCellHsep, x + vCellW, y + vCellHsep);
+ gc.line (x, y + vCellH, x + vCellW, y + vCellH);
+- push_text (gc, x + vCellW/4, y + vCellHtxt, value.text);
++ push_text (gc, x + transW, y + vCellHtxt, value.text);
+ break;
+
+ case ONE:
+- gc.line (x, y + vCellHsep, x + vCellW/4, y + vCellH);
+- gc.line (x + vCellW/4, y + vCellH, x + vCellW, y + vCellH);
++ gc.line (x, y + vCellHsep, x + transW, y + vCellH);
++ gc.line (x + transW, y + vCellH, x + vCellW, y + vCellH);
+ gc.line (x, y + vCellHsep, x + vCellW, y + vCellHsep);
+- push_text (gc, x + vCellW/4, y + vCellHtxt, value.text);
++ push_text (gc, x + transW, y + vCellHtxt, value.text);
+ break;
+
+ case Z:
+- gc.line (x, y + vCellW/4, x + vCellW/8, y + vCellH);
+- gc.line (x, y + vCellW/4, x + vCellW/8, y + vCellHsep);
+- gc.line (x + vCellW/8, y + vCellH, x + vCellW, y + vCellH);
+- gc.line (x + vCellW/8, y + vCellHsep, x + vCellW, y + vCellHsep);
+- push_text (gc, x + vCellW/8, y + vCellHtxt, value.text);
++ gc.line (x, y + transW, x + transW/2, y + vCellH);
++ gc.line (x, y + transW, x + transW/2, y + vCellHsep);
++ gc.line (x + transW/2, y + vCellH, x + vCellW, y + vCellH);
++ gc.line (x + transW/2, y + vCellHsep, x + vCellW, y + vCellHsep);
++ push_text (gc, x + transW/2, y + vCellHtxt, value.text);
+ break;
+ }
+ }
+Index: src/timing.h
+===================================================================
+--- src/timing.h (revision 76)
++++ src/timing.h (working copy)
+@@ -45,6 +45,7 @@
+ typedef std::list<sigvalue> value_sequence;
+
+ extern int vFontPointsize, vLineWidth, vCellHt, vCellW;
++ extern float vCellTrans;
+ extern std::string vFont;
+
+ class exception : public std::exception {
diff --git a/0008-grid.patch b/0008-grid.patch
new file mode 100644
index 00000000000..5a730d0f506
--- /dev/null
+++ b/0008-grid.patch
@@ -0,0 +1,88 @@
+Index: src/main.cc
+===================================================================
+--- src/main.cc (revision 76)
++++ src/main.cc (working copy)
+@@ -52,6 +52,7 @@
+ OPT_CELL_WIDTH,
+ OPT_FONT,
+ OPT_FONT_SIZE,
++ OPT_GRID,
+ OPT_HELP,
+ OPT_LINE_WIDTH,
+ OPT_OUTPUT,
+@@ -67,6 +68,7 @@
+ {"cell-width", required_argument, NULL, OPT_CELL_WIDTH},
+ {"font", required_argument, NULL, OPT_FONT},
+ {"font-size", required_argument, NULL, OPT_FONT_SIZE},
++ {"grid", no_argument, NULL, OPT_GRID},
+ {"help", no_argument, NULL, OPT_HELP},
+ {"line-width", required_argument, NULL, OPT_LINE_WIDTH},
+ {"output", required_argument, NULL, OPT_OUTPUT},
+@@ -110,6 +112,10 @@
+ case OPT_FONT_SIZE:
+ timing::vFontPointsize = atoi (optarg);
+ break;
++ case 'g':
++ case OPT_GRID:
++ timing::draw_grid = true;
++ break;
+ case 'h':
+ case OPT_HELP:
+ usage ();
+@@ -279,6 +285,9 @@
+ << "-l" << endl
+ << "--line-width" << endl
+ << " Line width (pixels) [3]." << endl
++ << "-g" << endl
++ << "--grid" << endl
++ << " Turn on grid." << endl
+ << endl
+ << "Consult the drawtiming(1) man page for details." << endl;
+ }
+Index: src/timing.cc
+===================================================================
+--- src/timing.cc (revision 76)
++++ src/timing.cc (working copy)
+@@ -18,6 +18,7 @@
+ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ #include "timing.h"
++#include <string.h>
+ #include <map>
+ #include <fstream>
+ using namespace std;
+@@ -29,6 +30,7 @@
+ int timing::vCellHt = 32;
+ int timing::vCellW = 64;
+ string timing::vFont = "Helvetica";
++bool timing::draw_grid = false;
+
+ static int vCellHsep, vCellH, vCellHtxt, vCellHdel, vCellHtdel, vCellWtsep,
+ vCellWrm;
+@@ -611,6 +613,14 @@
+ y += vCellHt + vCellHdel * sig.maxdelays;
+ }
+
++ if(timing::draw_grid) {
++ int x = labelWidth + vCellWtsep;
++ for(int j; j <= d.maxlen; j++) {
++ gc.line(x,0,x,y);
++ x += vCellW;
++ }
++ }
++
+ // draw the smooth arrows indicating the triggers for signal changes
+ for (list<depdata>::const_iterator i = d.dependencies.begin ();
+ i != d.dependencies.end (); ++ i)
+Index: src/timing.h
+===================================================================
+--- src/timing.h (revision 76)
++++ src/timing.h (working copy)
+@@ -46,6 +46,7 @@
+
+ extern int vFontPointsize, vLineWidth, vCellHt, vCellW;
+ extern std::string vFont;
++ extern bool draw_grid;
+
+ class exception : public std::exception {
+ };
diff --git a/0009-manpage-fix.patch b/0009-manpage-fix.patch
new file mode 100644
index 00000000000..2aa56c124df
--- /dev/null
+++ b/0009-manpage-fix.patch
@@ -0,0 +1,62 @@
+Description: Fix typos and hyphenation
+Author: أحمد المحمودي (Ahmed El-Mahmoudy) <aelmahmoudy@sabily.org>
+Forwarded: yes
+--- a/doc/drawtiming.1
++++ b/doc/drawtiming.1
+@@ -56,7 +56,7 @@
+ .It Fl -pagesize Ar WidthxHeight
+ Scale the diagram to fit given image size.
+ .It Fl -aspect
+-Maintain fixed aspect ratio if --pagesize given.
++Maintain fixed aspect ratio if \-\-pagesize given.
+ .It Fl -cell-height Ar H
+ Height of the each signal in pixels. Default is 32.
+ .It Fl -cell-width Ar W
+@@ -101,23 +101,23 @@
+ changing its value.
+ .El
+ .Pp
+-Statements are seperated by the following symbols:
++Statements are separated by the following symbols:
+ .Bl -tag -width "-tD>"
+ .It ,
+-The comma seperator is used to seperate statements without
++The comma separator is used to separate statements without
+ affecting the dependency list or clock (ie: the next statement will
+ add to the dependency list).
+ .It ;
+-The semicolon seperator resets the list of dependencies without
++The semicolon separator resets the list of dependencies without
+ incrementing the clock
+ .It .
+-The period seperator resets the list of dependencies and
++The period separator resets the list of dependencies and
+ increments the clock.
+ .It =>
+-The "causes" seperator renders dependency arrows based on the
++The "causes" separator renders dependency arrows based on the
+ current list of dependencies and then resets the dependency list.
+ .It -tD>
+-The "delay" seperator renders a delay arrow from the last dependency
++The "delay" separator renders a delay arrow from the last dependency
+ with the annotation
+ .Em tD .
+ .El
+@@ -173,7 +173,7 @@
+ value if their initial value is not given.
+ .Pp
+ Independent signal transitions which occur simultaneously are normally
+-seperated by commas. Since signals aren't normally expected to change
++separated by commas. Since signals aren't normally expected to change
+ simultaneously, the initial state is a good example of this:
+ .Pp
+ .Dl POWER=0, FIRE=0, ARMED=0, LED=OFF, COUNT=N.
+@@ -194,7 +194,7 @@
+ .Pp
+ .Dl POWER=1 => LED=GREEN.
+ .Pp
+-For signal state changes with multiple dependencies, seperate the
++For signal state changes with multiple dependencies, separate the
+ dependencies with commas:
+ .Pp
+ .Dl FIRE, ARMED => LED=RED.
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..48483c0f8a2
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,65 @@
+# Maintainer: Melvin Vermeeren <mail@mel.vin>
+pkgname=drawtiming
+pkgver=0.7.1
+pkgrel=1
+pkgdesc="Tool that converts ASCII to UML Timing Diagrams."
+arch=('i686' 'x86_64')
+url="http://drawtiming.sourceforge.net/"
+license=('GPL2')
+depends=('imagemagick' 'ghostscript' 'cairo')
+makedepends=('subversion')
+source=("https://downloads.sourceforge.net/project/drawtiming/drawtiming/0.7.1/drawtiming-0.7.1.tar.gz"
+ "https://downloads.sourceforge.net/project/drawtiming/drawtiming/0.7.1/drawtiming-0.7.1.tar.gz.asc"
+ "0001-gcc43.patch"
+ "0002-switch_LDFLAGS_LDADD.patch"
+ "0003-highlight_rows.patch"
+ "0004-drawtiming_cairo.patch"
+ "0005-drawtiming-color-support.patch"
+ "0006-analog_values.patch"
+ "0007-transition_percentage.patch"
+ "0008-grid.patch"
+ "0009-manpage-fix.patch")
+sha256sums=('ae35a369f71f03b219d23f56329ced73100f79ffda38dd8d31d1e9e510f3cf6e'
+ 'SKIP'
+ 'e2fc55753c003233ed3797d1b7c1e53cb0d38792cfb94d49b139049f1555da84'
+ '088407c2e04b7a0df73cdaeb3a31d2270c5056102b6f9bf2ab38e6b996a47140'
+ '917d344f23000f9d53773ef3a5cdc8a0ab5348b2ef6ef4cb47c41c27e4fedca5'
+ '2815283a41b6b832aca82e7a26110f358bd01d428dfd5c86e622e8996252c7e0'
+ '31eac54da13f61a9c17aceac645f37e98baef9ae3ed840f8c8c5275d70abded2'
+ '4ca14d1dbf67ebcd42f449a29a7db36070e19083352de2d11c1dc41989118bb1'
+ '2c40999feea0fa1e91f6100c8bc4bab517e5d19182fab6b4f13b2f81a1861005'
+ 'e19f9d86b550b0d14f9805e79b41d99973aa5ec3999443ee5cf0a5b64eccbc82'
+ '29881f7bbac6b06d75813c726132b6971c699e2aefa515720809de06d6acfbb7')
+validpgpkeys=('3ABAC00311517945BAF0491140DDCDFB3BF52988') # Edward Counce
+
+prepare() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+
+ # All patches are from soureforge.
+ # Most of them don't work, at least for now.
+ patch -p0 -i "${srcdir}/0001-gcc43.patch"
+ patch -p1 -i "${srcdir}/0002-switch_LDFLAGS_LDADD.patch"
+ #patch -p0 -i "${srcdir}/0003-highlight_rows.patch"
+ #patch -p0 -i "${srcdir}/0004-drawtiming_cairo.patch"
+ #patch -p2 -i "${srcdir}/0005-drawtiming-color-support.patch"
+ patch -p0 -i "${srcdir}/0006-analog_values.patch"
+ #patch -p0 -i "${srcdir}/0007-transition_percentage.patch"
+ #patch -p0 -i "${srcdir}/0008-grid.patch"
+ patch -p1 -i "${srcdir}/0009-manpage-fix.patch"
+}
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ ./configure --prefix=/usr
+ make
+}
+
+check() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ make -k check
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ make DESTDIR="$pkgdir/" PREFIX="/usr" install
+}