Drawtool, Version 0.1b Changes since version 0.01a The whole format of the string has been completely altered, see the README "FIX THE CRAP CMDLINE FUNCTION, it doesn't work properly" Now, I'm using getopt, badly. But it's better than before. "Use a 32 bit number for colour instead of cutting it short." Using 3 (r,g,b) integers. "Add support for other graphic primitives." Now have points, lines, frame rectangles and filled rectangles COLOUR! (yes, that is spelt right, GRRRR) Glorious 32bit colour, using the gimp colour picker. Fixed a major bug that caused the parse to go nuts when if received an EOF from it's parent pipe. Fixed a dodgy malloc in the parser that wasn't being freed up properly. Modularised the entire thing. Now, have several source files with many small reusable modules. It now compiles with gcc -Wall Added a -b option to omit buttons from the drawing window Lots more example programs. A simple implementation of 'logo' has been added in the utils folder, with some trivial and slightly less trivial examples. ---- v0.02b Added a filled and empty circle tool Added a simple colour picker for commonly used colours Added a current colour indicator Moved lots of stuff out of drawtool.c and improved the modularity Added PU,PD,PC to logo tool ---- v0.021b Discovered gdk_draw_arc for the circle routines (after spending the best part of a day searching and writing highly optimised code using the bresenham circle drawing algorithm GRRRRR). Added an a filled and empty ellipse tool (easy when you know how) Stopped the user from resizing the drawing window while running (buggers up the pixmap) Stopped the user from resizing the simple colour window, as it's fine the way it is. --- v0.022b Added -o and -i flags, to use files for I/O (happy now Mr. Huggins?) Eyedropper tool added Sort of stopped the thing where things move after a mouse_release Finally fixed cmdline.c and figured out what the hell "g:h:ghd:d" means... Added a colour indicator box Realised that updating the colour indicator box while in -t mode writes it's coords out, so fixed it with a really dirty kluge. Fixed stdin_func in a *big* way, now it uses the src, creates a stream from the src fd, takes unbuffered data and cleans up nicely after an eof. Put in a 'whiteboard' script to quickly hook up two machines using netcat --- v0.023b Added -d flag, to kill the program when an eof is found on stdin, useful for using it just as a display program Fixed a problem in stdin_func (events.c) where the file descriptor for the input was being fopened on *every* call. Added a global stream (FILE *input), it's now opened once in drawtool.c. Thanks to Anders Eurenius. Stuck Anders' perl code in utils/point, just to show that it works with sh, awk, c and perl :) --- v0.024b -t flag added to logo, to allow any number of turtles to be hatched. Eg, -t 100 will allow up to 100 HT's consecutively. eggs is now turtle ** and malloc'ed according to the -t flag. Added cmdline.c parser to logo. Now supports long options. Also, it has -x and -y for setting the home coordinates, see logo -h (or logo --help :) ) Added a -c option to logo, to list all of the commands available Added utils/sierpinski, a quick display hack in perl, derived from HAKMEM 146-148, computes X AND T for successive values of T. I need more drawtool fractal generators... --- v0.3b Added macro suport. MAJOR CHANGES. There's now a macro menu that lets you select external scripts to run. There is a .drawtoolrc file (see sample.drawtoolrc) and a parser for it. Discovered that gtkmenufactory doesn't work (apparently it's deprecated soon to disappear or sumamt). So, rolling my own menus. Macros are dealt with nicely, using gdk_input_add, so there's multithreading (in a sense). Drawtool can execute a macro, read data from stdin and have a user drawing in the window simultaneously. -r flag added, to select an arbitrary rc file (rather that ~/.drawtoolrc) Added colour to the macro interface, now called with 7 cmdline options. Realised that I'd never *actually* tried using ~/ and that it doesn't work with popen (what a surprise). So, for now, all pathnames in the drawtoolrc are absolute. Wrote a few macros, most of them are pointless. But, I'll do some good ones some time. Wrote the stdmacro code, just a simple shell to help people write C macros quicky. --- v3.01b I'm giving up with version numbers for a while. I'll prolly release a 3.1 final or something by the time I get back to Nottingham.. Changed the macro interface, so that macros can be sure that x1 Fixed the last change, so that x1,y1 in type 1 scripts is actually x1,y1, the -1,-1 was making it think that it was smaller than x2,y2 so it ordered them wrong. Added a running flag to macromenu.c, now it won't bother working doing any of the file stuff before running a macro if one is already going. Minor speed improvement. Noticed that writing shell scripts that fork and call bc (or even expr) are extremely slow. Perl is *much* faster and will probably be used from now on. I hate to think what would happen if you ran the brush macro on a system without enough memory to cache it. Changed the -b flag slightly, so that when selected, it disables event handling of the drawing area. ie. no user input has any effect, the -b now makes it purely a display app. Added a third script type (3). Where, x1,y1 is the point clicked on, and x2,y2 is the point let go on. The difference between this and type 2 is that there is no sorting. The macro cannot be sure that x1