Version 11 of Tk9

Updated 2006-08-20 02:37:05

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.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.

Freetypeext was almost completely rewritten recently. I also added more tests for it, and leak tests that have eliminated all leaks.

2006.07.20

I created a new demo for x86 Linux (requires an 8.5 tclkit):

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

The mouse input and dragging works perfectly now with rotated tk9_windows. Now you can rotate any window in the demo. Just select the window and click the Tk8.x Rotate button at the bottom. This release is the first that demonstrates the Freetype font feature (only used if you have Vera.ttf).

Thanks to Gerald W. Lester for his help with the rotated-window-mouse-input algorithm, and the developers of the tcllib math package for the excellent point-in-polygon code that I used.

We can also now rotate windows over and over again with only a single rotations loss. This is the first tk9_demo to use the tk9.vfs and what will become the standard window.img.

I've updated the plans here: http://www.xmission.com/~georgeps/documentation/plans/Tk9-13.tar.bz2

Thanks to rdt for testing the demo in Linux. I build the starkits with qemu, and test with an 8.5 Tclkit from Linux via NetBSD's Linux emulation.

The grid manager is also at revision 4 in the 2nd prototype. It's moving along and the results are good.

2006.07.19

I have a working prototype of freetypeext.so:

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

Sample code that generated that is available here:

http://www.xmission.com/~georgeps/implementation/software/demo/text_playground.tcl

I plan to add kerning support, so that the text has better spacing between chars. Also see the text_playground.tcl file for further features I want to add that will be required for things like entry and text widgets.

I've started on my second prototype of a grid manager in Tcl. It now has -columnspan, -rowspan, and -sticky.

http://www.xmission.com/~georgeps/engineering/prototype/grid_proto_structure-4.tcl

A little work everyday adds up to a lot.


At the moment it uses megaimagetk's megaimage.frame (in the demo) for fast shared memory image display. Future performance will be even better.

I have a demo/prototype that you can drag around the windows in, and watch as the alpha transparency works flawlessly with the windows.

Here's an example of the Tk9 demo (prototype WIP):

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

Download the demo (for x86 Linux (built in Debian Sarge)): http://www.xmission.com/~georgeps/implementation/software/demo/tk9_demo.kit

Design Plans for Tk9 http://www.xmission.com/~georgeps/documentation/plans/

Future Features

  • megaimage polygon code
  • a new grid manager implemented in Tcl (work in progress)
  • complete window.img and use it in the demo.
  • better handling of alpha transparency when dragging rotated objects in the demo.
  • port to a bare framebuffer and use it as an alternative to X11 (possibly via VESA support).

I'm open to new developers helping. Are any of you interested in a mailing list?


I'm looking forward to this when I get one of them thar' round toits.