George Peter Staplin: Oct 29, 2005 - Megapkg is my largest project so far. It contains a lot of C and Tcl code that is evolving.
The current list of (useful) Tcl/Tk extensions is:
- pwm.so (used by Whim window manager)
- tgext.so (used by Whim window manager for some applets. It's also available eventually as a C API via tg.so.)
- structure.so (see megapkg structure extension. This is used by some widgets, and IIRC a tgext.so demo.)
- gui.so (general drawing functions. It's used less now that I have tgext.so)
- pngext.so (reading/display works. write is a work-in-progress. Note: not based on the photo image layer.)
- jpegext.so (reading/display works. write isn't even started. Note: not based on the photo image layer.)
- sys.so (used for applet IPC by Whim window manager)
Megapkg has a radical source tree layout (by some standards). All *.c files are generated with Fed Builder. There is only one file to compile ${Ext}_Init.c per extension. The ${Ext}_Init.c file for the particular extension #includes a header file. The header file defines structures, and #includes many C source files (usually). 2 Tcl scripts are used to generate prototypes, and includes automatically.
TG/tgext.so or Terrific Graphics now uses XDBE and XShm (for performance) if they are available. There are still many changes I want to make as TG evolves. See the csrc/tg/tgext/tests directory for some Tcl examples that use tgext.so.
Current tgext.so features include:
- Rotation of a drawing by any angle (with smooth lossless 90 degree increment rotations)
- Full alpha blending of drawings (0-255)
- Fast gradient drawing (horizontal and vertical)
- Copy/Paste (easier image buffering essentially)
- Scaling (to an exact width/height and by width/height ratios such as 0.7 (to shrink))
- Canvas Plugin (tgext.so extends the Tk canvas with a new item type called "tg". This is used in Whim for several applets.)
- Text Drawing (albeit with some bugs with alpha transparency setting (soon to be fixed))
- Drawing types (typical items such as rectangles, polygons, lines)
- Pen (a pen is moved around to position the next drawing or manipulation. In some cases this reduces the complexity.)
- Drawing duplication (almost like a drawing fork())
- Repeating of Tk images (repeat a Tk image n times over a range)
The latest tarballs are here: http://www.xmission.com/~georgeps/implementation/software/megapkg
Category Package