Version 15 of Tk9

Updated 2006-08-22 23:29:06

George Peter Staplin 2006.07.11 : As the Tcl/Tk core team is taking their time with Tk 8.5, I've been working on my own Tk9 for a few months. It implements a window system using Tcl, and some C extensions from megapkg (megaimage, megaimagetk, structure). It has full support for alpha transparency in any widget. You can rotate windows, and every color in Tk9 consists of [list R G B A].

Features so far include (from megaimage):

  • antialiased line drawing using Wu's algorithm (full RGBA support).
  • rectangle drawing (full RGBA support)
  • rotation
  • scaling
  • arbitrary pixel put/get
  • getrow/putrow
  • and much much more! :)

NEWS 2006.08.21

After some help testing from Tcler's Chat people, I now think I have fixed the bug that occured sometimes with Xv (X video extension) and some video cards. I worked on my initial prototype program again to figure out the bug. This is the prototype: http://www.xmission.com/~georgeps/engineering/prototype/Xv_prototype-8.tar.bz2

I then added that code and did a round of builds. This time I did the Linux builds in Debian Sarge within Qemu. There was a bit of a strange libm issue that Torsten noticed otherwise I think. I tested in Windows, NetBSD, and with SuSE Linux emulation in NetBSD.

The latest demo is here and requires Tclkit >= 8.5a4: http://www.xmission.com/~georgeps/implementation/software/demo/NexTk_demo5b.kit

If the Xv code still fails, don't fret, because you can run the demo! (Please let me know if it does fail, because it's supposed to automatically fallback to MIT-SHM.) You can do:

 export NEXTK_DISABLE_XV=1 
 tclkit8.5 NexTk_demo5b.kit

  1. We now have a working button widget.
  2. We have a mostly complete grid. I want to talk with KBK about linear programming and grid management.
  3. The input system has had further improvements.
  4. I fixed 2 bugs in the Xvideo support.
  5. I added support for the NEXTK_DISABLE_XV. To use it just do: export NEXTK_DISABLE_XV=1

(for further changes see the megapkg CHANGES file)

  1. I did more work on using this code as a window system in NetBSD without X.
  2. I added documentation for megaimage and megaimagetk.

Here's a new screenshot:

http://www.xmission.com/~georgeps/implementation/software/demo/tk9_demo4pre.png

2006.08.19

  1. I created a new Starkit for NetBSD, Linux, and Windows XP x86.
  2. Windows support now includes Freetypeext (for the text display).
  3. It has support for text input in rotated widgets. This was a rather difficult thing to add at first.
  4. I added Xv support to the persistent rendering widget, so that now we have accelerated rendering for some video cards. If xvinfo says that your video card supports YUY2 then it should work. I'm going to add other formats, but it takes a while to learn the way.
  5. The entry widget appears in this release (as a white box in the red window). It has support for cursor positioning with the mouse, keyboard, and backspace/delete support. The mouse cursor positioning is off when the widget scrolls due to the contents not fully being on screen. This will be fixed.
  6. This is the first release to use the new grid manager. It's not perfect in all cases yet, but it will become better with use and changes I make overtime.
  7. I made some rendering improvements, and performance improvements, and I still want to make more.

http://www.xmission.com/~georgeps/implementation/software/demo/tk9_demo3.kit

Here is a screenshot from that Starkit:

http://www.xmission.com/~georgeps/implementation/software/demo/screenshot.png

   TODO:
  1. Apply some of the ideas that Torsten suggested.
  2. Speedup the rendering by possibly exporting some of the structure extension, and doing more of it in C. Right now the core loop of the compositor is written in Tcl (proc rendertree).
  3. Create a clock widget.
  4. Create a button widget.

2006.08.17

  1. I almost have the entry widget fully functional.
  2. I changed the rendering engine to improve performance and quality.
  3. I added YUY2 image support for use with the Xv X extension. This means that we get some hardware assistance when rendering.
  4. The input subsystem is now being used in the demo, and being fed by some 8.5 compat code.

Here's a new screenshot: http://www.xmission.com/~georgeps/implementation/software/demo/tk9_WIP.png

Items left to do:

  1. Input system changes for supporting rotated widgets in the -buttonpress structure element callbacks. This will involve taking into account all of the rotations of windows and subwindows.
  2. Make the entry widget resize its container properly for the height of the text.
  3. Documentation for the extensions.
  4. Demo changes to allow the user to create new windows, with images, or without.

2006.08.08

I have ported the base widget that hosts Tk9 within Tk8.x to Windows. I'm now regularly building Windows DLLs with the MinGW cross compiler from pkgsrc. There are many changes I've made to the C extensions. I also had to modify the tk9_demo.vfs files to work in Windows, and created an archmap.tcl for having the Starkit support multiple platforms.

Here's a link to the Starkit that supports NetBSD x86, Linux x86, and Windows for 8.5a4 tclkits:

http://www.xmission.com/~georgeps/implementation/software/demo/tk9_demo2.kit

Thanks to Pat Thoyts and RS for testing in Windows, and elsewhere.

DKF suggested that I change the name to NexTk1. I like the sound of NexTk.

I'm thinking seriously about finishing my notes on the nv driver for X, so that I can mmap the memory, setup the card, and use this as my window system. I was thinking that I could use a modified Xvfb with this code to support X11 apps in my own window system.

It's probably time to profile the code in the demo. Some hot spots may exist in the C code or the demo itself. The grid engine is basically finished for now I think. Once I get it working in real world apps I think that will be the real test of it.