FLTK logo

[Library] r8683 - in branches/branch-3.0: . FL fltk3 ide/Xcode4/FLTK.xcodeproj src test2 test2/images test2/plugins

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.commit  ]
 
Previous Message ]Next Message ]

[Library] r8683 - in branches/branch-3.0: . FL fltk3 ide/Xcode4/FLTK.xcodeproj src test2 test2/images test2/plugins fltk-dev May 18, 2011  
 
Author: matt
Date: 2011-05-18 06:58:16 -0700 (Wed, 18 May 2011)
New Revision: 8683
Log:
123: fixed wrongly added files. Adding FLTK2 headers.

Added:
   branches/branch-3.0/test2/
   branches/branch-3.0/test2/CubeMain.cxx
   branches/branch-3.0/test2/CubeView.cxx
   branches/branch-3.0/test2/CubeView.h
   branches/branch-3.0/test2/CubeViewUI.cxx
   branches/branch-3.0/test2/CubeViewUI.fl
   branches/branch-3.0/test2/CubeViewUI.h
   branches/branch-3.0/test2/Fl_Multi_Image.cxx
   branches/branch-3.0/test2/Makefile
   branches/branch-3.0/test2/README
   branches/branch-3.0/test2/adjuster.cxx
   branches/branch-3.0/test2/ansiwidget.cxx
   branches/branch-3.0/test2/arc.cxx
   branches/branch-3.0/test2/ask.cxx
   branches/branch-3.0/test2/bitmap.cxx
   branches/branch-3.0/test2/black_1.xbm
   branches/branch-3.0/test2/black_2.xbm
   branches/branch-3.0/test2/black_3.xbm
   branches/branch-3.0/test2/black_4.xbm
   branches/branch-3.0/test2/blackking_1.xbm
   branches/branch-3.0/test2/blackking_2.xbm
   branches/branch-3.0/test2/blackking_3.xbm
   branches/branch-3.0/test2/blackking_4.xbm
   branches/branch-3.0/test2/boxtype.cxx
   branches/branch-3.0/test2/browser.cxx
   branches/branch-3.0/test2/browserop.cxx
   branches/branch-3.0/test2/button.cxx
   branches/branch-3.0/test2/buttons.cxx
   branches/branch-3.0/test2/cairo.cxx
   branches/branch-3.0/test2/callbacks.cxx
   branches/branch-3.0/test2/checkers.cxx
   branches/branch-3.0/test2/circle.xbm
   branches/branch-3.0/test2/classes.cxx
   branches/branch-3.0/test2/clock.cxx
   branches/branch-3.0/test2/color_chooser.cxx
   branches/branch-3.0/test2/connect.cxx
   branches/branch-3.0/test2/cube.cxx
   branches/branch-3.0/test2/cursor.cxx
   branches/branch-3.0/test2/curve.cxx
   branches/branch-3.0/test2/demo.cxx
   branches/branch-3.0/test2/demo.menu
   branches/branch-3.0/test2/dnd.cxx
   branches/branch-3.0/test2/doublebuffer.cxx
   branches/branch-3.0/test2/drawing.cxx
   branches/branch-3.0/test2/drawtiming.cxx
   branches/branch-3.0/test2/editor.cxx
   branches/branch-3.0/test2/escherknot.xbm
   branches/branch-3.0/test2/exception.cxx
   branches/branch-3.0/test2/fast_slow.cxx
   branches/branch-3.0/test2/fast_slow.fl
   branches/branch-3.0/test2/fast_slow.h
   branches/branch-3.0/test2/file_chooser.cxx
   branches/branch-3.0/test2/fl_jpeg_image.cxx
   branches/branch-3.0/test2/fltk_scheme.cxx
   branches/branch-3.0/test2/fltkrc
   branches/branch-3.0/test2/fonts.cxx
   branches/branch-3.0/test2/fractals.cxx
   branches/branch-3.0/test2/fracviewer.cxx
   branches/branch-3.0/test2/fracviewer.h
   branches/branch-3.0/test2/fromdos.c
   branches/branch-3.0/test2/fullscreen.cxx
   branches/branch-3.0/test2/gl_overlay.cxx
   branches/branch-3.0/test2/glpuzzle.cxx
   branches/branch-3.0/test2/hello.cxx
   branches/branch-3.0/test2/helloask.cxx
   branches/branch-3.0/test2/help.cxx
   branches/branch-3.0/test2/iconize.cxx
   branches/branch-3.0/test2/image.cxx
   branches/branch-3.0/test2/image_file.cxx
   branches/branch-3.0/test2/image_file.fl
   branches/branch-3.0/test2/image_file.h
   branches/branch-3.0/test2/image_transform.cxx
   branches/branch-3.0/test2/images/
   branches/branch-3.0/test2/images/bg.jpeg
   branches/branch-3.0/test2/images/bg2.jpeg
   branches/branch-3.0/test2/images/coucou.gif
   branches/branch-3.0/test2/images/coucou.png
   branches/branch-3.0/test2/images/coucou.xpm
   branches/branch-3.0/test2/images/testimg.jpg
   branches/branch-3.0/test2/images/ulon.bmp
   branches/branch-3.0/test2/inactive.cxx
   branches/branch-3.0/test2/inactive.h
   branches/branch-3.0/test2/input.cxx
   branches/branch-3.0/test2/jpeg_image.cxx
   branches/branch-3.0/test2/keyboard.cxx
   branches/branch-3.0/test2/keyboard_ui.cxx
   branches/branch-3.0/test2/keyboard_ui.fl
   branches/branch-3.0/test2/keyboard_ui.h
   branches/branch-3.0/test2/label.cxx
   branches/branch-3.0/test2/layout.cxx
   branches/branch-3.0/test2/line_style.cxx
   branches/branch-3.0/test2/linetype.cxx
   branches/branch-3.0/test2/list.cxx
   branches/branch-3.0/test2/list_visuals.cxx
   branches/branch-3.0/test2/makedepend
   branches/branch-3.0/test2/mandelbrot.cxx
   branches/branch-3.0/test2/mandelbrot.h
   branches/branch-3.0/test2/mandelbrot_ui.cxx
   branches/branch-3.0/test2/mandelbrot_ui.fl
   branches/branch-3.0/test2/mandelbrot_ui.h
   branches/branch-3.0/test2/menu.cxx
   branches/branch-3.0/test2/menubar.cxx
   branches/branch-3.0/test2/message.cxx
   branches/branch-3.0/test2/monitors.cxx
   branches/branch-3.0/test2/navigation.cxx
   branches/branch-3.0/test2/output.cxx
   branches/branch-3.0/test2/overlay.cxx
   branches/branch-3.0/test2/pack.cxx
   branches/branch-3.0/test2/pixmap.cxx
   branches/branch-3.0/test2/pixmap_browser.cxx
   branches/branch-3.0/test2/plugins/
   branches/branch-3.0/test2/plugins/Fl_NSlider.H
   branches/branch-3.0/test2/plugins/Fl_NSlider.cxx
   branches/branch-3.0/test2/plugins/Fl_Pix_Box.H
   branches/branch-3.0/test2/plugins/Fl_Pix_Box.cxx
   branches/branch-3.0/test2/plugins/Fl_Pix_Button.H
   branches/branch-3.0/test2/plugins/Fl_Pix_Button.cxx
   branches/branch-3.0/test2/plugins/Makefile
   branches/branch-3.0/test2/plugins/essai.fl
   branches/branch-3.0/test2/plugins/essai_panel.cxx
   branches/branch-3.0/test2/plugins/essai_panel.fl
   branches/branch-3.0/test2/plugins/essai_panel.h
   branches/branch-3.0/test2/plugins/essai_plugin.cxx
   branches/branch-3.0/test2/plugins/pause_buttons256.xpm
   branches/branch-3.0/test2/plugins/play_buttons256.xpm
   branches/branch-3.0/test2/porsche.xpm
   branches/branch-3.0/test2/porsche1.xpm
   branches/branch-3.0/test2/progress.cxx
   branches/branch-3.0/test2/qubix.cxx
   branches/branch-3.0/test2/radio.cxx
   branches/branch-3.0/test2/radio.fl
   branches/branch-3.0/test2/radio.h
   branches/branch-3.0/test2/resizable.cxx
   branches/branch-3.0/test2/resizable.fl
   branches/branch-3.0/test2/resizable.h
   branches/branch-3.0/test2/resize.cxx
   branches/branch-3.0/test2/resize.fl
   branches/branch-3.0/test2/resize.h
   branches/branch-3.0/test2/resizealign.cxx
   branches/branch-3.0/test2/scroll.cxx
   branches/branch-3.0/test2/shape.cxx
   branches/branch-3.0/test2/shiny.cxx
   branches/branch-3.0/test2/size_range.cxx
   branches/branch-3.0/test2/size_range.h
   branches/branch-3.0/test2/sizes.cxx
   branches/branch-3.0/test2/sorceress.xbm
   branches/branch-3.0/test2/subwindow.cxx
   branches/branch-3.0/test2/symbols.cxx
   branches/branch-3.0/test2/tabs.cxx
   branches/branch-3.0/test2/tabs.fl
   branches/branch-3.0/test2/tabs.h
   branches/branch-3.0/test2/threads.cxx
   branches/branch-3.0/test2/tile.cxx
   branches/branch-3.0/test2/timer.cxx
   branches/branch-3.0/test2/trackball.c
   branches/branch-3.0/test2/trackball.h
   branches/branch-3.0/test2/utf.cxx
   branches/branch-3.0/test2/valuators.cxx
   branches/branch-3.0/test2/valuators.fl
   branches/branch-3.0/test2/valuators.h
   branches/branch-3.0/test2/white_1.xbm
   branches/branch-3.0/test2/white_2.xbm
   branches/branch-3.0/test2/white_3.xbm
   branches/branch-3.0/test2/white_4.xbm
   branches/branch-3.0/test2/whiteking_1.xbm
   branches/branch-3.0/test2/whiteking_2.xbm
   branches/branch-3.0/test2/whiteking_3.xbm
   branches/branch-3.0/test2/whiteking_4.xbm
   branches/branch-3.0/test2/wizard.cxx
Removed:
   branches/branch-3.0/autom4te.cache/
   branches/branch-3.0/config.h
   branches/branch-3.0/config.log
   branches/branch-3.0/config.status
   branches/branch-3.0/configure
   branches/branch-3.0/fltk-config
   branches/branch-3.0/fltk.list
   branches/branch-3.0/fltk.spec
   branches/branch-3.0/makeinclude
Modified:
   branches/branch-3.0/FL/Fl_Box.H
   branches/branch-3.0/FL/Fl_Widget.H
   branches/branch-3.0/fltk3/Widget.h
   branches/branch-3.0/fltk3/Wrapper.h
   branches/branch-3.0/ide/Xcode4/FLTK.xcodeproj/project.pbxproj
   branches/branch-3.0/src/Fl_Widget.cxx

Modified: branches/branch-3.0/FL/Fl_Box.H
===================================================================
--- branches/branch-3.0/FL/Fl_Box.H	2011-05-17 22:21:20 UTC (rev 8682)
+++ branches/branch-3.0/FL/Fl_Box.H	2011-05-18 13:58:16 UTC (rev 8683)
@@ -44,9 +44,12 @@
     _p->wrapper(this);
   }
   
+  Fl_Box(Fl_Boxtype b, int x, int y, int w, int h, const char *label) {
+    _p = new fltk3::Box(fltk3::_1to3_boxtype(b), x, y, w, h, label);
+    _p->wrapper(this);
+  }
+  
 #if 0 // FIXME: 123
-  Fl_Box(Fl_Boxtype b, int X, int Y, int W, int H, const char *l)
-  : Fl_Widget(X,Y,W,H,l) {box(b);}
   virtual int handle(int);
 #endif
 };

Modified: branches/branch-3.0/FL/Fl_Widget.H
===================================================================
--- branches/branch-3.0/FL/Fl_Widget.H	2011-05-17 22:21:20 UTC (rev 8682)
+++ branches/branch-3.0/FL/Fl_Widget.H	2011-05-18 13:58:16 UTC (rev 8683)
@@ -152,14 +152,26 @@
     ((fltk3::Widget*)_p)->box( fltk3::_1to3_boxtype(new_box) );
   }
   
-#if 0 // FIXME: 123
-  Fl_Color color() const {return color_;}
-  void color(Fl_Color bg) {color_ = bg;}
-  Fl_Color selection_color() const {return color2_;}
-  void selection_color(Fl_Color a) {color2_ = a;}
-  void color(Fl_Color bg, Fl_Color sel) {color_=bg; color2_=sel;}
-#endif
+  Fl_Color color() const {
+    return fltk3::_3to1_color( ((fltk3::Widget*)_p)->color() );
+  }
+
+  void color(Fl_Color bg) {
+    ((fltk3::Widget*)_p)->color( fltk3::_1to3_color(bg) );
+  }
   
+  Fl_Color selection_color() const {
+    return fltk3::_3to1_color( ((fltk3::Widget*)_p)->selection_color() );
+  }
+    
+  void selection_color(Fl_Color a) {
+    ((fltk3::Widget*)_p)->selection_color( fltk3::_1to3_color(a) );
+  }
+  
+  void color(Fl_Color bg, Fl_Color sel) {
+    ((fltk3::Widget*)_p)->color( fltk3::_1to3_color(bg), fltk3::_1to3_color(sel) );
+  }
+  
   const char* label() const {
     return ((fltk3::Widget*)_p)->label();
   }
@@ -168,12 +180,21 @@
     ((fltk3::Widget*)_p)->label(text);
   }
   
-#if 0 // FIXME: 123
-  void copy_label(const char *new_label);
-  void label(Fl_Labeltype a, const char* b) {label_.type = a; label_.value = b;}
-  Fl_Color labelcolor() const {return label_.color;}
-  void labelcolor(Fl_Color c) {label_.color=c;}
-#endif
+  void copy_label(const char *new_label) {
+    ((fltk3::Widget*)_p)->label(new_label);
+  }
+    
+  void label(Fl_Labeltype a, const char* b) {
+    ((fltk3::Widget*)_p)->label( fltk3::_1to3_labeltype(a), b );
+  }
+  
+  Fl_Color labelcolor() const {
+    return fltk3::_3to1_color( ((fltk3::Widget*)_p)->labelcolor() );
+  }
+  
+  void labelcolor(Fl_Color c) {
+    ((fltk3::Widget*)_p)->labelcolor( fltk3::_1to3_color(c) );
+  }
 
   Fl_Labeltype labeltype() const {
     return fltk3::_3to1_labeltype( ((fltk3::Widget*)_p)->labeltype() );

Deleted: branches/branch-3.0/config.h

Deleted: branches/branch-3.0/config.log

Deleted: branches/branch-3.0/config.status

Deleted: branches/branch-3.0/configure

Deleted: branches/branch-3.0/fltk-config

Deleted: branches/branch-3.0/fltk.list

Deleted: branches/branch-3.0/fltk.spec

Modified: branches/branch-3.0/fltk3/Widget.h
===================================================================
--- branches/branch-3.0/fltk3/Widget.h	2011-05-17 22:21:20 UTC (rev 8682)
+++ branches/branch-3.0/fltk3/Widget.h	2011-05-18 13:58:16 UTC (rev 8683)
@@ -226,7 +226,7 @@
      s->draw();			// calls Fl_Scrollbar::draw()
      \endcode
      */
-    virtual void draw() { }
+    virtual void draw();
     
     /** Handles the specified event. 
      You normally don't call this method directly, but instead let FLTK do 

Modified: branches/branch-3.0/fltk3/Wrapper.h
===================================================================
--- branches/branch-3.0/fltk3/Wrapper.h	2011-05-17 22:21:20 UTC (rev 8682)
+++ branches/branch-3.0/fltk3/Wrapper.h	2011-05-18 13:58:16 UTC (rev 8683)
@@ -47,12 +47,12 @@
   if (pWrapper) { \
     if ( pWrapper->pVCalls & Wrapper::pVCallWidget##flag ) { \
     } else { \
-      pWrapper->pVCalls |= Wrapper::pVCallWidgetResize; \
+      pWrapper->pVCalls |= Wrapper::pVCallWidget##flag; \
       ((WidgetWrapper*)pWrapper)->call; \
       if ( !(pWrapper->pVCalls & Wrapper::pVCallWidget##flag) ) \
         return; \
     } \
-    pWrapper->pVCalls &= ~Wrapper::pVCallWidgetResize; \
+    pWrapper->pVCalls &= ~Wrapper::pVCallWidget##flag; \
   }
 
 #define FLTK3_WRAPPER_VCALLS_OBJECT_INT(proto, call, flag) \
@@ -71,12 +71,12 @@
   if (pWrapper) { \
     if ( pWrapper->pVCalls & Wrapper::pVCallWidget##flag ) { \
     } else { \
-      pWrapper->pVCalls |= Wrapper::pVCallWidgetResize; \
+      pWrapper->pVCalls |= Wrapper::pVCallWidget##flag; \
       int ret = ((WidgetWrapper*)pWrapper)->call; \
       if ( !(pWrapper->pVCalls & Wrapper::pVCallWidget##flag) ) \
         return ret; \
     } \
-    pWrapper->pVCalls &= ~Wrapper::pVCallWidgetResize; \
+    pWrapper->pVCalls &= ~Wrapper::pVCallWidget##flag; \
   }
 
  */

Modified: branches/branch-3.0/ide/Xcode4/FLTK.xcodeproj/project.pbxproj
===================================================================
--- branches/branch-3.0/ide/Xcode4/FLTK.xcodeproj/project.pbxproj	2011-05-17 22:21:20 UTC (rev 8682)
+++ branches/branch-3.0/ide/Xcode4/FLTK.xcodeproj/project.pbxproj	2011-05-18 13:58:16 UTC (rev 8683)
@@ -492,7 +492,6 @@
 		C8D2445DE4DB272D6140EB4D /* ps_image.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 1C75365D167645656C3A6752 /* ps_image.cxx */; };
 		C915E2CB1382D16E00C5FD27 /* fltk.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FEB0F8FE6383384180570D94 /* fltk.framework */; };
 		C915E2CD1382D16E00C5FD27 /* fltk.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = FEB0F8FE6383384180570D94 /* fltk.framework */; };
-		C915E2D91382D8A100C5FD27 /* hello.cxx in Sources */ = {isa = PBXBuildFile; fileRef = C915E2D71382D83A00C5FD27 /* hello.cxx */; };
 		C915E2DA1382D8ED00C5FD27 /* Enumerations.H in Headers */ = {isa = PBXBuildFile; fileRef = 84CE79448708855561FEE498 /* Enumerations.H */; };
 		C915E2DB1382D8ED00C5FD27 /* Fl.H in Headers */ = {isa = PBXBuildFile; fileRef = C359E5D5187606DD69C7938B /* Fl.H */; };
 		C915E2DC1382D8ED00C5FD27 /* Fl_Adjuster.H in Headers */ = {isa = PBXBuildFile; fileRef = 5CDA214AEABC15E3EF1BB172 /* Fl_Adjuster.H */; };
@@ -621,6 +620,11 @@
 		C915E3571382D8ED00C5FD27 /* win32.H in Headers */ = {isa = PBXBuildFile; fileRef = 62281FC096BA407C4F1E6824 /* win32.H */; };
 		C915E3581382D8ED00C5FD27 /* x.H in Headers */ = {isa = PBXBuildFile; fileRef = 83CED42A779FA76E98D37CA8 /* x.H */; };
 		C915E3591382D8ED00C5FD27 /* Fl_Paged_Device.H in Headers */ = {isa = PBXBuildFile; fileRef = 4CABCBB89F9DD5CF57BB9779 /* Fl_Paged_Device.H */; };
+		C915E3631383FA8800C5FD27 /* fltk.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FEB0F8FE6383384180570D94 /* fltk.framework */; };
+		C915E3651383FA8800C5FD27 /* fltk.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = FEB0F8FE6383384180570D94 /* fltk.framework */; };
+		C915E36F1383FB0600C5FD27 /* hello.cxx in Sources */ = {isa = PBXBuildFile; fileRef = C915E2D71382D83A00C5FD27 /* hello.cxx */; };
+		C915E3701383FB0B00C5FD27 /* hello.cxx in Sources */ = {isa = PBXBuildFile; fileRef = C915E36C1383FAF900C5FD27 /* hello.cxx */; };
+		C915E3F31383FD6500C5FD27 /* string.h.in in Resources */ = {isa = PBXBuildFile; fileRef = C915E3F21383FD6500C5FD27 /* string.h.in */; };
 		C9165EA81291A304003FF4F0 /* fltk.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FEB0F8FE6383384180570D94 /* fltk.framework */; };
 		C9165EAA1291A304003FF4F0 /* fltk.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = FEB0F8FE6383384180570D94 /* fltk.framework */; };
 		C9165ED41291A376003FF4F0 /* unittests.cxx in Sources */ = {isa = PBXBuildFile; fileRef = C9165ED31291A376003FF4F0 /* unittests.cxx */; };
@@ -1631,6 +1635,18 @@
 			);
 			script = "export DYLD_FRAMEWORK_PATH=${TARGET_BUILD_DIR} && cd ${INPUT_FILE_DIR} && ${TARGET_BUILD_DIR}/Fluid.app/Contents/MacOS/Fluid -c ${INPUT_FILE_NAME}";
 		};
+		C915E3661383FA8800C5FD27 /* PBXBuildRule */ = {
+			isa = PBXBuildRule;
+			compilerSpec = com.apple.compilers.proxy.script;
+			filePatterns = "*.fl";
+			fileType = pattern.proxy;
+			isEditable = 1;
+			outputFiles = (
+				"${INPUT_FILE_DIR}/${INPUT_FILE_BASE}.cxx",
+				"${INPUT_FILE_DIR}/${INPUT_FILE_BASE}.h",
+			);
+			script = "export DYLD_FRAMEWORK_PATH=${TARGET_BUILD_DIR} && cd ${INPUT_FILE_DIR} && ${TARGET_BUILD_DIR}/Fluid.app/Contents/MacOS/Fluid -c ${INPUT_FILE_NAME}";
+		};
 		C9165EAB1291A304003FF4F0 /* PBXBuildRule */ = {
 			isa = PBXBuildRule;
 			compilerSpec = com.apple.compilers.proxy.script;
@@ -2926,6 +2942,13 @@
 			remoteGlobalIDString = A57FDE871C99A52BEEDEE68C;
 			remoteInfo = fltk;
 		};
+		C915E35E1383FA8800C5FD27 /* PBXContainerItemProxy */ = {
+			isa = PBXContainerItemProxy;
+			containerPortal = 4BF1A7FFEACF5F31B4127482 /* Project object */;
+			proxyType = 1;
+			remoteGlobalIDString = A57FDE871C99A52BEEDEE68C;
+			remoteInfo = fltk;
+		};
 		C9165EA31291A304003FF4F0 /* PBXContainerItemProxy */ = {
 			isa = PBXContainerItemProxy;
 			containerPortal = 4BF1A7FFEACF5F31B4127482 /* Project object */;
@@ -3825,6 +3848,16 @@
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
+		C915E3641383FA8800C5FD27 /* CopyFiles */ = {
+			isa = PBXCopyFilesBuildPhase;
+			buildActionMask = 2147483647;
+			dstPath = "";
+			dstSubfolderSpec = 10;
+			files = (
+				C915E3651383FA8800C5FD27 /* fltk.framework in CopyFiles */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
 		C9165EA91291A304003FF4F0 /* CopyFiles */ = {
 			isa = PBXCopyFilesBuildPhase;
 			buildActionMask = 2147483647;
@@ -4539,6 +4572,137 @@
 		C8AE10A8DDF53B8B27E3215A /* Fl_Choice.H */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = Fl_Choice.H; path = ../../FL/Fl_Choice.H; sourceTree = SOURCE_ROOT; };
 		C915E2D21382D16E00C5FD27 /* hello1.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = hello1.app; sourceTree = BUILT_PRODUCTS_DIR; };
 		C915E2D71382D83A00C5FD27 /* hello.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = hello.cxx; path = ../../test1/hello.cxx; sourceTree = "<group>"; };
+		C915E36A1383FA8800C5FD27 /* hello2.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = hello2.app; sourceTree = BUILT_PRODUCTS_DIR; };
+		C915E36C1383FAF900C5FD27 /* hello.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = hello.cxx; path = ../../test2/hello.cxx; sourceTree = "<group>"; };
+		C915E3721383FD5A00C5FD27 /* Adjuster.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Adjuster.h; path = ../../fltk/Adjuster.h; sourceTree = "<group>"; };
+		C915E3731383FD5A00C5FD27 /* AlignGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AlignGroup.h; path = ../../fltk/AlignGroup.h; sourceTree = "<group>"; };
+		C915E3741383FD5A00C5FD27 /* AnsiWidget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AnsiWidget.h; path = ../../fltk/AnsiWidget.h; sourceTree = "<group>"; };
+		C915E3751383FD5A00C5FD27 /* ask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ask.h; path = ../../fltk/ask.h; sourceTree = "<group>"; };
+		C915E3761383FD5B00C5FD27 /* BarGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BarGroup.h; path = ../../fltk/BarGroup.h; sourceTree = "<group>"; };
+		C915E3771383FD5B00C5FD27 /* Box.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Box.h; path = ../../fltk/Box.h; sourceTree = "<group>"; };
+		C915E3781383FD5B00C5FD27 /* Browser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Browser.h; path = ../../fltk/Browser.h; sourceTree = "<group>"; };
+		C915E3791383FD5B00C5FD27 /* Button.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Button.h; path = ../../fltk/Button.h; sourceTree = "<group>"; };
+		C915E37A1383FD5B00C5FD27 /* CheckButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CheckButton.h; path = ../../fltk/CheckButton.h; sourceTree = "<group>"; };
+		C915E37B1383FD5B00C5FD27 /* Choice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Choice.h; path = ../../fltk/Choice.h; sourceTree = "<group>"; };
+		C915E37C1383FD5B00C5FD27 /* Clock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Clock.h; path = ../../fltk/Clock.h; sourceTree = "<group>"; };
+		C915E37D1383FD5B00C5FD27 /* Color.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Color.h; path = ../../fltk/Color.h; sourceTree = "<group>"; };
+		C915E37E1383FD5B00C5FD27 /* ColorChooser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ColorChooser.h; path = ../../fltk/ColorChooser.h; sourceTree = "<group>"; };
+		C915E37F1383FD5B00C5FD27 /* ComboBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ComboBox.h; path = ../../fltk/ComboBox.h; sourceTree = "<group>"; };
+		C915E3801383FD5B00C5FD27 /* Cursor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Cursor.h; path = ../../fltk/Cursor.h; sourceTree = "<group>"; };
+		C915E3811383FD5B00C5FD27 /* CycleButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CycleButton.h; path = ../../fltk/CycleButton.h; sourceTree = "<group>"; };
+		C915E3821383FD5B00C5FD27 /* damage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = damage.h; path = ../../fltk/damage.h; sourceTree = "<group>"; };
+		C915E3831383FD5B00C5FD27 /* Dial.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Dial.h; path = ../../fltk/Dial.h; sourceTree = "<group>"; };
+		C915E3841383FD5B00C5FD27 /* dirent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dirent.h; path = ../../fltk/dirent.h; sourceTree = "<group>"; };
+		C915E3851383FD5B00C5FD27 /* Divider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Divider.h; path = ../../fltk/Divider.h; sourceTree = "<group>"; };
+		C915E3861383FD5C00C5FD27 /* DoubleBufferWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DoubleBufferWindow.h; path = ../../fltk/DoubleBufferWindow.h; sourceTree = "<group>"; };
+		C915E3871383FD5C00C5FD27 /* draw.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = draw.h; path = ../../fltk/draw.h; sourceTree = "<group>"; };
+		C915E3881383FD5C00C5FD27 /* error.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = error.h; path = ../../fltk/error.h; sourceTree = "<group>"; };
+		C915E3891383FD5C00C5FD27 /* events.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = events.h; path = ../../fltk/events.h; sourceTree = "<group>"; };
+		C915E38A1383FD5C00C5FD27 /* file_chooser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = file_chooser.h; path = ../../fltk/file_chooser.h; sourceTree = "<group>"; };
+		C915E38B1383FD5C00C5FD27 /* FileBrowser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileBrowser.h; path = ../../fltk/FileBrowser.h; sourceTree = "<group>"; };
+		C915E38C1383FD5C00C5FD27 /* FileChooser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileChooser.h; path = ../../fltk/FileChooser.h; sourceTree = "<group>"; };
+		C915E38D1383FD5C00C5FD27 /* FileIcon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileIcon.h; path = ../../fltk/FileIcon.h; sourceTree = "<group>"; };
+		C915E38E1383FD5C00C5FD27 /* FileInput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileInput.h; path = ../../fltk/FileInput.h; sourceTree = "<group>"; };
+		C915E38F1383FD5C00C5FD27 /* filename.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = filename.h; path = ../../fltk/filename.h; sourceTree = "<group>"; };
+		C915E3901383FD5C00C5FD27 /* FillDial.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FillDial.h; path = ../../fltk/FillDial.h; sourceTree = "<group>"; };
+		C915E3911383FD5C00C5FD27 /* FillSlider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FillSlider.h; path = ../../fltk/FillSlider.h; sourceTree = "<group>"; };
+		C915E3921383FD5C00C5FD27 /* FL_API.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FL_API.h; path = ../../fltk/FL_API.h; sourceTree = "<group>"; };
+		C915E3931383FD5C00C5FD27 /* FL_VERSION.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FL_VERSION.h; path = ../../fltk/FL_VERSION.h; sourceTree = "<group>"; };
+		C915E3941383FD5D00C5FD27 /* Flags.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Flags.h; path = ../../fltk/Flags.h; sourceTree = "<group>"; };
+		C915E3951383FD5D00C5FD27 /* FloatInput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FloatInput.h; path = ../../fltk/FloatInput.h; sourceTree = "<group>"; };
+		C915E3961383FD5D00C5FD27 /* fltk_cairo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = fltk_cairo.h; path = ../../fltk/fltk_cairo.h; sourceTree = "<group>"; };
+		C915E3971383FD5D00C5FD27 /* Font.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Font.h; path = ../../fltk/Font.h; sourceTree = "<group>"; };
+		C915E3981383FD5D00C5FD27 /* forms.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = forms.h; path = ../../fltk/forms.h; sourceTree = "<group>"; };
+		C915E3991383FD5D00C5FD27 /* gl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = gl.h; path = ../../fltk/gl.h; sourceTree = "<group>"; };
+		C915E39A1383FD5D00C5FD27 /* gl2opengl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = gl2opengl.h; path = ../../fltk/gl2opengl.h; sourceTree = "<group>"; };
+		C915E39B1383FD5D00C5FD27 /* glut.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = glut.h; path = ../../fltk/glut.h; sourceTree = "<group>"; };
+		C915E39C1383FD5D00C5FD27 /* GlWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GlWindow.h; path = ../../fltk/GlWindow.h; sourceTree = "<group>"; };
+		C915E39D1383FD5D00C5FD27 /* Group.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Group.h; path = ../../fltk/Group.h; sourceTree = "<group>"; };
+		C915E39E1383FD5D00C5FD27 /* HelpDialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HelpDialog.h; path = ../../fltk/HelpDialog.h; sourceTree = "<group>"; };
+		C915E39F1383FD5D00C5FD27 /* HelpView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HelpView.h; path = ../../fltk/HelpView.h; sourceTree = "<group>"; };
+		C915E3A01383FD5D00C5FD27 /* HighlightButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HighlightButton.h; path = ../../fltk/HighlightButton.h; sourceTree = "<group>"; };
+		C915E3A11383FD5E00C5FD27 /* Image.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Image.h; path = ../../fltk/Image.h; sourceTree = "<group>"; };
+		C915E3A21383FD5E00C5FD27 /* Input.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Input.h; path = ../../fltk/Input.h; sourceTree = "<group>"; };
+		C915E3A31383FD5E00C5FD27 /* InputBrowser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InputBrowser.h; path = ../../fltk/InputBrowser.h; sourceTree = "<group>"; };
+		C915E3A41383FD5E00C5FD27 /* IntInput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IntInput.h; path = ../../fltk/IntInput.h; sourceTree = "<group>"; };
+		C915E3A51383FD5E00C5FD27 /* InvisibleBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InvisibleBox.h; path = ../../fltk/InvisibleBox.h; sourceTree = "<group>"; };
+		C915E3A61383FD5E00C5FD27 /* Item.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Item.h; path = ../../fltk/Item.h; sourceTree = "<group>"; };
+		C915E3A71383FD5E00C5FD27 /* ItemGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ItemGroup.h; path = ../../fltk/ItemGroup.h; sourceTree = "<group>"; };
+		C915E3A81383FD5E00C5FD27 /* LabelType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LabelType.h; path = ../../fltk/LabelType.h; sourceTree = "<group>"; };
+		C915E3A91383FD5E00C5FD27 /* layout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = layout.h; path = ../../fltk/layout.h; sourceTree = "<group>"; };
+		C915E3AA1383FD5E00C5FD27 /* LightButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LightButton.h; path = ../../fltk/LightButton.h; sourceTree = "<group>"; };
+		C915E3AB1383FD5E00C5FD27 /* LineDial.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LineDial.h; path = ../../fltk/LineDial.h; sourceTree = "<group>"; };
+		C915E3AC1383FD5E00C5FD27 /* load_plugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = load_plugin.h; path = ../../fltk/load_plugin.h; sourceTree = "<group>"; };
+		C915E3AD1383FD5E00C5FD27 /* math.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = math.h; path = ../../fltk/math.h; sourceTree = "<group>"; };
+		C915E3AE1383FD5E00C5FD27 /* Menu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Menu.h; path = ../../fltk/Menu.h; sourceTree = "<group>"; };
+		C915E3AF1383FD5F00C5FD27 /* MenuBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MenuBar.h; path = ../../fltk/MenuBar.h; sourceTree = "<group>"; };
+		C915E3B01383FD5F00C5FD27 /* MenuBuild.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MenuBuild.h; path = ../../fltk/MenuBuild.h; sourceTree = "<group>"; };
+		C915E3B11383FD5F00C5FD27 /* MenuWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MenuWindow.h; path = ../../fltk/MenuWindow.h; sourceTree = "<group>"; };
+		C915E3B21383FD5F00C5FD27 /* Monitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Monitor.h; path = ../../fltk/Monitor.h; sourceTree = "<group>"; };
+		C915E3B31383FD5F00C5FD27 /* MultiBrowser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MultiBrowser.h; path = ../../fltk/MultiBrowser.h; sourceTree = "<group>"; };
+		C915E3B41383FD5F00C5FD27 /* MultiImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MultiImage.h; path = ../../fltk/MultiImage.h; sourceTree = "<group>"; };
+		C915E3B51383FD5F00C5FD27 /* MultiLineInput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MultiLineInput.h; path = ../../fltk/MultiLineInput.h; sourceTree = "<group>"; };
+		C915E3B61383FD5F00C5FD27 /* MultiLineOutput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MultiLineOutput.h; path = ../../fltk/MultiLineOutput.h; sourceTree = "<group>"; };
+		C915E3B71383FD5F00C5FD27 /* NumericInput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NumericInput.h; path = ../../fltk/NumericInput.h; sourceTree = "<group>"; };
+		C915E3B81383FD5F00C5FD27 /* osx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = osx.h; path = ../../fltk/osx.h; sourceTree = "<group>"; };
+		C915E3B91383FD5F00C5FD27 /* Output.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Output.h; path = ../../fltk/Output.h; sourceTree = "<group>"; };
+		C915E3BA1383FD5F00C5FD27 /* PackedGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PackedGroup.h; path = ../../fltk/PackedGroup.h; sourceTree = "<group>"; };
+		C915E3BB1383FD6000C5FD27 /* PixelType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PixelType.h; path = ../../fltk/PixelType.h; sourceTree = "<group>"; };
+		C915E3BC1383FD6000C5FD27 /* pnmImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = pnmImage.h; path = ../../fltk/pnmImage.h; sourceTree = "<group>"; };
+		C915E3BD1383FD6000C5FD27 /* PopupMenu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PopupMenu.h; path = ../../fltk/PopupMenu.h; sourceTree = "<group>"; };
+		C915E3BE1383FD6000C5FD27 /* Preferences.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Preferences.h; path = ../../fltk/Preferences.h; sourceTree = "<group>"; };
+		C915E3BF1383FD6000C5FD27 /* ProgressBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ProgressBar.h; path = ../../fltk/ProgressBar.h; sourceTree = "<group>"; };
+		C915E3C01383FD6000C5FD27 /* RadioButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RadioButton.h; path = ../../fltk/RadioButton.h; sourceTree = "<group>"; };
+		C915E3C11383FD6000C5FD27 /* RadioItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RadioItem.h; path = ../../fltk/RadioItem.h; sourceTree = "<group>"; };
+		C915E3C21383FD6000C5FD27 /* RadioLightButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RadioLightButton.h; path = ../../fltk/RadioLightButton.h; sourceTree = "<group>"; };
+		C915E3C31383FD6000C5FD27 /* Rectangle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Rectangle.h; path = ../../fltk/Rectangle.h; sourceTree = "<group>"; };
+		C915E3C41383FD6000C5FD27 /* RepeatButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RepeatButton.h; path = ../../fltk/RepeatButton.h; sourceTree = "<group>"; };
+		C915E3C51383FD6000C5FD27 /* ReturnButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ReturnButton.h; path = ../../fltk/ReturnButton.h; sourceTree = "<group>"; };
+		C915E3C61383FD6000C5FD27 /* rgbImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = rgbImage.h; path = ../../fltk/rgbImage.h; sourceTree = "<group>"; };
+		C915E3C71383FD6000C5FD27 /* run.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = run.h; path = ../../fltk/run.h; sourceTree = "<group>"; };
+		C915E3C81383FD6000C5FD27 /* Scrollbar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Scrollbar.h; path = ../../fltk/Scrollbar.h; sourceTree = "<group>"; };
+		C915E3C91383FD6100C5FD27 /* ScrollGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ScrollGroup.h; path = ../../fltk/ScrollGroup.h; sourceTree = "<group>"; };
+		C915E3CA1383FD6100C5FD27 /* SecretInput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SecretInput.h; path = ../../fltk/SecretInput.h; sourceTree = "<group>"; };
+		C915E3CB1383FD6100C5FD27 /* ShapedWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ShapedWindow.h; path = ../../fltk/ShapedWindow.h; sourceTree = "<group>"; };
+		C915E3CC1383FD6100C5FD27 /* SharedImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SharedImage.h; path = ../../fltk/SharedImage.h; sourceTree = "<group>"; };
+		C915E3CD1383FD6100C5FD27 /* show_colormap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = show_colormap.h; path = ../../fltk/show_colormap.h; sourceTree = "<group>"; };
+		C915E3CE1383FD6100C5FD27 /* Slider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Slider.h; path = ../../fltk/Slider.h; sourceTree = "<group>"; };
+		C915E3CF1383FD6100C5FD27 /* StatusBarGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StatusBarGroup.h; path = ../../fltk/StatusBarGroup.h; sourceTree = "<group>"; };
+		C915E3D01383FD6100C5FD27 /* string.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = string.h; path = ../../fltk/string.h; sourceTree = "<group>"; };
+		C915E3D11383FD6100C5FD27 /* StringList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StringList.h; path = ../../fltk/StringList.h; sourceTree = "<group>"; };
+		C915E3D21383FD6200C5FD27 /* Style.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Style.h; path = ../../fltk/Style.h; sourceTree = "<group>"; };
+		C915E3D31383FD6200C5FD27 /* StyleSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StyleSet.h; path = ../../fltk/StyleSet.h; sourceTree = "<group>"; };
+		C915E3D41383FD6200C5FD27 /* Symbol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Symbol.h; path = ../../fltk/Symbol.h; sourceTree = "<group>"; };
+		C915E3D51383FD6200C5FD27 /* SystemMenuBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SystemMenuBar.h; path = ../../fltk/SystemMenuBar.h; sourceTree = "<group>"; };
+		C915E3D61383FD6200C5FD27 /* TabGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TabGroup.h; path = ../../fltk/TabGroup.h; sourceTree = "<group>"; };
+		C915E3D71383FD6200C5FD27 /* TextBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TextBuffer.h; path = ../../fltk/TextBuffer.h; sourceTree = "<group>"; };
+		C915E3D81383FD6200C5FD27 /* TextDisplay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TextDisplay.h; path = ../../fltk/TextDisplay.h; sourceTree = "<group>"; };
+		C915E3D91383FD6200C5FD27 /* TextEditor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TextEditor.h; path = ../../fltk/TextEditor.h; sourceTree = "<group>"; };
+		C915E3DA1383FD6200C5FD27 /* Threads.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Threads.h; path = ../../fltk/Threads.h; sourceTree = "<group>"; };
+		C915E3DB1383FD6200C5FD27 /* ThumbWheel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThumbWheel.h; path = ../../fltk/ThumbWheel.h; sourceTree = "<group>"; };
+		C915E3DC1383FD6300C5FD27 /* TiledGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TiledGroup.h; path = ../../fltk/TiledGroup.h; sourceTree = "<group>"; };
+		C915E3DD1383FD6300C5FD27 /* TiledImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TiledImage.h; path = ../../fltk/TiledImage.h; sourceTree = "<group>"; };
+		C915E3DE1383FD6300C5FD27 /* ToggleButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ToggleButton.h; path = ../../fltk/ToggleButton.h; sourceTree = "<group>"; };
+		C915E3DF1383FD6300C5FD27 /* ToggleItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ToggleItem.h; path = ../../fltk/ToggleItem.h; sourceTree = "<group>"; };
+		C915E3E01383FD6300C5FD27 /* Tooltip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Tooltip.h; path = ../../fltk/Tooltip.h; sourceTree = "<group>"; };
+		C915E3E11383FD6300C5FD27 /* utf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = utf.h; path = ../../fltk/utf.h; sourceTree = "<group>"; };
+		C915E3E21383FD6300C5FD27 /* Valuator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Valuator.h; path = ../../fltk/Valuator.h; sourceTree = "<group>"; };
+		C915E3E31383FD6300C5FD27 /* ValueInput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ValueInput.h; path = ../../fltk/ValueInput.h; sourceTree = "<group>"; };
+		C915E3E41383FD6300C5FD27 /* ValueOutput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ValueOutput.h; path = ../../fltk/ValueOutput.h; sourceTree = "<group>"; };
+		C915E3E51383FD6300C5FD27 /* ValueSlider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ValueSlider.h; path = ../../fltk/ValueSlider.h; sourceTree = "<group>"; };
+		C915E3E61383FD6300C5FD27 /* visual.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = visual.h; path = ../../fltk/visual.h; sourceTree = "<group>"; };
+		C915E3E71383FD6300C5FD27 /* Widget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Widget.h; path = ../../fltk/Widget.h; sourceTree = "<group>"; };
+		C915E3E81383FD6400C5FD27 /* WidgetAssociation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WidgetAssociation.h; path = ../../fltk/WidgetAssociation.h; sourceTree = "<group>"; };
+		C915E3E91383FD6400C5FD27 /* win32.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = win32.h; path = ../../fltk/win32.h; sourceTree = "<group>"; };
+		C915E3EA1383FD6400C5FD27 /* Window.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Window.h; path = ../../fltk/Window.h; sourceTree = "<group>"; };
+		C915E3EB1383FD6400C5FD27 /* WizardGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WizardGroup.h; path = ../../fltk/WizardGroup.h; sourceTree = "<group>"; };
+		C915E3EC1383FD6400C5FD27 /* WordwrapInput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WordwrapInput.h; path = ../../fltk/WordwrapInput.h; sourceTree = "<group>"; };
+		C915E3ED1383FD6400C5FD27 /* WordwrapOutput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WordwrapOutput.h; path = ../../fltk/WordwrapOutput.h; sourceTree = "<group>"; };
+		C915E3EE1383FD6400C5FD27 /* x.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = x.h; path = ../../fltk/x.h; sourceTree = "<group>"; };
+		C915E3EF1383FD6400C5FD27 /* x11.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = x11.h; path = ../../fltk/x11.h; sourceTree = "<group>"; };
+		C915E3F01383FD6400C5FD27 /* xbmImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = xbmImage.h; path = ../../fltk/xbmImage.h; sourceTree = "<group>"; };
+		C915E3F11383FD6400C5FD27 /* xpmImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = xpmImage.h; path = ../../fltk/xpmImage.h; sourceTree = "<group>"; };
+		C915E3F21383FD6500C5FD27 /* string.h.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = string.h.in; path = ../../fltk/string.h.in; sourceTree = "<group>"; };
 		C9165EAF1291A304003FF4F0 /* utf8.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = utf8.app; sourceTree = BUILT_PRODUCTS_DIR; };
 		C9165ED31291A376003FF4F0 /* unittests.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; name = unittests.cxx; path = ../../test/unittests.cxx; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
 		C9568B8A1380730100CDA5BF /* Adjuster.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Adjuster.h; path = ../../fltk3/Adjuster.h; sourceTree = "<group>"; };
@@ -5397,6 +5561,14 @@
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
+		C915E3621383FA8800C5FD27 /* Frameworks */ = {
+			isa = PBXFrameworksBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				C915E3631383FA8800C5FD27 /* fltk.framework in Frameworks */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
 		C9165EA71291A304003FF4F0 /* Frameworks */ = {
 			isa = PBXFrameworksBuildPhase;
 			buildActionMask = 2147483647;
@@ -5545,6 +5717,7 @@
 			isa = PBXGroup;
 			children = (
 				C915E2D61382D1C600C5FD27 /* Test1 */,
+				C915E35A1383FA4C00C5FD27 /* Test2 */,
 				1745FD7A82A025A97E1FFD22 /* Demo */,
 				00A184CFEE690C4BD856C12B /* adjuster */,
 				D4A58B6D0BEEB58E9CB0E31F /* arc */,
@@ -5623,7 +5796,8 @@
 			isa = PBXGroup;
 			children = (
 				C9568B88138072AE00CDA5BF /* Headers */,
-				B04F6E032ADAF0A16A860A2E /* FLTK1Headers */,
+				B04F6E032ADAF0A16A860A2E /* Headers1 */,
+				C915E3711383FBB900C5FD27 /* Headers2 */,
 				7F66B1D612BB924C00C67B59 /* Fl_cocoa.mm */,
 				7F66B1D712BB924C00C67B59 /* Fl_Native_File_Chooser_MAC.mm */,
 				7F66B1D812BB924C00C67B59 /* Fl_Quartz_Printer.mm */,
@@ -6382,7 +6556,7 @@
 			name = fltk_images;
 			sourceTree = "<group>";
 		};
-		B04F6E032ADAF0A16A860A2E /* FLTK1Headers */ = {
+		B04F6E032ADAF0A16A860A2E /* Headers1 */ = {
 			isa = PBXGroup;
 			children = (
 				84CE79448708855561FEE498 /* Enumerations.H */,
@@ -6514,7 +6688,7 @@
 				83CED42A779FA76E98D37CA8 /* x.H */,
 				4CABCBB89F9DD5CF57BB9779 /* Fl_Paged_Device.H */,
 			);
-			name = FLTK1Headers;
+			name = Headers1;
 			sourceTree = "<group>";
 		};
 		B41ED46FB39CBC4D7E97E288 /* pack */ = {
@@ -6582,6 +6756,158 @@
 			name = Test1;
 			sourceTree = "<group>";
 		};
+		C915E35A1383FA4C00C5FD27 /* Test2 */ = {
+			isa = PBXGroup;
+			children = (
+				C915E35B1383FA5D00C5FD27 /* hello2 */,
+			);
+			name = Test2;
+			sourceTree = "<group>";
+		};
+		C915E35B1383FA5D00C5FD27 /* hello2 */ = {
+			isa = PBXGroup;
+			children = (
+				C915E36C1383FAF900C5FD27 /* hello.cxx */,
+			);
+			name = hello2;
+			sourceTree = "<group>";
+		};
+		C915E3711383FBB900C5FD27 /* Headers2 */ = {
+			isa = PBXGroup;
+			children = (
+				C915E3721383FD5A00C5FD27 /* Adjuster.h */,
+				C915E3731383FD5A00C5FD27 /* AlignGroup.h */,
+				C915E3741383FD5A00C5FD27 /* AnsiWidget.h */,
+				C915E3751383FD5A00C5FD27 /* ask.h */,
+				C915E3761383FD5B00C5FD27 /* BarGroup.h */,
+				C915E3771383FD5B00C5FD27 /* Box.h */,
+				C915E3781383FD5B00C5FD27 /* Browser.h */,
+				C915E3791383FD5B00C5FD27 /* Button.h */,
+				C915E37A1383FD5B00C5FD27 /* CheckButton.h */,
+				C915E37B1383FD5B00C5FD27 /* Choice.h */,
+				C915E37C1383FD5B00C5FD27 /* Clock.h */,
+				C915E37D1383FD5B00C5FD27 /* Color.h */,
+				C915E37E1383FD5B00C5FD27 /* ColorChooser.h */,
+				C915E37F1383FD5B00C5FD27 /* ComboBox.h */,
+				C915E3801383FD5B00C5FD27 /* Cursor.h */,
+				C915E3811383FD5B00C5FD27 /* CycleButton.h */,
+				C915E3821383FD5B00C5FD27 /* damage.h */,
+				C915E3831383FD5B00C5FD27 /* Dial.h */,
+				C915E3841383FD5B00C5FD27 /* dirent.h */,
+				C915E3851383FD5B00C5FD27 /* Divider.h */,
+				C915E3861383FD5C00C5FD27 /* DoubleBufferWindow.h */,
+				C915E3871383FD5C00C5FD27 /* draw.h */,
+				C915E3881383FD5C00C5FD27 /* error.h */,
+				C915E3891383FD5C00C5FD27 /* events.h */,
+				C915E38A1383FD5C00C5FD27 /* file_chooser.h */,
+				C915E38B1383FD5C00C5FD27 /* FileBrowser.h */,
+				C915E38C1383FD5C00C5FD27 /* FileChooser.h */,
+				C915E38D1383FD5C00C5FD27 /* FileIcon.h */,
+				C915E38E1383FD5C00C5FD27 /* FileInput.h */,
+				C915E38F1383FD5C00C5FD27 /* filename.h */,
+				C915E3901383FD5C00C5FD27 /* FillDial.h */,
+				C915E3911383FD5C00C5FD27 /* FillSlider.h */,
+				C915E3921383FD5C00C5FD27 /* FL_API.h */,
+				C915E3931383FD5C00C5FD27 /* FL_VERSION.h */,
+				C915E3941383FD5D00C5FD27 /* Flags.h */,
+				C915E3951383FD5D00C5FD27 /* FloatInput.h */,
+				C915E3961383FD5D00C5FD27 /* fltk_cairo.h */,
+				C915E3971383FD5D00C5FD27 /* Font.h */,
+				C915E3981383FD5D00C5FD27 /* forms.h */,
+				C915E3991383FD5D00C5FD27 /* gl.h */,
+				C915E39A1383FD5D00C5FD27 /* gl2opengl.h */,
+				C915E39B1383FD5D00C5FD27 /* glut.h */,
+				C915E39C1383FD5D00C5FD27 /* GlWindow.h */,
+				C915E39D1383FD5D00C5FD27 /* Group.h */,
+				C915E39E1383FD5D00C5FD27 /* HelpDialog.h */,
+				C915E39F1383FD5D00C5FD27 /* HelpView.h */,
+				C915E3A01383FD5D00C5FD27 /* HighlightButton.h */,
+				C915E3A11383FD5E00C5FD27 /* Image.h */,
+				C915E3A21383FD5E00C5FD27 /* Input.h */,
+				C915E3A31383FD5E00C5FD27 /* InputBrowser.h */,
+				C915E3A41383FD5E00C5FD27 /* IntInput.h */,
+				C915E3A51383FD5E00C5FD27 /* InvisibleBox.h */,
+				C915E3A61383FD5E00C5FD27 /* Item.h */,
+				C915E3A71383FD5E00C5FD27 /* ItemGroup.h */,
+				C915E3A81383FD5E00C5FD27 /* LabelType.h */,
+				C915E3A91383FD5E00C5FD27 /* layout.h */,
+				C915E3AA1383FD5E00C5FD27 /* LightButton.h */,
+				C915E3AB1383FD5E00C5FD27 /* LineDial.h */,
+				C915E3AC1383FD5E00C5FD27 /* load_plugin.h */,
+				C915E3AD1383FD5E00C5FD27 /* math.h */,
+				C915E3AE1383FD5E00C5FD27 /* Menu.h */,
+				C915E3AF1383FD5F00C5FD27 /* MenuBar.h */,
+				C915E3B01383FD5F00C5FD27 /* MenuBuild.h */,
+				C915E3B11383FD5F00C5FD27 /* MenuWindow.h */,
+				C915E3B21383FD5F00C5FD27 /* Monitor.h */,
+				C915E3B31383FD5F00C5FD27 /* MultiBrowser.h */,
+				C915E3B41383FD5F00C5FD27 /* MultiImage.h */,
+				C915E3B51383FD5F00C5FD27 /* MultiLineInput.h */,
+				C915E3B61383FD5F00C5FD27 /* MultiLineOutput.h */,
+				C915E3B71383FD5F00C5FD27 /* NumericInput.h */,
+				C915E3B81383FD5F00C5FD27 /* osx.h */,
+				C915E3B91383FD5F00C5FD27 /* Output.h */,
+				C915E3BA1383FD5F00C5FD27 /* PackedGroup.h */,
+				C915E3BB1383FD6000C5FD27 /* PixelType.h */,
+				C915E3BC1383FD6000C5FD27 /* pnmImage.h */,
+				C915E3BD1383FD6000C5FD27 /* PopupMenu.h */,
+				C915E3BE1383FD6000C5FD27 /* Preferences.h */,
+				C915E3BF1383FD6000C5FD27 /* ProgressBar.h */,
+				C915E3C01383FD6000C5FD27 /* RadioButton.h */,
+				C915E3C11383FD6000C5FD27 /* RadioItem.h */,
+				C915E3C21383FD6000C5FD27 /* RadioLightButton.h */,
+				C915E3C31383FD6000C5FD27 /* Rectangle.h */,
+				C915E3C41383FD6000C5FD27 /* RepeatButton.h */,
+				C915E3C51383FD6000C5FD27 /* ReturnButton.h */,
+				C915E3C61383FD6000C5FD27 /* rgbImage.h */,
+				C915E3C71383FD6000C5FD27 /* run.h */,
+				C915E3C81383FD6000C5FD27 /* Scrollbar.h */,
+				C915E3C91383FD6100C5FD27 /* ScrollGroup.h */,
+				C915E3CA1383FD6100C5FD27 /* SecretInput.h */,
+				C915E3CB1383FD6100C5FD27 /* ShapedWindow.h */,
+				C915E3CC1383FD6100C5FD27 /* SharedImage.h */,
+				C915E3CD1383FD6100C5FD27 /* show_colormap.h */,
+				C915E3CE1383FD6100C5FD27 /* Slider.h */,
+				C915E3CF1383FD6100C5FD27 /* StatusBarGroup.h */,
+				C915E3D01383FD6100C5FD27 /* string.h */,
+				C915E3D11383FD6100C5FD27 /* StringList.h */,
+				C915E3D21383FD6200C5FD27 /* Style.h */,
+				C915E3D31383FD6200C5FD27 /* StyleSet.h */,
+				C915E3D41383FD6200C5FD27 /* Symbol.h */,
+				C915E3D51383FD6200C5FD27 /* SystemMenuBar.h */,
+				C915E3D61383FD6200C5FD27 /* TabGroup.h */,
+				C915E3D71383FD6200C5FD27 /* TextBuffer.h */,
+				C915E3D81383FD6200C5FD27 /* TextDisplay.h */,
+				C915E3D91383FD6200C5FD27 /* TextEditor.h */,
+				C915E3DA1383FD6200C5FD27 /* Threads.h */,
+				C915E3DB1383FD6200C5FD27 /* ThumbWheel.h */,
+				C915E3DC1383FD6300C5FD27 /* TiledGroup.h */,
+				C915E3DD1383FD6300C5FD27 /* TiledImage.h */,
+				C915E3DE1383FD6300C5FD27 /* ToggleButton.h */,
+				C915E3DF1383FD6300C5FD27 /* ToggleItem.h */,
+				C915E3E01383FD6300C5FD27 /* Tooltip.h */,
+				C915E3E11383FD6300C5FD27 /* utf.h */,
+				C915E3E21383FD6300C5FD27 /* Valuator.h */,
+				C915E3E31383FD6300C5FD27 /* ValueInput.h */,
+				C915E3E41383FD6300C5FD27 /* ValueOutput.h */,
+				C915E3E51383FD6300C5FD27 /* ValueSlider.h */,
+				C915E3E61383FD6300C5FD27 /* visual.h */,
+				C915E3E71383FD6300C5FD27 /* Widget.h */,
+				C915E3E81383FD6400C5FD27 /* WidgetAssociation.h */,
+				C915E3E91383FD6400C5FD27 /* win32.h */,
+				C915E3EA1383FD6400C5FD27 /* Window.h */,
+				C915E3EB1383FD6400C5FD27 /* WizardGroup.h */,
+				C915E3EC1383FD6400C5FD27 /* WordwrapInput.h */,
+				C915E3ED1383FD6400C5FD27 /* WordwrapOutput.h */,
+				C915E3EE1383FD6400C5FD27 /* x.h */,
+				C915E3EF1383FD6400C5FD27 /* x11.h */,
+				C915E3F01383FD6400C5FD27 /* xbmImage.h */,
+				C915E3F11383FD6400C5FD27 /* xpmImage.h */,
+				C915E3F21383FD6500C5FD27 /* string.h.in */,
+			);
+			name = Headers2;
+			sourceTree = "<group>";
+		};
 		C9165ED21291A327003FF4F0 /* unittests */ = {
 			isa = PBXGroup;
 			children = (
@@ -6970,6 +7296,7 @@
 				5191489A6263E11B65A57B4D /* valuators.app */,
 				C9165EAF1291A304003FF4F0 /* utf8.app */,
 				C915E2D21382D16E00C5FD27 /* hello1.app */,
+				C915E36A1383FA8800C5FD27 /* hello2.app */,
 			);
 			name = Products;
 			sourceTree = "<group>";
@@ -8781,6 +9108,26 @@
 			productReference = C915E2D21382D16E00C5FD27 /* hello1.app */;
 			productType = "com.apple.product-type.application";
 		};
+		C915E35C1383FA8800C5FD27 /* hello2 */ = {
+			isa = PBXNativeTarget;
+			buildConfigurationList = C915E3671383FA8800C5FD27 /* Build configuration list for PBXNativeTarget "hello2" */;
+			buildPhases = (
+				C915E35F1383FA8800C5FD27 /* Resources */,
+				C915E3601383FA8800C5FD27 /* Sources */,
+				C915E3621383FA8800C5FD27 /* Frameworks */,
+				C915E3641383FA8800C5FD27 /* CopyFiles */,
+			);
+			buildRules = (
+				C915E3661383FA8800C5FD27 /* PBXBuildRule */,
+			);
+			dependencies = (
+				C915E35D1383FA8800C5FD27 /* PBXTargetDependency */,
+			);
+			name = hello2;
+			productName = hello;
+			productReference = C915E36A1383FA8800C5FD27 /* hello2.app */;
+			productType = "com.apple.product-type.application";
+		};
 		C9165EA11291A304003FF4F0 /* unittests */ = {
 			isa = PBXNativeTarget;
 			buildConfigurationList = C9165EAC1291A304003FF4F0 /* Build configuration list for PBXNativeTarget "unittests" */;
@@ -9146,7 +9493,6 @@
 				234377F13A1D2CBBCF9E5043 /* gl_overlay */,
 				D7D4B168DE66A92F9F8747C0 /* glpuzzle */,
 				7483E011046F1E2FC84A989B /* hello */,
-				C915E2C41382D16E00C5FD27 /* hello1 */,
 				B37F5F8EB169ABA76EA02FB9 /* help */,
 				CA05747C492074A51F2F35BC /* iconize */,
 				36F787DB6844466ACF848593 /* image */,
@@ -9187,6 +9533,8 @@
 				C9165EA11291A304003FF4F0 /* unittests */,
 				2BFE084E4D6FAB77DCAF0A83 /* utf8 */,
 				E167C0E81B125EBADAC8ED73 /* valuators */,
+				C915E2C41382D16E00C5FD27 /* hello1 */,
+				C915E35C1383FA8800C5FD27 /* hello2 */,
 			);
 		};
 /* End PBXProject section */
@@ -9576,6 +9924,7 @@
 			buildActionMask = 2147483647;
 			files = (
 				27C588BBFC1BE5D0F8202036 /* fluid.icns in Resources */,
+				C915E3F31383FD6500C5FD27 /* string.h.in in Resources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -9656,6 +10005,13 @@
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
+		C915E35F1383FA8800C5FD27 /* Resources */ = {
+			isa = PBXResourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
 		C9165EA41291A304003FF4F0 /* Resources */ = {
 			isa = PBXResourcesBuildPhase;
 			buildActionMask = 2147483647;
@@ -10520,10 +10876,18 @@
 			isa = PBXSourcesBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
-				C915E2D91382D8A100C5FD27 /* hello.cxx in Sources */,
+				C915E36F1383FB0600C5FD27 /* hello.cxx in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
+		C915E3601383FA8800C5FD27 /* Sources */ = {
+			isa = PBXSourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				C915E3701383FB0B00C5FD27 /* hello.cxx in Sources */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
 		C9165EA51291A304003FF4F0 /* Sources */ = {
 			isa = PBXSourcesBuildPhase;
 			buildActionMask = 2147483647;
@@ -11431,6 +11795,11 @@
 			target = A57FDE871C99A52BEEDEE68C /* fltk */;
 			targetProxy = C915E2C61382D16E00C5FD27 /* PBXContainerItemProxy */;
 		};
+		C915E35D1383FA8800C5FD27 /* PBXTargetDependency */ = {
+			isa = PBXTargetDependency;
+			target = A57FDE871C99A52BEEDEE68C /* fltk */;
+			targetProxy = C915E35E1383FA8800C5FD27 /* PBXContainerItemProxy */;
+		};
 		C9165EA21291A304003FF4F0 /* PBXTargetDependency */ = {
 			isa = PBXTargetDependency;
 			target = A57FDE871C99A52BEEDEE68C /* fltk */;
@@ -15749,6 +16118,69 @@
 			};
 			name = Release;
 		};
+		C915E3681383FA8800C5FD27 /* Debug */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ALWAYS_SEARCH_USER_PATHS = NO;
+				COPY_PHASE_STRIP = NO;
+				GCC_DYNAMIC_NO_PIC = NO;
+				GCC_ENABLE_FIX_AND_CONTINUE = YES;
+				GCC_MODEL_TUNING = G5;
+				GCC_OPTIMIZATION_LEVEL = 0;
+				GCC_PRECOMPILE_PREFIX_HEADER = YES;
+				GCC_PREFIX_HEADER = fltk.pch;
+				GCC_PREPROCESSOR_DEFINITIONS = "USING_XCODE=1";
+				HEADER_SEARCH_PATHS = (
+					../../ide/XCode3/,
+					../../,
+					../../png,
+					../../jpeg,
+				);
+				INFOPLIST_FILE = "plists/hello-Info.plist";
+				INSTALL_PATH = "$(HOME)/Applications";
+				OTHER_LDFLAGS = (
+					"-framework",
+					Cocoa,
+				);
+				PRODUCT_NAME = hello2;
+				SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.6.sdk";
+				WARNING_CFLAGS = (
+					"-Wno-format-security",
+					"-Wall",
+				);
+			};
+			name = Debug;
+		};
+		C915E3691383FA8800C5FD27 /* Release */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ALWAYS_SEARCH_USER_PATHS = NO;
+				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+				GCC_MODEL_TUNING = G5;
+				GCC_PRECOMPILE_PREFIX_HEADER = YES;
+				GCC_PREFIX_HEADER = fltk.pch;
+				GCC_PREPROCESSOR_DEFINITIONS = "USING_XCODE=1";
+				HEADER_SEARCH_PATHS = (
+					../../ide/XCode3/,
+					../../,
+					../../png,
+					../../jpeg,
+				);
+				INFOPLIST_FILE = "plists/hello-Info.plist";
+				INSTALL_PATH = "$(HOME)/Applications";
+				OTHER_LDFLAGS = (
+					"-framework",
+					Cocoa,
+				);
+				PRODUCT_NAME = hello2;
+				SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.6.sdk";
+				WARNING_CFLAGS = (
+					"-Wno-format-security",
+					"-Wall",
+				);
+			};
+			name = Release;
+		};
 		C9165EAD1291A304003FF4F0 /* Debug */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
@@ -17202,6 +17634,15 @@
 			defaultConfigurationIsVisible = 0;
 			defaultConfigurationName = Debug;
 		};
+		C915E3671383FA8800C5FD27 /* Build configuration list for PBXNativeTarget "hello2" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				C915E3681383FA8800C5FD27 /* Debug */,
+				C915E3691383FA8800C5FD27 /* Release */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Debug;
+		};
 		C9165EAC1291A304003FF4F0 /* Build configuration list for PBXNativeTarget "unittests" */ = {
 			isa = XCConfigurationList;
 			buildConfigurations = (

Deleted: branches/branch-3.0/makeinclude

Modified: branches/branch-3.0/src/Fl_Widget.cxx
===================================================================
--- branches/branch-3.0/src/Fl_Widget.cxx	2011-05-17 22:21:20 UTC (rev 8682)
+++ branches/branch-3.0/src/Fl_Widget.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -341,7 +341,14 @@
     clear_changed();
 }
 
+/** Draw a box.
+ */
+void fltk3::Widget::draw() {
+  draw_box();
+  draw_label();
+}
 
+
 // ========================= Wrapper Support ===================================
 
 fltk3::Object::~Object() {

Added: branches/branch-3.0/test2/CubeMain.cxx
===================================================================
--- branches/branch-3.0/test2/CubeMain.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/CubeMain.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,50 @@
+//
+// "$Id: CubeMain.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $"
+//
+// CubeView class definitions for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2006 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+//    http://www.fltk.org/str.php
+//
+
+#include <config.h>
+
+#include <fltk/run.h>
+#include <fltk/visual.h>
+
+#include "CubeViewUI.h"
+
+int main(int argc, char **argv) 
+{  
+  // Initial global objects.
+  fltk::args(argc, argv);
+  fltk::visual(fltk::DOUBLE_BUFFER);
+
+  CubeViewUI cvui;
+  cvui.show();
+    
+  return fltk::run();
+}
+
+
+//
+// End of "$Id: CubeMain.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $".
+//

Added: branches/branch-3.0/test2/CubeView.cxx
===================================================================
--- branches/branch-3.0/test2/CubeView.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/CubeView.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,175 @@
+//
+// "$Id: CubeView.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $"
+//
+// CubeView class implementation for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2006 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+//    http://www.fltk.org/str.php
+//
+
+#include "CubeView.h"
+#include <math.h>
+
+#if HAVE_GL
+CubeView::CubeView(int x,int y,int w,int h,const char *l)
+            : GlWindow(x,y,w,h,l)
+#else
+CubeView::CubeView(int x,int y,int w,int h,const char *l)
+            : Widget(x,y,w,h,l)
+#endif /* HAVE_GL */
+{
+    vAng = 0.0;
+    hAng=0.0;
+    size=10.0;
+    xshift=yshift=0;
+    /* The cube definition. These are the vertices of a unit cube
+     * centered on the origin.*/
+    
+    boxv0[0] = -0.5; boxv0[1] = -0.5; boxv0[2] = -0.5;
+    boxv1[0] =  0.5; boxv1[1] = -0.5; boxv1[2] = -0.5;
+    boxv2[0] =  0.5; boxv2[1] =  0.5; boxv2[2] = -0.5;
+    boxv3[0] = -0.5; boxv3[1] =  0.5; boxv3[2] = -0.5;
+    boxv4[0] = -0.5; boxv4[1] = -0.5; boxv4[2] =  0.5;
+    boxv5[0] =  0.5; boxv5[1] = -0.5; boxv5[2] =  0.5;
+    boxv6[0] =  0.5; boxv6[1] =  0.5; boxv6[2] =  0.5;
+    boxv7[0] = -0.5; boxv7[1] =  0.5; boxv7[2] =  0.5;
+
+#if !HAVE_GL
+    label("OpenGL is required for this demo to operate.");
+    align(fltk::ALIGN_WRAP | fltk::ALIGN_INSIDE);
+    box(fltk::NO_BOX);
+    labelcolor(fltk::WHITE);
+#endif /* !HAVE_GL */
+}
+
+#if HAVE_GL
+void CubeView::drawCube() 
+{
+    /* Draw a colored cube */
+    #define ALPHA 0.5
+    
+    glShadeModel(GL_FLAT);
+
+    glBegin(GL_QUADS);
+      glColor4f(0.0, 0.0, 1.0, ALPHA);
+      glVertex3fv(boxv0);
+      glVertex3fv(boxv1);
+      glVertex3fv(boxv2);
+      glVertex3fv(boxv3);
+
+      glColor4f(1.0, 1.0, 0.0, ALPHA);
+      glVertex3fv(boxv0);
+      glVertex3fv(boxv4);
+      glVertex3fv(boxv5);
+      glVertex3fv(boxv1);
+
+      glColor4f(0.0, 1.0, 1.0, ALPHA);
+      glVertex3fv(boxv2);
+      glVertex3fv(boxv6);
+      glVertex3fv(boxv7);
+      glVertex3fv(boxv3);
+
+      glColor4f(1.0, 0.0, 0.0, ALPHA);
+      glVertex3fv(boxv4);
+      glVertex3fv(boxv5);
+      glVertex3fv(boxv6);
+      glVertex3fv(boxv7);
+
+      glColor4f(1.0, 0.0, 1.0, ALPHA);
+      glVertex3fv(boxv0);
+      glVertex3fv(boxv3);
+      glVertex3fv(boxv7);
+      glVertex3fv(boxv4);
+
+      glColor4f(0.0, 1.0, 0.0, ALPHA);
+      glVertex3fv(boxv1);
+      glVertex3fv(boxv5);
+      glVertex3fv(boxv6);
+      glVertex3fv(boxv2);
+    glEnd();
+
+    glColor3f(1.0, 1.0, 1.0);
+    glBegin(GL_LINES);
+      glVertex3fv(boxv0);
+      glVertex3fv(boxv1);
+
+      glVertex3fv(boxv1);
+      glVertex3fv(boxv2);
+
+      glVertex3fv(boxv2);
+      glVertex3fv(boxv3);
+
+      glVertex3fv(boxv3);
+      glVertex3fv(boxv0);
+
+      glVertex3fv(boxv4);
+      glVertex3fv(boxv5);
+
+      glVertex3fv(boxv5);
+      glVertex3fv(boxv6);
+
+      glVertex3fv(boxv6);
+      glVertex3fv(boxv7);
+
+      glVertex3fv(boxv7);
+      glVertex3fv(boxv4);
+
+      glVertex3fv(boxv0);
+      glVertex3fv(boxv4);
+
+      glVertex3fv(boxv1);
+      glVertex3fv(boxv5);
+
+      glVertex3fv(boxv2);
+      glVertex3fv(boxv6);
+
+      glVertex3fv(boxv3);
+      glVertex3fv(boxv7);
+    glEnd();
+}
+
+void CubeView::draw() 
+{
+    if (!valid()) {
+        glLoadIdentity();
+        glViewport(0,0,w(),h());
+        glOrtho(-10,10,-10,10,-20000,10000);
+        glEnable(GL_BLEND);
+        glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+    }
+
+    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+    glPushMatrix();
+
+    glTranslatef(xshift, yshift, 0);
+    glRotatef(hAng,0,1,0); glRotatef(vAng,1,0,0);
+    glScalef(float(size),float(size),float(size));
+
+    drawCube();
+    
+    glPopMatrix();
+}
+#endif /* HAVE_GL */
+
+//
+// End of "$Id: CubeView.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $".
+//

Added: branches/branch-3.0/test2/CubeView.h
===================================================================
--- branches/branch-3.0/test2/CubeView.h	                        (rev 0)
+++ branches/branch-3.0/test2/CubeView.h	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,129 @@
+//
+// "$Id: CubeView.h 8500 2011-03-03 09:20:46Z bgbnbigben $"
+//
+// CubeView class definitions for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2006 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+//    http://www.fltk.org/str.php
+//
+
+#ifndef CUBEVIEW_H
+#define CUBEVIEW_H 1
+
+#include <config.h>
+
+#include <fltk/run.h>
+
+#if HAVE_GL
+#  include <fltk/GlWindow.h>
+#  include <fltk/gl.h>
+#else
+#  include <fltk/Widget.h>
+#endif /* HAVE_GL */
+
+#include <stdlib.h>
+
+#if HAVE_GL
+class CubeView : public fltk::GlWindow {
+#else
+class CubeView : public fltk::Widget {
+#endif /* HAVE_GL */
+
+public:
+    CubeView(int x,int y,int w,int h,const char *l=0);
+
+    /* Set the rotation about the vertical (y ) axis.
+     *
+     * This function is called by the horizontal roller in CubeViewUI and the
+     * initialize button in CubeViewUI.
+     */
+    void v_angle(float angle) { vAng=angle; }
+    
+    // Return the rotation about the vertical (y) axis.
+    float v_angle() { return vAng; }
+
+    /* Set the rotation about the horizontal (x) axis.
+     *
+     * This function is called by the vertical roller in CubeViewUI
+     */
+    void h_angle(float angle) { hAng=angle; }
+
+    // the rotation about the horizontal (x) axis.
+    float h_angle() { return hAng; }
+
+    /* Sets the x shift of the cube view camera.
+     *
+     * This function is called by the slider in CubeViewUI
+     */
+    void panx(float x) { xshift=x; }
+
+    /* Sets the y shift of the cube view camera.
+     *
+     * This function is called by the slider in CubeViewUI
+     */
+    void pany(float y) { yshift=y; }
+
+    /* Sets the scale factor of the cube view camera.
+     *
+     * This function is called by the slider in CubeViewUI
+     */
+    void setsize(float v) { size=v; }
+
+#if HAVE_GL
+    /*The widget class draw() override.
+     *
+     *The draw() function initialize Gl for another round o f drawing
+     * then calls specialized functions for drawing each of the
+     * entities displayed in the cube view.
+     *
+     */
+    void draw();    
+#endif /* HAVE_GL */
+
+private:
+    /* Draw the cube boundaries
+     *
+     * Draw the faces of the cube using the boxv[] vertices, using
+     * GL_LINE_LOOP for the faces. The color is \#defined by CUBECOLOR.
+     */
+#if HAVE_GL
+    void drawCube();
+#else
+    void drawCube() { }
+#endif /* HAVE_GL */
+
+    // this value determines the scaling factor used to draw the cube.
+    double size;
+    
+    float vAng, hAng;
+    float xshift, yshift;
+
+    float boxv0[3]; float boxv1[3];
+    float boxv2[3]; float boxv3[3];
+    float boxv4[3]; float boxv5[3];
+    float boxv6[3]; float boxv7[3];
+};
+
+#endif
+
+//
+// End of "$Id: CubeView.h 8500 2011-03-03 09:20:46Z bgbnbigben $".
+//

Added: branches/branch-3.0/test2/CubeViewUI.cxx
===================================================================
--- branches/branch-3.0/test2/CubeViewUI.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/CubeViewUI.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,128 @@
+// generated by Fast Light User Interface Designer (fluid) version 2.0100
+
+#include "CubeViewUI.h"
+
+inline void CubeViewUI::cb_zoom_i(fltk::ValueSlider* o, void*) {
+  cube->setsize((float) o->value());
+  cube->redraw();
+}
+void CubeViewUI::cb_zoom(fltk::ValueSlider* o, void* v) {
+  ((CubeViewUI*)(o->parent()->parent()->user_data()))->cb_zoom_i(o,v);
+}
+
+inline void CubeViewUI::cb_vrot_i(fltk::ThumbWheel* o, void*) {
+  cube->v_angle((float) o->value());
+  cube->redraw();
+}
+void CubeViewUI::cb_vrot(fltk::ThumbWheel* o, void* v) {
+  ((CubeViewUI*)(o->parent()->parent()->parent()->user_data()))->cb_vrot_i(o,v);
+}
+
+inline void CubeViewUI::cb_ypan_i(fltk::Slider* o, void*) {
+  cube->pany((float) o->value());
+  cube->redraw();
+}
+void CubeViewUI::cb_ypan(fltk::Slider* o, void* v) {
+  ((CubeViewUI*)(o->parent()->parent()->parent()->user_data()))->cb_ypan_i(o,v);
+}
+
+inline void CubeViewUI::cb_xpan_i(fltk::Slider* o, void*) {
+  cube->panx((float) o->value());
+  cube->redraw();
+}
+void CubeViewUI::cb_xpan(fltk::Slider* o, void* v) {
+  ((CubeViewUI*)(o->parent()->parent()->parent()->user_data()))->cb_xpan_i(o,v);
+}
+
+inline void CubeViewUI::cb_hrot_i(fltk::ThumbWheel* o, void*) {
+  cube->h_angle((float) o->value());
+  cube->redraw();
+}
+void CubeViewUI::cb_hrot(fltk::ThumbWheel* o, void* v) {
+  ((CubeViewUI*)(o->parent()->parent()->parent()->user_data()))->cb_hrot_i(o,v);
+}
+
+CubeViewUI::CubeViewUI() {
+  fltk::Window* w;
+   {fltk::Window* o = mainWindow = new fltk::Window(415, 406, "CubeView");
+    w = o;
+    o->user_data((void*)(this));
+    o->begin();
+     {fltk::Group* o = new fltk::Group(3, 3, 409, 400);
+      o->begin();
+       {fltk::ValueSlider* o = zoom = new fltk::ValueSlider(101, 0, 227, 19, "Zoom");
+        o->labelfont(fltk::HELVETICA_BOLD);
+        o->labelcolor((fltk::Color)136);
+        o->minimum(1);
+        o->maximum(50);
+        o->step(0.1);
+        o->value(10);
+        o->callback((fltk::Callback*)cb_zoom);
+        o->align(fltk::ALIGN_LEFT);
+      }
+       {fltk::Group* o = VChange = new fltk::Group(0, 97, 37, 192);
+        o->set_vertical();
+        o->begin();
+         {fltk::ThumbWheel* o = vrot = new fltk::ThumbWheel(0, 0, 17, 186, "V Rot");
+          o->set_vertical();
+          o->labeltype(fltk::NO_LABEL);
+          o->minimum(-180);
+          o->maximum(180);
+          o->step(1);
+          o->callback((fltk::Callback*)cb_vrot);
+          o->align(fltk::ALIGN_TOP|fltk::ALIGN_WRAP);
+        }
+         {fltk::Slider* o = ypan = new fltk::Slider(20, 0, 17, 186);
+          o->set_vertical();
+          o->labeltype(fltk::NO_LABEL);
+          o->labelcolor((fltk::Color)136);
+          o->minimum(-25);
+          o->maximum(25);
+          o->step(0.1);
+          o->callback((fltk::Callback*)cb_ypan);
+          o->align(fltk::ALIGN_CENTER);
+        }
+        o->end();
+      }
+       {fltk::Group* o = HChange = new fltk::Group(115, 359, 190, 40);
+        o->begin();
+         {fltk::Slider* o = xpan = new fltk::Slider(2, 2, 186, 17);
+          o->labeltype(fltk::NO_LABEL);
+          o->labelcolor((fltk::Color)136);
+          o->minimum(25);
+          o->maximum(-25);
+          o->step(0.1);
+          o->callback((fltk::Callback*)cb_xpan);
+          o->align(fltk::ALIGN_CENTER);
+        }
+         {fltk::ThumbWheel* o = hrot = new fltk::ThumbWheel(2, 21, 186, 17, "H Rotation");
+          o->labeltype(fltk::NO_LABEL);
+          o->minimum(-180);
+          o->maximum(180);
+          o->step(1);
+          o->callback((fltk::Callback*)cb_hrot);
+          o->align(fltk::ALIGN_LEFT);
+        }
+        o->end();
+      }
+       {fltk::Group* o = MainView = new fltk::Group(41, 24, 333, 333);
+        o->begin();
+         {fltk::InvisibleBox* o = cframe = new fltk::InvisibleBox(0, 0, 333, 333);
+          o->box(fltk::DOWN_BOX);
+          o->color((fltk::Color)56);
+          o->selection_color((fltk::Color)69);
+        }
+         {cube = new CubeView(2, 2, 329, 329);
+        }
+        o->end();
+      }
+      o->end();
+      fltk::Group::current()->resizable(o);
+    }
+    o->end();
+  }
+}
+
+void CubeViewUI::show() {
+  mainWindow->show();
+}

Added: branches/branch-3.0/test2/CubeViewUI.fl
===================================================================
--- branches/branch-3.0/test2/CubeViewUI.fl	                        (rev 0)
+++ branches/branch-3.0/test2/CubeViewUI.fl	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,76 @@
+# data file for the FLTK User Interface Designer (FLUID)
+version 2.0100 
+images_dir ./ 
+header_name {.h} 
+code_name {.cxx} 
+gridx 2 
+gridy 2 
+snap 2
+class CubeViewUI {open
+} {
+  Function {CubeViewUI()} {open
+  } {
+    {fltk::Window} mainWindow {
+      label CubeView open
+      private xywh {803 113 415 406} resizable visible
+    } {
+      {fltk::Group} {} {open
+        xywh {3 3 409 400} resizable
+      } {
+        {fltk::ValueSlider} zoom {
+          label Zoom
+          callback {cube->setsize(o->value());
+cube->redraw();}
+          xywh {101 0 227 19} align 4 labelfont 1 labelcolor 136 minimum 1 maximum 50 step 0.1 value 10
+        }
+        {fltk::Group} VChange {open
+          xywh {0 97 37 192}
+        } {
+          {fltk::ThumbWheel} vrot {
+            label {V Rot}
+            callback {cube->v_angle(o->value());
+cube->redraw();}
+            xywh {0 0 17 186} align 129 labeltype NO_LABEL minimum -180 maximum 180 step 1
+            extra_code {\#include <stdio.h>}
+          }
+          {fltk::Slider} ypan {
+            callback {cube->pany(o->value());
+cube->redraw();}
+            xywh {20 0 17 186} align 0 labeltype NO_LABEL labelcolor 136 minimum -25 maximum 25 step 0.1
+          }
+        }
+        {fltk::Group} HChange {open
+          xywh {115 359 190 40}
+        } {
+          {fltk::Slider} xpan {
+            callback {cube->panx(o->value());
+cube->redraw();} selected
+            xywh {2 2 186 17} align 0 labeltype NO_LABEL labelcolor 136 minimum 25 maximum -25 step 0.1
+          }
+          {fltk::ThumbWheel} hrot {
+            label {H Rotation}
+            callback {cube->h_angle(o->value());
+cube->redraw();}
+            xywh {2 21 186 17} align 4 labeltype NO_LABEL minimum -180 maximum 180 step 1
+          }
+        }
+        {fltk::Group} MainView {open
+          xywh {41 24 333 333}
+        } {
+          {fltk::InvisibleBox} cframe {
+            xywh {0 0 333 333} box DOWN_BOX color 56 selection_color 69
+          }
+          {fltk::InvisibleBox} cube {
+            xywh {2 2 329 329}
+            extra_code {\#include "CubeView.h"}
+            class CubeView
+          }
+        }
+      }
+    }
+  }
+  Function {show()} {open
+  } {
+    code {mainWindow->show();} {}
+  }
+} 

Added: branches/branch-3.0/test2/CubeViewUI.h
===================================================================
--- branches/branch-3.0/test2/CubeViewUI.h	                        (rev 0)
+++ branches/branch-3.0/test2/CubeViewUI.h	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,52 @@
+// generated by Fast Light User Interface Designer (fluid) version 2.0100
+
+#ifndef CubeViewUI_h
+#define CubeViewUI_h
+#include <fltk/Window.h>
+#include <fltk/Group.h>
+#include <fltk/ValueSlider.h>
+#include <fltk/ThumbWheel.h>
+#include <stdio.h>
+#include <fltk/Slider.h>
+#include <fltk/InvisibleBox.h>
+#include "CubeView.h"
+
+class CubeViewUI  {
+public:
+  CubeViewUI();
+private:
+  fltk::Window *mainWindow;
+public:
+      fltk::ValueSlider *zoom;
+private:
+      inline void cb_zoom_i(fltk::ValueSlider*, void*);
+      static void cb_zoom(fltk::ValueSlider*, void*);
+public:
+      fltk::Group *VChange;
+        fltk::ThumbWheel *vrot;
+private:
+        inline void cb_vrot_i(fltk::ThumbWheel*, void*);
+        static void cb_vrot(fltk::ThumbWheel*, void*);
+public:
+        fltk::Slider *ypan;
+private:
+        inline void cb_ypan_i(fltk::Slider*, void*);
+        static void cb_ypan(fltk::Slider*, void*);
+public:
+      fltk::Group *HChange;
+        fltk::Slider *xpan;
+private:
+        inline void cb_xpan_i(fltk::Slider*, void*);
+        static void cb_xpan(fltk::Slider*, void*);
+public:
+        fltk::ThumbWheel *hrot;
+private:
+        inline void cb_hrot_i(fltk::ThumbWheel*, void*);
+        static void cb_hrot(fltk::ThumbWheel*, void*);
+public:
+      fltk::Group *MainView;
+        fltk::InvisibleBox *cframe;
+        CubeView *cube;
+  void show();
+};
+#endif

Added: branches/branch-3.0/test2/Fl_Multi_Image.cxx
===================================================================
--- branches/branch-3.0/test2/Fl_Multi_Image.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/Fl_Multi_Image.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,502 @@
+// Test of the new Fl_MultiImage class for labelling a widget
+
+#include <fltk/Fl.h>
+#include <fltk/Fl_Window.h>
+#include <fltk/Fl_Button.h>
+#include <fltk/Fl_Check_Button.h>
+#include <fltk/Fl_Multi_Image.h>
+
+extern Fl_Multi_Image multiimage; // defined below
+
+void inactive_cb(Fl_Widget* w, void*)
+{
+  if (w->value()) {
+    w->window()->child(0)->deactivate();
+    w->window()->child(1)->deactivate();
+  } else {
+    w->window()->child(0)->activate();
+    w->window()->child(1)->activate();
+  }
+}
+
+int main(int argc, char** argv)
+{
+  Fl_Window window(200,100);
+  for (int i = 0; i < 4; i++) {
+    Fl_Button* b = new Fl_Button(20+i*40, 20, 32, 32);
+    b->image(multiimage);
+    // must remove box so it does not blink:
+    b->box(FL_NO_BOX);
+    // remove focus box because we have an image to show focus:
+    b->focus_box(FL_NO_BOX);
+    // you have to set highlight color to get it to redraw when the
+    // highlighting is changed:
+    b->highlight_color(FL_GRAY);
+  }
+  Fl_Check_Button check(20,60,180,20,"Make two of them inactive");
+  check.callback(inactive_cb);
+  window.end();
+  window.show(argc, argv);
+  return Fl::run();
+}
+
+////////////////////////////////////////////////////////////////
+// Sample images designed and provided by Curtis Edwards
+
+#include <fltk/Fl_Pixmap.h>
+#include <fltk/Fl_Bitmap.h>
+
+/* XPM */
+static char *clear_tick_up[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 20 1",
+/* colors */
+"  c #878E8E",
+". c #7A8081",
+"X c #8E9797",
+"o c #B2B3B3",
+"O c #C4CFCB",
+"+ c #EAEEED",
+"@ c #9A9B9E",
+"# c #AAAAAA",
+"$ c #94A19E",
+"% c #B6BEBC",
+"& c #A0A2A3",
+"* c #BAC6C3",
+"= c #6C7173",
+"- c #A8B4B1",
+"; c #5C6163",
+": c #414C66",
+"> c #A6A7A8",
+", c #9BAAA7",
+"< c #A1B1AC",
+"1 c #ACBAB6",
+/* pixels */
+"################################",
+"##########&@  ...  X@>##########",
+"########@.;=========. X&########",
+"######@=;=.     XX .=;=X@#######",
+"#####.;=XXX&O+++++%$XX=; @&#####",
+"####.; $$X#++++++++O&$$ ; &>####",
+"###.;X$$ -+++++++++++$$$ = >####",
+"## ; $$ X++++++++++++* $$ ;@####",
+"#&; $$X %+++++++++++++>X$$ ;oo##",
+"#.=$,X XO+++++++++++O$- X,X=Xoo#",
+"&; $$XX$**OOOOOOOOO,::XXX$$ ;oo#",
+" =X$XX$&<-1%%%%%%%X::: $XX$X=&%o",
+"=.$$XX$&<-1111111X:::=<$XX$$. %o",
+"=.$$X$,<-1.:;%%%X:::=--,$X$$..%%",
+"; ,$X$<-1 :::%*X:::=11-<$X$,  %%",
+"; ,$X$<-1.:::-X:::=%%%1<$X$,  %*",
+"; ,,$,-1%.:::=:::=%**%1-,$,, .%%",
+"; ,,,,-1% ::::::;%OO**%-,,,, =%%",
+"=.,,,,-%%$:::::=**OOO*%-,,,,.X%%",
+".=$,,,-%*<::::=*O**OO*%-,,,$=>%o",
+">; ,,,-%** ::.OOOO**O*%-,,, ;#%#",
+"#=.,<<<1**O1-OOOOOO*O*1<<<$.=oo#",
+"#&;X,<<1%*OOOOOOOOOO**1<<, ;>o##",
+"##==X<<-%**OOOOOOOOO*%-<<X==oo##",
+"##>;.$<<-***OOOOOOO**-<<$.=#####",
+"##>>==X,<1%*********1<< ==>#>>##",
+"###>&==.$,1%******%1,$.==&>>>###",
+"####>> ==. $,<<<,,$ .== @&&>####",
+"#####>&@ ..=========. @@@&>#####",
+"######>>&@@XXXXXXXX@@@@&>>######",
+"#######>>>&&@@@@@@@@&&>>########",
+"##########>>>>>>>>>>>>##########"
+};
+Fl_Pixmap up(clear_tick_up);
+
+/* XPM */
+static char *clear_tick_hi[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 20 1",
+/* colors */
+"  c #9ED2BF",
+". c #5D6768",
+"X c #A8A9A9",
+"o c #A7A7A8",
+"O c #A5A5A6",
+"+ c #9A9B9E",
+"@ c #85A59D",
+"# c #B7E0CE",
+"$ c #7A8A85",
+"% c #AAAAAA",
+"& c #B9BCBC",
+"* c #697877",
+"= c #E6F7F1",
+"- c #414C66",
+"; c #899492",
+": c #A1A1A3",
+"> c #8EB3A7",
+", c #B3B4B4",
+"< c #93C3B2",
+"1 c #ADAEAE",
+/* pixels */
+"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
+"%%%%%%%%%%:+;$$$$$;;+o%%%%%%%%%%",
+"%%%%%%%%+*.********.*;;:%%%%%%%%",
+"%%%%%%+..$@@>>>>>>@@$..;+1%%%%%%",
+"%%%%%*.$>>><#=====#>>>$.$+:%%%%%",
+"%%%%**@<<>&========#<<<@.$:O%%%%",
+"%%%**><<>&===========<><>*$O%%%%",
+"%%$*><<>>============#><<>*;11%%",
+"%:.@<<>@#=============<><<@.11%%",
+"%.$><>>>#===========#+ ><<>$$,1%",
+"+.><<>><###########<--@>><<@.,,%",
+"$$><<><<   #######>---@<><<>$+&,",
+"*@<<<<<<    ##   @---* <<<<<@$&,",
+".@<<<<<   $-.###@---*  <<<<<@*&&",
+"*@<<><   @---##@---*    <><<@$&&",
+".><<><   $--- @---*###  <><<>$&&",
+".><<<<   $---*---*####  <<<<>*&&",
+".@<<<<  #@------.###### <<<<@.&&",
+"*@< <   #>-----*#######  < <;;&&",
+";$<    ##<----*########    <$X&,",
+"O*>  < ###;--*######### < <>*1&1",
+"%.;<    ###  #########    <;.,,1",
+"%:*>    ##############   <>*O,1%",
+"%X.$>   ##############   >$.,11%",
+"%Xo.;<   ############   <;.%1XX%",
+"%%XO.$>   ##########   >$.o%OX%%",
+"%%%oO.$@<  ########  <@$.:oOXX%%",
+"%%oXoo$$$@><      <>@$*;+:OoX%%%",
+"%%%%XoO+$$$$$$$$$$$$$$+++OoX%%%%",
+"%%%%%XoO:++;;;;;;;;++++:OoX%%%%%",
+"%%%%%%XXoO::++++++++::OoXX%%%%%%",
+"%%%%%%%%%XXooOOOOOOooXXX%%%%%%%%"
+};
+Fl_Pixmap hi(clear_tick_hi);
+
+/* XPM */
+static char *clear_tick_dn[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 20 1",
+/* colors */
+"  c #AFAFAF",
+". c #A4CBBE",
+"X c #8EBBAB",
+"o c #8AAEA3",
+"O c #8D908F",
+"+ c #ADD9C8",
+"@ c #606B6C",
+"# c #BEBEBE",
+"$ c #AAAAAA",
+"% c #788E86",
+"& c #A4A4A4",
+"* c #BBE3D1",
+"= c #9A9C9D",
+"- c #95C0B2",
+"; c #727D7C",
+": c #E6F7F1",
+"> c #414C66",
+", c #95CFBA",
+"< c #81A099",
+"1 c #B5B5B5",
+/* pixels */
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$&=OO%;;OOO=$$$$$$$$$$$",
+"$$$$$$$$=;@@;;;;;;;@@OO&$$$$$$$$",
+"$$$$$$=@@%<oooooooo<%@@O=$$$$$$$",
+"$$$$$;@%oooo*:::::+XXo%@%=&$$$$$",
+"$$$$;@oooo.::::::::*---o@%&&$$$$",
+"$$$@;oooo.:::::::::::-X-o;%&$$$$",
+"$$%;ooooo::::::::::::*o--o@O$ $$",
+"$&@ooooo+:::::::::::::.X--<@  $$",
+"$@%ooXoo*:::::::::::*=.oX-X%%1 $",
+"=@oooXX-+**********->><XX--o@ 1$",
+"%%ooXXX-..++++++++o>>><XXX-X%=# ",
+"@<oXXX--..+++++++o>>>;.-XX--<;#1",
+"@<o-XX-...;>@+++o>>>;..,XX--<;##",
+"@o,-XX...<>>>++<>>>;++..-X-,o%##",
+"@o,-X-...%>>>.<>>>@+++..XX-,o%##",
+"@o,,--.++%>>>;>>>@+*+++.,-,,o;##",
+"@o,,,,.++<>>>>>>@+***++.,,,,o@##",
+";<,,,,.++o>>>>>@*****++.,,,,<=#1",
+"O%X,,,.++->>>>@*******+.,,,X% #1",
+"&;o,,,.++*%>>;********+.,,,o;## ",
+"$@<,,,,++**..*********+,,,-<@#1 ",
+"$&@X,,,++************++,,,o@## $",
+"$$@%X,,,+************+,,,X%;#1 $",
+"$$$@<-,,,+**********+,,,X<@#1$$$",
+"$$$$@%X,,,++++***++++,,o%;#1$$$$",
+"$$$$$@%o-,+++++*++++,-<%;#1$$$$$",
+"$$$$$ O;%<o,,,,.,,,o<%;&# $$$$$$",
+"$$$$$$$$OO%%%%%%%%%%O=11$$$$$$$$",
+"$$$$$$$$$$ $$ 11111#1 $$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$"
+};
+Fl_Pixmap dn(clear_tick_dn);
+
+/* XPM */
+static char *clear_tick_up_focus[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 69 1",
+/* colors */
+"  c #ADB5AD",
+". c #ADADAD",
+"X c #A5B5A5",
+"o c #A5ADA5",
+"O c #A5A5A5",
+"+ c #ADC6BD",
+"@ c #738C94",
+"# c #737373",
+"$ c #9CADA5",
+"% c #9CA5A5",
+"& c #CEDED6",
+"* c #C6DECE",
+"= c #C6D6CE",
+"- c #B5CEBD",
+"; c #B5C6BD",
+": c #ADC6B5",
+"> c #949C9C",
+", c #5A6363",
+"< c #8C9C94",
+"1 c #8C9494",
+"2 c #B5CEC6",
+"3 c #CEDECE",
+"4 c #C6DEC6",
+"5 c #C6D6C6",
+"6 c #C6CEC6",
+"7 c #BDCEBD",
+"8 c #BDC6BD",
+"9 c #9C9C9C",
+"0 c #949C94",
+"q c #BDD6C6",
+"w c #BDCEC6",
+"e c #A5BDB5",
+"r c #BDC6C6",
+"t c #A5B5B5",
+"y c #8C8C8C",
+"u c #E7F7EF",
+"i c #E7EFEF",
+"p c #D6EFDE",
+"a c #D6E7DE",
+"s c #CEE7D6",
+"d c #C6E7CE",
+"f c #B5BDBD",
+"g c #7B8484",
+"h c #ADBDB5",
+"j c #ADB5B5",
+"k c #A5BDAD",
+"l c #A5B5AD",
+"z c #A5ADAD",
+"x c #A5A5AD",
+"c c #E7F7E7",
+"v c #E7EFE7",
+"b c #DEF7DE",
+"n c #DEEFDE",
+"m c #94A59C",
+"M c #D6EFD6",
+"N c #D6E7D6",
+"B c #737B7B",
+"V c #9CB5AD",
+"C c #73737B",
+"Z c #9CADAD",
+"A c #849C9C",
+"S c #B5BDB5",
+"D c #6B7373",
+"F c #DEF7E7",
+"G c #94ADA5",
+"H c #B5B5B5",
+"J c #DEEFE7",
+"K c #94A5A5",
+"L c #C6DED6",
+/* pixels */
+"................................",
+".......o..%9y1gggy119O.zO.......",
+"........9g,#DB#B#B#Dg1<O........",
+"......%#,#g11111>>1g#,D>9.......",
+"....og,C>>>o=iiiii8K>>D,19%.....",
+"....g,1m$mjivvcvcii=o%$1,1OOO...",
+"...g,>K%<hvvcicvciciu$$K1Dyz....",
+"..1,1K%<%aapJFvFcvcvuw0$K1,9....",
+".%,19Gm>7&&spJbJFJFvci m$%1,HH..",
+"og#KV>>$=**NNpnbFnFnLl;0mZ>D0jHO",
+"O,yK$m%k=q*sMpppppMqA@l$K$%1,HH.",
+"yD>K>KlS-q*Mppnbpp*eGAXk%m%>DOfH",
+"Dg%Gm%lSq*sMbFnFnsq+Vl-k$m$%g1fH",
+"Dgm%mV:-q3*&pcccp*q--4w:lK$mggff",
+",yZ$ml;w*5*aFcucN*qqs*q-l%$Vy1ff",
+",yZ$Kl;q*q*pcccJs=qNMsq-k%$Vy1fr",
+",1$l$e;q3q*pvFnad=spMsq-h$lZygff",
+",1ZZV -q*5=Nnnss3snpss=-hlVZ1Dff",
+"DgZVll;5*42&Ns&NbJbppd=-ellZg>ff",
+"gDmZll;q*4+q**snFbpps*5;elV%DzfH",
+"z,1$Vl+6=*-+23pbppMss*wStlV1,.f.",
+".#gZllh+=*&**MpMpNs3s=-helmg#HH.",
+".O,>Zle;w=3sssssssss==;htV1,zH..",
+"..DD>llhrq=3&s&ss&&3qwhel>#DHH..",
+"..z,gKlkhwwq=3*3**=wwhelKg#.....",
+".OxoD#>Zl+8wwwwwwwww;ll1#BzoOOzO",
+"...zODDg%Z+8wwwwww8fV$gCDOxox...",
+"....Oz1DCg1$ZkltlV$1gBD19%Ox....",
+".....OO91gg#CB#B#BDBg19%9%O.....",
+"......OzO9%0A0A><><9999%Ox.o....",
+".......xOz%O9%9%9%99%Oox........",
+"..........oxoxoxoxoxox.........."
+};
+Fl_Pixmap up_focus(clear_tick_up_focus);
+
+/* XPM */
+static char *clear_tick_dn_focus[] = {
+/* width height ncolors chars_per_pixel */
+"32 32 94 2",
+/* colors */
+"   c #ADB5AD",
+" . c #636B6B",
+" X c #ADADAD",
+" o c #9CD6BD",
+" O c #9CCEBD",
+" + c #A5ADA5",
+" @ c #A5A5A5",
+" # c #9CA59C",
+" $ c #ADD6BD",
+" % c #ADCEBD",
+" & c #A5CEB5",
+" * c #A5C6B5",
+" = c #B5DECE",
+" - c #ADDEC6",
+" ; c #849C94",
+" : c #9CA5A5",
+" > c #ADD6C6",
+" , c #ADCEC6",
+" < c #C6DECE",
+" 1 c #9CCEB5",
+" 2 c #9CC6B5",
+" 3 c #94C6AD",
+" 4 c #B5CEBD",
+" 5 c #BDDECE",
+" 6 c #949C9C",
+" 7 c #B5DEC6",
+" 8 c #8C9C94",
+" 9 c #B5D6C6",
+" 0 c #8C9494",
+" q c #849C8C",
+" w c #84948C",
+" e c #848C8C",
+" r c #73847B",
+" t c #BDC6BD",
+" y c #CEF7DE",
+" u c #CEEFDE",
+" i c #84A59C",
+" p c #C6EFD6",
+" a c #C6E7D6",
+" s c #7B948C",
+" d c #9C9C9C",
+" f c #BDDEC6",
+" g c #949C94",
+" h c #BDD6C6",
+" j c #738C84",
+" k c #949494",
+" l c #738484",
+" z c #A5BDB5",
+" x c #E7F7EF",
+" c c #BDEFD6",
+" v c #BDE7D6",
+" b c #D6F7DE",
+" n c #B5E7CE",
+" m c #D6EFDE",
+" M c #8CA59C",
+" N c #CEF7D6",
+" B c #D6E7DE",
+" V c #CEEFD6",
+" C c #84A594",
+" Z c #CEE7D6",
+" A c #C6EFCE",
+" S c #C6E7CE",
+" D c #94BDAD",
+" F c #6B7B7B",
+" G c #94B5AD",
+" H c #7B8C84",
+" J c #7B8484",
+" K c #8CB5A5",
+" L c #637373",
+" P c #D6F7E7",
+" I c #ADB5B5",
+" U c #636B73",
+" Y c #EFF7EF",
+" T c #E7F7E7",
+" R c #DEF7DE",
+" E c #A5DEBD",
+" W c #BDE7CE",
+" Q c #DEEFDE",
+" ! c #A5D6BD",
+" ~ c #D6F7D6",
+" ^ c #A5CEBD",
+" / c #D6EFD6",
+" ( c #8CA594",
+" ) c #D6E7D6",
+" _ c #9CBDAD",
+" ` c #737B7B",
+" ' c #9CB5AD",
+" ] c #BDBDBD",
+" [ c #6B7B73",
+" { c #6B7373",
+" } c #DEF7E7",
+" | c #94ADA5",
+".  c #B5B5B5",
+".. c #A5DEC6",
+/* pixels */
+" X X X X X X X X X X       I  .    I     X X X X X X X X X X X X",
+" X X X X X X X X     X + # # ( w w # d 6 :     X X X X X X X X X",
+" X X X X X X X   : e r j 8 8 8 ( 8 8 q l r 6 6 + X X X X X X X X",
+" X X X X X X : F r ( | 2 * * & & & * * D M r F g : X X X X X X X",
+" X X X X X J [ ; D & ^ $ p } } } } } W ! & _ C F q : @ X X X X X",
+" X + X X r [ D O ^ ^ 7 } } b P b P R } p.. ^ ^ G [ s + @ X + X X",
+" X X X L J G O ^ 2 7 b P R b b b b b } } } $ 1 ^ G H s @ X X X X",
+" X X s l G 2 ^ 2 ^ u b b b b b b b b b P } p * ^ 1 G { k X X X X",
+" X @ . K 2 1 2 * 7 p m b y b b b b b b b b } 7 1 ^ 2 i L.  X X X",
+" X L s 3 O 2 _ & W p N V ~ b b b b b N V p 4 7 2 2 1 2 s H.  X X",
+" # . K 2 2 1 & > A p V N b b b R b b y A z | * ^ 1 O 2 K L  .  X",
+" s s K 2 2 1 ^ > W p N b b R R R R b V 9 * ' & ^ & 2 1 D s # ] X",
+" . i 2 3 2 1 $ 9 W p V b } } } T } R S 9 4 4 W > & 2 2 2 i l ]. ",
+" U i 2 2 2 2 $ 5 S V S ) R T T T } ) < h f S W - 1 2 2 2 i ` ] ]",
+" . K o 2 2 & 7 W a S Z m } x T x Q Z Z Z N V W = ! 2 2 o K s ] ]",
+" . K o 2 2 ^ = W a < Z Q } Y T } m Z / b b V W = & 2 2 o K s ] ]",
+" . K o o 1 ^ 7 W p f < Z R T Q ) Z m R } m V p =.. ^ o O K ` ] ]",
+" . K O o o.. 9 v p < h Z B ) Z Z Q } } b b p W 7 ! o o O K . t ]",
+" ` i o o o ! 7 W p 5 h < Z Z V Q T T } b b p W 7.. o o o i d ]. ",
+" 0 s D o o ! > W a W % 5 < < m } } } R b y V W 9 E o o D s   ]. ",
+" @ ` K O o o > n W V 4 % h S R R b b m V p p W > ! o o K ` ] ] X",
+" X . i o O o o = 5 p p S p / u b u V N p p a = ! o o 2 i . ].  X",
+" X @ . D o o o = = p p p V V u N u V V p p W = o o o K L ] ] X X",
+" X X . s D o o o = v p p p p p V p p p a p = o o o D s r ].  X X",
+" X X X . i 2 o o o = v a p a p a p a c a = o o o D i . t.  X X X",
+" X X X X . s D O o o 7 = = = W v W = 7 7 = o O K s ` ].  X X X X",
+" X X X X X . s K 2 o = = = = = v = = = = o 2 i s ` ].  X X X X X",
+" X X X X X   k r s i K o o o o , o o o K i s r @ ] X X X X X X X",
+" X X X X X X X X 0 k s s s s s s s s s s k d. .  X X X X X X X X",
+" X X X X X X X X X +   X X. . . . . .  t.  I X X + X X X X X X X",
+" X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X",
+" X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X"
+};
+Fl_Pixmap dn_focus(clear_tick_dn_focus);
+
+#define clear_tick_mask_width 32
+#define clear_tick_mask_height 32
+static char clear_tick_mask_bits[] = {
+ 0x00,0x00,0x00,0x00,0x00,0xfd,0xaf,0x00,0x00,0x55,0x55,0x00,0x40,0xab,0x6a,
+ 0x01,0x40,0x0a,0x48,0x01,0xb0,0xa8,0x92,0x01,0x28,0x01,0x20,0x05,0x98,0x54,
+ 0x55,0x0a,0x92,0x82,0x80,0x2a,0x26,0x18,0x25,0x14,0x4a,0x42,0x70,0x12,0x4a,
+ 0x20,0x78,0x17,0x4a,0x49,0x5a,0x12,0x11,0x1a,0x97,0x34,0x23,0x1c,0x0f,0x25,
+ 0xab,0x9d,0x47,0x36,0x25,0xbd,0xa1,0x24,0x49,0x6a,0x05,0x29,0x92,0xfc,0xa0,
+ 0x22,0x05,0x7c,0x0a,0x10,0xaa,0x18,0x40,0x15,0x42,0x82,0x24,0x28,0x0a,0x12,
+ 0x80,0x08,0x94,0x44,0x95,0x0a,0x54,0x10,0x20,0x0a,0xb0,0x4a,0xca,0x02,0x40,
+ 0x81,0x40,0x01,0x80,0x2a,0xaa,0x02,0x80,0xfa,0xab,0x02,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
+Fl_Bitmap up_inactive(clear_tick_mask_bits, clear_tick_mask_width, clear_tick_mask_height);
+#define dn_inactive up_inactive
+
+Fl_Multi_Image multiimage(up,
+			 FL_HIGHLIGHT, hi,
+  			 FL_SELECTED, up_focus,
+  			 FL_SELECTED|FL_HIGHLIGHT, dn_focus,
+			 FL_VALUE, dn,
+			 FL_INACTIVE, up_inactive,
+			 FL_INACTIVE|FL_VALUE, dn_inactive);
+
+// end of Fl_MultiImage test
+
+

Added: branches/branch-3.0/test2/Makefile
===================================================================
--- branches/branch-3.0/test2/Makefile	                        (rev 0)
+++ branches/branch-3.0/test2/Makefile	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,310 @@
+#
+# "$Id: Makefile 8500 2011-03-03 09:20:46Z bgbnbigben $"
+#
+# Test/example program makefile for the Fast Light Tool Kit (FLTK).
+#
+# Copyright 1998-2003 by Bill Spitzak and others.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+# USA.
+#
+# Please report all bugs and problems to the following page:
+#
+#    http://www.fltk.org/str.php
+#
+
+#
+# Include common definitions...
+#
+
+include ../makeinclude
+
+
+#
+# FLUID file rules...
+#
+
+.fl.cxx .fl.h:
+	../fluid/fluid2$(EXEEXT) -c $<
+
+
+#
+# Files for this directory...
+#
+
+CPPFILES = \
+	CubeMain.cxx \
+	CubeView.cxx \
+	ansiwidget.cxx \
+	arc.cxx \
+	ask.cxx \
+	bitmap.cxx \
+	boxtype.cxx \
+	browser.cxx \
+	button.cxx \
+	buttons.cxx \
+	cairo.cxx \
+	callbacks.cxx \
+	checkers.cxx \
+	clock.cxx \
+	color_chooser.cxx \
+	cube.cxx \
+	cursor.cxx \
+	curve.cxx \
+	demo.cxx \
+	doublebuffer.cxx \
+	drawing.cxx \
+	drawtiming.cxx \
+	editor.cxx \
+	file_chooser.cxx \
+	fonts.cxx \
+	fullscreen.cxx \
+	glpuzzle.cxx \
+	gl_overlay.cxx \
+	hello.cxx \
+	helloask.cxx \
+	iconize.cxx \
+	image.cxx \
+	image_transform.cxx \
+	input.cxx \
+	keyboard.cxx \
+	label.cxx \
+	list_visuals.cxx \
+	mandelbrot.cxx \
+	menu.cxx \
+	message.cxx \
+	monitors.cxx \
+	navigation.cxx \
+	output.cxx \
+	overlay.cxx \
+	pixmap.cxx \
+	pixmap_browser.cxx \
+	radio.cxx \
+	resizable.cxx \
+	resizealign.cxx \
+	scroll.cxx \
+	shape.cxx \
+	subwindow.cxx \
+	symbols.cxx \
+	tabs.cxx \
+	tile.cxx \
+	timer.cxx \
+	fast_slow.cxx \
+	resize.cxx \
+	pack.cxx \
+	inactive.cxx \
+	sizes.cxx \
+	image_file.cxx \
+	progress.cxx \
+	layout.cxx \
+	threads.cxx \
+	menubar.cxx \
+	line_style.cxx \
+	utf.cxx \
+	valuators.cxx \
+	wizard.cxx
+
+CFILES	=
+
+# only some of the demos have been changed to use namespaces:
+TARGETS = \
+	arc$(EXEEXT) \
+        ansiwidget$(EXEEXT) \
+	bitmap$(EXEEXT) \
+	boxtype$(EXEEXT) \
+	browser$(EXEEXT) \
+	cairo$(EXEEXT) \
+	callbacks$(EXEEXT) \
+	checkers$(EXEEXT) \
+	clock$(EXEEXT) \
+	button$(EXEEXT) \
+	buttons$(EXEEXT) \
+	color_chooser$(EXEEXT) \
+	cube$(EXEEXT) \
+	CubeView$(EXEEXT) \
+	cursor$(EXEEXT) \
+	curve$(EXEEXT) \
+	demo$(EXEEXT) \
+	doublebuffer$(EXEEXT) \
+	drawing$(EXEEXT) \
+	drawtiming$(EXEEXT) \
+	editor$(EXEEXT) \
+	exception$(EXEEXT) \
+	file_chooser$(EXEEXT) \
+	fonts$(EXEEXT) \
+	fractals$(EXEEXT) \
+	glpuzzle$(EXEEXT) \
+	gl_overlay$(EXEEXT) \
+	hello$(EXEEXT) \
+	image$(EXEEXT) \
+	image_transform$(EXEEXT) \
+	inactive$(EXEEXT) \
+	input$(EXEEXT) \
+	keyboard$(EXEEXT) \
+	label$(EXEEXT) \
+	line_style$(EXEEXT) \
+	list_visuals$(EXEEXT) \
+	mandelbrot$(EXEEXT) \
+	menu$(EXEEXT) \
+	message$(EXEEXT) \
+	monitors$(EXEEXT) \
+	navigation$(EXEEXT) \
+	output$(EXEEXT) \
+	pack$(EXEEXT) \
+	pixmap$(EXEEXT) \
+	progress$(EXEEXT) \
+	radio$(EXEEXT) \
+	qubix$(EXEEXT) \
+	resizable$(EXEEXT) \
+	resizealign$(EXEEXT) \
+	scroll$(EXEEXT) \
+	shape$(EXEEXT) \
+	sizes$(EXEEXT) \
+	subwindow$(EXEEXT) \
+	symbols$(EXEEXT) \
+	threads$(EXEEXT) \
+	tabs$(EXEEXT) \
+	tile$(EXEEXT) \
+	timer$(EXEEXT) \
+	utf$(EXEEXT) \
+	fullscreen$(EXEEXT) \
+	valuators$(EXEEXT) \
+	list$(EXEEXT) \
+	wizard$(EXEEXT)
+
+#
+# Make everything...
+#
+
+all:	$(TARGETS)
+
+
+#
+# Clean old files...
+#
+
+clean:
+	$(RM) *.bck
+	$(RM) *.o
+	$(RM) core*
+	$(RM) $(TARGETS)
+
+
+#
+# Make dependencies, excluding standard include directories...
+#
+
+depend:
+	$(MAKEDEPEND) -I.. $(CPPFILES) $(CFILES) > makedepend
+
+
+#
+# Include automatically generated dependencies...
+#
+
+makedepend:
+	touch makedepend
+include makedepend
+
+
+#
+# All demo programs depend on the static library.
+#
+
+$(TARGETS):	../lib/$(LIBPREFIX)fltk2$(LIBSUFFIX)
+
+
+#
+# Other programs needing special "help"...
+#
+
+button$(EXEEXT): button.o
+	echo Linking $@...
+	$(CXX) -I.. $(CXXFLAGS) $< $(LINKFLTKIMG) $(LDLIBS) -o $@
+	$(POSTBUILD) $@ ../fltk/mac.r
+
+cairo$(EXEEXT): cairo.o
+	echo Linking $@...
+	$(CXX) -I.. $(CXXFLAGS) $< $(LINKFLTK) $(LDLIBS) -o $@
+
+CubeView$(EXEEXT): CubeMain.o CubeView.o CubeViewUI.o ../lib/$(LIBPREFIX)fltk2_gl$(LIBSUFFIX)
+	echo Linking $@...
+	$(CXX) -I.. $(CXXFLAGS) CubeMain.o CubeView.o CubeViewUI.o \
+		$(LINKFLTKGL) $(GLDLIBS) -o $@
+	$(POSTBUILD) $@ ../fltk/mac.r
+
+cube$(EXEEXT): cube.o ../lib/$(LIBPREFIX)fltk2_gl$(LIBSUFFIX)
+	echo Linking $@...
+	$(CXX) -I.. $(CXXFLAGS) $< $(LINKFLTKGL) $(GLDLIBS) -o $@
+	$(POSTBUILD) $@ ../fltk/mac.r
+
+cursor$(EXEEXT): cursor.o
+	echo Linking $@...
+	$(CXX) -I.. $(CXXFLAGS) $< $(LINKFLTKIMG) $(LDLIBS) -o $@
+	$(POSTBUILD) $@ ../fltk/mac.r
+
+fullscreen$(EXEEXT): fullscreen.o ../lib/$(LIBPREFIX)fltk2_gl$(LIBSUFFIX)
+	echo Linking $@...
+	$(CXX) -I.. $(CXXFLAGS) $< $(LINKFLTKGL) $(GLDLIBS) -o $@
+	$(POSTBUILD) $@ ../fltk/mac.r
+
+fractals$(EXEEXT): fractals.o fracviewer.o ../lib/$(LIBPREFIX)fltk2_glut$(LIBSUFFIX)  ../lib/$(LIBPREFIX)fltk2_gl$(LIBSUFFIX)
+	echo Linking $@...
+	$(CXX) -I.. $(CXXFLAGS) fractals.o fracviewer.o ../lib/$(LIBPREFIX)fltk2_glut$(LIBSUFFIX) $(LINKFLTKGL) $(GLDLIBS) -o $@
+	$(POSTBUILD) $@ ../fltk/mac.r
+
+glpuzzle$(EXEEXT): glpuzzle.o ../lib/$(LIBPREFIX)fltk2_glut$(LIBSUFFIX)  ../lib/$(LIBPREFIX)fltk2_gl$(LIBSUFFIX)
+	echo Linking $@...
+	$(CXX) -I.. $(CXXFLAGS) glpuzzle.o ../lib/$(LIBPREFIX)fltk2_glut$(LIBSUFFIX) $(LINKFLTKGL) $(GLDLIBS) -o $@
+	$(POSTBUILD) $@ ../fltk/mac.r
+
+gl_overlay$(EXEEXT): gl_overlay.o ../lib/$(LIBPREFIX)fltk2_gl$(LIBSUFFIX)
+	echo Linking $@...
+	$(CXX) -I.. $(CXXFLAGS) $< $(LINKFLTKGL) $(GLDLIBS) -o $@
+	$(POSTBUILD) $@ ../fltk/mac.r
+
+mandelbrot$(EXEEXT): mandelbrot.o mandelbrot_ui.o
+	echo Linking $@...
+	$(CXX) -I.. $(CXXFLAGS) mandelbrot.o mandelbrot_ui.o $(LINKFLTK) $(LDLIBS) -o $@
+	$(POSTBUILD) $@ ../fltk/mac.r
+
+shape$(EXEEXT): shape.o ../lib/$(LIBPREFIX)fltk2_gl$(LIBSUFFIX)
+	echo Linking $@...
+	$(CXX) -I.. $(CXXFLAGS) $< $(LINKFLTKGL) $(GLDLIBS) -o $@
+	$(POSTBUILD) $@ ../fltk/mac.r
+
+file_chooser$(EXEEXT): file_chooser.o ../lib/$(LIBPREFIX)fltk2_images$(LIBSUFFIX)
+	echo Linking $@...
+	$(CXX) -I.. $(CXXFLAGS) $< $(LINKFLTKIMG) $(LDLIBS) -o $@
+	$(POSTBUILD) $@ ../fltk/mac.r
+image_file$(EXEEXT): image_file.o ../lib/$(LIBPREFIX)fltk2_images$(LIBSUFFIX)
+	echo Linking $@...
+	$(CXX) -I.. $(CXXFLAGS) $< $(LINKFLTKIMG) $(LDLIBS) -o $@
+	$(POSTBUILD) $@ ../fltk/mac.r
+
+help$(EXEEXT): help.o ../lib/$(LIBPREFIX)fltk2_images$(LIBSUFFIX)
+	echo Linking $@...
+	$(CXX) -I.. $(CXXFLAGS) $< $(LINKFLTKIMG) $(LDLIBS) -o $@
+	$(POSTBUILD) $@ ../fltk/mac.r
+
+
+install:
+uninstall:
+
+
+#
+# End of "$Id: Makefile 8500 2011-03-03 09:20:46Z bgbnbigben $".
+#
+# DO NOT DELETE

Added: branches/branch-3.0/test2/README
===================================================================
--- branches/branch-3.0/test2/README	                        (rev 0)
+++ branches/branch-3.0/test2/README	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,28 @@
+test/README - 20 Oct 1998
+-------------------------
+
+This directory contains tests and demos of FLTK.  In most cases you can
+learn a lot about how to program FLTK by looking at the source code.
+
+Type "make" to compile them all.
+
+The program "demo" is a graphical interface to run all the demos. (you
+may recognize this as a rewrite of an XForms program).
+
+Some of the more interesting programs:
+
+fractals:	A GLUT program with FLTK controls added to it
+
+glpuzzle:	A GLUT program with no modifications
+
+fullscreen:	Demo of how to make your window toggle to fill screen
+
+list_visuals:	necessary to debug X visual stuff
+
+mandelbrot:	A true application, using panels built in Fluid
+
+menubar:	Demo of how FLTK's menus work
+
+forms:		An XForms program to demonstrate emulation
+
+colbrowser:	Another XForms program that is actually useful

Added: branches/branch-3.0/test2/adjuster.cxx
===================================================================
--- branches/branch-3.0/test2/adjuster.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/adjuster.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,69 @@
+//
+// "$Id: adjuster.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $"
+//
+// Adjuster test program for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2006 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+//    http://www.fltk.org/str.php
+//
+
+#include <stdlib.h>
+#include <fltk/run.h>
+#include <fltk/Window.h>
+#include <fltk/Adjuster.h>
+#include <fltk/Box.h>
+#include <fltk/Rectangle.h>
+
+using namespace fltk;
+
+void adjcb(Widget *o, void *v) {
+  Adjuster *a = (Adjuster*)o;
+  Box *b = (Box *)v;
+  a->format((char *)(b->text()));
+  a->redraw();
+}
+
+int main(int, char ** argv) {
+   Window window(320,100,argv[0]);
+
+   char buf1[100];
+   FrameBox b1(fltk::DOWN_BOX,20,30,80,25,buf1);
+   b1.color(fltk::WHITE);
+   Adjuster a1(20+80,30,3*25,25);
+   a1.callback(adjcb,&b1);
+   adjcb(&a1,&b1);
+
+   char buf2[100];
+   FrameBox b2(fltk::DOWN_BOX,20+80+4*25,30,80,25,buf2);
+   b2.color(fltk::WHITE);
+   Adjuster a2(b2.dx()+b2.dw(),10,25,3*25);
+   a2.callback(adjcb,&b2);
+   adjcb(&a2,&b2);
+
+   window.resizable(window);
+   window.end();
+   window.show();
+   return fltk::run();
+}
+
+//
+// End of "$Id: adjuster.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $".
+//

Added: branches/branch-3.0/test2/ansiwidget.cxx
===================================================================
--- branches/branch-3.0/test2/ansiwidget.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/ansiwidget.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,69 @@
+//
+// "$Id: $"
+//
+// AnsiWindow test program for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2006 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+//    http://www.fltk.org/str.php
+//
+
+#include <fltk/run.h>
+#include <fltk/Button.h>
+#include <fltk/Window.h>
+#include <fltk/AnsiWidget.h>
+
+void more_cb(Widget*, void* p) {
+  AnsiWidget* out = (AnsiWidget*)p;
+  for (int i=0; i<10; i++) {
+    out->print("\033[3mitalic\033[23moff\033[4munderline\033[24moff");
+    out->print("\033[7minverse\033[27moff");
+    out->print("\033[1mbold\033[21moff");
+  }
+}
+
+int main(int argc, char **argv) {
+  int w = 210; // must be > 104
+  int h = 200;
+  Window window(w, h);
+  window.begin();
+
+  AnsiWidget out(0, 22, w, h, 11);
+  window.resizable(&out);
+
+  Button* b = new Button(0, 0, 40, 20, "Print");
+  b->callback(more_cb);
+  b->user_data(&out);
+
+  window.end();
+  window.show(argc,argv);
+
+#if USE_X11
+  while (!ready()) {
+    flush();
+    check();
+  }
+#else
+  check();
+#endif
+
+  return run();
+}
+

Added: branches/branch-3.0/test2/arc.cxx
===================================================================
--- branches/branch-3.0/test2/arc.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/arc.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,117 @@
+//
+// "$Id: arc.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $"
+//
+// Arc drawing test program for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2006 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+//    http://www.fltk.org/str.php
+//
+
+#include <config.h> // for  USE_CAIRO definition
+
+#include <fltk/x.h>
+
+#include <fltk/run.h>
+#include <fltk/DoubleBufferWindow.h>
+#include <fltk/ValueSlider.h>
+#include <fltk/draw.h>
+
+float dargs[7] = {90, 90, 100, 100, 0, 360, 0};
+const char* name[7] = {"X", "Y", "W", "H", "start", "end", "rotate"};
+
+using namespace fltk;
+
+class Drawing : public Widget {
+  void draw() {
+    push_clip(0,0, w(), h());
+    setcolor_alpha(BLUE,0.6);
+    fillrect(0,0,w(), h());
+    push_matrix();
+    //    if (dargs[6]) {
+      translate(w()/2.0f, h()/2.0f);
+      rotate(dargs[6]);
+      translate(-w()/2.0f, -h()/2.0f);
+      //}
+    addarc(dargs[0],dargs[1],dargs[2],dargs[3],dargs[4],dargs[5]);
+    closepath();
+    addarc(120,120,40,40,0,-360);
+    setcolor_alpha(GRAY33,0.6);
+    fillstrokepath(WHITE);
+    // draw a hardware circle to see how well rotations match:
+    setcolor(GRAY33);
+    fltk::Rectangle r(20,20,(int)(dargs[2]+1),(int)(dargs[3]+1));
+    addchord(r,dargs[4],dargs[5]);
+    fillstrokepath(WHITE);
+    // now draw non-rotated hardware circle to check if it inscribes:
+    pop_matrix();
+    setcolor_alpha(GRAY40,0.6);
+    r.set(10,(int) (270-dargs[3]),(int) dargs[2],(int)dargs[3]);
+    fillrect(r);
+    setcolor(GRAY90);
+    strokerect(r);
+    setcolor_alpha(RED,0.6);
+    addchord(r,dargs[4],dargs[5]);
+    fillstrokepath(GRAY90);
+    pop_clip();
+  }
+public:
+  Drawing(int X,int Y,int W,int H) : Widget(X,Y,W,H) {}
+};
+
+Drawing *d;
+
+void slider_cb(Widget* o, void* v) {
+  Slider* s = (Slider*)o;
+  dargs[long(v)] = s->value();
+  d->redraw();
+}
+
+int main(int argc, char** argv) {
+  Window window(300,500);
+  window.begin();
+  Drawing drawing(10,10,280,280);
+  d = &drawing;
+
+  int y = 300;
+  for (int n = 0; n<7; n++) {
+    Slider* s =
+      new ValueSlider(50,y,240,25,name[n]); y += 25;
+    if (n<4) {s->minimum(0); s->maximum(300);}
+    else if (n==6) {s->minimum(0); s->maximum(360);}
+    else {s->minimum(-360); s->maximum(360);}
+    s->type(Slider::TICK_ABOVE);
+    s->step(1);
+    s->value(dargs[n]);
+	s->clear_flag(ALIGN_MASK);
+    s->set_flag(ALIGN_LEFT);
+    s->callback(slider_cb, (void*)n);
+  }
+
+  window.end();
+  window.resizable(drawing);
+  window.show(argc,argv);
+  return run();
+}
+
+
+//
+// End of "$Id: arc.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $".
+//

Added: branches/branch-3.0/test2/ask.cxx
===================================================================
--- branches/branch-3.0/test2/ask.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/ask.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,79 @@
+//
+// "$Id: ask.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $"
+//
+// Standard dialog test program for the Fast Light Tool Kit (FLTK).
+//
+// Demonstrates how to use readqueue to see if a button has been
+// pushed, and to see if a window has been closed, thus avoiding
+// the need to define callbacks.
+//
+// This also demonstrates how to trap attempts by the user to
+// close the last window by overriding Fl::exit
+//
+// Copyright 1998-2006 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+//    http://www.fltk.org/str.php
+//
+
+#include <stdio.h>
+#include <string.h>
+#include <FL/Fl.H>
+#include <FL/Fl_Window.H>
+#include <FL/Fl_Input.H>
+#include <FL/Fl_Button.H>
+#include <FL/Fl_Return_Button.H>
+
+#include <FL/fl_ask.H>
+#include <stdlib.h>
+
+void rename_me(Fl_Widget*o) {
+  const char *input = fl_input("Input:", o->label());
+
+  if (input) {
+    o->label(input);
+    o->redraw();
+  }
+}
+
+void window_callback(Fl_Widget*, void*) {
+  if (!fl_ask("Are you sure you want to quit?")) return;
+  exit(0);
+}
+
+int main(int argc, char **argv) {
+  char buffer[128] = "test text";
+
+// this is a test to make sure automatic destructors work.  Pop up
+// the question dialog several times and make sure it don't crash.
+  Fl_Window window(200, 55);
+  Fl_Return_Button b(20, 10, 160, 35, buffer); b.callback(rename_me);
+  window.add(b);
+  window.resizable(&b);
+  window.show(argc, argv);
+
+// Also we test to see if the exit callback works:
+  window.callback(window_callback);
+
+  return Fl::run();
+}
+    
+//
+// End of "$Id: ask.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $".
+//

Added: branches/branch-3.0/test2/bitmap.cxx
===================================================================
--- branches/branch-3.0/test2/bitmap.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/bitmap.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,80 @@
+//
+// "$Id$"
+//
+// Bitmap label test program for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2006 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+//    http://www.fltk.org/str.php
+//
+
+#include <fltk/ToggleButton.h>
+#include <fltk/run.h>
+#include <fltk/Window.h>
+#include <fltk/Button.h>
+#include <fltk/xbmImage.h>
+#include <stdio.h>
+#include "escherknot.xbm"
+
+using namespace fltk;
+
+ToggleButton *leftb,*rightb,*topb,*bottomb,*insideb,*inactb;
+Button *b;
+Window *win;
+
+void button_cb(Widget *,void *) {
+  int i = 0;
+  if (leftb->value()) i |= ALIGN_LEFT;
+  if (rightb->value()) i |= ALIGN_RIGHT;
+  if (topb->value()) i |= ALIGN_TOP;
+  if (bottomb->value()) i |= ALIGN_BOTTOM;
+  if (insideb->value()) i |= ALIGN_INSIDE;
+  b->align(i);
+  if (inactb->value()) b->deactivate();
+  else b->activate();
+  win->redraw();
+}
+
+int main(int argc, char **argv) {
+  win = new Window(400,400);
+  win->begin();
+  b = new Button(140,160,120,120,"Bitmap");
+  b->image(new xbmImage(escherknot_bits,escherknot_width,escherknot_height));
+  leftb = new ToggleButton(25,50,50,25,"left");
+  leftb->callback(button_cb);
+  rightb = new ToggleButton(75,50,50,25,"right");
+  rightb->callback(button_cb);
+  topb = new ToggleButton(125,50,50,25,"top");
+  topb->callback(button_cb);
+  bottomb = new ToggleButton(175,50,50,25,"bottom");
+  bottomb->callback(button_cb);
+  insideb = new ToggleButton(225,50,50,25,"inside");
+  insideb->callback(button_cb);
+  inactb = new ToggleButton(125,75,100,25,"inactive");
+  inactb->callback(button_cb);
+  win->resizable(win);
+  win->end();
+  win->show(argc, argv);
+  return fltk::run();
+}
+
+//
+// End of "$Id$"
+//

Added: branches/branch-3.0/test2/black_1.xbm
===================================================================
--- branches/branch-3.0/test2/black_1.xbm	                        (rev 0)
+++ branches/branch-3.0/test2/black_1.xbm	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,60 @@
+#define black_1_width 56
+#define black_1_height 56
+static unsigned char black_1_bits[] = {
+0x00, 0x00, 0xff, 0x3f, 0x00, 0x00, 0x00, 
+0x00, 0xc0, 0xff, 0xff, 0x00, 0x00, 0x00, 
+0x00, 0xf8, 0xff, 0xff, 0x03, 0x00, 0x00, 
+0x00, 0xfc, 0xff, 0xff, 0x1f, 0x00, 0x00, 
+0x00, 0xfe, 0xff, 0xff, 0x3f, 0x00, 0x00, 
+0x80, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 
+0xc0, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 
+0xe0, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 
+0xe0, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 
+0xf0, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 
+0xf8, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 
+0xfc, 0xff, 0xff, 0xff, 0xff, 0x17, 0x00, 
+0xfc, 0xff, 0xff, 0xff, 0xff, 0x2f, 0x00, 
+0xfc, 0xff, 0xff, 0xff, 0xff, 0x5f, 0x00, 
+0xfe, 0xff, 0xff, 0xff, 0xff, 0xbf, 0x00, 
+0xfe, 0xff, 0xff, 0xff, 0xff, 0x5f, 0x00, 
+0xff, 0xff, 0xff, 0xff, 0xff, 0xbf, 0x00, 
+0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x01, 
+0xff, 0xff, 0xff, 0xff, 0xff, 0xbf, 0x02, 
+0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x01, 
+0xff, 0xff, 0xff, 0xff, 0xff, 0xbf, 0x02, 
+0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x01, 
+0xff, 0xff, 0xff, 0xff, 0xff, 0xbf, 0x02, 
+0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x05, 
+0xff, 0xff, 0xff, 0xff, 0xff, 0xbf, 0x02, 
+0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x05, 
+0xff, 0xff, 0xff, 0xff, 0xff, 0xbf, 0x02, 
+0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x05, 
+0xff, 0xff, 0xff, 0xff, 0xff, 0xbf, 0x02, 
+0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x05, 
+0xfe, 0xff, 0xff, 0xff, 0xff, 0xbf, 0x02, 
+0xfe, 0xff, 0xff, 0xff, 0xff, 0x5f, 0x05, 
+0xfe, 0xff, 0xff, 0xff, 0xff, 0xaf, 0x02, 
+0xfc, 0xff, 0xff, 0xff, 0xff, 0x5f, 0x05, 
+0xf8, 0xff, 0xff, 0xff, 0xff, 0xaf, 0x02, 
+0xf8, 0xff, 0xff, 0xff, 0xff, 0x57, 0x01, 
+0xf8, 0xff, 0xff, 0xff, 0xff, 0xab, 0x02, 
+0xf0, 0xff, 0xff, 0xff, 0xff, 0x55, 0x01, 
+0xe0, 0xff, 0xff, 0xff, 0xff, 0xab, 0x00, 
+0xc0, 0xff, 0xff, 0xff, 0xff, 0x55, 0x01, 
+0x80, 0xff, 0xff, 0xff, 0xff, 0xaa, 0x00, 
+0x00, 0xff, 0xff, 0xff, 0x5f, 0x55, 0x00, 
+0x00, 0xfe, 0xff, 0xff, 0xaf, 0x2a, 0x00, 
+0x00, 0xf4, 0xff, 0xff, 0x57, 0x15, 0x00, 
+0x00, 0xe8, 0xff, 0xff, 0xaa, 0x0a, 0x00, 
+0x00, 0x50, 0xff, 0x7f, 0x55, 0x05, 0x00, 
+0x00, 0xa0, 0xaa, 0xaa, 0xaa, 0x02, 0x00, 
+0x00, 0x40, 0x55, 0x55, 0x55, 0x01, 0x00, 
+0x00, 0x00, 0xaa, 0xaa, 0xaa, 0x00, 0x00, 
+0x00, 0x00, 0x50, 0x55, 0x15, 0x00, 0x00, 
+0x00, 0x00, 0x80, 0xaa, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+};

Added: branches/branch-3.0/test2/black_2.xbm
===================================================================
--- branches/branch-3.0/test2/black_2.xbm	                        (rev 0)
+++ branches/branch-3.0/test2/black_2.xbm	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,60 @@
+#define black_2_width 56
+#define black_2_height 56
+static unsigned char black_2_bits[] = {
+0x00, 0x00, 0x0f, 0x3c, 0x00, 0x00, 0x00, 
+0x00, 0x40, 0x40, 0x81, 0x00, 0x00, 0x00, 
+0x00, 0x10, 0x49, 0x09, 0x02, 0x00, 0x00, 
+0x00, 0x44, 0x52, 0x49, 0x08, 0x00, 0x00, 
+0x00, 0x90, 0x52, 0x25, 0x01, 0x00, 0x00, 
+0x80, 0x94, 0x54, 0x95, 0x44, 0x00, 0x00, 
+0x40, 0x24, 0x01, 0x40, 0x92, 0x00, 0x00, 
+0x20, 0x49, 0xfc, 0x0f, 0x09, 0x01, 0x00, 
+0x00, 0x11, 0x57, 0x35, 0x64, 0x00, 0x00, 
+0x40, 0xc2, 0x00, 0xc0, 0x10, 0x00, 0x00, 
+0x88, 0x64, 0x55, 0x55, 0x89, 0x05, 0x00, 
+0x20, 0x11, 0x00, 0x08, 0x42, 0x00, 0x00, 
+0x44, 0x58, 0x55, 0x55, 0x21, 0x0b, 0x00, 
+0x90, 0x04, 0x80, 0x0a, 0x80, 0x00, 0x00, 
+0x22, 0x56, 0x55, 0x55, 0x45, 0x14, 0x00, 
+0x48, 0x02, 0xa8, 0x2a, 0x00, 0x03, 0x00, 
+0x11, 0x55, 0x55, 0x55, 0x95, 0x28, 0x00, 
+0x21, 0x81, 0xaa, 0x2a, 0x00, 0x26, 0x00, 
+0x8d, 0x55, 0x55, 0x55, 0x15, 0x21, 0x00, 
+0xb1, 0xe0, 0xaa, 0xaa, 0x00, 0x20, 0x00, 
+0x80, 0xf5, 0x55, 0x55, 0x15, 0x07, 0x00, 
+0xbe, 0xf0, 0xab, 0xaa, 0x00, 0x00, 0x00, 
+0x80, 0xf5, 0x55, 0x55, 0x15, 0x1f, 0x00, 
+0xbe, 0xe0, 0xab, 0xaa, 0x02, 0x00, 0x00, 
+0x80, 0xf5, 0x57, 0x55, 0x15, 0x1f, 0x00, 
+0xb8, 0xc0, 0xaf, 0xaa, 0x00, 0x00, 0x00, 
+0x81, 0xd5, 0x57, 0x15, 0x14, 0x23, 0x00, 
+0xa1, 0x80, 0xaf, 0x0a, 0x00, 0x2c, 0x00, 
+0x19, 0xd5, 0x5f, 0x01, 0x14, 0x21, 0x00, 
+0x45, 0x01, 0xaf, 0x00, 0x00, 0x22, 0x00, 
+0x30, 0x56, 0x1f, 0x40, 0x85, 0x04, 0x00, 
+0x8a, 0x02, 0x0e, 0x00, 0x00, 0x11, 0x00, 
+0x40, 0x54, 0x0f, 0x54, 0x45, 0x02, 0x00, 
+0x34, 0x09, 0x04, 0x00, 0x80, 0x08, 0x00, 
+0x80, 0x40, 0x45, 0x55, 0x21, 0x01, 0x00, 
+0x68, 0x04, 0x00, 0x00, 0x48, 0x04, 0x00, 
+0x00, 0x82, 0x55, 0x95, 0x90, 0x00, 0x00, 
+0x80, 0x09, 0x02, 0x20, 0x22, 0x00, 0x00, 
+0x20, 0x24, 0xa8, 0x8a, 0x24, 0x01, 0x00, 
+0x40, 0x92, 0x00, 0x20, 0x89, 0x00, 0x00, 
+0x80, 0x48, 0xaa, 0x4a, 0x4a, 0x00, 0x00, 
+0x00, 0x20, 0xa9, 0x52, 0x02, 0x00, 0x00, 
+0x00, 0x84, 0xa4, 0x92, 0x08, 0x00, 0x00, 
+0x00, 0x10, 0xa4, 0x24, 0x02, 0x00, 0x00, 
+0x00, 0x40, 0xa0, 0x80, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x0f, 0x3c, 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, 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, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+};

Added: branches/branch-3.0/test2/black_3.xbm
===================================================================
--- branches/branch-3.0/test2/black_3.xbm	                        (rev 0)
+++ branches/branch-3.0/test2/black_3.xbm	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,60 @@
+#define black_3_width 56
+#define black_3_height 56
+static unsigned char black_3_bits[] = {
+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, 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, 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, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x40, 0x08, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 
+0x04, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 
+0x00, 0x10, 0x00, 0x00, 0x02, 0x00, 0x00, 
+0x00, 0x20, 0x00, 0x00, 0x01, 0x00, 0x00, 
+0x00, 0x40, 0x00, 0x40, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x01, 0x10, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x54, 0x05, 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, 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, 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, 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, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+};

Added: branches/branch-3.0/test2/black_4.xbm
===================================================================
--- branches/branch-3.0/test2/black_4.xbm	                        (rev 0)
+++ branches/branch-3.0/test2/black_4.xbm	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,60 @@
+#define black_4_width 56
+#define black_4_height 56
+static unsigned char black_4_bits[] = {
+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, 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, 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, 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, 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, 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, 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, 
+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, 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, 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, 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, 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, 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, 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, 
+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, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+};

Added: branches/branch-3.0/test2/blackking_1.xbm
===================================================================
--- branches/branch-3.0/test2/blackking_1.xbm	                        (rev 0)
+++ branches/branch-3.0/test2/blackking_1.xbm	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,60 @@
+#define blackking_1_width 56
+#define blackking_1_height 56
+static unsigned char blackking_1_bits[] = {
+0x00, 0x00, 0xff, 0x3f, 0x00, 0x00, 0x00, 
+0x00, 0xc0, 0xff, 0xff, 0x00, 0x00, 0x00, 
+0x00, 0xf8, 0xff, 0xff, 0x03, 0x00, 0x00, 
+0x00, 0xfc, 0xff, 0xff, 0x1f, 0x00, 0x00, 
+0x00, 0xfe, 0xff, 0xff, 0x3f, 0x00, 0x00, 
+0x80, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 
+0xc0, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 
+0xe0, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 
+0xe0, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 
+0xf0, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 
+0xf8, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 
+0xfc, 0xff, 0xff, 0xff, 0xff, 0x17, 0x00, 
+0xfc, 0xff, 0xff, 0xff, 0xff, 0x2f, 0x00, 
+0xfc, 0xff, 0xff, 0xff, 0xff, 0x5f, 0x00, 
+0xfe, 0xff, 0xff, 0xff, 0xff, 0xbf, 0x00, 
+0xfe, 0xff, 0xff, 0xff, 0xff, 0x5f, 0x01, 
+0xff, 0xff, 0xff, 0xff, 0xff, 0xbf, 0x02, 
+0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x05, 
+0xff, 0xff, 0xff, 0xff, 0xff, 0xbf, 0x0a, 
+0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x15, 
+0xff, 0xff, 0xff, 0xff, 0xff, 0xbf, 0x0a, 
+0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x15, 
+0xff, 0xff, 0xff, 0xff, 0xff, 0xbf, 0x2a, 
+0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x55, 
+0xff, 0xff, 0xff, 0xff, 0xff, 0xbf, 0x2a, 
+0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x55, 
+0xff, 0xff, 0xff, 0xff, 0xff, 0xbf, 0x2a, 
+0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x55, 
+0xff, 0xff, 0xff, 0xff, 0xff, 0xbf, 0xaa, 
+0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x55, 
+0xfe, 0xff, 0xff, 0xff, 0xff, 0xbf, 0xaa, 
+0xfe, 0xff, 0xff, 0xff, 0xff, 0x5f, 0x55, 
+0xfe, 0xff, 0xff, 0xff, 0xff, 0xaf, 0xaa, 
+0xfc, 0xff, 0xff, 0xff, 0xff, 0x5f, 0x55, 
+0xf8, 0xff, 0xff, 0xff, 0xff, 0xaf, 0xaa, 
+0xf8, 0xff, 0xff, 0xff, 0xff, 0x57, 0x55, 
+0xf8, 0xff, 0xff, 0xff, 0xff, 0xab, 0xaa, 
+0xf0, 0xff, 0xff, 0xff, 0xff, 0x55, 0x55, 
+0xe0, 0xff, 0xff, 0xff, 0xff, 0xab, 0xaa, 
+0xc0, 0xff, 0xff, 0xff, 0xff, 0x55, 0x55, 
+0x80, 0xff, 0xff, 0xff, 0xff, 0xaa, 0x2a, 
+0x00, 0xff, 0xff, 0xff, 0x5f, 0x55, 0x55, 
+0x00, 0xfe, 0xff, 0xff, 0xaf, 0xaa, 0x2a, 
+0x00, 0xf4, 0xff, 0xff, 0x57, 0x55, 0x15, 
+0x00, 0xe8, 0xff, 0xff, 0xaa, 0xaa, 0x2a, 
+0x00, 0x50, 0xff, 0x7f, 0x55, 0x55, 0x15, 
+0x00, 0xa0, 0xaa, 0xaa, 0xaa, 0xaa, 0x0a, 
+0x00, 0x40, 0x55, 0x55, 0x55, 0x55, 0x05, 
+0x00, 0x80, 0xaa, 0xaa, 0xaa, 0xaa, 0x02, 
+0x00, 0x00, 0x55, 0x55, 0x55, 0x55, 0x01, 
+0x00, 0x00, 0xaa, 0xaa, 0xaa, 0xaa, 0x00, 
+0x00, 0x00, 0x54, 0x55, 0x55, 0x55, 0x00, 
+0x00, 0x00, 0xa8, 0xaa, 0xaa, 0x2a, 0x00, 
+0x00, 0x00, 0x40, 0x55, 0x55, 0x15, 0x00, 
+0x00, 0x00, 0x00, 0xaa, 0xaa, 0x02, 0x00, 
+0x00, 0x00, 0x00, 0x50, 0x15, 0x00, 0x00, 
+};

Added: branches/branch-3.0/test2/blackking_2.xbm
===================================================================
--- branches/branch-3.0/test2/blackking_2.xbm	                        (rev 0)
+++ branches/branch-3.0/test2/blackking_2.xbm	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,60 @@
+#define blackking_2_width 56
+#define blackking_2_height 56
+static unsigned char blackking_2_bits[] = {
+0x00, 0x00, 0x0f, 0x3c, 0x00, 0x00, 0x00, 
+0x00, 0x40, 0x40, 0x81, 0x00, 0x00, 0x00, 
+0x00, 0x10, 0x49, 0x09, 0x02, 0x00, 0x00, 
+0x00, 0x44, 0x52, 0x49, 0x08, 0x00, 0x00, 
+0x00, 0x90, 0x52, 0x25, 0x01, 0x00, 0x00, 
+0x80, 0x94, 0x54, 0x95, 0x44, 0x00, 0x00, 
+0x40, 0x24, 0x01, 0x40, 0x92, 0x00, 0x00, 
+0x20, 0x49, 0xfc, 0x0f, 0x09, 0x01, 0x00, 
+0x00, 0x11, 0x57, 0x35, 0x64, 0x00, 0x00, 
+0x40, 0xc2, 0x00, 0xc0, 0x10, 0x00, 0x00, 
+0x88, 0x64, 0xd5, 0x55, 0x89, 0x05, 0x00, 
+0x20, 0x11, 0xc0, 0x00, 0x42, 0x00, 0x00, 
+0x44, 0x58, 0x57, 0x74, 0x21, 0x0b, 0x00, 
+0x90, 0x04, 0x03, 0x30, 0x80, 0x00, 0x00, 
+0x22, 0x76, 0x51, 0x15, 0x47, 0x14, 0x00, 
+0x48, 0x32, 0x08, 0x02, 0x03, 0x03, 0x00, 
+0x11, 0x15, 0x5d, 0x57, 0x91, 0x28, 0x00, 
+0x21, 0x01, 0x0c, 0x03, 0x00, 0x26, 0x00, 
+0x8d, 0x55, 0xcf, 0xd3, 0x15, 0x21, 0x00, 
+0xb1, 0x18, 0x86, 0xe1, 0x00, 0x20, 0x00, 
+0x80, 0x5d, 0xd7, 0x75, 0x11, 0x07, 0x00, 
+0xbe, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x80, 0x75, 0x55, 0x55, 0x11, 0x1f, 0x00, 
+0xbe, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x80, 0x75, 0x55, 0x55, 0x10, 0x1f, 0x00, 
+0xb8, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x81, 0x75, 0x55, 0x55, 0x14, 0x23, 0x00, 
+0xa1, 0x60, 0x00, 0x00, 0x00, 0x2c, 0x00, 
+0x19, 0xd5, 0x55, 0x55, 0x14, 0x21, 0x00, 
+0x45, 0xc1, 0x00, 0x00, 0x00, 0x22, 0x00, 
+0x30, 0xd6, 0x00, 0x00, 0x85, 0x04, 0x00, 
+0x8a, 0x82, 0x00, 0x00, 0x00, 0x11, 0x00, 
+0x40, 0x54, 0x00, 0x00, 0x45, 0x02, 0x00, 
+0x34, 0x09, 0x00, 0x00, 0x80, 0x08, 0x00, 
+0x80, 0x40, 0x55, 0x55, 0x21, 0x01, 0x00, 
+0x68, 0x04, 0x00, 0x00, 0x48, 0x04, 0x00, 
+0x00, 0x82, 0x55, 0x95, 0x90, 0x00, 0x00, 
+0x80, 0x09, 0x02, 0x20, 0x22, 0x00, 0x00, 
+0x20, 0x24, 0xa8, 0x8a, 0x24, 0x01, 0x00, 
+0x40, 0x92, 0x00, 0x20, 0x89, 0x00, 0x00, 
+0x80, 0x48, 0xaa, 0x4a, 0x4a, 0x00, 0x00, 
+0x00, 0x20, 0xa9, 0x52, 0x02, 0x00, 0x00, 
+0x00, 0x84, 0xa4, 0x92, 0x08, 0x00, 0x00, 
+0x00, 0x10, 0xa4, 0x24, 0x02, 0x00, 0x00, 
+0x00, 0x40, 0xa0, 0x80, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x0f, 0x3c, 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, 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, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+};

Added: branches/branch-3.0/test2/blackking_3.xbm
===================================================================
--- branches/branch-3.0/test2/blackking_3.xbm	                        (rev 0)
+++ branches/branch-3.0/test2/blackking_3.xbm	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,60 @@
+#define blackking_3_width 56
+#define blackking_3_height 56
+static unsigned char blackking_3_bits[] = {
+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, 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, 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, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x40, 0x08, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 
+0x04, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 
+0x00, 0x10, 0x00, 0x00, 0x02, 0x00, 0x00, 
+0x00, 0x20, 0x00, 0x00, 0x01, 0x00, 0x00, 
+0x00, 0x40, 0x00, 0x40, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x01, 0x10, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x54, 0x05, 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, 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, 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, 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, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+};

Added: branches/branch-3.0/test2/blackking_4.xbm
===================================================================
--- branches/branch-3.0/test2/blackking_4.xbm	                        (rev 0)
+++ branches/branch-3.0/test2/blackking_4.xbm	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,60 @@
+#define blackking_4_width 56
+#define blackking_4_height 56
+static unsigned char blackking_4_bits[] = {
+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, 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, 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, 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, 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, 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, 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, 
+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, 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, 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, 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, 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, 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, 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, 
+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, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+};

Added: branches/branch-3.0/test2/boxtype.cxx
===================================================================
--- branches/branch-3.0/test2/boxtype.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/boxtype.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,101 @@
+//
+// "$Id: boxtype.cxx 5810 2007-05-11 22:44:12Z spitzak $"
+//
+// Boxtype test program for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-1999 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems to "fltk-bugs@easysw.com".
+//
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <fltk/run.h>
+#include <fltk/Window.h>
+#include <fltk/InvisibleBox.h>
+
+int N = 0;
+#define W 150
+#define H 50
+#define ROWS 6
+
+fltk::Widget* bt(const char *name, fltk::Box* type, int square=0) {
+    int x = N%4;
+    int y = N/4;
+    N++;
+    x = x*W+10;
+    y = y*H+10;
+    fltk::Widget *b = new fltk::InvisibleBox(type,x,y,square ? H-20 : W-20,H-20,name);
+    b->labelsize(11);
+    if (square) {
+	b->clear_flag(fltk::ALIGN_MASK);
+	b->set_flag(fltk::ALIGN_RIGHT);
+    }
+    return b;
+}
+
+int main(int argc, char ** argv) {
+    fltk::Window window(4*W,ROWS*H);
+    window.color(12);// light blue
+    window.begin();
+    bt("fltk::NO_BOX",fltk::NO_BOX);
+    bt("fltk::FLAT_BOX",fltk::FLAT_BOX);
+    //  N += 2; // go to start of next row to line up boxes & frames
+    bt("fltk::UP_BOX",fltk::UP_BOX);
+    bt("fltk::DOWN_BOX",fltk::DOWN_BOX);
+    //  bt("fltk::UP_FRAME",fltk::UP_FRAME);
+    //  bt("fltk::DOWN_FRAME",fltk::DOWN_FRAME);
+    bt("fltk::THIN_UP_BOX",fltk::THIN_UP_BOX);
+    bt("fltk::THIN_DOWN_BOX",fltk::THIN_DOWN_BOX);
+    //  bt("fltk::THIN_UP_FRAME",fltk::THIN_UP_FRAME);
+    //  bt("fltk::THIN_DOWN_FRAME",fltk::THIN_DOWN_FRAME);
+    bt("fltk::ENGRAVED_BOX",fltk::ENGRAVED_BOX);
+    bt("fltk::EMBOSSED_BOX",fltk::EMBOSSED_BOX);
+    //  bt("fltk::ENGRAVED_FRAME",fltk::ENGRAVED_FRAME);
+    //  bt("fltk::EMBOSSED_FRAME",fltk::EMBOSSED_FRAME);
+    bt("fltk::ROUND_UP_BOX",fltk::ROUND_UP_BOX);
+    bt("fltk::ROUND_DOWN_BOX",fltk::ROUND_DOWN_BOX);
+    bt("fltk::DIAMOND_UP_BOX",fltk::DIAMOND_UP_BOX);
+    bt("fltk::DIAMOND_DOWN_BOX",fltk::DIAMOND_DOWN_BOX);
+    //  bt("fltk::BORDER_FRAME",fltk::BORDER_FRAME);
+    //  bt("fltk::SHADOW_FRAME",fltk::SHADOW_FRAME);
+    bt("fltk::BORDER_BOX",fltk::BORDER_BOX);
+    bt("fltk::ROUNDED_BOX",fltk::ROUNDED_BOX);
+    bt("fltk::RSHADOW_BOX",fltk::RSHADOW_BOX);
+    //  bt("fltk::ROUNDED_FRAME",fltk::ROUNDED_FRAME);
+    bt("fltk::RFLAT_BOX",fltk::RFLAT_BOX);
+    bt("fltk::SHADOW_BOX",fltk::SHADOW_BOX);
+    bt("fltk::OVAL_BOX",fltk::OVAL_BOX);
+    bt("fltk::OSHADOW_BOX",fltk::OSHADOW_BOX);
+    //  bt("fltk::OVAL_FRAME",fltk::OVAL_FRAME);
+    bt("fltk::OFLAT_BOX",fltk::OFLAT_BOX);
+    //    bt("fltk::PLASTIC_UP_BOX", fltk::PLASTIC_UP_BOX);
+    //    bt("fltk::PLASTIC_DOWN_BOX", fltk::PLASTIC_DOWN_BOX);
+    //    bt("fltk::FOCUS_FRAME", fltk::FOCUS_FRAME);
+    bt("fltk::BORDER_FRAME", fltk::BORDER_FRAME);
+    bt("fltk::PLASTIC_UP_BOX", fltk::PLASTIC_UP_BOX)->color(12);
+    bt("fltk::PLASTIC_DOWN_BOX", fltk::PLASTIC_DOWN_BOX)->color(12);
+    window.resizable(window);
+    window.end();
+    window.show(argc,argv);
+    return fltk::run();
+}
+
+//
+// End of "$Id: boxtype.cxx 5810 2007-05-11 22:44:12Z spitzak $".
+//

Added: branches/branch-3.0/test2/browser.cxx
===================================================================
--- branches/branch-3.0/test2/browser.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/browser.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,374 @@
+//
+// "$Id: browser.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $"
+//
+// browser.cxx
+// Maarten de Boer's toggle tree demo program rewritten to use the
+// fltk 2.0 browser.  This unfortunately required a bunch of changes.
+//
+// Copyright 1998-2006 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+//    http://www.fltk.org/str.php
+//
+
+#include <fltk/Browser.h>
+#include <fltk/Window.h>
+#include <fltk/Button.h>
+#include <fltk/CheckButton.h>
+#include <fltk/RadioButton.h>
+#include <fltk/Input.h>
+#include <fltk/ValueSlider.h>
+#include <fltk/run.h>
+#include <fltk/events.h>
+#include <fltk/MenuBuild.h>
+#include <fltk/ask.h>
+#include <fltk/xpmImage.h>
+#include <fltk/MultiImage.h>
+
+#include <pixmaps/folder_small.xpm>
+#include <pixmaps/folder_small2.xpm>
+#include <pixmaps/folder_small3.xpm>
+#include <pixmaps/file_small.xpm>
+#include <pixmaps/file_small2.xpm>
+#include <pixmaps/book.xpm>
+#include "porsche.xpm"
+
+#include <stdio.h>
+#include <stdlib.h>
+
+using namespace fltk;
+
+xpmImage folderSmall(folder_small);
+xpmImage folderSmall2(folder_small2);
+xpmImage folderSmall3(folder_small3);
+xpmImage fileSmall(file_small);
+xpmImage fileSmall2(file_small2);
+xpmImage bookImg(book);
+xpmImage customImage(porsche_xpm);
+
+void cb_test(Widget* browser, void*) {
+  Browser *b = (Browser*)browser;
+  Widget* w = b->item();
+  printf("Callback, b->item() = '%s'",
+	 w && w->label() ? w->label() : "null");
+  if (event_clicks()) printf(", Double Click");
+  printf("\n");
+  if (b->selected_column()!= Browser::NO_COLUMN_SELECTED )
+      fltk::message("Column %d selected\n", b->selected_column()+1);
+}
+
+void cb_remove(Widget*, void* ptr) {
+  Browser* tree = (Browser*) ptr;
+  if (tree->type() & Browser::IS_MULTI) {
+    Widget* w = tree->goto_top();
+    while (w) {
+      if (w->selected()) { // test for parent being open
+	Group* g = w->parent();
+	g->remove(w);
+	delete w;
+	g->relayout();
+	w = tree->goto_top();
+      } else {
+	w = tree->next();
+      }
+    }
+  } else {
+    Widget* w = tree->goto_focus();
+    if (w) {
+      Group* g = w->parent();
+      g->remove(w);
+      delete w;
+      g->relayout();
+    }
+  }
+}
+
+void cb_multi(Button* w, void* ptr) {
+  Browser* tree = (Browser*) ptr;
+  tree->type(w->value() ? Browser::MULTI : Browser::NORMAL);
+  tree->relayout();
+}
+
+static Group* current_group(Browser* tree) {
+  Widget* w = tree->goto_focus();
+  if (!w) return tree;
+  if (w->is_group() && w->flag(fltk::OPENED)) return (Group*)w;
+  return w->parent() ? w->parent() : tree;
+}
+
+void cb_add_folder(Widget*, void* ptr) {
+  Browser* tree = (Browser*) ptr;
+  tree->add_group("Added folder", current_group(tree));
+  tree->relayout();
+}
+
+void cb_add_paper(Widget*, void* ptr) {
+  Browser* tree = (Browser*) ptr;
+  tree->add_leaf("New paper\t@rt2.col\t3.col", current_group(tree));
+  tree->relayout();
+}
+
+void cb_when_changed(Button* b, void* ptr) {
+  Browser* tree = (Browser*)ptr;
+  if (b->value())
+    tree->when(tree->when()|fltk::WHEN_CHANGED);
+  else
+    tree->when(tree->when()&~fltk::WHEN_CHANGED);
+}
+
+void cb_when_release(Button* b, void* ptr) {
+  Browser* tree = (Browser*)ptr;
+  if (b->value())
+    tree->when(tree->when()|fltk::WHEN_RELEASE);
+  else
+    tree->when(tree->when()&~fltk::WHEN_RELEASE);
+}
+
+void cb_when_not_changed(Button* b, void* ptr) {
+  Browser* tree = (Browser*)ptr;
+  if (b->value())
+    tree->when(tree->when()|fltk::WHEN_NOT_CHANGED);
+  else
+    tree->when(tree->when()&~fltk::WHEN_NOT_CHANGED);
+}
+
+void cb_when_enter_key(Button* b, void* ptr) {
+  Browser* tree = (Browser*)ptr;
+  if (b->value())
+    tree->when(tree->when()|fltk::WHEN_ENTER_KEY);
+  else
+    tree->when(tree->when()&~fltk::WHEN_ENTER_KEY);
+}
+
+void button_cb(Widget* b, void *) {
+  printf("Button %s pushed\n", b->label());
+}
+
+const char *labels[] = {"Column 1", "Column 2\nwith new\nlines", "Column 3", 0};
+int widths[]   = {100, 70, 70, 0};
+
+Browser *browser=0;
+bool flip = false;
+bool bm = true;
+bool dlines = true;
+
+MultiImage g1(fileSmall, HIGHLIGHT, fileSmall2);
+MultiImage g2(folderSmall, HIGHLIGHT, folderSmall3);
+MultiImage g3(fileSmall2, HIGHLIGHT, fileSmall);
+MultiImage g4(folderSmall2, OPENED, folderSmall3, HIGHLIGHT, folderSmall);
+MultiImage g5(folderSmall2, OPENED, folderSmall3);
+
+void update_look() {
+  if (bm) {
+    if (flip) {
+      browser->leaf_symbol(&g1);
+      browser->group_symbol(&g2);
+    } else {
+      browser->leaf_symbol(&g3);
+      browser->group_symbol(&g4);
+    }
+  } else {
+    if (flip) {
+      browser->leaf_symbol(&fileSmall);
+      browser->group_symbol(&folderSmall);
+    } else {
+      browser->leaf_symbol(&fileSmall2);
+      browser->group_symbol(&g5);
+    }
+  }
+  browser->relayout();
+}
+
+// callback for changing dynamically the look of the tree browser 
+void cb_change_look(Widget*, void* ptr) {
+  flip = !flip;
+  update_look();
+}
+
+// callback for deactivate/activate the belowmouse img change
+void below_mouse_cb(Button *w, long arg) {
+  bm = w->value();
+  update_look();
+}
+
+void display_lines_cb(Widget* w, void* ptr_arg) {
+  Browser* tree = reinterpret_cast<Browser*>(ptr_arg);
+  dlines = !dlines;
+  tree->display_lines(dlines);
+  tree->relayout();
+}
+
+void change_resize(Button *w, long arg) {
+  if (w->value()) 
+    widths[1] = -1;
+  else
+    widths[1] = 70; 
+  browser->column_widths(widths);
+}
+
+int main(int argc,char** argv) {
+
+  Window win(280, 340, "Browser Example");
+  win.begin();
+
+  Browser tree(10, 10, 260, 180);
+  tree.indented(1);
+  tree.callback(cb_test);
+
+  browser = &tree;
+  tree.column_widths(widths);
+  tree.column_labels(labels);
+  
+  Button remove_button(5, 200, 80, 22, "Remove");
+  remove_button.callback((Callback*)cb_remove, (void *)&tree);
+
+  Button add_paper_button(5, 224, 80, 22, "Add Paper");
+  add_paper_button.callback((Callback*)cb_add_paper, (void *)&tree);
+
+  Button add_folder_button(5, 248, 80, 22, "Add Folder");
+  add_folder_button.callback((Callback*)cb_add_folder, (void *)&tree);
+
+  Button change_look_button(5, 272, 80, 22, "Change Look!");
+  change_look_button.callback((Callback*)cb_change_look , (void *)&tree);
+
+  CheckButton multi_button(88, 200, 160, 20, "Browser::MULTI");
+  multi_button.callback((Callback*)cb_multi, (void *)&tree);
+
+  CheckButton when_changed_button(88, 220, 160, 20, "WHEN_CHANGED");
+  when_changed_button.callback((Callback*)cb_when_changed, (void *)&tree);
+
+  CheckButton when_not_changed_button(88, 240, 160, 20, "WHEN_NOT_CHANGED");
+  when_not_changed_button.callback((Callback*)cb_when_not_changed, (void *)&tree);
+
+  CheckButton when_release_button(88, 260, 160, 20, "WHEN_RELEASE");
+  when_release_button.callback((Callback*)cb_when_release, (void *)&tree);
+  when_release_button.set_flag(fltk::STATE);
+
+  CheckButton when_enter_key_button(88, 280, 160, 20, "WHEN_ENTER_KEY");
+  when_enter_key_button.callback((Callback*)cb_when_enter_key, (void *)&tree);
+
+  // Let's show how to show/hide lines in the Browser (tree) widget
+  CheckButton display_lines(88, 300, 160, 20, "Display lines");
+  display_lines.value(true);
+  display_lines.callback((Callback*)display_lines_cb, (void *)&tree);
+
+  CheckButton resize(108, 320, 160, 20, "Make 2. column flexible");
+  resize.callback((Callback*)change_resize);
+
+  CheckButton bm(5, 320, 82, 20, "below mouse");
+  bm.set();
+  bm.callback((Callback*)below_mouse_cb);
+
+  win.resizable(tree);
+  win.end();
+
+#if USE_STRING_LIST
+  //tree.list(new String_List("alpha\0beta\0ceta\0delta\0red\0green\0blue\0"));
+  tree.list(new String_List(strings, sizeof(strings)/sizeof(*strings)));
+  //tree.list(new String_List(strings));
+#else
+
+  // defining default images for nodes
+  cb_change_look(0, &tree);
+
+  // Add some nodes with icons -- some open, some closed.
+  Group* g;
+  g = tree.add_group ("aaa\t2.col\t3.col", &tree);
+  tree.add_group ("bbb TWO\t2.col\t3.col", g);
+
+  g = tree.add_group ("bbb", &tree);
+  tree.add_leaf("ccc\t789", g); 
+  tree.add_leaf("ddd\t012", g); 
+
+  
+  g = tree.add_group("eee", &tree);
+  tree.add_leaf("fff", &tree)->image(customImage); // let's have fun with a custom image
+					    // while demonstrating different height nodes
+  g = tree.add_group("ggg", g);
+  tree.add_leaf("hhh", g); // g decl is not even necessary for next children
+  tree.add_leaf("iii", g); // I let it for keeping API orthogonality
+
+  g = tree.add_group("jjj",&tree);
+  tree.add_leaf("kkk",g);
+
+  tree.add_leaf("lll");
+ tree.add_leaf("zut");
+
+  g = tree.add_group("mmm", &tree, 0); // let this node closed
+  tree.add_leaf("nnn",g);
+  tree.add_leaf("ooo",g);
+
+  g = tree.add_group("ppp", g);
+  tree.add_leaf("qqq",g);
+
+  g = tree.add_group("rrr", g); // more imbricated groups 
+  g = tree.add_group("sss", g);
+  g = tree.add_group("ttt", g);
+
+  g = tree.add_group("uuu", &tree);
+  tree.add_leaf("vvv", g);
+  tree.add_leaf("www", g);
+
+  tree.add_leaf("yyy", g);
+  tree.add_leaf("zzz", g);
+
+
+  // add some widgets:
+  Button * b = new Button(0,0,100,23,"button");
+  b->callback(button_cb);
+#if 0
+  // fabien: creating the CheckButton below will still mess up the drawing ... 
+  //   have to be fixed, but not in the browser i think.
+  b = new CheckButton(0,0,100,23,"CheckButton");
+
+  printf("b->type = %d, group = %d, is_group = %d\n",
+	 b->type(), Widget::GROUP_TYPE, b->is_group());
+  b->callback(button_cb);
+#endif
+  new Input(0,0,200,23,"Input:");
+  new ValueSlider(0,0,200,23,"Input1:");
+  new ValueSlider(0,0,200,23,"Input2:");
+  new ValueSlider(0,0,200,23,"Input3:");
+  tree.end();
+
+
+#if 0
+  // Examples of removing items (successfully, and unsuccessfully)
+  // by label name:
+  if (&tree.remove("xxx"))
+    printf("Successfully deleted \"xxx\"\n");
+  else
+    printf("Could not delete \"xxx\"\n");
+
+  if (&tree.remove("nonexistant"))
+    printf("Successfully deleted \"nonexistant\"\n");
+  else
+    printf("Could not delete \"nonexistant\"\n");
+#endif
+#endif
+
+  tree.select(tree.find( "fff" ),1);
+
+  win.show(argc,argv);
+ 
+  run();
+  return 0;
+}
+
+// End of "$Id: browser.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $"

Added: branches/branch-3.0/test2/browserop.cxx
===================================================================
--- branches/branch-3.0/test2/browserop.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/browserop.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,110 @@
+//
+// "$Id: browserop.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $"
+//
+// Browser operation test program for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2006 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+//    http://www.fltk.org/str.php
+//
+
+#include "forms.h"
+
+FL_FORM *form;
+FL_OBJECT *browserobj, *inputobj, *exitobj;
+
+void addit(FL_OBJECT *, long)
+{
+  /* append and show the last line. Don't use this if you just want
+   * to add some lines. use fl_add_browser_line
+   */
+  fl_addto_browser(browserobj,fl_get_input(inputobj));
+}
+
+void insertit(FL_OBJECT *, long)
+{
+  int n;
+  if (! ( n = fl_get_browser(browserobj))) return;
+  fl_insert_browser_line(browserobj,n,fl_get_input(inputobj));
+}
+
+void replaceit(FL_OBJECT *, long)
+{
+  int n;
+  if (! (n=fl_get_browser(browserobj))) return;
+  fl_replace_browser_line(browserobj,n,fl_get_input(inputobj));
+}
+
+void deleteit(FL_OBJECT *, long)
+{
+  int n;
+  if (! (n = fl_get_browser(browserobj))) return;
+  fl_delete_browser_line(browserobj,n);
+}
+
+void clearit(FL_OBJECT *, long)
+{
+  fl_clear_browser(browserobj);
+}
+
+/*---------------------------------------*/
+
+void create_form(void)
+{
+  FL_OBJECT *obj;
+
+  form = fl_bgn_form(FL_UP_BOX,390,420);
+  browserobj = fl_add_browser(FL_HOLD_BROWSER,20,20,210,330,"");
+//  fl_set_object_dblbuffer(browserobj, 1);
+  inputobj = obj = fl_add_input(FL_NORMAL_INPUT,20,370,210,30,"");
+    fl_set_object_callback(obj,addit,0);
+    obj->when(FL_WHEN_ENTER_KEY|FL_WHEN_NOT_CHANGED);
+  obj = fl_add_button(FL_NORMAL_BUTTON,250,20,120,30,"Add");
+    fl_set_object_callback(obj,addit,0);
+  obj = fl_add_button(FL_NORMAL_BUTTON,250,60,120,30,"Insert");
+    fl_set_object_callback(obj,insertit,0);
+  obj = fl_add_button(FL_NORMAL_BUTTON,250,100,120,30,"Replace");
+    fl_set_object_callback(obj,replaceit,0);
+  obj = fl_add_button(FL_NORMAL_BUTTON,250,160,120,30,"Delete");
+    fl_set_object_callback(obj,deleteit,0);
+  obj = fl_add_button(FL_NORMAL_BUTTON,250,200,120,30,"Clear");
+    fl_set_object_callback(obj,clearit,0);
+  exitobj = fl_add_button(FL_NORMAL_BUTTON,250,370,120,30,"Exit");
+  fl_end_form();
+}
+
+/*---------------------------------------*/
+
+int
+main(int argc, char *argv[])
+{
+  FL_OBJECT *obj;
+
+  fl_initialize(&argc, argv, "FormDemo", 0, 0);
+  create_form();
+  fl_show_form(form,FL_PLACE_CENTER,FL_TRANSIENT,"Browser Op");
+  do obj = fl_do_forms(); while (obj != exitobj);
+  fl_hide_form(form);
+  return 0;
+}
+
+//
+// End of "$Id: browserop.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $".
+//

Added: branches/branch-3.0/test2/button.cxx
===================================================================
--- branches/branch-3.0/test2/button.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/button.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,47 @@
+// button.cxx (example2a)
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <fltk/run.h>
+#include <fltk/Window.h>
+#include <fltk/Button.h>
+#include <fltk/InvisibleBox.h>
+#include <fltk/TiledImage.h>
+#include <fltk/SharedImage.h>
+using namespace fltk;
+
+void beepcb(Widget *, void *) {
+  printf("\007"); fflush(stdout);
+}
+
+void exitcb(Widget *, void *) {
+  exit(0);
+}
+
+int main(int argc, char ** argv) {
+  register_images();
+  Window *window = new Window(320,65);
+
+  window->begin();
+  Group* ib = new Group(0,0,window->w(),window->h());
+  ib->begin();
+  ib->image(new TiledImage(SharedImage::get("./images/bg.jpeg")));
+  window->resizable(ib);
+
+  Button *b1 = new Button(20, 20, 80, 25, "&Beep");
+  b1->callback(beepcb,0);
+  
+  Button *b2 = new Button(120,20, 80, 25, "");
+  b2->image(new TiledImage(SharedImage::get("./images/coucou.png")));
+
+  Button *b3 = new Button(220,20, 80, 25, "E&xit");
+  b3->callback(exitcb,0);
+  ib->end();
+  window->end();
+  window->show(argc,argv);
+  return run();
+}
+
+//
+// End of "$Id: button.cxx 5465 2006-09-19 03:21:56Z spitzak $".
+//

Added: branches/branch-3.0/test2/buttons.cxx
===================================================================
--- branches/branch-3.0/test2/buttons.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/buttons.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,159 @@
+//
+// "$Id: buttons.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $"
+//
+// Draws the image for the manual
+//
+// Copyright 1998-2006 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+//    http://www.fltk.org/str.php
+//
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <fltk/run.h>
+#include <fltk/Window.h>
+#include <fltk/Button.h>
+#include <fltk/ToggleButton.h>
+#include <fltk/ReturnButton.h>
+#include <fltk/RepeatButton.h>
+#include <fltk/CheckButton.h>
+#include <fltk/RadioButton.h>
+#include <fltk/LightButton.h>
+#include <fltk/HighlightButton.h>
+#include <fltk/MultiImage.h>
+#include <fltk/xpmImage.h>
+#include <fltk/SharedImage.h>
+
+#include <pixmaps/folder_small.xpm>
+#include <pixmaps/folder_small2.xpm>
+#include <pixmaps/folder_small3.xpm>
+
+using namespace fltk;
+
+Button * abutton=0;
+MultiImage* multi;
+
+void cb_active_butt(Widget*, void*) {
+    static bool flip = true;
+    if (flip) abutton->activate(); else abutton->deactivate();
+    abutton->label(flip ? "Active" : "Inactive");
+    flip = !flip;
+
+  abutton->redraw();
+}
+
+void rb_cb(Widget*, void*) {
+  static bool flip = false;
+  if (flip) { //  Fl::theme("essai");
+      reset_theme();
+  } else {
+    // Default Style handling for changing the scheme of all widget at once
+    Button::default_style->box_ = fltk::PLASTIC_UP_BOX;
+    Button::default_style->color_ = 256-36;
+    Widget::default_style->highlight_color(3);
+  }
+  flip = !flip;
+  redraw();
+}
+
+const int W = 150;
+const int H = 24;
+const int B = 10;
+const int X0 = B;
+const int X1 = (B+W+B);
+
+int main(int argc, char ** argv) {
+  Window window(X1+W+B, B+7*(H+B));
+  window.begin();
+  
+  xpmImage fold1(folder_small);
+  xpmImage fold3(folder_small3);
+
+  xpmImage fold2(folder_small2);
+#if !defined(TESTIMAGES)
+  xpmImage ifold2(folder_small2); // use closed folder 2 as inactive image
+#else
+  register_images();
+  SharedImage& ifold2 = *SharedImage::get("images/testimg2.jpg");
+  //SharedImage& ifold2 = *SharedImage::get("images/coucou.png"); 
+#endif
+  // ifold2.inactive();
+  // WAS: inactive() is nyi but should not be a problem with new Image...
+  MultiImage push_release_img(fold2, PUSHED, fold3);
+  MultiImage push_release_hlt_img(fold2, HIGHLIGHT, fold1, PUSHED, fold3);
+  
+  int Y = B;
+  (void) new Button(X0, Y, W, H, "Button");
+  ReturnButton* rb = new ReturnButton(X1, Y, W, H, "Flip theme");
+  rb->callback(rb_cb);
+  rb->tooltip("Push this to revert style to fltk defaults");
+  Y += H+B;
+  (void) new ToggleButton(X0, Y, W, H, "ToggleButton");
+  (void) new RadioButton(X1, Y, W, H, "RadioButton");
+  Y += H+B;
+  (void) new RepeatButton(X0, Y, W, H, "RepeatButton");
+  (void) new RadioButton(X1, Y, W, H, "RadioButton");
+  Y += H+B;
+  (void) new LightButton(X0, Y, W, H, "LightButton");
+  (void) new RadioButton(X1, Y, W, H, "RadioButton");
+  Y += H+B;
+  // The box of the higlight button will appear when belowmouse
+  // when combined with image() as below, you get the border + the image appearing when belowmouse()
+
+  //HighlightButton* hb = 
+      new HighlightButton(X0, Y, W, H, "HighlightButton");
+
+  new CheckButton(X1, Y, W, H, "CheckButton");
+
+  Y += H+B;
+  Button * b = new Button(X0, Y, W, H, "push/release img");
+  b->image(push_release_img); // use default & pushed img
+  b = new Button(X1, Y, W, H, "push/rel noborder");
+  b->image(push_release_img); // use default & pushed img
+  b->box(NO_BOX);
+  
+  Y += H+B;
+  b = new HighlightButton(X0, Y, W, H, "Everything !");
+  // to remove the  belowmouse changing image comment this line:
+  b->image(push_release_hlt_img);
+  b->callback(cb_active_butt);
+#if !defined(TESTIMAGES)
+  abutton = b = new Button(X1, Y, W, H, "Inactive");
+  multi = new MultiImage(fold2,  fltk::PUSHED, fold3,fltk::INACTIVE, ifold2);
+  b->image(multi); 
+#else
+  abutton = b = new Button(X1, Y, W, H*2, "Inactive");
+  multi = new MultiImage(fold2,  fltk::PUSHED, fold3,fltk::INACTIVE, ifold2);
+  b->image(&fold2,&ifold2);
+#endif
+  b->activate(0);  
+
+  window.resizable(window);
+  window.end();
+  window.show(argc,argv);
+
+  rb_cb(0,0);  // Default Style handling for changing the scheme of all widget at once
+
+  return run();
+}
+
+//
+// End of "$Id: buttons.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $".
+//

Added: branches/branch-3.0/test2/cairo.cxx
===================================================================
--- branches/branch-3.0/test2/cairo.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/cairo.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,178 @@
+//
+// "$Id: arc.cxx 5115 2006-05-12 16:00:00Z fabien $"
+//
+// Arc drawing test program for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2006 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+//    http://www.fltk.org/str.php
+//
+
+#include <config.h>
+
+#if USE_CAIRO
+
+#include <fltk/run.h>
+#include <fltk/x.h>
+#include <fltk/DoubleBufferWindow.h>
+#include <fltk/ValueSlider.h>
+#include <fltk/draw.h>
+#include <fltk/math.h>
+
+#define DEF_WIDTH 0.03
+
+using namespace fltk;
+
+// put your drawing stuff here
+float drawargs[7] = {90, 90, 100, 100, 0, 360, 0};
+const char* name[7] = {"X", "Y", "W", "H", "start", "end", "rotate"};
+
+
+void centered_text(cairo_t* cr, double x0,double y0,double w0,double h0, const char * my_text) {
+    cairo_select_font_face (cr, "Sans", CAIRO_FONT_SLANT_OBLIQUE,CAIRO_FONT_WEIGHT_BOLD);
+    cairo_set_source_rgba (cr, 0.9, 0.9, 0.4, 0.6);
+    cairo_text_extents_t extents;
+    cairo_text_extents (cr, my_text, &extents);
+    double x = (extents.width/2 + extents.x_bearing);
+    double y = (extents.height/2 + extents.y_bearing);
+    cairo_move_to  (cr, x0+w0/2-x, y0+h0/2 - y);
+    cairo_text_path(cr,my_text);
+    cairo_fill_preserve (cr);
+    cairo_set_source_rgba (cr, 0, 0, 0,1);
+    cairo_set_line_width (cr, 0.004);
+    cairo_stroke (cr);
+    cairo_set_line_width (cr, DEF_WIDTH);
+
+
+}
+
+void round_button(cairo_t* cr, double x0, double y0, 
+		  double rect_width, double rect_height, double radius,
+		  double r, double g, double b) {
+    
+    double x1,y1;
+    
+    
+    x1=x0+rect_width;
+    y1=y0+rect_height;
+    if (!rect_width || !rect_height)
+	return;
+    if (rect_width/2<radius) {
+	if (rect_height/2<radius) {
+	    cairo_move_to  (cr, x0, (y0 + y1)/2);
+	    cairo_curve_to (cr, x0 ,y0, x0, y0, (x0 + x1)/2, y0);
+	    cairo_curve_to (cr, x1, y0, x1, y0, x1, (y0 + y1)/2);
+	    cairo_curve_to (cr, x1, y1, x1, y1, (x1 + x0)/2, y1);
+	    cairo_curve_to (cr, x0, y1, x0, y1, x0, (y0 + y1)/2);
+	} else {
+	    cairo_move_to  (cr, x0, y0 + radius);
+	    cairo_curve_to (cr, x0 ,y0, x0, y0, (x0 + x1)/2, y0);
+	    cairo_curve_to (cr, x1, y0, x1, y0, x1, y0 + radius);
+	    cairo_line_to (cr, x1 , y1 - radius);
+	    cairo_curve_to (cr, x1, y1, x1, y1, (x1 + x0)/2, y1);
+	    cairo_curve_to (cr, x0, y1, x0, y1, x0, y1- radius);
+	}
+    } else {
+	if (rect_height/2<radius) {
+	    cairo_move_to  (cr, x0, (y0 + y1)/2);
+	    cairo_curve_to (cr, x0 , y0, x0 , y0, x0 + radius, y0);
+	    cairo_line_to (cr, x1 - radius, y0);
+	    cairo_curve_to (cr, x1, y0, x1, y0, x1, (y0 + y1)/2);
+	    cairo_curve_to (cr, x1, y1, x1, y1, x1 - radius, y1);
+	    cairo_line_to (cr, x0 + radius, y1);
+	    cairo_curve_to (cr, x0, y1, x0, y1, x0, (y0 + y1)/2);
+	} else {
+	    cairo_move_to  (cr, x0, y0 + radius);
+	    cairo_curve_to (cr, x0 , y0, x0 , y0, x0 + radius, y0);
+	    cairo_line_to (cr, x1 - radius, y0);
+	    cairo_curve_to (cr, x1, y0, x1, y0, x1, y0 + radius);
+	    cairo_line_to (cr, x1 , y1 - radius);
+	    cairo_curve_to (cr, x1, y1, x1, y1, x1 - radius, y1);
+	    cairo_line_to (cr, x0 + radius, y1);
+	    cairo_curve_to (cr, x0, y1, x0, y1, x0, y1- radius);
+	}
+    }
+    cairo_close_path (cr);
+    
+    cairo_pattern_t *pat= 
+	//cairo_pattern_create_linear (0.0, 0.0,  0.0, 1.0);
+        cairo_pattern_create_radial (0.25, 0.24, 0.11, 0.24,  0.14, 0.35);
+    cairo_pattern_set_extend (pat, CAIRO_EXTEND_REFLECT);
+    
+    cairo_pattern_add_color_stop_rgba (pat, 1.0, r, g, b, 1);
+    cairo_pattern_add_color_stop_rgba (pat, 0.0, 1, 1, 1, 1);
+    cairo_set_source (cr, pat);
+    cairo_fill_preserve (cr);
+    cairo_pattern_destroy (pat);
+
+    //cairo_set_source_rgb (cr, 0.5,0.5,1);    cairo_fill_preserve (cr);
+    cairo_set_source_rgba (cr, 0, 0, 0.5, 0.3);
+    cairo_stroke (cr);
+
+    cairo_set_font_size (cr, 0.08);
+    centered_text(cr,x0,y0,rect_width, rect_height, "FLTK loves Cairo!");
+
+}
+
+class CairoWindow : public Window {
+public:
+
+  CairoWindow() : Window(300,300) {
+    resizable(this); // comment this out for fixed-size
+    color(fltk::WHITE); // desired background color
+  }
+
+  void draw() {
+    fltk::Window::draw(); // this erases it
+    cairo_save(cr);
+
+    double xc = 0.5;
+    double yc = 0.5;
+    double radius = 0.4;
+    double angle1 = 45.0  * (M_PI/180.0);  /* angles are specified */
+    double angle2 = 180.0 * (M_PI/180.0);  /* in radians           */
+
+    cairo_set_line_width (cr, DEF_WIDTH);
+    cairo_scale (cr, w(), h());
+
+    round_button(cr,0.1,0.05,0.8,0.2,0.4,0,0,1);
+    round_button(cr,0.1,0.35,0.8,0.2,0.4,1,0,0);
+    round_button(cr,0.1,0.65,0.8,0.2,0.4,0,1,0);
+    cairo_restore(cr);
+  }
+};
+
+int main(int argc, char** argv) {
+  CairoWindow window;
+  window.show(argc,argv);
+  return fltk::run();
+}
+#else
+#include <fltk/ask.h>
+int main(int argc, char** argv) {
+  fltk::message("please configure fltk with CAIRO enabled (--enable-cairo)"); 
+  return 0;
+}
+
+#endif
+
+//
+// End of "$Id: arc.cxx 5115 2006-05-12 16:00:00Z fabien $".
+//

Added: branches/branch-3.0/test2/callbacks.cxx
===================================================================
--- branches/branch-3.0/test2/callbacks.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/callbacks.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,63 @@
+// callback.cxx (example 2b)
+
+#include <fltk/run.h>
+#include <fltk/Window.h>
+#include <fltk/Slider.h>
+#include <fltk/Button.h>
+#include <fltk/IntInput.h>
+#include <stdlib.h>
+using namespace fltk;
+
+IntInput* intinput;
+
+void copy_callback(Widget*, void* v) {
+  Slider* slider = (Slider*)v;
+  slider->value(intinput->ivalue());
+}
+
+void down_callback(Widget*, void* v) {
+  Slider* slider = (Slider*)v;
+  slider->value(slider->value()-1);
+  intinput->value(slider->value());
+}
+
+void up_callback(Widget*, void* v) {
+  Slider* slider = (Slider*)v;
+  slider->value(slider->value()+1);
+  intinput->value(slider->value());
+}
+
+void slider_callback(Widget* w, void*) {
+  Slider* slider = (Slider*)w;
+  intinput->value(slider->value());
+}
+
+void exit_callback(Widget *, void *) {
+  exit(0);
+}
+
+int main(int argc, char ** argv) {
+  Window window(320, 90);
+  window.begin();
+  IntInput intinput(10,10,100,20);
+  ::intinput = &intinput;
+  intinput.value(0.0);
+  Button copy_button(110, 10, 100, 20, "copy to slider");
+  Slider slider(10,35,300,20);
+  slider.type(Slider::TICK_ABOVE);
+  slider.clear_flag(LAYOUT_VERTICAL);
+  slider.callback(slider_callback);
+  copy_button.callback(copy_callback, &slider);
+  slider.range(-10,10);
+  slider.step(1);
+  slider.value(0);
+  Button down_button(50,60,50,20,"down");
+  down_button.callback(down_callback, &slider);
+  Button up_button(150,60,50,20,"up");
+  up_button.callback(up_callback, &slider);
+  Button exit_button(250,60,50,20,"exit");
+  exit_button.callback(exit_callback);
+  window.end();
+  window.show(argc,argv);
+  return run();
+}

Added: branches/branch-3.0/test2/checkers.cxx
===================================================================
--- branches/branch-3.0/test2/checkers.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/checkers.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,1390 @@
+//
+// "$Id: checkers.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $"
+//
+// Checkers game for the Fast Light Tool Kit (FLTK).
+//
+// Hours of fun: the FLTK checkers game!
+// Based on a very old algorithim, but it still works!
+//
+// Copyright 1998-2006 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+//    http://www.fltk.org/str.php
+//
+
+const char* copyright = 
+"Checkers game\n"
+"\xa9""2001 Bill Spitzak    spitzak@d2.com\n"
+"Original Pascal code:\n"
+"\xa9""1978, Oregon Minicomputer Software, Inc.\n"
+"2340 SW Canyon Road, Portland, Oregon 97201\n"
+"Written by Steve Poulsen 18-Jan-79\n"
+"\n"
+"This program is free software; you can redistribute it and/or modify "
+"it under the terms of the GNU General Public License as published by "
+"the Free Software Foundation; either version 2 of the License, or "
+"(at your option) any later version.\n"
+"\n"
+"This program is distributed in the hope that it will be useful, "
+"but WITHOUT ANY WARRANTY; without even the implied warranty of "
+"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the "
+"GNU General Public License for more details.\n"
+"\n"
+"You should have received a copy of the GNU Library General Public "
+"License along with this library; if not, write to the Free Software "
+"Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 "
+"USA.";
+
+// Define FLTK to get the fltk interface
+// Define VT100 to get the VT100 interface
+// Define both to get a program that takes a -t switch
+
+#define FLTK
+//#define VT100
+
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <ctype.h>
+#include <time.h>
+
+////////////////////////////////////////////////////////////////
+// The algorithim:
+
+int maxevaluate=2500;		// max number of moves to examine on a turn
+int maxnodes = 2500;		// maximum number of nodes in search tree
+int maxply = 20;		// maximum depth to look ahead
+char forcejumps = 1;		// is forced jumps rule in effect?
+
+// scoring parameters: (all divided by 5 from original code)
+// some signs seem to be backwards, marked them with (-) in comment
+const int spiece = 800;		// value of a piece
+const int sking = 1200;		// value of a king
+const int sadvan = 160;		// value of mypieces/theirpieces-1
+// const int smobil = ?		// moves *enemy* can make w/o being jumped
+const int sallpin = 80;		// mobil == 0
+const int sdeny = 10;		// moves enemy can make that will be jumped
+const int spin = 32;		// enemy pieces that have no move except jumped
+const int sthreat = -10;	// enemy pieces we can jump if not moved (-)
+const int sgrad = 1;		// score of piece positions
+const int sback = 10;		// back row occupied so enemy can't make king
+const int smoc2 = 200;		// more mobility, more center
+const int smoc3 = -8;		// less mobility, less center
+const int smoc4 = -80;		// more mobility, less center
+const int smode2 = -14;		// less mobility, less denied
+const int smode3 = -40;		// more mobility, more denied (-)
+const int sdemmo = -20;		// more denied, more moves (-)
+const int scent = 10;		// pieces in center
+const int skcent = 100;		// kings in center
+
+const int depthpenalty=4;	// guess
+const int noise=2;		// values less or eq to this apart are eq
+
+// const int sattackking = 4;	// not used
+// const int sattackpiece = 3;
+
+struct node {
+  node *father;
+  node *son;		// best son
+  node *brother;	// next brother
+  short int value;	// value of this board position to player making move
+  unsigned char from,to; // the move to reach this board
+  long int jump;	// bit map of locations jumped
+  unsigned char mobil;
+  unsigned char deny;
+  unsigned char pin;
+  unsigned char threat;
+  short int gradient;
+  unsigned who:1;	// 0 = black's move, 1 = white's move
+  unsigned king:1;	// 1 = move causes piece to be kinged
+  unsigned back:1;
+  unsigned moc2:1;
+  unsigned moc3:1;
+  unsigned moc4:1;
+  unsigned mode2:1;
+  unsigned mode3:1;
+  unsigned demmo:1;
+};
+
+int nodes;		// count of nodes
+
+/*	Board positions:	Border positions:
+
+	      WHITE		  00  01  02  03  04
+	  05  06  07  08	04  XX  XX  XX  XX
+	09  10  11  12		  XX  XX  XX  XX  13
+	  14  15  16  17	13  XX  XX  XX  XX
+	18  19  20  21		  XX  XX  XX  XX  22
+	  23  24  25  26	22  XX  XX  XX  XX
+	27  28  29  30		  XX  XX  XX  XX  31
+	  32  33  34  36	31  XX  XX  XX  XX
+	36  37  38  39		  XX  XX  XX  XX  40
+	      BLACK		40  41  42  43  44
+
+*/
+
+typedef unsigned char piece;
+
+// Piece values so that BLACK and WHITE are bit flags:
+enum {
+  EMPTY = 0,
+  BLACK = 1,
+  WHITE = 2,
+  KING  = 4,
+  BLACKKING = 5,
+  WHITEKING = 6,
+  BLUE	= 8,
+  FRIEND = BLACK,
+  FRIENDKING = BLACKKING,
+  ENEMY	= WHITE,
+  ENEMYKING = WHITEKING
+};
+
+const piece flip[9] = {
+  EMPTY, WHITE, BLACK, 0, 0, WHITEKING, BLACKKING, 0, BLUE};
+
+const int offset[9][4] = {	// legal move directions
+  {0,0,0,0},
+  {-5,-4,0,0},
+  {4,5,0,0},
+  {0,0,0,0},
+  {0,0,0,0},
+  {4,5,-4,-5},
+  {4,5,-4,-5},
+  {0,0,0,0},
+  {0,0,0,0}
+};
+
+piece b[45];		// current board position being considered
+
+int evaluated;		// number of moves evaluated this turn
+
+char centralsquares[45];
+char is_protected[45];
+
+piece flipboard[45];	// swapped if enemy is black
+piece *tb;		// pointer to real or swapped board
+
+char check(int target,int direction) {
+  // see if enemy at target can be jumped from direction by our piece
+  int dst = target-direction;
+  if (tb[dst]) return(0);
+  int src = target+direction;
+  if (tb[src] == FRIENDKING);
+  else if (direction < 0 || tb[src] != FRIEND) return(0);
+  piece a = tb[target]; piece b = tb[src];
+  tb[target] = EMPTY; tb[src] = EMPTY;
+  int safe =
+    ((tb[src-4]&FRIEND && tb[src-8]&ENEMY)
+     || (tb[src-5]&FRIEND && tb[src-10]&ENEMY)
+     || (tb[dst-4]&ENEMY && !tb[dst+4])
+     || (tb[dst-5]&ENEMY && !tb[dst+5])
+     || (tb[src+4]&FRIEND && tb[src+8]==ENEMYKING)
+     || (tb[src+5]&FRIEND && tb[src+10]==ENEMYKING)
+     || (tb[dst+4]==ENEMYKING && !tb[dst-4])
+     || (tb[dst+5]==ENEMYKING && !tb[dst-5]));
+  tb[target] = a; tb[src] = b;
+  return(safe);
+}
+
+int deniedmoves,undeniedmoves;
+void analyzemove(int direction,int src) {
+  int target = src+direction;
+  if (!tb[target]) {
+    if (!tb[target+direction]) is_protected[target] = 1;
+    piece a = tb[src]; tb[src] = EMPTY;
+    if (check(target,4) || check(target,5) ||
+	check(target,-4) || check(target,-5) ||
+	(tb[src+4]&ENEMY && check(src+4,4)) ||
+	(tb[src+5]&ENEMY && check(src+5,5)) ||
+	(tb[src-4]&ENEMY && check(src-4,-4)) ||
+	(tb[src-5]&ENEMY && check(src-5,-5)))
+      deniedmoves++;
+    else undeniedmoves++;
+    tb[src] = a;
+  }
+}
+
+void evaluateboard(node *n,int print) {
+
+  if (!n->who) tb = b;	// move was black's
+  else {
+    for (int i=0; i<45; i++) flipboard[44-i] = flip[b[i]];
+    tb = flipboard;
+  }
+
+  memset(is_protected,0,sizeof(is_protected));
+  int friendpieces = 0;
+  int enemypieces = 0;
+  int friendkings = 0;
+  int enemykings = 0;
+  int friendkcent = 0;
+  int friendcent = 0;
+  int enemykcent = 0;
+  int enemycent = 0;
+  n->mobil = n->deny = n->pin = n->threat = 0;
+
+  int i;
+  for (i=5; i<40; i++) switch(tb[i]) {
+  case ENEMYKING:
+    enemykings++;
+    enemykcent += centralsquares[i];
+    deniedmoves = 0;
+    undeniedmoves = 0;
+    if (i>8) {
+      analyzemove(-4,i);
+      analyzemove(-5,i);
+    }
+    goto J1;
+  case ENEMY:
+    deniedmoves = 0;
+    undeniedmoves = 0;
+  J1:	enemypieces++;
+    enemycent += centralsquares[i];
+    if (i<36) {
+      analyzemove(4,i);
+      analyzemove(5,i);
+    }
+    if (deniedmoves && !undeniedmoves) n->pin++;
+    n->deny += deniedmoves;
+    n->mobil += undeniedmoves;
+    break;
+  case FRIENDKING:
+    friendkings++;
+    friendkcent += centralsquares[i];
+    if (tb[i+4]&ENEMY && !tb[i+8] && !(tb[i+4]==ENEMYKING && !tb[i-4]))
+      n->threat++;
+    if (tb[i+5]&ENEMY && !tb[i+10] && !(tb[i+5]==ENEMYKING && !tb[i-5]))
+      n->threat++;
+  case FRIEND:
+    friendpieces++;
+    friendcent += centralsquares[i];
+    if (tb[i-4]&ENEMY && !tb[i-8] && tb[i+4]) n->threat++;
+    if (tb[i-5]&ENEMY && !tb[i-10] && tb[i+5]) n->threat++;
+    break;
+  }
+
+  int gradient[40];
+  for (i=4; i<9; i++) gradient[i] = tb[i] ? 0 : 32;
+  int total = 0;
+  for (i=9; i<40; i++) {
+    int x = (gradient[i-4]+gradient[i-5])/2;
+    if (tb[i]==FRIEND) total += x;
+    gradient[i] = ((tb[i]&FRIEND) || !(tb[i] || is_protected[i])) ? x : 0;
+  }
+  n->gradient = total;
+
+  n->back = tb[39]==FRIEND && tb[37]==FRIEND && !enemykings;
+
+  node* f = n->father;
+
+  n->moc2 = f->mobil>n->mobil && friendcent>enemycent;
+  n->moc3 = f->mobil<=n->mobil && friendcent<enemycent;
+  n->moc4 = f->mobil>n->mobil && friendcent<enemycent;
+  n->mode2 = f->mobil<=n->mobil && n->deny<f->deny;
+  n->mode3 = f->mobil>n->mobil && n->deny>f->deny;
+  n->demmo = n->deny>f->deny && f->deny+f->mobil>n->deny+n->mobil;
+
+  total =
+    spiece	* (friendpieces - enemypieces) +
+    (sking-spiece) * (friendkings	- enemykings) +
+    //	mobil?
+    sdeny	* (n->deny	- f->deny) +
+    spin	* (n->pin	- f->pin) +
+    sthreat	* (n->threat	- f->threat) +
+    sgrad	* (n->gradient	- f->gradient) +
+    sback	* (n->back	- f->back) +
+    smoc2	* (n->moc2	- f->moc2) +
+    smoc3	* (n->moc3	- f->moc3) +
+    smoc4	* (n->moc4	- f->moc4) +
+    smode2	* (n->mode2	- f->mode2) +
+    smode3	* (n->mode3	- f->mode3) +
+    sdemmo	* (n->demmo	- f->demmo) +
+    scent	* (friendcent	- enemycent) +
+    (skcent-scent) * (friendkcent	- enemykcent);
+  if (!n->mobil) total += sallpin;
+
+  if (!enemypieces) total = 30000;
+  else if (friendpieces > enemypieces)
+    total += (sadvan*friendpieces)/enemypieces-sadvan;
+  else total -= (sadvan*enemypieces)/friendpieces-sadvan;
+
+  if (print) {
+    printf("\tParent\tNew\tScore\n");
+    printf("pieces\t%d\t%d\t%d\n",enemypieces,friendpieces,
+	   spiece*(friendpieces-enemypieces));
+    printf("kings\t%d\t%d\t%d\n",enemykings,friendkings,
+	   (sking-spiece)*(friendkings-enemykings));
+    printf("mobil\t%d\t%d\t%d\n",f->mobil,n->mobil,n->mobil?0:sallpin);
+    printf("deny\t%d\t%d\t%d\n",f->deny,n->deny,sdeny*(n->deny-f->deny));
+    printf("pin\t%d\t%d\t%d\n",f->pin,n->pin,spin*(n->pin-f->pin));
+    printf("threat\t%d\t%d\t%d\n",f->threat,n->threat,sthreat*(n->threat-f->threat));
+    printf("grad\t%d\t%d\t%d\n",f->gradient,n->gradient,sgrad*(n->gradient-f->gradient));
+    printf("back\t%d\t%d\t%d\n",f->back,n->back,sback*(n->back-f->back));
+    printf("moc2\t%d\t%d\t%d\n",f->moc2,n->moc2,smoc2*(n->moc2-f->moc2));
+    printf("moc3\t%d\t%d\t%d\n",f->moc3,n->moc3,smoc3*(n->moc3-f->moc3));
+    printf("moc4\t%d\t%d\t%d\n",f->moc4,n->moc4,smoc4*(n->moc4-f->moc4));
+    printf("mode2\t%d\t%d\t%d\n",f->mode2,n->mode2,smode2*(n->mode2-f->mode2));
+    printf("mode3\t%d\t%d\t%d\n",f->mode3,n->mode3,smode3*(n->mode3-f->mode3));
+    printf("demmo\t%d\t%d\t%d\n",f->demmo,n->demmo,sdemmo*(n->demmo-f->demmo));
+    printf("cent\t%d\t%d\t%d\n",enemycent,friendcent,scent*(friendcent-enemycent));
+    printf("kcent\t%d\t%d\t%d\n",enemykcent,friendkcent,skcent*(friendkcent-enemykcent));
+    printf("total:\t\t\t%d\n",total);
+  }
+  else {
+    n->value = total;
+    evaluated++;
+  }
+}	// end of evaluateboard
+
+// --------------------- Tree management -----------------
+
+node *freelist;
+
+node *newnode(void) {
+  node *n;
+  if (freelist) {
+    n = freelist;
+    freelist = n->brother;
+  }
+  else n = (node *)malloc(sizeof(node));
+  memset(n,0,sizeof(node));
+  nodes++;
+  return(n);
+}
+
+void extract(node *n) {
+  node* i = n->father;
+  if (i) {
+    node* j = i->son;
+    if (j==n) i->son = n->brother;
+    else while (j) {
+      i = j; j = j->brother;
+      if (j==n) {i->brother = n->brother; break;}
+    }
+  }
+  n->brother = 0;
+}
+
+void killnode(node *x) {
+  if (!x) return;
+  node *y;
+  for (y = x; ; y = y->brother) {
+    nodes--;
+    killnode(y->son); y->son = 0;
+    if (!y->brother) break;
+  }
+  y->brother = freelist;
+  freelist = x;
+}
+
+int seed;		// current random number
+
+void insert(node *n) {
+  int val = n->value;
+  node **pp;
+  for (pp = &(n->father->son); *pp; pp = &((*pp)->brother)) {
+    int val1 = (*pp)->value;
+    if (abs(val-val1) <= noise) {
+      seed = (seed*13077+5051)%0100000;
+      if ((seed & 070) >= 060) break;
+    }
+    else if (val > val1) break;
+  }
+  n->brother = *pp;
+  *pp = n;
+}
+
+// --------------------------------------------------------------
+
+void movepiece(node* f, int i, node* jnode) {
+  static char jumphappened;
+
+  for (int k=0; k<4; k++) {
+    int direction = offset[b[i]][k];
+    if (!direction) break;
+    int j = i+direction;
+    if (b[j] == EMPTY) {
+      if (!jnode && (!forcejumps || !f->son || !f->son->jump)) {
+	node* n = newnode();
+	n->father = f;
+	n->who = !f->who;
+	n->from = i;
+	n->to = j;
+	piece oldpiece = b[i]; b[i] = EMPTY;
+	if (!(oldpiece&KING) && n->who ? (j>=36) : (j<=8)) {
+	  n->king = 1;
+	  b[j] = oldpiece|KING;
+	}
+	else b[j] = oldpiece;
+	evaluateboard(n,0);
+	insert(n);
+	b[i] = oldpiece; b[j] = EMPTY;
+      }
+    } else if (((b[j]^b[i])&(WHITE|BLACK))==(WHITE|BLACK) && !b[j+direction]) {
+      if (forcejumps && f->son && !f->son->jump) {
+	killnode(f->son);
+	f->son = 0;
+      }
+      int jumploc = j;
+      j += direction;
+      node* n = newnode();
+      n->father = f;
+      n->who = !f->who;
+      n->from = i;
+      n->to = j;
+      n->jump = (1<<(jumploc-10));
+      piece oldpiece = b[i]; b[i] = EMPTY;
+      if (!(oldpiece&KING) && n->who ? (j>=36) : (j<=8)) {
+	n->king = 1;
+	b[j] = oldpiece|KING;
+      }
+      else b[j] = oldpiece;
+      if (jnode) {
+	n->from = jnode->from;
+	n->jump |= jnode->jump;
+	n->king |= jnode->king;
+      }
+      piece jumpedpiece = b[jumploc];
+      b[jumploc] = EMPTY;
+      jumphappened = 0;
+      movepiece(f,j,n);
+      if (forcejumps && jumphappened) killnode(n);
+      else {evaluateboard(n,0); insert(n);}
+      b[i] = oldpiece; b[j] = EMPTY;
+      b[jumploc] = jumpedpiece;
+      jumphappened = 1;
+    }
+  }
+}
+
+void expandnode(node *f) {
+  if (f->son || f->value > 28000) return;	// already done
+  piece turn = f->who ? BLACK : WHITE;
+  for (int i=5; i<40; i++) if (b[i]&turn) movepiece(f,i,0);
+  if (f->son) {
+    f->value = -f->son->value;
+    if (f->brother) f->value -= depthpenalty;
+  }
+  else f->value = 30000;
+}
+
+void makemove(node *n) {
+  b[n->to] = b[n->from];
+  if (n->king) b[n->to] |= KING;
+  b[n->from] = EMPTY;
+  if (n->jump) for(int i=0; i<32; i++) {
+    if (n->jump & (1<<i)) b[10+i] = EMPTY;
+  }
+}
+
+int didabort(void);
+
+int fullexpand(node *f, int level) {
+  if (didabort() || nodes > maxnodes-(maxply*10) || evaluated > maxevaluate) return(0);
+  expandnode(f);
+  if (!f->son) return(1);
+  piece oldboard[45];
+  memmove(oldboard,b,sizeof(b));
+  node* n = f->son;
+  if (!n->jump && n->brother) {if (level<1) return(1); level--;}
+  int i;
+  node* sons[32]; for (i=0; (sons[i++] = n); n = n->brother);
+  int ret = 1;
+  for (i=0; ret && (n = sons[i++]);) {
+    makemove(n);
+    ret = fullexpand(n,level);
+    memmove(b,oldboard,sizeof(b));
+    extract(n);
+    insert(n);
+  }
+  f->value = -f->son->value;
+  return(ret);
+}
+
+int descend(node *f) {
+  static int depth;
+  if (didabort() || nodes > maxnodes || depth >= maxply) return(0);
+  if (f->son) {
+    node* n = f->son;
+    makemove(n);
+    depth++;
+    int ret = descend(n);
+    depth--;
+    extract(n);
+    insert(n);
+    f->value = -f->son->value;
+    return(ret);
+  }
+  else {expandnode(f); return(1);}
+}
+
+char debug;
+
+node *calcmove(node *root) {	// return best move after root
+  expandnode(root);
+  if (!root->son) return(0);	// no move due to loss
+  if (debug) printf("calcmove() initial nodes = %d\n",nodes);
+  evaluated = 0;
+  if (root->son->brother) {
+    int x;
+    for (x = 1; abs(root->value)<28000 && fullexpand(root,x); x++);
+    piece saveboard[45]; memmove(saveboard,b,sizeof(b));
+    while (abs(root->value)<28000) {
+      x = descend(root);
+      memmove(b,saveboard,sizeof(b));
+      if (!x) break;
+    }
+  }
+  if (debug) printf(" evaluated %d, nodes = %d\n", evaluated, nodes);
+  return(root->son);
+}
+
+// the actual game state ----------------
+
+node *root,*undoroot;
+
+piece jumpboards[24][45];	// saved boards for undoing jumps
+int nextjump;
+
+char user;	// 0 = black, 1 = white
+char playing;
+char autoplay;
+
+void newgame(void) {
+
+  int n;
+  for (n=0; n<5; n++) b[n] = BLUE;
+  for (n=5; n<18; n++) b[n] = WHITE;
+  for (n=18; n<27; n++) b[n] = EMPTY;
+  for (n=27; n<40; n++) b[n] = BLACK;
+  for (n=40; n<45; n++) b[n] = BLUE;
+  b[13] = b[22] = b[31] = BLUE;
+
+  centralsquares[15] = centralsquares[16] =
+    centralsquares[19] = centralsquares[20] =
+    centralsquares[24] = centralsquares[25] =
+    centralsquares[28] = centralsquares[29] = 1;
+
+  // set up initial search tree:
+  nextjump = 0;
+  killnode(undoroot);
+  undoroot = root = newnode();
+
+  // make it white's move, so first move is black:
+  root->who = 1;
+  user = 0;
+  playing = 1;
+}
+
+void domove(node* move) {
+  if (move->jump) memmove(jumpboards[nextjump++],b,sizeof(b));
+  makemove(move);
+  extract(move);
+  killnode(root->son);
+  root->son = move;
+  root = move;
+  if (debug) evaluateboard(move,1);
+}
+
+node* undomove() {
+  node *n = root;
+  if (n == undoroot) return 0; // no more undo possible
+  if (n->jump) memmove(b,jumpboards[--nextjump],sizeof(b));
+  else {
+    b[n->from] = b[n->to];
+    if (n->king) b[n->from] &= (WHITE|BLACK);
+    b[n->to] = EMPTY;
+  }
+  root = n->father;
+  killnode(n);
+  root->son = 0;
+  root->value = 0;	// prevent it from thinking game is over
+  playing = 1;
+  if (root == undoroot) user = 0;
+  return n;
+}
+
+const char _usermoves[] =
+"B1D1F1H1A2C2E2G2??B3D3F3H3A4C4E4G4??B5D5F5H5A6C6E6G6??B7D7F7H7A8C8E8G8??";
+#define usermoves(x,y) _usermoves[2*((x)-5)+(y)-1]
+
+void dumpnode(node *n, int help) {
+  int x = n->from;
+  int y = n->to;
+  if (help) printf("%c%c %c%c\t- ",
+		   usermoves(x,1),usermoves(x,2),
+		   usermoves(y,1),usermoves(y,2));
+  printf("%s %ss from %c%c to %c%c",
+	 n->who ? "White" : "Black",
+	 n->jump ? "jump" : "move",
+	 usermoves(x,1),usermoves(x,2),
+	 usermoves(y,1),usermoves(y,2));
+  if (n->jump) {
+    for (int i=0; i<32; i++) if (n->jump & (1<<i))
+      printf(", %c%c",usermoves(10+i,1),usermoves(10+i,2));
+    printf(" removed");
+  }
+  printf(" (%+d).\n",n->value);
+}
+
+int abortflag;
+
+////////////////////////////////////////////////////////////////
+// VT100 Interface:
+#ifdef VT100
+
+void positioncursor(int i) {
+  printf("\033[%d;%dH",
+	 usermoves(i,2)-'0'+1,
+	 2*(usermoves(i,1)-'A')+1);
+}
+
+void outpiecename(piece n) {
+  printf(n&BLACK ? "\033[1;7m" : "\033[1m");
+  putchar(" BW??BW??"[n]);
+  putchar(" BW??KK??"[n]);
+  printf("\033[0m");
+}
+
+void VT100board(void) {
+  printf("\033<\033[H\033[J\033[10r");
+  int l = 0;
+  puts(" A B C D E F G H");
+  for (int i=0; i<4; i++) {
+    int j = 9*i+5;
+    int k;
+    for (k=0; k<4; k++) {
+      printf("\033[7m  \033[0m");
+      outpiecename(b[j+k]);
+    }
+    l++;
+    printf("%d\n",l);
+    j += 4;
+    for (k=0; k<4; k++) {
+      outpiecename(b[j+k]);
+      printf("\033[7m  \033[0m");
+    }
+    l++;
+    printf("%d\n",l);
+  }
+}
+
+void VT100move(node *n, int) {
+  if (!n) return;
+  printf("\0337");
+  positioncursor(n->from);
+  outpiecename(b[n->from]);
+  positioncursor(n->to);
+  outpiecename(b[n->to]);
+  if (n->jump) for(int i=0; i<32; i++) {
+    if (n->jump & (1<<i)) {
+      positioncursor(10+i);
+      outpiecename(b[10+i]);
+    }
+  }
+  printf("\0338");
+}
+
+int decode(char *m) {
+  int i;
+  for(i=5; i<=40; i++)
+    if (toupper(m[0])==usermoves(i,1) && m[1]==usermoves(i,2)) return(i);
+  return(0);
+}
+
+#include <signal.h>
+
+static void sigint(...) {
+  abortflag = 1;
+  signal(SIGINT,sigint);
+}
+
+void fixexit(int x) {
+  printf("\0337\033[r\0338");
+  exit(x);
+}
+
+// Returns a son, or 0 if no move specified, or root to cause "help"
+node *getusermove(void) {
+  int i,j;
+  node *t;
+  char line[100],*m1,*m2;
+
+  if (playing)
+    printf("\033[1m%s's move?\033[0m ",root->who ? "Black" : "White");
+  else
+    printf("\033[1mCommand?\033[0m ");
+  abortflag = 0;
+  if (!gets(line)) {
+    putchar('\n');
+    if (feof(stdin)) fixexit(0);
+    return 0;
+  }
+  for (m1 = line; *m1 && *m1<=' '; m1++);
+  if (!*m1) return(0);
+  m2 = m1+1;
+  if (*m2) m2++;
+  for (; *m2 && *m2<'0'; m2++);
+  if (playing && m1[1]>='0' && m1[1]<='9') {
+    i = decode(m1);
+    j = decode(m2);
+    if (i && j) for (t = root->son; t; t = t->brother)
+      if (t->from == i && t->to == j) return(t);
+    puts("Valid moves are:");
+    m1[0] = 'L';
+  }
+  switch(toupper(m1[0])) {
+  case 0: return(0);
+  case 'A':
+    if (playing) autoplay = 1;
+    return(root);
+  case 'C':
+    puts(copyright);
+    break;
+  case 'D':
+    debug = !debug;
+    printf("Debug is now %s.", debug ? "on" : "off");
+    break;
+  case 'F':
+    forcejumps = !forcejumps;
+    printf("Forced jumps rule is now %s.",forcejumps ? "on" : "off");
+    killnode(root->son); root->son = 0;
+    return(0);
+  case 'L':
+    expandnode(root);
+    if (playing) for (t = root->son; t; t = t->brother) dumpnode(t,1);
+    break;
+  case 'M':
+    return(playing ? root : 0);
+  case 'N':
+    newgame();
+    VT100board();
+    return(0);
+  case 'P':
+    printf("I expect the following moves:\n");
+    for (t = root->son; t; t = t->son) dumpnode(t,0);
+    break;
+  case 'Q':
+    fixexit(0);
+  case 'R':
+    VT100board();
+    break;
+  case 'S':
+    user = !user;
+    return(root);
+  case 'U':
+    VT100move(undomove(),1);
+    VT100move(undomove(),1);
+    return(0);
+  case '+':
+    maxevaluate = maxnodes = 2*maxevaluate;
+    goto J2;
+  case '-':
+    if (maxevaluate > 1)
+      maxevaluate = maxnodes = maxevaluate/2;
+  J2: printf("Moves evaluated set to %d.",maxevaluate);
+    break;
+  default:
+    puts(
+	 "A(utoplay)\n"
+	 "C(opyright)\n"
+	 "D(ebug on/off)\n"
+	 "F(orce jumps rule on/off)\n"
+	 "L(ist legal moves)\n"
+	 "M(ake a move for me)\n"
+	 "N(ew game)\n"
+	 "P(redict next few moves)\n"
+	 "Q(uit)\n"
+	 "R(edraw screen)\n"
+	 "S(witch sides)\n"
+	 "U(ndo)\n"
+	 "+	- smarter\n"
+	 "-	- stupider");
+    expandnode(root);
+    for (t = root->son; t; t = t->brother) dumpnode(t,1);
+  }
+  return(0);
+}
+
+int VT100main() {
+  signal(SIGINT,sigint);
+  VT100board();
+  for (;;) {
+    if (playing) {
+      expandnode(root);
+      if (!root->son) {
+	printf("%s has no move.  Game over.",root->who ? "Black" : "White");
+	playing = autoplay = 0;
+      }
+    }
+    node* move;
+    if (playing && (autoplay || root->who == user)) {
+      move = calcmove(root);
+      if (move->value <= -30000) {
+ 	printf("%s resigns.", move->who ? "White" : "Black");
+ 	move = 0;
+ 	playing = autoplay = 0;
+      }
+    } else {
+      move = getusermove();
+      if (move == root) move = calcmove(root);
+    }
+    if (move) {
+      dumpnode(move,0);
+      domove(move);
+      VT100move(move,0);
+    }
+  }
+}
+
+#endif
+
+////////////////////////////////////////////////////////////////
+// fltk interface:
+#ifdef FLTK
+
+#include <fltk/run.h>
+#include <fltk/events.h>
+#include <fltk/Window.h>
+#include <fltk/xbmImage.h>
+#include <fltk/draw.h>
+#include <FL/Fl_Menu_Item.H>
+#include <fltk/ask.h>
+#include <fltk/Cursor.h>
+
+//----------------------------------------------------------------
+// old 4-level NeXT images have been seperated into bitmaps so they
+// can be drawn with arbitrary colors and real transparency.  This is
+// rather tedious and perhaps fltk should provide a direct support
+// to do this:
+
+#include "black_1.xbm"
+#include "black_2.xbm"
+#include "black_3.xbm"
+#include "black_4.xbm"
+#include "white_1.xbm"
+#include "white_2.xbm"
+#include "white_3.xbm"
+#include "white_4.xbm"
+#include "blackking_1.xbm"
+#include "blackking_2.xbm"
+#include "blackking_3.xbm"
+#include "blackking_4.xbm"
+#include "whiteking_1.xbm"
+#include "whiteking_2.xbm"
+#include "whiteking_3.xbm"
+#include "whiteking_4.xbm"
+
+fltk::xbmImage *bm[4][4];
+
+void make_bitmaps() {
+  if (bm[0][0]) return;
+  bm[0][0] = new fltk::xbmImage(black_1_bits, black_1_width, black_1_height);
+  bm[0][1] = new fltk::xbmImage(black_2_bits, black_1_width, black_1_height);
+  bm[0][2] = new fltk::xbmImage(black_3_bits, black_1_width, black_1_height);
+  bm[0][3] = new fltk::xbmImage(black_4_bits, black_1_width, black_1_height);
+  bm[1][0] = new fltk::xbmImage(white_1_bits, black_1_width, black_1_height);
+  bm[1][1] = new fltk::xbmImage(white_2_bits, black_1_width, black_1_height);
+  bm[1][2] = new fltk::xbmImage(white_3_bits, black_1_width, black_1_height);
+  bm[1][3] = new fltk::xbmImage(white_4_bits, black_1_width, black_1_height);
+  bm[2][0] = new fltk::xbmImage(blackking_1_bits, black_1_width, black_1_height);
+  bm[2][1] = new fltk::xbmImage(blackking_2_bits, black_1_width, black_1_height);
+  bm[2][2] = new fltk::xbmImage(blackking_3_bits, black_1_width, black_1_height);
+  bm[2][3] = new fltk::xbmImage(blackking_4_bits, black_1_width, black_1_height);
+  bm[3][0] = new fltk::xbmImage(whiteking_1_bits, black_1_width, black_1_height);
+  bm[3][1] = new fltk::xbmImage(whiteking_2_bits, black_1_width, black_1_height);
+  bm[3][2] = new fltk::xbmImage(whiteking_3_bits, black_1_width, black_1_height);
+  bm[3][3] = new fltk::xbmImage(whiteking_4_bits, black_1_width, black_1_height);
+}
+
+// Unfortunately, this is necessary on Windows 'cause GDI resources aren't
+// automatically released at program exit
+// WAS: no, fltk should do this! I guess when a bitmap is drawn the resulting
+// image should be put in a list for deletiong on exit.
+// void destroy_bitmaps() {
+//   for (int i = 0; i < 4; i++) for (int j = 0; j < 4; j++) delete bm[i][j];
+// }
+
+#define ISIZE black_1_width
+
+void draw_piece(int which, int x, int y) {
+  if (!fltk::not_clipped(fltk::Rectangle(x,y,ISIZE,ISIZE))) return;
+  switch (which) {
+  case BLACK: which = 0; break;
+  case WHITE: which = 1; break;
+  case BLACKKING: which = 2; break;
+  case WHITEKING: which = 3; break;
+  default: return;
+  }
+  fltk::setcolor(fltk::GRAY00); bm[which][0]->draw(x, y);
+  fltk::setcolor(fltk::GRAY33); bm[which][1]->draw(x, y);
+  fltk::setcolor(fltk::GRAY66); bm[which][2]->draw(x, y);
+  fltk::setcolor(fltk::GRAY99); bm[which][3]->draw(x, y);
+}
+
+//----------------------------------------------------------------
+
+class Board : public fltk::Window {
+  void draw();
+  int handle(int);
+public:
+  void drag_piece(int, int, int);
+  void drop_piece(int);
+  void animate(node* move, int backwards);
+  void computer_move(int);
+  Board(int w, int h) : fltk::Window(w,h) {color(15); /*set_double_buffer();*/}
+};
+
+#define BOXSIZE 52
+#define BORDER 4
+#define BOARDSIZE (8*BOXSIZE+BORDER)
+#define BMOFFSET 5
+
+static int erase_this;  // real location of dragging piece, don't draw it
+static int dragging;	// piece being dragged
+static int dragx;	// where it is
+static int dragy;
+static int showlegal;	// show legal moves
+
+int squarex(int i) {return (usermoves(i,1)-'A')*BOXSIZE+BMOFFSET;}
+int squarey(int i) {return (usermoves(i,2)-'1')*BOXSIZE+BMOFFSET;}
+
+void Board::draw() {
+  make_bitmaps();
+  fltk::setcolor(color()); fltk::fillrect(0,0,w(),h());
+  fltk::setcolor((fltk::Color)107 /*10*/);
+  int x; for (x=0; x<8; x++) for (int y=0; y<8; y++) {
+    if (!((x^y)&1)) fltk::fillrect(BORDER+x*BOXSIZE, BORDER+y*BOXSIZE,
+			     BOXSIZE-BORDER, BOXSIZE-BORDER);
+  }
+  fltk::setcolor(fltk::GRAY20);
+  for (x=0; x<9; x++) {
+    fltk::fillrect(x*BOXSIZE,0,BORDER,h());
+    fltk::fillrect(0,x*BOXSIZE,w(),BORDER);
+  }
+  for (int i = 5; i < 40; i++) if (i != erase_this) {
+    draw_piece(::b[i], squarex(i), squarey(i));
+  }
+  if (showlegal) {
+    fltk::setcolor(fltk::WHITE);
+    node* n;
+    for (n = root->son; n; n = showlegal==2 ? n->son : n->brother) {
+      int x1 = squarex(n->from)+BOXSIZE/2-5;
+      int y1 = squarey(n->from)+BOXSIZE/2-5;
+      int x2 = squarex(n->to)+BOXSIZE/2-5;
+      int y2 = squarey(n->to)+BOXSIZE/2-5;
+      fltk::drawline(x1,y1,x2,y2);
+      fltk::push_matrix();
+      fltk::concat(float(x2-x1),float(y2-y1),float(y1-y2),float(x2-x1),float(x2),float(y2));
+      fltk::addvertex(0,0);
+      fltk::addvertex(-.3f,  .1f);
+      fltk::addvertex(-.3f, -.1f);
+      fltk::fillpath();
+      fltk::pop_matrix();
+    }
+    int num = 1;
+    fltk::setcolor(fltk::BLACK);
+    fltk::setfont(labelfont(),10);
+    for (n = root->son; n; n = showlegal==2 ? n->son : n->brother) {
+      int x1 = squarex(n->from)+BOXSIZE/2-5;
+      int y1 = squarey(n->from)+BOXSIZE/2-5;
+      int x2 = squarex(n->to)+BOXSIZE/2-5;
+      int y2 = squarey(n->to)+BOXSIZE/2-5;
+      char buf[20]; sprintf(buf,"%d",num);
+      fltk::drawtext(buf, float(x1+int((x2-x1)*.85)-3), float(y1+int((y2-y1)*.85)+5));
+      num++;
+    }
+  }
+  if (dragging) draw_piece(dragging, dragx, dragy);
+}
+
+// drag the piece on square i to dx dy, or undo drag if i is zero:
+void Board::drag_piece(int i, int dx, int dy) {
+  dy = (dy&-2) | (dx&1); // make halftone shadows line up
+  if (i != erase_this) drop_piece(erase_this); // should not happen
+  if (!erase_this) { // pick up old piece
+    dragx = squarex(i); dragy = squarey(i);
+    erase_this = i;
+    dragging = ::b[i];
+  }
+  if (dx != dragx || dy != dragy) {
+    redraw(Rectangle(dragx, dragy, ISIZE, ISIZE));
+    redraw(Rectangle(dx, dy, ISIZE, ISIZE));
+  }
+  dragx = dx;
+  dragy = dy;
+}
+
+// drop currently dragged piece on square i
+void Board::drop_piece(int i) {
+  if (!erase_this) return; // should not happen!
+  erase_this = 0;
+  dragging = 0;
+  int x = squarex(i);
+  int y = squarey(i);
+  if (x != dragx || y != dragy) {
+    redraw(Rectangle(dragx, dragy, ISIZE, ISIZE));
+    redraw(Rectangle(x, y, ISIZE, ISIZE));
+  }
+}
+
+#ifndef _WIN32
+# include <unistd.h>
+#endif
+
+// show move (call this *before* the move, *after* undo):
+void Board::animate(node* move, int backwards) {
+  if (showlegal) {showlegal = 0; redraw();}
+  if (!move) return;
+  int f = move->from;
+  int t = move->to;
+  if (backwards) {int x = f; f = t; t = x;}
+  int x1 = squarex(f);
+  int y1 = squarey(f);
+  int x2 = squarex(t);
+  int y2 = squarey(t);
+  const int STEPS=20; // was 35;
+  for (int i=0; i<STEPS; i++) {
+    int x = x1+(x2-x1)*i/STEPS;
+    int y = y1+(y2-y1)*i/STEPS;
+    drag_piece(move->from,x,y);
+    fltk::flush();
+#ifndef _WIN32
+    usleep(0);
+#endif
+  }
+  drop_piece(t);
+  if (move->jump) redraw();
+}
+
+int busy; // causes pop-up abort menu
+
+void message(const char* m, ...) {
+  char buffer[2048];
+  va_list a;
+  va_start(a,m);
+  vsprintf(buffer, m, a);
+  va_end(a);
+  fltk::message(buffer);
+}
+
+void Board::computer_move(int help) {
+  if (!playing) return;
+  cursor(fltk::CURSOR_WAIT);
+  fltk::flush();
+  busy = 1; abortflag = 0;
+  node* move = calcmove(root);
+  busy = 0;
+  if (move) {
+    if (!help && move->value <= -30000) {
+      message("%s resigns", move->who ? "White" : "Black");
+      playing = autoplay = 0;
+      cursor(fltk::CURSOR_DEFAULT);
+      return;
+    }
+    animate(move,0);
+    domove(move);
+  }
+  expandnode(root);
+  if (!root->son) {
+    message("%s has no move", root->who ? "Black" : "White");
+    playing = autoplay = 0;
+  }
+  if (!autoplay) cursor(fltk::CURSOR_DEFAULT);
+}
+
+extern Fl_Menu_Item menu[];
+extern Fl_Menu_Item busymenu[];
+static Board* board;
+
+int Board::handle(int e) {
+  board = this;
+  if (busy) {
+    switch(e) {
+    case fltk::PUSH:
+      busymenu->popup(fltk::event_x(), fltk::event_y());
+      return 1;
+    case fltk::SHORTCUT:
+      return busymenu->test_shortcut() != 0;
+    default:
+      return Window::handle(e);
+    }
+  }
+  node *t, *n;
+  static int deltax, deltay;
+  int dist;
+  switch (e) {
+  case fltk::PUSH:
+    if (fltk::event_button() > 1) {
+      static const Fl_Menu_Item* previous;
+      const Fl_Menu_Item* i =
+	menu->popup(fltk::event_x(), fltk::event_y(), 0, previous);
+      if (i) previous = i;
+      return 1;
+    }
+    if (playing) {
+      expandnode(root);
+      for (t = root->son; t; t = t->brother) {
+	int x = squarex(t->from);
+	int y = squarey(t->from);
+	if (fltk::event_inside(Rectangle(x,y,BOXSIZE,BOXSIZE))) {
+	  deltax = fltk::event_x()-x;
+	  deltay = fltk::event_y()-y;
+	  drag_piece(t->from,x,y);
+	  return 1;
+	}
+      }
+    }
+    return 0;
+  case fltk::SHORTCUT:
+    return menu->test_shortcut() != 0;
+  case fltk::DRAG:
+    drag_piece(erase_this, fltk::event_x()-deltax, fltk::event_y()-deltay);
+    return 1;
+  case fltk::RELEASE:
+    // find the closest legal move he dropped it on:
+    dist = 50*50; n = 0;
+    for (t = root->son; t; t = t->brother) if (t->from==erase_this) {
+      int d1 = fltk::event_x()-deltax-squarex(t->to);
+      int d = d1*d1;
+      d1 = fltk::event_y()-deltay-squarey(t->to);
+      d += d1*d1;
+      if (d < dist) {dist = d; n = t;}
+    }
+    if (!n) {drop_piece(erase_this); return 1;} // none found
+    drop_piece(n->to);
+    domove(n);
+    if (showlegal) {showlegal = 0; redraw();}
+    if (n->jump) redraw();
+    computer_move(0);
+    return 1;
+  default:
+    return Window::handle(e);
+  }
+}
+
+void quit_cb(fltk::Widget*, void*) { exit(0); }
+
+#include <fltk/visual.h>
+int FLTKmain(int argc, char** argv) {
+  fltk::visual(fltk::DOUBLE_BUFFER|fltk::INDEXED_COLOR);
+  Board b(BOARDSIZE,BOARDSIZE);
+  b.callback(quit_cb);
+  b.show(argc,argv);
+  return fltk::run();
+} 
+
+void autoplay_cb(fltk::Widget*, void*) {
+  if (autoplay) {autoplay = 0; return;}
+  if (!playing) return;
+  autoplay = 1;
+  while (autoplay) {board->computer_move(0); board->computer_move(0);}
+}
+
+fltk::Window *copyright_window;
+void copyright_cb(fltk::Widget*, void*) {
+  if (!copyright_window) {
+    copyright_window = new fltk::Window(400,270,"About checkers");
+    //copyright_window->color(fltk::WHITE);
+    copyright_window->begin();
+    fltk::Widget *b = new fltk::Widget(20,0,380,270,copyright);
+    b->labelsize(10);
+    b->clear_flag(fltk::ALIGN_MASK);
+    b->set_flag(fltk::ALIGN_LEFT|fltk::ALIGN_INSIDE|fltk::ALIGN_WRAP);
+    copyright_window->end();
+  }
+  copyright_window->hotspot(copyright_window);
+  copyright_window->set_non_modal();
+  copyright_window->show();
+}
+
+void debug_cb(fltk::Widget* v, void*) {
+  debug = !debug;
+  // LAME! Fltk2 does not emulate Fl_Menu_Item well enough to allow any
+  // changes to be remembered. Go change the table directly:
+  Fl_Menu_Item* item = menu+8;
+  if (debug) item->set(); else item->clear();
+}
+
+void forced_cb(fltk::Widget* v, void*) {
+  forcejumps = !forcejumps;
+  // LAME! Fltk2 does not emulate Fl_Menu_Item well enough to allow any
+  // changes to be remembered. Go change the table directly:
+  Fl_Menu_Item* item = menu+7;
+  if (forcejumps) item->set(); else item->clear();
+  killnode(root->son); root->son = 0;
+  if (showlegal) {expandnode(root); board->redraw();}
+}
+
+void move_cb(fltk::Widget*, void*) {
+  if (playing) board->computer_move(1);
+  if (playing) board->computer_move(0);
+}
+
+void newgame_cb(fltk::Widget*, void*) {
+  showlegal = 0;
+  newgame();
+  board->redraw();
+}
+
+void legal_cb(fltk::Widget*, void*) {
+  if (showlegal == 1) {showlegal = 0; board->redraw(); return;}
+  if (!playing) return;
+  expandnode(root);
+  showlegal = 1; board->redraw();
+}
+
+void predict_cb(fltk::Widget*, void*) {
+  if (showlegal == 2) {showlegal = 0; board->redraw(); return;}
+  if (playing) expandnode(root);
+  showlegal = 2; board->redraw();
+}
+
+void switch_cb(fltk::Widget*, void* pb) {
+  user = !user;
+  board->computer_move(0);
+}
+
+void undo_cb(fltk::Widget*, void* pb) {
+  board->animate(undomove(),1);
+  board->animate(undomove(),1);
+}
+
+//--------------------------
+
+#include <fltk/Slider.h>
+#include <fltk/ValueInput.h>
+
+fltk::Window *intel_window;
+fltk::ValueInput *intel_output;
+
+void intel_slider_cb(fltk::Widget*w, void*) {
+  double v = ((fltk::Slider*)w)->value();
+  int n = int(v*v);
+  intel_output->value(n);
+  maxevaluate = maxnodes = n;
+}
+
+void intel_cb(fltk::Widget*, void*) {
+  if (!intel_window) {
+    intel_window = new fltk::Window(200,25,"Checkers Intelligence");
+    intel_window->begin();
+    fltk::Slider* s = new fltk::Slider(60,0,140,25);
+    s->minimum(1); s->maximum(500); s->value(50);
+    s->callback(intel_slider_cb);
+    intel_output = new fltk::ValueInput(0,0,60,25);
+    intel_output->value(maxevaluate);
+    intel_window->resizable(s);
+    intel_window->end();
+  }
+  intel_window->hotspot(intel_window);
+  intel_window->set_non_modal();
+  intel_window->show();
+}
+
+//---------------------------
+
+void stop_cb(fltk::Widget*, void*) {abortflag = 1;}
+
+void continue_cb(fltk::Widget*, void*) {}
+
+Fl_Menu_Item menu[] = {
+  {"Autoplay", 'a', autoplay_cb},
+  {"Legal moves", 'l', legal_cb},
+  {"Move for me", 'm', move_cb},
+  {"New game", 'n', newgame_cb},
+  {"Predict", 'p', predict_cb},
+  {"Switch sides", 's', switch_cb},
+  {"Undo", 'u', undo_cb, 0, FL_MENU_DIVIDER},
+  {"Forced jumps rule", 'f', forced_cb, 0, FL_MENU_TOGGLE|FL_MENU_VALUE},
+  {"Debug", 'd', debug_cb, 0, FL_MENU_TOGGLE},
+  {"Intelligence...", 'i', intel_cb, 0, FL_MENU_DIVIDER},
+  {"About...", 'c', copyright_cb},
+  {"Quit", 'q', quit_cb},
+  {(const char *)0}};
+
+Fl_Menu_Item busymenu[] = {
+  {"Stop", '.', stop_cb},
+  {"Autoplay", 'a', autoplay_cb},
+  {"Continue", 0, continue_cb},
+  {"Debug", 'd', debug_cb, 0, FL_MENU_TOGGLE},
+  {"Intelligence...", 'i', intel_cb},
+  {"Copyright", 'c', copyright_cb},
+  {"Quit", 'q', quit_cb},
+  {(const char *)0}};
+
+#endif
+
+////////////////////////////////////////////////////////////////
+// parts shared by both interface:
+
+#ifdef FLTK
+#ifdef VT100
+#define BOTH
+#endif
+#endif
+
+#ifdef BOTH
+int terminal;
+int arg(int, char **argv, int &i) {
+  if (argv[i][1] == 't') {terminal = 1; i++; return 1;}
+  return 0;
+}
+#endif
+
+int didabort(void) {
+#ifdef FLTK
+#ifdef BOTH
+  if (!terminal)
+#endif
+    fltk::check();
+#endif
+  if (abortflag) {
+    autoplay = 0;
+    abortflag = 0;
+    return 1;
+  }
+  return(0);
+}
+
+int main(int argc, char **argv) {
+  seed = time(0);
+  newgame();
+#ifdef BOTH
+  int i = 1;
+  if (fltk::args(argc, argv, i, arg) < argc) {
+    fprintf(stderr," -t : use VT100 display\n", fltk::help);
+    exit(1);
+  }
+  if (!getenv("DISPLAY")) terminal = 1;
+  if (!terminal)
+#endif
+#ifdef FLTK
+    return FLTKmain(argc,argv);
+#endif
+#ifdef VT100
+  return VT100main();
+#endif
+}
+
+//
+// End of "$Id: checkers.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $".
+//

Added: branches/branch-3.0/test2/circle.xbm
===================================================================
--- branches/branch-3.0/test2/circle.xbm	                        (rev 0)
+++ branches/branch-3.0/test2/circle.xbm	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,517 @@
+#define circle_width 220
+#define circle_height 220
+static unsigned char circle_bits[] = {
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x20, 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, 0x80, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 
+  0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 
+  0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 
+  0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 
+  0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0x1f, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 
+  0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0x7f, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 
+  0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0x01, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0xfc, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 
+  0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0x03, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0xfe, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 
+  0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0x0f, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 
+  0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0x1f, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x80, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 
+  0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0x3f, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0xe0, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 
+  0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0x7f, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0xe0, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 
+  0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0xf0, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 
+  0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0xf8, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 
+  0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0x01, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0xfc, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 
+  0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0x03, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0xfc, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 
+  0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0x03, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0xfc, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 
+  0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0x07, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0xfe, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 
+  0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0x07, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0xfe, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 
+  0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0x07, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0xfe, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 
+  0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0x07, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0xfe, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 
+  0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0x07, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0xfe, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 
+  0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0x07, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0xfe, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 
+  0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0x07, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0xfe, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 
+  0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0x07, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0xfe, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 
+  0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0x07, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0xfe, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 
+  0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0x07, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0xfc, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 
+  0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0x03, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0xfc, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 
+  0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0x03, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0xf8, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 
+  0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0x01, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0xf8, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 
+  0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0xf0, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 
+  0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0xe0, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 
+  0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0x7f, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0xc0, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 
+  0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0x3f, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x80, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 
+  0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0x1f, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 
+  0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0x0f, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0xfe, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 
+  0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0x03, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0xf8, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 
+  0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0x01, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 
+  0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0x7f, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 
+  0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0x1f, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 
+  0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 
+  0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 
+  0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 
+  0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 
+  0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0x1f, 
+  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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, };

Added: branches/branch-3.0/test2/classes.cxx
===================================================================
--- branches/branch-3.0/test2/classes.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/classes.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,86 @@
+// classes.cxx (example 3a)
+
+#include <fltk/run.h>
+#include <fltk/Window.h>
+#include <fltk/Slider.h>
+#include <fltk/Button.h>
+#include <fltk/IntInput.h>
+#include <stdlib.h>
+using namespace fltk;
+
+static void exit_callback(Widget *, void *) {
+  exit(0);
+}
+
+class SampleWindow : public Window {
+  IntInput intinput;
+  Button copy_button;
+  Slider slider;
+  Button down_button;
+  Button up_button;
+  Button exit_button;
+
+  inline void copy_callback_i() {
+    slider.value(intinput.ivalue());
+  }
+  static void copy_callback(Widget*, void* v) {
+    ((SampleWindow*)v)->copy_callback_i();
+  }
+
+  inline void down_callback_i() {
+    slider.value(slider.value()-1);
+    intinput.value(slider.value());
+  }
+  static void down_callback(Widget*, void* v) {
+    ((SampleWindow*)v)->down_callback_i();
+  }
+
+  inline void up_callback_i() {
+    slider.value(slider.value()+1);
+    intinput.value(slider.value());
+  }
+  static void up_callback(Widget*, void* v) {
+    ((SampleWindow*)v)->up_callback_i();
+  }
+
+  inline void slider_callback_i(Slider* slider) {
+    intinput.value(slider->value());
+  }
+  static void slider_callback(Widget* w, void* v) {
+    ((SampleWindow*)v)->slider_callback_i((Slider*)w);
+  }
+
+public:
+
+  SampleWindow(const char* label=0) :
+    Window(USEDEFAULT,USEDEFAULT,320,90,label,true),
+    intinput(10,10,100,20),
+    copy_button(110,10,100,20,"copy to slider"),
+    slider(10,35,300,20),
+    down_button(50,60,50,20,"down"),
+    up_button(150,60,50,20,"up"),
+    exit_button(250,60,50,20,"exit")
+  {
+    copy_button.callback(copy_callback,this);
+    down_button.callback(down_callback,this);
+    up_button.callback(up_callback,this);
+    slider.callback(slider_callback,this);
+    slider.set_horizontal(); slider.type(Slider::TICK_ABOVE);
+    slider.range(-10,10);
+    slider.step(1);
+    slider.value(0);
+    exit_button.callback(exit_callback);
+    end();
+  }
+
+  ~SampleWindow() {}
+
+};
+
+int main(int argc, char ** argv) {
+  SampleWindow window1("Window 1");
+  SampleWindow window2("Window 2");
+  window1.show(argc,argv);
+  window2.show();
+  return run();
+}

Added: branches/branch-3.0/test2/clock.cxx
===================================================================
--- branches/branch-3.0/test2/clock.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/clock.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,104 @@
+//
+// "$Id: clock.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $"
+//
+// Clock test program for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2006 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+//    http://www.fltk.org/str.php
+//
+
+#include <fltk/ShapedWindow.h>
+#include <fltk/Clock.h>
+#include <fltk/PopupMenu.h>
+#include <fltk/Menu.h>
+#include <fltk/Item.h>
+#include <fltk/SharedImage.h>
+#include <fltk/ask.h>
+#include <fltk/events.h>
+#include <fltk/run.h>
+#include <stdlib.h>
+
+using namespace fltk;
+#include "circle.xbm" // bitmap mask for window shape
+
+class ClockWindow : public ShapedWindow {
+  public:
+    ClockWindow(int W, int H, const char *l = 0) : ShapedWindow(W,H,l) {}
+    int handle(int);
+};
+
+int ClockWindow::handle(int e) {
+  static int bx, by;
+  static int button1 = 0;
+  if (e == PUSH) button1 = (fltk::event_button() == 1);
+  if (button1) switch(e) {
+    case DRAG:
+      position(x()+event_x_root()-bx, y()+event_y_root()-by);
+    case PUSH:
+      bx = event_x_root(); by = event_y_root();
+      show(); // so the window will click-to-front
+      return 1;
+  }
+  return ShapedWindow::handle(e);
+}
+
+Item *about_item, *exit_item;
+void callback(Widget* w, void* d) {
+  if (((Menu*)w)->value()) exit(0);
+  message("FLTK-- Copyright 2000 Bill Spitzak and others");
+}
+
+int main(int argc, char **argv) {
+  ClockWindow window(220, 220, "fltk::Clock");
+  window.color(12);
+  window.begin();
+  // don't show window manager border-- some window managers do this for you
+  // if an arbitrary shape is assigned to the window.
+  // previously windows.clear_border();
+  // window.border(false); // not needed now because now ShapedWindow implicitly sets border to false.
+#ifdef WIN32
+  Clock clock(0,0,220,220);
+#else
+  Clock clock(10,10,200,200); // Fabien : why ?
+#endif
+  clock.type(ClockOutput::ROUND);
+  clock.box(fltk::OVAL_BOX);
+  clock.align(fltk::ALIGN_BOTTOM|fltk::ALIGN_WRAP);
+  PopupMenu popup(0, 0, 220, 220);
+  popup.type(PopupMenu::POPUP3);
+  popup.begin();
+  about_item = new Item("About clock");
+  exit_item = new Item("Exit clock");
+  popup.end();
+  popup.callback(callback);
+  //window.resizable(popup); //- Not today, maybe never!
+  window.end();
+  window.xclass("fltkClock");
+  window.show(argc, argv);
+  xbmImage shape(circle_bits, circle_width, circle_height);
+  window.shape(shape);
+
+  return run();
+}
+
+//
+// End of "$Id: clock.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $".
+//

Added: branches/branch-3.0/test2/color_chooser.cxx
===================================================================
--- branches/branch-3.0/test2/color_chooser.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/color_chooser.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,165 @@
+// "$Id: color_chooser.cxx 6249 2008-09-15 06:21:01Z spitzak $"
+//
+// Color chooser test program for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2006 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems to:
+//
+//     http://www.fltk.org/str.php
+//
+
+#include <config.h>
+#undef USE_XFT // this breaks the <x.h> header file
+
+#include <fltk/run.h>
+#include <fltk/Window.h>
+#include <fltk/visual.h>
+#include <fltk/Button.h>
+#include <fltk/show_colormap.h>
+#include <fltk/ColorChooser.h>
+#include <fltk/rgbImage.h>
+#include <fltk/x.h>
+#include <fltk/error.h>
+#include <fltk/draw.h>
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#if USE_X11
+  #include "list_visuals.cxx"
+#endif
+
+class GrayLines : public fltk::Widget {
+public:
+  GrayLines(int X, int Y, int W, int H, const char* L)
+    : fltk::Widget(X,Y,W,H,L) { }
+  
+  void draw() {
+    // Use every color in the gray ramp:
+    for (int i = 0; i < 3*8; i++) {
+      fltk::setcolor((fltk::Color)(fltk::GRAY00+i));
+      fltk::drawline(i, 0, i, h());
+    }
+  }
+};
+
+#define freecolor_cell (fltk::FREE_COLOR)
+
+// Callback function for "fltk::show_colormap" button
+static void colormap_cb(fltk::Widget *w, void *v) {
+  uchar r, g, b;
+  fltk::Color c = fltk::show_colormap(w->parent()->color());
+  fltk::split_color(c, r,g,b);
+  // Set new color to our free color index
+  fltk::set_color_index(freecolor_cell, fltk::color(r,g,b));
+  // Redraw parent box
+  w->parent()->redraw();
+}
+
+// Callback function for "fltk::choose_color" button
+static void choose_color_cb(fltk::Widget *w, void *v) {
+  uchar r,g,b;
+  fltk::split_color(w->parent()->color(),r,g,b);
+  if (!fltk::color_chooser("New color:", r,g,b)) return;
+  // Set new color to our free color index
+  fltk::set_color_index(freecolor_cell, fltk::color(r,g,b));
+  // Redraw parent box
+  w->parent()->redraw();
+}
+
+// Main entry point for application
+int main(int argc, char **argv) 
+{
+  // Set default color for our free color index
+  fltk::set_color_index(freecolor_cell, fltk::color(145,159,170));
+  
+  // Create window
+  fltk::Window window(200, 170, "color_chooser test");  
+  window.begin();
+
+  // Create widget container group
+  fltk::Group gbox(10, 10, window.w()-20, window.h()-20);
+  gbox.box(fltk::THIN_DOWN_BOX);
+  gbox.color(freecolor_cell);
+  gbox.begin();
+
+  // Create button
+  fltk::Button button1(50,20,120,30, "fltk::show_colormap");
+  button1.callback(colormap_cb);
+
+  // Create button
+  fltk::Button button2(50,60,120,30, "fltk::choose_color");
+  button2.callback(choose_color_cb);
+
+  // Create lines widget
+  GrayLines lines(10,20,3*8,120, "Lines");
+  lines.align(fltk::ALIGN_TOP);
+
+  // We're done with the group
+  gbox.end();
+
+  // Test command line options
+  int i = 1;
+  if (!fltk::args(argc, argv, i) || i != argc-1) {
+    printf("usage: %s <switches> visual-number\n"
+	   " - : default visual\n"
+	   " r : call fltk::visual(fltk::RGB_COLOR)\n"
+	   " c : call fltk::own_colormap()\n",argv[0]);
+#if USE_X11
+    printf(" # : use this visual with an empty colormap:\n");
+    list_visuals();
+#endif
+    puts("\n Invalid parameter, using with default visual");
+  }
+
+  // Parse command line options  
+  if (argc > 1 && argv[i][0] == 'r') {
+    if (!fltk::visual(fltk::RGB_COLOR)) fltk::fatal("fltk::visual(fltk::RGB_COLOR) returned false.\n");
+  } 
+  else if (argc > 1 && argv[i][0] == 'c') {
+    fltk::own_colormap();
+  } 
+  else if (argc > 1 && argv[i][0] != '-') {
+#if USE_X11
+    int visid = atoi(argv[i]);
+    fltk::open_display();
+    XVisualInfo templt; int num;
+    templt.visualid = visid;
+    fltk::xvisual= XGetVisualInfo(fltk::xdisplay, VisualIDMask, &templt, &num);
+    if (!fltk::xvisual) fltk::fatal("No visual with id %d",visid);
+    fltk::xcolormap = XCreateColormap(fltk::xdisplay, RootWindow(fltk::xdisplay,fltk::xscreen),
+				  fltk::xvisual->visual, AllocNone);
+# if !USE_CAIRO
+    fltk::xpixel(fltk::BLACK); // make sure black is allocated
+# endif
+#else
+    fltk::fatal("Visual id's not supported on this platform");
+#endif
+  }
+
+  // Show window
+  window.show(argc, argv);
+
+  // Run FLTK event loop
+  return fltk::run();
+}
+
+//
+// End of "$Id: color_chooser.cxx 6249 2008-09-15 06:21:01Z spitzak $".
+//

Added: branches/branch-3.0/test2/connect.cxx
===================================================================
--- branches/branch-3.0/test2/connect.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/connect.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,77 @@
+//
+// "$Id: connect.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $"
+//
+// PPP example program for the Fast Light Tool Kit (FLTK).
+//
+// Program to make a button to turn a ppp connection on/off.
+// You must chmod +s /usr/sbin/pppd, and put all the options
+// into /etc/ppp/options.
+//
+// Copyright 1998-2006 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+//    http://www.fltk.org/str.php
+//
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <signal.h>
+#include <sys/wait.h>
+
+#include <fltk/Fl.h>
+#include <fltk/Fl_Window.h>
+#include <fltk/Fl_Toggle_Button.h>
+
+int running;	// actually the pid
+Fl_Toggle_Button *Button;
+
+void sigchld(int) {
+  waitpid(running, 0, 0);
+  running = 0;
+  Button->value(0);
+}
+
+void cb(Fl_Widget *o, void *) {
+  if (((Fl_Toggle_Button*)o)->value()) {
+    if (running) return;
+    running = fork();
+    if (!running) execl("/usr/sbin/pppd","pppd","-detach",0);
+    else signal(SIGCHLD, sigchld);
+  } else {
+    if (!running) return;
+    kill(running, SIGINT);
+    waitpid(running, 0, 0);
+    running = 0;
+  }
+}
+
+int main(int argc, char ** argv) {
+   Fl_Window window(100,50);
+   Fl_Toggle_Button button(0,0,100,50,"Connect");
+   Button = &button;
+   button.color(1,2);
+   button.callback(cb,0);
+   window.show(argc,argv);
+   return Fl::run();
+}
+
+//
+// End of "$Id: connect.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $".
+//

Added: branches/branch-3.0/test2/cube.cxx
===================================================================
--- branches/branch-3.0/test2/cube.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/cube.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,204 @@
+//
+// "$Id: cube.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $"
+//
+// OpenGL test program for the Fast Light Tool Kit (FLTK).
+//
+// Modified to have 2 cubes to test multiple OpenGL contexts
+//
+// Copyright 1998-2006 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+//    http://www.fltk.org/str.php
+//
+
+#include <config.h>
+#include <fltk/run.h>
+#include <fltk/draw.h>
+#include <fltk/Window.h>
+#include <fltk/Box.h>
+#include <fltk/Button.h>
+#include <fltk/RadioLightButton.h>
+#include <fltk/Slider.h>
+#include <stdlib.h>
+
+using namespace fltk;
+
+#if !HAVE_GL
+#include <fltk/ask.h>
+
+int main(int, char**) {
+  fltk::alert("This demo does not work without OpenGL");
+  return 1;
+}
+#else
+#include <fltk/GlWindow.h>
+#include <fltk/gl.h>
+
+class cube_box : public GlWindow {
+  void draw();
+public:
+  double lasttime;
+  int wire;
+  double size;
+  double speed;
+  cube_box(int x,int y,int w,int h,const char *l=0)
+    : GlWindow(x,y,w,h,l) {lasttime = 0.0;}
+};
+
+/* The cube definition */
+float v0[3] = {0.0, 0.0, 0.0};
+float v1[3] = {1.0, 0.0, 0.0};
+float v2[3] = {1.0, 1.0, 0.0};
+float v3[3] = {0.0, 1.0, 0.0};
+float v4[3] = {0.0, 0.0, 1.0};
+float v5[3] = {1.0, 0.0, 1.0};
+float v6[3] = {1.0, 1.0, 1.0};
+float v7[3] = {0.0, 1.0, 1.0};
+
+#define v3f(x) glVertex3fv(x)
+
+void drawcube(int wire) {
+/* Draw a colored cube */
+  glBegin(wire ? GL_LINE_LOOP : GL_POLYGON);
+  glColor3ub(0,0,255);
+  v3f(v0); v3f(v1); v3f(v2); v3f(v3);
+  glEnd();
+  glBegin(wire ? GL_LINE_LOOP : GL_POLYGON);
+  glColor3ub(0,255,255); v3f(v4); v3f(v5); v3f(v6); v3f(v7);
+  glEnd();
+  glBegin(wire ? GL_LINE_LOOP : GL_POLYGON);
+  glColor3ub(255,0,255); v3f(v0); v3f(v1); v3f(v5); v3f(v4);
+  glEnd();
+  glBegin(wire ? GL_LINE_LOOP : GL_POLYGON);
+  glColor3ub(255,255,0); v3f(v2); v3f(v3); v3f(v7); v3f(v6);
+  glEnd();
+  glBegin(wire ? GL_LINE_LOOP : GL_POLYGON);
+  glColor3ub(0,255,0); v3f(v0); v3f(v4); v3f(v7); v3f(v3);
+  glEnd();
+  glBegin(wire ? GL_LINE_LOOP : GL_POLYGON);
+  glColor3ub(255,0,0); v3f(v1); v3f(v2); v3f(v6); v3f(v5);
+  glEnd();
+}
+
+void cube_box::draw() {
+  lasttime = lasttime+speed;
+  if (!valid()) {
+    glLoadIdentity();
+    glViewport(0,0,w(),h());
+    glEnable(GL_DEPTH_TEST);
+    glFrustum(-1,1,-1,1,2,10000);
+    glTranslatef(0,0,-10);
+    glsetfont(HELVETICA_BOLD, 16 );
+  }
+  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+  glPushMatrix();
+  glRotatef(float(lasttime*1.6),0,0,1);
+  glRotatef(float(lasttime*4.2),1,0,0);
+  glRotatef(float(lasttime*2.3),0,1,0);
+  glTranslatef(-1.0, 1.2f, -1.5);
+  glScalef(float(size),float(size),float(size));
+  drawcube(wire);
+  glPopMatrix();
+  color(GRAY75);
+  glDisable(GL_DEPTH_TEST);
+  gldrawtext(wire ? "Cube: wire" : "Cube: flat", -4.5f, -4.5f );
+  glEnable(GL_DEPTH_TEST);
+}
+
+Window *form;
+Slider *speed, *size;
+Button *button, *wire, *flat;
+cube_box *cube, *cube2;
+
+static void exit_cb(Widget*, void*) {
+  form->hide();
+}
+
+void makeform(const char *name) {
+  form = new Window(510+390,390,name);
+  form->begin();
+  Widget *box = new Widget(20,20,350,350,"");
+  box->box(DOWN_BOX);
+  box = new Widget(510,20,350,350,"");
+  box->box(DOWN_BOX);
+  speed = new Slider(390,90,40,220,"Speed");
+  speed->set_vertical();
+  size = new Slider(450,90,40,220,"Size");
+  size->set_vertical();
+  wire = new RadioLightButton(390,20,100,30,"Wire");
+  flat = new RadioLightButton(390,50,100,30,"Flat");
+  button = new Button(390,340,100,30,"Exit");
+  button->callback(exit_cb);
+  cube = new cube_box(23,23,344,344, 0);
+  cube2 = new cube_box(513,23,344,344, 0);
+  Widget *b = new Widget(cube->x(),size->y(), cube->w(),size->h(),0);
+  b->box(NO_BOX);
+  form->resizable(b);
+  b->hide();
+  form->end();
+}
+
+/* 
+ * It should be noted that it is not a good practice to have an idle 
+ * callback in place at all times because it will eat all available 
+ * processor time. A timout callback would be a better solution.
+ * However, "idle" is used in this particular test program to show
+ * maximum OpenGL performance.
+ */
+
+void idle_cb(void*) {
+  cube->wire = wire->value();
+  cube2->wire = !wire->value();
+  cube->size = cube2->size = size->value();
+  cube->speed = cube2->speed = speed->value();
+  cube->redraw();
+  cube2->redraw();
+}
+
+int main(int argc, char **argv) {
+  makeform(argv[0]);
+  speed->range(0,4);
+  speed->value(cube->speed = cube2->speed = 1.0);
+  size->range(0.01,4);
+  size->value(cube->size = cube2->size = 1.0);
+  flat->value(1); cube->wire = 0; cube2->wire = 1;
+  form->label("cube");
+  form->show(argc,argv);
+  cube->show();
+  cube2->show();
+#if 0
+  // This demonstrates how to manipulate OpenGL contexts.
+  // In this case the same context is used by multiple windows (I'm not
+  // sure if this is allowed on Win32, can somebody check?).
+  // This fixes a bug on the XFree86 3.0 OpenGL where only one context
+  // per program seems to work, but there are probably better uses for
+  // this!
+  cube->make_current(); // causes context to be created
+  cube2->context(cube->context()); // share the contexts
+#endif
+  fltk::add_idle(idle_cb, 0);
+  fltk::run();
+  return 0;
+}
+
+#endif
+
+//
+// End of "$Id: cube.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $".
+//

Added: branches/branch-3.0/test2/cursor.cxx
===================================================================
--- branches/branch-3.0/test2/cursor.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/cursor.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,114 @@
+//
+// "$Id: cursor.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $"
+//
+// Cursor test program for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2006 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+//    http://www.fltk.org/str.php
+//
+
+// This is a complete rewrite that replaces the old test program.
+// Cursors are no longer identified by an integer.
+
+#include <config.h> 
+#include <fltk/run.h>
+#include <fltk/events.h>
+#include <fltk/Window.h>
+#include <fltk/Cursor.h>
+#ifdef USE_XCURSOR
+#include <fltk/SharedImage.h>
+#include <stdio.h>
+#endif
+
+using namespace fltk;
+
+class CursorBox : public Widget {
+  int handle(int);
+public:
+  Cursor* cursor;
+  CursorBox(int x, int y, int w, int h, const char* name, Cursor* c)
+    : Widget(x,y,w,h,name), cursor(c) {}
+};
+
+int CursorBox::handle(int event) {
+  if (event == ENTER) Widget::cursor(cursor);
+  if (event == PUSH) return true; // drag the cursor around
+  return Widget::handle(event);
+}
+
+struct gcc4_bug_workaround {const char* name; Cursor* cursor;} table[] = {
+  {"0", 0},
+  {"CURSOR_ARROW",	CURSOR_ARROW},
+  {"CURSOR_CROSS",	CURSOR_CROSS},
+  {"CURSOR_WAIT",	CURSOR_WAIT},
+  {"CURSOR_INSERT",	CURSOR_INSERT},
+  {"CURSOR_HAND",	CURSOR_HAND},
+  {"CURSOR_HELP",	CURSOR_HELP},
+  {"CURSOR_MOVE",	CURSOR_MOVE},
+  {"CURSOR_NS",		CURSOR_NS},
+  {"CURSOR_WE",		CURSOR_WE},
+  {"CURSOR_NWSE",	CURSOR_NWSE},
+  {"CURSOR_NESW",	CURSOR_NESW},
+  {"CURSOR_NO",		CURSOR_NO},
+  {"CURSOR_NONE",	CURSOR_NONE},
+#ifdef USE_XCURSOR
+  {"CUSTOM_CURSOR",	0},
+#endif
+};
+#define COUNT (sizeof(table)/sizeof(table[0]))
+#define W 200
+#define H 25
+#define GAP 5
+
+#ifdef USE_XCURSOR
+int load_file(int argc, char** argv, int&i){
+  Image *img = SharedImage::get(argv[i]);
+  if( img ){
+    table[COUNT-1].cursor = fltk::cursor(img, 0, 0);
+    ++i;
+    return 1;
+  }
+  return 0;
+}
+
+int main(int argc, char **argv) {
+  register_images();
+  int i;
+  if ( fltk::args(argc, argv, i, load_file) < argc -1) {
+    fprintf(stderr,"args return %d (%d)\n",i,argc);
+    return 1;
+  }
+  if(!table[COUNT-1].cursor)table[COUNT-1].cursor = fltk::cursor(SharedImage::get("porsche.xpm"),32,32);
+#else
+int main(int argc, char **argv) {
+#endif
+  Window window(W+2*GAP, (H+GAP)*COUNT+GAP);
+  window.begin();
+  for (unsigned i = 0; i < COUNT; i++)
+    new CursorBox(GAP, GAP+i*(H+GAP), W, H, table[i].name, table[i].cursor);
+  window.end();
+  window.show(argc, argv);
+  return run();
+}
+
+//
+// End of "$Id: cursor.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $".
+//

Added: branches/branch-3.0/test2/curve.cxx
===================================================================
--- branches/branch-3.0/test2/curve.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/curve.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,117 @@
+//
+// "$Id: curve.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $"
+//
+// Curve test program for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2006 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+//    http://www.fltk.org/str.php
+//
+
+#include <fltk/run.h>
+#include <fltk/Window.h>
+#include <fltk/ValueSlider.h>
+#include <fltk/draw.h>
+#include <fltk/ToggleButton.h>
+
+using namespace fltk;
+
+float xy[10] = {
+  20,20, 50,200, 100,20, 200,200, 0, 0};
+const char* name[10] = {
+  "X0", "Y0", "X1", "Y1", "X2", "Y2", "X3", "Y3", "rotate", "line"};
+
+int points;
+
+class Drawing : public Widget {
+  void draw() {
+    push_clip(0,0,w(),h());
+    setcolor(GRAY20);
+    fillrect(0,0,w(),h());
+    push_matrix();
+    if (xy[8]) {
+      translate(w()/2, h()/2);
+      rotate(xy[8]);
+      translate(-(w()/2), -(h()/2));
+    }
+    if (!points) {
+      setcolor(WHITE);
+      addcurve(xy[0],xy[1],xy[2],xy[3],xy[4],xy[5],xy[6],xy[7]);
+      fillpath();
+    }
+    setcolor(BLACK);
+    addvertex(xy[0],xy[1]);
+    addvertex(xy[2],xy[3]);
+    addvertex(xy[4],xy[5]);
+    addvertex(xy[6],xy[7]);
+    strokepath();
+    setcolor(points ? WHITE : RED);
+    line_style(0,int(xy[9]));
+    addcurve(xy[0],xy[1],xy[2],xy[3],xy[4],xy[5],xy[6],xy[7]);
+    /*points ? drawpoints() :*/ strokepath();
+    line_style(0);
+    pop_matrix();
+    pop_clip();
+  }
+public:
+  Drawing(int X,int Y,int W,int H) : Widget(X,Y,W,H) {}
+};
+
+Drawing *d;
+
+void points_cb(Widget* o, void*) {
+  points = ((ToggleButton*)o)->value();
+  d->redraw();
+}
+
+void slider_cb(Widget* o, void* v) {
+  Slider* s = (Slider*)o;
+  xy[long(v)] = s->value();
+  d->redraw();
+}
+
+int main(int argc, char** argv) {
+  Window window(300,555+25,"addcurve() test");
+  window.begin();
+  window.set_double_buffer();
+  Drawing drawing(10,10,280,280);
+  d = &drawing;
+
+  int y = 300;
+  for (int n = 0; n<10; n++) {
+    ValueSlider* s = new ValueSlider(50,y,240,25,name[n]); y += 25;
+    s->minimum(0); s->maximum(280);
+    if (n == 8) s->maximum(360);
+    s->step(1);
+    s->value(xy[n]);
+    s->align(ALIGN_LEFT);
+    s->callback(slider_cb, (void*)n);
+  }
+//   ToggleButton but(50,y,50,25,"points");
+//   but.callback(points_cb);
+
+  window.end();
+  window.show(argc,argv);
+  return run();
+}
+
+//
+// End of "$Id: curve.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $".
+//

Added: branches/branch-3.0/test2/demo.cxx
===================================================================
--- branches/branch-3.0/test2/demo.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/demo.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,350 @@
+//
+// "$Id: demo.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $"
+//
+// Main demo program for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2006 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+//    http://www.fltk.org/str.php
+//
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#if defined(_WIN32)
+# if !defined(__CYGWIN__)
+#  include <direct.h>
+# else
+#  include <unistd.h>
+# endif
+# include <windows.h> 
+#else
+# include <unistd.h>
+#endif
+#include <fltk/run.h>
+#include <fltk/Window.h>
+#include <fltk/Box.h>
+#include <fltk/Button.h>
+#include <fltk/filename.h>
+#include <fltk/error.h>
+#include <cctype> // tolower
+
+/* The form description */
+
+void doexit(fltk::Widget *, void *);
+void doback(fltk::Widget *, void *);
+void dobut(fltk::Widget *, long);
+
+fltk::Window *form;
+fltk::Button *but[9];
+
+void create_the_forms() {
+  fltk::Widget *obj;
+  form = new fltk::Window(370, 450);
+  form->begin();
+  obj = new fltk::Widget(20,20,330,40,"fltk Demonstration");
+  obj->box(fltk::ENGRAVED_BOX);
+  obj->color(fltk::GRAY60);
+  obj->labelsize(24);
+  obj->labelfont(fltk::HELVETICA_BOLD);
+  obj->labeltype(fltk::ENGRAVED_LABEL);
+  obj = new fltk::Widget(20,70,330,330,0);
+  obj->box(fltk::ENGRAVED_BOX);
+  obj->color(fltk::GRAY50);
+  obj = new fltk::Button(20,20,330,380); obj->type(fltk::Button::HIDDEN);
+  obj->callback(doback);
+  obj = but[0] = new fltk::Button(40,90,90,90);
+  obj = but[1] = new fltk::Button(140,90,90,90);
+  obj = but[2] = new fltk::Button(240,90,90,90);
+  obj = but[3] = new fltk::Button(40,190,90,90);
+  obj = but[4] = new fltk::Button(140,190,90,90);
+  obj = but[5] = new fltk::Button(240,190,90,90);
+  obj = but[6] = new fltk::Button(40,290,90,90);
+  obj = but[7] = new fltk::Button(140,290,90,90);
+  obj = but[8] = new fltk::Button(240,290,90,90);
+  for (int i=0; i<9; i++) {
+    but[i]->set_flag(fltk::ALIGN_WRAP);
+    but[i]->callback(dobut, i);
+  }
+  obj = new fltk::Button(130,410,110,30,"Exit");
+  obj->callback(doexit);
+  form->end();
+}
+
+/* Maintaining and building up the menus. */
+
+typedef struct {
+  char name[64];
+  int numb;
+  char iname[9][64];
+  char icommand[9][64];
+} MENU;
+
+#define MAXMENU	32
+
+MENU menus[MAXMENU];
+int mennumb = 0;
+
+int find_menu(const char nnn[])
+/* Returns the number of a given menu name. */
+{
+  int i;
+  for (i=0; i<mennumb; i++)
+    if (strcmp(menus[i].name,nnn) == 0) return i;
+  return -1;
+}
+
+void create_menu(char nnn[])
+/* Creates a new menu with name nnn */
+{
+  if (mennumb == MAXMENU -1) return;
+  strcpy(menus[mennumb].name,nnn);
+  menus[mennumb].numb = 0;
+  mennumb++;
+}
+
+void addto_menu(char men[], char item[], char comm[])
+/* Adds an item to a menu */
+{
+  int n = find_menu(men);
+  if (n<0) { create_menu(men); n = find_menu(men); }
+  if (menus[n].numb == 9) return;
+  strcpy(menus[n].iname[menus[n].numb],item);
+  strcpy(menus[n].icommand[menus[n].numb],comm);
+  menus[n].numb++;
+}
+
+/* Button to Item conversion and back. */
+
+int b2n[][9] = { 
+	{ -1, -1, -1, -1,  0, -1, -1, -1, -1},
+	{ -1, -1, -1,  0, -1,  1, -1, -1, -1},
+	{  0, -1, -1, -1,  1, -1, -1, -1,  2},
+	{  0, -1,  1, -1, -1, -1,  2, -1,  3},
+	{  0, -1,  1, -1,  2, -1,  3, -1,  4},
+	{  0, -1,  1,  2, -1,  3,  4, -1,  5},
+	{  0, -1,  1,  2,  3,  4,  5, -1,  6},
+	{  0,  1,  2,  3, -1,  4,  5,  6,  7},
+	{  0,  1,  2,  3,  4,  5,  6,  7,  8}
+  };
+int n2b[][9] = { 
+	{  4, -1, -1, -1, -1, -1, -1, -1, -1},
+	{  3,  5, -1, -1, -1, -1, -1, -1, -1},
+	{  0,  4,  8, -1, -1, -1, -1, -1, -1},
+	{  0,  2,  6,  8, -1, -1, -1, -1, -1},
+	{  0,  2,  4,  6,  8, -1, -1, -1, -1},
+	{  0,  2,  3,  5,  6,  8, -1, -1, -1},
+	{  0,  2,  3,  4,  5,  6,  8, -1, -1},
+	{  0,  1,  2,  3,  5,  6,  7,  8, -1},
+	{  0,  1,  2,  3,  4,  5,  6,  7,  8}
+  };
+
+int but2numb(int bnumb, int maxnumb)
+/* Transforms a button number to an item number when there are
+   maxnumb items in total. -1 if the button should not exist. */
+ { return b2n[maxnumb][bnumb]; }
+
+int numb2but(int inumb, int maxnumb)
+/* Transforms an item number to a button number when there are
+   maxnumb items in total. -1 if the item should not exist. */
+ { return n2b[maxnumb][inumb]; }
+
+/* Pushing and Popping menus */
+
+char stack[64][32];
+int stsize = 0;
+
+void push_menu(const char nnn[])
+/* Pushes a menu to be visible */
+{
+  int n,i,bn;
+  int men = find_menu(nnn);
+  if (men < 0) return;
+  n = menus[men].numb;
+  for (i=0; i<9; i++) but[i]->hide();
+  for (i=0; i<n; i++)
+  {
+    bn = numb2but(i,n-1);
+    but[bn]->show();
+    but[bn]->label(menus[men].iname[i]);
+  }
+  strcpy(stack[stsize],nnn);
+  stsize++;
+}
+
+void pop_menu()
+/* Pops a menu */
+{
+  if (stsize<=1) return;
+  stsize -= 2;
+  push_menu(stack[stsize]);
+}
+
+/* The callback Routines */
+
+void dobut(fltk::Widget *, long arg)
+/* handles a button push */
+{
+  int men = find_menu(stack[stsize-1]);
+  int n = menus[men].numb;
+  int bn = but2numb( (int) arg, n-1);
+  if (menus[men].icommand[bn][0] == '@')
+    push_menu(menus[men].icommand[bn]);
+  else {
+
+#ifdef _WIN32
+    STARTUPINFO		suInfo;		// Process startup information
+    PROCESS_INFORMATION	prInfo;		// Process information
+
+    memset(&suInfo, 0, sizeof(suInfo));
+    suInfo.cb = sizeof(suInfo);
+
+    int icommand_length = strlen(menus[men].icommand[bn]);
+
+    char* copy_of_icommand = new char[icommand_length+1];
+    strcpy(copy_of_icommand,menus[men].icommand[bn]);
+
+    // On _WIN32 the .exe suffix needs to be appended to the command
+    // whilst leaving any additional parameters unchanged - this
+    // is required to handle the correct conversion of cases such as : 
+    // `../fluid/fluid valuators.fl' to '../fluid/fluid.exe valuators.fl'.
+
+    // skip leading spaces.
+    char* start_command = copy_of_icommand;
+    while(*start_command == ' ') ++start_command;
+
+    // find the space between the command and parameters if one exists.
+    char* start_parameters = strchr(start_command,' ');
+
+    char* command = new char[icommand_length+6]; // 6 for extra 'd.exe\0'
+
+    if (start_parameters==NULL) { // no parameters required.
+#  ifdef _DEBUG
+      sprintf(command, "%sd.exe", start_command);
+#  else
+      sprintf(command, "%s.exe", start_command);
+#  endif // _DEBUG
+    } else { // parameters required.
+      // break the start_command at the intermediate space between
+      // start_command and start_parameters.
+      *start_parameters = 0;
+      // move start_paremeters to skip over the intermediate space.
+      ++start_parameters;
+
+#  ifdef _DEBUG
+      sprintf(command, "%sd.exe %s", start_command, start_parameters);
+#  else
+      sprintf(command, "%s.exe %s", start_command, start_parameters);
+#  endif // _DEBUG
+    }
+
+    CreateProcess(NULL, command, NULL, NULL, FALSE,
+                  NORMAL_PRIORITY_CLASS, NULL, NULL, &suInfo, &prInfo);
+	
+    delete command;
+    delete copy_of_icommand;
+	
+#else // NON _WIN32 systems.
+
+    int icommand_length = strlen(menus[men].icommand[bn]);
+    char* command = new char[icommand_length+5]; // 5 for extra './' and ' &\0' 
+
+    sprintf(command, "./%s &", menus[men].icommand[bn]);
+    system(command);
+
+    delete command;
+#endif // _WIN32
+  }
+}
+
+void doback(fltk::Widget *, void *) {pop_menu();}
+
+void doexit(fltk::Widget *, void *) {exit(0);}
+
+int load_the_menu(const char fname[])
+/* Loads the menu file. Returns whether successful. */
+{
+  FILE *fin;
+  char line[256], mname[64],iname[64],cname[64];
+  int i,j;
+  fin = fopen(fname,"r");
+  if (fin == NULL)
+  {
+//    fltk::show_message("ERROR","","Cannot read the menu description file.");
+    return 0;
+  }
+  for (;;) {
+    if (fgets(line,256,fin) == NULL) break;
+    j = 0; i = 0;
+    while (line[i] == ' ' || line[i] == '\t') i++;
+    if (line[i] == '\n') continue;
+    if (line[i] == '#') continue;
+    while (line[i] != ':' && line[i] != '\n') mname[j++] = line[i++];
+    mname[j] = '\0';
+    if (line[i] == ':') i++;
+    j = 0; 
+    while (line[i] != ':' && line[i] != '\n')
+    {
+      if (line[i] == '\\') {
+	i++;
+	if (line[i] == 'n') iname[j++] = '\n';
+	else iname[j++] = line[i];
+	i++;
+      } else
+        iname[j++] = line[i++];
+    }
+    iname[j] = '\0';
+    if (line[i] == ':') i++;
+    j = 0;
+    while (line[i] != ':' && line[i] != '\n') cname[j++] = line[i++];
+    cname[j] = '\0';
+    addto_menu(mname,iname,cname);
+  }
+  fclose(fin);
+  return 1;
+}
+
+int main(int argc, char **argv) {
+  create_the_forms();
+  char buf[256];
+  if (argv[0] && *argv[0]) strcpy(buf, argv[0]);
+  else                     strcpy(buf, "demo");
+  char *epos = (char*)fltk::filename_ext(buf);
+  if (tolower(*(epos-1))=='d') epos--; // Handle the debug 'demod' case
+  strcpy(epos,".menu");
+  const char *fname = buf;
+  int i = 0;
+  if (!fltk::args(argc,argv,i) || i < argc-1)
+    fltk::fatal("Usage: %s <switches> <menufile>\n%s",fltk::help);
+  if (i < argc) fname = argv[i];
+  if (!load_the_menu(fname)) fltk::fatal("Can't open %s",fname);
+  strcpy(buf,fname);
+  const char *c = fltk::filename_name(buf);
+  if (c > buf) {buf[c-buf] = 0; chdir(buf);}
+  push_menu("@main");
+  form->show(argc,argv);
+  fltk::run();
+  return 0;
+}
+
+//
+// End of "$Id: demo.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $".
+//
+

Added: branches/branch-3.0/test2/demo.menu
===================================================================
--- branches/branch-3.0/test2/demo.menu	                        (rev 0)
+++ branches/branch-3.0/test2/demo.menu	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,82 @@
+# Menu description file for the generic demo program
+#
+# Each line consists of three fields, separated by :
+#
+# - menu name	: To which the item belongs (starts with @)
+# - item name	: Placed on button. (use \n for newline)
+# - command name: To be executed. Use a menu name to define a submenu.
+#
+# @main indicates the main menu.
+#
+
+@main:Widget\nTests:@x
+	@x:Browser:browser
+	@x:Input:input
+	@x:Output:output
+	@x:Buttons:buttons
+	@x:TabGroup:tabs
+	@x:TiledGroup:tile
+	@x:ScrollGroup:scroll
+	@x:PackedGroup:pack
+	@x:Menu:menubar
+
+@main:Window\nTests:@w
+	@w:overlay:overlay
+	@w:subwindow:subwindow
+	@w:double\nbuffer:doublebuffer
+	@w:GL window:cube
+	@w:GL overlay:gl_overlay
+	@w:iconize:iconize
+	@w:fullscreen:fullscreen
+	@w:resizable:resizable
+	@w:program\nresize:resize
+
+@main:Drawing\nTests:@d
+	@d:text labels:label
+	@d:Image\nlabels:image
+#	@d:pixmap\nbrowser:pixmap_browser
+	@d:cursor:cursor
+	@d:addarc():arc
+	@d:addcurve():curve
+	@d:line_style():line_style
+	@d:fonts:fonts
+
+@main:Events:@u
+	@u:navigation:navigation
+	@u:keyboard:keyboard
+	@u:fast & slow widgets:fast_slow
+	@u:inactive:inactive
+
+@main:Fluid\n(UI design tool):../fluid/fluid2 valuators.fl
+
+@main:Nice\nDemos:@e
+	@e:X Color\nBrowser:../forms/colbrowser
+	@e:Mandelbrot:mandelbrot
+	@e:Fractals:fractals
+	@e:Puzzle:glpuzzle
+	@e:Checkers:checkers
+	@e:Qubix:qubix
+
+@main:Other\nTests:@o
+	@o:color choosers:color_chooser r
+	@o:file chooser:file_chooser
+	@o:XForms Emulation:../forms/forms
+	@o:WizardGroup:wizard
+	@o:TiledImage:button
+
+@main:Tutorial\nfrom\nManual:@j
+	@j:ask\n(modified):ask
+	@j:button:button
+	@j:CubeView:CubeView
+	@j:editor:editor editor.cxx
+	@j:hello:hello
+	@j:drawing:drawing
+	@j:shape:shape
+
+@main:Images\nfor\nManual:@i
+	@i:valuators:valuators
+	@i:symbols:symbols
+	@i:buttons:buttons
+	@i:clock:clock
+	@i:popups:message
+	@i:boxtypes:boxtype

Added: branches/branch-3.0/test2/dnd.cxx
===================================================================
--- branches/branch-3.0/test2/dnd.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/dnd.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,83 @@
+#include <fltk/run.h>
+#include <fltk/Window.h>
+#include <fltk/events.h>
+#include <fltk/string.h>
+#include <fltk/MultiLineOutput.h>
+#include <stdio.h>
+
+using namespace fltk;
+
+Widget* bluewidget = 0;
+Widget* greenwidget = 0;
+MultiLineOutput* output = 0;
+
+class DNDTarget : public Widget {
+public:
+  int handle(int event) {
+    switch (event) {
+    case PUSH:
+      //printf("%s : starting dnd()\n", label());
+      if (greenwidget) {
+        greenwidget->color(0); greenwidget->redraw(); greenwidget = 0;
+      }
+      bluewidget = this; color(12); redraw();
+      fltk::copy(label(), strlen(label()));
+      fltk::dnd();
+      bluewidget = 0;
+      if (this != greenwidget) {color(0); redraw();}
+      return true;
+    case DND_ENTER:
+      if (greenwidget) {
+        greenwidget->color(0); greenwidget->redraw(); greenwidget = 0;
+      }
+      //printf("%s : DND_ENTER\n", label());
+      color(RED); redraw();
+      return 1;
+    case DND_DRAG:
+      // bug? You must implement this and return 1 or drop will not happen
+      return 1;
+    case DND_LEAVE:
+      //printf("%s : DND_LEAVE\n", label());
+      color(this==bluewidget ? 12 : 0); redraw();
+      return 1;
+    case DND_RELEASE:
+      //printf("%s : DND_RELEASE\n", label());
+      color(10); redraw(); // this should never be seen as paste replaces it!
+      return 1;
+    case PASTE:
+      //printf("%s : PASTE '%s'\n", label(), fltk::event_text());
+      greenwidget = this; color(GREEN); redraw();
+      ::output->text(fltk::event_text());
+      return 1;
+    default:
+      return Widget::handle(event);
+    }
+  }
+
+  DNDTarget(int x, int y, int w, int h, const char* l) :
+    Widget(x,y,w,h) { copy_label(l); }
+};
+
+#define SIZE 30
+#define BORDER 10
+#define NUM 5
+
+int main(int argc, char** argv) {
+  Window window(NUM*(SIZE+BORDER)+BORDER,
+                NUM*(SIZE+BORDER)+BORDER+50+2*BORDER);
+  window.begin();
+  for (int y = 0; y < NUM; y++) {
+    for (int x = 0; x < NUM; x++) {
+      char buf[100];
+      sprintf(buf, "%d", x+NUM*y+1);
+      new DNDTarget(BORDER+x*(SIZE+BORDER), BORDER+y*(SIZE+BORDER),
+                    SIZE, SIZE, buf);
+    }
+  }
+  output = new MultiLineOutput(BORDER, 2*BORDER+NUM*(SIZE+BORDER),
+                               NUM*(SIZE+BORDER)-BORDER, 50,
+                               "Last paste:");
+  output->align(fltk::ALIGN_TOP|fltk::ALIGN_LEFT);
+  window.show(argc, argv);
+  return fltk::run();
+}

Added: branches/branch-3.0/test2/doublebuffer.cxx
===================================================================
--- branches/branch-3.0/test2/doublebuffer.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/doublebuffer.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,177 @@
+//
+// "$Id: doublebuffer.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $"
+//
+// Test of double_buffer and overlay of Windows.
+// This demo shows how double buffering helps, by drawing the
+// window in a particularily bad way.
+//
+// The single-buffered window will blink as it updates.  The
+// double buffered one will not.  It will take just as long
+// (or longer) to update, but often it will appear to be faster.
+//
+// Copyright 1998-2006 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+//    http://www.fltk.org/str.php
+//
+
+#include <fltk/run.h>
+#include <fltk/Window.h>
+#include <fltk/draw.h>
+#include <fltk/Slider.h>
+#include <fltk/CheckButton.h>
+#include <fltk/visual.h>
+#include <fltk/math.h>
+#include <stdio.h>
+
+using namespace fltk;
+
+int sides = 20;
+int overlay_sides = 20;
+
+class BlinkWindow : public Window {
+
+  void draw() {
+    setcolor(BLACK);
+    fillrect(0,0,w(),h());
+    push_matrix();
+    translate(w()/2, h()/2);
+    scale(w()/2, h()/2);
+    int n = sides;
+    for (int i = 0; i < n; i++) {
+      for (int j = i+1; j < n; j++) {
+	setcolor((i+j)%(5*8*5)+BLACK); // random color from cube
+	fltk::addvertex(float(cosf(2*M_PI*(j-1)/n+.1)),
+                        float(sinf(2*M_PI*(j-1)/n+.1)));
+	fltk::addvertex(float(cosf(2*M_PI*i/n+.1)),
+                        float(sinf(2*M_PI*i/n+.1)));
+	fltk::addvertex(float(cosf(2*M_PI*j/n+.1)),
+                        float(sinf(2*M_PI*j/n+.1)));
+	fillstrokepath(WHITE);
+      }
+    }
+    pop_matrix();
+    char buffer[128];
+    sprintf(buffer,"FLTK doublebuffer demo. This image has %d outlined triangles", n*(n-1)/2);
+    setfont(HELVETICA_BOLD_ITALIC, 24);
+    setcolor(BLACK);
+    drawtext(buffer,Rectangle(10,h()/2,w()-20,h()/2),ALIGN_WRAP|ALIGN_TOP);
+  }
+
+  void draw_overlay() {
+    setcolor(RED);
+    push_matrix();
+    translate(w()/2, h()/2);
+    scale(w()/2, h()/2);
+    int n = overlay_sides;
+    for (int i = 0; i < n; i++) {
+      for (int j = i+1; j < n; j++) {
+        fltk::addvertex(float(cosf(2*M_PI*(j-1)/n+.1)),
+                        float(sinf(2*M_PI*(j-1)/n+.1)));
+	fltk::addvertex(float(cosf(2*M_PI*i/n+.1)),
+                        float(sinf(2*M_PI*i/n+.1)));
+	fltk::addvertex(float(cosf(2*M_PI*j/n+.1)),
+                        float(sinf(2*M_PI*j/n+.1)));
+	strokepath();
+      }
+    }
+    pop_matrix();
+  }
+
+public:
+  BlinkWindow(int x, int y, int w, int h) : Window(x,y,w,h) {}
+} *blinkwindow;
+
+void db_cb(Widget* o) {
+  if (((Button*)o)->value()) blinkwindow->set_double_buffer();
+  else blinkwindow->clear_double_buffer();
+}
+
+bool overlay = false;
+
+void ovl_cb(Widget* o) {
+  overlay = ((Button*)o)->value();
+  if (overlay) blinkwindow->redraw_overlay();
+  else blinkwindow->erase_overlay();
+}
+
+void slider_cb(Widget* o) {
+  sides = int(((Slider*)o)->value());
+  blinkwindow->redraw();
+}
+
+void oslider_cb(Widget* o) {
+  overlay_sides = int(((Slider*)o)->value());
+  if (overlay) blinkwindow->redraw_overlay();
+}
+
+int main(int argc, char** argv) {
+  if (!visual(DOUBLE_BUFFER))
+    printf("Xdbe not supported, faking double buffer with pixmaps.\n");
+  Window window(420,420+3*25);
+  window.begin();
+  blinkwindow = new BlinkWindow(10,10,400,400);
+  blinkwindow->tooltip("This graphic is designed to blink in a nasty way "
+		       "when redrawing. Try moving the sliders or resizing "
+		       "the window.\n\n"
+		       "Turn on the double buffer checkmark to hide the "
+		       "blinking.");
+  int y = 420;
+  Slider slider0(60,y,340,22,"sides:");
+  slider0.tooltip("Redraw above graphic with this many slides");
+  slider0.align(ALIGN_LEFT);
+  slider0.type(Slider::TICK_ABOVE);
+  slider0.callback(slider_cb);
+  y += 25;
+  Slider slider1(60,y,340,22,"overlay:");
+  slider1.tooltip("Redraw red overlay if the overlay checkmark is turned on.");
+  slider1.callback(oslider_cb);
+  slider1.align(ALIGN_LEFT);
+  slider1.type(Slider::TICK_ABOVE);
+  y += 25;
+  CheckButton b1(60,y,150,25,"double buffer");
+  b1.tooltip("Turns on double-buffer mode in the above window for smooth "
+	     "update. Notice that not only does it not blink, it also "
+	     "@i;looks@n; faster (even though it really is the same speed "
+	     "or slower)");
+  b1.callback(db_cb);
+  if (window.double_buffer()) b1.set();
+  CheckButton b2(60+150,y,150,25,"overlay");
+  b2.tooltip("Turns on a red overlay in above window. This is redrawn "
+	     "without having to redraw the basic image, so changes to it "
+	     "will be faster (probably not noticable on modern computers).\n\n"
+	     "Notice that the overlay will blink if the window is resized "
+	     "or the graphic is complex. It is designed for simple temporary "
+	     "things like mouse selection rectangles.");
+  b2.callback(ovl_cb);
+  window.end();
+  window.resizable(blinkwindow);
+  slider0.range(2,30);
+  slider0.step(1);
+  slider0.value(sides);
+  slider1.range(2,30);
+  slider1.step(1);
+  slider1.value(overlay_sides);
+  window.show(argc, argv);
+  return run();
+}
+
+//
+// End of "$Id: doublebuffer.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $".
+//

Added: branches/branch-3.0/test2/drawing.cxx
===================================================================
--- branches/branch-3.0/test2/drawing.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/drawing.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,85 @@
+// drawing.cxx (example4)
+
+#include <fltk/run.h>
+#include <fltk/Window.h>
+#include <fltk/Widget.h>
+#include <fltk/Slider.h>
+#include <fltk/math.h>
+#include <fltk/draw.h>
+#include <fltk/string.h> // for snprintf
+
+using namespace fltk;
+
+class ShapeWidget : public Widget {
+  int sides_;
+
+  void draw() {
+    setcolor(BLACK);
+    fillrect(0,0,w(),h());
+    push_matrix();
+    scale(w()/2.0f, h()/2.0f);
+    translate(1,1);
+    setcolor(0x8098b000);
+    int i; for (i=0; i<sides(); i++) {
+      double ang = i*2*M_PI/sides();
+      addvertex(cosf(ang),sinf(ang));
+    }
+    fillstrokepath(WHITE);
+    pop_matrix();
+    setfont(labelfont(), labelsize());
+    setcolor(WHITE);
+    char buf[200];
+    double ang = 2*M_PI/sides();
+    snprintf(buf, 200,
+	     "%d sides\n"
+	     "Angle between sides = %g�\n"
+	     "Length of side = %g\n"
+	     "Perimiter = %g\n"
+	     "Area = %g",
+	     i,
+	     360.0/i,
+	     sqrt(2-2*cos(ang)),
+	     sides()*sqrt(2-2*cos(ang)),
+	     sides()*sin(ang)/2);
+    drawtext(buf, Rectangle(w(),h()), ALIGN_WRAP);
+  }
+
+
+public:
+
+  inline int sides() const {return sides_;}
+
+  void sides(int n) {
+    if (sides_ != n) {sides_ = n; redraw();}
+  }
+
+  ShapeWidget(int x,int y,int w,int h,const char *l=0) :
+    Widget(x,y,w,h,l), sides_(3) {}
+
+};
+
+static void slider_callback(Widget* widget, void* data) {
+  ((ShapeWidget*)data)->sides(int(((Slider*)widget)->value()));
+}
+
+int main(int argc, char **argv) {
+
+  Window window(300, 330);
+  window.begin();
+
+  ShapeWidget sw(10, 10, 280, 280);
+  window.resizable(&sw);
+
+  Slider slider(50, 295, window.w()-60, 30, "Sides:");
+  slider.clear_flag(ALIGN_MASK);
+  slider.set_flag(ALIGN_LEFT);
+  slider.callback(slider_callback, &sw);
+  slider.value(sw.sides());
+  slider.step(1);
+  slider.range(3,40);
+
+  window.end();
+  window.show(argc,argv);
+    
+  return run();
+}

Added: branches/branch-3.0/test2/drawtiming.cxx
===================================================================
--- branches/branch-3.0/test2/drawtiming.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/drawtiming.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,96 @@
+// Test of how fast drawing is in various scenarios
+// Requires X because it uses XSync
+
+#include <fltk/run.h>
+#include <fltk/Window.h>
+#include <fltk/x.h>
+#include <fltk/draw.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+using namespace fltk;
+
+class TestWindow : public fltk::Window {
+  int test;
+  int iter;
+public:
+  TestWindow(int t) : Window(300,300), test(t) {
+    if (t&1) set_double_buffer(); else clear_double_buffer();
+    iter = 1;
+  }
+  void draw();
+};
+
+void TestWindow::draw() {
+  char buffer[128];
+  sprintf(buffer, "Redraw number %d, text in the widget is clipped off somewhere on the right",
+	  ++iter);
+  if (test&2) { // new version
+    setcolor(GRAY75);
+    fillrect(0,0,w(),h());
+    for (int y = 10; y+21 < h(); y+=25) {
+      int X = 5+y/10;
+      int Y = y;
+      int W = w()-5-X;
+      int H = 21;
+      push_clip(X,Y,W,H);
+      setcolor(BLACK);
+      fillrect(X,Y,W,H);
+      if (y < 11) {
+	setcolor(WHITE);
+	setfont(fltk::HELVETICA,12);
+	drawtext(buffer,X+3,Y+16);
+      }
+      pop_clip();
+    }
+  } else {
+    // clip-out version:
+    push_clip(0,0,w(),h());
+    for (int y = 10; y+21 < h(); y+=25) {
+      int X = 5+y/10;
+      int Y = y;
+      int W = w()-5-X;
+      int H = 21;
+      push_clip(X,Y,W,H);
+      setcolor(BLACK);
+      fillrect(X,Y,W,H);
+      if (y < 11) {
+	setcolor(WHITE);
+	setfont(fltk::HELVETICA,12);
+	drawtext(buffer,X+3,Y+16);
+      }
+      pop_clip();
+      clipout(Rectangle(X,Y,W,H));
+    }
+    setcolor(GRAY75);
+    fillrect(0,0,w(),h());
+    pop_clip();
+  }
+}
+
+int main(int argc, char** argv) {
+  int m; int n = fltk::args(argc, argv, m);
+  if (n != argc-2) {
+    fprintf(stderr, "%s\nAdd test number and number of interations:\n"
+	    " 0 = single buffer + clip out\n"
+	    " 1 = double buffer + clip out\n"
+	    " 2 = single buffer with overlapping rectangles\n"
+	    " 3 = double buffer with overlapping rectangles\n",
+	    fltk::help);
+    exit(1);
+  }
+  TestWindow window(atoi(argv[n]));
+  int iterations = atoi(argv[n+1]);
+  double dt = get_time_secs();
+  printf("iterations = %d\n", iterations);
+  window.show(argc, argv);
+  while (window.damage()) fltk::wait();
+  for (int i=0; i < iterations; i++) {
+    window.redraw();
+    fltk::check();
+  }
+  dt = get_time_secs() - dt;
+  printf("time elapsed = %4.6lf secs\n",dt);
+  return 0;
+}
+

Added: branches/branch-3.0/test2/editor.cxx
===================================================================
--- branches/branch-3.0/test2/editor.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/editor.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,808 @@
+//
+// "$Id: editor.cxx 8662 2011-05-15 06:04:24Z bgbnbigben $"
+//
+// A simple text editor program for the Fast Light Tool Kit (FLTK).
+//
+// This program is described in Chapter 4 of the FLTK Programmer's Guide.
+//
+// Copyright 1998-2006 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+//
+// Include necessary headers...
+//
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <errno.h>
+
+#include <fltk/run.h>
+#include <fltk/events.h>
+#include <fltk/Group.h>
+#include <fltk/Window.h>
+#include <fltk/ask.h>
+#include <fltk/file_chooser.h>
+#include <fltk/Input.h>
+#include <fltk/Button.h>
+#include <fltk/ReturnButton.h>
+#include <fltk/TextBuffer.h>
+#include <fltk/TextEditor.h>
+#include <fltk/MenuBuild.h>
+
+int                changed = 0;
+char               filename[256] = "";
+char               title[256];
+fltk::TextBuffer     *textbuf = 0;
+
+
+// Syntax highlighting stuff...
+fltk::TextBuffer     *stylebuf = 0;
+fltk::TextDisplay::StyleTableEntry
+                   styletable[] = {	// Style table
+		     { fltk::BLACK,           fltk::COURIER,        12 }, // A - Plain
+		     { fltk::DARK_GREEN,      fltk::COURIER_ITALIC, 12 }, // B - Line comments
+		     { fltk::DARK_GREEN,      fltk::COURIER_ITALIC, 12 }, // C - Block comments
+		     { fltk::BLUE,            fltk::COURIER,        12 }, // D - Strings
+		     { fltk::DARK_RED,        fltk::COURIER,        12 }, // E - Directives
+		     { fltk::DARK_RED,        fltk::COURIER_BOLD,   12 }, // F - Types
+		     { fltk::BLUE,            fltk::COURIER_BOLD,   12/*, fltk::TextDisplay::ATTR_UNDERLINE*/ }  // G - Keywords
+		   };
+const char         *code_keywords[] = {	// List of known C/C++ keywords...
+		     "and",
+		     "and_eq",
+		     "asm",
+		     "bitand",
+		     "bitor",
+		     "break",
+		     "case",
+		     "catch",
+		     "compl",
+		     "continue",
+		     "default",
+		     "delete",
+		     "do",
+		     "else",
+		     "false",
+		     "for",
+		     "goto",
+		     "if",
+		     "new",
+		     "not",
+		     "not_eq",
+		     "operator",
+		     "or",
+		     "or_eq",
+		     "return",
+		     "switch",
+		     "template",
+		     "this",
+		     "throw",
+		     "true",
+		     "try",
+		     "using",
+		     "while",
+		     "xor",
+		     "xor_eq"
+		   };
+const char         *code_types[] = {	// List of known C/C++ types...
+		     "auto",
+		     "bool",
+		     "char",
+		     "class",
+		     "const",
+		     "const_cast",
+		     "double",
+		     "dynamic_cast",
+		     "enum",
+		     "explicit",
+		     "extern",
+		     "float",
+		     "friend",
+		     "inline",
+		     "int",
+		     "long",
+		     "mutable",
+		     "namespace",
+		     "private",
+		     "protected",
+		     "public",
+		     "register",
+		     "short",
+		     "signed",
+		     "sizeof",
+		     "static",
+		     "static_cast",
+		     "struct",
+		     "template",
+		     "typedef",
+		     "typename",
+		     "union",
+		     "unsigned",
+		     "virtual",
+		     "void",
+		     "volatile"
+		   };
+
+
+//
+// 'compare_keywords()' - Compare two keywords...
+//
+
+extern "C" {
+  int
+  compare_keywords(const void *a,
+                   const void *b) {
+    return (strcmp(*((const char **)a), *((const char **)b)));
+  }
+}
+
+//
+// 'style_parse()' - Parse text and produce style data.
+//
+
+void
+style_parse(const char *text,
+            char       *style,
+	    int        length) {
+  char	     current;
+  int	     col;
+  int	     last;
+  char	     buf[255],
+             *bufptr;
+  const char *temp;
+
+  // Style letters:
+  //
+  // A - Plain
+  // B - Line comments
+  // C - Block comments
+  // D - Strings
+  // E - Directives
+  // F - Types
+  // G - Keywords
+
+  for (current = *style, col = 0, last = 0; length > 0; length --, text ++) {
+    if (current == 'B' || current == 'F' || current == 'G') current = 'A';
+    if (current == 'A') {
+      // Check for directives, comments, strings, and keywords...
+      if (col == 0 && *text == '#') {
+        // Set style to directive
+        current = 'E';
+      } else if (strncmp(text, "//", 2) == 0) {
+        current = 'B';
+	for (; length > 0 && *text != '\n'; length --, text ++) *style++ = 'B';
+
+        if (length == 0) break;
+      } else if (strncmp(text, "/*", 2) == 0) {
+        current = 'C';
+      } else if (strncmp(text, "\\\"", 2) == 0) {
+        // Quoted quote...
+	*style++ = current;
+	*style++ = current;
+	text ++;
+	length --;
+	col += 2;
+	continue;
+      } else if (*text == '\"') {
+        current = 'D';
+      } else if (!last && (islower(*text) || *text == '_')) {
+        // Might be a keyword...
+	for (temp = text, bufptr = buf;
+	     (islower(*temp) || *temp == '_') && bufptr < (buf + sizeof(buf) - 1);
+	     *bufptr++ = *temp++);
+
+        if (!islower(*temp) && *temp != '_') {
+	  *bufptr = '\0';
+
+          bufptr = buf;
+
+	  if (bsearch(&bufptr, code_types,
+	              sizeof(code_types) / sizeof(code_types[0]),
+		      sizeof(code_types[0]), compare_keywords)) {
+	    while (text < temp) {
+	      *style++ = 'F';
+	      text ++;
+	      length --;
+	      col ++;
+	    }
+
+	    text --;
+	    length ++;
+	    last = 1;
+	    continue;
+	  } else if (bsearch(&bufptr, code_keywords,
+	                     sizeof(code_keywords) / sizeof(code_keywords[0]),
+		             sizeof(code_keywords[0]), compare_keywords)) {
+	    while (text < temp) {
+	      *style++ = 'G';
+	      text ++;
+	      length --;
+	      col ++;
+	    }
+
+	    text --;
+	    length ++;
+	    last = 1;
+	    continue;
+	  }
+	}
+      }
+    } else if (current == 'C' && strncmp(text, "*/", 2) == 0) {
+      // Close a C comment...
+      *style++ = current;
+      *style++ = current;
+      text ++;
+      length --;
+      current = 'A';
+      col += 2;
+      continue;
+    } else if (current == 'D') {
+      // Continuing in string...
+      if (strncmp(text, "\\\"", 2) == 0) {
+        // Quoted end quote...
+	*style++ = current;
+	*style++ = current;
+	text ++;
+	length --;
+	col += 2;
+	continue;
+      } else if (*text == '\"') {
+        // End quote...
+	*style++ = current;
+	col ++;
+	current = 'A';
+	continue;
+      }
+    }
+
+    // Copy style info...
+    if (current == 'A' && (*text == '{' || *text == '}')) *style++ = 'G';
+    else *style++ = current;
+    col ++;
+
+    last = isalnum(*text) || *text == '_' || *text == '.';
+
+    if (*text == '\n') {
+      // Reset column and possibly reset the style
+      col = 0;
+      if (current == 'B' || current == 'E') current = 'A';
+    }
+  }
+}
+
+
+//
+// 'style_init()' - Initialize the style buffer...
+//
+
+void
+style_init(void) {
+  char *style = new char[textbuf->length() + 1];
+  const char *text = textbuf->text();
+
+  memset(style, 'A', textbuf->length());
+  style[textbuf->length()] = '\0';
+
+  if (!stylebuf) stylebuf = new fltk::TextBuffer(textbuf->length());
+
+  style_parse(text, style, textbuf->length());
+
+  stylebuf->text(style);
+  delete[] style;
+}
+
+
+//
+// 'style_unfinished_cb()' - Update unfinished styles.
+//
+
+void
+style_unfinished_cb(int, void*) {
+}
+
+
+//
+// 'style_update()' - Update the style buffer...
+//
+
+void
+style_update(int        pos,		// I - Position of update
+             int        nInserted,	// I - Number of inserted chars
+	     int        nDeleted,	// I - Number of deleted chars
+             int        /*nRestyled*/,	// I - Number of restyled chars
+	     const char * /*deletedText*/,// I - Text that was deleted
+             void       *cbArg) {	// I - Callback data
+  int	start,				// Start of text
+	end;				// End of text
+  char	last,				// Last style on line
+	*style,				// Style data
+	*text;				// Text data
+
+
+  // If this is just a selection change, just unselect the style buffer...
+  if (nInserted == 0 && nDeleted == 0) {
+    stylebuf->unselect();
+    return;
+  }
+
+  // Track changes in the text buffer...
+  if (nInserted > 0) {
+    // Insert characters into the style buffer...
+    style = new char[nInserted + 1];
+    memset(style, 'A', nInserted);
+    style[nInserted] = '\0';
+
+    stylebuf->replace(pos, pos + nDeleted, style);
+    delete[] style;
+  } else {
+    // Just delete characters in the style buffer...
+    stylebuf->remove(pos, pos + nDeleted);
+  }
+
+  // Select the area that was just updated to avoid unnecessary
+  // callbacks...
+  stylebuf->select(pos, pos + nInserted - nDeleted);
+
+  // Re-parse the changed region; we do this by parsing from the
+  // beginning of the previous line of the changed region to the end of
+  // the line of the changed region...  Then we check the last
+  // style character and keep updating if we have a multi-line
+  // comment character...
+  start = textbuf->line_start(pos);
+//  if (start > 0) start = textbuf->line_start(start - 1);
+  end   = textbuf->line_end(pos + nInserted);
+  text  = textbuf->text_range(start, end);
+  style = stylebuf->text_range(start, end);
+  if (start==end)
+    last = 0;
+  else
+    last  = style[end - start - 1];
+
+//  printf("start = %d, end = %d, text = \"%s\", style = \"%s\", last='%c'...\n",
+//         start, end, text, style, last);
+
+  style_parse(text, style, end - start);
+
+//  printf("new style = \"%s\", new last='%c'...\n",
+//         style, style[end - start - 1]);
+
+  stylebuf->replace(start, end, style);
+  ((fltk::TextEditor *)cbArg)->redisplay_range(start, end);
+
+  if (start==end || last != style[end - start - 1]) {
+//    printf("Recalculate the rest of the buffer style\n");
+    // Either the user deleted some text, or the last character
+    // on the line changed styles, so reparse the
+    // remainder of the buffer...
+    free(text);
+    free(style);
+
+    end   = textbuf->length();
+    text  = textbuf->text_range(start, end);
+    style = stylebuf->text_range(start, end);
+
+    style_parse(text, style, end - start);
+
+    stylebuf->replace(start, end, style);
+    ((fltk::TextEditor *)cbArg)->redisplay_range(start, end);
+  }
+
+  free(text);
+  free(style);
+}
+
+
+// Editor window functions and class...
+void save_cb();
+void saveas_cb();
+void find2_cb(fltk::Widget*, void*);
+void replall_cb(fltk::Widget*, void*);
+void replace2_cb(fltk::Widget*, void*);
+void replcan_cb(fltk::Widget*, void*);
+
+class EditorWindow : public fltk::Window {
+  public:
+    EditorWindow(int w, int h, const char* t);
+    ~EditorWindow();
+
+    fltk::Window          *replace_dlg;
+    fltk::Input           *replace_find;
+    fltk::Input           *replace_with;
+    fltk::Button          *replace_all;
+    fltk::ReturnButton   *replace_next;
+    fltk::Button          *replace_cancel;
+
+    fltk::TextEditor     *editor;
+    char               search[256];
+};
+
+EditorWindow::EditorWindow(int w, int h, const char* t) : fltk::Window(w, h, t) {
+  replace_dlg = new fltk::Window(300, 105, "Replace");
+  replace_dlg->begin();
+    replace_find = new fltk::Input(80, 10, 210, 25, "Find:");
+    replace_find->align(fltk::ALIGN_LEFT);
+
+    replace_with = new fltk::Input(80, 40, 210, 25, "Replace:");
+    replace_with->align(fltk::ALIGN_LEFT);
+
+    replace_all = new fltk::Button(10, 70, 90, 25, "Replace All");
+    replace_all->callback((fltk::Callback *)replall_cb, this);
+
+    replace_next = new fltk::ReturnButton(105, 70, 120, 25, "Replace Next");
+    replace_next->callback((fltk::Callback *)replace2_cb, this);
+
+    replace_cancel = new fltk::Button(230, 70, 60, 25, "Cancel");
+    replace_cancel->callback((fltk::Callback *)replcan_cb, this);
+  replace_dlg->end();
+  replace_dlg->set_non_modal();
+  editor = 0;
+  *search = (char)0;
+}
+
+EditorWindow::~EditorWindow() {
+  delete replace_dlg;
+}
+
+int check_save(void) {
+  if (!changed) return 1;
+
+  int r = fltk::choice("The current file has not been saved.\n"
+                    "Would you like to save it now?",
+                    "Don't Save", "Save", "Cancel");
+
+  if (r == 1) {
+    save_cb(); // Save the file...
+    return !changed;
+  }
+
+  return (r == 2) ? 1 : 0;
+}
+
+int loading = 0;
+void load_file(const char *newfile, int ipos) {
+  loading = 1;
+  int insert = (ipos != -1);
+  changed = insert;
+  if (!insert) strcpy(filename, "");
+  int r;
+  if (!insert) r = textbuf->loadfile(newfile);
+  else r = textbuf->insertfile(newfile, ipos);
+  if (r) {
+    if (fltk::ask("File '%s' does not exit. Do you want to create one?", newfile))
+      strcpy(filename, newfile);
+    else
+      strcpy(filename, "");
+  } // if
+  else
+    if (!insert) strcpy(filename, newfile);
+  loading = 0;
+  textbuf->call_modify_callbacks();
+}
+
+void save_file(const char *newfile) {
+  if (textbuf->savefile(newfile))
+    fltk::alert("Error writing to file \'%s\':\n%s.", newfile, strerror(errno));
+  else
+    strcpy(filename, newfile);
+  changed = 0;
+  textbuf->call_modify_callbacks();
+}
+
+void copy_cb(fltk::Widget*, void* v) {
+  EditorWindow* e = (EditorWindow*)v;
+  fltk::TextEditor::kf_copy(0, e->editor);
+}
+
+void cut_cb(fltk::Widget*, void* v) {
+  EditorWindow* e = (EditorWindow*)v;
+  fltk::TextEditor::kf_cut(0, e->editor);
+}
+
+void delete_cb(fltk::Widget*, void*) {
+  textbuf->remove_selection();
+}
+
+void find_cb(fltk::Widget* w, void* v) {
+  EditorWindow* e = (EditorWindow*)v;
+  const char *val;
+
+  val = fltk::input("Search String:", e->search);
+  if (val != NULL) {
+    // User entered a string - go find it!
+    strcpy(e->search, val);
+    find2_cb(w, v);
+  }
+}
+
+void find2_cb(fltk::Widget* w, void* v) {
+  EditorWindow* e = (EditorWindow*)v;
+  if (e->search[0] == '\0') {
+    // Search string is blank; get a new one...
+    find_cb(w, v);
+    return;
+  }
+
+  int pos = e->editor->insert_position();
+  int found = textbuf->search_forward(pos, e->search, &pos);
+  if (found) {
+    // Found a match; select and update the position...
+    textbuf->select(pos, pos+strlen(e->search));
+    e->editor->insert_position(pos+strlen(e->search));
+    e->editor->show_insert_position();
+  }
+  else fltk::alert("No occurrences of \'%s\' found!", e->search);
+}
+
+void set_title(fltk::Window* w) {
+  if (filename[0] == '\0') strcpy(title, "Untitled.txt");
+  else {
+    char *slash;
+    slash = strrchr(filename, '/');
+#ifdef WIN32
+    if (slash == NULL) slash = strrchr(filename, '\\');
+#endif
+    if (slash != NULL) strcpy(title, slash + 1);
+    else strcpy(title, filename);
+  }
+
+  if (changed) strcat(title, " (modified)");
+
+  w->label(title);
+}
+
+void changed_cb(int, int nInserted, int nDeleted,int, const char*, void* v) {
+  if ((nInserted || nDeleted) && !loading) changed = 1;
+  EditorWindow *w = (EditorWindow *)v;
+  set_title(w);
+  if (loading) w->editor->show_insert_position();
+}
+
+void new_cb(fltk::Widget*, void*) {
+  if (!check_save()) return;
+
+  filename[0] = '\0';
+  textbuf->select(0, textbuf->length());
+  textbuf->remove_selection();
+  changed = 0;
+  textbuf->call_modify_callbacks();
+}
+
+void open_cb(fltk::Widget*, void*) {
+  if (!check_save()) return;
+
+  const char *newfile = fltk::file_chooser("Open File?", "*", filename);
+  if (newfile != NULL) load_file(newfile, -1);
+}
+
+void insert_cb(fltk::Widget*, void *v) {
+  const char *newfile = fltk::file_chooser("Insert File?", "*", filename);
+  EditorWindow *w = (EditorWindow *)v;
+  if (newfile != NULL) load_file(newfile, w->editor->insert_position());
+}
+
+void paste_cb(fltk::Widget*, void* v) {
+  EditorWindow* e = (EditorWindow*)v;
+  fltk::TextEditor::kf_paste(0, e->editor);
+}
+
+int num_windows = 0;
+
+void close_cb(fltk::Widget*, void* v) {
+  fltk::Window* w = (fltk::Window*)v;
+  if (num_windows == 1 && !check_save()) {
+    return;
+  }
+
+  w->hide();
+  textbuf->remove_modify_callback(changed_cb, w);
+  delete w;
+  num_windows--;
+  if (!num_windows) exit(0);
+}
+
+void quit_cb(fltk::Widget*, void*) {
+  if (changed && !check_save())
+    return;
+
+  exit(0);
+}
+
+void replace_cb(fltk::Widget*, void* v) {
+  EditorWindow* e = (EditorWindow*)v;
+  e->replace_dlg->show();
+}
+
+void replace2_cb(fltk::Widget*, void* v) {
+  EditorWindow* e = (EditorWindow*)v;
+  const char *find = e->replace_find->text();
+  const char *replace = e->replace_with->text();
+
+  if (find[0] == '\0') {
+    // Search string is blank; get a new one...
+    e->replace_dlg->show();
+    return;
+  }
+
+  e->replace_dlg->hide();
+
+  int pos = e->editor->insert_position();
+  int found = textbuf->search_forward(pos, find, &pos);
+
+  if (found) {
+    // Found a match; update the position and replace text...
+    textbuf->select(pos, pos+strlen(find));
+    textbuf->remove_selection();
+    textbuf->insert(pos, replace);
+    textbuf->select(pos, pos+strlen(replace));
+    e->editor->insert_position(pos+strlen(replace));
+    e->editor->show_insert_position();
+  }
+  else fltk::alert("No occurrences of \'%s\' found!", find);
+}
+
+void replall_cb(fltk::Widget*, void* v) {
+  EditorWindow* e = (EditorWindow*)v;
+  const char *find = e->replace_find->text();
+  const char *replace = e->replace_with->text();
+
+  find = e->replace_find->text();
+  if (find[0] == '\0') {
+    // Search string is blank; get a new one...
+    e->replace_dlg->show();
+    return;
+  }
+
+  e->replace_dlg->hide();
+
+  e->editor->insert_position(0);
+  int times = 0;
+
+  // Loop through the whole string
+  for (int found = 1; found;) {
+    int pos = e->editor->insert_position();
+    found = textbuf->search_forward(pos, find, &pos);
+
+    if (found) {
+      // Found a match; update the position and replace text...
+      textbuf->select(pos, pos+strlen(find));
+      textbuf->remove_selection();
+      textbuf->insert(pos, replace);
+      e->editor->insert_position(pos+strlen(replace));
+      e->editor->show_insert_position();
+      times++;
+    }
+  }
+
+  if (times) fltk::message("Replaced %d occurrences.", times);
+  else fltk::alert("No occurrences of \'%s\' found!", find);
+}
+
+void replcan_cb(fltk::Widget*, void* v) {
+  EditorWindow* e = (EditorWindow*)v;
+  e->replace_dlg->hide();
+}
+
+void save_cb() {
+  if (filename[0] == '\0') {
+    // No filename - get one!
+    saveas_cb();
+    return;
+  }
+  else save_file(filename);
+}
+
+void saveas_cb() {
+  const char *newfile = fltk::file_chooser("Save File As?", "*", filename);
+  if (newfile != NULL) save_file(newfile);
+}
+
+fltk::Window* new_view();
+
+void view_cb(fltk::Widget*, void*) {
+  fltk::Window* w = new_view();
+  w->show();
+}
+
+static void build_menus(fltk::MenuBar * menu, fltk::Widget *w) {
+    fltk::ItemGroup * g;
+    menu->user_data(w);
+    menu->begin();
+      g = new fltk::ItemGroup( "&File" );
+      g->begin();
+	new fltk::Item( "&New File",        0, (fltk::Callback *)new_cb );
+	new fltk::Item( "&Open File...",    fltk::COMMAND + 'O', (fltk::Callback *)open_cb );
+	new fltk::Item( "&Insert File...",  fltk::COMMAND + 'I', (fltk::Callback *)insert_cb);
+	new fltk::Divider();
+	new fltk::Item( "&Save File",       fltk::COMMAND + 'S', (fltk::Callback *)save_cb );
+	new fltk::Item( "Save File &As...", fltk::COMMAND + fltk::SHIFT + 'S', (fltk::Callback *)saveas_cb);
+	new fltk::Divider();
+	new fltk::Item( "New &View", fltk::ACCELERATOR + 'V', (fltk::Callback *)view_cb, 0 );
+	new fltk::Item( "&Close View", fltk::COMMAND + 'W', (fltk::Callback *)close_cb);
+	new fltk::Divider();
+	new fltk::Item( "E&xit", fltk::COMMAND + 'Q', (fltk::Callback *)quit_cb, 0 );
+      g->end();
+      g = new fltk::ItemGroup( "&Edit" );
+      g->begin();
+	new fltk::Item( "Cu&t",        fltk::COMMAND + 'X', (fltk::Callback *)cut_cb );
+	new fltk::Item( "&Copy",       fltk::COMMAND + 'C', (fltk::Callback *)copy_cb );
+	new fltk::Item( "&Paste",      fltk::COMMAND + 'V', (fltk::Callback *)paste_cb );
+	new fltk::Item( "&Delete",     0, (fltk::Callback *)delete_cb );
+      g->end();
+      g = new fltk::ItemGroup( "&Search" );
+      g->begin();
+	new fltk::Item( "&Find...",       fltk::COMMAND + 'F', (fltk::Callback *)find_cb );
+	new fltk::Item( "F&ind Again",    fltk::COMMAND + 'G', find2_cb );
+	new fltk::Item( "&Replace...",    fltk::COMMAND + 'R', replace_cb );
+	new fltk::Item( "Re&place Again", fltk::COMMAND + 'T', replace2_cb );
+      g->end();
+    menu->end();
+}
+
+fltk::Window* new_view() {
+  EditorWindow* w = new EditorWindow(660, 400, title);
+  w->begin();
+    fltk::MenuBar* m = new fltk::MenuBar(0, 0, 660, 21);
+    build_menus(m,w);
+    w->editor = new fltk::TextEditor(0, 21, 660, 379);
+    w->editor->buffer(textbuf);
+    w->editor->highlight_data(stylebuf, styletable,
+      sizeof(styletable) / sizeof(styletable[0]),
+     'A', style_unfinished_cb, 0);
+    w->editor->textfont(fltk::COURIER);
+  w->end();
+  w->resizable(w->editor);
+  w->callback((fltk::Callback *)close_cb, w);
+
+  w->editor->linenumber_width(60);
+  w->editor->wrap_mode(true, 0);
+  w->editor->cursor_style(fltk::TextDisplay::BLOCK_CURSOR);
+  // w->editor->insert_mode(false);
+
+  textbuf->add_modify_callback(style_update, w->editor);
+  textbuf->add_modify_callback(changed_cb, w);
+  textbuf->call_modify_callbacks();
+  num_windows++;
+  return w;
+}
+
+int main(int argc, char **argv) {
+
+  textbuf = new fltk::TextBuffer(0);
+  style_init();
+
+  fltk::Window* window = new_view();
+
+  window->show(1, argv);
+
+  if (argc > 1) {
+    window->label(" "); // Prevent from displaying "Untitled.txt" before its time...
+    load_file(argv[1], -1);
+  }
+
+  return fltk::run();
+}
+
+//
+// End of "$Id: editor.cxx 8662 2011-05-15 06:04:24Z bgbnbigben $".
+//

Added: branches/branch-3.0/test2/escherknot.xbm
===================================================================
--- branches/branch-3.0/test2/escherknot.xbm	                        (rev 0)
+++ branches/branch-3.0/test2/escherknot.xbm	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,473 @@
+#define escherknot_width 216
+#define escherknot_height 208
+
+static unsigned char escherknot_bits[] = {
+ 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, 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, 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, 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, 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, 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, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x5f,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xf0, 0x6f, 0xf6, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xc0, 0xff, 0x3a, 0x13, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x0d, 0x02, 0x51, 0x71, 0x0e, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x2f, 0x20, 0xd9, 0x88,
+ 0x9b, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x82,
+ 0xac, 0x44, 0x4e, 0x1c, 0xf3, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x1e, 0x40, 0x02, 0x44, 0x60, 0xe2, 0xfc, 0x06, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x80, 0x25, 0x09, 0x90, 0x22, 0x13, 0xb7, 0x9a, 0x1e,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x40, 0x10, 0x89,
+ 0x18, 0xe3, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x04, 0x08,
+ 0x01, 0x10, 0xc8, 0xa8, 0xd5, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x83, 0x80, 0x20, 0x40, 0x82, 0x00, 0x66, 0x9c, 0xec, 0x01, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x08, 0x08, 0x24, 0x12, 0x93, 0x5b,
+ 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x12, 0x80, 0x04, 0x01, 0x00, 0x80,
+ 0x19, 0x33, 0xfa, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x80, 0x80, 0x00,
+ 0x20, 0x08, 0x12, 0xc4, 0x68, 0x26, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
+ 0x02, 0x04, 0x24, 0x00, 0x01, 0x40, 0x24, 0x8c, 0xcd, 0x3f, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00,
+ 0x00, 0x80, 0x49, 0x10, 0x90, 0x00, 0x21, 0x20, 0x08, 0x11, 0x43, 0xd9,
+ 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe8,
+ 0xff, 0xff, 0x0b, 0x00, 0x60, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x80, 0x30, 0xb9, 0xf2, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xc0, 0x97, 0x04, 0x08, 0xfe, 0x05, 0x30, 0x10, 0x12, 0x20, 0x20,
+ 0x04, 0x00, 0x80, 0x48, 0x0c, 0xa3, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x3e, 0x92, 0x20, 0x49, 0x40, 0x3e, 0x0e, 0x82,
+ 0x00, 0x84, 0x25, 0x01, 0x80, 0x00, 0x80, 0xc8, 0x34, 0xed, 0x03, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x25, 0x01, 0x04, 0x01, 0x08,
+ 0xd0, 0x17, 0x00, 0x80, 0x25, 0x01, 0xad, 0x04, 0x12, 0x20, 0x23, 0x4c,
+ 0x6a, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5c, 0x02, 0x48,
+ 0x92, 0x20, 0x41, 0x92, 0x9e, 0x80, 0x24, 0x24, 0x29, 0x00, 0x04, 0x00,
+ 0x10, 0x98, 0xcc, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
+ 0x4f, 0x10, 0x01, 0x90, 0x24, 0x40, 0x12, 0xf0, 0x00, 0x24, 0x41, 0x0b,
+ 0xa9, 0x10, 0x00, 0x00, 0x04, 0xd9, 0x96, 0x0e, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xe0, 0x00, 0x92, 0x48, 0x02, 0x04, 0x09, 0xc0, 0x84, 0x8f,
+ 0x29, 0x2d, 0xf8, 0xa9, 0x02, 0x00, 0x00, 0x20, 0x90, 0xf4, 0x1e, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x98, 0x24, 0x91, 0x04, 0x50, 0x22, 0x24,
+ 0x1b, 0x12, 0x7a, 0x48, 0xca, 0x03, 0x21, 0x10, 0x00, 0x00, 0x48, 0x93,
+ 0xff, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9e, 0x24, 0x92, 0x20,
+ 0x81, 0xda, 0x24, 0xc8, 0x16, 0xd0, 0xe7, 0x50, 0xd2, 0xbf, 0x03, 0x00,
+ 0x80, 0x00, 0x30, 0x29, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03,
+ 0x20, 0x80, 0x24, 0x41, 0x12, 0x2a, 0x41, 0xb2, 0x80, 0x33, 0x0e, 0x7e,
+ 0x88, 0x1c, 0x01, 0x00, 0xa0, 0x24, 0x69, 0x75, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xe0, 0x82, 0x44, 0x11, 0x24, 0x09, 0x90, 0xa4, 0x4d, 0xd2, 0x92,
+ 0x9e, 0xd3, 0x83, 0x6b, 0x62, 0x00, 0x00, 0x10, 0x22, 0xff, 0x7f, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x30, 0x42, 0x04, 0x92, 0x24, 0x6b, 0x53, 0x32,
+ 0x59, 0x90, 0x16, 0xfa, 0xb4, 0xf4, 0xff, 0x0f, 0x01, 0x00, 0x90, 0x68,
+ 0x4a, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x90, 0x24, 0x11, 0x24,
+ 0x49, 0xda, 0x82, 0xc5, 0x92, 0xd2, 0xd0, 0x9e, 0x1e, 0x00, 0x78, 0x0a,
+ 0x00, 0x00, 0x05, 0xd2, 0xfa, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4c, 0x02,
+ 0x44, 0xb2, 0x65, 0xea, 0x49, 0x9e, 0x2c, 0x4b, 0x1a, 0xd2, 0xeb, 0xe3,
+ 0xff, 0xc7, 0x09, 0x00, 0x20, 0x68, 0xff, 0xd6, 0x01, 0x00, 0x00, 0x00,
+ 0x00, 0x0b, 0x90, 0x40, 0x92, 0x24, 0x09, 0x5f, 0xd2, 0x64, 0x59, 0x72,
+ 0x56, 0x7f, 0xfd, 0xdf, 0x1f, 0x12, 0x00, 0x20, 0x49, 0x92, 0xde, 0x01,
+ 0x00, 0x00, 0x00, 0x80, 0x41, 0x92, 0x4c, 0x92, 0x24, 0x25, 0xc9, 0x8b,
+ 0x2e, 0xcb, 0x92, 0x4b, 0x5a, 0x2f, 0x75, 0xf4, 0x04, 0x00, 0x00, 0x41,
+ 0xf6, 0x74, 0x01, 0x00, 0x00, 0x00, 0x40, 0x49, 0x02, 0x00, 0xba, 0xb6,
+ 0xfd, 0x49, 0xf8, 0x74, 0x6d, 0x4b, 0x72, 0xed, 0xdb, 0xff, 0xcf, 0x53,
+ 0x00, 0x00, 0x48, 0xb6, 0xd7, 0x03, 0x00, 0x00, 0x00, 0x60, 0x48, 0x10,
+ 0xc9, 0x93, 0x24, 0x00, 0x7b, 0xc3, 0xa6, 0x69, 0x58, 0x5a, 0xfb, 0xfa,
+ 0xa5, 0xbe, 0x16, 0x00, 0x00, 0x92, 0xa4, 0xfd, 0x03, 0x00, 0x00, 0x00,
+ 0x30, 0x01, 0x20, 0x5d, 0xa2, 0xfe, 0x7f, 0x01, 0x4f, 0x1a, 0xcd, 0x6b,
+ 0x6a, 0xa9, 0x5f, 0xff, 0xf3, 0x24, 0x01, 0x40, 0xc0, 0xb4, 0xf4, 0x03,
+ 0x00, 0x00, 0x00, 0x2c, 0x88, 0x84, 0x89, 0xb6, 0x00, 0x24, 0x7d, 0x69,
+ 0xf2, 0x34, 0xad, 0x99, 0x2d, 0xf7, 0xff, 0x9f, 0x4b, 0x00, 0x00, 0x92,
+ 0xa6, 0xad, 0x07, 0x00, 0x00, 0x00, 0x06, 0x91, 0x24, 0xe9, 0xa4, 0xfd,
+ 0xa5, 0xa9, 0x4b, 0x93, 0xe7, 0x34, 0x63, 0xf9, 0xfc, 0xd5, 0xef, 0x16,
+ 0x00, 0x40, 0x90, 0xb4, 0xbd, 0x07, 0x00, 0x00, 0x00, 0x6a, 0x80, 0x4c,
+ 0x96, 0xbe, 0x2d, 0xfd, 0x2f, 0x7c, 0x5e, 0x9c, 0x67, 0xad, 0xa5, 0xfd,
+ 0xff, 0xbf, 0x29, 0x00, 0x00, 0x92, 0x76, 0xed, 0x06, 0x00, 0x00, 0x00,
+ 0x05, 0x12, 0x48, 0x53, 0x25, 0x65, 0x25, 0xf4, 0xe5, 0xd3, 0x72, 0x9c,
+ 0x35, 0xdf, 0xf6, 0x7f, 0xf5, 0x56, 0x00, 0x00, 0x92, 0xa4, 0xed, 0x0f,
+ 0x00, 0x00, 0x80, 0x49, 0x20, 0x59, 0x38, 0xec, 0xff, 0xff, 0xad, 0x2f,
+ 0x5d, 0xd3, 0x33, 0xe6, 0x24, 0xed, 0xff, 0xdf, 0x2d, 0x01, 0x40, 0x80,
+ 0x24, 0xbd, 0x07, 0x00, 0x00, 0xc0, 0x48, 0x24, 0x49, 0x87, 0x37, 0x21,
+ 0xa0, 0xbd, 0xf4, 0x79, 0x4f, 0xc7, 0x9c, 0xde, 0xf6, 0xff, 0xff, 0x5b,
+ 0x08, 0x00, 0x92, 0xfc, 0xe9, 0x0e, 0x00, 0x00, 0x20, 0x89, 0x40, 0xd3,
+ 0xf4, 0x49, 0xff, 0xff, 0xe7, 0x2f, 0xcf, 0x79, 0x9c, 0x53, 0xb2, 0x35,
+ 0xff, 0xff, 0x37, 0x00, 0x40, 0x90, 0x24, 0xef, 0x0e, 0x00, 0x00, 0x30,
+ 0x91, 0x49, 0x32, 0x2d, 0xff, 0x6b, 0xb7, 0xbd, 0xbc, 0x3c, 0xef, 0x79,
+ 0xce, 0xde, 0xd6, 0xfd, 0xff, 0x9f, 0x00, 0x00, 0x92, 0xa6, 0xad, 0x0b,
+ 0x00, 0x00, 0x30, 0x11, 0x89, 0x8c, 0xcb, 0x5b, 0xba, 0xaf, 0xf6, 0xd7,
+ 0xe7, 0x35, 0xe7, 0x59, 0xb3, 0xfb, 0xff, 0xff, 0x7f, 0x04, 0x40, 0x80,
+ 0xe4, 0xb9, 0x1f, 0x00, 0x00, 0x48, 0x22, 0x91, 0x66, 0x79, 0xeb, 0xff,
+ 0xff, 0xdf, 0xbe, 0xbe, 0xe7, 0x8c, 0x75, 0x6b, 0x4a, 0xfa, 0xbf, 0x7f,
+ 0x00, 0x00, 0x82, 0x24, 0xef, 0x0e, 0x00, 0x00, 0x4c, 0x22, 0xb2, 0x79,
+ 0x5e, 0xfa, 0x5b, 0xa9, 0xfd, 0xeb, 0xf5, 0x9c, 0x3d, 0xc6, 0xcc, 0xee,
+ 0xed, 0x01, 0xf8, 0x00, 0x40, 0x82, 0xb6, 0xa9, 0x1b, 0x00, 0x00, 0x94,
+ 0x64, 0x66, 0x8e, 0xd3, 0x97, 0xfe, 0xff, 0xd7, 0xdf, 0x9f, 0x7b, 0xf3,
+ 0x3c, 0x35, 0x59, 0x6b, 0x00, 0x70, 0x00, 0x00, 0x40, 0xe4, 0xed, 0x1e,
+ 0x00, 0x00, 0x92, 0xc4, 0x34, 0xf3, 0xfc, 0xfd, 0x5f, 0xad, 0x7d, 0xfa,
+ 0x7a, 0xce, 0x8e, 0xb3, 0x76, 0x2f, 0xfd, 0x00, 0xe0, 0x04, 0x00, 0x9a,
+ 0x26, 0xaf, 0x1e, 0x00, 0x00, 0x13, 0x88, 0xcc, 0xb5, 0x3f, 0xbf, 0xff,
+ 0xff, 0xd7, 0xef, 0xef, 0xbd, 0x79, 0x6a, 0xde, 0xec, 0xab, 0x01, 0xc0,
+ 0x00, 0x00, 0x40, 0xb6, 0xbd, 0x1b, 0x00, 0x00, 0x05, 0x91, 0xeb, 0x5c,
+ 0xeb, 0xeb, 0xff, 0xff, 0xff, 0x7e, 0xef, 0x6b, 0xef, 0xcd, 0x99, 0xb3,
+ 0xe4, 0x07, 0x80, 0x00, 0x40, 0x49, 0xb2, 0xe5, 0x1a, 0x00, 0x80, 0x20,
+ 0x32, 0xb1, 0xe7, 0x79, 0x7f, 0xf7, 0xff, 0xfd, 0xeb, 0xbd, 0xfe, 0x2c,
+ 0x3d, 0x6b, 0xb6, 0xaf, 0x06, 0x80, 0x00, 0x00, 0x41, 0x96, 0xfe, 0x1e,
+ 0x00, 0x80, 0x44, 0xb2, 0x9b, 0xf9, 0xde, 0xff, 0xff, 0xff, 0x7f, 0xbf,
+ 0xf7, 0xbb, 0xb3, 0x77, 0xce, 0xce, 0xb6, 0x0d, 0x80, 0x01, 0x00, 0x49,
+ 0xf2, 0x94, 0x1f, 0x00, 0x40, 0x49, 0x44, 0xe6, 0x9e, 0x77, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xbf, 0xf7, 0x7e, 0xd6, 0xbc, 0xd9, 0xba, 0x3b, 0x80,
+ 0x00, 0x00, 0x64, 0x93, 0xf7, 0x1b, 0x00, 0x40, 0x89, 0xec, 0x7e, 0x67,
+ 0xbd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xce, 0xdb, 0x99, 0x33, 0x37,
+ 0xd3, 0x36, 0x80, 0x01, 0x80, 0x24, 0xda, 0xd6, 0x1e, 0x00, 0x20, 0x90,
+ 0x99, 0x99, 0x7b, 0xef, 0xfb, 0xff, 0xff, 0xff, 0xff, 0xef, 0xbd, 0x37,
+ 0x63, 0xf3, 0x66, 0xdb, 0x7a, 0x80, 0x00, 0x00, 0x24, 0x59, 0xde, 0x1f,
+ 0x00, 0x60, 0x12, 0xb3, 0xf7, 0xdd, 0xfb, 0xfe, 0xff, 0xff, 0xff, 0xff,
+ 0xbf, 0xf7, 0xfe, 0x6e, 0xce, 0xdd, 0x6d, 0xd7, 0x80, 0x00, 0x80, 0x20,
+ 0xcb, 0xfb, 0x1f, 0x00, 0x10, 0x20, 0x6e, 0x66, 0x76, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xef, 0xde, 0xdb, 0x9b, 0x99, 0xb3, 0x5d, 0x6b, 0x81,
+ 0x00, 0x40, 0x96, 0x59, 0x6a, 0x1f, 0x00, 0x98, 0xc4, 0xe4, 0xdf, 0xff,
+ 0xfb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7b, 0x6f, 0x7b, 0x37, 0x7f,
+ 0xb3, 0xdd, 0x83, 0x00, 0x00, 0xb0, 0xed, 0xef, 0x1d, 0x00, 0x10, 0x88,
+ 0x9e, 0xdd, 0xcd, 0xbd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xed,
+ 0x6c, 0xe6, 0xcc, 0x76, 0x6d, 0xc1, 0x00, 0x40, 0x91, 0x24, 0x7b, 0x1f,
+ 0x00, 0x08, 0xd1, 0xf1, 0x66, 0x76, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xdf, 0xbd, 0xbf, 0xd9, 0xdd, 0xdd, 0xb6, 0x47, 0x00, 0x00, 0xd8,
+ 0xb4, 0xad, 0x1f, 0x00, 0x24, 0x24, 0x6f, 0xf6, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0x7f, 0x7f, 0xb7, 0x9d, 0x33, 0xd9, 0x96, 0x4e,
+ 0x00, 0x20, 0x49, 0xf7, 0xfd, 0x1e, 0x00, 0x48, 0xe4, 0xac, 0xb9, 0xdd,
+ 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xdd, 0x76, 0xb6,
+ 0xb7, 0xfd, 0x7a, 0x00, 0x00, 0x44, 0x96, 0xb7, 0x1f, 0x00, 0x02, 0x9a,
+ 0xbe, 0x6f, 0x77, 0xff, 0xff, 0x7f, 0x61, 0xd9, 0xff, 0xff, 0xff, 0xfd,
+ 0xdd, 0x66, 0xed, 0x66, 0x5b, 0x37, 0x00, 0x90, 0x64, 0xb9, 0xf6, 0x1f,
+ 0x00, 0x02, 0xc9, 0xf3, 0xee, 0xfd, 0xff, 0xff, 0x2f, 0x24, 0x4f, 0xfe,
+ 0xff, 0xff, 0x7f, 0x37, 0xdb, 0xcd, 0x7c, 0xff, 0x3a, 0x00, 0x88, 0x24,
+ 0xdb, 0xde, 0x1a, 0x00, 0x13, 0x31, 0x6f, 0xbb, 0xdf, 0xff, 0xff, 0x21,
+ 0xa0, 0x64, 0xf3, 0xff, 0xff, 0xe7, 0xff, 0x96, 0xbb, 0x9b, 0xa5, 0x1d,
+ 0x00, 0x60, 0x32, 0xe9, 0xdb, 0x0f, 0x00, 0x65, 0xe6, 0x3c, 0xfb, 0xf6,
+ 0xff, 0x7f, 0x10, 0xa4, 0xb5, 0x9d, 0xfe, 0xdf, 0xdf, 0xdd, 0x6d, 0x32,
+ 0xb3, 0x7d, 0x0d, 0x00, 0x0b, 0x93, 0x7c, 0x7b, 0x0f, 0x00, 0x89, 0xdc,
+ 0xb3, 0xed, 0xfb, 0xff, 0x1f, 0x10, 0x90, 0x92, 0xd9, 0xfe, 0x7f, 0xff,
+ 0x77, 0xdb, 0xee, 0x6e, 0xdb, 0x0e, 0x00, 0x20, 0xdd, 0x66, 0x6f, 0x0f,
+ 0x80, 0x91, 0x5a, 0xfb, 0xbe, 0xef, 0xff, 0x0f, 0x10, 0xda, 0x92, 0xee,
+ 0xff, 0xff, 0xff, 0xf7, 0xb7, 0xcd, 0xee, 0xde, 0x07, 0x00, 0x24, 0x49,
+ 0xb6, 0xed, 0x0f, 0x00, 0x12, 0x6b, 0xcd, 0xf3, 0xbe, 0xff, 0x07, 0x08,
+ 0x48, 0xda, 0x76, 0xb7, 0xff, 0xff, 0xdd, 0x6e, 0xba, 0x99, 0x65, 0x03,
+ 0x40, 0x92, 0xe4, 0xba, 0xbd, 0x0e, 0x80, 0x62, 0xed, 0x7d, 0x5f, 0xf7,
+ 0xff, 0x01, 0x08, 0x28, 0xc9, 0x26, 0xbb, 0xff, 0xff, 0xff, 0x99, 0xb7,
+ 0xbb, 0x7d, 0x03, 0x00, 0x89, 0x64, 0xdb, 0xf6, 0x07, 0x40, 0x0c, 0x35,
+ 0xe7, 0x79, 0xdd, 0xff, 0x01, 0x84, 0xa5, 0x7d, 0xba, 0xdd, 0xfe, 0x7f,
+ 0xbf, 0xbf, 0x6d, 0x76, 0xdb, 0x01, 0x00, 0x48, 0x36, 0xdb, 0xd6, 0x07,
+ 0xc0, 0x88, 0xb4, 0xb6, 0xbf, 0xff, 0x7f, 0x00, 0x0c, 0x24, 0x44, 0xdb,
+ 0xed, 0xff, 0xdf, 0xef, 0x6e, 0xdb, 0x6e, 0xb7, 0x00, 0x80, 0x44, 0x93,
+ 0xed, 0x5b, 0x07, 0x40, 0x91, 0xd2, 0xfa, 0xfc, 0xf6, 0x7f, 0x00, 0x02,
+ 0xb4, 0x35, 0xd9, 0xef, 0xff, 0xff, 0xfb, 0xef, 0xb6, 0xc9, 0xe4, 0x00,
+ 0x10, 0x24, 0xd9, 0x6d, 0xfb, 0x03, 0x00, 0x27, 0xfe, 0xd3, 0xd6, 0xdb,
+ 0x3f, 0x00, 0xa2, 0x94, 0xb4, 0xdb, 0x7c, 0xff, 0xff, 0xbf, 0xd9, 0xad,
+ 0xdb, 0x7d, 0x00, 0x40, 0x32, 0xd9, 0xb6, 0xef, 0x03, 0x60, 0xe4, 0x5a,
+ 0x5f, 0x5f, 0xff, 0x1f, 0x00, 0x02, 0x52, 0x92, 0xec, 0xb6, 0xff, 0xff,
+ 0xef, 0xff, 0x6d, 0xb6, 0x3b, 0x00, 0x28, 0x90, 0xcc, 0xbe, 0xfd, 0x03,
+ 0xa0, 0x88, 0xeb, 0xf9, 0xfd, 0xf5, 0x1f, 0x00, 0x82, 0x53, 0xbb, 0x6d,
+ 0xf7, 0xff, 0xf9, 0xff, 0x6f, 0xdb, 0x6d, 0x1b, 0x00, 0x04, 0xc9, 0x66,
+ 0xdb, 0x57, 0x03, 0xa0, 0x52, 0xaf, 0xa7, 0x97, 0xff, 0x0f, 0x00, 0x51,
+ 0x48, 0xda, 0x66, 0xdb, 0xff, 0xf8, 0xdf, 0xed, 0xbe, 0xed, 0x0e, 0x00,
+ 0x92, 0x64, 0x32, 0xeb, 0xf6, 0x01, 0x20, 0x63, 0xbd, 0xbc, 0xfc, 0xfa,
+ 0x0f, 0x00, 0x09, 0x20, 0x89, 0x3e, 0xff, 0xff, 0xe0, 0x7f, 0xdf, 0x6f,
+ 0xdb, 0x07, 0x00, 0x01, 0x24, 0xbb, 0xed, 0xfe, 0x01, 0xa0, 0xce, 0xf5,
+ 0xf6, 0xdb, 0xdf, 0x07, 0x00, 0x41, 0xad, 0x5f, 0xf2, 0xed, 0xff, 0xc0,
+ 0xff, 0xbf, 0xdd, 0x92, 0x03, 0x00, 0x44, 0xb2, 0xd9, 0x7d, 0xfb, 0x01,
+ 0xe0, 0xaa, 0xdf, 0x9b, 0x7f, 0xfb, 0x07, 0x80, 0x28, 0x21, 0x64, 0xbb,
+ 0x7f, 0x7f, 0x80, 0xff, 0xf6, 0xbb, 0xee, 0x03, 0x80, 0x22, 0x99, 0xed,
+ 0xb6, 0xff, 0x00, 0x90, 0xb8, 0x5e, 0x5b, 0x6b, 0xed, 0x03, 0x00, 0x01,
+ 0xa6, 0x6d, 0xdb, 0xf6, 0x7f, 0x00, 0xff, 0xff, 0xf6, 0xcd, 0x00, 0x40,
+ 0x10, 0xc9, 0x6c, 0xff, 0xf7, 0x00, 0xa0, 0xe3, 0x72, 0xeb, 0xef, 0xff,
+ 0x03, 0x80, 0xe0, 0x90, 0x24, 0xdb, 0xbd, 0x3f, 0x00, 0xfe, 0xdb, 0x6f,
+ 0xfb, 0x00, 0x00, 0x89, 0x4c, 0xb6, 0xd9, 0x7e, 0x00, 0x70, 0xaf, 0xaf,
+ 0x6f, 0xb5, 0xde, 0x03, 0x80, 0x94, 0x92, 0xb6, 0xf9, 0xf6, 0x3f, 0x00,
+ 0xfc, 0xbf, 0xdd, 0x7b, 0x00, 0x10, 0x48, 0x26, 0xb3, 0xdf, 0x7f, 0x00,
+ 0x70, 0xd8, 0xae, 0xfd, 0xff, 0xf7, 0x03, 0x80, 0x00, 0xd2, 0x36, 0xcf,
+ 0xdf, 0x3f, 0x00, 0xb8, 0x6d, 0xdf, 0x16, 0x00, 0x48, 0x44, 0xb2, 0xfb,
+ 0x6c, 0x3f, 0x00, 0x50, 0x75, 0xfd, 0xa5, 0xd5, 0xfe, 0x01, 0x40, 0xd1,
+ 0x12, 0xa2, 0x7d, 0xfb, 0x1f, 0x00, 0xf0, 0xff, 0xbf, 0x0d, 0x00, 0x20,
+ 0x12, 0x9b, 0xcd, 0xf6, 0x3f, 0x00, 0x90, 0xd5, 0xa7, 0xfd, 0x77, 0xab,
+ 0x03, 0x40, 0x1c, 0xc8, 0xbe, 0x6d, 0xfb, 0x1f, 0x00, 0xe0, 0xff, 0xee,
+ 0x07, 0x00, 0x04, 0x91, 0xc9, 0x7e, 0xbf, 0x1f, 0x00, 0x30, 0x57, 0xbf,
+ 0xa6, 0xde, 0xfd, 0x01, 0x40, 0x40, 0x6b, 0xd3, 0x6e, 0xef, 0x0f, 0x00,
+ 0xc0, 0xeb, 0x7d, 0x03, 0x00, 0x90, 0xc8, 0x6c, 0x76, 0xfb, 0x0f, 0x00,
+ 0x70, 0x5c, 0xe5, 0xf7, 0xfa, 0xeb, 0x01, 0x40, 0x50, 0x49, 0x92, 0xf4,
+ 0xfd, 0x0f, 0x00, 0xc0, 0xff, 0xdb, 0x01, 0x80, 0x44, 0x44, 0x66, 0xbb,
+ 0x6f, 0x0f, 0x00, 0xd0, 0xf1, 0x95, 0xf6, 0x6f, 0xad, 0x01, 0x40, 0x08,
+ 0x78, 0xdb, 0xb6, 0xef, 0x0f, 0x00, 0x00, 0xdf, 0xd6, 0x00, 0x00, 0x20,
+ 0x32, 0xb3, 0xdb, 0xfd, 0x0f, 0x00, 0x10, 0xd7, 0xf7, 0xb6, 0xd8, 0xeb,
+ 0x03, 0x20, 0x43, 0x27, 0xd9, 0xb6, 0xfd, 0x0f, 0x00, 0x00, 0xff, 0x7e,
+ 0x00, 0x40, 0x12, 0x93, 0xd9, 0xec, 0xb6, 0x07, 0x00, 0x70, 0x55, 0xdd,
+ 0xf6, 0x6f, 0xbb, 0x01, 0x40, 0x28, 0xa1, 0x6f, 0xb6, 0xb7, 0x0f, 0x00,
+ 0x00, 0xde, 0x1f, 0x00, 0x80, 0x88, 0xd8, 0xcc, 0x66, 0xff, 0x03, 0x00,
+ 0x70, 0xf4, 0xf5, 0xdb, 0xaa, 0xee, 0x01, 0x60, 0x28, 0x2d, 0x49, 0xf7,
+ 0xf6, 0x07, 0x00, 0x00, 0x7c, 0x0f, 0x00, 0x08, 0x48, 0x66, 0x6e, 0xfb,
+ 0xef, 0x03, 0x00, 0xd0, 0xd5, 0xdf, 0x52, 0xff, 0xda, 0x03, 0x20, 0xa3,
+ 0xa5, 0xd9, 0xb2, 0xff, 0x07, 0x00, 0x00, 0xf8, 0x07, 0x00, 0x20, 0x22,
+ 0x33, 0x37, 0xbf, 0xfd, 0x01, 0x00, 0x70, 0x5f, 0xf7, 0xfe, 0xab, 0x6b,
+ 0x02, 0xa0, 0xa8, 0xb4, 0x6d, 0xdf, 0xf6, 0x07, 0x00, 0x00, 0xf8, 0x01,
+ 0x00, 0x12, 0x33, 0x11, 0xd9, 0xdd, 0xff, 0x01, 0x00, 0x70, 0x75, 0xd5,
+ 0x52, 0xea, 0x8a, 0x03, 0x20, 0x84, 0x36, 0x69, 0xba, 0xdb, 0x07, 0x00,
+ 0x00, 0xf0, 0x01, 0x00, 0x81, 0xc8, 0xcc, 0xdd, 0xed, 0xff, 0x00, 0x00,
+ 0x60, 0xd5, 0xdf, 0xf6, 0xae, 0x6b, 0x03, 0x00, 0xa1, 0xa4, 0x6d, 0xdf,
+ 0xfe, 0x07, 0x00, 0x00, 0x60, 0x00, 0x40, 0x44, 0xc6, 0xcc, 0x64, 0xb7,
+ 0xfd, 0x00, 0x00, 0xe0, 0x55, 0xf7, 0xd6, 0xea, 0xba, 0x07, 0x20, 0x94,
+ 0x94, 0x6d, 0xfb, 0xdb, 0x07, 0x00, 0x00, 0x20, 0x00, 0x20, 0x20, 0x32,
+ 0x76, 0x77, 0xff, 0x7f, 0x00, 0x00, 0x60, 0x7d, 0xd5, 0xb6, 0x3f, 0xaf,
+ 0x06, 0xa0, 0xa4, 0x95, 0x6c, 0x9b, 0xee, 0x07, 0x00, 0x00, 0x18, 0x00,
+ 0x10, 0x92, 0x15, 0x73, 0xbb, 0xd9, 0x3f, 0x00, 0x00, 0xe0, 0xf5, 0xff,
+ 0xf7, 0x6a, 0xa9, 0x06, 0x80, 0xa2, 0xb4, 0x6d, 0xfb, 0xfb, 0x07, 0x00,
+ 0x00, 0x04, 0x00, 0x84, 0x88, 0xc8, 0x99, 0xdd, 0xff, 0x3f, 0x00, 0x00,
+ 0xe0, 0x8b, 0xff, 0x96, 0x6a, 0xb6, 0x0a, 0xa0, 0x94, 0x96, 0x64, 0xdb,
+ 0xee, 0x07, 0x00, 0x00, 0x03, 0x08, 0x20, 0x60, 0x66, 0xec, 0xee, 0xb6,
+ 0x1d, 0x00, 0x00, 0xc0, 0x7e, 0xa5, 0xf4, 0xab, 0x55, 0x0d, 0x20, 0xe7,
+ 0xd4, 0x6d, 0xdb, 0xfb, 0x07, 0x00, 0x80, 0x00, 0x00, 0x09, 0x12, 0x33,
+ 0x67, 0x77, 0xff, 0x0f, 0x00, 0x00, 0xc0, 0xfa, 0xff, 0xb7, 0x7a, 0x55,
+ 0x19, 0x90, 0x91, 0xd4, 0x64, 0xdb, 0xee, 0x07, 0x00, 0x40, 0x00, 0x81,
+ 0x04, 0x88, 0x91, 0x3b, 0xbb, 0xfd, 0x0f, 0x00, 0x00, 0xc0, 0xab, 0xbf,
+ 0xed, 0x4e, 0xbb, 0x32, 0x20, 0x94, 0x96, 0x6c, 0xff, 0xfa, 0x03, 0x00,
+ 0x30, 0x40, 0x20, 0x20, 0x64, 0xcc, 0xdc, 0xdd, 0xff, 0x07, 0x00, 0x00,
+ 0xc0, 0xeb, 0xea, 0xfd, 0xd5, 0xaa, 0x2a, 0x20, 0xd7, 0xb0, 0x6d, 0x93,
+ 0xef, 0x07, 0x00, 0x08, 0x00, 0x08, 0x01, 0x23, 0xee, 0xee, 0xee, 0xfb,
+ 0x03, 0x00, 0x00, 0xc0, 0xfe, 0xff, 0x2d, 0xdd, 0x6a, 0x49, 0xd0, 0x90,
+ 0x9a, 0x64, 0xdf, 0xea, 0x07, 0x00, 0x03, 0x80, 0x40, 0x8c, 0x98, 0x33,
+ 0xb3, 0xbb, 0xff, 0x01, 0x00, 0x00, 0xc0, 0xa5, 0x7b, 0x6d, 0xa7, 0x56,
+ 0xc5, 0xa0, 0x94, 0x94, 0x6f, 0xd3, 0xbb, 0x07, 0x80, 0x10, 0x0c, 0x12,
+ 0x40, 0xc6, 0xb9, 0xdb, 0xfb, 0xfd, 0x01, 0x00, 0x00, 0x80, 0x97, 0xee,
+ 0xdf, 0xba, 0x54, 0x1a, 0xa1, 0xe5, 0xd2, 0x64, 0x7e, 0xee, 0x07, 0x60,
+ 0x02, 0x80, 0x00, 0x31, 0x62, 0xcc, 0xdc, 0xee, 0x7f, 0x00, 0x00, 0x00,
+ 0x80, 0xff, 0xff, 0xdb, 0xaa, 0xb5, 0x8a, 0x86, 0x98, 0x96, 0x6d, 0x9b,
+ 0xea, 0x07, 0x98, 0x00, 0x22, 0x44, 0x88, 0x39, 0x77, 0x77, 0xff, 0x7f,
+ 0x00, 0x00, 0x00, 0x80, 0x7d, 0x77, 0xba, 0x7b, 0x2d, 0x55, 0x3c, 0xa6,
+ 0xb4, 0x6c, 0xf6, 0xaf, 0x07, 0x07, 0x90, 0x88, 0x20, 0x42, 0x9c, 0xbb,
+ 0xbb, 0xbb, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x4b, 0xbd, 0xbf, 0x55, 0x53,
+ 0xa5, 0xb2, 0xa1, 0xb4, 0xc9, 0x9f, 0xda, 0xcf, 0x28, 0x24, 0x42, 0x08,
+ 0x31, 0xe6, 0xcc, 0xdd, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xff, 0xef,
+ 0xb7, 0xbd, 0xde, 0x12, 0xd1, 0xac, 0x95, 0x4d, 0xf2, 0x56, 0x9f, 0x88,
+ 0x80, 0x10, 0xc2, 0x9c, 0x73, 0x77, 0xef, 0xfe, 0x7f, 0x00, 0x00, 0x00,
+ 0x00, 0xbf, 0xfb, 0xed, 0xeb, 0x35, 0x95, 0x72, 0xa2, 0x35, 0xcd, 0xb6,
+ 0xd6, 0x2f, 0x21, 0x24, 0x04, 0x31, 0xc6, 0x98, 0x33, 0xf7, 0xff, 0xff,
+ 0x00, 0x00, 0x00, 0x00, 0xd6, 0x6a, 0x7f, 0x5b, 0xab, 0x2d, 0x28, 0x23,
+ 0x65, 0xd9, 0xb6, 0x55, 0x5f, 0x88, 0x08, 0x43, 0x0c, 0x61, 0xde, 0xdd,
+ 0xfb, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x76, 0xff, 0x4d, 0xd7, 0x4d,
+ 0x4a, 0xa5, 0x29, 0x2d, 0xdb, 0xbe, 0x55, 0x1f, 0x22, 0x42, 0x28, 0xc2,
+ 0x39, 0xe7, 0xee, 0xee, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x7f,
+ 0xfb, 0xb6, 0xb6, 0x95, 0x70, 0x2e, 0xa5, 0xd9, 0x24, 0x5d, 0x5f, 0x8a,
+ 0x28, 0x88, 0x31, 0x9e, 0x39, 0x73, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00,
+ 0x00, 0xec, 0xb7, 0xdf, 0x6c, 0xb5, 0x65, 0x26, 0xa3, 0x39, 0x9b, 0xfc,
+ 0x85, 0x5d, 0x21, 0x04, 0x63, 0x1c, 0xe6, 0xdd, 0xbd, 0xfb, 0xff, 0xff,
+ 0x01, 0x00, 0x00, 0x00, 0xb8, 0xfa, 0xb6, 0x6f, 0x4d, 0x9a, 0x28, 0x59,
+ 0x4d, 0xd3, 0x2f, 0xf5, 0x3f, 0x8c, 0xd1, 0x18, 0xc6, 0x31, 0xf6, 0xdd,
+ 0xfe, 0xff, 0xfe, 0x01, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xef, 0xb9, 0xb6,
+ 0x25, 0xe1, 0x4d, 0x69, 0xba, 0x6c, 0xad, 0x3c, 0x41, 0x14, 0x84, 0xe9,
+ 0x9e, 0x37, 0xf7, 0xff, 0xff, 0xfb, 0x03, 0x00, 0x00, 0x00, 0x70, 0x5d,
+ 0x3d, 0x9f, 0x3d, 0x6d, 0x26, 0x52, 0x59, 0xb6, 0x6d, 0xab, 0x7f, 0x14,
+ 0x82, 0xe1, 0x39, 0xe6, 0xdd, 0xfb, 0xff, 0xbf, 0xff, 0x01, 0x00, 0x00,
+ 0x00, 0xf0, 0xf6, 0x6f, 0x77, 0xcd, 0x92, 0xd0, 0x52, 0x4b, 0xb3, 0x49,
+ 0x0b, 0x3a, 0x41, 0x61, 0x38, 0x9e, 0x73, 0xee, 0xdc, 0xff, 0xff, 0xfd,
+ 0x03, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xd7, 0x65, 0xda, 0x66, 0x63, 0x9d,
+ 0xf2, 0x36, 0x7b, 0x6a, 0x7f, 0x14, 0x18, 0x8e, 0xe7, 0xd9, 0x7b, 0xff,
+ 0xff, 0xef, 0xff, 0x03, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xdd, 0xb6,
+ 0xc9, 0x4c, 0x46, 0x9a, 0x64, 0xcb, 0x5b, 0xed, 0x06, 0xc6, 0xe3, 0x71,
+ 0xde, 0xbd, 0xff, 0xff, 0x7f, 0xff, 0x07, 0x00, 0x00, 0x00, 0xc0, 0x7f,
+ 0x7f, 0xff, 0x59, 0x37, 0x75, 0xbb, 0x96, 0x66, 0xdb, 0x56, 0xf7, 0xe0,
+ 0xf2, 0x74, 0x9e, 0x77, 0xef, 0xfd, 0xff, 0xeb, 0xed, 0x03, 0x00, 0x00,
+ 0x00, 0xc0, 0xea, 0xdf, 0xb3, 0xdb, 0xde, 0xc6, 0x81, 0xb0, 0x6c, 0xba,
+ 0xb4, 0xf6, 0x38, 0x18, 0x3c, 0xe7, 0x9c, 0xfb, 0xff, 0x7f, 0xff, 0xff,
+ 0x07, 0x00, 0x00, 0x00, 0x80, 0xff, 0xf7, 0x6e, 0x66, 0xd9, 0x99, 0xac,
+ 0xa4, 0xcd, 0x96, 0xa5, 0xea, 0x03, 0xa7, 0xcf, 0x79, 0xef, 0xfd, 0xff,
+ 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0xff, 0xfd, 0xef, 0xdf,
+ 0x6f, 0xef, 0x72, 0x65, 0xd9, 0xb6, 0xad, 0xe8, 0xc1, 0xe1, 0xf1, 0xbe,
+ 0x7b, 0xef, 0xff, 0xdf, 0x7a, 0xfb, 0x07, 0x00, 0x00, 0x00, 0x00, 0xfe,
+ 0x5f, 0xdd, 0x9d, 0xac, 0x99, 0x84, 0x29, 0xcd, 0x3c, 0x4f, 0x9d, 0x7d,
+ 0x3c, 0x9e, 0xe7, 0xbe, 0xff, 0xff, 0xff, 0xff, 0xef, 0x0f, 0x00, 0x00,
+ 0x00, 0x00, 0xfe, 0xff, 0x77, 0x7b, 0x33, 0xe7, 0x5a, 0x49, 0x9b, 0x65,
+ 0x59, 0x75, 0x07, 0x97, 0xf7, 0xbb, 0xef, 0xff, 0xff, 0xdb, 0xfe, 0xff,
+ 0x07, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xf7, 0x3f, 0xe7, 0xcf, 0x9c, 0x51,
+ 0x4d, 0xb0, 0x6d, 0x4b, 0xc9, 0xd3, 0xf5, 0x79, 0xfe, 0xfb, 0xff, 0xff,
+ 0xdb, 0xda, 0xfe, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xef, 0xde,
+ 0xdd, 0xf3, 0x4d, 0x52, 0x36, 0xcb, 0xd2, 0x3a, 0x7e, 0x3c, 0xde, 0xe7,
+ 0xbe, 0xff, 0x7f, 0xda, 0xff, 0xdf, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf8,
+ 0xff, 0xfb, 0xdd, 0x73, 0x8f, 0xa5, 0x9a, 0xe6, 0xd9, 0xb6, 0xe2, 0x4e,
+ 0xc7, 0xf7, 0xfd, 0xff, 0xff, 0xff, 0xf7, 0xf6, 0xff, 0x0f, 0x00, 0x00,
+ 0x00, 0x00, 0xe0, 0xff, 0xff, 0x7f, 0xee, 0x79, 0xb2, 0xb2, 0x2c, 0x9f,
+ 0xb6, 0x54, 0xfe, 0xfb, 0x79, 0xbf, 0xff, 0xff, 0x5f, 0xda, 0xff, 0xfa,
+ 0x0f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xf7, 0xbf, 0xe7, 0x4b,
+ 0xb4, 0x69, 0xd3, 0x2c, 0x25, 0xbd, 0xbc, 0xcf, 0xf7, 0xfd, 0xff, 0xd7,
+ 0xf6, 0xfe, 0xdf, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xbf, 0x9d,
+ 0xf1, 0x3e, 0x57, 0x25, 0xcb, 0xb6, 0x6d, 0xa9, 0xb5, 0xef, 0xfb, 0xff,
+ 0xff, 0xff, 0xd5, 0xda, 0xd6, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x80,
+ 0xff, 0xff, 0xfb, 0xcf, 0xf5, 0x25, 0x65, 0xd9, 0x66, 0x5b, 0x4a, 0xfa,
+ 0xf9, 0x7e, 0xff, 0xff, 0xff, 0xf6, 0xd6, 0xdf, 0xfa, 0x0f, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0xfe, 0xff, 0xef, 0x3e, 0xf7, 0x9f, 0x5b, 0x92, 0x6c,
+ 0xdb, 0x52, 0xe5, 0xbe, 0xdf, 0xff, 0xff, 0xbf, 0x51, 0xda, 0xfa, 0x7f,
+ 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0x7b, 0x9f, 0xe7,
+ 0x4c, 0xb3, 0x4d, 0xd3, 0x54, 0xd9, 0xe7, 0xfb, 0xff, 0xff, 0x5f, 0xdc,
+ 0xfa, 0xdf, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x7f,
+ 0xe7, 0xf9, 0x3a, 0xd3, 0xa6, 0xe9, 0xb6, 0xa5, 0xca, 0xf9, 0xfd, 0xff,
+ 0xff, 0x83, 0x42, 0xd2, 0xff, 0xfb, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xf0, 0xff, 0xfd, 0xbf, 0xef, 0x4f, 0xd5, 0x64, 0xdb, 0x26, 0x4d, 0x30,
+ 0x7f, 0xff, 0xff, 0xff, 0x91, 0xda, 0xdb, 0xda, 0xdf, 0x1f, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0xe0, 0xff, 0xbf, 0xff, 0x7d, 0xbe, 0xb5, 0x6d, 0x97,
+ 0x6d, 0x93, 0x56, 0xdf, 0xff, 0xff, 0x7f, 0x81, 0x4a, 0xda, 0x7f, 0xff,
+ 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xef, 0xeb, 0xbb,
+ 0xa6, 0x4d, 0x73, 0xcd, 0x92, 0xaa, 0xfe, 0xff, 0xff, 0x1f, 0x01, 0x6a,
+ 0x5b, 0xfb, 0xfb, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff,
+ 0xfd, 0xbf, 0x5f, 0x3b, 0xdb, 0x36, 0xbb, 0x26, 0x4c, 0xf9, 0xff, 0xff,
+ 0x0f, 0xa3, 0x2a, 0xe9, 0x7f, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xee, 0xff, 0xff, 0xfe, 0xfe, 0xcc, 0x91, 0xec, 0x93, 0x6d, 0x93,
+ 0xf2, 0xff, 0xff, 0x03, 0x00, 0x6a, 0x6d, 0x6f, 0xff, 0x1f, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xf7, 0x6f, 0x76, 0xb6, 0xcd,
+ 0x76, 0xc9, 0x2a, 0xe9, 0xff, 0xff, 0x00, 0x02, 0x24, 0xed, 0xf9, 0xed,
+ 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xdf, 0xff,
+ 0xd9, 0x66, 0x9b, 0x6c, 0x93, 0x54, 0xc5, 0xff, 0x3f, 0x00, 0x01, 0x95,
+ 0xb5, 0xaf, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff,
+ 0xff, 0xff, 0xfd, 0xae, 0x7d, 0xde, 0x6d, 0xf6, 0xa1, 0x8a, 0xff, 0x0f,
+ 0x00, 0x81, 0x90, 0xb4, 0xfd, 0xfd, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xcd, 0xb2, 0xdb, 0x2c, 0xcb,
+ 0x54, 0xfe, 0x01, 0x00, 0x01, 0xd2, 0xb6, 0xb7, 0xff, 0x0f, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x39, 0xdb, 0x76,
+ 0xb3, 0x4b, 0xb6, 0x0a, 0xfe, 0x00, 0x00, 0x01, 0x48, 0xda, 0xfe, 0xff,
+ 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff,
+ 0xcf, 0xb9, 0x6d, 0xb6, 0xd9, 0xa5, 0x75, 0x1c, 0x00, 0x80, 0x80, 0x20,
+ 0xdb, 0xda, 0xbe, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0,
+ 0xff, 0xff, 0xff, 0x77, 0x96, 0xd9, 0x26, 0xb3, 0x4d, 0x82, 0x11, 0x00,
+ 0x80, 0x80, 0x24, 0x6d, 0xff, 0xf7, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xbb, 0x67, 0xdb, 0xdd, 0x36, 0xd9,
+ 0x54, 0x60, 0x00, 0xc0, 0x00, 0x92, 0x65, 0x6b, 0xff, 0x0f, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0x4f, 0x7d, 0x96,
+ 0xd9, 0x6c, 0x36, 0xad, 0xc2, 0x00, 0x60, 0x00, 0xc8, 0xb6, 0x6d, 0xff,
+ 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff,
+ 0xff, 0xc8, 0x76, 0xbb, 0xcb, 0x64, 0x52, 0x02, 0x03, 0x10, 0x00, 0x64,
+ 0xda, 0xff, 0xfb, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x80, 0xff, 0xff, 0x5f, 0xd7, 0x4d, 0x33, 0x99, 0xdd, 0x96, 0x04, 0x2c,
+ 0x1c, 0x40, 0x22, 0xdb, 0xb6, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xdf, 0xb5, 0xed, 0xe6, 0x36, 0x9b,
+ 0x6c, 0x29, 0xf0, 0x03, 0x00, 0x99, 0x6c, 0xfb, 0xfd, 0x07, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x35, 0xbb,
+ 0xec, 0x76, 0x33, 0x91, 0x02, 0x00, 0x00, 0x00, 0x64, 0x67, 0xdf, 0xff,
+ 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc,
+ 0xbf, 0x6f, 0x9b, 0x9d, 0xc9, 0xce, 0x36, 0x49, 0x00, 0x00, 0x00, 0x93,
+ 0xb1, 0xdd, 0xfe, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x40, 0xff, 0x6a, 0x76, 0xbb, 0xdd, 0xd9, 0x64, 0x12, 0x01,
+ 0x00, 0x40, 0x98, 0xdd, 0x6d, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xdf, 0x66, 0x73, 0x33, 0xbb,
+ 0x9d, 0x4d, 0x00, 0x00, 0x00, 0x63, 0xe6, 0xf6, 0xff, 0x07, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xed, 0xfd,
+ 0xee, 0xee, 0x36, 0x73, 0x2b, 0x04, 0x00, 0xa0, 0x38, 0x75, 0xbf, 0xff,
+ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x7f, 0xd9, 0xec, 0xce, 0x66, 0x66, 0x66, 0x22, 0x04, 0x00, 0xc6,
+ 0x99, 0xbb, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x5e, 0xb3, 0xdb, 0xb9, 0xcd, 0xc9, 0x88, 0x89,
+ 0x00, 0x68, 0x31, 0xee, 0xdd, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0xbe, 0xbb, 0x9b, 0x3f,
+ 0xbb, 0x33, 0x23, 0x04, 0x00, 0x8c, 0xf3, 0xee, 0xff, 0x03, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbc, 0x67,
+ 0x76, 0x77, 0xb2, 0x66, 0xce, 0x0c, 0xd1, 0xd6, 0xe3, 0x79, 0xf7, 0xff,
+ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xf8, 0xfd, 0xef, 0xe6, 0xee, 0xce, 0x9c, 0x31, 0x16, 0x00, 0x3c,
+ 0x9e, 0xfb, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x78, 0x9f, 0xdb, 0xdc, 0x9d, 0x99, 0x33, 0xc6,
+ 0xc1, 0xff, 0x8f, 0xe7, 0xbb, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf7, 0xbd, 0xbb, 0x33,
+ 0x7b, 0xee, 0x18, 0x1e, 0x50, 0xf0, 0xf9, 0xfe, 0xff, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x7b,
+ 0xf7, 0x77, 0xf7, 0xe6, 0x9c, 0xe3, 0xf0, 0x4d, 0xff, 0x7c, 0xef, 0xff,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xc0, 0xdf, 0x76, 0x7f, 0xcf, 0x9e, 0x73, 0x8f, 0x07, 0xff, 0x0b,
+ 0xdf, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x80, 0xee, 0xcd, 0xdd, 0x9d, 0x7b, 0xf7, 0x7c,
+ 0x7a, 0x00, 0xf0, 0xe7, 0xfd, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x7f, 0xbf, 0xdd, 0x7b,
+ 0x6b, 0x9e, 0xf3, 0xe1, 0xff, 0xff, 0x7d, 0xff, 0x7f, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xee,
+ 0xb7, 0xbb, 0x7b, 0xee, 0x79, 0x8f, 0x0f, 0xfa, 0x2f, 0xff, 0xf7, 0x3f,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x7e, 0xff, 0x77, 0xef, 0xdd, 0x77, 0x7c, 0xfe, 0x02, 0xe8,
+ 0xcf, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xef, 0xee, 0xdd, 0xb3, 0xcf, 0xf3,
+ 0xf1, 0xff, 0xff, 0xf9, 0xfe, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xfb, 0xff, 0xbf,
+ 0xef, 0xbe, 0xcf, 0x8f, 0xfe, 0x5f, 0xfe, 0xff, 0x0f, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0,
+ 0xbf, 0xbb, 0xf7, 0xde, 0x79, 0x3e, 0xff, 0x52, 0xd2, 0xdf, 0xff, 0x0f,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xe0, 0xef, 0xef, 0xef, 0x3c, 0xef, 0xf9, 0xf8, 0xff, 0xff,
+ 0xf7, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xee, 0xdc, 0xf7, 0xfe, 0xe7,
+ 0x97, 0xfe, 0xff, 0xfe, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xbf,
+ 0xef, 0xbf, 0x3e, 0xff, 0xda, 0xf6, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xfe, 0xbf, 0xf7, 0xfe, 0xf7, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, 0x01,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0xfe, 0xff, 0xde, 0xbd, 0xef, 0xfb, 0xd7, 0xff, 0xbf,
+ 0xfd, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xf7, 0x7d, 0xbf,
+ 0xff, 0xd2, 0xf6, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xbf,
+ 0xef, 0xfb, 0xfd, 0xfd, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xc0, 0xff, 0xef, 0xbe, 0xf7, 0xef, 0xef, 0xff, 0xff, 0xff, 0x3f, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xfb, 0xdf, 0xbf, 0xff, 0xff, 0xff,
+ 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0x7f, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff,
+ 0xfe, 0xff, 0xfb, 0xf7, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xf0, 0xff, 0xff, 0xff, 0xdf, 0xff, 0xfd, 0xff, 0xff, 0x03, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xfc, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x07,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff,
+ 0xff, 0xff, 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, 0xff, 0x0f, 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, 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, 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, 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, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+ };

Added: branches/branch-3.0/test2/exception.cxx
===================================================================
--- branches/branch-3.0/test2/exception.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/exception.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,55 @@
+#include <fltk/run.h>
+#include <fltk/Button.h>
+#include <fltk/Window.h>
+#include <fltk/ask.h>
+#include <config.h>
+#include <stdio.h>
+using namespace fltk;
+
+#ifdef HAVE_EXCEPTIONS
+
+#include <exception>
+class my_exception : public std::exception {
+public:
+  const char* what() const throw() {return "my exception";}
+};
+
+void throwit(Widget*, void*) {
+  throw my_exception();
+}
+
+int main(int argc, char** argv) {
+  Window window(200,100);
+  window.begin();
+  Button button(25,50,150,24,"Throw Exception");
+  button.callback(throwit);
+  window.end();
+  window.show(argc, argv);
+  for (;;) {
+    try {
+      return run();
+    } catch (std::exception& e) {
+      message("Exception was thrown!\nIt was \"%s\"", e.what());
+    }
+  }
+}
+
+#else
+
+void quit(Widget *w, void*) {
+  w->window()->hide();
+}
+
+int main(int argc, char** argv) {
+  Window window(200,100);
+  window.begin();
+  Button button(25,25,150,50,"This demo needs exceptions!");
+  button.align(ALIGN_WRAP);
+  button.callback(quit);
+  window.end();
+  window.show(argc, argv);
+  return run();
+}
+
+#endif
+

Added: branches/branch-3.0/test2/fast_slow.cxx
===================================================================
--- branches/branch-3.0/test2/fast_slow.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/fast_slow.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,47 @@
+// generated by Fast Light User Interface Designer (fluid) version 2.0001
+
+#include "fast_slow.h"
+
+Fl_Slider* control;
+
+static void cb_control(Fl_Slider* o, void*) {
+  fast->value(o->value());
+  if (!Fl::pushed()) slow->value(o->value());
+}
+
+Fl_Slider* fast;
+
+Fl_Slider* slow;
+
+int main (int argc, char **argv) {
+
+  Fl_Window* w;
+   {Fl_Window* o = new Fl_Window(318, 443);
+    w = o;
+     {Fl_Slider* o = control = new Fl_Slider(90, 200, 30, 200, "move\nthis");
+      o->callback((Fl_Callback*)cb_control);
+      o->when(FL_WHEN_CHANGED|FL_WHEN_RELEASE|FL_WHEN_NOT_CHANGED);
+    }
+     {Fl_Slider* o = fast = new Fl_Slider(140, 200, 30, 200, "fast\nredraw");
+      o->set_output();
+    }
+     {Fl_Slider* o = slow = new Fl_Slider(190, 200, 30, 200, "slow\nredraw");
+      o->set_output();
+    }
+     {Fl_Box* o = new Fl_Box(10, 10, 300, 180, "The left slider has\nchanged(FL_WHEN_CHANGED | FL_WHEN_RELEASE | FL_WHEN_NOT_\
+CHANGED) so it produces a callback on both drag and release mouse events.\n\nT\
+he middle slider (representing a widget with low overhead) is changed on every\
+ mouse movement.\n\nThe right slider (representing a widget with high overhead\
+) is only updated when the mouse is released, by checking if Fl::pushed() is z\
+ero.");
+      o->box(FL_DOWN_BOX);
+      o->color((Fl_Color)53);
+      o->selection_color((Fl_Color)47);
+      o->align(132|FL_ALIGN_INSIDE);
+    }
+    o->end();
+    o->resizable(o);
+  }
+  w->show(argc, argv);
+  return  Fl::run();
+}

Added: branches/branch-3.0/test2/fast_slow.fl
===================================================================
--- branches/branch-3.0/test2/fast_slow.fl	                        (rev 0)
+++ branches/branch-3.0/test2/fast_slow.fl	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,44 @@
+# data file for the FLTK User Interface Designer (FLUID)
+version 2.0001 
+images_dir ./ 
+header_name {.h} 
+code_name {.cxx} 
+gridx 10 
+gridy 10 
+snap 3
+Function {} {open
+} {
+  Fl_Window {} {open
+    xywh {143 188 318 443} resizable visible
+  } {
+    Fl_Slider control {
+      label {move
+this}
+      callback {fast->value(o->value());
+if (!Fl::pushed()) slow->value(o->value());}
+      xywh {90 200 30 200}
+      extra_code {o->when(FL_WHEN_CHANGED|FL_WHEN_RELEASE|FL_WHEN_NOT_CHANGED);}
+    }
+    Fl_Slider fast {
+      label {fast
+redraw}
+      xywh {140 200 30 200}
+      extra_code {o->set_output();}
+    }
+    Fl_Slider slow {
+      label {slow
+redraw}
+      xywh {190 200 30 200}
+      extra_code {o->set_output();}
+    }
+    Fl_Box {} {
+      label {The left slider has
+changed(FL_WHEN_CHANGED | FL_WHEN_RELEASE | FL_WHEN_NOT_CHANGED) so it produces a callback on both drag and release mouse events.
+
+The middle slider (representing a widget with low overhead) is changed on every mouse movement.
+
+The right slider (representing a widget with high overhead) is only updated when the mouse is released, by checking if Fl::pushed() is zero.} selected
+      xywh {10 10 300 180} align 148 box DOWN_BOX color 53 selection_color 47
+    }
+  }
+} 

Added: branches/branch-3.0/test2/fast_slow.h
===================================================================
--- branches/branch-3.0/test2/fast_slow.h	                        (rev 0)
+++ branches/branch-3.0/test2/fast_slow.h	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,12 @@
+// generated by Fast Light User Interface Designer (fluid) version 2.0001
+
+#ifndef fast_slow_h
+#define fast_slow_h
+#include <FL/Fl.H>
+#include <FL/Fl_Window.H>
+#include <FL/Fl_Slider.H>
+extern Fl_Slider* control;
+extern Fl_Slider* fast;
+extern Fl_Slider* slow;
+#include <FL/Fl_Box.H>
+#endif

Added: branches/branch-3.0/test2/file_chooser.cxx
===================================================================
--- branches/branch-3.0/test2/file_chooser.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/file_chooser.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,363 @@
+//
+// " $Id: file_chooser.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $"
+//
+// File chooser test program for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2006 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+//    http://www.fltk.org/str.php
+//
+//
+// Contents:
+//
+//   main()           - Create a file chooser and wait for a selection to
+//                      be made.
+//   close_callback() - Close the main window...
+//   fc_callback()    - Handle choices in the file chooser...
+//   pdf_check()      - Check for and load the first page of a PDF file.
+//   ps_check()       - Check for and load the first page of a PostScript
+//                      file.
+//   show_callback()  - Show the file chooser...
+//
+
+//
+// Include necessary headers...
+//
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <fltk/FileChooser.h>
+#include <fltk/file_chooser.h>
+#include <fltk/FileIcon.h>
+#include <fltk/SharedImage.h>
+#include <fltk/pnmImage.h>
+//#include <fltk/PNMImage.h>
+#include <fltk/LightButton.h>
+#include <fltk/run.h>
+#include <string.h>
+#include <fltk/ask.h>
+
+using namespace fltk;
+
+//
+// Globals...
+//
+
+Input		*filter;
+FileBrowser		*files;
+FileChooser		*fc;
+SharedImage		*image = 0;
+
+//
+// Functions...
+//
+
+void		close_callback(void);
+void		create_callback(void);
+void		dir_callback(void);
+void		fc_callback(FileChooser *, void *);
+void		multi_callback(void);
+SharedImage	*pdf_check(const char *, uchar *, int);
+SharedImage	*ps_check(const char *, uchar *, int);
+void		show_callback(void);
+
+//
+// 'close_callback()' - Close the main window...
+//
+
+void
+close_callback(void)
+{
+  exit(0);
+}
+
+
+//
+// 'create_callback()' - Handle clicks on the create button.
+//
+
+void
+create_callback(void)
+{
+  fc->type(fc->type() ^ FileChooser::CREATE);
+}
+
+
+//
+// 'dir_callback()' - Handle clicks on the directory button.
+//
+
+void
+dir_callback(void)
+{
+  fc->type(fc->type() ^ FileChooser::DIRECTORY);
+}
+
+
+//
+// 'fc_callback()' - Handle choices in the file chooser...
+//
+
+void
+fc_callback(FileChooser *fc,	// I - File chooser
+            void            *data)	// I - Data
+{
+  const char		*filename;	// Current filename
+
+
+  printf("fc_callback(fc = %p, data = %p)\n", fc, data);
+
+  filename = fc->value();
+
+  printf("    filename = \"%s\"\n", filename ? filename : "(null)");
+}
+
+
+//
+// 'multi_callback()' - Handle clicks on the multi button.
+//
+
+void
+multi_callback(void)
+{
+  fc->type(fc->type() ^ FileChooser::MULTI);
+}
+
+
+//
+// 'pdf_check()' - Check for and load the first page of a PDF file.
+//
+
+SharedImage *			// O - Page image or NULL
+pdf_check(const char *name,	// I - Name of file
+          uchar      *header,	// I - Header data
+	  int        headerlen)	// I - Length of header data
+{
+  const char	*home;		// Home directory
+  char		preview[1024],	// Preview filename
+		command[1024];	// Command
+
+
+  if (memcmp(header, "%PDF", 4) != 0)
+    return 0;
+
+  home = getenv("HOME");
+  sprintf(preview, "%s/.preview.ppm", home ? home : "");
+
+  sprintf(command,
+          "gs -r100 -dFIXED -sDEVICE=ppmraw -dQUIET -dNOPAUSE -dBATCH "
+	  "-sstdout=\"%%stderr\" -sOUTPUTFILE=\'%s\' "
+	  "-dFirstPage=1 -dLastPage=1 \'%s\' 2>/dev/null", preview, name);
+
+  if (system(command)) return 0;
+
+  return new pnmImage(preview);
+}
+
+
+//
+// 'ps_check()' - Check for and load the first page of a PostScript file.
+//
+
+SharedImage *			// O - Page image or NULL
+ps_check(const char *name,	// I - Name of file
+         uchar      *header,	// I - Header data
+	 int        headerlen)	// I - Length of header data
+{
+  const char	*home;		// Home directory
+  char		preview[1024],	// Preview filename
+		outname[1024],	// Preview PS file
+		command[1024];	// Command
+  FILE		*in,		// Input file
+		*out;		// Output file
+  int		page;		// Current page
+  char		line[256];	// Line from file
+
+
+  if (memcmp(header, "%!", 2) != 0)
+    return 0;
+
+  home = getenv("HOME");
+  sprintf(preview, "%s/.preview.ppm", home ? home : "");
+
+  if (memcmp(header, "%!PS", 4) == 0) {
+    // PS file has DSC comments; extract the first page...
+    sprintf(outname, "%s/.preview.ps", home ? home : "");
+
+    if (strcmp(name, outname) != 0) {
+      in   = fopen(name, "rb");
+      out  = fopen(outname, "wb");
+      page = 0;
+
+      while (fgets(line, sizeof(line), in) != NULL) {
+	if (strncmp(line, "%%Page:", 7) == 0) {
+          page ++;
+	  if (page > 1) break;
+	}
+
+	fputs(line, out);
+      }
+
+      fclose(in);
+      fclose(out);
+    }
+  } else {
+    // PS file doesn't have DSC comments; do the whole file...
+    strncpy(outname, name, sizeof(outname) - 1);
+    outname[sizeof(outname) - 1] = '\0';
+  }
+
+  sprintf(command,
+          "gs -r100 -dFIXED -sDEVICE=ppmraw -dQUIET -dNOPAUSE -dBATCH "
+	  "-sstdout=\"%%stderr\" -sOUTPUTFILE=\'%s\' \'%s\' 2>/dev/null",
+	  preview, outname);
+
+  if (system(command)) return 0;
+
+  return new pnmImage(preview);
+}
+
+
+//
+// 'show_callback()' - Show the file chooser...
+//
+
+void
+show_callback(void)
+{
+  int	i;			// Looping var
+  int	count;			// Number of files selected
+  char	relative[1024];		// Relative filename
+
+
+  if (filter->value()[0])
+    fc->filter(filter->value());
+
+  fc->show(240,200);
+
+  while (fc->visible())
+    fltk::wait();
+
+  count = fc->count();
+  if (count > 0)
+  {
+    files->clear();
+
+    for (i = 1; i <= count; i ++)
+    {
+      if (!fc->value(i))
+        break;
+
+      fltk::filename_relative(relative, sizeof(relative), fc->value(i));
+
+      files->add(relative,
+                 FileIcon::find(fc->value(i), FileIcon::PLAIN));
+    }
+
+    files->redraw();
+  }
+}
+
+//
+// 'main()' - Create a file chooser and wait for a selection to be made.
+//
+#define SIMPLE_IMPL 0
+int			// O - Exit status
+main(int  argc,		// I - Number of command-line arguments
+     char *argv[])	// I - Command-line arguments
+{
+  // Make the file chooser...
+  //fltk::scheme(NULL);
+
+  // if you decide not to link with images lib you must comment this:
+  FileIcon::load_system_icons();
+
+#if !SIMPLE_IMPL
+  Window	*window;// Main window
+  Button	*button;// Buttons
+  FileIcon	*icon;	// New file icon
+
+  fc = new FileChooser(".", "*", FileChooser::SINGLE, "FileChooser Test");
+  fc->callback(fc_callback);
+
+  // Register the PS and PDF image types...
+  SharedImage::add_handler(pdf_check);
+  SharedImage::add_handler(ps_check);
+
+  // Make the main window...
+  window = new Window(400, 200, "File Chooser Test");
+  window->begin();
+
+  filter = new Input(50, 10, 315, 25, "Filter:");
+  if (argc > 1)
+    filter->value(argv[1]);
+  else
+    filter->value(
+		  "Image Files (*.{bmp,gif,jpg,png})\t"
+		  "PDF Files (*.pdf)\t"
+                  "PostScript Files (*.ps)\t"
+		  "C/C++ Source Files (*.{c,C,cc,cpp,cxx,h,H})"
+		  );
+
+  button = new Button(365, 10, 25, 25);
+  button->labelcolor(fltk::YELLOW);
+  button->callback((Callback *)show_callback);
+
+#define TEST_FETCH_PNG 0
+#if TEST_FETCH_PNG
+  icon = new FileIcon("butt", FileIcon::DIRECTORY);
+  icon->load_image("./images/folder.png");
+#else
+  icon   = new FileIcon(*FileIcon::find(".", FileIcon::DIRECTORY));
+#endif
+  icon->value(button);
+
+  button = new LightButton(50, 45, 80, 25, "MULTI");
+  button->callback((Callback*)multi_callback);
+
+  button = new LightButton(140, 45, 90, 25, "CREATE");
+  button->callback((Callback*)create_callback);
+
+  button = new LightButton(240, 45, 115, 25, "DIRECTORY");
+  button->callback((Callback*)dir_callback);
+
+  files = new FileBrowser(50, 80, 340, 75, "Files:");
+  files->align(fltk::ALIGN_LEFT);
+
+  button = new Button(340, 165, 50, 25, "Close");
+  button->callback((Callback*)close_callback);
+  window->resizable(files);
+  window->end();
+  window->show(1, argv);
+  fltk::run();
+
+#else
+  const char *defaultname = "images/testimg.jpg";
+  fltk::use_system_file_chooser(true);
+  const char * name = fltk::file_chooser("Open","Image Files (*.{bmp,gif,jpg,png})\t", defaultname);
+  fltk::message("File selected is : %s", name && strlen(name) ? name : "<no_selection>");
+#endif
+
+  return (0);
+}
+
+//
+// End of "$Id: file_chooser.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $".
+//

Added: branches/branch-3.0/test2/fl_jpeg_image.cxx
===================================================================
--- branches/branch-3.0/test2/fl_jpeg_image.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/fl_jpeg_image.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,203 @@
+//
+// "$Id: fl_jpeg_image.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $"
+//
+// fl_draw_image test program for the Fast Light Tool Kit (FLTK).
+//
+// Be sure to try every visual with the -v switch and try -m (monochrome)
+// on each of them.
+//
+// This program requires either the libjpeg.a library or an internal DD
+// library to read images (this is chosen by the presence of the "DD"
+// #define).
+//
+// To get the jpeg library:
+//
+// The "official" archive site for this software is ftp.uu.net (Internet
+// address 192.48.96.9).  The most recent released version can always be
+// found there in directory graphics/jpeg.  This particular version will
+// be archived as graphics/jpeg/jpegsrc.v6a.tar.gz.
+//
+// The makefile assummes you decompressed and build these in a directory
+// called "jpeg-6a" in the same location as the "FL" directory.
+//
+// Copyright 1998-2006 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+//    http://www.fltk.org/str.php
+//
+
+#include <fltk/Fl.h>
+#include <fltk/fl_draw.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+void readtheimage(const char *name); // below
+int width;
+int height;
+int depth;
+int linedelta;
+uchar *ibuffer;
+
+////////////////////////////////////////////////////////////////
+
+#include <fltk/Fl_Window.h>
+int mono;
+
+class image_window : public Fl_Window {
+  void draw();
+public:
+  image_window(int w,int h) : Fl_Window(w,h) {box(FL_NO_BOX);}
+};
+
+void image_window::draw() {
+  if (mono)
+    fl_draw_image_mono(ibuffer+1,0,0,width,height,depth,linedelta);
+  else
+    fl_draw_image(ibuffer,0,0,width,height,depth,linedelta);
+}
+
+////////////////////////////////////////////////////////////////
+
+#include <fltk/x.h>
+#include "list_visuals.cxx"
+
+////////////////////////////////////////////////////////////////
+
+int visid = -1;
+int arg(int argc, char **argv, int &i) {
+  if (argv[i][1] == 'm') {mono = 1; i++; return 1;}
+
+  if (argv[i][1] == 'v') {
+    if (i+1 >= argc) return 0;
+    visid = atoi(argv[i+1]);
+    i += 2;
+    return 2;
+  }
+
+  return 0;
+}
+
+int main(int argc, char ** argv) {
+
+  int i = 1;
+  if (!Fl::args(argc,argv,i,arg) || i != argc-1) {
+    fprintf(stderr,"usage: %s <switches> image_file\n"
+" -v # : use visual\n"
+" -m : monochrome\n"
+"%s\n",
+	    argv[0],Fl::help);
+    exit(1);
+  }
+
+  readtheimage(argv[i]);
+  image_window *window = new image_window(width,height);
+
+  if (visid>=0) {
+    fl_open_display();
+    XVisualInfo templt; int num;
+    templt.visualid = visid;
+    fl_visual = XGetVisualInfo(fl_display, VisualIDMask, &templt, &num);
+    if (!fl_visual) {
+      fprintf(stderr, "No visual with id %d, use one of:\n",visid);
+      list_visuals();
+      exit(1);
+    }
+    fl_colormap = XCreateColormap(fl_display, RootWindow(fl_display,fl_screen),
+				fl_visual->visual, AllocNone);
+    fl_xpixel(0); // make sure black is allocated
+  }
+
+  window->show(argc,argv);
+  return Fl::run();
+}
+
+////////////////////////////////////////////////////////////////
+#ifndef DD_LIBRARY
+// Read using jpeg library:
+
+extern "C" {
+#include "jpeglib.h"
+}
+
+void readtheimage(const char *name) {
+  struct jpeg_decompress_struct cinfo;
+  struct jpeg_error_mgr jerr;
+  FILE * infile = fopen(name, "rb");
+  if (!infile) {
+    fprintf(stderr, "can't open %s\n", name);
+    exit(1);
+  }
+  cinfo.err = jpeg_std_error(&jerr);
+  jpeg_create_decompress(&cinfo);
+  jpeg_stdio_src(&cinfo, infile);
+  jpeg_read_header(&cinfo, TRUE);
+  jpeg_start_decompress(&cinfo);
+  width = cinfo.output_width;
+  height = cinfo.output_height;
+  depth = cinfo.output_components;
+  ibuffer = new uchar[width*height*depth];
+  uchar *rp = ibuffer;
+  for (int i=0; i<height; i++) {
+    jpeg_read_scanlines(&cinfo, &rp, 1);
+    rp += width*depth;
+  }
+  jpeg_finish_decompress(&cinfo);
+  jpeg_destroy_decompress(&cinfo);
+  fclose(infile);
+}
+
+////////////////////////////////////////////////////////////////
+#else // Digital Domain in-house library
+
+#include "DDNewImage/DDImageOp.h"
+#include "DDNewImage/DDImgRead.h"
+#include "DDNewImage/DDImgToBuffer.h"
+
+void readtheimage(const char *name) {
+  DDImgRead reader(name);
+  width = reader.xsize();
+  height = reader.ysize();
+  depth = 4; // reader.zsize();
+  ibuffer = new uchar[width*height*depth];
+  DDImgToBuffer b(&reader,depth,ibuffer,0,0,width,height);
+  b.execute();
+  if (DDImage::haderror) {
+    fprintf(stderr,"%s\n",DDImage::errormsg());
+    exit(1);
+  }
+  // swap it around into RGBA order:
+  for (uchar *p = ibuffer+width*height*4-4; p >= ibuffer; p-=4) {
+    uchar r = p[3];
+    uchar g = p[2];
+    uchar b = p[1];
+    uchar a = p[0];
+    p[0] = r;
+    p[1] = g;
+    p[2] = b;
+    p[3] = a;
+  }
+  // make it bottom-to-top:
+  ibuffer = ibuffer + width*(height-1)*depth;
+  linedelta = -(width*depth);
+}
+#endif
+
+//
+// End of "$Id: fl_jpeg_image.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $".
+//

Added: branches/branch-3.0/test2/fltk_scheme.cxx
===================================================================
--- branches/branch-3.0/test2/fltk_scheme.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/fltk_scheme.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,105 @@
+#include <fltk/fl_config.h>
+#include <fltk/x.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <limits.h>
+#ifdef _WIN32
+#include <windows.h>
+#endif
+#include <config.h>
+
+#ifndef PATH_MAX
+#define PATH_MAX 128
+#endif
+
+#ifndef _WIN32
+// Stolen from KDE!
+static int _getprop(Window w, Atom a, Atom type, long len, unsigned char **p){
+  Atom real_type;
+  int format;
+  unsigned long n, extra;
+  int status;
+
+  status = XGetWindowProperty(fl_display, w, a, 0L, len, False, type, &real_type, &format, &n, &extra, p);
+  if (status != Success || *p == 0)
+    return -1;
+  if (n == 0)
+    XFree((char*) *p);
+  return n;
+}
+
+// Stolen from KDE!
+static bool getSimpleProperty(Window w, Atom a, long &result){
+  long *p = 0;
+
+  if (_getprop(w, a, a, 1L, (unsigned char**)&p) <= 0){
+    return false;
+  }
+
+  result = p[0];
+  XFree((char *) p);
+  return true;
+}
+#endif
+
+const char* pname;
+
+void usage() {
+  fprintf(stderr, "%s: Usage- %s <scheme>\n", pname, pname);
+  exit(1);
+}
+
+int main(int argc, char* argv[]) {
+  pname = argv[0];
+  if (argc != 2) usage();
+
+  char scheme[PATH_MAX];
+  strncpy(scheme, argv[1], sizeof(scheme));
+
+  Fl_Config flconfig("flconfig");
+  int r;
+
+  if ( (r = flconfig.set("default/scheme", scheme)) ) {
+    fprintf(stderr, "%s: Error- Cannot set default scheme.\n", pname);
+    fprintf(stderr, "%s: Error- %s.\n", pname, flconfig.strerror());
+    exit(3);
+  }
+
+#ifndef _WIN32
+  // stolen from KDE!
+  fl_open_display();
+  int screen = DefaultScreen(fl_display);
+  Window root = RootWindow(fl_display, screen);
+
+  XEvent ev;
+  unsigned int i, nrootwins;
+  Window dw1, dw2, *rootwins;
+
+  XQueryTree(fl_display, root, &dw1, &dw2, &rootwins, &nrootwins);
+
+  Atom a = XInternAtom(fl_display, "FLTK_STYLE_WINDOW", False);
+  Atom Scheme = XInternAtom(fl_display, "FLTKChangeScheme", False);
+
+  for (i = 0; i < nrootwins; i++) {
+    long result = 0;
+    getSimpleProperty(rootwins[i],a, result);
+    if (result) {
+      ev.xclient.type = ClientMessage;
+      ev.xclient.display = fl_display;
+      ev.xclient.window = rootwins[i];
+      ev.xclient.message_type = Scheme;
+      ev.xclient.format = 32;
+
+      XSendEvent(fl_display, rootwins[i] , False, 0L, &ev);
+    }
+  }
+
+  XFlush(fl_display);
+
+  XFree((char *) rootwins);
+#else
+  // Need to figure out how to do this for Windows...
+  // But why bother, we already handle Windows style change events.
+#endif
+}
+

Added: branches/branch-3.0/test2/fltkrc
===================================================================
--- branches/branch-3.0/test2/fltkrc	                        (rev 0)
+++ branches/branch-3.0/test2/fltkrc	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,41 @@
+#
+# config file for the minimalistic fltk conf reader plugin
+#
+
+[window]
+box		= image_flat_box(images/bg.jpeg)# This is an example 
+						# of boxtype defined in plugin
+
+
+[global]
+box		= image_box(images/bg.jpeg images/bg2.jpeg images/bg2.jpeg)	# This is an example 
+glyph_box	= image_box(images/bg.jpeg images/bg2.jpeg images/bg2.jpeg)	# This is an example 
+						# of boxtype defined in plugin
+#box		= rshadow_box			# Normal box
+#color		= #d0d0e0			# Color in hex
+#selection_color	= #d0d0e0			# Color in hex
+label_color	= .2, 0, 0			# Color in r, g, b
+
+
+[check_button]
+box		= no_box
+
+
+[menu_item]
+box			= image_flat_box(images/bg.jpeg images/bg2.jpeg images/bg2.jpeg)
+#highlight_label_color	= 0.7 , 0.2 , 0.2
+highlight_label_color	= 1,0,0
+highlight_label_color	= 1,0,0
+
+[menu_title]
+box			= image_flat_box(images/bg.jpeg images/bg2.jpeg images/bg2.jpeg)
+highlight_label_color	= 0.7 , 0.2 , 0.2
+
+
+[tabs]
+box		= image_box(images/bg2.jpeg)
+
+
+#[box]
+#box		= image_box(images/bg2.jpeg)
+box			= image_flat_box(images/bg.jpeg images/bg2.jpeg images/bg2.jpeg)

Added: branches/branch-3.0/test2/fonts.cxx
===================================================================
--- branches/branch-3.0/test2/fonts.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/fonts.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,215 @@
+//
+// "$Id: fonts.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $"
+//
+// Font demo program for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2003 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+//    http://www.fltk.org/str.php
+//
+
+#include <fltk/run.h>
+#include <fltk/Window.h>
+#include <fltk/Browser.h>
+#include <fltk/CheckButton.h>
+#include <fltk/draw.h>
+#include <fltk/Font.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+fltk::Window *form;
+
+class FontDisplay : public fltk::Widget {
+  void draw();
+public:
+  fltk::Font* font; float size; const char* encoding;
+  FontDisplay(fltk::Box* B, int X, int Y, int W, int H, const char* L = 0) :
+    fltk::Widget(X,Y,W,H,L) {box(B); font = 0; size = 14.0f;}
+};
+
+fltk::Widget* id_box;
+
+void FontDisplay::draw() {
+  draw_box();
+  fltk::push_clip(2,2,w()-4,h()-4);
+  const char* saved_encoding = fltk::get_encoding();
+  fltk::set_encoding(encoding);
+  fltk::setfont(font, size);
+  id_box->label(fltk::Font::current_name());
+  id_box->redraw();
+  fltk::setcolor(fltk::BLACK);
+  char buffer[32];
+  for (int Y = 1; Y < 8; Y++) {
+    for (int X = 0; X < 32; X++) buffer[X] = (32*Y+X);
+    fltk::drawtext(buffer, 32, 3, 3+(size+leading())*Y);
+  }
+  fltk::set_encoding(saved_encoding);
+  fltk::pop_clip();
+}
+
+FontDisplay *textobj;
+
+fltk::Browser *fontobj, *sizeobj, *encobj;
+
+fltk::Font** fonts; // list returned by fltk
+
+fltk::Group *button_group;
+fltk::CheckButton* bold_button, *italic_button;
+
+float pickedsize = 14.0f;
+
+void font_cb(fltk::Widget *, long) {
+  int fn = fontobj->value();
+//printf("font: %d    name: %s   bigname: %s\n", fn, fonts[fn]->name(), fonts[fn]->system_name());
+
+  fltk::Font* f = fonts[fn];
+  if (f->bold() == f) bold_button->deactivate();
+  else bold_button->activate();
+  if (f->italic() == f) italic_button->deactivate();
+  else italic_button->activate();
+  if (bold_button->value()) f = f->bold();
+  if (italic_button->value()) f = f->italic();
+  textobj->font = f;
+
+  char saved[30];
+  if (textobj->encoding)
+    strncpy(saved, textobj->encoding, 29);
+  else
+    saved[0] = 0;
+  encobj->clear();
+  const char** encodings; int ne = f->encodings(encodings);
+  int picked = -1;
+  int iso8859 = 0;
+  for (int i = 0; i < ne; i++) {
+    encobj->add(encodings[i]);
+    if (!strcmp(encodings[i], saved)) picked = i;
+    if (!strcmp(encodings[i], fltk::get_encoding())) iso8859 = i;
+  }
+  if (picked < 0) picked = iso8859;
+  textobj->encoding = encodings[picked];
+  encobj->value(picked);
+
+  sizeobj->clear();
+  int *s; int n = f->sizes(s);
+  if (!n) {
+    // no sizes (this only happens on X)
+    fltk::setfont(f, pickedsize);
+    textobj->size = fltk::getsize();
+  } else /*if (s[0] == 0)*/ {
+    // many sizes;
+    int j = 1;
+    for (int i = s[0]?0:1; i<64 || i<s[n-1]; i++) {
+      char buf[20];
+      if (j < n && i==s[j]) {sprintf(buf,"@b;%d",i); j++;}
+      else sprintf(buf,"%d",i);
+      sizeobj->add(buf);
+    }
+    sizeobj->value(int(pickedsize-1));
+    textobj->size = pickedsize;
+    /*  } else {
+    // some sizes
+    int w = 0;
+    for (int i = 0; i < n; i++) {
+      if (s[i]<=pickedsize) w = i;
+      char buf[20];
+      sprintf(buf,"@b;%d",s[i]);
+      sizeobj->add(buf);
+    }
+    sizeobj->value(w);
+    textobj->size = s[w]; */
+  }
+  encobj->redraw();
+  sizeobj->redraw();
+  textobj->redraw();
+  button_group->redraw();
+}
+
+void encoding_cb(fltk::Widget *, long) {
+  int i = encobj->value();
+  if (i < 0)
+     return;
+  textobj->encoding = encobj->child(i)->label();
+  textobj->redraw();
+}
+
+void size_cb(fltk::Widget *, long) {
+  int i = sizeobj->value();
+  if (i < 0) 
+     return;
+  const char *c = sizeobj->child(i)->label();
+  while (*c < '0' || *c > '9') c++;
+  pickedsize = (float) atoi(c);
+  textobj->size = pickedsize;
+  textobj->redraw();
+}
+
+void create_the_forms() {
+  form = new fltk::Window(550,390);
+  form->set_double_buffer();
+  form->begin();
+  id_box = new fltk::Widget(10, 172, 530, 15);
+  id_box->box(fltk::ENGRAVED_BOX);
+  id_box->labelsize(10);
+  id_box->labelfont(fltk::COURIER);
+  id_box->set_flag(fltk::ALIGN_INSIDE|fltk::ALIGN_CLIP|fltk::ALIGN_LEFT);
+  textobj = new FontDisplay(fltk::ENGRAVED_BOX,10,10,530,160);
+  textobj->clear_flag(fltk::ALIGN_MASK);
+  textobj->set_flag(fltk::ALIGN_TOP|fltk::ALIGN_LEFT|fltk::ALIGN_INSIDE|fltk::ALIGN_CLIP);
+  button_group = new fltk::Group(10, 190, 140, 20);
+  button_group->begin();
+  bold_button = new fltk::CheckButton(0, 0, 70, 20, "Bold");
+  bold_button->labelfont(bold_button->labelfont()->bold());
+  bold_button->callback(font_cb, 1);
+  italic_button = new fltk::CheckButton(70, 0, 70, 20, "Italic");
+  italic_button->labelfont(italic_button->labelfont()->italic());
+  italic_button->callback(font_cb, 1);
+  button_group->end();
+  fontobj = new fltk::Browser(10, 210, 280, 170);
+  fontobj->when(fltk::WHEN_CHANGED);
+  fontobj->callback(font_cb);
+  form->resizable(fontobj);
+  encobj = new fltk::Browser(300, 210, 100, 170);
+  encobj->when(fltk::WHEN_CHANGED);
+  encobj->callback(encoding_cb, 1);
+  sizeobj = new fltk::Browser(410, 210, 130, 170);
+  sizeobj->when(fltk::WHEN_CHANGED);
+  sizeobj->callback(size_cb);
+  form->end();
+}
+
+#include <fltk/ask.h>
+
+int main(int argc, char **argv) {
+  create_the_forms();
+  int numfonts = fltk::list_fonts(fonts);
+  for (int i = 0; i < numfonts; i++)
+       fontobj->add(fonts[i]->name());
+
+  fontobj->value(0);
+  textobj->encoding = fltk::get_encoding();
+  font_cb(fontobj,0);
+  form->show(argc,argv);
+  return fltk::run();
+}
+
+//
+// End of "$Id: fonts.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $".
+//

Added: branches/branch-3.0/test2/fractals.cxx
===================================================================
--- branches/branch-3.0/test2/fractals.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/fractals.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,835 @@
+//
+// "$Id: fractals.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $"
+//
+// Fractal drawing demo for the Fast Light Tool Kit (FLTK).
+//
+// This is a GLUT demo program, with modifications to
+// demonstrate how to add FLTK controls to a GLUT program.   The GLUT
+// code is unchanged except for the end (search for FLTK to find changes).
+//
+// Copyright 1998-2006 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+//    http://www.fltk.org/str.php
+//
+
+#include <config.h>
+#if !HAVE_GL || !HAVE_GL_GLU_H
+#include <fltk/run.h>
+#include <fltk/ask.h>
+int main(int, char**) {
+  fltk::alert("This demo does not work without GL and GLU");
+  return 1;
+}
+#else
+/*
+ * To compile: cc -o fractals fractals.c -lGL -lGLU -lX11 -lglut -lXmu -lm
+ *
+ * Usage: fractals
+ *
+ * Homework 6, Part 2: fractal mountains and fractal trees 
+ * (Pretty Late)
+ *
+ * Draws fractal mountains and trees -- and an island of mountains in water 
+ * (I tried having trees on the island but it didn't work too well.)
+ *
+ * Two viewer modes: polar and flying (both restrained to y>0 for up vector).
+ * Keyboard 0->9 and +/- control speed when flying.
+ *
+ * Only keyboard commands are 0-9 and +/- for speed in flying mode.
+ *
+ * Fog would make the island look much better, but I couldn't get it to work
+ * correctly.  Would line up on -z axis not from eye.
+ *
+ * Philip Winston - 3/4/95
+ * pwinston@hmc.edu
+ * http://www.cs.hmc.edu/people/pwinston
+ *
+ */
+
+#include <FL/glut.H>
+#ifdef __APPLE__
+#  include <OpenGL/glu.h>
+#else
+#  include <GL/glu.h> // added for FLTK
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <limits.h>           /* ULONG_MAX is defined here */
+#include <float.h>            /* FLT_MAX is atleast defined here */
+typedef unsigned long ulong;
+
+#include <time.h>  /* for random seed */
+
+#include "fracviewer.h"
+
+#if defined(WIN32) || defined(__EMX__)
+#  define drand48() (((float) rand())/((float) RAND_MAX))
+#  define srand48(x) (srand((x)))
+#elif defined __APPLE__
+#  define drand48() (((float) rand())/((float) RAND_MAX))
+#  define srand48(x) (srand((x)))
+#endif
+
+typedef enum { NOTALLOWED=10, MOUNTAIN, TREE, ISLAND, BIGMTN, STEM, LEAF, 
+               MOUNTAIN_MAT, WATER_MAT, LEAF_MAT, TREE_MAT, STEMANDLEAVES,
+               AXES } DisplayLists;
+
+#define MAXLEVEL 8
+
+int Rebuild = 1,        /* Rebuild display list in next display? */
+    Fract   = TREE,     /* What fractal are we building */
+    Level   = 4;        /* levels of recursion for fractals */     
+
+int DrawAxes = 0;       
+
+/***************************************************************/
+/************************* VECTOR JUNK *************************/
+/***************************************************************/
+
+  /* print vertex to stderr */
+void printvert(float v[3])
+{
+  fprintf(stderr, "(%f, %f, %f)\n", v[0], v[1], v[2]);
+}
+
+#if 0	// removed for FL, it is in fracviewer.c
+  /* normalizes v */
+void normalize(GLfloat v[3])
+{
+  GLfloat d = sqrt(v[0]*v[0] + v[1]*v[1] + v[2]*v[2]);
+
+  if (d == 0)
+    fprintf(stderr, "Zero length vector in normalize\n");
+  else
+    v[0] /= d; v[1] /= d; v[2] /= d;
+}
+
+  /* calculates a normalized crossproduct to v1, v2 */
+void ncrossprod(float v1[3], float v2[3], float cp[3])
+{
+  cp[0] = v1[1]*v2[2] - v1[2]*v2[1];
+  cp[1] = v1[2]*v2[0] - v1[0]*v2[2];
+  cp[2] = v1[0]*v2[1] - v1[1]*v2[0];
+  normalize(cp);
+}
+#endif
+
+  /* calculates normal to the triangle designated by v1, v2, v3 */
+void triagnormal(float v1[3], float v2[3], float v3[3], float norm[3])
+{
+  float vec1[3], vec2[3];
+
+  vec1[0] = v3[0] - v1[0];  vec2[0] = v2[0] - v1[0];
+  vec1[1] = v3[1] - v1[1];  vec2[1] = v2[1] - v1[1];
+  vec1[2] = v3[2] - v1[2];  vec2[2] = v2[2] - v1[2];
+
+  ncrossprod(vec2, vec1, norm);
+}
+
+float xzlength(float v1[3], float v2[3])
+{
+  return sqrt((v1[0] - v2[0])*(v1[0] - v2[0]) +
+              (v1[2] - v2[2])*(v1[2] - v2[2]));
+}
+
+float xzslope(float v1[3], float v2[3])
+{
+  return ((v1[0] != v2[0]) ? ((v1[2] - v2[2]) / (v1[0] - v2[0]))
+	                   : FLT_MAX);
+}
+
+
+/***************************************************************/
+/************************ MOUNTAIN STUFF ***********************/
+/***************************************************************/
+
+GLfloat DispFactor[MAXLEVEL];  /* Array of what to multiply random number
+				  by for a given level to get midpoint
+				  displacement  */
+GLfloat DispBias[MAXLEVEL];  /* Array of what to add to random number
+				before multiplying it by DispFactor */
+
+#define NUMRANDS 191
+float RandTable[NUMRANDS];  /* hash table of random numbers so we can
+			       raise the same midpoints by the same amount */ 
+
+         /* The following are for permitting an edge of a moutain to be   */
+         /* pegged so it won't be displaced up or down.  This makes it    */
+         /* easier to setup scenes and makes a single moutain look better */
+
+GLfloat Verts[3][3],    /* Vertices of outside edges of mountain */
+        Slopes[3];      /* Slopes between these outside edges */
+int     Pegged[3];      /* Is this edge pegged or not */           
+
+ /*
+  * Comes up with a new table of random numbers [0,1)
+  */
+void InitRandTable(unsigned int seed)
+{
+  int i;
+
+  srand48((long) seed);
+  for (i = 0; i < NUMRANDS; i++)
+    RandTable[i] = drand48() - 0.5;
+}
+
+  /* calculate midpoint and displace it if required */
+void Midpoint(GLfloat mid[3], GLfloat v1[3], GLfloat v2[3],
+	      int edge, int level)
+{
+  unsigned hash;
+
+  mid[0] = (v1[0] + v2[0]) / 2;
+  mid[1] = (v1[1] + v2[1]) / 2;
+  mid[2] = (v1[2] + v2[2]) / 2;
+  if (!Pegged[edge] || (fabs(xzslope(Verts[edge], mid) 
+                        - Slopes[edge]) > 0.00001)) {
+    srand48((int)((v1[0]+v2[0])*23344));
+    hash = unsigned(drand48() * 7334334);
+    srand48((int)((v2[2]+v1[2])*43433));
+    hash = (unsigned)(drand48() * 634344 + hash) % NUMRANDS;
+    mid[1] += ((RandTable[hash] + DispBias[level]) * DispFactor[level]);
+  }
+}
+
+  /*
+   * Recursive moutain drawing routine -- from lecture with addition of 
+   * allowing an edge to be pegged.  This function requires the above
+   * globals to be set, as well as the Level global for fractal level 
+   */
+static float cutoff = -1;
+
+void FMR(GLfloat v1[3], GLfloat v2[3], GLfloat v3[3], int level)
+{
+  if (level == Level) {
+    GLfloat norm[3];
+    if (v1[1] <= cutoff && v2[1]<=cutoff && v3[1]<=cutoff) return;
+    triagnormal(v1, v2, v3, norm);
+    glNormal3fv(norm);
+    glVertex3fv(v1);
+    glVertex3fv(v2);
+    glVertex3fv(v3);
+
+  } else {
+    GLfloat m1[3], m2[3], m3[3];
+
+    Midpoint(m1, v1, v2, 0, level);
+    Midpoint(m2, v2, v3, 1, level);
+    Midpoint(m3, v3, v1, 2, level);
+
+    FMR(v1, m1, m3, level + 1);
+    FMR(m1, v2, m2, level + 1);
+    FMR(m3, m2, v3, level + 1);
+    FMR(m1, m2, m3, level + 1);
+  }
+}
+
+ /*
+  * sets up lookup tables and calls recursive mountain function
+  */
+void FractalMountain(GLfloat v1[3], GLfloat v2[3], GLfloat v3[3],
+                     int pegged[3])
+{
+  GLfloat lengths[MAXLEVEL];
+  GLfloat fraction[8] = { 0.3, 0.3, 0.4, 0.2, 0.3, 0.2, 0.4, 0.4  };
+  GLfloat bias[8]     = { 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1  };
+  int i;
+  float avglen = (xzlength(v1, v2) + 
+                  xzlength(v2, v3) +
+		  xzlength(v3, v1) / 3);
+
+  for (i = 0; i < 3; i++) {
+    Verts[0][i] = v1[i];      /* set mountain vertex globals */
+    Verts[1][i] = v2[i];
+    Verts[2][i] = v3[i];
+    Pegged[i] = pegged[i];
+  }
+
+  Slopes[0] = xzslope(Verts[0], Verts[1]);   /* set edge slope globals */
+  Slopes[1] = xzslope(Verts[1], Verts[2]);
+  Slopes[2] = xzslope(Verts[2], Verts[0]);
+
+  lengths[0] = avglen;          
+  for (i = 1; i < Level; i++) {   
+    lengths[i] = lengths[i-1]/2;     /* compute edge length for each level */
+  }
+
+  for (i = 0; i < Level; i++) {     /* DispFactor and DispBias arrays */      
+    DispFactor[i] = (lengths[i] * ((i <= 7) ? fraction[i] : fraction[7]));
+    DispBias[i]   = ((i <= 7) ? bias[i] : bias[7]);
+  } 
+
+  glBegin(GL_TRIANGLES);
+    FMR(v1, v2, v3, 0);    /* issues no GL but vertex calls */
+  glEnd();
+}
+
+ /*
+  * draw a mountain and build the display list
+  */
+void CreateMountain(void)
+{
+  GLfloat v1[3] = { 0, 0, -1 }, v2[3] = { -1, 0, 1 }, v3[3] = { 1, 0, 1 };
+  int pegged[3] = { 1, 1, 1 };
+
+  glNewList(MOUNTAIN, GL_COMPILE);
+  glPushAttrib(GL_LIGHTING_BIT);
+    glCallList(MOUNTAIN_MAT);
+    FractalMountain(v1, v2, v3, pegged);
+  glPopAttrib();
+  glEndList();
+}
+
+  /*
+   * new random numbers to make a different moutain
+   */
+void NewMountain(void)
+{
+  InitRandTable(time(NULL));
+}
+
+/***************************************************************/
+/***************************** TREE ****************************/
+/***************************************************************/
+
+long TreeSeed;   /* for srand48 - remember so we can build "same tree"
+                     at a different level */
+
+ /*
+  * recursive tree drawing thing, fleshed out from class notes pseudocode 
+  */
+void FractalTree(int level)
+{
+  long savedseed;  /* need to save seeds while building tree too */
+
+  if (level == Level) {
+      glPushMatrix();
+        glRotatef(drand48()*180, 0, 1, 0);
+        glCallList(STEMANDLEAVES);
+      glPopMatrix();
+  } else {
+    glCallList(STEM);
+    glPushMatrix();
+    glRotatef(drand48()*180, 0, 1, 0);
+    glTranslatef(0, 1, 0);
+    glScalef(0.7, 0.7, 0.7);
+
+      savedseed = (long)((ulong)drand48()*ULONG_MAX);
+      glPushMatrix();    
+        glRotatef(110 + drand48()*40, 0, 1, 0);
+        glRotatef(30 + drand48()*20, 0, 0, 1);
+        FractalTree(level + 1);
+      glPopMatrix();
+
+      srand48(savedseed);
+      savedseed = (long)((ulong)drand48()*ULONG_MAX);
+      glPushMatrix();
+        glRotatef(-130 + drand48()*40, 0, 1, 0);
+        glRotatef(30 + drand48()*20, 0, 0, 1);
+        FractalTree(level + 1);
+      glPopMatrix();
+
+      srand48(savedseed);
+      glPushMatrix();
+        glRotatef(-20 + drand48()*40, 0, 1, 0);
+        glRotatef(30 + drand48()*20, 0, 0, 1);
+        FractalTree(level + 1);
+      glPopMatrix();
+
+    glPopMatrix();
+  }
+}
+
+  /*
+   * Create display lists for a leaf, a set of leaves, and a stem
+   */
+void CreateTreeLists(void)
+{
+  GLUquadricObj *cylquad = gluNewQuadric();
+  int i;
+
+  glNewList(STEM, GL_COMPILE);
+  glPushMatrix();
+    glRotatef(-90, 1, 0, 0);
+    gluCylinder(cylquad, 0.1, 0.08, 1, 10, 2 );
+  glPopMatrix();
+  glEndList();
+
+  glNewList(LEAF, GL_COMPILE);  /* I think this was jeff allen's leaf idea */
+    glBegin(GL_TRIANGLES);
+      glNormal3f(-0.1, 0, 0.25);  /* not normalized */
+      glVertex3f(0, 0, 0);
+      glVertex3f(0.25, 0.25, 0.1);
+      glVertex3f(0, 0.5, 0);
+
+      glNormal3f(0.1, 0, 0.25);
+      glVertex3f(0, 0, 0);
+      glVertex3f(0, 0.5, 0);
+      glVertex3f(-0.25, 0.25, 0.1);
+    glEnd();
+  glEndList();
+
+  glNewList(STEMANDLEAVES, GL_COMPILE);
+  glPushMatrix();
+  glPushAttrib(GL_LIGHTING_BIT);
+    glCallList(STEM);
+    glCallList(LEAF_MAT);
+    for(i = 0; i < 3; i++) {
+      glTranslatef(0, 0.333, 0);
+      glRotatef(90, 0, 1, 0);
+      glPushMatrix();
+        glRotatef(0, 0, 1, 0);
+        glRotatef(50, 1, 0, 0);
+        glCallList(LEAF);
+      glPopMatrix();
+      glPushMatrix();
+        glRotatef(180, 0, 1, 0);
+        glRotatef(60, 1, 0, 0);
+        glCallList(LEAF);
+      glPopMatrix();
+    }
+  glPopAttrib();
+  glPopMatrix();
+  glEndList();
+
+  gluDeleteQuadric(cylquad);
+}
+
+ /*
+  * draw and build display list for tree
+  */
+void CreateTree(void)
+{
+  srand48(TreeSeed);
+
+  glNewList(TREE, GL_COMPILE);
+    glPushMatrix();
+    glPushAttrib(GL_LIGHTING_BIT);
+    glCallList(TREE_MAT);
+    glTranslatef(0, -1, 0);
+    FractalTree(0);
+    glPopAttrib();
+    glPopMatrix();
+  glEndList();  
+}
+
+ /*
+  * new seed for a new tree (groan)
+  */
+void NewTree(void)
+{
+  TreeSeed = time(NULL);
+}
+
+/***************************************************************/
+/*********************** FRACTAL PLANET ************************/
+/***************************************************************/
+
+void CreateIsland(void)
+{
+  cutoff = .06;
+  CreateMountain();
+  cutoff = -1;
+  glNewList(ISLAND, GL_COMPILE);
+  glPushAttrib(GL_LIGHTING_BIT);
+  glMatrixMode(GL_MODELVIEW);
+  glPushMatrix();
+    glCallList(WATER_MAT);
+
+    glBegin(GL_QUADS);
+      glNormal3f(0, 1, 0);
+      glVertex3f(10, 0.01, 10);
+      glVertex3f(10, 0.01, -10);
+      glVertex3f(-10, 0.01, -10);
+      glVertex3f(-10, 0.01, 10);
+    glEnd();
+
+    glPushMatrix();
+    glTranslatef(0, -0.1, 0);
+    glCallList(MOUNTAIN);
+    glPopMatrix();
+
+    glPushMatrix();
+    glRotatef(135, 0, 1, 0);
+    glTranslatef(0.2, -0.15, -0.4);
+    glCallList(MOUNTAIN);
+    glPopMatrix();
+
+    glPushMatrix();
+    glRotatef(-60, 0, 1, 0);
+    glTranslatef(0.7, -0.07, 0.5);
+    glCallList(MOUNTAIN);
+    glPopMatrix();
+
+    glPushMatrix();
+    glRotatef(-175, 0, 1, 0);
+    glTranslatef(-0.7, -0.05, -0.5);
+    glCallList(MOUNTAIN);
+    glPopMatrix();
+
+    glPushMatrix();
+    glRotatef(165, 0, 1, 0);
+    glTranslatef(-0.9, -0.12, 0.0);
+    glCallList(MOUNTAIN);
+    glPopMatrix();
+
+  glPopMatrix();
+  glPopAttrib();
+  glEndList();  
+}
+
+
+void NewFractals(void)
+{
+  NewMountain();
+  NewTree();
+}
+
+void Create(int fract)
+{
+  switch(fract) {
+    case MOUNTAIN:
+      CreateMountain();
+      break;
+    case TREE:
+      CreateTree();
+      break;
+    case ISLAND:
+      CreateIsland();
+      break;
+  }
+}
+
+
+
+/***************************************************************/
+/**************************** OPENGL ***************************/
+/***************************************************************/
+
+
+void SetupMaterials(void)
+{
+  GLfloat mtn_ambuse[] =   { 0.426, 0.256, 0.108, 1.0 };
+  GLfloat mtn_specular[] = { 0.394, 0.272, 0.167, 1.0 };
+  GLfloat mtn_shininess[] = { 10 };
+
+  GLfloat water_ambuse[] =   { 0.0, 0.1, 0.5, 1.0 };
+  GLfloat water_specular[] = { 0.0, 0.1, 0.5, 1.0 };
+  GLfloat water_shininess[] = { 10 };
+
+  GLfloat tree_ambuse[] =   { 0.4, 0.25, 0.1, 1.0 };
+  GLfloat tree_specular[] = { 0.0, 0.0, 0.0, 1.0 };
+  GLfloat tree_shininess[] = { 0 };
+
+  GLfloat leaf_ambuse[] =   { 0.0, 0.8, 0.0, 1.0 };
+  GLfloat leaf_specular[] = { 0.0, 0.8, 0.0, 1.0 };
+  GLfloat leaf_shininess[] = { 10 };
+
+  glNewList(MOUNTAIN_MAT, GL_COMPILE);
+    glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, mtn_ambuse);
+    glMaterialfv(GL_FRONT, GL_SPECULAR, mtn_specular);
+    glMaterialfv(GL_FRONT, GL_SHININESS, mtn_shininess);
+  glEndList();
+
+  glNewList(WATER_MAT, GL_COMPILE);
+    glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, water_ambuse);
+    glMaterialfv(GL_FRONT, GL_SPECULAR, water_specular);
+    glMaterialfv(GL_FRONT, GL_SHININESS, water_shininess);
+  glEndList();
+
+  glNewList(TREE_MAT, GL_COMPILE);
+    glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, tree_ambuse);
+    glMaterialfv(GL_FRONT, GL_SPECULAR, tree_specular);
+    glMaterialfv(GL_FRONT, GL_SHININESS, tree_shininess);
+  glEndList();
+
+  glNewList(LEAF_MAT, GL_COMPILE);
+    glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, leaf_ambuse);
+    glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, leaf_specular);
+    glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, leaf_shininess);
+  glEndList();
+}
+
+void myGLInit(void)
+{
+  GLfloat light_ambient[] = { 0.0, 0.0, 0.0, 1.0 };
+  GLfloat light_diffuse[] = { 1.0, 1.0, 1.0, 1.0 };
+  GLfloat light_specular[] = { 1.0, 1.0, 1.0, 1.0 };
+  GLfloat light_position[] = { 0.0, 0.3, 0.3, 0.0 };
+
+  GLfloat lmodel_ambient[] = { 0.4, 0.4, 0.4, 1.0 };
+
+  glLightfv(GL_LIGHT0, GL_AMBIENT, light_ambient);
+  glLightfv(GL_LIGHT0, GL_DIFFUSE, light_diffuse);
+  glLightfv(GL_LIGHT0, GL_SPECULAR, light_specular);
+  glLightfv(GL_LIGHT0, GL_POSITION, light_position);
+    
+  glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient);
+
+  glEnable(GL_LIGHTING);
+  glEnable(GL_LIGHT0);
+
+  glDepthFunc(GL_LEQUAL);
+  glEnable(GL_DEPTH_TEST);
+
+  glEnable(GL_NORMALIZE);
+#if 0
+  glEnable(GL_CULL_FACE);
+  glCullFace(GL_BACK);
+#endif
+
+  glShadeModel(GL_SMOOTH);
+#if 0
+  glEnable(GL_BLEND);
+  glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+#endif
+
+  SetupMaterials();
+  CreateTreeLists();
+
+  glFlush();
+} 
+
+/***************************************************************/
+/************************ GLUT STUFF ***************************/
+/***************************************************************/
+
+void reshape(int w, int h)
+{
+  glViewport(0,0,w,h);
+  glMatrixMode(GL_PROJECTION);
+  glLoadIdentity();
+  gluPerspective(60.0, (GLdouble)w/h, 0.01, 100);
+  glPushMatrix();
+  glMatrixMode(GL_MODELVIEW);
+  glFlush();
+}
+
+void display(void)
+{ 
+  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+  glMatrixMode(GL_PROJECTION);
+  glPopMatrix();
+  glPushMatrix();  /* clear of last viewing xform, leaving perspective */
+
+  agvViewTransform();
+
+  glMatrixMode(GL_MODELVIEW);
+  glLoadIdentity();
+
+  if (Rebuild) {
+    Create(Fract);
+    Rebuild = 0;
+  }
+
+  glCallList(Fract);
+
+  if (DrawAxes)
+    glCallList(AXES);
+
+  //
+  // Use glFinish() instead of glFlush() to avoid getting many frames
+  // ahead of the display (problem with some Linux OpenGL implementations...)
+  //
+
+  glFinish();
+}
+
+void visible(int v)
+{
+  if (v == GLUT_VISIBLE)
+    agvSetAllowIdle(1);
+  else {
+    glutIdleFunc(NULL);
+    agvSetAllowIdle(0);
+  }
+}
+
+void menuuse(int v)
+{
+  if (v == GLUT_MENU_NOT_IN_USE)
+    agvSetAllowIdle(1);
+  else {
+    glutIdleFunc(NULL);
+    agvSetAllowIdle(0);
+  }
+}
+
+/***************************************************************/
+/******************* MENU SETUP & HANDLING *********************/
+/***************************************************************/
+
+typedef enum { MENU_QUIT=30, MENU_RAND, MENU_MOVE, MENU_AXES } MenuChoices;
+
+void setlevel(int value)
+{
+  Level = value;
+  Rebuild = 1;
+  glutPostRedisplay();
+}
+
+void choosefract(int value)
+{
+  Fract = value;
+  Rebuild = 1;
+  glutPostRedisplay();
+}
+
+void handlemenu(int value)
+{
+  switch (value) {
+  case MOUNTAIN:
+  case TREE:
+  case ISLAND:
+    choosefract(value);
+    break;
+  case 0:  case 1:  case 2:  case 3:  case 4:  case 5:  case 6:  case 7: case 8:
+    setlevel(value);
+    break;
+  case FLYING: case POLAR: 
+    agvSwitchMoveMode(value);
+    break;
+  case MENU_QUIT:
+      exit(0);
+      break;
+    case MENU_RAND:
+      NewFractals();
+      Rebuild = 1;
+      glutPostRedisplay();
+      break;
+    case MENU_AXES:
+      DrawAxes = !DrawAxes;
+      glutPostRedisplay();
+      break;
+    }
+}
+
+void MenuInit(void)
+{
+  int submenu3, submenu2, submenu1;
+
+  submenu1 = glutCreateMenu(setlevel);
+  glutAddMenuEntry("0", 0);  glutAddMenuEntry("1", 1);
+  glutAddMenuEntry("2", 2);  glutAddMenuEntry("3", 3);
+  glutAddMenuEntry("4", 4);  glutAddMenuEntry("5", 5);
+  glutAddMenuEntry("6", 6);  glutAddMenuEntry("7", 7);
+  glutAddMenuEntry("8", 8);
+
+  submenu2 = glutCreateMenu(choosefract);
+  glutAddMenuEntry("Moutain", MOUNTAIN);
+  glutAddMenuEntry("Tree", TREE);
+  glutAddMenuEntry("Island", ISLAND);
+
+  submenu3 = glutCreateMenu(agvSwitchMoveMode);
+  glutAddMenuEntry("Flying", FLYING);
+  glutAddMenuEntry("Polar", POLAR);
+
+  glutCreateMenu(handlemenu);
+  glutAddSubMenu("Level", submenu1);
+  glutAddSubMenu("Fractal", submenu2);
+  glutAddSubMenu("Movement", submenu3);
+  glutAddMenuEntry("New Fractal",      MENU_RAND);
+  glutAddMenuEntry("Toggle Axes", MENU_AXES);
+  glutAddMenuEntry("Quit",             MENU_QUIT);
+  glutAttachMenu(GLUT_RIGHT_BUTTON);
+}
+
+
+/***************************************************************/
+/**************************** MAIN *****************************/
+/***************************************************************/
+
+// FLTK-style callbacks to Glut menu callback translators:
+void setlevel(Fl_Widget*, void *value) {setlevel(long(value));}
+
+void choosefract(Fl_Widget*, void *value) {choosefract(long(value));}
+
+void handlemenu(Fl_Widget*, void *value) {handlemenu(long(value));}
+
+#include <FL/Fl_Button.H>
+#include <FL/Fl_Group.H>
+#include <FL/Fl_Window.H>
+
+int main(int argc, char** argv)
+{
+//  glutInit(&argc, argv); // this line removed for FLTK
+
+  // create FLTK window:
+  Fl_Window window(512+20, 512+100);
+  window.resizable(window);
+
+  // create a bunch of buttons:
+  Fl_Group *g = new Fl_Group(110,50,400-110,30,"Level:");
+  g->align(FL_ALIGN_LEFT);
+  g->begin();
+  Fl_Button *b;
+  // These coordinates were chagned from fltk1 to fltk2:
+  b = new Fl_Button(  0,0,30,30,"0"); b->callback(setlevel,(void*)0);
+  b = new Fl_Button( 30,0,30,30,"1"); b->callback(setlevel,(void*)1);
+  b = new Fl_Button( 60,0,30,30,"2"); b->callback(setlevel,(void*)2);
+  b = new Fl_Button( 90,0,30,30,"3"); b->callback(setlevel,(void*)3);
+  b = new Fl_Button(120,0,30,30,"4"); b->callback(setlevel,(void*)4);
+  b = new Fl_Button(150,0,30,30,"5"); b->callback(setlevel,(void*)5);
+  b = new Fl_Button(180,0,30,30,"6"); b->callback(setlevel,(void*)6);
+  b = new Fl_Button(210,0,30,30,"7"); b->callback(setlevel,(void*)7);
+  b = new Fl_Button(240,0,30,30,"8"); b->callback(setlevel,(void*)8);
+  g->end();
+
+  b = new Fl_Button(400,50,100,30,"New Fractal"); b->callback(handlemenu,(void*)MENU_RAND);
+  
+  b = new Fl_Button( 10,10,100,30,"Mountain"); b->callback(choosefract,(void*)MOUNTAIN);
+  b = new Fl_Button(110,10,100,30,"Tree"); b->callback(choosefract,(void*)TREE);
+  b = new Fl_Button(210,10,100,30,"Island"); b->callback(choosefract,(void*)ISLAND);
+  b = new Fl_Button(400,10,100,30,"Quit"); b->callback(handlemenu,(void*)MENU_QUIT);
+
+
+  window.show(argc,argv); // glut will die unless parent window visible
+  window.begin(); // this will cause Glut window to be a child
+  glutInitWindowSize(512, 512);
+  glutInitWindowPosition(10,90); // place it inside parent window
+  glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH | GLUT_MULTISAMPLE);
+  glutCreateWindow("Fractal Planet?");
+  window.end();
+  window.resizable(glut_window);
+
+  agvInit(1); /* 1 cause we don't have our own idle */
+
+  glutReshapeFunc(reshape);
+  glutDisplayFunc(display);
+  glutVisibilityFunc(visible);
+  glutMenuStateFunc(menuuse);
+
+  NewFractals();
+  agvMakeAxesList(AXES);
+  myGLInit(); 
+  MenuInit();
+
+  glutMainLoop(); // you could use Fl::run() instead
+
+  return 0;
+}
+#endif
+
+//
+// End of "$Id: fractals.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $".
+//

Added: branches/branch-3.0/test2/fracviewer.cxx
===================================================================
--- branches/branch-3.0/test2/fracviewer.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/fracviewer.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,510 @@
+/*
+ * fractviewer.cxx [from agviewer.c  (version 1.0)]
+ *
+ * AGV: a glut viewer. Routines for viewing a 3d scene w/ glut
+ *
+ * See agv_example.c and agviewer.h comments within for more info.
+ *
+ * I welcome any feedback or improved versions!
+ *
+ * Philip Winston - 4/11/95
+ * pwinston@hmc.edu
+ * http://www.cs.hmc.edu/people/pwinston
+ */
+
+#include <config.h>
+
+#if HAVE_GL && HAVE_GL_GLU_H
+#  include <FL/glut.H>
+#  ifdef __APPLE__
+#    include <OpenGL/glu.h>
+#  else
+#    include <GL/glu.h> // added for FLTK
+#  endif
+
+#  include <stdio.h>
+#  include <stdlib.h>
+#  include <math.h>
+#  include <sys/types.h>
+#  include <time.h>
+#  if !defined(WIN32) && !defined(__EMX__)
+#    include <sys/time.h>
+#  endif // !WIN32 && !__EMX__
+
+#  include "fracviewer.h"
+
+/* Some <math.h> files do not define M_PI... */
+#ifndef M_PI
+#define M_PI 3.14159265
+#endif
+
+/***************************************************************/
+/************************** SETTINGS ***************************/
+/***************************************************************/
+
+   /* Initial polar movement settings */
+#define INIT_POLAR_AZ  0.0
+#define INIT_POLAR_EL 30.0
+#define INIT_DIST      4.0
+#define INIT_AZ_SPIN   0.5
+#define INIT_EL_SPIN   0.0
+
+  /* Initial flying movement settings */
+#define INIT_EX        0.0
+#define INIT_EY       -2.0
+#define INIT_EZ       -2.0
+#define INIT_MOVE     0.01
+#define MINMOVE      0.001    
+
+  /* Start in this mode */
+#define INIT_MODE   POLAR   
+
+  /* Controls:  */
+
+  /* map 0-9 to an EyeMove value when number key is hit in FLYING mode */
+#define SPEEDFUNCTION(x) ((x)*(x)*0.001)  
+
+  /* Multiply EyeMove by (1+-MOVEFRACTION) when +/- hit in FLYING mode */
+#define MOVEFRACTION 0.25   
+
+  /* What to multiply number of pixels mouse moved by to get rotation amount */
+#define EL_SENS   0.5
+#define AZ_SENS   0.5
+
+  /* What to multiply number of pixels mouse moved by for movement amounts */
+#define DIST_SENS 0.01
+#define E_SENS    0.01
+
+  /* Minimum spin to allow in polar (lower forced to zero) */
+#define MIN_AZSPIN 0.1
+#define MIN_ELSPIN 0.1
+
+  /* Factors used in computing dAz and dEl (which determine AzSpin, ElSpin) */
+#define SLOW_DAZ 0.90
+#define SLOW_DEL 0.90
+#define PREV_DAZ 0.80
+#define PREV_DEL 0.80
+#define CUR_DAZ  0.20
+#define CUR_DEL  0.20
+
+/***************************************************************/
+/************************** GLOBALS ****************************/
+/***************************************************************/
+
+int     MoveMode = INIT_MODE;  /* FLYING or POLAR mode? */
+
+GLfloat Ex = INIT_EX,             /* flying parameters */
+        Ey = INIT_EY,
+        Ez = INIT_EZ,
+        EyeMove = INIT_MOVE,     
+
+        EyeDist = INIT_DIST,      /* polar params */
+        AzSpin  = INIT_AZ_SPIN,
+        ElSpin  = INIT_EL_SPIN,
+
+        EyeAz = INIT_POLAR_AZ,    /* used by both */
+        EyeEl = INIT_POLAR_EL;
+
+int agvMoving;    /* Currently moving?  */
+
+int downx, downy,   /* for tracking mouse position */
+    lastx, lasty,
+    downb = -1;     /* and button status */
+						
+GLfloat downDist, downEl, downAz, /* for saving state of things */
+        downEx, downEy, downEz,   /* when button is pressed */
+        downEyeMove;                
+
+GLfloat dAz, dEl, lastAz, lastEl;  /* to calculate spinning w/ polar motion */
+int     AdjustingAzEl = 0;
+
+int AllowIdle, RedisplayWindow; 
+   /* If AllowIdle is 1 it means AGV will install its own idle which
+    * will update the viewpoint as needed and send glutPostRedisplay() to the
+    * window RedisplayWindow which was set in agvInit().  AllowIdle of 0
+    * means AGV won't install an idle funciton, and something like
+    * "if (agvMoving) agvMove()" should exist at the end of the running
+    * idle function.
+    */
+
+#define MAX(x,y) (((x) > (y)) ? (x) : (y))
+#define TORAD(x) ((M_PI/180.0)*(x))
+#define TODEG(x) ((180.0/M_PI)*(x))
+
+/***************************************************************/
+/************************ PROTOTYPES ***************************/
+/***************************************************************/
+
+  /*
+   * these are functions meant for internal use only
+   * the other prototypes are in agviewer.h
+   */
+
+void PolarLookFrom(GLfloat dist, GLfloat elevation, GLfloat azimuth);
+void FlyLookFrom(GLfloat x, GLfloat y, GLfloat z,
+                        GLfloat az, GLfloat el);
+int  ConstrainEl(void);
+void MoveOn(int v);
+void SetMove(float newmove);
+static void normalize(GLfloat v[3]);
+void ncrossprod(float v1[3], float v2[3], float cp[3]);
+
+
+/***************************************************************/
+/************************ agvInit ******************************/
+/***************************************************************/
+
+void agvInit(int window)
+{
+  glutMouseFunc(agvHandleButton);
+  glutMotionFunc(agvHandleMotion);
+  glutKeyboardFunc(agvHandleKeys);
+  RedisplayWindow = glutGetWindow();
+  agvSetAllowIdle(window);
+}
+
+/***************************************************************/
+/************************ VIEWPOINT STUFF **********************/
+/***************************************************************/
+
+  /*
+   * viewing transformation modified from page 90 of red book
+   */
+void PolarLookFrom(GLfloat dist, GLfloat elevation, GLfloat azimuth)
+{
+  glTranslatef(0, 0, -dist);
+  glRotatef(elevation, 1, 0, 0);
+  glRotatef(azimuth, 0, 1, 0);
+
+}
+
+  /*
+   * I took the idea of tracking eye position in absolute
+   * coords and direction looking in Polar form from denis
+   */
+void FlyLookFrom(GLfloat x, GLfloat y, GLfloat z, GLfloat az, GLfloat el)
+{
+  float lookat[3], perp[3], up[3];
+
+  lookat[0] = sin(TORAD(az))*cos(TORAD(el));
+  lookat[1] = sin(TORAD(el));
+  lookat[2] = -cos(TORAD(az))*cos(TORAD(el));
+  normalize(lookat);
+  perp[0] = lookat[2];
+  perp[1] = 0;
+  perp[2] = -lookat[0];
+  normalize(perp);
+  ncrossprod(lookat, perp, up);
+  gluLookAt(x, y, z,
+            x+lookat[0], y+lookat[1], z+lookat[2],
+            up[0], up[1], up[2]);
+}
+
+  /*
+   * Call viewing transformation based on movement mode
+   */
+void agvViewTransform(void)
+{ 
+  switch (MoveMode) {
+    case FLYING:
+      FlyLookFrom(Ex, Ey, Ez, EyeAz, EyeEl);
+      break;
+    case POLAR:
+      PolarLookFrom(EyeDist, EyeEl, EyeAz);
+      break;
+    }
+}
+
+  /*
+   * keep them vertical; I think this makes a lot of things easier, 
+   * but maybe it wouldn't be too hard to adapt things to let you go
+   * upside down
+   */
+int ConstrainEl(void)
+{
+  if (EyeEl <= -90) {
+    EyeEl = -89.99;
+    return 1;
+  } else if (EyeEl >= 90) {
+    EyeEl = 89.99;
+    return 1;
+  }
+  return 0;
+}
+
+ /*
+  * Idle Function - moves eyeposition
+  */
+void agvMove(void)
+{
+  switch (MoveMode)  {
+    case FLYING:
+      Ex += EyeMove*sin(TORAD(EyeAz))*cos(TORAD(EyeEl));
+      Ey += EyeMove*sin(TORAD(EyeEl));
+      Ez -= EyeMove*cos(TORAD(EyeAz))*cos(TORAD(EyeEl));
+      break;
+
+    case POLAR:
+      EyeEl += ElSpin;
+      EyeAz += AzSpin;
+      if (ConstrainEl()) {  /* weird spin thing to make things look     */
+        ElSpin = -ElSpin;      /* look better when you are kept from going */
+                               /* upside down while spinning - Isn't great */
+        if (fabs(ElSpin) > fabs(AzSpin))
+          AzSpin = fabs(ElSpin) * ((AzSpin > 0) ? 1 : -1);
+      }
+      break;
+    }
+
+  if (AdjustingAzEl) {
+    dAz *= SLOW_DAZ;
+    dEl *= SLOW_DEL;
+  }
+
+  if (AllowIdle) {
+    glutSetWindow(RedisplayWindow);
+    glutPostRedisplay();
+  }
+}
+
+
+  /*
+   * Don't install agvMove as idle unless we will be updating the view
+   * and we've been given a RedisplayWindow
+   */
+void MoveOn(int v)
+{
+  if (v && ((MoveMode == FLYING && EyeMove != 0) ||
+             (MoveMode == POLAR &&
+             (AzSpin != 0 || ElSpin != 0 || AdjustingAzEl)))) {
+    agvMoving = 1;
+    if (AllowIdle)
+      glutIdleFunc(agvMove);
+  } else {
+    agvMoving = 0;
+    if (AllowIdle)
+      glutIdleFunc(NULL);
+  }
+}
+
+  /*
+   * set new redisplay window.  If <= 0 it means we are not to install
+   * an idle function and will rely on whoever does install one to 
+   * put statement like "if (agvMoving) agvMove();" at end of it
+   */
+void agvSetAllowIdle(int allowidle)
+{
+  if ((AllowIdle = allowidle))
+    MoveOn(1);
+}
+
+
+  /*
+   * when moving to flying we stay in the same spot, moving to polar we
+   * reset since we have to be looking at the origin (though a pivot from
+   * current position to look at origin might be cooler)
+   */
+void agvSwitchMoveMode(int move)
+{
+  switch (move) {
+    case FLYING:
+      if (MoveMode == FLYING) return;
+      Ex    = -EyeDist*sin(TORAD(EyeAz))*cos(TORAD(EyeEl));
+      Ey    =  EyeDist*sin(TORAD(EyeEl));
+      Ez    =  EyeDist*(cos(TORAD(EyeAz))*cos(TORAD(EyeEl)));
+      EyeAz =  EyeAz;
+      EyeEl = -EyeEl;
+      EyeMove = INIT_MOVE;
+      break;
+    case POLAR:
+      EyeDist = INIT_DIST;
+      EyeAz   = INIT_POLAR_AZ;
+      EyeEl   = INIT_POLAR_EL;
+      AzSpin  = INIT_AZ_SPIN;
+      ElSpin  = INIT_EL_SPIN;
+      break;
+    }
+  MoveMode = move;
+  MoveOn(1);
+  glutPostRedisplay();
+}
+
+/***************************************************************/
+/*******************    MOUSE HANDLING   ***********************/
+/***************************************************************/
+
+void agvHandleButton(int button, int state, int x, int y)
+{
+ if (state == GLUT_DOWN && downb == -1) {  
+    lastx = downx = x;
+    lasty = downy = y;
+    downb = button;    
+
+    switch (button) {
+      case GLUT_LEFT_BUTTON:
+        lastEl = downEl = EyeEl;
+        lastAz = downAz = EyeAz;
+        AzSpin = ElSpin = dAz = dEl = 0;
+        AdjustingAzEl = 1;
+	MoveOn(1);
+        break;
+
+      case GLUT_MIDDLE_BUTTON:
+        downDist = EyeDist;
+	downEx = Ex;
+	downEy = Ey;
+	downEz = Ez;
+	downEyeMove = EyeMove;
+	EyeMove = 0;
+    }
+
+  } else if (state == GLUT_UP && button == downb) {
+
+    downb = -1;
+
+    switch (button) {
+      case GLUT_LEFT_BUTTON:
+        if (MoveMode != FLYING) {
+	  AzSpin =  -dAz;
+	  if (AzSpin < MIN_AZSPIN && AzSpin > -MIN_AZSPIN)
+	    AzSpin = 0;	
+	  ElSpin = -dEl;
+	  if (ElSpin < MIN_ELSPIN && ElSpin > -MIN_ELSPIN)
+	    ElSpin = 0; 
+	}
+        AdjustingAzEl = 0;
+        MoveOn(1);
+	break;
+
+      case GLUT_MIDDLE_BUTTON:
+	EyeMove = downEyeMove;
+      }
+  }
+}
+
+ /*
+  * change EyeEl and EyeAz and position when mouse is moved w/ button down
+  */
+void agvHandleMotion(int x, int y)
+{
+  int deltax = x - downx, deltay = y - downy;
+
+  switch (downb) {
+    case GLUT_LEFT_BUTTON:
+      EyeEl  = downEl + EL_SENS * deltay;
+      ConstrainEl();
+      EyeAz  = downAz + AZ_SENS * deltax;
+      dAz    = PREV_DAZ*dAz + CUR_DAZ*(lastAz - EyeAz);
+      dEl    = PREV_DEL*dEl + CUR_DEL*(lastEl - EyeEl);
+      lastAz = EyeAz;
+      lastEl = EyeEl;
+      break;
+    case GLUT_MIDDLE_BUTTON:
+        EyeDist = downDist + DIST_SENS*deltay;
+        Ex = downEx - E_SENS*deltay*sin(TORAD(EyeAz))*cos(TORAD(EyeEl));
+        Ey = downEy - E_SENS*deltay*sin(TORAD(EyeEl));
+        Ez = downEz + E_SENS*deltay*cos(TORAD(EyeAz))*cos(TORAD(EyeEl));
+      break;
+  }
+  glutPostRedisplay();
+}
+
+/***************************************************************/
+/********************* KEYBOARD HANDLING ***********************/
+/***************************************************************/
+
+  /*
+   * set EyeMove (current speed) for FLYING mode
+   */
+void SetMove(float newmove)
+{
+  if (newmove > MINMOVE) {
+    EyeMove = newmove;
+    MoveOn(1);
+  } else {
+    EyeMove = 0;
+    MoveOn(0);
+  }
+}
+
+  /*
+   * 0->9 set speed, +/- adjust current speed  -- in FLYING mode
+   */
+void agvHandleKeys(unsigned char key, int, int) {
+  if (MoveMode != FLYING)
+    return;
+
+  if (key >= '0' && key <= '9')
+    SetMove(SPEEDFUNCTION((key-'0')));
+  else
+    switch(key) {
+      case '+':  
+        if (EyeMove == 0)
+          SetMove(MINMOVE);
+         else
+	  SetMove(EyeMove *= (1 + MOVEFRACTION));
+        break;
+      case '-':
+	SetMove(EyeMove *= (1 - MOVEFRACTION));
+        break;
+    }
+}
+
+/***************************************************************/
+/*********************** VECTOR STUFF **************************/
+/***************************************************************/
+
+  /* normalizes v */
+static void normalize(GLfloat v[3])
+{
+  GLfloat d = sqrt(v[0]*v[0] + v[1]*v[1] + v[2]*v[2]);
+
+  if (d == 0)
+    fprintf(stderr, "Zero length vector in normalize\n");
+  else
+    v[0] /= d; v[1] /= d; v[2] /= d;
+}
+
+  /* calculates a normalized crossproduct to v1, v2 */
+void ncrossprod(float v1[3], float v2[3], float cp[3])
+{
+  cp[0] = v1[1]*v2[2] - v1[2]*v2[1];
+  cp[1] = v1[2]*v2[0] - v1[0]*v2[2];
+  cp[2] = v1[0]*v2[1] - v1[1]*v2[0];
+  normalize(cp);
+}
+
+/***************************************************************/
+/**************************** AXES *****************************/
+/***************************************************************/
+
+
+  /* draw axes -- was helpful to debug/design things */
+void agvMakeAxesList(int displaylistnum)
+{
+  int i,j;
+  GLfloat axes_ambuse[] =   { 0.5, 0.0, 0.0, 1.0 };
+  glNewList(displaylistnum, GL_COMPILE);
+  glPushAttrib(GL_LIGHTING_BIT);
+  glMatrixMode(GL_MODELVIEW);
+    glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, axes_ambuse);
+    glBegin(GL_LINES);
+      glVertex3f(15, 0, 0); glVertex3f(-15, 0, 0);
+      glVertex3f(0, 15, 0); glVertex3f(0, -15, 0);
+      glVertex3f(0, 0, 15); glVertex3f(0, 0, -15);
+    glEnd();
+    for (i = 0; i < 3; i++) {
+      glPushMatrix();
+        glTranslatef(-10*(i==0), -10*(i==1), -10*(i==2));
+        for (j = 0; j < 21; j++) {
+//          glutSolidCube(0.1);
+          glTranslatef(i==0, i==1, i==2);
+	}
+      glPopMatrix();
+    }
+  glPopAttrib();
+  glEndList();  
+}
+
+
+#endif // HAVE_GL && HAVE_GL_GLU_H

Added: branches/branch-3.0/test2/fracviewer.h
===================================================================
--- branches/branch-3.0/test2/fracviewer.h	                        (rev 0)
+++ branches/branch-3.0/test2/fracviewer.h	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,105 @@
+/*
+ * fracviewer.h [from agviewer.h  (version 1.0)]
+ *
+ * AGV: a glut viewer. Routines for viewing a 3d scene w/ glut
+ *
+ * The two view movement modes are POLAR and FLYING.  Both move the eye, NOT
+ * THE OBJECT.  You can never be upside down or twisted (roll) in either mode.
+ *
+ * A nice addition would be an examiner type trackball mode where you are
+ * moving the object and so could see it from any angle.  Also less restricted
+ * flying and polar modes (fly upside down, do rolls, etc.).
+ *
+ * Controls for Polar are just left and middle buttons -- for flying it's
+ * those plus 0-9 number keys and +/- for speed adjustment.
+ *
+ * See agv_example.c and agviewer.c for more info.  Probably want to make
+ * a copy of these and then edit for each program.  This isn't meant to be
+ * a library, just something to graft onto your own programs.
+ *
+ * I welcome any feedback or improved versions.
+ *
+ * Philip Winston - 4/11/95
+ * pwinston@hmc.edu
+ * http://www.cs.hmc.edu/people/pwinston
+ */
+
+
+ /*
+  * Call agvInit() with glut's current window set to the window in 
+  * which you want to run the viewer. Right after creating it is fine.  It
+  * will remember that window for possible later use (see below) and
+  * registers mouse, motion, and keyboard handlers for that window (see below).
+  *
+  * allowidle is 1 or 0 depnding on whether you will let AGV install
+  * and uninstall an idle function.  0 means you will not let it (because
+  * you will be having your own idle function). In this case it is your
+  * responsibility to put a statement like:
+  *
+  *     if (agvMoving)
+  *       agvMove();
+  *
+  * at the end of your idle function, to let AGV update the viewpoint if it
+  * is moving. 
+  *
+  * If allowidle is 1 it means AGV will install its own idle which
+  * will update the viewpoint as needed and send glutPostRedisplay() to the
+  * window which was current when agvInit() was called.
+  *
+  * agvSetIdleAllow changes this value so you can let AGV install its idle
+  * when your idle isn't installed. 
+  *
+  */
+void agvInit(int allowidle);
+void agvSetAllowIdle(int allowidle);
+
+
+ /*
+  * Set which movement mode you are in.
+  */
+typedef enum { FLYING=1000, POLAR } MovementType;
+void agvSwitchMoveMode(int move);
+
+ /*
+  * agvViewTransform basically does the appropriate gluLookAt() for the 
+  * current position.  So call it in your display on the projection matrix
+  */
+void agvViewTransform(void);
+
+ /*
+  * agvMoving will be set by AGV according to whether it needs you to call
+  * agvMove() at the end of your idle function.  You only need these if 
+  * you aren't allowing AGV to do its own idle.
+  * (Don't change the value of agvMoving)
+  */
+extern int agvMoving;
+void agvMove(void);
+
+ /*
+  * These are the routines AGV registers to deal with mouse and keyboard input.
+  * Keyboard input only matters in flying mode, and then only to set speed.
+  * Mouse input only uses left two buttons in both modes.
+  * These are all registered with agvInit(), but you could register
+  * something else which called these, or reregister these as needed 
+  */
+void agvHandleButton(int button, int state, int x, int y);
+void agvHandleMotion(int x, int y);
+void agvHandleKeys(unsigned char key, int x, int y);
+
+ /*
+  * Just an extra routine which makes an x-y-z axes (about 10x10x10)
+  * which is nice for aligning things and debugging.  Pass it an available
+  * displaylist number.
+  */
+void agvMakeAxesList(int displaylist);
+
+
+
+void ncrossprod(float v1[3], float v2[3], float cp[3]);
+
+
+
+
+
+
+

Added: branches/branch-3.0/test2/fromdos.c
===================================================================
--- branches/branch-3.0/test2/fromdos.c	                        (rev 0)
+++ branches/branch-3.0/test2/fromdos.c	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,65 @@
+/* fromdos.c : strip the stupid ^M characters without mistakes! */
+
+/* this can do in-place conversion or be used as a pipe... */
+
+#include <stdio.h>
+#include <errno.h>
+#include <unistd.h>
+#include <string.h>
+
+int main(int argc, char** argv) {
+  int f,c;
+  if (argc <= 1) {
+    if (isatty(0)) {
+      fprintf(stderr,"usage : %s <files>\nStrips ^M characters.\nCan do in-place conversion of many files or can be used in a pipe\n",argv[0]);
+      return 1;
+    }
+    for (;;) {
+      c = getchar();
+      while (c == '\r') {
+	c = getchar();
+	if (c != '\n') putchar(c);
+      }
+      if (c < 0) break;
+      putchar(c);
+    }
+    return 0;
+  }
+  for (f = 1; f < argc; f++) {
+    char* fname = argv[f];
+    char tempname[1024];
+    FILE* in = fopen(fname,"rb");
+    FILE* out;
+    int mod = 0;
+    if (!in) {
+      fprintf(stderr,"%s : %s\n", fname, strerror(errno));
+      return 1;
+    }
+    strcpy(tempname, fname);
+    strcat(tempname, ".temp");
+    out = fopen(tempname, "wb");
+    if (!out) {
+      fprintf(stderr,"%s : %s\n", fname, strerror(errno));
+      return 1;
+    }
+    for (;;) {
+      c = getc(in);
+      while (c == '\r') {
+	c = getc(in);
+	if (c == '\n') mod=1; else putc(c,out);
+      }
+      if (c < 0) break;
+      putc(c,out);
+    }
+    fclose(in);
+    fclose(out);
+    if (!mod) {
+      fprintf(stderr,"%s : no change\n", fname);
+      unlink(tempname);
+    } else if (rename(tempname, fname)) {
+      fprintf(stderr,"Can't mv %s %s : %s\n",tempname,fname,strerror(errno));
+      return 1;
+    }
+  }
+  return 0;
+}

Added: branches/branch-3.0/test2/fullscreen.cxx
===================================================================
--- branches/branch-3.0/test2/fullscreen.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/fullscreen.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,296 @@
+//
+// "$Id: fullscreen.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $"
+//
+// Fullscreen test program for the Fast Light Tool Kit (FLTK).
+//
+// This demo shows how to do many of the window manipulations that
+// are popular on SGI programs, even though X does not really like
+// them.  You can toggle the border on/off, change the visual to
+// switch between single/double buffer, and make the window take
+// over the screen.
+//
+// Normally the program makes a single window with a child GL window.
+// This simulates a program where the 3D display is surrounded by
+// control knobs.  Running the program with an argument will
+// make it make a seperate GL window from the controls window.  This
+// simulates a (older?) style program where the graphics display is
+// a different window than the controls.
+//
+// This program reports how many times it redraws the window to
+// stdout, so you can see how much time it is wasting.  It appears
+// to be impossible to prevent X from sending redundant resize
+// events, so there are extra redraws.  But the way I have the
+// code arranged here seems to be keeping that to a minimu.
+//
+// Apparently unavoidable bugs:
+//
+// Turning the border on causes an unnecessary redraw.
+//
+// Turning off full screen when the border is on causes an unnecessary
+// resize and redraw when the program turns the border on.
+//
+// If it is a seperate window, turning double buffering on and off
+// will cause the window to raise, deiconize, and possibly move.  You
+// can avoid this by making the Fl_Gl_Window a child of a normal
+// window.
+//
+// Copyright 1998-2006 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+//    http://www.fltk.org/str.php
+//
+
+#include <config.h>
+
+#include <fltk/run.h>
+#include <fltk/error.h>
+#include <fltk/Window.h>
+#include <fltk/Slider.h>
+#include <fltk/LightButton.h>
+#include <fltk/math.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#if HAVE_GL
+
+#include <fltk/gl.h>
+#include <fltk/visual.h>
+#include <fltk/GlWindow.h>
+
+class shape_window : public fltk::GlWindow {
+  void draw();
+public:
+  int sides;
+  shape_window(int x,int y,int w,int h,const char *l=0);
+};
+
+shape_window::shape_window(int x,int y,int w,int h,const char *l) :
+fltk::GlWindow(x,y,w,h,l) {
+  sides = 3;
+}
+
+void shape_window::draw() {
+  printf("drawing size %d %d\n",w(),h());
+  if (!valid()) {
+    valid(1);
+//  printf("init\n");
+    glLoadIdentity();
+    glViewport(0,0,w(),h());
+  }
+  glClear(GL_COLOR_BUFFER_BIT);
+  glColor3f(.5,.6,.7);
+  glBegin(GL_POLYGON);
+  for (int i=0; i<sides; i++) {
+    double ang = i*2*M_PI/sides;
+    glVertex3f(cos(ang),sin(ang),0);
+  }
+  glEnd();
+
+  fltk::glsetcolor(fltk::WHITE);
+  fltk::glsetfont(fltk::HELVETICA, 12); 
+  fltk::gldrawtext("Using OpenGL", -.9, -.9);
+}
+
+#else
+
+#include <fltk/draw.h>
+
+class shape_window : public fltk::Window {
+  void draw();
+public:
+  int sides;
+  shape_window(int x,int y,int w,int h,const char *l=0);
+};
+
+shape_window::shape_window(int x,int y,int w,int h,const char *l)
+: fltk::Window(x,y,w,h,l) {
+  sides = 3;
+}
+
+void shape_window::draw() {
+  printf("drawing size %d %d\n",w(),h());
+  fltk::setcolor(fltk::BLACK);
+  fltk::fillrect(0,0,w(),h());
+
+  fltk::setcolor(fltk::BLUE);
+  fltk::push_matrix();
+  fltk::translate(w()/2, h()/2);
+  fltk::scale(w()/2, h()/2);    
+  for (int i=0; i<sides; i++) {
+    double ang = i*2*M_PI/sides;
+    fltk::addvertex((float)cos(ang), (float)sin(ang));
+  }
+  fltk::closepath();
+  fltk::pop_matrix();
+  fltk::fillstrokepath(fltk::WHITE);
+
+  fltk::setcolor(fltk::WHITE);
+  fltk::setfont(fltk::HELVETICA, 12); 
+  fltk::drawtext("Not using OpenGL",1,fltk::getascent());
+}
+
+#endif
+
+void sides_cb(fltk::Widget *o, void *p) {
+  shape_window *sw = (shape_window *)p;
+  sw->sides = int(((fltk::Slider *)o)->value());
+  sw->redraw();
+}
+
+fltk::Window *control_win = 0;
+
+void double_cb(fltk::Widget *o, void *p) {
+  shape_window *sw = (shape_window *)p;
+  int d = ((fltk::Button *)o)->value();
+#if HAVE_GL
+  sw->mode(d ? (fltk::DOUBLE_BUFFER|fltk::RGB_COLOR) : fltk::RGB_COLOR);
+  // We must show "control_win" if running in 2 window mode.
+  // GlWindow::mode will destroy GL window and also control window, 
+  // cause it's "child_of()" GL window. 
+  if (control_win) control_win->show(); 
+#else
+  if(d) sw->set_double_buffer();
+  else  sw->clear_double_buffer();
+#endif
+}
+
+// This is useless in current FLTK2...
+void border_cb(fltk::Widget *o, void *p) {
+  //fltk::Window *w = (fltk::Window *)p;
+  //int d = ((fltk::Button *)o)->value();
+  //w->setborder(d);
+}
+
+int px,py,pw,ph;
+fltk::Button *border_button;
+fltk::Window *fullscreen = 0;
+
+void fullscreen_cb(fltk::Widget *o, void *p) {
+  fltk::Window *w = (fltk::Window *)p;
+  int d = ((fltk::Button *)o)->value();
+  if (d) {
+    // Store current geometry of the window
+    px = w->x(); py = w->y();
+    pw = w->w(); ph = w->h();
+    w->fullscreen();
+    fullscreen = w;
+  } else {
+    // restore geometry to the window and turn fullscreen off
+    w->fullscreen_off(px,py,pw,ph);
+    fullscreen = 0;
+  }
+}
+
+void maximize_cb(fltk::Widget *o, void *p) {
+  fltk::Window *w = (fltk::Window *)p;
+  w->maximize();
+}
+
+void exit_cb(fltk::Widget *, void *) {
+  // Turn fullscreen off when exit
+  if(fullscreen)
+    fullscreen->fullscreen_off(px,py,pw,ph);
+  exit(0);
+}
+
+#define NUMB 5
+
+int twowindow = 0;
+int initfull = 0;
+int arg(int, char **argv, int &i) {
+  if (argv[i][1] == '2') {twowindow = 1; i++; return 1;}
+  if (argv[i][1] == 'f') {initfull = 1; i++; return 1;}
+  return 0;
+}
+
+int main(int argc, char **argv) {
+
+  int i=0;
+  if (fltk::args(argc,argv,i,arg) < argc)
+    fltk::fatal("Options are:\n -2 = 2 windows\n -f = startup fullscreen\n%s", fltk::help);
+
+  fltk::Window window(300, (twowindow?10:300)+30*NUMB); window.end();
+  window.callback(exit_cb);
+  
+  if(twowindow)
+    control_win = &window;
+
+  shape_window sw(10, 10, window.w()-20, (twowindow?400:window.h())-30*NUMB-20);
+#if HAVE_GL
+  sw.mode(fltk::RGB_COLOR);
+#endif
+
+  fltk::Window *w;
+  if (twowindow) {	// make it's own window
+    sw.resizable(&sw);
+    w = (fltk::Window*)(&sw); // cast added for fltk2.0
+    window.child_of(w); // makes controls stay on top when fullscreen pushed
+    argc--;
+    sw.show();
+  } else {		// otherwise make a subwindow
+    window.add(sw);
+    window.resizable(&sw);
+    w = &window;
+  }
+
+  window.begin();
+
+  int y = window.h()-30*NUMB-5;
+  fltk::Slider slider(50,y,window.w()-60,30,"Sides:");
+  slider.align(fltk::ALIGN_LEFT);
+  slider.callback(sides_cb,&sw);
+  slider.value(sw.sides);
+  slider.step(1);
+  slider.range(3,40);
+  y+=30;
+
+  fltk::LightButton b1(50,y,window.w()-60,30,"Double Buffered");
+  b1.callback(double_cb,&sw);
+  y+=30;
+
+  /*fltk::LightButton b2(50,y,window.w()-60,30,"Border");
+  b2.callback(border_cb,w);
+  b2.set();
+  border_button = &b2;
+  y+=30;*/
+
+  fltk::LightButton b3(50,y,window.w()-60,30,"FullScreen");
+  b3.callback(fullscreen_cb,w);
+  y+=30;
+
+  fltk::Button btnMaximize(50,y,window.w()-60,30,"Maximize me!");
+  btnMaximize.callback(maximize_cb,&window);
+  y+=30;
+
+  fltk::Button eb(50,y,window.w()-60,30,"Exit");
+  eb.callback(exit_cb);
+  y+=30;
+
+  if (initfull) {b3.set(); b3.do_callback();}
+
+  window.end();
+  window.show(argc,argv);
+
+  return fltk::run();
+}
+
+//
+// End of "$Id: fullscreen.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $".
+//

Added: branches/branch-3.0/test2/gl_overlay.cxx
===================================================================
--- branches/branch-3.0/test2/gl_overlay.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/gl_overlay.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,196 @@
+//
+// "$Id: gl_overlay.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $"
+//
+// OpenGL overlay test program for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2006 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+//    http://www.fltk.org/str.php
+//
+
+#include <config.h>
+#include <fltk/run.h>
+#include <fltk/Window.h>
+#include <fltk/Slider.h>
+#include <fltk/ToggleButton.h>
+#include <fltk/math.h>
+
+#if !HAVE_GL
+
+class shape_window : public fltk::Widget {
+public:	
+  int sides;
+  shape_window(int x,int y,int w,int h,const char *l=0)
+    :fltk::Widget(x,y,w,h,l){
+      label("This demo does\nnot work without GL");
+  }
+};
+#else
+#include <fltk/gl.h>
+#include <fltk/GlWindow.h>
+
+class shape_window : public fltk::GlWindow {
+  void draw();
+  void draw_overlay();
+public:
+  int sides;
+  int overlay_sides;
+  shape_window(int x,int y,int w,int h,const char *l=0);
+};
+
+shape_window::shape_window(int x,int y,int w,int h,const char *l)
+  : fltk::GlWindow(x,y,w,h,l)
+{
+  sides = overlay_sides = 3;
+}
+
+#include <stdio.h>
+
+void shape_window::draw() {
+// the valid() property may be used to avoid reinitializing your
+// GL transformation for each redraw:
+  if (!valid()) {
+    static int r;
+    printf("Invalid %d\n", ++r);
+    valid(1);
+    glLoadIdentity();
+    glViewport(0,0,w(),h());
+  }
+  glClear(GL_COLOR_BUFFER_BIT);
+  glBegin(GL_POLYGON);
+  for (int i=0; i<sides; i++) {
+    double ang = i*2*M_PI/sides;
+    glColor3f(float(i)/sides,float(i)/sides,float(i)/sides);
+    glVertex3f(cos(ang),sin(ang),0);
+  }
+  glEnd();
+  fltk::glsetcolor(fltk::WHITE);
+  fltk::glsetfont(labelfont(), labelsize());
+  static int count = 0;
+  count++;
+  char buffer[40];
+  sprintf(buffer, "normal draw %d", count);
+  fltk::gldrawtext(buffer, .1, .5);
+}
+
+void shape_window::draw_overlay() {
+// the valid() property may be used to avoid reinitializing your
+// GL transformation for each redraw:
+  if (!valid()) {
+    valid(1);
+    glLoadIdentity();
+    glViewport(0,0,w(),h());
+  }
+// draw an amazing graphic:
+  fltk::glsetcolor(fltk::RED);
+  glBegin(GL_LINE_LOOP);
+  for (int i=0; i<overlay_sides; i++) {
+    double ang = i*2*M_PI/overlay_sides;
+    glVertex3f(cos(ang),sin(ang),0);
+  }
+  glEnd();
+  fltk::glsetfont(labelfont(), labelsize());
+  static int count = 0;
+  count++;
+  char buffer[40];
+  sprintf(buffer, "overlay draw %d", count);
+  fltk::gldrawtext(buffer, .1, .6);
+}
+#endif
+
+// when you change the data, as in this callback, you must call redraw():
+void sides_cb(fltk::Widget *o, void *p) {
+  shape_window *sw = (shape_window *)p;
+  sw->sides = int(((fltk::Slider *)o)->value());
+  sw->redraw();
+}
+
+#if HAVE_GL
+void overlay_sides_cb(fltk::Widget *o, void *p) {
+  shape_window *sw = (shape_window *)p;
+  sw->overlay_sides = int(((fltk::Slider *)o)->value());
+  sw->redraw_overlay();
+}
+#endif
+
+int main(int argc, char **argv) {
+
+  fltk::Window window(300, 370);
+  window.begin();
+
+  shape_window sw(10, 75, window.w()-20, window.h()-90);
+//sw.mode(FLTK::RGB);
+  window.resizable(&sw);
+
+  fltk::Slider oslider(60, 5, window.w()-70, 30, "Overlay:");
+  oslider.clear_flag(fltk::ALIGN_MASK);
+  oslider.set_flag(fltk::ALIGN_LEFT);
+#if HAVE_GL
+  oslider.callback(overlay_sides_cb,&sw);
+  oslider.value(sw.overlay_sides);
+#endif
+  oslider.step(1);
+  oslider.range(3,40);
+  oslider.tooltip("Move this slider to make overlay redraw");
+
+  fltk::Slider slider(60, 40, window.w()-70, 30, "Normal:");
+  slider.clear_flag(fltk::ALIGN_MASK);
+  slider.set_flag(fltk::ALIGN_LEFT);
+  slider.callback(sides_cb,&sw);
+  slider.value(sw.sides);
+  slider.step(1);
+  slider.range(3,40);
+  oslider.tooltip("Move this slider to make background image redraw");
+
+  window.end();
+  window.show(argc,argv);
+
+#if HAVE_GL
+  sw.tooltip(sw.can_do_overlay() ?
+
+"The red image is drawn by implementing fltk::GlWindow::draw_overlay().\n"
+"\n"
+"Hardware overlays may be unable to draw some "
+"colors or may exhibit bugs. If you see the red outline but no red text "
+"this is a known bug on Windows."
+:
+"The red image is drawn by implementing fltk::GlWindow::draw_overlay().\n"
+"\n"
+"You do not have OpenGL overlay hardware, so fltk "
+"simulates it. To work on all OpenGl hardware the simulation is very "
+"simple by default. You can reduce redraws of the background by changing the "
+"environment variable $GL_SWAP_TYPE:\n"
+"\n"
+"setenv GL_SWAP_TYPE USE_COPY (almost always works)\n"
+"setenv GL_SWAP_TYPE COPY (works on some cards)\n"
+"setenv GL_SWAP_TYPE NODAMAGE (works only with software OpenGl)"
+	     );
+  sw.show();
+  sw.redraw_overlay();
+#else
+  sw.show();
+#endif
+
+  return fltk::run();
+}
+
+//
+// End of "$Id: gl_overlay.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $".
+//

Added: branches/branch-3.0/test2/glpuzzle.cxx
===================================================================
--- branches/branch-3.0/test2/glpuzzle.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/glpuzzle.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,1496 @@
+//
+// "$Id: glpuzzle.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $"
+//
+// OpenGL puzzle demo for the Fast Light Tool Kit (FLTK).
+//
+// This is a GLUT demo program to demonstrate fltk's GLUT emulation.
+// Search for "fltk" to find all the changes
+//
+// Copyright 1998-2006 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+//    http://www.fltk.org/str.php
+//
+
+// this block added for fltk's distribtion so it will compile w/o OpenGL:
+#include <config.h>
+
+
+#if !HAVE_GL || !HAVE_GL_GLU_H
+#include <fltk/run.h>
+#include <fltk/ask.h>
+
+
+int main(int, char**) {
+    fltk::alert("This demo does not work without GL and GLU");
+  return 1;
+}
+#else
+// end of added block
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <time.h>
+#include <math.h>
+#include <fltk/glut.h>	// changed for fltk
+#ifdef __APPLE__
+# include <OpenGL/glu.h>
+#else
+# include <GL/glu.h> // added for fltk
+#endif
+#include "trackball.c"	// changed from trackball.h for fltk
+
+#define WIDTH 4
+#define HEIGHT 5
+#define PIECES 10
+#define OFFSETX -2
+#define OFFSETY -2.5
+#define OFFSETZ -0.5
+
+typedef char Config[HEIGHT][WIDTH];
+
+struct puzzle {
+  struct puzzle *backptr;
+  struct puzzle *solnptr;
+  Config pieces;
+  struct puzzle *next;
+  unsigned hashvalue;
+};
+
+#define HASHSIZE 10691
+
+  struct puzzlelist {
+  struct puzzle *puzzle;
+  struct puzzlelist *next;
+};
+
+static char convert[PIECES + 1] =
+{0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 4};
+
+static unsigned char colors[PIECES + 1][3] =
+{
+  {0, 0, 0},
+  {255, 255, 127},
+  {255, 255, 127},
+  {255, 255, 127},
+  {255, 255, 127},
+  {255, 127, 255},
+  {255, 127, 255},
+  {255, 127, 255},
+  {255, 127, 255},
+  {255, 127, 127},
+  {255, 255, 255},
+};
+
+void changeState(void);
+
+static struct puzzle *hashtable[HASHSIZE];
+static struct puzzle *startPuzzle;
+static struct puzzlelist *puzzles;
+static struct puzzlelist *lastentry;
+
+int curX, curY, visible;
+
+#define MOVE_SPEED 0.2
+static unsigned char movingPiece;
+static float move_x, move_y;
+static float curquat[4];
+static int doubleBuffer = 1;
+static int depth = 1;
+
+static char xsize[PIECES + 1] =
+{0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2};
+static char ysize[PIECES + 1] =
+{0, 1, 1, 1, 1, 2, 2, 2, 2, 1, 2};
+static float zsize[PIECES + 1] =
+{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.6};
+
+static Config startConfig =
+{
+  {8, 10, 10, 7},
+  {8, 10, 10, 7},
+  {6, 9, 9, 5},
+  {6, 4, 3, 5},
+  {2, 0, 0, 1}
+};
+
+static Config thePuzzle =
+{
+  {8, 10, 10, 7},
+  {8, 10, 10, 7},
+  {6, 9, 9, 5},
+  {6, 4, 3, 5},
+  {2, 0, 0, 1}
+};
+
+static int xadds[4] =
+{-1, 0, 1, 0};
+static int yadds[4] =
+{0, -1, 0, 1};
+
+static long W = 400, H = 300;
+static GLint viewport[4];
+
+#define srandom srand
+#define random() (rand() >> 2)
+
+
+unsigned hash(Config config) {
+  int i, j, value;
+  int p;
+
+  value = 0;
+  for (i = 0; i < HEIGHT; i++) {
+    for (j = 0; j < WIDTH; j++) {
+      p = config[i][j];
+      value = value + convert[p];
+      value *= 6;
+    }
+  }
+  return (value);
+}
+
+int
+solution(Config config)
+{
+  if (config[4][1] == 10 && config[4][2] == 10)
+    return (1);
+  return (0);
+}
+
+float boxcoords[][3] =
+{
+  {0.2, 0.2, 0.9},
+  {0.8, 0.2, 0.9},
+  {0.8, 0.8, 0.9},
+  {0.2, 0.8, 0.9},
+  {0.2, 0.1, 0.8},
+  {0.8, 0.1, 0.8},
+  {0.9, 0.2, 0.8},
+  {0.9, 0.8, 0.8},
+  {0.8, 0.9, 0.8},
+  {0.2, 0.9, 0.8},
+  {0.1, 0.8, 0.8},
+  {0.1, 0.2, 0.8},
+  {0.2, 0.1, 0.2},
+  {0.8, 0.1, 0.2},
+  {0.9, 0.2, 0.2},
+  {0.9, 0.8, 0.2},
+  {0.8, 0.9, 0.2},
+  {0.2, 0.9, 0.2},
+  {0.1, 0.8, 0.2},
+  {0.1, 0.2, 0.2},
+  {0.2, 0.2, 0.1},
+  {0.8, 0.2, 0.1},
+  {0.8, 0.8, 0.1},
+  {0.2, 0.8, 0.1},
+};
+
+float boxnormals[][3] =
+{
+  {0, 0, 1},            /* 0 */
+  {0, 1, 0},
+  {1, 0, 0},
+  {0, 0, -1},
+  {0, -1, 0},
+  {-1, 0, 0},
+  {0.7071, 0.7071, 0.0000},  /* 6 */
+  {0.7071, -0.7071, 0.0000},
+  {-0.7071, 0.7071, 0.0000},
+  {-0.7071, -0.7071, 0.0000},
+  {0.7071, 0.0000, 0.7071},  /* 10 */
+  {0.7071, 0.0000, -0.7071},
+  {-0.7071, 0.0000, 0.7071},
+  {-0.7071, 0.0000, -0.7071},
+  {0.0000, 0.7071, 0.7071},  /* 14 */
+  {0.0000, 0.7071, -0.7071},
+  {0.0000, -0.7071, 0.7071},
+  {0.0000, -0.7071, -0.7071},
+  {0.5774, 0.5774, 0.5774},  /* 18 */
+  {0.5774, 0.5774, -0.5774},
+  {0.5774, -0.5774, 0.5774},
+  {0.5774, -0.5774, -0.5774},
+  {-0.5774, 0.5774, 0.5774},
+  {-0.5774, 0.5774, -0.5774},
+  {-0.5774, -0.5774, 0.5774},
+  {-0.5774, -0.5774, -0.5774},
+};
+
+int boxfaces[][4] =
+{
+  {0, 1, 2, 3},         /* 0 */
+  {9, 8, 16, 17},
+  {6, 14, 15, 7},
+  {20, 23, 22, 21},
+  {12, 13, 5, 4},
+  {19, 11, 10, 18},
+  {7, 15, 16, 8},       /* 6 */
+  {13, 14, 6, 5},
+  {18, 10, 9, 17},
+  {19, 12, 4, 11},
+  {1, 6, 7, 2},         /* 10 */
+  {14, 21, 22, 15},
+  {11, 0, 3, 10},
+  {20, 19, 18, 23},
+  {3, 2, 8, 9},         /* 14 */
+  {17, 16, 22, 23},
+  {4, 5, 1, 0},
+  {20, 21, 13, 12},
+  {2, 7, 8, -1},        /* 18 */
+  {16, 15, 22, -1},
+  {5, 6, 1, -1},
+  {13, 21, 14, -1},
+  {10, 3, 9, -1},
+  {18, 17, 23, -1},
+  {11, 4, 0, -1},
+  {20, 12, 19, -1},
+};
+
+#define NBOXFACES (sizeof(boxfaces)/sizeof(boxfaces[0]))
+
+/* Draw a box.  Bevel as desired. */
+void
+drawBox(int piece, float xoff, float yoff)
+{
+  int xlen, ylen;
+  int i, k;
+  float x, y, z;
+  float zlen;
+  float *v;
+
+  xlen = xsize[piece];
+  ylen = ysize[piece];
+  zlen = zsize[piece];
+
+  glColor3ubv(colors[piece]);
+  glBegin(GL_QUADS);
+  for (i = 0; i < 18; i++) {
+    glNormal3fv(boxnormals[i]);
+    for (k = 0; k < 4; k++) {
+      if (boxfaces[i][k] == -1)
+        continue;
+      v = boxcoords[boxfaces[i][k]];
+      x = v[0] + OFFSETX;
+      if (v[0] > 0.5)
+        x += xlen - 1;
+      y = v[1] + OFFSETY;
+      if (v[1] > 0.5)
+        y += ylen - 1;
+      z = v[2] + OFFSETZ;
+      if (v[2] > 0.5)
+        z += zlen - 1;
+      glVertex3f(xoff + x, yoff + y, z);
+    }
+  }
+  glEnd();
+  glBegin(GL_TRIANGLES);
+  for (i = 18; i < int(NBOXFACES); i++) {
+    glNormal3fv(boxnormals[i]);
+    for (k = 0; k < 3; k++) {
+      if (boxfaces[i][k] == -1)
+        continue;
+      v = boxcoords[boxfaces[i][k]];
+      x = v[0] + OFFSETX;
+      if (v[0] > 0.5)
+        x += xlen - 1;
+      y = v[1] + OFFSETY;
+      if (v[1] > 0.5)
+        y += ylen - 1;
+      z = v[2] + OFFSETZ;
+      if (v[2] > 0.5)
+        z += zlen - 1;
+      glVertex3f(xoff + x, yoff + y, z);
+    }
+  }
+  glEnd();
+}
+
+float containercoords[][3] =
+{
+  {-0.1, -0.1, 1.0},
+  {-0.1, -0.1, -0.1},
+  {4.1, -0.1, -0.1},
+  {4.1, -0.1, 1.0},
+  {1.0, -0.1, 0.6},     /* 4 */
+  {3.0, -0.1, 0.6},
+  {1.0, -0.1, 0.0},
+  {3.0, -0.1, 0.0},
+  {1.0, 0.0, 0.0},      /* 8 */
+  {3.0, 0.0, 0.0},
+  {3.0, 0.0, 0.6},
+  {1.0, 0.0, 0.6},
+  {0.0, 0.0, 1.0},      /* 12 */
+  {4.0, 0.0, 1.0},
+  {4.0, 0.0, 0.0},
+  {0.0, 0.0, 0.0},
+  {0.0, 5.0, 0.0},      /* 16 */
+  {0.0, 5.0, 1.0},
+  {4.0, 5.0, 1.0},
+  {4.0, 5.0, 0.0},
+  {-0.1, 5.1, -0.1},    /* 20 */
+  {4.1, 5.1, -0.1},
+  {4.1, 5.1, 1.0},
+  {-0.1, 5.1, 1.0},
+};
+
+float containernormals[][3] =
+{
+  {0, -1, 0},
+  {0, -1, 0},
+  {0, -1, 0},
+  {0, -1, 0},
+  {0, -1, 0},
+  {0, 1, 0},
+  {0, 1, 0},
+  {0, 1, 0},
+  {1, 0, 0},
+  {1, 0, 0},
+  {1, 0, 0},
+  {-1, 0, 0},
+  {-1, 0, 0},
+  {-1, 0, 0},
+  {0, 1, 0},
+  {0, 0, -1},
+  {0, 0, -1},
+  {0, 0, 1},
+  {0, 0, 1},
+  {0, 0, 1},
+  {0, 0, 1},
+  {0, 0, 1},
+  {0, 0, 1},
+  {0, 0, 1},
+};
+
+int containerfaces[][4] =
+{
+  {1, 6, 4, 0},
+  {0, 4, 5, 3},
+  {1, 2, 7, 6},
+  {7, 2, 3, 5},
+  {16, 19, 18, 17},
+
+  {23, 22, 21, 20},
+  {12, 11, 8, 15},
+  {10, 13, 14, 9},
+
+  {15, 16, 17, 12},
+  {2, 21, 22, 3},
+  {6, 8, 11, 4},
+
+  {1, 0, 23, 20},
+  {14, 13, 18, 19},
+  {9, 7, 5, 10},
+
+  {12, 13, 10, 11},
+
+  {1, 20, 21, 2},
+  {4, 11, 10, 5},
+
+  {15, 8, 19, 16},
+  {19, 8, 9, 14},
+  {8, 6, 7, 9},
+  {0, 3, 13, 12},
+  {13, 3, 22, 18},
+  {18, 22, 23, 17},
+  {17, 23, 0, 12},
+};
+
+#define NCONTFACES (sizeof(containerfaces)/sizeof(containerfaces[0]))
+
+/* Draw the container */
+void
+drawContainer(void)
+{
+  int i, k;
+  float *v;
+
+  /* Y is reversed here because the model has it reversed */
+
+  /* Arbitrary bright wood-like color */
+  glColor3ub(209, 103, 23);
+  glBegin(GL_QUADS);
+  for (i = 0; i < int(NCONTFACES); i++) {
+    v = containernormals[i];
+    glNormal3f(v[0], -v[1], v[2]);
+    for (k = 3; k >= 0; k--) {
+      v = containercoords[containerfaces[i][k]];
+      glVertex3f(v[0] + OFFSETX, -(v[1] + OFFSETY), v[2] + OFFSETZ);
+    }
+  }
+  glEnd();
+}
+
+void
+drawAll(void)
+{
+  int i, j;
+  int piece;
+  char done[PIECES + 1];
+  float m[4][4];
+
+  build_rotmatrix(m, curquat);
+  glMatrixMode(GL_MODELVIEW);
+  glLoadIdentity();
+  glTranslatef(0, 0, -10);
+  glMultMatrixf(&(m[0][0]));
+  glRotatef(180, 0, 0, 1);
+
+  if (depth) {
+    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+  } else {
+    glClear(GL_COLOR_BUFFER_BIT);
+  }
+  for (i = 1; i <= PIECES; i++) {
+    done[i] = 0;
+  }
+  glLoadName(0);
+  drawContainer();
+  for (i = 0; i < HEIGHT; i++) {
+    for (j = 0; j < WIDTH; j++) {
+      piece = thePuzzle[i][j];
+      if (piece == 0)
+        continue;
+      if (done[piece])
+        continue;
+      done[piece] = 1;
+      glLoadName(piece);
+      if (piece == movingPiece) {
+        drawBox(piece, move_x, move_y);
+      } else {
+        drawBox(piece, j, i);
+      }
+    }
+  }
+}
+
+void
+redraw(void)
+{
+  glMatrixMode(GL_PROJECTION);
+  glLoadIdentity();
+  gluPerspective(45, viewport[2]*1.0/viewport[3], 0.1, 100.0);
+
+  drawAll();
+
+  if (doubleBuffer)
+    glutSwapBuffers();
+  else
+    glFinish();
+}
+
+void
+solidifyChain(struct puzzle *puzzle)
+{
+  int i;
+  char buf[256];
+
+  i = 0;
+  while (puzzle->backptr) {
+    i++;
+    puzzle->backptr->solnptr = puzzle;
+    puzzle = puzzle->backptr;
+  }
+  sprintf(buf, "%d moves to complete!", i);
+  glutSetWindowTitle(buf);
+}
+
+int
+addConfig(Config config, struct puzzle *back)
+{
+  unsigned hashvalue;
+  struct puzzle *newpiece;
+  struct puzzlelist *newlistentry;
+
+  hashvalue = hash(config);
+
+  newpiece = hashtable[hashvalue % HASHSIZE];
+  while (newpiece != NULL) {
+    if (newpiece->hashvalue == hashvalue) {
+      int i, j, p, np;
+
+      for (i = 0; i < WIDTH; i++) {
+        for (j = 0; j < HEIGHT; j++) {
+          p = config[j][i];
+          np = newpiece->pieces[j][i];
+          if (convert[p] != convert[np])
+            goto nomatch;
+        }
+      }
+      return 0;
+    }
+  nomatch:
+    newpiece = newpiece->next;
+  }
+
+  newpiece = (struct puzzle *) malloc(sizeof(struct puzzle));
+  newpiece->next = hashtable[hashvalue % HASHSIZE];
+  newpiece->hashvalue = hashvalue;
+  memcpy(newpiece->pieces, config, HEIGHT * WIDTH);
+  newpiece->backptr = back;
+  newpiece->solnptr = NULL;
+  hashtable[hashvalue % HASHSIZE] = newpiece;
+
+  newlistentry = (struct puzzlelist *) malloc(sizeof(struct puzzlelist));
+  newlistentry->puzzle = newpiece;
+  newlistentry->next = NULL;
+
+  if (lastentry) {
+    lastentry->next = newlistentry;
+  } else {
+    puzzles = newlistentry;
+  }
+  lastentry = newlistentry;
+
+  if (back == NULL) {
+    startPuzzle = newpiece;
+  }
+  if (solution(config)) {
+    solidifyChain(newpiece);
+    return 1;
+  }
+  return 0;
+}
+
+/* Checks if a space can move */
+int
+canmove0(Config pieces, int x, int y, int dir, Config newpieces)
+{
+  char piece;
+  int xadd, yadd;
+  int l, m;
+
+  xadd = xadds[dir];
+  yadd = yadds[dir];
+
+  if (x + xadd < 0 || x + xadd >= WIDTH ||
+    y + yadd < 0 || y + yadd >= HEIGHT)
+    return 0;
+  piece = pieces[y + yadd][x + xadd];
+  if (piece == 0)
+    return 0;
+  memcpy(newpieces, pieces, HEIGHT * WIDTH);
+  for (l = 0; l < WIDTH; l++) {
+    for (m = 0; m < HEIGHT; m++) {
+      if (newpieces[m][l] == piece)
+        newpieces[m][l] = 0;
+    }
+  }
+  xadd = -xadd;
+  yadd = -yadd;
+  for (l = 0; l < WIDTH; l++) {
+    for (m = 0; m < HEIGHT; m++) {
+      if (pieces[m][l] == piece) {
+        int newx, newy;
+
+        newx = l + xadd;
+        newy = m + yadd;
+        if (newx < 0 || newx >= WIDTH ||
+          newy < 0 || newy >= HEIGHT)
+          return 0;
+        if (newpieces[newy][newx] != 0)
+          return 0;
+        newpieces[newy][newx] = piece;
+      }
+    }
+  }
+  return 1;
+}
+
+/* Checks if a piece can move */
+int
+canmove(Config pieces, int x, int y, int dir, Config newpieces)
+{
+  int xadd, yadd;
+
+  xadd = xadds[dir];
+  yadd = yadds[dir];
+
+  if (x + xadd < 0 || x + xadd >= WIDTH ||
+    y + yadd < 0 || y + yadd >= HEIGHT)
+    return 0;
+  if (pieces[y + yadd][x + xadd] == pieces[y][x]) {
+    return canmove(pieces, x + xadd, y + yadd, dir, newpieces);
+  }
+  if (pieces[y + yadd][x + xadd] != 0)
+    return 0;
+  return canmove0(pieces, x + xadd, y + yadd, (dir + 2) % 4, newpieces);
+}
+
+int
+generateNewConfigs(struct puzzle *puzzle)
+{
+  int i, j, k;
+  Config pieces;
+  Config newpieces;
+
+  memcpy(pieces, puzzle->pieces, HEIGHT * WIDTH);
+  for (i = 0; i < WIDTH; i++) {
+    for (j = 0; j < HEIGHT; j++) {
+      if (pieces[j][i] == 0) {
+        for (k = 0; k < 4; k++) {
+          if (canmove0(pieces, i, j, k, newpieces)) {
+            if (addConfig(newpieces, puzzle))
+              return 1;
+          }
+        }
+      }
+    }
+  }
+  return 0;
+}
+
+void
+freeSolutions(void)
+{
+  struct puzzlelist *nextpuz;
+  struct puzzle *puzzle, *next;
+  int i;
+
+  while (puzzles) {
+    nextpuz = puzzles->next;
+    free((char *) puzzles);
+    puzzles = nextpuz;
+  }
+  lastentry = NULL;
+  for (i = 0; i < HASHSIZE; i++) {
+    puzzle = hashtable[i];
+    hashtable[i] = NULL;
+    while (puzzle) {
+      next = puzzle->next;
+      free((char *) puzzle);
+      puzzle = next;
+    }
+  }
+  startPuzzle = NULL;
+}
+
+int
+continueSolving(void)
+{
+  struct puzzle *nextpuz;
+  int i, j;
+  int movedPiece;
+  int movedir;
+  int fromx, fromy;
+  int tox, toy;
+
+  if (startPuzzle == NULL)
+    return 0;
+  if (startPuzzle->solnptr == NULL) {
+    freeSolutions();
+    return 0;
+  }
+  nextpuz = startPuzzle->solnptr;
+  movedPiece = 0;
+  movedir = 0;
+  for (i = 0; i < HEIGHT; i++) {
+    for (j = 0; j < WIDTH; j++) {
+      if (startPuzzle->pieces[i][j] != nextpuz->pieces[i][j]) {
+        if (startPuzzle->pieces[i][j]) {
+          movedPiece = startPuzzle->pieces[i][j];
+          fromx = j;
+          fromy = i;
+          if (i < HEIGHT - 1 && nextpuz->pieces[i + 1][j] == movedPiece) {
+            movedir = 3;
+          } else {
+            movedir = 2;
+          }
+          goto found_piece;
+        } else {
+          movedPiece = nextpuz->pieces[i][j];
+          if (i < HEIGHT - 1 &&
+            startPuzzle->pieces[i + 1][j] == movedPiece) {
+            fromx = j;
+            fromy = i + 1;
+            movedir = 1;
+          } else {
+            fromx = j + 1;
+            fromy = i;
+            movedir = 0;
+          }
+          goto found_piece;
+        }
+      }
+    }
+  }
+  glutSetWindowTitle("What!  No change?");
+  freeSolutions();
+  return 0;
+
+found_piece:
+  if (!movingPiece) {
+    movingPiece = movedPiece;
+    move_x = fromx;
+    move_y = fromy;
+  }
+  move_x += xadds[movedir] * MOVE_SPEED;
+  move_y += yadds[movedir] * MOVE_SPEED;
+
+  tox = fromx + xadds[movedir];
+  toy = fromy + yadds[movedir];
+
+  if (move_x > tox - MOVE_SPEED / 2 && move_x < tox + MOVE_SPEED / 2 &&
+    move_y > toy - MOVE_SPEED / 2 && move_y < toy + MOVE_SPEED / 2) {
+    startPuzzle = nextpuz;
+    movingPiece = 0;
+  }
+  memcpy(thePuzzle, startPuzzle->pieces, HEIGHT * WIDTH);
+  changeState();
+  return 1;
+}
+
+int
+solvePuzzle(void)
+{
+  struct puzzlelist *nextpuz;
+  char buf[256];
+  int i;
+
+  if (solution(thePuzzle)) {
+    glutSetWindowTitle("Puzzle already solved!");
+    return 0;
+  }
+  addConfig(thePuzzle, NULL);
+  i = 0;
+
+  while (puzzles) {
+    i++;
+    if (generateNewConfigs(puzzles->puzzle))
+      break;
+    nextpuz = puzzles->next;
+    free((char *) puzzles);
+    puzzles = nextpuz;
+  }
+  if (puzzles == NULL) {
+    freeSolutions();
+    sprintf(buf, "I can't solve it! (%d positions examined)", i);
+    glutSetWindowTitle(buf);
+    return 1;
+  }
+  return 1;
+}
+
+int
+selectPiece(int mousex, int mousey)
+{
+  long hits;
+  GLuint selectBuf[1024];
+  GLuint closest;
+  GLuint dist;
+
+  glSelectBuffer(1024, selectBuf);
+  (void) glRenderMode(GL_SELECT);
+  glInitNames();
+
+  /* Because LoadName() won't work with no names on the stack */
+  glPushName(0);
+
+  glMatrixMode(GL_PROJECTION);
+  glLoadIdentity();
+  gluPickMatrix(mousex, H - mousey, 4, 4, viewport);
+  gluPerspective(45, viewport[2]*1.0/viewport[3], 0.1, 100.0);
+
+  drawAll();
+
+  hits = glRenderMode(GL_RENDER);
+  if (hits <= 0) {
+    return 0;
+  }
+  closest = 0;
+  dist = 0xFFFFFFFFU; //2147483647;
+  while (hits) {
+    if (selectBuf[(hits - 1) * 4 + 1] < dist) {
+      dist = selectBuf[(hits - 1) * 4 + 1];
+      closest = selectBuf[(hits - 1) * 4 + 3];
+    }
+    hits--;
+  }
+  return closest;
+}
+
+void
+nukePiece(int piece)
+{
+  int i, j;
+
+  for (i = 0; i < HEIGHT; i++) {
+    for (j = 0; j < WIDTH; j++) {
+      if (thePuzzle[i][j] == piece) {
+        thePuzzle[i][j] = 0;
+      }
+    }
+  }
+}
+
+void
+multMatrices(const GLfloat a[16], const GLfloat b[16], GLfloat r[16])
+{
+  int i, j;
+
+  for (i = 0; i < 4; i++) {
+    for (j = 0; j < 4; j++) {
+      r[i * 4 + j] =
+        a[i * 4 + 0] * b[0 * 4 + j] +
+        a[i * 4 + 1] * b[1 * 4 + j] +
+        a[i * 4 + 2] * b[2 * 4 + j] +
+        a[i * 4 + 3] * b[3 * 4 + j];
+    }
+  }
+}
+
+void
+makeIdentity(GLfloat m[16])
+{
+  m[0 + 4 * 0] = 1;
+  m[0 + 4 * 1] = 0;
+  m[0 + 4 * 2] = 0;
+  m[0 + 4 * 3] = 0;
+  m[1 + 4 * 0] = 0;
+  m[1 + 4 * 1] = 1;
+  m[1 + 4 * 2] = 0;
+  m[1 + 4 * 3] = 0;
+  m[2 + 4 * 0] = 0;
+  m[2 + 4 * 1] = 0;
+  m[2 + 4 * 2] = 1;
+  m[2 + 4 * 3] = 0;
+  m[3 + 4 * 0] = 0;
+  m[3 + 4 * 1] = 0;
+  m[3 + 4 * 2] = 0;
+  m[3 + 4 * 3] = 1;
+}
+
+/*
+   ** inverse = invert(src)
+ */
+int
+invertMatrix(const GLfloat src[16], GLfloat inverse[16])
+{
+  int i, j, k, swap;
+  double t;
+  GLfloat temp[4][4];
+
+  for (i = 0; i < 4; i++) {
+    for (j = 0; j < 4; j++) {
+      temp[i][j] = src[i * 4 + j];
+    }
+  }
+  makeIdentity(inverse);
+
+  for (i = 0; i < 4; i++) {
+    /* 
+       ** Look for largest element in column */
+    swap = i;
+    for (j = i + 1; j < 4; j++) {
+      if (fabs(temp[j][i]) > fabs(temp[i][i])) {
+        swap = j;
+      }
+    }
+
+    if (swap != i) {
+      /* 
+         ** Swap rows. */
+      for (k = 0; k < 4; k++) {
+        t = temp[i][k];
+        temp[i][k] = temp[swap][k];
+        temp[swap][k] = t;
+
+        t = inverse[i * 4 + k];
+        inverse[i * 4 + k] = inverse[swap * 4 + k];
+        inverse[swap * 4 + k] = t;
+      }
+    }
+    if (temp[i][i] == 0) {
+      /* 
+         ** No non-zero pivot.  The matrix is singular, which
+         shouldn't ** happen.  This means the user gave us a
+         bad matrix. */
+      return 0;
+    }
+    t = temp[i][i];
+    for (k = 0; k < 4; k++) {
+      temp[i][k] /= t;
+      inverse[i * 4 + k] /= t;
+    }
+    for (j = 0; j < 4; j++) {
+      if (j != i) {
+        t = temp[j][i];
+        for (k = 0; k < 4; k++) {
+          temp[j][k] -= temp[i][k] * t;
+          inverse[j * 4 + k] -= inverse[i * 4 + k] * t;
+        }
+      }
+    }
+  }
+  return 1;
+}
+
+/*
+   ** This is a screwball function.  What it does is the following:
+   ** Given screen x and y coordinates, compute the corresponding object space 
+   **   x and y coordinates given that the object space z is 0.9 + OFFSETZ.
+   ** Since the tops of (most) pieces are at z = 0.9 + OFFSETZ, we use that 
+   **   number.
+ */
+int
+computeCoords(int piece, int mousex, int mousey,
+  GLfloat * selx, GLfloat * sely)
+{
+  GLfloat modelMatrix[16];
+  GLfloat projMatrix[16];
+  GLfloat finalMatrix[16];
+  GLfloat in[4];
+  GLfloat a, b, c, d;
+  GLfloat top, bot;
+  GLfloat z;
+  GLfloat w;
+  GLfloat height;
+
+  if (piece == 0)
+    return 0;
+  height = zsize[piece] - 0.1 + OFFSETZ;
+
+  glGetFloatv(GL_PROJECTION_MATRIX, projMatrix);
+  glGetFloatv(GL_MODELVIEW_MATRIX, modelMatrix);
+  multMatrices(modelMatrix, projMatrix, finalMatrix);
+  if (!invertMatrix(finalMatrix, finalMatrix))
+    return 0;
+
+  in[0] = (2.0 * (mousex - viewport[0]) / viewport[2]) - 1;
+  in[1] = (2.0 * ((H - mousey) - viewport[1]) / viewport[3]) - 1;
+
+  a = in[0] * finalMatrix[0 * 4 + 2] +
+    in[1] * finalMatrix[1 * 4 + 2] +
+    finalMatrix[3 * 4 + 2];
+  b = finalMatrix[2 * 4 + 2];
+  c = in[0] * finalMatrix[0 * 4 + 3] +
+    in[1] * finalMatrix[1 * 4 + 3] +
+    finalMatrix[3 * 4 + 3];
+  d = finalMatrix[2 * 4 + 3];
+
+  /* 
+     ** Ok, now we need to solve for z: **   (a + b z) / (c + d 
+
+     z) = height. ** ("height" is the height in object space we 
+
+     want to solve z for) ** ** ==>  a + b z = height c +
+     height d z **      bz - height d z = height c - a ** z =
+     (height c - a) / (b - height d) */
+  top = height * c - a;
+  bot = b - height * d;
+  if (bot == 0.0)
+    return 0;
+
+  z = top / bot;
+
+  /* 
+     ** Ok, no problem. ** Now we solve for x and y.  We know
+     that w = c + d z, so we compute it. */
+  w = c + d * z;
+
+  /* 
+     ** Now for x and y: */
+  *selx = (in[0] * finalMatrix[0 * 4 + 0] +
+    in[1] * finalMatrix[1 * 4 + 0] +
+    z * finalMatrix[2 * 4 + 0] +
+    finalMatrix[3 * 4 + 0]) / w - OFFSETX;
+  *sely = (in[0] * finalMatrix[0 * 4 + 1] +
+    in[1] * finalMatrix[1 * 4 + 1] +
+    z * finalMatrix[2 * 4 + 1] +
+    finalMatrix[3 * 4 + 1]) / w - OFFSETY;
+  return 1;
+}
+
+static int selected;
+static int selectx, selecty;
+static float selstartx, selstarty;
+
+void
+grabPiece(int piece, float selx, float sely)
+{
+  int hit;
+
+  selectx = int(selx);
+  selecty = int(sely);
+  if (selectx < 0 || selecty < 0 || selectx >= WIDTH || selecty >= HEIGHT) {
+    return;
+  }
+  hit = thePuzzle[selecty][selectx];
+  if (hit != piece)
+    return;
+  if (hit) {
+    movingPiece = hit;
+    while (selectx > 0 && thePuzzle[selecty][selectx - 1] == movingPiece) {
+      selectx--;
+    }
+    while (selecty > 0 && thePuzzle[selecty - 1][selectx] == movingPiece) {
+      selecty--;
+    }
+    move_x = selectx;
+    move_y = selecty;
+    selected = 1;
+    selstartx = selx;
+    selstarty = sely;
+  } else {
+    selected = 0;
+  }
+  changeState();
+}
+
+void
+moveSelection(float selx, float sely)
+{
+  float deltax, deltay;
+  int dir;
+  Config newpieces;
+
+  if (!selected)
+    return;
+  deltax = selx - selstartx;
+  deltay = sely - selstarty;
+
+  if (fabs(deltax) > fabs(deltay)) {
+    deltay = 0;
+    if (deltax > 0) {
+      if (deltax > 1)
+        deltax = 1;
+      dir = 2;
+    } else {
+      if (deltax < -1)
+        deltax = -1;
+      dir = 0;
+    }
+  } else {
+    deltax = 0;
+    if (deltay > 0) {
+      if (deltay > 1)
+        deltay = 1;
+      dir = 3;
+    } else {
+      if (deltay < -1)
+        deltay = -1;
+      dir = 1;
+    }
+  }
+  if (canmove(thePuzzle, selectx, selecty, dir, newpieces)) {
+    move_x = deltax + selectx;
+    move_y = deltay + selecty;
+    if (deltax > 0.5) {
+      memcpy(thePuzzle, newpieces, HEIGHT * WIDTH);
+      selectx++;
+      selstartx++;
+    } else if (deltax < -0.5) {
+      memcpy(thePuzzle, newpieces, HEIGHT * WIDTH);
+      selectx--;
+      selstartx--;
+    } else if (deltay > 0.5) {
+      memcpy(thePuzzle, newpieces, HEIGHT * WIDTH);
+      selecty++;
+      selstarty++;
+    } else if (deltay < -0.5) {
+      memcpy(thePuzzle, newpieces, HEIGHT * WIDTH);
+      selecty--;
+      selstarty--;
+    }
+  } else {
+    if (deltay > 0 && thePuzzle[selecty][selectx] == 10 &&
+      selectx == 1 && selecty == 3) {
+      /* Allow visual movement of solution piece outside of the 
+
+         box */
+      move_x = selectx;
+      move_y = sely - selstarty + selecty;
+    } else {
+      move_x = selectx;
+      move_y = selecty;
+    }
+  }
+}
+
+void
+dropSelection(void)
+{
+  if (!selected)
+    return;
+  movingPiece = 0;
+  selected = 0;
+  changeState();
+}
+
+static int left_mouse, middle_mouse;
+static int mousex, mousey;
+static int solving;
+static int spinning;
+static float lastquat[4];
+static int sel_piece;
+
+static void
+Reshape(int width, int height)
+{
+
+  W = width;
+  H = height;
+  glViewport(0, 0, W, H);
+  glGetIntegerv(GL_VIEWPORT, viewport);
+}
+
+void
+toggleSolve(void)
+{
+    if (solving) {
+      freeSolutions();
+      solving = 0;
+      glutChangeToMenuEntry(1, "Solving", 1);
+      glutSetWindowTitle("glpuzzle");
+      movingPiece = 0;
+    } else {
+      glutChangeToMenuEntry(1, "Stop solving", 1);
+      glutSetWindowTitle("Solving...");
+      if (solvePuzzle()) {
+        solving = 1;
+      }
+    }
+    changeState();
+    glutPostRedisplay();
+}
+
+void reset(void)
+{
+    if (solving) {
+      freeSolutions();
+      solving = 0;
+      glutChangeToMenuEntry(1, "Solving", 1);
+      glutSetWindowTitle("glpuzzle");
+      movingPiece = 0;
+      changeState();
+    }
+    memcpy(thePuzzle, startConfig, HEIGHT * WIDTH);
+    glutPostRedisplay();
+}
+
+void
+keyboard(unsigned char c, int x, int y)
+{
+  int piece;
+
+  switch (c) {
+  case 27:
+    exit(0);
+    break;
+  case 'D':
+  case 'd':
+    if (solving) {
+      freeSolutions();
+      solving = 0;
+      glutChangeToMenuEntry(1, "Solving", 1);
+      glutSetWindowTitle("glpuzzle");
+      movingPiece = 0;
+      changeState();
+    }
+    piece = selectPiece(x, y);
+    if (piece) {
+      nukePiece(piece);
+    }
+    glutPostRedisplay();
+    break;
+  case 'R':
+  case 'r':
+    reset();
+    break;
+  case 'S':
+  case 's':
+    toggleSolve();
+    break;
+  case 'b':
+  case 'B':
+    depth = 1 - depth;
+    if (depth) {
+      glEnable(GL_DEPTH_TEST);
+    } else {
+      glDisable(GL_DEPTH_TEST);
+    }
+    glutPostRedisplay();
+    break;
+  default:
+    break;
+  }
+}
+
+void
+motion(int x, int y)
+{
+  float selx, sely;
+
+  if (middle_mouse && !left_mouse) {
+    if (mousex != x || mousey != y) {
+      trackball(lastquat,
+        (2.0*mousex - W) / W,
+        (H - 2.0*mousey) / H,
+        (2.0*x - W) / W,
+        (H - 2.0*y) / H);
+      spinning = 1;
+    } else {
+      spinning = 0;
+    }
+    changeState();
+  } else {
+    computeCoords(sel_piece, x, y, &selx, &sely);
+    moveSelection(selx, sely);
+  }
+  mousex = x;
+  mousey = y;
+  glutPostRedisplay();
+}
+
+void
+mouse(int b, int s, int x, int y)
+{
+  float selx, sely;
+
+  mousex = x;
+  mousey = y;
+  curX = x;
+  curY = y;
+  if (s == GLUT_DOWN) {
+    switch (b) {
+    case GLUT_LEFT_BUTTON:
+      if (solving) {
+        freeSolutions();
+        solving = 0;
+      glutChangeToMenuEntry(1, "Solving", 1);
+        glutSetWindowTitle("glpuzzle");
+        movingPiece = 0;
+      }
+      left_mouse = GL_TRUE;
+      sel_piece = selectPiece(mousex, mousey);
+      if (!sel_piece) {
+      left_mouse = GL_FALSE;
+      middle_mouse = GL_TRUE; // let it rotate object
+      } else if (computeCoords(sel_piece, mousex, mousey, &selx, &sely)) {
+        grabPiece(sel_piece, selx, sely);
+      }
+      glutPostRedisplay();
+      break;
+    case GLUT_MIDDLE_BUTTON:
+      middle_mouse = GL_TRUE;
+      glutPostRedisplay();
+      break;
+    }
+  } else {
+    if (left_mouse) {
+      left_mouse = GL_FALSE;
+      dropSelection();
+      glutPostRedisplay();
+    } else if (middle_mouse) {
+      middle_mouse = GL_FALSE;
+      glutPostRedisplay();
+    }
+  }
+  motion(x, y);
+}
+
+void
+animate(void)
+{
+  if (spinning) {
+    add_quats(lastquat, curquat, curquat);
+  }
+  glutPostRedisplay();
+  if (solving) {
+    if (!continueSolving()) {
+      solving = 0;
+      glutChangeToMenuEntry(1, "Solving", 1);
+      glutSetWindowTitle("glpuzzle");
+    }
+  }
+  if (!solving && !spinning && !visible) {
+    glutIdleFunc(NULL);
+  }
+}
+
+void
+changeState(void)
+{
+  if (visible) {
+    if (!solving && !spinning) {
+      glutIdleFunc(NULL);
+    } else {
+      glutIdleFunc(animate);
+    }
+  } else {
+    glutIdleFunc(NULL);
+  }
+}
+
+void
+init(void)
+{
+  static float lmodel_ambient[] =
+  {0.0, 0.0, 0.0, 0.0};
+  static float lmodel_twoside[] =
+  {GL_FALSE};
+  static float lmodel_local[] =
+  {GL_FALSE};
+  static float light0_ambient[] =
+  {0.1, 0.1, 0.1, 1.0};
+  static float light0_diffuse[] =
+  {1.0, 1.0, 1.0, 0.0};
+  static float light0_position[] =
+  {0.8660254, 0.5, 1, 0};
+  static float light0_specular[] =
+  {0.0, 0.0, 0.0, 0.0};
+  static float bevel_mat_ambient[] =
+  {0.0, 0.0, 0.0, 1.0};
+  static float bevel_mat_shininess[] =
+  {40.0};
+  static float bevel_mat_specular[] =
+  {0.0, 0.0, 0.0, 0.0};
+  static float bevel_mat_diffuse[] =
+  {1.0, 0.0, 0.0, 0.0};
+
+  glEnable(GL_CULL_FACE);
+  glCullFace(GL_BACK);
+  glEnable(GL_DEPTH_TEST);
+  glClearDepth(1.0);
+
+  glClearColor(0.5, 0.5, 0.5, 0.0);
+  glLightfv(GL_LIGHT0, GL_AMBIENT, light0_ambient);
+  glLightfv(GL_LIGHT0, GL_DIFFUSE, light0_diffuse);
+  glLightfv(GL_LIGHT0, GL_SPECULAR, light0_specular);
+  glLightfv(GL_LIGHT0, GL_POSITION, light0_position);
+  glEnable(GL_LIGHT0);
+
+  glLightModelfv(GL_LIGHT_MODEL_LOCAL_VIEWER, lmodel_local);
+  glLightModelfv(GL_LIGHT_MODEL_TWO_SIDE, lmodel_twoside);
+  glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient);
+  glEnable(GL_LIGHTING);
+
+  glMaterialfv(GL_FRONT, GL_AMBIENT, bevel_mat_ambient);
+  glMaterialfv(GL_FRONT, GL_SHININESS, bevel_mat_shininess);
+  glMaterialfv(GL_FRONT, GL_SPECULAR, bevel_mat_specular);
+  glMaterialfv(GL_FRONT, GL_DIFFUSE, bevel_mat_diffuse);
+
+  glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE);
+  glEnable(GL_COLOR_MATERIAL);
+  glShadeModel(GL_FLAT);
+
+  trackball(curquat, 0.0, 0.0, 0.0, 0.0);
+  srandom(time(NULL));
+}
+
+static void
+Usage(void)
+{
+  printf("Usage: puzzle [-s]\n");
+  printf("   -s:  Run in single buffered mode\n");
+  exit(-1);
+}
+
+void
+visibility(int v)
+{
+  if (v == GLUT_VISIBLE) {
+    visible = 1;
+  } else {
+    visible = 0;
+  }
+  changeState();
+}
+
+void
+menu(int choice)
+{
+   switch(choice) {
+   case 1:
+      toggleSolve();
+      break;
+   case 2:
+      reset();
+      break;
+   case 3:
+      exit(0);
+      break;
+   }
+}
+
+int
+main(int argc, char **argv)
+{
+  long i;
+
+  glutInit(&argc, argv);
+  for (i = 1; i < argc; i++) {
+    if (argv[i][0] == '-') {
+      switch (argv[i][1]) {
+      case 's':
+        doubleBuffer = 0;
+        break;
+      default:
+        Usage();
+      }
+    } else {
+      Usage();
+    }
+  }
+
+  glutInitWindowSize(W, H);
+  if (doubleBuffer) {
+    glutInitDisplayMode(GLUT_DEPTH | GLUT_RGB | GLUT_DOUBLE | GLUT_MULTISAMPLE);
+  } else {
+    glutInitDisplayMode(GLUT_DEPTH | GLUT_RGB | GLUT_SINGLE | GLUT_MULTISAMPLE);
+  }
+
+  glutCreateWindow("glpuzzle");
+  visible = 1; // added for fltk, bug in original program?
+
+  init();
+
+  glGetIntegerv(GL_VIEWPORT, viewport);
+
+  printf("\n");
+  printf("r   Reset puzzle\n");
+  printf("s   Solve puzzle (may take a few seconds to compute)\n");
+  printf("d   Destroy a piece - makes the puzzle easier\n");
+  printf("b   Toggles the depth buffer on and off\n");
+  printf("\n");
+  printf("Left mouse moves pieces\n");
+  printf("Middle mouse spins the puzzle\n");
+  printf("Right mouse has menu\n");
+
+  glutReshapeFunc(Reshape);
+  glutDisplayFunc(redraw);
+  glutKeyboardFunc(keyboard);
+  glutMotionFunc(motion);
+  glutMouseFunc(mouse);
+  glutVisibilityFunc(visibility);
+  glutCreateMenu(menu);
+  glutAddMenuEntry("Solve", 1);
+  glutAddMenuEntry("Reset", 2);
+  glutAddMenuEntry("Quit", 3);
+  glutAttachMenu(GLUT_RIGHT_BUTTON);
+  glutMainLoop();
+  return 0;             /* ANSI C requires main to return int. */
+}
+
+#endif // added for fltk's distribution
+
+//
+// End of "$Id: glpuzzle.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $".
+//

Added: branches/branch-3.0/test2/hello.cxx
===================================================================
--- branches/branch-3.0/test2/hello.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/hello.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,19 @@
+// hello.cxx (example1)
+
+#include <fltk/Window.h>
+#include <fltk/Widget.h>
+#include <fltk/run.h>
+using namespace fltk;
+
+int main(int argc, char **argv) {
+  Window *window = new Window(300, 180);
+  window->begin();
+  Widget *box = new Widget(20, 40, 260, 100, "Hello, World!");
+  box->box(UP_BOX);
+  box->labelfont(HELVETICA_BOLD_ITALIC);
+  box->labelsize(36);
+  box->labeltype(SHADOW_LABEL);
+  window->end();
+  window->show(argc, argv);
+  return run();
+}

Added: branches/branch-3.0/test2/helloask.cxx
===================================================================
--- branches/branch-3.0/test2/helloask.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/helloask.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,26 @@
+// helloask.cxx (example2a)
+
+#include <fltk/Window.h>
+#include <fltk/Widget.h>
+#include <fltk/run.h>
+#include <fltk/ask.h>
+using namespace fltk;
+
+void window_callback(Widget* widget, void*) {
+  if (ask("Do you really want to exit?"))
+    ((Window*)widget)->hide();
+}
+
+int main(int argc, char **argv) {
+  Window *window = new Window(300, 180);
+  window->callback(window_callback);
+  window->begin();
+  Widget *box = new Widget(20, 40, 260, 100, "Hello, World!");
+  box->box(UP_BOX);
+  box->labelfont(HELVETICA_BOLD_ITALIC);
+  box->labelsize(36);
+  box->labeltype(SHADOW_LABEL);
+  window->end();
+  window->show(argc, argv);
+  return run();
+}

Added: branches/branch-3.0/test2/help.cxx
===================================================================
--- branches/branch-3.0/test2/help.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/help.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,69 @@
+//
+// "$Id: help.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $"
+//
+// Fl_Help_Dialog test program.
+//
+// Copyright 1999-2003 by Easy Software Products.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+//    http://www.fltk.org/str.php
+//
+// Contents:
+//
+//   main() - Display the help GUI...
+//
+
+//
+// Include necessary headers...
+//
+
+#include <fltk/run.h>
+#include <fltk/HelpDialog.h>
+
+//
+// 'main()' - Display the help GUI...
+//
+
+int				// O - Exit status
+main(int  argc,			// I - Number of command-line arguments
+     char *argv[])		// I - Command-line arguments
+{
+  fltk::HelpDialog	*help;		// Help dialog
+
+
+  help = new fltk::HelpDialog;
+
+  if (argc < 2)
+    help->load("../documentation/index.html");
+  else
+    help->load(argv[1]);
+
+  help->show();
+
+  fltk::run();
+
+  delete help;
+
+  return (0);
+}
+
+
+//
+// End of "$Id: help.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $".
+//

Added: branches/branch-3.0/test2/iconize.cxx
===================================================================
--- branches/branch-3.0/test2/iconize.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/iconize.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,162 @@
+//
+// "$Id: iconize.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $"
+//
+// Iconize test program for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2003 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+//    http://www.fltk.org/str.php
+
+#include <fltk/run.h>
+#include <fltk/Window.h>
+#include <fltk/Button.h>
+#include <stdio.h>
+#include <stdlib.h>
+using namespace fltk;
+
+void hide_cb(Widget *, void *v) {
+  Window *w = (Window *)v;
+  w->hide();
+}
+
+void iconize_cb(Widget *, void *v) {
+  Window *w = (Window *)v;
+  w->iconize();
+}
+
+void destroy_cb(Widget *, void *v) {
+  Window *w = (Window *)v;
+  w->destroy();
+}
+
+void show_cb(Widget *, void *v) {
+  Window *w = (Window *)v;
+  w->show();
+}
+
+void big_cb(Widget *, void *v) {
+  Window *w = (Window *)v;
+  w->resize(800,800);
+}
+
+void small_cb(Widget *, void *v) {
+  Window *w = (Window *)v;
+  w->resize(200,200);
+}
+
+void fson_cb(Widget *, void *v) {
+  Window *w = (Window *)v;
+  w->fullscreen();
+}
+
+void fsoff_cb(Widget *, void *v) {
+  Window *w = (Window *)v;
+  w->fullscreen_off(100,100,200,200);
+}
+
+void window_cb(Widget*, void*) {
+  exit(0);
+}
+
+int main(int argc, char **argv) {
+
+  Window mainw(200,200);
+  mainw.resizable(mainw);
+  Window child(50,50,100,100);
+  child.color(1);
+  mainw.add(child);
+  mainw.resizable(child);
+  mainw.show(argc,argv);
+
+  Window control(120,9*30,"Window actions");
+  control.begin();
+
+  int y = 0;
+  Button hide_button(0,y,120,30,"&hide()");
+  hide_button.callback(hide_cb, &mainw);
+  y += 30;
+
+  Button iconize_button(0,y,120,30,"&iconize()");
+  iconize_button.callback(iconize_cb, &mainw);
+  y += 30;
+
+  Button destroy_button(0,y,120,30,"&destroy()");
+  destroy_button.callback(destroy_cb, &mainw);
+  y += 30;
+
+  Button show_button(0,y,120,30,"&show()");
+  show_button.callback(show_cb, &mainw);
+  y += 30;
+
+  Button big_button(0,y,120,30,"resize(&big)");
+  big_button.callback(big_cb, &mainw);
+  y += 30;
+
+  Button small_button(0,y,120,30,"resize(&little)");
+  small_button.callback(small_cb, &mainw);
+  y += 30;
+
+  Button fson_button(0,y,120,30,"fullscreen()");
+  fson_button.callback(fson_cb, &mainw);
+  y += 30;
+
+  Button fsoff_button(0,y,120,30,"&fullscreen_off()");
+  fsoff_button.callback(fsoff_cb, &mainw);
+  y += 30;
+
+  Button show_button2(0,y,120,30,"show this");
+  show_button2.callback(show_cb, &control);
+  y += 30;
+
+  control.tooltip("Push these buttons to cause actions to the main window.\n\n"
+		  "Also you should try running this with -i to iconize "
+		  "the window on startup, and -g WxH+X+Y to position "
+		  "the window on startup.");
+
+  control.end();
+  control.show();
+  control.callback(window_cb);
+  while (fltk::wait()) {
+    static int oldarray[6] = {0,0,0,0,0,0};
+    int array[6];
+    array[0] = mainw.x();
+    array[1] = mainw.y();
+    array[2] = mainw.w();
+    array[3] = mainw.h();
+    array[4] = mainw.visible();
+    array[5] = mainw.iconic();
+    bool print = false;
+    for (int i = 0; i < 6; i++) {
+      if (array[i] != oldarray[i]) print = true;
+      oldarray[i] = array[i];
+    }
+    if (print) {
+      printf("window is %d %d %d %d, visible %d, iconic %d\n",
+	     array[0], array[1], array[2], array[3], array[4], array[5]);
+//       fltk::Rectangle r; mainw.borders(&r);
+//       printf("borders %d %d %d %d\n", r.x(),r.y(),r.r(),r.b());
+    }
+  }
+  return 0;
+}
+
+//
+// End of "$Id: iconize.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $".
+//

Added: branches/branch-3.0/test2/image.cxx
===================================================================
--- branches/branch-3.0/test2/image.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/image.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,425 @@
+// Lame test of all types of image drawings.
+#include <string.h>      // memcpy
+#include <fltk/run.h>
+#include <fltk/Window.h>
+#include <fltk/Slider.h>
+#include <fltk/draw.h>
+#include <fltk/rgbImage.h>
+#include <fltk/xpmImage.h>
+#include <fltk/xbmImage.h>
+#include <fltk/CheckButton.h>
+
+#include <config.h>
+#if USE_X11
+#include "list_visuals.cxx"
+#include <fltk/visual.h>
+#endif
+
+using namespace fltk;
+
+const char cdata[16*16+1] =
+"                "
+"  R RR    GGG   "
+"  RRrrR  GgggG  "
+"  Rrrrrr GgggGg "
+"  Rrrrrrr GGGGgg"
+"  Rrrrrrrr ggGgg"
+"  Rrrrrrrrr gGgg"
+"   rBrrrrrGGGggg"
+"    Bbrrrrrggggg"
+"    BBBBrrrrgggg"
+"    BbbbBrrrrggg"
+"    BbbbBbrrrrgg"
+"    BbbbBbbrrrrg"
+"    BBBBbbbbrrrr"
+"     bbbbbbbbrrr"
+"      bbbbbbbbrr";
+
+#define SCALE 4
+
+// Tester for drawimage() call:
+class Dtest : public Widget {
+public:
+  fltk::PixelType pixeltype;
+  const unsigned char* data;
+  void draw() {
+    push_matrix();
+    scale(float(w())/(16*SCALE),float(h())/(16*SCALE));
+    drawimage(data, pixeltype, Rectangle(16*SCALE,16*SCALE));
+    pop_matrix();
+  }
+  Dtest(PixelType pt, int x, int y, const char* l, const unsigned char* d) :
+    Widget(x,y,16*SCALE,16*SCALE,l), pixeltype(pt), data(d) {
+    box(NO_BOX);
+    align(ALIGN_BOTTOM);
+    labelsize(10);
+    tooltip("fltk::drawimage()");
+  }
+};
+
+// Tester for rgbImage subclass:
+class Itest : public Widget {
+public:
+  Itest(PixelType pt, int x, int y, const char* l, const unsigned char* d) :
+    Widget(x,y,16*SCALE,16*SCALE,l) {
+    box(new rgbImage(d, pt, 16*SCALE, 16*SCALE));
+    align(ALIGN_BOTTOM);
+    labelsize(10);
+    tooltip("Instance of fltk::rgbImage used as widget->box()");
+  }
+};
+
+// Tester for inset:
+class Insetimage : public rgbImage {
+public:
+  Insetimage(const unsigned char* d, PixelType pt, int w, int h) :
+    rgbImage(d,pt,w,h) {}
+  void inset(fltk::Rectangle& r) const {r.inset(16);}
+};
+
+class Insettest : public Widget {
+public:
+  Insettest(PixelType pt,int x, int y, const char* l, const unsigned char* d) :
+    Widget(x,y,16*SCALE,16*SCALE,l) {
+    box(new Insetimage(d, pt, 16*SCALE, 16*SCALE));
+    align(ALIGN_BOTTOM);
+    labelsize(10);
+    tooltip("Edges are not scaled in this image.");
+  }
+};
+
+// Bitmap tester:
+#include "sorceress.xbm"
+class Btest : public Widget {
+public:
+  Btest(int x, int y, const char* l)
+    : Widget(x,y,16*SCALE,16*SCALE,l) {
+    box(new xbmImage(sorceress_bits, sorceress_width, sorceress_height));
+    align(ALIGN_BOTTOM|ALIGN_CLIP);
+    labelsize(10);
+  }
+};
+
+// Monochrome xpm tester:
+#include "../pixmaps/recycle.xpm"
+#include "porsche.xpm"
+class Xtest : public Widget {
+public:
+  Xtest(int x, int y, const char* l, const char* const* data)
+    : Widget(x,y,16*SCALE,16*SCALE,l) {
+    box(new xpmImage(data,0));
+    align(ALIGN_BOTTOM|ALIGN_CLIP);
+    labelsize(10);
+  }
+};
+
+unsigned char* builddata(int depth, const unsigned char* pixels) {
+  unsigned char* b = new unsigned char[SCALE*SCALE*16*16*depth];
+  unsigned char* p = b;
+  for (int y = 0; y < 16; y++) {
+    for (int y1 = 0; y1 < SCALE; y1++) {
+      const char* s = cdata+y*16;
+      for (int x = 0; x < 16; x++) {
+	int n;
+	switch (*s++) {
+	case 'R': n = 1; break;
+	case 'G': n = 2; break;
+	case 'B': n = 3; break;
+	case 'r': n = 4; break;
+	case 'g': n = 5; break;
+	case 'b': n = 6; break;
+	default: n = 0; break;
+	}
+	for (int xx = 0; xx < SCALE; xx++) {
+	  const unsigned char* pp = pixels+depth*n;
+	  for (int k=0; k < depth; k++) *p++ = *pp++;
+	}
+      }
+    }
+  }
+  return b;
+}
+
+unsigned char monopixels[7] = {0, 60, 160, 40, 30, 130, 20};
+
+unsigned char rgbpixels[7*3] = {
+  0, 0, 0,
+  255,0,0,
+  0, 255, 0,
+  0, 0, 255,
+  127,0,0,
+  0, 127, 0,
+  0, 0, 127};
+
+unsigned char rgbapixels[7*4] = {
+  0, 0, 0, 0,
+  255,0,0,255,
+  0, 255, 0,255,
+  0, 0, 255,255,
+  127,0,0,127,
+  0, 127, 0,127,
+  0, 0, 127,127};
+
+unsigned char rgbmpixels[7*4] = {
+  255, 255, 255, 0,
+  255,0,0,255,
+  0, 255, 0,255,
+  0, 0, 255,255,
+  255, 0,0,127,
+  0, 255, 0,127,
+  0, 0, 255,127};
+
+// Warning assummes sizeof(unsigned)==4!
+unsigned argbpixels[7] = {
+  0x0,
+  0xffff0000,
+  0xff00ff00,
+  0xff0000ff,
+  0x7f7f0000,
+  0x7f007f00,
+  0x7f00007f
+};
+
+unsigned mrgbpixels[7] = {
+  0x00ffffff,
+  0xffff0000,
+  0xff00ff00,
+  0xff0000ff,
+  0x7fff0000,
+  0x7f00ff00,
+  0x7f0000ff
+};
+
+#if USE_X11
+int visid = -1;
+int arg(int argc, char **argv, int &i) {
+  if (argv[i][1] == 'v') {
+    if (i+1 >= argc) return 0;
+    visid = atoi(argv[i+1]);
+    i += 2;
+    return 2;
+  }
+  return 0;
+}
+#endif
+
+void bgcallback(Widget* w, void *v) {
+  fltk::Color c = fltk::Color(((Slider*)w)->value());
+  ((Window*)v)->color(c);
+  fltk::Widget::default_style->buttoncolor(c);
+  fltk::redraw();
+}
+
+void fgcallback(Widget* w, void *v) {
+  fltk::Color c = fltk::Color(((Slider*)w)->value());
+  fltk::Widget::default_style->labelcolor(c);
+  fltk::Widget::default_style->textcolor(c);
+  fltk::redraw();
+}
+
+void activecallback(Widget* w, void* v) {
+  if (((Button*)w)->value()) ((Widget*)v)->activate();
+  else ((Widget*)v)->deactivate();
+}
+
+bool checker = false;
+
+void checkercallback(Widget* w, void*) {
+  checker = ((Button*)w)->value();
+  fltk::redraw();
+}
+
+class CheckGroup : public Group {
+public:
+  void draw() {
+    if (checker) {
+      fltk::setcolor(GRAY50);
+      int x1 = 0;
+      for (int y = 0; y < h(); y += 10) {
+	x1 = 10-x1;
+	for (int x = x1; x < w(); x += 20)
+	  fltk::fillrect(x,y,10,10);
+      }
+    }
+    Group::draw();
+  }
+  CheckGroup(int x, int y, int w, int h) : Group(x,y,w,h) {}
+};
+
+int main(int argc, char** argv) {
+
+#if USE_X11
+  int i = 1;
+  if (args(argc,argv,i,::arg) < argc) {
+    fprintf(stderr," -v # : use visual\n%s\n",help);
+    exit(1);
+  }
+
+  if (visid >= 0) {
+    open_display();
+    XVisualInfo templt; int num;
+    templt.visualid = visid;
+    xvisual = XGetVisualInfo(xdisplay, VisualIDMask, &templt, &num);
+    if (!xvisual) {
+      fprintf(stderr, "No visual with id %d, use one of:\n",visid);
+      list_visuals();
+      exit(1);
+    }
+    xcolormap = XCreateColormap(xdisplay, RootWindow(xdisplay,xscreen),
+				xvisual->visual, AllocNone);
+# if !USE_CAIRO
+    fltk::xpixel(fltk::BLACK); // make sure black is allocated
+# endif
+  } else {
+    visual(RGB_COLOR);
+  }
+#endif
+
+  const int COLS = 4;
+  const int ROWS = 7;
+
+  Window window(COLS*(16*SCALE+10)+10, 10+ROWS*(16*SCALE+15)+60+150);
+  window.begin();
+  CheckGroup group(0,0,window.w(),window.h()-60-150);
+  window.resizable(group);
+  group.resizable(group);
+  group.begin();
+
+  int y = 10;
+  int x = 10;
+#define nextxy() if ((x+=16*SCALE+10)>=window.w()) y += 16*SCALE+(x=10)+5
+
+  Widget* w;
+
+  w = new Dtest(fltk::MONO, x, y, "MONO", builddata(1, monopixels));
+  nextxy();
+
+  w = new Itest(fltk::MONO, x, y, "MONOimage", builddata(1, monopixels));
+  nextxy();
+
+  w = new Dtest(fltk::RGB, x, y, "RGB", builddata(3, rgbpixels));
+  nextxy();
+
+  w = new Itest(fltk::RGB, x, y, "RGB image", builddata(3, rgbpixels));
+  nextxy();
+
+  w = new Dtest(fltk::RGB32, x, y, "RGB32", builddata(4, (uchar*)argbpixels));
+  nextxy();
+
+  w = new Itest(fltk::RGB32, x, y, "RGB32image", builddata(4, (uchar*)argbpixels));
+  nextxy();
+
+  w = new Dtest(fltk::RGBx, x, y, "RGBx", builddata(4, rgbapixels));
+  w->tooltip("drawimage() of an rgb image except the pixels are 4 apart, "
+	      "some drivers will screw up and not skip the 4th byte");
+  nextxy();
+
+  w = new Itest(fltk::RGBx, x, y, "RGBx image", builddata(4, rgbapixels));
+  nextxy();
+
+  w = new Dtest(fltk::RGBA, x, y, "RGBA", builddata(4, rgbapixels));
+  w->tooltip("drawimage() of 4-byte rgba. Should be transparent, not black");
+  nextxy();
+
+  w = new Itest(fltk::RGBA, x, y, "RGBAimage", builddata(4, rgbapixels));
+  nextxy();
+
+  w = new Dtest(fltk::ARGB32, x, y, "ARGB32", builddata(4, (uchar*)argbpixels));
+  nextxy();
+
+  w = new Itest(fltk::ARGB32, x, y, "ARGB32image", builddata(4, (uchar*)argbpixels));
+  nextxy();
+
+  w = new Dtest(fltk::RGBM, x, y, "RGBM", builddata(4, rgbmpixels));
+  w->tooltip("drawimage() of 4-byte @i;unpremultiplied@n; rgba. Should be transparent, not white");
+  nextxy();
+
+  w = new Itest(fltk::RGBM, x, y, "RGBMimage", builddata(4, rgbmpixels));
+  nextxy();
+
+  w = new Dtest(fltk::MRGB32, x, y, "MRGB32", builddata(4, (uchar*)mrgbpixels));
+  nextxy();
+
+  w = new Itest(fltk::MRGB32, x, y, "MRGB32image", builddata(4, (uchar*)mrgbpixels));
+  nextxy();
+
+  w = new Dtest(fltk::MASK, x, y, "MASK", builddata(1, monopixels));
+  nextxy();
+
+  w = new Itest(fltk::MASK, x, y, "MASKimage", builddata(1, monopixels));
+  nextxy();
+
+  w = new Xtest(x, y, "mask xpmImage", recycle_xpm);
+  w->tooltip("In some versions of FLTK2, the only MASK style image was "
+	     "special monochrome XPM files. These should continue to work.");
+  nextxy();
+
+  w = new Btest(x, y, "xbmImage");
+  w->tooltip("In older versions of FLTK, the only MASK style image was "
+	     "the fltk::xbmImage object, which only had 1 bit for pixel. "
+	     "This should continue to work and display the same colors "
+	     "as maskXPM and MASK.");
+  nextxy();
+
+  w = new Xtest(x, y, "xpmImage", porsche_xpm);
+  w->tooltip("In older versions of FLTK, the only transparency available "
+	     "was from XPM and GIF images. This should continue to work.");
+  nextxy();
+
+  w = new Insettest(fltk::RGBx, x, y, "Insetimage", builddata(4, rgbapixels));
+  nextxy();
+
+  group.end(); y = group.h();
+  CheckButton* b = new CheckButton(20,y,100,20,"active");
+  b->tooltip("activate()/deactivate() the widgets. The ones using an Image "
+	     "will redraw to show the grayed-out state.");
+  b->set();
+  b->callback(activecallback, &group);
+
+  b = new CheckButton(100,y,100,20,"checker");
+  b->tooltip("Draw a checkerboard to test transparency.");
+  b->callback(checkercallback, &group);
+  y += 20;
+
+  Slider* s = new Slider(20,y,window.w()-30,20,"bg");
+  s->tooltip("background color, change this to see transparency");
+  s->range(1,255);
+  s->step(1);
+  s->value(fltk::GRAY75);
+  s->align(ALIGN_LEFT);
+  s->callback(bgcallback, &window);
+  s = new Slider(20,y+20,window.w()-30,20,"fg");
+  s->tooltip("labelcolor, change this to see if MASK works");
+  s->range(1,255);
+  s->step(1);
+  s->value(fltk::BLACK);
+  s->callback(fgcallback, &window);
+  s->align(ALIGN_LEFT);
+
+  Widget text(0,y+40,window.w(),window.h()-y-40,
+	      "* All images should scale to fill their rectangle as you resize the window.\n"
+              "* Images with RGB in their names should have the letters opaque and the correct color.\n"
+              "* RGBA and RGBM images should look identical and be transparent, "
+              "with 100% transparency around the upper-left.\n"
+              "* MASK images should match the fg color as you change it.\n"
+              "Currently only OS/X version has no errors.");
+  text.align(ALIGN_LEFT|ALIGN_INSIDE|ALIGN_WRAP);
+
+  window.end();
+
+#if USE_X11
+  // try to set the icon on X
+  uchar* data = builddata(4, (uchar*)argbpixels);
+  const unsigned width = 16*SCALE;
+  const unsigned height = 16*SCALE;
+  unsigned* icon = new unsigned[width*height+2];
+  icon[0] = width;
+  icon[1] = height;
+  memcpy(icon+2, data, width*height*4);
+  window.icon(icon);
+#endif
+
+  window.show(argc, argv);
+
+  return fltk::run();
+}

Added: branches/branch-3.0/test2/image_file.cxx
===================================================================
--- branches/branch-3.0/test2/image_file.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/image_file.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,582 @@
+// generated by Fast Light User Interface Designer (fluid) version 2.0001
+
+#include "image_file.h"
+#include <stdio.h>
+#include <fltk/fl_file_chooser.h>
+
+Fl_Window* window;
+
+#include <fltk/Fl_Shared_Image.h>
+static const unsigned char datas_coucou[4328] = {
+137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,64,0,0,0,64,8,6,0,0,0,
+170,105,113,222,0,0,0,4,103,65,77,65,0,1,134,160,49,232,150,95,0,0,16,159,73,
+68,65,84,120,218,157,155,59,143,28,229,211,197,79,119,63,125,155,158,89,219,
+24,57,32,176,68,66,0,9,66,88,130,144,136,24,248,20,164,72,124,52,167,4,136,
+12,132,248,0,36,14,64,88,128,133,119,166,239,183,127,96,126,69,117,123,225,
+221,125,91,26,237,206,173,187,159,122,170,78,157,58,85,19,73,90,117,139,227,
+171,175,190,210,253,251,247,245,253,247,223,107,93,87,125,240,193,7,122,250,
+244,169,190,248,226,11,61,123,246,76,239,190,251,174,186,174,147,36,229,121,
+174,231,207,159,235,155,111,190,81,81,20,250,236,179,207,148,36,137,150,101,
+209,56,142,146,164,182,109,213,247,189,94,188,120,161,71,143,30,233,135,31,
+126,208,147,39,79,244,237,183,223,234,243,207,63,215,79,63,253,164,119,222,
+121,71,95,127,253,245,109,110,79,31,125,244,145,166,105,82,150,101,122,246,
+236,153,30,62,124,168,171,171,43,205,243,172,103,207,158,233,241,227,199,90,
+215,85,47,94,188,208,213,213,149,146,36,81,20,69,10,186,229,209,247,189,234,
+186,150,36,45,203,162,203,229,34,73,186,92,46,234,186,78,151,203,69,125,223,
+43,142,99,141,227,168,190,239,237,187,117,93,43,142,99,77,211,164,121,158,37,
+73,93,215,105,24,6,45,203,162,243,249,172,101,89,212,247,189,162,40,210,245,
+245,181,134,97,176,235,221,230,200,243,92,73,146,40,207,115,229,121,174,162,
+40,148,231,185,150,101,177,255,215,117,85,89,150,42,138,66,113,28,223,205,0,
+243,60,171,109,91,51,0,55,215,182,173,198,113,84,93,215,234,186,78,33,4,133,
+16,52,12,131,93,164,105,26,69,81,164,101,89,52,12,131,36,105,28,71,141,227,
+168,105,154,84,215,181,162,40,82,215,117,138,162,72,117,93,111,140,124,91,3,
+132,16,148,231,185,45,146,69,23,69,161,44,203,36,73,135,195,65,69,81,40,73,
+18,173,235,122,123,3,12,195,160,97,24,52,207,179,45,120,93,87,53,77,163,105,
+154,54,30,144,166,169,154,166,209,178,44,102,172,40,138,236,187,24,96,154,38,
+51,202,60,207,102,212,203,229,162,97,24,238,100,128,178,44,53,77,147,138,162,
+80,89,150,102,4,73,246,218,52,77,42,203,82,105,154,42,203,50,205,243,124,55,
+3,44,203,162,117,93,53,77,147,154,166,81,28,199,106,154,70,227,56,170,105,26,
+243,0,66,32,142,99,91,80,8,193,194,98,154,38,51,194,186,174,26,199,81,243,60,
+171,239,123,51,88,223,247,230,113,119,13,1,118,57,77,83,197,113,172,195,225,
+160,60,207,21,69,145,214,117,85,150,101,10,33,220,45,4,134,97,208,56,142,6,
+100,77,211,104,158,103,139,101,118,141,139,98,176,101,89,212,52,141,66,8,230,
+226,236,252,60,207,74,146,68,195,48,152,81,9,9,158,223,246,200,178,76,73,146,
+232,112,56,168,170,42,219,233,16,130,25,128,197,199,113,172,36,73,148,36,201,
+237,13,192,66,137,93,118,171,109,91,13,195,96,158,48,77,147,45,114,158,103,
+139,233,44,203,204,16,236,252,178,44,6,154,227,56,170,235,58,205,243,172,166,
+105,212,247,189,214,117,189,147,7,44,203,178,193,128,56,142,149,101,153,25,
+99,158,103,101,89,246,42,246,255,222,144,59,101,129,190,239,53,77,147,166,105,
+82,219,182,230,182,220,236,56,142,6,54,132,10,97,194,119,216,241,56,142,53,
+207,243,198,0,120,21,6,32,99,220,230,72,211,84,81,20,169,44,75,157,78,39,29,
+14,7,205,243,172,162,40,204,35,230,121,86,85,85,154,166,201,128,250,78,30,64,
+158,31,134,193,22,72,22,0,224,216,117,220,159,133,121,3,224,37,235,186,42,138,
+34,243,28,188,137,191,96,197,109,14,118,188,44,75,29,143,71,165,105,106,160,
+87,85,149,242,60,215,48,12,42,138,194,12,80,215,245,221,13,16,69,209,198,0,
+184,45,33,225,13,128,65,72,157,109,219,42,77,83,141,227,184,49,192,60,207,90,
+150,197,194,12,160,12,33,220,201,3,210,52,53,15,72,146,68,231,243,89,121,158,
+235,120,60,170,40,10,213,117,173,195,225,96,88,149,166,169,194,147,39,79,44,
+79,250,7,136,154,101,153,229,212,178,44,13,101,121,148,101,169,16,130,202,178,
+212,178,44,182,48,0,147,7,134,72,146,68,113,28,107,93,87,173,235,106,158,131,
+203,15,195,160,174,235,12,19,62,253,244,211,13,206,16,114,109,219,110,158,103,
+89,102,247,51,77,147,225,7,24,16,66,176,181,36,73,162,16,130,226,56,86,248,
+253,247,223,109,113,44,42,138,34,133,16,148,166,169,197,16,113,180,79,51,69,
+81,152,1,161,187,243,60,43,207,115,35,80,28,236,118,146,36,154,231,121,147,
+69,72,139,125,223,107,24,6,245,125,191,89,32,255,251,16,225,189,190,239,141,
+253,225,226,32,126,89,150,155,76,65,186,196,8,129,92,189,44,139,166,105,50,
+58,138,123,98,73,254,70,81,100,136,155,36,137,185,29,198,249,55,224,242,30,
+192,255,109,219,170,235,58,229,121,110,33,198,206,119,93,167,178,44,109,183,
+179,44,179,207,135,16,212,182,173,252,189,227,234,228,123,214,81,150,165,133,
+100,81,20,58,28,14,26,199,209,24,107,120,235,173,183,94,99,79,228,77,158,243,
+94,28,199,170,170,202,94,131,81,113,35,236,234,254,192,226,208,79,62,143,167,
+241,30,134,134,164,144,42,201,60,243,60,219,38,225,1,128,101,146,36,6,118,156,
+155,52,72,200,65,200,184,94,150,101,175,60,128,23,88,16,174,195,98,1,17,31,
+255,24,161,40,10,35,27,235,186,110,8,16,187,73,22,32,221,225,250,227,56,170,
+109,91,213,117,109,187,219,117,221,198,197,41,146,198,113,180,197,242,28,102,
+74,22,168,170,202,194,144,16,78,211,84,85,85,105,28,71,187,95,140,92,20,197,
+63,24,224,193,142,152,62,28,14,246,58,46,206,103,60,22,240,121,46,200,174,123,
+34,131,129,121,255,116,58,41,142,227,27,23,14,46,244,125,111,239,17,251,124,
+14,195,82,214,114,191,84,157,81,20,89,241,147,101,153,186,174,211,225,112,176,
+157,143,227,248,149,1,30,61,122,100,0,232,93,222,47,20,119,247,30,194,201,248,
+44,159,223,47,30,215,246,177,79,184,120,240,243,217,129,247,125,22,89,150,101,
+131,69,184,185,47,134,48,128,63,119,150,101,170,170,106,99,140,178,44,255,169,
+9,136,91,128,129,112,32,78,61,24,70,81,164,52,77,237,102,252,174,147,106,214,
+117,181,69,75,218,44,202,231,117,174,177,44,139,174,174,174,12,148,242,60,183,
+208,104,219,86,101,89,170,105,154,13,232,145,62,9,43,118,21,87,47,138,194,240,
+165,40,10,157,78,39,205,243,108,6,42,138,194,64,49,144,182,200,203,222,186,
+126,199,185,65,210,7,113,12,33,242,121,159,29,100,135,40,129,111,202,12,208,
+235,174,235,12,241,41,136,192,16,82,29,37,185,127,13,112,76,211,84,199,227,
+209,238,137,141,4,195,48,106,20,69,42,138,66,227,56,170,170,170,87,6,240,106,
+12,36,166,235,58,99,82,236,180,15,135,125,152,128,3,255,150,9,188,71,240,23,
+164,102,183,96,127,44,96,28,71,243,32,192,15,78,224,177,162,235,186,141,231,
+250,52,13,73,59,159,207,182,112,188,56,203,50,5,110,130,29,222,131,33,152,64,
+236,96,12,222,99,225,100,3,14,60,225,191,14,79,127,135,97,48,228,238,186,206,
+132,21,118,13,16,109,219,246,159,74,206,149,216,222,171,192,143,61,0,67,177,
+217,32,211,3,188,235,19,10,228,96,110,212,87,119,88,208,147,27,226,206,231,
+116,127,83,156,203,135,3,41,17,49,5,100,39,20,72,125,184,252,62,245,249,112,
+101,199,185,135,61,7,217,135,29,27,25,88,44,150,1,12,241,10,44,77,237,142,151,
+120,210,228,249,53,231,192,64,94,9,166,8,66,15,96,241,24,0,165,24,190,128,103,
+80,45,122,29,17,16,196,32,92,131,82,123,239,129,158,136,225,245,113,28,43,246,
+224,231,173,7,65,130,149,129,15,196,240,222,229,124,236,123,12,216,239,6,128,
+139,161,88,16,252,29,131,253,215,98,249,60,70,166,108,230,156,123,15,244,76,
+149,243,99,0,3,65,95,222,178,88,175,215,241,101,79,103,113,125,98,12,30,128,
+24,137,33,40,72,208,19,124,237,129,254,135,170,92,215,181,242,60,183,212,231,
+63,139,231,236,235,19,143,57,251,216,247,161,237,61,145,80,14,158,151,227,226,
+27,23,249,27,165,33,23,244,1,184,233,191,254,250,75,33,4,35,27,123,215,131,
+143,67,63,185,112,154,166,102,72,190,79,218,109,154,102,195,64,225,4,0,100,
+20,69,150,46,193,37,79,140,188,23,123,99,240,62,30,184,174,171,194,159,127,
+254,105,23,131,79,243,63,187,76,121,235,83,225,190,38,56,30,143,38,135,249,
+84,231,195,1,9,28,131,146,218,192,1,176,0,10,76,218,243,175,241,240,175,131,
+45,222,232,243,60,91,86,218,135,10,158,156,36,137,194,131,7,15,54,28,159,69,
+146,255,169,161,33,67,94,120,64,129,229,239,77,76,210,123,197,158,35,208,11,
+240,143,166,105,116,185,92,54,212,24,247,231,156,236,166,247,212,125,182,161,
+32,242,153,202,27,0,145,52,60,127,254,252,181,118,146,47,141,155,166,49,25,
+41,203,50,77,211,164,97,24,236,53,95,184,64,132,56,0,48,98,120,175,20,249,29,
+132,124,129,57,164,65,148,34,208,155,107,160,249,121,64,221,19,48,66,193,203,
+114,222,3,36,41,188,249,230,155,27,210,227,31,188,254,111,85,161,87,130,246,
+72,15,247,255,55,93,207,139,34,222,245,1,69,0,206,87,118,62,115,144,30,249,
+222,30,241,145,202,253,181,250,190,87,85,85,27,156,10,191,252,242,203,102,113,
+123,113,4,87,39,60,48,0,108,144,240,224,243,52,35,160,160,0,158,149,159,127,
+27,132,178,21,53,24,212,191,190,190,214,52,77,122,249,242,165,218,182,85,81,
+20,22,18,158,182,3,102,158,144,237,13,12,224,122,142,112,60,30,55,159,11,143,
+31,63,182,197,16,239,94,31,160,162,226,117,22,198,115,116,1,22,75,236,130,242,
+62,165,66,108,0,169,117,93,55,122,64,93,215,86,247,123,213,135,52,205,98,60,
+19,245,248,226,57,3,245,1,64,75,232,122,226,103,125,1,79,122,216,65,140,129,
+171,19,6,160,63,218,59,98,41,32,249,127,29,44,222,131,146,245,234,255,6,173,
+44,203,54,189,72,127,176,0,143,250,96,11,32,138,198,184,174,171,253,157,231,
+89,151,203,69,111,188,241,134,41,204,77,211,188,34,66,251,162,129,5,19,10,44,
+208,99,3,249,27,110,141,59,210,39,0,108,72,81,94,30,247,228,11,238,223,117,
+157,165,73,186,197,236,40,57,31,73,204,159,99,95,88,121,81,213,119,158,215,
+117,53,15,243,224,29,60,192,248,134,7,174,184,175,10,247,92,1,145,129,27,130,
+11,236,11,144,155,16,153,52,72,17,196,160,133,167,187,94,10,247,160,231,249,
+0,207,33,76,113,28,171,174,107,37,73,98,50,27,170,178,239,64,95,46,23,133,223,
+126,251,109,179,24,196,80,175,224,248,114,25,93,157,48,225,51,222,37,247,185,
+223,247,11,40,134,216,69,175,245,121,99,120,108,240,21,161,47,144,240,8,174,
+69,6,161,123,69,49,215,182,173,117,169,9,9,132,216,240,246,219,111,155,155,
+131,246,158,15,176,72,0,209,167,39,92,174,40,10,179,242,77,121,152,214,149,
+55,38,162,133,167,194,199,227,113,3,130,8,31,62,75,120,195,96,44,168,49,101,
+52,106,85,150,101,234,251,94,215,215,215,22,34,126,40,163,109,219,127,36,49,
+47,141,237,65,11,100,223,103,9,255,32,5,238,83,146,39,31,123,93,0,23,63,159,
+207,182,56,175,12,227,222,16,162,125,63,192,147,48,47,171,145,42,81,157,47,
+151,139,226,56,182,115,48,182,51,142,227,63,213,32,116,19,122,137,91,3,110,
+158,79,251,93,7,52,169,212,246,161,224,245,69,60,33,132,160,227,241,104,231,
+125,248,240,225,198,173,217,101,223,7,244,97,130,55,240,63,139,225,181,60,207,
+213,247,189,117,144,24,209,225,123,120,114,215,117,10,190,41,66,29,192,95,184,
+189,175,15,88,176,47,140,188,36,238,119,251,38,15,64,174,38,78,253,238,178,
+163,235,186,190,38,140,248,62,32,223,243,217,192,27,14,161,133,234,147,254,
+129,247,0,8,88,248,238,187,239,110,213,126,126,255,253,247,173,20,205,178,76,
+117,93,27,171,130,152,16,119,228,120,64,8,99,96,100,220,244,112,56,104,154,
+38,27,90,104,219,86,135,195,97,19,142,63,254,248,227,173,238,239,147,79,62,
+49,192,35,139,177,216,186,174,173,118,240,19,107,227,56,222,126,62,128,102,
+2,130,199,56,142,214,136,204,178,204,118,26,54,136,247,248,161,40,192,15,242,
+82,150,165,13,45,128,9,104,246,119,153,14,129,230,130,242,224,1,108,212,107,
+141,125,223,43,77,83,195,144,91,27,128,174,42,6,160,37,13,56,66,108,200,26,
+8,21,224,2,76,143,97,37,230,247,152,234,224,59,244,247,201,16,119,25,224,136,
+227,120,51,169,230,211,31,231,247,194,202,157,70,100,104,85,211,81,161,252,
+101,81,236,50,30,192,204,14,3,144,251,254,252,52,77,54,139,80,150,165,245,1,
+152,229,185,235,132,8,5,18,53,0,6,1,119,60,145,162,87,216,247,253,221,60,0,
+247,194,0,180,204,201,8,158,48,225,17,94,98,247,93,166,190,239,55,45,42,134,
+167,152,49,248,175,82,250,166,3,157,129,5,250,73,85,102,147,48,64,81,20,134,
+21,119,50,64,93,215,70,138,88,0,3,19,208,97,120,195,190,7,72,145,67,105,76,
+40,209,179,243,212,219,235,9,183,61,88,164,231,13,96,22,241,14,54,248,241,154,
+91,95,1,186,236,67,192,119,89,113,119,47,135,249,41,47,192,142,70,38,92,2,183,
+39,124,16,80,17,81,239,18,2,144,29,48,0,176,197,27,124,123,237,255,21,2,126,
+30,151,27,247,2,163,223,125,223,84,161,220,245,162,10,30,132,97,192,25,122,
+247,190,176,186,173,1,40,139,9,49,120,2,248,128,39,208,98,187,115,26,100,0,
+201,123,128,159,249,243,41,142,20,228,135,162,8,25,64,207,207,31,236,167,186,
+125,127,225,54,7,99,181,128,39,105,21,15,160,48,195,0,132,196,157,12,80,85,
+149,237,156,247,4,92,22,189,141,221,243,237,113,63,57,86,85,149,213,15,227,
+56,218,120,13,24,65,136,220,213,3,32,79,94,69,246,101,62,216,128,1,150,101,
+81,248,242,203,47,173,152,224,3,48,41,207,199,145,193,232,6,77,211,164,227,
+241,104,243,63,184,56,150,70,189,165,93,141,225,0,61,206,195,185,193,4,84,41,
+248,197,123,239,189,247,26,21,247,5,25,146,220,254,7,19,251,207,239,193,217,
+128,246,195,15,63,180,162,226,124,62,111,52,250,203,229,98,174,133,240,73,204,
+206,243,108,24,0,2,67,99,217,61,200,146,231,0,80,95,106,10,36,118,190,195,216,
+13,223,245,122,165,87,164,253,115,206,231,167,66,25,140,160,105,131,160,227,
+135,36,203,178,84,120,249,242,165,46,151,139,149,141,52,38,188,234,2,224,177,
+227,100,131,227,241,104,49,198,136,10,12,16,99,65,151,209,28,134,97,176,113,
+54,158,151,101,169,203,229,98,59,133,97,61,41,98,168,218,183,236,120,222,247,
+253,141,180,27,47,67,203,196,48,190,0,12,215,215,215,58,159,207,182,251,55,
+9,15,168,43,236,32,96,118,58,157,44,221,16,187,128,159,31,183,67,154,98,104,
+241,254,253,251,138,162,200,60,102,95,81,194,57,252,34,253,236,129,39,90,126,
+62,96,255,243,30,240,160,174,107,189,120,241,98,243,171,21,248,66,248,249,231,
+159,55,122,0,162,35,86,246,23,165,122,195,0,85,85,89,170,99,151,41,77,169,251,
+153,221,107,154,198,164,54,239,166,84,133,251,44,179,207,18,251,30,133,159,
+88,33,84,252,175,80,24,241,241,217,136,112,37,196,199,113,84,248,245,215,95,
+95,19,63,64,76,210,8,164,4,26,123,56,28,20,66,208,189,123,247,44,255,114,67,
+8,157,148,190,240,253,123,247,238,89,107,221,99,0,134,243,253,71,175,73,122,
+121,222,171,212,126,88,219,191,231,251,149,132,45,19,228,126,140,207,248,202,
+131,7,15,94,251,57,12,98,163,111,65,249,169,145,189,136,234,135,145,232,219,
+17,207,85,85,25,96,18,2,204,244,250,249,68,239,1,164,83,79,176,120,248,57,66,
+240,129,142,51,59,77,139,45,207,115,27,142,34,245,18,174,214,197,250,248,227,
+143,173,231,239,219,212,30,7,24,84,34,22,73,57,87,87,87,38,99,19,211,146,244,
+199,31,127,108,188,133,56,166,143,112,60,30,205,144,48,67,64,138,193,103,234,
+10,98,25,207,228,117,100,54,188,132,77,240,41,208,171,214,72,238,94,44,105,
+154,230,213,140,16,232,233,37,231,253,140,14,213,153,31,152,62,30,143,170,170,
+202,64,8,15,240,116,248,234,234,74,47,95,190,180,214,25,32,72,220,226,13,85,
+85,233,116,58,89,63,16,228,223,55,107,125,251,205,239,184,215,46,89,32,70,38,
+181,250,25,102,126,77,22,40,29,153,208,196,173,166,105,178,94,28,245,59,127,
+105,139,17,247,104,253,8,35,190,150,167,184,65,62,99,247,233,31,130,3,224,10,
+32,135,156,133,150,224,135,155,32,89,126,28,23,227,222,52,158,231,199,124,253,
+132,74,154,166,10,94,112,244,98,163,159,11,242,5,69,211,52,27,166,134,198,231,
+129,197,183,174,125,67,211,11,38,156,31,41,221,103,29,223,54,247,243,139,92,
+207,143,187,236,199,96,60,96,250,169,151,227,241,104,188,128,123,201,178,76,
+1,192,130,51,147,215,189,188,205,14,123,133,213,119,136,200,187,220,140,31,
+99,45,138,194,82,37,245,128,111,147,209,178,226,156,228,234,243,249,252,218,
+252,34,90,161,31,116,100,225,190,37,127,58,157,44,60,79,167,147,174,174,174,
+140,124,249,223,46,72,122,85,12,249,41,14,30,94,167,247,63,74,64,87,103,39,
+104,123,65,92,188,7,48,242,74,37,232,135,20,125,229,70,203,12,240,243,191,83,
+28,134,97,83,106,123,213,9,207,227,53,164,48,223,185,98,144,139,208,3,163,236,
+183,195,79,159,62,181,27,245,132,193,207,226,193,168,188,196,236,181,63,118,
+156,221,246,141,205,16,130,209,103,228,168,125,65,194,0,51,174,238,231,6,88,
+152,119,117,63,208,9,86,248,223,33,250,169,183,253,236,176,15,223,56,142,245,
+63,29,34,171,173,78,153,43,170,0,0,0,0,73,69,78,68,174,66,96,130};
+
+Fl_Value_Slider* slider;
+
+static void cb_slider(Fl_Value_Slider* o, void*) {
+  Fl_Shared_Image::set_cache_size((int)o->value()*1024);
+}
+static const unsigned char datas_testimg[5756] = {
+255,216,255,224,0,16,74,70,73,70,0,1,1,0,0,1,0,1,0,0,255,219,0,67,0,8,6,6,
+7,6,5,8,7,7,7,9,9,8,10,12,20,13,12,11,11,12,25,18,19,15,20,29,26,31,30,29,26,
+28,28,32,36,46,39,32,34,44,35,28,28,40,55,41,44,48,49,52,52,52,31,39,57,61,
+56,50,60,46,51,52,50,255,219,0,67,1,9,9,9,12,11,12,24,13,13,24,50,33,28,33,
+50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,
+50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,
+255,192,0,17,8,0,149,0,227,3,1,34,0,2,17,1,3,17,1,255,196,0,31,0,0,1,5,1,1,
+1,1,1,1,0,0,0,0,0,0,0,0,1,2,3,4,5,6,7,8,9,10,11,255,196,0,181,16,0,2,1,3,3,
+2,4,3,5,5,4,4,0,0,1,125,1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,
+129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,
+26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,
+86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,
+131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,
+164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,
+197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,
+229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250,255,196,0,31,
+1,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,2,3,4,5,6,7,8,9,10,11,255,196,0,181,17,
+0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119,0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,
+19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,
+52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,
+73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,
+119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,
+152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,
+185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,
+218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250,
+255,218,0,12,3,1,0,2,17,3,17,0,63,0,242,229,106,118,250,102,41,8,52,154,26,
+99,247,243,70,241,81,28,138,51,69,135,113,228,210,241,81,238,197,56,28,209,
+96,184,240,0,169,20,212,27,176,41,202,78,105,88,11,137,46,5,74,178,18,106,160,
+224,83,149,240,106,28,75,70,164,18,249,125,13,105,90,221,22,56,102,174,124,
+75,197,93,181,152,30,245,207,86,159,83,211,192,226,28,125,219,157,66,73,184,
+122,212,115,184,88,201,172,248,110,74,30,188,84,183,23,2,72,198,43,149,197,
+220,250,69,141,78,147,93,72,139,84,78,212,210,252,212,108,212,212,79,58,117,
+46,133,38,128,220,212,69,170,88,148,177,173,20,110,115,185,216,185,110,189,
+77,86,213,227,113,110,48,135,6,181,52,248,12,238,20,14,51,91,90,134,157,27,
+89,237,199,56,171,167,15,122,236,195,31,139,140,40,170,107,118,121,131,129,
+81,154,214,212,172,90,38,60,126,53,140,196,134,193,174,196,238,120,151,190,
+194,226,149,78,199,12,41,155,169,119,85,2,186,58,157,23,80,102,153,35,94,73,
+226,182,117,197,152,217,128,70,0,228,215,55,225,82,167,84,93,221,186,87,165,
+45,140,122,132,139,28,164,109,197,111,133,171,74,151,50,155,30,34,179,149,175,
+208,243,171,45,74,75,11,129,44,124,227,168,245,173,75,253,101,245,56,149,90,
+38,30,228,87,83,47,132,244,251,89,86,64,170,73,61,58,213,93,106,27,104,44,219,
+98,1,133,226,176,171,82,18,122,24,123,84,222,135,37,176,81,80,139,165,3,4,209,
+89,123,121,29,26,24,34,58,127,149,145,78,70,25,230,167,80,15,74,178,81,77,161,
+52,198,132,226,180,182,102,154,209,250,10,57,172,85,174,102,121,102,156,18,
+174,148,199,81,81,50,209,205,112,104,132,68,79,74,149,33,167,32,230,172,40,
+192,169,148,135,20,64,209,224,84,123,14,106,203,154,96,0,154,19,27,208,143,
+203,36,113,78,136,52,109,145,93,5,173,149,165,189,162,201,114,158,100,206,55,
+42,18,64,3,181,16,44,8,73,146,221,58,112,118,214,51,173,21,161,234,195,47,171,
+104,201,180,175,253,106,84,129,158,68,225,88,254,21,46,74,157,172,8,62,134,
+172,160,89,14,50,192,14,105,203,189,220,140,229,71,63,55,32,86,14,107,177,221,
+28,60,172,149,202,76,105,132,147,90,130,218,7,31,63,113,213,70,15,248,83,98,
+178,134,34,29,219,205,61,148,174,0,250,250,210,231,135,115,111,168,87,109,105,
+163,234,84,58,125,194,218,197,116,201,136,101,36,43,103,210,165,129,115,133,
+21,160,142,247,14,96,99,196,132,99,39,0,17,211,252,42,75,59,101,44,76,138,85,
+80,252,199,223,208,85,70,105,171,156,120,156,61,74,117,85,58,106,247,46,233,
+191,185,11,187,0,122,154,218,151,231,135,165,115,146,203,27,200,21,200,80,56,
+94,120,21,42,207,52,77,182,57,92,46,123,26,106,169,180,248,114,53,149,253,167,
+191,215,77,7,221,105,171,58,182,71,90,226,245,125,29,237,220,178,142,43,184,
+75,169,179,130,255,0,152,164,147,108,191,235,99,71,30,133,69,109,9,62,135,58,
+225,170,208,122,77,91,230,121,113,141,148,242,40,218,222,149,233,51,104,150,
+23,155,148,90,170,51,3,130,156,17,238,43,154,188,208,46,172,103,193,143,204,
+143,63,44,138,50,15,215,210,181,85,78,76,94,89,87,15,172,181,94,68,126,30,180,
+158,27,197,184,101,194,227,165,119,182,247,173,193,25,200,53,87,67,240,245,
+219,218,249,175,25,25,94,6,43,118,223,195,23,206,202,21,112,15,95,106,202,80,
+156,245,177,227,213,139,110,200,172,215,109,41,37,143,74,197,214,164,223,110,
+223,74,238,211,194,70,52,203,228,156,87,23,226,59,22,181,149,163,3,131,77,83,
+113,87,50,246,114,142,172,243,169,12,158,99,112,122,209,91,159,100,61,211,154,
+42,174,142,155,196,230,134,228,56,53,102,39,169,101,183,170,234,133,26,174,
+247,29,141,4,25,25,174,151,66,208,34,212,109,203,56,201,53,204,68,196,1,93,
+183,131,231,32,50,142,128,214,248,56,198,85,109,33,84,210,55,70,118,161,224,
+203,136,203,24,9,35,208,215,51,121,165,221,218,72,86,72,141,123,146,200,140,
+188,128,107,23,84,210,226,189,7,8,51,94,141,76,12,31,195,161,154,168,250,158,
+56,21,148,225,129,7,222,166,29,43,172,212,188,51,57,207,150,128,227,161,172,
+235,77,23,203,144,27,150,4,47,97,222,188,204,69,31,100,253,231,161,213,135,
+165,82,188,185,105,43,179,15,236,243,184,202,70,236,61,64,171,22,118,172,92,
+201,42,16,168,122,17,212,215,93,45,196,49,91,236,134,5,28,99,154,165,115,22,
+238,15,240,142,112,56,205,114,86,173,77,43,65,220,245,240,217,77,101,46,106,
+150,211,166,229,22,86,118,46,204,75,19,146,77,73,26,6,80,8,167,44,65,126,251,
+224,125,13,74,165,20,97,6,125,205,121,237,158,237,26,55,119,100,30,81,82,118,
+244,169,54,16,187,0,247,99,253,42,96,197,1,220,20,159,167,74,68,185,149,24,
+149,114,51,212,14,135,216,142,244,156,141,213,8,71,81,20,96,80,228,129,197,
+75,132,148,110,143,131,221,79,244,168,157,28,182,10,149,199,118,24,168,179,
+103,115,81,84,253,222,163,84,141,192,158,8,57,200,171,174,242,67,0,243,8,101,
+234,140,58,26,168,85,84,114,73,250,85,160,170,109,163,66,197,163,153,114,15,
+247,91,56,53,112,236,114,77,74,46,251,50,132,174,102,113,218,175,91,49,194,
+249,157,184,39,214,169,60,102,55,42,120,34,165,251,71,238,85,8,228,28,138,164,
+251,156,233,184,75,155,169,169,24,46,153,238,13,79,18,134,203,99,230,170,16,
+220,134,143,130,58,214,185,143,17,43,174,50,78,13,116,82,149,142,184,215,82,
+208,96,5,84,183,124,112,123,231,218,162,184,132,29,54,118,18,159,182,111,83,
+28,100,29,184,4,19,147,239,87,35,137,153,27,130,85,6,78,58,154,86,180,150,88,
+228,104,211,115,70,50,65,60,128,123,214,142,78,250,28,184,169,83,149,57,41,
+189,58,216,244,95,8,180,23,154,36,68,170,239,3,7,30,181,209,36,9,31,240,143,
+202,188,179,225,182,175,44,151,19,218,179,100,43,147,248,102,189,96,114,191,
+133,117,211,111,150,199,196,86,107,154,240,217,144,205,28,101,114,192,98,185,
+77,83,195,209,106,183,63,34,130,7,181,117,207,16,145,25,73,235,197,86,177,129,
+160,50,6,254,247,21,50,149,145,158,141,28,28,190,17,137,37,101,40,56,52,87,
+113,53,171,188,172,216,234,104,167,238,153,89,159,49,48,6,161,48,130,106,92,
+208,43,27,157,54,24,137,129,93,23,135,175,18,217,136,99,130,77,97,10,122,146,
+167,35,138,214,141,95,103,62,98,101,11,171,30,147,14,166,167,156,230,161,185,
+215,22,18,118,130,126,149,203,233,87,78,88,131,147,129,91,151,16,33,180,105,
+64,36,178,244,244,175,98,120,200,198,10,82,97,135,193,206,189,78,72,238,67,
+113,172,201,117,3,42,96,110,224,145,89,187,61,234,53,132,65,130,140,196,30,
+121,237,79,145,194,198,72,60,215,205,87,175,58,211,230,145,247,56,76,45,60,
+45,46,68,172,214,254,100,36,129,60,96,242,55,100,253,7,52,52,139,33,56,126,
+157,106,162,51,27,128,70,78,13,93,72,162,149,204,69,128,47,192,110,128,30,213,
+131,101,83,148,164,164,209,85,164,44,172,164,112,78,71,181,58,37,81,130,121,
+162,72,94,9,90,41,23,12,167,20,248,198,213,206,50,231,167,181,102,219,52,161,
+11,202,226,236,98,9,61,253,120,205,68,33,108,242,64,29,206,71,21,41,24,229,
+156,127,58,18,47,55,8,28,124,199,181,84,32,219,216,239,116,33,43,115,93,17,
+200,23,35,96,192,250,210,170,59,12,231,3,182,106,251,233,241,69,108,94,98,68,
+157,64,29,135,191,189,80,150,117,70,41,144,88,123,113,67,131,90,156,239,146,
+45,203,154,200,71,220,141,181,191,253,117,52,114,4,72,198,220,175,63,41,61,
+121,207,30,159,253,106,85,16,53,142,101,63,188,102,249,54,158,64,232,127,63,
+233,81,76,74,62,206,1,78,5,43,91,83,21,36,221,228,238,77,115,53,188,227,114,
+163,198,223,80,223,225,84,229,86,137,202,176,57,250,82,35,151,144,47,86,99,
+138,183,112,4,215,50,59,142,184,192,167,230,204,109,237,116,129,77,31,105,25,
+233,93,117,179,188,208,35,169,5,137,7,61,186,87,46,208,71,143,148,109,63,90,
+232,124,53,32,146,38,132,245,92,241,87,6,155,34,116,167,73,218,70,132,113,48,
+148,25,14,72,92,147,140,103,240,168,18,226,73,39,187,141,15,204,241,21,95,211,
+252,42,229,195,108,140,147,193,53,206,220,94,27,93,243,169,27,179,129,248,214,
+235,71,115,60,76,84,176,181,27,236,206,171,225,213,164,118,58,156,207,114,202,
+11,114,62,181,233,55,58,213,141,170,156,206,133,189,1,175,19,179,150,238,84,
+220,175,141,221,197,94,134,221,144,230,89,93,155,220,213,198,171,138,62,10,
+85,26,138,71,166,193,226,72,158,67,140,109,38,175,73,168,6,85,145,24,109,239,
+94,109,20,219,64,0,214,158,151,52,242,187,197,230,97,61,232,133,78,103,102,
+20,39,175,43,59,95,237,235,101,224,158,71,189,21,231,87,50,200,151,50,47,156,
+56,62,148,87,111,179,145,191,52,15,44,219,70,40,141,195,1,83,4,36,224,14,77,
+114,216,218,228,106,164,144,0,230,180,226,210,100,104,195,185,198,123,84,246,
+86,43,16,18,205,141,221,113,233,90,16,9,47,38,8,156,70,63,90,244,240,216,46,
+101,121,152,78,173,158,131,180,173,60,64,217,193,36,214,219,193,114,145,180,
+139,106,242,70,7,33,122,254,2,182,244,75,59,75,116,13,46,9,247,173,45,67,83,
+180,130,221,188,189,185,2,163,27,38,163,236,105,194,235,185,166,26,172,169,
+207,218,39,169,230,114,201,4,197,252,128,219,186,148,101,193,21,157,42,157,
+167,53,175,119,168,197,45,225,97,129,137,55,144,0,228,244,167,77,167,197,118,
+141,61,155,6,67,206,222,226,188,90,148,229,29,207,178,193,227,225,138,135,43,
+209,152,118,144,25,188,196,83,181,192,4,19,208,251,80,50,9,86,4,48,56,32,212,
+210,65,44,44,74,29,140,160,147,158,156,115,77,154,85,185,101,149,87,99,145,
+134,25,224,159,106,198,86,104,232,166,165,78,124,175,97,196,249,145,46,226,
+114,157,253,189,41,208,178,52,128,73,242,161,24,36,118,227,20,146,172,94,84,
+94,91,157,248,249,215,29,13,66,119,41,254,19,237,156,84,234,153,219,9,70,55,
+145,98,107,55,141,200,92,186,31,184,216,251,221,56,253,105,138,141,109,25,150,
+88,36,228,148,85,32,174,123,30,127,79,207,165,62,214,253,237,227,66,234,55,
+169,249,73,31,50,255,0,133,106,253,164,155,41,25,153,139,145,144,88,228,131,
+90,198,43,116,67,196,74,75,115,54,226,234,226,228,42,180,127,51,127,10,142,
+254,148,191,216,6,104,195,92,72,209,190,56,11,212,125,105,145,4,150,69,121,
+103,27,65,201,201,57,53,109,117,57,13,187,41,92,55,69,52,38,183,97,82,130,157,
+146,212,166,182,240,90,36,98,103,103,153,58,32,3,7,158,230,163,150,60,21,105,
+48,204,71,64,104,125,167,150,201,115,206,104,193,221,147,205,67,149,201,84,
+121,108,133,134,24,252,224,193,0,238,91,61,169,129,139,72,88,245,52,231,63,
+33,230,152,56,34,166,76,232,74,42,75,149,88,113,173,63,11,184,26,180,209,158,
+232,72,255,0,63,141,102,154,187,162,2,154,148,183,3,133,72,136,39,220,241,254,
+53,84,254,35,28,108,121,146,177,175,169,220,124,199,28,246,174,83,86,152,25,
+160,182,206,50,119,191,244,254,181,183,115,56,145,203,19,133,28,146,125,43,
+142,189,144,92,93,53,218,185,201,60,125,59,87,114,71,143,156,86,246,56,101,
+73,111,47,200,237,172,91,108,11,131,192,21,96,75,184,245,172,13,42,251,205,
+181,11,158,69,105,71,47,189,115,75,71,99,224,228,172,205,53,147,24,230,164,
+154,229,227,136,180,82,249,109,142,185,172,153,110,74,240,181,147,120,110,46,
+155,105,145,130,251,26,80,191,53,197,21,169,5,192,191,123,135,99,170,30,78,
+122,209,80,13,61,59,130,104,174,207,172,51,91,152,54,215,93,50,107,119,78,149,
+75,22,61,171,155,91,87,83,145,90,118,101,227,173,226,226,164,155,58,46,237,
+99,160,87,154,238,127,45,65,216,43,160,179,79,179,32,236,107,31,69,184,141,
+95,14,6,107,98,238,226,53,195,6,226,189,250,21,105,186,124,201,153,52,238,91,
+55,146,116,4,213,91,219,166,16,54,230,170,237,168,66,177,228,17,154,199,188,
+189,107,130,85,126,237,114,226,113,16,140,108,183,52,132,91,42,59,22,144,176,
+245,174,135,74,148,32,86,83,180,144,58,26,231,149,73,53,114,218,231,236,192,
+175,222,96,120,3,160,175,159,173,46,172,247,114,148,229,81,198,218,63,192,219,
+215,164,182,107,54,4,5,185,108,0,23,184,207,255,0,90,185,165,4,28,138,158,73,
+26,71,46,231,44,122,154,140,87,12,165,118,125,50,165,203,100,216,133,184,200,
+63,67,233,78,117,109,170,199,163,116,34,161,86,201,100,244,171,23,42,99,138,
+44,114,155,70,8,247,235,250,209,98,121,238,155,232,69,159,151,105,249,135,161,
+169,252,215,16,148,82,118,227,166,121,168,2,179,28,109,57,250,84,232,133,78,
+88,242,58,0,105,221,149,8,41,8,136,118,2,195,31,90,82,51,252,71,240,21,60,113,
+121,206,75,72,136,163,150,103,56,2,150,73,109,134,82,213,89,199,121,95,191,
+208,85,45,22,135,114,174,169,218,40,128,124,163,158,79,106,7,74,57,39,158,105,
+195,129,75,114,101,39,57,115,49,146,12,45,71,186,164,148,252,135,154,164,101,
+197,75,141,206,106,245,148,36,90,15,145,214,181,96,31,102,177,81,252,114,157,
+237,244,236,63,207,173,99,88,33,186,190,72,199,221,234,255,0,238,142,181,173,
+113,46,101,102,60,183,97,233,91,81,133,157,217,156,113,48,229,117,42,61,17,
+141,226,11,227,21,175,217,163,63,188,151,151,246,95,254,189,97,233,150,119,
+26,133,204,118,176,130,89,143,224,42,83,5,198,165,127,229,194,175,44,206,121,
+227,63,157,118,254,31,177,135,64,67,246,147,24,184,198,89,253,5,117,78,106,
+49,178,220,248,172,199,26,241,53,92,223,201,121,11,113,225,216,244,109,54,34,
+28,52,223,198,106,24,19,41,187,53,71,90,241,36,122,141,244,112,219,49,48,169,
+229,143,241,26,185,17,34,17,92,213,19,86,185,228,206,251,177,92,2,196,84,59,
+51,154,153,19,187,119,169,210,2,92,113,81,123,34,111,98,37,182,93,163,138,43,
+75,203,81,198,71,231,69,77,200,230,56,159,179,47,165,57,96,2,167,165,197,122,
+71,166,53,65,67,144,112,105,239,44,142,187,75,156,81,138,49,78,237,104,152,
+20,39,105,35,108,228,145,68,119,139,252,85,110,88,131,161,21,143,60,70,54,52,
+183,220,151,117,177,189,105,44,82,238,1,194,200,112,23,61,233,30,51,19,146,
+127,26,205,210,209,132,194,224,228,172,103,32,127,121,187,10,233,227,68,189,
+179,243,29,145,101,94,28,103,245,174,90,202,239,67,233,178,134,221,47,121,91,
+179,51,51,145,73,82,24,54,177,27,198,7,112,41,226,5,63,242,208,254,85,203,202,
+207,111,158,230,107,182,203,128,123,30,42,220,50,16,118,224,50,183,98,50,42,
+71,211,225,144,130,100,124,15,64,5,78,145,199,8,249,23,159,83,201,171,104,194,
+149,57,169,59,236,70,119,46,89,219,131,234,113,81,60,234,169,184,16,125,5,67,
+118,249,148,228,228,14,42,139,190,79,21,106,23,34,182,59,217,183,24,196,178,
+93,139,239,39,38,174,67,42,184,0,112,125,43,32,72,195,189,57,110,10,156,255,
+0,42,29,54,115,81,198,168,202,236,218,197,53,136,65,201,2,168,45,251,99,25,
+31,141,65,44,237,33,203,28,212,168,59,234,118,84,199,194,215,137,106,226,236,
+17,181,15,212,213,25,36,168,218,78,106,50,119,16,7,122,213,64,242,107,98,101,
+55,118,107,105,114,188,81,72,202,112,100,59,115,220,138,186,135,215,243,170,
+80,174,220,47,69,81,138,176,102,142,20,243,37,39,104,35,56,235,90,197,28,181,
+42,123,186,189,16,251,143,16,217,104,246,141,14,145,110,62,210,227,247,147,
+55,99,92,213,205,245,221,226,153,39,149,152,158,167,61,107,86,123,123,123,178,
+178,8,62,207,2,243,201,203,61,101,222,92,36,164,164,74,22,52,224,1,85,77,69,
+108,181,62,125,90,228,54,205,254,145,31,212,87,125,110,128,219,167,210,188,
+254,220,226,100,39,179,10,244,27,70,15,110,132,122,86,120,158,132,85,37,17,
+229,128,21,36,210,139,84,199,89,15,65,74,100,88,35,50,55,94,194,179,203,180,
+140,210,57,249,143,233,92,169,95,86,115,238,83,150,105,140,172,76,135,57,162,
+162,149,255,0,122,223,90,43,162,195,177,8,162,150,138,234,61,27,133,45,2,156,
+6,104,25,98,202,194,123,249,196,48,33,98,125,186,87,82,62,28,220,79,98,30,68,
+5,136,234,43,127,225,220,86,162,16,66,101,251,146,59,215,163,18,2,240,185,30,
+149,171,130,75,83,62,123,179,230,13,83,78,212,252,63,51,192,198,68,136,182,
+120,232,106,138,235,23,81,30,118,48,247,92,127,42,250,31,196,222,31,181,213,
+44,100,243,34,7,143,74,240,29,87,69,123,93,82,75,88,148,190,15,203,88,36,155,
+179,70,240,196,85,167,240,73,164,91,176,189,93,65,138,168,219,38,50,83,63,202,
+175,8,202,142,69,118,222,6,240,52,118,139,21,228,200,26,82,57,39,181,116,90,
+255,0,128,237,181,21,51,88,21,182,185,199,221,254,7,62,254,159,133,69,74,29,
+98,123,88,60,217,43,70,183,222,121,70,113,77,39,154,181,169,233,247,122,85,
+211,91,222,64,209,74,59,30,132,122,131,220,85,28,241,205,114,180,123,176,173,
+25,171,197,148,239,163,227,120,227,214,179,207,90,212,188,35,203,193,234,107,
+45,186,214,144,189,143,47,24,146,169,116,52,154,74,67,65,32,86,137,28,109,136,
+78,41,11,10,99,49,52,220,213,88,201,204,86,106,72,219,18,167,212,80,65,97,128,
+62,148,67,111,35,204,14,211,181,72,44,125,5,59,18,228,111,46,0,201,170,151,
+26,140,48,228,21,87,199,64,121,230,179,174,245,54,147,41,22,85,58,103,185,172,
+242,249,234,114,107,69,14,231,6,34,191,63,187,29,139,239,170,52,206,124,204,
+224,213,103,93,185,101,232,106,185,32,212,145,200,0,218,221,42,185,82,216,227,
+219,96,70,25,226,187,205,14,79,54,209,73,60,1,92,3,161,141,183,47,221,174,203,
+73,184,75,93,8,57,63,59,14,5,101,94,60,203,66,106,124,37,235,171,159,58,98,
+1,249,87,129,76,47,242,226,179,132,252,231,214,172,52,187,98,46,79,65,92,252,
+166,54,51,231,151,247,207,207,122,43,2,227,83,38,225,241,235,69,116,251,22,
+87,35,58,154,40,28,210,213,157,128,43,83,68,130,25,181,40,82,111,187,158,149,
+152,43,83,70,231,83,128,99,57,106,168,252,72,153,187,35,220,244,155,11,107,
+59,40,252,152,208,18,185,36,10,177,117,57,139,1,70,77,71,165,41,91,8,193,24,
+226,159,120,66,198,91,112,171,168,236,74,216,165,123,59,61,163,168,224,145,
+92,101,167,130,154,231,84,123,215,114,119,31,194,186,88,238,62,213,113,229,
+51,119,173,248,32,88,80,5,172,225,27,251,204,187,43,106,50,206,209,109,109,
+214,48,58,10,179,69,21,169,38,118,173,163,88,235,86,134,222,250,21,145,63,132,
+255,0,18,159,80,123,87,146,248,151,193,55,218,19,180,208,111,186,178,61,36,
+3,230,79,247,128,254,125,43,218,143,78,180,132,6,83,158,245,149,90,74,126,167,
+86,27,23,82,131,247,94,157,143,153,174,65,40,14,58,117,172,231,28,215,188,235,
+127,14,244,189,80,60,182,185,178,184,110,114,131,40,79,186,255,0,134,43,130,
+212,126,20,107,176,185,54,175,107,114,189,182,190,211,249,31,241,174,117,78,
+80,209,163,208,169,141,167,87,93,153,231,164,102,152,202,122,86,182,179,161,
+106,58,4,233,14,163,111,228,187,141,202,55,171,100,126,6,179,48,198,171,67,
+39,85,119,33,34,128,191,151,189,74,87,3,181,58,120,33,54,72,237,39,239,11,31,
+144,122,83,49,158,34,43,96,88,72,80,216,224,244,173,69,149,45,52,75,153,8,27,
+157,118,47,212,241,89,22,207,42,204,14,11,6,224,175,173,91,213,242,241,199,
+12,92,197,31,39,220,208,183,57,103,86,83,71,62,115,77,53,96,167,181,38,192,
+123,86,230,5,108,210,110,230,172,152,133,70,208,30,213,64,9,41,28,30,69,92,
+91,185,12,104,163,238,47,106,206,42,202,121,205,73,20,166,54,207,111,74,78,
+55,21,141,200,174,150,80,48,112,106,206,167,63,149,166,146,15,36,86,48,1,128,
+146,35,131,82,221,78,211,90,133,97,210,178,81,87,34,200,195,57,201,226,138,
+156,168,207,74,43,163,152,179,181,136,102,158,84,3,69,21,206,139,128,211,233,
+91,30,28,109,186,146,62,1,42,120,162,138,210,31,18,21,77,143,112,179,152,141,
+61,27,28,226,177,53,77,70,111,153,70,0,233,69,20,85,220,112,23,71,211,210,89,
+124,231,145,139,30,107,168,94,128,81,69,92,62,18,230,58,144,154,40,161,146,
+128,28,230,171,220,239,243,35,218,229,70,121,3,189,20,82,150,195,142,229,158,
+212,140,120,205,20,81,63,133,146,183,60,79,227,0,255,0,138,134,204,103,143,
+179,255,0,90,243,179,194,230,138,43,145,238,105,208,111,94,42,72,109,214,73,
+70,79,83,138,40,166,246,51,123,157,53,230,129,5,174,151,231,71,35,121,152,201,
+108,117,246,174,96,74,197,182,158,69,20,82,134,193,6,65,52,107,156,129,138,
+171,69,21,188,118,9,139,142,105,202,57,162,138,162,5,101,82,57,81,82,88,197,
+27,93,0,200,8,244,162,138,153,252,44,79,98,214,170,86,29,190,90,42,231,210,
+144,5,125,60,177,81,156,81,69,103,31,133,25,173,142,125,152,6,60,126,180,81,
+69,110,106,127,255,217};
+
+static void cb_Load(Fl_Button*, void*) {
+  static char *name=0;
+  name = fl_file_chooser("Choose in image", "", name);
+  char s[256];
+  sprintf(s, "%s%s", name[0]=='/'? "":"../", name);
+  static Fl_Shared_Image* im;
+  if (im && im!=(Fl_Shared_Image*)&nosuch_bitmap) im->remove();
+  im = Fl_Shared_Image::guess(s)->get(s);
+  image_box->image(im);
+  int w, h;
+  im->measure(w, h);
+  image_window->size(w, h);
+  image_window->show();
+}
+
+Fl_Window* browser_window;
+
+Fl_Browser* browser;
+
+Fl_Window* image_window;
+
+Fl_Box* image_box;
+
+int main (int argc, char **argv) {
+
+  Fl_Window* w;
+  Fl_Shared_Image::set_root_directory("images");
+   {Fl_Window* o = window = new Fl_Window(660, 405, "The background is a BMP file");
+    o->image(Fl_BMP_Image::get("ulon.bmp"));
+    o->box(FL_NO_BOX);
+    o->align(32);
+     {Fl_Box* o = new Fl_Box(23, 158, 352, 197, "tiled GIF image loaded from disk");
+      o->image(Fl_GIF_Image::get("coucou.gif"));
+      o->label_font(fl_fonts+1);
+      o->label_type(FL_SHADOW_LABEL);
+      o->label_color((Fl_Color)3);
+      o->align(32);
+    }
+     {Fl_Box* o = new Fl_Box(100, 23, 170, 102, "PNG image with datas included in code");
+      o->image(Fl_PNG_Image::get("coucou.png", datas_coucou));
+      o->label_font(fl_fonts+1);
+      o->label_type(FL_SHADOW_LABEL);
+      o->label_color((Fl_Color)3);
+      o->align(32);
+    }
+     {Fl_Box* o = new Fl_Box(408, 16, 134, 109, "XPM image loaded from disk");
+      o->image(Fl_XPM_Image::get("../porsche.xpm"));
+      o->label_font(fl_fonts+1);
+      o->label_type(FL_SHADOW_LABEL);
+      o->label_color((Fl_Color)3);
+      o->deactivate();
+    }
+     {Fl_Value_Slider* o = slider = new Fl_Value_Slider(40, 368, 288, 22, "Size of the image cache in kilo pixels (0 for unlimited)");
+      o->label_font(fl_fonts+1);
+      o->label_type(FL_SHADOW_LABEL);
+      o->label_color((Fl_Color)3);
+      o->maximum(100);
+      o->step(1);
+      o->callback((Fl_Callback*)cb_slider);
+    }
+     {Fl_Box* o = new Fl_Box(395, 195, 230, 150, "JPEG image stored in the executable");
+      o->image(Fl_JPEG_Image::get("testimg.jpg", datas_testimg));
+      o->label_font(fl_fonts+1);
+      o->label_type(FL_SHADOW_LABEL);
+      o->label_color((Fl_Color)3);
+      o->align(32);
+    }
+     {Fl_Button* o = new Fl_Button(510, 15, 135, 30, "Load an image ...");
+      o->callback((Fl_Callback*)cb_Load);
+    }
+    o->end();
+    o->resizable(o);
+  }
+   {Fl_Window* o = browser_window = new Fl_Window(255, 150, "Image in the cache");
+     {Fl_Browser* o = browser = new Fl_Browser(0, 0, 255, 115); o->begin();
+      o->end();
+    }
+     {Fl_Box* o = new Fl_Box(0, 115, 165, 20, "Italic : out of the cache");
+      o->align(133|FL_ALIGN_INSIDE);
+    }
+     {Fl_Box* o = new Fl_Box(0, 130, 205, 20, "Grey : just loaded or unloaded");
+      o->align(FL_ALIGN_TOP | FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
+    }
+    o->end();
+  }
+   {Fl_Window* o = image_window = new Fl_Window(115, 100);
+    w = o;
+     {Fl_Box* o = image_box = new Fl_Box(0, 0, 115, 100);
+      o->align(FL_ALIGN_TOP | FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
+    }
+    o->end();
+  }
+  window->show();
+  w->show(argc, argv);
+  return  Fl::run();
+}

Added: branches/branch-3.0/test2/image_file.fl
===================================================================
--- branches/branch-3.0/test2/image_file.fl	                        (rev 0)
+++ branches/branch-3.0/test2/image_file.fl	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,84 @@
+# data file for the FLTK User Interface Designer (FLUID)
+version 2.0000 
+images_dir images 
+header_name {.h} 
+code_name {.cxx} 
+gridx 5 
+gridy 5 
+snap 3
+decl {\#include <stdio.h>} {} 
+
+decl {\#include <fltk/fl_file_chooser.h>} {} 
+
+Function {} {open private
+} {
+  code {Fl_Shared_Image::set_root_directory("images");} {}
+  Fl_Window window {
+    label {The background is a BMP file} open
+    xywh {179 404 660 405} align 536870944 resizable box NO_BOX image not_inlined {ulon.bmp} visible
+  } {
+    Fl_Box {} {
+      label {tiled GIF image loaded from disk}
+      xywh {23 158 352 197} align 32 labelfont 1 labeltype SHADOW_LABEL image not_inlined {coucou.gif} labelcolor 3
+    }
+    Fl_Box {} {
+      label {PNG image with datas included in code}
+      xywh {100 23 170 102} align 32 labelfont 1 labeltype SHADOW_LABEL image {coucou.png} labelcolor 3
+    }
+    Fl_Box {} {
+      label {XPM image loaded from disk}
+      xywh {408 16 134 109} deactivate labelfont 1 labeltype SHADOW_LABEL image not_inlined {../porsche.xpm} labelcolor 3
+    }
+    Fl_Value_Slider slider {
+      label {Size of the image cache in kilo pixels (0 for unlimited)}
+      callback {Fl_Shared_Image::set_cache_size((int)o->value()*1024);}
+      xywh {40 368 288 22} type {Horz Knob} labelfont 1 labeltype SHADOW_LABEL labelcolor 3 maximum 100 step 1
+    }
+    Fl_Box {} {
+      label {JPEG image stored in the executable}
+      xywh {395 195 230 150} align 32 labelfont 1 labeltype SHADOW_LABEL image {testimg.jpg} labelcolor 3
+    }
+    Fl_Button {} {
+      label {Load an image ...}
+      callback {static char *name=0;
+name = fl_file_chooser("Choose in image", "", name);
+char s[256];
+sprintf(s, "%s%s", name[0]=='/'? "":"../", name);
+static Fl_Shared_Image* im;
+if (im && im!=(Fl_Shared_Image*)&nosuch_bitmap) im->remove();
+im = Fl_Shared_Image::guess(s)->get(s);
+image_box->image(im);
+int w, h;
+im->measure(w, h);
+image_window->size(w, h);
+image_window->show();}
+      xywh {510 15 135 30}
+      code0 {\#include <fltk/Fl_Bitmap.h>}
+    }
+  }
+  Fl_Window browser_window {
+    label {Image in the cache} open
+    xywh {667 762 255 150} visible
+  } {
+    Fl_Browser browser {
+      xywh {0 0 255 115}
+    }
+    Fl_Box {} {
+      label {Italic : out of the cache}
+      xywh {0 115 165 20} align 149
+    }
+    Fl_Box {} {
+      label {Grey : just loaded or unloaded}
+      xywh {0 130 205 20} align 21
+    }
+  }
+  Fl_Window image_window {open
+    xywh {483 617 115 100} visible
+  } {
+    Fl_Box image_box {
+      xywh {0 0 115 100} align 21
+    }
+  }
+  code {window->show();} {selected
+  }
+} 

Added: branches/branch-3.0/test2/image_file.h
===================================================================
--- branches/branch-3.0/test2/image_file.h	                        (rev 0)
+++ branches/branch-3.0/test2/image_file.h	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,18 @@
+// generated by Fast Light User Interface Designer (fluid) version 2.0001
+
+#ifndef image_file_h
+#define image_file_h
+#include <fltk/Fl.h>
+#include <fltk/Fl_Window.h>
+extern Fl_Window* window;
+#include <fltk/Fl_Box.h>
+#include <fltk/Fl_Value_Slider.h>
+extern Fl_Value_Slider* slider;
+#include <fltk/Fl_Button.h>
+#include <fltk/Fl_Bitmap.h>
+extern Fl_Window* browser_window;
+#include <fltk/Fl_Browser.h>
+extern Fl_Browser* browser;
+extern Fl_Window* image_window;
+extern Fl_Box* image_box;
+#endif

Added: branches/branch-3.0/test2/image_transform.cxx
===================================================================
--- branches/branch-3.0/test2/image_transform.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/image_transform.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,134 @@
+// Test of drawimage() through a transform. Currently only the
+// XRender implementation works.
+
+#include <fltk/run.h>
+#include <fltk/Window.h>
+#include <fltk/ValueSlider.h>
+#include <fltk/draw.h>
+#include <fltk/RadioButton.h>
+#include <fltk/rgbImage.h>
+
+using namespace fltk;
+
+#define SLIDERS 9
+
+float xy[SLIDERS] = {
+  -64, -64, 0, 0, 1, 1, 0, 0, 0};
+const char* name[SLIDERS] = {
+  "X", "Y", "tx", "ty", "sx", "sy", "rotate", "fromxy", "toxy"};
+
+#define SIZE 129
+unsigned array[SIZE*SIZE];
+
+bool image = false;
+bool alpha = false;
+
+void fillimage() {
+  for (int y=0; y<SIZE; y++) for (int x=0; x<SIZE; x++) {
+    uchar r = x*255/SIZE;
+    uchar g = y*255/SIZE;
+    uchar b = 255-g;
+    uchar a = r > g ? r : g; if (b > a) a = b;
+    if (x%16==0 || y%16==0) {r = 255-r; g = 255-g; b = 255-b; a = 0xff;}
+    array[y*SIZE+x] = (a<<24)|(r<<16)|(g<<8)|b;
+  }
+}
+
+rgbImage* theimage;
+
+class Drawing : public Widget {
+  void draw() {
+    push_clip(0, 0, w(),h());
+    setcolor(GRAY20);
+    fillrect(0,0,w(),h());
+    setcolor(GRAY10);
+    fillrect(0,0,w()/2,h()/2);
+    fillrect(w()/2,h()/2,(w()+1)/2,(h()+1)/2);
+    push_matrix();
+    translate(w()/2+xy[2], h()/2+xy[3]);
+    scale(xy[4],xy[5]);
+    rotate(xy[6]);
+    if (::image) {
+      Rectangle r(xy[7],xy[7],SIZE-xy[7],SIZE-xy[7]);
+      Rectangle r1(xy[8]+xy[0],xy[8]+xy[1],SIZE-xy[8],SIZE-xy[8]);
+      ::theimage->draw(r,r1);
+    } else {
+      drawimage((uchar*)array,
+		alpha ? ARGB32 : RGB32,
+		fltk::Rectangle((int)xy[0], (int)xy[1], SIZE, SIZE));
+    }
+    setcolor(GRAY80);
+    addvertex(xy[0],xy[1]);
+    addvertex(xy[0],xy[1]+SIZE);
+    addvertex(xy[0]+SIZE,xy[1]+SIZE);
+    addvertex(xy[0]+SIZE,xy[1]);
+    closepath();
+    strokepath();
+    pop_matrix();
+    pop_clip();
+  }
+public:
+  Drawing(int X,int Y,int W,int H) : Widget(X,Y,W,H) {
+    fillimage();
+    ::theimage = new rgbImage((uchar*)array, ARGB32, SIZE, SIZE);
+  }
+};
+
+Drawing *d;
+
+void slider_cb(Widget* o, void* v) {
+  Slider* s = (Slider*)o;
+  xy[long(v)] = s->value();
+  d->redraw();
+}
+
+void noalpha_cb(Widget* o, void*) {
+  alpha = image = false;
+  d->redraw();
+}
+
+void alpha_cb(Widget* o, void*) {
+  
+  alpha = reinterpret_cast<Button*>(o)->value(); image = false;
+  d->redraw();
+}
+
+void image_cb(Widget* o, void*) {
+  image = true;
+  d->redraw();
+}
+
+int main(int argc, char** argv) {
+  Window window(300,555+50,"drawimage & transformations test");
+  window.begin();
+  Drawing drawing(10,10,280,280);
+  d = &drawing;
+
+  int y = 300;
+  for (int n = 0; n<SLIDERS; n++) {
+    ValueSlider* s = new ValueSlider(50,y,240,25,name[n]); y += 25;
+    s->type(Slider::TICK_ABOVE);
+    s->step(1);
+    if (n < 4) s->range(-200,200);
+    else if (n < 6) {s->range(-1,3); s->step(.01);}
+    else if (n < 7) s->range(-180, 180);
+    else {s->range(0,SIZE); s->tooltip("top-left corner of rectangle passed to Image::draw()");}
+    s->value(xy[n]);
+    s->align(ALIGN_LEFT);
+    s->callback(slider_cb, (void*)n);
+  }
+  RadioButton* b = new RadioButton(50,y,240,25,"RGB32 fltk::drawimage()"); y+= 25;
+  b->callback(noalpha_cb); b->set();
+  b = new RadioButton(50,y,240,25,"ARGB32 fltk::drawimage()"); y+= 25;
+  b->callback(alpha_cb);
+  b = new RadioButton(50,y,240,25,"ARGB32 fltk::Image object"); y+= 25;
+  b->callback(image_cb);
+
+  window.end();
+  window.show(argc,argv);
+  return run();
+}
+
+//
+// End of "$Id: image_transform.cxx 1464 2006-12-28 21:37:21Z spitzak $".
+//

Added: branches/branch-3.0/test2/images/bg.jpeg
===================================================================
(Binary files differ)


Property changes on: branches/branch-3.0/test2/images/bg.jpeg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/branch-3.0/test2/images/bg2.jpeg
===================================================================
(Binary files differ)


Property changes on: branches/branch-3.0/test2/images/bg2.jpeg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/branch-3.0/test2/images/coucou.gif
===================================================================
(Binary files differ)


Property changes on: branches/branch-3.0/test2/images/coucou.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/branch-3.0/test2/images/coucou.png
===================================================================
(Binary files differ)


Property changes on: branches/branch-3.0/test2/images/coucou.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/branch-3.0/test2/images/coucou.xpm
===================================================================
--- branches/branch-3.0/test2/images/coucou.xpm	                        (rev 0)
+++ branches/branch-3.0/test2/images/coucou.xpm	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,81 @@
+/* XPM */
+static char *essai[] = {
+/* width height num_colors chars_per_pixel */
+"    48    48       26            1",
+/* colors */
+". c #ffcc00",
+"# c #ff9900",
+"a c #ff6600",
+"b c #ff3300",
+"c c #ff0000",
+"d c #cccc00",
+"e c #cc9966",
+"f c #cc9933",
+"g c #cc9900",
+"h c #cc6666",
+"i c #cc6633",
+"j c #cc6600",
+"k c #cc3333",
+"l c #cc3300",
+"m c #cc0000",
+"n c #996666",
+"o c #996633",
+"p c #996600",
+"q c #993366",
+"r c #993333",
+"s c #993300",
+"t c #990000",
+"u c #663300",
+"v c #660000",
+"w c #330000",
+"x c #000000",
+/* pixels */
+"ihhihhihhihhihhihhihhihhihhihhihhihhihhihhihhihi",
+"iohhiehiehiehiehiehiehiehiehiehiehiehiehiehiehho",
+"hoihnihhihhihhohhinhihnihhohhihhihhihhihhihhioor",
+"ihohihfnhfheiehiehieihfhiehiehfheiehfheiehfhhiro",
+"oiohstmllmtttjlsvvvtljdgjtvvttttvvwwwvllvtjhorro",
+"nhiitvttmmmmlbjvwvvla..asvwvtttwwwwxxwbbttajoror",
+"iohotvvvtmlbaaaltll#..#lvwvvttvwxxwxwwmblmaaroro",
+"inihtvwwwtmla##aa#a###atvwttvvwwxxwxxxvmbcaarkor",
+"ihoimvwwwwvtl##aaalbbllvvvtvvwxwxwxwxwwmbbaaoror",
+"ohinmvwxxxwvsaalltttlmvvvtvwwwwwxxxwxwwtmb#aoror",
+"iniitvwwxxwwmaalmtvvtttvvvwwxxwwxwxwwwvttl##riro",
+"ohohvvwwwwvvla#blmttttttvwxxwxwwxxxxwvvvwtaaoror",
+"inihvtvtvvtmb###aajbltvvwwxxxwxxxwxwwvvwwvaaroro",
+"ihoittmmllla#..#aaa#amvwwxxxxwwxxxwwvvwwwvjaokor",
+"oiholclaaa##...alla##altwwxxxwxxxxwwvwwxxvaarror",
+"inihlba#..#...#lmttj##ajvwxxwwwxwwwvvwxxwvjaoror",
+"ihoij#####.##lltvvtl#..#lvvvvvvvsslltvvvvlaaroko",
+"iohhg##ala.#amtttvtl#..#ajllllljbaaajlllla##oror",
+"hoio#almma##bmttlmla###..#jbaa###llbbjbjba##roro",
+"ihohgammmj##bccmlaa###a..alutsa#alvtststsla#iror",
+"ohinlbcba##acbcba##aaaa#.jvwwvl#altvvvvwwtjaroro",
+"iohittla##almbcbbabababa#jvxxwmaaastvwvwwvaarkor",
+"hiohvtl##ammbbmmcbbbllmlalvxxvmba#blmtvwwvajoror",
+"ninitmj#almmbbcmlbabmttmajvxxwtmb##abltwwvaaroro",
+"iihola#almmlabbbbaamttsbalvxxvtmb##blbbvwtaarokr",
+"ohohg#abmmmbbcbbbllttmb##jvxxwtla#lttbbtvtaaroro",
+"iningbltmbcbbbcbtvwvmbbaajvwxwta#bmvvcactmaaoror",
+"hiiijltmlbbcccmctwwvmcmmaatwxwlaabvvvl#bcb#aroro",
+"ohnigabbbbbcbccmtwvtlbmlb#ltvtl#amvwvb#bmmb#rirr",
+"inihj##bcbbmcbmttvvtmbbba##aalb##btvtlabttcaroro",
+"iinima#aabbmcmtvvttvtttlljaa#.####bbcaaltvmcoror",
+"niohla#..aabltvvvvvvwwwwvvmlballja#bmbbmvvlcokro",
+"ihohja##..#amtvvvvwxwxxxwvtmmcmttb#lmmcmvvalroro",
+"iohilmba#.##ablmtwwxxxxxwtcmttmttc#ablbbmmaboror",
+"hoinmba##ajbj#alswxxxxxwvmmvvvmbcmlaa#a#aa#aorir",
+"hohitbaaaltvtlabvwxxxxxvtmtwwvtblvvtbaaaaaa#orro",
+"iinitcbaamwwwsjbsvwxxwvtctvxxwsbmwxvlbmmlmtboror",
+"ininmbbaalwwwtjamtvvwvtctwwxxxvlbvwvmmvvmmtmroro",
+"ihoilabbbtvvtlabmtttmmctvwxxxxvmbtwvcmvwtcbmorko",
+"inihjammbmtmmbblvvvtmmtwxxxxxxxtblvwmmvxwmacoror",
+"ihohjbsmbblcmmcmvxwvvvwwxwwwxwwvlbvwtmvwwtaaroro",
+"iniigammbablmmmltvvvtvvvvvvvvvvtbatwtcmvvtbairor",
+"iohn.##a#.#aabaaajajaaalaaaaaaaa##mttmcbmbbbroro",
+"niiohd####.#aaaaaabjalaalajajjaja##mtvmcbmcarkor",
+"iniqrrrrrrrrrrrrorrrrrrrrsrrrrrrrrrrorrrrrosroro",
+"hoiprprsrprprprsrsosrprsrrsrsrsrsosrsrsosrrsrsor",
+"iorrrrrorrrrrrrorsrrrsrosorsorprrsrosorsrprorrso",
+"irsrprsrsosrprsrrsosorsrrsrrsrrsorsrrsorrrsrprrr"
+};

Added: branches/branch-3.0/test2/images/testimg.jpg
===================================================================
(Binary files differ)


Property changes on: branches/branch-3.0/test2/images/testimg.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/branch-3.0/test2/images/ulon.bmp
===================================================================
(Binary files differ)


Property changes on: branches/branch-3.0/test2/images/ulon.bmp
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:mime-type
   + application/octet-stream

Added: branches/branch-3.0/test2/inactive.cxx
===================================================================
--- branches/branch-3.0/test2/inactive.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/inactive.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,114 @@
+// generated by Fast Light User Interface Designer (fluid) version 2.0002
+
+#include "inactive.h"
+
+fltk::Group* the_group;
+
+static void cb_active(fltk::Button*, void*) {
+  the_group->activate();
+}
+
+static void cb_inactive(fltk::Button*, void*) {
+  the_group->deactivate();
+}
+
+#include <fltk/run.h>
+
+int main (int argc, char **argv) {
+
+  fltk::Window* w;
+   {fltk::Window* o = new fltk::Window(395, 274);
+    w = o;
+    o->begin();
+     {fltk::Group* o = the_group = new fltk::Group(5, 6, 384, 233, "activate()/deactivate() called on this Fl_Group");
+      o->box(fltk::ENGRAVED_BOX);
+      o->align(fltk::ALIGN_TOP|fltk::ALIGN_INSIDE);
+      o->begin();
+      new fltk::Button(25, 27, 105, 21, "button");
+       {fltk::Group* o = new fltk::Group(25, 74, 105, 102, "Child group");
+        o->begin();
+         {fltk::CheckButton* o = new fltk::CheckButton(0, 0, 105, 25, "red");
+          o->type(fltk::CheckButton::RADIO);
+          o->selection_color((fltk::Color)1);
+          o->selection_textcolor((fltk::Color)1);
+          o->labelcolor((fltk::Color)1);
+          o->highlight_textcolor((fltk::Color)1);
+        }
+         {fltk::CheckButton* o = new fltk::CheckButton(0, 25, 105, 25, "green");
+          o->type(fltk::CheckButton::RADIO);
+          o->selection_color((fltk::Color)2);
+          o->selection_textcolor((fltk::Color)2);
+          o->labelcolor((fltk::Color)2);
+          o->highlight_textcolor((fltk::Color)2);
+        }
+         {fltk::CheckButton* o = new fltk::CheckButton(0, 50, 105, 25, "blue");
+          o->type(fltk::CheckButton::RADIO);
+          o->selection_color((fltk::Color)4);
+          o->selection_textcolor((fltk::Color)4);
+          o->labelcolor((fltk::Color)4);
+          o->highlight_textcolor((fltk::Color)4);
+        }
+         {fltk::CheckButton* o = new fltk::CheckButton(0, 75, 105, 25, "white");
+          o->type(fltk::CheckButton::RADIO);
+          o->selection_color((fltk::Color)7);
+          o->selection_textcolor((fltk::Color)55);
+          o->labelcolor((fltk::Color)7);
+          o->highlight_textcolor((fltk::Color)55);
+        }
+        o->end();
+      }
+       {fltk::Slider* o = new fltk::Slider(140, 25, 24, 146, "Fl_Slider");
+        o->set_vertical();
+        o->value(0.5);
+      }
+       {fltk::Input* o = new fltk::Input(170, 27, 195, 21);
+        o->static_value("Fl_Input");
+      }
+       {fltk::InputBrowser* o = new fltk::InputBrowser(255, 59, 110, 21, "input browser");
+        o->begin();
+         {fltk::Item* o = new fltk::Item("Moe");
+          o->set_vertical();
+        }
+         {fltk::Item* o = new fltk::Item("Larry");
+          o->set_vertical();
+        }
+         {fltk::Item* o = new fltk::Item("Curly");
+          o->set_vertical();
+        }
+        o->end();
+        o->text("Shemp");
+      }
+       {fltk::Widget* o = new fltk::Widget(215, 134, 145, 86, "Fl_Box");
+        o->box(fltk::ENGRAVED_BOX);
+        o->labelfont(fltk::HELVETICA_BOLD_ITALIC);
+        o->labeltype(fltk::SHADOW_LABEL);
+        o->labelsize(38);
+      }
+       {fltk::ValueInput* o = new fltk::ValueInput(230, 91, 135, 32, "value:");
+        o->textfont(fltk::COURIER_BOLD);
+        o->textcolor((fltk::Color)4);
+        o->textsize(24);
+        o->maximum(10000);
+        o->step(1);
+        o->tooltip("This Fl_Value_Output widget has a tooltip.");
+      }
+       {fltk::Scrollbar* o = new fltk::Scrollbar(15, 191, 180, 19, "scrollbar");
+        o->maximum(100);
+      }
+      o->end();
+      fltk::Group::current()->resizable(o);
+    }
+     {fltk::Button* o = new fltk::Button(5, 244, 190, 25, "active");
+      o->type(fltk::Button::RADIO);
+      o->set();
+      o->callback((fltk::Callback*)cb_active);
+    }
+     {fltk::Button* o = new fltk::Button(205, 244, 184, 25, "inactive");
+      o->type(fltk::Button::RADIO);
+      o->callback((fltk::Callback*)cb_inactive);
+    }
+    o->end();
+  }
+  w->show(argc, argv);
+  return  fltk::run();
+}

Added: branches/branch-3.0/test2/inactive.h
===================================================================
--- branches/branch-3.0/test2/inactive.h	                        (rev 0)
+++ branches/branch-3.0/test2/inactive.h	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,17 @@
+// generated by Fast Light User Interface Designer (fluid) version 2.0002
+
+#ifndef inactive_h
+#define inactive_h
+#include <fltk/Window.h>
+#include <fltk/Group.h>
+extern fltk::Group* the_group;
+#include <fltk/Button.h>
+#include <fltk/CheckButton.h>
+#include <fltk/Slider.h>
+#include <fltk/Input.h>
+#include <fltk/InputBrowser.h>
+#include <fltk/Item.h>
+#include <fltk/Widget.h>
+#include <fltk/ValueInput.h>
+#include <fltk/Scrollbar.h>
+#endif

Added: branches/branch-3.0/test2/input.cxx
===================================================================
--- branches/branch-3.0/test2/input.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/input.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,167 @@
+//
+// "$Id: input.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $"
+//
+// Input field test program for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2006 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+//    http://www.fltk.org/str.php
+//
+
+#include <fltk/run.h>
+#include <fltk/Window.h>
+#include <fltk/Input.h>
+#include <fltk/FloatInput.h>
+#include <fltk/IntInput.h>
+#include <fltk/SecretInput.h>
+#include <fltk/WordwrapInput.h>
+#include <fltk/TextEditor.h>
+#include <fltk/Button.h>
+#include <fltk/ToggleButton.h>
+#include <fltk/show_colormap.h>
+#include <stdio.h>
+using namespace fltk;
+
+void cb(Widget *ob) {
+  printf("Callback for %s '%s'\n",ob->label(),((Input*)ob)->text());
+}
+
+void editor_cb(Widget *ob) {
+  printf("Callback for %s '%s'\n",ob->label(),((TextEditor*)ob)->text());
+}
+
+int when = 0;
+Input *input[5];
+TextEditor* editor;
+
+void toggle_cb(Widget *o, long v) {
+  if (((ToggleButton*)o)->value()) when |= v; else when &= ~v;
+  for (int i=0; i<5; i++) input[i]->when(when);
+  editor->when(when);
+}
+
+void test(Input *i) {
+  if (i->changed()) {
+    i->clear_changed();
+    printf("%s '%s'\n",i->label(),i->text());
+  }
+}
+
+void button_cb(Widget *,void *) {
+  for (int i=0; i<5; i++) test(input[i]);
+  if (editor->changed()) {
+    editor->clear_changed();
+    printf("%s '%s'\n",editor->label(),editor->text());
+  }
+}
+
+void color_cb(Widget* button, void* v) {
+  Style& s = *Input::default_style;
+  Color c;
+  
+  switch ((long)v) {
+    case 0: c = s.color_; break;
+    case 1: c = s.selection_color_; break;
+    default: c = s.textcolor_; break;
+  }
+  c = show_colormap(c);
+  switch ((long)v) {
+    case 0: s.color_ = c; break;
+    case 1: s.selection_color_ = c; break;
+    default: s.textcolor_ = c; break;
+  }
+  //s.selection_textcolor = contrast(s.textcolor, s.selection_color);
+  button->color(c);
+  button->labelcolor(contrast(BLACK,(Color)c));
+  fltk::redraw();
+}
+
+int main(int argc, char **argv) {
+  Window *window = new Window(400,350+105);
+  //window->clear_double_buffer();
+
+  window->begin();
+  int y = 10;
+  input[0] = new Input(70,y,300,23,"Normal"); y += 27;
+  input[0]->tooltip("Normal input field");
+  // input[0]->cursor_color(SELECTION_COLOR);
+  //  input[0]->maximum_size(20);
+  input[0]->static_text("this is the initial text");
+  input[1] = new FloatInput(70,y,300,23,"Float"); y += 27;
+  input[1]->tooltip("Input field for floating-point number");
+  input[2] = new IntInput(70,y,300,23,"Int"); y += 27;
+  input[2]->tooltip("Input field for integer number");
+  input[3] = new SecretInput(70,y,300,23,"Secret"); y += 27;
+  input[3]->tooltip("Input field for password");
+  input[4] = new WordwrapInput(70,y,300,100,"Wordwrap"); y += 105;
+  input[4]->tooltip("Input field for short multi-line text. Use TextEditor for anything more than a few lines!");
+
+  editor = new TextEditor(70,y,300,100,"TextEditor"); y += 105;
+  editor->tooltip("TextEditor, designed for editing email and programs. "
+		  "wrap_mode(true) has been done to this one.");
+  editor->wrap_mode(true);
+  window->resizable(editor);
+
+  for (int i = 0; i < 5; i++) {
+    input[i]->when(0); input[i]->callback(cb);
+  }
+  int y1 = y;
+  editor->when(0);
+  editor->callback(editor_cb);
+
+  Button *b;
+  b = new ToggleButton(10,y,200,23,"WHEN_&CHANGED");
+  b->tooltip("Do callback each time the text changes");
+  b->callback(toggle_cb, WHEN_CHANGED); y += 23;
+  b = new ToggleButton(10,y,200,23,"WHEN_&RELEASE");
+  b->callback(toggle_cb, WHEN_RELEASE); y += 23;
+  b->tooltip("Do callback when widget loses focus");
+  b = new ToggleButton(10,y,200,23,"WHEN_&ENTER_KEY");
+  b->callback(toggle_cb, WHEN_ENTER_KEY); y += 23;
+  b->tooltip("Do callback when user hits Enter key");
+  b = new ToggleButton(10,y,200,23,"WHEN_&NOT_CHANGED");
+  b->callback(toggle_cb, WHEN_NOT_CHANGED); y += 23;
+  b->tooltip("Do callback even if the text is not changed");
+  y += 5;
+  b = new Button(10,y,200,23,"&print changed()");
+  b->callback(button_cb);
+  b->tooltip("Print widgets that have changed() flag set");
+
+  b = new Button(220,y1,100,23,"color"); y1 += 23;
+  b->color(input[0]->color()); b->callback(color_cb, (void*)0);
+  b->labelcolor(contrast(BLACK,b->color()));
+  b->tooltip("Color behind the text");
+  b = new Button(220,y1,100,23,"selection_color"); y1 += 23;
+  b->color(input[0]->selection_color()); b->callback(color_cb, (void*)1);
+  b->labelcolor(contrast(BLACK,b->color()));
+  b->tooltip("Color behind selected text");
+  b = new Button(220,y1,100,23,"textcolor"); y1 += 23;
+  b->color(input[0]->textcolor()); b->callback(color_cb, (void*)2);
+  b->labelcolor(contrast(BLACK,b->color()));
+  b->tooltip("Color of the text");
+
+  window->end();
+  window->show(argc,argv);
+  return run();
+}
+
+//
+// End of "$Id: input.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $".
+//

Added: branches/branch-3.0/test2/jpeg_image.cxx
===================================================================
--- branches/branch-3.0/test2/jpeg_image.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/jpeg_image.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,204 @@
+//
+// "$Id: jpeg_image.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $"
+//
+// fl_draw_image test program for the Fast Light Tool Kit (FLTK).
+//
+// Be sure to try every visual with the -v switch and try -m (monochrome)
+// on each of them.
+//
+// This program requires either the libjpeg.a library or an internal DD
+// library to read images (this is chosen by the presence of the "DD"
+// #define).
+//
+// To get the jpeg library:
+//
+// The "official" archive site for this software is ftp.uu.net (Internet
+// address 192.48.96.9).  The most recent released version can always be
+// found there in directory graphics/jpeg.  This particular version will
+// be archived as graphics/jpeg/jpegsrc.v6a.tar.gz.
+//
+// The makefile assummes you decompressed and build these in a directory
+// called "jpeg-6a" in the same location as the "FL" directory.
+//
+// Copyright 1998-2006 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+//    http://www.fltk.org/str.php
+//
+
+#include <fltk/Fl.h>
+#include <fltk/fl_draw.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+void readtheimage(const char *name); // below
+int width;
+int height;
+int depth;
+int linedelta;
+uchar *ibuffer;
+
+////////////////////////////////////////////////////////////////
+
+#include <fltk/Fl_Window.h>
+int mono;
+
+class image_window : public Fl_Window {
+  void draw();
+public:
+  image_window(int w,int h) : Fl_Window(w,h) {box(FL_NO_BOX);}
+};
+
+void image_window::draw() {
+  if (mono)
+    fl_draw_image_mono(ibuffer+1,0,0,::width,::height,depth,linedelta);
+  else
+    fl_draw_image(ibuffer,0,0,::width,::height,depth,linedelta);
+}
+
+////////////////////////////////////////////////////////////////
+
+#include <fltk/x.h>
+#include "list_visuals.cxx"
+
+////////////////////////////////////////////////////////////////
+
+int visid = -1;
+int arg(int argc, char **argv, int &i) {
+  if (argv[i][1] == 'm') {mono = 1; i++; return 1;}
+
+  if (argv[i][1] == 'v') {
+    if (i+1 >= argc) return 0;
+    visid = atoi(argv[i+1]);
+    i += 2;
+    return 2;
+  }
+
+  return 0;
+}
+
+int main(int argc, char ** argv) {
+
+  int i = 1;
+  if (!Fl::args(argc,argv,i,arg) || i != argc-1) {
+    fprintf(stderr,"usage: %s <switches> image_file\n"
+" -v # : use visual\n"
+" -m : monochrome\n"
+"%s\n",
+	    argv[0],Fl::help);
+    exit(1);
+  }
+
+  readtheimage(argv[i]);
+  image_window *window = new image_window(width,height);
+
+  if (visid>=0) {
+    fl_open_display();
+    XVisualInfo templt; int num;
+    templt.visualid = visid;
+    fl_visual = XGetVisualInfo(fl_display, VisualIDMask, &templt, &num);
+    if (!fl_visual) {
+      fprintf(stderr, "No visual with id %d, use one of:\n",visid);
+      list_visuals();
+      exit(1);
+    }
+    fl_colormap = XCreateColormap(fl_display, RootWindow(fl_display,fl_screen),
+				fl_visual->visual, AllocNone);
+    fl_xpixel(FL_BLACK); // make sure black is allocated
+  }
+
+  window->show(argc,argv);
+  return Fl::run();
+}
+
+////////////////////////////////////////////////////////////////
+#ifndef DD_LIBRARY
+// Read using jpeg library:
+
+extern "C" {
+#include "jpeglib.h"
+}
+
+void readtheimage(const char *name) {
+  struct jpeg_decompress_struct cinfo;
+  struct jpeg_error_mgr jerr;
+  FILE * infile = fopen(name, "rb");
+  if (!infile) {
+    fprintf(stderr, "can't open %s\n", name);
+    exit(1);
+  }
+  cinfo.err = jpeg_std_error(&jerr);
+  jpeg_create_decompress(&cinfo);
+  jpeg_stdio_src(&cinfo, infile);
+  jpeg_read_header(&cinfo, TRUE);
+  jpeg_start_decompress(&cinfo);
+  width = cinfo.output_width;
+  height = cinfo.output_height;
+  depth = cinfo.output_components;
+  ibuffer = new uchar[width*height*depth];
+  uchar *rp = ibuffer;
+  //  for (int i=0; i<height; i++) {
+  for (int i=height; i--; ) {
+    jpeg_read_scanlines(&cinfo, &rp, 1);
+    rp += width*depth;
+  }
+  jpeg_finish_decompress(&cinfo);
+  jpeg_destroy_decompress(&cinfo);
+  fclose(infile);
+}
+
+////////////////////////////////////////////////////////////////
+#else // Digital Domain in-house library
+
+#include "DDNewImage/DDImageOp.h"
+#include "DDNewImage/DDImgRead.h"
+#include "DDNewImage/DDImgToBuffer.h"
+
+void readtheimage(const char *name) {
+  DDImgRead reader(name);
+  width = reader.xsize();
+  height = reader.ysize();
+  depth = 4; // reader.zsize();
+  ibuffer = new uchar[width*height*depth];
+  DDImgToBuffer b(&reader,depth,ibuffer,0,0,width,height);
+  b.execute();
+  if (DDImage::haderror) {
+    fprintf(stderr,"%s\n",DDImage::errormsg());
+    exit(1);
+  }
+  // swap it around into RGBA order:
+  for (uchar *p = ibuffer+width*height*4-4; p >= ibuffer; p-=4) {
+    uchar r = p[3];
+    uchar g = p[2];
+    uchar b = p[1];
+    uchar a = p[0];
+    p[0] = r;
+    p[1] = g;
+    p[2] = b;
+    p[3] = a;
+  }
+  // make it bottom-to-top:
+  ibuffer = ibuffer + width*(height-1)*depth;
+  linedelta = -(width*depth);
+}
+#endif
+
+//
+// End of "$Id: jpeg_image.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $".
+//

Added: branches/branch-3.0/test2/keyboard.cxx
===================================================================
--- branches/branch-3.0/test2/keyboard.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/keyboard.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,152 @@
+//
+// "$Id: keyboard.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $"
+//
+// Keyboard/event test program for the Fast Light Tool Kit (FLTK).
+//
+// Continuously display FLTK's event state.
+//
+// Known bugs:
+//
+// X insists on reporting the state *before* the shift key was
+// pressed, rather than after, on shift key events.  I fixed this for
+// the mouse buttons, but it did not seem worth it for shift.
+//
+// X servers do not agree about any shift flags except shift, ctrl,
+// lock, and alt.  They may also not agree about the symbols for the extra
+// keys Micro$oft put on the keyboard.
+//
+// Windows has a number of keys that do not report that they are held down.
+// On IRIX the backslash key does not report it is held down.
+//
+// Copyright 2001 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+//    http://www.fltk.org/str.php
+//
+
+#include "keyboard_ui.cxx"
+#include <stdio.h>
+#include <ctype.h>
+#include <fltk/run.h>
+
+// these are used to identify which buttons are which:
+void key_cb(fltk::Button*, void*) {}
+void shift_cb(fltk::Button*, void*) {}
+
+static struct {int n; const char* text;} table[] = {
+  {fltk::EscapeKey, "fltk::EscapeKey"},
+  {fltk::BackSpaceKey, "fltk::BackSpaceKey"},
+  {fltk::TabKey, "fltk::TabKey"},
+  {fltk::ReturnKey, "fltk::ReturnKey"},
+  {fltk::PrintKey, "fltk::PrintKey"},
+  {fltk::ScrollLockKey, "fltk::ScrollLockKey"},
+  {fltk::PauseKey, "fltk::PauseKey"},
+  {fltk::InsertKey, "fltk::InsertKey"},
+  {fltk::HomeKey, "fltk::HomeKey"},
+  {fltk::PageUpKey, "fltk::PageUpKey"},
+  {fltk::DeleteKey, "fltk::DeleteKey"},
+  {fltk::EndKey, "fltk::EndKey"},
+  {fltk::PageDownKey, "fltk::PageDownKey"},
+  {fltk::LeftKey, "fltk::LeftKey"},
+  {fltk::UpKey, "fltk::UpKey"},
+  {fltk::RightKey, "fltk::RightKey"},
+  {fltk::DownKey, "fltk::DownKey"},
+  {fltk::LeftShiftKey, "fltk::LeftShiftKey"},
+  {fltk::RightShiftKey, "fltk::RightShiftKey"},
+  {fltk::LeftCtrlKey, "fltk::LeftCtrlKey"},
+  {fltk::RightCtrlKey, "fltk::RightCtrlKey"},
+  {fltk::CapsLockKey, "fltk::CapsLockKey"},
+  {fltk::LeftAltKey, "fltk::LeftAltKey"},
+  {fltk::RightAltKey, "fltk::RightAltKey"},
+  {fltk::LeftMetaKey, "fltk::LeftMetaKey"},
+  {fltk::RightMetaKey, "fltk::RightMetaKey"},
+  {fltk::MenuKey, "fltk::MenuKey"},
+  {fltk::NumLockKey, "fltk::NumLockKey"},
+  {fltk::KeypadEnter, "fltk::KeypadEnter"},
+  {fltk::MultiplyKey, "fltk::MultiplyKey"},
+  {fltk::AddKey, "fltk::AddKey"},
+  {fltk::SubtractKey, "fltk::SubtractKey"},
+  {fltk::DecimalKey, "fltk::DecimalKey"},
+  {fltk::DivideKey, "fltk::DivideKey"},
+  {fltk::Keypad0, "fltk::Keypad0"},
+  {fltk::Keypad1, "fltk::Keypad1"},
+  {fltk::Keypad2, "fltk::Keypad2"},
+  {fltk::Keypad3, "fltk::Keypad3"},
+  {fltk::Keypad4, "fltk::Keypad4"},
+  {fltk::Keypad5, "fltk::Keypad5"},
+  {fltk::Keypad6, "fltk::Keypad6"},
+  {fltk::Keypad7, "fltk::Keypad7"},
+  {fltk::Keypad8, "fltk::Keypad8"},
+  {fltk::Keypad9, "fltk::Keypad9"},
+  {fltk::SpaceKey,"fltk::SpaceKey (' ')"}
+};
+
+int main(int argc, char** argv) {
+  fltk::Window *window = make_window();
+  window->show(argc,argv);
+  for (;;) {
+    fltk::wait();
+    if (!window->visible()) break;
+
+    // update all the buttons with the current key and shift state:
+    for (int i = 0; i < window->children(); i++) {
+      fltk::Widget* b = window->child(i);
+      if (b->callback() == (fltk::Callback*)key_cb) {
+	unsigned i = (unsigned)b->argument();
+	if (!i) i = tolower(b->label()[0]);
+	((fltk::Button*)b)->value(fltk::event_key_state(i));
+	if (i == fltk::event_key()) ((fltk::Button*)b)->take_focus();
+      } else if (b->callback() == (fltk::Callback*)shift_cb) {
+	unsigned i = (unsigned)b->argument();
+	((fltk::Button*)b)->value(fltk::event_state(i));
+      }
+    }
+
+    // figure out the keyname:
+    char buffer[100];
+    const char *keyname = buffer;
+    int k = fltk::event_key();
+    if (!k) {
+      keyname = "0";
+    } else if (k <= 7) {
+      sprintf(buffer, "(mouse button %d)", k);
+    } else if (k < 256 && k != 32) {
+      sprintf(buffer, "'%c'", k);
+    } else if (k >= fltk::F0Key && k <= fltk::LastFunctionKey) {
+      sprintf(buffer, "fltk::F%dKey", k - fltk::F0Key);
+    } else {
+      sprintf(buffer, "0x%04x", k);
+      for (int i = 0; i < int(sizeof(table)/sizeof(*table)); i++)
+	if (table[i].n == k) {keyname = table[i].text; break;}
+    }
+    key_output->value(keyname);
+
+    if (fltk::event_text()[0] == 32)
+      text_output->value("\" \"");
+    else if (fltk::event_text()[0])
+      text_output->value(fltk::event_text());
+    else
+      text_output->value("\"\"");
+  }
+  return 0;
+}
+
+//
+// End of "$Id: keyboard.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $".
+//

Added: branches/branch-3.0/test2/keyboard_ui.cxx
===================================================================
--- branches/branch-3.0/test2/keyboard_ui.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/keyboard_ui.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,544 @@
+// generated by Fast Light User Interface Designer (fluid) version 2.1000
+
+#include "keyboard_ui.h"
+#include <fltk/events.h>
+
+fltk::Output *key_output=(fltk::Output *)0;
+
+fltk::Output *text_output=(fltk::Output *)0;
+
+fltk::Window* make_window() {
+  fltk::Window* w;
+   {fltk::Window* o = new fltk::Window(490, 190);
+    w = o;
+    o->shortcut(0xff1b);
+    o->begin();
+     {fltk::Output* o = key_output = new fltk::Output(15, 15, 170, 30, "fltk::event_key():");
+      o->textfont(fltk::COURIER);
+      o->labelsize(10);
+      o->align(fltk::ALIGN_TOP|fltk::ALIGN_LEFT);
+    }
+     {fltk::Output* o = text_output = new fltk::Output(195, 15, 190, 30, "fltk::event_text():");
+      o->textfont(fltk::COURIER);
+      o->labelsize(10);
+      o->align(fltk::ALIGN_TOP|fltk::ALIGN_LEFT);
+    }
+     {fltk::Button* o = new fltk::Button(15, 50, 20, 20, "Esc ");
+      o->labelsize(8);
+      o->callback((fltk::Callback*)key_cb, (void*)(fltk::EscapeKey));
+    }
+     {fltk::Button* o = new fltk::Button(50, 50, 20, 20, "F1");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb, (void*)(fltk::F1Key));
+    }
+     {fltk::Button* o = new fltk::Button(70, 50, 20, 20, "F2");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb, (void*)(fltk::F2Key));
+    }
+     {fltk::Button* o = new fltk::Button(90, 50, 20, 20, "F3");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb, (void*)(fltk::F3Key));
+    }
+     {fltk::Button* o = new fltk::Button(110, 50, 20, 20, "F4");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb, (void*)(fltk::F4Key));
+    }
+     {fltk::Button* o = new fltk::Button(140, 50, 20, 20, "F5");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb, (void*)(fltk::F5Key));
+    }
+     {fltk::Button* o = new fltk::Button(160, 50, 20, 20, "F6");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb, (void*)(fltk::F6Key));
+    }
+     {fltk::Button* o = new fltk::Button(180, 50, 20, 20, "F7");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb, (void*)(fltk::F7Key));
+    }
+     {fltk::Button* o = new fltk::Button(200, 50, 20, 20, "F8");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb, (void*)(fltk::F8Key));
+    }
+     {fltk::Button* o = new fltk::Button(230, 50, 20, 20, "F9");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb, (void*)(fltk::F9Key));
+    }
+     {fltk::Button* o = new fltk::Button(250, 50, 20, 20, "F10");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb, (void*)(fltk::F10Key));
+    }
+     {fltk::Button* o = new fltk::Button(270, 50, 20, 20, "F11");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb, (void*)(fltk::F11Key));
+    }
+     {fltk::Button* o = new fltk::Button(290, 50, 20, 20, "F12");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb, (void*)(fltk::F12Key));
+    }
+     {fltk::Button* o = new fltk::Button(325, 50, 20, 20, "Print ");
+      o->labelsize(8);
+      o->callback((fltk::Callback*)key_cb, (void*)(fltk::PrintKey));
+    }
+     {fltk::Button* o = new fltk::Button(345, 50, 20, 20, "Sclk ");
+      o->labelsize(8);
+      o->callback((fltk::Callback*)key_cb, (void*)(fltk::ScrollLockKey));
+    }
+     {fltk::Button* o = new fltk::Button(365, 50, 20, 20, "Paus ");
+      o->labelsize(8);
+      o->callback((fltk::Callback*)key_cb, (void*)(fltk::PauseKey));
+    }
+     {fltk::Button* o = new fltk::Button(15, 80, 20, 20, "`");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb);
+    }
+     {fltk::Button* o = new fltk::Button(35, 80, 20, 20, "1");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb);
+    }
+     {fltk::Button* o = new fltk::Button(55, 80, 20, 20, "2");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb);
+    }
+     {fltk::Button* o = new fltk::Button(75, 80, 20, 20, "3");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb);
+    }
+     {fltk::Button* o = new fltk::Button(95, 80, 20, 20, "4");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb);
+    }
+     {fltk::Button* o = new fltk::Button(115, 80, 20, 20, "5");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb);
+    }
+     {fltk::Button* o = new fltk::Button(135, 80, 20, 20, "6");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb);
+    }
+     {fltk::Button* o = new fltk::Button(155, 80, 20, 20, "7");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb);
+    }
+     {fltk::Button* o = new fltk::Button(175, 80, 20, 20, "8");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb);
+    }
+     {fltk::Button* o = new fltk::Button(195, 80, 20, 20, "9");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb);
+    }
+     {fltk::Button* o = new fltk::Button(215, 80, 20, 20, "0");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb);
+    }
+     {fltk::Button* o = new fltk::Button(235, 80, 20, 20, "-");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb);
+    }
+     {fltk::Button* o = new fltk::Button(255, 80, 20, 20, "=");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb);
+    }
+     {fltk::Button* o = new fltk::Button(275, 80, 35, 20, "Bksp");
+      o->labelsize(8);
+      o->callback((fltk::Callback*)key_cb, (void*)(fltk::BackSpaceKey));
+      o->align(fltk::ALIGN_LEFT|fltk::ALIGN_CENTER|fltk::ALIGN_INSIDE);
+    }
+     {fltk::Button* o = new fltk::Button(325, 80, 20, 20, "Ins ");
+      o->labelsize(8);
+      o->callback((fltk::Callback*)key_cb, (void*)(fltk::InsertKey));
+    }
+     {fltk::Button* o = new fltk::Button(345, 80, 20, 20, "Home");
+      o->labelsize(8);
+      o->callback((fltk::Callback*)key_cb, (void*)(fltk::HomeKey));
+    }
+     {fltk::Button* o = new fltk::Button(365, 80, 20, 20, "pgup ");
+      o->labelsize(8);
+      o->callback((fltk::Callback*)key_cb, (void*)(fltk::PageUpKey));
+    }
+     {fltk::Button* o = new fltk::Button(400, 80, 20, 20, "Num");
+      o->labelsize(8);
+      o->callback((fltk::Callback*)key_cb, (void*)(fltk::NumLockKey));
+    }
+     {fltk::Button* o = new fltk::Button(420, 80, 20, 20, "/");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb, (void*)(fltk::Keypad+'/'));
+    }
+     {fltk::Button* o = new fltk::Button(440, 80, 20, 20, "*");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb, (void*)(fltk::Keypad+'*'));
+    }
+     {fltk::Button* o = new fltk::Button(460, 80, 20, 20, "-");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb, (void*)(fltk::Keypad+'-'));
+    }
+     {fltk::Button* o = new fltk::Button(15, 100, 27, 20, "Tab");
+      o->labelsize(8);
+      o->callback((fltk::Callback*)key_cb, (void*)(fltk::TabKey));
+      o->align(fltk::ALIGN_LEFT|fltk::ALIGN_CENTER|fltk::ALIGN_INSIDE);
+    }
+     {fltk::Button* o = new fltk::Button(42, 100, 20, 20, "Q");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb);
+    }
+     {fltk::Button* o = new fltk::Button(62, 100, 20, 20, "W");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb);
+    }
+     {fltk::Button* o = new fltk::Button(82, 100, 20, 20, "E");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb);
+    }
+     {fltk::Button* o = new fltk::Button(102, 100, 20, 20, "R");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb);
+    }
+     {fltk::Button* o = new fltk::Button(122, 100, 20, 20, "T");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb);
+    }
+     {fltk::Button* o = new fltk::Button(142, 100, 20, 20, "Y");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb);
+    }
+     {fltk::Button* o = new fltk::Button(162, 100, 20, 20, "U");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb);
+    }
+     {fltk::Button* o = new fltk::Button(182, 100, 20, 20, "I");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb);
+    }
+     {fltk::Button* o = new fltk::Button(202, 100, 20, 20, "O");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb);
+    }
+     {fltk::Button* o = new fltk::Button(222, 100, 20, 20, "P");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb);
+    }
+     {fltk::Button* o = new fltk::Button(242, 100, 20, 20, "[");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb);
+    }
+     {fltk::Button* o = new fltk::Button(262, 100, 20, 20, "]");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb);
+    }
+     {fltk::Button* o = new fltk::Button(282, 100, 28, 20, "\\");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb);
+      o->align(fltk::ALIGN_LEFT|fltk::ALIGN_CENTER|fltk::ALIGN_INSIDE);
+    }
+     {fltk::Button* o = new fltk::Button(325, 100, 20, 20, "Del ");
+      o->labelsize(8);
+      o->callback((fltk::Callback*)key_cb, (void*)(fltk::DeleteKey));
+    }
+     {fltk::Button* o = new fltk::Button(345, 100, 20, 20, "End ");
+      o->labelsize(8);
+      o->callback((fltk::Callback*)key_cb, (void*)(fltk::EndKey));
+    }
+     {fltk::Button* o = new fltk::Button(365, 100, 20, 20, "pgdn ");
+      o->labelsize(8);
+      o->callback((fltk::Callback*)key_cb, (void*)(fltk::PageDownKey));
+    }
+     {fltk::Button* o = new fltk::Button(400, 100, 20, 20, "7");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb, (void*)(fltk::Keypad+'7'));
+    }
+     {fltk::Button* o = new fltk::Button(420, 100, 20, 20, "8");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb, (void*)(fltk::Keypad+'8'));
+    }
+     {fltk::Button* o = new fltk::Button(440, 100, 20, 20, "9");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb, (void*)(fltk::Keypad+'9'));
+    }
+     {fltk::Button* o = new fltk::Button(460, 100, 20, 40, "+");
+      o->set_vertical();
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb, (void*)(fltk::Keypad+'+'));
+      o->align(fltk::ALIGN_TOP|fltk::ALIGN_CENTER|fltk::ALIGN_INSIDE);
+    }
+     {fltk::Button* o = new fltk::Button(15, 120, 36, 20, "Lock");
+      o->labelsize(8);
+      o->callback((fltk::Callback*)key_cb, (void*)(fltk::CapsLockKey));
+      o->align(fltk::ALIGN_LEFT|fltk::ALIGN_CENTER|fltk::ALIGN_INSIDE);
+    }
+     {fltk::Button* o = new fltk::Button(51, 120, 20, 20, "A");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb);
+    }
+     {fltk::Button* o = new fltk::Button(71, 120, 20, 20, "S");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb);
+    }
+     {fltk::Button* o = new fltk::Button(91, 120, 20, 20, "D");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb);
+    }
+     {fltk::Button* o = new fltk::Button(111, 120, 20, 20, "F");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb);
+    }
+     {fltk::Button* o = new fltk::Button(131, 120, 20, 20, "G");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb);
+    }
+     {fltk::Button* o = new fltk::Button(151, 120, 20, 20, "H");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb);
+    }
+     {fltk::Button* o = new fltk::Button(171, 120, 20, 20, "J");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb);
+    }
+     {fltk::Button* o = new fltk::Button(191, 120, 20, 20, "K");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb);
+    }
+     {fltk::Button* o = new fltk::Button(211, 120, 20, 20, "L");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb);
+    }
+     {fltk::Button* o = new fltk::Button(231, 120, 20, 20, ";");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb);
+    }
+     {fltk::Button* o = new fltk::Button(251, 120, 20, 20, "'");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb);
+    }
+     {fltk::Button* o = new fltk::Button(271, 120, 39, 20, "Enter");
+      o->labelsize(8);
+      o->callback((fltk::Callback*)key_cb, (void*)(fltk::ReturnKey));
+      o->align(fltk::ALIGN_LEFT|fltk::ALIGN_CENTER|fltk::ALIGN_INSIDE);
+    }
+     {fltk::Button* o = new fltk::Button(400, 120, 20, 20, "4");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb, (void*)(fltk::Keypad+'4'));
+    }
+     {fltk::Button* o = new fltk::Button(420, 120, 20, 20, "5");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb, (void*)(fltk::Keypad+'5'));
+    }
+     {fltk::Button* o = new fltk::Button(440, 120, 20, 20, "6");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb, (void*)(fltk::Keypad+'6'));
+    }
+     {fltk::Button* o = new fltk::Button(15, 140, 45, 20, "Shift");
+      o->labelsize(8);
+      o->callback((fltk::Callback*)key_cb, (void*)(fltk::LeftShiftKey));
+      o->align(fltk::ALIGN_LEFT|fltk::ALIGN_CENTER|fltk::ALIGN_INSIDE);
+    }
+     {fltk::Button* o = new fltk::Button(60, 140, 20, 20, "Z");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb);
+    }
+     {fltk::Button* o = new fltk::Button(80, 140, 20, 20, "X");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb);
+    }
+     {fltk::Button* o = new fltk::Button(100, 140, 20, 20, "C");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb);
+    }
+     {fltk::Button* o = new fltk::Button(120, 140, 20, 20, "V");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb);
+    }
+     {fltk::Button* o = new fltk::Button(140, 140, 20, 20, "B");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb);
+    }
+     {fltk::Button* o = new fltk::Button(160, 140, 20, 20, "N");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb);
+    }
+     {fltk::Button* o = new fltk::Button(180, 140, 20, 20, "M");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb);
+    }
+     {fltk::Button* o = new fltk::Button(200, 140, 20, 20, ",");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb);
+    }
+     {fltk::Button* o = new fltk::Button(220, 140, 20, 20, ".");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb);
+    }
+     {fltk::Button* o = new fltk::Button(240, 140, 20, 20, "/");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb);
+    }
+     {fltk::Button* o = new fltk::Button(260, 140, 50, 20, "Shift");
+      o->labelsize(8);
+      o->callback((fltk::Callback*)key_cb, (void*)(fltk::RightShiftKey));
+      o->align(fltk::ALIGN_LEFT|fltk::ALIGN_CENTER|fltk::ALIGN_INSIDE);
+    }
+     {fltk::Button* o = new fltk::Button(345, 140, 20, 20, "@8->");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb, (void*)(fltk::UpKey));
+    }
+     {fltk::Button* o = new fltk::Button(400, 140, 20, 20, "1");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb, (void*)(fltk::Keypad+'1'));
+    }
+     {fltk::Button* o = new fltk::Button(420, 140, 20, 20, "2");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb, (void*)(fltk::Keypad+'2'));
+    }
+     {fltk::Button* o = new fltk::Button(440, 140, 20, 20, "3");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb, (void*)(fltk::Keypad+'3'));
+    }
+     {fltk::Button* o = new fltk::Button(460, 140, 20, 40);
+      o->set_vertical();
+      o->callback((fltk::Callback*)key_cb, (void*)(fltk::KeypadEnter));
+    }
+     {fltk::Button* o = new fltk::Button(15, 160, 30, 20, "Ctrl");
+      o->labelsize(8);
+      o->callback((fltk::Callback*)key_cb, (void*)(fltk::LeftCtrlKey));
+      o->align(fltk::ALIGN_LEFT|fltk::ALIGN_CENTER|fltk::ALIGN_INSIDE);
+    }
+     {fltk::Button* o = new fltk::Button(45, 160, 30, 20, "Meta");
+      o->labelsize(8);
+      o->callback((fltk::Callback*)key_cb, (void*)(fltk::LeftMetaKey));
+    }
+     {fltk::Button* o = new fltk::Button(75, 160, 30, 20, "Alt ");
+      o->labelsize(8);
+      o->callback((fltk::Callback*)key_cb, (void*)(fltk::LeftAltKey));
+    }
+     {fltk::Button* o = new fltk::Button(105, 160, 85, 20);
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb, (void*)(' '));
+    }
+     {fltk::Button* o = new fltk::Button(190, 160, 30, 20, "Alt ");
+      o->labelsize(8);
+      o->callback((fltk::Callback*)key_cb, (void*)(fltk::RightAltKey));
+    }
+     {fltk::Button* o = new fltk::Button(220, 160, 30, 20, "Meta");
+      o->labelsize(8);
+      o->callback((fltk::Callback*)key_cb, (void*)(fltk::RightMetaKey));
+    }
+     {fltk::Button* o = new fltk::Button(250, 160, 30, 20, "Menu ");
+      o->labelsize(8);
+      o->callback((fltk::Callback*)key_cb, (void*)(fltk::MenuKey));
+    }
+     {fltk::Button* o = new fltk::Button(280, 160, 30, 20, "Ctrl");
+      o->labelsize(8);
+      o->callback((fltk::Callback*)key_cb, (void*)(fltk::RightCtrlKey));
+      o->align(fltk::ALIGN_LEFT|fltk::ALIGN_CENTER|fltk::ALIGN_INSIDE);
+    }
+     {fltk::Button* o = new fltk::Button(325, 160, 20, 20, "@4->");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb, (void*)(fltk::LeftKey));
+    }
+     {fltk::Button* o = new fltk::Button(345, 160, 20, 20, "@2->");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb, (void*)(fltk::DownKey));
+    }
+     {fltk::Button* o = new fltk::Button(365, 160, 20, 20, "@6->");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb, (void*)(fltk::RightKey));
+    }
+     {fltk::Button* o = new fltk::Button(400, 160, 40, 20, "0");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb, (void*)(fltk::Keypad+'0'));
+      o->align(fltk::ALIGN_LEFT|fltk::ALIGN_CENTER|fltk::ALIGN_INSIDE);
+    }
+     {fltk::Button* o = new fltk::Button(440, 160, 20, 20, ".");
+      o->labelsize(10);
+      o->callback((fltk::Callback*)key_cb, (void*)(fltk::Keypad+'.'));
+    }
+     {fltk::Widget* o = new fltk::Widget(400, 15, 80, 40, "Fl::event_state():");
+      o->box(fltk::NO_BOX);
+      o->labelsize(10);
+      o->align(fltk::ALIGN_TOP|fltk::ALIGN_LEFT);
+    }
+     {fltk::Button* o = new fltk::Button(400, 15, 20, 10, "shift ");
+      o->selection_color((fltk::Color)3);
+      o->labelsize(8);
+      o->callback((fltk::Callback*)shift_cb, (void*)(fltk::SHIFT));
+    }
+     {fltk::Button* o = new fltk::Button(420, 15, 20, 10, "lock ");
+      o->selection_color((fltk::Color)3);
+      o->labelsize(8);
+      o->callback((fltk::Callback*)shift_cb, (void*)(fltk::CAPSLOCK));
+    }
+     {fltk::Button* o = new fltk::Button(440, 15, 20, 10, "ctrl");
+      o->selection_color((fltk::Color)3);
+      o->labelsize(8);
+      o->callback((fltk::Callback*)shift_cb, (void*)(fltk::CTRL));
+    }
+     {fltk::Button* o = new fltk::Button(460, 15, 20, 10, "alt");
+      o->selection_color((fltk::Color)3);
+      o->labelsize(8);
+      o->callback((fltk::Callback*)shift_cb, (void*)(fltk::ALT));
+    }
+     {fltk::Button* o = new fltk::Button(400, 25, 20, 10, "num");
+      o->selection_color((fltk::Color)3);
+      o->labelsize(8);
+      o->callback((fltk::Callback*)shift_cb, (void*)(fltk::NUMLOCK));
+    }
+     {fltk::Button* o = new fltk::Button(420, 25, 20, 10, "?");
+      o->selection_color((fltk::Color)3);
+      o->labelsize(8);
+      o->callback((fltk::Callback*)shift_cb, (void*)(0x20));
+    }
+     {fltk::Button* o = new fltk::Button(440, 25, 20, 10, "meta");
+      o->selection_color((fltk::Color)3);
+      o->labelsize(8);
+      o->callback((fltk::Callback*)shift_cb, (void*)(fltk::META));
+    }
+     {fltk::Button* o = new fltk::Button(460, 25, 20, 10, "sclk");
+      o->selection_color((fltk::Color)3);
+      o->labelsize(8);
+      o->callback((fltk::Callback*)shift_cb, (void*)(fltk::SCROLLLOCK));
+    }
+     {fltk::Button* o = new fltk::Button(400, 35, 20, 10, "b1");
+      o->selection_color((fltk::Color)3);
+      o->labelsize(8);
+      o->callback((fltk::Callback*)shift_cb, (void*)(fltk::BUTTON1));
+    }
+     {fltk::Button* o = new fltk::Button(420, 35, 20, 10, "b2");
+      o->selection_color((fltk::Color)3);
+      o->labelsize(8);
+      o->callback((fltk::Callback*)shift_cb, (void*)(fltk::BUTTON2));
+    }
+     {fltk::Button* o = new fltk::Button(440, 35, 20, 10, "b3");
+      o->selection_color((fltk::Color)3);
+      o->labelsize(8);
+      o->callback((fltk::Callback*)shift_cb, (void*)(fltk::BUTTON3));
+    }
+     {fltk::Button* o = new fltk::Button(460, 35, 20, 10, "?");
+      o->selection_color((fltk::Color)3);
+      o->labelsize(8);
+      o->callback((fltk::Callback*)shift_cb, (void*)(0x800));
+    }
+     {fltk::Button* o = new fltk::Button(400, 45, 20, 10, "?");
+      o->selection_color((fltk::Color)3);
+      o->labelsize(8);
+      o->callback((fltk::Callback*)shift_cb, (void*)(0x1000));
+    }
+     {fltk::Button* o = new fltk::Button(420, 45, 20, 10, "?");
+      o->selection_color((fltk::Color)3);
+      o->labelsize(8);
+      o->callback((fltk::Callback*)shift_cb, (void*)(0x2000));
+    }
+     {fltk::Button* o = new fltk::Button(440, 45, 20, 10, "?");
+      o->selection_color((fltk::Color)3);
+      o->labelsize(8);
+      o->callback((fltk::Callback*)shift_cb, (void*)(0x4000));
+    }
+     {fltk::Button* o = new fltk::Button(460, 45, 20, 10, "?");
+      o->selection_color((fltk::Color)3);
+      o->labelsize(8);
+      o->callback((fltk::Callback*)shift_cb, (void*)(0x8000));
+    }
+    o->end();
+    o->shortcut(0);
+    o->resizable(o);
+  }
+  return  w;
+}

Added: branches/branch-3.0/test2/keyboard_ui.fl
===================================================================
--- branches/branch-3.0/test2/keyboard_ui.fl	                        (rev 0)
+++ branches/branch-3.0/test2/keyboard_ui.fl	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,701 @@
+# data file for the FLTK User Interface Designer (FLUID)
+version 2.0100 
+images_dir ./ 
+header_name {.h} 
+code_name {.cxx} 
+gridx 5 
+gridy 5 
+snap 3
+decl {\#include <fltk/events.h>} {} 
+
+Function {make_window()} {open
+} {
+  {fltk::Window} {} {open
+    xywh {416 379 490 190} resizable
+    extra_code {o->shortcut(0);} visible
+  } {
+    {fltk::Output} key_output {
+      label {Fl::event_key():}
+      xywh {15 15 170 30} align 5 textfont 4 labelsize 10
+    }
+    {fltk::Output} text_output {
+      label {Fl::event_text():}
+      xywh {195 15 190 30} align 5 textfont 4 labelsize 10
+    }
+    {fltk::Button} {} {
+      label {Esc }
+      user_data {fltk::EscapeKey} user_data_type {void*}
+      callback key_cb
+      xywh {15 50 20 20} labelsize 8
+    }
+    {fltk::Button} {} {
+      label F1
+      user_data {fltk::F1Key} user_data_type {void*}
+      callback key_cb
+      xywh {50 50 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label F2
+      user_data {fltk::F2Key} user_data_type {void*}
+      callback key_cb
+      xywh {70 50 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label F3
+      user_data {fltk::F3Key} user_data_type {void*}
+      callback key_cb
+      xywh {90 50 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label F4
+      user_data {fltk::F4Key} user_data_type {void*}
+      callback key_cb
+      xywh {110 50 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label F5
+      user_data {fltk::F5Key} user_data_type {void*}
+      callback key_cb
+      xywh {140 50 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label F6
+      user_data {fltk::F6Key} user_data_type {void*}
+      callback key_cb
+      xywh {160 50 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label F7
+      user_data {fltk::F7Key} user_data_type {void*}
+      callback key_cb
+      xywh {180 50 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label F8
+      user_data {fltk::F8Key} user_data_type {void*}
+      callback key_cb
+      xywh {200 50 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label F9
+      user_data {fltk::F9Key} user_data_type {void*}
+      callback key_cb
+      xywh {230 50 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label F10
+      user_data {fltk::F10Key} user_data_type {void*}
+      callback key_cb
+      xywh {250 50 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label F11
+      user_data {fltk::F11Key} user_data_type {void*}
+      callback key_cb
+      xywh {270 50 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label F12
+      user_data {fltk::F12Key} user_data_type {void*}
+      callback key_cb
+      xywh {290 50 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label {Print }
+      user_data {fltk::PrintKey} user_data_type {void*}
+      callback key_cb
+      xywh {325 50 20 20} labelsize 8
+    }
+    {fltk::Button} {} {
+      label {Sclk }
+      user_data {fltk::ScrollLockKey} user_data_type {void*}
+      callback key_cb
+      xywh {345 50 20 20} labelsize 8
+    }
+    {fltk::Button} {} {
+      label {Paus }
+      user_data {fltk::PauseKey} user_data_type {void*}
+      callback key_cb
+      xywh {365 50 20 20} labelsize 8
+    }
+    {fltk::Button} {} {
+      label {`}
+      callback key_cb
+      xywh {15 80 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label 1
+      callback key_cb
+      xywh {35 80 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label 2
+      callback key_cb
+      xywh {55 80 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label 3
+      callback key_cb
+      xywh {75 80 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label 4
+      callback key_cb
+      xywh {95 80 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label 5
+      callback key_cb
+      xywh {115 80 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label 6
+      callback key_cb
+      xywh {135 80 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label 7
+      callback key_cb
+      xywh {155 80 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label 8
+      callback key_cb
+      xywh {175 80 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label 9
+      callback key_cb
+      xywh {195 80 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label 0
+      callback key_cb
+      xywh {215 80 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label {-}
+      callback key_cb
+      xywh {235 80 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label {=}
+      callback key_cb
+      xywh {255 80 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label Bksp
+      user_data {fltk::BackSpaceKey} user_data_type {void*}
+      callback key_cb
+      xywh {275 80 35 20} align 52 labelsize 8
+    }
+    {fltk::Button} {} {
+      label {Ins }
+      user_data {fltk::InsertKey} user_data_type {void*}
+      callback key_cb
+      xywh {325 80 20 20} labelsize 8
+    }
+    {fltk::Button} {} {
+      label Home
+      user_data {fltk::HomeKey} user_data_type {void*}
+      callback key_cb
+      xywh {345 80 20 20} labelsize 8
+    }
+    {fltk::Button} {} {
+      label {pgup }
+      user_data {fltk::PageUpKey} user_data_type {void*}
+      callback key_cb
+      xywh {365 80 20 20} labelsize 8
+    }
+    {fltk::Button} {} {
+      label Num
+      user_data {fltk::NumLockKey} user_data_type {void*}
+      callback key_cb
+      xywh {400 80 20 20} labelsize 8
+    }
+    {fltk::Button} {} {
+      label {/}
+      user_data {fltk::Keypad+'/'} user_data_type {void*}
+      callback key_cb
+      xywh {420 80 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label {*}
+      user_data {fltk::Keypad+'*'} user_data_type {void*}
+      callback key_cb
+      xywh {440 80 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label {-}
+      user_data {fltk::Keypad+'-'} user_data_type {void*}
+      callback key_cb
+      xywh {460 80 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label Tab
+      user_data {fltk::TabKey} user_data_type {void*}
+      callback key_cb
+      xywh {15 100 27 20} align 52 labelsize 8
+    }
+    {fltk::Button} {} {
+      label Q
+      callback key_cb
+      xywh {42 100 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label W
+      callback key_cb
+      xywh {62 100 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label E
+      callback key_cb
+      xywh {82 100 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label R
+      callback key_cb
+      xywh {102 100 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label T
+      callback key_cb
+      xywh {122 100 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label Y
+      callback key_cb
+      xywh {142 100 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label U
+      callback key_cb
+      xywh {162 100 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label I
+      callback key_cb
+      xywh {182 100 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label O
+      callback key_cb
+      xywh {202 100 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label P
+      callback key_cb
+      xywh {222 100 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label {[}
+      callback key_cb
+      xywh {242 100 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label {]}
+      callback key_cb
+      xywh {262 100 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label {\\}
+      callback key_cb
+      xywh {282 100 28 20} align 52 labelsize 10
+    }
+    {fltk::Button} {} {
+      label {Del }
+      user_data {fltk::DeleteKey} user_data_type {void*}
+      callback key_cb
+      xywh {325 100 20 20} labelsize 8
+    }
+    {fltk::Button} {} {
+      label {End }
+      user_data {fltk::EndKey} user_data_type {void*}
+      callback key_cb
+      xywh {345 100 20 20} labelsize 8
+    }
+    {fltk::Button} {} {
+      label {pgdn }
+      user_data {fltk::PageDownKey} user_data_type {void*}
+      callback key_cb
+      xywh {365 100 20 20} labelsize 8
+    }
+    {fltk::Button} {} {
+      label 7
+      user_data {fltk::Keypad+'7'} user_data_type {void*}
+      callback key_cb
+      xywh {400 100 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label 8
+      user_data {fltk::Keypad+'8'} user_data_type {void*}
+      callback key_cb
+      xywh {420 100 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label 9
+      user_data {fltk::Keypad+'9'} user_data_type {void*}
+      callback key_cb
+      xywh {440 100 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label {+}
+      user_data {fltk::Keypad+'+'} user_data_type {void*}
+      callback key_cb
+      xywh {460 100 20 40} align 49 labelsize 10
+    }
+    {fltk::Button} {} {
+      label Lock
+      user_data {fltk::CapsLockKey} user_data_type {void*}
+      callback key_cb
+      xywh {15 120 36 20} align 52 labelsize 8
+    }
+    {fltk::Button} {} {
+      label A
+      callback key_cb
+      xywh {51 120 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label S
+      callback key_cb
+      xywh {71 120 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label D
+      callback key_cb
+      xywh {91 120 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label F
+      callback key_cb
+      xywh {111 120 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label G
+      callback key_cb
+      xywh {131 120 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label H
+      callback key_cb
+      xywh {151 120 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label J
+      callback key_cb
+      xywh {171 120 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label K
+      callback key_cb
+      xywh {191 120 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label L
+      callback key_cb
+      xywh {211 120 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label {;}
+      callback key_cb
+      xywh {231 120 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label {'}
+      callback key_cb
+      xywh {251 120 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label Enter
+      user_data {fltk::ReturnKey} user_data_type {void*}
+      callback key_cb
+      xywh {271 120 39 20} align 52 labelsize 8
+    }
+    {fltk::Button} {} {
+      label 4
+      user_data {fltk::Keypad+'4'} user_data_type {void*}
+      callback key_cb
+      xywh {400 120 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label 5
+      user_data {fltk::Keypad+'5'} user_data_type {void*}
+      callback key_cb
+      xywh {420 120 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label 6
+      user_data {fltk::Keypad+'6'} user_data_type {void*}
+      callback key_cb
+      xywh {440 120 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label Shift
+      user_data {fltk::LeftShiftKey} user_data_type {void*}
+      callback key_cb
+      xywh {15 140 45 20} align 52 labelsize 8
+    }
+    {fltk::Button} {} {
+      label Z
+      callback key_cb
+      xywh {60 140 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label X
+      callback key_cb
+      xywh {80 140 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label C
+      callback key_cb
+      xywh {100 140 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label V
+      callback key_cb
+      xywh {120 140 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label B
+      callback key_cb
+      xywh {140 140 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label N
+      callback key_cb
+      xywh {160 140 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label M
+      callback key_cb
+      xywh {180 140 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label {,}
+      callback key_cb
+      xywh {200 140 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label {.}
+      callback key_cb
+      xywh {220 140 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label {/}
+      callback key_cb
+      xywh {240 140 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label Shift
+      user_data {fltk::RightShiftKey} user_data_type {void*}
+      callback key_cb
+      xywh {260 140 50 20} align 52 labelsize 8
+    }
+    {fltk::Button} {} {
+      label {@8->}
+      user_data {fltk::UpKey} user_data_type {void*}
+      callback key_cb
+      xywh {345 140 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label 1
+      user_data {fltk::Keypad+'1'} user_data_type {void*}
+      callback key_cb
+      xywh {400 140 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label 2
+      user_data {fltk::Keypad+'2'} user_data_type {void*}
+      callback key_cb
+      xywh {420 140 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label 3
+      user_data {fltk::Keypad+'3'} user_data_type {void*}
+      callback key_cb
+      xywh {440 140 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      user_data {fltk::KeypadEnter} user_data_type {void*}
+      callback key_cb selected
+      xywh {460 140 20 40}
+    }
+    {fltk::Button} {} {
+      label Ctrl
+      user_data {fltk::LeftCtrlKey} user_data_type {void*}
+      callback key_cb
+      xywh {15 160 30 20} align 52 labelsize 8
+    }
+    {fltk::Button} {} {
+      label Meta
+      user_data {fltk::LeftMetaKey} user_data_type {void*}
+      callback key_cb
+      xywh {45 160 30 20} labelsize 8
+    }
+    {fltk::Button} {} {
+      label {Alt }
+      user_data {fltk::LeftAltKey} user_data_type {void*}
+      callback key_cb
+      xywh {75 160 30 20} labelsize 8
+    }
+    {fltk::Button} {} {
+      user_data {' '} user_data_type {void*}
+      callback key_cb
+      xywh {105 160 85 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label {Alt }
+      user_data {fltk::RightAltKey} user_data_type {void*}
+      callback key_cb
+      xywh {190 160 30 20} labelsize 8
+    }
+    {fltk::Button} {} {
+      label Meta
+      user_data {fltk::RightMetaKey} user_data_type {void*}
+      callback key_cb
+      xywh {220 160 30 20} labelsize 8
+    }
+    {fltk::Button} {} {
+      label {Menu }
+      user_data {fltk::MenuKey} user_data_type {void*}
+      callback key_cb
+      xywh {250 160 30 20} labelsize 8
+    }
+    {fltk::Button} {} {
+      label Ctrl
+      user_data {fltk::RightCtrlKey} user_data_type {void*}
+      callback key_cb
+      xywh {280 160 30 20} align 52 labelsize 8
+    }
+    {fltk::Button} {} {
+      label {@4->}
+      user_data {fltk::LeftKey} user_data_type {void*}
+      callback key_cb
+      xywh {325 160 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label {@2->}
+      user_data {fltk::DownKey} user_data_type {void*}
+      callback key_cb
+      xywh {345 160 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label {@6->}
+      user_data {fltk::RightKey} user_data_type {void*}
+      callback key_cb
+      xywh {365 160 20 20} labelsize 10
+    }
+    {fltk::Button} {} {
+      label 0
+      user_data {fltk::Keypad+'0'} user_data_type {void*}
+      callback key_cb
+      xywh {400 160 40 20} align 52 labelsize 10
+    }
+    {fltk::Button} {} {
+      label {.}
+      user_data {fltk::Keypad+'.'} user_data_type {void*}
+      callback key_cb
+      xywh {440 160 20 20} labelsize 10
+    }
+    {fltk::Widget} {} {
+      label {Fl::event_state():}
+      xywh {400 15 80 40} align 5 box NO_BOX labelsize 10
+    }
+    {fltk::Button} {} {
+      label {shift }
+      user_data {fltk::SHIFT} user_data_type {void*}
+      callback shift_cb
+      xywh {400 15 20 10} selection_color 3 labelsize 8
+    }
+    {fltk::Button} {} {
+      label {lock }
+      user_data {fltk::CAPSLOCK} user_data_type {void*}
+      callback shift_cb
+      xywh {420 15 20 10} selection_color 3 labelsize 8
+    }
+    {fltk::Button} {} {
+      label ctrl
+      user_data {fltk::CTRL} user_data_type {void*}
+      callback shift_cb
+      xywh {440 15 20 10} selection_color 3 labelsize 8
+    }
+    {fltk::Button} {} {
+      label alt
+      user_data {fltk::ALT} user_data_type {void*}
+      callback shift_cb
+      xywh {460 15 20 10} selection_color 3 labelsize 8
+    }
+    {fltk::Button} {} {
+      label num
+      user_data {fltk::NUMLOCK} user_data_type {void*}
+      callback shift_cb
+      xywh {400 25 20 10} selection_color 3 labelsize 8
+    }
+    {fltk::Button} {} {
+      label {?}
+      user_data 0x20 user_data_type {void*}
+      callback shift_cb
+      xywh {420 25 20 10} selection_color 3 labelsize 8
+    }
+    {fltk::Button} {} {
+      label meta
+      user_data {fltk::META} user_data_type {void*}
+      callback shift_cb
+      xywh {440 25 20 10} selection_color 3 labelsize 8
+    }
+    {fltk::Button} {} {
+      label sclk
+      user_data {fltk::SCROLLLOCK} user_data_type {void*}
+      callback shift_cb
+      xywh {460 25 20 10} selection_color 3 labelsize 8
+    }
+    {fltk::Button} {} {
+      label b1
+      user_data {fltk::BUTTON1} user_data_type {void*}
+      callback shift_cb
+      xywh {400 35 20 10} selection_color 3 labelsize 8
+    }
+    {fltk::Button} {} {
+      label b2
+      user_data {fltk::BUTTON2} user_data_type {void*}
+      callback shift_cb
+      xywh {420 35 20 10} selection_color 3 labelsize 8
+    }
+    {fltk::Button} {} {
+      label b3
+      user_data {fltk::BUTTON3} user_data_type {void*}
+      callback shift_cb
+      xywh {440 35 20 10} selection_color 3 labelsize 8
+    }
+    {fltk::Button} {} {
+      label {?}
+      user_data 0x800 user_data_type {void*}
+      callback shift_cb
+      xywh {460 35 20 10} selection_color 3 labelsize 8
+    }
+    {fltk::Button} {} {
+      label {?}
+      user_data 0x1000 user_data_type {void*}
+      callback shift_cb
+      xywh {400 45 20 10} selection_color 3 labelsize 8
+    }
+    {fltk::Button} {} {
+      label {?}
+      user_data 0x2000 user_data_type {void*}
+      callback shift_cb
+      xywh {420 45 20 10} selection_color 3 labelsize 8
+    }
+    {fltk::Button} {} {
+      label {?}
+      user_data 0x4000 user_data_type {void*}
+      callback shift_cb
+      xywh {440 45 20 10} selection_color 3 labelsize 8
+    }
+    {fltk::Button} {} {
+      label {?}
+      user_data 0x8000 user_data_type {void*}
+      callback shift_cb
+      xywh {460 45 20 10} selection_color 3 labelsize 8
+    }
+  }
+} 

Added: branches/branch-3.0/test2/keyboard_ui.h
===================================================================
--- branches/branch-3.0/test2/keyboard_ui.h	                        (rev 0)
+++ branches/branch-3.0/test2/keyboard_ui.h	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,14 @@
+// generated by Fast Light User Interface Designer (fluid) version 2.1000
+
+#ifndef keyboard_ui_h
+#define keyboard_ui_h
+#include <fltk/Window.h>
+#include <fltk/Output.h>
+extern fltk::Output* key_output;
+extern fltk::Output* text_output;
+#include <fltk/Button.h>
+extern void key_cb(fltk::Button*, void*);
+#include <fltk/Widget.h>
+extern void shift_cb(fltk::Button*, void*);
+fltk::Window* make_window();
+#endif

Added: branches/branch-3.0/test2/label.cxx
===================================================================
--- branches/branch-3.0/test2/label.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/label.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,201 @@
+//
+// "$Id: label.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $"
+//
+// Label test program for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2006 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+//    http://www.fltk.org/str.php
+//
+
+#include <fltk/run.h>
+#include <fltk/Window.h>
+#include <fltk/Box.h>
+#include <fltk/ValueSlider.h>
+#include <fltk/ToggleButton.h>
+#include <fltk/Input.h>
+#include <fltk/MenuBuild.h>
+#include <fltk/Choice.h>
+#include <fltk/draw.h>
+#include <fltk/Font.h>
+#include <fltk/xpmImage.h>
+
+using namespace fltk;
+
+ToggleButton *leftb,*rightb,*topb,*bottomb,*insideb,*centerb,*clipb,*wrapb;
+Widget *textbox;
+Input *input;
+ValueSlider *fontslider;
+ValueSlider *sizes;
+Window *window;
+
+void button_cb(Widget *,void *) {
+  int i = 0;
+  if (leftb->value()) i |= ALIGN_LEFT;
+  if (rightb->value()) i |= ALIGN_RIGHT;
+  if (topb->value()) i |= ALIGN_TOP;
+  if (bottomb->value()) i |= ALIGN_BOTTOM;
+  if (insideb->value()) i |= ALIGN_INSIDE;
+  if (centerb->value()) i |= ALIGN_CENTER;
+  if (clipb->value()) i |= ALIGN_CLIP;
+  if (wrapb->value()) i |= ALIGN_WRAP;
+  textbox->align(i);
+  window->redraw();
+}
+
+void font_cb(Widget *,void *) {
+  //Widget::default_style->leading_ = int(fontslider->value());
+  textbox->labelfont(font(int(fontslider->value())));
+  window->redraw();
+}
+
+void size_cb(Widget *,void *) {
+  textbox->labelsize((float)sizes->value());
+  window->redraw();
+}
+
+void input_cb(Widget *,void *) {
+  textbox->label(input->value());
+  window->redraw();
+}
+
+void normal_cb(Widget *,void *) {
+  textbox->labeltype(NORMAL_LABEL);
+  window->redraw();
+}
+
+void symbol_cb(Widget *,void *) {
+  textbox->labeltype(SYMBOL_LABEL);
+  if (input->value()[0] != '@') {
+    input->static_value("@->");
+    textbox->label("@->");
+  }
+  window->redraw();
+}
+
+void shadow_cb(Widget *,void *) {
+  textbox->labeltype(SHADOW_LABEL);
+  window->redraw();
+}
+
+void embossed_cb(Widget *,void *) {
+  textbox->labeltype(EMBOSSED_LABEL);
+  window->redraw();
+}
+
+void engraved_cb(Widget *,void *) {
+  textbox->labeltype(ENGRAVED_LABEL);
+  window->redraw();
+}
+
+static void load_menu(Choice* c) {
+  c->begin();
+      new fltk::Item("NORMAL_LABEL",0,normal_cb);
+      new fltk::Item("SYMBOL_LABEL",0,symbol_cb);
+      new fltk::Item("SHADOW_LABEL",0,shadow_cb);
+      new fltk::Item("ENGRAVED_LABEL",0,engraved_cb);
+      new fltk::Item("EMBOSSED_LABEL",0,embossed_cb);
+  c->end();
+}
+
+#include "porsche.xpm"
+xpmImage theimage(porsche_xpm);
+void image_cb(Widget* w, void*) {
+  textbox->image(((Button*)w)->value() ? &theimage : 0);
+  window->redraw();
+}
+
+void inactive_cb(Widget* w, void*) {
+  if (((Button*)w)->value()) textbox->deactivate(); else textbox->activate();
+  window->redraw();
+}
+
+const char* const initial = "The quick brown fox jumps over the lazy dog.";
+
+int main(int argc, char **argv) {
+  window = new Window(400,400);
+  window->set_double_buffer();
+  window->begin();
+
+  textbox= new Widget(100,75,200,100,initial);
+  textbox->box(ENGRAVED_BOX);
+
+  Choice *c = new Choice(50,275,200,25);
+  load_menu(c);
+
+  ToggleButton* b = new ToggleButton(250,275,50,25,"image");
+  b->callback(image_cb);
+
+  b = new ToggleButton(300,275,50,25,"inactive");
+  b->callback(inactive_cb);
+
+  Group *g = new Group(0,300,400,25);
+  g->resizable(g);
+  g->begin();
+  leftb = new ToggleButton(0,0,50,25,"left");
+  leftb->callback(button_cb);
+  rightb = new ToggleButton(50,0,50,25,"right");
+  rightb->callback(button_cb);
+  topb = new ToggleButton(100,0,50,25,"top");
+  topb->callback(button_cb);
+  bottomb = new ToggleButton(150,0,50,25,"bottom");
+  bottomb->callback(button_cb);
+  insideb = new ToggleButton(200,0,50,25,"inside");
+  insideb->callback(button_cb);
+  centerb = new ToggleButton(250,0,50,25,"center");
+  centerb->callback(button_cb);
+  wrapb = new ToggleButton(300,0,50,25,"wrap");
+  wrapb->callback(button_cb);
+  clipb = new ToggleButton(350,0,50,25,"clip");
+  clipb->callback(button_cb);
+  g->end();
+
+  fontslider=new ValueSlider(50,325,350,25,"Font:");
+  fontslider->type(Slider::TICK_ABOVE);
+  fontslider->clear_flag(ALIGN_MASK);
+  fontslider->set_flag(ALIGN_LEFT);
+  fontslider->range(0,15);
+  fontslider->step(1);
+  fontslider->value(0);
+  fontslider->callback(font_cb);
+
+  sizes= new ValueSlider(50,350,350,25,"Size:");
+  sizes->type(Slider::TICK_ABOVE|Slider::LOG);
+  sizes->clear_flag(ALIGN_MASK);
+  sizes->set_flag(ALIGN_LEFT);
+  sizes->range(1,64);
+  //sizes->step(1);
+  sizes->value(14);
+  sizes->callback(size_cb);
+
+  input = new Input(50,375,350,25);
+  input->static_value(initial);
+  input->when(WHEN_CHANGED);
+  input->callback(input_cb);
+
+  window->resizable(textbox);
+  window->end();
+  window->show(argc,argv);
+  return run();
+}
+
+//
+// End of "$Id: label.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $".
+//

Added: branches/branch-3.0/test2/layout.cxx
===================================================================
--- branches/branch-3.0/test2/layout.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/layout.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,111 @@
+// Layout managers test program Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2006 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+//    http://www.fltk.org/str.php
+//
+
+#include <stdio.h>
+#include <fltk/Fl.h>
+#include <fltk/Fl_Button.h>
+#include <fltk/Fl_Choice.h>
+#include <fltk/Fl_Light_Button.h>
+#include <fltk/Fl_Align_Group.h>
+#include <fltk/Fl_Window.h>
+
+Fl_Align_Group* lower_half;
+
+void align_cb(Fl_Choice* c,long w) {
+  switch (w) {
+    case 0: lower_half->vertical(!c->value()); break;
+    case 1: 
+    case 2: {
+      Fl_Align new_align = lower_half->align();
+      new_align &= (w == 1) ?
+                   (FL_ALIGN_TOP | FL_ALIGN_BOTTOM) :
+                   (FL_ALIGN_LEFT | FL_ALIGN_RIGHT);
+      if (c->value()) {
+      	if (w == 1) 
+	  new_align |= c->value() > 1 ? FL_ALIGN_RIGHT : FL_ALIGN_LEFT;
+       	  else new_align |= c->value() > 1 ? FL_ALIGN_BOTTOM : FL_ALIGN_TOP;
+      }
+      lower_half->align(new_align);
+    }
+    default: break;
+  }
+  lower_half->layout();
+  lower_half->redraw();
+}
+
+int main(int argc, char ** argv) {
+  Fl_Window *window = new Fl_Window(600,400);
+
+  Fl_Align_Group main_group(0,0,600,400,0,2,1,0,5,5);
+
+  Fl_Align_Group* o = new Fl_Align_Group(0,0,0,0,0,2,false,FL_ALIGN_TOP | FL_ALIGN_LEFT);
+  {
+    Fl_Align_Group* o = new Fl_Align_Group(0,0,0,0,"Tiled Buttons",
+					   3,false,0,10,10);
+    o->box(FL_DOWN_BOX);
+    char *l,labels[18];
+    l=labels;
+    for (int i=1;i<=9;i++) {
+      sprintf(l,"%1d",i);
+      (void) new Fl_Button(0,0,0,0,l);
+      l+=2;
+    }
+    o->end();
+  }
+  {
+    Fl_Align_Group* o=new Fl_Align_Group(0,0,0,0,"Fl_Align_Group options",
+					 3,true,0,10,10);
+    o->box(FL_DOWN_BOX);
+    static const char* labels[3][3]={{"Vertical","Horizontal",""},
+				     {"Center","Left","Right"},
+				     {"Center","Top","Bottom"}};
+    Fl_Choice* c;
+    for (int i=0;i<3;i++) {
+      c = new Fl_Choice(0,0,0,0);
+      for (int j=0;j<3;j++) {c->add(labels[i][j]);if (i==0 && j==1) break;}
+      c->callback((Fl_Callback*)align_cb);
+      c->user_data((void*)i);
+      c->value(0);
+    }
+    o->end();
+  }
+  o->end();
+  o = lower_half = new Fl_Align_Group(0,0,0,0,0,4,true,0,10,10);
+  o->box(FL_DOWN_BOX);
+  static const char* labels[24]={"Although","these","labels","have",
+				 "different","lengths",",","the",
+				 "widgets","they","belong","to",
+				 "are","properly","aligned",".",
+				 "Variable","lenghts\nare","respected\n,",
+				 "as\nseen","h","e","r","e"};
+  for (int i=0;i<24;i++) (void) new Fl_Button(0,0,0,0,labels[i]);
+  o->end();
+
+  main_group.end();
+  window->resizable(main_group);
+  window->end();
+  window->show(argc,argv);
+  return Fl::run();
+}
+

Added: branches/branch-3.0/test2/line_style.cxx
===================================================================
--- branches/branch-3.0/test2/line_style.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/line_style.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,128 @@
+#include <fltk/run.h>
+#include <fltk/Window.h>
+#include <fltk/Item.h>
+#include <fltk/ValueSlider.h>
+#include <fltk/draw.h>
+#include <fltk/Choice.h>
+using namespace fltk;
+
+Window *form;
+Slider *sliders[8];
+Choice *choice[3];
+
+class test_box: public Window {
+  void draw();
+public:
+  test_box(int x,int y,int w,int h,const char *l=0)
+    : Window(x,y,w,h,l) {}
+} *test;
+
+void test_box::draw() {
+  Window::draw();
+  setcolor(fltk::color((uchar)(sliders[0]->value()),
+		       (uchar)(sliders[1]->value()),
+		       (uchar)(sliders[2]->value())));
+  char buf[5];
+  buf[0] = char(sliders[4]->value());
+  buf[1] = char(sliders[5]->value());
+  buf[2] = char(sliders[6]->value());
+  buf[3] = char(sliders[7]->value());
+  buf[4] = 0;
+  line_style(
+    (int)(choice[0]->get_item()->argument()) +
+    (int)(choice[1]->get_item()->argument()) +
+    (int)(choice[2]->get_item()->argument()),
+    (int)(sliders[3]->value()),
+    buf);
+  strokerect(10,10,w()-20,h()-20);
+  addvertex(35, 35);
+  addvertex(w()-35, h()-35);
+  addvertex(w()/2, 35);
+  addvertex(35, h()/2);
+  strokepath();
+  drawpoint(w()-35, 35);
+  drawline(35, h()*3/4, w()-35, h()*3/4);
+  // you must reset the line type when done:
+  line_style(SOLID);
+}
+
+void build_style_menu(Group *g) {
+  g->begin();
+  (new Item("fltk::SOLID"))->argument(SOLID);
+  (new Item("fltk::DASH"))->argument(DASH);
+  (new Item("fltk::DOT"))->argument(DOT);
+  (new Item("fltk::DASHDOT"))->argument(DASHDOT);
+  (new Item("fltk::DASHDOTDOT"))->argument(DASHDOTDOT);
+  g->end();
+}
+
+void build_cap_menu(Group *g) {
+  g->begin();
+  new Item("default");
+  (new Item("fltk::CAP_FLAT"))->argument(CAP_FLAT);
+  (new Item("fltk::CAP_ROUND"))->argument(CAP_ROUND);
+  (new Item("fltk::CAP_SQUARE"))->argument(CAP_SQUARE);
+  g->end();
+}
+
+void build_join_menu(Group *g) {
+  g->begin();
+  new Item("default");
+  (new Item("fltk::JOIN_MITER"))->argument(JOIN_MITER);
+  (new Item("fltk::JOIN_ROUND"))->argument(JOIN_ROUND);
+  (new Item("fltk::JOIN_BEVEL"))->argument(JOIN_BEVEL);
+  g->end();
+}
+
+void do_redraw(Widget*,void*)
+{
+    test->redraw();
+}
+
+void makeform(const char *) {
+  form = new Window(500,210,"line_style() test");
+  form->begin();
+  sliders[0]= new ValueSlider(280,10,180,20,"R");
+  sliders[0]->maximum(255);
+  sliders[1]= new ValueSlider(280,30,180,20,"G");
+  sliders[1]->maximum(255);
+  sliders[2]= new ValueSlider(280,50,180,20,"B");
+  sliders[2]->maximum(255);
+  choice[0]= new Choice(280,70,180,20,"Style");
+  build_style_menu(choice[0]);
+  choice[1]= new Choice(280,90,180,20,"Cap");
+  build_cap_menu(choice[1]);
+  choice[2]= new Choice(280,110,180,20,"Join");
+  build_join_menu(choice[2]);
+  sliders[3]= new ValueSlider(280,130,180,20,"Width");
+  sliders[3]->maximum(20);
+  sliders[4] = new Slider(200,170,70,20,"Dash");
+  sliders[4]->align(ALIGN_TOP|ALIGN_LEFT);
+  sliders[4]->maximum(40);
+  sliders[5] = new Slider(270,170,70,20);
+  sliders[5]->maximum(40);
+  sliders[6] = new Slider(340,170,70,20);
+  sliders[6]->maximum(40);
+  sliders[7] = new Slider(410,170,70,20);
+  sliders[7]->maximum(40);
+  int i;
+  for (i=0;i<8;i++) {
+    sliders[i]->type(1);
+    if (i<4) sliders[i]->align(ALIGN_LEFT);
+    sliders[i]->callback((Callback*)do_redraw);
+    sliders[i]->step(1);
+  }
+  for (i=0;i<3;i++) {
+    choice[i]->value(0);
+    choice[i]->callback((Callback*)do_redraw);
+  }
+  test=new test_box(10,10,190,190);
+  form->resizable(test);
+  form->end();
+}
+
+int main(int argc, char **argv) {
+  makeform(argv[0]);
+  form->show(argc,argv);
+  return run();
+}

Added: branches/branch-3.0/test2/linetype.cxx
===================================================================
--- branches/branch-3.0/test2/linetype.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/linetype.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,123 @@
+#include <fltk/Fl.h>
+#include <fltk/Fl_Window.h>
+#include <fltk/Fl_Value_Slider.h>
+#include <fltk/fl_draw.h>
+#include <fltk/Fl_Choice.h>
+
+Fl_Window *form;
+Fl_Slider *sliders[8];
+Fl_Choice *choice[3];
+
+class test_box: public Fl_Window {
+  void draw();
+public:
+  test_box(int x,int y,int w,int h,const char *l=0)
+    : Fl_Window(x,y,w,h,l) {}
+}*test;
+
+void test_box::draw() {
+  Fl_Window::draw();
+  fl_color(fl_rgb((uchar)(sliders[0]->value()),
+		  (uchar)(sliders[1]->value()),
+		  (uchar)(sliders[2]->value())));
+  char buf[5];
+  buf[0] = char(sliders[4]->value());
+  buf[1] = char(sliders[5]->value());
+  buf[2] = char(sliders[6]->value());
+  buf[3] = char(sliders[7]->value());
+  buf[4] = 0;
+  fl_line_style(
+    (int)(choice[0]->mvalue()->argument()) +
+    (int)(choice[1]->mvalue()->argument()) +
+    (int)(choice[2]->mvalue()->argument()),
+    (int)(sliders[3]->value()),
+    buf);
+  fl_rect(10,10,w()-20,h()-20);
+  fl_begin_line();
+  fl_vertex(35, 35);
+  fl_vertex(w()-35, h()-35);
+  fl_vertex(w()-40, 35);
+  fl_vertex(35, h()/2);
+  fl_end_line();
+  // you must reset the line type when done:
+  fl_line_style(FL_SOLID);
+}
+
+Fl_Menu_Item style_menu[] = {
+  {"FL_SOLID",	0, 0, (void*)FL_SOLID},
+  {"FL_DASH",	0, 0, (void*)FL_DASH},
+  {"FL_DOT",	0, 0, (void*)FL_DOT},
+  {"FL_DASHDOT",0, 0, (void*)FL_DASHDOT},
+  {"FL_DASHDOTDOT", 0, 0, (void*)FL_DASHDOTDOT},
+  {0}
+};
+
+Fl_Menu_Item cap_menu[] = {
+  {"default",		0, 0, 0},
+  {"FL_CAP_FLAT",	0, 0, (void*)FL_CAP_FLAT},
+  {"FL_CAP_ROUND",	0, 0, (void*)FL_CAP_ROUND},
+  {"FL_CAP_SQUARE",	0, 0, (void*)FL_CAP_SQUARE},
+  {0}
+};
+
+Fl_Menu_Item join_menu[] = {
+  {"default",		0, 0, 0},
+  {"FL_JOIN_MITER",	0, 0, (void*)FL_JOIN_MITER},
+  {"FL_JOIN_ROUND",	0, 0, (void*)FL_JOIN_ROUND},
+  {"FL_JOIN_BEVEL",	0, 0, (void*)FL_JOIN_BEVEL},
+  {0}
+};
+
+void do_redraw(Fl_Widget*,void*)
+{
+    test->redraw();
+}
+
+void makeform(const char *) {
+  form = new Fl_Window(500,210,"line type test");
+  sliders[0]= new Fl_Value_Slider(280,10,180,20,"R");
+  sliders[0]->bounds(0,255);
+  sliders[1]= new Fl_Value_Slider(280,30,180,20,"G");
+  sliders[1]->bounds(0,255);
+  sliders[2]= new Fl_Value_Slider(280,50,180,20,"B");
+  sliders[2]->bounds(0,255);
+  choice[0]= new Fl_Choice(280,70,180,20,"Style");
+  choice[0]->menu(style_menu);
+  choice[1]= new Fl_Choice(280,90,180,20,"Cap");
+  choice[1]->menu(cap_menu);
+  choice[2]= new Fl_Choice(280,110,180,20,"Join");
+  choice[2]->menu(join_menu);
+  sliders[3]= new Fl_Value_Slider(280,130,180,20,"Width");
+  sliders[3]->bounds(0,20);
+  sliders[4] = new Fl_Slider(200,170,70,20,"Dash");
+  sliders[4]->align(FL_ALIGN_TOP_LEFT);
+  sliders[4]->bounds(0,40);
+  sliders[5] = new Fl_Slider(270,170,70,20);
+  sliders[5]->bounds(0,40);
+  sliders[6] = new Fl_Slider(340,170,70,20);
+  sliders[6]->bounds(0,40);
+  sliders[7] = new Fl_Slider(410,170,70,20);
+  sliders[7]->bounds(0,40);
+  int i;
+  for (i=0;i<8;i++) {
+    sliders[i]->type(1);
+    if (i<4) sliders[i]->align(FL_ALIGN_LEFT);
+    sliders[i]->callback((Fl_Callback*)do_redraw);
+    sliders[i]->step(1);
+  }
+  for (i=0;i<3;i++) {
+    choice[i]->value(0);
+    choice[i]->callback((Fl_Callback*)do_redraw);
+  }
+  test=new test_box(10,10,190,190);
+  test->end();
+  form->resizable(test);
+  form->end();
+}
+
+main(int argc, char **argv) {
+  makeform(argv[0]);
+  form->show(argc,argv);
+  return Fl::run();
+}
+

Added: branches/branch-3.0/test2/list.cxx
===================================================================
--- branches/branch-3.0/test2/list.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/list.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,53 @@
+// Test of List to see if all menus can handle it.
+
+#include <fltk/run.h>
+#include <fltk/Window.h>
+#include <fltk/PopupMenu.h>
+#include <fltk/Choice.h>
+#include <fltk/Browser.h>
+#include <fltk/StringList.h>
+#include <fltk/Item.h>
+#include <fltk/string.h>
+using namespace fltk;
+
+const int SIZE = 50;
+const int DEPTH = 3;
+
+class MyList : public StringHierarchy {
+public:
+
+  int children(const Menu* group, const int* indexes, int level) {
+    if (level < DEPTH) return SIZE;
+    return -1;
+  }
+
+  const char* label(const Menu* group, const int* indexes, int level) {
+    int n = indexes[level];
+    // FLTK is never supposed to ask for a widget outside the children range,
+    // so this should never print:
+    if (n < 0 || n >= SIZE) {printf("Asked for item %d\n", n); return 0;}
+    // produce a label. You can reuse the buffer:
+    static char buffer[100];
+    if (level) sprintf(buffer, "Level %d Item %d", level, n);
+    else sprintf(buffer, "Top Item %d", n);
+    return buffer;
+  }
+};
+
+int main(int argc, char** argv) {
+  MyList list;
+  Window window(330,300,"Sample fltk::List subclass");
+  window.begin();
+  Browser browser(10,10,200,280);
+  browser.list(&list);
+  browser.indented(true);
+  Choice choice(220,10,100,25);
+  choice.list(&list);
+  PopupMenu button(220,55,100,25,"pushme");
+  button.list(&list);
+  window.resizable(browser);
+  window.resize_align(ALIGN_TOP);
+  window.end();
+  window.show(argc, argv);
+  return fltk::run();
+}

Added: branches/branch-3.0/test2/list_visuals.cxx
===================================================================
--- branches/branch-3.0/test2/list_visuals.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/list_visuals.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,229 @@
+//
+// "$Id: list_visuals.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $"
+//
+// Visual list utility for the Fast Light Tool Kit (FLTK).
+//
+// List all the visuals on the screen, and dumps anything interesting
+// about them to stdout.
+//
+// Does not use fltk.
+//
+// This file may be #included in another program to make a function to
+// call to list the visuals.  Fl.h must be included first to indicate this.
+//
+// Copyright 1998-2006 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+//    http://www.fltk.org/str.php
+//
+
+#include <config.h>
+
+#if !(USE_X11)
+#include <fltk/error.h>
+
+int main(int, char**) {
+  fltk::fatal("Only X has this sillyness.");
+  return 1;
+}
+
+#else
+
+#include <config.h>
+#include <fltk/x.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+const char *ClassNames[] = {
+  "StaticGray ",
+  "GrayScale  ",
+  "StaticColor",
+  "PseudoColor",
+  "TrueColor  ",
+  "DirectColor"
+};
+
+// SERVER_OVERLAY_VISUALS property element:
+typedef struct _OverlayInfo {
+  long overlay_visual;
+  long transparent_type;
+  long value;
+  long layer;
+} OverlayInfo;
+
+#if HAVE_MULTIBUF
+#define Window XWindow
+#include <X11/extensions/multibuf.h>
+#undef Window
+#endif
+
+#if HAVE_XDBE
+#define Window XWindow
+#include <X11/extensions/Xdbe.h>
+#undef Window
+#endif
+
+
+static void print_mask(XVisualInfo* p) {
+  int n = 0;
+  int what = 0;
+  int print_anything = 0;
+  char buf[20];
+  char *q = buf;
+  *q = 0;
+  int b; unsigned int m; for (b=32,m=0x80000000; ; b--,m>>=1) {
+    int new_what = 0;
+    if (p->red_mask&m) new_what = 'r';
+    else if (p->green_mask&m) new_what = 'g';
+    else if (p->blue_mask&m) new_what = 'b';
+    else new_what = '?';
+    if (new_what != what) {
+      if (what && (what != '?' || print_anything)) {
+	q += sprintf(q,"%d%c", n, what);
+	print_anything = 1;
+      }
+      what = new_what;
+      n = 1;
+    } else {
+      n++;
+    }
+    if (!b) break;
+  }
+  printf("%7s", buf);
+}
+
+void list_visuals() {
+  using namespace fltk;
+  fltk::open_display();
+  XVisualInfo vTemplate;
+  int num;
+  XVisualInfo *visualList = XGetVisualInfo(xdisplay,0,&vTemplate,&num);
+
+  XPixmapFormatValues *pfvlist;
+  static int numpfv;
+  pfvlist = XListPixmapFormats(xdisplay, &numpfv);
+
+  OverlayInfo *overlayInfo = 0;
+  int numoverlayinfo = 0;
+  Atom overlayVisualsAtom = XInternAtom(xdisplay,"SERVER_OVERLAY_VISUALS",1);
+  if (overlayVisualsAtom) {
+    unsigned long sizeData, bytesLeft;
+    Atom actualType;
+    int actualFormat;
+    if (!XGetWindowProperty(xdisplay, RootWindow(xdisplay, xscreen),
+			   overlayVisualsAtom, 0L, 10000L, False,
+			   overlayVisualsAtom, &actualType, &actualFormat,
+			   &sizeData, &bytesLeft,
+			   (unsigned char **)(void*)&overlayInfo))
+      numoverlayinfo = int(sizeData/4);
+  }
+
+#if HAVE_MULTIBUF
+  int event_base, error_base;
+  XmbufBufferInfo *mbuf, *sbuf;
+  int nmbuf = 0, nsbuf = 0;
+  if (XmbufQueryExtension(xdisplay,&event_base, &error_base)) {
+    XmbufGetScreenInfo(xdisplay,RootWindow(xdisplay,xscreen),
+		       &nmbuf, &mbuf, &nsbuf, &sbuf);
+  }
+#endif
+
+#if HAVE_XDBE
+  int event_base, error_base;
+  int numdouble = 0;
+  XdbeVisualInfo *dbe = 0;
+  if (XdbeQueryExtension(xdisplay, &event_base, &error_base)) {
+    XWindow root = RootWindow(xdisplay,xscreen);
+    int numscreens = 1;
+    XdbeScreenVisualInfo *a = XdbeGetVisualInfo(xdisplay,&root,&numscreens);
+    if (!a) printf("error getting double buffer visuals\n");
+    else {
+      dbe = a->visinfo;
+      numdouble = a->count;
+    }
+  }
+#endif
+
+  for (int i=0; i<num; i++) {
+    XVisualInfo *p = visualList+i;
+
+    XPixmapFormatValues *pfv;
+    for (pfv = pfvlist; ; pfv++) {
+      if (pfv >= pfvlist+numpfv) {pfv = 0; break;} // should not happen!
+      if (pfv->depth == p->depth) break;
+    }
+
+    int j = pfv ? pfv->bits_per_pixel : 0;
+    printf(" %2ld: %s %2d/%d", p->visualid, ClassNames[p->c_class],
+	   p->depth, j);
+    if (j < 10) putchar(' ');
+
+    print_mask(p);
+
+    for (j=0; j<numoverlayinfo; j++) {
+      OverlayInfo *o = &overlayInfo[j];
+      if (o->overlay_visual == long(p->visualid)) {
+	printf(" overlay(");
+	if (o->transparent_type==1) printf("transparent pixel %ld, ",o->value);
+	else if (o->transparent_type==2) printf("transparent mask %ld, ",o->value);
+	else printf("opaque, ");
+	printf("layer %ld)", o->layer);
+      }
+    }
+
+#if HAVE_MULTIBUF
+    for (j=0; j<nmbuf; j++) {
+      XmbufBufferInfo *m = &mbuf[j];
+      if (m->visualid == p->visualid)
+	printf(" multibuffer(%d)", m->max_buffers);
+    }
+    for (j=0; j<nsbuf; j++) {
+      XmbufBufferInfo *m = &sbuf[j];
+      if (m->visualid == p->visualid)
+	printf(" stereo multibuffer(%d)", m->max_buffers);
+    }
+#endif
+
+#if HAVE_XDBE
+    for (j = 0; j < numdouble; j++) if (dbe[j].visual == p->visualid)
+      printf(" doublebuf(perflevel %d)",dbe[j].perflevel);
+#endif
+
+    if (p->visualid==XVisualIDFromVisual(DefaultVisual(xdisplay,xscreen)))
+      printf(" (default visual)");
+
+    putchar('\n');
+  }
+}
+
+#ifndef fltk_run_h
+#include <fltk/run.h>
+int main(int argc, char **argv) {
+  if (argc == 1);
+  else if (argc == 2 && argv[1][0]!='-') fltk::display(argv[1]);
+  else {fprintf(stderr,"usage: %s <display>\n",argv[0]); exit(1);}
+  list_visuals();
+  return 0;
+}
+#endif
+#endif
+
+//
+// End of "$Id: list_visuals.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $".
+//

Added: branches/branch-3.0/test2/makedepend
===================================================================

Added: branches/branch-3.0/test2/mandelbrot.cxx
===================================================================
--- branches/branch-3.0/test2/mandelbrot.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/mandelbrot.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,233 @@
+//
+// "$Id: mandelbrot.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $"
+//
+// Mandelbrot set demo for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2006 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+//    http://www.fltk.org/str.php
+//
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <fltk/run.h>
+#include <fltk/error.h>
+#include <fltk/draw.h>
+#include <fltk/visual.h>
+#include <fltk/events.h>
+#include <fltk/Widget.h>
+#include "mandelbrot_ui.h"
+
+DrawingWindow mbrot;
+DrawingWindow jbrot;
+
+void idle() {
+  if (!mbrot.d->idle() && !(jbrot.d && jbrot.d->idle())) fltk::set_idle(0);
+}
+
+void set_idle() {
+  fltk::set_idle(idle);
+}
+
+static void window_callback(fltk::Widget*, void*) {
+  exit(0);
+}
+
+int main(int argc, char **argv) {
+  mbrot.make_window();
+  mbrot.window->clear_double_buffer(); // otherwise make_current does not work
+  mbrot.d->X = -.75;
+  mbrot.d->scale = 2.5;
+  mbrot.update_label();
+  int i = 0;
+  if (fltk::args(argc, argv, i) < argc)
+    fltk::fatal(fltk::help);
+  fltk::visual(fltk::RGB);
+  mbrot.window->callback(window_callback);
+  mbrot.window->show(argc, argv);
+  return fltk::run();
+}
+
+void DrawingWindow::update_label() {
+  char buffer[128];
+  sprintf(buffer, "%+.10f", d->X); x_input->text(buffer);
+  sprintf(buffer, "%+.10f", d->Y); y_input->text(buffer);
+  sprintf(buffer, "%.2g", d->scale); w_input->text(buffer);
+}
+
+void DrawingArea::draw() {
+  draw_box();
+  drawn = 0;
+  set_idle();
+}
+
+int DrawingArea::idle() {
+  if (!window()->visible()) return 0;
+  if (drawn < nextline) {
+    make_current(); // deleted window-> from this for fltk2.0
+    int yy = drawn + 4;
+    if (yy >= sy && yy <= sy + sh) erase_box();
+    fltk::drawimage(buffer + drawn*W, fltk::MONO, fltk::Rectangle(3, yy, W, 1), W);
+    //fltk::draw_image_mono(buffer+drawn*W, 3,yy,W,1,1,W);
+    drawn++;
+    return 1;
+  }
+  if (nextline < H) {
+    if (!buffer) buffer = new uchar[W*H];
+    double yy = Y + (H / 2 - nextline) * scale / W;
+    double yi = yy; if (julia) yy = jY;
+    uchar *p = buffer + nextline * W;
+    for (int xi = 0; xi < W; xi++) {
+      double xx = X + (xi - W / 2) * scale / W;
+      double wx = xx; double wy = yi;
+      if (julia) xx = jX;
+      for (int i = 0; ; i++) {
+        if (i >= iterations) {
+          *p = 0; break;
+        }
+        double t = wx * wx - wy * wy + xx;
+        wy = 2 * wx * wy + yy;
+        wx = t;
+        if (wx*wx + wy*wy > 4) {
+          wx = t = 1 - double(i) / (1 << 10);
+          if (t <= 0) t = 0; else for (i = brightness; i--;) t *= wx;
+          *p = 255 - int(254 * t);
+          break;
+        }
+      }
+      p++;
+    }
+    nextline++;
+    return nextline < H;
+  }
+  return 0;
+}
+
+void DrawingArea::erase_box() {
+  make_current();
+  fltk::overlay_clear();
+}
+
+// For fltk2.0, all the occurances of x() and y() were replaced by 0:
+
+int DrawingArea::handle(int event) {
+  static int ix, iy;
+  static int dragged;
+  static int button;
+  int x2, y2;
+  switch (event) {
+    case fltk::PUSH:
+      erase_box();
+      ix = fltk::event_x(); if (ix < 0) ix = 0; if (ix >= w()) ix = w() - 1;
+      iy = fltk::event_y(); if (iy < 0) iy = 0; if (iy >= h()) iy = h() - 1;
+      dragged = 0;
+      button = fltk::event_button();
+      return 1;
+    case fltk::DRAG:
+      dragged = 1;
+      erase_box();
+      x2 = fltk::event_x(); if (x2 < 0) x2 = 0; if (x2 >= w()) x2 = w() - 1;
+      y2 = fltk::event_y(); if (y2 < 0) y2 = 0; if (y2 >= h()) y2 = h() - 1;
+      if (button != 1) {
+        ix = x2; iy = y2; return 1;
+      }
+      if (ix < x2) {
+        sx = ix; sw = x2 - ix;
+      } else {
+        sx = x2; sw = ix - x2;
+      }
+      if (iy < y2) {
+        sy = iy; sh = y2 - iy;
+      } else {
+        sy = y2; sh = iy - y2;
+      }
+      make_current();
+      fltk::overlay_rect(sx, sy, sw, sh);
+      return 1;
+    case fltk::RELEASE:
+      if (button == 1) {
+        erase_box();
+        if (dragged && sw > 3 && sh > 3) {
+          X = X + (sx + sw / 2 - W / 2) * scale / W;
+          Y = Y + (-sy - sh / 2 + H / 2) * scale / W;
+          scale = sw * scale / W;
+        } else if (!dragged) {
+          scale = 2 * scale;
+          if (julia) {
+            if (scale >= 4) {
+              scale = 4;
+              X = Y = 0;
+            }
+          } else {
+            if (scale >= 2.5) {
+              scale = 2.5;
+              X = -.75;
+              Y = 0;
+            }
+          }
+        } else return 1;
+        ((DrawingWindow*)(user_data()))->update_label();
+        new_display();
+      } else if (!julia) {
+        if (!jbrot.d) {
+          jbrot.make_window();
+          jbrot.window->clear_double_buffer(); // otherwise make_current does not work
+          jbrot.d->julia = 1;
+          jbrot.d->X = 0;
+          jbrot.d->Y = 0;
+          jbrot.d->scale = 4;
+          jbrot.update_label();
+        }
+        jbrot.d->jX = X + (ix - W / 2) * scale / W;
+        jbrot.d->jY = Y + (H / 2 - iy) * scale / W;
+        static char s[128];
+        sprintf(s, "Julia %.7f %.7f", jbrot.d->jX, jbrot.d->jY);
+        jbrot.window->label(s);
+        jbrot.window->show();
+        jbrot.d->new_display();
+      }
+      return 1;
+    default:
+      return Widget::handle(event);
+  }
+}
+
+void DrawingArea::new_display() {
+  drawn = nextline = 0;
+  set_idle();
+}
+
+#include <fltk/layout.h> // added for fltk2.0
+
+void DrawingArea::layout() {
+  if (layout_damage() & fltk::LAYOUT_WH) {
+    W = w() - 6;
+    H = h() - 8;
+    if (buffer) {
+      delete[] buffer; buffer = 0; new_display();
+    }
+  }
+  Widget::layout();
+}
+
+//
+// End of "$Id: mandelbrot.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $".
+//

Added: branches/branch-3.0/test2/mandelbrot.h
===================================================================
--- branches/branch-3.0/test2/mandelbrot.h	                        (rev 0)
+++ branches/branch-3.0/test2/mandelbrot.h	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,70 @@
+//
+// "$Id: mandelbrot.h 8500 2011-03-03 09:20:46Z bgbnbigben $"
+//
+// Mandelbrot set header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2006 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+//    http://www.fltk.org/str.php
+//
+
+#include <fltk/Widget.h>
+
+class DrawingArea : public fltk::Widget {
+  void draw();
+public:
+  uchar *buffer;
+  int W, H;
+  int nextline;
+  int drawn;
+  int julia;
+  int iterations;
+  int brightness;
+  double jX, jY;
+  double X, Y, scale;
+  int sx, sy, sw, sh; // selection box
+  void erase_box();
+  int handle(int);
+  void layout(); // resize() replaced by this for fltk2.0
+  void new_display();
+  enum {
+    MAX_BRIGHTNESS = 16,
+    DEFAULT_BRIGHTNESS = 16,
+    MAX_ITERATIONS = 14,
+    DEFAULT_ITERATIONS = 7
+  };
+  DrawingArea(int x, int y, int w, int h) : fltk::Widget(x, y, w, h) {
+    buffer = 0;
+    W = w - 6;
+    H = h - 8;
+    nextline = 0;
+    drawn = 0;
+    julia = 0;
+    X = Y = 0;
+    scale = 4.0;
+    iterations = 1 << DEFAULT_ITERATIONS;
+    brightness = DEFAULT_BRIGHTNESS;
+  }
+  int idle();
+};
+
+//
+// End of "$Id: mandelbrot.h 8500 2011-03-03 09:20:46Z bgbnbigben $".
+//

Added: branches/branch-3.0/test2/mandelbrot_ui.cxx
===================================================================
--- branches/branch-3.0/test2/mandelbrot_ui.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/mandelbrot_ui.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,138 @@
+// generated by Fast Light User Interface Designer (fluid) version 2.0100
+
+#include "mandelbrot_ui.h"
+
+inline void DrawingWindow::cb_x_input_i(fltk::FloatInput* o, void*) {
+  d->X = o->fvalue();
+  d->new_display();
+}
+void DrawingWindow::cb_x_input(fltk::FloatInput* o, void* v) {
+  ((DrawingWindow*)(o->parent()->user_data()))->cb_x_input_i(o, v);
+}
+
+inline void DrawingWindow::cb_y_input_i(fltk::FloatInput* o, void*) {
+  d->Y = o->fvalue();
+  d->new_display();
+}
+void DrawingWindow::cb_y_input(fltk::FloatInput* o, void* v) {
+  ((DrawingWindow*)(o->parent()->user_data()))->cb_y_input_i(o, v);
+}
+
+inline void DrawingWindow::cb_w_input_i(fltk::FloatInput* o, void*) {
+  d->scale = o->fvalue();
+  d->new_display();
+}
+void DrawingWindow::cb_w_input(fltk::FloatInput* o, void* v) {
+  ((DrawingWindow*)(o->parent()->user_data()))->cb_w_input_i(o, v);
+}
+
+inline void DrawingWindow::cb_brightness_i(fltk::Slider* o, void*) {
+  d->brightness = int(o->value());
+  d->new_display();
+}
+void DrawingWindow::cb_brightness(fltk::Slider* o, void* v) {
+  ((DrawingWindow*)(o->parent()->user_data()))->cb_brightness_i(o, v);
+}
+
+inline void DrawingWindow::cb_iterations_i(fltk::Slider* o, void*) {
+  d->iterations = 1 << int(o->value());
+  d->new_display();
+}
+void DrawingWindow::cb_iterations(fltk::Slider* o, void* v) {
+  ((DrawingWindow*)(o->parent()->user_data()))->cb_iterations_i(o, v);
+}
+
+void DrawingWindow::make_window() {
+  fltk::Window* w;
+  {
+    fltk::Window* o = window = new fltk::Window(430, 510);
+    w = o;
+    o->set_vertical();
+    o->user_data((void*)(this));
+    o->begin();
+    {
+      DrawingArea* o = d = new DrawingArea(10, 70, 410, 430);
+      o->set_vertical();
+      o->box(fltk::DOWN_BOX);
+      o->color((fltk::Color)56);
+      o->selection_color((fltk::Color)47);
+      o->user_data((void*)(this));
+      fltk::Group::current()->resizable(o);
+      o->tooltip("Left-click will zoom out by 2.\nLeft-drag will select a region to zoom in to.\
+                 \nRight-click will create the Julia set viewer and set it to that point.");
+    }
+    {
+      fltk::FloatInput* o = x_input = new fltk::FloatInput(10, 10, 130, 25, "x");
+      o->type(1);
+      o->labelfont(fltk::HELVETICA_ITALIC);
+      o->textfont(fltk::HELVETICA_BOLD);
+      o->labelsize(10);
+      o->callback((fltk::Callback*)cb_x_input);
+      o->align(fltk::ALIGN_LEFT | fltk::ALIGN_INSIDE);
+      o->tooltip("x coordinate of window center");
+      o->when(fltk::WHEN_ENTER_KEY | fltk::WHEN_RELEASE);
+    }
+    {
+      fltk::FloatInput* o = y_input = new fltk::FloatInput(150, 10, 130, 25, "y");
+      o->type(1);
+      o->labelfont(fltk::HELVETICA_ITALIC);
+      o->textfont(fltk::HELVETICA_BOLD);
+      o->labelsize(10);
+      o->callback((fltk::Callback*)cb_y_input);
+      o->align(fltk::ALIGN_LEFT | fltk::ALIGN_INSIDE);
+      o->tooltip("y coordinate of window center");
+      o->when(fltk::WHEN_ENTER_KEY | fltk::WHEN_RELEASE);
+    }
+    {
+      fltk::FloatInput* o = w_input = new fltk::FloatInput(290, 10, 130, 25, "w");
+      o->type(1);
+      o->labelfont(fltk::HELVETICA_ITALIC);
+      o->textfont(fltk::HELVETICA_BOLD);
+      o->labelsize(10);
+      o->callback((fltk::Callback*)cb_w_input);
+      o->align(fltk::ALIGN_LEFT | fltk::ALIGN_INSIDE);
+      o->tooltip("width of the window");
+      o->when(fltk::WHEN_ENTER_KEY | fltk::WHEN_RELEASE);
+    }
+    {
+      fltk::Slider* o = new fltk::Slider(70, 40, 160, 15, "brightness:");
+      o->box(fltk::THIN_DOWN_BOX);
+      o->labelsize(10);
+      o->step(1);
+      o->slider_size(16);
+      o->callback((fltk::Callback*)cb_brightness);
+      o->align(fltk::ALIGN_LEFT);
+      o->tooltip("Change mapping from iteration count to gray level so that details are visible\
+                 .");
+      o->range(0, d->MAX_BRIGHTNESS);
+      o->value(d->DEFAULT_BRIGHTNESS);
+      o->box(fltk::DOWN_BOX);
+      o->step(1 / d->MAX_BRIGHTNESS);
+    }
+    {
+      fltk::InvisibleBox* o = new fltk::InvisibleBox(240, 40, 180, 26, "FLTK Mandelbrot Viewer");
+      o->box(fltk::EMBOSSED_BOX);
+      o->labelfont(fltk::HELVETICA_BOLD);
+      o->labelsize(10);
+      o->align(fltk::ALIGN_RIGHT | fltk::ALIGN_INSIDE);
+      o->deactivate();
+    }
+    {
+      fltk::Slider* o = new fltk::Slider(70, 55, 160, 15, "iterations:");
+      o->box(fltk::THIN_DOWN_BOX);
+      o->labelsize(10);
+      o->step(1);
+      o->slider_size(16);
+      o->callback((fltk::Callback*)cb_iterations);
+      o->align(fltk::ALIGN_LEFT);
+      o->tooltip("Set number of iterations before it colors the pixel black. Higher values make\
+                 it more accurate.");
+      o->range(1, d->MAX_ITERATIONS);
+      o->value(d->DEFAULT_ITERATIONS);
+      o->box(fltk::DOWN_BOX);
+      o->step(1 / d->MAX_ITERATIONS);
+    }
+    o->end();
+    o->size_range(220, 220);
+  }
+}

Added: branches/branch-3.0/test2/mandelbrot_ui.fl
===================================================================
--- branches/branch-3.0/test2/mandelbrot_ui.fl	                        (rev 0)
+++ branches/branch-3.0/test2/mandelbrot_ui.fl	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,79 @@
+# data file for the FLTK User Interface Designer (FLUID)
+version 2.0002 
+header_name {.h} 
+code_name {.cxx} 
+gridx 10 
+gridy 10 
+snap 3
+decl {\#include "mandelbrot.h"} {public
+} 
+
+class Drawing_Window {open
+} {
+  Function {make_window()} {open return_type void
+  } {
+    {fltk::Window} window {open
+      xywh {142 207 430 510} resizable
+      extra_code {o->size_range(220,220);} visible
+    } {
+      {fltk::InvisibleBox} d {
+        user_data this user_data_type {void*}
+        tooltip {Left-click will zoom out by 2.
+Left-drag will select a region to zoom in to.
+Right-click will create the Julia set viewer and set it to that point.}
+        xywh {10 70 410 430} resizable box DOWN_BOX color 56 selection_color 47
+        class Drawing_Area
+      }
+      {fltk::Input} x_input {
+        label x
+        callback {d->X = o->fvalue();
+d->new_display();}
+        tooltip {x coordinate of window center}
+        xywh {10 10 130 25} type Float align 20 labelfont 2 textfont 1 labelsize 10
+        extra_code {o->when(FL_WHEN_ENTER_KEY|FL_WHEN_RELEASE);}
+      }
+      {fltk::Input} y_input {
+        label y
+        callback {d->Y = o->fvalue();
+d->new_display();}
+        tooltip {y coordinate of window center}
+        xywh {150 10 130 25} type Float align 20 labelfont 2 textfont 1 labelsize 10
+        extra_code {o->when(FL_WHEN_ENTER_KEY|FL_WHEN_RELEASE);}
+      }
+      {fltk::Input} w_input {
+        label w
+        callback {d->scale = o->fvalue();
+d->new_display();}
+        tooltip {width of the window}
+        xywh {290 10 130 25} type Float align 20 labelfont 2 textfont 1 labelsize 10
+        extra_code {o->when(FL_WHEN_ENTER_KEY|FL_WHEN_RELEASE);}
+      }
+      {fltk::Slider} {} {
+        label {brightness:}
+        callback {d->brightness = int(o->value());
+d->new_display();}
+        tooltip {Change mapping from iteration count to gray level so that details are visible.}
+        xywh {70 40 160 15} align 4 box THIN_DOWN_BOX labelsize 10 step 1 slider_size 16
+        extra_code {o->bounds(0,d->MAX_BRIGHTNESS);
+o->value(d->DEFAULT_BRIGHTNESS);
+o->slider(FL_UP_BOX);}
+      }
+      {fltk::InvisibleBox} {} {
+        label {FLTK Mandelbrot Viewer} selected
+        xywh {240 40 180 26} align 24 deactivate box EMBOSSED_BOX labelfont 1 labelsize 10
+      }
+      {fltk::Slider} {} {
+        label {iterations:}
+        callback {d->iterations = 1<<int(o->value());
+d->new_display();}
+        tooltip {Set number of iterations before it colors the pixel black. Higher values make it more accurate.}
+        xywh {70 55 160 15} align 4 box THIN_DOWN_BOX labelsize 10 step 1 slider_size 16
+        extra_code {o->bounds(1,d->MAX_ITERATIONS);
+o->value(d->DEFAULT_ITERATIONS);
+o->slider(FL_UP_BOX);}
+      }
+    }
+  }
+  decl {void update_label();} {public
+  }
+} 

Added: branches/branch-3.0/test2/mandelbrot_ui.h
===================================================================
--- branches/branch-3.0/test2/mandelbrot_ui.h	                        (rev 0)
+++ branches/branch-3.0/test2/mandelbrot_ui.h	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,37 @@
+// generated by Fast Light User Interface Designer (fluid) version 2.0100
+
+#ifndef mandelbrot_ui_h
+#define mandelbrot_ui_h
+#include "mandelbrot.h"
+#include <fltk/Window.h>
+#include <fltk/FloatInput.h>
+#include <fltk/Slider.h>
+#include <fltk/InvisibleBox.h>
+
+class DrawingWindow  {
+public:
+  fltk::Window *window;
+  void make_window();
+  DrawingArea *d;
+  fltk::FloatInput *x_input;
+private:
+  inline void cb_x_input_i(fltk::FloatInput*, void*);
+  static void cb_x_input(fltk::FloatInput*, void*);
+public:
+  fltk::FloatInput *y_input;
+private:
+  inline void cb_y_input_i(fltk::FloatInput*, void*);
+  static void cb_y_input(fltk::FloatInput*, void*);
+public:
+  fltk::FloatInput *w_input;
+private:
+  inline void cb_w_input_i(fltk::FloatInput*, void*);
+  static void cb_w_input(fltk::FloatInput*, void*);
+  inline void cb_brightness_i(fltk::Slider*, void*);
+  static void cb_brightness(fltk::Slider*, void*);
+  inline void cb_iterations_i(fltk::Slider*, void*);
+  static void cb_iterations(fltk::Slider*, void*);
+public:
+  void update_label();
+};
+#endif

Added: branches/branch-3.0/test2/menu.cxx
===================================================================
--- branches/branch-3.0/test2/menu.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/menu.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,200 @@
+// Test of the various subclasses of Menu
+
+#include <fltk/run.h>
+#include <fltk/Item.h>
+#include <fltk/ItemGroup.h>
+#include <fltk/Divider.h>
+#include <fltk/Window.h>
+#include <fltk/Box.h>
+#include <fltk/MenuBar.h>
+#include <fltk/PopupMenu.h>
+#include <fltk/InputBrowser.h>
+#include <fltk/Choice.h>
+#include <fltk/CycleButton.h>
+#include <fltk/Button.h>
+#include <fltk/draw.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <fltk/Slider.h>
+#include <fltk/StringList.h>
+#include <fltk/events.h>
+#include <fltk/ask.h>
+using namespace fltk;
+
+#define WIDTH 600
+#define HEIGHT 23
+
+void callback(Widget* w, void*) {
+  Menu* menu = (Menu*)w;
+  Widget* item = menu->get_item();
+  printf("Callback for %s, item is %s\n",
+	 menu->label() ? menu->label() : "menu bar",
+	 item ? item->label() ? item->label() : "unnamed" : "none");
+  if (item) item->do_callback();
+  printf("event_button = %d\n", fltk::event_button());
+}
+
+void never_cb(Widget* w, void*) {
+  alert("This callback should not be ever executed");
+}
+
+const char* const strings[] = {
+  "This","is","a","test","of","a","menu","defined","as a","StringArray"
+};
+StringArray thelist(strings, sizeof(strings)/sizeof(*strings));
+
+void build_hierarchy() {
+  Item* ii = new Item("&Alpha");
+  ii->when(WHEN_NEVER);
+  ii->callback(never_cb);
+  new Item("&Beta");
+  new Item("&Gamma");
+  new Item("&Delta");
+  new Item("&Epsilon");
+  ItemGroup* g = new ItemGroup("submenu&1");
+  g->begin();
+  new Item("Item &1");
+  new Item("Item &2");
+  new Item("Item &3");
+  new Item("Item &4");
+  g->end();
+  // now using MenuSection facility:
+  {MenuSection g("submenu&2");
+      (new Item("Item &1"))->textsize(10);
+      (new Item("Item &2"))->textsize(14);
+      (new Item("Item &3"))->textsize(18);
+      (new Item("Item &4"))->textsize(22);
+      //g->deactivate();
+      {MenuSection g1("&nested menu");
+	  new Item("Item &1");
+	  new Item("Item &2");
+	  {MenuSection g2("deeper");
+	      (new Item("Very low level items"))->deactivate();
+	      (new Item("Are here on this menu"))->deactivate();
+	      new Item("In this test");
+	      new Item("Program");
+	  }
+      }
+  }
+}
+
+void quit_cb(Widget*, void*) {exit(0);}
+
+class ListShortcuts : public ShortcutFunctor {
+public:
+  bool handle(const Widget* widget, unsigned key) {
+    printf("Widget=%s shortcut=%s\n", widget->label() ? widget->label() : "NULL", key_name(key));
+    return false;
+  }
+} listShortcuts;
+
+int main(int argc, char **argv) {
+  Window window(WIDTH,400);
+  window.begin();
+  MenuBar menubar(0,0,WIDTH,HEIGHT);
+  menubar.callback(callback);
+  menubar.begin();
+
+  ItemGroup file("&File");
+  file.begin();
+  Item* o = new Item("Quit");
+  o->shortcut(COMMAND+'q');
+  o->callback(quit_cb);
+  new Divider();
+  (new Slider(0,0,100,30))->value(.3);
+  build_hierarchy();
+  file.end();
+  ItemGroup edit("&Edit");
+  edit.begin();
+  (new Item("Undo"))->shortcut(COMMAND+'z');
+  (new Item("Cut"))->shortcut(COMMAND+'x');
+  (new Item("Copy"))->shortcut(COMMAND+'c');
+  (new Item("Paste"))->shortcut(COMMAND+'v');
+  build_hierarchy();
+  edit.end();
+  //edit.deactivate();
+  ItemGroup options("&Options");
+  options.begin();
+  o = new Item("Red"); o->type(Item::RADIO);
+  o = new Item("Green"); o->type(Item::RADIO);
+  o = new Item("Blue"); o->type(Item::RADIO);
+  o = new Item("Aqua"); o->type(Item::RADIO);
+  o = new Item("Toggle 1"); o->type(Item::TOGGLE);
+  o = new Item("Toggle 2"); o->type(Item::TOGGLE);
+  o = new Item("Toggle 3"); o->type(Item::TOGGLE);
+  o = new Item("Toggle 4"); o->type(Item::TOGGLE);
+  options.end();
+  new Divider();
+  Item item("&Toggle"); item.type(Item::TOGGLE);
+  Item but("&button");
+  menubar.end();
+  menubar.tooltip("This is a menu bar");
+
+  const int VWIDTH=100;
+
+  MenuBar mb0(0,HEIGHT,VWIDTH,400-HEIGHT);
+  mb0.set_vertical();
+  mb0.begin();
+  build_hierarchy();
+  mb0.end();
+
+  Widget box(VWIDTH,HEIGHT,WIDTH-VWIDTH,400-HEIGHT);
+  //box.color(WHITE);
+  box.box(fltk::DOWN_BOX);
+  box.tooltip("Press right button for a pop-up menu");
+
+  PopupMenu mb(VWIDTH,HEIGHT,WIDTH-VWIDTH,400-HEIGHT, "popup");
+  mb.callback(callback);
+  mb.begin();
+  build_hierarchy();
+  mb.end();
+  mb.type(PopupMenu::POPUP3);
+
+  int x = 180;
+  int y = 50;
+
+  PopupMenu mb1(x,y,100,25,"&PopupMenu");
+  mb1.callback(callback);
+  mb1.begin();
+  build_hierarchy();
+  mb1.end();
+  mb1.tooltip("This is a menu button");
+  y += 60;
+
+  Choice ch(x,y,100,25,"&choice:");
+  ch.callback(callback);
+  ch.begin();
+  build_hierarchy();
+  ch.end();
+  ch.tooltip("This is a choice");
+  y += 60;
+
+  CycleButton cb(x,y,100,25,"&cycle:");
+  cb.callback(callback);
+  cb.list(&thelist);
+  cb.tooltip("This is a cyclebutton");
+  y += 60;
+
+  InputBrowser ib(x,y,100,25,"Input&Browser:");
+  ib.type(InputBrowser::INDENTED);
+  ib.callback(callback);
+  ib.when(fltk::WHEN_CHANGED);
+  ib.begin();
+  build_hierarchy();
+  ib.end();
+  ib.tooltip("This is an InputBrowser");
+  y += 60;
+
+  Button button(x+200,y,100,30,"button");
+  button.tooltip("This is to test if clicking here to exit menus pushes the button");
+
+  window.resizable(box);
+  window.size_range(300,20);
+  window.end();
+  window.show(argc, argv);
+
+  foreachShortcut(listShortcuts);
+
+  return run();
+}

Added: branches/branch-3.0/test2/menubar.cxx
===================================================================
--- branches/branch-3.0/test2/menubar.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/menubar.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,293 @@
+//
+// "$Id: menubar.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $"
+//
+// Menubar test program for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2006 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+//    http://www.fltk.org/str.php
+//
+
+// Use compat header for Fl_Menu_Item
+#include <FL/Fl_Menu_Item.H>
+
+#include <fltk/run.h>
+#include <fltk/events.h>
+#include <fltk/Output.h>
+#include <fltk/Box.h>
+#include <fltk/Window.h>
+#include <fltk/MenuBar.h>
+#include <fltk/ToggleButton.h>
+#include <fltk/PopupMenu.h>
+#include <fltk/Choice.h>
+#include <fltk/Tooltip.h>
+#include <fltk/draw.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <fltk/string.h>
+
+#ifdef __APPLE__
+#include <fltk/SystemMenuBar.h>
+#endif
+
+fltk::Window *window;
+
+fltk::Menu* menus[4];
+
+void test_cb(fltk::Widget* w, void*)
+{
+  fltk::Menu* mw = (fltk::Menu*)w;
+  fltk::Widget* m = mw->item();
+  if (!m)
+    printf("NULL\n");
+  else if (m->shortcut())
+    printf("%s - %s\n", m->label(), fltk::key_name(m->shortcut()));
+  else
+    printf("%s\n", m->label());
+
+  if (!strcmp("item 77", m->label())) {
+    if (mw->find("button")) mw->replace("button", "Spitzak");
+    else mw->replace("Spitzak", "button");
+    menus[0]->redraw();
+  }
+
+  m->do_callback();
+}
+
+void quit_cb(fltk::Widget*, void*) { exit(0); }
+
+Fl_Menu_Item hugemenu[100];
+
+Fl_Menu_Item menutable[] = {
+  {"foo",0,0,0,FL_MENU_INACTIVE},
+  {"&File",0,0,0,FL_SUBMENU},
+    {"&Open",	fltk::COMMAND+'O', 0, 0, FL_MENU_INACTIVE},
+    {"&Close",	0,	0},
+    {"&Quit",	fltk::COMMAND+'Q', quit_cb, 0, fltk::MENU_DIVIDER},
+    {"shortcut",'A'},
+    {"shortcut",fltk::SHIFT+'A'},
+    {"shortcut",fltk::COMMAND+'A'},
+    {"shortcut",fltk::COMMAND+fltk::SHIFT+'A'},
+    {"shortcut",fltk::ACCELERATOR+'A'},
+    {"shortcut",fltk::ACCELERATOR+fltk::SHIFT+'A'},
+    {"shortcut",fltk::ACCELERATOR+fltk::COMMAND+'A'},
+    {"shortcut",fltk::ACCELERATOR+fltk::SHIFT+fltk::COMMAND+'A', 0,0, fltk::MENU_DIVIDER},
+    {"shortcut",fltk::ReturnKey},
+    {"shortcut",fltk::COMMAND+fltk::ReturnKey, 0,0, fltk::MENU_DIVIDER},
+    {"shortcut",fltk::F1Key},
+    {"shortcut",fltk::SHIFT+fltk::F1Key},
+    {"shortcut",fltk::COMMAND+fltk::F1Key},
+    {"shortcut",fltk::SHIFT+fltk::COMMAND+fltk::F1Key},
+    {"shortcut",fltk::ACCELERATOR+fltk::F1Key},
+    {"shortcut",fltk::ACCELERATOR+fltk::SHIFT+fltk::F1Key},
+    {"shortcut",fltk::ACCELERATOR+fltk::COMMAND+fltk::F1Key},
+    {"shortcut",fltk::ACCELERATOR+fltk::SHIFT+fltk::COMMAND+fltk::F1Key, 0,0, fltk::MENU_DIVIDER},
+    {"&Submenus", fltk::ACCELERATOR+'S',	0, (void*)"Submenu1", FL_SUBMENU},
+      {"A very long menu item"},
+      {"&submenu",fltk::COMMAND+'S',	0, (void*)"submenu2", FL_SUBMENU},
+	{"item 1"},
+	{"item 2"},
+	{"item 3"},
+	{"item 4"},
+	{0},
+      {"after submenu"},
+      {0},
+    {0},
+  {"&Edit",0,0,0,FL_SUBMENU},
+    {"Undo",	fltk::COMMAND+'Z',	0},
+    {"Redo",	fltk::COMMAND+'Y',	0, 0, fltk::MENU_DIVIDER},
+    {"Cut",	fltk::COMMAND+'X',	0},
+    {"Copy",	fltk::COMMAND+'C',	0},
+    {"Paste",	fltk::COMMAND+'V',	0},
+    {"Inactive",fltk::COMMAND+'D',	0, 0, FL_MENU_INACTIVE},
+    {"Clear",	0,	0, 0, fltk::MENU_DIVIDER},
+    {"Invisible",fltk::COMMAND+'E',	0, 0, FL_MENU_INVISIBLE},
+    {"Preferences",0,	0},
+    {"Larger", '+', 0, 0},
+    {"Smaller", '-', 0, 0},
+    {0},
+  {"&Checkbox",0,0,0,FL_SUBMENU},
+    {"&Alpha",	0,	0, (void *)1, fltk::MENU_TOGGLE|FL_MENU_VALUE},
+    {"&Beta",	0,	0, (void *)2, fltk::MENU_TOGGLE},
+    {"&Gamma",	0,	0, (void *)3, fltk::MENU_TOGGLE},
+    {"&Delta",	0,	0, (void *)4, fltk::MENU_TOGGLE|FL_MENU_VALUE},
+    {"&Epsilon",0,	0, (void *)5, fltk::MENU_TOGGLE},
+    {"&Pi",	0,	0, (void *)6, fltk::MENU_TOGGLE},
+    {"&Mu",	0,	0, (void *)7, fltk::MENU_TOGGLE|fltk::MENU_DIVIDER},
+    {"Red",	0,	0, (void *)1, fltk::MENU_TOGGLE},
+    {"Black",	0,	0, (void *)1, fltk::MENU_TOGGLE|fltk::MENU_DIVIDER},
+    {"00",	0,	0, (void *)1, fltk::MENU_TOGGLE},
+    {"000",	0,	0, (void *)1, fltk::MENU_TOGGLE},
+    {0},
+  {"&Radio",0,0,0,FL_SUBMENU},
+    {"&Alpha",	0,	0, (void *)1, fltk::MENU_RADIO},
+    {"&Beta",	0,	0, (void *)2, fltk::MENU_RADIO},
+    {"&Gamma",	0,	0, (void *)3, fltk::MENU_RADIO},
+    {"&Delta",	0,	0, (void *)4, fltk::MENU_RADIO|FL_MENU_VALUE},
+    {"&Epsilon",0,	0, (void *)5, fltk::MENU_RADIO},
+    {"&Pi",	0,	0, (void *)6, fltk::MENU_RADIO},
+    {"&Mu",	0,	0, (void *)7, fltk::MENU_RADIO|fltk::MENU_DIVIDER},
+    {"Red",	0,	0, (void *)1, fltk::MENU_RADIO},
+    {"Black",	0,	0, (void *)1, fltk::MENU_RADIO|fltk::MENU_DIVIDER},
+    {"00",	0,	0, (void *)1, fltk::MENU_RADIO},
+    {"000",	0,	0, (void *)1, fltk::MENU_RADIO},
+    {0},
+  {"&Font",0,0,0,FL_SUBMENU},
+    {"Normal",	0, 0},
+    {"Bold",	0, 0},
+    {"Italic",	0, 0},
+    {"BoldItalic",0,0},
+    {"Small",	0, 0},
+    {"Large",	0, 0},
+    {"Emboss",	0, 0},
+    {"Engrave",	0, 0},
+    {"Shadow",	0, 0},
+    {"@->",	0, 0},
+    {0},
+  {"E&mpty",0,0,0,FL_SUBMENU},
+    {0},
+  {"&Inactive", 0,	0, 0, FL_MENU_INACTIVE|FL_SUBMENU},
+    {"A very long menu item"},
+    {"A very long menu item"},
+    {0},
+  {"Invisible",0,	0, 0, FL_MENU_INVISIBLE|FL_SUBMENU},
+    {"A very long menu item"},
+    {"A very long menu item"},
+    {0},
+  {"&Huge", 0, 0, (void*)hugemenu, FL_SUBMENU_POINTER},
+  // these buttons demonstrates that the menubar can be used as a "toolbar"
+  {"@[]"}, {"@<->"}, {"@+"},
+  // it would be nice if checkmarks worked, but they don't:
+  //{"toggle",0, 0, 0, fltk::MENU_TOGGLE},
+  {0}
+};
+
+Fl_Menu_Item pulldown[] = {
+  {"Red",	fltk::ACCELERATOR+'r'},
+  {"Green",	fltk::ACCELERATOR+'g'},
+  {"Blue",	fltk::ACCELERATOR+'b'},
+  {"Strange",	fltk::ACCELERATOR+'s'},
+  {"&Charm",	fltk::ACCELERATOR+'c'},
+  {"Truth",	fltk::ACCELERATOR+'t'},
+  {"Beauty",	fltk::ACCELERATOR+'b'},
+  {0}
+};
+
+#define WIDTH 600
+#define HEIGHT 22 //30 // use 25 for better Windoze look
+
+int main(int argc, char **argv)
+{
+  for (int i=0; i<99; i++) {
+    char buf[100];
+    sprintf(buf,"item %d",i);
+    hugemenu[i].text = newstring(buf);
+  }
+
+  fltk::Window window(WIDTH,400);
+  window.color(fltk::WHITE);
+  window.tooltip("Press right button\nfor a pop-up menu");
+  window.begin();
+
+  fltk::MenuBar menubar(0,0,WIDTH,HEIGHT); menubar.menu(menutable);
+  menubar.find("&Font/Normal")->labelfont(fltk::HELVETICA);
+  menubar.find("&Font/Bold")->labelfont(fltk::HELVETICA_BOLD);
+  menubar.find("&Font/Italic")->labelfont(fltk::HELVETICA_ITALIC);
+  menubar.find("&Font/BoldItalic")->labelfont(fltk::HELVETICA_BOLD_ITALIC);
+  menubar.find("&Font/Small")->labelsize(10);
+  menubar.find("&Font/Large")->labelsize(24);
+  menubar.find("&Font/Emboss")->labeltype(fltk::EMBOSSED_LABEL);
+  menubar.find("&Font/Engrave")->labeltype(fltk::ENGRAVED_LABEL);
+  menubar.find("&Font/Shadow")->labeltype(fltk::SHADOW_LABEL);
+  menubar.find("&Font/@->")->labeltype(fltk::SYMBOL_LABEL);
+  menubar.find("&Checkbox/Red")->labelcolor(fltk::RED); // label text red
+  menubar.find("&Checkbox/Red")->selection_textcolor(fltk::RED); // label text red when selected
+  menubar.find("&Checkbox/Red")->textcolor(fltk::RED); // check mark red
+  menubar.find("&Checkbox/Black")->labelcolor(fltk::BLACK);
+  menubar.find("&Checkbox/Black")->selection_textcolor(fltk::BLACK);
+  menubar.find("&Checkbox/Black")->textcolor(fltk::BLACK);
+  menubar.find("&Radio/Red")->labelcolor(fltk::RED);
+  menubar.find("&Radio/Red")->selection_textcolor(fltk::RED);
+  menubar.find("&Radio/Red")->textcolor(fltk::RED);
+  menubar.find("&Radio/Black")->labelcolor(fltk::BLACK);
+  menubar.find("&Radio/Black")->selection_textcolor(fltk::BLACK);
+  menubar.find("&Radio/Black")->textcolor(fltk::BLACK);
+  //menubar.find("&Huge/item 69")->deactivate();
+  menubar.callback(test_cb);
+  menubar.tooltip("This is a menu bar");
+  menus[0] = &menubar;
+
+  fltk::PopupMenu mb1(100,100,120,25,"&menubutton"); mb1.menu(pulldown);
+  mb1.callback(test_cb);
+  mb1.tooltip("This is a menu button");
+  menus[1] = &mb1;
+
+  fltk::Choice ch(300,100,90,25,"&choice:"); ch.menu(pulldown);
+  ch.callback(test_cb);
+  ch.tooltip("This is a choice");
+  menus[2] = &ch;
+
+  fltk::PopupMenu mb(0,25,WIDTH,400-HEIGHT/*,"&popup"*/);
+  mb.type(fltk::PopupMenu::POPUP3);
+  mb.menu(menutable);
+  mb.callback(test_cb);
+  menus[3] = &mb;
+
+  window.resizable(&mb);
+  window.size_range(300,20);
+  window.end();
+  window.show(argc, argv);
+
+#ifdef __APPLE__
+  fltk::SystemMenuBar sysmb(0, 0, 1, 1);
+  sysmb.menu(menutable);
+  sysmb.find("&Font/Normal")->labelfont(fltk::HELVETICA);
+  sysmb.find("&Font/Bold")->labelfont(fltk::HELVETICA_BOLD);
+  sysmb.find("&Font/Italic")->labelfont(fltk::HELVETICA_ITALIC);
+  sysmb.find("&Font/BoldItalic")->labelfont(fltk::HELVETICA_BOLD_ITALIC);
+  sysmb.find("&Font/Small")->labelsize(10);
+  sysmb.find("&Font/Large")->labelsize(24);
+  sysmb.find("&Font/Emboss")->labeltype(fltk::EMBOSSED_LABEL);
+  sysmb.find("&Font/Engrave")->labeltype(fltk::ENGRAVED_LABEL);
+  sysmb.find("&Font/Shadow")->labeltype(fltk::SHADOW_LABEL);
+  sysmb.find("&Font/@->")->labeltype(fltk::SYMBOL_LABEL);
+  sysmb.find("&Checkbox/Red")->labelcolor(fltk::RED); // label text red
+  sysmb.find("&Checkbox/Red")->selection_textcolor(fltk::RED); // label text red when selected
+  sysmb.find("&Checkbox/Red")->textcolor(fltk::RED); // check mark red
+  sysmb.find("&Checkbox/Black")->labelcolor(fltk::BLACK);
+  sysmb.find("&Checkbox/Black")->selection_textcolor(fltk::BLACK);
+  sysmb.find("&Checkbox/Black")->textcolor(fltk::BLACK);
+  sysmb.find("&Radio/Red")->labelcolor(fltk::RED);
+  sysmb.find("&Radio/Red")->selection_textcolor(fltk::RED);
+  sysmb.find("&Radio/Red")->textcolor(fltk::RED);
+  sysmb.find("&Radio/Black")->labelcolor(fltk::BLACK);
+  sysmb.find("&Radio/Black")->selection_textcolor(fltk::BLACK);
+  sysmb.find("&Radio/Black")->textcolor(fltk::BLACK);
+  sysmb.callback(test_cb);
+  sysmb.layout();
+#endif
+
+  return fltk::run();
+}
+
+//
+// End of "$Id: menubar.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $".
+//

Added: branches/branch-3.0/test2/message.cxx
===================================================================
--- branches/branch-3.0/test2/message.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/message.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,63 @@
+//
+// "$Id: message.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $"
+//
+// Message test program for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2006 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+//    http://www.fltk.org/str.php
+//
+
+#include <fltk/ask.h>
+#include <fltk/run.h>
+#include <stdio.h>
+
+int main(int argc, char **argv) {
+
+  fltk::args(argc, argv);
+
+  if(!fltk::ask("Do you want to disable beep sounds ?", "continue"))
+      fltk::beep_on_dialog(true);
+  fltk::message("Spelling check sucessfull, %d errors found with %g%% confidence",
+	     1002, 100*(15/77.0));
+
+  fltk::alert("Quantum fluctuations in the space-time continuum detected, "
+	   "you have %g seconds to comply.", 10.0);
+
+  printf("fltk::ask returned %d\n",
+    fltk::ask("Do you really want to %s?", "continue"));
+
+  printf("fltk::choice returned %d\n",
+    fltk::choice("Choose one of the following:","choice0","choice1","choice2"));
+  const char *r;
+
+  r = fltk::input("Please enter a string for '%s':", "this is the default value",
+	       "testing");
+  printf("fltk::input returned \"%s\"\n", r ? r : "NULL");
+
+  r = fltk::password("Enter %s's password:", 0, "somebody");
+  printf("fltk::password returned \"%s\"\n", r ? r : "NULL");
+
+  return 0;
+}
+
+//
+// End of "$Id: message.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $".
+//

Added: branches/branch-3.0/test2/monitors.cxx
===================================================================
--- branches/branch-3.0/test2/monitors.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/monitors.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,92 @@
+// Test of the fltk::Monitor calls
+
+#include <fltk/run.h>
+#include <fltk/Window.h>
+#include <fltk/Monitor.h>
+#include <fltk/draw.h>
+#include <stdio.h>
+
+using namespace fltk;
+
+void print_monitor(const Monitor& m, int i) {
+  if (i < 0) printf("all: ");
+  else printf("%d: ", i);
+  printf("area %d %d %d %d, work %d %d %d %d, depth %d, dpi %g %g\n",
+         m.x(), m.y(), m.w(), m.h(),
+         m.work.x(), m.work.y(), m.work.w(), m.work.h(),
+         m.depth(), m.dpi_x(), m.dpi_y());
+}
+
+class MonitorWindow : public Window {
+public:
+  MonitorWindow() : Window(500,500) {resizable(this);}
+
+  void draw_monitor(const Monitor& m, int i) {
+    setcolor(GRAY50);
+    strokerect(m.work);
+    setcolor(BLACK);
+    strokerect(m);
+    char b[256];
+    char* p = b;
+    if (i < 0) p += sprintf(p,"all: ");
+    else p += sprintf(p, "%d: ", i);
+    sprintf(p, "area %d %d %d %d\nwork %d %d %d %d\ndepth %d, dpi %g %g",
+            m.x(), m.y(), m.w(), m.h(),
+            m.work.x(), m.work.y(), m.work.w(), m.work.h(),
+            m.depth(), m.dpi_x(), m.dpi_y());
+    if (i < 0)
+      drawtext(b, Rectangle(m.x(),m.b(),m.w(),1000), ALIGN_TOP|ALIGN_RIGHT|ALIGN_WRAP);
+    else 
+      drawtext(b, m, ALIGN_CENTER|ALIGN_WRAP|ALIGN_CLIP);
+  }
+
+  void draw() {
+    draw_box();
+    setfont(textfont(), textsize());
+    const Monitor& all = Monitor::all();
+    push_matrix();
+    translate(w()/10,h()/10);
+    float s = w()*.8/all.w();
+    float s2 = h()*.8/all.h();
+    if (s2 < s) s = s2;
+    scale(s,s);
+    translate(-all.x(), -all.y());
+
+    setcolor(GRAY25);
+    Rectangle b; borders(&b);
+    fillrect(this->x()+b.x(), this->y()+b.y(), this->w()+b.w(), this->h()+b.h());
+    setcolor(GRAY50);
+    fillrect(*this);
+    setcolor(WHITE);
+    drawtext("this window", *this, ALIGN_CENTER|ALIGN_WRAP|ALIGN_CLIP);
+
+    draw_monitor(all, -1);
+
+    const Monitor* list;
+    int size = Monitor::list(&list);
+    for (int i=0; i<size; i++)
+      draw_monitor(list[i], i);
+
+    pop_matrix();
+  }
+
+  void layout() { // make it redraw when user moves window
+    redraw();
+    Window::layout();
+  }
+};
+
+int main(int argc, char** argv) {
+  MonitorWindow window;
+  window.show(argc,argv);
+
+  print_monitor(Monitor::all(),-1);
+
+  const Monitor* list;
+  int size = Monitor::list(&list);
+
+  for (int i=0; i<size; i++)
+    print_monitor(list[i],i);
+
+  return fltk::run();
+}

Added: branches/branch-3.0/test2/navigation.cxx
===================================================================
--- branches/branch-3.0/test2/navigation.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/navigation.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,75 @@
+//
+// "$Id: navigation.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $"
+//
+// Navigation test program for the Fast Light Tool Kit (FLTK).
+//
+// Silly test of navigation keys. This is not a recommended method of
+// laying out your panels!
+//
+// Copyright 1998-2006 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+//    http://www.fltk.org/str.php
+//
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <fltk/run.h>
+#include <fltk/Window.h>
+#include <fltk/Input.h>
+
+#define WIDTH 600
+#define HEIGHT 300
+#define GRID 25
+
+using namespace fltk;
+
+int main(int argc, char **argv) {
+  if (argc > 1) srand(atoi(argv[1]));
+  Window window(WIDTH,HEIGHT,argv[0]);
+  window.end(); // don't auto-add children
+  for (int i = 0; i<10000; i++) {
+    // make up a random size of widget:
+    int x = rand()%(WIDTH/GRID+1) * GRID;
+    int y = rand()%(HEIGHT/GRID+1) * GRID;
+    int w = rand()%(WIDTH/GRID+1) * GRID;
+    if (w < x) {w = x-w; x-=w;} else {w = w-x;}
+    int h = rand()%(HEIGHT/GRID+1) * GRID;
+    if (h < y) {h = y-h; y-=h;} else {h = h-y;}
+    if (w < GRID || h < GRID || w < h) continue;
+    // find where to insert it and see if it intersects something:
+    Widget *j = 0;
+    int n; for (n=0; n < window.children(); n++) {
+      Widget *o = window.child(n);
+      if (x<o->x()+o->w() && x+w>o->x() &&
+	  y<o->y()+o->h() && y+h>o->y()) break;
+      if (!j && (y < o->y() || (y == o->y() && x < o->x()))) j = o;
+    }
+    // skip if intersection:
+    if (n < window.children()) continue;
+    window.insert(*(new Input(x,y,w,h)),j);
+  }
+  window.resizable(window);
+  window.show();
+  return fltk::run();
+}
+
+//
+// End of "$Id: navigation.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $".
+//

Added: branches/branch-3.0/test2/output.cxx
===================================================================
--- branches/branch-3.0/test2/output.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/output.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,113 @@
+//
+// "$Id: output.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $"
+//
+// Output test program for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2006 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+//    http://www.fltk.org/str.php
+//
+
+#include <fltk/run.h>
+#include <fltk/ValueInput.h> // necessary for bug in mingw32?
+#include <fltk/Window.h>
+#include <fltk/Box.h>
+#include <fltk/ToggleButton.h>
+#include <fltk/Input.h>
+#include <fltk/draw.h>
+#include <fltk/Output.h>
+#include <fltk/MultiLineOutput.h>
+#include <fltk/ValueSlider.h>
+#include <fltk/Font.h>
+
+using namespace fltk;
+
+Output *text;
+MultiLineOutput *text2;
+Input *input;
+ValueSlider *fonts;
+ValueSlider *sizes;
+Window *window;
+
+void font_cb(Widget *,void *) {
+  text->textfont(font(int(fonts->value())));
+  text->redraw();
+  text2->textfont(font(int(fonts->value())));
+  text2->redraw();
+}
+
+void size_cb(Widget *,void *) {
+  text->textsize(int(sizes->value()));
+  text->redraw();
+  text2->textsize(int(sizes->value()));
+  text2->redraw();
+}
+
+void input_cb(Widget *,void *) {
+  text->value(input->value());
+  text2->value(input->value());
+}
+
+static const char* const initial_value =
+"The quick brown fox\njumps over\nthe lazy dog.";
+
+int main(int argc, char **argv) {
+  window = new Window(400,400);
+  window->begin();
+  text = new Output(100,90,200,30,"Output");
+  text->value(initial_value);
+  text->clear_flag(fltk::ALIGN_MASK);
+  text->set_flag(fltk::ALIGN_BOTTOM);
+
+  text2 = new MultiLineOutput(100,150,200,100,"MultiLineOutput");
+  text2->value(initial_value);
+  text2->clear_flag(fltk::ALIGN_MASK);
+  text2->set_flag(fltk::ALIGN_BOTTOM);
+  window->resizable(text2);
+
+  fonts = new ValueSlider(50,325,350,25,"Font");
+  fonts->clear_flag(fltk::ALIGN_MASK);
+  fonts->set_flag(fltk::ALIGN_LEFT);
+  fonts->range(0,15);
+  fonts->step(1);
+  fonts->value(0);
+  fonts->callback(font_cb);
+
+  sizes = new ValueSlider(50,350,350,25,"Size");
+  sizes->clear_flag(fltk::ALIGN_MASK);
+  sizes->set_flag(fltk::ALIGN_LEFT);
+  sizes->range(1,64);
+  sizes->step(1);
+  sizes->value(14);
+  sizes->callback(size_cb);
+
+  input = new Input(50,375,350,25);
+  input->static_value(initial_value);
+  input->when(fltk::WHEN_CHANGED);
+  input->callback(input_cb);
+
+  window->end();
+  window->show(argc,argv);
+  return fltk::run();
+}
+
+//
+// End of "$Id: output.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $".
+//

Added: branches/branch-3.0/test2/overlay.cxx
===================================================================
--- branches/branch-3.0/test2/overlay.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/overlay.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,87 @@
+//
+// "$Id: overlay.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $"
+//
+// Overlay window test program for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2006 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+//    http://www.fltk.org/str.php
+//
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <FL/Fl.H>
+#include <FL/Fl_Window.H>
+#include <FL/Fl_Overlay_Window.H>
+#include <FL/Fl_Button.H>
+#include <FL/fl_draw.H>
+
+int width=10,height=10;
+
+class overlay : public Fl_Overlay_Window {
+public:
+  overlay(int w,int h) : Fl_Overlay_Window(w,h) {}
+  void draw_overlay();
+};
+
+void overlay::draw_overlay() {
+  fl_color(FL_RED);
+  fl_rect((w()-::width)/2,(h()-::height)/2,::width,::height);
+}
+
+overlay *ovl;
+
+void bcb1(Fl_Widget *,void *) {width+=20; ovl->redraw_overlay();}
+void bcb2(Fl_Widget *,void *) {width-=20; ovl->redraw_overlay();}
+void bcb3(Fl_Widget *,void *) {height+=20; ovl->redraw_overlay();}
+void bcb4(Fl_Widget *,void *) {height-=20; ovl->redraw_overlay();}
+
+int arg(int, char **argv, int& i) {
+  Fl_Color n = (Fl_Color)atoi(argv[i]);
+  if (n<=0) return 0;
+  i++;
+  uchar r,g,b;
+  Fl::get_color(n,r,g,b);
+  Fl::set_color(FL_RED,r,g,b);
+  return i;
+}
+
+int main(int argc, char **argv) {
+  int i=0; Fl::args(argc,argv,i,arg);
+  ovl = new overlay(400,400);
+  Fl_Button *b;
+  b = new Fl_Button(50,50,100,100,"wider\n(a)");
+  b->callback(bcb1); b->shortcut('a');
+  b = new Fl_Button(250,50,100,100,"narrower\n(b)");
+  b->callback(bcb2); b->shortcut('b');
+  b = new Fl_Button(50,250,100,100,"taller\n(c)");
+  b->callback(bcb3); b->shortcut('c');
+  b = new Fl_Button(250,250,100,100,"shorter\n(d)");
+  b->callback(bcb4); b->shortcut('d');
+  ovl->resizable(ovl);
+  ovl->end();
+  ovl->show(argc,argv);
+  ovl->redraw_overlay();
+  return Fl::run();
+}
+
+//
+// End of "$Id: overlay.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $".
+//

Added: branches/branch-3.0/test2/pack.cxx
===================================================================
--- branches/branch-3.0/test2/pack.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/pack.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,38 @@
+#include <fltk/run.h>
+#include <fltk/Window.h>
+#include <fltk/BarGroup.h>
+#include <fltk/PackedGroup.h>
+using namespace fltk;
+
+BarGroup* makebar(const char* name, int w, int h, bool vertical) {
+  BarGroup* b = new BarGroup(0,0,w,h,name);
+  b->box(THIN_UP_BOX);
+  if (vertical) b->set_vertical();
+  return b;
+}
+
+int main(int argc, char** argv) {
+  Window window(300,300,"PackedGroup test");
+  window.begin();
+  PackedGroup group(0,0,300,300);
+  window.resizable(group);
+  group.begin();
+  makebar("bar0",30,30,false);
+  makebar("bar1",30,30,false);
+  makebar("bar2",30,30,true);
+  makebar("bar3",30,30,true);
+  makebar("bar4",30,30,false);
+  Widget resize(0,0,30,30,"resizable()");
+  resize.box(FLAT_BOX);
+  resize.color(GRAY15);
+  resize.labelcolor(WHITE);
+  group.resizable(resize);
+  makebar("bar5",30,30,false);
+  makebar("bar6",30,30,true);
+  makebar("bar7",30,30,true);
+  makebar("bar8",30,30,false);
+  makebar("bar9",30,30,false);
+  window.end();
+  window.show(argc, argv);
+  return run();
+}

Added: branches/branch-3.0/test2/pixmap.cxx
===================================================================
--- branches/branch-3.0/test2/pixmap.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/pixmap.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,99 @@
+//
+// "$Id$"
+//
+// Pixmap label test program for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2006 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+//    http://www.fltk.org/str.php
+//
+
+#include <fltk/run.h>
+#include <fltk/Window.h>
+#include <fltk/Button.h>
+#include <fltk/xpmImage.h>
+#include <stdio.h>
+
+#include "porsche.xpm"
+
+#include <fltk/ToggleButton.h>
+
+using namespace fltk;
+
+ToggleButton *leftb,*rightb,*topb,*bottomb,*insideb,*inactb,*fitb,*fillb;
+Button *b;
+Window *win;
+
+void button_cb(Widget *,void *) {
+  int i = 0;
+  if (leftb->value()) i |= ALIGN_LEFT;
+  if (rightb->value()) i |= ALIGN_RIGHT;
+  if (topb->value()) i |= ALIGN_TOP;
+  if (bottomb->value()) i |= ALIGN_BOTTOM;
+  if (insideb->value()) i |= ALIGN_INSIDE;
+  b->align(i);
+  if (fitb->value()) b->set_flag(RESIZE_FIT);
+  else b->clear_flag(RESIZE_FIT);
+  if (fillb->value()) b->set_flag(RESIZE_FILL);
+  else b->clear_flag(RESIZE_FILL);
+  if (inactb->value()) b->deactivate();
+  else b->activate();
+  win->redraw();
+}
+
+int dvisual = 0;
+int arg(int, char **argv, int &i) {
+  if (argv[i][1] == '8') {dvisual = 1; i++; return 1;}
+  return 0;
+}
+
+int main(int argc, char **argv) {
+  Window window(400,400); win = &window;
+  window.begin();
+  Button b(140,160,120,120,"Pixmap"); ::b = &b;
+  xpmImage *pixmap = new xpmImage(porsche_xpm);
+
+  b.image(pixmap);
+
+  leftb = new ToggleButton(25,50,50,25,"left");
+  leftb->callback(button_cb);
+  rightb = new ToggleButton(75,50,50,25,"right");
+  rightb->callback(button_cb);
+  topb = new ToggleButton(125,50,50,25,"top");
+  topb->callback(button_cb);
+  bottomb = new ToggleButton(175,50,50,25,"bottom");
+  bottomb->callback(button_cb);
+  insideb = new ToggleButton(225,50,50,25,"inside");
+  insideb->callback(button_cb);
+  fitb = new ToggleButton(25,75,50,25,"fit");
+  fitb->callback(button_cb);
+  fillb = new ToggleButton(75,75,50,25,"fill");
+  fillb->callback(button_cb);
+  inactb = new ToggleButton(125,75,100,25,"inactive");
+  inactb->callback(button_cb);
+  window.resizable(window);
+  window.end();
+  window.show(argc,argv);
+  return fltk::run();
+}
+
+//
+// End of "$Id$"
+//

Added: branches/branch-3.0/test2/pixmap_browser.cxx
===================================================================
--- branches/branch-3.0/test2/pixmap_browser.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/pixmap_browser.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,171 @@
+//
+// "$Id: pixmap_browser.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $"
+//
+// Another pixmap test program for the Fast Light Tool Kit (FLTK).
+//
+// On purpose, I do NOT provide a fltk method to turn a file
+// into a pixmap.  This program uses a rather simplistic one.
+//
+// Copyright 1998-2006 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+//    http://www.fltk.org/str.php
+//
+
+#include <fltk/Fl.h>
+#include <fltk/Fl_Box.h>
+#include <fltk/Fl_Window.h>
+#include <fltk/Fl_Button.h>
+#include <fltk/Fl_Pixmap.h>
+#include <ctype.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <fltk/fl_file_chooser.h>
+#include <fltk/fl_message.h>
+
+Fl_Box *b;
+Fl_Window *w;
+
+char **data;
+int sizeofdata;
+int numlines;
+
+static int hexdigit(int x) {
+  if (isdigit(x)) return x-'0';
+  if (isupper(x)) return x-'A'+10;
+  if (islower(x)) return x-'a'+10;
+  return 20;
+}
+
+int load_file(const char *name) {
+  FILE *f = fopen(name,"r");
+  if (!f) {
+    fl_message("Can't open %s, %s",name,strerror(errno));
+    return 0;
+  }
+  if (data) {
+    for (int i=numlines; i--;) delete[] data[i];
+  }
+#define BUFSIZE 2048
+  char buffer[BUFSIZE];
+  int i = 0;
+  while (fgets(buffer, BUFSIZE, f)) {
+    if (buffer[0] != '\"') continue;
+    char *p = buffer;
+    char *q = buffer+1;
+    while (*q != '\"') {
+      if (*q == '\\') switch (*++q) {
+      case '\n':
+	fgets(q,(buffer+BUFSIZE)-q,f); break;
+      case 0:
+	break;
+      case 'x': {
+	q++;
+	int n = 0;
+	for (int x = 0; x < 3; x++) {
+	  int d = hexdigit(*q);
+	  if (d > 15) break;
+	  n = (n<<4)+d;
+	  q++;
+	}
+	*p++ = n;
+      } break;
+      default: {
+	int c = *q++;
+	if (c>='0' && c<='7') {
+	  c -= '0';
+	  for (int x=0; x<2; x++) {
+	    int d = hexdigit(*q);
+	    if (d>7) break;
+	    c = (c<<3)+d;
+	    q++;
+	  }
+	}
+	*p++ = c;
+      } break;
+      } else {
+	*p++ = *q++;
+      }
+    }
+    *p++ = 0;
+    if (i >= sizeofdata) {
+      sizeofdata = 2*sizeofdata+100;
+      char **newdata = new char *[sizeofdata];
+      for (int j=0; j<i; j++) newdata[j] = data[j];
+      delete[] data;
+      data = newdata;
+    }
+    data[i] = new char[p-buffer];
+    memcpy(data[i],buffer,p-buffer);
+    i++;
+  }
+  numlines = i;
+  fclose(f);
+  return i;
+}
+
+Fl_Pixmap *pixmap;
+void newpixmap() {
+  delete pixmap;
+  pixmap = new Fl_Pixmap(data);
+  pixmap->label(b);
+  w->redraw();
+}
+
+static char name[1024];
+
+void file_cb(const char *n) {
+  if (!strcmp(name,n)) return;
+  if (!load_file(n)) return;
+  strcpy(name,n);
+  w->label(name);
+  newpixmap();
+}
+
+void button_cb(Fl_Widget *,void *) {
+  fl_file_chooser_callback(file_cb);
+  fl_file_chooser("XPM file","*.xpm",name);
+  fl_file_chooser_callback(0);
+}
+
+int dvisual = 0;
+int arg(int, char **argv, int &i) {
+  if (argv[i][1] == '8') {dvisual = 1; i++; return 1;}
+  return 0;
+}
+
+int main(int argc, char **argv) {
+  int i = 1;
+  if (Fl::args(argc,argv,i,arg) < argc)
+    Fl::fatal(" -8 # : use default visual\n%s\n",Fl::help);
+
+  Fl_Window window(400,400); ::w = &window;
+  Fl_Box b(0,0,window.w(),window.h()); ::b = &b;
+  Fl_Button button(5,5,100,35,"load");
+  button.callback(button_cb);
+  if (!dvisual) Fl::visual(FL_RGB);
+  window.resizable(window);
+  window.show(argc,argv);
+  return Fl::run();
+}
+
+//
+// End of "$Id: pixmap_browser.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $".
+//

Added: branches/branch-3.0/test2/plugins/Fl_NSlider.H
===================================================================
--- branches/branch-3.0/test2/plugins/Fl_NSlider.H	                        (rev 0)
+++ branches/branch-3.0/test2/plugins/Fl_NSlider.H	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,81 @@
+//class Fl_Slider
+//Another in the group of Fltk Widgets By Curtis Edwards (c) 1998 
+//A Rewrite for the sliders to provide:
+//Section Ticks,Color Ramping, Tick Font Display, Boxtype Slider knob (Can Use Bitmaps/labels/etc.)
+#ifndef FL_NSLIDER_H
+#define FL_NSLIDER_H
+
+#include <FL/Fl.H>
+#include <FL/Fl_Valuator.H>
+#include <FL/fl_draw.H>
+#include <FL/Fl_Group.H>
+#include <stdio.h>
+#include <stdlib.h>
+#include "math.h"
+
+#define FL_VERT_SLIDER		0
+#define FL_HOR_SLIDER		1
+#define FL_VERT_FILL_SLIDER	2
+#define FL_HOR_FILL_SLIDER	3
+#define FL_VERT_NICE_SLIDER	4
+#define FL_HOR_NICE_SLIDER	5
+#define FL_VERT_HALF_SLIDER	6
+#define FL_HOR_HALF_SLIDER	7
+
+class Fl_NSlider : public Fl_Valuator {
+public:
+  float         slider_size_;		//store slider 
+  Fl_Boxtype    slider_;            //boxtype for slider
+  int           _hilight;           //hilight slider knob (ENTER)
+  int           _hilight_col;
+  Fl_Color      _tick_col;
+  Fl_Font       _tick_font;
+  int           _tick_fontSize;
+  uchar         _r1, _g1, _b1;		//rgb color ramp 1
+  uchar         _r2, _g2, _b2;		//rgb colour ramp 2
+  int           _xoffset,_yoffset;  //save offset for the slider button when pushed insidestart position for tick/knobs
+  char          _majorTickPrecision[5];  //ie "%.0f" for tick Precision
+  float         _minorTick;
+  float         _majorTick;
+  Fl_Align      _alignTick;
+ double oldval;
+ float tk_range;	  //total pixel steps
+ float px_steps;	  //pixel steps for tick and slider moves
+ float px_x;          //pixel start position for tick/knobs
+ float px_y;          //pixel start position for tick/knobs
+ float px_w;          //pixel width of widget for knobs&ticks
+ float px_h;          //pixle height
+  int           mtp;
+  
+  Fl_NSlider(int x, int y, int w, int h, const char* l=0);
+  Fl_NSlider(uchar t, int x, int y, int w, int h, const char* l=0);
+  int        handle(int);
+  void       hilight_color(int col)   { _hilight_col = col;  }
+  int        hilight_color()          { return _hilight_col; }
+  void       bounds(float a, float b);
+  Fl_Boxtype slider() const {return (Fl_Boxtype)slider_;}
+  void       slider(Fl_Boxtype c) {slider_ = c;}
+  void       calcButton(int &knob_x, int &knob_y, int &knob_w , int &knob_h,double val);
+  void       setDefaults();
+  float      slider_size() const {return slider_size_;}
+  void       slider_size(float v);
+  void       alignTick( Fl_Align a)    { _alignTick = a; }
+  Fl_Align   alignTick()    { return _alignTick;}
+  void       colorTick( Fl_Color a)    { _tick_col  = a; }
+  void       majorTickFont( Fl_Font p)     { if(p<0) p=0; _tick_font = p;}
+  void       majorTickFontSize(int p)  { if(p<0) p=0; _tick_fontSize = p;}
+  void       majorTickPrecision(int p) { if(p<0 || p>6) p=0; mtp=p; sprintf(_majorTickPrecision,"%%.%df",p); printf("new mtp = %d\n", mtp); }
+  int        majorTickPrecision()      { printf("get mtp %d\n", mtp); return mtp; }
+  void       minorTick(float tick)     { _minorTick = tick;} //set minor tick dividers
+  void       majorTick(float tick)     { _majorTick = tick;} //set major tick dividers
+  float      minorTick() {return _minorTick; }              //return minor tick dividers
+  float      majorTick() {return _majorTick; }              //return major tick dividers
+  void       value_damage();
+  void       ramp(uchar nr1, uchar ng1, uchar nb1, uchar nr2, uchar ng2, uchar nb2) {_r1=nr1; _r2=nr2; _g1=ng1; _g2=ng2; _b1=nb1; _b2=nb2;}
+  void       ramp(int ramp1, int ramp2) {fl_get_color((Fl_Color)ramp1, _r1, _g1, _b1);  fl_get_color((Fl_Color)ramp2, _r2, _g2, _b2);}
+  void       draw();
+  void       drawTicks();
+  void       drawRamp();
+};
+
+#endif

Added: branches/branch-3.0/test2/plugins/Fl_NSlider.cxx
===================================================================
--- branches/branch-3.0/test2/plugins/Fl_NSlider.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/plugins/Fl_NSlider.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,372 @@
+/* Fl_NSlider for WidgetSet, Copyright (c) 1998 curtis Edwards (curt1@jps.net)
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted, provided
+ * that the above copyright notice appear in all copies and that both the
+ * copyright notice and this permission notice appear in supporting
+ * documentation.  All work developed as a consequence of the use of
+ * this program should duly acknowledge such use. No representations are
+ * made about the suitability of this software for any purpose.  It is
+ * provided "as is" without express or implied warranty.
+ */
+#include "Fl_NSlider.H"
+
+static uchar isHoz = 0;	        //for image draw setup
+static uchar r1, g1, b1;        //for color ramp
+static uchar r2, g2, b2;
+
+///////////////////Setup Defaults for slider
+void  Fl_NSlider::setDefaults()
+{
+  slider_size((float)0.06);
+  slider(FL_UP_BOX);    
+  alignTick(FL_ALIGN_TOP);
+  majorTickFont(FL_HELVETICA);
+  majorTickFontSize(9);
+  majorTickPrecision(0);
+  minorTick(0);
+  majorTick(0);
+  colorTick( FL_BLACK);
+  selection_color(9);
+  hilight_color(FL_RED);
+  color(FL_GRAY);
+  ramp(0,0);		  //set to no ramp (0,0)
+  _hilight = 0;           //hilighterd is false
+  _r1=0, _g1=0; _b1=0;    //for color ramp
+  _r2=0; _g2=0; _b2=0;
+}
+/////////////////////////////////The New Slider
+Fl_NSlider::Fl_NSlider(uchar t, int x, int y, int w, int h, const char* l)
+: Fl_Valuator(x, y, w, h, l) {
+  type(t);
+   switch(type())
+   {
+        case FL_VERT_NICE_SLIDER:
+        case FL_HOR_NICE_SLIDER	:
+             box(FL_FLAT_BOX);
+             break;
+       default: box(FL_DOWN_BOX);
+             break;
+   }
+   setDefaults();
+}
+ //////////////////////////////////The New Slider
+Fl_NSlider::Fl_NSlider(int x,int y,int w,int h, const char *l)
+: Fl_Valuator(x, y, w, h, l)
+{
+   box(FL_DOWN_BOX);
+   setDefaults();
+}
+
+/////////////////////////////////slider draw
+void Fl_NSlider::draw() {
+  int    knob_x, knob_y, knob_w, knob_h, col;
+  tk_range  = (float) (maximum()-minimum());
+  if(slider_size_ == 0) slider_size(0.06);
+  int pxSlider;
+
+  isHoz = horizontal();
+  if( isHoz ) { 
+     pxSlider = (int)(w()*slider_size_);
+     px_x     = x() + box()->dx() + (pxSlider/2);  //starting point
+     px_y     = y() + box()->dy();                 //y of widget
+     px_w     = w() - pxSlider - box()->dw();      //w of widget
+     px_h     = h() - box()->dh();                 //h of widget
+     if(tk_range == 0) px_steps=0;
+     else  px_steps = px_w / tk_range;                   //pixel steps(divider)
+  }
+  else {   //vertical      
+     pxSlider = (int)(h()*slider_size_);
+     px_x     = x() + box()->dx();                 
+     px_y     = y() + box()->dy() + (pxSlider/2); 
+     px_w     = w() - box()->dw();                            
+     px_h     = h() - pxSlider -box()->dh();          
+     if(tk_range == 0) px_steps=0;
+     else  px_steps = px_h / tk_range;                   //pixel steps(divider)
+  }
+  calcButton(knob_x, knob_y, knob_w , knob_h, value());  //calc out the slider size&type
+  draw_box();
+  drawRamp();
+  drawTicks();
+  if(_hilight) col = hilight_color();
+  else col = selection_color();
+  switch(type()){
+      case FL_VERT_NICE_SLIDER:
+           draw_box();
+           draw_box();
+           draw_box();
+           break;
+      case FL_HOR_NICE_SLIDER:
+           draw_box();
+           draw_box();
+           draw_box();
+           break;
+      default:
+           draw_box();
+	   break;
+  }
+
+draw_label();
+ }
+///////////////////////////////work out size of the slider
+void Fl_NSlider::calcButton(int &knob_x, int &knob_y, int &knob_w , int &knob_h, double val) {
+ float  tk_button_incr;
+ int pxSlider;
+ if( horizontal()) {
+     tk_button_incr = (px_x + (px_steps * (val-minimum()) ));
+     pxSlider = (int)(w()*slider_size_);
+ }
+ else  {
+     tk_button_incr = (px_y + (px_steps * (val-minimum()) ));
+     pxSlider = (int)(h()*slider_size_);
+ }
+ switch(type()) {
+        case FL_VERT_FILL_SLIDER:
+             knob_x = (int)px_x;
+	     knob_y = y()+box()->dy();
+	     knob_w = (int)px_w;
+             knob_h = (int)(tk_button_incr-y());
+	      break;
+        case FL_HOR_FILL_SLIDER	:
+             knob_x = x()+box()->dx();
+	     knob_y = (int)px_y;
+	     knob_w = (int)(tk_button_incr-x());
+             knob_h = (int)px_h;
+	     break;
+        case FL_VERT_HALF_SLIDER:
+             knob_x = (int)px_x;
+	     knob_y = (int)(tk_button_incr-(pxSlider/2));
+	     knob_w = (int)(px_w/2);
+             knob_h = pxSlider;
+ 	     break;
+        case FL_HOR_HALF_SLIDER	:
+             knob_x = (int)(tk_button_incr-(pxSlider/2));
+	     knob_y = (int)px_y;
+	     knob_w = pxSlider;
+             knob_h = (int)(px_h/2);
+             break;
+        case FL_HOR_NICE_SLIDER	:
+        case FL_HOR_SLIDER:
+             knob_x = (int)(tk_button_incr-(pxSlider/2));
+	     knob_y = (int)px_y;
+	     knob_w = pxSlider;
+             knob_h = (int)px_h;
+	     break;
+        case FL_VERT_NICE_SLIDER	:
+        case FL_VERT_SLIDER:
+             knob_x = (int)px_x;
+             knob_y = (int)(tk_button_incr-(pxSlider/2));
+	     knob_w = (int)px_w;
+             knob_h = pxSlider;
+	     break;
+     }
+}
+//////////////////redraw area damaged if NO_BOX ask parent to redraw (A hard function to find,value_damage)
+void Fl_NSlider::value_damage(){
+  int knob_x, knob_y, knob_w, knob_h;
+  if(value() != oldval) 
+  {
+       calcButton( knob_x, knob_y, knob_w, knob_h,  oldval);
+       if(box() == FL_NO_BOX)  parent()->damage(~1,  knob_x, knob_y, knob_w+3, knob_h+3);
+       else damage(~1,  knob_x, knob_y, knob_w+3, knob_h+3);
+  }
+  calcButton( knob_x, knob_y, knob_w, knob_h, value());
+  damage(~1,  knob_x, knob_y, knob_w, knob_h);
+}
+
+//////////////////////fltk handle stuff (notice FL_DRAG has no redraw,handle_drag() does it)
+int  Fl_NSlider::handle(int event)
+{
+  int newpos = horizontal() ? Fl::event_x() : Fl::event_y();
+  float val=0;
+  switch (event) {
+  case FL_ENTER: 
+	_hilight = 1;
+        value_damage();
+        break;		
+  case FL_LEAVE: 
+	_hilight = 0;
+        value_damage();
+	break;		
+  case FL_PUSH:		
+	handle_push();
+  case FL_DRAG:
+        oldval=value();
+	if( horizontal() ) {
+	    val = ((newpos-x()-box()->dw() - ( (w()*slider_size_)/2))/ px_steps)+minimum();
+	}
+	else{  //vertical
+	    val = ((newpos-y()-box()->dh() - ( (h()*slider_size_)/2) )/ px_steps)+minimum();
+        }
+        val = clamp(val);
+        val = round(val);
+	handle_drag(val);
+        return 1;
+   case FL_RELEASE:
+		handle_release();
+		return 1;
+   default:
+		return 0;
+  }
+return 1;
+}
+////////////a lot of shit for drawing ticks ..to do: merge Hoz/Vert Code tighter 
+void   Fl_NSlider::drawTicks()
+{
+ char  pnt[12];
+ int   fw=0, fh=0;
+ float mdev, mcount, fnum=0, fnumIncr=0;
+ uchar sr1, sg1, sb1; 
+ int    majorLnLen    ;
+ int    majorLnStart  ;
+ int    minorLnLen    ;
+ int    minorLnStart  ;
+ int    majorFntStart ;
+ 
+ fl_get_color( selection_color(), sr1, sg1, sb1);  //get color for ticks
+
+ fl_font( (Fl_Font)_tick_font,_tick_fontSize);
+ 
+ fl_color(_tick_col);
+ sprintf(pnt,  _majorTickPrecision, maximum());
+ fl_measure(pnt, fw, fh);                           //find font size
+ if(tk_range == 0) return;
+ if( horizontal() )             //insure the slider is horz
+ { 
+       majorLnLen    = (int) px_h/2;
+       majorLnStart  = (int) px_y;
+       minorLnLen    = (int) px_h/4;
+       minorLnStart  = (int) px_y;
+       majorFntStart = (int) majorLnStart+majorLnLen+fh;
+       switch(_alignTick) {
+           case FL_ALIGN_CENTER:
+                minorLnStart += majorLnLen -(minorLnLen/2);
+                majorLnStart += (int) px_h/4;
+                majorFntStart = majorLnStart + majorLnLen+fh;                     
+                break;
+	   case FL_ALIGN_LEFT:
+	   case FL_ALIGN_BOTTOM:
+                minorLnStart += (int) px_h - minorLnLen;
+                majorLnStart += (int) px_h - majorLnLen;
+                majorFntStart = (int)(px_y+majorLnLen-(fh/4));
+	        break;
+       }
+       if( majorTick() ) {   
+          mdev   = fabs( px_w/ ( tk_range/_majorTick));    //pixles per major tick span
+          if(mdev < (fw+(fw/3))) mdev   = (fw+(fw/3));
+          fnumIncr = tk_range/(px_w/mdev);
+          mcount   = 0; 
+          fnum     = 0; 
+          fl_line(  px_x+px_w , majorLnStart,  px_x+px_w , majorLnStart+majorLnLen );
+          while(mcount < px_w) {
+               fl_line(  px_x+mcount  , majorLnStart, px_x+mcount  , majorLnStart+majorLnLen );
+               sprintf(pnt, _majorTickPrecision, fnum+minimum() );
+               fl_measure(pnt, fw, fh); 
+               if(_tick_fontSize) fl_draw(pnt, px_x+mcount-(fw/3), majorFntStart); 
+               fnum += fnumIncr;
+               mcount += mdev;
+         }
+     } //(if major)
+     if( minorTick()  && _minorTick <= maximum()) {  //do minor ticks
+         mdev  = fabs( px_w/ ( tk_range/_minorTick));
+         if(mdev < 4) mdev = 4;
+         mcount = mdev;
+         while(mcount < px_w)
+         {   fl_line(  px_x+mcount , minorLnStart,  px_x+mcount , minorLnStart+minorLnLen );  //create main line 
+	     mcount += mdev;
+         }
+     } //(if minor)
+ } //(isHoz)
+ else  //insure the slider is Vert
+ {
+       majorLnLen    = (int) px_w/2;
+       majorLnStart  = (int) px_x;
+       minorLnLen    = (int) px_w/4;
+       minorLnStart  = (int) px_x;
+       majorFntStart = (int) majorLnStart+majorLnLen+(fh/4);
+       switch(_alignTick) {
+           case FL_ALIGN_CENTER:
+                minorLnStart += majorLnLen -(minorLnLen/2);
+                majorLnStart += (int) px_w/4;
+                majorFntStart = majorLnStart + majorLnLen+(fh/4);                     
+                break;
+	   case FL_ALIGN_BOTTOM:
+	   case FL_ALIGN_LEFT:
+                minorLnStart += (int) px_w - minorLnLen;
+                majorLnStart += (int) px_w - majorLnLen;
+                majorFntStart = majorLnStart - fw-(fh/4);                     
+	        break;
+       }
+       if( majorTick() ) {   
+          mdev   = fabs( px_h/ ( tk_range/_majorTick));    //pixles per major tick span
+          if(mdev < (fh+(fh/3))) mdev   = (fh+(fh/3));
+          fnumIncr = tk_range/(px_h/mdev);
+          mcount   = 0; 
+          fnum     = 0; 
+          fl_line(  majorLnStart, px_y+px_h , majorLnStart+majorLnLen,  px_y+px_h );
+          while(mcount < px_h) {
+               fl_line( majorLnStart, px_y+mcount  ,majorLnStart+majorLnLen, px_y+mcount );
+               sprintf(pnt, _majorTickPrecision, fnum+minimum() );
+               fl_measure(pnt, fw, fh); 
+               if(_tick_fontSize) fl_draw(pnt, majorFntStart,px_y+mcount+(fh/3)); 
+               fnum += fnumIncr;
+               mcount += mdev;
+         }
+     } //(if major)
+     if( minorTick()  && _minorTick <= maximum()) {  //do minor ticks
+         mdev  = fabs( px_h/ ( tk_range/_minorTick));
+         if(mdev < 4) mdev = 4;
+         mcount = mdev;
+         while(mcount < px_h)
+         {   fl_line(  minorLnStart, px_y+mcount,  minorLnStart+minorLnLen, px_y+mcount );  //create main line 
+	     mcount += mdev;
+         }
+     } //(if minor) 
+ } //else vert
+} //end drawTicks()
+////////////////////////some tricky stuff to do ramp shit (generates ramp image)
+static void generate_image(void* vv, int X, int Y, int W, uchar* buf) 
+{
+ Fl_NSlider* v = (Fl_NSlider*)vv;
+ char r= r1+Y*(r2-r1)/( v->h()-(v->box()->dh()) );   //VERTICAL
+ char g= g1+Y*(g2-g1)/( v->h()-(v->box()->dh()) );
+ char b= b1+Y*(b2-b1)/( v->h()-(v->box()->dh()) );
+
+ for (int x = X; x < X+W; x++) {
+    if( isHoz ){   
+        r= r1+x*(r2-r1)/( v->w()-(v->box()->dw()) );  //HORIZONTAL
+        g= g1+x*(g2-g1)/( v->w()-(v->box()->dw()) );
+        b= b1+x*(b2-b1)/( v->w()-(v->box()->dw()) );
+    }
+    *buf++ = r;
+    *buf++ = g;
+    *buf++ = b;
+ }
+}
+///////////////////draw the ramp 
+void   Fl_NSlider::drawRamp()
+{
+  if( (_r1+_r2+_g1+_g2+_b1+_b2) == 0) return;   //if black dont do it
+  int x1 = x()+box()->dx();
+  int y1 = y()+box()->dy();
+  int w1 = w()-box()->dw();
+  int h1 = h()-box()->dh();
+  r1=_r1; g1=_g1; b1=_b1;	    //for color ramp
+  r2=_r2; g2=_g2; b2=_b2;
+  fl_draw_image(generate_image, this, x1, y1, w1, h1);
+}
+//////////////////set the slider size
+void Fl_NSlider::slider_size(float v) {
+  if (v <  0) v = 0;
+  if (v > 1) v = 1;
+  if (slider_size_ != float(v)) {
+    slider_size_ = float(v); 
+    damage(FL_DAMAGE_EXPOSE);
+  }
+}
+////////////////set the bounds (from old slider)
+void Fl_NSlider::bounds(float a, float b) {
+  if (minimum() != a || maximum() != b) {
+    Fl_Valuator::range(a, b); 
+    damage(FL_DAMAGE_EXPOSE);
+  }
+}

Added: branches/branch-3.0/test2/plugins/Fl_Pix_Box.H
===================================================================
--- branches/branch-3.0/test2/plugins/Fl_Pix_Box.H	                        (rev 0)
+++ branches/branch-3.0/test2/plugins/Fl_Pix_Box.H	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,22 @@
+// Fl_Check_Button.H
+
+// For back compatability, a Fl_Light_Button with a diamond down_box()
+// and a red color.
+
+#ifndef Fl_Pix_Box_H
+#define Fl_Pix_Box_H
+
+#include <FL/Fl_Box.H>
+#include <FL/Fl_Pixmap.H>
+
+class Fl_Pix_Box : public Fl_Box 
+{
+public:
+  Fl_Pixmap* bUp_;
+
+  void draw();
+  Fl_Pix_Box(int x,int y,int w,int h,const char *l = 0,Fl_Pixmap* bUp=0);
+};
+
+
+#endif

Added: branches/branch-3.0/test2/plugins/Fl_Pix_Box.cxx
===================================================================
--- branches/branch-3.0/test2/plugins/Fl_Pix_Box.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/plugins/Fl_Pix_Box.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,58 @@
+/* Fl_Pix_Box for WidgetSet, Copyright (c) 1998 curtis Edwards (curt1@jps.net)
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted, provided
+ * that the above copyright notice appear in all copies and that both the
+ * copyright notice and this permission notice appear in supporting
+ * documentation.  All work developed as a consequence of the use of
+ * this program should duly acknowledge such use. No representations are
+ * made about the suitability of this software for any purpose.  It is
+ * provided "as is" without express or implied warranty.
+ Description	- subclass of Fl_Button that draws pixmaps with lables
+          each pixmap will draw UP/DOWN/HILIGHT 
+*/ 
+
+#include <FL/Fl.H>
+#include <FL/Fl_Pix_Box.H>
+#include <FL/fl_draw.H>
+
+////constructor
+Fl_Pix_Box::Fl_Pix_Box(int x,int y,int w,int h,const char *l,Fl_Pixmap* bUp)
+: Fl_Box(x,y,w,h,l) 
+{
+ bUp_     = bUp;
+ if(bUp)  fl_measure_pixmap(bUp->data, bUp->w, bUp->h); 
+}
+
+////draw the button
+void Fl_Pix_Box::draw()
+{
+  int remW=0,  nW=1;
+  int remH=0,  nH=1;
+  int X, Y, W=bUp_->w, H=bUp_->h;
+  Y= y() + Fl::box_dy(box());
+  draw_box();
+
+  if(!bUp_) return;
+  if(w() > W)
+  {  nW     = w() / W;
+     remW   = w() % W;
+  }
+  if(h() > H)
+  {  nH   = h() / H;
+     remH = h() % H;
+  }
+
+ for(int j=0; j<=nH; j++)
+ {
+    X=x()+ Fl::box_dx(box());
+    if(j==nH) H = remH-Fl::box_dh(box());
+    for(int i=0; i<nW; i++)
+    {  bUp_->draw(X,Y, w(), H); 
+       X=X+W;
+    }
+    if(remW) bUp_->draw(X,Y, remW-Fl::box_dw(box()), H);  
+    Y=Y+H;
+ }
+  draw_label();
+
+}

Added: branches/branch-3.0/test2/plugins/Fl_Pix_Button.H
===================================================================
--- branches/branch-3.0/test2/plugins/Fl_Pix_Button.H	                        (rev 0)
+++ branches/branch-3.0/test2/plugins/Fl_Pix_Button.H	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,24 @@
+// Fl_Check_Button.H
+
+// For back compatability, a Fl_Light_Button with a diamond down_box()
+// and a red color.
+
+#ifndef Fl_Pix_Button_H
+#define Fl_Pix_Button_H
+
+#include <FL/Fl_Button.H>
+#include <FL/Fl_Pixmap.H>
+
+class Fl_Pix_Button : public Fl_Button 
+{
+public:
+  Fl_Pixmap* pix;
+  int hilight;
+  
+  void draw();
+  int handle(int);
+  Fl_Pix_Button(int x,int y,int w,int h,const char *l = 0,Fl_Pixmap* bUp=0);
+};
+
+
+#endif

Added: branches/branch-3.0/test2/plugins/Fl_Pix_Button.cxx
===================================================================
--- branches/branch-3.0/test2/plugins/Fl_Pix_Button.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/plugins/Fl_Pix_Button.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,68 @@
+/* Fl_Pix_Button for WidgetSet, Copyright (c) 1998 curtis Edwards (curt1@jps.net)
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted, provided
+ * that the above copyright notice appear in all copies and that both the
+ * copyright notice and this permission notice appear in supporting
+ * documentation.  All work developed as a consequence of the use of
+ * this program should duly acknowledge such use. No representations are
+ * made about the suitability of this software for any purpose.  It is
+ * provided "as is" without express or implied warranty.
+ Description	- subclass of Fl_Button that draws pixmaps with lables
+                each pixmap will draw UP/DOWN/HILIGHT 
+*/
+#include <FL/Fl.H>
+#include "Fl_Pix_Button.H"
+#include <FL/fl_draw.H>
+#include <math.h>
+
+////constructor
+Fl_Pix_Button::Fl_Pix_Button(int x,int y,int w,int h,const char *l,Fl_Pixmap* bUp)
+: Fl_Button(x,y,w,h,l) 
+{
+ pix     = bUp;
+ hilight  = 0;
+ int maxW=0, maxH=0;
+ if(pix)                       //check size of bitmaps and log biggest sizes
+ {   fl_measure_pixmap(pix->data, pix->w, pix->h); 
+    if(pix->w > maxW ) maxW = pix->w; 
+    if(pix->h/3 > maxH)  maxH = pix->h/3;
+ }
+ Fl_Button::w(maxW);
+ Fl_Button::h(maxH);
+
+}
+
+////draw the button
+void Fl_Pix_Button::draw()
+{
+  if (type() == FL_HIDDEN_BUTTON) return;
+  if (!pix) return;
+  switch(value())
+  {
+      case 0: if(hilight) pix->draw(x(),y(), w(), pix->h/3, 0, 0);
+              else pix->draw(x(),y(), w(), pix->h/3, 0, 0);
+              break;
+      case 1: pix->draw(x(),y(), w(), pix->h/3, 0, 0);
+              break;
+      default: pix->draw(x(),y(), w(), pix->h/3, 0, 0);
+              break;
+  }
+  draw_label();
+}
+
+////handel the events
+int Fl_Pix_Button::handle(int event)
+{
+    switch (event) 
+    {
+       case FL_ENTER:
+            hilight=1;
+            redraw();
+            break;
+       case FL_LEAVE:
+	        hilight=0;
+                redraw();
+                break;
+   }
+ return Fl_Button::handle(event);
+}

Added: branches/branch-3.0/test2/plugins/Makefile
===================================================================
--- branches/branch-3.0/test2/plugins/Makefile	                        (rev 0)
+++ branches/branch-3.0/test2/plugins/Makefile	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,57 @@
+#
+# "$Id: Makefile 1186 2000-06-10 04:10:35Z carl $"
+#
+# Fluid plugin makefile for the Fast Light Tool Kit (FLTK).
+#
+# Copyright 1998-1999 by Bill Spitzak and others.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+# USA.
+#
+# Please report all bugs and problems to "fltk-bugs@easysw.com".
+#
+
+PROGRAM = essai.flpl
+
+CPPFILES = \
+	essai_plugin.cxx
+
+################################################################
+
+OBJECTS = $(CPPFILES:.cxx=.o)
+
+XTRAFLAGS = -I../../fluid -I../..
+
+include ../../makeinclude
+
+all: $(PROGRAM) Fl_NSlider.o
+
+$(PROGRAM) : $(OBJECTS) ../../lib/$(LIBNAME).a
+	$(DSOCOMMAND) $@ $(OBJECTS) $(DSOLIBS)
+
+clean :
+	-@ rm -f *.o $(PROGRAM) $(CLEAN) core *~ makedepend
+	@touch makedepend
+
+depend:
+	$(MAKEDEPEND) $(XTRAFLAGS) $(CXXFLAGS) $(CPPFILES) $(CFILES) > makedepend
+
+install:
+
+include makedepend
+
+#
+# End of "$Id: Makefile 1186 2000-06-10 04:10:35Z carl $".
+#

Added: branches/branch-3.0/test2/plugins/essai.fl
===================================================================
--- branches/branch-3.0/test2/plugins/essai.fl	                        (rev 0)
+++ branches/branch-3.0/test2/plugins/essai.fl	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,23 @@
+# data file for the Fltk User Interface Designer (fluid)
+version 2.00 
+images_dir ./ 
+header_name {.h} 
+code_name {.cxx} 
+gridx 5 
+gridy 5 
+snap 3
+Function {make_window()} {open
+} {
+  Fl_Window {} {open
+    xywh {299 199 299 258} visible
+  } {
+    Fl_Pix_Button {} {
+      label pixbutton
+      xywh {25 25 20 20} align 524289
+    }
+    Fl_NSlider {} {
+      xywh {110 30 35 175} type {Vert Half}
+      majorTickPrecision 3
+    }
+  }
+} 

Added: branches/branch-3.0/test2/plugins/essai_panel.cxx
===================================================================
--- branches/branch-3.0/test2/plugins/essai_panel.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/plugins/essai_panel.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,20 @@
+// generated by Fast Light User Interface Designer (fluid) version 2.0000
+
+#include "essai_panel.h"
+
+Fl_Group *Essai=(Fl_Group *)0;
+
+Fl_Group* make_window() {
+  Fl_Group* w;
+  { Fl_Group* o = Essai = new Fl_Group(0, 0, 258, 74);
+    w = o;
+    { Fl_Slider* o = new Fl_Slider(20, 20, 225, 20, "Major tick precision");
+      o->type(5);
+      o->maximum(6);
+      o->step(1);
+      o->callback((Fl_Callback*)major_tick_precision_cb);
+    }
+    o->end();
+  }
+  return w;
+}

Added: branches/branch-3.0/test2/plugins/essai_panel.fl
===================================================================
--- branches/branch-3.0/test2/plugins/essai_panel.fl	                        (rev 0)
+++ branches/branch-3.0/test2/plugins/essai_panel.fl	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,21 @@
+# data file for the FLTK User Interface Designer (FLUID)
+version 2.0000 
+images_dir ./ 
+header_name {.h} 
+code_name {.cxx} 
+gridx 5 
+gridy 5 
+snap 3
+Function {make_window()} {open
+} {
+  Fl_Window Essai {open selected
+    xywh {279 430 258 74}
+    class Fl_Group visible
+  } {
+    Fl_Slider {} {
+      label {Major tick precision}
+      callback major_tick_precision_cb
+      xywh {20 20 225 20} type {Horz Knob} maximum 6 step 1
+    }
+  }
+} 

Added: branches/branch-3.0/test2/plugins/essai_panel.h
===================================================================
--- branches/branch-3.0/test2/plugins/essai_panel.h	                        (rev 0)
+++ branches/branch-3.0/test2/plugins/essai_panel.h	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,10 @@
+// generated by Fast Light User Interface Designer (fluid) version 2.0000
+
+#ifndef essai_panel_h
+#define essai_panel_h
+#include <FL/Fl.H>
+extern Fl_Group *Essai;
+#include <FL/Fl_Slider.H>
+extern void major_tick_precision_cb(Fl_Slider*, void*);
+Fl_Group* make_window();
+#endif

Added: branches/branch-3.0/test2/plugins/essai_plugin.cxx
===================================================================
--- branches/branch-3.0/test2/plugins/essai_plugin.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/plugins/essai_plugin.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,177 @@
+#include <stdio.h>
+#include <string.h>
+#include <FL/Fl_Menu.H>
+#include <FL/Fl_Window.H>
+#include "Fluid_Plugins.h"
+#include "Fl_Type.h"
+#include "Fl_Pix_Button.cxx"
+
+#include "play_buttons256.xpm"
+#include "pause_buttons256.xpm"
+
+#define S2I(a) ( int(a[0])+(int(a[1])<<8)+(int(a[2])<<16)+(int(a[3])<<24) )
+
+// Description of the plugin : declared extern "C" to avoid C++ name encoding
+// (MS Visual C does encode C++ name of variables and not only functions !! Wonder why ...)
+extern "C" FLUID_PLUGIN_API Fluid_Plugin fluid_plugin;
+
+
+void option_cb(Fl_Widget* o, void* p)
+{
+  printf("plugin option callback called !\n");
+}
+
+// Options menu : you can put whatever you want here
+Fl_Menu_Item options_menu[] = {
+{"Options",0,option_cb,0,0},
+{ 0 }
+};
+
+#include <FL/Fl_Button.H>
+
+
+//////////////////////////////////////////////////////////////////////
+// Description of a new widget for fluid
+
+// This object contains all the informations about the widgets and all methods
+// to write and read datas from the .fl file
+// (in this example we do not override the write and read methods !)
+// (see below for a more complete example)
+
+static Fl_Menu_Item buttontype_menu[] = {
+  {"Normal",0,0,(void*)0},
+  {"Toggle",0,0,(void*)FL_TOGGLE_BUTTON},
+  {"Radio",0,0,(void*)FL_RADIO_BUTTON},
+  {0}};
+
+class Fl_Pix_Button_Type : public Fl_Widget_Type {
+  // Return a pointer on the button type menu
+  Fl_Menu_Item *subtypes() {return buttontype_menu;}
+public:
+  // Give the name of the widget type
+  virtual const char *type_name() {return "Fl_Pix_Button";}
+
+  // Actually create a widget of this type to be drawn in fluid
+  // Set a default label name describing the widget type shortly
+  Fl_Widget *widget(int x,int y,int w,int h) {
+    return new Fl_Pix_Button(x,y,w,h,"pixbutton", new Fl_Pixmap(play_buttons256)); }
+
+  // Create a new fluid object of this type
+  Fl_Widget_Type *_make() {return new Fl_Pix_Button_Type();}
+
+  // Give informations on this type
+  int is_button() const {return 1;} // (all other is_foo methods reuturn 0 by default
+};
+static Fl_Pix_Button_Type Fl_Pix_Button_type; // template pixbutton
+
+
+
+///////////////////////////////////////////////////////
+// Another widget : the NSlider
+// Here we override the write and read methods
+#include "Fl_NSlider.cxx"
+static Fl_Menu_Item slider_type_menu[] = { // Type menu definition
+  {"Vertical",0,0,(void*)FL_VERT_SLIDER},
+  {"Horizontal",0,0,(void*)FL_HOR_SLIDER},
+  {"Vert Fill",0,0,(void*)FL_VERT_FILL_SLIDER},
+  {"Horz Fill",0,0,(void*)FL_HOR_FILL_SLIDER},
+  {"Vert Knob",0,0,(void*)FL_VERT_NICE_SLIDER},
+  {"Horz Knob",0,0,(void*)FL_HOR_NICE_SLIDER},
+  {"Vert Half",0,0,(void*)FL_VERT_HALF_SLIDER},
+  {"Horz half",0,0,(void*)FL_HOR_HALF_SLIDER},
+  {0}};
+class Fl_NSlider_Type : public Fl_Widget_Type {
+  Fl_Menu_Item *subtypes() {return slider_type_menu;}
+  // We use this kludge to identify that this is really an NSlider and not any valuator,
+  // could there be any better way ?
+  int is_valuator() const {return S2I("NSLD");}   
+public:
+  virtual const char *type_name() {return "Fl_NSlider";}
+  Fl_Widget *widget(int x,int y,int w,int h) {
+    return new Fl_NSlider(x,y,w,h);}
+  Fl_Widget_Type *_make() {return new Fl_NSlider_Type();}
+
+  void write_properties() {
+    Fl_Widget_Type::write_properties();
+    Fl_NSlider* i = (Fl_NSlider*) o;
+    if(i->majorTickPrecision()) {
+      write_indent(level+1);
+      write_string("majorTickPrecision %d", i->majorTickPrecision());
+    }
+  }
+  void read_property(const char* c) {
+    if(!strcmp(c, "majorTickPrecision")) {
+      Fl_NSlider* i = (Fl_NSlider*) o;
+      int mtp;
+      if(sscanf(read_word(), "%d", &mtp) == 1) i->majorTickPrecision(mtp);
+    } else
+      Fl_Widget_Type::read_property(c);
+  }
+  void write_widget_code() {
+    Fl_Widget_Type::write_widget_code();
+    Fl_NSlider* i = (Fl_NSlider*) o;
+    if(i->majorTickPrecision()) write_c("%so->majorTickPrecision(%d);\n", indent(), 
+					i->majorTickPrecision());
+  }
+};
+static Fl_NSlider_Type Fl_NSlider_type;
+
+
+
+// Submenu in the new menu : only pointers on the the template objects is needed,
+// fluid will fill in the rest (name, callback action, etc ...)
+Fl_Menu_Item new_menu[] = {
+  {0,0,0,(void*)&Fl_Pix_Button_type},
+  {0,0,0,(void*)&Fl_NSlider_type},
+{ 0 }
+};
+
+
+
+// Callback for the panel settings
+// fluid set the user_data parameter to let us know if we have to set or load the settings
+class Fl_Slider;
+void major_tick_precision_cb(Fl_Slider* o, void* v)
+{
+  Fl_Valuator* i = (Fl_Valuator*) o;
+  if (v == LOAD) { // Case LOAD
+    if (current_widget->is_valuator() != S2I("NSLD")) // Is it a NSlider widget ?
+      {i->hide(); return;}                       // no, we hide the controller
+    else { 
+      fluid_plugin.please_show_panel=1; // yes : tell to fluid that we use the panel
+      i->show();                        // and we show the controller
+    } 
+
+    // Actually load the value in the controller
+    i->value(((Fl_NSlider*)current_widget->o)->majorTickPrecision()); 
+
+  } else {         // Case SET
+
+    for (Fl_Type *o = Fl_Type::first; o; o = o->next)
+      if (o->selected && o->is_widget() && o->is_valuator() == S2I("NSLD")) { // is it a NSlider
+	Fl_Widget_Type* q = (Fl_Widget_Type*)o;
+	((Fl_NSlider*)q->o)->majorTickPrecision(i->value()); // yep : set the widget setting
+	q->o->redraw();
+      }
+  }
+}
+
+
+
+// This function create the panel for the specific settings of this set of widgets
+#include "essai_panel.cxx"
+void make_panel()
+{
+  fluid_plugin.panel = make_window();
+}
+
+
+
+
+// This is the description of the plugin
+FLUID_PLUGIN_API Fluid_Plugin fluid_plugin = {
+  "Essai",       // Name of the plugin
+  options_menu,  // pointer on the 'option' menu
+  new_menu,      // pointer on the 'new' menu
+  make_panel,    // function that creates the settings window
+};

Added: branches/branch-3.0/test2/plugins/pause_buttons256.xpm
===================================================================
--- branches/branch-3.0/test2/plugins/pause_buttons256.xpm	                        (rev 0)
+++ branches/branch-3.0/test2/plugins/pause_buttons256.xpm	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,111 @@
+/* XPM */
+char *pause_buttons256[] = {
+/* width height num_colors chars_per_pixel */
+"    20    60       44            1",
+/* colors */
+". c #000000",
+"# c #808080",
+"a c #c0dcc0",
+"b c #a6caf0",
+"c c #2a5f55",
+"d c #2a7f55",
+"e c #2a7faa",
+"f c #553f55",
+"g c #555f55",
+"h c #555faa",
+"i c #557f55",
+"j c #557faa",
+"k c #559f55",
+"l c #559faa",
+"m c #55bfaa",
+"n c #7f5f55",
+"o c #7f7f55",
+"p c #7f7faa",
+"q c #7f9f55",
+"r c #7f9faa",
+"s c #7fbfaa",
+"t c #7fbfff",
+"u c #7fdfaa",
+"v c #7fdfff",
+"w c #aa7f55",
+"x c #aa9f55",
+"y c #aa9faa",
+"z c #aabfaa",
+"A c #aadfff",
+"B c #d4bfaa",
+"C c #d4dfaa",
+"D c #d4dfff",
+"E c #ffdfaa",
+"F c #ffdfff",
+"G c #ccccff",
+"H c #99ffff",
+"I c #ccffff",
+"J c #2a1f00",
+"K c #2a1f55",
+"L c #2a3f00",
+"M c #2a3f55",
+"N c #fffbf0",
+"O c #a0a0a4",
+"P c #ffffff",
+/* pixels */
+"#MJK.Lg##O###gJJMg##",
+"MKJJ#yyzyzzyOOOgKKgh",
+"JJM#OOOOyOyOOOO#oMMg",
+"KJ#OyzzBzBBzBzOOO#Jg",
+".gOOOyBzBazBzOOx##gK",
+"MOOzzBa..aD..BzyOO#L",
+"g#OyyzaJJEaJJBzO###g",
+"#yzyaBG..DF..aBBzO##",
+"#OOOBBaJJaCJKzzO#o#o",
+"OOOzzaD..PF..aBzyO##",
+"#xOyyBaJJaaJJBOO#o#o",
+"OOOyBaa..FN..aBzOO##",
+"o##OOyBJJazJJyO#ooog",
+"gOOOzza..aa..zzOO##g",
+"J#q##OOOOyOOOx##oooM",
+"KgOOOOOzBzzzOOOx##gg",
+"gLn#o#####w#o#oinifO",
+"nMf#OxOOxOO#O####fOz",
+"gogLg#oo#ooooooggOzO",
+"g###MJg######fMgyzO#",
+"#MJK.Kg##r###cJJMg##",
+"MK.J#rOrOOOOrOrgKKgh",
+"JJM##rOOrOrrOp##iMMg",
+"JK#rOzyzzzzzzOOrOgKg",
+".g#rOOzzbyzyyrr###gK",
+"KrOOzzb..Ga..ayOrp#L",
+"g#rryyzJJbaKJyrr###f",
+"#OOyzaD..DD..bayrrj#",
+"#rrOObzJJbaJJzrr##g#",
+"rOOzzaG..DD..bzyrrp#",
+"##prOyzJJabJJyrrpg#g",
+"#rOOyab..DD..bzOr#j#",
+"###rrOyJJzzJJrpp##gg",
+"MrrOOzb..bb..zrr#j#M",
+"J###p#rrrOrrpp###ggM",
+"Kg##rrOOyrOOOrp#j#gg",
+"gJh####j####jgigggMO",
+"gfM##p#rpp###pp#jfOy",
+"#ifMgg#g#gihgggMfOzO",
+"gn#gMMM##j###MMnOOO#",
+"#MJK.LcjlrrljgM.Mg##",
+"MKJJlrsssssrsrriKKgh",
+"J.MlrrrsrsrssrllkMMg",
+"JMlrssszzbszsssrriMg",
+".irrsssbssbsssrlllcK",
+"Mrsszba..ba..bssrrlM",
+"crrrsstJJAvJJtsslllc",
+"rssszba..aI..ubssrl#",
+"lrrssbbJJHvJJvmmllji",
+"rrssbub..IA..bbsrlll",
+"llrrssvJJvHJJvmmlljj",
+"rrsszba..AA..utsrlll",
+"jlrlsstJJvuJKmllljid",
+"crrssss..bv..bsslllc",
+"M#jllrmsmmsmllljjdjM",
+"Jdlrrssstsssssllljcg",
+"gKiljlllllljlejieiMO",
+"gfMlllrlrlllllljjcOy",
+"#igMcijjjjjijeicfOzO",
+"gn#nMMckjkljjcMgOyO#"
+};

Added: branches/branch-3.0/test2/plugins/play_buttons256.xpm
===================================================================
--- branches/branch-3.0/test2/plugins/play_buttons256.xpm	                        (rev 0)
+++ branches/branch-3.0/test2/plugins/play_buttons256.xpm	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,112 @@
+/* XPM */
+char *play_buttons256[] = {
+/* width height num_colors chars_per_pixel */
+"    20    60       45            1",
+/* colors */
+". c #000000",
+"# c #808080",
+"a c #c0dcc0",
+"b c #a6caf0",
+"c c #2a5f55",
+"d c #2a5faa",
+"e c #2a7f55",
+"f c #2a7faa",
+"g c #553f55",
+"h c #555f55",
+"i c #555faa",
+"j c #557f55",
+"k c #557faa",
+"l c #559f55",
+"m c #559faa",
+"n c #55bfaa",
+"o c #55bfff",
+"p c #7f5f55",
+"q c #7f7f55",
+"r c #7f7faa",
+"s c #7f9f55",
+"t c #7f9faa",
+"u c #7fbfaa",
+"v c #7fbfff",
+"w c #7fdfaa",
+"x c #7fdfff",
+"y c #aa9f55",
+"z c #aa9faa",
+"A c #aabfaa",
+"B c #aadfaa",
+"C c #aadfff",
+"D c #d4bfaa",
+"E c #d4bfff",
+"F c #d4dfff",
+"G c #ffdfaa",
+"H c #ffdfff",
+"I c #ccccff",
+"J c #99ffff",
+"K c #ccffff",
+"L c #2a1f00",
+"M c #2a1f55",
+"N c #2a3f00",
+"O c #2a3f55",
+"P c #fffbf0",
+"Q c #a0a0a4",
+/* pixels */
+"#gMLLMh##Q###hLMOh#r",
+"hMLM#QAzAzAQQQQhLOh#",
+"MLO#QQQzAzQQQ####gg#",
+"LN#AAADaDDDDAAQQQhOh",
+".#QQzDALaaAAzQy#q#hO",
+"MQQDAaE..FaaDAAzQ##N",
+"hQQADDaLLLGaDAQ###qg",
+"#QADaaF....HaDDAQ###",
+"#QQADaPLLMLLaAQ#s#qh",
+"QQADaEP......aDAQ###",
+"#QzADDaLLLLLDAQ#q#qp",
+"QQzDaaF....FaDDQQ###",
+"q#QQzDDLMLaDzQ##qqhh",
+"hQQAAaa..aaDAAAQ###h",
+"N###QQzLAzQQQ#qqqjpO",
+"ghQQQzAAADAAyQQ###hh",
+"hOq#s###Q##q#qqhphgQ",
+"#hg#QQQQyQQ######h#A",
+"##hghqqq#qqqqpjhgQaz",
+"p##qgOh######hghQAQ#",
+"#hML.Lh#####hgLLgh#r",
+"gMLO#tQQQAQtQtthMOh#",
+"OLO#tQQtQtQtt###hgO#",
+"LL#QQzAAaaAAQQttthOh",
+".itQQAAMAzzzQt####gO",
+"O#QAAba..FFaAAQt###M",
+"hQtzAAbLLLabzQt#k#jO",
+"#QzAIaF....FabAQt###",
+"#ttAAbaLMLLLAQtr#hih",
+"tQzAaIF......bAtt###",
+"#ttzzAbLLLMLAQt###hh",
+"#QQAaaF....IbAQtk#k#",
+"##ttQzALLMAuQrr#hhhh",
+"OtQQAbb..abAzttr#r#O",
+"O###r#tLtQttr###hhhO",
+"NhtttQAzzQQQtt#k#kgh",
+"hOh###krkr##h#hhhhOQ",
+"#hg#r#t#t#r#r#k#ig#A",
+"##hOh#h#h#hhhhhcg#AQ",
+"h##qgOO##k#k#OOhQAz#",
+"#gML.Ocmmtm#kcLMgh#r",
+"hMLOmtuQuuuuttteMOh#",
+"MLO#tutuuututtmmjOO#",
+"LOmuuuAbAbAuuutttjOh",
+".jttuAbLbwbuuttmmkcO",
+"OtuAbAb..babbuuttmtO",
+"ctuuuwbLLLbxuuummkjc",
+"tuubabK....abbuutmmk",
+"mttuubCLLMLLxwnmmkjj",
+"tuubaCa......bvummmk",
+"mttubwJMLLLLxunmmjke",
+"tuuuBbb....Cwxuummkk",
+"kmtuuuxLLMxwommmkjfe",
+"ctutbub..Bxbuutmmk#c",
+"O#mmmunLonunmmmkjfeO",
+"Oettuuuvuuutummmmkch",
+"hOkmmmmmmmmmkkfjdegQ",
+"#hO#mmtmtmmmmmkmjc#A",
+"q#hOckkkkkkjdjecgQAQ",
+"####hOclmlkkkcOhQzQ#"
+};

Added: branches/branch-3.0/test2/porsche.xpm
===================================================================
--- branches/branch-3.0/test2/porsche.xpm	                        (rev 0)
+++ branches/branch-3.0/test2/porsche.xpm	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,71 @@
+/* XPM */
+static const char * porsche_xpm[] = {
+"64 64 4 1",
+" 	c #background",
+".	c #000000000000",
+"X	c #ffd100",
+"o	c #FFFF00000000",
+"                                                                ",
+"                   ..........................                   ",
+"              .....................................             ",
+"        ............XXXXXXXXXXXXXXXXXXXXXXXX............        ",
+"        ......XXXXXXX...XX...XXXXXXXX...XXXXXXXXXX......        ",
+"        ..XXXXXXXXXX..X..XX..XXXX.XXXX..XXXXXXXXXXXXXX..        ",
+"        ..XXXXXXXXXX..X..XX..XXX..XXXX..X...XXXXXXXXXX..        ",
+"        ..XXXXXXXXXX..XXXXX..XX.....XX..XX.XXXXXXXXXXX..        ",
+"        ..XXXXXXXXX.....XXX..XXX..XXXX..X.XXXXXXXXXXXX..        ",
+"        ..XXXXXXXXXX..XXXXX..XXX..XXXX....XXXXXXXXXXXX..        ",
+"        ..XXXXXXXXXX..XXXXX..XXX..XXXX..X..XXXXXXXXXXX..        ",
+"        ..XXXXXXXXXX..XXXXX..XXX..X.XX..XX..XXXXXXXXXX..        ",
+"        ..XXXXXXXXX....XXX....XXX..XX....XX..XXXXXXXXX..        ",
+"        ..XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..        ",
+"        ..XXXXXXXXX..........................XXXXXXXXX..        ",
+"        ..XXX.......XXXXXXXXXXX...................XXXX..        ",
+"        ......XX.XXX.XXX..XXXXX.........................        ",
+"        ..XXXXX.XXX.XXX.XXXX.XX.........................        ",
+"        ..XXXX.XXX.XX.......XXX.........................        ",
+"        ..XXXX.......XXXXXX..XX..ooooooooooooooooooooo..        ",
+"        ..X.....XXXXXXXXXXXXXXX..ooooooooooooooooooooo..        ",
+"        ..X...XXXXXXXXXXXXXXXXX..ooooooooooooooooooooo..        ",
+"        ..X..XXXXXXX.XX.XXXXXXX..ooooooooooooooooooooo..        ",
+"        ..XXXXX.XXX.XX.XXXXXXXX..ooooooooooooooooooooo..        ",
+"        ..XXXX.XXX.XX.XX................................        ",
+"        ..XXXX.X.........X....X.X.X.....................        ",
+"        ..XXXX...XXXXXXX.X..X...X.X.X.X.................        ",
+"        ..X....XXXXXXXXXX.X...X.X.X.....................        ",
+"        ..X...XXXXXXXXXX.XXXXXXXXXXXXXX.................        ",
+"        ..X..XXXXXX.XX.X.XXX...XXXXXXXX.................        ",
+"        ..XXXXX.XX.XX.XX.XX.....XXXXXXX.oooooooooooooo..        ",
+"        ..XXXX.XX.XX.XX..XX.X...XXXXX.X.oooooooooooooo..        ",
+"        ..XXXX.X.......X.XXXX...XXXX..X.oooooooooooooo..        ",
+"        ..X......XXXXXX..XXXX...XXXX..X.oooooooooooooo..        ",
+"        ..X...XXXXXXXXXX.XXX.....XXX.XX.oooooooooooooo..        ",
+"        ..X..XXXXXXXXXXX.X...........XX.oooooooooooooo..        ",
+"        .................X.X.........XX.................        ",
+"        .................X.X.XXXX....XX.XXXXXXXXXXXXXX..        ",
+"        .................XXX.XXXXX.X.XX.XXX.XX.XXXXXXX..        ",
+"         ................XXXX.XXX..X..X.XX.XX.XXX.XXX..         ",
+"         ................XXXXXXXX.XX.XX.X.XX.XXX.XXXX..         ",
+"         .................XXXXXX.XX.XX.X..........XXX..         ",
+"          ..oooooooooooooo.XXXXXXXXXX....XXXXXXXX..X..          ",
+"          ..ooooooooooooooo.XXXXXXXX....XXXXXXXXXXXX..          ",
+"           ..ooooooooooooooo........XXXXXXX.XX.XXXX..           ",
+"           ..oooooooooooooooooo..XXXXX.XXX.XX.XX.XX..           ",
+"            ..ooooooooooooooooo..XXXX.XXX.XX.XX.XX..            ",
+"            ..ooooooooooooooooo..XXX.XX........XXX..            ",
+"             ....................XXX....XXXXXX..X..             ",
+"              ...................XX...XXXXXXXXXXX.              ",
+"              ...................X...XXXXXXXXXXX..              ",
+"               ..................X..XXXX.XXXXXX..               ",
+"                .................XXX.XX.XX.XXX..                ",
+"                 ................XX.XX.XX.XXX..                 ",
+"                  ..ooooooooooo..XX.......XX..                  ",
+"                   ..oooooooooo..X...XXXX.X..                   ",
+"                    ..ooooooooo..X..XXXXXX..                    ",
+"                     ...ooooooo..X..XXXX...                     ",
+"                      ....ooooo..XXXXX....                      ",
+"                        ....ooo..XXX....                        ",
+"                          ....o..X....                          ",
+"                            ........                            ",
+"                              ....                              ",
+"                                                                "};

Added: branches/branch-3.0/test2/porsche1.xpm
===================================================================
--- branches/branch-3.0/test2/porsche1.xpm	                        (rev 0)
+++ branches/branch-3.0/test2/porsche1.xpm	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,76 @@
+/* XPM */
+static char * porsche[] = {
+/* width height ncolors chars_per_pixel */
+"64 64 -4 1 ",
+/* colormap */
+"\
+ \x50\x50\x80\
+.\xff\xff\0\
+r\xff\x00\0\
+b\0\0\0",
+/* pixels */
+"        bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb        ",
+"        bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb        ",
+"        bb............................................bb        ",
+"        bb.......................bbbbbbb.bb...........bb        ",
+"        bb.......................bbbbbbb.bb...........bb        ",
+"        bb......bbb...bb..bb.....bb......bb...........bb        ",
+"        bb......bbb...bb..bb.....bb......bb...........bb        ",
+"        bb.......bb.......bbbb...bbbbb...bb...........bb        ",
+"        bb.......bb...bb..bbbbb..bbbbb...bb...........bb        ",
+"        bb.......bb...bb..bb.bb..bb......bb...........bb        ",
+"        bb......bbbb..bb..bbbbb..bb......bbbbbb.......bb        ",
+"        bb......bbbb..bb..bbbb...bb......bbbbbb.......bb        ",
+"        bb............................................bb        ",
+"        bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb        ",
+"        bb.....................bbbbbbbbbbbbbbbbbbbbbbbbb        ",
+"        bb......b...b...bb.....bbbbbbbbbbbbbbbbbbbbbbbbb        ",
+"        bb.....b...b...b....b..bbbbbbbbbbbbbbbbbbbbbbbbb        ",
+"        bb....bb..bb.bbbbbbb...bbbbbbbbbbbbbbbbbbbbbbbbb        ",
+"        bb...bbbbbbbb......bb..bbrrrrrrrrrrrrrrrrrrrrrbb        ",
+"        bb..bbbb...............bbrrrrrrrrrrrrrrrrrrrrrbb        ",
+"        bb.bbb.................bbrrrrrrrrrrrrrrrrrrrrrbb        ",
+"        bb..........b..b.......bbrrrrrrrrrrrrrrrrrrrrrbb        ",
+"        bb.....b...b..b........bbrrrrrrrrrrrrrrrrrrrrrbb        ",
+"        bb....b...b..b..bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb        ",
+"        bb....b.bbbbbbbbb..............bbbbbbbbbbbbbbbbb        ",
+"        bb...bbbb.......bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb        ",
+"        bb..bbb.........b..............bbbbbbbbbbbbbbbbb        ",
+"        bb.bbb..........b...bbb........bbbbbbbbbbbbbbbbb        ",
+"        bb.........b..b.b..bbbbb.......bbbbbbbbbbbbbbbbb        ",
+"        bb.....b..b..b..b..b.bbb.....b.brrrrrrrrrrrrrrbb        ",
+"        bb....b..b..b..bb....bbb....bb.brrrrrrrrrrrrrrbb        ",
+"        bb...bb.bbbbbbb.b....bbb....bb.brrrrrrrrrrrrrrbb        ",
+"        bb..bbbbb......bb...bbbbb...b..brrrrrrrrrrrrrrbb        ",
+"        bb.bbb..........b.bbbbbbbbbbb..brrrrrrrrrrrrrrbb        ",
+"        bb..............b.b.bbbbbbbbb..brrrrrrrrrrrrrrbb        ",
+"        bbbbbbbbbbbbbbbbb.b.b....bbbb..bbbbbbbbbbbbbbbbb        ",
+"        bbbbbbbbbbbbbbbbb...b.....b.b..b..............bb        ",
+"        bbbbbbbbbbbbbbbbb........bb.bb.b...b..b.......bb        ",
+"         bbbbbbbbbbbbbbbb........b..b..b..b..b...b...bb         ",
+"         bbbbbbbbbbbbbbbb.......b..b...b.b..b...b....bb         ",
+"         bbbbbbbbbbbbbbbbb............b.bbbbbbbbbb...bb         ",
+"          bbrrrrrrrrrrrrrrb..........bbbb........bb.bb          ",
+"          bbrrrrrrrrrrrrrrrb........bbbb............bb          ",
+"           bbrrrrrrrrrrrrrrrbbbbbbbb.......b..b....bb           ",
+"           bbrrrrrrrrrrrrrrrrrrbb.....b...b..b..b..bb           ",
+"            bbrrrrrrrrrrrrrrrrrbb....b...b..b..b..bb            ",
+"            bbrrrrrrrrrrrrrrrrrbb...bb.bbbbbbbb...bb            ",
+"             bbbbbbbbbbbbbbbbbbbb...bbbb......bb.bb             ",
+"              bbbbbbbbbbbbbbbbbbb..bbb...........b              ",
+"              bbbbbbbbbbbbbbbbbbb.bbb...........bb              ",
+"               bbbbbbbbbbbbbbbbbb..............bb               ",
+"                bbbbbbbbbbbbbbbbb...b.b.b.....bb                ",
+"                 bbbbbbbbbbbbbbbb..b.b.b..b..bb                 ",
+"                  bbrrrrrrrrrrrbb..bbbbbbb..bb                  ",
+"                   bbrrrrrrrrrrbb.bbb....b.bb                   ",
+"                    bbrrrrrrrrrbb.bb......bb                    ",
+"                     bbbrrrrrrrbb.......bbb                     ",
+"                      bbbbrrrrrbb.....bbbb                      ",
+"                        bbbbrrrbb...bbbb                        ",
+"                          bbbbrbb.bbbb                          ",
+"                            bbbbbbbb                            ",
+"                              bbbb                              ",
+"                               bb                               ",
+"                                                                "
+} ;

Added: branches/branch-3.0/test2/progress.cxx
===================================================================
--- branches/branch-3.0/test2/progress.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/progress.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,51 @@
+#include <fltk/run.h>
+#include <fltk/Window.h>
+#include <fltk/ProgressBar.h>
+#include <stdlib.h>
+
+using namespace fltk;
+
+Window* win;
+
+static void ptimer(void *o)
+{
+	ProgressBar *pbar = (ProgressBar *)o;
+	if(pbar->position() < 100)
+	{
+		pbar->step(1);
+		add_timeout(0.1, ptimer, (void *)pbar);
+	}
+	else
+		win->hide();
+}
+
+int main(int argc, char **argv) {
+  ProgressBar* pbar;
+  int nargs = 0;
+  { Window* o = new Window(400, 100);
+    o->begin();
+    win = o;
+    { ProgressBar* o = new ProgressBar(25, 25, 330, 25, "Simple Progress Bar");
+      if (argc>1) {nargs++; o->minimum(atoi(argv[1]));}
+      if (argc>2) {nargs++; o->maximum(atoi(argv[2]));}
+
+	  pbar = o;
+	  //pbar->set_vertical();
+      o->box(ENGRAVED_BOX);
+#if (MAJOR_VERSION > 1)
+	  o->clear_flag(ALIGN_MASK);
+	  o->set_flag(ALIGN_BOTTOM);
+#else
+	  o->align(ALIGN_BOTTOM);
+#endif
+	  o->selection_color(BLUE);
+	  o->color(WHITE);
+	  o->textcolor(RED);
+    }
+    o->end();
+  }
+  add_timeout(0.1, ptimer, (void *)pbar);
+  if (nargs) argv[nargs] = argv[0];
+  win->show(argc-nargs, &argv[nargs]);
+  return run();
+}

Added: branches/branch-3.0/test2/qubix.cxx
===================================================================
--- branches/branch-3.0/test2/qubix.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/qubix.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,987 @@
+/* FLQUBIX
+
+   VERSION:  2.0
+   DATE:     20.10.2004
+   USING:    FLTK 2.0
+   PLATFORM: WINDOWS
+
+   A game of four-in-a-row in 3D
+
+   Adapted for FLTK, (http://www.fltk.org) September 2000, Frank
+   Siegert <frank@this.net> More of my workings is available on
+   http://www.this.net/~frank
+
+   This code may be used freely as long as it is given away for free
+   
+   It is hereby placed under the GPL (LGPL if you remove the random
+   generator embedded within)
+   
+   Please do not judge my professional work by the quality of this
+   hack, this puppy was written just for fun in about three hours out
+   of the DisplayPostscript code from NeXTSTEP. By doing this the code
+   comes back from a long journey - as the original author of FLTK
+   Bill Spitzak has released it in his famous 'hackkit' for NeXTSTEP
+   aeons ago (1991). The code is not written for clarity but *hey* it
+   works and now I do not need to boot my trusty NeXT just to
+   play. :-)
+
+   Further adapted by Bill Spitzak for fltk2.0 10/20/2004
+
+*/
+
+/* Original comments:
+
+   qubix.c generated from qubic.psw
+   by unix pswrap V1.009  Wed Apr 19 17:50:24 PDT 1989
+
+   This is the main file, containing all the game logic
+
+   in ancient times all UI stuff was embedded within too (no AppKit!)
+   so do not be too upset with the suboptimal structure
+
+   Original (c) 1991 by Bill Spitzak, Q&D ported to NeXTSTEP/Appkit by
+   Frank M. Siegert, 1998
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#if !defined (__APPLE__) && !defined (__FreeBSD__)
+# include <malloc.h>
+#endif
+#include <string.h>
+#include <math.h>
+#include <time.h>
+
+#include <fltk/run.h>
+#include <fltk/events.h>
+#include <fltk/Widget.h>
+#include <fltk/MenuBar.h>
+#include <fltk/Slider.h>
+#include <fltk/Window.h>
+#include <fltk/ask.h>
+#include <fltk/draw.h>
+#include <fltk/MenuBuild.h>
+
+using namespace fltk;
+
+Window *mainwin;
+Window *infowin;
+
+Slider *y_slider=(Slider *)0;
+
+Slider *x_silder=(Slider *)0;
+
+MenuBar *main_menu=(MenuBar *)0;
+
+void load_menu(MenuBar* menu) {
+    menu->begin();
+    {MenuSection g("Info"); new Item("About"); }
+    {MenuSection g("Game"); 
+	new Item("New Game"); 
+	new Item("Flip Sides"); 
+	new Item("Undo Last Move"); 
+    }
+    {MenuSection g("System"); new Item("Quit"); }
+    menu->end();
+};
+
+// taken directly from NeXTSTEP Qubix
+
+const char *remark=NULL;	/* message set by makemove */
+
+int board[65];			/* game field */
+bool playerblack;		/* which side I am on */
+int xangle=75,yangle=75;	/* angle in range 90 */
+double sinx,cosx,siny,cosy;	/* sin/cos of angles */
+
+#define viewdistance 12.0	/* units from origin of "eye" for perspective */
+#define MARK 1
+#define PLAYER 8
+#define COMPUTER 64
+
+#define TRUE 1
+#define FALSE 0
+
+#define MAXPATH 32
+
+/* Mersenne Twister random stuff */
+
+/* This library is free software; you can redistribute it and/or   */
+/* modify it under the terms of the GNU Library General Public     */
+/* License as published by the Free Software Foundation; either    */
+/* version 2 of the License, or (at your option) any later         */
+/* version.                                                        */
+/* This library is distributed in the hope that it will be useful, */
+/* but WITHOUT ANY WARRANTY; without even the implied warranty of  */
+/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.            */
+/* See the GNU Library General Public License for more details.    */
+/* You should have received a copy of the GNU Library General      */
+/* Public License along with this library; if not, write to the    */
+/* Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA   */ 
+/* 02111-1307  USA                                                 */
+
+/* Copyright (C) 1997 Makoto Matsumoto and Takuji Nishimura.       */
+/* When you use this, send an email to: matumoto@math.keio.ac.jp   */
+/* with an appropriate reference to your work.                     */
+
+/* REFERENCE                                                       */
+/* M. Matsumoto and T. Nishimura,                                  */
+/* "Mersenne Twister: A 623-Dimensionally Equidistributed Uniform  */
+/* Pseudo-Random Number Generator",                                */
+/* ACM Transactions on Modeling and Computer Simulation,           */
+/* Vol. 8, No. 1, January 1998, pp 3--30.                          */
+
+#include<stdio.h>
+
+/* Period parameters */  
+#define N 624
+#define M 397
+#define MATRIX_A 0x9908b0df   /* constant vector a */
+#define UPPER_MASK 0x80000000 /* most significant w-r bits */
+#define LOWER_MASK 0x7fffffff /* least significant r bits */
+
+/* Tempering parameters */   
+#define TEMPERING_MASK_B 0x9d2c5680
+#define TEMPERING_MASK_C 0xefc60000
+#define TEMPERING_SHIFT_U(y)  (y >> 11)
+#define TEMPERING_SHIFT_S(y)  (y << 7)
+#define TEMPERING_SHIFT_T(y)  (y << 15)
+#define TEMPERING_SHIFT_L(y)  (y >> 18)
+
+static unsigned long mt[N]; /* the array for the state vector  */
+static int mti=N+1; /* mti==N+1 means mt[N] is not initialized */
+
+/* initializing the array with a NONZERO seed */
+void sgenrand(unsigned long seed) 
+{
+    /* setting initial seeds to mt[N] using         */
+    /* the generator Line 25 of Table 1 in          */
+    /* [KNUTH 1981, The Art of Computer Programming */
+    /*    Vol. 2 (2nd Ed.), pp102]                  */
+    mt[0]= seed & 0xffffffff;
+    for (mti=1; mti<N; mti++)
+        mt[mti] = (69069 * mt[mti-1]) & 0xffffffff;
+}
+
+unsigned long genrand()
+{
+    unsigned long y;
+    static unsigned long mag01[2]={0x0, MATRIX_A};
+    /* mag01[x] = x * MATRIX_A  for x=0,1 */
+
+    if (mti >= N) { /* generate N words at one time */
+        int kk;
+
+        if (mti == N+1)   /* if sgenrand() has not been called, */
+            sgenrand(4357); /* a default initial seed is used   */
+
+        for (kk=0;kk<N-M;kk++) {
+            y = (mt[kk]&UPPER_MASK)|(mt[kk+1]&LOWER_MASK);
+            mt[kk] = mt[kk+M] ^ (y >> 1) ^ mag01[y & 0x1];
+        }
+        for (;kk<N-1;kk++) {
+            y = (mt[kk]&UPPER_MASK)|(mt[kk+1]&LOWER_MASK);
+            mt[kk] = mt[kk+(M-N)] ^ (y >> 1) ^ mag01[y & 0x1];
+        }
+        y = (mt[N-1]&UPPER_MASK)|(mt[0]&LOWER_MASK);
+        mt[N-1] = mt[M-1] ^ (y >> 1) ^ mag01[y & 0x1];
+
+        mti = 0;
+    }
+  
+    y = mt[mti++];
+    y ^= TEMPERING_SHIFT_U(y);
+    y ^= TEMPERING_SHIFT_S(y) & TEMPERING_MASK_B;
+    y ^= TEMPERING_SHIFT_T(y) & TEMPERING_MASK_C;
+    y ^= TEMPERING_SHIFT_L(y);
+
+    return y; 
+}
+
+// Compatibilty stuff
+// AKA poor man's DPS routines - we really only do the things the original needs omiting the rest
+//
+
+struct tpspoint {
+	double x;
+	double y;
+	bool draw;
+};
+
+struct tpspoint PSpath[MAXPATH];
+int nPathPtr=0;
+
+double grayvalue=0.0;
+double yscale=1.0;
+
+void PSsetgray(double value) {
+	int c = int(value * 255+.5);
+	setcolor(color(c,c,c));
+	grayvalue=value;
+}
+
+void PSsetlinewidth(double value) {
+
+}
+
+void PSgsave() {
+	push_matrix();
+}
+
+void PSgrestore() {
+	pop_matrix();
+}
+
+void PSsetinstance(int value) {
+
+}
+
+void PSscale(float x, float y) {
+	scale(x,y);
+	yscale = y;
+}
+
+
+void PStranslate(float x, float y) {
+	translate(x,y);
+}
+
+void PSshow(char *value) {
+
+}
+
+void PSrectfill(double x1, double y1, double x2, double y2) {
+
+}
+
+void PSmoveto(double x, double y) {
+  PSpath[nPathPtr].x = x;
+  PSpath[nPathPtr].y = 0.25 - y;
+  PSpath[nPathPtr].draw = FALSE;
+  nPathPtr++;
+  if (nPathPtr >= MAXPATH) {
+    alert("PATH OVERFLOW in PSmoveto()");
+    exit(1);
+  }
+}
+
+void PSlineto(double x, double y) {
+  PSpath[nPathPtr].x = x;
+  PSpath[nPathPtr].y = 0.25 - y;
+  PSpath[nPathPtr].draw = TRUE;
+  nPathPtr++;
+  if (nPathPtr >= MAXPATH) {
+    alert("PATH OVERFLOW in PSlineto()");
+    exit(1);
+  }
+}
+
+void PSstroke() {
+  if (nPathPtr<2) return;
+  for (int i=0; i<nPathPtr; i++) {
+    addvertex(float(PSpath[i].x), float(PSpath[i].y));
+  }
+  strokepath();
+  nPathPtr=0;
+}
+
+void PSthickstroke() {
+  if (nPathPtr<2) return;
+  for (int i=0; i<nPathPtr; i++) {
+    addvertex(float(PSpath[i].x), float(PSpath[i].y));
+  }
+  setcolor(YELLOW);
+  float dx = .3f, dy = 0; fltk::transform_distance(dx,dy);
+  line_style(JOIN_ROUND|CAP_ROUND,int(sqrt(dx*dx+dy*dy)+.9));
+  strokepath();
+  line_style(0);
+  PSsetgray(grayvalue);
+  nPathPtr=0;
+}
+
+#define RADIUS 0.25
+#define SOLARSIZE 0.2
+
+inline void addcircle(double x, double y, double r) {
+  addarc((float) (x-r), (float) (y-r), (float) (2*r), (float) (2*r), 0, 360);
+}
+
+void darkblob( void ) {
+  if (!nPathPtr) return;
+  setcolor(RED);
+
+  addcircle(PSpath[nPathPtr-1].x, PSpath[nPathPtr-1].y, RADIUS);
+  fillpath();
+
+  setcolor(color(255,128,128));
+  addcircle(PSpath[nPathPtr-1].x-RADIUS/2, PSpath[nPathPtr-1].y-RADIUS/2, RADIUS/5);
+  fillpath();
+
+  setcolor(color(255,200,200));
+  addcircle(PSpath[nPathPtr-1].x-RADIUS/2, PSpath[nPathPtr-1].y-RADIUS/2, RADIUS/8);
+  fillpath();
+
+  setcolor(BLACK);
+  addcircle(PSpath[nPathPtr-1].x, PSpath[nPathPtr-1].y, RADIUS);
+  strokepath();
+
+  PSsetgray(grayvalue);
+  nPathPtr=0;
+}
+
+void whiteblob( void ) {
+  if (!nPathPtr) return;
+  setcolor(BLUE);
+
+  addcircle(PSpath[nPathPtr-1].x, PSpath[nPathPtr-1].y, RADIUS);
+  fillpath();
+
+  setcolor(color(128,128,255));
+  addcircle(PSpath[nPathPtr-1].x-RADIUS/2, PSpath[nPathPtr-1].y-RADIUS/2, RADIUS/5);
+  fillpath();
+
+  setcolor(color(200,200,255));
+  addcircle(PSpath[nPathPtr-1].x-RADIUS/2, PSpath[nPathPtr-1].y-RADIUS/2, RADIUS/8);
+  fillpath();
+
+  setcolor(BLACK);
+  addcircle(PSpath[nPathPtr-1].x, PSpath[nPathPtr-1].y, RADIUS);
+  strokepath();
+  PSsetgray(grayvalue);
+  nPathPtr=0;
+}
+
+
+// not needed, we don't do instance drawing
+
+void clipblob( void ) {
+
+}
+
+// the rest is take directly from the NeXTSTEP qubix again
+
+void moveto3(double x,double y,double z) {
+  double zscale;
+  zscale = viewdistance/(viewdistance-(siny*y+sinx*cosy*x+cosx*cosy*z));
+  PSmoveto((cosx*x-sinx*z)*zscale, (cosy*y-sinx*siny*x-cosx*siny*z)*zscale);
+  /*  PSmoveto(cosx*x-sinx*siny*y+sinx*cosy*z, z*siny+y*cosy); */
+}
+
+void lineto3(double x,double y,double z) {
+  double zscale;
+  zscale = viewdistance/(viewdistance-(siny*y+sinx*cosy*x+cosx*cosy*z));
+  PSlineto((cosx*x-sinx*z)*zscale, (cosy*y-sinx*siny*x-cosx*siny*z)*zscale);
+  /*  PSlineto(cosx*x-sinx*siny*y+sinx*cosy*z, z*siny+y*cosy); */
+}
+
+double distto(double mx,double my,double x,double y,double z) {
+  double zscale;
+  zscale = viewdistance/(viewdistance-(siny*y+sinx*cosy*x+cosx*cosy*z));
+  return(fabs((cosx*x-sinx*z)*zscale-mx)+
+	 fabs((cosy*y-sinx*siny*x-cosx*siny*z)*zscale-my));
+}
+
+int inwinrow(int);
+
+static double wx,wy,wz;
+void winline(int i,double x,double y, double z) {
+  double d=0.0;
+  if (!inwinrow(i)) return;
+  if (wx) {
+    switch ((x!=wx)+(y!=wy)+(z!=wz)) {
+    case 1: d = .25; break;
+    case 2: d = .25*0.70710678; break;
+    case 3: d = .25*0.57735027; break;
+    }
+    PSsetlinewidth(0.15);
+    moveto3(wx+d*(x-wx),wy+d*(y-wy),wz+d*(z-wz));
+    lineto3(x,y,z);
+    PSthickstroke();
+    PSsetlinewidth(0.0);
+  }
+  wx = x; wy = y; wz = z;
+}
+
+/* draw position x and any of the rest of the board that might obscure
+   it.  If x is zero, also erase the previous board.  If instance is
+   on, draw the new piece using instance drawing. */
+void drawfrom(int ifrom, int instance, fltk::Widget* widget) {
+  double x,y,z,l1;
+  int a,b,c,i,from;
+  from = ifrom;
+  PSscale(widget->w()/6.0f, widget->h()/6.0f);
+  PStranslate(3.0,3.0);
+  PSsetlinewidth(0.0);
+  if (!from) {
+    PSsetgray(.666); 
+    PSrectfill(-3,-3,6,6); 
+    PSsetgray(0.0);
+  } else {
+    PSgsave();
+    a = (from-1)>>4;
+    b = ((from-1)>>2)&3;
+    c = (from-1)&3;
+    moveto3(-1.5+b,-1.5+a,-1.5+c);
+    clipblob();
+    if (instance) PSsetinstance(TRUE);
+  }
+  wx = 0;
+  for(a=0,y=-1.5; a<4; a++,y+=1.0) {
+    if (xangle<45) {				
+      for (b=0,x=-1.5; b<4; b++,x+=1.0) {
+	for (c=0,l1=z=-1.5; c<4; c++,z+=1.0) {
+	  i = 16*a+4*b+c+1;
+	  if (board[i] && (!from || i==from)) {
+	    winline(i,x,y,z);
+	    if (!from && c) {
+	      moveto3(x,y,l1);
+	      lineto3(x,y,z);
+	      PSstroke();
+	    }
+	    from = 0;
+	    moveto3(x,y,z);
+	    if (board[i]==PLAYER)
+	      playerblack?darkblob():whiteblob();
+	    else playerblack?whiteblob():darkblob();
+	    l1 = z+.25;
+	  }
+	}
+	if (from) continue;
+	if (l1<1.5) {
+	  moveto3(x,y,l1); 
+	  lineto3(x,y,1.5); 
+	  PSstroke();
+	}
+	if (b<3) for (c=0,z=-1.5; c<4; c++,z+=1.0) {
+	  moveto3(x+(board[16*a+4*b+c+1]?.25:0.0),y,z);
+	  lineto3(x+1.0,y,z);
+	  PSstroke();
+	}
+      }
+    } else {
+      for (c=0,z=-1.5; c<4; c++,z+=1.0) {
+	for (b=0,l1=x=-1.5; b<4; b++,x+=1.0) {
+	  i = 16*a+4*b+c+1;
+	  if (board[i] && (!from || i==from)) {
+	    winline(i,x,y,z);
+	    if (!from && b) {
+	      moveto3(l1,y,z);
+	      lineto3(x,y,z);
+	      PSstroke();
+	    }
+	    from = 0;
+	    moveto3(x,y,z);
+	    if (board[i]==PLAYER)
+	      playerblack?darkblob():whiteblob();
+	    else playerblack?whiteblob():darkblob();
+	    l1 = x+.25;
+	  }
+	}
+	if (from) continue;
+	if (l1<1.5) {
+	  moveto3(l1,y,z); 
+	  lineto3(1.5,y,z); 
+	  PSstroke();
+	}
+	if (c<3) for (b=0,x=-1.5; b<4; b++,x+=1.0) {
+	  moveto3(x,y,z+(board[16*a+4*b+c+1]?.25:0.0));
+	  lineto3(x,y,z+1.0);
+	  PSstroke();
+	}
+      }
+    }
+  } 
+  if (ifrom) PSgrestore();
+}
+
+/*=========================== Original NS User Interface ===========================*/
+
+void maindisplay() {
+  mainwin->redraw();
+  mainwin->flush();
+}
+
+int winrow;	/* n-1 out of lines table of winning line */
+char moves[64];	/* undo history */
+int movenum;
+int initedfltk=0;
+
+void newgame(void) {
+  memset(board,0,sizeof(board));
+  winrow = 0;
+  movenum = 0;
+  playerblack = 0;
+  remark = NULL;
+  if (initedfltk) maindisplay();
+}
+
+void erasemarks();
+int makemove();
+
+void computermove(void) {
+  int i = makemove(); erasemarks();
+  if (i) board[i] = COMPUTER;
+  moves[movenum++] = i;
+  maindisplay();
+}
+
+void flipboard(void) {
+  int i;
+  for (i=1; i<65; i++)
+    if (board[i] == PLAYER) board[i] = COMPUTER;
+    else if (board[i] == COMPUTER) board[i] = PLAYER;
+}
+
+void flipsides(void) {
+  flipboard();
+  playerblack = !playerblack;
+  if (movenum && moves[movenum-1]==0) movenum--;
+  else computermove();
+  maindisplay();
+}
+
+void help(void) {
+  int i;
+  flipboard();
+  i = makemove(); erasemarks();
+  flipboard();
+  if (i) {
+    board[i] = PLAYER;
+    moves[movenum++] = i;
+    maindisplay();
+    computermove();
+  }
+}
+
+void undo(void) {
+  if (movenum<2) return;
+  board[(int)moves[--movenum]] = 0;
+  board[(int)moves[--movenum]] = 0;
+  winrow = 0;
+  maindisplay();
+}
+
+int setAPiece(double pntx, double pnty, int for_real, fltk::Widget* widget)
+{
+  static int needsReset=FALSE;
+  static int pieceReset=0;
+  double x,y,z,l1,mx,my,idist;
+  int a,b,c,i,pi;
+  int e;
+
+  if (needsReset == TRUE) {
+    board[pieceReset] = 0;
+    needsReset=FALSE;
+  }
+
+  if (winrow) return 1;
+  //printf("setAPiece %d: %f %f\n",for_real, pntx,pnty);
+
+  pi = 0;
+  do {
+    mx = (6.0*(pntx))/widget->w() - 3; 
+    my = (6.0*(pnty))/widget->h() - 3;
+    idist = .25; i = 0;
+    for(a=0,y=-1.5; a<4; a++,y+=1.0) {
+      for (c=0,z=-1.5; c<4; c++,z+=1.0) {
+	for (b=0,x=-1.5; b<4; b++,x+=1.0) {
+	  if (board[16*a+4*b+c+1]) continue;
+	  l1 = distto(mx,my,x,y,z);
+	  if (l1 <= idist) {
+	    idist=l1;
+	    i = 16*a+4*b+c+1;
+	  }
+	}
+      }
+    }
+    if (i!=pi) {
+      if (i && !for_real) {
+	board[i] = PLAYER;
+	maindisplay();
+	needsReset=TRUE;
+	pieceReset=i;
+      }
+      pi = i;
+    }
+    e = 0;
+  } while (e != 0);
+  if (!i) {
+    maindisplay();
+    return 2;
+  }
+  if (!for_real) {
+    maindisplay();
+    return 3;
+  }
+  board[i] = PLAYER; 
+  moves[movenum++] = i;
+  maindisplay();
+  computermove();
+  return 0;
+}
+
+void updateSliderPos(double xangle, double yangle)
+{
+  double x,y;
+  //alert("%f %f",xangle, yangle);
+  x = (90-xangle)*(3.14159/180);
+  sinx = sin(x); cosx = cos(x);
+  y = (90-yangle)*(3.14159/180);
+  siny = sin(y); cosy = cos(y);
+}
+
+void setupGFX() {
+  double x,y;
+
+  x = (90-xangle)*(3.14159/180);
+  sinx = sin(x); cosx = cos(x);
+  y = (90-yangle)*(3.14159/180);
+  siny = sin(y); cosy = cos(y);
+}
+
+/*=============================== Game logic =============================*/
+
+const int lines[304] = {
+	1,2,3,4,	8,7,6,5,	12,11,10,9,	13,14,15,16,
+	20,19,18,17,	21,22,23,24,	25,26,27,28,	32,31,30,29,
+	36,35,34,33,	37,38,39,40,	41,42,43,44,	48,47,46,45,
+	49,50,51,52,	56,55,54,53,	60,59,58,57,	61,62,63,64,
+
+	1,5,9,13,	14,10,6,2,	15,11,7,3,	4,8,12,16,
+	29,25,21,17,	18,22,26,30,	19,23,27,31,	32,28,24,20,
+	45,41,37,33,	34,38,42,46,	35,39,43,47,	48,44,40,36,
+	49,53,57,61,	62,58,54,50,	63,59,55,51,	52,56,60,64,
+
+	1,17,33,49,	53,37,21,5,	57,41,25,9,	13,29,45,61,
+	50,34,18,2,	6,22,38,54,	10,26,42,58,	62,46,30,14,
+	51,35,19,3,	7,23,39,55,	11,27,43,59,	63,47,31,15,
+	4,20,36,52,	56,40,24,8,	60,44,28,12,	16,32,48,64,
+
+	1,6,11,16,	32,27,22,17,	48,43,38,33,	49,54,59,64,
+	13,10,7,4,	20,23,26,29,	36,39,42,45,	61,58,55,52,
+	1,21,41,61,	62,42,22,2,	63,43,23,3,	4,24,44,64,
+	49,37,25,13,	14,26,38,50,	15,27,39,51,	52,40,28,16,
+	1,18,35,52,	56,39,22,5,	60,43,26,9,	13,30,47,64,
+	49,34,19,4,	8,23,38,53,	12,27,42,57,	61,46,31,16,
+
+	1,22,43,64,	49,38,27,16,	61,42,23,4,	13,26,39,52};
+
+int nummarks;
+
+void erasemarks() {
+  int *point;
+  for (point = &board[64]; point > board; point--)
+    if (*point == MARK) *point = 0;
+  nummarks = 0;
+}
+
+int linesum(int i) {	/* add the values in a line on the board */
+  int sum,j;
+  const int *p;
+  if (i > 75) return(-1);
+  for (sum = 0, j = 0, p = lines+4*i; j < 4; j++) sum += board[*p++];
+  return(sum);
+}
+
+void markline(int i) {
+  int j;
+  const int *p;
+  for (j = 0, p = lines+4*i; j < 4; j++,p++) if (!board[*p]) {
+    board[*p] = MARK;
+    nummarks++;
+  }
+}
+
+int find(int n, int i) {	/* locate n in a line */
+  const int *p;
+  p = lines+4*i;
+  if (board[*(p+1)] == n) return(*(p+1));
+  if (board[*(p+2)] == n) return(*(p+2));
+  if (board[*(p+0)] == n) return(*(p+0));
+  if (board[*(p+3)] == n) return(*(p+3));
+  return(0);
+}
+
+int inwinrow(int n) {
+  const int *p;
+  if (!winrow) return(FALSE);
+  p = lines+4*(winrow-1);
+  if (*p++ == n) return(TRUE);
+  if (*p++ == n) return(TRUE);
+  if (*p++ == n) return(TRUE);
+  if (*p == n) return(TRUE);
+  return(FALSE);
+}
+
+int makemove() {
+  int i,line,move;
+
+  for (i=0; (line=linesum(i))>=0; i++) if (line == 4*PLAYER) {
+    remark = "Rats.  You win.";
+    winrow = i+1;
+    return(0);
+  }
+  else if (line == 4*COMPUTER) {
+    remark = "I win!";
+    winrow = i+1;
+    return(0);
+  }
+
+  for (i=0; (line=linesum(i))>=0; i++) if (line == 3*COMPUTER) {
+    remark = "I win!";
+    winrow = i+1;
+    return(find(0,i));
+  }
+
+  for (i=0; (line=linesum(i))>=0; i++) if (line == 3*PLAYER) {
+    remark = "I'll block that.";
+    return(find(0,i));
+  }
+
+  move = 0;
+
+  for (i=0; (line=linesum(i))>=0; i++) {
+    /* computer tries to make crossed triples */
+    if (line == 2*COMPUTER) markline(i);
+    else if (line == 2*COMPUTER+MARK || line == 2*COMPUTER+2*MARK) {
+      remark = "Let's see you get out of this...";
+      move = find(MARK,i);
+      goto DONE;
+    }
+  }
+
+  if (nummarks) for (i=0; (line=linesum(i))>=0; i++) {
+    /* computer tries to force a crossed triple */
+    if (line == COMPUTER+2*MARK || line == COMPUTER+3*MARK) {
+      remark = "You've had it now...";
+      move = find(MARK,i);
+      goto DONE;
+    }
+    else if (line == 3*MARK || line == 4*MARK) {
+      remark = "You have to block my triple...";
+      move = find(MARK,i);
+      goto DONE;
+    }
+    else if (line == 2*MARK) {
+      remark = "Look carefully or you will lose...";
+      move = find(0,i);
+    }
+  }
+
+  erasemarks();
+  for (i=0; (line=linesum(i))>=0; i++)
+    if (line == 2*PLAYER) markline(i);
+    else if (line == 2*PLAYER+MARK || line == 2*PLAYER+2*MARK) {
+      remark = "You'll have to be more clever than that.";
+      move = find(MARK,i);
+      goto DONE;
+    }
+
+  if (nummarks) for (i=0; (line=linesum(i))>=0; i++) {
+    /* try to block good players */
+    if (line == PLAYER+2*MARK || line == PLAYER+3*MARK) {
+      remark = "This should mess up your plans.";
+      move = find(MARK,i);
+      goto DONE;
+    }
+    else if (line == 2*MARK || line == 3*MARK || line == 4*MARK) {
+      remark = "Are you trying something?";
+      move = find(MARK,i);
+    }
+    else if (!move && line>COMPUTER && line<COMPUTER+4*MARK) {
+      remark = 0;
+      move = find(MARK,i);
+    }
+  }
+  if (move) goto DONE;
+
+  /* random move, as long as it is in non-dead line */
+  erasemarks();
+  for (i=1; (line=linesum(i))>=0; i++)
+    if (!((line & 7*PLAYER) && (line & 7*COMPUTER)))
+      /* line does not contain both types of pieces */
+      markline(i);
+  if (nummarks) {
+    remark = 0;
+    do move = (genrand()&63)+1; while (board[move] != MARK);
+  }
+  else remark = "Tie game!";
+
+ DONE:
+  erasemarks();
+  return(move);
+}
+
+// FLTK specific stuff 
+
+// the game board view, also the event handler
+
+class QubixView : public Widget {
+  void draw() {
+    push_clip(0, 0, w(),h());
+    setcolor(WHITE);
+    fillrect(0,0,w(),h());
+    push_matrix();
+    drawfrom(0,0, this);
+    pop_matrix();
+    if (remark) {
+      setfont(HELVETICA,12);
+      drawtext(remark, 3, (float) h()-13);
+    }
+    pop_clip();
+  }
+  int handle(int event) {
+    int x2,y2;
+    switch (event) {
+    case PUSH:
+      /* fall throu */
+    case DRAG:
+      x2 = event_x();
+      y2 = event_y();
+      setAPiece(x2-6,(h()-y2)+18, 0, this);
+      return 1;
+      /* not reached */
+      break;
+    case RELEASE:
+      x2 = event_x();
+      y2 = event_y();
+      setAPiece(x2-6,(h()-y2)+18, 1, this);
+      return 1;
+      /* not reached */
+      break;
+    }
+    return 0;
+  }
+public:
+  QubixView(int X,int Y,int W,int H) : Widget(X,Y,W,H) {}
+};
+
+/* turn the game board by using the sliders */
+void updatedSlider(Widget *wid, void *value) {
+  double xv, yv;
+
+  xv = x_silder->value();
+  yv = y_slider->value();
+
+  updateSliderPos(xv,yv);
+
+  mainwin->redraw();
+}
+
+/* handle the menu */
+void menu_callback(Widget* w, void*) {
+  Menu* mw = (Menu*)w;
+  const Widget* m = mw->item();
+  const char* acTmp = m->label();
+
+  if (!strcmp("About",acTmp)) {
+    infowin->show();
+  }
+  if (!strcmp("New Game",acTmp)) {
+    newgame();
+  }
+  if (!strcmp("Flip Sides",acTmp)) {
+    flipsides();
+  }
+  if (!strcmp("Undo Last Move",acTmp)) {
+    undo();
+  }
+  if (!strcmp("Quit",acTmp)) {
+    alert("  Thanks for playing FlQubix... Have a nice day!");
+    exit(0);
+  }
+
+}
+
+/* make our windows */
+
+Window* make_infowin() {
+  Window* w;
+  { Window* o = new Window(364, 299);
+    w = o;
+    o->begin();
+    { Widget* o = new Widget(20, 0, 325, 95, "Qubix");
+      o->labelfont(TIMES_BOLD_ITALIC);
+      o->labelsize(80);
+    }
+    { Widget* o = new Widget(30, 105, 305, 40, "A game of 4-in-a-row in 3D");
+      o->labelfont(TIMES);
+      o->labelsize(24);
+    }
+    { Widget* o = new Widget(20, 150, 335, 35, "written by Frank Siegert <frank@this.net>");
+      o->labelfont(TIMES);
+      o->labelsize(18);
+    }
+    { Widget* o = new Widget(15, 190, 340, 35, "Based on Qubix by Bill Spitzak");
+      o->labelfont(TIMES);
+      o->labelsize(18);
+    }
+    { Widget* o = new Widget(85, 215, 195, 25, "(c) 1991 on NeXTSTEP");
+      o->labelfont(TIMES);
+      o->labelsize(18);
+    }
+    { Widget* o = new Widget(25, 260, 320, 25, "This program may be distributed freely (GPL)");
+      o->labelfont(TIMES);
+      o->labelsize(18);
+    }
+    { Widget* o = new Widget(10, 75, 320, 20, "in FLTK");
+      o->labelfont(TIMES);
+      o->labelsize(18);
+    }
+    o->end();
+  }
+  return w;
+}
+
+
+Window* make_gamewin() {
+  Window* w;
+  { Window* o = new Window(403, 426,"FLTK Qubix");
+    o->set_double_buffer();
+    o->begin();
+    w = o;
+    y_slider = new Slider(380, 35, 20, 370);
+    y_slider->set_vertical();
+	y_slider->minimum(0.0);
+	y_slider->maximum(90.0);
+	y_slider->value(75.0);
+	y_slider->callback(updatedSlider);
+
+	// oh well... if this the way of fluid....
+
+    { Slider* o = x_silder = new Slider(0, 405, 380, 20);
+	  o->minimum(0.0);
+	  o->maximum(90.0);
+	  o->value(75.0);
+	  o->callback(updatedSlider);
+    }
+    { MenuBar* o = main_menu = new MenuBar(10, 5, 170, 25);
+      load_menu(main_menu);
+	  o->callback(menu_callback);
+    }
+    { QubixView* o = new QubixView(10, 35, 370, 370);
+    w->resizable(o);
+    }
+    o->end();
+  }
+  return w;
+}
+
+/* main routine */
+
+int main(int argc, char **argv) {
+
+  sgenrand(time(0));
+
+  mainwin = make_gamewin();
+  infowin = make_infowin();
+
+  setupGFX();
+  newgame();
+
+  mainwin->show();
+
+  initedfltk = 1;
+
+  return run();
+}

Added: branches/branch-3.0/test2/radio.cxx
===================================================================
--- branches/branch-3.0/test2/radio.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/radio.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,114 @@
+// generated by Fast Light User Interface Designer (fluid) version 2.0100
+
+#include "radio.h"
+using namespace fltk;
+
+fltk::LightButton* ttlb;
+
+static void cb_ttlb(fltk::LightButton*, void*) {
+  Tooltip::enable(ttlb->value() ? true : false);
+}
+
+#include <fltk/run.h>
+
+int main (int argc, char **argv) {
+
+  fltk::Window* w;
+   {fltk::Window* o = new fltk::Window(380, 274, "Radio buttons and Tooltips");
+    w = o;
+    o->tooltip("This is a window");
+    o->begin();
+     {fltk::Button* o = new fltk::Button(20, 10, 160, 25, "Button");
+      o->tooltip("This is a button");
+    }
+     {fltk::ReturnButton* o = new fltk::ReturnButton(20, 40, 160, 25, "ReturnButton");
+      o->shortcut(0xff0d);
+      o->tooltip("This is a return button");
+    }
+     {fltk::LightButton* o = new fltk::LightButton(20, 70, 160, 25, "LightButton");
+      o->tooltip("This is a light button!  This particular light button has a very long tooltip\
+.  This tooltip should demonstrate that very long tooltips are wrapped across \
+multiple lines.");
+    }
+     {fltk::CheckButton* o = new fltk::CheckButton(20, 100, 160, 25, "CheckButton");
+      o->tooltip("This is a check button");
+    }
+     {fltk::RadioButton* o = new fltk::RadioButton(20, 125, 160, 25, "RoundButton");
+      o->tooltip("This is a round button");
+    }
+     {fltk::Group* o = new fltk::Group(190, 10, 70, 200);
+      o->set_vertical();
+      o->tooltip("This is a group");
+      o->begin();
+       {fltk::CheckButton* o = new fltk::CheckButton(0, 0, 70, 25, "radio");
+        o->type(fltk::CheckButton::RADIO);
+        o->tooltip("This is a check button");
+      }
+       {fltk::CheckButton* o = new fltk::CheckButton(0, 25, 70, 25, "radio");
+        o->type(fltk::CheckButton::RADIO);
+        o->tooltip("This is a check button");
+      }
+       {fltk::CheckButton* o = new fltk::CheckButton(0, 50, 70, 25, "radio");
+        o->type(fltk::CheckButton::RADIO);
+        o->tooltip("This is a check button");
+      }
+       {fltk::CheckButton* o = new fltk::CheckButton(0, 75, 70, 25, "radio");
+        o->type(fltk::CheckButton::RADIO);
+        o->tooltip("This is a check button");
+      }
+       {fltk::CheckButton* o = new fltk::CheckButton(0, 100, 70, 25, "radio");
+        o->type(fltk::CheckButton::RADIO);
+        o->tooltip("This is a check button");
+      }
+       {fltk::CheckButton* o = new fltk::CheckButton(0, 125, 70, 25, "radio");
+        o->type(fltk::CheckButton::RADIO);
+        o->tooltip("This is a check button");
+      }
+       {fltk::CheckButton* o = new fltk::CheckButton(0, 150, 70, 25, "radio");
+        o->type(fltk::CheckButton::RADIO);
+        o->tooltip("This is a check button");
+      }
+       {fltk::CheckButton* o = new fltk::CheckButton(0, 175, 70, 25, "radio");
+        o->type(fltk::CheckButton::RADIO);
+        o->tooltip("This is a check button");
+      }
+      o->end();
+    }
+     {fltk::Group* o = new fltk::Group(270, 10, 90, 115);
+      o->set_vertical();
+      o->box(fltk::THIN_UP_BOX);
+      o->tooltip("This is a group");
+      o->begin();
+       {fltk::Button* o = new fltk::Button(15, 10, 20, 20, "radio");
+        o->type(fltk::Button::RADIO);
+        o->align(fltk::ALIGN_RIGHT);
+        o->tooltip("This the first button of the group");
+      }
+       {fltk::Button* o = new fltk::Button(15, 35, 20, 20, "radio");
+        o->type(fltk::Button::RADIO);
+        o->align(fltk::ALIGN_RIGHT);
+        o->tooltip("This the second button of the group");
+      }
+       {fltk::Button* o = new fltk::Button(15, 60, 20, 20, "radio");
+        o->type(fltk::Button::RADIO);
+        o->align(fltk::ALIGN_RIGHT);
+        o->tooltip("This the third button of the group");
+      }
+       {fltk::Button* o = new fltk::Button(15, 85, 20, 20, "radio");
+        o->type(fltk::Button::RADIO);
+        o->align(fltk::ALIGN_RIGHT);
+        o->tooltip("This the fourth button of the group");
+      }
+      o->end();
+    }
+     {fltk::LightButton* o = ttlb = new fltk::LightButton(120, 230, 130, 30, "Show Tooltips");
+      o->set_flag(fltk::STATE);
+      o->callback((fltk::Callback*)cb_ttlb);
+      o->tooltip("This button enables or disables tooltips");
+    }
+    o->end();
+    o->resizable(o);
+  }
+  w->show(argc, argv);
+  return  fltk::run();
+}

Added: branches/branch-3.0/test2/radio.fl
===================================================================
--- branches/branch-3.0/test2/radio.fl	                        (rev 0)
+++ branches/branch-3.0/test2/radio.fl	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,122 @@
+# data file for the FLTK User Interface Designer (FLUID)
+version 2.0100 
+images_dir ./ 
+header_name {.h} 
+code_name {.cxx} 
+gridx 10 
+gridy 5 
+snap 3
+namespace fltk {open
+} {
+Function {} {open selected
+} {
+  {fltk::Window} {} {
+    label {Radio buttons and Tooltips} open
+    tooltip {This is a window}
+    xywh {372 93 380 274} resizable visible
+  } {
+    {fltk::Button} {} {
+      label Button
+      tooltip {This is a button}
+      xywh {20 10 160 25}
+    }
+    {fltk::ReturnButton} {} {
+      label ReturnButton
+      tooltip {This is a return button}
+      xywh {20 40 160 25} shortcut 0xff0d
+    }
+    {fltk::LightButton} {} {
+      label LightButton
+      tooltip {This is a light button!  This particular light button has a very long tooltip.  This tooltip should demonstrate that very long tooltips are wrapped across multiple lines.}
+      xywh {20 70 160 25}
+    }
+    {fltk::CheckButton} {} {
+      label CheckButton
+      tooltip {This is a check button}
+      xywh {20 100 160 25}
+    }
+    {fltk::RadioButton} {} {
+      label RoundButton
+      tooltip {This is a round button}
+      xywh {20 125 160 25}
+    }
+    {fltk::Group} {} {open
+      tooltip {This is a group}
+      xywh {190 10 70 200}
+    } {
+      {fltk::CheckButton} {} {
+        label radio
+        tooltip {This is a check button}
+        xywh {0 0 70 25} type RADIO
+      }
+      {fltk::CheckButton} {} {
+        label radio
+        tooltip {This is a check button}
+        xywh {0 25 70 25} type RADIO
+      }
+      {fltk::CheckButton} {} {
+        label radio
+        tooltip {This is a check button}
+        xywh {0 50 70 25} type RADIO
+      }
+      {fltk::CheckButton} {} {
+        label radio
+        tooltip {This is a check button}
+        xywh {0 75 70 25} type RADIO
+      }
+      {fltk::CheckButton} {} {
+        label radio
+        tooltip {This is a check button}
+        xywh {0 100 70 25} type RADIO
+      }
+      {fltk::CheckButton} {} {
+        label radio
+        tooltip {This is a check button}
+        xywh {0 125 70 25} type RADIO
+      }
+      {fltk::CheckButton} {} {
+        label radio
+        tooltip {This is a check button}
+        xywh {0 150 70 25} type RADIO
+      }
+      {fltk::CheckButton} {} {
+        label radio
+        tooltip {This is a check button}
+        xywh {0 175 70 25} type RADIO
+      }
+    }
+    {fltk::Group} {} {open
+      tooltip {This is a group}
+      xywh {270 10 90 115} box THIN_UP_BOX
+    } {
+      {fltk::Button} {} {
+        label radio
+        tooltip {This the first button of the group}
+        xywh {15 10 20 20} type RADIO align 8
+      }
+      {fltk::Button} {} {
+        label radio
+        tooltip {This the second button of the group}
+        xywh {15 35 20 20} type RADIO align 8
+      }
+      {fltk::Button} {} {
+        label radio
+        tooltip {This the third button of the group}
+        xywh {15 60 20 20} type RADIO align 8
+      }
+      {fltk::Button} {} {
+        label radio
+        tooltip {This the fourth button of the group}
+        xywh {15 85 20 20} type RADIO align 8
+      }
+    }
+    {fltk::LightButton} ttlb {
+      label {Show Tooltips}
+      callback {Tooltip::enable(ttlb->value() ? true : false);}
+      tooltip {This button enables or disables tooltips}
+      xywh {120 230 130 30} value 1
+      extra_code {\#include <fltk/Tooltip.h>}
+    }
+  }
+} 
+} 

Added: branches/branch-3.0/test2/radio.h
===================================================================
--- branches/branch-3.0/test2/radio.h	                        (rev 0)
+++ branches/branch-3.0/test2/radio.h	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,17 @@
+// generated by Fast Light User Interface Designer (fluid) version 2.0100
+
+#ifndef radio_h
+#define radio_h
+#include <fltk/Window.h>
+#include <fltk/Button.h>
+#include <fltk/ReturnButton.h>
+#include <fltk/LightButton.h>
+#include <fltk/CheckButton.h>
+#include <fltk/RadioButton.h>
+#include <fltk/Group.h>
+#include <fltk/Tooltip.h>
+extern fltk::LightButton* ttlb;
+
+namespace fltk  {
+}
+#endif

Added: branches/branch-3.0/test2/resizable.cxx
===================================================================
--- branches/branch-3.0/test2/resizable.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/resizable.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,115 @@
+// generated by Fast Light User Interface Designer (fluid) version 2.0002
+
+#include "resizable.h"
+
+#include <fltk/run.h>
+
+int main (int argc, char **argv) {
+
+  fltk::Window* w;
+   {fltk::Window* o = new fltk::Window(560, 470);
+    w = o;
+    o->begin();
+     {fltk::MenuBar* o = new fltk::MenuBar(515, 0, 45, 25);
+      o->tooltip("A right-justified help item can be made by making a second menubar and puttin\
+g it to the right of the resizable().");
+      o->begin();
+       {fltk::ItemGroup* o = new fltk::ItemGroup("Help");
+        o->begin();
+        new fltk::Item("About...");
+        new fltk::Item("Chapter 1");
+        o->end();
+      }
+      o->end();
+    }
+     {fltk::MenuBar* o = new fltk::MenuBar(0, 0, 515, 25);
+      o->begin();
+      new fltk::Item("This");
+      new fltk::Item("is");
+      new fltk::Item("a");
+      new fltk::Item("Menu");
+      new fltk::Item("Bar");
+      o->end();
+    }
+     {fltk::InvisibleBox* o = new fltk::InvisibleBox(95, 25, 465, 419, "\nThis program demonstrates how you set the resizable() of a window to get th\
+ings to resize the way you want.");
+      o->box(fltk::FLAT_BOX);
+      o->color((fltk::Color)19);
+      o->labelcolor((fltk::Color)7);
+      o->align(fltk::ALIGN_TOP|fltk::ALIGN_INSIDE|fltk::ALIGN_CLIP|fltk::ALIGN_WRAP);
+    }
+     {fltk::Button* o = new fltk::Button(0, 25, 95, 25, "These");
+      o->color((fltk::Color)47);
+    }
+     {fltk::Button* o = new fltk::Button(0, 50, 95, 25, "are some");
+      o->color((fltk::Color)47);
+    }
+     {fltk::Button* o = new fltk::Button(0, 75, 95, 25, "buttons");
+      o->color((fltk::Color)47);
+    }
+     {fltk::Button* o = new fltk::Button(0, 100, 95, 25, "we don't want");
+      o->color((fltk::Color)47);
+    }
+     {fltk::Button* o = new fltk::Button(0, 125, 95, 25, "to resize.");
+      o->color((fltk::Color)47);
+    }
+     {fltk::Button* o = new fltk::Button(0, 150, 95, 25, "Things that");
+      o->color((fltk::Color)0x8e6f8c00);
+    }
+     {fltk::Button* o = new fltk::Button(0, 175, 95, 25, "overlap the box");
+      o->color((fltk::Color)0x8e6f8c00);
+    }
+     {fltk::Button* o = new fltk::Button(0, 200, 95, 25, "will scale.");
+      o->color((fltk::Color)0x8e6f8c00);
+    }
+     {fltk::Group* o = new fltk::Group(0, 225, 95, 190, "A group");
+      o->box(fltk::ENGRAVED_BOX);
+      o->labeltype(fltk::ENGRAVED_LABEL);
+      o->labelcolor((fltk::Color)49);
+      o->align(fltk::ALIGN_BOTTOM|fltk::ALIGN_INSIDE);
+      o->tooltip("This group has resizable(0) (this is the default).  But you can set a group's\
+ resizable to nest different resize behavior.");
+      o->begin();
+       {fltk::Button* o = new fltk::Button(5, 5, 85, 25, "You can put");
+        o->color((fltk::Color)47);
+      }
+       {fltk::Button* o = new fltk::Button(5, 30, 85, 25, "them inside");
+        o->color((fltk::Color)47);
+      }
+       {fltk::Button* o = new fltk::Button(5, 55, 85, 25, "a group to");
+        o->color((fltk::Color)47);
+      }
+       {fltk::Button* o = new fltk::Button(5, 80, 85, 25, "stop scaling.");
+        o->color((fltk::Color)47);
+      }
+      o->end();
+    }
+     {fltk::Button* o = new fltk::Button(0, 419, 95, 25, "nonscaling");
+      o->color((fltk::Color)47);
+    }
+     {fltk::InvisibleBox* o = new fltk::InvisibleBox(0, 444, 460, 25, "This status message will resize horizontally only.");
+      o->box(fltk::BORDER_BOX);
+      o->color((fltk::Color)55);
+      o->align(fltk::ALIGN_LEFT|fltk::ALIGN_INSIDE);
+    }
+    new fltk::Button(460, 445, 25, 25, "@<<");
+    new fltk::Button(485, 445, 25, 25, "@<");
+    new fltk::Button(510, 445, 25, 25, "@>");
+    new fltk::Button(535, 445, 25, 25, "@>>");
+     {fltk::InvisibleBox* o = new fltk::InvisibleBox(95, 150, 365, 270, "This is the resizable() of the window.\nIt is normally invisible.");
+      o->box(fltk::BORDER_BOX);
+      o->color((fltk::Color)37);
+      o->labelcolor((fltk::Color)1);
+      o->align(fltk::ALIGN_CLIP|fltk::ALIGN_WRAP);
+      fltk::Group::current()->resizable(o);
+      o->tooltip("To make it invisible, use an Fl_Box with the default box(FL_NO_BOX) and no la\
+bel.\n\nFltk sets the window's minimum size such that this widget's minimum si\
+ze is 100, unless it starts out smaller than that.  You can override this defa\
+ult by calling size_range() on the window.");
+    }
+    o->end();
+  }
+  // w->size_range(w->w()-w->resizable()->w(), w->h()-w->resizable()->h());
+  w->show(argc, argv);
+  return  fltk::run();
+}

Added: branches/branch-3.0/test2/resizable.fl
===================================================================
--- branches/branch-3.0/test2/resizable.fl	                        (rev 0)
+++ branches/branch-3.0/test2/resizable.fl	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,141 @@
+# data file for the FLTK User Interface Designer (FLUID)
+version 2.0002 
+images_dir ./ 
+header_name {.h} 
+code_name {.cxx} 
+gridx 5 
+gridy 5 
+snap 3
+Function {} {open
+} {
+  {fltk::Window} {} {open
+    xywh {562 242 560 470} resizable visible
+  } {
+    {fltk::MenuBar} {} {open
+      tooltip {A right-justified help item can be made by making a second menubar and putting it to the right of the resizable().}
+      xywh {515 0 45 25}
+    } {
+      {fltk::ItemGroup} {} {
+        label Help open
+        } {
+        {fltk::Item} {} {
+          label {About...}
+          }
+        {fltk::Item} {} {
+          label {Chapter 1}
+          }
+      }
+    }
+    {fltk::MenuBar} {} {open
+      xywh {0 0 515 25}
+    } {
+      {fltk::Item} {} {
+        label This
+        }
+      {fltk::Item} {} {
+        label is
+        }
+      {fltk::Item} {} {
+        label a
+        }
+      {fltk::Item} {} {
+        label Menu
+        }
+      {fltk::Item} {} {
+        label Bar
+        }
+    }
+    {fltk::InvisibleBox} {} {
+      label {
+This program demonstrates how you set the resizable() of a window to get things to resize the way you want.}
+      xywh {95 25 465 419} align 209 box FLAT_BOX color 19 labelcolor 7
+    }
+    {fltk::Button} {} {
+      label These
+      xywh {0 25 95 25} color 47
+    }
+    {fltk::Button} {} {
+      label {are some}
+      xywh {0 50 95 25} color 47
+    }
+    {fltk::Button} {} {
+      label buttons
+      xywh {0 75 95 25} color 47
+    }
+    {fltk::Button} {} {
+      label {we don't want}
+      xywh {0 100 95 25} color 47
+    }
+    {fltk::Button} {} {
+      label {to resize.}
+      xywh {0 125 95 25} color 47
+    }
+    {fltk::Button} {} {
+      label {Things that}
+      xywh {0 150 95 25} color 0x8e6f8c00
+    }
+    {fltk::Button} {} {
+      label {overlap the box}
+      xywh {0 175 95 25} color 0x8e6f8c00
+    }
+    {fltk::Button} {} {
+      label {will scale.}
+      xywh {0 200 95 25} color 0x8e6f8c00
+    }
+    {fltk::Group} {} {
+      label {A group} open
+      tooltip {This group has resizable(0) (this is the default).  But you can set a group's resizable to nest different resize behavior.}
+      xywh {0 225 95 190} align 18 box ENGRAVED_BOX labeltype ENGRAVED_LABEL labelcolor 49
+    } {
+      {fltk::Button} {} {
+        label {You can put}
+        xywh {5 5 85 25} color 47
+      }
+      {fltk::Button} {} {
+        label {them inside}
+        xywh {5 30 85 25} color 47
+      }
+      {fltk::Button} {} {
+        label {a group to}
+        xywh {5 55 85 25} color 47
+      }
+      {fltk::Button} {} {
+        label {stop scaling.}
+        xywh {5 80 85 25} color 47
+      }
+    }
+    {fltk::Button} {} {
+      label nonscaling
+      xywh {0 419 95 25} color 47
+    }
+    {fltk::InvisibleBox} {} {
+      label {This status message will resize horizontally only.}
+      xywh {0 444 460 25} align 20 box BORDER_BOX color 55
+    }
+    {fltk::Button} {} {
+      label {@<<}
+      xywh {460 445 25 25}
+    }
+    {fltk::Button} {} {
+      label {@<}
+      xywh {485 445 25 25}
+    }
+    {fltk::Button} {} {
+      label {@>}
+      xywh {510 445 25 25}
+    }
+    {fltk::Button} {} {
+      label {@>>}
+      xywh {535 445 25 25}
+    }
+    {fltk::InvisibleBox} {} {
+      label {This is the resizable() of the window.
+It is normally invisible.} selected
+      tooltip {To make it invisible, use an Fl_Box with the default box(FL_NO_BOX) and no label.
+
+Fltk sets the window's minimum size such that this widget's minimum size is 100, unless it starts out smaller than that.  You can override this default by calling size_range() on the window.}
+      xywh {95 150 365 270} align 192 resizable box BORDER_BOX color 37 labelcolor 1
+    }
+  }
+  code {// w->size_range(w->w()-w->resizable()->w(), w->h()-w->resizable()->h());} {}
+} 

Added: branches/branch-3.0/test2/resizable.h
===================================================================
--- branches/branch-3.0/test2/resizable.h	                        (rev 0)
+++ branches/branch-3.0/test2/resizable.h	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,12 @@
+// generated by Fast Light User Interface Designer (fluid) version 2.0002
+
+#ifndef resizable_h
+#define resizable_h
+#include <fltk/Window.h>
+#include <fltk/MenuBar.h>
+#include <fltk/ItemGroup.h>
+#include <fltk/Item.h>
+#include <fltk/InvisibleBox.h>
+#include <fltk/Button.h>
+#include <fltk/Group.h>
+#endif

Added: branches/branch-3.0/test2/resize.cxx
===================================================================
--- branches/branch-3.0/test2/resize.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/resize.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,97 @@
+// generated by Fast Light User Interface Designer (fluid) version 2.1000
+
+#include "resize.h"
+#include <fltk/events.h>
+
+void warp(int dx, int dy) {
+  fltk::warp_mouse(fltk::event_x_root()+dx, fltk::event_y_root()+dy);
+}
+
+static void cb_8(fltk::Button* o, void*) {
+  fltk::Window* w = o->window();
+  w->position(w->x(),w->y()-50);
+  warp(0,-50);
+}
+
+static void cb_(fltk::Button* o, void*) {
+  fltk::Window* w = o->window();
+  w->position(w->x()-50,w->y());
+  warp(-50,0);
+}
+
+static void cb_1(fltk::Button* o, void*) {
+  fltk::Window* w = o->window();
+  w->position(w->x()+50,w->y());
+  warp(+50,0);
+}
+
+static void cb_2(fltk::Button* o, void*) {
+  fltk::Window* w = o->window();
+  w->position(w->x(),w->y()+50);
+  warp(0,+50);
+}
+
+static void cb_grow(fltk::Button* o, void*) {
+  fltk::Window* w = o->window();
+  int mx = fltk::event_x_root()-w->x();
+  int my = fltk::event_y_root()-w->y();
+  warp(mx*20/w->w(), my*20/w->h());
+  w->resize(w->w()+20, w->h()+20);
+}
+
+static void cb_shrink(fltk::Button* o, void*) {
+  fltk::Window* w = o->window();
+  int mx = fltk::event_x_root()-w->x();
+  int my = fltk::event_y_root()-w->y();
+  warp(-mx*20/w->w(), -my*20/w->h());
+  w->resize(w->w()-20, w->h()-20);
+}
+
+#include <fltk/run.h>
+
+int main (int argc, char **argv) {
+
+  fltk::Window* w;
+   {fltk::Window* o = new fltk::Window(320, 240);
+    w = o;
+    o->shortcut(0xff1b);
+    o->begin();
+     {fltk::Button* o = new fltk::Button(60, 0, 39, 40, "@8->");
+      o->set_vertical();
+      o->callback((fltk::Callback*)cb_8);
+    }
+     {fltk::InvisibleBox* o = new fltk::InvisibleBox(148, 10, 157, 218, "This is a test of program-generated resize() of a window.  The window should \
+move or resize once when each button is clicked.  The program and window manag\
+er should not go into fits echoing resizes back and forth!");
+      o->set_vertical();
+      o->box(fltk::BORDER_BOX);
+      o->align(fltk::ALIGN_LEFT|fltk::ALIGN_CENTER|fltk::ALIGN_INSIDE|fltk::ALIGN_WRAP);
+      fltk::Group::current()->resizable(o);
+    }
+     {fltk::Button* o = new fltk::Button(20, 40, 40, 40, "@<-");
+      o->set_vertical();
+      o->callback((fltk::Callback*)cb_);
+    }
+     {fltk::Button* o = new fltk::Button(99, 40, 39, 40, "@->");
+      o->set_vertical();
+      o->callback((fltk::Callback*)cb_1);
+    }
+     {fltk::Button* o = new fltk::Button(60, 80, 39, 39, "@2->");
+      o->set_vertical();
+      o->callback((fltk::Callback*)cb_2);
+    }
+     {fltk::Button* o = new fltk::Button(30, 129, 108, 40, "grow");
+      o->labelfont(fltk::HELVETICA_BOLD);
+      o->labelsize(18);
+      o->callback((fltk::Callback*)cb_grow);
+    }
+     {fltk::Button* o = new fltk::Button(30, 188, 108, 40, "shrink");
+      o->labelfont(fltk::HELVETICA_BOLD);
+      o->labelsize(18);
+      o->callback((fltk::Callback*)cb_shrink);
+    }
+    o->end();
+  }
+  w->show(argc, argv);
+  return  fltk::run();
+}

Added: branches/branch-3.0/test2/resize.fl
===================================================================
--- branches/branch-3.0/test2/resize.fl	                        (rev 0)
+++ branches/branch-3.0/test2/resize.fl	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,72 @@
+# data file for the FLTK User Interface Designer (FLUID)
+version 2.1000 
+images_dir ./ 
+header_name {.h} 
+code_name {.cxx} 
+gridx 10 
+gridy 10 
+snap 3
+decl {\#include <fltk/events.h>} {} 
+
+Function {warp(int dx, int dy)} {open return_type void
+} {
+  code {fltk::warp_mouse(fltk::event_x_root()+dx, fltk::event_y_root()+dy);} {}
+} 
+
+Function {} {open
+} {
+  {fltk::Window} {} {open
+    xywh {439 389 320 240} resizable visible
+  } {
+    {fltk::Button} {} {
+      label {@8->}
+      callback {fltk::Window* w = o->window();
+w->position(w->x(),w->y()-50);
+warp(0,-50);}
+      xywh {60 0 39 40}
+    }
+    {fltk::InvisibleBox} {} {
+      label {This is a test of program-generated resize() of a window.  The window should move or resize once when each button is clicked.  The program and window manager should not go into fits echoing resizes back and forth!}
+      xywh {148 10 157 218} align 180 resizable box BORDER_BOX
+    }
+    {fltk::Button} {} {
+      label {@<-}
+      callback {fltk::Window* w = o->window();
+w->position(w->x()-50,w->y());
+warp(-50,0);}
+      xywh {20 40 40 40} vertical
+    }
+    {fltk::Button} {} {
+      label {@->}
+      callback {fltk::Window* w = o->window();
+w->position(w->x()+50,w->y());
+warp(+50,0);}
+      xywh {99 40 39 40}
+    }
+    {fltk::Button} {} {
+      label {@2->}
+      callback {fltk::Window* w = o->window();
+w->position(w->x(),w->y()+50);
+warp(0,+50);}
+      xywh {60 80 39 39} vertical
+    }
+    {fltk::Button} {} {
+      label grow
+      callback {fltk::Window* w = o->window();
+int mx = fltk::event_x_root()-w->x();
+int my = fltk::event_y_root()-w->y();
+warp(mx*20/w->w(), my*20/w->h());
+w->resize(w->w()+20, w->h()+20);}
+      xywh {30 129 108 40} labelfont 1 labelsize 18
+    }
+    {fltk::Button} {} {
+      label shrink
+      callback {fltk::Window* w = o->window();
+int mx = fltk::event_x_root()-w->x();
+int my = fltk::event_y_root()-w->y();
+warp(-mx*20/w->w(), -my*20/w->h());
+w->resize(w->w()-20, w->h()-20);} selected
+      xywh {30 188 108 40} labelfont 1 labelsize 18
+    }
+  }
+} 

Added: branches/branch-3.0/test2/resize.h
===================================================================
--- branches/branch-3.0/test2/resize.h	                        (rev 0)
+++ branches/branch-3.0/test2/resize.h	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,9 @@
+// generated by Fast Light User Interface Designer (fluid) version 2.1000
+
+#ifndef resize_h
+#define resize_h
+void warp(int dx, int dy);
+#include <fltk/Window.h>
+#include <fltk/Button.h>
+#include <fltk/InvisibleBox.h>
+#endif

Added: branches/branch-3.0/test2/resizealign.cxx
===================================================================
--- branches/branch-3.0/test2/resizealign.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/resizealign.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,97 @@
+//
+// "$Id: resizealign.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $"
+//
+// Copyright 1998-2006 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+//    http://www.fltk.org/str.php
+//
+
+#define W1 40
+#define B 0
+#define W3 (5*W1+6*B)
+
+#include <fltk/run.h>
+#include <fltk/Window.h>
+#include <fltk/ToggleButton.h>
+
+using namespace fltk;
+
+Window *window;
+int flags = 0;
+
+void b_cb(Widget *b,long w) {
+  if (((Button*)b)->value()) flags |= int(w);
+  else flags &= ~int(w);
+  window->resize_align(flags);
+  window->relayout();
+  window->redraw();
+}
+
+int main(int argc, char **argv) {
+  window = new Window(W3,W3);
+  window->box(NO_BOX);
+  window->begin();
+  Widget *n;
+  for (int x = 0; x<4; x++) for (int y = 0; y<4; y++) {
+    if ((x==1 || x==2) && (y==1 || y==2)) continue;
+    n = new Widget(x*(B+W1)+B,y*(B+W1)+B,W1,W1,0);
+    n->box(ENGRAVED_BOX);
+    n->color(x+y+8);
+  }
+  n = new Widget(B,4*W1+5*B,4*W1+3*B,W1,0);
+  n->box(ENGRAVED_BOX);
+  n->color(12);
+  n = new Widget(4*W1+5*B,B,W1,5*W1+4*B,0);
+  n->box(ENGRAVED_BOX);
+  n->color(13);
+
+  n = new Widget(W1+B+B,W1+B+B,2*W1+B,2*W1+B,0);
+  n->box(ENGRAVED_BOX);
+  n->color(8);
+  window->resizable(n);
+  n->align(ALIGN_INSIDE|ALIGN_BOTTOM|ALIGN_WRAP);
+  n->label("This gray area is the window->resizable().\n"
+	   "The arrow buttons change the "
+	   "window->resizealign() value.");
+  n->labelcolor(GRAY75);
+
+  Button *b;
+  b = new ToggleButton(W1+B+50,W1+B+30,20,20,"@6>");
+  b->callback(b_cb,8);
+  b = new ToggleButton(W1+B+30,W1+B+10,20,20,"@8>");
+  b->callback(b_cb,1);
+  b = new ToggleButton(W1+B+10,W1+B+30,20,20,"@4>");
+  b->callback(b_cb,4);
+  b = new ToggleButton(W1+B+30,W1+B+50,20,20,"@2>");
+  b->callback(b_cb,2);
+  window->resize_align(0);
+
+  window->end();
+
+  window->size_range(W3,W3);
+  window->layout();
+  window->resize(W3*2,W3*2);
+  window->show(argc,argv);
+  return run();
+}
+
+//
+// End of "$Id: resizealign.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $".
+//

Added: branches/branch-3.0/test2/scroll.cxx
===================================================================
--- branches/branch-3.0/test2/scroll.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/scroll.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,157 @@
+//
+// "$Id: scroll.cxx 8636 2011-05-06 08:01:12Z bgbnbigben $"
+//
+// ScrollGroup test program for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2006 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+//    http://www.fltk.org/str.php
+//
+
+#include <fltk/run.h>
+#include <fltk/Window.h>
+#include <fltk/ScrollGroup.h>
+#include <fltk/LightButton.h>
+#include <fltk/Choice.h>
+#include <fltk/Box.h>
+#include <stdio.h>
+#include <fltk/draw.h>
+#include <fltk/math.h>
+#include <fltk/InvisibleBox.h>
+#include <fltk/MenuBuild.h>
+
+using namespace fltk;
+
+class Drawing : public Widget {
+  void draw();
+public:
+  Drawing(int X,int Y,int W,int H,const char* L) : Widget(X,Y,W,H,L) {
+    align(fltk::ALIGN_TOP);
+    box(fltk::FLAT_BOX);
+    color(fltk::WHITE);
+  }
+};
+
+void Drawing::draw() {
+  draw_box();
+  fltk::push_matrix();
+  // Change from fltk1 to 2: removed translation by x(),y():
+  fltk::translate(w()/2, h()/2);
+  fltk::scale(w()/2, h()/2);
+  fltk::color(fltk::BLACK);
+  for (int i = 0; i < 20; i++) {
+    for (int j = i+1; j < 20; j++) {
+      // Change from fltk1 to 2: added 'f' to make arguments float:
+      fltk::newpath();
+      fltk::addvertex(cosf(M_PI*i/10+.1), sinf(M_PI*i/10+.1));
+      fltk::addvertex(cosf(M_PI*j/10+.1), sinf(M_PI*j/10+.1));
+//      fltk::closepath(); //bug
+      fltk::strokepath();
+      // you must reset the line type when done:
+      line_style(SOLID);
+    }
+  }
+  fltk::pop_matrix();
+}
+
+ScrollGroup* thescroll;
+
+void box_cb(Widget* o, void*) {
+  thescroll->box(((Button*)o)->value() ? fltk::DOWN_BOX : fltk::NO_BOX);
+  thescroll->relayout(); // added for fltk2
+  thescroll->redraw();
+}
+
+void type_cb(Widget*, void* v) {
+  thescroll->type(int((long)v));
+  thescroll->relayout(); // changed from fltk1 setting of redraw()
+}
+
+void load_menu_choice (Choice* c)  {
+ c->begin();
+  new Item("None", 0, type_cb, (void*)ScrollGroup::NONE);
+  new Item("HORIZONTAL", 0, type_cb, (void*)ScrollGroup::HORIZONTAL);
+  new Item("VERTICAL", 0, type_cb, (void*)ScrollGroup::VERTICAL);
+  new Item("BOTH", 0, type_cb, (void*)ScrollGroup::BOTH);
+  new Item("HORIZONTAL_ALWAYS", 0, type_cb, (void*)ScrollGroup::HORIZONTAL_ALWAYS);
+  new Item("VERTICAL_ALWAYS", 0, type_cb, (void*)ScrollGroup::VERTICAL_ALWAYS);
+  new Item("BOTH_ALWAYS", 0, type_cb, (void*)ScrollGroup::BOTH_ALWAYS);
+ c->end();
+}
+
+void align_cb(Widget*, void* v) {
+  thescroll->scrollbar_align(int((long)v));
+  //thescroll->scrollbar.align(int((long)v)); // fltk1 version
+  thescroll->relayout(); // changed from fltk1 setting of redraw()
+}
+
+void load_menu_achoice (Choice* c)  {
+ c->begin();
+  new Item("left+top", 0, align_cb, (void*)(fltk::ALIGN_LEFT+fltk::ALIGN_TOP));
+  new Item("left+bottom", 0, align_cb, (void*)(fltk::ALIGN_LEFT+fltk::ALIGN_BOTTOM));
+  new Item("right+top", 0, align_cb, (void*)(fltk::ALIGN_RIGHT+fltk::ALIGN_TOP));
+  new Item("right+bottom", 0, align_cb, (void*)(fltk::ALIGN_RIGHT+fltk::ALIGN_BOTTOM));
+ c->end();
+}
+
+int main(int argc, char** argv) {
+  Window window(5*75,400);
+  //window.clear_double_buffer(); // use this to test scroll_area()
+  //window.box(fltk::NO_BOX); //remove trash
+  window.begin();
+  ScrollGroup scroll(0,0,5*75,300);
+  scroll.begin();
+
+  int n = 0;
+  for (int y=0; y<16; y++) for (int x=0; x<5; x++) {
+    char buf[20]; sprintf(buf,"%d",n++);
+    Button* b = new Button(x*75,y*25+(y>=8?5*75:0),75,25);
+    b->copy_label(buf);
+    b->color(n);
+//    b->labelcolor(fltk::WHITE);
+  }
+  Drawing drawing(0,8*25,5*75,5*75,0);
+  scroll.end();
+  scroll.type(scroll.VERTICAL);
+  window.resizable(scroll);
+
+  LightButton but1(150, 310, 200, 25, "box");
+  but1.callback(box_cb);
+
+  Choice choice(150, 335, 200, 25, "type():");
+  load_menu_choice(&choice);
+  choice.value(2);
+
+  Choice achoice(150, 360, 200, 25, "scrollbar_align():");
+  load_menu_achoice(&achoice);
+  achoice.value(3);
+
+  thescroll = &scroll;
+
+  scroll.box(fltk::DOWN_BOX);
+  scroll.type(ScrollGroup::VERTICAL);
+  window.end();
+  window.show(argc,argv);
+  return fltk::run();
+}
+
+//
+// End of "$Id: scroll.cxx 8636 2011-05-06 08:01:12Z bgbnbigben $".
+//

Added: branches/branch-3.0/test2/shape.cxx
===================================================================
--- branches/branch-3.0/test2/shape.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/shape.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,119 @@
+//
+// "$Id: shape.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $"
+//
+// Tiny OpenGL demo program for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2006 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+//    http://www.fltk.org/str.php
+//
+
+#include <config.h>
+#include <fltk/run.h>
+#include <fltk/Window.h>
+#include <fltk/Slider.h>
+#include <fltk/math.h>
+
+#if HAVE_GL
+
+#include <fltk/gl.h>
+#include <fltk/GlWindow.h>
+
+class shape_window : public fltk::GlWindow {
+  void draw();
+public:
+  int sides;
+  shape_window(int x,int y,int w,int h,const char *l=0);
+};
+
+shape_window::shape_window(int x,int y,int w,int h,const char *l) :
+  fltk::GlWindow(x,y,w,h,l)
+{
+  sides = 3;
+}
+
+void shape_window::draw() {
+// the valid() property may be used to avoid reinitializing your
+// GL transformation for each redraw:
+  if (!valid()) {
+    valid(1);
+    glLoadIdentity();
+    glViewport(0,0,w(),h());
+  }
+// draw an amazing graphic:
+  glClear(GL_COLOR_BUFFER_BIT);
+  glColor3f(.5,.6,.7);
+  glBegin(GL_POLYGON);
+  for (int i=0; i<sides; i++) {
+    double ang = i*2*M_PI/sides;
+    glVertex3f(cos(ang),sin(ang),0);
+  }
+  glEnd();
+}
+
+#else
+
+class shape_window : public fltk::Widget {
+public:	
+  int sides;
+  shape_window(int x,int y,int w,int h,const char *l=0)
+    : Widget(x,y,w,h,l){
+      label("This demo does\nnot work without GL");
+  }
+};
+
+#endif
+
+// when you change the data, as in this callback, you must call redraw():
+void sides_cb(fltk::Widget *o, void *p) {
+  shape_window *sw = (shape_window *)p;
+  sw->sides = int(((fltk::Slider *)o)->value());
+  sw->redraw();
+}
+
+int main(int argc, char **argv) {
+
+  fltk::Window window(300, 330);
+  window.begin();
+
+// the shape window could be it's own window, but here we make it
+// a child window:
+  shape_window sw(10, 10, 280, 280);
+// make it resize:
+  window.resizable(&sw);
+  //  window.size_range(300,330,0,0,1,1,1);
+// add a knob to control it:
+  fltk::Slider slider(50, 295, window.w()-60, 30, "Sides:");
+  slider.clear_flag(fltk::ALIGN_MASK);
+  slider.set_flag(fltk::ALIGN_LEFT);
+  slider.callback(sides_cb,&sw);
+  slider.value(sw.sides);
+  slider.step(1);
+  slider.range(3,40);
+
+  window.end();
+  window.show(argc,argv);
+    
+  return fltk::run();
+}
+
+//
+// End of "$Id: shape.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $".
+//

Added: branches/branch-3.0/test2/shiny.cxx
===================================================================
--- branches/branch-3.0/test2/shiny.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/shiny.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,320 @@
+//
+// "$Id: shiny.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $"
+//
+// OpenGL "shiny buttons" test program for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-1999 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems to "fltk-bugs@easysw.com".
+//
+
+#include <config.h>
+#include "shiny_panel.cxx"
+#include <FL/fl_message.H>
+#include <stdio.h>
+
+static uchar color[8][3] = {
+  {128,136,149},
+  {63,54,21},
+  {128,136,146},
+  {223,223,223},
+  {121,128,128},
+  {192,206,220},
+  {137,143,145},
+  {99,81,64}
+};
+static int thickness = 3;
+
+int which = 0;
+
+static Fl_Color pcolor;
+
+Fl_Window *window;
+
+void color_slider_cb(Fl_Value_Slider *o, long i) {
+  int v = int(o->value());
+  if (!i) {
+    color[which][0] = color[which][1] = color[which][2] = v;
+    color_slider[1]->value(v);
+    color_slider[2]->value(v);
+    color_slider[3]->value(v);
+  } else {
+    color[which][i-1] = v;
+  }
+  for (int n=0; n<window->children(); n++) window->child(n)->redraw();
+  pcolor = FL_BLACK; // make it recalculate actual colors
+//   test_box[0]->redraw();
+//   test_box[1]->redraw();
+//   test_box[2]->redraw();
+}
+
+void set_sliders() {
+  color_slider[0]->value(color[which][0]);
+  color_slider[1]->value(color[which][0]);
+  color_slider[2]->value(color[which][1]);
+  color_slider[3]->value(color[which][2]);
+}
+
+void thickness_cb(Fl_Slider* s,void*) {
+  thickness = int(s->value());
+  for (int n=0; n<window->children(); n++) window->child(n)->redraw();
+}
+
+void which_cb(Fl_Button *, long i) {
+  which = which&(~3) | i;
+  set_sliders();
+}
+
+void inside_cb(Fl_Button *b, void*) {
+  if (b->value()) which = which | 4;
+  else which = which & (3|8);
+  set_sliders();
+}
+
+void dump_cb(Fl_Button *, void*) {
+  printf("static uchar color[8][3] = {\n");
+  for (int i=0; i<8; i++) {
+    printf("  {%d,%d,%d}",color[i][0],color[i][1],color[i][2]);
+    if (i<7) printf(",\n");
+  }
+  printf("\n};\nstatic int thickness = %d;\n",thickness);
+}
+
+#include <FL/fl_draw.H>
+
+#if HAVE_GL
+#include <FL/gl.h>
+
+static uchar C[8][3]; // actual colors for current button
+
+static void calc_color(Fl_Color c) {
+  uchar r[3];
+  pcolor = c;
+  Fl::get_color(c,r[0],r[1],r[2]);
+  for (int x = 0; x<8; x++) for (int y=0; y<3; y++) {
+    int i = r[y]-166+color[x][y];
+    if (i<0) i = 0; else if (i>255) i = 255;
+    C[x][y] = i;
+  }
+}
+
+void shiny_down_draw(Fl_Boxtype, int x1, int y1, int w1, int h1, Fl_Color c, Fl_Flags);
+
+void shiny_up_draw(Fl_Boxtype, int x1, int y1, int w1, int h1, Fl_Color c, Fl_Flags f) {
+  if (f & FL_VALUE) {
+    shiny_down_draw(0, x1, y1, w1, h1, c, f);
+    return;
+  }
+  if (c != pcolor) calc_color(c);
+  int x = x1+1;
+  int y = Fl_Window::current()->h()-(y1+h1-1);
+  int w = w1-2;
+  int h = h1-2;
+  gl_start();
+
+  // left edge:
+  glBegin(GL_POLYGON);
+  glColor3ub(C[0][0],C[0][1],C[0][2]);
+  glVertex2i(x,y);
+  glVertex2i(x+thickness,y+thickness);
+  glColor3ub(C[3][0],C[3][1],C[3][2]);
+  glVertex2i(x+thickness,y+h-thickness);
+  glVertex2i(x,y+h);
+  glEnd();
+
+  // top edge:
+  glBegin(GL_POLYGON);
+  glVertex2i(x,y+h);
+  glVertex2i(x+thickness,y+h-thickness);
+  glColor3ub(C[2][0],C[2][1],C[2][2]);
+  glVertex2i(x+w-thickness,y+h-thickness);
+  glVertex2i(x+w,y+h);
+  glEnd();
+
+  // right edge:
+  glColor3ub(C[1][0],C[1][1],C[1][2]);
+  glBegin(GL_POLYGON);
+  glVertex2i(x+w-thickness,y+thickness);
+  glVertex2i(x+w,y+thickness);
+  glVertex2i(x+w,y+h);
+  glVertex2i(x+w-thickness,y+h-thickness);
+  glEnd();
+
+  // bottom edge:
+  glBegin(GL_POLYGON);
+  glVertex2i(x,y);
+  glVertex2i(x+w,y);
+  glVertex2i(x+w,y+thickness);
+  glVertex2i(x+thickness,y+thickness);
+  glEnd();
+
+  glBegin(GL_POLYGON);
+  glColor3ub(C[4][0],C[4][1],C[4][2]);
+  glVertex2i(x+thickness,y+thickness);
+  glColor3ub(C[5][0],C[5][1],C[5][2]);
+  glVertex2i(x+w-thickness,y+thickness);
+  glColor3ub(C[6][0],C[6][1],C[6][2]);
+  glVertex2i(x+w-thickness,y+h-thickness);
+  glColor3ub(C[7][0],C[7][1],C[7][2]);
+  glVertex2i(x+thickness,y+h-thickness);
+  glEnd();
+
+  gl_finish();
+  fl_color(FL_BLACK);
+  fl_rect(x1,y1,w1,h1);
+}
+
+void shiny_down_draw(Fl_Boxtype, int x1, int y1, int w1, int h1, Fl_Color c, Fl_Flags) {
+  if (c != pcolor) calc_color(c);
+  int x = x1+1;
+  int y = Fl_Window::current()->h()-(y1+h1-1);
+  int w = w1-2;
+  int h = h1-2;
+  gl_start();
+
+  // left edge:
+  glColor3ub(C[1][0],C[1][1],C[1][2]);
+  glBegin(GL_POLYGON);
+  glVertex2i(x,y);
+  glVertex2i(x+thickness,y+thickness);
+  glVertex2i(x+thickness,y+h-thickness);
+  glVertex2i(x,y+h);
+  glEnd();
+
+  // top edge:
+  glBegin(GL_POLYGON);
+  glVertex2i(x,y+h);
+  glVertex2i(x+thickness,y+h-thickness);
+  glVertex2i(x+w-thickness,y+h-thickness);
+  glVertex2i(x+w,y+h);
+  glEnd();
+
+  // bottom edge:
+  glBegin(GL_POLYGON);
+  glColor3ub(C[0][0],C[0][1],C[0][2]);
+  glVertex2i(x+thickness,y+thickness);
+  glVertex2i(x,y);
+  glColor3ub(C[1][0],C[1][1],C[1][2]);
+  glVertex2i(x+w,y);
+  glVertex2i(x+w-thickness,y+thickness);
+  glEnd();
+
+  // right edge:
+  glBegin(GL_POLYGON);
+  glVertex2i(x+w-thickness,y+thickness);
+  glVertex2i(x+w,y);
+  glColor3ub(C[2][0],C[2][1],C[2][2]);
+  glVertex2i(x+w,y+h);
+  glVertex2i(x+w-thickness,y+h-thickness);
+  glEnd();
+
+  // inside:
+  glBegin(GL_POLYGON);
+  glColor3ub(C[4][0],C[4][1],C[4][2]);
+  glVertex2i(x+thickness,y+thickness);
+  glColor3ub(C[5][0],C[5][1],C[5][2]);
+  glVertex2i(x+w-thickness,y+thickness);
+  glColor3ub(C[6][0],C[6][1],C[6][2]);
+  glVertex2i(x+w-thickness,y+h-thickness);
+  glColor3ub(C[7][0],C[7][1],C[7][2]);
+  glVertex2i(x+thickness,y+h-thickness);
+  glEnd();
+
+  gl_finish();
+  fl_color(FL_BLACK);
+  fl_rect(x1,y1,w1,h1);
+}
+
+const Fl_Boxtype_ shiny_down_box = {
+  shiny_down_draw, 0, &shiny_down_box, 3,3,6,6, true
+};
+const Fl_Boxtype_ shiny_up_box = {
+  shiny_up_draw, 0, &shiny_down_box, 3,3,6,6, true
+};
+
+// It looks interesting if you use this for the window's boxtype,
+// but it is way too slow under MESA:
+void shiny_flat_draw(Fl_Boxtype, int x, int y1, int w, int h, Fl_Color c, Fl_Flags) {
+  if (c != pcolor) calc_color(c);
+  int y = Fl_Window::current()->h()-(y1+h);
+  gl_start();
+  glBegin(GL_POLYGON);
+  glColor3ub(C[4][0],C[4][1],C[4][2]);
+  glVertex2i(x,y);
+  glColor3ub(C[5][0],C[5][1],C[5][2]);
+  glVertex2i(x+w,y);
+  glColor3ub(C[6][0],C[6][1],C[6][2]);
+  glVertex2i(x+w,y+h);
+  glColor3ub(C[7][0],C[7][1],C[7][2]);
+  glVertex2i(x,y+h);
+  glEnd();
+  gl_finish();
+}
+
+const Fl_Boxtype_ shiny_flat_box = {
+  shiny_flat_draw, 0, &shiny_flat_box, 0,0,0,0
+};
+
+#endif
+
+// If you use a shiny box as a background, things like the sliders that
+// expect to erase a flat area will not work, as you will see the edges
+// of the area.  This "box type" clips to the area and then draws the
+// parent's box.  Perhaps sliders should be fixed to do this automatically?
+void invisible_draw(Fl_Boxtype, int x, int y, int w, int h, Fl_Color c, Fl_Flags) {
+  fl_clip(x,y,w,h);
+  Fl_Window *W = Fl_Window::current();
+  shiny_flat_box.draw(0,0,W->w(),W->h(),c);
+  fl_pop_clip();
+}
+const Fl_Boxtype_ invisible_box = {
+  invisible_draw, 0, &invisible_box, 0,0,0,0
+};
+
+int main(int argc, char **argv) {
+  window = make_panels();
+#if HAVE_GL
+  // This will cause all buttons to be shiny:
+  fl_normal_box.draw_ = shiny_up_draw;
+  Fl_Window::default_style.set_box(&shiny_flat_box);
+#endif
+  set_sliders();
+//color_slider[0]->box(INVISIBLE_BOX);
+//color_slider[1]->box(INVISIBLE_BOX);
+//color_slider[2]->box(INVISIBLE_BOX);
+//color_slider[3]->box(INVISIBLE_BOX);
+  thickness_slider->value(thickness);
+  thickness_slider->box(&invisible_box);
+  thickness_slider->slider(FL_UP_BOX);
+  // we must eat the switches first so -display is done before trying
+  // to set the visual:
+  int i = 0;
+  if (Fl::args(argc,argv,i) < argc) Fl::fatal(Fl::help);
+#if HAVE_GL
+  if (!Fl::gl_visual(FL_RGB|FL_DEPTH)) Fl::fatal("Display does not do OpenGL");
+  glEnable(GL_DEPTH_TEST);
+#else
+  fl_message("This demo does not work without OpenGL");
+#endif
+  window->show(argc,argv);
+  return Fl::run();
+}
+
+//
+// End of "$Id: shiny.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $".
+//

Added: branches/branch-3.0/test2/size_range.cxx
===================================================================
--- branches/branch-3.0/test2/size_range.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/size_range.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,50 @@
+//
+// "$Id$"
+//
+// size_range demo : constraining the window dimensions
+//
+// Copyright 1998-2006 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+//    http://www.fltk.org/str.php
+//
+
+#include "size_range.h"
+// Code for //\n// "$Id"\n//\n// HelpDialog dialog for the Fa...
+#include <fltk/run.h>
+
+UI::UI() {
+  fltk::DoubleBufferWindow* w;
+   {fltk::DoubleBufferWindow* o = window = new fltk::DoubleBufferWindow(195, 176);
+    w = o;
+    o->type(241);
+    o->user_data((void*)(this));
+    o->begin();
+    fltk::Button *b = new fltk::LightButton(25, 25, 68, 20, "button");
+    o->end();
+    o->size_range(0,0,195,0);
+  }
+}
+
+int main() {
+  UI ui;
+  ui.window->show();
+  return fltk::run();
+}
+// End of "$Id$"

Added: branches/branch-3.0/test2/size_range.h
===================================================================
--- branches/branch-3.0/test2/size_range.h	                        (rev 0)
+++ branches/branch-3.0/test2/size_range.h	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,42 @@
+//
+// "$Id$"
+//
+// size_range demo : constraining the window dimensions
+//
+// Copyright 1998-2006 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+//    http://www.fltk.org/str.php
+//
+
+#ifndef size_range_h
+#define size_range_h
+// Header for //\n// "$Id"\n//\n// HelpDialog dialog for the Fa...
+#include <fltk/DoubleBufferWindow.h>
+#include <fltk/LightButton.h>
+
+class UI  {
+public:
+  UI();
+  fltk::DoubleBufferWindow *window;
+};
+int main();
+#endif
+
+// End of "$Id"

Added: branches/branch-3.0/test2/sizes.cxx
===================================================================
--- branches/branch-3.0/test2/sizes.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/sizes.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,66 @@
+#include <fltk/Widget.h>
+#include <fltk/Browser.h>
+#include <fltk/Button.h>
+#include <fltk/CheckButton.h>
+#include <fltk/LightButton.h>
+#include <fltk/ReturnButton.h>
+#include <fltk/Menu.h>
+#include <fltk/MenuBar.h>
+#include <fltk/PopupMenu.h>
+#include <fltk/Choice.h>
+#include <fltk/Adjuster.h>
+#include <fltk/Clock.h>
+#include <fltk/Group.h>
+#include <fltk/ColorChooser.h>
+#include <fltk/Dial.h>
+#include <fltk/Valuator.h>
+#include <fltk/ValueInput.h>
+#include <fltk/Window.h>
+#include <fltk/Input.h>
+#include <fltk/Output.h>
+#include <fltk/ThumbWheel.h>
+#include <fltk/ScrollGroup.h>
+#include <fltk/Slider.h>
+#include <fltk/Scrollbar.h>
+#include <fltk/TabGroup.h>
+#include <fltk/Style.h>
+#include <fltk/TextBuffer.h>
+#include <fltk/TextDisplay.h>
+#include <fltk/TextEditor.h>
+#include <fltk/Box.h>
+
+#include <stdio.h>
+
+int main() {
+  printf("sizeof(fltk::Style) = %lu\n", (unsigned long)sizeof(struct fltk::Style));
+  //printf("  sizeof(fltk::Box) = %lu\n", (unsigned long)sizeof(class fltk::Box));
+  printf("sizeof(fltk::Widget) = %lu\n", (unsigned long)sizeof(class fltk::Widget));
+  printf("  sizeof(fltk::Button) = %lu\n", (unsigned long)sizeof(class fltk::Button));
+  printf("    sizeof(fltk::LightButton) = %lu\n", (unsigned long)sizeof(class fltk::LightButton));
+  printf("      sizeof(fltk::CheckButton) = %lu\n", (unsigned long)sizeof(class fltk::CheckButton));
+  printf("    sizeof(fltk::ReturnButton) = %lu\n", (unsigned long)sizeof(class fltk::ReturnButton));
+  printf("  sizeof(fltk::Clock) = %lu\n", (unsigned long)sizeof(class fltk::Clock));
+  printf("  sizeof(fltk::Group) = %lu\n", (unsigned long)sizeof(class fltk::Group));
+  printf("    sizeof(fltk::Browser) = %lu\n", (unsigned long)sizeof(class fltk::Browser));
+  printf("    sizeof(fltk::ColorChooser) = %lu\n", (unsigned long)sizeof(class fltk::ColorChooser));
+  printf("    sizeof(fltk::ScrollGroup) = %lu\n", (unsigned long)sizeof(class fltk::ScrollGroup));
+  printf("    sizeof(fltk::TabGroup) = %lu\n", (unsigned long)sizeof(class fltk::TabGroup));
+  printf("    sizeof(fltk::TextDisplay) = %lu\n", (unsigned long)sizeof(class fltk::TextDisplay));
+  printf("      sizeof(fltk::TextEditor) = %lu\n", (unsigned long)sizeof(class fltk::TextEditor));
+  printf("    sizeof(fltk::Window) = %lu\n", (unsigned long)sizeof(class fltk::Window));
+  printf("  sizeof(fltk::Input) = %lu\n", (unsigned long)sizeof(class fltk::Input));
+  printf("  sizeof(fltk::Output) = %lu\n", (unsigned long)sizeof(class fltk::Output));
+  printf("  sizeof(fltk::Menu) = %lu\n", (unsigned long)sizeof(class fltk::Menu));
+  printf("    sizeof(fltk::Choice) = %lu\n", (unsigned long)sizeof(class fltk::Choice));
+  printf("    sizeof(fltk::MenuBar) = %lu\n", (unsigned long)sizeof(class fltk::MenuBar));
+  printf("    sizeof(fltk::PopupMenu) = %lu\n", (unsigned long)sizeof(class fltk::PopupMenu));
+  printf("  sizeof(fltk::ThumbWheel) = %lu\n", (unsigned long)sizeof(class fltk::ThumbWheel));
+  printf("  sizeof(fltk::TextBuffer) = %lu\n", (unsigned long)sizeof(class fltk::TextBuffer));
+  printf("  sizeof(fltk::Valuator) = %lu\n", (unsigned long)sizeof(class fltk::Valuator));
+  printf("    sizeof(fltk::Adjuster) = %lu\n", (unsigned long)sizeof(class fltk::Adjuster));
+  printf("    sizeof(fltk::Dial) = %lu\n", (unsigned long)sizeof(class fltk::Dial));
+  printf("    sizeof(fltk::Slider) = %lu\n", (unsigned long)sizeof(class fltk::Slider));
+  printf("      sizeof(fltk::Scrollbar) = %lu\n", (unsigned long)sizeof(class fltk::Scrollbar));
+  printf("    sizeof(fltk::ValueInput) = %lu\n", (unsigned long)sizeof(class fltk::ValueInput));
+  return 0;
+}

Added: branches/branch-3.0/test2/sorceress.xbm
===================================================================
--- branches/branch-3.0/test2/sorceress.xbm	                        (rev 0)
+++ branches/branch-3.0/test2/sorceress.xbm	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,67 @@
+#define sorceress_width 75
+#define sorceress_height 75
+static unsigned char sorceress_bits[] =
+{
+  0xfc, 0x7e, 0x40, 0x20, 0x90, 0x00, 0x07, 0x80, 0x23, 0x00, 0x00, 0xc6,
+  0xc1, 0x41, 0x98, 0xb8, 0x01, 0x07, 0x66, 0x00, 0x15, 0x9f, 0x03, 0x47,
+  0x8c, 0xc6, 0xdc, 0x7b, 0xcc, 0x00, 0xb0, 0x71, 0x0e, 0x4d, 0x06, 0x66,
+  0x73, 0x8e, 0x8f, 0x01, 0x18, 0xc4, 0x39, 0x4b, 0x02, 0x23, 0x0c, 0x04,
+  0x1e, 0x03, 0x0c, 0x08, 0xc7, 0xef, 0x08, 0x30, 0x06, 0x07, 0x1c, 0x02,
+  0x06, 0x30, 0x18, 0xae, 0xc8, 0x98, 0x3f, 0x78, 0x20, 0x06, 0x02, 0x20,
+  0x60, 0xa0, 0xc4, 0x1d, 0xc0, 0xff, 0x41, 0x04, 0xfa, 0x63, 0x80, 0xa1,
+  0xa4, 0x3d, 0x00, 0x84, 0xbf, 0x04, 0x0f, 0x06, 0xfc, 0xa1, 0x34, 0x6b,
+  0x01, 0x1c, 0xc9, 0x05, 0x06, 0xc7, 0x06, 0xbe, 0x11, 0x1e, 0x43, 0x30,
+  0x91, 0x05, 0xc3, 0x61, 0x02, 0x30, 0x1b, 0x30, 0xcc, 0x20, 0x11, 0x00,
+  0xc1, 0x3c, 0x03, 0x20, 0x0a, 0x00, 0xe8, 0x60, 0x21, 0x00, 0x61, 0x1b,
+  0xc1, 0x63, 0x08, 0xf0, 0xc6, 0xc7, 0x21, 0x03, 0xf8, 0x08, 0xe1, 0xcf,
+  0x0a, 0xfc, 0x4d, 0x99, 0x43, 0x07, 0x3c, 0x0c, 0xf1, 0x9f, 0x0b, 0xfc,
+  0x5b, 0x81, 0x47, 0x02, 0x16, 0x04, 0x31, 0x1c, 0x0b, 0x1f, 0x17, 0x89,
+  0x4d, 0x06, 0x1a, 0x04, 0x31, 0x38, 0x02, 0x07, 0x56, 0x89, 0x49, 0x04,
+  0x0b, 0x04, 0xb1, 0x72, 0x82, 0xa1, 0x54, 0x9a, 0x49, 0x04, 0x1d, 0x66,
+  0x50, 0xe7, 0xc2, 0xf0, 0x54, 0x9a, 0x58, 0x04, 0x0d, 0x62, 0xc1, 0x1f,
+  0x44, 0xfc, 0x51, 0x90, 0x90, 0x04, 0x86, 0x63, 0xe0, 0x74, 0x04, 0xef,
+  0x31, 0x1a, 0x91, 0x00, 0x02, 0xe2, 0xc1, 0xfd, 0x84, 0xf9, 0x30, 0x0a,
+  0x91, 0x00, 0x82, 0xa9, 0xc0, 0xb9, 0x84, 0xf9, 0x31, 0x16, 0x81, 0x00,
+  0x42, 0xa9, 0xdb, 0x7f, 0x0c, 0xff, 0x1c, 0x16, 0x11, 0x00, 0x02, 0x28,
+  0x0b, 0x07, 0x08, 0x60, 0x1c, 0x02, 0x91, 0x00, 0x46, 0x29, 0x0e, 0x00,
+  0x00, 0x00, 0x10, 0x16, 0x11, 0x02, 0x06, 0x29, 0x04, 0x00, 0x00, 0x00,
+  0x10, 0x16, 0x91, 0x06, 0xa6, 0x2a, 0x04, 0x00, 0x00, 0x00, 0x18, 0x24,
+  0x91, 0x04, 0x86, 0x2a, 0x04, 0x00, 0x00, 0x00, 0x18, 0x27, 0x93, 0x04,
+  0x96, 0x4a, 0x04, 0x00, 0x00, 0x00, 0x04, 0x02, 0x91, 0x04, 0x86, 0x4a,
+  0x0c, 0x00, 0x00, 0x00, 0x1e, 0x23, 0x93, 0x04, 0x56, 0x88, 0x08, 0x00,
+  0x00, 0x00, 0x90, 0x21, 0x93, 0x04, 0x52, 0x0a, 0x09, 0x80, 0x01, 0x00,
+  0xd0, 0x21, 0x95, 0x04, 0x57, 0x0a, 0x0f, 0x80, 0x27, 0x00, 0xd8, 0x20,
+  0x9d, 0x04, 0x5d, 0x08, 0x1c, 0x80, 0x67, 0x00, 0xe4, 0x01, 0x85, 0x04,
+  0x79, 0x8a, 0x3f, 0x00, 0x00, 0x00, 0xf4, 0x11, 0x85, 0x06, 0x39, 0x08,
+  0x7d, 0x00, 0x00, 0x18, 0xb7, 0x10, 0x81, 0x03, 0x29, 0x12, 0xcb, 0x00,
+  0x7e, 0x30, 0x28, 0x00, 0x85, 0x03, 0x29, 0x10, 0xbe, 0x81, 0xff, 0x27,
+  0x0c, 0x10, 0x85, 0x03, 0x29, 0x32, 0xfa, 0xc1, 0xff, 0x27, 0x94, 0x11,
+  0x85, 0x03, 0x28, 0x20, 0x6c, 0xe1, 0xff, 0x07, 0x0c, 0x01, 0x85, 0x01,
+  0x28, 0x62, 0x5c, 0xe3, 0x8f, 0x03, 0x4e, 0x91, 0x80, 0x05, 0x39, 0x40,
+  0xf4, 0xc2, 0xff, 0x00, 0x9f, 0x91, 0x84, 0x05, 0x31, 0xc6, 0xe8, 0x07,
+  0x7f, 0x80, 0xcd, 0x00, 0xc4, 0x04, 0x31, 0x06, 0xc9, 0x0e, 0x00, 0xc0,
+  0x48, 0x88, 0xe0, 0x04, 0x79, 0x04, 0xdb, 0x12, 0x00, 0x30, 0x0c, 0xc8,
+  0xe4, 0x04, 0x6d, 0x06, 0xb6, 0x23, 0x00, 0x18, 0x1c, 0xc0, 0x84, 0x04,
+  0x25, 0x0c, 0xff, 0xc2, 0x00, 0x4e, 0x06, 0xb0, 0x80, 0x04, 0x3f, 0x8a,
+  0xb3, 0x83, 0xff, 0xc3, 0x03, 0x91, 0x84, 0x04, 0x2e, 0xd8, 0x0f, 0x3f,
+  0x00, 0x00, 0x5f, 0x83, 0x84, 0x04, 0x2a, 0x70, 0xfd, 0x7f, 0x00, 0x00,
+  0xc8, 0xc0, 0x84, 0x04, 0x4b, 0xe2, 0x2f, 0x01, 0x00, 0x08, 0x58, 0x60,
+  0x80, 0x04, 0x5b, 0x82, 0xff, 0x01, 0x00, 0x08, 0xd0, 0xa0, 0x84, 0x04,
+  0x72, 0x80, 0xe5, 0x00, 0x00, 0x08, 0xd2, 0x20, 0x44, 0x04, 0xca, 0x02,
+  0xff, 0x00, 0x00, 0x08, 0xde, 0xa0, 0x44, 0x04, 0x82, 0x02, 0x6d, 0x00,
+  0x00, 0x08, 0xf6, 0xb0, 0x40, 0x02, 0x82, 0x07, 0x3f, 0x00, 0x00, 0x08,
+  0x44, 0x58, 0x44, 0x02, 0x93, 0x3f, 0x1f, 0x00, 0x00, 0x30, 0x88, 0x4f,
+  0x44, 0x03, 0x83, 0x23, 0x3e, 0x00, 0x00, 0x00, 0x18, 0x60, 0xe0, 0x07,
+  0xe3, 0x0f, 0xfe, 0x00, 0x00, 0x00, 0x70, 0x70, 0xe4, 0x07, 0xc7, 0x1b,
+  0xfe, 0x01, 0x00, 0x00, 0xe0, 0x3c, 0xe4, 0x07, 0xc7, 0xe3, 0xfe, 0x1f,
+  0x00, 0x00, 0xff, 0x1f, 0xfc, 0x07, 0xc7, 0x03, 0xf8, 0x33, 0x00, 0xc0,
+  0xf0, 0x07, 0xff, 0x07, 0x87, 0x02, 0xfc, 0x43, 0x00, 0x60, 0xf0, 0xff,
+  0xff, 0x07, 0x8f, 0x06, 0xbe, 0x87, 0x00, 0x30, 0xf8, 0xff, 0xff, 0x07,
+  0x8f, 0x14, 0x9c, 0x8f, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x07, 0x9f, 0x8d,
+  0x8a, 0x0f, 0x00, 0x00, 0xfe, 0xff, 0xff, 0x07, 0xbf, 0x0b, 0x80, 0x1f,
+  0x00, 0x00, 0xff, 0xff, 0xff, 0x07, 0x7f, 0x3a, 0x80, 0x3f, 0x00, 0x80,
+  0xff, 0xff, 0xff, 0x07, 0xff, 0x20, 0xc0, 0x3f, 0x00, 0x80, 0xff, 0xff,
+  0xff, 0x07, 0xff, 0x01, 0xe0, 0x7f, 0x00, 0xc0, 0xff, 0xff, 0xff, 0x07,
+  0xff, 0x0f, 0xf8, 0xff, 0x40, 0xe0, 0xff, 0xff, 0xff, 0x07, 0xff, 0xff,
+  0xff, 0xff, 0x40, 0xf0, 0xff, 0xff, 0xff, 0x07, 0xff, 0xff, 0xff, 0xff,
+  0x41, 0xf0, 0xff, 0xff, 0xff, 0x07};

Added: branches/branch-3.0/test2/subwindow.cxx
===================================================================
--- branches/branch-3.0/test2/subwindow.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/subwindow.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,201 @@
+//
+// "$Id: subwindow.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $"
+//
+// Nested window test program for the Fast Light Tool Kit (FLTK).
+//
+// Test to make sure nested windows work.
+// Events should be reported for enter/exit and all mouse operations
+// Buttons and pop-up menu should work, indicating that mouse positions
+// are being correctly translated.
+//
+// Copyright 1998-2006 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+//    http://www.fltk.org/str.php
+//
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <fltk/run.h>
+#include <fltk/Window.h>
+#include <fltk/ToggleButton.h>
+#include <fltk/PopupMenu.h>
+#include <fltk/Input.h>
+#include <fltk/InputBrowser.h>
+#include <fltk/events.h>
+using namespace fltk;
+
+#define DEBUG 1
+
+class testwindow : public Window {
+  int handle(int);
+  void draw();
+public:
+  testwindow(Box* b,int x,int y,const char *l)
+    : Window(x,y,l) {box(b);}
+  testwindow(Box* b,int x,int y,int w,int h,const char *l)
+    : Window(x,y,w,h,l) {box(b);}
+};
+
+void testwindow::draw() {
+#ifdef DEBUG
+  printf("%s : draw\n",label());
+#endif
+  Window::draw();
+}
+
+class EnterExit : public Widget {
+  uchar oldcolor;
+  int handle(int);
+public:
+  EnterExit(int x, int y, int w, int h, const char *l) :
+    Widget(x,y,w,h,l) {box(BORDER_BOX);}
+};
+
+int EnterExit::handle(int e) {
+  if (e == ENTER) {oldcolor = color(); color(RED); redraw(); return 1;}
+  else if (e == LEAVE) {color(oldcolor); redraw(); return 1;}
+  else if (e == MOVE) return 1;
+  else return 0;
+}
+
+#ifdef DEBUG
+const char *eventnames[] = {
+"zero",
+"PUSH",
+"RELEASE",
+"ENTER",
+"LEAVE",
+"DRAG",
+"FOCUS",
+"UNFOCUS",
+"KEY",
+"KEYUP",
+"MOVE",
+"SHORTCUT",
+"ACTIVATE",
+"DEACTIVATE",
+"SHOW",
+"HIDE",
+"VIEWCHANGE",
+"PASTE",
+"SELECTIONCLEAR",
+};
+#endif
+
+PopupMenu* popup;
+
+int testwindow::handle(int e) {
+#ifdef DEBUG
+  if (e != MOVE) printf("%s : %s\n",label(),eventnames[e]);
+#endif
+  if (Window::handle(e)) return 1;
+  //  if (e==PUSH) return popup->handle(e);
+  return 0;
+}
+
+const char* bigmess =
+#if 0
+"this|is|only|a test"
+#else
+"item1|item2|item3|item4|item5|"
+"submenu/item1|submenu/item2|submenu/item3|submenu/item4|"
+"submenu/sub/item1|submenu/sub/item2|submenu/sub/item3|"
+"item6|item7|item8|item9|item10|"
+"item21|item22|item23|item24|item25|"
+"submenu/item21|submenu/item22|submenu/item23|submenu/item24|"
+"submenu/sub/item21|submenu/sub/item22|submenu/sub/item23|"
+"item36|item37|item38|item39|item310|"
+"item31|item32|item33|item34|item35|"
+"submenu/item31|submenu/item32|submenu/item33|submenu/item34|"
+"submenu/sub/item31|submenu/sub/item32|submenu/sub/item33|"
+"item46|item47|item48|item49|item410|"
+"item41|item42|item43|item44|item45|"
+"submenu/item41|submenu/item42|submenu/item43|submenu/item44|"
+"submenu/sub/item41|submenu/sub/item42|submenu/sub/item43|"
+"item26|item27|item28|item29|item210|"
+"submenu2/item1|submenu2/item2|submenu2/item3|submenu2/item4|"
+"submenu2/sub/item1|submenu2/sub/item2|submenu2/sub/item3|"
+"item6|item7|item8|item9|item10|"
+"item21|item22|item23|item24|item25|"
+"submenu2/item21|submenu2/item22|submenu2/item23|submenu2/item24|"
+"submenu2/sub/item21|submenu2/sub/item22|submenu2/sub/item23|"
+"item36|item37|item38|item39|item310|"
+"item31|item32|item33|item34|item35|"
+"submenu2/item31|submenu2/item32|submenu2/item33|submenu2/item34|"
+"submenu2/sub/item31|submenu2/sub/item32|submenu2/sub/item33|"
+"item46|item47|item48|item49|item410|"
+"item41|item42|item43|item44|item45|"
+"submenu2/item41|submenu2/item42|submenu2/item43|submenu2/item44|"
+"submenu2/sub/item41|submenu2/sub/item42|submenu2/sub/item43|"
+"item26|item27|item28|item29|item210|"
+#endif
+;
+
+int main(int, char **) {
+  testwindow *window =
+    new testwindow(UP_BOX,400,400,"outer");
+  window->begin();
+//  (new Menu_Button(5,150,80,25,"menu&1"))->add_many(bigmess);
+  testwindow *subwindow =
+    new testwindow(DOWN_BOX,100,100,200,200,"inner");
+  subwindow->color(YELLOW);
+  subwindow->begin();
+  (new PopupMenu(50,50,80,25,"menu&2"))->add_many(bigmess);
+  (void) new Input(45,80,150,25,"input:");
+  (void) new EnterExit(10,110,80,80,"enterexit");
+  (void) new ToggleButton(110,110,80,80,"&inner");
+  subwindow->resizable(subwindow);
+  window->resizable(subwindow);
+  subwindow->end();
+  subwindow->tooltip(
+"This is a child fltk::Window. This may be necessary for imbedding "
+"controls that need a different X visual, OpenGL (using fltk::GlWindow), "
+"or to use the system's clipping to the edge of the window. This program "
+"tests for bugs in event handling and redrawing of these windows.\n\n"
+
+"Things to check:\n"
+" Outer border always draws exactly around yellow area.\n"
+" enterexit widgets turn red when pointed to by mouse, even if this "
+"happens when you exit a popup menu or move from an overlapping "
+"window belonging to another application, or raise this window.\n"
+" focus can move between both windows and you can type to both "
+"input widgets.");
+  (void) new EnterExit(10,310,80,80,"enterexit");
+  (void) new Input(150,310,150,25,"input:");
+  (void) new ToggleButton(310,310,80,80,"&outer");
+#if 0
+  { InputBrowser *o = new InputBrowser(5,150,80,25,"menu&1");
+    o->type(InputBrowser::NONEDITABLE_INDENTED);
+    o->add_many(bigmess);
+    o->value(o->child(0)->label());
+  }
+#endif
+  popup = new PopupMenu(0,0,400,400);
+  popup->type(PopupMenu::POPUP3);
+  popup->add_many("This|is|a popup|menu");
+  window->end();
+  subwindow->show(); // this should do nothing. On older fltk it crashed.
+  window->show(); // this actually shows the window + subwindow
+  return fltk::run();
+}
+
+//
+// End of "$Id: subwindow.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $".
+//

Added: branches/branch-3.0/test2/symbols.cxx
===================================================================
--- branches/branch-3.0/test2/symbols.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/symbols.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,117 @@
+// "$Id: symbols.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $"
+//
+// Symbol test program for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2006 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+//    http://www.fltk.org/str.php
+
+#include <fltk/Window.h>
+#include <fltk/Browser.h>
+#include <fltk/Symbol.h>
+#include <fltk/run.h>
+#include <fltk/string.h>
+#include <fltk/Slider.h>
+#include <stdlib.h>
+
+using namespace fltk;
+
+int sort(const void* a, const void* b) {
+  const Symbol* A = *(const Symbol**)a;
+  const Symbol* B = *(const Symbol**)b;
+  return strcasecmp(A->name(), B->name());
+}
+
+struct fl_char_table {const char* name; const char* text;} specialtable[] = {
+  {"b", "@t@@b;\t@n@b;bold"},
+  {"B", "@t@@B#;\t@n@B11;bg color"},
+  {"C", "@t@@C#;\t@n@C11;color"},
+  {"f", "@t@@f;\t@n@f;fixed"},
+  {"i", "@t@@i;\t@n@i;italic"},
+  {"n", "@t@@n;\t@n;reset font & color"},
+  {"t", "@t@@t;\t@t;typewriter"},
+  {"s", "@t@@s+#;\t@n@s+4;bigger"},
+  {"S", "@t@@s-#;\t@n@S-4;smaller"},
+  {"x", "@t@@x#;\t@n@x+10;t@x+3;e@x-4;x@x+5;t (displace x)"},
+  {"y", "@t@@y#;\t@n@y-1;t@y+1;e@y+3;x@y+5;t@n; (displace y)"},
+  {".", "@t@@.;\t@n@.;raw mode: @&"},
+  {"l",	"@t@@l;\t@n@l;left"},
+  {"c",	"@t@@c;\t@n@c;center"},
+  {"r",	"@t@@r;\t@n@r;right"}
+};
+
+void slider_cb(Widget* w, void* v) {
+  Browser* browser = (Browser*)v;
+  browser->textsize(((Slider*)w)->value());
+  // make it remeasure all the child items (not sure if this is a bug
+  // in the Browser or not:
+  for (int i = 0; i < browser->children(); i++)
+    browser->child(i)->h(0);
+  browser->relayout();
+  browser->redraw();
+}
+
+static const char* labels[] = {"command", "result", 0};
+static int widths[] = {170,-1,0};
+
+int main(int argc, char** argv) {
+  Window window(250,700);
+  window.begin();
+  const int sliderh = 25;
+  Browser browser(0,0,window.w(),window.h()-sliderh);
+  browser.column_widths(widths);
+  browser.column_labels(labels);
+  browser.color(GRAY85);
+  window.resizable(browser);
+  Slider slider(0, browser.h(), window.w(), sliderh);
+  slider.type(Slider::TICK_ABOVE|Slider::LOG);
+  slider.range(1,60);
+  slider.step(1);
+  slider.value(browser.textsize());
+  slider.callback(slider_cb, &browser);
+  window.end();
+  const Symbol* table[1000];
+  int n = 0;
+  int i; for (i=0;;) {
+    const Symbol* symbol = Symbol::iterate(i);
+    if (!symbol) break;
+    table[n++] = symbol;
+  }
+  qsort(table, n, sizeof(*table), sort);
+  for (i=0; i<n; i++) {
+    const Symbol* symbol = table[i];
+    char buffer[256];
+    for (unsigned j = 0; j < sizeof(specialtable)/sizeof(*specialtable); j++) {
+      if (!strcmp(specialtable[j].name, symbol->name())) {
+        browser.add(specialtable[j].text);
+        goto CONTINUE;
+      }
+    }
+    snprintf(buffer, 256, "@t@@%s;\t@n@%s;", symbol->name(), symbol->name());
+    browser.add(buffer);
+  CONTINUE:;
+  }
+  window.show(argc, argv);
+  return fltk::run();
+}
+
+/*
+ * End of "$Id: symbols.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $".
+ */

Added: branches/branch-3.0/test2/tabs.cxx
===================================================================
--- branches/branch-3.0/test2/tabs.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/tabs.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,109 @@
+// generated by Fast Light User Interface Designer (fluid) version 2.1000
+
+#include "tabs.h"
+
+fltk::Window *foo_window=(fltk::Window *)0;
+
+static void cb_cancel(fltk::Button*, void*) {
+  exit(1);
+}
+
+static void cb_OK(fltk::ReturnButton*, void*) {
+  exit(0);
+}
+
+#include <fltk/run.h>
+
+int main (int argc, char **argv) {
+
+  fltk::Window* w;
+   {fltk::Window* o = foo_window = new fltk::Window(320, 296);
+    w = o;
+    o->shortcut(0xff1b);
+    o->begin();
+     {fltk::TabGroup* o = new fltk::TabGroup(10, 10, 300, 191);
+      o->begin();
+       {fltk::Group* o = new fltk::Group(0, 20, 300, 171, "Label1");
+        o->begin();
+        new fltk::Input(50, 14, 240, 22, "input:");
+        new fltk::Input(50, 36, 240, 22, "input2:");
+         {fltk::WordwrapInput* o = new fltk::WordwrapInput(50, 58, 240, 99, "input3:");
+          o->type(5);
+        }
+        o->end();
+        fltk::Group::current()->resizable(o);
+      }
+       {fltk::Group* o = new fltk::Group(0, 20, 300, 171, "tab2");
+        o->hide();
+        o->begin();
+        new fltk::Button(10, 25, 100, 22, "button1");
+        new fltk::Input(130, 58, 100, 22, "input in box2");
+        new fltk::Button(20, 113, 260, 22, "This is stuff inside the Fl_Group \"tab2\"");
+        o->end();
+      }
+       {fltk::Group* o = new fltk::Group(0, 20, 300, 171, "tab3");
+        o->hide();
+        o->begin();
+         {fltk::Button* o = new fltk::Button(10, 30, 60, 80, "button2");
+          o->set_vertical();
+        }
+         {fltk::Button* o = new fltk::Button(70, 30, 60, 80, "button");
+          o->set_vertical();
+        }
+         {fltk::Button* o = new fltk::Button(130, 30, 60, 80, "button");
+          o->set_vertical();
+        }
+        o->end();
+      }
+       {fltk::Group* o = new fltk::Group(0, 20, 300, 171, "tab4");
+        o->labelfont(fltk::HELVETICA_ITALIC);
+        o->hide();
+        o->begin();
+         {fltk::Button* o = new fltk::Button(10, 20, 60, 110, "button2");
+          o->set_vertical();
+        }
+         {fltk::Button* o = new fltk::Button(70, 20, 60, 110, "button");
+          o->set_vertical();
+        }
+         {fltk::Button* o = new fltk::Button(130, 20, 60, 110, "button");
+          o->set_vertical();
+        }
+        o->end();
+      }
+       {fltk::Group* o = new fltk::Group(0, 20, 300, 171, "very long tab text");
+        o->labeltype(fltk::ENGRAVED_LABEL);
+        o->hide();
+        o->begin();
+         {fltk::Button* o = new fltk::Button(10, 50, 60, 80, "button2");
+          o->set_vertical();
+        }
+         {fltk::Button* o = new fltk::Button(80, 60, 60, 80, "button");
+          o->set_vertical();
+        }
+         {fltk::Clock* o = new fltk::Clock(155, 13, 100, 100, "Make sure this clock does not use processor time when this tab is hidden or w\
+indow is iconized");
+          o->box(fltk::OSHADOW_BOX);
+          o->labelfont(fltk::TIMES);
+          o->color((fltk::Color)238);
+          o->labelsize(10);
+          o->align(fltk::ALIGN_BOTTOM|fltk::ALIGN_WRAP);
+        }
+        o->end();
+      }
+      o->end();
+      fltk::Group::current()->resizable(o);
+    }
+    new fltk::Input(60, 211, 130, 22, "inputA:");
+    new fltk::Input(60, 233, 250, 22, "inputB:");
+     {fltk::Button* o = new fltk::Button(180, 266, 60, 22, "cancel");
+      o->callback((fltk::Callback*)cb_cancel);
+    }
+     {fltk::ReturnButton* o = new fltk::ReturnButton(250, 266, 60, 22, "OK");
+      o->shortcut(0xff0d);
+      o->callback((fltk::Callback*)cb_OK);
+    }
+    o->end();
+  }
+  w->show(argc, argv);
+  return  fltk::run();
+}

Added: branches/branch-3.0/test2/tabs.fl
===================================================================
--- branches/branch-3.0/test2/tabs.fl	                        (rev 0)
+++ branches/branch-3.0/test2/tabs.fl	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,124 @@
+# data file for the FLTK User Interface Designer (FLUID)
+version 2.0100 
+images_dir ./ 
+header_name {.h} 
+code_name {.cxx} 
+gridx 5 
+gridy 11 
+snap 3
+Function {} {open
+} {
+  {fltk::Window} foo_window {open
+    xywh {457 236 320 296} resizable visible
+  } {
+    {fltk::TabGroup} {} {open
+      xywh {10 10 300 191} resizable
+    } {
+      {fltk::Group} {} {
+        label Label1 open
+        xywh {0 20 300 171} resizable
+      } {
+        {fltk::Input} {} {
+          label {input:}
+          xywh {50 14 240 22}
+        }
+        {fltk::Input} {} {
+          label {input2:}
+          xywh {50 36 240 22}
+        }
+        {fltk::Input} {} {
+          label {input3:}
+          xywh {50 58 240 99} type Wordwrap
+        }
+      }
+      {fltk::Group} {} {
+        label tab2 open
+        xywh {0 20 300 171} hide
+      } {
+        {fltk::Button} {} {
+          label button1
+          xywh {10 25 100 22}
+        }
+        {fltk::Input} {} {
+          label {input in box2}
+          xywh {130 58 100 22}
+        }
+        {fltk::Button} {} {
+          label {This is stuff inside the Fl_Group "tab2"}
+          xywh {20 113 260 22}
+        }
+      }
+      {fltk::Group} {} {
+        label tab3 open
+        xywh {0 20 300 171} hide
+      } {
+        {fltk::Button} {} {
+          label button2
+          xywh {10 30 60 80}
+        }
+        {fltk::Button} {} {
+          label button
+          xywh {70 30 60 80}
+        }
+        {fltk::Button} {} {
+          label button
+          xywh {130 30 60 80}
+        }
+      }
+      {fltk::Group} {} {
+        label tab4 open
+        xywh {0 20 300 171} hide labelfont 2
+      } {
+        {fltk::Button} {} {
+          label button2
+          xywh {10 20 60 110}
+        }
+        {fltk::Button} {} {
+          label button
+          xywh {70 20 60 110}
+        }
+        {fltk::Button} {} {
+          label button
+          xywh {130 20 60 110}
+        }
+      }
+      {fltk::Group} {} {
+        label {very long tab text} open
+        xywh {0 20 300 171} hide labeltype ENGRAVED_LABEL
+      } {
+        {fltk::Button} {} {
+          label button2
+          xywh {10 50 60 80}
+        }
+        {fltk::Button} {} {
+          label button
+          xywh {80 60 60 80}
+        }
+        {fltk::Clock} {} {
+          label {Make sure this clock does not use processor time when this tab is hidden or window is iconized}
+          xywh {155 13 100 100} align 130 box OSHADOW_BOX labelfont 8 color 238 labelsize 10
+        }
+      }
+    }
+    {fltk::Input} {} {
+      label {inputA:}
+      xywh {60 211 130 22}
+    }
+    {fltk::Input} {} {
+      label {inputB:}
+      xywh {60 233 250 22}
+    }
+    {fltk::Button} {} {
+      label cancel
+      callback {exit(1);}
+      xywh {180 266 60 22}
+      extra_code {\#include <stdlib.h>}
+    }
+    {fltk::ReturnButton} {} {
+      label OK
+      callback {exit(0);}
+      xywh {250 266 60 22} shortcut 0xff0d
+      extra_code {\#include <stdlib.h>}
+    }
+  }
+} 

Added: branches/branch-3.0/test2/tabs.h
===================================================================
--- branches/branch-3.0/test2/tabs.h	                        (rev 0)
+++ branches/branch-3.0/test2/tabs.h	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,15 @@
+// generated by Fast Light User Interface Designer (fluid) version 2.1000
+
+#ifndef tabs_h
+#define tabs_h
+#include <fltk/Window.h>
+extern fltk::Window* foo_window;
+#include <fltk/TabGroup.h>
+#include <fltk/Group.h>
+#include <fltk/Input.h>
+#include <fltk/WordwrapInput.h>
+#include <fltk/Button.h>
+#include <fltk/Clock.h>
+#include <stdlib.h>
+#include <fltk/ReturnButton.h>
+#endif

Added: branches/branch-3.0/test2/threads.cxx
===================================================================
--- branches/branch-3.0/test2/threads.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/threads.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,138 @@
+//
+// "$Id: threads.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $"
+//
+// Threading example program for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2006 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+//    http://www.fltk.org/str.php
+//
+
+#include <config.h>
+
+#if HAVE_PTHREAD || defined(WIN32)
+#  include <fltk/Window.h>
+#  include <fltk/Browser.h>
+#  include <fltk/ValueInput.h>
+#  include <fltk/Threads.h>
+#  include <fltk/run.h>
+#  include <stdio.h>
+#  include <math.h>
+
+fltk::Thread prime_thread;
+
+fltk::Browser *browser1, *browser2;
+fltk::ValueInput *value1, *value2;
+unsigned start2 = 5;
+
+void* prime_func(void* p)
+{
+  fltk::Browser* browser = (fltk::Browser*) p;
+  fltk::ValueInput *value;
+  unsigned n = 5;
+  if (browser == browser2) {
+    value = value2;
+  } else {
+    value = value1;
+  }
+
+  // very simple prime number calculator !
+  for (; ; n += 2) {
+    if (browser == browser2) {
+      // for multithreaded one, get next number to test
+      fltk::lock();
+      n = start2;
+      start2 += 2;
+      fltk::unlock();
+    }
+    for (unsigned p=3; n%p; p+=2) {
+      if (p*p > n) {
+	char s[128];
+	sprintf(s, "%u", n);
+	fltk::lock();
+	browser->add(s);
+	browser->bottomline(browser->size());
+	if (n > value->value()) value->value(n);
+	fltk::awake((void*) (browser == browser1? p:0));	// Cause the browser to redraw ...
+	fltk::unlock();
+	break;
+      }
+    }
+  }
+  return 0;
+}
+
+int main()
+{
+  fltk::lock(); // you must do this before creating any threads!
+
+  fltk::Window* w = new fltk::Window(200, 200, "Single Thread");
+  w->begin();
+  browser1 = new fltk::Browser(0, 0, 200, 175);
+  w->resizable(browser1);
+  value1 = new fltk::ValueInput(100, 175, 200, 25, "Max Prime:");
+  w->end();
+  w->show();
+  w = new fltk::Window(200, 200, "Six Threads");
+  w->begin();
+  browser2 = new fltk::Browser(0, 0, 200, 175);
+  w->resizable(browser2);
+  value2 = new fltk::ValueInput(100, 175, 200, 25, "Max Prime:");
+  w->end();
+  w->show();
+
+  browser1->add("Prime numbers:");
+  browser1->add("2");
+  browser1->add("3");
+  browser2->add("Prime numbers:");
+  browser2->add("2");
+  browser2->add("3");
+
+  // One thread displaying in one browser
+  fltk::create_thread(prime_thread, prime_func, browser1);
+  // Several threads displaying in another browser
+  fltk::create_thread(prime_thread, prime_func, browser2);
+  fltk::create_thread(prime_thread, prime_func, browser2);
+  fltk::create_thread(prime_thread, prime_func, browser2);
+  fltk::create_thread(prime_thread, prime_func, browser2);
+  fltk::create_thread(prime_thread, prime_func, browser2);
+  fltk::create_thread(prime_thread, prime_func, browser2);
+
+  //  fltk::run();
+  while (w->visible()) {
+    fltk::wait();
+//    void* m = fltk::thread_message();
+//    printf("Received message: %p\n", m);
+  }
+
+  return 0;
+}
+#else
+#  include <fltk/ask.h>
+
+int main() {
+  fltk::alert("Sorry, threading not supported on this platform!");
+}
+#endif // HAVE_PTHREAD || WIN32
+
+
+//
+// End of "$Id: threads.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $".
+//

Added: branches/branch-3.0/test2/tile.cxx
===================================================================
--- branches/branch-3.0/test2/tile.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/tile.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,102 @@
+//
+// "$Id: tile.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $"
+//
+// Tile test program for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2006 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+//    http://www.fltk.org/str.php
+//
+
+#include <fltk/run.h>
+#include <fltk/Window.h>
+#include <fltk/TiledGroup.h>
+#include <fltk/Button.h>
+
+int main(int argc, char** argv) {
+  fltk::Window window(320,320);
+  window.begin();
+  window.resizable(window);
+
+  fltk::TiledGroup tile(10,10,300,300);
+  tile.begin();
+
+  fltk::Group box0(0,0,150,150,"0");
+  box0.box(fltk::DOWN_BOX);
+  box0.color(9);
+  box0.labelsize(36);
+  box0.set_flag(fltk::ALIGN_CLIP);
+
+  box0.begin();
+  fltk::Button but(20, 20, 100, 30, "Button");
+  but.set_flag(fltk::ALIGN_CLIP);
+  box0.end();
+
+  fltk::Window w1(150,0,150,150,"1");
+  w1.begin();
+  fltk::Widget box1(0,0,150,150,"1\nThis is a\nchild\nX window");
+  box1.box(fltk::DOWN_BOX);
+  box1.color(19);
+  box1.labelsize(18);
+  box1.set_flag(fltk::ALIGN_CLIP);
+  w1.resizable(box1);
+  w1.end();
+
+  //  fltk::Tile tile2(0,150,150,150);
+  fltk::Widget box2a(0,150,70,150,"2a");
+  box2a.box(fltk::DOWN_BOX);
+  box2a.color(12);
+  box2a.labelsize(36);
+  box2a.set_flag(fltk::ALIGN_CLIP);
+  fltk::Widget box2b(70,150,80,150,"2b");
+  box2b.box(fltk::DOWN_BOX);
+  box2b.color(13);
+  box2b.labelsize(36);
+  box2b.set_flag(fltk::ALIGN_CLIP);
+  //tile2.end();
+
+  //Tile tile3(150,150,150,150);
+  fltk::Widget box3a(150,150,150,70,"3a");
+  box3a.box(fltk::DOWN_BOX);
+  box3a.color(12);
+  box3a.labelsize(36);
+  box3a.set_flag(fltk::ALIGN_CLIP);
+  fltk::Widget box3b(150,150+70,150,80,"3b");
+  box3b.box(fltk::DOWN_BOX);
+  box3b.color(13);
+  box3b.labelsize(36);
+  box3b.set_flag(fltk::ALIGN_CLIP);
+  //tile3.end();
+  
+  fltk::Widget r(10,0,300-10,300-10);
+  //r.box(fltk::BORDER_FRAME);
+  r.hide();
+  tile.resizable(r);
+
+  tile.end();
+  window.end();
+  window.show(argc,argv);
+  w1.show();
+  return fltk::run();
+}
+
+//
+// End of "$Id: tile.cxx 8500 2011-03-03 09:20:46Z bgbnbigben $".
+//

Added: branches/branch-3.0/test2/timer.cxx
===================================================================
--- branches/branch-3.0/test2/timer.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/timer.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,75 @@
+#include <fltk/run.h>
+#include <fltk/Widget.h>
+#include <fltk/Window.h>
+#include <fltk/ValueInput.h>
+#include <fltk/ValueOutput.h>
+#include <fltk/Slider.h>
+
+using namespace fltk;
+
+double cps = 24.0;
+double period = 1.0/24.0;
+
+unsigned ticks;
+static double starttime;
+unsigned prevticks;
+
+//#define SLIDER_TICKS cps
+// A prime number to avoid system tendency to do things in multiples of 2
+// and 100:
+#define SLIDER_TICKS 139
+
+ValueOutput* actual;
+int timing_period = 1;
+
+void timeout_callback(void* v) {
+  ticks++;
+  ((Slider*)v)->value(ticks%SLIDER_TICKS);
+  fltk::repeat_timeout(period, timeout_callback, v);
+
+  if (ticks-prevticks > cps*timing_period) {
+    double now = fltk::get_time_secs();
+    actual->value((ticks-prevticks)/(now-starttime));
+    starttime = now;
+    prevticks = ticks;
+    timing_period++;
+  }
+}
+
+void fps_callback(Widget* w, void* v) {
+  cps = ((ValueInput*)w)->value();
+  //((Slider*)v)->maximum(SLIDER_TICKS-1);
+  period = 1.0/cps;
+  fltk::remove_timeout(timeout_callback, v);
+  fltk::add_timeout(period, timeout_callback, v);
+  starttime = fltk::get_time_secs();
+  prevticks = ticks;
+  timing_period = 1;
+}
+
+int main(int argc, char** argv) {
+
+  Window window(300,200);
+  window.begin();
+  Widget box(0, 0, 300, 100, "fltk::repeat_timeout() test");
+  box.labelsize(20); //box.labelfont(HELVETICA_BOLD);
+  box.align(ALIGN_WRAP);
+  window.resizable(box);
+  Slider ticker(10, 100,280,25);
+  ticker.maximum(SLIDER_TICKS-1);
+  ticker.set_output();
+  ValueInput fps(120, 130, 170, 25, "Desired speed:");
+  fps.value(24);
+  fps.callback(fps_callback, &ticker);
+  ValueOutput actual(120, 165, 170, 25, "Actual speed:");
+  actual.tooltip("Average speed since you last changed the speed.");
+  ::actual = &actual;
+
+  window.show(argc, argv);
+  fltk::wait();
+
+  fltk::add_timeout(period, timeout_callback, &ticker);
+  starttime = fltk::get_time_secs();
+
+  return fltk::run();
+}

Added: branches/branch-3.0/test2/trackball.c
===================================================================
--- branches/branch-3.0/test2/trackball.c	                        (rev 0)
+++ branches/branch-3.0/test2/trackball.c	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,324 @@
+/*
+ * (c) Copyright 1993, 1994, Silicon Graphics, Inc.
+ * ALL RIGHTS RESERVED
+ * Permission to use, copy, modify, and distribute this software for
+ * any purpose and without fee is hereby granted, provided that the above
+ * copyright notice appear in all copies and that both the copyright notice
+ * and this permission notice appear in supporting documentation, and that
+ * the name of Silicon Graphics, Inc. not be used in advertising
+ * or publicity pertaining to distribution of the software without specific,
+ * written prior permission.
+ *
+ * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
+ * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
+ * FITNESS FOR A PARTICULAR PURPOSE.  IN NO EVENT SHALL SILICON
+ * GRAPHICS, INC.  BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
+ * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
+ * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
+ * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
+ * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC.  HAS BEEN
+ * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
+ * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * US Government Users Restricted Rights
+ * Use, duplication, or disclosure by the Government is subject to
+ * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
+ * (c)(1)(ii) of the Rights in Technical Data and Computer Software
+ * clause at DFARS 252.227-7013 and/or in similar or successor
+ * clauses in the FAR or the DOD or NASA FAR Supplement.
+ * Unpublished-- rights reserved under the copyright laws of the
+ * United States.  Contractor/manufacturer is Silicon Graphics,
+ * Inc., 2011 N.  Shoreline Blvd., Mountain View, CA 94039-7311.
+ *
+ * OpenGL(TM) is a trademark of Silicon Graphics, Inc.
+ */
+/*
+ * Trackball code:
+ *
+ * Implementation of a virtual trackball.
+ * Implemented by Gavin Bell, lots of ideas from Thant Tessman and
+ *   the August '88 issue of Siggraph's "Computer Graphics," pp. 121-129.
+ *
+ * Vector manip code:
+ *
+ * Original code from:
+ * David M. Ciemiewicz, Mark Grossman, Henry Moreton, and Paul Haeberli
+ *
+ * Much mucking with by:
+ * Gavin Bell
+ */
+#include <math.h>
+#include "trackball.h"
+
+/*
+ * This size should really be based on the distance from the center of
+ * rotation to the point on the object underneath the mouse.  That
+ * point would then track the mouse as closely as possible.  This is a
+ * simple example, though, so that is left as an Exercise for the
+ * Programmer.
+ */
+#define TRACKBALLSIZE  (0.8)
+
+/*
+ * Local function prototypes (not defined in trackball.h)
+ */
+static float tb_project_to_sphere(float, float, float);
+static void normalize_quat(float [4]);
+
+void
+vzero(float *v)
+{
+    v[0] = 0.0;
+    v[1] = 0.0;
+    v[2] = 0.0;
+}
+
+void
+vset(float *v, float x, float y, float z)
+{
+    v[0] = x;
+    v[1] = y;
+    v[2] = z;
+}
+
+void
+vsub(const float *src1, const float *src2, float *dst)
+{
+    dst[0] = src1[0] - src2[0];
+    dst[1] = src1[1] - src2[1];
+    dst[2] = src1[2] - src2[2];
+}
+
+void
+vcopy(const float *v1, float *v2)
+{
+    register int i;
+    for (i = 0 ; i < 3 ; i++)
+        v2[i] = v1[i];
+}
+
+void
+vcross(const float *v1, const float *v2, float *cross)
+{
+    float temp[3];
+
+    temp[0] = (v1[1] * v2[2]) - (v1[2] * v2[1]);
+    temp[1] = (v1[2] * v2[0]) - (v1[0] * v2[2]);
+    temp[2] = (v1[0] * v2[1]) - (v1[1] * v2[0]);
+    vcopy(temp, cross);
+}
+
+float
+vlength(const float *v)
+{
+    return (float)(sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]));
+}
+
+void
+vscale(float *v, float div)
+{
+    v[0] *= div;
+    v[1] *= div;
+    v[2] *= div;
+}
+
+void
+vnormal(float *v)
+{
+    vscale(v,1.0/vlength(v));
+}
+
+float
+vdot(const float *v1, const float *v2)
+{
+    return v1[0]*v2[0] + v1[1]*v2[1] + v1[2]*v2[2];
+}
+
+void
+vadd(const float *src1, const float *src2, float *dst)
+{
+    dst[0] = src1[0] + src2[0];
+    dst[1] = src1[1] + src2[1];
+    dst[2] = src1[2] + src2[2];
+}
+
+/*
+ * Ok, simulate a track-ball.  Project the points onto the virtual
+ * trackball, then figure out the axis of rotation, which is the cross
+ * product of P1 P2 and O P1 (O is the center of the ball, 0,0,0)
+ * Note:  This is a deformed trackball-- is a trackball in the center,
+ * but is deformed into a hyperbolic sheet of rotation away from the
+ * center.  This particular function was chosen after trying out
+ * several variations.
+ *
+ * It is assumed that the arguments to this routine are in the range
+ * (-1.0 ... 1.0)
+ */
+void
+trackball(float q[4], float p1x, float p1y, float p2x, float p2y)
+{
+    float a[3]; /* Axis of rotation */
+    float phi;  /* how much to rotate about axis */
+    float p1[3], p2[3], d[3];
+    float t;
+
+    if (p1x == p2x && p1y == p2y) {
+        /* Zero rotation */
+        vzero(q);
+        q[3] = 1.0;
+        return;
+    }
+
+    /*
+     * First, figure out z-coordinates for projection of P1 and P2 to
+     * deformed sphere
+     */
+    vset(p1,p1x,p1y,tb_project_to_sphere(TRACKBALLSIZE,p1x,p1y));
+    vset(p2,p2x,p2y,tb_project_to_sphere(TRACKBALLSIZE,p2x,p2y));
+
+    /*
+     *  Now, we want the cross product of P1 and P2
+     */
+    vcross(p2,p1,a);
+
+    /*
+     *  Figure out how much to rotate around that axis.
+     */
+    vsub(p1,p2,d);
+    t = vlength(d) / (2.0*TRACKBALLSIZE);
+
+    /*
+     * Avoid problems with out-of-control values...
+     */
+    if (t > 1.0) t = 1.0;
+    if (t < -1.0) t = -1.0;
+    phi = 2.0 * asin(t);
+
+    axis_to_quat(a,phi,q);
+}
+
+/*
+ *  Given an axis and angle, compute quaternion.
+ */
+void
+axis_to_quat(float a[3], float phi, float q[4])
+{
+    vnormal(a);
+    vcopy(a,q);
+    vscale(q,sin(phi/2.0));
+    q[3] = cos(phi/2.0);
+}
+
+/*
+ * Project an x,y pair onto a sphere of radius r OR a hyperbolic sheet
+ * if we are away from the center of the sphere.
+ */
+static float
+tb_project_to_sphere(float r, float x, float y)
+{
+    float d, t, z;
+
+    d = sqrt(x*x + y*y);
+    if (d < r * 0.70710678118654752440) {    /* Inside sphere */
+        z = sqrt(r*r - d*d);
+    } else {           /* On hyperbola */
+        t = r / 1.41421356237309504880;
+        z = t*t / d;
+    }
+    return z;
+}
+
+/*
+ * Given two rotations, e1 and e2, expressed as quaternion rotations,
+ * figure out the equivalent single rotation and stuff it into dest.
+ *
+ * This routine also normalizes the result every RENORMCOUNT times it is
+ * called, to keep error from creeping in.
+ *
+ * NOTE: This routine is written so that q1 or q2 may be the same
+ * as dest (or each other).
+ */
+
+#define RENORMCOUNT 97
+
+void
+add_quats(float q1[4], float q2[4], float dest[4])
+{
+    static int count=0;
+    float t1[4], t2[4], t3[4];
+    float tf[4];
+
+    vcopy(q1,t1);
+    vscale(t1,q2[3]);
+
+    vcopy(q2,t2);
+    vscale(t2,q1[3]);
+
+    vcross(q2,q1,t3);
+    vadd(t1,t2,tf);
+    vadd(t3,tf,tf);
+    tf[3] = q1[3] * q2[3] - vdot(q1,q2);
+
+    dest[0] = tf[0];
+    dest[1] = tf[1];
+    dest[2] = tf[2];
+    dest[3] = tf[3];
+
+    if (++count > RENORMCOUNT) {
+        count = 0;
+        normalize_quat(dest);
+    }
+}
+
+/*
+ * Quaternions always obey:  a^2 + b^2 + c^2 + d^2 = 1.0
+ * If they don't add up to 1.0, dividing by their magnitued will
+ * renormalize them.
+ *
+ * Note: See the following for more information on quaternions:
+ *
+ * - Shoemake, K., Animating rotation with quaternion curves, Computer
+ *   Graphics 19, No 3 (Proc. SIGGRAPH'85), 245-254, 1985.
+ * - Pletinckx, D., Quaternion calculus as a basic tool in computer
+ *   graphics, The Visual Computer 5, 2-13, 1989.
+ */
+static void
+normalize_quat(float q[4])
+{
+    int i;
+    float mag;
+
+    mag = (q[0]*q[0] + q[1]*q[1] + q[2]*q[2] + q[3]*q[3]);
+    for (i = 0; i < 4; i++) q[i] /= mag;
+}
+
+/*
+ * Build a rotation matrix, given a quaternion rotation.
+ *
+ */
+void
+build_rotmatrix(float m[4][4], float q[4])
+{
+    m[0][0] = 1.0 - 2.0 * (q[1] * q[1] + q[2] * q[2]);
+    m[0][1] = 2.0 * (q[0] * q[1] - q[2] * q[3]);
+    m[0][2] = 2.0 * (q[2] * q[0] + q[1] * q[3]);
+    m[0][3] = 0.0;
+
+    m[1][0] = 2.0 * (q[0] * q[1] + q[2] * q[3]);
+    m[1][1]= 1.0 - 2.0 * (q[2] * q[2] + q[0] * q[0]);
+    m[1][2] = 2.0 * (q[1] * q[2] - q[0] * q[3]);
+    m[1][3] = 0.0;
+
+    m[2][0] = 2.0 * (q[2] * q[0] - q[1] * q[3]);
+    m[2][1] = 2.0 * (q[1] * q[2] + q[0] * q[3]);
+    m[2][2] = 1.0 - 2.0 * (q[1] * q[1] + q[0] * q[0]);
+    m[2][3] = 0.0;
+
+    m[3][0] = 0.0;
+    m[3][1] = 0.0;
+    m[3][2] = 0.0;
+    m[3][3] = 1.0;
+}
+

Added: branches/branch-3.0/test2/trackball.h
===================================================================
--- branches/branch-3.0/test2/trackball.h	                        (rev 0)
+++ branches/branch-3.0/test2/trackball.h	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,78 @@
+/*
+ * (c) Copyright 1993, 1994, Silicon Graphics, Inc.
+ * ALL RIGHTS RESERVED
+ * Permission to use, copy, modify, and distribute this software for
+ * any purpose and without fee is hereby granted, provided that the above
+ * copyright notice appear in all copies and that both the copyright notice
+ * and this permission notice appear in supporting documentation, and that
+ * the name of Silicon Graphics, Inc. not be used in advertising
+ * or publicity pertaining to distribution of the software without specific,
+ * written prior permission.
+ *
+ * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
+ * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
+ * FITNESS FOR A PARTICULAR PURPOSE.  IN NO EVENT SHALL SILICON
+ * GRAPHICS, INC.  BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
+ * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
+ * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
+ * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
+ * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC.  HAS BEEN
+ * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
+ * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * US Government Users Restricted Rights
+ * Use, duplication, or disclosure by the Government is subject to
+ * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
+ * (c)(1)(ii) of the Rights in Technical Data and Computer Software
+ * clause at DFARS 252.227-7013 and/or in similar or successor
+ * clauses in the FAR or the DOD or NASA FAR Supplement.
+ * Unpublished-- rights reserved under the copyright laws of the
+ * United States.  Contractor/manufacturer is Silicon Graphics,
+ * Inc., 2011 N.  Shoreline Blvd., Mountain View, CA 94039-7311.
+ *
+ * OpenGL(TM) is a trademark of Silicon Graphics, Inc.
+ */
+/*
+ * trackball.h
+ * A virtual trackball implementation
+ * Written by Gavin Bell for Silicon Graphics, November 1988.
+ */
+
+/*
+ * Pass the x and y coordinates of the last and current positions of
+ * the mouse, scaled so they are from (-1.0 ... 1.0).
+ *
+ * The resulting rotation is returned as a quaternion rotation in the
+ * first paramater.
+ */
+void
+trackball(float q[4], float p1x, float p1y, float p2x, float p2y);
+
+/*
+ * Given two quaternions, add them together to get a third quaternion.
+ * Adding quaternions to get a compound rotation is analagous to adding
+ * translations to get a compound translation.  When incrementally
+ * adding rotations, the first argument here should be the new
+ * rotation, the second and third the total rotation (which will be
+ * over-written with the resulting new total rotation).
+ */
+void
+add_quats(float *q1, float *q2, float *dest);
+
+/*
+ * A useful function, builds a rotation matrix in Matrix based on
+ * given quaternion.
+ */
+void
+build_rotmatrix(float m[4][4], float q[4]);
+
+/*
+ * This function computes a quaternion based on an axis (defined by
+ * the given vector) and an angle about which to rotate.  The angle is
+ * expressed in radians.  The result is put into the third argument.
+ */
+void
+axis_to_quat(float a[3], float phi, float q[4]);
+

Added: branches/branch-3.0/test2/utf.cxx
===================================================================
--- branches/branch-3.0/test2/utf.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/utf.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,159 @@
+// Test of UTF-8 handling in fltk.
+
+#include <fltk/run.h>
+#include <fltk/Window.h>
+#include <fltk/Scrollbar.h>
+#include <fltk/draw.h>
+#include <fltk/string.h>
+#include <fltk/Box.h>
+#include <fltk/Choice.h>
+#include <fltk/Font.h>
+#include <fltk/utf.h>
+#include <fltk/math.h>
+#include <fltk/Tooltip.h>
+#include <fltk/events.h>
+using namespace fltk;
+
+fltk::Font** fonts; // list returned by fltk
+Scrollbar* scrollbar;
+
+class Drawing : public Widget {
+  void draw();
+  int handle(int);
+public:
+  Drawing(int x, int y, int w, int h) : Widget(x,y,w,h) {}
+  void layout();
+};
+
+Drawing *drawing;
+
+// Return color to draw behind given code
+Color code_color(unsigned ucs) {
+  if (ucs < 32 || ucs==127 // ascii control characters
+      || (ucs >= 0x80 && ucs <= 0x9f) // C1 control characters
+      || (ucs >= 0xd800 && ucs <= 0xdfff) // surrogate pairs
+      || (ucs >= 0xfdd0 && ucs <= 0xfdef) // noncharacters
+      || (ucs&0xffff) >= 0xfffe // noncharacters
+      ) return GRAY50;
+  if (ucs & 0x100) return GRAY80;
+  return WHITE;
+}
+
+void Drawing::draw() {
+  push_clip(*this);
+  unsigned scroll = unsigned(scrollbar->value());
+  unsigned itemh = unsigned(textsize()+8);
+  unsigned base = scroll*16;
+  int y = 0;
+  Box* box = this->box();
+  for (; y < h(); y+=itemh, base+=16) {
+    char buf[20];
+    sprintf(buf, "U+%03Xx", base>>4);
+    Rectangle r(0, y, w()*2/18, itemh);
+    setbgcolor((base&0x100) ? GRAY80 : WHITE);
+    box->draw(r);
+    setcolor(labelcolor());
+    setfont(labelfont(),labelsize());
+    drawtext(buf, r, 0);
+    setfont(textfont(),textsize());
+    for (int z = 0; z < 16; z++) {
+      r.x(r.r()); r.set_r(w()*(3+z)/18);
+      char* p = buf;
+      // if (base < 0x100) *p++ = base+z; else // demonstrate cp1252 emulation
+      p += utf8encode(base+z,p);
+      *p = 0;
+      setbgcolor(code_color(base+z));
+      box->draw(r);
+      setcolor(labelcolor());
+      drawtext(buf, r, 0);
+    }
+  }
+  pop_clip();
+}
+
+const char* generator(Widget*, void* data) {
+  unsigned ucs = (unsigned)(unsigned long)data;
+  static char buffer[20];
+  sprintf(buffer,"U+%04x",ucs);
+  return buffer;
+}
+
+int Drawing::handle(int event) {
+  switch (event) {
+  case ENTER:
+  case MOVE:
+  case DRAG:
+  case PUSH:
+  case RELEASE:
+    break;
+  default:
+    return Widget::handle(event);
+  }
+  unsigned itemh = unsigned(textsize()+8);
+  int x = event_x()*18/w()-2;
+  int y = event_y()/itemh;
+  if (x < 0 || x > 15 || y < 0 || event_y()>h()) {
+    Tooltip::exit();
+    return true;
+  }
+  unsigned scroll = unsigned(scrollbar->value());
+  unsigned base = scroll*16;
+  unsigned ucs = base+y*16+x;
+  Tooltip::enter(this, Rectangle(w()*(2+x)/18, y*itemh, (w()+9)/18, itemh),
+		 generator, (void*)ucs);
+  return true;
+}
+
+void Drawing::layout() {
+  unsigned itemh = unsigned(textsize()+8);
+  //actually the height should be 0x11000*itemh to get all Unicode:
+  scrollbar->value(scrollbar->value(),h()/itemh,0,0x1000);
+  scrollbar->linesize(1);
+  Widget::layout();
+}
+
+void scroll_cb(Widget* w, void*) {
+  drawing->redraw();
+}
+
+void font_cb(Widget* w, void*) {
+  drawing->textfont(fonts[((Choice*)w)->value()]);
+  drawing->redraw();
+}
+
+void size_cb(Widget* w, void*) {
+  drawing->textsize(rint(((Slider*)w)->value()));
+  drawing->relayout();
+  drawing->redraw();
+}
+
+#define WH 24
+
+int main(int argc, char** argv) {
+  Window window(400,400+2*WH);
+  window.begin();
+  Drawing drawing(0,0,385,400);
+  ::drawing = &drawing;
+  window.resizable(drawing);
+  Scrollbar scrollbar(385,0,15,400);
+  scrollbar.set_vertical();
+  ::scrollbar = &scrollbar;
+  scrollbar.callback(scroll_cb);
+  Choice fontchooser(0,400,400,WH);
+  int numfonts = fltk::list_fonts(fonts);
+  int i; for (i = 0; i < numfonts; i++) fontchooser.add(fonts[i]->name());
+  fontchooser.callback(font_cb);
+  Slider sizeslider(0,400+WH,400,WH);
+  sizeslider.type(Slider::TICK_ABOVE|Slider::LOG);
+  sizeslider.range(5,50);
+  sizeslider.callback(size_cb);
+  window.end();
+  window.show(argc,argv);
+  sizeslider.value(drawing.textsize());
+  for (i=0; i < numfonts; i++)
+    if (drawing.textfont()==fonts[i]) {
+      fontchooser.value(i);
+      break;
+    }
+  return run();
+}

Added: branches/branch-3.0/test2/valuators.cxx
===================================================================
--- branches/branch-3.0/test2/valuators.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/valuators.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,277 @@
+// generated by Fast Light User Interface Designer (fluid) version 2.1000
+
+#include "valuators.h"
+
+static void callback(fltk::Widget* o, void*) {
+  printf("%g     \r", ((fltk::Valuator*)o)->value());
+  fflush(stdout);
+}
+
+#include <fltk/run.h>
+
+int main (int argc, char **argv) {
+
+  fltk::Window* w;
+   {fltk::Window* o = new fltk::Window(565, 490, "Valuator classes, showing values for the type()");
+    w = o;
+    o->labelsize(10);
+    o->shortcut(0xff1b);
+    o->begin();
+     {fltk::Widget* o = new fltk::Widget(10, 10, 280, 235, "Fl_Slider");
+      o->box(fltk::ENGRAVED_BOX);
+      o->labelfont(fltk::HELVETICA_BOLD);
+      o->color((fltk::Color)49);
+      o->align(fltk::ALIGN_TOP|fltk::ALIGN_CENTER);
+    }
+     {fltk::Slider* o = new fltk::Slider(25, 49, 20, 157, "VERTICAL");
+      o->set_vertical();
+      o->color((fltk::Color)10);
+      o->selection_color((fltk::Color)1);
+      o->labelsize(8);
+      o->callback((fltk::Callback*)callback);
+      o->align(fltk::ALIGN_TOP);
+    }
+     {fltk::Slider* o = new fltk::Slider(60, 70, 20, 158, "VERTICAL|TICK_LEFT");
+      o->type(fltk::Slider::TICK_ABOVE);
+      o->set_vertical();
+      o->color((fltk::Color)10);
+      o->selection_color((fltk::Color)1);
+      o->labelsize(8);
+      o->callback((fltk::Callback*)callback);
+    }
+     {fltk::Slider* o = new fltk::Slider(100, 49, 20, 157, "VERTICAL|TICK_RIGHT");
+      o->type(fltk::Slider::TICK_BELOW);
+      o->set_vertical();
+      o->color((fltk::Color)10);
+      o->selection_color((fltk::Color)1);
+      o->labelsize(8);
+      o->callback((fltk::Callback*)callback);
+      o->align(fltk::ALIGN_TOP);
+    }
+     {fltk::Slider* o = new fltk::Slider(140, 54, 130, 16, "HORIZONTAL");
+      o->color((fltk::Color)10);
+      o->selection_color((fltk::Color)1);
+      o->labelsize(8);
+      o->callback((fltk::Callback*)callback);
+    }
+     {fltk::Slider* o = new fltk::Slider(140, 81, 130, 22, "HORIZONTAL|TICK_ABOVE");
+      o->type(fltk::Slider::TICK_ABOVE);
+      o->color((fltk::Color)10);
+      o->selection_color((fltk::Color)1);
+      o->labelsize(8);
+      o->callback((fltk::Callback*)callback);
+    }
+     {fltk::Slider* o = new fltk::Slider(140, 119, 130, 22, "HORIZONTAL|TICK_ABOVE,box");
+      o->type(fltk::Slider::TICK_ABOVE);
+      o->box(fltk::DOWN_BOX);
+      o->color((fltk::Color)10);
+      o->selection_color((fltk::Color)1);
+      o->labelsize(8);
+      o->callback((fltk::Callback*)callback);
+    }
+     {fltk::Slider* o = new fltk::Slider(140, 157, 130, 22, "HORIZONTAL|TICK_BELOW");
+      o->type(fltk::Slider::TICK_BELOW);
+      o->color((fltk::Color)10);
+      o->selection_color((fltk::Color)1);
+      o->labelsize(8);
+      o->callback((fltk::Callback*)callback);
+    }
+     {fltk::Slider* o = new fltk::Slider(140, 201, 130, 22, "HORIZONTAL|TICK_BOTH");
+      o->type(fltk::Slider::TICK_BOTH);
+      o->color((fltk::Color)10);
+      o->selection_color((fltk::Color)1);
+      o->labelsize(8);
+      o->callback((fltk::Callback*)callback);
+    }
+     {fltk::Widget* o = new fltk::Widget(295, 10, 260, 126, "Fl_Value_Input");
+      o->box(fltk::ENGRAVED_BOX);
+      o->labelfont(fltk::HELVETICA_BOLD);
+      o->color((fltk::Color)49);
+      o->align(fltk::ALIGN_TOP|fltk::ALIGN_CENTER);
+    }
+     {fltk::ValueInput* o = new fltk::ValueInput(360, 35, 180, 22, "outside label");
+      o->color((fltk::Color)10);
+      o->selection_color((fltk::Color)1);
+      o->labelsize(8);
+      o->callback((fltk::Callback*)callback);
+    }
+     {fltk::ValueInput* o = new fltk::ValueInput(310, 63, 100, 22, "inside");
+      o->color((fltk::Color)10);
+      o->selection_color((fltk::Color)1);
+      o->labelsize(8);
+      o->callback((fltk::Callback*)callback);
+      o->align(fltk::ALIGN_LEFT|fltk::ALIGN_CENTER);
+    }
+     {fltk::ValueInput* o = new fltk::ValueInput(410, 63, 65, 22, "x");
+      o->color((fltk::Color)10);
+      o->selection_color((fltk::Color)1);
+      o->maximum(100);
+      o->step(0.1);
+      o->callback((fltk::Callback*)callback);
+      o->align(fltk::ALIGN_LEFT|fltk::ALIGN_CENTER);
+    }
+     {fltk::ValueInput* o = new fltk::ValueInput(475, 63, 65, 22, "y");
+      o->color((fltk::Color)10);
+      o->selection_color((fltk::Color)1);
+      o->maximum(100);
+      o->step(0.1);
+      o->callback((fltk::Callback*)callback);
+      o->align(fltk::ALIGN_LEFT|fltk::ALIGN_CENTER);
+    }
+     {fltk::ValueInput* o = new fltk::ValueInput(360, 93, 180, 32, "larger");
+      o->color((fltk::Color)10);
+      o->selection_color((fltk::Color)1);
+      o->callback((fltk::Callback*)callback);
+    }
+     {fltk::Widget* o = new fltk::Widget(10, 250, 280, 229, "Fl_Value_Slider");
+      o->box(fltk::ENGRAVED_BOX);
+      o->labelfont(fltk::HELVETICA_BOLD);
+      o->color((fltk::Color)49);
+      o->align(fltk::ALIGN_TOP|fltk::ALIGN_CENTER);
+    }
+     {fltk::Widget* o = new fltk::Widget(295, 141, 145, 131, "   Fl_Scrollbar");
+      o->box(fltk::ENGRAVED_BOX);
+      o->labelfont(fltk::HELVETICA_BOLD);
+      o->color((fltk::Color)49);
+      o->align(fltk::ALIGN_TOP|fltk::ALIGN_LEFT|fltk::ALIGN_CENTER);
+    }
+     {fltk::Scrollbar* o = new fltk::Scrollbar(300, 240, 105, 20, "HORIZONTAL");
+      o->color((fltk::Color)10);
+      o->selection_color((fltk::Color)1);
+      o->labelsize(8);
+      o->maximum(100);
+      o->callback((fltk::Callback*)callback);
+    }
+     {fltk::Scrollbar* o = new fltk::Scrollbar(405, 145, 20, 115, "VERTICAL");
+      o->set_vertical();
+      o->color((fltk::Color)10);
+      o->selection_color((fltk::Color)1);
+      o->labelsize(8);
+      o->minimum(100);
+      o->maximum(0);
+      o->callback((fltk::Callback*)callback);
+    }
+     {fltk::ValueSlider* o = new fltk::ValueSlider(25, 277, 30, 158, "VERTICAL");
+      o->set_vertical();
+      o->color((fltk::Color)10);
+      o->selection_color((fltk::Color)1);
+      o->labelsize(8);
+      o->textsize(10);
+      o->callback((fltk::Callback*)callback);
+      o->align(fltk::ALIGN_TOP);
+    }
+     {fltk::ValueSlider* o = new fltk::ValueSlider(65, 310, 30, 152, "VERTICAL|TICK_LEFT");
+      o->type(fltk::ValueSlider::TICK_ABOVE);
+      o->set_vertical();
+      o->color((fltk::Color)10);
+      o->selection_color((fltk::Color)1);
+      o->labelsize(8);
+      o->textsize(10);
+      o->callback((fltk::Callback*)callback);
+    }
+     {fltk::ValueSlider* o = new fltk::ValueSlider(105, 283, 35, 158, "VERTICAL|TICK_LEFT,box");
+      o->type(fltk::ValueSlider::TICK_ABOVE);
+      o->set_vertical();
+      o->box(fltk::DOWN_BOX);
+      o->color((fltk::Color)10);
+      o->selection_color((fltk::Color)1);
+      o->labelsize(8);
+      o->textsize(10);
+      o->callback((fltk::Callback*)callback);
+      o->align(fltk::ALIGN_TOP);
+    }
+     {fltk::ValueSlider* o = new fltk::ValueSlider(145, 294, 130, 21, "HORIZONTAL");
+      o->color((fltk::Color)10);
+      o->selection_color((fltk::Color)1);
+      o->labelsize(8);
+      o->callback((fltk::Callback*)callback);
+    }
+     {fltk::ValueSlider* o = new fltk::ValueSlider(145, 337, 130, 22, "HORIZONTAL|TICK_BELOW");
+      o->type(fltk::ValueSlider::TICK_BELOW);
+      o->color((fltk::Color)10);
+      o->selection_color((fltk::Color)1);
+      o->labelsize(8);
+      o->callback((fltk::Callback*)callback);
+    }
+     {fltk::ValueSlider* o = new fltk::ValueSlider(145, 381, 130, 21, "HORIZONTAL|TICK_BELOW,box");
+      o->type(fltk::ValueSlider::TICK_BELOW);
+      o->box(fltk::DOWN_BOX);
+      o->color((fltk::Color)10);
+      o->selection_color((fltk::Color)1);
+      o->labelsize(8);
+      o->callback((fltk::Callback*)callback);
+    }
+     {fltk::ValueSlider* o = new fltk::ValueSlider(145, 424, 130, 33, "HORIZONTAL|TICK_BOTH");
+      o->type(fltk::ValueSlider::TICK_BOTH);
+      o->color((fltk::Color)10);
+      o->selection_color((fltk::Color)1);
+      o->labelsize(8);
+      o->callback((fltk::Callback*)callback);
+    }
+     {fltk::Widget* o = new fltk::Widget(295, 277, 145, 136, "Fl_Roller");
+      o->box(fltk::ENGRAVED_BOX);
+      o->labelfont(fltk::HELVETICA_BOLD);
+      o->color((fltk::Color)49);
+      o->align(fltk::ALIGN_TOP|fltk::ALIGN_CENTER);
+    }
+     {fltk::ThumbWheel* o = new fltk::ThumbWheel(305, 340, 90, 20, "HORIZONTAL");
+      o->color((fltk::Color)0xe6e7e600);
+      o->selection_color((fltk::Color)1);
+      o->labelsize(8);
+      o->callback((fltk::Callback*)callback);
+    }
+     {fltk::ThumbWheel* o = new fltk::ThumbWheel(405, 299, 20, 103, "VERTICAL");
+      o->set_vertical();
+      o->color((fltk::Color)0xe6e7e600);
+      o->selection_color((fltk::Color)1);
+      o->labelsize(8);
+      o->callback((fltk::Callback*)callback);
+    }
+     {fltk::Group* o = new fltk::Group(445, 141, 110, 272, "Fl_Dial");
+      o->set_vertical();
+      o->box(fltk::ENGRAVED_BOX);
+      o->labelfont(fltk::HELVETICA_BOLD);
+      o->align(fltk::ALIGN_TOP|fltk::ALIGN_CENTER);
+      o->begin();
+       {fltk::Dial* o = new fltk::Dial(23, 24, 63, 65, "NORMAL");
+        o->set_vertical();
+        o->color((fltk::Color)10);
+        o->selection_color((fltk::Color)1);
+        o->labelsize(8);
+        o->value(0.5);
+        o->callback((fltk::Callback*)callback);
+        o->angles(0,315);
+      }
+       {fltk::Dial* o = new fltk::Dial(23, 104, 63, 65, "LINE");
+        o->type(fltk::Dial::LINE);
+        o->set_vertical();
+        o->color((fltk::Color)10);
+        o->selection_color((fltk::Color)1);
+        o->labelsize(8);
+        o->value(0.5);
+        o->callback((fltk::Callback*)callback);
+      }
+       {fltk::Dial* o = new fltk::Dial(23, 184, 63, 65, "FILL");
+        o->type(fltk::Dial::FILL);
+        o->set_vertical();
+        o->color((fltk::Color)10);
+        o->selection_color((fltk::Color)1);
+        o->labelsize(8);
+        o->value(0.75);
+        o->callback((fltk::Callback*)callback);
+        o->angles(0,360);
+      }
+      o->end();
+    }
+     {fltk::Widget* o = new fltk::Widget(295, 419, 260, 60, "All widgets have color(green) and selection_color(red) to show the areas thes\
+e colors affect.");
+      o->box(fltk::ENGRAVED_BOX);
+      o->labelsize(10);
+      o->align(fltk::ALIGN_WRAP);
+    }
+    o->end();
+    o->resizable(o);
+  }
+  w->show(argc, argv);
+  return  fltk::run();
+}

Added: branches/branch-3.0/test2/valuators.fl
===================================================================
--- branches/branch-3.0/test2/valuators.fl	                        (rev 0)
+++ branches/branch-3.0/test2/valuators.fl	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,189 @@
+# data file for the FLTK User Interface Designer (FLUID)
+version 2.0100 
+images_dir ./ 
+header_name {.h} 
+code_name {.cxx} 
+gridx 5 
+gridy 5 
+snap 3
+Function {callback(fltk::Widget* o, void*)} {open private return_type void
+} {
+  code {printf("%g     \\r", ((fltk::Valuator*)o)->value());
+fflush(stdout);} {}
+} 
+
+Function {} {open
+} {
+  {fltk::Window} {} {
+    label {Valuator classes, showing values for the type()} open
+    xywh {182 371 565 490} resizable labelsize 10
+    extra_code {\#include <stdio.h>} visible
+  } {
+    {fltk::Widget} {} {
+      label Fl_Slider
+      xywh {10 10 280 235} align 17 box ENGRAVED_BOX labelfont 1 color 49
+    }
+    {fltk::Slider} {} {
+      label VERTICAL
+      callback callback
+      xywh {25 49 20 157} align 1 color 10 selection_color 1 labelsize 8
+    }
+    {fltk::Slider} {} {
+      label {VERTICAL|TICK_LEFT}
+      callback callback
+      xywh {60 70 20 158} type TICK_ABOVE color 10 selection_color 1 labelsize 8
+    }
+    {fltk::Slider} {} {
+      label {VERTICAL|TICK_RIGHT}
+      callback callback
+      xywh {100 49 20 157} type TICK_BELOW align 1 color 10 selection_color 1 labelsize 8
+    }
+    {fltk::Slider} {} {
+      label HORIZONTAL
+      callback callback
+      xywh {140 54 130 16} color 10 selection_color 1 labelsize 8
+    }
+    {fltk::Slider} {} {
+      label {HORIZONTAL|TICK_ABOVE}
+      callback callback selected
+      xywh {140 81 130 22} type TICK_ABOVE color 10 selection_color 1 labelsize 8
+    }
+    {fltk::Slider} {} {
+      label {HORIZONTAL|TICK_ABOVE,box}
+      callback callback
+      xywh {140 119 130 22} type TICK_ABOVE box DOWN_BOX color 10 selection_color 1 labelsize 8
+    }
+    {fltk::Slider} {} {
+      label {HORIZONTAL|TICK_BELOW}
+      callback callback
+      xywh {140 157 130 22} type TICK_BELOW color 10 selection_color 1 labelsize 8
+    }
+    {fltk::Slider} {} {
+      label {HORIZONTAL|TICK_BOTH}
+      callback callback
+      xywh {140 201 130 22} type TICK_BOTH color 10 selection_color 1 labelsize 8
+    }
+    {fltk::Widget} {} {
+      label Fl_Value_Input
+      xywh {295 10 260 126} align 17 box ENGRAVED_BOX labelfont 1 color 49
+    }
+    {fltk::ValueInput} {} {
+      label {outside label}
+      callback callback
+      xywh {360 35 180 22} color 10 selection_color 1 labelsize 8
+    }
+    {fltk::ValueInput} {} {
+      label inside
+      callback callback
+      xywh {310 63 100 22} align 20 color 10 selection_color 1 labelsize 8
+    }
+    {fltk::ValueInput} {} {
+      label x
+      callback callback
+      xywh {410 63 65 22} align 20 color 10 selection_color 1 maximum 100 step 0.1
+    }
+    {fltk::ValueInput} {} {
+      label y
+      callback callback
+      xywh {475 63 65 22} align 20 color 10 selection_color 1 maximum 100 step 0.1
+    }
+    {fltk::ValueInput} {} {
+      label larger
+      callback callback
+      xywh {360 93 180 32} color 10 selection_color 1
+    }
+    {fltk::Widget} {} {
+      label Fl_Value_Slider
+      xywh {10 250 280 229} align 17 box ENGRAVED_BOX labelfont 1 color 49
+    }
+    {fltk::Widget} {} {
+      label {   Fl_Scrollbar}
+      xywh {295 141 145 131} align 21 box ENGRAVED_BOX labelfont 1 color 49
+    }
+    {fltk::Scrollbar} {} {
+      label HORIZONTAL
+      callback callback
+      xywh {300 240 105 20} color 10 selection_color 1 labelsize 8 maximum 100
+    }
+    {fltk::Scrollbar} {} {
+      label VERTICAL
+      callback callback
+      xywh {405 145 20 115} color 10 selection_color 1 labelsize 8 minimum 100 maximum 0
+    }
+    {fltk::ValueSlider} {} {
+      label VERTICAL
+      callback callback
+      xywh {25 277 30 158} align 1 color 10 selection_color 1 labelsize 8 textsize 10
+    }
+    {fltk::ValueSlider} {} {
+      label {VERTICAL|TICK_LEFT}
+      callback callback
+      xywh {65 310 30 152} type TICK_ABOVE color 10 selection_color 1 labelsize 8 textsize 10
+    }
+    {fltk::ValueSlider} {} {
+      label {VERTICAL|TICK_LEFT,box}
+      callback callback
+      xywh {105 283 35 158} type TICK_ABOVE align 1 box DOWN_BOX color 10 selection_color 1 labelsize 8 textsize 10
+    }
+    {fltk::ValueSlider} {} {
+      label HORIZONTAL
+      callback callback
+      xywh {145 294 130 21} color 10 selection_color 1 labelsize 8
+    }
+    {fltk::ValueSlider} {} {
+      label {HORIZONTAL|TICK_BELOW}
+      callback callback
+      xywh {145 337 130 22} type TICK_BELOW color 10 selection_color 1 labelsize 8
+    }
+    {fltk::ValueSlider} {} {
+      label {HORIZONTAL|TICK_BELOW,box}
+      callback callback
+      xywh {145 381 130 21} type TICK_BELOW box DOWN_BOX color 10 selection_color 1 labelsize 8
+    }
+    {fltk::ValueSlider} {} {
+      label {HORIZONTAL|TICK_BOTH}
+      callback callback
+      xywh {145 424 130 33} type TICK_BOTH color 10 selection_color 1 labelsize 8
+    }
+    {fltk::Widget} {} {
+      label Fl_Roller
+      xywh {295 277 145 136} align 17 box ENGRAVED_BOX labelfont 1 color 49
+    }
+    {fltk::ThumbWheel} {} {
+      label HORIZONTAL
+      callback callback
+      xywh {305 340 90 20} color 0xe6e7e600 selection_color 1 labelsize 8
+    }
+    {fltk::ThumbWheel} {} {
+      label VERTICAL
+      callback callback
+      xywh {405 299 20 103} color 0xe6e7e600 selection_color 1 labelsize 8
+    }
+    {fltk::Group} {} {
+      label Fl_Dial open
+      xywh {445 141 110 272} align 17 box ENGRAVED_BOX labelfont 1
+    } {
+      {fltk::Dial} {} {
+        label NORMAL
+        callback callback
+        xywh {23 24 63 65} color 10 selection_color 1 labelsize 8 value 0.5
+        extra_code {o->angles(0,315);}
+      }
+      {fltk::Dial} {} {
+        label LINE
+        callback callback
+        xywh {23 104 63 65} type LINE color 10 selection_color 1 labelsize 8 value 0.5
+      }
+      {fltk::Dial} {} {
+        label FILL
+        callback callback
+        xywh {23 184 63 65} type FILL color 10 selection_color 1 labelsize 8 value 0.75
+        extra_code {o->angles(0,360);}
+      }
+    }
+    {fltk::Widget} {} {
+      label {All widgets have color(green) and selection_color(red) to show the areas these colors affect.}
+      xywh {295 419 260 60} align 128 box ENGRAVED_BOX labelsize 10
+    }
+  }
+} 

Added: branches/branch-3.0/test2/valuators.h
===================================================================
--- branches/branch-3.0/test2/valuators.h	                        (rev 0)
+++ branches/branch-3.0/test2/valuators.h	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,21 @@
+// generated by Fast Light User Interface Designer (fluid) version 2.1000
+
+#ifndef valuators_h
+#define valuators_h
+#include <fltk/Window.h>
+#include <stdio.h>
+#include <fltk/Widget.h>
+#include <fltk/Slider.h>
+extern void callback(fltk::Slider*, void*);
+#include <fltk/ValueInput.h>
+extern void callback(fltk::ValueInput*, void*);
+#include <fltk/Scrollbar.h>
+extern void callback(fltk::Scrollbar*, void*);
+#include <fltk/ValueSlider.h>
+extern void callback(fltk::ValueSlider*, void*);
+#include <fltk/ThumbWheel.h>
+extern void callback(fltk::ThumbWheel*, void*);
+#include <fltk/Group.h>
+#include <fltk/Dial.h>
+extern void callback(fltk::Dial*, void*);
+#endif

Added: branches/branch-3.0/test2/white_1.xbm
===================================================================
--- branches/branch-3.0/test2/white_1.xbm	                        (rev 0)
+++ branches/branch-3.0/test2/white_1.xbm	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,60 @@
+#define white_1_width 56
+#define white_1_height 56
+static unsigned char white_1_bits[] = {
+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, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x01, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x02, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x01, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x01, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x02, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x02, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x02, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x05, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x02, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x05, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0x02, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x54, 0x01, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0x02, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x54, 0x01, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0xaa, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x01, 
+0x80, 0x00, 0x00, 0x00, 0x80, 0xaa, 0x00, 
+0x00, 0x01, 0x00, 0x00, 0x40, 0x55, 0x00, 
+0x00, 0x02, 0x00, 0x00, 0xa8, 0x2a, 0x00, 
+0x00, 0x14, 0x00, 0x00, 0x54, 0x15, 0x00, 
+0x00, 0x28, 0x00, 0x80, 0xaa, 0x0a, 0x00, 
+0x00, 0x50, 0x05, 0x54, 0x55, 0x05, 0x00, 
+0x00, 0xa0, 0xaa, 0xaa, 0xaa, 0x02, 0x00, 
+0x00, 0x40, 0x55, 0x55, 0x55, 0x01, 0x00, 
+0x00, 0x00, 0xaa, 0xaa, 0xaa, 0x00, 0x00, 
+0x00, 0x00, 0x50, 0x55, 0x15, 0x00, 0x00, 
+0x00, 0x00, 0x80, 0xaa, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+};

Added: branches/branch-3.0/test2/white_2.xbm
===================================================================
--- branches/branch-3.0/test2/white_2.xbm	                        (rev 0)
+++ branches/branch-3.0/test2/white_2.xbm	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,60 @@
+#define white_2_width 56
+#define white_2_height 56
+static unsigned char white_2_bits[] = {
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x40, 0x00, 0x40, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 
+0x00, 0x00, 0x04, 0x90, 0x04, 0x00, 0x00, 
+0x00, 0x20, 0x01, 0x40, 0x12, 0x00, 0x00, 
+0x00, 0x48, 0xfc, 0x0f, 0x09, 0x00, 0x00, 
+0x00, 0x10, 0x07, 0x30, 0x04, 0x00, 0x00, 
+0x40, 0xc2, 0x00, 0xc0, 0x10, 0x00, 0x00, 
+0x80, 0x24, 0x00, 0x00, 0x09, 0x00, 0x00, 
+0x20, 0x11, 0x00, 0x00, 0x42, 0x00, 0x00, 
+0x40, 0x08, 0x00, 0x00, 0x20, 0x00, 0x00, 
+0x90, 0x04, 0x00, 0x00, 0x80, 0x00, 0x00, 
+0x20, 0x02, 0x00, 0x00, 0x40, 0x04, 0x00, 
+0x48, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x10, 0x01, 0x00, 0x00, 0x80, 0x08, 0x00, 
+0x20, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x80, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 
+0x80, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 
+0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x80, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 
+0x84, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 
+0xa0, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x00, 
+0x00, 0x01, 0x00, 0x54, 0x01, 0x01, 0x00, 
+0x44, 0x01, 0x00, 0xaa, 0x00, 0x02, 0x00, 
+0x00, 0x02, 0x40, 0x55, 0x80, 0x04, 0x00, 
+0x88, 0x02, 0xa0, 0x0a, 0x00, 0x01, 0x00, 
+0x40, 0x04, 0x50, 0x05, 0x40, 0x02, 0x00, 
+0x00, 0x09, 0xa0, 0x00, 0x80, 0x00, 0x00, 
+0x80, 0x00, 0x50, 0x00, 0x20, 0x01, 0x00, 
+0x00, 0x04, 0x08, 0x00, 0x48, 0x00, 0x00, 
+0x00, 0x02, 0x00, 0x00, 0x90, 0x00, 0x00, 
+0x00, 0x08, 0x00, 0x00, 0x02, 0x00, 0x00, 
+0x00, 0x24, 0x00, 0x80, 0x04, 0x00, 0x00, 
+0x00, 0x92, 0x00, 0x20, 0x01, 0x00, 0x00, 
+0x00, 0x48, 0x02, 0x08, 0x00, 0x00, 0x00, 
+0x00, 0x20, 0x01, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x24, 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, 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, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+};

Added: branches/branch-3.0/test2/white_3.xbm
===================================================================
--- branches/branch-3.0/test2/white_3.xbm	                        (rev 0)
+++ branches/branch-3.0/test2/white_3.xbm	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,60 @@
+#define white_3_width 56
+#define white_3_height 56
+static unsigned char white_3_bits[] = {
+0x00, 0x00, 0x0c, 0x0c, 0x00, 0x00, 0x00, 
+0x00, 0x40, 0x40, 0x81, 0x00, 0x00, 0x00, 
+0x00, 0x18, 0x40, 0x09, 0x00, 0x00, 0x00, 
+0x00, 0x06, 0x52, 0x09, 0x00, 0x00, 0x00, 
+0x00, 0x91, 0x52, 0x05, 0x00, 0x00, 0x00, 
+0x80, 0x94, 0x50, 0x05, 0x00, 0x00, 0x00, 
+0x40, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x20, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x10, 0x01, 0x50, 0x05, 0x60, 0x00, 0x00, 
+0x08, 0x00, 0xaa, 0x2a, 0x00, 0x00, 0x00, 
+0x08, 0x40, 0x55, 0x55, 0x80, 0x01, 0x00, 
+0x04, 0xa0, 0xaa, 0xa0, 0x00, 0x00, 0x00, 
+0x04, 0x50, 0x55, 0x55, 0x05, 0x03, 0x00, 
+0x02, 0xa8, 0x0a, 0xa0, 0x0a, 0x00, 0x00, 
+0x02, 0x54, 0x55, 0x55, 0x15, 0x00, 0x00, 
+0x00, 0xa8, 0x00, 0x80, 0x1a, 0x03, 0x00, 
+0x00, 0x54, 0x55, 0x55, 0x35, 0x00, 0x00, 
+0x00, 0x0a, 0x00, 0x80, 0x2a, 0x06, 0x00, 
+0x0d, 0x45, 0x55, 0x55, 0x55, 0x00, 0x00, 
+0x31, 0x0a, 0x00, 0x00, 0x6a, 0x00, 0x00, 
+0x00, 0x05, 0x55, 0x55, 0x55, 0x07, 0x00, 
+0x3e, 0x02, 0x00, 0x00, 0x6a, 0x00, 0x00, 
+0x00, 0x05, 0x55, 0x55, 0x55, 0x1f, 0x00, 
+0x3e, 0x0a, 0x00, 0x00, 0x68, 0x00, 0x00, 
+0x00, 0x15, 0x54, 0x55, 0x55, 0x1f, 0x00, 
+0x38, 0x0a, 0x00, 0x00, 0x69, 0x00, 0x00, 
+0x01, 0x15, 0x54, 0x95, 0x56, 0x03, 0x00, 
+0x01, 0x2a, 0x00, 0x50, 0x69, 0x0c, 0x00, 
+0x18, 0x54, 0x50, 0xa9, 0x34, 0x00, 0x00, 
+0x00, 0x2a, 0x00, 0x55, 0x2b, 0x00, 0x00, 
+0x30, 0x54, 0x90, 0x2a, 0x15, 0x00, 0x00, 
+0x02, 0xa8, 0x40, 0xb5, 0x1a, 0x00, 0x00, 
+0x00, 0x50, 0xa1, 0x52, 0x0d, 0x00, 0x00, 
+0x30, 0xa0, 0x50, 0xab, 0x06, 0x00, 0x00, 
+0x00, 0x50, 0x29, 0x55, 0x03, 0x00, 0x00, 
+0x60, 0xa0, 0xb2, 0xaa, 0x01, 0x00, 0x00, 
+0x00, 0xc0, 0x55, 0xd5, 0x00, 0x00, 0x00, 
+0x80, 0x01, 0xab, 0x3a, 0x20, 0x00, 0x00, 
+0x00, 0x00, 0xfc, 0x0f, 0x20, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 
+0x00, 0x00, 0xa8, 0x42, 0x0a, 0x00, 0x00, 
+0x00, 0x00, 0xa8, 0x52, 0x02, 0x00, 0x00, 
+0x00, 0x00, 0xa4, 0x12, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0xa0, 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, 
+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, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+};

Added: branches/branch-3.0/test2/white_4.xbm
===================================================================
--- branches/branch-3.0/test2/white_4.xbm	                        (rev 0)
+++ branches/branch-3.0/test2/white_4.xbm	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,60 @@
+#define white_4_width 56
+#define white_4_height 56
+static unsigned char white_4_bits[] = {
+0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0x00, 
+0x00, 0x80, 0xbf, 0x7e, 0x00, 0x00, 0x00, 
+0x00, 0xe0, 0xb6, 0xf6, 0x01, 0x00, 0x00, 
+0x00, 0xb8, 0xad, 0xb6, 0x07, 0x00, 0x00, 
+0x00, 0x6e, 0xad, 0xda, 0x1e, 0x00, 0x00, 
+0x00, 0x6b, 0xab, 0x6a, 0x3b, 0x00, 0x00, 
+0x80, 0xdb, 0xfe, 0xbf, 0x6d, 0x00, 0x00, 
+0xc0, 0xb6, 0x03, 0xf0, 0xf6, 0x00, 0x00, 
+0xe0, 0xee, 0xa8, 0xca, 0x9b, 0x01, 0x00, 
+0xb0, 0x3d, 0x55, 0x15, 0xef, 0x03, 0x00, 
+0x70, 0x9b, 0xaa, 0xaa, 0x76, 0x02, 0x00, 
+0xd8, 0x4e, 0x55, 0x5f, 0xbd, 0x07, 0x00, 
+0xb8, 0xa7, 0xaa, 0xaa, 0xda, 0x04, 0x00, 
+0x6c, 0x53, 0xf5, 0x5f, 0x75, 0x0f, 0x00, 
+0xdc, 0xa9, 0xaa, 0xaa, 0xaa, 0x0b, 0x00, 
+0xb6, 0x55, 0xff, 0x7f, 0xe5, 0x1c, 0x00, 
+0xee, 0xaa, 0xaa, 0xaa, 0x4a, 0x17, 0x00, 
+0xde, 0xf4, 0xff, 0x7f, 0xd5, 0x19, 0x00, 
+0x72, 0xba, 0xaa, 0xaa, 0xaa, 0x1e, 0x00, 
+0x4e, 0xf5, 0xff, 0xff, 0x95, 0x17, 0x00, 
+0x7f, 0xfa, 0xaa, 0xaa, 0xaa, 0x38, 0x00, 
+0x41, 0xfd, 0xff, 0xff, 0x95, 0x3f, 0x00, 
+0x7f, 0xfa, 0xaa, 0xaa, 0xaa, 0x20, 0x00, 
+0x41, 0xf5, 0xff, 0xff, 0x97, 0x3f, 0x00, 
+0x7f, 0xea, 0xab, 0xaa, 0xaa, 0x20, 0x00, 
+0x47, 0xf5, 0xff, 0xff, 0x94, 0x3f, 0x00, 
+0x7a, 0xea, 0xab, 0x2a, 0xa8, 0x1c, 0x00, 
+0x5e, 0xd5, 0xff, 0x0f, 0x94, 0x13, 0x00, 
+0xe6, 0xaa, 0xaf, 0x02, 0xca, 0x1e, 0x00, 
+0xba, 0xd4, 0xff, 0x00, 0xd4, 0x1d, 0x00, 
+0xce, 0xa9, 0x2f, 0x80, 0x6a, 0x1b, 0x00, 
+0x74, 0x55, 0x1f, 0x40, 0xe5, 0x0e, 0x00, 
+0xbc, 0xab, 0x0e, 0xa8, 0xb2, 0x0d, 0x00, 
+0xc8, 0x56, 0x0f, 0x54, 0x79, 0x07, 0x00, 
+0x78, 0xaf, 0x86, 0xaa, 0xdc, 0x06, 0x00, 
+0x90, 0x5b, 0x45, 0x55, 0xb6, 0x03, 0x00, 
+0xf0, 0x3d, 0xaa, 0x2a, 0x6f, 0x03, 0x00, 
+0x60, 0xf6, 0x54, 0xc5, 0xdd, 0x01, 0x00, 
+0xc0, 0xdb, 0x03, 0x70, 0xdb, 0x00, 0x00, 
+0x80, 0x6d, 0xff, 0xdf, 0x76, 0x00, 0x00, 
+0x00, 0xb7, 0x55, 0xb5, 0x35, 0x00, 0x00, 
+0x00, 0xde, 0x56, 0xad, 0x1d, 0x00, 0x00, 
+0x00, 0x78, 0x5b, 0x6d, 0x07, 0x00, 0x00, 
+0x00, 0xe0, 0x5b, 0xdb, 0x01, 0x00, 0x00, 
+0x00, 0x80, 0x5f, 0x7f, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0xf0, 0x03, 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, 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, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+};

Added: branches/branch-3.0/test2/whiteking_1.xbm
===================================================================
--- branches/branch-3.0/test2/whiteking_1.xbm	                        (rev 0)
+++ branches/branch-3.0/test2/whiteking_1.xbm	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,60 @@
+#define whiteking_1_width 56
+#define whiteking_1_height 56
+static unsigned char whiteking_1_bits[] = {
+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, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x01, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x02, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x0a, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x15, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0a, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x15, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x2a, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x55, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x2a, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x55, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x2a, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x55, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0xaa, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x55, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0xaa, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x55, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0xaa, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x55, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0xaa, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x54, 0x55, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0xaa, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x54, 0x55, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0xaa, 0xaa, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 
+0x80, 0x00, 0x00, 0x00, 0x80, 0xaa, 0x2a, 
+0x00, 0x01, 0x00, 0x00, 0x40, 0x55, 0x55, 
+0x00, 0x02, 0x00, 0x00, 0xa8, 0xaa, 0x2a, 
+0x00, 0x14, 0x00, 0x00, 0x54, 0x55, 0x15, 
+0x00, 0x28, 0x00, 0x80, 0xaa, 0xaa, 0x2a, 
+0x00, 0x50, 0x05, 0x54, 0x55, 0x55, 0x15, 
+0x00, 0xa0, 0xaa, 0xaa, 0xaa, 0xaa, 0x0a, 
+0x00, 0x40, 0x55, 0x55, 0x55, 0x55, 0x05, 
+0x00, 0x80, 0xaa, 0xaa, 0xaa, 0xaa, 0x02, 
+0x00, 0x00, 0x55, 0x55, 0x55, 0x55, 0x01, 
+0x00, 0x00, 0xaa, 0xaa, 0xaa, 0xaa, 0x00, 
+0x00, 0x00, 0x54, 0x55, 0x55, 0x55, 0x00, 
+0x00, 0x00, 0xa8, 0xaa, 0xaa, 0x2a, 0x00, 
+0x00, 0x00, 0x40, 0x55, 0x55, 0x15, 0x00, 
+0x00, 0x00, 0x00, 0xaa, 0xaa, 0x02, 0x00, 
+0x00, 0x00, 0x00, 0x50, 0x15, 0x00, 0x00, 
+};

Added: branches/branch-3.0/test2/whiteking_2.xbm
===================================================================
--- branches/branch-3.0/test2/whiteking_2.xbm	                        (rev 0)
+++ branches/branch-3.0/test2/whiteking_2.xbm	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,60 @@
+#define whiteking_2_width 56
+#define whiteking_2_height 56
+static unsigned char whiteking_2_bits[] = {
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x40, 0x00, 0x40, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 
+0x00, 0x00, 0x04, 0x90, 0x04, 0x00, 0x00, 
+0x00, 0x20, 0x01, 0x40, 0x12, 0x00, 0x00, 
+0x00, 0x48, 0xfc, 0x0f, 0x09, 0x00, 0x00, 
+0x00, 0x10, 0x07, 0x30, 0x04, 0x00, 0x00, 
+0x40, 0xc2, 0x00, 0xc0, 0x10, 0x00, 0x00, 
+0x80, 0x24, 0x00, 0x00, 0x09, 0x00, 0x00, 
+0x20, 0x11, 0x00, 0x00, 0x42, 0x00, 0x00, 
+0x40, 0x08, 0x80, 0x00, 0x20, 0x00, 0x00, 
+0x90, 0x04, 0xc4, 0x10, 0x80, 0x00, 0x00, 
+0x20, 0x02, 0x06, 0x18, 0x40, 0x04, 0x00, 
+0x48, 0x42, 0x00, 0x00, 0x01, 0x00, 0x00, 
+0x10, 0x61, 0x00, 0x88, 0x81, 0x08, 0x00, 
+0x20, 0x01, 0x10, 0x10, 0x00, 0x00, 0x00, 
+0x80, 0x00, 0x20, 0x08, 0x00, 0x01, 0x00, 
+0x80, 0x40, 0x40, 0x10, 0x04, 0x08, 0x00, 
+0x80, 0x80, 0x00, 0x20, 0x02, 0x00, 0x00, 
+0x80, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 
+0x80, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 
+0x80, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 
+0x80, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 
+0x80, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 
+0x84, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 
+0xa0, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 
+0x00, 0x01, 0x00, 0x80, 0x00, 0x01, 0x00, 
+0x44, 0x01, 0x00, 0x40, 0x01, 0x02, 0x00, 
+0x00, 0x02, 0xaa, 0xaa, 0x80, 0x04, 0x00, 
+0x88, 0x02, 0x54, 0x55, 0x00, 0x01, 0x00, 
+0x40, 0x04, 0xaa, 0x2a, 0x40, 0x02, 0x00, 
+0x00, 0x09, 0x54, 0x15, 0x80, 0x00, 0x00, 
+0x80, 0x00, 0x00, 0x00, 0x20, 0x01, 0x00, 
+0x00, 0x04, 0x00, 0x00, 0x48, 0x00, 0x00, 
+0x00, 0x02, 0x00, 0x00, 0x90, 0x00, 0x00, 
+0x00, 0x08, 0x00, 0x00, 0x02, 0x00, 0x00, 
+0x00, 0x24, 0x00, 0x80, 0x04, 0x00, 0x00, 
+0x00, 0x92, 0x00, 0x20, 0x01, 0x00, 0x00, 
+0x00, 0x48, 0x02, 0x08, 0x00, 0x00, 0x00, 
+0x00, 0x20, 0x01, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x24, 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, 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, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+};

Added: branches/branch-3.0/test2/whiteking_3.xbm
===================================================================
--- branches/branch-3.0/test2/whiteking_3.xbm	                        (rev 0)
+++ branches/branch-3.0/test2/whiteking_3.xbm	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,60 @@
+#define whiteking_3_width 56
+#define whiteking_3_height 56
+static unsigned char whiteking_3_bits[] = {
+0x00, 0x00, 0x0c, 0x0c, 0x00, 0x00, 0x00, 
+0x00, 0x40, 0x40, 0x81, 0x00, 0x00, 0x00, 
+0x00, 0x18, 0x40, 0x09, 0x00, 0x00, 0x00, 
+0x00, 0x06, 0x52, 0x09, 0x00, 0x00, 0x00, 
+0x00, 0x91, 0x52, 0x05, 0x00, 0x00, 0x00, 
+0x80, 0x94, 0x50, 0x05, 0x00, 0x00, 0x00, 
+0x40, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x20, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x10, 0x01, 0x50, 0x05, 0x60, 0x00, 0x00, 
+0x08, 0x00, 0xaa, 0x2a, 0x00, 0x00, 0x00, 
+0x08, 0x40, 0x55, 0x55, 0x80, 0x01, 0x00, 
+0x04, 0xa0, 0x0a, 0xaa, 0x00, 0x00, 0x00, 
+0x04, 0x50, 0x10, 0x41, 0x05, 0x03, 0x00, 
+0x02, 0xa8, 0x08, 0xa2, 0x0a, 0x00, 0x00, 
+0x02, 0x04, 0x50, 0x01, 0x14, 0x00, 0x00, 
+0x00, 0x88, 0xaa, 0x2a, 0x1a, 0x03, 0x00, 
+0x00, 0x04, 0x59, 0x11, 0x34, 0x00, 0x00, 
+0x01, 0xaa, 0xa8, 0xa8, 0x2a, 0x06, 0x00, 
+0x0d, 0x55, 0x51, 0x54, 0x55, 0x00, 0x00, 
+0x31, 0xa2, 0x28, 0x2a, 0x6a, 0x00, 0x00, 
+0x00, 0x45, 0x54, 0x15, 0x55, 0x07, 0x00, 
+0x3e, 0xa2, 0xa8, 0xaa, 0x6b, 0x00, 0x00, 
+0x00, 0x45, 0x55, 0x55, 0x55, 0x1f, 0x00, 
+0x3e, 0x8a, 0xaa, 0xaa, 0x6a, 0x00, 0x00, 
+0x00, 0x45, 0x55, 0xd5, 0x55, 0x1f, 0x00, 
+0x38, 0x8a, 0xaa, 0xaa, 0x6a, 0x00, 0x00, 
+0x01, 0x15, 0x55, 0x55, 0x55, 0x03, 0x00, 
+0x01, 0x2a, 0xaa, 0xea, 0x6a, 0x0c, 0x00, 
+0x19, 0x14, 0x54, 0x55, 0x35, 0x00, 0x00, 
+0x00, 0x2a, 0xaa, 0xaa, 0x2a, 0x00, 0x00, 
+0x30, 0x54, 0x54, 0x55, 0x15, 0x00, 0x00, 
+0x02, 0xa8, 0xaa, 0xaa, 0x1a, 0x00, 0x00, 
+0x00, 0x50, 0x55, 0xd5, 0x0d, 0x00, 0x00, 
+0x30, 0xa0, 0xaa, 0xea, 0x06, 0x00, 0x00, 
+0x00, 0x50, 0x55, 0x55, 0x03, 0x00, 0x00, 
+0x60, 0xa0, 0xaa, 0xaa, 0x01, 0x00, 0x00, 
+0x00, 0xc0, 0x55, 0xd5, 0x00, 0x00, 0x00, 
+0x80, 0x01, 0xab, 0x3a, 0x20, 0x00, 0x00, 
+0x00, 0x00, 0xfc, 0x0f, 0x20, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 
+0x00, 0x00, 0xa8, 0x42, 0x0a, 0x00, 0x00, 
+0x00, 0x00, 0xa8, 0x52, 0x02, 0x00, 0x00, 
+0x00, 0x00, 0xa4, 0x12, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0xa0, 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, 
+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, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+};

Added: branches/branch-3.0/test2/whiteking_4.xbm
===================================================================
--- branches/branch-3.0/test2/whiteking_4.xbm	                        (rev 0)
+++ branches/branch-3.0/test2/whiteking_4.xbm	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,60 @@
+#define whiteking_4_width 56
+#define whiteking_4_height 56
+static unsigned char whiteking_4_bits[] = {
+0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0x00, 
+0x00, 0x80, 0xbf, 0x7e, 0x00, 0x00, 0x00, 
+0x00, 0xe0, 0xb6, 0xf6, 0x01, 0x00, 0x00, 
+0x00, 0xb8, 0xad, 0xb6, 0x07, 0x00, 0x00, 
+0x00, 0x6e, 0xad, 0xda, 0x1e, 0x00, 0x00, 
+0x00, 0x6b, 0xab, 0x6a, 0x3b, 0x00, 0x00, 
+0x80, 0xdb, 0xfe, 0xbf, 0x6d, 0x00, 0x00, 
+0xc0, 0xb6, 0x03, 0xf0, 0xf6, 0x00, 0x00, 
+0xe0, 0xee, 0xa8, 0xca, 0x9b, 0x01, 0x00, 
+0xb0, 0x3d, 0x55, 0x15, 0xef, 0x03, 0x00, 
+0x70, 0x9b, 0xaa, 0xaa, 0x76, 0x02, 0x00, 
+0xd8, 0x4e, 0xf5, 0x55, 0xbd, 0x07, 0x00, 
+0xb8, 0xa7, 0x6f, 0xbe, 0xda, 0x04, 0x00, 
+0x6c, 0x53, 0x33, 0x4d, 0x75, 0x0f, 0x00, 
+0xdc, 0xf9, 0xa9, 0xe6, 0xab, 0x0b, 0x00, 
+0xb6, 0x35, 0x55, 0xd5, 0xe4, 0x1c, 0x00, 
+0xee, 0x9a, 0xa6, 0x66, 0x4a, 0x17, 0x00, 
+0xde, 0x54, 0x47, 0x47, 0xd5, 0x19, 0x00, 
+0x72, 0xaa, 0x8e, 0xa3, 0xaa, 0x1e, 0x00, 
+0x4e, 0x1d, 0x97, 0xc5, 0x91, 0x17, 0x00, 
+0x7f, 0x3a, 0xab, 0xca, 0xa8, 0x38, 0x00, 
+0x41, 0x5d, 0x57, 0x55, 0x90, 0x3f, 0x00, 
+0x7f, 0xba, 0xaa, 0xaa, 0xa8, 0x20, 0x00, 
+0x41, 0x75, 0x55, 0x55, 0x94, 0x3f, 0x00, 
+0x7f, 0xba, 0xaa, 0x2a, 0xa8, 0x20, 0x00, 
+0x47, 0x75, 0x55, 0x55, 0x94, 0x3f, 0x00, 
+0x7a, 0xea, 0xaa, 0x2a, 0xaa, 0x1c, 0x00, 
+0x5e, 0xd5, 0x55, 0x15, 0x94, 0x13, 0x00, 
+0xe6, 0xea, 0xab, 0x2a, 0xca, 0x1e, 0x00, 
+0xba, 0xd4, 0x55, 0x15, 0xd4, 0x1d, 0x00, 
+0xce, 0xa9, 0x01, 0x00, 0x6a, 0x1b, 0x00, 
+0x74, 0x55, 0x01, 0x00, 0xe5, 0x0e, 0x00, 
+0xbc, 0xab, 0x00, 0x00, 0xb2, 0x0d, 0x00, 
+0xc8, 0x56, 0x01, 0x00, 0x79, 0x07, 0x00, 
+0x78, 0xaf, 0xaa, 0xaa, 0xdc, 0x06, 0x00, 
+0x90, 0x5b, 0x55, 0x55, 0xb6, 0x03, 0x00, 
+0xf0, 0x3d, 0xaa, 0x2a, 0x6f, 0x03, 0x00, 
+0x60, 0xf6, 0x54, 0xc5, 0xdd, 0x01, 0x00, 
+0xc0, 0xdb, 0x03, 0x70, 0xdb, 0x00, 0x00, 
+0x80, 0x6d, 0xff, 0xdf, 0x76, 0x00, 0x00, 
+0x00, 0xb7, 0x55, 0xb5, 0x35, 0x00, 0x00, 
+0x00, 0xde, 0x56, 0xad, 0x1d, 0x00, 0x00, 
+0x00, 0x78, 0x5b, 0x6d, 0x07, 0x00, 0x00, 
+0x00, 0xe0, 0x5b, 0xdb, 0x01, 0x00, 0x00, 
+0x00, 0x80, 0x5f, 0x7f, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0xf0, 0x03, 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, 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, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+};

Added: branches/branch-3.0/test2/wizard.cxx
===================================================================
--- branches/branch-3.0/test2/wizard.cxx	                        (rev 0)
+++ branches/branch-3.0/test2/wizard.cxx	2011-05-18 13:58:16 UTC (rev 8683)
@@ -0,0 +1,79 @@
+//
+// "$Id: Wizard.cxx 4288 2005-04-16 00:13:17Z mike $"
+//
+// Wizard demo inspired from Greg Ercolano cheat page
+//
+// Copyright 1997-2005 by Easy Software Products.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+//
+
+#include <stdlib.h>
+#include <fltk/run.h>
+#include <fltk/Window.h>
+#include <fltk/Group.h>
+#include <fltk/Button.h>
+#include <fltk/WizardGroup.h>
+
+using namespace fltk;
+
+// Simple 'wizard' using fltk's new Wizard widget
+
+Window *G_win;
+WizardGroup *G_wiz;
+
+void done_cb(Widget*, void*) { G_win->hide(); }
+void back_cb(Widget*, void*) { G_wiz->prev(); }
+void next_cb(Widget*, void*) { G_wiz->next(); }
+
+const int WIDTH  = 140;
+const int HEIGHT = 180;
+
+void add_group(const char * text, Color c, bool first, bool last) {
+  Group  *g = new Group(0,0,WIDTH,HEIGHT);
+  g->begin();
+  if (!first) (new Button(20,25,WIDTH-40,25,"<< Back"))->callback(back_cb);
+  if (!last)  (new Button(20,55,WIDTH-40,25,"Next >>"))->callback(next_cb);
+  else        (new Button(20,55,WIDTH-40,25,"Finish"))->callback(done_cb);
+  Widget *out = new Widget(10,100,WIDTH-20,HEIGHT-100-10);
+  out->color(c); out->label(text);
+  g->end();
+}
+
+int main(int argc, char **argv) {
+  G_win = new Window(WIDTH,HEIGHT);
+  G_win->begin();
+  G_wiz = new WizardGroup(0,0,WIDTH, HEIGHT);
+  G_wiz->begin();
+  add_group("This is the\nFirst\npage", fltk::RED,true, false ); // Wizard: page 1
+  add_group("This is the\nSecond\npage", fltk::YELLOW, false, false); // Wizard: page 2
+  add_group("This is the\nLast\npage", fltk::GREEN, false, true); // Wizard: page 3
+  G_wiz->end();
+  G_win->end();
+  
+  G_win->show(argc, argv);
+  
+  return fltk::run();
+}
+
+//
+// End of "$Id"
+//

Direct Link to Message ]
 
     
Previous Message ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.