[Fencommits] libvob: Add simple terminal graphics api.

Matti J. Katila majukati at cc.jyu.fi
Tue Nov 29 23:05:03 EET 2005


Tue Nov 29 22:27:49 EET 2005  Matti J. Katila <majukati at cc.jyu.fi>
  * Add simple terminal graphics api.

diff -rN -u libvob-old/org/nongnu/libvob/GraphicsAPI.java libvob-new/org/nongnu/libvob/GraphicsAPI.java
--- libvob-old/org/nongnu/libvob/GraphicsAPI.java	2005-11-29 23:05:01.407575569 +0200
+++ libvob-new/org/nongnu/libvob/GraphicsAPI.java	2005-11-29 22:32:08.000000000 +0200
@@ -61,8 +61,12 @@
 	} else if(cl.equals("gl")) {
 	    gfxapi = new org.nongnu.libvob.impl.gl.GLAPI();
             type = "gl";
+	} else if(cl.equals("terminal")) {
+	    gfxapi = new org.nongnu.libvob.impl.terminal.TERMINALAPI();
+            type = "terminal";
 	} else
-	    throw new Error("Invalid client type '"+cl+"': should be awt or gl");
+	    throw new Error("Invalid client type '"+cl+"': should be "+
+			    "awt, applet, terminal or gl");
     }
 
     /** Get the singleton instance.
diff -rN -u libvob-old/org/nongnu/libvob/impl/awt/AWTScreen.java libvob-new/org/nongnu/libvob/impl/awt/AWTScreen.java
--- libvob-old/org/nongnu/libvob/impl/awt/AWTScreen.java	2005-11-29 23:05:01.404576021 +0200
+++ libvob-new/org/nongnu/libvob/impl/awt/AWTScreen.java	2005-11-29 22:32:08.000000000 +0200
@@ -315,7 +315,7 @@
 	    }
 	    switch(me.getButton()) {
 	        case 0:
-		    // argh -- that's a bug in awt -- work around it
+		    // argh -- that's a bug in awt -- this's a work around
 		    veb = 1; break;
 		case MouseEvent.BUTTON1: veb = 1; break;
 		case MouseEvent.BUTTON2: veb = 2; break;
diff -rN -u libvob-old/org/nongnu/libvob/impl/awt/AWTVobCoorderBase.java libvob-new/org/nongnu/libvob/impl/awt/AWTVobCoorderBase.java
--- libvob-old/org/nongnu/libvob/impl/awt/AWTVobCoorderBase.java	2005-11-29 23:05:01.403576172 +0200
+++ libvob-new/org/nongnu/libvob/impl/awt/AWTVobCoorderBase.java	2005-11-29 22:32:08.000000000 +0200
@@ -1094,7 +1094,7 @@
     /** Internal API: to be called right after creation,
      * to leave room for other coordsyses.
      */
-    void setNumberOfParameterCS(int numberOfParameterCS) {
+    public void setNumberOfParameterCS(int numberOfParameterCS) {
 	ninds = this.numberOfParameterCS = numberOfParameterCS;
     }
     int numberOfParameterCS = 1;
diff -rN -u libvob-old/org/nongnu/libvob/impl/terminal/ConsoleOperations.java libvob-new/org/nongnu/libvob/impl/terminal/ConsoleOperations.java
--- libvob-old/org/nongnu/libvob/impl/terminal/ConsoleOperations.java	1970-01-01 02:00:00.000000000 +0200
+++ libvob-new/org/nongnu/libvob/impl/terminal/ConsoleOperations.java	2005-11-29 22:32:08.000000000 +0200
@@ -0,0 +1,286 @@
+/**
+ *	jline - Java console input library
+ *	Copyright (c) 2002, 2003, 2004, 2005, Marc Prud'hommeaux <mwp1 at cornell.edu>
+ *	All rights reserved.
+ *
+ *	Redistribution and use in source and binary forms, with or
+ *	without modification, are permitted provided that the following
+ *	conditions are met:
+ *
+ *	Redistributions of source code must retain the above copyright
+ *	notice, this list of conditions and the following disclaimer.
+ *
+ *	Redistributions in binary form must reproduce the above copyright
+ *	notice, this list of conditions and the following disclaimer
+ *	in the documentation and/or other materials provided with
+ *	the distribution.
+ *
+ *	Neither the name of JLine nor the names of its contributors
+ *	may be used to endorse or promote products derived from this
+ *	software without specific prior written permission.
+ *
+ *	THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ *	"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
+ *	BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ *	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ *	EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ *	FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ *	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ *	PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ *	DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ *	AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ *	LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ *	IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ *	OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.nongnu.libvob.impl.terminal;
+
+
+import java.awt.event.KeyEvent;
+
+
+/**
+ *	Synbolic constants for Console operations and virtual key bindings.
+ *
+ *	@see KeyEvent
+ *  @author  <a href="mailto:mwp1 at cornell.edu">Marc Prud'hommeaux</a>
+ */
+public interface ConsoleOperations
+{
+	String CR = System.getProperty ("line.separator");
+
+	char BACKSPACE = '\b';
+	char RESET_LINE = '\r';
+	char KEYBOARD_BELL = '\07';
+
+	char CTRL_P = 16;
+	char CTRL_N = 14;
+	char CTRL_B = 2;
+	char CTRL_F = 6;
+
+
+	/**
+	 *	Logical constants for key operations.
+	 */
+
+	/**
+	 *  Unknown operation.
+	 */
+	short UNKNOWN				= -99;
+
+	/**
+	 *  Operation that moves to the beginning of the buffer.
+	 */
+	short MOVE_TO_BEG			= -1;
+
+	/**
+	 *  Operation that moves to the end of the buffer.
+	 */
+	short MOVE_TO_END			= -3;
+
+	/**
+	 *  Operation that moved to the previous character in the buffer.
+	 */
+	short PREV_CHAR				= -4;
+
+	/**
+	 *  Operation that issues a newline.
+	 */
+	short NEWLINE				= -6;
+
+	/**
+	 *  Operation that deletes the buffer from the current character to the end.
+	 */
+	short KILL_LINE				= -7;
+
+	/**
+	 *  Operation that clears the screen.
+	 */
+	short CLEAR_SCREEN			= -8;
+
+	/**
+	 *  Operation that sets the buffer to the next history item.
+	 */
+	short NEXT_HISTORY			= -9;
+
+	/**
+	 *  Operation that sets the buffer to the previous history item.
+	 */
+	short PREV_HISTORY			= -11;
+
+	/**
+	 *  Operation that redisplays the current buffer.
+	 */
+	short REDISPLAY				= -13;
+
+	/**
+	 *  Operation that deletes the buffer from the cursor to the beginning.
+	 */
+	short KILL_LINE_PREV		= -15;
+
+	/**
+	 *  Operation that deletes the previous word in the buffer.
+	 */
+	short DELETE_PREV_WORD		= -16;
+
+	/**
+	 *  Operation that moves to the next character in the buffer.
+	 */
+	short NEXT_CHAR				= -19;
+
+	/**
+	 *  Operation that moves to the previous character in the buffer.
+	 */
+	short REPEAT_PREV_CHAR		= -20;
+
+	/**
+	 *  Operation that searches backwards in the command history.
+	 */
+	short SEARCH_PREV			= -21;
+
+	/**
+	 *  Operation that repeats the character.
+	 */
+	short REPEAT_NEXT_CHAR		= -24;
+
+	/**
+	 *  Operation that searches forward in the command history.
+	 */
+	short SEARCH_NEXT			= -25;
+
+	/**
+	 *  Operation that moved to the previous whitespace.
+	 */
+	short PREV_SPACE_WORD		= -27;
+
+	/**
+	 *  Operation that moved to the end of the current word.
+	 */
+	short TO_END_WORD			= -29;
+
+	/**
+	 *  Operation that
+	 */
+	short REPEAT_SEARCH_PREV	= -34;
+
+	/**
+	 *  Operation that
+	 */
+	short PASTE_PREV			= -36;
+
+	/**
+	 *  Operation that
+	 */
+	short REPLACE_MODE			= -37;
+
+	/**
+	 *  Operation that
+	 */
+	short SUBSTITUTE_LINE		= -38;
+
+	/**
+	 *  Operation that
+	 */
+	short TO_PREV_CHAR			= -39;
+
+	/**
+	 *  Operation that
+	 */
+	short NEXT_SPACE_WORD		= -40;
+
+	/**
+	 *  Operation that
+	 */
+	short DELETE_PREV_CHAR		= -41;
+
+	/**
+	 *  Operation that
+	 */
+	short ADD					= -42;
+
+	/**
+	 *  Operation that
+	 */
+	short PREV_WORD				= -43;
+
+	/**
+	 *  Operation that
+	 */
+	short CHANGE_META			= -44;
+
+	/**
+	 *  Operation that
+	 */
+	short DELETE_META			= -45;
+
+	/**
+	 *  Operation that
+	 */
+	short END_WORD				= -46;
+
+	/**
+	 *  Operation that
+	 */
+	short INSERT				= -48;
+
+	/**
+	 *  Operation that
+	 */
+	short REPEAT_SEARCH_NEXT	= -49;
+
+	/**
+	 *  Operation that
+	 */
+	short PASTE_NEXT			= -50;
+
+	/**
+	 *  Operation that
+	 */
+	short REPLACE_CHAR			= -51;
+
+	/**
+	 *  Operation that
+	 */
+	short SUBSTITUTE_CHAR		= -52;
+
+	/**
+	 *  Operation that
+	 */
+	short TO_NEXT_CHAR			= -53;
+
+	/**
+	 *  Operation that undoes the previous operation.
+	 */
+	short UNDO					= -54;
+
+	/**
+	 *  Operation that moved to the next word.
+	 */
+	short NEXT_WORD				= -55;
+
+	/**
+	 *  Operation that deletes the previous character.
+	 */
+	short DELETE_NEXT_CHAR		= -56;
+
+	/**
+	 *  Operation that toggles between uppercase and lowercase.
+	 */
+	short CHANGE_CASE			= -57;
+
+	/**
+	 *  Operation that performs completion operation on the current word.
+	 */
+	short COMPLETE				= -58;
+
+	/**
+	 *  Operation that exits the command prompt.
+	 */
+	short EXIT					= -59;
+
+	/**
+	 *  Operation that pastes the contents of the cliboard into the line
+	 */
+	short PASTE				= -60;
+}
+
diff -rN -u libvob-old/org/nongnu/libvob/impl/terminal/TERMINALAPI.java libvob-new/org/nongnu/libvob/impl/terminal/TERMINALAPI.java
--- libvob-old/org/nongnu/libvob/impl/terminal/TERMINALAPI.java	1970-01-01 02:00:00.000000000 +0200
+++ libvob-new/org/nongnu/libvob/impl/terminal/TERMINALAPI.java	2005-11-29 22:32:08.000000000 +0200
@@ -0,0 +1,32 @@
+// (c): Matti J. Katila
+
+package org.nongnu.libvob.impl.terminal;
+import org.nongnu.libvob.*;
+import org.nongnu.libvob.impl.awt.*;
+import org.nongnu.libvob.util.*;
+import jline.*;
+
+public class TERMINALAPI extends GraphicsAPI {
+
+    public void startUpdateManager(java.lang.Runnable r){
+	TerminalUpdateManager.startUpdateManager(r);
+    }
+
+    private Window window = null;
+
+    public Window createWindow() {
+	if (window != null) 
+	    throw new Error("Window in use already.");
+	else window = new TerminalWindow(this);
+	return window;
+    }
+
+    public RenderingSurface createStableOffscreen(int w, int h) {
+	return null;
+    }
+
+    public TextStyle getTextStyle(java.lang.String family, 
+				  int style, int size) {
+	return new RawTextStyle(new ScalableFont(family, style, size), null);
+    }
+}
diff -rN -u libvob-old/org/nongnu/libvob/impl/terminal/TerminalGraphics.java libvob-new/org/nongnu/libvob/impl/terminal/TerminalGraphics.java
--- libvob-old/org/nongnu/libvob/impl/terminal/TerminalGraphics.java	1970-01-01 02:00:00.000000000 +0200
+++ libvob-new/org/nongnu/libvob/impl/terminal/TerminalGraphics.java	2005-11-29 22:32:08.000000000 +0200
@@ -0,0 +1,866 @@
+// (c): Matti J. Katila
+
+package org.nongnu.libvob.impl.terminal;
+import java.awt.*;
+import java.awt.image.*;
+import java.text.*;
+import java.util.*;
+
+public class TerminalGraphics extends Graphics {
+    static private void p(String s) { System.out.println("TermGraphics:: "+s); }
+    static public boolean dbg = true;
+    static public boolean dbgImpl = false;
+
+    private Frame dbgFrame = null;
+    private Canvas dbgCanvas = null;
+    private int[] dbgArr = null;
+    private MemoryImageSource dbgSource = null;
+
+
+
+    /* Some ANSI color codes:
+     *
+     * [30m  set foreground color to black
+     * [31m  set foreground color to red
+     * [32m  set foreground color to green
+     * [33m  set foreground color to yellow
+     * [34m  set foreground color to blue
+     * [35m  set foreground color to magenta (purple)
+     * [36m  set foreground color to cyan
+     * [37m  set foreground color to white
+     * [39m  set foreground color to default (white)
+     *
+     * [40m  set background color to black
+     * [41m  set background color to red
+     * [42m  set background color to green
+     * [43m  set background color to yellow
+     * [44m  set background color to blue
+     * [45m  set background color to magenta (purple)
+     * [46m  set background color to cyan
+     * [47m  set background color to white
+     * [49m  set background color to default (black)
+     */
+
+    public final char 
+        BLACK = 1 << 0,
+	RED = 1 << 1,
+	GREEN = 1 << 2,
+	YELLOW = 1 << 3,
+	BLUE = 1 << 4,
+	MAGENTA = 1 << 5,
+	CYAN = 1 << 6,
+	WHITE = 1 << 7;
+
+
+    private Dimension termSize, size;
+    private int xBits = 8, yBits = 16;
+    private Color buff[];
+    private Color innerColor = Color.BLACK;
+    private Color outerColor = Color.BLACK;
+    private Rectangle clip;
+
+    private Color[] colors = {
+        Color.BLACK,
+	Color.RED,
+	Color.GREEN,
+	Color.YELLOW,
+	Color.BLUE,
+	Color.MAGENTA,
+	Color.CYAN,
+	Color.WHITE,
+    };
+
+
+    public TerminalGraphics(Dimension termSize) {
+	this.termSize = termSize;
+	p("size: "+termSize);
+	this.size = new Dimension(termSize.width * xBits, 
+				  termSize.height * yBits);
+	this.buff = new Color[size.width * size.height];
+
+	setBeginState();
+
+	if (dbg) {
+	    dbgFrame = new Frame();
+	    dbgArr = new int[size.width*size.height];
+	    dbgSource = 
+		new MemoryImageSource(size.width, size.height, dbgArr, 0, size.width);
+	    dbgSource.setAnimated(true);
+	    final Image img = Toolkit.getDefaultToolkit().createImage(dbgSource);
+	    dbgFrame.setBounds(0,0, size.width, size.height);
+	    dbgCanvas = new Canvas(){
+		    public void paint(Graphics g) {
+			g.drawImage(img, 0,0,size.width, size.height, null);
+		    }
+		};
+	    dbgFrame.add(dbgCanvas);
+	    dbgFrame.show();
+	    /*
+	    new Thread(){ public void run() {
+		Random r = new Random();
+		while(true){
+
+		    for (int i=0; i<100; i++)
+			dbgArr[r.nextInt(size.height)*size.width+r.nextInt(size.width)] =
+			    new Color(r.nextInt(255), r.nextInt(255), r.nextInt(255)).getRGB();
+		    try{
+			Thread.sleep(100);
+		    } catch (Exception e) {
+			; 
+		    }
+		    dbgSource.newPixels();
+		    //canvas.validate();
+		    canvas.repaint();
+		    //dbgFrame.validate();
+		}
+	    }}.start();
+	    */
+
+	    int y=0, x=0;
+	    for (int i=33; i<50; i++)
+	    {
+		int fontIndex = i*16;
+		for (int yi=0; yi<16; yi++) {
+		    for (int xi=0; xi<8; xi++) {
+			if ((font8x16[fontIndex+yi] & (1<<xi)) != 0)
+			    dbgArr[(y+yi)*size.width+x+7-xi] = innerColor.getRGB();
+		    }
+		}
+		y += 16;
+	    }
+	    drawString("ABC", 20,20);
+	    drawString(" ABCD", 0,0);
+	    if (dbg) {
+		dbgSource.newPixels();
+		dbgCanvas.repaint();
+	    }
+
+	};
+    }
+
+    static public void main(String[]argv) {
+	new TerminalGraphics(new Dimension(20,20));
+    }
+
+
+
+
+    public void setBeginState() {
+	this.clip = new Rectangle(0,0,size.width, size.height);
+	this.innerColor = outerColor = Color.BLACK;
+
+    }
+
+    public Dimension getSize() { return size; }
+
+    private Color getClosestColor(Color out, Color[] colors) {
+	int distance[] = new int[colors.length];
+	for (int i=0; i<colors.length; i++) {
+	    Color c = colors[i];
+	    int d = c.getBlue() - out.getBlue();
+	    if (d<0) d = -d;
+	    distance[i] += d;
+	    d = c.getGreen() - out.getGreen();
+	    if (d<0) d = -d;
+	    distance[i] += d;
+	    d = c.getRed() - out.getRed();
+	    if (d<0) d = -d;
+	    distance[i] += d;
+	}
+	int min = 1000000;
+	int index = -1;
+	for (int i=0; i<colors.length; i++) {
+	    if (distance[i] < min) {
+		index = i;
+		min = distance[i];
+	    }
+	}
+	return colors[index];
+    }
+
+
+    private int min(int a, int b) { return a<b?a:b; }
+    private int max(int a, int b) { return a>b?a:b; }
+
+
+
+
+    public void clearRect(int x, int y, int width, int height) {
+	if (dbg) p("clearRect");
+    }
+
+
+    public void clipRect(int x, int y, int width, int height){
+	if (dbg) p("clipRect");
+	if (x < clip.width && y < clip.height)
+	    clip = new Rectangle(max(x, clip.x),max(y, clip.y), 
+				 min(width, clip.width), min(height, clip.height));
+    }
+
+
+    public void copyArea(int x, int y, int width, int height,
+			  int dx, int dy) {
+	if (dbg) p("");
+    }
+
+    public Graphics create() { return this; }
+    
+    public Graphics create(int x, int y, int width, int height) {
+	return this;
+    }
+
+    public void dispose() {}
+    
+    public void draw3DRect(int x, int y, int width, int height, 
+				   boolean raised) {
+    }
+
+    public void drawArc(int x, int y, int width, int height, 
+			 int startAngle, int arcAngle) {
+    }
+    
+    public boolean drawImage(Image img, int x, int y, Color bgcolor, 
+			      ImageObserver observer) {
+	return true;
+    }
+
+    public boolean drawImage(Image img, int x, int y, 
+			      ImageObserver observer) {
+	return true;
+    }
+
+    public boolean drawImage(Image img, int x, int y, int width, int height,
+			      Color bgcolor, ImageObserver observer) {
+	return true;
+    }
+
+    public boolean drawImage(Image img, int x, int y, int width, int height, 
+			      ImageObserver observer) {
+	return true;
+    }
+
+    public boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2, 
+			      int sx1, int sy1, int sx2, int sy2, 
+			      Color bgcolor, ImageObserver observer) {
+	return true;
+    }
+
+    public boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2,
+			      int sx1, int sy1, int sx2, int sy2, 
+			      ImageObserver observer) {
+	return true;
+    }
+
+    public void drawLine(int x1, int y1, int x2, int y2) {
+	if (dbg) p("drawLine: "+x1+", "+y1+", "+x2+", "+y2);
+    }
+
+    public void drawOval(int x, int y, int width, int height) {
+	if (dbg) p("drawOval: "+x+", "+y+", "+width+", "+height);
+    }
+    
+    public void drawPolygon(int[] xPoints, int[] yPoints, int nPoints) {
+	if (dbg) p("drawPolygon: "+nPoints);
+    }
+
+    public void drawPolygon(Polygon p) {
+	if (dbg) p("drawPolygon: "+p);
+    }
+    
+    public void drawPolyline(int[] xPoints, int[] yPoints, int nPoints) {
+	if (dbg) p("drawPolyline: "+nPoints);
+    }
+
+    public void drawRect(int x, int y, int width, int height) {
+	if (dbg) p("drawRect: "+x+", "+y+", "+width+", "+height);
+    }
+
+    public void drawRoundRect(int x, int y, int width, int height, 
+			       int arcWidth, int arcHeight) {
+	if (dbg) p("drawRoundRect: "+x+", "+y+", "+width+", "+height+
+		   ", "+arcHeight+", "+arcHeight);
+    }
+
+    public void drawString(AttributedCharacterIterator iterator, 
+			    int x, int y) {
+	if (dbg) p("drawString: ");
+    }
+    
+    public void drawString(String str, int x, int y) {
+	if (dbg) p("drawString: "+str+", "+x+", "+y);
+
+	x = x - (x%8);
+	y = y - (y%16);
+	for (int i=0; i<str.length(); i++) 
+	{
+	    int ch = str.charAt(i);
+	    int fontIndex = ch*16;
+	    for (int yi=0; yi<16; yi++) {
+		for (int xi=0; xi<8; xi++) {
+		    if (y+yi>= clip.y+clip.height) continue;
+		    if (x+xi>= clip.x+clip.width) continue;
+
+		    if ((font8x16[fontIndex+yi] & (1<<xi)) != 0) {
+			buff[(y+yi)*size.width+x+7-xi] = innerColor;
+			if (dbg) dbgArr[(y+yi)*size.width+x+7-xi] = innerColor.getRGB();
+		    }
+		}
+	    }
+	    x+=8;
+		
+	}
+	if (dbg) {
+	    dbgSource.newPixels();
+	    dbgCanvas.repaint();
+	}
+
+    }
+
+    public void fill3DRect(int x, int y, int width, int height, 
+			   boolean raised) {
+	if (dbg) p("fill3d");
+    }
+
+    public void fillArc(int x, int y, int width, int height, 
+			 int startAngle, int arcAngle) {
+	if (dbg) p("fillArc: "+x+", "+y+", "+width+", "+height+
+		   ", "+startAngle+", "+arcAngle);
+    }
+
+    public void fillOval(int x, int y, int width, int height) {
+	if (dbg) p("fillOval: "+x+", "+y+", "+width+", "+height);
+    }
+
+    public void fillPolygon(int[] xPoints, int[] yPoints, int nPoints) {
+	if (dbg) p("fillPolygon: "+nPoints);
+    }
+
+    public void fillPolygon(Polygon p) {
+	if (dbg) p("fillPolygon: "+p);
+    }
+
+    public void fillRect(int x, int y, int width, int height) {
+	if (dbg && dbgImpl) p("fillRect: "+x+", "+y+", "+width+", "+height);
+	try {
+	for (int yi=max(y, clip.y); yi<min(y+height, clip.y+clip.height); yi++){
+	    for (int xi=max(x, clip.x); xi<min(x+width, clip.x+clip.width); xi++){
+		buff[yi*size.width+xi] = innerColor;
+		if (dbg) dbgArr[yi*size.width+xi] = innerColor.getRGB();
+	    }
+	}
+	if (dbg) {
+	    dbgSource.newPixels();
+	    dbgCanvas.repaint();
+	}
+	} catch (ArrayIndexOutOfBoundsException e) {
+	    p("ARGH");
+	    p("fillRect: "+x+", "+y+", "+width+", "+height);
+	}
+    }
+
+    public void fillRoundRect(int x, int y, int width, int height, 
+			       int arcWidth, int arcHeight) {
+	if (dbg) p("fillRoundRect: "+x+", "+y+", "+width+", "+height+
+		   ", "+arcWidth+", "+arcHeight);
+    }
+
+    public Shape getClip() {
+	if (dbg && dbgImpl) p("getClip");
+	return clip;
+    }
+
+    public Rectangle getClipBounds() {
+	if (dbg && dbgImpl) p("getClipBounds");
+	return clip;
+    }
+
+    public Color getColor() {
+	if (dbg && dbgImpl) p("getColor");
+	return outerColor;
+    }
+
+    public Font getFont() {
+	if (dbg) p("getFont");
+	return null;
+    }
+
+    public FontMetrics getFontMetrics(Font f) {
+	if (dbg) p("getFontMetrics: "+f);
+	return null;
+    }
+
+    public void setClip(int x, int y, int width, int height) {
+	if (dbg && dbgImpl) p("setClip: "+x+", "+y+", "+width+", "+height);
+
+	
+	clip = new Rectangle(x, y, width, height);
+	clip.x = min(clip.x, size.height);
+	clip.y = min(clip.y, size.height);
+	clip.x = max(clip.x, 0);
+	clip.y = max(clip.y, 0);
+	clip.width = min(size.width-clip.x, clip.width);
+	clip.height = min(size.height-clip.y, clip.height);
+    }
+
+    public void setClip(Shape clip) {
+	if (dbg && dbgImpl) p("setClip: "+clip);
+	if (clip == null) return;
+	if (!(clip instanceof Rectangle))
+	    throw new Error("Non rect - Not implemented.");
+	Rectangle r = (Rectangle) clip;
+	setClip((int)r.getX(), (int)r.getY(), 
+		(int)r.getWidth(), (int)r.getHeight());
+    }
+    
+    public void setColor(Color c) {
+	outerColor = c;
+	innerColor = getClosestColor(c, colors);
+	if (dbg  && dbgImpl) p("setColor: "+c+" -> "+innerColor);
+    }
+
+    public void setFont(Font font) {
+	if (dbg) p("setFont: "+font);
+    }
+
+    public void setPaintMode() {
+	if (dbg) p("setPaintMode");
+    }
+
+    public void setXORMode(Color c1) {
+	if (dbg) p("setXORMode "+c1);
+    }
+
+    public String toString() { return "Terminal"+super.toString(); }
+
+    public void translate(int x, int y) {
+	if (dbg) p("translate "+x+", "+y);
+    }
+
+
+
+
+
+
+
+
+
+
+
+    /* This field is a copy from aalib. Aalib's source is licensed under the (L)GPL.
+     */
+    char font8x16[] = {
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x81,
+    0xa5, 0x81, 0x81, 0xbd, 0x99, 0x81, 0x81, 0x7e, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x7e, 0xff, 0xdb, 0xff, 0xff, 0xc3,
+    0xe7, 0xff, 0xff, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x6c, 0xfe, 0xfe, 0xfe, 0xfe, 0x7c, 0x38, 0x10,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38,
+    0x7c, 0xfe, 0x7c, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x18, 0x3c, 0x3c, 0xe7, 0xe7, 0xe7, 0x18,
+    0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18,
+    0x3c, 0x7e, 0xff, 0xff, 0x7e, 0x18, 0x18, 0x3c, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c,
+    0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff,
+    0xff, 0xff, 0xff, 0xff, 0xe7, 0xc3, 0xc3, 0xe7, 0xff, 0xff,
+    0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c,
+    0x66, 0x42, 0x42, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xff, 0xff, 0xff, 0xff, 0xff, 0xc3, 0x99, 0xbd, 0xbd, 0x99,
+    0xc3, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x1e, 0x0e,
+    0x1a, 0x32, 0x78, 0xcc, 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0x66, 0x66, 0x66, 0x3c,
+    0x18, 0x7e, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x3f, 0x33, 0x3f, 0x30, 0x30, 0x30, 0x30, 0x70, 0xf0, 0xe0,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x63, 0x7f, 0x63,
+    0x63, 0x63, 0x63, 0x67, 0xe7, 0xe6, 0xc0, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x18, 0x18, 0xdb, 0x3c, 0xe7, 0x3c, 0xdb,
+    0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0,
+    0xf0, 0xf8, 0xfe, 0xf8, 0xf0, 0xe0, 0xc0, 0x80, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x02, 0x06, 0x0e, 0x1e, 0x3e, 0xfe, 0x3e,
+    0x1e, 0x0e, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x18, 0x3c, 0x7e, 0x18, 0x18, 0x18, 0x7e, 0x3c, 0x18, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66, 0x66,
+    0x66, 0x66, 0x66, 0x00, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x7f, 0xdb, 0xdb, 0xdb, 0x7b, 0x1b, 0x1b, 0x1b,
+    0x1b, 0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0x60,
+    0x38, 0x6c, 0xc6, 0xc6, 0x6c, 0x38, 0x0c, 0xc6, 0x7c, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xfe, 0xfe, 0xfe, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x18, 0x3c, 0x7e, 0x18, 0x18, 0x18, 0x7e, 0x3c, 0x18, 0x7e,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c, 0x7e, 0x18,
+    0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x7e,
+    0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x18, 0x0c, 0xfe, 0x0c, 0x18, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x60, 0xfe,
+    0x60, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0xc0, 0xfe, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24,
+    0x66, 0xff, 0x66, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x38, 0x7c, 0x7c, 0xfe,
+    0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xfe, 0xfe, 0x7c, 0x7c, 0x38, 0x38, 0x10, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x18, 0x3c, 0x3c, 0x3c, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66, 0x24, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x6c, 0x6c, 0xfe, 0x6c, 0x6c, 0x6c, 0xfe,
+    0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7c, 0xc6,
+    0xc2, 0xc0, 0x7c, 0x06, 0x06, 0x86, 0xc6, 0x7c, 0x18, 0x18,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc2, 0xc6, 0x0c, 0x18,
+    0x30, 0x60, 0xc6, 0x86, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x38, 0x6c, 0x6c, 0x38, 0x76, 0xdc, 0xcc, 0xcc, 0xcc, 0x76,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x30, 0x60, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x0c, 0x18, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
+    0x18, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x18,
+    0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x18, 0x30, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x3c, 0xff,
+    0x3c, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x18, 0x18, 0x7e, 0x18, 0x18, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x06, 0x0c, 0x18,
+    0x30, 0x60, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x7c, 0xc6, 0xc6, 0xce, 0xde, 0xf6, 0xe6, 0xc6, 0xc6, 0x7c,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x38, 0x78, 0x18,
+    0x18, 0x18, 0x18, 0x18, 0x18, 0x7e, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x7c, 0xc6, 0x06, 0x0c, 0x18, 0x30, 0x60, 0xc0,
+    0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6,
+    0x06, 0x06, 0x3c, 0x06, 0x06, 0x06, 0xc6, 0x7c, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x0c, 0x1c, 0x3c, 0x6c, 0xcc, 0xfe,
+    0x0c, 0x0c, 0x0c, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xfe, 0xc0, 0xc0, 0xc0, 0xfc, 0x06, 0x06, 0x06, 0xc6, 0x7c,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x60, 0xc0, 0xc0,
+    0xfc, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0xfe, 0xc6, 0x06, 0x06, 0x0c, 0x18, 0x30, 0x30,
+    0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6,
+    0xc6, 0xc6, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0x7e, 0x06,
+    0x06, 0x06, 0x0c, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18,
+    0x00, 0x00, 0x00, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x06, 0x0c, 0x18, 0x30, 0x60, 0x30, 0x18,
+    0x0c, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x7e, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0x18, 0x0c, 0x06,
+    0x0c, 0x18, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x7c, 0xc6, 0xc6, 0x0c, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6,
+    0xde, 0xde, 0xde, 0xdc, 0xc0, 0x7c, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6,
+    0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x66,
+    0x66, 0x66, 0x7c, 0x66, 0x66, 0x66, 0x66, 0xfc, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0xc2, 0xc0, 0xc0, 0xc0,
+    0xc0, 0xc2, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xf8, 0x6c, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x6c, 0xf8,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x66, 0x62, 0x68,
+    0x78, 0x68, 0x60, 0x62, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 0x60, 0x60,
+    0x60, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66,
+    0xc2, 0xc0, 0xc0, 0xde, 0xc6, 0xc6, 0x66, 0x3a, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xfe, 0xc6,
+    0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x3c, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x0c, 0x0c, 0x0c,
+    0x0c, 0x0c, 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0xe6, 0x66, 0x66, 0x6c, 0x78, 0x78, 0x6c, 0x66,
+    0x66, 0xe6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x60,
+    0x60, 0x60, 0x60, 0x60, 0x60, 0x62, 0x66, 0xfe, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0xc3, 0xe7, 0xff, 0xff, 0xdb, 0xc3,
+    0xc3, 0xc3, 0xc3, 0xc3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xc6, 0xe6, 0xf6, 0xfe, 0xde, 0xce, 0xc6, 0xc6, 0xc6, 0xc6,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6,
+    0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x60, 0x60, 0x60,
+    0x60, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6,
+    0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xd6, 0xde, 0x7c, 0x0c, 0x0e,
+    0x00, 0x00, 0x00, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x6c,
+    0x66, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x7c, 0xc6, 0xc6, 0x60, 0x38, 0x0c, 0x06, 0xc6, 0xc6, 0x7c,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xdb, 0x99, 0x18,
+    0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6,
+    0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xc3,
+    0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0x66, 0x3c, 0x18, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xdb,
+    0xdb, 0xff, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xc3, 0xc3, 0x66, 0x3c, 0x18, 0x18, 0x3c, 0x66, 0xc3, 0xc3,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xc3, 0xc3, 0x66,
+    0x3c, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0xff, 0xc3, 0x86, 0x0c, 0x18, 0x30, 0x60, 0xc1,
+    0xc3, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x30,
+    0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x3c, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0, 0x70, 0x38,
+    0x1c, 0x0e, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x3c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x3c,
+    0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x30, 0x30, 0x18, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x0c, 0x7c,
+    0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xe0, 0x60, 0x60, 0x78, 0x6c, 0x66, 0x66, 0x66, 0x66, 0x7c,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c,
+    0xc6, 0xc0, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x1c, 0x0c, 0x0c, 0x3c, 0x6c, 0xcc, 0xcc, 0xcc,
+    0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x38, 0x6c, 0x64, 0x60, 0xf0, 0x60,
+    0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x76, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x7c,
+    0x0c, 0xcc, 0x78, 0x00, 0x00, 0x00, 0xe0, 0x60, 0x60, 0x6c,
+    0x76, 0x66, 0x66, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x18, 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18,
+    0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06,
+    0x00, 0x0e, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x66, 0x66,
+    0x3c, 0x00, 0x00, 0x00, 0xe0, 0x60, 0x60, 0x66, 0x6c, 0x78,
+    0x78, 0x6c, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe6,
+    0xff, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x66, 0x66, 0x66, 0x66,
+    0x66, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x66, 0x66,
+    0x66, 0x66, 0x66, 0x7c, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x76, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x7c,
+    0x0c, 0x0c, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdc,
+    0x76, 0x66, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0x60, 0x38, 0x0c,
+    0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x30,
+    0x30, 0xfc, 0x30, 0x30, 0x30, 0x30, 0x36, 0x1c, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0xcc, 0xcc,
+    0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0x66, 0x3c, 0x18,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3,
+    0xc3, 0xc3, 0xdb, 0xdb, 0xff, 0x66, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0x66, 0x3c, 0x18, 0x3c,
+    0x66, 0xc3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x0c,
+    0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xcc, 0x18,
+    0x30, 0x60, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x0e, 0x18, 0x18, 0x18, 0x70, 0x18, 0x18, 0x18, 0x18, 0x0e,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18,
+    0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x70, 0x18, 0x18, 0x18, 0x0e, 0x18, 0x18, 0x18,
+    0x18, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xdc,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c, 0xc6,
+    0xc6, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x3c, 0x66, 0xc2, 0xc0, 0xc0, 0xc0, 0xc2, 0x66, 0x3c, 0x0c,
+    0x06, 0x7c, 0x00, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0xcc,
+    0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x0c, 0x18, 0x30, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0,
+    0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c,
+    0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x78, 0x0c, 0x7c,
+    0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60,
+    0x30, 0x18, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c, 0x38, 0x00, 0x78,
+    0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0x60, 0x60, 0x66, 0x3c,
+    0x0c, 0x06, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c,
+    0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0xc6, 0x00, 0x00, 0x7c, 0xc6, 0xfe,
+    0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60,
+    0x30, 0x18, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x00, 0x00, 0x38,
+    0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x18, 0x3c, 0x66, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18,
+    0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0x18,
+    0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0xc6, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6,
+    0xfe, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c,
+    0x38, 0x00, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6,
+    0x00, 0x00, 0x00, 0x00, 0x18, 0x30, 0x60, 0x00, 0xfe, 0x66,
+    0x60, 0x7c, 0x60, 0x60, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x6e, 0x3b, 0x1b, 0x7e, 0xd8,
+    0xdc, 0x77, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x6c,
+    0xcc, 0xcc, 0xfe, 0xcc, 0xcc, 0xcc, 0xcc, 0xce, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x10, 0x38, 0x6c, 0x00, 0x7c, 0xc6, 0xc6,
+    0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xc6, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0x18, 0x00, 0x7c,
+    0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x30, 0x78, 0xcc, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc,
+    0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0x18,
+    0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0xc6, 0x00, 0x00, 0xc6, 0xc6, 0xc6,
+    0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x0c, 0x78, 0x00, 0x00, 0xc6,
+    0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00, 0xc6, 0xc6, 0xc6,
+    0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x18, 0x18, 0x7e, 0xc3, 0xc0, 0xc0, 0xc0, 0xc3, 0x7e,
+    0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c, 0x64,
+    0x60, 0xf0, 0x60, 0x60, 0x60, 0x60, 0xe6, 0xfc, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0xc3, 0x66, 0x3c, 0x18, 0xff, 0x18,
+    0xff, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc,
+    0x66, 0x66, 0x7c, 0x62, 0x66, 0x6f, 0x66, 0x66, 0x66, 0xf3,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x1b, 0x18, 0x18, 0x18,
+    0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 0xd8, 0x70, 0x00, 0x00,
+    0x00, 0x18, 0x30, 0x60, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc,
+    0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x18, 0x30,
+    0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x18, 0x30, 0x60, 0x00, 0x7c, 0xc6, 0xc6,
+    0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18,
+    0x30, 0x60, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xdc, 0x00, 0xdc,
+    0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00,
+    0x76, 0xdc, 0x00, 0xc6, 0xe6, 0xf6, 0xfe, 0xde, 0xce, 0xc6,
+    0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x6c, 0x6c,
+    0x3e, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x38, 0x6c, 0x6c, 0x38, 0x00, 0x7c, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x30, 0x30, 0x00, 0x30, 0x30, 0x60, 0xc0, 0xc6, 0xc6, 0x7c,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xfe, 0xc0, 0xc0, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x06, 0x06, 0x06,
+    0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0xc2,
+    0xc6, 0xcc, 0x18, 0x30, 0x60, 0xce, 0x9b, 0x06, 0x0c, 0x1f,
+    0x00, 0x00, 0x00, 0xc0, 0xc0, 0xc2, 0xc6, 0xcc, 0x18, 0x30,
+    0x66, 0xce, 0x96, 0x3e, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00,
+    0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x3c, 0x3c, 0x3c, 0x18,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36,
+    0x6c, 0xd8, 0x6c, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0xd8, 0x6c, 0x36, 0x6c, 0xd8,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x44, 0x11, 0x44,
+    0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44,
+    0x11, 0x44, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa,
+    0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0xdd, 0x77,
+    0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77,
+    0xdd, 0x77, 0xdd, 0x77, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
+    0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
+    0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0x18, 0x18,
+    0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
+    0x18, 0xf8, 0x18, 0xf8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
+    0x18, 0x18, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xf6,
+    0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x36, 0x36, 0x36, 0x36,
+    0x36, 0x36, 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8,
+    0x18, 0xf8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
+    0x36, 0x36, 0x36, 0x36, 0x36, 0xf6, 0x06, 0xf6, 0x36, 0x36,
+    0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
+    0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
+    0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x06, 0xf6,
+    0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
+    0x36, 0x36, 0x36, 0xf6, 0x06, 0xfe, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
+    0x36, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0x18, 0xf8, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0xf8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
+    0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18,
+    0x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
+    0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x18, 0x18,
+    0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff,
+    0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
+    0x18, 0x18, 0x18, 0x1f, 0x18, 0x1f, 0x18, 0x18, 0x18, 0x18,
+    0x18, 0x18, 0x18, 0x18, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
+    0x36, 0x37, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
+    0x36, 0x36, 0x36, 0x36, 0x36, 0x37, 0x30, 0x3f, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x3f, 0x30, 0x37, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
+    0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xf7, 0x00, 0xff,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0xff, 0x00, 0xf7, 0x36, 0x36, 0x36, 0x36,
+    0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x37,
+    0x30, 0x37, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x36, 0x36, 0x36,
+    0x36, 0xf7, 0x00, 0xf7, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
+    0x36, 0x36, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0x00, 0xff,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x36,
+    0x36, 0x36, 0x36, 0x36, 0x36, 0xff, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff,
+    0x00, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x36, 0x36,
+    0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
+    0x36, 0x36, 0x36, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x18, 0x1f,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x1f, 0x18, 0x1f, 0x18, 0x18, 0x18, 0x18,
+    0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x3f, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
+    0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xff, 0x36, 0x36,
+    0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x18, 0x18, 0x18, 0x18,
+    0x18, 0xff, 0x18, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
+    0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x18, 0x18, 0x18, 0x18,
+    0x18, 0x18, 0x18, 0x18, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
+    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0,
+    0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0,
+    0xf0, 0xf0, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f,
+    0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff,
+    0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76,
+    0xdc, 0xd8, 0xd8, 0xd8, 0xdc, 0x76, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x78, 0xcc, 0xcc, 0xcc, 0xd8, 0xcc, 0xc6, 0xc6,
+    0xc6, 0xcc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc6,
+    0xc6, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x6c, 0x6c, 0x6c,
+    0x6c, 0x6c, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0xfe, 0xc6, 0x60, 0x30, 0x18, 0x30, 0x60, 0xc6, 0xfe,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e,
+    0xd8, 0xd8, 0xd8, 0xd8, 0xd8, 0x70, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x66, 0x7c,
+    0x60, 0x60, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x76, 0xdc, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x18, 0x3c, 0x66, 0x66,
+    0x66, 0x3c, 0x18, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0x6c, 0x38,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c, 0xc6, 0xc6,
+    0xc6, 0x6c, 0x6c, 0x6c, 0x6c, 0xee, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x1e, 0x30, 0x18, 0x0c, 0x3e, 0x66, 0x66, 0x66,
+    0x66, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x7e, 0xdb, 0xdb, 0xdb, 0x7e, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x06, 0x7e, 0xdb, 0xdb,
+    0xf3, 0x7e, 0x60, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x1c, 0x30, 0x60, 0x60, 0x7c, 0x60, 0x60, 0x60, 0x30, 0x1c,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6,
+    0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0xfe, 0x00, 0x00,
+    0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x18, 0x18, 0x7e, 0x18, 0x18, 0x00, 0x00, 0xff, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x18, 0x0c, 0x06, 0x0c,
+    0x18, 0x30, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x0c, 0x18, 0x30, 0x60, 0x30, 0x18, 0x0c, 0x00, 0x7e,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x1b, 0x1b, 0x1b,
+    0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
+    0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xd8, 0xd8,
+    0xd8, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x18, 0x18, 0x00, 0x7e, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xdc, 0x00,
+    0x76, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38,
+    0x6c, 0x6c, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0c, 0x0c,
+    0x0c, 0x0c, 0x0c, 0xec, 0x6c, 0x6c, 0x3c, 0x1c, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0xd8, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70,
+    0xd8, 0x30, 0x60, 0xc8, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x7c,
+    0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+    };
+
+
+
+}
diff -rN -u libvob-old/org/nongnu/libvob/impl/terminal/TerminalUpdateManager.java libvob-new/org/nongnu/libvob/impl/terminal/TerminalUpdateManager.java
--- libvob-old/org/nongnu/libvob/impl/terminal/TerminalUpdateManager.java	1970-01-01 02:00:00.000000000 +0200
+++ libvob-new/org/nongnu/libvob/impl/terminal/TerminalUpdateManager.java	2005-11-29 22:32:08.000000000 +0200
@@ -0,0 +1,58 @@
+// (c): Matti J. Katila
+
+package org.nongnu.libvob.impl.terminal;
+
+import org.nongnu.libvob.*;
+import org.nongnu.libvob.util.*;
+import java.util.*;
+import java.io.*;
+import java.awt.*;
+
+/** A singleton class update manager for terminal.
+ */
+public class TerminalUpdateManager extends AbstractUpdateManager {
+    private static boolean dbg = true;
+    private static void p(String s) { System.out.println("TermUpdateMgr:: "+s); }
+
+    static private TerminalUpdateManager mgr = null;
+    private UnixTerminal terminal = null;
+    
+    private TerminalUpdateManager(Runnable r) { super(r); }
+
+    static public TerminalUpdateManager getInstance() { return mgr; }
+
+    static void startUpdateManager(Runnable r) {
+	if (mgr != null) 
+	    throw new Error("Only one instance of terminal update manager allowed!");
+	mgr = new TerminalUpdateManager(r);
+	if(dbg) p("STARTORDTHREAD");
+	new Thread(mgr).start();
+    }
+
+    public void set(UnixTerminal term) { this.terminal = term; }
+
+    // return true if there were events..
+    protected boolean handleEvents(boolean waitForEvent) {
+	if (dbg) p("handleEvents: "+waitForEvent);
+	if (terminal == null || !waitForEvent)
+	    return false;
+
+	boolean ret = terminal.hasEvents();
+	while (terminal.hasEvents())
+	{
+	    p("key: "+((int)terminal.popEvent()));
+	}
+	return ret;
+    }
+
+    protected void interruptEventloop()  { 
+	synchronized(ordering) {
+	    ordering.notifyAll();
+	}
+    }
+
+    protected void synchronizeToolkit() {
+	Toolkit.getDefaultToolkit().sync();
+    }
+
+}
diff -rN -u libvob-old/org/nongnu/libvob/impl/terminal/TerminalWindow.java libvob-new/org/nongnu/libvob/impl/terminal/TerminalWindow.java
--- libvob-old/org/nongnu/libvob/impl/terminal/TerminalWindow.java	1970-01-01 02:00:00.000000000 +0200
+++ libvob-new/org/nongnu/libvob/impl/terminal/TerminalWindow.java	2005-11-29 23:05:03.065325644 +0200
@@ -0,0 +1,201 @@
+/**
+ *	jline - Java console input library
+ *	Copyright (c) 2002, 2003, 2004, 2005, Marc Prud'hommeaux <mwp1 at cornell.edu>
+ *                    2005 Matti J. Katila
+ *	All rights reserved.
+ *
+ *	Redistribution and use in source and binary forms, with or
+ *	without modification, are permitted provided that the following
+ *	conditions are met:
+ *
+ *	Redistributions of source code must retain the above copyright
+ *	notice, this list of conditions and the following disclaimer.
+ *
+ *	Redistributions in binary form must reproduce the above copyright
+ *	notice, this list of conditions and the following disclaimer
+ *	in the documentation and/or other materials provided with
+ *	the distribution.
+ *
+ *	Neither the name of JLine nor the names of its contributors
+ *	may be used to endorse or promote products derived from this
+ *	software without specific prior written permission.
+ *
+ *	THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ *	"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
+ *	BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ *	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ *	EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ *	FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ *	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ *	PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ *	DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ *	AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ *	LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ *	IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ *	OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+
+package org.nongnu.libvob.impl.terminal;
+import org.nongnu.libvob.impl.awt.*;
+import org.nongnu.libvob.impl.*;
+import org.nongnu.libvob.util.*;
+import org.nongnu.libvob.*;
+import java.io.*;
+import java.util.*;
+import java.awt.*;
+
+
+/** A class that encapsulates all GraphicsAPI.Window methods.
+ */
+public class TerminalWindow extends GraphicsAPI.AbstractWindow 
+    implements ConsoleOperations {
+
+    static public boolean dbg = false;
+    static private void p(String s) { System.out.println("TermWindow:: "+s); }
+    
+    private TerminalGraphics g;
+    private UnixTerminal terminal;
+    private Dimension terminalSize = null;
+
+    Binder binder;
+    VobScene listprev, listnext;
+    int[] interplist;
+
+    public TerminalWindow(GraphicsAPI api) {
+	super(api);
+	try {
+	    terminal = new UnixTerminal();
+	    terminal.initializeTerminal();
+	    terminalSize = terminal.getTerminalSize();
+	    g = new TerminalGraphics(terminalSize);
+	    TerminalUpdateManager.getInstance().set(terminal);
+	} catch (Exception e) { e.printStackTrace(); }
+
+    }
+
+    public void renderStill(VobScene prev, float lod) {
+	renderAnim(prev, null, 0, lod, true);
+    }
+
+    /** Renders and display a frame of the view animation on screen
+     */
+    public void renderAnim(VobScene prev, VobScene next, float fract, float lod, boolean showFinal) {
+	renderAnimImage(prev, next, fract, lod);
+	if(dbg) p("renderanim: "+prev+" "+next);
+	if (g == null) return;
+	//canvas.paint(g);
+	g.dispose();
+    }
+
+    private void renderMessage(Graphics gr, Dimension d, String message, 
+			       int height) {
+	ScalableFont f = new ScalableFont("SansSerif", Font.PLAIN, 36);
+	FontMetrics fm = f.getFontMetrics(1);
+	int sw = fm.stringWidth(message);
+		
+	gr.setFont(f.getFont(1));
+	gr.drawString(message,
+		      (d.width-sw-10)/2,
+		      (d.height-fm.getHeight())/2);
+    }
+
+    /** Renders a frame of the view animation onto Graphics buffer
+     */
+    void renderAnimImage(VobScene prev, VobScene next, float fract, float lod) {
+	Dimension d = g.getSize();
+	Graphics gr = g;
+	Shape oldClip = gr.getClip();
+
+	try {
+	    gr.setColor(Color.white); // XXX
+	    gr.fillRect(0, 0, d.width, d.height);
+	    gr.setColor(Color.black);
+	
+	    if (next == null && fract != 0) {
+		// No VobScene to draw
+		gr.setColor(Color.white);
+		gr.fillRect(0, 0, d.width, d.height);
+		gr.setColor(Color.red);
+		renderMessage(gr, d, "No vobscene to interpolate to", 18);
+	    } else {
+		VobScene sc = prev;
+		VobScene osc = next;
+		boolean towardsOther = true;
+		if (fract > AbstractUpdateManager.jumpFract) {
+		    sc = next;
+		    osc = prev;
+		    fract = 1-fract;
+		    towardsOther = false;
+		}
+		if(dbg) p("Going to render: "+sc+" "+osc+" "+fract);
+		if(dbg) sc.dump();
+		if(dbg && osc!=null) osc.dump();
+		
+		createInterpList(sc, osc, towardsOther);
+		AWTRenderer.render(sc, osc, towardsOther,
+				   fract, gr, gr.getColor());
+	    }
+	} finally {
+	    gr.setClip(oldClip);
+	}
+	//gr.dispose();
+    }
+
+
+    void createInterpList(VobScene sc, VobScene osc, boolean towardsOther) {
+	if(osc != null && (sc != listprev || osc != listnext)) {
+	    listprev = sc;
+	    listnext = osc;
+	    interplist = sc.matcher.interpList(osc.matcher,
+					       towardsOther);
+	}
+    }
+
+    public boolean needInterp(VobScene prev, VobScene next) {
+	createInterpList(prev, next, true);
+	if(interplist == null) return false;
+	return prev.coords.needInterp(next.coords, interplist);
+    }
+
+    public void setCursor(String name) { }
+    //public void setCursor(Cursor cursor) { }
+
+    public VobScene createVobScene(Dimension size) {
+	return new VobScene(
+		new DefaultVobMap(),
+		new AWTVobCoorder_Gen(size.width, size.height),
+		new DefaultVobMatcher(),
+		this.getGraphicsAPI(),
+		this,
+		size
+		);
+    }
+    public ChildVobScene createChildVobScene(Dimension size, 
+					     int numberOfParameterCS) {
+
+	AWTVobCoorder_Gen coorder = new AWTVobCoorder_Gen(size.width, size.height);
+	coorder.setNumberOfParameterCS(numberOfParameterCS);
+	return new ChildVobScene(
+	    new DefaultVobMap(),
+	    coorder,
+	    new DefaultVobMatcher(),
+	    this.getGraphicsAPI(),
+	    this,
+	    size
+	    );
+    }
+
+    public void registerBinder(Binder s) {
+	binder = s;
+    }
+ 
+
+    public void setLocation(int x, int y, int w, int h) { }
+
+    public Dimension getSize() { return g.getSize(); }
+
+    public int[] readPixels(int x, int y, int w, int h) { return null; }
+
+}
diff -rN -u libvob-old/org/nongnu/libvob/impl/terminal/Text.java libvob-new/org/nongnu/libvob/impl/terminal/Text.java
--- libvob-old/org/nongnu/libvob/impl/terminal/Text.java	1970-01-01 02:00:00.000000000 +0200
+++ libvob-new/org/nongnu/libvob/impl/terminal/Text.java	2005-11-29 22:32:08.000000000 +0200
@@ -0,0 +1,41 @@
+
+package org.nongnu.libvob.impl.terminal;
+
+import org.nongnu.libvob.*;
+import org.nongnu.libvob.impl.*;
+
+
+public class Text implements Runnable {
+
+    protected GraphicsAPI.Window window;
+
+    public void start() {
+	GraphicsAPI.getInstance().startUpdateManager(this);
+    }
+
+    public void run(Binder binder, Shower shower) {
+	String geometry = java.lang.System.getProperty("vob.windowsize", 
+						       "1024x768");
+	int x = geometry.indexOf('x');
+	int width = Integer.parseInt(geometry.substring(0, x)),
+	    height = Integer.parseInt(geometry.substring(x+1));
+
+	window = GraphicsAPI.getInstance().createWindow();
+    }
+
+    public void run() {
+	try {
+	    while (true) {
+		System.out.print(window+".");
+		Thread.sleep(1000);
+	    }
+	} catch (Exception e) { 
+	    e.printStackTrace(); 
+	}
+    }
+
+    static public void main(String[] argv) {
+	new Text().start();
+    }
+
+}
diff -rN -u libvob-old/org/nongnu/libvob/impl/terminal/UnixTerminal.java libvob-new/org/nongnu/libvob/impl/terminal/UnixTerminal.java
--- libvob-old/org/nongnu/libvob/impl/terminal/UnixTerminal.java	1970-01-01 02:00:00.000000000 +0200
+++ libvob-new/org/nongnu/libvob/impl/terminal/UnixTerminal.java	2005-11-29 23:05:03.067325342 +0200
@@ -0,0 +1,233 @@
+// (c): Matti J. Katila
+
+package org.nongnu.libvob.impl.terminal;
+import org.nongnu.libvob.*;
+import org.nongnu.libvob.impl.awt.*;
+import org.nongnu.libvob.util.*;
+
+import java.io.*;
+import java.util.*;
+import java.awt.Dimension;
+
+public class UnixTerminal implements ConsoleOperations {
+
+
+    public static final short ARROW_START           = 27;
+    public static final short ARROW_PREFIX          = 91;
+    public static final short ARROW_LEFT            = 68;
+    public static final short ARROW_RIGHT           = 67;
+    public static final short ARROW_UP              = 65;
+    public static final short ARROW_DOWN            = 66;
+
+    private List events = new ArrayList();
+
+    public boolean hasEvents() {
+	synchronized(events) {
+	    return !events.isEmpty(); 
+	}
+    }
+
+    public int popEvent() {
+	if (!hasEvents()) throw new Error("event queue is empty.");
+	synchronized(events) {
+	    return ((Integer)events.remove(0)).intValue();
+	}
+    }
+
+    public void initializeTerminal ()
+	throws IOException, InterruptedException {
+	
+        // save the initial tty configuration
+	final String ttyConfig = stty ("-g");
+
+	// sanity check
+	if (ttyConfig.length () == 0
+	    || (ttyConfig.indexOf ("=") == -1
+		&& ttyConfig.indexOf (":") == -1))
+	{
+	    throw new IOException ("Unrecognized stty code: " + ttyConfig);
+	}
+
+
+	// set the console to be character-buffered instead of line-buffered
+	stty ("-icanon min 1");
+
+	// disable character echoing
+	stty ("-echo");
+
+	// at exit, restore the original tty configuration (for JDK 1.3+)
+	try
+	{
+	    Runtime.getRuntime ().addShutdownHook (new Thread ()
+		{
+		    public void start ()
+			{
+			    try
+			    {
+				stty (ttyConfig);
+			    }
+			    catch (Exception e)
+			    {
+				consumeException (e);
+			    }
+			}
+		});
+	}
+	catch (AbstractMethodError ame)
+	{
+	    // JDK 1.3+ only method. Bummer.
+	    consumeException (ame);
+	}
+
+	new Thread(){
+	    public void run() {
+		while (true) {
+		    try {
+			Integer i = new Integer(readVirtualKey(System.in));
+			synchronized(events) {
+			    events.add(i);
+			}
+		    } catch (Exception e) { 
+			e.printStackTrace(); 
+		    }
+		}
+	    }
+	}.start();
+    }
+
+    /**
+     *  Read a single character from the input stream. This might
+     *  enable a terminal implementation to better handle nuances of
+     *  the console.
+     */
+    public int readCharacter (final InputStream in)
+	throws IOException {
+	return in.read ();
+    }
+
+    public int readVirtualKey (InputStream in)
+	throws IOException {
+	
+	int c = readCharacter (in);
+
+	// in Unix terminals, arrow keys are represented by
+	// a sequence of 3 characters. E.g., the up arrow
+	// key yields 27, 91, 68
+	if (c == ARROW_START)
+	{
+	    System.out.println("arrow start");
+	    c = readCharacter (in);
+	    if (c == ARROW_PREFIX)
+	    {
+		System.out.println("arrow prefix");
+		c = readCharacter (in);
+		if (c == ARROW_UP)
+		    return CTRL_P;
+		else if (c == ARROW_DOWN)
+		    return CTRL_N;
+		else if (c == ARROW_LEFT)
+		    return CTRL_B;
+		else if (c == ARROW_RIGHT)
+		    return CTRL_F;
+	    }
+	}
+	
+	
+	return c;
+    }
+
+
+    /** 
+     *  No-op for exceptions we want to silently consume.
+     */
+    private void consumeException (Throwable e) { }
+
+
+    public boolean isSupported () {
+	return true;
+    }
+
+
+    public boolean getEcho () {
+	return false;
+    }
+
+
+    /**
+     *	Returns the value of "stty size" width param.
+     *
+     *	<strong>Note</strong>: this method caches the value from the
+     *	first time it is called in order to increase speed, which means
+     *	that changing to size of the terminal will not be reflected
+     *	in the console.
+     */
+    public Dimension getTerminalSize() {
+	try
+	{
+	    String size = stty ("size");
+	    if (size.length () != 0 && size.indexOf (" ") != -1)
+	    {
+		int width = Integer.parseInt (
+		    size.substring (size.indexOf (" ") + 1));
+		int height = Integer.parseInt (
+		    size.substring (0, size.indexOf (" ")));
+		return new Dimension (width, height);
+	    }
+	}
+	catch (Exception e)
+	{
+	    consumeException (e);
+	}
+	return new Dimension(80,24);
+    }
+
+
+
+
+    /**
+     *  Execute the stty command with the specified arguments
+     *  against the current active terminal.
+     */
+    private static String stty (final String args)
+	throws IOException, InterruptedException  {
+	return exec ("stty " + args + " < /dev/tty").trim ();
+    }
+
+
+    /**
+     *  Execute the specified command and return the output
+     *  (both stdout and stderr).
+     */
+    private static String exec (final String cmd)
+	throws IOException, InterruptedException {
+	return exec (new String [] { "sh", "-c", cmd });
+    }
+
+
+    /**
+     *  Execute the specified command and return the output
+     *  (both stdout and stderr).
+     */
+    private static String exec (final String [] cmd)
+	throws IOException, InterruptedException {
+	ByteArrayOutputStream bout = new ByteArrayOutputStream ();
+	
+	Process p = Runtime.getRuntime ().exec (cmd);
+	int c;
+	InputStream in;
+	
+	in = p.getInputStream ();
+	while ((c = in.read ()) != -1)
+	    bout.write (c);
+	
+	in = p.getErrorStream ();
+	while ((c = in.read ()) != -1)
+	    bout.write (c);
+	
+	p.waitFor ();
+	
+	String result = new String (bout.toByteArray ());
+	return result;
+    }
+
+}
diff -rN -u libvob-old/org/nongnu/libvob/lob/DragManager.java libvob-new/org/nongnu/libvob/lob/DragManager.java
--- libvob-old/org/nongnu/libvob/lob/DragManager.java	2005-11-29 23:05:01.394577529 +0200
+++ libvob-new/org/nongnu/libvob/lob/DragManager.java	2005-11-29 22:32:08.000000000 +0200
@@ -74,6 +74,8 @@
 	    
 	    coords[0] = e.getX(); coords[1] = e.getY();
 	    scene.coords.inverseTransformPoints3(dragCS, coords, coords);
+	    if (dbg) p("was: "+e.getX()+" - "+e.getY()+
+		", now: "+coords[0]+" - "+coords[1]);
 	    dragController.drag(scene, dragCS, coords[0], coords[1], e);
 
 	    return true;
diff -rN -u libvob-old/org/nongnu/libvob/lob/lobs/ClipLob.java libvob-new/org/nongnu/libvob/lob/lobs/ClipLob.java
--- libvob-old/org/nongnu/libvob/lob/lobs/ClipLob.java	2005-11-29 23:05:01.394577529 +0200
+++ libvob-new/org/nongnu/libvob/lob/lobs/ClipLob.java	2005-11-29 22:32:08.000000000 +0200
@@ -107,7 +107,8 @@
 	}
 
 	GraphicsAPI api = GraphicsAPI.getInstance();
-	if(api instanceof org.nongnu.libvob.impl.awt.AWTAPI) {
+	if(api instanceof org.nongnu.libvob.impl.awt.AWTAPI ||
+	    api instanceof org.nongnu.libvob.impl.terminal.TERMINALAPI) {
 	    org.nongnu.libvob.impl.DefaultVobMap map = 
 		(org.nongnu.libvob.impl.DefaultVobMap)scene.map;
 	    map.clip(cs);




More information about the Fencommits mailing list