drawtool v3.2.1 : Copyright (C) 1999 Toby Jaffey November 29th 1999 Portions: (Gtk stuff) Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald (Getopt) Copyright (C) 1989-1994 Free Software Foundation, Inc. This program is free software; you can distribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. DESCRIPTION: Drawtool is a simple application that reads in simple vector geometry from stdin and displays it in a Gtk window. Similarly, it will write data onto stdout as generated by click-drag mouse movements. However, Gtk is not needed as the front end can be replaced with PSDrawtool to output PostScript or perltool to output gif/png files. REQUIREMENTS: For Drawtool Gtk: X11 Gtk 1.0.6 A pointing device For PSDrawtool and perltool: Perl For logo: glibc (strsep is needed till I ifdef it in) QUICKSTART: Read docs/drawtool.pdf make su make install cd .. src/drawtool -r ./sample.drawtoolrc For PSDrawtool, try drawtool | flip.pl | psdrawtool | gs USES: When used in conjunction with netcat drawtool can be used a a networked whiteboard. (see utils/whiteboard for a quick script) eg. nc -l -p 1234 -u | drawtool | nc -p -u first.host.com 1235 nc -l -p 1235 -u | drawtool | nc -p -u second.host.com 1234 or, if you're all on the same machine On one end: create a couple of fifos cat infifo | drawtool > outfifo On the other:cat outfifo | drawtool > infifo The program can be used to quickly prototype graphical ideas. For example, by only using the standard C libraries and a pipe, it is possible to plot pictures into drawtool (see rainbow/swap/stretch/tree/logo) eg. echo "gogogogogo" | ./rainbow | drawtool drawtool | ./swap | drawtool echo go | ./rainbow | ./stretch 0.5 | swap | ./drawtool echo -e "FD 50\nRT 90\nFD 50\nRT 90\nFD 50\nRT 90\nFD 50" | logo | drawtool Drawtool can be used as a notepad, to quickly scribble down ideas eg. In: drawtool | compress -c > MyGreatIdea.Z Out: cat MyGreatIdea.Z | uncompress -d | drawtool Pictures can be outputted as PostScript like this, cat MyGreatIdea | flip.pl | psdrawtool.pl BUILDING: edit Makefile. "make" INSTALLING: cp drawtool /usr/local/bin edit sample.drawtoolrc cp sample.drawtoolrc ~/.drawtoolrc USAGE: drawtool -h, will show the online help. The options are: -h: Less help than you're getting here. -g Geometry: drawtool -g 17x42+69+666 will put a window 17 by 42 pixels at 69,666 -t: The -t flag sends all data coming through stdin into stdout, this can be useful for connecting more than one drawtool. eg. cat Borg.rawpict | drawtool -t | drawtool -t | nc bill.msn.com 666 would show the picture in one of two, then two of two before piping it into nc. The receiver could then bounce the data through netcat, making it possible to have a point to point link. -b: Omit the buttons, ideal for using as a display window. -o: File to output to (default is stdout) -i: File to take input from (default is stdin) -d: Die on EOF from input, the program will exit when it receives an End Of File marker from stdin or the file specified with -o -r file: Use file as config file instead of ~/.drawtoolrc DATA FORMAT: where: (x1,y2) or (x2,y2) are integer coordinates, (r,g,b) are integer red, green and blue colour values. point: 0,x1,y1,r,g,b line: 1,x1,y1,x2,y2,r,g,b empty rectangle: 2,x1,y1,x2,y2,r,g,b filled rectangle: 3,x1,y1,x2,y2,r,g,b empty circle: 4,x1,y1,radius,r,g,b filled circle: 5,x1,y1,radius,r,g,b empty ellipse: 6,x1,y1,x2,y2,r,g,b filled ellipse: 7,x1,y1,x2,y2,r,g,b RCFILE FORMAT: The drawtoolrc file consists of lines of the format: "menuAlias pathname type" Where, menuAlias is the name that appears on the macro menu, pathname is the *full* pathname of the script to be called, type is either 1 or 2. 1 will pass an x,y coordinate pair to the macro script. 2 will allow the user to draw a box, then it will pass two sets of x,y coordinates which specify a bounding box. ADDRESSES: Please contact me with bug reports, suggestions and graphical hacks to include in the distribution. email: homepage: http://www.nottingham.ac.uk/~psystrj