summaryrefslogtreecommitdiff
path: root/third_party/windows/fltk-1.1.10/test
diff options
context:
space:
mode:
authorYuval Adam <yuv.adm@gmail.com>2014-08-08 14:42:07 +0300
committerYuval Adam <yuv.adm@gmail.com>2014-08-08 14:42:07 +0300
commita6163888f3c56123b1db313743c6147ba498732c (patch)
treeff7d15d991d1d09ba6cbc0cec80924f57445bfdd /third_party/windows/fltk-1.1.10/test
parentc3e4c9a25c2910d2d66d52215b3406b13d5b23d5 (diff)
Add third_party libs
Diffstat (limited to 'third_party/windows/fltk-1.1.10/test')
-rw-r--r--third_party/windows/fltk-1.1.10/test/CMakeLists.txt96
-rw-r--r--third_party/windows/fltk-1.1.10/test/CubeMain.cxx49
-rw-r--r--third_party/windows/fltk-1.1.10/test/CubeView.cxx173
-rw-r--r--third_party/windows/fltk-1.1.10/test/CubeView.h124
-rw-r--r--third_party/windows/fltk-1.1.10/test/CubeViewUI.fl75
-rw-r--r--third_party/windows/fltk-1.1.10/test/Makefile485
-rw-r--r--third_party/windows/fltk-1.1.10/test/README30
-rw-r--r--third_party/windows/fltk-1.1.10/test/adjuster.cxx66
-rw-r--r--third_party/windows/fltk-1.1.10/test/arc.cxx99
-rw-r--r--third_party/windows/fltk-1.1.10/test/ask.cxx80
-rw-r--r--third_party/windows/fltk-1.1.10/test/bitmap.cxx147
-rw-r--r--third_party/windows/fltk-1.1.10/test/blocks.app/Contents/Info.plist44
-rw-r--r--third_party/windows/fltk-1.1.10/test/blocks.app/Contents/PkgInfo1
-rw-r--r--third_party/windows/fltk-1.1.10/test/blocks.app/Contents/Resources/blocks.icnsbin0 -> 51273 bytes
-rw-r--r--third_party/windows/fltk-1.1.10/test/blocks.cxx1019
-rw-r--r--third_party/windows/fltk-1.1.10/test/boxtype.cxx128
-rw-r--r--third_party/windows/fltk-1.1.10/test/browser.cxx182
-rw-r--r--third_party/windows/fltk-1.1.10/test/button.cxx68
-rw-r--r--third_party/windows/fltk-1.1.10/test/buttons.cxx55
-rw-r--r--third_party/windows/fltk-1.1.10/test/checkers.app/Contents/Info.plist44
-rw-r--r--third_party/windows/fltk-1.1.10/test/checkers.app/Contents/PkgInfo1
-rw-r--r--third_party/windows/fltk-1.1.10/test/checkers.app/Contents/Resources/checkers.icnsbin0 -> 61470 bytes
-rw-r--r--third_party/windows/fltk-1.1.10/test/checkers.cxx1361
-rw-r--r--third_party/windows/fltk-1.1.10/test/clock.cxx53
-rw-r--r--third_party/windows/fltk-1.1.10/test/colbrowser.cxx330
-rw-r--r--third_party/windows/fltk-1.1.10/test/color_chooser.cxx152
-rw-r--r--third_party/windows/fltk-1.1.10/test/connect.cxx77
-rw-r--r--third_party/windows/fltk-1.1.10/test/cube.cxx199
-rw-r--r--third_party/windows/fltk-1.1.10/test/cursor.cxx165
-rw-r--r--third_party/windows/fltk-1.1.10/test/curve.cxx115
-rw-r--r--third_party/windows/fltk-1.1.10/test/demo.cxx378
-rw-r--r--third_party/windows/fltk-1.1.10/test/demo.menu89
-rw-r--r--third_party/windows/fltk-1.1.10/test/desktop/blocks-128.pngbin0 -> 16233 bytes
-rw-r--r--third_party/windows/fltk-1.1.10/test/desktop/blocks-32.pngbin0 -> 1856 bytes
-rw-r--r--third_party/windows/fltk-1.1.10/test/desktop/blocks.desktop9
-rw-r--r--third_party/windows/fltk-1.1.10/test/desktop/checkers-128.pngbin0 -> 23655 bytes
-rw-r--r--third_party/windows/fltk-1.1.10/test/desktop/checkers-32.pngbin0 -> 1871 bytes
-rw-r--r--third_party/windows/fltk-1.1.10/test/desktop/checkers.desktop9
-rw-r--r--third_party/windows/fltk-1.1.10/test/desktop/sudoku-128.pngbin0 -> 6514 bytes
-rw-r--r--third_party/windows/fltk-1.1.10/test/desktop/sudoku-32.pngbin0 -> 295 bytes
-rw-r--r--third_party/windows/fltk-1.1.10/test/desktop/sudoku.desktop9
-rw-r--r--third_party/windows/fltk-1.1.10/test/doublebuffer.cxx128
-rw-r--r--third_party/windows/fltk-1.1.10/test/editor.cxx795
-rw-r--r--third_party/windows/fltk-1.1.10/test/fast_slow.fl40
-rw-r--r--third_party/windows/fltk-1.1.10/test/file_chooser.cxx345
-rw-r--r--third_party/windows/fltk-1.1.10/test/fl_jpeg_image.cxx203
-rw-r--r--third_party/windows/fltk-1.1.10/test/fonts.cxx183
-rw-r--r--third_party/windows/fltk-1.1.10/test/forms.cxx237
-rw-r--r--third_party/windows/fltk-1.1.10/test/fractals.cxx842
-rw-r--r--third_party/windows/fltk-1.1.10/test/fracviewer.cxx506
-rw-r--r--third_party/windows/fltk-1.1.10/test/fracviewer.h105
-rw-r--r--third_party/windows/fltk-1.1.10/test/fromdos.c65
-rw-r--r--third_party/windows/fltk-1.1.10/test/fullscreen.cxx251
-rw-r--r--third_party/windows/fltk-1.1.10/test/gl_overlay.cxx157
-rw-r--r--third_party/windows/fltk-1.1.10/test/glpuzzle.cxx1486
-rw-r--r--third_party/windows/fltk-1.1.10/test/hello.cxx47
-rw-r--r--third_party/windows/fltk-1.1.10/test/help.cxx69
-rw-r--r--third_party/windows/fltk-1.1.10/test/iconize.cxx83
-rw-r--r--third_party/windows/fltk-1.1.10/test/image.cxx161
-rw-r--r--third_party/windows/fltk-1.1.10/test/inactive.fl120
-rw-r--r--third_party/windows/fltk-1.1.10/test/input.cxx142
-rw-r--r--third_party/windows/fltk-1.1.10/test/input_choice.cxx68
-rw-r--r--third_party/windows/fltk-1.1.10/test/keyboard.cxx158
-rw-r--r--third_party/windows/fltk-1.1.10/test/keyboard.h46
-rw-r--r--third_party/windows/fltk-1.1.10/test/keyboard_ui.fl722
-rw-r--r--third_party/windows/fltk-1.1.10/test/label.cxx162
-rw-r--r--third_party/windows/fltk-1.1.10/test/line_style.cxx154
-rw-r--r--third_party/windows/fltk-1.1.10/test/list_visuals.cxx241
-rw-r--r--third_party/windows/fltk-1.1.10/test/makedepend388
-rw-r--r--third_party/windows/fltk-1.1.10/test/makefile.wat289
-rw-r--r--third_party/windows/fltk-1.1.10/test/mandelbrot.cxx203
-rw-r--r--third_party/windows/fltk-1.1.10/test/mandelbrot.h74
-rw-r--r--third_party/windows/fltk-1.1.10/test/mandelbrot_ui.fl71
-rw-r--r--third_party/windows/fltk-1.1.10/test/menubar.cxx247
-rw-r--r--third_party/windows/fltk-1.1.10/test/message.cxx70
-rw-r--r--third_party/windows/fltk-1.1.10/test/minimum.cxx80
-rw-r--r--third_party/windows/fltk-1.1.10/test/navigation.cxx72
-rw-r--r--third_party/windows/fltk-1.1.10/test/output.cxx105
-rw-r--r--third_party/windows/fltk-1.1.10/test/overlay.cxx86
-rw-r--r--third_party/windows/fltk-1.1.10/test/pack.cxx120
-rw-r--r--third_party/windows/fltk-1.1.10/test/pixmap.cxx102
-rw-r--r--third_party/windows/fltk-1.1.10/test/pixmap_browser.cxx123
-rw-r--r--third_party/windows/fltk-1.1.10/test/pixmaps/black_1.xbm60
-rw-r--r--third_party/windows/fltk-1.1.10/test/pixmaps/black_2.xbm60
-rw-r--r--third_party/windows/fltk-1.1.10/test/pixmaps/black_3.xbm60
-rw-r--r--third_party/windows/fltk-1.1.10/test/pixmaps/black_4.xbm60
-rw-r--r--third_party/windows/fltk-1.1.10/test/pixmaps/blackking_1.xbm60
-rw-r--r--third_party/windows/fltk-1.1.10/test/pixmaps/blackking_2.xbm60
-rw-r--r--third_party/windows/fltk-1.1.10/test/pixmaps/blackking_3.xbm60
-rw-r--r--third_party/windows/fltk-1.1.10/test/pixmaps/blackking_4.xbm60
-rw-r--r--third_party/windows/fltk-1.1.10/test/pixmaps/blast.xpm67
-rw-r--r--third_party/windows/fltk-1.1.10/test/pixmaps/block.xcf.gzbin0 -> 2919 bytes
-rw-r--r--third_party/windows/fltk-1.1.10/test/pixmaps/blue.xpm67
-rw-r--r--third_party/windows/fltk-1.1.10/test/pixmaps/blue_bomb.xpm67
-rw-r--r--third_party/windows/fltk-1.1.10/test/pixmaps/cyan.xpm67
-rw-r--r--third_party/windows/fltk-1.1.10/test/pixmaps/cyan_bomb.xpm67
-rw-r--r--third_party/windows/fltk-1.1.10/test/pixmaps/gray.xpm67
-rw-r--r--third_party/windows/fltk-1.1.10/test/pixmaps/gray_bomb.xpm67
-rw-r--r--third_party/windows/fltk-1.1.10/test/pixmaps/green.xpm67
-rw-r--r--third_party/windows/fltk-1.1.10/test/pixmaps/green_bomb.xpm67
-rw-r--r--third_party/windows/fltk-1.1.10/test/pixmaps/magenta.xpm67
-rw-r--r--third_party/windows/fltk-1.1.10/test/pixmaps/magenta_bomb.xpm67
-rw-r--r--third_party/windows/fltk-1.1.10/test/pixmaps/porsche.xpm71
-rw-r--r--third_party/windows/fltk-1.1.10/test/pixmaps/porsche1.xpm76
-rw-r--r--third_party/windows/fltk-1.1.10/test/pixmaps/red.xpm67
-rw-r--r--third_party/windows/fltk-1.1.10/test/pixmaps/red_bomb.xpm67
-rw-r--r--third_party/windows/fltk-1.1.10/test/pixmaps/srs.xbm67
-rw-r--r--third_party/windows/fltk-1.1.10/test/pixmaps/sudoku.xbm14
-rw-r--r--third_party/windows/fltk-1.1.10/test/pixmaps/tile.xpm120
-rw-r--r--third_party/windows/fltk-1.1.10/test/pixmaps/white_1.xbm60
-rw-r--r--third_party/windows/fltk-1.1.10/test/pixmaps/white_2.xbm60
-rw-r--r--third_party/windows/fltk-1.1.10/test/pixmaps/white_3.xbm60
-rw-r--r--third_party/windows/fltk-1.1.10/test/pixmaps/white_4.xbm60
-rw-r--r--third_party/windows/fltk-1.1.10/test/pixmaps/whiteking_1.xbm60
-rw-r--r--third_party/windows/fltk-1.1.10/test/pixmaps/whiteking_2.xbm60
-rw-r--r--third_party/windows/fltk-1.1.10/test/pixmaps/whiteking_3.xbm60
-rw-r--r--third_party/windows/fltk-1.1.10/test/pixmaps/whiteking_4.xbm60
-rw-r--r--third_party/windows/fltk-1.1.10/test/pixmaps/yellow.xpm67
-rw-r--r--third_party/windows/fltk-1.1.10/test/pixmaps/yellow_bomb.xpm67
-rw-r--r--third_party/windows/fltk-1.1.10/test/preferences.fl324
-rw-r--r--third_party/windows/fltk-1.1.10/test/radio.fl74
-rw-r--r--third_party/windows/fltk-1.1.10/test/resize.fl54
-rw-r--r--third_party/windows/fltk-1.1.10/test/resizebox.cxx102
-rw-r--r--third_party/windows/fltk-1.1.10/test/rgb.txt753
-rw-r--r--third_party/windows/fltk-1.1.10/test/scroll.cxx144
-rw-r--r--third_party/windows/fltk-1.1.10/test/shape.cxx117
-rw-r--r--third_party/windows/fltk-1.1.10/test/subwindow.cxx191
-rw-r--r--third_party/windows/fltk-1.1.10/test/sudoku.app/Contents/Info.plist44
-rw-r--r--third_party/windows/fltk-1.1.10/test/sudoku.app/Contents/PkgInfo1
-rw-r--r--third_party/windows/fltk-1.1.10/test/sudoku.app/Contents/Resources/sudoku.icnsbin0 -> 34933 bytes
-rw-r--r--third_party/windows/fltk-1.1.10/test/sudoku.cxx1335
-rw-r--r--third_party/windows/fltk-1.1.10/test/sudoku.icobin0 -> 766 bytes
-rw-r--r--third_party/windows/fltk-1.1.10/test/sudoku.rc72
-rw-r--r--third_party/windows/fltk-1.1.10/test/sudokurc.h16
-rw-r--r--third_party/windows/fltk-1.1.10/test/symbols.cxx159
-rw-r--r--third_party/windows/fltk-1.1.10/test/tabs.fl289
-rw-r--r--third_party/windows/fltk-1.1.10/test/threads.cxx173
-rw-r--r--third_party/windows/fltk-1.1.10/test/threads.h81
-rw-r--r--third_party/windows/fltk-1.1.10/test/tile.cxx92
-rw-r--r--third_party/windows/fltk-1.1.10/test/tiled_image.cxx105
-rw-r--r--third_party/windows/fltk-1.1.10/test/trackball.c324
-rw-r--r--third_party/windows/fltk-1.1.10/test/trackball.h78
-rw-r--r--third_party/windows/fltk-1.1.10/test/unittests.cxx299
-rw-r--r--third_party/windows/fltk-1.1.10/test/valuators.fl198
144 files changed, 22796 insertions, 0 deletions
diff --git a/third_party/windows/fltk-1.1.10/test/CMakeLists.txt b/third_party/windows/fltk-1.1.10/test/CMakeLists.txt
new file mode 100644
index 0000000..3762c0b
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/CMakeLists.txt
@@ -0,0 +1,96 @@
+MACRO(CREATE_EXAMPLE NAME SOURCES LIBRARIES)
+ SET(srcs)
+ FOREACH(src ${SOURCES})
+ IF("${src}" MATCHES ".fl$")
+ GET_FILENAME_COMPONENT(fname ${src} NAME_WE)
+ SET(fluid_name "${CMAKE_CURRENT_SOURCE_DIR}/${fname}.fl")
+ SET(cxx_name "${CMAKE_CURRENT_BINARY_DIR}/${fname}.cxx")
+ SET(h_name "${CMAKE_CURRENT_BINARY_DIR}/${fname}.cxx")
+ SET(srcs ${srcs} "${cxx_name}")
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${cxx_name}
+ DEPENDS "${fluid_name}" "${FLUID_COMMAND}"
+ COMMAND ${FLUID_COMMAND}
+ ARGS -c ${fluid_name})
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${h_name}
+ DEPENDS "${fluid_name}" "${FLUID_COMMAND}"
+ COMMAND ${FLUID_COMMAND}
+ ARGS -c ${fluid_name})
+ ELSE("${src}" MATCHES ".fl$")
+ SET(srcs ${srcs} ${src})
+ ENDIF("${src}" MATCHES ".fl$")
+ ENDFOREACH(src)
+ ADD_EXECUTABLE(${NAME} ${srcs})
+ TARGET_LINK_LIBRARIES(${NAME} ${LIBRARIES})
+ENDMACRO(CREATE_EXAMPLE)
+
+INCLUDE_DIRECTORIES(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_BINARY_DIR}
+ )
+
+CREATE_EXAMPLE(adjuster adjuster.cxx fltk)
+CREATE_EXAMPLE(arc arc.cxx fltk)
+CREATE_EXAMPLE(ask ask.cxx fltk)
+CREATE_EXAMPLE(bitmap bitmap.cxx fltk)
+CREATE_EXAMPLE(boxtype boxtype.cxx fltk)
+CREATE_EXAMPLE(browser browser.cxx fltk)
+CREATE_EXAMPLE(button button.cxx fltk)
+CREATE_EXAMPLE(buttons buttons.cxx fltk)
+CREATE_EXAMPLE(checkers checkers.cxx fltk)
+CREATE_EXAMPLE(clock clock.cxx fltk)
+CREATE_EXAMPLE(colbrowser colbrowser.cxx "fltk;fltk_forms")
+CREATE_EXAMPLE(color_chooser color_chooser.cxx fltk)
+CREATE_EXAMPLE(cursor cursor.cxx fltk)
+CREATE_EXAMPLE(curve curve.cxx fltk)
+CREATE_EXAMPLE(demo demo.cxx "fltk;fltk_forms")
+CREATE_EXAMPLE(doublebuffer doublebuffer.cxx fltk)
+CREATE_EXAMPLE(editor editor.cxx fltk)
+CREATE_EXAMPLE(fast_slow fast_slow.fl fltk)
+CREATE_EXAMPLE(file_chooser file_chooser.cxx "fltk;fltk_images")
+CREATE_EXAMPLE(fonts fonts.cxx fltk)
+CREATE_EXAMPLE(forms forms.cxx "fltk;fltk_forms")
+CREATE_EXAMPLE(hello hello.cxx fltk)
+CREATE_EXAMPLE(help help.cxx "fltk;fltk_images")
+CREATE_EXAMPLE(iconize iconize.cxx fltk)
+CREATE_EXAMPLE(image image.cxx fltk)
+CREATE_EXAMPLE(inactive inactive.fl fltk)
+CREATE_EXAMPLE(input input.cxx fltk)
+CREATE_EXAMPLE(keyboard "keyboard.cxx;keyboard_ui.fl" fltk)
+CREATE_EXAMPLE(label label.cxx "fltk;fltk_forms")
+CREATE_EXAMPLE(line_style line_style.cxx fltk)
+CREATE_EXAMPLE(list_visuals list_visuals.cxx fltk)
+CREATE_EXAMPLE(mandelbrot "mandelbrot_ui.fl;mandelbrot.cxx" fltk)
+CREATE_EXAMPLE(menubar menubar.cxx fltk)
+CREATE_EXAMPLE(message message.cxx fltk)
+CREATE_EXAMPLE(minimum minimum.cxx fltk)
+CREATE_EXAMPLE(navigation navigation.cxx fltk)
+CREATE_EXAMPLE(output output.cxx "fltk;fltk_forms")
+CREATE_EXAMPLE(overlay overlay.cxx fltk)
+CREATE_EXAMPLE(pack pack.cxx fltk)
+CREATE_EXAMPLE(pixmap pixmap.cxx fltk)
+CREATE_EXAMPLE(pixmap_browser pixmap_browser.cxx "fltk;fltk_images")
+CREATE_EXAMPLE(preferences preferences.fl fltk)
+CREATE_EXAMPLE(radio radio.fl fltk)
+CREATE_EXAMPLE(resize resize.fl fltk)
+CREATE_EXAMPLE(resizebox resizebox.cxx fltk)
+CREATE_EXAMPLE(scroll scroll.cxx fltk)
+CREATE_EXAMPLE(subwindow subwindow.cxx fltk)
+CREATE_EXAMPLE(symbols symbols.cxx fltk)
+CREATE_EXAMPLE(tabs tabs.fl fltk)
+CREATE_EXAMPLE(threads threads.cxx fltk)
+CREATE_EXAMPLE(tile tile.cxx fltk)
+CREATE_EXAMPLE(tiled_image tiled_image.cxx fltk)
+CREATE_EXAMPLE(valuators valuators.fl fltk)
+
+# OpenGL demos...
+IF(OPENGL_FOUND)
+CREATE_EXAMPLE(CubeView "CubeMain.cxx;CubeView.cxx;CubeViewUI.fl" "fltk;fltk_gl")
+CREATE_EXAMPLE(cube cube.cxx "fltk;fltk_gl;${OPENGL_LIBRARIES}")
+CREATE_EXAMPLE(fractals "fractals.cxx;fracviewer.cxx" "fltk;fltk_gl")
+CREATE_EXAMPLE(fullscreen fullscreen.cxx "fltk;fltk_gl")
+CREATE_EXAMPLE(glpuzzle glpuzzle.cxx "fltk;fltk_gl;${OPENGL_LIBRARIES}")
+CREATE_EXAMPLE(gl_overlay gl_overlay.cxx "fltk;fltk_gl;${OPENGL_LIBRARIES}")
+CREATE_EXAMPLE(shape shape.cxx "fltk;fltk_gl;${OPENGL_LIBRARIES}")
+ENDIF(OPENGL_FOUND)
diff --git a/third_party/windows/fltk-1.1.10/test/CubeMain.cxx b/third_party/windows/fltk-1.1.10/test/CubeMain.cxx
new file mode 100644
index 0000000..050a0ea
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/CubeMain.cxx
@@ -0,0 +1,49 @@
+//
+// "$Id: CubeMain.cxx 5519 2006-10-11 03:12:15Z mike $"
+//
+// CubeView class definitions for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2005 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 <FL/Fl.H>
+#include "CubeViewUI.h"
+
+int
+main(int argc, char **argv) {
+
+ CubeViewUI *cvui=new CubeViewUI;
+
+//Initial global objects.
+
+ Fl::visual(FL_DOUBLE|FL_INDEX);
+
+ cvui->show(argc, argv);
+
+ return Fl::run();
+}
+
+
+//
+// End of "$Id: CubeMain.cxx 5519 2006-10-11 03:12:15Z mike $".
+//
diff --git a/third_party/windows/fltk-1.1.10/test/CubeView.cxx b/third_party/windows/fltk-1.1.10/test/CubeView.cxx
new file mode 100644
index 0000000..f4243db
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/CubeView.cxx
@@ -0,0 +1,173 @@
+//
+// "$Id: CubeView.cxx 5519 2006-10-11 03:12:15Z mike $"
+//
+// CubeView class implementation for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2005 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)
+ : Fl_Gl_Window(x,y,w,h,l)
+#else
+CubeView::CubeView(int x,int y,int w,int h,const char *l)
+ : Fl_Box(x,y,w,h,l)
+#endif /* HAVE_GL */
+{
+ vAng = 0.0;
+ hAng=0.0;
+ size=10.0;
+ xshift=0.0;
+ yshift=0.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(FL_ALIGN_WRAP | FL_ALIGN_INSIDE);
+#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();
+}//drawCube
+
+void CubeView::draw() {
+ if (!valid()) {
+ glLoadIdentity();
+ glViewport(0,0,w(),h());
+ glOrtho(-10,10,-10,10,-20050,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 5519 2006-10-11 03:12:15Z mike $".
+//
diff --git a/third_party/windows/fltk-1.1.10/test/CubeView.h b/third_party/windows/fltk-1.1.10/test/CubeView.h
new file mode 100644
index 0000000..977edc8
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/CubeView.h
@@ -0,0 +1,124 @@
+//
+// "$Id: CubeView.h 5519 2006-10-11 03:12:15Z mike $"
+//
+// CubeView class definitions for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2005 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 <FL/Fl.H>
+#if HAVE_GL
+# include <FL/Fl_Gl_Window.H>
+# include <FL/gl.h>
+#else
+# include <FL/Fl_Box.H>
+#endif /* HAVE_GL */
+
+#include <stdlib.h>
+
+#if HAVE_GL
+class CubeView : public Fl_Gl_Window {
+#else
+class CubeView : public Fl_Box {
+#endif /* HAVE_GL */
+
+public:
+ // this value determines the scaling factor used to draw the cube.
+ double size;
+
+ 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 and the
+ * initialize button 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 and the
+ * initialize button 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 and the
+ * initialize button in CubeViewUI.
+ */
+ void pany(float y){yshift=y;};
+
+#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 */
+
+ 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 5519 2006-10-11 03:12:15Z mike $".
+//
diff --git a/third_party/windows/fltk-1.1.10/test/CubeViewUI.fl b/third_party/windows/fltk-1.1.10/test/CubeViewUI.fl
new file mode 100644
index 0000000..34de8a8
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/CubeViewUI.fl
@@ -0,0 +1,75 @@
+# data file for the Fltk User Interface Designer (fluid)
+version 1.0108
+header_name {.h}
+code_name {.cxx}
+class CubeViewUI {open
+} {
+ Function {CubeViewUI()} {open
+ } {
+ Fl_Window mainWindow {
+ label CubeView open
+ private xywh {428 124 415 405} type Double box UP_BOX labelsize 12 resizable visible
+ } {
+ Fl_Group {} {open
+ xywh {5 3 374 399}
+ } {
+ Fl_Group VChange {open
+ xywh {5 100 37 192}
+ } {
+ Fl_Roller vrot {
+ label {V Rot}
+ callback {cube->v_angle(((Fl_Roller *)o)->value());
+cube->redraw();}
+ xywh {5 100 17 186} labeltype NO_LABEL labelsize 12 align 128 minimum -180 maximum 180 step 1
+ code0 {\#include <stdio.h>}
+ }
+ Fl_Slider ypan {
+ label {V Pan}
+ callback {cube->pany(((Fl_Slider *)o)->value());
+cube->redraw();}
+ xywh {25 100 17 186} type {Vert Knob} selection_color 136 labeltype NO_LABEL labelsize 12 align 0 minimum -25 maximum 25 step 0.1
+ }
+ }
+ Fl_Group HChange {open
+ xywh {120 362 190 40}
+ } {
+ Fl_Slider xpan {
+ label {H Pan}
+ callback {cube->panx(((Fl_Slider *)o)->value());
+cube->redraw();}
+ xywh {122 364 186 17} type {Horz Knob} selection_color 136 labeltype NO_LABEL labelsize 12 align 16 minimum 25 maximum -25 step 0.1
+ }
+ Fl_Roller hrot {
+ label {H Rotation}
+ callback {cube->h_angle(((Fl_Roller *)o)->value());
+cube->redraw();}
+ xywh {122 383 186 17} type Horizontal labeltype NO_LABEL labelsize 12 align 8 minimum -180 maximum 180 step 1
+ }
+ }
+ Fl_Group MainView {open
+ xywh {46 27 333 333} resizable
+ } {
+ Fl_Box cframe {
+ xywh {46 27 333 333} box DOWN_FRAME color 4 selection_color 69
+ }
+ Fl_Box cube {
+ label {This is the cube_view} selected
+ xywh {48 29 329 329} align 16 resizable
+ code0 {\#include "CubeView.h"}
+ class CubeView
+ }
+ }
+ Fl_Value_Slider zoom {
+ label Zoom
+ callback {cube->size=((Fl_Value_Slider *)o)->value();
+cube->redraw();}
+ xywh {106 3 227 19} type {Horz Knob} selection_color 136 labelfont 1 labelsize 12 align 4 minimum 1 maximum 50 step 0.1 value 10 textfont 1
+ }
+ }
+ }
+ }
+ Function {show(int argc, char **argv)} {open
+ } {
+ code {mainWindow->show(argc, argv);} {}
+ }
+}
diff --git a/third_party/windows/fltk-1.1.10/test/Makefile b/third_party/windows/fltk-1.1.10/test/Makefile
new file mode 100644
index 0000000..48f305e
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/Makefile
@@ -0,0 +1,485 @@
+#
+# "$Id: Makefile 6612 2008-12-29 20:21:29Z matt $"
+#
+# Test/example program makefile for the Fast Light Tool Kit (FLTK).
+#
+# Copyright 1998-2007 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 ../makeinclude
+
+CPPFILES =\
+ unittests.cxx \
+ adjuster.cxx \
+ arc.cxx \
+ ask.cxx \
+ bitmap.cxx \
+ blocks.cxx \
+ boxtype.cxx \
+ browser.cxx \
+ button.cxx \
+ buttons.cxx \
+ checkers.cxx \
+ clock.cxx \
+ colbrowser.cxx \
+ color_chooser.cxx \
+ cube.cxx \
+ CubeMain.cxx \
+ CubeView.cxx \
+ cursor.cxx \
+ curve.cxx \
+ demo.cxx \
+ doublebuffer.cxx \
+ editor.cxx \
+ fast_slow.cxx \
+ file_chooser.cxx \
+ fonts.cxx \
+ forms.cxx \
+ fractals.cxx \
+ fullscreen.cxx \
+ gl_overlay.cxx \
+ glpuzzle.cxx \
+ hello.cxx \
+ help.cxx \
+ iconize.cxx \
+ image.cxx \
+ inactive.cxx \
+ input.cxx \
+ input_choice.cxx \
+ keyboard.cxx \
+ label.cxx \
+ line_style.cxx \
+ list_visuals.cxx \
+ mandelbrot.cxx \
+ menubar.cxx \
+ message.cxx \
+ minimum.cxx \
+ navigation.cxx \
+ output.cxx \
+ overlay.cxx \
+ pack.cxx \
+ pixmap_browser.cxx \
+ pixmap.cxx \
+ preferences.cxx \
+ radio.cxx \
+ resizebox.cxx \
+ resize.cxx \
+ scroll.cxx \
+ shape.cxx \
+ subwindow.cxx \
+ sudoku.cxx \
+ symbols.cxx \
+ tabs.cxx \
+ threads.cxx \
+ tile.cxx \
+ tiled_image.cxx \
+ valuators.cxx
+
+ALL = \
+ unittests$(EXEEXT) \
+ adjuster$(EXEEXT) \
+ arc$(EXEEXT) \
+ ask$(EXEEXT) \
+ bitmap$(EXEEXT) \
+ blocks$(EXEEXT) \
+ boxtype$(EXEEXT) \
+ browser$(EXEEXT) \
+ button$(EXEEXT) \
+ buttons$(EXEEXT) \
+ checkers$(EXEEXT) \
+ clock$(EXEEXT) \
+ colbrowser$(EXEEXT) \
+ color_chooser$(EXEEXT) \
+ cursor$(EXEEXT) \
+ curve$(EXEEXT) \
+ demo$(EXEEXT) \
+ doublebuffer$(EXEEXT) \
+ editor$(EXEEXT) \
+ fast_slow$(EXEEXT) \
+ file_chooser$(EXEEXT) \
+ fonts$(EXEEXT) \
+ forms$(EXEEXT) \
+ hello$(EXEEXT) \
+ help$(EXEEXT) \
+ iconize$(EXEEXT) \
+ image$(EXEEXT) \
+ inactive$(EXEEXT) \
+ input$(EXEEXT) \
+ input_choice$(EXEEXT) \
+ keyboard$(EXEEXT) \
+ label$(EXEEXT) \
+ line_style$(EXEEXT) \
+ list_visuals$(EXEEXT) \
+ mandelbrot$(EXEEXT) \
+ menubar$(EXEEXT) \
+ message$(EXEEXT) \
+ minimum$(EXEEXT) \
+ navigation$(EXEEXT) \
+ output$(EXEEXT) \
+ overlay$(EXEEXT) \
+ pack$(EXEEXT) \
+ pixmap$(EXEEXT) \
+ pixmap_browser$(EXEEXT) \
+ preferences$(EXEEXT) \
+ radio$(EXEEXT) \
+ resize$(EXEEXT) \
+ resizebox$(EXEEXT) \
+ scroll$(EXEEXT) \
+ subwindow$(EXEEXT) \
+ sudoku$(EXEEXT) \
+ symbols$(EXEEXT) \
+ tabs$(EXEEXT) \
+ $(THREADS) \
+ tile$(EXEEXT) \
+ tiled_image$(EXEEXT) \
+ valuators$(EXEEXT)
+
+GLALL = \
+ cube$(EXEEXT) \
+ CubeView$(EXEEXT) \
+ fractals$(EXEEXT) \
+ fullscreen$(EXEEXT) \
+ gl_overlay$(EXEEXT) \
+ glpuzzle$(EXEEXT) \
+ shape$(EXEEXT)
+
+all: $(ALL) $(GLDEMOS)
+
+gldemos: $(GLALL)
+
+depend: $(CPPFILES)
+ makedepend -Y -I.. -f makedepend $(CPPFILES)
+
+# Automatically generated dependencies...
+include makedepend
+
+clean:
+ $(RM) $(ALL) $(GLALL) core
+ $(RM) *.o core.* *~ *.bck *.bak
+ $(RM) CubeViewUI.cxx
+ $(RM) fast_slow.cxx
+ $(RM) inactive.cxx
+ $(RM) keyboard_ui.cxx
+ $(RM) mandelbrot_ui.cxx
+ $(RM) preferences.cxx
+ $(RM) radio.cxx
+ $(RM) resize.cxx
+ $(RM) tabs.cxx
+ $(RM) valuators.cxx
+ $(OSX_ONLY) $(RM) blocks.app/Contents/MacOS/blocks$(EXEEXT)
+ $(OSX_ONLY) $(RM) checkers.app/Contents/MacOS/checkers$(EXEEXT)
+ $(OSX_ONLY) $(RM) sudoku.app/Contents/MacOS/sudoku$(EXEEXT)
+
+install: all
+ echo "Installing example programs to $(DESTDIR)$(docdir)/examples..."
+ -$(INSTALL_DIR) $(DESTDIR)$(docdir)/examples
+ for file in *.h *.cxx *.fl demo.menu; do \
+ $(INSTALL_DATA) $$file $(DESTDIR)$(docdir)/examples; \
+ done
+ -$(INSTALL_DIR) $(DESTDIR)$(docdir)/examples/pixmaps
+ for file in pixmaps/*.xbm pixmaps/*.xpm; do \
+ $(INSTALL_DATA) $$file $(DESTDIR)$(docdir)/examples/pixmaps; \
+ done
+
+install-linux:
+ echo Installing games to $(DESTDIR)$(bindir)...
+ -$(INSTALL_DIR) $(DESTDIR)$(bindir)
+ -$(INSTALL_DIR) $(DESTDIR)/usr/share/applications
+ -$(INSTALL_DIR) $(DESTDIR)/usr/share/icons/hicolor/32x32/apps
+ -$(INSTALL_DIR) $(DESTDIR)/usr/share/icons/hicolor/128x128/apps
+ for game in blocks checkers sudoku; do \
+ $(INSTALL_BIN) $$game $(DESTDIR)$(bindir); \
+ $(INSTALL_DATA) desktop/$$game.desktop $(DESTDIR)/usr/share/applications; \
+ $(INSTALL_DATA) desktop/$$game-32.png $(DESTDIR)/usr/share/icons/hicolor/32x32/apps/$$game.png; \
+ $(INSTALL_DATA) desktop/$$game-128.png $(DESTDIR)/usr/share/icons/hicolor/128x128/apps/$$game.png; \
+ done
+
+install-osx:
+ echo Installing games in $(DESTDIR)/Applications...
+ for game in blocks checkers sudoku; do \
+ if test ! -d $(DESTDIR)/Applications/$$game.app; then \
+ $(INSTALL_DIR) $(DESTDIR)/Applications/$$game.app; \
+ $(INSTALL_DIR) $(DESTDIR)/Applications/$$game.app/Contents; \
+ $(INSTALL_DIR) $(DESTDIR)/Applications/$$game.app/Contents/MacOS; \
+ $(INSTALL_DIR) $(DESTDIR)/Applications/$$game.app/Contents/Resources; \
+ fi; \
+ $(INSTALL_DATA) $$game.app/Contents/Info.plist $(DESTDIR)/Applications/$$game.app/Contents; \
+ $(INSTALL_DATA) $$game.app/Contents/PkgInfo $(DESTDIR)/Applications/$$game.app/Contents; \
+ $(INSTALL_BIN) $$game.app/Contents/MacOS/$$game $(DESTDIR)/Applications/$$game.app/Contents/MacOS; \
+ $(INSTALL_DATA) $$game.app/Contents/Resources/$$game.icns $(DESTDIR)/Applications/$$game.app/Contents/Resources; \
+ done
+
+uninstall:
+ echo "Removing examples programs from $(DESTDIR)$(docdir)/examples..."
+ -$(RMDIR) $(DESTDIR)$(docdir)/examples
+
+uninstall-linux:
+ echo Removing games from $(DESTDIR)$(bindir)...
+ for game in blocks checkers sudoku; do \
+ $(RM) $(DESTDIR)$(bindir)/$$game; \
+ $(RM) $(DESTDIR)/usr/share/applications/$$game.desktop; \
+ $(RM) $(DESTDIR)/usr/share/icons/hicolor/32x32/apps/$$game.png; \
+ $(RM) $(DESTDIR)/usr/share/icons/hicolor/128x128/apps/$$game.png; \
+ done
+
+uninstall-osx:
+ echo Removing games from $(DESTDIR)/Applications...
+ $(RMDIR) $(DESTDIR)/Applications/blocks.app
+ $(RMDIR) $(DESTDIR)/Applications/checkers.app
+ $(RMDIR) $(DESTDIR)/Applications/sudoku.app
+
+# FLUID file rules
+.fl.cxx .fl.h: ../fluid/fluid$(EXEEXT)
+ echo Generating $@ and header from $<...
+ ../fluid/fluid$(EXEEXT) -c $<
+
+# All demos depend on the FLTK library...
+$(ALL): $(LIBNAME)
+
+# General demos...
+unittests$(EXEEXT): unittests.o
+
+adjuster$(EXEEXT): adjuster.o
+
+arc$(EXEEXT): arc.o
+
+ask$(EXEEXT): ask.o
+
+bitmap$(EXEEXT): bitmap.o
+
+boxtype$(EXEEXT): boxtype.o
+
+browser$(EXEEXT): browser.o
+
+button$(EXEEXT): button.o
+
+buttons$(EXEEXT): buttons.o
+
+blocks$(EXEEXT): blocks.o
+ echo Linking $@...
+ $(CXX) $(ARCHFLAGS) $(LDFLAGS) blocks.o -o $@ $(AUDIOLIBS) $(LINKFLTK) $(LDLIBS)
+ $(OSX_ONLY) $(INSTALL_BIN) blocks$(EXEEXT) blocks.app/Contents/MacOS
+ $(POSTBUILD) $@ ../FL/mac.r
+
+checkers$(EXEEXT): checkers.o
+ echo Linking $@...
+ $(CXX) $(ARCHFLAGS) $(LDFLAGS) checkers.o -o $@ $(LINKFLTK) $(LDLIBS)
+ $(OSX_ONLY) $(INSTALL_BIN) checkers$(EXEEXT) checkers.app/Contents/MacOS
+ $(POSTBUILD) $@ ../FL/mac.r
+
+clock$(EXEEXT): clock.o
+
+colbrowser$(EXEEXT): colbrowser.o
+ echo Linking $@...
+ $(CXX) $(ARCHFLAGS) $(LDFLAGS) -o $@ colbrowser.o $(LINKFLTKFORMS) $(LDLIBS)
+ $(POSTBUILD) $@ ../FL/mac.r
+
+color_chooser$(EXEEXT): color_chooser.o
+
+cursor$(EXEEXT): cursor.o
+
+curve$(EXEEXT): curve.o
+
+demo$(EXEEXT): demo.o
+ echo Linking $@...
+ $(CXX) $(ARCHFLAGS) $(LDFLAGS) -o $@ demo.o $(LINKFLTKFORMS) $(LDLIBS)
+ $(POSTBUILD) $@ ../FL/mac.r
+
+doublebuffer$(EXEEXT): doublebuffer.o
+
+editor$(EXEEXT): editor.o
+ echo Linking $@...
+ $(CXX) $(ARCHFLAGS) $(LDFLAGS) editor.o -o $@ $(LINKFLTKIMG) $(LDLIBS)
+ $(POSTBUILD) $@ ../FL/mac.r
+
+fast_slow$(EXEEXT): fast_slow.o
+fast_slow.cxx: fast_slow.fl ../fluid/fluid$(EXEEXT)
+
+file_chooser$(EXEEXT): file_chooser.o $(IMGLIBNAME)
+ echo Linking $@...
+ $(CXX) $(ARCHFLAGS) $(LDFLAGS) file_chooser.o -o $@ $(LINKFLTKIMG) $(LDLIBS)
+ $(POSTBUILD) $@ ../FL/mac.r
+
+fonts$(EXEEXT): fonts.o
+
+forms$(EXEEXT): forms.o
+ echo Linking $@...
+ $(CXX) $(ARCHFLAGS) $(LDFLAGS) -o $@ forms.o $(LINKFLTKFORMS) $(LDLIBS)
+ $(POSTBUILD) $@ ../FL/mac.r
+
+hello$(EXEEXT): hello.o
+
+help$(EXEEXT): help.o $(IMGLIBNAME)
+ echo Linking $@...
+ $(CXX) $(ARCHFLAGS) $(LDFLAGS) help.o -o $@ $(LINKFLTKIMG) $(LDLIBS)
+ $(POSTBUILD) $@ ../FL/mac.r
+
+iconize$(EXEEXT): iconize.o
+
+image$(EXEEXT): image.o
+
+inactive$(EXEEXT): inactive.o
+inactive.cxx: inactive.fl ../fluid/fluid$(EXEEXT)
+
+input$(EXEEXT): input.o
+
+input_choice$(EXEEXT): input_choice.o
+
+keyboard$(EXEEXT): keyboard_ui.o keyboard.o
+ echo Linking $@...
+ $(CXX) $(ARCHFLAGS) $(LDFLAGS) -o $@ keyboard.o keyboard_ui.o $(LINKFLTK) $(LDLIBS)
+ $(POSTBUILD) $@ ../FL/mac.r
+keyboard_ui.o: keyboard_ui.h
+keyboard_ui.cxx: keyboard_ui.fl ../fluid/fluid$(EXEEXT)
+
+label$(EXEEXT): label.o
+ echo Linking $@...
+ $(CXX) $(ARCHFLAGS) $(LDFLAGS) -o $@ label.o $(LINKFLTKFORMS) $(LDLIBS)
+ $(POSTBUILD) $@ ../FL/mac.r
+
+line_style$(EXEEXT): line_style.o
+
+list_visuals$(EXEEXT): list_visuals.o
+
+mandelbrot$(EXEEXT): mandelbrot_ui.o mandelbrot.o
+ echo Linking $@...
+ $(CXX) $(ARCHFLAGS) $(LDFLAGS) -o $@ mandelbrot.o mandelbrot_ui.o $(LINKFLTK) $(LDLIBS)
+ $(POSTBUILD) $@ ../FL/mac.r
+mandelbrot_ui.o: mandelbrot_ui.h
+mandelbrot_ui.cxx: mandelbrot_ui.fl ../fluid/fluid$(EXEEXT)
+
+menubar$(EXEEXT): menubar.o
+
+message$(EXEEXT): message.o
+
+minimum$(EXEEXT): minimum.o
+
+navigation$(EXEEXT): navigation.o
+
+output$(EXEEXT): output.o $(FLLIBNAME)
+ echo Linking $@...
+ $(CXX) $(ARCHFLAGS) $(LDFLAGS) -o $@ output.o $(LINKFLTKFORMS) $(LDLIBS)
+ $(POSTBUILD) $@ ../FL/mac.r
+
+overlay$(EXEEXT): overlay.o
+
+pack$(EXEEXT): pack.o
+
+pixmap$(EXEEXT): pixmap.o
+
+pixmap_browser$(EXEEXT): pixmap_browser.o $(IMGLIBNAME)
+ echo Linking $@...
+ $(CXX) $(ARCHFLAGS) $(LDFLAGS) pixmap_browser.o -o $@ $(LINKFLTKIMG) $(LDLIBS)
+ $(POSTBUILD) $@ ../FL/mac.r
+
+preferences$(EXEEXT): preferences.o
+preferences.cxx: preferences.fl ../fluid/fluid$(EXEEXT)
+
+radio$(EXEEXT): radio.o
+radio.cxx: radio.fl ../fluid/fluid$(EXEEXT)
+
+resize$(EXEEXT): resize.o
+resize.cxx: resize.fl ../fluid/fluid$(EXEEXT)
+
+resizebox$(EXEEXT): resizebox.o
+
+scroll$(EXEEXT): scroll.o
+
+subwindow$(EXEEXT): subwindow.o
+
+sudoku: sudoku.o
+ echo Linking $@...
+ $(CXX) $(ARCHFLAGS) $(LDFLAGS) sudoku.o -o $@ $(AUDIOLIBS) $(LINKFLTKIMG) $(LDLIBS)
+ $(OSX_ONLY) $(INSTALL_BIN) sudoku$(EXEEXT) sudoku.app/Contents/MacOS
+ $(POSTBUILD) $@ ../FL/mac.r
+
+sudoku.exe: sudoku.o sudoku.rc
+ echo Linking $@...
+ windres sudoku.rc sudokures.o
+ $(CXX) $(ARCHFLAGS) $(LDFLAGS) sudoku.o sudokures.o -o $@ $(AUDIOLIBS) $(LINKFLTKIMG) $(LDLIBS)
+
+symbols$(EXEEXT): symbols.o
+
+tabs$(EXEEXT): tabs.o
+tabs.cxx: tabs.fl ../fluid/fluid$(EXEEXT)
+
+threads$(EXEEXT): threads.o
+# This ensures that we have this dependency even if threads are not
+# enabled in the current tree...
+threads.o: threads.h
+
+tile$(EXEEXT): tile.o
+
+tiled_image$(EXEEXT): tiled_image.o
+
+valuators$(EXEEXT): valuators.o
+valuators.cxx: valuators.fl ../fluid/fluid$(EXEEXT)
+
+# All OpenGL demos depend on the FLTK and FLTK_GL libraries...
+$(GLALL): $(LIBNAME) $(GLLIBNAME)
+
+# OpenGL demos...
+CubeView$(EXEEXT): CubeMain.o CubeView.o CubeViewUI.o
+ echo Linking $@...
+ $(CXX) $(ARCHFLAGS) $(LDFLAGS) -o $@ \
+ CubeMain.o CubeView.o CubeViewUI.o \
+ $(LINKFLTKGL) $(LINKFLTK) $(GLDLIBS)
+ $(POSTBUILD) $@ ../FL/mac.r
+CubeMain.o: CubeViewUI.h CubeView.h CubeViewUI.cxx
+CubeView.o: CubeView.h
+CubeViewUI.o: CubeViewUI.cxx CubeViewUI.h
+CubeViewUI.cxx: CubeViewUI.fl ../fluid/fluid$(EXEEXT)
+
+cube$(EXEEXT): cube.o
+ echo Linking $@...
+ $(CXX) $(ARCHFLAGS) $(LDFLAGS) -o $@ cube.o $(LINKFLTKGL) $(LINKFLTK) $(GLDLIBS)
+ $(POSTBUILD) $@ ../FL/mac.r
+
+fractals$(EXEEXT): fractals.o fracviewer.o
+ echo Linking $@...
+ $(CXX) $(ARCHFLAGS) $(LDFLAGS) -o $@ fractals.o fracviewer.o $(LINKFLTKGL) $(LINKFLTK) $(GLDLIBS)
+ $(POSTBUILD) $@ ../FL/mac.r
+
+fullscreen$(EXEEXT): fullscreen.o
+ echo Linking $@...
+ $(CXX) $(ARCHFLAGS) $(LDFLAGS) -o $@ fullscreen.o $(LINKFLTKGL) $(LINKFLTK) $(GLDLIBS)
+ $(POSTBUILD) $@ ../FL/mac.r
+
+glpuzzle$(EXEEXT): glpuzzle.o
+ echo Linking $@...
+ $(CXX) $(ARCHFLAGS) $(LDFLAGS) -o $@ glpuzzle.o $(LINKFLTKGL) $(LINKFLTK) $(GLDLIBS)
+ $(POSTBUILD) $@ ../FL/mac.r
+
+gl_overlay$(EXEEXT): gl_overlay.o
+ echo Linking $@...
+ $(CXX) $(ARCHFLAGS) $(LDFLAGS) -o $@ gl_overlay.o $(LINKFLTKGL) $(LINKFLTK) $(GLDLIBS)
+ $(POSTBUILD) $@ ../FL/mac.r
+
+shape$(EXEEXT): shape.o
+ echo Linking $@...
+ $(CXX) $(ARCHFLAGS) $(LDFLAGS) -o $@ shape.o $(LINKFLTKGL) $(LINKFLTK) $(GLDLIBS)
+ $(POSTBUILD) $@ ../FL/mac.r
+
+
+#
+# End of "$Id: Makefile 6612 2008-12-29 20:21:29Z matt $".
+#
diff --git a/third_party/windows/fltk-1.1.10/test/README b/third_party/windows/fltk-1.1.10/test/README
new file mode 100644
index 0000000..20a4d8e
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/README
@@ -0,0 +1,30 @@
+test/README - 20 Oct 1998
+-------------------------
+
+This directory contains tests and demos of FL. In most cases you can
+learn a lot about how to program FL 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 FL 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 FL's menus work
+
+shiny: Demo of drawing FL's controls using OpenGL
+
+forms: An XForms program to demonstrate emulation
+
+colbrowser: Another XForms program that is actually useful
diff --git a/third_party/windows/fltk-1.1.10/test/adjuster.cxx b/third_party/windows/fltk-1.1.10/test/adjuster.cxx
new file mode 100644
index 0000000..ad596f9
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/adjuster.cxx
@@ -0,0 +1,66 @@
+//
+// "$Id: adjuster.cxx 5519 2006-10-11 03:12:15Z mike $"
+//
+// Adjuster test program for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2005 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 <FL/Fl.H>
+#include <FL/Fl_Window.H>
+#include <FL/Fl_Adjuster.H>
+#include <FL/Fl_Box.H>
+
+void adjcb(Fl_Widget *o, void *v) {
+ Fl_Adjuster *a = (Fl_Adjuster*)o;
+ Fl_Box *b = (Fl_Box *)v;
+ a->format((char *)(b->label()));
+ b->redraw();
+}
+
+int main(int argc, char ** argv) {
+ Fl_Window window(320,100,argv[0]);
+
+ char buf1[100];
+ Fl_Box b1(FL_DOWN_BOX,20,30,80,25,buf1);
+ b1.color(FL_WHITE);
+ Fl_Adjuster a1(20+80,30,3*25,25);
+ a1.callback(adjcb,&b1);
+ adjcb(&a1,&b1);
+
+ char buf2[100];
+ Fl_Box b2(FL_DOWN_BOX,20+80+4*25,30,80,25,buf2);
+ b2.color(FL_WHITE);
+ Fl_Adjuster a2(b2.x()+b2.w(),10,25,3*25);
+ a2.callback(adjcb,&b2);
+ adjcb(&a2,&b2);
+
+ window.resizable(window);
+ window.end();
+ window.show(argc, argv);
+ return Fl::run();
+}
+
+//
+// End of "$Id: adjuster.cxx 5519 2006-10-11 03:12:15Z mike $".
+//
diff --git a/third_party/windows/fltk-1.1.10/test/arc.cxx b/third_party/windows/fltk-1.1.10/test/arc.cxx
new file mode 100644
index 0000000..90f48cd
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/arc.cxx
@@ -0,0 +1,99 @@
+//
+// "$Id: arc.cxx 5519 2006-10-11 03:12:15Z mike $"
+//
+// Arc drawing test program for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2005 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 <FL/Fl.H>
+#include <FL/Fl_Double_Window.H>
+#include <FL/Fl_Hor_Value_Slider.H>
+#include <FL/fl_draw.H>
+
+double args[6] = {140, 140, 50, 0, 360, 0};
+const char* name[6] = {"X", "Y", "R", "start", "end", "rotate"};
+
+class Drawing : public Fl_Widget {
+ void draw() {
+ fl_clip(x(),y(),w(),h());
+ fl_color(FL_DARK3);
+ fl_rectf(x(),y(),w(),h());
+ fl_push_matrix();
+ if (args[5]) {
+ fl_translate(x()+w()/2.0, y()+h()/2.0);
+ fl_rotate(args[5]);
+ fl_translate(-(x()+w()/2.0), -(y()+h()/2.0));
+ }
+ fl_color(FL_WHITE);
+ fl_translate(x(),y());
+ fl_begin_complex_polygon();
+ fl_arc(args[0],args[1],args[2],args[3],args[4]);
+ fl_gap();
+ fl_arc(140,140,20,0,-360);
+ fl_end_complex_polygon();
+ fl_color(FL_RED);
+ fl_begin_line();
+ fl_arc(args[0],args[1],args[2],args[3],args[4]);
+ fl_end_line();
+ fl_pop_matrix();
+ fl_pop_clip();
+ }
+public:
+ Drawing(int X,int Y,int W,int H) : Fl_Widget(X,Y,W,H) {}
+};
+
+Drawing *d;
+
+void slider_cb(Fl_Widget* o, void* v) {
+ Fl_Slider* s = (Fl_Slider*)o;
+ args[long(v)] = s->value();
+ d->redraw();
+}
+
+int main(int argc, char** argv) {
+ Fl_Double_Window window(300,500);
+ Drawing drawing(10,10,280,280);
+ d = &drawing;
+
+ int y = 300;
+ for (int n = 0; n<6; n++) {
+ Fl_Slider* s = new Fl_Hor_Value_Slider(50,y,240,25,name[n]); y += 25;
+ if (n<3) {s->minimum(0); s->maximum(300);}
+ else if (n==5) {s->minimum(0); s->maximum(360);}
+ else {s->minimum(-360); s->maximum(360);}
+ s->step(1);
+ s->value(args[n]);
+ s->align(FL_ALIGN_LEFT);
+ s->callback(slider_cb, (void*)n);
+ }
+
+ window.end();
+ window.show(argc,argv);
+ return Fl::run();
+}
+
+
+//
+// End of "$Id: arc.cxx 5519 2006-10-11 03:12:15Z mike $".
+//
+
diff --git a/third_party/windows/fltk-1.1.10/test/ask.cxx b/third_party/windows/fltk-1.1.10/test/ask.cxx
new file mode 100644
index 0000000..c0d95bd
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/ask.cxx
@@ -0,0 +1,80 @@
+//
+// "$Id: ask.cxx 5671 2007-02-08 07:58:47Z matt $"
+//
+// 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-2005 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->copy_label(input);
+ o->redraw();
+ }
+}
+
+void window_callback(Fl_Widget*, void*) {
+ if (!fl_choice("Are you sure you want to quit?", "Cancel", "Quit", 0L)) 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.end();
+ 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 5671 2007-02-08 07:58:47Z matt $".
+//
diff --git a/third_party/windows/fltk-1.1.10/test/bitmap.cxx b/third_party/windows/fltk-1.1.10/test/bitmap.cxx
new file mode 100644
index 0000000..b672288
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/bitmap.cxx
@@ -0,0 +1,147 @@
+//
+// "$Id: bitmap.cxx 5519 2006-10-11 03:12:15Z mike $"
+//
+// Bitmap label test program for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2005 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 <FL/Fl.H>
+#include <FL/Fl_Window.H>
+#include <FL/Fl_Button.H>
+#include <FL/Fl_Bitmap.H>
+#include <stdio.h>
+
+#define sorceress_width 75
+#define sorceress_height 75
+static uchar 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};
+
+#include <FL/Fl_Toggle_Button.H>
+
+Fl_Toggle_Button *leftb,*rightb,*topb,*bottomb,*insideb,*overb,*inactb;
+Fl_Button *b;
+Fl_Window *w;
+
+void button_cb(Fl_Widget *,void *) {
+ int i = 0;
+ if (leftb->value()) i |= FL_ALIGN_LEFT;
+ if (rightb->value()) i |= FL_ALIGN_RIGHT;
+ if (topb->value()) i |= FL_ALIGN_TOP;
+ if (bottomb->value()) i |= FL_ALIGN_BOTTOM;
+ if (insideb->value()) i |= FL_ALIGN_INSIDE;
+ if (overb->value()) i |= FL_ALIGN_TEXT_OVER_IMAGE;
+ b->align(i);
+ if (inactb->value()) b->deactivate();
+ else b->activate();
+ w->redraw();
+}
+
+int main(int argc, char **argv) {
+ w = new Fl_Window(400,400);
+ b = new Fl_Button(140,160,120,120,"Bitmap");
+ b->image(new Fl_Bitmap(sorceress_bits,sorceress_width,sorceress_height));
+ leftb = new Fl_Toggle_Button(25,50,50,25,"left");
+ leftb->callback(button_cb);
+ rightb = new Fl_Toggle_Button(75,50,50,25,"right");
+ rightb->callback(button_cb);
+ topb = new Fl_Toggle_Button(125,50,50,25,"top");
+ topb->callback(button_cb);
+ bottomb = new Fl_Toggle_Button(175,50,50,25,"bottom");
+ bottomb->callback(button_cb);
+ insideb = new Fl_Toggle_Button(225,50,50,25,"inside");
+ insideb->callback(button_cb);
+ overb = new Fl_Toggle_Button(25,75,100,25,"text over");
+ overb->callback(button_cb);
+ inactb = new Fl_Toggle_Button(125,75,100,25,"inactive");
+ inactb->callback(button_cb);
+ w->resizable(w);
+ w->end();
+ w->show(argc, argv);
+ return Fl::run();
+}
+
+//
+// End of "$Id: bitmap.cxx 5519 2006-10-11 03:12:15Z mike $".
+//
diff --git a/third_party/windows/fltk-1.1.10/test/blocks.app/Contents/Info.plist b/third_party/windows/fltk-1.1.10/test/blocks.app/Contents/Info.plist
new file mode 100644
index 0000000..2a4566a
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/blocks.app/Contents/Info.plist
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<plist version="0.9">
+ <dict>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+
+ <key>CFBundleExecutable</key>
+ <string>blocks</string>
+
+ <key>CFBundleIdentifier</key>
+ <string>com.easysw.blocks</string>
+
+ <key>CFBundleVersion</key>
+ <string>1.0</string>
+
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+
+ <key>NSHumanReadableCopyright</key>
+ <string>Copyright 2006 by Michael Sweet</string>
+
+ <key>CFAppleHelpAnchor</key>
+ <string>help</string>
+
+ <key>CFBundleName</key>
+ <string>blocks</string>
+
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+
+ <key>CFBundleSignature</key>
+ <string>BLKS</string>
+
+ <key>CFBundleIconFile</key>
+ <string>blocks.icns</string>
+
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+
+ <key>CFBundleGetInfoString</key>
+ <string>1.0, Copyright 2006 by Michael Sweet</string>
+
+ </dict>
+</plist>
diff --git a/third_party/windows/fltk-1.1.10/test/blocks.app/Contents/PkgInfo b/third_party/windows/fltk-1.1.10/test/blocks.app/Contents/PkgInfo
new file mode 100644
index 0000000..098c33c
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/blocks.app/Contents/PkgInfo
@@ -0,0 +1 @@
+BLKSBlks
diff --git a/third_party/windows/fltk-1.1.10/test/blocks.app/Contents/Resources/blocks.icns b/third_party/windows/fltk-1.1.10/test/blocks.app/Contents/Resources/blocks.icns
new file mode 100644
index 0000000..9b0f8d5
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/blocks.app/Contents/Resources/blocks.icns
Binary files differ
diff --git a/third_party/windows/fltk-1.1.10/test/blocks.cxx b/third_party/windows/fltk-1.1.10/test/blocks.cxx
new file mode 100644
index 0000000..5f7339b
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/blocks.cxx
@@ -0,0 +1,1019 @@
+//
+// "$Id: blocks.cxx 5976 2007-11-19 14:14:13Z matt $"
+//
+// "Block Attack!" scrolling blocks game using the Fast Light Tool Kit (FLTK).
+//
+// Copyright 2006 by Michael Sweet.
+//
+// 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 <FL/Fl.H>
+#include <FL/Fl_Double_Window.H>
+#include <FL/Fl_Button.H>
+#include <FL/Fl_Preferences.H>
+#include <FL/Fl_XPM_Image.H>
+#include <FL/Fl_XBM_Image.H>
+#include <FL/Fl_Tiled_Image.H>
+#include <FL/fl_draw.H>
+#include <FL/x.H>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include <math.h>
+
+// Audio headers...
+#include <config.h>
+
+#ifndef WIN32
+# include <unistd.h>
+# include <sys/time.h>
+#endif // !WIN32
+
+#ifdef HAVE_ALSA_ASOUNDLIB_H
+# define ALSA_PCM_NEW_HW_PARAMS_API
+# include <alsa/asoundlib.h>
+#endif // HAVE_ALSA_ASOUNDLIB_H
+#ifdef __APPLE__
+# include <CoreAudio/AudioHardware.h>
+#endif // __APPLE__
+#ifdef WIN32
+# include <mmsystem.h>
+#endif // WIN32
+
+
+#define BLOCK_COLS 20
+#define BLOCK_ROWS 10
+#define BLOCK_SIZE 32
+#define BLOCK_BLAST 100
+
+#include "pixmaps/blast.xpm"
+Fl_Pixmap blast_pixmap(blast_xpm);
+
+#include "pixmaps/red.xpm"
+Fl_Pixmap red_pixmap(red_xpm);
+#include "pixmaps/red_bomb.xpm"
+Fl_Pixmap red_bomb_pixmap(red_bomb_xpm);
+
+#include "pixmaps/green.xpm"
+Fl_Pixmap green_pixmap(green_xpm);
+#include "pixmaps/green_bomb.xpm"
+Fl_Pixmap green_bomb_pixmap(green_bomb_xpm);
+
+#include "pixmaps/blue.xpm"
+Fl_Pixmap blue_pixmap(blue_xpm);
+#include "pixmaps/blue_bomb.xpm"
+Fl_Pixmap blue_bomb_pixmap(blue_bomb_xpm);
+
+#include "pixmaps/yellow.xpm"
+Fl_Pixmap yellow_pixmap(yellow_xpm);
+#include "pixmaps/yellow_bomb.xpm"
+Fl_Pixmap yellow_bomb_pixmap(yellow_bomb_xpm);
+
+#include "pixmaps/cyan.xpm"
+Fl_Pixmap cyan_pixmap(cyan_xpm);
+#include "pixmaps/cyan_bomb.xpm"
+Fl_Pixmap cyan_bomb_pixmap(cyan_bomb_xpm);
+
+#include "pixmaps/magenta.xpm"
+Fl_Pixmap magenta_pixmap(magenta_xpm);
+#include "pixmaps/magenta_bomb.xpm"
+Fl_Pixmap magenta_bomb_pixmap(magenta_bomb_xpm);
+
+#include "pixmaps/gray.xpm"
+Fl_Pixmap gray_pixmap(gray_xpm);
+#include "pixmaps/gray_bomb.xpm"
+Fl_Pixmap gray_bomb_pixmap(gray_bomb_xpm);
+
+Fl_Pixmap *normal_pixmaps[] = {
+ &red_pixmap,
+ &green_pixmap,
+ &blue_pixmap,
+ &yellow_pixmap,
+ &cyan_pixmap,
+ &magenta_pixmap,
+ &gray_pixmap
+};
+Fl_Pixmap *bomb_pixmaps[] = {
+ &red_bomb_pixmap,
+ &green_bomb_pixmap,
+ &blue_bomb_pixmap,
+ &yellow_bomb_pixmap,
+ &cyan_bomb_pixmap,
+ &magenta_bomb_pixmap,
+ &gray_bomb_pixmap
+};
+
+const unsigned char screen_bits[] = {
+ 0xff, 0x55, 0xff, 0xaa, 0xff, 0x55, 0xff, 0xaa
+};
+Fl_Bitmap screen_bitmap(screen_bits, 8, 8);
+Fl_Tiled_Image screen_tile(&screen_bitmap);
+
+
+// Sound class...
+//
+// There are MANY ways to implement sound in a FLTK application.
+// The approach we are using here is to conditionally compile OS-
+// specific code into the application - CoreAudio for MacOS X, the
+// standard Win32 API stuff for Windows, ALSA or X11 for Linux, and
+// X11 for all others. We have to support ALSA on Linux because the
+// current Xorg releases no longer support XBell() or the PC speaker.
+//
+// There are several good cross-platform audio libraries we could also
+// use, such as OpenAL, PortAudio, and SDL, however they were not chosen
+// for this application because of our limited use of sound.
+//
+// Many thanks to Ian MacArthur who provided sample code that led to
+// the CoreAudio implementation you see here!
+class BlockSound {
+ // Private, OS-specific data...
+#ifdef __APPLE__
+ AudioDeviceID device;
+ AudioStreamBasicDescription format;
+ short *data;
+ int remaining;
+
+ static OSStatus audio_cb(AudioDeviceID device,
+ const AudioTimeStamp *current_time,
+ const AudioBufferList *data_in,
+ const AudioTimeStamp *time_in,
+ AudioBufferList *data_out,
+ const AudioTimeStamp *time_out,
+ void *client_data);
+#elif defined(WIN32)
+ HWAVEOUT device;
+ HGLOBAL header_handle;
+ LPWAVEHDR header_ptr;
+ HGLOBAL data_handle;
+ LPSTR data_ptr;
+
+#else
+# ifdef HAVE_ALSA_ASOUNDLIB_H
+ snd_pcm_t *handle;
+# endif // HAVE_ALSA_ASOUNDLIB_H
+#endif // __APPLE__
+
+ public:
+
+ // Common data...
+ static short *sample_data;
+ static int sample_size;
+
+ BlockSound();
+ ~BlockSound();
+
+ void play_explosion(float duration);
+};
+
+// Sound class globals...
+short *BlockSound::sample_data = NULL;
+int BlockSound::sample_size = 0;
+
+
+// Initialize the BlockSound class
+BlockSound::BlockSound() {
+ sample_size = 0;
+
+#ifdef __APPLE__
+ remaining = 0;
+
+ UInt32 size = sizeof(device);
+
+ if (AudioHardwareGetProperty(kAudioHardwarePropertyDefaultOutputDevice,
+ &size, (void *)&device) != noErr) return;
+
+ size = sizeof(format);
+ if (AudioDeviceGetProperty(device, 0, false, kAudioDevicePropertyStreamFormat,
+ &size, &format) != noErr) return;
+
+ // Set up a format we like...
+ format.mSampleRate = 44100.0; // 44.1kHz
+ format.mChannelsPerFrame = 2; // stereo
+
+ if (AudioDeviceSetProperty(device, NULL, 0, false,
+ kAudioDevicePropertyStreamFormat,
+ sizeof(format), &format) != noErr) return;
+
+ // Check we got linear pcm - what to do if we did not ???
+ if (format.mFormatID != kAudioFormatLinearPCM) return;
+
+ // Attach the callback
+ if (AudioDeviceAddIOProc(device, audio_cb, (void *)this) != noErr) return;
+
+ // Start the device...
+ AudioDeviceStart(device, audio_cb);
+
+ sample_size = (int)format.mSampleRate;
+
+#elif defined(WIN32)
+ WAVEFORMATEX format;
+
+ memset(&format, 0, sizeof(format));
+ format.cbSize = sizeof(format);
+ format.wFormatTag = WAVE_FORMAT_PCM;
+ format.nChannels = 2;
+ format.nSamplesPerSec = 44100;
+ format.nAvgBytesPerSec = 44100 * 4;
+ format.nBlockAlign = 4;
+ format.wBitsPerSample = 16;
+
+ data_handle = GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE, format.nSamplesPerSec * 4);
+ if (!data_handle) return;
+
+ data_ptr = (LPSTR)GlobalLock(data_handle);
+
+ header_handle = GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE, sizeof(WAVEHDR));
+ if (!header_handle) return;
+
+ header_ptr = (WAVEHDR *)GlobalLock(header_handle);
+
+ header_ptr->lpData = data_ptr;
+ header_ptr->dwFlags = 0;
+ header_ptr->dwLoops = 0;
+
+ if (waveOutOpen(&device, WAVE_MAPPER, &format, 0, 0, WAVE_ALLOWSYNC)
+ != MMSYSERR_NOERROR) return;
+
+ sample_size = format.nSamplesPerSec;
+
+#else
+# ifdef HAVE_ALSA_ASOUNDLIB_H
+ handle = NULL;
+
+ if (snd_pcm_open(&handle, "default", SND_PCM_STREAM_PLAYBACK, 0) >= 0) {
+ // Initialize PCM sound stuff...
+ snd_pcm_hw_params_t *params;
+
+ snd_pcm_hw_params_alloca(&params);
+ snd_pcm_hw_params_any(handle, params);
+ snd_pcm_hw_params_set_access(handle, params, SND_PCM_ACCESS_RW_INTERLEAVED);
+ snd_pcm_hw_params_set_format(handle, params, SND_PCM_FORMAT_S16);
+ snd_pcm_hw_params_set_channels(handle, params, 2);
+ unsigned rate = 44100;
+ int dir;
+ snd_pcm_hw_params_set_rate_near(handle, params, &rate, &dir);
+ snd_pcm_uframes_t period = (int)rate;
+ snd_pcm_hw_params_set_period_size_near(handle, params, &period, &dir);
+
+ sample_size = rate;
+
+ if (snd_pcm_hw_params(handle, params) < 0) {
+ sample_size = 0;
+ snd_pcm_close(handle);
+ handle = NULL;
+ }
+ }
+# endif // HAVE_ALSA_ASOUNDLIB_H
+#endif // __APPLE__
+
+ if (sample_size) {
+ // Make an explosion sound by passing white noise through a low pass
+ // filter with a decreasing frequency...
+ sample_data = new short[2 * sample_size];
+
+ short *sample_ptr = sample_data;
+ int max_sample = 2 * sample_size - 2;
+
+ *sample_ptr++ = 0;
+ *sample_ptr++ = 0;
+
+ for (int j = max_sample; j > 0; j --, sample_ptr ++) {
+ float freq = (float)j / (float)max_sample;
+ float volume = 32767.0 * (0.5 * sqrt(freq) + 0.5);
+ float sample = 0.0001 * ((rand() % 20001) - 10000);
+
+ *sample_ptr = (int)(volume * freq * sample +
+ (1.0 - freq) * sample_ptr[-2]);
+ }
+ }
+}
+
+
+// Cleanup the BlockSound class
+BlockSound::~BlockSound() {
+#ifdef __APPLE__
+ if (sample_size) {
+ AudioDeviceStop(device, audio_cb);
+ AudioDeviceRemoveIOProc(device, audio_cb);
+ }
+
+#elif defined(WIN32)
+ if (sample_size) {
+ waveOutClose(device);
+
+ GlobalUnlock(header_handle);
+ GlobalFree(header_handle);
+
+ GlobalUnlock(data_handle);
+ GlobalFree(data_handle);
+ }
+
+#else
+# ifdef HAVE_ALSA_ASOUNDLIB_H
+ if (handle) {
+ snd_pcm_drain(handle);
+ snd_pcm_close(handle);
+ }
+# endif // HAVE_ALSA_ASOUNDLIB_H
+#endif // __APPLE__
+
+ if (sample_size) {
+ delete[] sample_data;
+ }
+}
+
+
+#ifdef __APPLE__
+// Callback function for writing audio data...
+OSStatus
+BlockSound::audio_cb(AudioDeviceID device,
+ const AudioTimeStamp *current_time,
+ const AudioBufferList *data_in,
+ const AudioTimeStamp *time_in,
+ AudioBufferList *data_out,
+ const AudioTimeStamp *time_out,
+ void *client_data) {
+ BlockSound *ss = (BlockSound *)client_data;
+ int count;
+ float *buffer;
+
+ if (!ss->remaining) return noErr;
+
+ for (count = data_out->mBuffers[0].mDataByteSize / sizeof(float),
+ buffer = (float*) data_out->mBuffers[0].mData;
+ ss->remaining > 0 && count > 0;
+ count --, ss->data ++, ss->remaining --) {
+ *buffer++ = *(ss->data) / 32767.0;
+ }
+
+ while (count > 0) {
+ *buffer++ = 0.0;
+ count --;
+ }
+
+ return noErr;
+}
+#endif // __APPLE__
+
+
+// Play a note for the given amount of time...
+void
+BlockSound::play_explosion(float duration) {
+ Fl::check();
+
+ if (duration <= 0.0)
+ return;
+
+#if defined(__APPLE__) || defined(WIN32) || defined(HAVE_ALSA_ASOUNDLIB_H)
+ if (duration > 1.0)
+ duration = 1.0;
+
+ int samples = (int)(duration * sample_size);
+ short *sample_ptr = sample_data + 2 * (sample_size - samples);
+#endif // __APPLE__ || WIN32 || HAVE_ALSA_ASOUNDLIB_H
+
+#ifdef __APPLE__
+ // Point to the next note...
+ data = sample_ptr;
+ remaining = samples * 2;
+
+#elif defined(WIN32)
+ if (sample_size) {
+ memcpy(data_ptr, sample_ptr, samples * 4);
+
+ header_ptr->dwBufferLength = samples * 4;
+ waveOutPrepareHeader(device, header_ptr, sizeof(WAVEHDR));
+
+ waveOutWrite(device, header_ptr, sizeof(WAVEHDR));
+ } else Beep(440, (int)(1000.0 * duration));
+
+#elif defined(HAVE_ALSA_ASOUNDLIB_H)
+ if (handle) {
+ // Use ALSA to play the sound...
+ if (snd_pcm_writei(handle, sample_ptr, samples) < 0) {
+ snd_pcm_prepare(handle);
+ snd_pcm_writei(handle, sample_ptr, samples);
+ }
+ return;
+ }
+#endif // __APPLE__
+}
+
+
+class BlockWindow : public Fl_Double_Window
+{
+ public:
+
+ struct Block
+ {
+ int color;
+ bool bomb;
+ int y;
+ };
+
+ struct Column
+ {
+ int num_blocks;
+ Block blocks[BLOCK_ROWS];
+ int x;
+ };
+
+ private:
+
+ Fl_Button *help_button_,
+ *play_button_;
+
+ int num_columns_;
+ Column columns_[BLOCK_COLS];
+ int count_;
+ bool help_;
+ int high_score_;
+ float interval_;
+ int level_;
+ int num_colors_;
+ int opened_columns_;
+ bool paused_;
+ static Fl_Preferences prefs_;
+ int score_;
+ BlockSound *sound_;
+ char title_[255];
+ int title_y_;
+
+ void _BlockWindow();
+ int bomb(int color);
+ int click(int col, int row);
+ static void help_cb(Fl_Widget *wi, BlockWindow *bw);
+ void init();
+ static void play_cb(Fl_Widget *wi, BlockWindow *bw);
+ static void timeout_cb(BlockWindow *bw);
+
+ public:
+
+ BlockWindow(int X, int Y, int W, int H, const char *L = 0);
+ BlockWindow(int W, int H, const char *L = 0);
+ ~BlockWindow();
+
+ void draw();
+ int handle(int event);
+ void new_game();
+ int score() { return (score_); }
+ void up_level();
+};
+
+
+Fl_Preferences BlockWindow::prefs_(Fl_Preferences::USER, "fltk.org", "blocks");
+
+
+int
+main(int argc, char *argv[]) {
+ Fl::scheme("plastic");
+ Fl::visible_focus(0);
+
+ BlockWindow *bw = new BlockWindow(BLOCK_COLS * BLOCK_SIZE,
+ BLOCK_ROWS * BLOCK_SIZE + 20,
+ "Block Attack!");
+
+ bw->show(argc, argv);
+
+ return (Fl::run());
+}
+
+
+// Create a block window at the specified position
+BlockWindow::BlockWindow(int X, int Y, int W, int H, const char *L)
+ : Fl_Double_Window(X, Y, W, H, L) {
+ _BlockWindow();
+}
+
+
+// Create a block window
+BlockWindow::BlockWindow(int W, int H, const char *L)
+ : Fl_Double_Window(W, H, L) {
+ _BlockWindow();
+}
+
+
+// Delete a block window
+BlockWindow::~BlockWindow() {
+ Fl::remove_timeout((Fl_Timeout_Handler)timeout_cb, (void *)this);
+}
+
+
+// Initialize a block window...
+void
+BlockWindow::_BlockWindow() {
+ init();
+
+ help_button_ = new Fl_Button(0, 0, 20, 20, "?");
+ help_button_->callback((Fl_Callback *)help_cb, this);
+ help_button_->shortcut('?');
+
+ play_button_ = new Fl_Button(80, (h() - 80) / 2, 80, 80, "@>");
+ play_button_->callback((Fl_Callback *)play_cb, this);
+ play_button_->labelsize(44);
+ play_button_->shortcut(' ');
+
+ sound_ = new BlockSound();
+
+ prefs_.get("high_score", high_score_, 0);
+
+ Fl::add_timeout(0.1, (Fl_Timeout_Handler)timeout_cb, (void *)this);
+}
+
+
+// Bomb all blocks of a given color and return the number of affected blocks
+int
+BlockWindow::bomb(int color) {
+ int j, k;
+ int count;
+ Block *b;
+ Column *c;
+
+
+ if (color >= BLOCK_BLAST) return (0);
+
+ for (j = num_columns_, c = columns_, count = 1; j > 0; j --, c ++)
+ for (k = c->num_blocks, b = c->blocks; k > 0; k --, b ++)
+ if (b->color == color) {
+ b->color = -color;
+ count ++;
+ }
+
+ return (count);
+}
+
+
+// Tag all blocks connected to the clicked block and return the number
+// of affected blocks
+int
+BlockWindow::click(int col, int row) {
+ Block *b;
+ Column *c;
+ int count, color;
+
+
+ c = columns_ + col;
+ b = c->blocks + row;
+ color = b->color;
+
+ if (color < 0 || color >= BLOCK_BLAST) return (0);
+
+ // Find the bottom block...
+ while (row > 0 && b[-1].color == color) {
+ row --;
+ b --;
+ }
+
+ count = 0;
+
+ while (row < c->num_blocks && b->color == color) {
+ b->color = -color;
+
+ if (col > 0 && row < c[-1].num_blocks &&
+ c[-1].blocks[row].color == color) {
+ count += click(col - 1, row);
+ }
+
+ if (col < (num_columns_ - 1) && row < c[1].num_blocks &&
+ c[1].blocks[row].color == color) {
+ count += click(col + 1, row);
+ }
+
+ count ++;
+ row ++;
+ b ++;
+ }
+
+ return (count);
+}
+
+
+// Draw the block window...
+void
+BlockWindow::draw() {
+ int j, k, xx, yy;
+ Block *b;
+ Column *c;
+
+
+ // Draw the blocks...
+ fl_color(FL_BLACK);
+ fl_rectf(0, 0, w(), h());
+
+ // Draw the blocks...
+ for (j = num_columns_, c = columns_; j > 0; j --, c ++)
+ for (k = c->num_blocks, b = c->blocks; k > 0; k --, b ++) {
+ xx = w() - c->x;
+ yy = h() - BLOCK_SIZE - b->y;
+
+ if (b->color >= BLOCK_BLAST) {
+ b->color ++;
+ blast_pixmap.draw(xx, yy);
+ } else if (b->color < 0) {
+ if (b->bomb) bomb_pixmaps[-b->color - 1]->draw(xx, yy);
+ else normal_pixmaps[-b->color - 1]->draw(xx, yy);
+ } else {
+ if (b->bomb) bomb_pixmaps[b->color - 1]->draw(xx, yy);
+ else normal_pixmaps[b->color - 1]->draw(xx, yy);
+ }
+ }
+
+ if (interval_ < 0.0 || paused_) {
+ fl_color(FL_BLACK);
+ screen_tile.draw(0, 0, w(), h(), 0, 0);
+ }
+
+ // Redraw the widgets...
+ play_button_->redraw();
+ help_button_->redraw();
+ draw_children();
+
+ // Draw any paused/game over/new game message...
+ if ((paused_ || interval_ < 0.0) && play_button_->w() == 80) {
+ const char *s;
+
+ if (help_) {
+ s = "Click on adjacent blocks of the same color. Clear all blocks "
+ "before they reach the left side.";
+
+ fl_font(FL_HELVETICA_BOLD, 24);
+ fl_color(FL_BLACK);
+ fl_draw(s, 171, 3, w() - 250, h() - 6,
+ (Fl_Align)(FL_ALIGN_WRAP | FL_ALIGN_LEFT));
+
+ fl_color(FL_YELLOW);
+ fl_draw(s, 168, 0, w() - 250, h(),
+ (Fl_Align)(FL_ALIGN_WRAP | FL_ALIGN_LEFT));
+ } else {
+ if (interval_ < 0.0) {
+#ifdef DEBUG
+ // Show sample waveform...
+ short *sample_ptr;
+
+ for (i = 0; i < 2; i ++)
+ {
+ fl_color(FL_RED + i);
+ fl_begin_line();
+ for (j = 0, sample_ptr = sound_->sample_data + i;
+ j < sound_->sample_size;
+ j ++, sample_ptr += 2)
+ fl_vertex(j * w() / sound_->sample_size,
+ *sample_ptr * h() / 4 / 65534 + h() / 2);
+ fl_end_line();
+ }
+#endif // DEBUG
+
+ if (num_columns_ && (time(NULL) & 7) < 4) s = "Game Over";
+ else s = "Block Attack!\nby Michael R Sweet";
+ } else s = "Paused";
+
+ fl_font(FL_HELVETICA_BOLD, 32);
+ fl_color(FL_BLACK);
+ fl_draw(s, 6, 6, w() - 6, h() - 6, FL_ALIGN_CENTER);
+
+ fl_color(FL_YELLOW);
+ fl_draw(s, 0, 0, w(), h(), FL_ALIGN_CENTER);
+ }
+ }
+
+ // Draw the scores and level...
+ char s[255];
+
+ sprintf(s, " Score: %d", score_);
+ fl_color(FL_WHITE);
+ fl_font(FL_HELVETICA, 14);
+ fl_draw(s, 40, 0, w() - 40, 20, FL_ALIGN_LEFT);
+
+ sprintf(s, "High Score: %d ", high_score_);
+ fl_draw(s, 0, 0, w(), 20, FL_ALIGN_RIGHT);
+
+ if (level_ > 1 || title_y_ <= 0)
+ {
+ sprintf(s, "Level: %d ", level_);
+ fl_draw(s, 0, 0, w(), 20, FL_ALIGN_CENTER);
+ }
+
+ if (title_y_ > 0 && interval_ > 0.0)
+ {
+ int sz = 14 + title_y_ * 86 / h();
+
+ fl_font(FL_HELVETICA_BOLD, sz);
+ fl_color(FL_YELLOW);
+ fl_draw(title_, 0, title_y_, w(), sz, FL_ALIGN_CENTER);
+ }
+}
+
+
+// Handle mouse clicks, etc.
+int
+BlockWindow::handle(int event) {
+ int j, k, mx, my, count;
+ Block *b;
+ Column *c;
+
+
+ if (Fl_Double_Window::handle(event)) return (1);
+ else if (interval_ < 0.0 || paused_) return (0);
+
+ switch (event) {
+ case FL_KEYBOARD:
+ if (Fl::event_text()) {
+ if (strcmp(Fl::event_text(), "+") == 0)
+ up_level();
+ }
+ break;
+ case FL_PUSH :
+ mx = w() - Fl::event_x() + BLOCK_SIZE;
+ my = h() - Fl::event_y();
+ count = 0;
+ b = 0;
+
+ for (j = 0, c = columns_; !count && j < num_columns_; j ++, c ++)
+ for (k = 0, b = c->blocks; !count && k < c->num_blocks; k ++, b ++)
+ if (mx >= c->x && mx < (c->x + BLOCK_SIZE) &&
+ my >= b->y && my < (b->y + BLOCK_SIZE)) {
+ if (b->bomb) count = bomb(b->color);
+ else count = click(j, k);
+
+ break;
+ }
+
+ if (count < 2) {
+ for (j = 0, c = columns_; j < num_columns_; j ++, c ++)
+ for (k = 0, b = c->blocks; k < c->num_blocks; k ++, b ++)
+ if (b->color < 0) b->color = -b->color;
+ } else {
+ count --;
+
+ if (b->bomb) {
+ sound_->play_explosion(0.19 + 0.005 * count);
+
+ interval_ *= 0.995;
+ score_ += count;
+ } else {
+ sound_->play_explosion(0.09 + 0.005 * count);
+
+ interval_ *= 0.999;
+ score_ += count * count;
+ }
+
+ if (score_ > high_score_) {
+ high_score_ = score_;
+ prefs_.set("high_score", high_score_);
+ }
+
+ for (j = 0, c = columns_; j < num_columns_; j ++, c ++)
+ for (k = 0, b = c->blocks; k < c->num_blocks; k ++, b ++)
+ if (b->color < 0) b->color = BLOCK_BLAST;
+ }
+ return (1);
+ }
+
+ return (0);
+}
+
+
+// Toggle the on-line help...
+void
+BlockWindow::help_cb(Fl_Widget *, BlockWindow *bw) {
+ bw->paused_ = bw->help_ = !bw->help_;
+ bw->play_button_->label("@>");
+ bw->redraw();
+}
+
+
+// Initialize the block window...
+void
+BlockWindow::init() {
+ count_ = 0;
+ help_ = false;
+ interval_ = -1.0;
+ level_ = 1;
+ num_colors_ = 3;
+ num_columns_ = 0;
+ paused_ = false;
+ score_ = 0;
+ title_[0] = '\0';
+ title_y_ = 0;
+}
+
+
+// Start a new game...
+void
+BlockWindow::new_game() {
+ // Seed the random number generator...
+ srand(time(NULL));
+
+ init();
+
+ interval_ = 0.1;
+ opened_columns_ = 0;
+
+ strcpy(title_, "Level: 1");
+ title_y_ = h();
+
+ redraw();
+}
+
+
+// Play/pause...
+void
+BlockWindow::play_cb(Fl_Widget *wi, BlockWindow *bw) {
+ if (bw->interval_ < 0) bw->new_game();
+ else bw->paused_ = !bw->paused_;
+
+ if (bw->paused_) wi->label("@>");
+ else {
+ wi->label("@-2||");
+ bw->help_ = false;
+ }
+}
+
+void BlockWindow::up_level() {
+ interval_ *= 0.95;
+ opened_columns_ = 0;
+ if (num_colors_ < 7) num_colors_ ++;
+ level_ ++;
+ sprintf(title_, "Level: %d", level_);
+ title_y_ = h();
+ Fl::repeat_timeout(interval_, (Fl_Timeout_Handler)timeout_cb, (void *)this);
+}
+
+// Animate the game...
+void
+BlockWindow::timeout_cb(BlockWindow *bw) {
+ int i, j;
+ Block *b;
+ Column *c;
+ int lastx, lasty;
+
+
+#ifdef DEBUG
+ struct timeval curtime;
+ static struct timeval lasttime;
+
+
+ gettimeofday(&curtime, NULL);
+ printf("%.3f (%+f - %f)\n",
+ curtime.tv_sec + 0.000001 * curtime.tv_usec,
+ curtime.tv_sec - lasttime.tv_sec +
+ 0.000001 * (curtime.tv_usec - lasttime.tv_usec), bw->interval_);
+ lasttime = curtime;
+#endif // DEBUG
+
+ // Update blocks that have been destroyed...
+ for (i = 0, c = bw->columns_; i < bw->num_columns_; i ++, c ++)
+ for (j = 0, b = c->blocks; j < c->num_blocks; j ++, b ++)
+ if (b->color > (BLOCK_BLAST + 1)) {
+ bw->redraw();
+
+ c->num_blocks --;
+
+ if (j < c->num_blocks) {
+ memmove(b, b + 1, (c->num_blocks - j) * sizeof(Block));
+ }
+
+ j --;
+ b --;
+
+ if (!c->num_blocks) {
+ bw->num_columns_ --;
+
+ if (i < bw->num_columns_) {
+ memmove(c, c + 1, (bw->num_columns_ - i) * sizeof(Column));
+ }
+
+ i --;
+ c --;
+ j = c->num_blocks;
+ }
+ }
+
+ // Let the rest of the blocks fall and/or move...
+ for (i = bw->num_columns_, c = bw->columns_, lastx = c->x;
+ i > 0;
+ i --, c ++) {
+ if (c->x > lastx) {
+ c->x -= 8;
+ bw->redraw();
+ }
+
+ lastx = c->x + BLOCK_SIZE;
+
+ if (!bw->paused_ && bw->interval_ > 0.0) {
+ bw->redraw();
+ c->x ++;
+ }
+
+ for (j = c->num_blocks, b = c->blocks, lasty = 0; j > 0; j --, b ++) {
+ if (b->y > lasty) {
+ bw->redraw();
+ b->y -= 8;
+ }
+
+ lasty = b->y + BLOCK_SIZE;
+ }
+ }
+
+ // Slide the title text as needed...
+ if (bw->title_y_ > 0) {
+ bw->redraw();
+ bw->title_y_ -= 5;
+ }
+
+ // Play the game...
+ if (!bw->paused_ && bw->interval_ > 0.0) {
+ bw->count_ --;
+
+ if (bw->count_ <= 0) {
+ bw->redraw();
+ bw->count_ = BLOCK_SIZE;
+
+ if (bw->num_columns_ == BLOCK_COLS) {
+ bw->interval_ = -1.0;
+ bw->sound_->play_explosion(0.8);
+ bw->play_button_->label("@>");
+ } else {
+ bw->opened_columns_ ++;
+
+ if (bw->opened_columns_ > (2 * BLOCK_COLS)) {
+ bw->up_level();
+ }
+
+ c = bw->columns_;
+
+ if (bw->num_columns_) {
+ memmove(c + 1, c, bw->num_columns_ * sizeof(Column));
+ }
+
+ bw->num_columns_ ++;
+ c->x = 0;
+ c->num_blocks = BLOCK_ROWS;
+
+ for (j = 0, b = c->blocks; j < BLOCK_ROWS; j ++, b ++) {
+ b->bomb = bw->num_colors_ > 3 && (rand() & 127) < bw->num_colors_;
+ b->color = 1 + (rand() % bw->num_colors_);
+ b->y = j * (BLOCK_SIZE + 8) + 24;
+ }
+ }
+ }
+ }
+ else
+ {
+ bw->count_ --;
+
+ if (bw->count_ <= 0) {
+ bw->count_ = 40;
+ bw->redraw();
+ }
+ }
+
+ // Update the play/pause button as needed...
+ if ((bw->paused_ || bw->interval_< 0.0) &&
+ bw->play_button_->w() < 80) {
+ int s = bw->play_button_->w() + 10;
+
+ bw->play_button_->resize(s, (s - 20) * (bw->h() - s) / 120, s, s);
+ bw->play_button_->labelsize(s / 2 + 4);
+ bw->redraw();
+ } else if ((!bw->paused_ && bw->interval_ > 0.0) &&
+ bw->play_button_->w() > 20) {
+ int s = bw->play_button_->w() - 5;
+
+ bw->play_button_->resize(s, (s - 20) * (bw->h() - s) / 120, s, s);
+ bw->play_button_->labelsize(s / 2 + 4);
+ bw->redraw();
+ }
+
+ if (bw->interval_ > 0.0) {
+ Fl::repeat_timeout(bw->interval_, (Fl_Timeout_Handler)timeout_cb,
+ (void *)bw);
+ } else {
+ Fl::repeat_timeout(0.1, (Fl_Timeout_Handler)timeout_cb,
+ (void *)bw);
+ }
+}
+
+
+//
+// End of "$Id: blocks.cxx 5976 2007-11-19 14:14:13Z matt $".
+//
diff --git a/third_party/windows/fltk-1.1.10/test/boxtype.cxx b/third_party/windows/fltk-1.1.10/test/boxtype.cxx
new file mode 100644
index 0000000..bfc3b98
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/boxtype.cxx
@@ -0,0 +1,128 @@
+//
+// "$Id: boxtype.cxx 5671 2007-02-08 07:58:47Z matt $"
+//
+// Boxtype test program for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2005 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_Double_Window.H>
+#include <FL/Fl_Box.H>
+
+int N = 0;
+#define W 200
+#define H 50
+#define ROWS 14
+
+Fl_Window *window;
+
+void bt(const char *name, Fl_Boxtype type, int square=0) {
+ int x = N%4;
+ int y = N/4;
+ N++;
+ x = x*W+10;
+ y = y*H+10;
+ Fl_Box *b = new Fl_Box(type,x,y,square ? H-20 : W-20,H-20,name);
+ b->labelsize(11);
+ if (square) b->align(FL_ALIGN_RIGHT);
+}
+
+int main(int argc, char ** argv) {
+ window = new Fl_Double_Window(4*W,ROWS*H);
+ window->box(FL_FLAT_BOX);
+#if 0 // this code uses the command line arguments to set arbitrary color schemes
+ Fl::args(argc, argv);
+ Fl::get_system_colors();
+#elif 0 // this code uses a single color to define a scheme
+ Fl::args(argc, argv);
+ Fl::get_system_colors();
+ Fl::background(113,113,198);
+#else // this code uses the nice bright blue background to show box vs. frame types
+ Fl::args(argc, argv);
+ Fl::get_system_colors();
+ window->color(12);// light blue
+#endif
+ bt("FL_NO_BOX",FL_NO_BOX);
+ bt("FL_FLAT_BOX",FL_FLAT_BOX);
+ N += 2; // go to start of next row to line up boxes & frames
+ bt("FL_UP_BOX",FL_UP_BOX);
+ bt("FL_DOWN_BOX",FL_DOWN_BOX);
+ bt("FL_UP_FRAME",FL_UP_FRAME);
+ bt("FL_DOWN_FRAME",FL_DOWN_FRAME);
+ bt("FL_THIN_UP_BOX",FL_THIN_UP_BOX);
+ bt("FL_THIN_DOWN_BOX",FL_THIN_DOWN_BOX);
+ bt("FL_THIN_UP_FRAME",FL_THIN_UP_FRAME);
+ bt("FL_THIN_DOWN_FRAME",FL_THIN_DOWN_FRAME);
+ bt("FL_ENGRAVED_BOX",FL_ENGRAVED_BOX);
+ bt("FL_EMBOSSED_BOX",FL_EMBOSSED_BOX);
+ bt("FL_ENGRAVED_FRAME",FL_ENGRAVED_FRAME);
+ bt("FL_EMBOSSED_FRAME",FL_EMBOSSED_FRAME);
+ bt("FL_BORDER_BOX",FL_BORDER_BOX);
+ bt("FL_SHADOW_BOX",FL_SHADOW_BOX);
+ bt("FL_BORDER_FRAME",FL_BORDER_FRAME);
+ bt("FL_SHADOW_FRAME",FL_SHADOW_FRAME);
+ bt("FL_ROUNDED_BOX",FL_ROUNDED_BOX);
+ bt("FL_RSHADOW_BOX",FL_RSHADOW_BOX);
+ bt("FL_ROUNDED_FRAME",FL_ROUNDED_FRAME);
+ bt("FL_RFLAT_BOX",FL_RFLAT_BOX);
+ bt("FL_OVAL_BOX",FL_OVAL_BOX);
+ bt("FL_OSHADOW_BOX",FL_OSHADOW_BOX);
+ bt("FL_OVAL_FRAME",FL_OVAL_FRAME);
+ bt("FL_OFLAT_BOX",FL_OFLAT_BOX);
+ bt("FL_ROUND_UP_BOX",FL_ROUND_UP_BOX);
+ bt("FL_ROUND_DOWN_BOX",FL_ROUND_DOWN_BOX);
+ bt("FL_DIAMOND_UP_BOX",FL_DIAMOND_UP_BOX);
+ bt("FL_DIAMOND_DOWN_BOX",FL_DIAMOND_DOWN_BOX);
+
+ bt("FL_PLASTIC_UP_BOX",FL_PLASTIC_UP_BOX);
+ bt("FL_PLASTIC_DOWN_BOX",FL_PLASTIC_DOWN_BOX);
+ bt("FL_PLASTIC_UP_FRAME",FL_PLASTIC_UP_FRAME);
+ bt("FL_PLASTIC_DOWN_FRAME",FL_PLASTIC_DOWN_FRAME);
+ bt("FL_PLASTIC_THIN_UP_BOX",FL_PLASTIC_THIN_UP_BOX);
+ bt("FL_PLASTIC_THIN_DOWN_BOX",FL_PLASTIC_THIN_DOWN_BOX);
+ N += 2;
+ bt("FL_PLASTIC_ROUND_UP_BOX",FL_PLASTIC_ROUND_UP_BOX);
+ bt("FL_PLASTIC_ROUND_DOWN_BOX",FL_PLASTIC_ROUND_DOWN_BOX);
+ N += 2;
+
+ bt("FL_GTK_UP_BOX",FL_GTK_UP_BOX);
+ bt("FL_GTK_DOWN_BOX",FL_GTK_DOWN_BOX);
+ bt("FL_GTK_UP_FRAME",FL_GTK_UP_FRAME);
+ bt("FL_GTK_DOWN_FRAME",FL_GTK_DOWN_FRAME);
+ bt("FL_GTK_THIN_UP_BOX",FL_GTK_THIN_UP_BOX);
+ bt("FL_GTK_THIN_DOWN_BOX",FL_GTK_THIN_DOWN_BOX);
+ bt("FL_GTK_THIN_UP_FRAME",FL_GTK_THIN_UP_FRAME);
+ bt("FL_GTK_THIN_DOWN_FRAME",FL_GTK_THIN_DOWN_FRAME);
+ bt("FL_GTK_ROUND_UP_BOX",FL_GTK_ROUND_UP_BOX);
+ bt("FL_GTK_ROUND_DOWN_BOX",FL_GTK_ROUND_DOWN_BOX);
+ window->resizable(window);
+ window->end();
+ window->show();
+ return Fl::run();
+}
+
+//
+// End of "$Id: boxtype.cxx 5671 2007-02-08 07:58:47Z matt $".
+//
diff --git a/third_party/windows/fltk-1.1.10/test/browser.cxx b/third_party/windows/fltk-1.1.10/test/browser.cxx
new file mode 100644
index 0000000..15cb007
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/browser.cxx
@@ -0,0 +1,182 @@
+//
+// "$Id: browser.cxx 5845 2007-05-20 00:01:06Z mike $"
+//
+// Browser test program for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2005 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 test of how the browser draws lines.
+This is a second line.
+This is a third.
+
+That was a blank line above this.
+
+@r@_Right justify
+@c@_Center justify
+@_Left justify
+
+@bBold text
+@iItalic text
+@b@iBold Italic
+@fFixed width
+@f@bBold Fixed
+@f@iItalic Fixed
+@f@i@bBold Italic Fixed
+@lLarge
+@l@bLarge bold
+@sSmall
+@s@bSmall bold
+@s@iSmall italic
+@s@i@bSmall italic bold
+@uunderscore
+@C1RED
+@C2Green
+@C4Blue
+
+ You should try different browser types:
+ Fl_Browser
+ Fl_Select_Browser
+ Fl_Hold_Browser
+ Fl_Multi_Browser
+*/
+
+#include <FL/Fl.H>
+#include <FL/Fl_Select_Browser.H>
+#include <FL/Fl_Double_Window.H>
+#include <FL/Fl_Button.H>
+#include <FL/Fl_Int_Input.H>
+#include <FL/fl_ask.H>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <stdlib.h>
+
+Fl_Select_Browser *browser;
+Fl_Button *top,
+ *bottom,
+ *middle,
+ *visible,
+ *swap;
+Fl_Int_Input *field;
+
+void b_cb(Fl_Widget* o, void*) {
+ printf("callback, selection = %d, event_clicks = %d\n",
+ ((Fl_Browser*)o)->value(), Fl::event_clicks());
+}
+
+void show_cb(Fl_Widget *o, void *) {
+ int line = atoi(field->value());
+
+ if (!line) {
+ fl_alert("Please enter a number in the text field\n"
+ "before clicking on the buttons.");
+ return;
+ }
+
+ if (o == top)
+ browser->topline(line);
+ else if (o == bottom)
+ browser->bottomline(line);
+ else if (o == middle)
+ browser->middleline(line);
+ else
+ browser->make_visible(line);
+}
+
+void swap_cb(Fl_Widget *, void *) {
+ int a = -1, b = -1;
+ for ( int t=0; t<browser->size(); t++ ) { // find two selected items
+ if ( browser->selected(t) ) {
+ if ( a < 0 )
+ { a = t; }
+ else
+ { b = t; break; }
+ }
+ }
+ browser->swap(a, b); // swap them
+}
+
+int main(int argc, char **argv) {
+ int i;
+ if (!Fl::args(argc,argv,i)) Fl::fatal(Fl::help);
+ const char* fname = (i < argc) ? argv[i] : "browser.cxx";
+ Fl_Window window(400,400,fname);
+ browser = new Fl_Select_Browser(0,0,400,350,0);
+ browser->type(FL_MULTI_BROWSER);
+ //browser->type(FL_HOLD_BROWSER);
+ //browser->color(42);
+ browser->callback(b_cb);
+ // browser->scrollbar_right();
+ //browser->has_scrollbar(Fl_Browser::BOTH_ALWAYS);
+ if (!browser->load(fname)) {
+#ifdef _MSC_VER
+ // if 'browser' was started from the VisualC environment in Win32,
+ // the current directory is set to the environment itself,
+ // so we need to correct the browser file path
+ int done = 1;
+ if ( i == argc )
+ {
+ fname = "../test/browser.cxx";
+ done = browser->load(fname);
+ }
+ if ( !done )
+ {
+ printf("Can't load %s, %s\n", fname, strerror(errno));
+ exit(1);
+ }
+#else
+ printf("Can't load %s, %s\n", fname, strerror(errno));
+ exit(1);
+#endif
+ }
+ browser->position(0);
+
+ field = new Fl_Int_Input(50, 350, 350, 25, "Line #:");
+ field->callback(show_cb);
+
+ top = new Fl_Button(0, 375, 80, 25, "Top");
+ top->callback(show_cb);
+
+ bottom = new Fl_Button(80, 375, 80, 25, "Bottom");
+ bottom->callback(show_cb);
+
+ middle = new Fl_Button(160, 375, 80, 25, "Middle");
+ middle->callback(show_cb);
+
+ visible = new Fl_Button(240, 375, 80, 25, "Make Vis.");
+ visible->callback(show_cb);
+
+ swap = new Fl_Button(320, 375, 80, 25, "Swap");
+ swap->callback(swap_cb);
+ swap->tooltip("Swaps two selected lines\n(Use CTRL-click to select two lines)");
+
+ window.resizable(browser);
+ window.show(argc,argv);
+ return Fl::run();
+}
+
+//
+// End of "$Id: browser.cxx 5845 2007-05-20 00:01:06Z mike $".
+//
+
diff --git a/third_party/windows/fltk-1.1.10/test/button.cxx b/third_party/windows/fltk-1.1.10/test/button.cxx
new file mode 100644
index 0000000..54a458f
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/button.cxx
@@ -0,0 +1,68 @@
+//
+// "$Id: button.cxx 5519 2006-10-11 03:12:15Z mike $"
+//
+// Button/callback test program for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2005 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_Button.H>
+
+void beepcb(Fl_Widget *, void *) {
+ printf("\007"); fflush(stdout);
+}
+
+void exitcb(Fl_Widget *, void *) {
+ exit(0);
+}
+
+#if 0
+// test Fl::add_fd()...
+void stdin_cb(int, void*) {
+ char buf[1000];
+ gets(buf);
+ printf("stdin callback\n");
+}
+#endif
+
+int main(int argc, char ** argv) {
+ Fl_Window *window = new Fl_Window(320,65);
+ Fl_Button *b1 = new Fl_Button(20, 20, 80, 25, "&Beep");
+ b1->callback(beepcb,0);
+ /*Fl_Button *b2 =*/ new Fl_Button(120,20, 80, 25, "&no op");
+ Fl_Button *b3 = new Fl_Button(220,20, 80, 25, "E&xit");
+ b3->callback(exitcb,0);
+ window->end();
+ window->show(argc,argv);
+#if 0
+ Fl::add_fd(0, stdin_cb);
+#endif
+ return Fl::run();
+}
+
+//
+// End of "$Id: button.cxx 5519 2006-10-11 03:12:15Z mike $".
+//
diff --git a/third_party/windows/fltk-1.1.10/test/buttons.cxx b/third_party/windows/fltk-1.1.10/test/buttons.cxx
new file mode 100644
index 0000000..6fe57d2
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/buttons.cxx
@@ -0,0 +1,55 @@
+//
+// "$Id: buttons.cxx 5519 2006-10-11 03:12:15Z mike $"
+//
+// Another button test program for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2005 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_Button.H>
+#include <FL/Fl_Return_Button.H>
+#include <FL/Fl_Repeat_Button.H>
+#include <FL/Fl_Check_Button.H>
+#include <FL/Fl_Light_Button.H>
+#include <FL/Fl_Round_Button.H>
+#include <FL/Fl_Tooltip.H>
+
+int main(int argc, char ** argv) {
+ Fl_Window *window = new Fl_Window(320,130);
+ (new Fl_Button(10, 10, 130, 30, "Fl_Button"))->tooltip("This is a Tooltip.");
+ new Fl_Return_Button(150, 10, 160, 30, "Fl_Return_Button");
+ new Fl_Repeat_Button(10,50,130,30,"Fl_Repeat_Button");
+ new Fl_Light_Button(10,90,130,30,"Fl_Light_Button");
+ new Fl_Round_Button(150,50,160,30,"Fl_Round_Button");
+ new Fl_Check_Button(150,90,160,30,"Fl_Check_Button");
+ window->end();
+ window->show(argc,argv);
+ return Fl::run();
+}
+
+//
+// End of "$Id: buttons.cxx 5519 2006-10-11 03:12:15Z mike $".
+//
diff --git a/third_party/windows/fltk-1.1.10/test/checkers.app/Contents/Info.plist b/third_party/windows/fltk-1.1.10/test/checkers.app/Contents/Info.plist
new file mode 100644
index 0000000..3d3d6da
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/checkers.app/Contents/Info.plist
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<plist version="0.9">
+ <dict>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+
+ <key>CFBundleExecutable</key>
+ <string>checkers</string>
+
+ <key>CFBundleIdentifier</key>
+ <string>org.fltk.checkers</string>
+
+ <key>CFBundleVersion</key>
+ <string>1.0</string>
+
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+
+ <key>NSHumanReadableCopyright</key>
+ <string>Copyright 1997-2006 by Bill Spitzak and others</string>
+
+ <key>CFAppleHelpAnchor</key>
+ <string>help</string>
+
+ <key>CFBundleName</key>
+ <string>checkers</string>
+
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+
+ <key>CFBundleSignature</key>
+ <string>FLSU</string>
+
+ <key>CFBundleIconFile</key>
+ <string>checkers.icns</string>
+
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+
+ <key>CFBundleGetInfoString</key>
+ <string>1.0, Copyright 1997-2006 by Bill Spitzak and others</string>
+
+ </dict>
+</plist>
diff --git a/third_party/windows/fltk-1.1.10/test/checkers.app/Contents/PkgInfo b/third_party/windows/fltk-1.1.10/test/checkers.app/Contents/PkgInfo
new file mode 100644
index 0000000..ffeeb7d
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/checkers.app/Contents/PkgInfo
@@ -0,0 +1 @@
+FLSUFlsu
diff --git a/third_party/windows/fltk-1.1.10/test/checkers.app/Contents/Resources/checkers.icns b/third_party/windows/fltk-1.1.10/test/checkers.app/Contents/Resources/checkers.icns
new file mode 100644
index 0000000..7e561e3
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/checkers.app/Contents/Resources/checkers.icns
Binary files differ
diff --git a/third_party/windows/fltk-1.1.10/test/checkers.cxx b/third_party/windows/fltk-1.1.10/test/checkers.cxx
new file mode 100644
index 0000000..7b0ad86
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/checkers.cxx
@@ -0,0 +1,1361 @@
+//
+// "$Id: checkers.cxx 5519 2006-10-11 03:12:15Z mike $"
+//
+// Checkers game for the Fast Light Tool Kit (FLTK).
+//
+// Hours of fun: the FLTK checkers game!
+// Based on a very old algorithm, but it still works!
+//
+// Copyright 1998-2005 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"
+"Copyright (C) 1997 Bill Spitzak spitzak@d2.com\n"
+"Original Pascal code:\n"
+"Copyright 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 <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 char piece;
+
+// Piece values so that BLACK and WHITE are bit flags:
+#define EMPTY 0
+#define BLACK 1
+#define WHITE 2
+#define KING 4
+#define BLACKKING 5
+#define WHITEKING 6
+#define BLUE 8
+
+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
+#define FRIEND BLACK
+#define FRIENDKING BLACKKING
+#define ENEMY WHITE
+#define ENEMYKING WHITEKING
+
+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 aa = tb[target]; piece bb = 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] = aa; tb[src] = bb;
+ 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[(int)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\n",f->mobil,n->mobil);
+ 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%dn",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[(int)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 <FL/Fl.H>
+#include <FL/Fl_Double_Window.H>
+#include <FL/Fl_Bitmap.H>
+#include <FL/fl_draw.H>
+#include <FL/Fl_Menu_Item.H>
+#include <FL/fl_ask.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 "pixmaps/black_1.xbm"
+#include "pixmaps/black_2.xbm"
+#include "pixmaps/black_3.xbm"
+#include "pixmaps/black_4.xbm"
+#include "pixmaps/white_1.xbm"
+#include "pixmaps/white_2.xbm"
+#include "pixmaps/white_3.xbm"
+#include "pixmaps/white_4.xbm"
+#include "pixmaps/blackking_1.xbm"
+#include "pixmaps/blackking_2.xbm"
+#include "pixmaps/blackking_3.xbm"
+#include "pixmaps/blackking_4.xbm"
+#include "pixmaps/whiteking_1.xbm"
+#include "pixmaps/whiteking_2.xbm"
+#include "pixmaps/whiteking_3.xbm"
+#include "pixmaps/whiteking_4.xbm"
+
+Fl_Bitmap *bm[4][4];
+
+void make_bitmaps() {
+ if (bm[0][0]) return;
+ bm[0][0] = new Fl_Bitmap(black_1_bits, black_1_width, black_1_height);
+ bm[0][1] = new Fl_Bitmap(black_2_bits, black_1_width, black_1_height);
+ bm[0][2] = new Fl_Bitmap(black_3_bits, black_1_width, black_1_height);
+ bm[0][3] = new Fl_Bitmap(black_4_bits, black_1_width, black_1_height);
+ bm[1][0] = new Fl_Bitmap(white_1_bits, black_1_width, black_1_height);
+ bm[1][1] = new Fl_Bitmap(white_2_bits, black_1_width, black_1_height);
+ bm[1][2] = new Fl_Bitmap(white_3_bits, black_1_width, black_1_height);
+ bm[1][3] = new Fl_Bitmap(white_4_bits, black_1_width, black_1_height);
+ bm[2][0] = new Fl_Bitmap(blackking_1_bits, black_1_width, black_1_height);
+ bm[2][1] = new Fl_Bitmap(blackking_2_bits, black_1_width, black_1_height);
+ bm[2][2] = new Fl_Bitmap(blackking_3_bits, black_1_width, black_1_height);
+ bm[2][3] = new Fl_Bitmap(blackking_4_bits, black_1_width, black_1_height);
+ bm[3][0] = new Fl_Bitmap(whiteking_1_bits, black_1_width, black_1_height);
+ bm[3][1] = new Fl_Bitmap(whiteking_2_bits, black_1_width, black_1_height);
+ bm[3][2] = new Fl_Bitmap(whiteking_3_bits, black_1_width, black_1_height);
+ bm[3][3] = new Fl_Bitmap(whiteking_4_bits, black_1_width, black_1_height);
+}
+
+#define ISIZE black_1_width
+
+void draw_piece(int which, int x, int y) {
+ if (!fl_not_clipped(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;
+ }
+ fl_color(FL_BLACK); bm[which][0]->draw(x, y);
+ fl_color(FL_INACTIVE_COLOR); bm[which][1]->draw(x, y);
+ fl_color(FL_SELECTION_COLOR); bm[which][2]->draw(x, y);
+ fl_color(FL_WHITE); bm[which][3]->draw(x, y);
+}
+
+//----------------------------------------------------------------
+
+class Board : public Fl_Double_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) : Fl_Double_Window(w,h) {color(15);}
+};
+
+#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();
+ fl_draw_box(box(),0,0,w(),h(),color());
+ fl_color((Fl_Color)10 /*107*/);
+ int x; for (x=0; x<8; x++) for (int y=0; y<8; y++) {
+ if (!((x^y)&1)) fl_rectf(BORDER+x*BOXSIZE, BORDER+y*BOXSIZE,
+ BOXSIZE-BORDER, BOXSIZE-BORDER);
+ }
+ fl_color(FL_DARK3 /*FL_GRAY_RAMP+4*/);
+ for (x=0; x<9; x++) {
+ fl_rectf(x*BOXSIZE,0,BORDER,h());
+ fl_rectf(0,x*BOXSIZE,w(),BORDER);
+ }
+ for (int j = 5; j < 40; j++) if (j != erase_this) {
+ draw_piece(b[j], squarex(j), squarey(j));
+ }
+ if (showlegal) {
+ fl_color(FL_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;
+ fl_line(x1,y1,x2,y2);
+ fl_push_matrix();
+ fl_mult_matrix(x2-x1,y2-y1,y1-y2,x2-x1,x2,y2);
+ fl_begin_polygon();
+ fl_vertex(0,0);
+ fl_vertex(-.3, .1);
+ fl_vertex(-.3, -.1);
+ fl_end_polygon();
+ fl_pop_matrix();
+ }
+ int num = 1;
+ fl_color(FL_BLACK);
+ fl_font(FL_BOLD,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);
+ fl_draw(buf, x1+int((x2-x1)*.85)-3, 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 j, int dx, int dy) {
+ dy = (dy&-2) | dx&1; // make halftone shadows line up
+ if (j != erase_this) drop_piece(erase_this); // should not happen
+ if (!erase_this) { // pick up old piece
+ dragx = squarex(j); dragy = squarey(j);
+ erase_this = j;
+ dragging = b[j];
+ }
+ if (dx != dragx || dy != dragy) {
+ damage(FL_DAMAGE_ALL, dragx, dragy, ISIZE, ISIZE);
+ damage(FL_DAMAGE_ALL, dx, dy, ISIZE, ISIZE);
+ }
+ dragx = dx;
+ dragy = dy;
+}
+
+// drop currently dragged piece on square i
+void Board::drop_piece(int j) {
+ if (!erase_this) return; // should not happen!
+ erase_this = 0;
+ dragging = 0;
+ int x = squarex(j);
+ int y = squarey(j);
+ if (x != dragx || y != dragy) {
+ damage(4, dragx, dragy, ISIZE, ISIZE);
+ damage(4, x, y, ISIZE, ISIZE);
+ }
+}
+
+// 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=35;
+ for (int j=0; j<STEPS; j++) {
+ int x = x1+(x2-x1)*j/STEPS;
+ int y = y1+(y2-y1)*j/STEPS;
+ drag_piece(move->from,x,y);
+ Fl::flush();
+ }
+ drop_piece(t);
+ if (move->jump) redraw();
+}
+
+int busy; // causes pop-up abort menu
+
+void Board::computer_move(int help) {
+ if (!playing) return;
+ cursor(FL_CURSOR_WAIT);
+ Fl::flush();
+ busy = 1; abortflag = 0;
+ node* move = calcmove(root);
+ busy = 0;
+ if (move) {
+ if (!help && move->value <= -30000) {
+ fl_message("%s resigns", move->who ? "White" : "Black");
+ playing = autoplay = 0;
+ cursor(FL_CURSOR_DEFAULT);
+ return;
+ }
+ animate(move,0);
+ domove(move);
+ }
+ expandnode(root);
+ if (!root->son) {
+ fl_message("%s has no move", root->who ? "Black" : "White");
+ playing = autoplay = 0;
+ }
+ if (!autoplay) cursor(FL_CURSOR_DEFAULT);
+}
+
+extern Fl_Menu_Item menu[];
+extern Fl_Menu_Item busymenu[];
+
+int Board::handle(int e) {
+ if (busy) {
+ const Fl_Menu_Item* m;
+ switch(e) {
+ case FL_PUSH:
+ m = busymenu->popup(Fl::event_x(), Fl::event_y(), 0, 0, 0);
+ if (m) m->do_callback(this, (void*)m);
+ return 1;
+ case FL_SHORTCUT:
+ m = busymenu->test_shortcut();
+ if (m) {m->do_callback(this, (void*)m); return 1;}
+ return 0;
+ default:
+ return 0;
+ }
+ }
+ node *t, *n;
+ static int deltax, deltay;
+ int dist;
+ const Fl_Menu_Item* m;
+ switch (e) {
+ case FL_PUSH:
+ if (Fl::event_button() > 1) {
+ m = menu->popup(Fl::event_x(), Fl::event_y(), 0, 0, 0);
+ if (m) m->do_callback(this, (void*)m);
+ 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 (Fl::event_inside(x,y,BOXSIZE,BOXSIZE)) {
+ deltax = Fl::event_x()-x;
+ deltay = Fl::event_y()-y;
+ drag_piece(t->from,x,y);
+ return 1;
+ }
+ }
+ }
+ return 0;
+ case FL_SHORTCUT:
+ m = menu->test_shortcut();
+ if (m) {m->do_callback(this, (void*)m); return 1;}
+ return 0;
+ case FL_DRAG:
+ drag_piece(erase_this, Fl::event_x()-deltax, Fl::event_y()-deltay);
+ return 1;
+ case FL_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 = Fl::event_x()-deltax-squarex(t->to);
+ int d = d1*d1;
+ d1 = Fl::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 0;
+ }
+}
+
+void quit_cb(Fl_Widget*, void*) {exit(0);}
+
+int FLTKmain(int argc, char** argv) {
+ Fl::visual(FL_DOUBLE|FL_INDEX);
+ Board b(BOARDSIZE,BOARDSIZE);
+ b.callback(quit_cb);
+ b.show(argc,argv);
+ return Fl::run();
+}
+
+void autoplay_cb(Fl_Widget*bp, void*) {
+ if (autoplay) {autoplay = 0; return;}
+ if (!playing) return;
+ Board* b = (Board*)bp;
+ autoplay = 1;
+ while (autoplay) {b->computer_move(0); b->computer_move(0);}
+}
+
+#include <FL/Fl_Box.H>
+Fl_Window *copyright_window;
+void copyright_cb(Fl_Widget*, void*) {
+ if (!copyright_window) {
+ copyright_window = new Fl_Window(400,270,"Copyright");
+ copyright_window->color(FL_WHITE);
+ Fl_Box *b = new Fl_Box(20,0,380,270,copyright);
+ b->labelsize(10);
+ b->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE|FL_ALIGN_WRAP);
+ copyright_window->end();
+ }
+ copyright_window->hotspot(copyright_window);
+ copyright_window->set_non_modal();
+ copyright_window->show();
+}
+
+void debug_cb(Fl_Widget*, void*v) {
+ debug = !debug;
+ ((Fl_Menu_Item*)v)->flags =
+ debug ? FL_MENU_TOGGLE|FL_MENU_VALUE : FL_MENU_TOGGLE;
+}
+
+void forced_cb(Fl_Widget*b, void*v) {
+ forcejumps = !forcejumps;
+ ((Fl_Menu_Item*)v)->flags =
+ forcejumps ? FL_MENU_TOGGLE|FL_MENU_VALUE : FL_MENU_TOGGLE;
+ killnode(root->son); root->son = 0;
+ if (showlegal) {expandnode(root); b->redraw();}
+}
+
+void move_cb(Fl_Widget*pb, void*) {
+ Board* b = (Board*)pb;
+ if (playing) b->computer_move(1);
+ if (playing) b->computer_move(0);
+}
+
+void newgame_cb(Fl_Widget*b, void*) {
+ showlegal = 0;
+ newgame();
+ b->redraw();
+}
+
+void legal_cb(Fl_Widget*pb, void*) {
+ if (showlegal == 1) {showlegal = 0; ((Board*)pb)->redraw(); return;}
+ if (!playing) return;
+ expandnode(root);
+ showlegal = 1; ((Board*)pb)->redraw();
+}
+
+void predict_cb(Fl_Widget*pb, void*) {
+ if (showlegal == 2) {showlegal = 0; ((Board*)pb)->redraw(); return;}
+ if (playing) expandnode(root);
+ showlegal = 2; ((Board*)pb)->redraw();
+}
+
+void switch_cb(Fl_Widget*pb, void*) {
+ user = !user;
+ ((Board*)pb)->computer_move(0);
+}
+
+void undo_cb(Fl_Widget*pb, void*) {
+ Board* b = (Board*)pb;
+ b->animate(undomove(),1);
+ b->animate(undomove(),1);
+}
+
+//--------------------------
+
+#include <FL/Fl_Slider.H>
+#include <FL/Fl_Value_Output.H>
+
+Fl_Window *intel_window;
+Fl_Value_Output *intel_output;
+
+void intel_slider_cb(Fl_Widget*w, void*) {
+ double v = ((Fl_Slider*)w)->value();
+ int n = int(v*v);
+ intel_output->value(n);
+ maxevaluate = maxnodes = n;
+}
+
+void intel_cb(Fl_Widget*, void*) {
+ if (!intel_window) {
+ intel_window = new Fl_Window(200,25,"Checkers Intelligence");
+ Fl_Slider* s = new Fl_Slider(60,0,140,25);
+ s->type(FL_HOR_NICE_SLIDER);
+ s->minimum(1); s->maximum(500); s->value(50);
+ s->callback(intel_slider_cb);
+ intel_output = new Fl_Value_Output(0,0,60,25);
+ intel_output->value(maxevaluate);
+ intel_window->resizable(s);
+ }
+ intel_window->hotspot(intel_window);
+ intel_window->set_non_modal();
+ intel_window->show();
+}
+
+//---------------------------
+
+void stop_cb(Fl_Widget*, void*) {abortflag = 1;}
+
+void continue_cb(Fl_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, (void *)"d", FL_MENU_TOGGLE},
+ {"Intelligence...", 'i', intel_cb, 0, FL_MENU_DIVIDER},
+ {"Copyright", 'c', copyright_cb},
+ {"Quit", 'q', quit_cb},
+ {0}};
+
+Fl_Menu_Item busymenu[] = {
+ {"Stop", '.', stop_cb},
+ {"Autoplay", 'a', autoplay_cb},
+ {"Continue", 0, continue_cb},
+ {"Debug", 'd', debug_cb, (void *)"d", FL_MENU_TOGGLE},
+ {"Intelligence...", 'i', intel_cb},
+ {"Copyright", 'c', copyright_cb},
+ {"Quit", 'q', quit_cb},
+ {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
+ Fl::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 (Fl::args(argc, argv, i, arg) < argc) {
+ fprintf(stderr," -t : use VT100 display\n", Fl::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 5519 2006-10-11 03:12:15Z mike $".
+//
diff --git a/third_party/windows/fltk-1.1.10/test/clock.cxx b/third_party/windows/fltk-1.1.10/test/clock.cxx
new file mode 100644
index 0000000..db218b1
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/clock.cxx
@@ -0,0 +1,53 @@
+//
+// "$Id: clock.cxx 5519 2006-10-11 03:12:15Z mike $"
+//
+// Clock test program for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2005 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 <FL/Fl.H>
+#include <FL/Fl_Window.H>
+#include <FL/Fl_Clock.H>
+#include <FL/Fl_Round_Clock.H>
+
+int main(int argc, char **argv) {
+ Fl_Window window(220,220,"Fl_Clock");
+ Fl_Clock c1(0,0,220,220); // c1.color(2,1);
+ window.resizable(c1);
+ window.end();
+ Fl_Window window2(220,220,"Fl_Round_Clock");
+ Fl_Round_Clock c2(0,0,220,220); // c2.color(3,4);
+ window2.resizable(c2);
+ window2.end();
+ // my machine had a clock* Xresource set for another program, so
+ // I don't want the class to be "clock":
+ window.xclass("Fl_Clock");
+ window2.xclass("Fl_Clock");
+ window.show(argc,argv);
+ window2.show();
+ return Fl::run();
+}
+
+//
+// End of "$Id: clock.cxx 5519 2006-10-11 03:12:15Z mike $".
+//
diff --git a/third_party/windows/fltk-1.1.10/test/colbrowser.cxx b/third_party/windows/fltk-1.1.10/test/colbrowser.cxx
new file mode 100644
index 0000000..dccd4d4
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/colbrowser.cxx
@@ -0,0 +1,330 @@
+//
+// "$Id: colbrowser.cxx 5519 2006-10-11 03:12:15Z mike $"
+//
+// Forms test program for the Fast Light Tool Kit (FLTK).
+//
+// This is an XForms program from the 0.86 distribution of XForms.
+// It has been modified as little as possible to work under fltk by
+// using fltk's Forms emulation. Search for "fltk" to find all the
+// changes
+//
+// Copyright 1998-2005 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 <FL/forms.H> // changed for fltk
+#include <stdlib.h>
+#include <stdio.h> // added for fltk
+#include <string.h> // added for fltk
+
+#define MAX_RGB 3000
+
+static FL_FORM *cl;
+static Fl_Widget *rescol, *dbobj, *colbr, *rs, *gs, *bs;
+char dbname[FL_PATH_MAX];
+static void create_form_cl(void);
+static int load_browser(char *);
+
+typedef struct { int r, g, b; } RGBdb;
+
+static RGBdb rgbdb[MAX_RGB];
+
+int
+main(int argc, char *argv[])
+{
+
+ fl_initialize(&argc, argv, "FormDemo", 0, 0);
+
+ create_form_cl();
+ strcpy(dbname, "rgb.txt");
+
+ if (load_browser(dbname))
+ fl_set_object_label(dbobj, dbname);
+ else
+ fl_set_object_label(dbobj, "None");
+
+// fl_set_form_minsize(cl, cl->w , cl->h); // removed for fltk
+// fl_set_form_maxsize(cl, 2*cl->w , 2*cl->h); // removed for fltk
+ cl->size_range(cl->w(),cl->h(),2*cl->w(),2*cl->h()); // added for fltk
+ // border changed from FL_TRANSIENT for fltk:
+ // This is so Esc & the close box will close the window.
+ // (on transient windows attempting to close it just calls the callback)
+ fl_show_form(cl, FL_PLACE_FREE, 1/*FL_TRANSIENT*/, "RGB Browser");
+
+
+ while (fl_do_forms())
+ ;
+ return 0;
+}
+
+static void
+set_entry(int i)
+{
+ RGBdb *db = rgbdb + i;
+
+ fl_freeze_form(cl);
+// unclear why demo is doing this. This messes up FL:
+// fl_mapcolor(FL_FREE_COL4+i, db->r, db->g, db->b);
+ fl_mapcolor(FL_FREE_COL4, db->r, db->g, db->b);
+ fl_set_slider_value(rs, db->r);
+ fl_set_slider_value(gs, db->g);
+ fl_set_slider_value(bs, db->b);
+ fl_redraw_object(rescol);
+ fl_unfreeze_form(cl);
+}
+
+static void
+br_cb(Fl_Widget * ob, long)
+{
+ int r = fl_get_browser(ob);
+
+ if (r <= 0)
+ return;
+ set_entry(r - 1);
+}
+
+static int
+read_entry(FILE * fp, int *r, int *g, int *b, char *name)
+{
+ int n;
+ char buf[512], *p;
+
+ if (!fgets(buf, sizeof(buf) - 1, fp))
+ return 0;
+
+ if(buf[0] == '!')
+ fgets(buf,sizeof(buf)-1,fp);
+
+ if(sscanf(buf, " %d %d %d %n", r, g, b, &n) < 3)
+ return 0;
+
+ p = buf + n;
+
+ /* squeeze out all spaces */
+ while (*p)
+ {
+ if (*p != ' ' && *p != '\n')
+ *name++ = *p;
+ p++;
+ }
+ *name = 0;
+
+ return (feof(fp) || ferror(fp)) ? 0 : 1;
+}
+
+
+static int
+load_browser(char *fname)
+{
+ FILE *fp;
+ RGBdb *db = rgbdb, *dbs = db + MAX_RGB;
+ int r, g, b, lr = -1 , lg = -1, lb = -1;
+ char name[256], buf[256];
+#ifdef __EMX__
+ if (!(fp = fopen(__XOS2RedirRoot(fname), "r")))
+#else
+ if (!(fp = fopen(fname, "r")))
+#endif
+ {
+ fl_show_alert("Load", fname, "Can't open", 0);
+ return 0;
+ }
+
+ /* read the items */
+
+ fl_freeze_form(cl);
+
+ for (; db < dbs && read_entry(fp, &r, &g, &b, name);)
+ {
+ db->r = r;
+ db->g = g;
+ db->b = b;
+
+ /* unique the entries on the fly */
+ if (lr != r || lg != g || lb != b)
+ {
+ db++;
+ lr = r;
+ lg = g;
+ lb = b;
+ sprintf(buf, "(%3d %3d %3d) %s", r, g, b, name);
+ fl_addto_browser(colbr, buf);
+ }
+ }
+ fclose(fp);
+
+ if (db < dbs)
+ db->r = 1000; /* sentinel */
+ else
+ {
+ db--;
+ db->r = 1000;
+ }
+
+ fl_set_browser_topline(colbr, 1);
+ fl_select_browser_line(colbr, 1);
+ set_entry(0);
+ fl_unfreeze_form(cl);
+ return 1;
+}
+
+static int
+search_entry(int r, int g, int b)
+{
+ register RGBdb *db = rgbdb;
+ int i, j, diffr, diffg, diffb;
+ unsigned int diff, mindiff;
+
+ mindiff = (unsigned int)~0;
+ for (i = j = 0; db->r < 256; db++, i++)
+ {
+ diffr = r - db->r;
+ diffg = g - db->g;
+ diffb = b - db->b;
+
+#ifdef FL_LINEAR
+ diff = unsigned(3.0 * (FL_abs(r - db->r)) +
+ (5.9 * FL_abs(g - db->g)) +
+ (1.1 * (FL_abs(b - db->b)));
+#else
+ diff = unsigned(3.0 * (diffr *diffr) +
+ 5.9 * (diffg *diffg) +
+ 1.1 * (diffb *diffb));
+#endif
+
+ if (mindiff > diff)
+ {
+ mindiff = diff;
+ j = i;
+ }
+ }
+
+ return j;
+}
+
+static void
+search_rgb(Fl_Widget *, long)
+{
+ int r, g, b, i;
+ int top = fl_get_browser_topline(colbr);
+
+ r = int(fl_get_slider_value(rs));
+ g = int(fl_get_slider_value(gs));
+ b = int(fl_get_slider_value(bs));
+
+ fl_freeze_form(cl);
+ fl_mapcolor(FL_FREE_COL4, r, g, b);
+ fl_redraw_object(rescol);
+ i = search_entry(r, g, b);
+ /* change topline only if necessary */
+ if(i < top || i > (top+15))
+ fl_set_browser_topline(colbr, i-8);
+ fl_select_browser_line(colbr, i + 1);
+ fl_unfreeze_form(cl);
+}
+
+/* change database */
+static void
+db_cb(Fl_Widget * ob, long)
+{
+ const char *p = fl_show_input("Enter New Database Name", dbname);
+ char buf[512];
+
+ if (!p || strcmp(p, dbname) == 0)
+ return;
+
+ strcpy(buf, p);
+ if (load_browser(buf))
+ strcpy(dbname, buf);
+ else
+ fl_set_object_label(ob, dbname);
+}
+
+static void
+done_cb(Fl_Widget *, long)
+{
+ exit(0);
+}
+
+static void
+create_form_cl(void)
+{
+ Fl_Widget *obj;
+
+ if (cl)
+ return;
+
+ cl = fl_bgn_form(FL_NO_BOX, 330, 385);
+ obj = fl_add_box(FL_UP_BOX, 0, 0, 330, 385, "");
+ fl_set_object_color(obj, FL_INDIANRED, FL_COL1);
+
+ obj = fl_add_box(FL_NO_BOX, 40, 10, 250, 30, "Color Browser");
+ fl_set_object_lcol(obj, FL_RED);
+ fl_set_object_lsize(obj, FL_HUGE_SIZE);
+ fl_set_object_lstyle(obj, FL_BOLD_STYLE + FL_SHADOW_STYLE);
+
+ dbobj = obj = fl_add_button(FL_NORMAL_BUTTON, 40, 50, 250, 25, "");
+ fl_set_object_boxtype(obj, FL_BORDER_BOX);
+ fl_set_object_color(obj, /*fl_get_visual_depth()==1 ? FL_WHITE:*/ FL_INDIANRED,
+ FL_INDIANRED);
+ fl_set_object_callback(obj, db_cb, 0);
+ rs = obj = fl_add_valslider(FL_VERT_FILL_SLIDER, 225, 130, 30, 200, "");
+ fl_set_object_color(obj, FL_INDIANRED, FL_RED);
+ fl_set_slider_bounds(obj, 0, 255);
+ fl_set_slider_precision(obj, 0);
+ fl_set_object_callback(obj, search_rgb, 0);
+ fl_set_slider_return(obj, 0);
+
+ gs = obj = fl_add_valslider(FL_VERT_FILL_SLIDER, 255, 130, 30, 200, "");
+ fl_set_object_color(obj, FL_INDIANRED, FL_GREEN);
+ fl_set_slider_bounds(obj, 0, 255);
+ fl_set_slider_precision(obj, 0);
+ fl_set_object_callback(obj, search_rgb, 1);
+ fl_set_slider_return(obj, 0);
+
+ bs = obj = fl_add_valslider(FL_VERT_FILL_SLIDER, 285, 130, 30, 200, "");
+ fl_set_object_color(obj, FL_INDIANRED, FL_BLUE);
+ fl_set_slider_bounds(obj, 0, 255);
+ fl_set_slider_precision(obj, 0);
+ fl_set_object_callback(obj, search_rgb, 2);
+ fl_set_slider_return(obj, 0);
+
+
+ colbr = obj = fl_add_browser(FL_HOLD_BROWSER, 10, 90, 205, 240, "");
+ fl_set_browser_fontstyle(obj, FL_FIXED_STYLE);
+ fl_set_object_callback(obj, br_cb, 0);
+
+
+ obj = fl_add_button(FL_NORMAL_BUTTON, 135, 345, 80, 30, "Done");
+ fl_set_object_callback(obj, done_cb, 0);
+
+ rescol = obj = fl_add_box(FL_FLAT_BOX, 225, 90, 90, 35, "");
+ fl_set_object_color(obj, FL_FREE_COL4, FL_FREE_COL4);
+ fl_set_object_boxtype(obj, FL_BORDER_BOX);
+
+
+ fl_end_form();
+ fl_scale_form(cl, 1.1, 1.0);
+}
+
+//
+// End of "$Id: colbrowser.cxx 5519 2006-10-11 03:12:15Z mike $".
+//
diff --git a/third_party/windows/fltk-1.1.10/test/color_chooser.cxx b/third_party/windows/fltk-1.1.10/test/color_chooser.cxx
new file mode 100644
index 0000000..70cb5d0
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/color_chooser.cxx
@@ -0,0 +1,152 @@
+//
+// "$Id: color_chooser.cxx 5519 2006-10-11 03:12:15Z mike $"
+//
+// Color chooser test program for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2005 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 <FL/Fl.H>
+#include <FL/Fl_Window.H>
+#include <FL/Fl_Box.H>
+#include <FL/Fl_Button.H>
+#include <FL/fl_show_colormap.H>
+#include <FL/Fl_Color_Chooser.H>
+#include <FL/Fl_Image.H>
+#include <FL/x.H>
+#include <FL/fl_draw.H>
+
+#include <stdlib.h>
+#include <stdio.h>
+#if !defined(WIN32) && !defined(__APPLE__)
+#include "list_visuals.cxx"
+#endif
+
+int width = 75;
+int height = 75;
+uchar *image;
+
+void make_image() {
+ image = new uchar[3*width*height];
+ uchar *p = image;
+ for (int y = 0; y < height; y++) {
+ double Y = double(y)/(height-1);
+ for (int x = 0; x < width; x++) {
+ double X = double(x)/(width-1);
+ *p++ = uchar(255*((1-X)*(1-Y))); // red in upper-left
+ *p++ = uchar(255*((1-X)*Y)); // green in lower-left
+ *p++ = uchar(255*(X*Y)); // blue in lower-right
+ }
+ }
+}
+
+class Pens : public Fl_Box {
+ void draw();
+public:
+ Pens(int X, int Y, int W, int H, const char* L)
+ : Fl_Box(X,Y,W,H,L) {}
+};
+void Pens::draw() {
+ // use every color in the gray ramp:
+ for (int i = 0; i < 3*8; i++) {
+ fl_color((Fl_Color)(FL_GRAY_RAMP+i));
+ fl_line(x()+i, y(), x()+i, y()+h());
+ }
+}
+
+Fl_Color c = FL_GRAY;
+#define fullcolor_cell (FL_FREE_COLOR)
+
+void cb1(Fl_Widget *, void *v) {
+ c = fl_show_colormap(c);
+ Fl_Box* b = (Fl_Box*)v;
+ b->color(c);
+ b->parent()->redraw();
+}
+
+void cb2(Fl_Widget *, void *v) {
+ uchar r,g,b;
+ Fl::get_color(c,r,g,b);
+ if (!fl_color_chooser("New color:",r,g,b)) return;
+ c = fullcolor_cell;
+ Fl::set_color(fullcolor_cell,r,g,b);
+ Fl_Box* bx = (Fl_Box*)v;
+ bx->color(fullcolor_cell);
+ bx->parent()->redraw();
+}
+
+int main(int argc, char ** argv) {
+ Fl::set_color(fullcolor_cell,145,159,170);
+ Fl_Window window(400,400);
+ Fl_Box box(50,50,300,300);
+ box.box(FL_THIN_DOWN_BOX);
+ c = fullcolor_cell;
+ box.color(c);
+ Fl_Button b1(140,120,120,30,"fl_show_colormap");
+ b1.callback(cb1,&box);
+ Fl_Button b2(140,160,120,30,"fl_choose_color");
+ b2.callback(cb2,&box);
+ Fl_Box image_box(140,200,120,120,0);
+ make_image();
+ (new Fl_RGB_Image(image, width, height))->label(&image_box);
+ Fl_Box b(140,320,120,0,"Example of fl_draw_image()");
+ Pens p(80,200,3*8,120,"lines");
+ p.align(FL_ALIGN_TOP);
+ int i = 1;
+ if (!Fl::args(argc,argv,i) || i != argc-1) {
+ printf("usage: %s <switches> visual-number\n"
+ " - : default visual\n"
+ " r : call Fl::visual(FL_RGB)\n"
+ " c : call Fl::own_colormap()\n",argv[0]);
+#if !defined(WIN32) && !defined(__APPLE__)
+ printf(" # : use this visual with an empty colormap:\n");
+ list_visuals();
+#endif
+ puts(Fl::help);
+ exit(1);
+ }
+ if (argv[i][0] == 'r') {
+ if (!Fl::visual(FL_RGB)) printf("Fl::visual(FL_RGB) returned false.\n");
+ } else if (argv[i][0] == 'c') {
+ Fl::own_colormap();
+ } else if (argv[i][0] != '-') {
+#if !defined(WIN32) && !defined(__APPLE__)
+ int visid = atoi(argv[i]);
+ fl_open_display();
+ XVisualInfo templt; int num;
+ templt.visualid = visid;
+ fl_visual = XGetVisualInfo(fl_display, VisualIDMask, &templt, &num);
+ if (!fl_visual) Fl::fatal("No visual with id %d",visid);
+ fl_colormap = XCreateColormap(fl_display, RootWindow(fl_display,fl_screen),
+ fl_visual->visual, AllocNone);
+ fl_xpixel(FL_BLACK); // make sure black is allocated
+#else
+ Fl::fatal("Visual id's not supported on MSWindows or MacOS.");
+#endif
+ }
+ window.show(argc,argv);
+ return Fl::run();
+}
+
+//
+// End of "$Id: color_chooser.cxx 5519 2006-10-11 03:12:15Z mike $".
+//
diff --git a/third_party/windows/fltk-1.1.10/test/connect.cxx b/third_party/windows/fltk-1.1.10/test/connect.cxx
new file mode 100644
index 0000000..2c2c6d2
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/connect.cxx
@@ -0,0 +1,77 @@
+//
+// "$Id: connect.cxx 5519 2006-10-11 03:12:15Z mike $"
+//
+// 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-2005 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 <FL/Fl.H>
+#include <FL/Fl_Window.H>
+#include <FL/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 5519 2006-10-11 03:12:15Z mike $".
+//
diff --git a/third_party/windows/fltk-1.1.10/test/cube.cxx b/third_party/windows/fltk-1.1.10/test/cube.cxx
new file mode 100644
index 0000000..f32c629
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/cube.cxx
@@ -0,0 +1,199 @@
+//
+// "$Id: cube.cxx 5519 2006-10-11 03:12:15Z mike $"
+//
+// Another forms test program for the Fast Light Tool Kit (FLTK).
+//
+// Modified to have 2 cubes to test multiple OpenGL contexts
+//
+// Copyright 1998-2005 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 <FL/Fl.H>
+#include <FL/Fl_Window.H>
+#include <FL/Fl_Box.H>
+#include <FL/Fl_Button.H>
+#include <FL/Fl_Radio_Light_Button.H>
+#include <FL/Fl_Slider.H>
+#include <stdlib.h>
+
+#if !HAVE_GL
+class cube_box : public Fl_Box {
+public:
+ double lasttime;
+ int wire;
+ double size;
+ double speed;
+ cube_box(int x,int y,int w,int h,const char *l=0)
+ :Fl_Box(FL_DOWN_BOX,x,y,w,h,l){
+ label("This demo does\nnot work without GL");
+ }
+};
+#else
+#include <FL/Fl_Gl_Window.H>
+#include <FL/gl.h>
+
+class cube_box : public Fl_Gl_Window {
+ void draw();
+ int handle(int);
+public:
+ double lasttime;
+ int wire;
+ double size;
+ double speed;
+ cube_box(int x,int y,int w,int h,const char *l=0)
+ : Fl_Gl_Window(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);
+ gl_font(FL_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();
+ gl_color(FL_GRAY);
+ glDisable(GL_DEPTH_TEST);
+ gl_draw(wire ? "Cube: wire" : "Cube: flat", -4.5f, -4.5f );
+ glEnable(GL_DEPTH_TEST);
+}
+
+int cube_box::handle(int e) {
+ switch (e) {
+ case FL_ENTER: cursor(FL_CURSOR_CROSS); break;
+ case FL_LEAVE: cursor(FL_CURSOR_DEFAULT); break;
+ }
+ return Fl_Gl_Window::handle(e);
+}
+
+#endif
+
+Fl_Window *form;
+Fl_Slider *speed, *size;
+Fl_Button *button, *wire, *flat;
+cube_box *cube, *cube2;
+
+void makeform(const char *name) {
+ form = new Fl_Window(510+390,390,name);
+ new Fl_Box(FL_DOWN_FRAME,20,20,350,350,"");
+ new Fl_Box(FL_DOWN_FRAME,510,20,350,350,"");
+ speed = new Fl_Slider(FL_VERT_SLIDER,390,90,40,220,"Speed");
+ size = new Fl_Slider(FL_VERT_SLIDER,450,90,40,220,"Size");
+ wire = new Fl_Radio_Light_Button(390,20,100,30,"Wire");
+ flat = new Fl_Radio_Light_Button(390,50,100,30,"Flat");
+ button = new Fl_Button(390,340,100,30,"Exit");
+ cube = new cube_box(23,23,344,344, 0);
+ cube2 = new cube_box(513,23,344,344, 0);
+ Fl_Box *b = new Fl_Box(FL_NO_BOX,cube->x(),size->y(),
+ cube->w(),size->h(),0);
+ form->resizable(b);
+ b->hide();
+ form->end();
+}
+
+int main(int argc, char **argv) {
+ makeform(argv[0]);
+ speed->bounds(4,0);
+ speed->value(cube->speed = cube2->speed = 1.0);
+ size->bounds(4,0.01);
+ 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
+ for (;;) {
+ if (form->visible() && speed->value())
+ {if (!Fl::check()) break;} // returns immediately
+ else
+ {if (!Fl::wait()) break;} // waits until something happens
+ cube->wire = wire->value();
+ cube2->wire = !wire->value();
+ cube->size = cube2->size = size->value();
+ cube->speed = cube2->speed = speed->value();
+ cube->redraw();
+ cube2->redraw();
+ if (Fl::readqueue() == button) break;
+ }
+ return 0;
+}
+
+//
+// End of "$Id: cube.cxx 5519 2006-10-11 03:12:15Z mike $".
+//
diff --git a/third_party/windows/fltk-1.1.10/test/cursor.cxx b/third_party/windows/fltk-1.1.10/test/cursor.cxx
new file mode 100644
index 0000000..69895f2
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/cursor.cxx
@@ -0,0 +1,165 @@
+//
+// "$Id: cursor.cxx 5519 2006-10-11 03:12:15Z mike $"
+//
+// Cursor test program for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2005 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 <FL/Fl.H>
+#include <FL/Fl_Window.H>
+#include <FL/Fl_Hor_Value_Slider.H>
+#include <FL/Fl_Choice.H>
+#include <FL/fl_draw.H>
+#include <FL/Fl_Box.H>
+
+Fl_Color fg = FL_BLACK;
+Fl_Color bg = FL_WHITE;
+Fl_Cursor cursor = FL_CURSOR_DEFAULT;
+
+Fl_Hor_Value_Slider *cursor_slider;
+
+void choice_cb(Fl_Widget *, void *v) {
+ cursor = (Fl_Cursor)(long)v;
+ cursor_slider->value(cursor);
+ fl_cursor(cursor,fg,bg);
+}
+
+Fl_Menu_Item choices[] = {
+ {"FL_CURSOR_DEFAULT",0,choice_cb,(void*)FL_CURSOR_DEFAULT},
+ {"FL_CURSOR_ARROW",0,choice_cb,(void*)FL_CURSOR_ARROW},
+ {"FL_CURSOR_CROSS",0,choice_cb,(void*)FL_CURSOR_CROSS},
+ {"FL_CURSOR_WAIT",0,choice_cb,(void*)FL_CURSOR_WAIT},
+ {"FL_CURSOR_INSERT",0,choice_cb,(void*)FL_CURSOR_INSERT},
+ {"FL_CURSOR_HAND",0,choice_cb,(void*)FL_CURSOR_HAND},
+ {"FL_CURSOR_HELP",0,choice_cb,(void*)FL_CURSOR_HELP},
+ {"FL_CURSOR_MOVE",0,choice_cb,(void*)FL_CURSOR_MOVE},
+ {"FL_CURSOR_NS",0,choice_cb,(void*)FL_CURSOR_NS},
+ {"FL_CURSOR_WE",0,choice_cb,(void*)FL_CURSOR_WE},
+ {"FL_CURSOR_NWSE",0,choice_cb,(void*)FL_CURSOR_NWSE},
+ {"FL_CURSOR_NESW",0,choice_cb,(void*)FL_CURSOR_NESW},
+ {"FL_CURSOR_NONE",0,choice_cb,(void*)FL_CURSOR_NONE},
+#if 0
+ {"FL_CURSOR_N",0,choice_cb,(void*)FL_CURSOR_N},
+ {"FL_CURSOR_NE",0,choice_cb,(void*)FL_CURSOR_NE},
+ {"FL_CURSOR_E",0,choice_cb,(void*)FL_CURSOR_E},
+ {"FL_CURSOR_SE",0,choice_cb,(void*)FL_CURSOR_SE},
+ {"FL_CURSOR_S",0,choice_cb,(void*)FL_CURSOR_S},
+ {"FL_CURSOR_SW",0,choice_cb,(void*)FL_CURSOR_SW},
+ {"FL_CURSOR_W",0,choice_cb,(void*)FL_CURSOR_W},
+ {"FL_CURSOR_NW",0,choice_cb,(void*)FL_CURSOR_NW},
+#endif
+ {0}
+};
+
+void setcursor(Fl_Widget *o, void *) {
+ Fl_Hor_Value_Slider *slider = (Fl_Hor_Value_Slider *)o;
+ cursor = Fl_Cursor((int)slider->value());
+ fl_cursor(cursor,fg,bg);
+}
+
+void setfg(Fl_Widget *o, void *) {
+ Fl_Hor_Value_Slider *slider = (Fl_Hor_Value_Slider *)o;
+ fg = Fl_Color((int)slider->value());
+ fl_cursor(cursor,fg,bg);
+}
+
+void setbg(Fl_Widget *o, void *) {
+ Fl_Hor_Value_Slider *slider = (Fl_Hor_Value_Slider *)o;
+ bg = Fl_Color((int)slider->value());
+ fl_cursor(cursor,fg,bg);
+}
+
+// draw the label without any ^C or \nnn conversions:
+class CharBox : public Fl_Box {
+ void draw() {
+ fl_font(FL_FREE_FONT,14);
+ fl_draw(label(), x()+w()/2, y()+h()/2);
+ }
+public:
+ CharBox(int X, int Y, int W, int H, const char* L) : Fl_Box(X,Y,W,H,L) {}
+};
+
+int main(int argc, char **argv) {
+ Fl_Window window(400,300);
+
+ Fl_Choice choice(80,100,200,25,"Cursor:");
+ choice.menu(choices);
+ choice.callback(choice_cb);
+ choice.when(FL_WHEN_RELEASE|FL_WHEN_NOT_CHANGED);
+
+ Fl_Hor_Value_Slider slider1(80,180,310,30,"Cursor:");
+ cursor_slider = &slider1;
+ slider1.align(FL_ALIGN_LEFT);
+ slider1.step(1);
+ slider1.precision(0);
+ slider1.bounds(0,100);
+ slider1.value(0);
+ slider1.callback(setcursor);
+ slider1.value(cursor);
+
+ Fl_Hor_Value_Slider slider2(80,220,310,30,"fgcolor:");
+ slider2.align(FL_ALIGN_LEFT);
+ slider2.step(1);
+ slider2.precision(0);
+ slider2.bounds(0,255);
+ slider2.value(0);
+ slider2.callback(setfg);
+ slider2.value(fg);
+
+ Fl_Hor_Value_Slider slider3(80,260,310,30,"bgcolor:");
+ slider3.align(FL_ALIGN_LEFT);
+ slider3.step(1);
+ slider3.precision(0);
+ slider3.bounds(0,255);
+ slider3.value(0);
+ slider3.callback(setbg);
+ slider3.value(bg);
+
+#if 0
+ // draw the manual's diagram of cursors...
+ window.size(400,800);
+ int y = 300;
+ Fl::set_font(FL_FREE_FONT, "cursor");
+ char buf[100]; char *p = buf;
+ for (Fl_Menu* m = choices; m->label(); m++) {
+ Fl_Box* b = new Fl_Box(35,y,150,25,m->label());
+ b->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
+ int n = (int)(m->argument());
+ if (n == FL_CURSOR_NONE) break;
+ if (n == FL_CURSOR_DEFAULT) n = FL_CURSOR_ARROW;
+ p[0] = (char)((n-1)*2);
+ p[1] = 0;
+ b = new CharBox(15,y,20,20,p); p+=2;
+ y += 25;
+ }
+#endif
+
+ window.resizable(window);
+ window.end();
+ window.show(argc,argv);
+ return Fl::run();
+}
+
+//
+// End of "$Id: cursor.cxx 5519 2006-10-11 03:12:15Z mike $".
+//
diff --git a/third_party/windows/fltk-1.1.10/test/curve.cxx b/third_party/windows/fltk-1.1.10/test/curve.cxx
new file mode 100644
index 0000000..a83111a
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/curve.cxx
@@ -0,0 +1,115 @@
+//
+// "$Id: curve.cxx 5519 2006-10-11 03:12:15Z mike $"
+//
+// Curve test program for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2005 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 <FL/Fl.H>
+#include <FL/Fl_Double_Window.H>
+#include <FL/Fl_Hor_Value_Slider.H>
+#include <FL/fl_draw.H>
+#include <FL/Fl_Toggle_Button.H>
+
+double args[9] = {
+ 20,20, 50,200, 100,20, 200,200, 0};
+const char* name[9] = {
+ "X0", "Y0", "X1", "Y1", "X2", "Y2", "X3", "Y3", "rotate"};
+
+int points;
+
+class Drawing : public Fl_Widget {
+ void draw() {
+ fl_clip(x(),y(),w(),h());
+ fl_color(FL_DARK3);
+ fl_rectf(x(),y(),w(),h());
+ fl_push_matrix();
+ if (args[8]) {
+ fl_translate(x()+w()/2.0, y()+h()/2.0);
+ fl_rotate(args[8]);
+ fl_translate(-(x()+w()/2.0), -(y()+h()/2.0));
+ }
+ fl_translate(x(),y());
+ if (!points) {
+ fl_color(FL_WHITE);
+ fl_begin_complex_polygon();
+ fl_curve(args[0],args[1],args[2],args[3],args[4],args[5],args[6],args[7]);
+ fl_end_complex_polygon();
+ }
+ fl_color(FL_BLACK);
+ fl_begin_line();
+ fl_vertex(args[0],args[1]);
+ fl_vertex(args[2],args[3]);
+ fl_vertex(args[4],args[5]);
+ fl_vertex(args[6],args[7]);
+ fl_end_line();
+ fl_color(points ? FL_WHITE : FL_RED);
+ points ? fl_begin_points() : fl_begin_line();
+ fl_curve(args[0],args[1],args[2],args[3],args[4],args[5],args[6],args[7]);
+ points ? fl_end_points() : fl_end_line();
+ fl_pop_matrix();
+ fl_pop_clip();
+ }
+public:
+ Drawing(int X,int Y,int W,int H) : Fl_Widget(X,Y,W,H) {}
+};
+
+Drawing *d;
+
+void points_cb(Fl_Widget* o, void*) {
+ points = ((Fl_Toggle_Button*)o)->value();
+ d->redraw();
+}
+
+void slider_cb(Fl_Widget* o, void* v) {
+ Fl_Slider* s = (Fl_Slider*)o;
+ args[long(v)] = s->value();
+ d->redraw();
+}
+
+int main(int argc, char** argv) {
+ Fl_Double_Window window(300,555);
+ Drawing drawing(10,10,280,280);
+ d = &drawing;
+
+ int y = 300;
+ for (int n = 0; n<9; n++) {
+ Fl_Slider* s = new Fl_Hor_Value_Slider(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(args[n]);
+ s->align(FL_ALIGN_LEFT);
+ s->callback(slider_cb, (void*)n);
+ }
+ Fl_Toggle_Button but(50,y,50,25,"points");
+ but.callback(points_cb);
+
+ window.end();
+ window.show(argc,argv);
+ return Fl::run();
+}
+
+//
+// End of "$Id: curve.cxx 5519 2006-10-11 03:12:15Z mike $".
+//
diff --git a/third_party/windows/fltk-1.1.10/test/demo.cxx b/third_party/windows/fltk-1.1.10/test/demo.cxx
new file mode 100644
index 0000000..983ba0e
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/demo.cxx
@@ -0,0 +1,378 @@
+//
+// "$Id: demo.cxx 5712 2007-02-23 19:27:43Z matt $"
+//
+// Main demo program for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2007 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) && !defined(__CYGWIN__)
+# include <direct.h>
+# ifndef __WATCOMC__
+// Visual C++ 2005 incorrectly displays a warning about the use of POSIX APIs
+// on Windows, which is supposed to be POSIX compliant...
+# define chdir _chdir
+# define putenv _putenv
+# endif // !__WATCOMC__
+#else
+# include <unistd.h>
+#endif
+#include <FL/Fl.H>
+#include <FL/Fl_Window.H>
+#include <FL/Fl_Box.H>
+#include <FL/Fl_Button.H>
+#include <FL/Fl_Choice.H>
+#include <FL/filename.H>
+#include <FL/x.H>
+
+/* The form description */
+
+void doexit(Fl_Widget *, void *);
+void doback(Fl_Widget *, void *);
+void dobut(Fl_Widget *, long);
+void doscheme(Fl_Choice *c, void *) {
+ Fl::scheme(c->text(c->value()));
+}
+
+Fl_Window *form;
+Fl_Button *but[9];
+
+void create_the_forms() {
+ Fl_Widget *obj;
+ form = new Fl_Window(350, 440);
+ obj = new Fl_Box(FL_FRAME_BOX,10,385,330,40,"FLTK Demonstration");
+ obj->color(FL_GRAY-4);
+ obj->labelsize(24);
+ obj->labelfont(FL_BOLD);
+ obj->labeltype(FL_ENGRAVED_LABEL);
+ obj = new Fl_Box(FL_FRAME_BOX,10,45,330,330,0);
+ obj->color(FL_GRAY-8);
+ obj = new Fl_Button(280,10,60,25,"Exit");
+ obj->callback(doexit);
+ Fl_Choice *choice = new Fl_Choice(75, 10, 100, 25, "Scheme:");
+ choice->labelfont(FL_HELVETICA_BOLD);
+ choice->add("none");
+ choice->add("gtk+");
+ choice->add("plastic");
+ choice->callback((Fl_Callback *)doscheme);
+ Fl::scheme(NULL);
+ if (!Fl::scheme()) choice->value(0);
+ else if (!strcmp(Fl::scheme(), "gtk+")) choice->value(1);
+ else choice->value(2);
+ obj = new Fl_Button(10,45,330,380); obj->type(FL_HIDDEN_BUTTON);
+ obj->callback(doback);
+ obj = but[0] = new Fl_Button(30,265,90,90);
+ obj = but[1] = new Fl_Button(130,265,90,90);
+ obj = but[2] = new Fl_Button(230,265,90,90);
+ obj = but[5] = new Fl_Button(230,165,90,90);
+ obj = but[4] = new Fl_Button(130,165,90,90);
+ obj = but[3] = new Fl_Button(30,165,90,90);
+ obj = but[6] = new Fl_Button(30,65,90,90);
+ obj = but[7] = new Fl_Button(130,65,90,90);
+ obj = but[8] = new Fl_Button(230,65,90,90);
+ for (int i=0; i<9; i++) {
+ but[i]->align(FL_ALIGN_WRAP);
+ but[i]->callback(dobut, i);
+ }
+ form->forms_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(const 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(const char* men, const char* item, const 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]);
+ if (menus[men].icommand[i][0] != '@') but[bn]->tooltip(menus[men].icommand[i]);
+ else but[bn]->tooltip(0);
+ }
+ if (stack[stsize]!=nnn)
+ 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(Fl_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(Fl_Widget *, void *) {pop_menu();}
+
+void doexit(Fl_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)
+ {
+// fl_show_message("ERROR","","Cannot read the menu description file.");
+ return 0;
+ }
+ for (;;) {
+ if (fgets(line,256,fin) == NULL) break;
+ // remove all carriage returns that Cygwin may have inserted
+ char *s = line, *d = line;
+ for (;;++d) {
+ while (*s=='\r') s++;
+ *d = *s++;
+ if (!*d) break;
+ }
+ // interprete the line
+ 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) {
+ putenv((char *)"FLTK_DOCDIR=../documentation");
+ char buf[256];
+ strcpy(buf, argv[0]);
+#if ( defined _MSC_VER || defined __MWERKS__ ) && defined _DEBUG
+ // MS_VisualC appends a 'd' to debugging executables. remove it.
+ fl_filename_setext( buf, "" );
+ buf[ strlen(buf)-1 ] = 0;
+#endif
+ fl_filename_setext(buf,".menu");
+ const char *fname = buf;
+ int i = 0;
+ if (!Fl::args(argc,argv,i) || i < argc-1)
+ Fl::fatal("Usage: %s <switches> <menufile>\n%s",argv[0],Fl::help);
+ if (i < argc) fname = argv[i];
+
+ create_the_forms();
+
+ if (!load_the_menu(fname)) Fl::fatal("Can't open %s",fname);
+ if (buf!=fname)
+ strcpy(buf,fname);
+ const char *c = fl_filename_name(buf);
+ if (c > buf) {buf[c-buf] = 0; chdir(buf);}
+ push_menu("@main");
+ form->show(argc,argv);
+ Fl::run();
+ return 0;
+}
+
+//
+// End of "$Id: demo.cxx 5712 2007-02-23 19:27:43Z matt $".
+//
+
diff --git a/third_party/windows/fltk-1.1.10/test/demo.menu b/third_party/windows/fltk-1.1.10/test/demo.menu
new file mode 100644
index 0000000..a989f8e
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/demo.menu
@@ -0,0 +1,89 @@
+# 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:Fl_Browser:browser
+ @x:Fl_Input:input
+ @x:Fl_Output:output
+ @x:Fl_Button:radio
+ @x:Fl_Tabs:tabs
+ @x:Fl_Tile:tile
+ @x:Fl_Scroll:scroll
+ @x:Fl_Pack:pack
+ @x:Fl_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:resizebox
+ @w:resize:resize
+
+@main:Drawing\nTests:@d
+ @d:Images:@di
+ @di:Fl_Bitmap:bitmap
+ @di:Fl_Pixmap:pixmap
+ @di:Fl_RGB\n_Image:image
+ @di:Fl_Shared\n_Image:pixmap_browser
+ @di:Fl_Tiled\n_Image:tiled_image
+ @d:cursor:cursor
+ @d:labels:label
+ @d:fl_arc:arc
+ @d:fl_curve:curve
+ @d:fl_line_style:line_style
+
+@main:Events:@u
+ @u:navigation:navigation
+ @u:minimum update:minimum
+ @u:keyboard:keyboard
+ @u:fast && slow widgets:fast_slow
+ @u:inactive:inactive
+
+@main:Fluid\n(UI design tool):../fluid/fluid valuators.fl
+
+@main:Cool\nDemos:@e
+ @e:X Color\nBrowser:colbrowser
+ @e:Mandelbrot:mandelbrot
+ @e:Fractals:fractals
+ @e:Puzzle:glpuzzle
+ @e:Block\nAttack!:blocks
+ @e:Checkers:checkers
+ @e:Sudoku:sudoku
+
+@main:Other\nTests:@o
+ @o:Color Choosers:color_chooser r
+ @o:File Chooser:file_chooser
+ @o:Fonts:fonts
+ @o:HelpDialog:help
+ @o:Input Choice:input_choice
+ @o:Preferences:preferences
+ @o:Threading:threads
+ @o:XForms Emulation:forms
+
+@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: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
diff --git a/third_party/windows/fltk-1.1.10/test/desktop/blocks-128.png b/third_party/windows/fltk-1.1.10/test/desktop/blocks-128.png
new file mode 100644
index 0000000..41e6d00
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/desktop/blocks-128.png
Binary files differ
diff --git a/third_party/windows/fltk-1.1.10/test/desktop/blocks-32.png b/third_party/windows/fltk-1.1.10/test/desktop/blocks-32.png
new file mode 100644
index 0000000..073bc0f
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/desktop/blocks-32.png
Binary files differ
diff --git a/third_party/windows/fltk-1.1.10/test/desktop/blocks.desktop b/third_party/windows/fltk-1.1.10/test/desktop/blocks.desktop
new file mode 100644
index 0000000..6dc18a5
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/desktop/blocks.desktop
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Name=Block Attack!
+Comment=Block Attack! Game
+TryExec=blocks
+Exec=blocks
+Icon=blocks
+Terminal=false
+Type=Application
+Categories=Game;BlocksGame;
diff --git a/third_party/windows/fltk-1.1.10/test/desktop/checkers-128.png b/third_party/windows/fltk-1.1.10/test/desktop/checkers-128.png
new file mode 100644
index 0000000..ed02527
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/desktop/checkers-128.png
Binary files differ
diff --git a/third_party/windows/fltk-1.1.10/test/desktop/checkers-32.png b/third_party/windows/fltk-1.1.10/test/desktop/checkers-32.png
new file mode 100644
index 0000000..4adcd66
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/desktop/checkers-32.png
Binary files differ
diff --git a/third_party/windows/fltk-1.1.10/test/desktop/checkers.desktop b/third_party/windows/fltk-1.1.10/test/desktop/checkers.desktop
new file mode 100644
index 0000000..7a10026
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/desktop/checkers.desktop
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Name=Checkers
+Comment=Checkers Game
+TryExec=checkers
+Exec=checkers
+Icon=checkers
+Terminal=false
+Type=Application
+Categories=Game;BoardGame;
diff --git a/third_party/windows/fltk-1.1.10/test/desktop/sudoku-128.png b/third_party/windows/fltk-1.1.10/test/desktop/sudoku-128.png
new file mode 100644
index 0000000..070a410
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/desktop/sudoku-128.png
Binary files differ
diff --git a/third_party/windows/fltk-1.1.10/test/desktop/sudoku-32.png b/third_party/windows/fltk-1.1.10/test/desktop/sudoku-32.png
new file mode 100644
index 0000000..154c273
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/desktop/sudoku-32.png
Binary files differ
diff --git a/third_party/windows/fltk-1.1.10/test/desktop/sudoku.desktop b/third_party/windows/fltk-1.1.10/test/desktop/sudoku.desktop
new file mode 100644
index 0000000..9bdc456
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/desktop/sudoku.desktop
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Name=Sudoku
+Comment=Suduku Number Game
+TryExec=sudoku
+Exec=sudoku
+Icon=sudoku
+Terminal=false
+Type=Application
+Categories=Game;LogicGame;
diff --git a/third_party/windows/fltk-1.1.10/test/doublebuffer.cxx b/third_party/windows/fltk-1.1.10/test/doublebuffer.cxx
new file mode 100644
index 0000000..7227907
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/doublebuffer.cxx
@@ -0,0 +1,128 @@
+//
+// "$Id: doublebuffer.cxx 5519 2006-10-11 03:12:15Z mike $"
+//
+// Double-buffering test program for the Fast Light Tool Kit (FLTK).
+//
+// 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.
+//
+// This demo should work for both the GL and X versions of Fl,
+// even though the double buffering mechanism is totally different.
+//
+// Copyright 1998-2005 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 <FL/Fl.H>
+#include <FL/Fl_Single_Window.H>
+#include <FL/Fl_Double_Window.H>
+#include <FL/Fl_Box.H>
+#include <FL/fl_draw.H>
+#include <FL/Fl_Hor_Slider.H>
+#include <stdlib.h>
+#include <FL/math.h>
+#include <stdio.h>
+
+// this purposely draws each line 10 times to be slow:
+void star(int w, int h, int n) {
+ fl_push_matrix();
+ fl_translate(w/2, h/2);
+ fl_scale(w/2, h/2);
+ for (int i = 0; i < n; i++) {
+ for (int j = i+1; j < n; j++)/* for (int k=0; k<10; k++)*/ {
+ fl_begin_line();
+ fl_vertex(cos(2*M_PI*i/n+.1), sin(2*M_PI*i/n+.1));
+ fl_vertex(cos(2*M_PI*j/n+.1), sin(2*M_PI*j/n+.1));
+ fl_end_line();
+ }
+ }
+ fl_pop_matrix();
+}
+
+int sides[2] = {20,20};
+
+void slider_cb(Fl_Widget* o, long v) {
+ sides[v] = int(((Fl_Slider*)o)->value());
+ o->parent()->redraw();
+}
+
+void bad_draw(int w,int h,int which) {
+// for (int i=0; i<10; i++) {
+// fl_color(7); fl_rectf(0,0,w,h); fl_color(0); star(w,h);
+// fl_color(0); fl_rectf(0,0,w,h); fl_color(7); star(w,h);
+// }
+ fl_color(FL_BLACK); fl_rectf(0,0,w,h);
+ fl_color(FL_WHITE); star(w,h,sides[which]);
+ // for (int x=0; x<sides[which]; x++) for (int y=0; y<sides[which]; y++)
+ //fl_draw_box(FL_UP_BOX, 10*x, 10*y, 25,25, FL_GRAY);
+}
+
+class single_blink_window : public Fl_Single_Window {
+ void draw() {bad_draw(w(),h(),0); draw_child(*child(0));}
+public:
+ single_blink_window(int x, int y,int w,int h,const char *l)
+ : Fl_Single_Window(x,y,w,h,l) {resizable(this);}
+};
+
+class double_blink_window : public Fl_Double_Window {
+ void draw() {bad_draw(w(),h(),1); draw_child(*child(0));}
+public:
+ double_blink_window(int x, int y, int w,int h,const char *l)
+ : Fl_Double_Window(x,y,w,h,l) {resizable(this);}
+};
+
+int main(int argc, char **argv) {
+ if (!Fl::visual(FL_DOUBLE))
+ printf("Xdbe not supported, faking double buffer with pixmaps.\n");
+ Fl_Window w01(420,420,"Fl_Single_Window"); w01.box(FL_FLAT_BOX);
+ single_blink_window w1(10,10,400,400,"Fl_Single_Window");
+ w1.box(FL_FLAT_BOX); w1.color(FL_BLACK); //w1.position(100,200);
+ Fl_Hor_Slider slider0(20,370,360,25);
+ slider0.range(2,30);
+ slider0.step(1);
+ slider0.value(sides[0]);
+ slider0.callback(slider_cb, 0);
+ w1.end();
+ w01.end();
+ Fl_Window w02(420,420,"Fl_Double_Window"); w02.box(FL_FLAT_BOX);
+ double_blink_window w2(10,10,400,400,"Fl_Double_Window");
+ w2.box(FL_FLAT_BOX); w2.color(FL_BLACK); //w2.position(600,200);
+ Fl_Hor_Slider slider1(20,370,360,25);
+ slider1.range(2,30);
+ slider1.step(1);
+ slider1.value(sides[0]);
+ slider1.callback(slider_cb, 1);
+ w2.end();
+ w02.end();
+ w01.show(argc, argv);
+ w1.show();
+ w02.show();
+ w2.show();
+ return Fl::run();
+}
+
+//
+// End of "$Id: doublebuffer.cxx 5519 2006-10-11 03:12:15Z mike $".
+//
diff --git a/third_party/windows/fltk-1.1.10/test/editor.cxx b/third_party/windows/fltk-1.1.10/test/editor.cxx
new file mode 100644
index 0000000..b46be06
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/editor.cxx
@@ -0,0 +1,795 @@
+//
+// "$Id: editor.cxx 5519 2006-10-11 03:12:15Z mike $"
+//
+// 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-2005 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>
+
+#ifdef __MWERKS__
+# define FL_DLL
+#endif
+
+#include <FL/Fl.H>
+#include <FL/Fl_Group.H>
+#include <FL/Fl_Double_Window.H>
+#include <FL/fl_ask.H>
+#include <FL/Fl_File_Chooser.H>
+#include <FL/Fl_Menu_Bar.H>
+#include <FL/Fl_Input.H>
+#include <FL/Fl_Button.H>
+#include <FL/Fl_Return_Button.H>
+#include <FL/Fl_Text_Buffer.H>
+#include <FL/Fl_Text_Editor.H>
+
+
+int changed = 0;
+char filename[256] = "";
+char title[256];
+Fl_Text_Buffer *textbuf = 0;
+
+
+// Syntax highlighting stuff...
+Fl_Text_Buffer *stylebuf = 0;
+Fl_Text_Display::Style_Table_Entry
+ styletable[] = { // Style table
+ { FL_BLACK, FL_COURIER, 14 }, // A - Plain
+ { FL_DARK_GREEN, FL_COURIER_ITALIC, 14 }, // B - Line comments
+ { FL_DARK_GREEN, FL_COURIER_ITALIC, 14 }, // C - Block comments
+ { FL_BLUE, FL_COURIER, 14 }, // D - Strings
+ { FL_DARK_RED, FL_COURIER, 14 }, // E - Directives
+ { FL_DARK_RED, FL_COURIER_BOLD, 14 }, // F - Types
+ { FL_BLUE, FL_COURIER_BOLD, 14 } // 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",
+ "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];
+ char *text = textbuf->text();
+
+
+ memset(style, 'A', textbuf->length());
+ style[textbuf->length()] = '\0';
+
+ if (!stylebuf) stylebuf = new Fl_Text_Buffer(textbuf->length());
+
+ style_parse(text, style, textbuf->length());
+
+ stylebuf->text(style);
+ delete[] style;
+ free(text);
+}
+
+
+//
+// '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);
+ ((Fl_Text_Editor *)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);
+ ((Fl_Text_Editor *)cbArg)->redisplay_range(start, end);
+ }
+
+ free(text);
+ free(style);
+}
+
+
+// Editor window functions and class...
+void save_cb();
+void saveas_cb();
+void find2_cb(Fl_Widget*, void*);
+void replall_cb(Fl_Widget*, void*);
+void replace2_cb(Fl_Widget*, void*);
+void replcan_cb(Fl_Widget*, void*);
+
+class EditorWindow : public Fl_Double_Window {
+ public:
+ EditorWindow(int w, int h, const char* t);
+ ~EditorWindow();
+
+ Fl_Window *replace_dlg;
+ Fl_Input *replace_find;
+ Fl_Input *replace_with;
+ Fl_Button *replace_all;
+ Fl_Return_Button *replace_next;
+ Fl_Button *replace_cancel;
+
+ Fl_Text_Editor *editor;
+ char search[256];
+};
+
+EditorWindow::EditorWindow(int w, int h, const char* t) : Fl_Double_Window(w, h, t) {
+ replace_dlg = new Fl_Window(300, 105, "Replace");
+ replace_find = new Fl_Input(80, 10, 210, 25, "Find:");
+ replace_find->align(FL_ALIGN_LEFT);
+
+ replace_with = new Fl_Input(80, 40, 210, 25, "Replace:");
+ replace_with->align(FL_ALIGN_LEFT);
+
+ replace_all = new Fl_Button(10, 70, 90, 25, "Replace All");
+ replace_all->callback((Fl_Callback *)replall_cb, this);
+
+ replace_next = new Fl_Return_Button(105, 70, 120, 25, "Replace Next");
+ replace_next->callback((Fl_Callback *)replace2_cb, this);
+
+ replace_cancel = new Fl_Button(230, 70, 60, 25, "Cancel");
+ replace_cancel->callback((Fl_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 = fl_choice("The current file has not been saved.\n"
+ "Would you like to save it now?",
+ "Cancel", "Save", "Don't Save");
+
+ if (r == 1) {
+ save_cb(); // Save the file...
+ return !changed;
+ }
+
+ return (r == 2) ? 1 : 0;
+}
+
+int loading = 0;
+void load_file(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)
+ fl_alert("Error reading from file \'%s\':\n%s.", newfile, strerror(errno));
+ else
+ if (!insert) strcpy(filename, newfile);
+ loading = 0;
+ textbuf->call_modify_callbacks();
+}
+
+void save_file(char *newfile) {
+ if (textbuf->savefile(newfile))
+ fl_alert("Error writing to file \'%s\':\n%s.", newfile, strerror(errno));
+ else
+ strcpy(filename, newfile);
+ changed = 0;
+ textbuf->call_modify_callbacks();
+}
+
+void copy_cb(Fl_Widget*, void* v) {
+ EditorWindow* e = (EditorWindow*)v;
+ Fl_Text_Editor::kf_copy(0, e->editor);
+}
+
+void cut_cb(Fl_Widget*, void* v) {
+ EditorWindow* e = (EditorWindow*)v;
+ Fl_Text_Editor::kf_cut(0, e->editor);
+}
+
+void delete_cb(Fl_Widget*, void*) {
+ textbuf->remove_selection();
+}
+
+void find_cb(Fl_Widget* w, void* v) {
+ EditorWindow* e = (EditorWindow*)v;
+ const char *val;
+
+ val = fl_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(Fl_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 fl_alert("No occurrences of \'%s\' found!", e->search);
+}
+
+void set_title(Fl_Window* w) {
+ if (filename[0] == '\0') strcpy(title, "Untitled");
+ 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(Fl_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(Fl_Widget*, void*) {
+ if (!check_save()) return;
+
+ char *newfile = fl_file_chooser("Open File?", "*", filename);
+ if (newfile != NULL) load_file(newfile, -1);
+}
+
+void insert_cb(Fl_Widget*, void *v) {
+ char *newfile = fl_file_chooser("Insert File?", "*", filename);
+ EditorWindow *w = (EditorWindow *)v;
+ if (newfile != NULL) load_file(newfile, w->editor->insert_position());
+}
+
+void paste_cb(Fl_Widget*, void* v) {
+ EditorWindow* e = (EditorWindow*)v;
+ Fl_Text_Editor::kf_paste(0, e->editor);
+}
+
+int num_windows = 0;
+
+void close_cb(Fl_Widget*, void* v) {
+ Fl_Window* w = (Fl_Window*)v;
+ if (num_windows == 1 && !check_save()) {
+ return;
+ }
+
+ w->hide();
+ textbuf->remove_modify_callback(changed_cb, w);
+ Fl::delete_widget(w);
+ num_windows--;
+ if (!num_windows) exit(0);
+}
+
+void quit_cb(Fl_Widget*, void*) {
+ if (changed && !check_save())
+ return;
+
+ exit(0);
+}
+
+void replace_cb(Fl_Widget*, void* v) {
+ EditorWindow* e = (EditorWindow*)v;
+ e->replace_dlg->show();
+}
+
+void replace2_cb(Fl_Widget*, void* v) {
+ EditorWindow* e = (EditorWindow*)v;
+ const char *find = e->replace_find->value();
+ const char *replace = e->replace_with->value();
+
+ 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 fl_alert("No occurrences of \'%s\' found!", find);
+}
+
+void replall_cb(Fl_Widget*, void* v) {
+ EditorWindow* e = (EditorWindow*)v;
+ const char *find = e->replace_find->value();
+ const char *replace = e->replace_with->value();
+
+ find = e->replace_find->value();
+ 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) fl_message("Replaced %d occurrences.", times);
+ else fl_alert("No occurrences of \'%s\' found!", find);
+}
+
+void replcan_cb(Fl_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() {
+ char *newfile;
+
+ newfile = fl_file_chooser("Save File As?", "*", filename);
+ if (newfile != NULL) save_file(newfile);
+}
+
+Fl_Window* new_view();
+
+void view_cb(Fl_Widget*, void*) {
+ Fl_Window* w = new_view();
+ w->show();
+}
+
+Fl_Menu_Item menuitems[] = {
+ { "&File", 0, 0, 0, FL_SUBMENU },
+ { "&New File", 0, (Fl_Callback *)new_cb },
+ { "&Open File...", FL_CTRL + 'o', (Fl_Callback *)open_cb },
+ { "&Insert File...", FL_CTRL + 'i', (Fl_Callback *)insert_cb, 0, FL_MENU_DIVIDER },
+ { "&Save File", FL_CTRL + 's', (Fl_Callback *)save_cb },
+ { "Save File &As...", FL_CTRL + FL_SHIFT + 's', (Fl_Callback *)saveas_cb, 0, FL_MENU_DIVIDER },
+ { "New &View", FL_ALT + 'v', (Fl_Callback *)view_cb, 0 },
+ { "&Close View", FL_CTRL + 'w', (Fl_Callback *)close_cb, 0, FL_MENU_DIVIDER },
+ { "E&xit", FL_CTRL + 'q', (Fl_Callback *)quit_cb, 0 },
+ { 0 },
+
+ { "&Edit", 0, 0, 0, FL_SUBMENU },
+ { "Cu&t", FL_CTRL + 'x', (Fl_Callback *)cut_cb },
+ { "&Copy", FL_CTRL + 'c', (Fl_Callback *)copy_cb },
+ { "&Paste", FL_CTRL + 'v', (Fl_Callback *)paste_cb },
+ { "&Delete", 0, (Fl_Callback *)delete_cb },
+ { 0 },
+
+ { "&Search", 0, 0, 0, FL_SUBMENU },
+ { "&Find...", FL_CTRL + 'f', (Fl_Callback *)find_cb },
+ { "F&ind Again", FL_CTRL + 'g', find2_cb },
+ { "&Replace...", FL_CTRL + 'r', replace_cb },
+ { "Re&place Again", FL_CTRL + 't', replace2_cb },
+ { 0 },
+
+ { 0 }
+};
+
+Fl_Window* new_view() {
+ EditorWindow* w = new EditorWindow(660, 400, title);
+ w->begin();
+ Fl_Menu_Bar* m = new Fl_Menu_Bar(0, 0, 660, 30);
+ m->copy(menuitems, w);
+ w->editor = new Fl_Text_Editor(0, 30, 660, 370);
+ w->editor->buffer(textbuf);
+ w->editor->highlight_data(stylebuf, styletable,
+ sizeof(styletable) / sizeof(styletable[0]),
+ 'A', style_unfinished_cb, 0);
+ w->editor->textfont(FL_COURIER);
+ w->end();
+ w->resizable(w->editor);
+ w->callback((Fl_Callback *)close_cb, w);
+
+ 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 Fl_Text_Buffer;
+ style_init();
+
+ Fl_Window* window = new_view();
+
+ window->show(1, argv);
+
+ if (argc > 1) load_file(argv[1], -1);
+
+ return Fl::run();
+}
+
+//
+// End of "$Id: editor.cxx 5519 2006-10-11 03:12:15Z mike $".
+//
diff --git a/third_party/windows/fltk-1.1.10/test/fast_slow.fl b/third_party/windows/fltk-1.1.10/test/fast_slow.fl
new file mode 100644
index 0000000..ae4b8d8
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/fast_slow.fl
@@ -0,0 +1,40 @@
+# data file for the Fltk User Interface Designer (fluid)
+version 1.00
+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}
+ code0 {o->when(FL_WHEN_CHANGED|FL_WHEN_RELEASE|FL_WHEN_NOT_CHANGED);}
+ }
+ Fl_Slider fast {
+ label {fast
+redraw} selected
+ xywh {140 200 30 200}
+ code0 {o->set_output();}
+ }
+ Fl_Slider slow {
+ label {slow
+redraw} selected
+ xywh {190 200 30 200}
+ code0 {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.}
+ xywh {10 10 300 180} box DOWN_BOX color 53 selection_color 47 labelfont 4 labelsize 12 align 148
+ }
+ }
+}
diff --git a/third_party/windows/fltk-1.1.10/test/file_chooser.cxx b/third_party/windows/fltk-1.1.10/test/file_chooser.cxx
new file mode 100644
index 0000000..842060e
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/file_chooser.cxx
@@ -0,0 +1,345 @@
+//
+// "$Id: file_chooser.cxx 6092 2008-04-11 12:57:37Z matt $"
+//
+// File chooser test program.
+//
+// Copyright 1999-2005 by Michael Sweet.
+//
+// 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 <FL/Fl_File_Chooser.H>
+#include <FL/Fl_File_Icon.H>
+#include <FL/Fl_Shared_Image.H>
+#include <FL/Fl_PNM_Image.H>
+#include <FL/Fl_Light_Button.H>
+#include <string.h>
+
+
+//
+// Globals...
+//
+
+Fl_Input *filter;
+Fl_File_Browser *files;
+Fl_File_Chooser *fc;
+Fl_Shared_Image *image = 0;
+
+
+//
+// Functions...
+//
+
+void close_callback(void);
+void create_callback(void);
+void dir_callback(void);
+void fc_callback(Fl_File_Chooser *, void *);
+void multi_callback(void);
+Fl_Image *pdf_check(const char *, uchar *, int);
+Fl_Image *ps_check(const char *, uchar *, int);
+void show_callback(void);
+
+
+//
+// 'main()' - Create a file chooser and wait for a selection to be made.
+//
+
+int // O - Exit status
+main(int argc, // I - Number of command-line arguments
+ char *argv[]) // I - Command-line arguments
+{
+ Fl_Window *window;// Main window
+ Fl_Button *button;// Buttons
+ Fl_File_Icon *icon; // New file icon
+
+
+ // Make the file chooser...
+ Fl::scheme(NULL);
+ Fl_File_Icon::load_system_icons();
+
+ fc = new Fl_File_Chooser(".", "*", Fl_File_Chooser::SINGLE, "Fl_File_Chooser Test");
+ fc->callback(fc_callback);
+
+ // Register the PS and PDF image types...
+ Fl_Shared_Image::add_handler(pdf_check);
+ Fl_Shared_Image::add_handler(ps_check);
+
+ // Make the main window...
+ window = new Fl_Window(400, 200, "File Chooser Test");
+
+ filter = new Fl_Input(50, 10, 315, 25, "Filter:");
+ if (argc > 1)
+ filter->value(argv[1]);
+ else
+ filter->value("PDF Files (*.pdf)\t"
+ "PostScript Files (*.ps)\t"
+ "Image Files (*.{bmp,gif,jpg,png})\t"
+ "C/C++ Source Files (*.{c,C,cc,cpp,cxx})");
+
+ button = new Fl_Button(365, 10, 25, 25);
+ button->labelcolor(FL_YELLOW);
+ button->callback((Fl_Callback *)show_callback);
+
+ icon = Fl_File_Icon::find(".", Fl_File_Icon::DIRECTORY);
+ icon->label(button);
+
+ button = new Fl_Light_Button(50, 45, 80, 25, "MULTI");
+ button->callback((Fl_Callback *)multi_callback);
+
+ button = new Fl_Light_Button(140, 45, 90, 25, "CREATE");
+ button->callback((Fl_Callback *)create_callback);
+
+ button = new Fl_Light_Button(240, 45, 115, 25, "DIRECTORY");
+ button->callback((Fl_Callback *)dir_callback);
+
+ files = new Fl_File_Browser(50, 80, 340, 75, "Files:");
+ files->align(FL_ALIGN_LEFT);
+
+ button = new Fl_Button(340, 165, 50, 25, "Close");
+ button->callback((Fl_Callback *)close_callback);
+
+ window->resizable(files);
+ window->end();
+ window->show(1, argv);
+
+ Fl::run();
+
+ return (0);
+}
+
+
+//
+// '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() ^ Fl_File_Chooser::CREATE);
+}
+
+
+//
+// 'dir_callback()' - Handle clicks on the directory button.
+//
+
+void
+dir_callback(void)
+{
+ fc->type(fc->type() ^ Fl_File_Chooser::DIRECTORY);
+}
+
+
+//
+// 'fc_callback()' - Handle choices in the file chooser...
+//
+
+void
+fc_callback(Fl_File_Chooser *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() ^ Fl_File_Chooser::MULTI);
+}
+
+
+//
+// 'pdf_check()' - Check for and load the first page of a PDF file.
+//
+
+Fl_Image * // O - Page image or NULL
+pdf_check(const char *name, // I - Name of file
+ uchar *header, // I - Header data
+ int) // I - Length of header data (unused)
+{
+ 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 Fl_PNM_Image(preview);
+}
+
+
+//
+// 'ps_check()' - Check for and load the first page of a PostScript file.
+//
+
+Fl_Image * // O - Page image or NULL
+ps_check(const char *name, // I - Name of file
+ uchar *header, // I - Header data
+ int) // I - Length of header data (unused)
+{
+ 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 Fl_PNM_Image(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();
+
+ while (fc->visible()) {
+ Fl::wait();
+ }
+
+ count = fc->count();
+ if (count > 0)
+ {
+ files->clear();
+
+ for (i = 1; i <= count; i ++)
+ {
+ if (!fc->value(i))
+ break;
+
+ fl_filename_relative(relative, sizeof(relative), fc->value(i));
+
+ files->add(relative,
+ Fl_File_Icon::find(fc->value(i), Fl_File_Icon::PLAIN));
+ }
+
+ files->redraw();
+ }
+}
+
+
+//
+// End of "$Id: file_chooser.cxx 6092 2008-04-11 12:57:37Z matt $".
+//
diff --git a/third_party/windows/fltk-1.1.10/test/fl_jpeg_image.cxx b/third_party/windows/fltk-1.1.10/test/fl_jpeg_image.cxx
new file mode 100644
index 0000000..462494d
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/fl_jpeg_image.cxx
@@ -0,0 +1,203 @@
+//
+// "$Id: fl_jpeg_image.cxx 5519 2006-10-11 03:12:15Z mike $"
+//
+// 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-2005 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 <FL/Fl.H>
+#include <FL/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 <FL/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 <FL/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 5519 2006-10-11 03:12:15Z mike $".
+//
diff --git a/third_party/windows/fltk-1.1.10/test/fonts.cxx b/third_party/windows/fltk-1.1.10/test/fonts.cxx
new file mode 100644
index 0000000..35ac715
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/fonts.cxx
@@ -0,0 +1,183 @@
+//
+// "$Id: fonts.cxx 5519 2006-10-11 03:12:15Z mike $"
+//
+// Font demo program for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2005 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 <FL/Fl.H>
+#include <FL/Fl_Window.H>
+#include <FL/Fl_Hold_Browser.H>
+#include <FL/fl_draw.H>
+#include <FL/Fl_Box.H>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+Fl_Window *form;
+
+class FontDisplay : public Fl_Widget {
+ void draw();
+public:
+ int font, size;
+ FontDisplay(Fl_Boxtype B, int X, int Y, int W, int H, const char* L = 0) :
+ Fl_Widget(X,Y,W,H,L) {box(B); font = 0; size = 14;}
+};
+void FontDisplay::draw() {
+ draw_box();
+ fl_font((Fl_Font)font, size);
+ fl_color(FL_BLACK);
+ fl_draw(label(), x()+3, y()+3, w()-6, h()-6, align());
+}
+
+FontDisplay *textobj;
+
+Fl_Hold_Browser *fontobj, *sizeobj;
+
+int **sizes;
+int *numsizes;
+int pickedsize = 14;
+
+void font_cb(Fl_Widget *, long) {
+ int fn = fontobj->value();
+ if (!fn) return;
+ fn--;
+ textobj->font = fn;
+ sizeobj->clear();
+ int n = numsizes[fn];
+ int *s = sizes[fn];
+ if (!n) {
+ // no sizes
+ } else if (s[0] == 0) {
+ // many sizes;
+ int j = 1;
+ for (int i = 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(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+1);
+ }
+ textobj->redraw();
+}
+
+void size_cb(Fl_Widget *, long) {
+ int i = sizeobj->value();
+ if (!i) return;
+ const char *c = sizeobj->text(i);
+ while (*c < '0' || *c > '9') c++;
+ pickedsize = atoi(c);
+ textobj->size = pickedsize;
+ textobj->redraw();
+}
+
+char label[400];
+
+void create_the_forms() {
+ form = new Fl_Window(550,370);
+
+ strcpy(label, "Hello, world!\n");
+ int i = strlen(label);
+ uchar c;
+ for (c = ' '+1; c < 127; c++) {
+ if (!(c&0x1f)) label[i++]='\n';
+ if (c=='@') label[i++]=c;
+ label[i++]=c;
+ }
+ label[i++] = '\n';
+ for (c = 0xA1; c; c++) {if (!(c&0x1f)) label[i++]='\n'; label[i++]=c;}
+ label[i] = 0;
+
+ textobj = new FontDisplay(FL_FRAME_BOX,10,10,530,170,label);
+ textobj->align(FL_ALIGN_TOP|FL_ALIGN_LEFT|FL_ALIGN_INSIDE|FL_ALIGN_CLIP);
+ textobj->color(9,47);
+ fontobj = new Fl_Hold_Browser(10, 190, 390, 170);
+ fontobj->box(FL_FRAME_BOX);
+ fontobj->color(53,3);
+ fontobj->callback(font_cb);
+ form->resizable(fontobj);
+ sizeobj = new Fl_Hold_Browser(410, 190, 130, 170);
+ sizeobj->box(FL_FRAME_BOX);
+ sizeobj->color(53,3);
+ sizeobj->callback(size_cb);
+ form->end();
+}
+
+#include <FL/fl_ask.H>
+
+int main(int argc, char **argv) {
+ Fl::scheme(NULL);
+ Fl::args(argc, argv);
+ Fl::get_system_colors();
+ create_the_forms();
+#ifdef __APPLE__
+ int i = 0;
+#else
+ int i = fl_choice("Which fonts:","-*","iso8859","All");
+#endif
+ int k = Fl::set_fonts(i ? (i>1 ? "*" : 0) : "-*");
+ sizes = new int*[k];
+ numsizes = new int[k];
+ for (i = 0; i < k; i++) {
+ int t; const char *name = Fl::get_font_name((Fl_Font)i,&t);
+ char buffer[128];
+#if 1
+ if (t) {
+ char *p = buffer;
+ if (t & FL_BOLD) {*p++ = '@'; *p++ = 'b';}
+ if (t & FL_ITALIC) {*p++ = '@'; *p++ = 'i';}
+ strcpy(p,name);
+ name = buffer;
+ }
+#else // this is neat, but really slow on some X servers:
+ sprintf(buffer, "@F%d@.%s", i, name);
+ name = buffer;
+#endif
+ fontobj->add(name);
+ int *s; int n = Fl::get_font_sizes((Fl_Font)i, s);
+ numsizes[i] = n;
+ if (n) {
+ sizes[i] = new int[n];
+ for (int j=0; j<n; j++) sizes[i][j] = s[j];
+ }
+ }
+ fontobj->value(1);
+ font_cb(fontobj,0);
+ form->show(argc,argv);
+ return Fl::run();
+}
+
+//
+// End of "$Id: fonts.cxx 5519 2006-10-11 03:12:15Z mike $".
+//
diff --git a/third_party/windows/fltk-1.1.10/test/forms.cxx b/third_party/windows/fltk-1.1.10/test/forms.cxx
new file mode 100644
index 0000000..24c95e7
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/forms.cxx
@@ -0,0 +1,237 @@
+//
+// "$Id: forms.cxx 5519 2006-10-11 03:12:15Z mike $"
+//
+// Another forms demo for the Fast Light Tool Kit (FLTK).
+//
+// This is an XForms program with very few changes.
+// Search for "fltk" to find all changes necessary to port to fltk.
+//
+// This demo show the different boxtypes. Note that some
+// boxtypes are not appropriate for some objects
+//
+// Copyright 1998-2005 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 <FL/forms.H> // changed for fltk
+
+static int border = 1; // changed from FL_TRANSIENT for fltk
+// (this is so the close box and Esc work to close the window)
+
+typedef struct { int val; const char *name; } VN_struct;
+#define VN(a) {a,#a}
+
+// static VN_struct gmode[] =
+// {
+// VN(StaticGray), VN(GrayScale), VN(StaticColor),
+// VN(PseudoColor), VN(TrueColor), VN(DirectColor),
+// };
+
+static VN_struct btypes[]=
+{
+ {FL_NO_BOX,"no box"},
+ {FL_UP_BOX, "up box"},
+ {FL_DOWN_BOX,"down box"},
+ {FL_BORDER_BOX,"border box"},
+ {FL_SHADOW_BOX,"shadow box"},
+ {FL_FLAT_BOX,"flat box"},
+ {FL_FRAME_BOX,"frame box"},
+ {FL_EMBOSSED_BOX,"embossed box"},
+ {FL_ROUNDED_BOX,"rounded box"},
+ {FL_RFLAT_BOX,"rflat box"},
+ {FL_RSHADOW_BOX,"rshadow box"}, // renamed for fltk
+ {FL_OVAL_BOX,"oval box"},
+ {FL_ROUNDED3D_UPBOX,"rounded3d upbox"},
+ {FL_ROUNDED3D_DOWNBOX,"rounded3d downbox"},
+ {FL_OVAL3D_UPBOX,"oval3d upbox"},
+ {FL_OVAL3D_DOWNBOX,"oval3d downbox"},
+ {FL_PLASTIC_UP_BOX,"plastic upbox"},
+ {FL_PLASTIC_DOWN_BOX,"plastic downbox"},
+ /* sentinel */
+ {-1}
+};
+
+#include "pixmaps/srs.xbm"
+
+/*************** Callback **********************/
+
+FL_FORM *form;
+Fl_Widget *tobj[18], *exitob, *btypeob, *modeob;
+
+void
+boxtype_cb (Fl_Widget * ob, long)
+{
+ int i, req_bt = fl_get_choice(ob) - 1;
+ static int lastbt = -1;
+
+ if(lastbt != req_bt)
+ {
+ fl_freeze_form (form);
+ fl_redraw_form (form);
+ for (i = 0; i < 18; i++)
+ fl_set_object_boxtype (tobj[i], (Fl_Boxtype)btypes[req_bt].val);
+ fl_unfreeze_form (form);
+ lastbt = req_bt;
+ fl_redraw_form(form); // added for fltk
+ }
+}
+
+void
+mode_cb (Fl_Widget *, long)
+{
+// static int lval = -1;
+// int val = fl_get_choice (ob) -1;
+// int db = 0;
+
+// if (val == lval || val < 0)
+// return;
+
+// fl_hide_form (form);
+// if (!fl_mode_capable (gmode[val].val, 0))
+// {
+// fl_set_choice(ob, lval);
+// val = lval;
+// }
+
+// fl_set_graphics_mode (gmode[val].val, db);
+// fl_show_form (form, FL_PLACE_GEOMETRY, border, "Box types");
+
+// lval = val;
+}
+
+/*************** Creation Routines *********************/
+
+void
+create_form_form (void)
+{
+ Fl_Widget *obj;
+
+ form = fl_bgn_form(FL_NO_BOX, 720, 520);
+ obj = fl_add_box(FL_UP_BOX, 0, 0, 720, 520, "");
+ fl_set_object_color(obj, FL_BLUE, FL_COL1);
+ obj = fl_add_box(FL_DOWN_BOX, 10, 90, 700, 420, "");
+ fl_set_object_color(obj, FL_COL1, FL_COL1);
+ obj = fl_add_box(FL_DOWN_BOX, 10, 10, 700, 70, "");
+ fl_set_object_color(obj, FL_SLATEBLUE, FL_COL1);
+ tobj[0] = obj = fl_add_box(FL_UP_BOX, 30, 110, 110, 110, "Box");
+ tobj[1] = obj = fl_add_text(FL_NORMAL_TEXT, 30, 240, 110, 30, "Text");
+ tobj[2] = obj = fl_add_bitmap(FL_NORMAL_BITMAP, 40, 280, 90, 80, "Bitmap");
+ fl_set_object_lcol(obj, FL_BLUE);
+ tobj[3] = obj = fl_add_chart(FL_BAR_CHART, 160, 110, 160, 110, "Chart");
+ tobj[4] = obj = fl_add_clock(FL_ANALOG_CLOCK, 40, 390, 90, 90, "Clock");
+//fl_set_object_dblbuffer(tobj[4],1); // removed for fltk
+ tobj[5]=obj=fl_add_button(FL_NORMAL_BUTTON, 340, 110, 120, 30, "Button");
+ tobj[6]=obj=fl_add_lightbutton(FL_PUSH_BUTTON,340,150,120,30,"Lightbutton");
+ tobj[7]=obj=fl_add_roundbutton(FL_PUSH_BUTTON,340,190,120,30,"Roundbutton");
+ tobj[8]=obj=fl_add_slider(FL_VERT_SLIDER, 160, 250, 40, 230, "Slider");
+ tobj[9]=obj=fl_add_valslider(FL_VERT_SLIDER, 220, 250, 40, 230, "Valslider");
+ tobj[10]=obj=fl_add_dial (FL_LINE_DIAL, 280, 250, 100, 100, "Dial");
+ tobj[11]=obj=fl_add_positioner(FL_NORMAL_POSITIONER,280,380,150,100, "Positioner");
+ tobj[12]=obj=fl_add_counter (FL_NORMAL_COUNTER,480,110,210,30, "Counter");
+ tobj[13]=obj=fl_add_input (FL_NORMAL_INPUT, 520,170,170,30, "Input");
+ tobj[14]=obj=fl_add_menu (FL_PUSH_MENU, 400, 240, 100, 30, "Menu");
+ tobj[15]=obj=fl_add_choice (FL_NORMAL_CHOICE, 580, 250, 110, 30, "Choice");
+ tobj[16]=obj=fl_add_timer (FL_VALUE_TIMER, 580, 210, 110, 30, "Timer");
+//fl_set_object_dblbuffer(tobj[16], 1); // removed for fltk
+ tobj[17]=obj=fl_add_browser (FL_NORMAL_BROWSER,450,300,240, 180, "Browser");
+ exitob=obj= fl_add_button (FL_NORMAL_BUTTON, 590, 30, 100, 30, "Exit");
+ btypeob=obj= fl_add_choice (FL_NORMAL_CHOICE,110,30, 130, 30, "Boxtype");
+ fl_set_object_callback (obj, boxtype_cb, 0);
+ modeob = obj=fl_add_choice(FL_NORMAL_CHOICE,370,30,130,30,"Graphics mode");
+ fl_set_object_callback (obj, mode_cb, 0);
+ fl_end_form ();
+}
+/*---------------------------------------*/
+
+void
+create_the_forms (void)
+{
+ create_form_form ();
+}
+
+/*************** Main Routine ***********************/
+
+const char *browserlines[] = {
+ " ", "@C1@c@l@bObjects Demo", " ",
+ "This demo shows you all", "objects that currently",
+ "exist in the Forms Library.", " ",
+ "You can change the boxtype", "of the different objects",
+ "using the buttons at the", "top of the form. Note that",
+ "some combinations might not", "look too good. Also realize",
+ "that for all object classes", "many different types are",
+ "available with different", "behaviour.", " ",
+ "With this demo you can also", "see the effect of the drawing",
+ "mode on the appearance of the","objects.",
+ 0
+};
+
+
+int
+main (int argc, char *argv[])
+{
+ FL_COLOR c = FL_BLACK;
+ const char **p;
+ VN_struct *vn;
+
+ fl_initialize(&argc, argv, "FormDemo", 0, 0);
+ create_the_forms ();
+ fl_set_bitmap_data (tobj[2], sorceress_width, sorceress_height, sorceress_bits);
+ fl_add_chart_value (tobj[3], 15, "item 1", c++);
+ fl_add_chart_value (tobj[3], 5, "item 2", c++);
+ fl_add_chart_value (tobj[3], -10, "item 3", c++);
+ fl_add_chart_value (tobj[3], 25, "item 4", c++);
+ fl_set_menu (tobj[14], "item 1|item 2|item 3|item 4|item 5");
+ fl_addto_choice (tobj[15], "item 1");
+ fl_addto_choice (tobj[15], "item 2");
+ fl_addto_choice (tobj[15], "item 3");
+ fl_addto_choice (tobj[15], "item 4");
+ fl_addto_choice (tobj[15], "item 5");
+ fl_set_timer (tobj[16], 1000.0);
+
+ for ( p = browserlines; *p; p++)
+ fl_add_browser_line (tobj[17], *p);
+
+ for ( vn = btypes; vn->val >= 0; vn++)
+ fl_addto_choice(btypeob, vn->name);
+
+// {
+// int i;
+// VN_struct *g = gmode, *gs = g + sizeof (gmode) / sizeof (gmode[0]);
+// for (i = 1; g < gs; g++, i++)
+// {
+// fl_addto_choice (modeob, g->name);
+// if(!fl_mode_capable(g->val, 0))
+// fl_set_choice_item_mode(modeob, i, FL_PUP_GRAY);
+// }
+// }
+// fl_set_choice (modeob, fl_vmode+1);
+
+ fl_show_form (form, FL_PLACE_MOUSE, border, "Box types");
+
+ while (fl_do_forms () != exitob)
+ ;
+
+ return 0;
+}
+
+//
+// End of "$Id: forms.cxx 5519 2006-10-11 03:12:15Z mike $".
+//
diff --git a/third_party/windows/fltk-1.1.10/test/fractals.cxx b/third_party/windows/fltk-1.1.10/test/fractals.cxx
new file mode 100644
index 0000000..5ab3ebb
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/fractals.cxx
@@ -0,0 +1,842 @@
+//
+// "$Id: fractals.cxx 5845 2007-05-20 00:01:06Z mike $"
+//
+// 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-2005 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 <FL/Fl.H>
+#include <FL/fl_message.H>
+int main(int, char**) {
+ fl_alert("This demo does not work without GL and GLU (%d)");
+ 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>
+#include <FL/glu.h>
+
+#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 */
+
+#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, 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? */
+ fractal = 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 ***************************/
+/***************************************************************/
+
+int winwidth = 1;
+int winheight = 1;
+
+void reshape(int w, int h)
+{
+ glViewport(0,0,w,h);
+
+ winwidth = w;
+ winheight = h;
+}
+
+void display(void)
+{
+ time_t curtime;
+ char buf[255];
+ static time_t fpstime = 0;
+ static int fpscount = 0;
+ static int fps = 0;
+
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ gluPerspective(60.0, (GLdouble)winwidth/winheight, 0.01, 100);
+ agvViewTransform();
+
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
+
+ if (Rebuild) {
+ Create(fractal);
+ Rebuild = 0;
+ }
+
+ glCallList(fractal);
+
+ if (DrawAxes)
+ glCallList(AXES);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ gluOrtho2D(0.0, winwidth, 0.0, winheight);
+
+ sprintf(buf, "FPS=%d", fps);
+ glColor3f(1.0f, 1.0f, 1.0f);
+ gl_font(FL_HELVETICA, 12);
+ gl_draw(buf, 10, 10);
+
+ //
+ // Use glFinish() instead of glFlush() to avoid getting many frames
+ // ahead of the display (problem with some Linux OpenGL implementations...)
+ //
+
+ glFinish();
+
+ // Update frames-per-second
+ fpscount ++;
+ curtime = time(NULL);
+ if ((curtime - fpstime) >= 2)
+ {
+ fps = (fps + fpscount / (curtime - fpstime)) / 2;
+ fpstime = curtime;
+ fpscount = 0;
+ }
+}
+
+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, MENU_RAND, MENU_MOVE, MENU_AXES } MenuChoices;
+
+void setlevel(int value)
+{
+ Level = value;
+ Rebuild = 1;
+ glutPostRedisplay();
+}
+
+void choosefract(int value)
+{
+ fractal = value;
+ Rebuild = 1;
+ glutPostRedisplay();
+}
+
+void handlemenu(int value)
+{
+ switch (value) {
+ 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((char *)"0", 0); glutAddMenuEntry((char *)"1", 1);
+ glutAddMenuEntry((char *)"2", 2); glutAddMenuEntry((char *)"3", 3);
+ glutAddMenuEntry((char *)"4", 4); glutAddMenuEntry((char *)"5", 5);
+ glutAddMenuEntry((char *)"6", 6); glutAddMenuEntry((char *)"7", 7);
+ glutAddMenuEntry((char *)"8", 8);
+
+ submenu2 = glutCreateMenu(choosefract);
+ glutAddMenuEntry((char *)"Moutain", MOUNTAIN);
+ glutAddMenuEntry((char *)"Tree", TREE);
+ glutAddMenuEntry((char *)"Island", ISLAND);
+
+ submenu3 = glutCreateMenu(agvSwitchMoveMode);
+ glutAddMenuEntry((char *)"Flying", FLYING);
+ glutAddMenuEntry((char *)"Polar", POLAR);
+
+ glutCreateMenu(handlemenu);
+ glutAddSubMenu((char *)"Level", submenu1);
+ glutAddSubMenu((char *)"Fractal", submenu2);
+ glutAddSubMenu((char *)"Movement", submenu3);
+ glutAddMenuEntry((char *)"New Fractal", MENU_RAND);
+ glutAddMenuEntry((char *)"Toggle Axes", MENU_AXES);
+ glutAddMenuEntry((char *)"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;
+ b = new Fl_Button(110,50,30,30,"0"); b->callback(setlevel,(void*)0);
+ b = new Fl_Button(140,50,30,30,"1"); b->callback(setlevel,(void*)1);
+ b = new Fl_Button(170,50,30,30,"2"); b->callback(setlevel,(void*)2);
+ b = new Fl_Button(200,50,30,30,"3"); b->callback(setlevel,(void*)3);
+ b = new Fl_Button(230,50,30,30,"4"); b->callback(setlevel,(void*)4);
+ b = new Fl_Button(260,50,30,30,"5"); b->callback(setlevel,(void*)5);
+ b = new Fl_Button(290,50,30,30,"6"); b->callback(setlevel,(void*)6);
+ b = new Fl_Button(320,50,30,30,"7"); b->callback(setlevel,(void*)7);
+ b = new Fl_Button(350,50,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 5845 2007-05-20 00:01:06Z mike $".
+//
diff --git a/third_party/windows/fltk-1.1.10/test/fracviewer.cxx b/third_party/windows/fltk-1.1.10/test/fracviewer.cxx
new file mode 100644
index 0000000..6866cec
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/fracviewer.cxx
@@ -0,0 +1,506 @@
+/*
+ * 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>
+# include <FL/glu.h>
+
+# 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
diff --git a/third_party/windows/fltk-1.1.10/test/fracviewer.h b/third_party/windows/fltk-1.1.10/test/fracviewer.h
new file mode 100644
index 0000000..00899f3
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/fracviewer.h
@@ -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, 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]);
+
+
+
+
+
+
+
diff --git a/third_party/windows/fltk-1.1.10/test/fromdos.c b/third_party/windows/fltk-1.1.10/test/fromdos.c
new file mode 100644
index 0000000..c79a0ad
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/fromdos.c
@@ -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;
+}
diff --git a/third_party/windows/fltk-1.1.10/test/fullscreen.cxx b/third_party/windows/fltk-1.1.10/test/fullscreen.cxx
new file mode 100644
index 0000000..6f9a554
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/fullscreen.cxx
@@ -0,0 +1,251 @@
+//
+// "$Id: fullscreen.cxx 5845 2007-05-20 00:01:06Z mike $"
+//
+// 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-2005 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 <FL/Fl.H>
+#include <FL/Fl_Single_Window.H>
+#include <FL/Fl_Hor_Slider.H>
+#include <FL/Fl_Toggle_Light_Button.H>
+#include <FL/math.h>
+#include <stdio.h>
+
+#if HAVE_GL
+#include <FL/gl.h>
+#include <FL/Fl_Gl_Window.H>
+
+class shape_window : public Fl_Gl_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) :
+Fl_Gl_Window(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 j = 0; j < sides; j ++) {
+ double ang = j*2*M_PI/sides;
+ glVertex3f(cos(ang),sin(ang),0);
+ }
+ glEnd();
+}
+
+#else
+
+#include <FL/fl_draw.H>
+
+class shape_window : public Fl_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) :
+Fl_Window(x,y,w,h,l) {
+ sides = 3;
+}
+
+void shape_window::draw() {
+ fl_color(0);
+ fl_rectf(0,0,w(),h());
+ fl_font(0,20);
+ fl_color(7);
+ fl_draw("This requires GL",0,0,w(),h(),FL_ALIGN_CENTER);
+}
+
+#endif
+
+void sides_cb(Fl_Widget *o, void *p) {
+ shape_window *sw = (shape_window *)p;
+ sw->sides = int(((Fl_Slider *)o)->value());
+ sw->redraw();
+}
+
+#if HAVE_GL
+void double_cb(Fl_Widget *o, void *p) {
+ shape_window *sw = (shape_window *)p;
+ int d = ((Fl_Button *)o)->value();
+ sw->mode(d ? Fl_Mode(FL_DOUBLE|FL_RGB) : FL_RGB);
+}
+#else
+void double_cb(Fl_Widget *, void *) {}
+#endif
+
+void border_cb(Fl_Widget *o, void *p) {
+ Fl_Window *w = (Fl_Window *)p;
+ int d = ((Fl_Button *)o)->value();
+ w->border(d);
+#if defined(WIN32) || defined(__APPLE__)
+ int wx = w->x(), wy = w->y();
+ w->hide(); w->show();
+ w->position(wx, wy);
+#endif
+}
+
+int px,py,pw,ph;
+Fl_Button *border_button;
+void fullscreen_cb(Fl_Widget *o, void *p) {
+ Fl_Window *w = (Fl_Window *)p;
+ int d = ((Fl_Button *)o)->value();
+ if (d) {
+ px = w->x();
+ py = w->y();
+ pw = w->w();
+ ph = w->h();
+ w->fullscreen();
+ } else {
+ w->fullscreen_off(px,py,pw,ph);
+ }
+}
+
+#include <stdlib.h>
+
+void exit_cb(Fl_Widget *, void *) {
+ 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 (Fl::args(argc,argv,i,arg) < argc)
+ Fl::fatal("Options are:\n -2 = 2 windows\n -f = startup fullscreen\n%s",Fl::help);
+
+ Fl_Single_Window window(300,300+30*NUMB); window.end();
+
+ shape_window sw(10,10,window.w()-20,window.h()-30*NUMB-20);
+#if HAVE_GL
+ sw.mode(FL_RGB);
+#endif
+
+ Fl_Window *w;
+ if (twowindow) { // make it's own window
+ sw.resizable(&sw);
+ w = &sw;
+ window.set_modal(); // 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;
+ Fl_Hor_Slider slider(50,y,window.w()-60,30,"Sides:");
+ slider.align(FL_ALIGN_LEFT);
+ slider.callback(sides_cb,&sw);
+ slider.value(sw.sides);
+ slider.step(1);
+ slider.bounds(3,40);
+ y+=30;
+
+ Fl_Toggle_Light_Button b1(50,y,window.w()-60,30,"Double Buffered");
+ b1.callback(double_cb,&sw);
+ y+=30;
+
+ Fl_Toggle_Light_Button b2(50,y,window.w()-60,30,"Border");
+ b2.callback(border_cb,w);
+ b2.set();
+ border_button = &b2;
+ y+=30;
+
+ Fl_Toggle_Light_Button b3(50,y,window.w()-60,30,"FullScreen");
+ b3.callback(fullscreen_cb,w);
+ y+=30;
+
+ Fl_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 Fl::run();
+}
+
+//
+// End of "$Id: fullscreen.cxx 5845 2007-05-20 00:01:06Z mike $".
+//
diff --git a/third_party/windows/fltk-1.1.10/test/gl_overlay.cxx b/third_party/windows/fltk-1.1.10/test/gl_overlay.cxx
new file mode 100644
index 0000000..1a44fec
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/gl_overlay.cxx
@@ -0,0 +1,157 @@
+//
+// "$Id: gl_overlay.cxx 5845 2007-05-20 00:01:06Z mike $"
+//
+// OpenGL overlay test program for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2005 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 <FL/Fl.H>
+#include <FL/Fl_Window.H>
+#include <FL/Fl_Hor_Slider.H>
+#include <FL/Fl_Toggle_Button.H>
+#include <FL/math.h>
+
+#if !HAVE_GL
+#include <FL/Fl_Box.H>
+class shape_window : public Fl_Box {
+public:
+ int sides;
+ shape_window(int x,int y,int w,int h,const char *l=0)
+ :Fl_Box(FL_DOWN_BOX,x,y,w,h,l){
+ label("This demo does\nnot work without GL");
+ }
+};
+#else
+#include <FL/gl.h>
+#include <FL/Fl_Gl_Window.H>
+
+class shape_window : public Fl_Gl_Window {
+ 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) :
+Fl_Gl_Window(x,y,w,h,l) {
+ sides = overlay_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 but slow graphic:
+ glClear(GL_COLOR_BUFFER_BIT);
+ // for (int j=1; j<=1000; j++) {
+ glBegin(GL_POLYGON);
+ for (int j=0; j<sides; j++) {
+ double ang = j*2*M_PI/sides;
+ glColor3f(float(j)/sides,float(j)/sides,float(j)/sides);
+ glVertex3f(cos(ang),sin(ang),0);
+ }
+ glEnd();
+ // }
+}
+
+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:
+ gl_color(FL_RED);
+ glBegin(GL_LINE_LOOP);
+ for (int j=0; j<overlay_sides; j++) {
+ double ang = j*2*M_PI/overlay_sides;
+ glVertex3f(cos(ang),sin(ang),0);
+ }
+ glEnd();
+}
+#endif
+
+// when you change the data, as in this callback, you must call redraw():
+void sides_cb(Fl_Widget *o, void *p) {
+ shape_window *sw = (shape_window *)p;
+ sw->sides = int(((Fl_Slider *)o)->value());
+ sw->redraw();
+}
+
+#if HAVE_GL
+void overlay_sides_cb(Fl_Widget *o, void *p) {
+ shape_window *sw = (shape_window *)p;
+ sw->overlay_sides = int(((Fl_Slider *)o)->value());
+ sw->redraw_overlay();
+}
+#endif
+#include <stdio.h>
+int main(int argc, char **argv) {
+
+ Fl_Window window(300, 370);
+
+ shape_window sw(10, 75, window.w()-20, window.h()-90);
+//sw.mode(FL_RGB);
+ window.resizable(&sw);
+
+ Fl_Hor_Slider slider(60, 5, window.w()-70, 30, "Sides:");
+ slider.align(FL_ALIGN_LEFT);
+ slider.callback(sides_cb,&sw);
+ slider.value(sw.sides);
+ slider.step(1);
+ slider.bounds(3,40);
+
+ Fl_Hor_Slider oslider(60, 40, window.w()-70, 30, "Overlay:");
+ oslider.align(FL_ALIGN_LEFT);
+#if HAVE_GL
+ oslider.callback(overlay_sides_cb,&sw);
+ oslider.value(sw.overlay_sides);
+#endif
+ oslider.step(1);
+ oslider.bounds(3,40);
+
+ window.end();
+ window.show(argc,argv);
+#if HAVE_GL
+ printf("Can do overlay = %d\n", sw.can_do_overlay());
+ sw.show();
+ sw.redraw_overlay();
+#else
+ sw.show();
+#endif
+
+ return Fl::run();
+}
+
+//
+// End of "$Id: gl_overlay.cxx 5845 2007-05-20 00:01:06Z mike $".
+//
diff --git a/third_party/windows/fltk-1.1.10/test/glpuzzle.cxx b/third_party/windows/fltk-1.1.10/test/glpuzzle.cxx
new file mode 100644
index 0000000..464f660
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/glpuzzle.cxx
@@ -0,0 +1,1486 @@
+//
+// "$Id: glpuzzle.cxx 5845 2007-05-20 00:01:06Z mike $"
+//
+// 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-2005 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 <FL/Fl.H>
+#include <FL/fl_message.H>
+int main(int, char**) {
+ fl_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 <FL/glut.H> // changed for fltk
+#include <FL/glu.h> // added for fltk
+#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;
+
+ value = 0;
+ for (i = 0; i < HEIGHT; i++) {
+ for (j = 0; j < WIDTH; j++) {
+ value = value + convert[(int)config[i][j]];
+ 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;
+
+ for (i = 0; i < WIDTH; i++) {
+ for (j = 0; j < HEIGHT; j++) {
+ if (convert[(int)config[j][i]] !=
+ convert[(int)newpiece->pieces[j][i]])
+ 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((char *)"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((char *)"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, (char *)"Solving", 1);
+ glutSetWindowTitle((char *)"glpuzzle");
+ movingPiece = 0;
+ } else {
+ glutChangeToMenuEntry(1, (char *)"Stop solving", 1);
+ glutSetWindowTitle((char *)"Solving...");
+ if (solvePuzzle()) {
+ solving = 1;
+ }
+ }
+ changeState();
+ glutPostRedisplay();
+}
+
+void reset(void)
+{
+ if (solving) {
+ freeSolutions();
+ solving = 0;
+ glutChangeToMenuEntry(1, (char *)"Solving", 1);
+ glutSetWindowTitle((char *)"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, (char *)"Solving", 1);
+ glutSetWindowTitle((char *)"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, (char *)"Solving", 1);
+ glutSetWindowTitle((char *)"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, (char *)"Solving", 1);
+ glutSetWindowTitle((char *)"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)
+{
+ puts("Usage: puzzle [-s]");
+ puts(" -s: Run in single buffered mode");
+ 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);
+
+ puts("");
+ puts("r Reset puzzle");
+ puts("s Solve puzzle (may take a few seconds to compute)");
+ puts("d Destroy a piece - makes the puzzle easier");
+ puts("b Toggles the depth buffer on and off");
+ puts("");
+ puts("Left mouse moves pieces");
+ puts("Middle mouse spins the puzzle");
+ puts("Right mouse has menu");
+
+ glutReshapeFunc(Reshape);
+ glutDisplayFunc(redraw);
+ glutKeyboardFunc(keyboard);
+ glutMotionFunc(motion);
+ glutMouseFunc(mouse);
+ glutVisibilityFunc(visibility);
+ glutCreateMenu(menu);
+ glutAddMenuEntry((char *)"Solve", 1);
+ glutAddMenuEntry((char *)"Reset", 2);
+ glutAddMenuEntry((char *)"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 5845 2007-05-20 00:01:06Z mike $".
+//
diff --git a/third_party/windows/fltk-1.1.10/test/hello.cxx b/third_party/windows/fltk-1.1.10/test/hello.cxx
new file mode 100644
index 0000000..b6f9e76
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/hello.cxx
@@ -0,0 +1,47 @@
+//
+// "$Id: hello.cxx 6102 2008-04-21 19:54:34Z matt $"
+//
+// Hello, World! program for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2005 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 <FL/Fl.H>
+#include <FL/Fl_Window.H>
+#include <FL/Fl_Box.H>
+#include <FL/filename.H>
+
+int main(int argc, char **argv) {
+ Fl_Window *window = new Fl_Window(300,180);
+ Fl_Box *box = new Fl_Box(FL_UP_BOX,20,40,260,100,"Hello, World!");
+ box->labelfont(FL_BOLD+FL_ITALIC);
+ box->labelsize(36);
+ box->labeltype(FL_SHADOW_LABEL);
+ window->end();
+ window->show(argc, argv);
+ return Fl::run();
+}
+
+//
+// End of "$Id: hello.cxx 6102 2008-04-21 19:54:34Z matt $".
+//
+
diff --git a/third_party/windows/fltk-1.1.10/test/help.cxx b/third_party/windows/fltk-1.1.10/test/help.cxx
new file mode 100644
index 0000000..7926938
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/help.cxx
@@ -0,0 +1,69 @@
+//
+// "$Id: help.cxx 5519 2006-10-11 03:12:15Z mike $"
+//
+// Fl_Help_Dialog test program.
+//
+// Copyright 1999-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
+//
+// Contents:
+//
+// main() - Display the help GUI...
+//
+
+//
+// Include necessary headers...
+//
+
+#include <FL/Fl_Help_Dialog.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
+{
+ Fl_Help_Dialog *help; // Help dialog
+
+
+ help = new Fl_Help_Dialog;
+
+ if (argc < 2)
+ help->load("../documentation/index.html");
+ else
+ help->load(argv[1]);
+
+ help->show(1, argv);
+
+ Fl::run();
+
+ delete help;
+
+ return (0);
+}
+
+
+//
+// End of "$Id: help.cxx 5519 2006-10-11 03:12:15Z mike $".
+//
diff --git a/third_party/windows/fltk-1.1.10/test/iconize.cxx b/third_party/windows/fltk-1.1.10/test/iconize.cxx
new file mode 100644
index 0000000..029eddc
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/iconize.cxx
@@ -0,0 +1,83 @@
+//
+// "$Id: iconize.cxx 5519 2006-10-11 03:12:15Z mike $"
+//
+// Iconize test program for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2005 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 <FL/Fl.H>
+#include <FL/Fl_Window.H>
+#include <FL/Fl_Button.H>
+#include <FL/Fl_Box.H>
+#include <stdlib.h>
+
+void iconize_cb(Fl_Widget *, void *v) {
+ Fl_Window *w = (Fl_Window *)v;
+ w->iconize();
+}
+
+void show_cb(Fl_Widget *, void *v) {
+ Fl_Window *w = (Fl_Window *)v;
+ w->show();
+}
+
+void hide_cb(Fl_Widget *, void *v) {
+ Fl_Window *w = (Fl_Window *)v;
+ w->hide();
+}
+
+void window_cb(Fl_Widget*, void*) {
+ exit(0);
+}
+
+int main(int argc, char **argv) {
+
+ Fl_Window mainw(200,200);
+ mainw.end();
+ mainw.show(argc,argv);
+
+ Fl_Window control(120,120);
+
+ Fl_Button hide_button(0,0,120,30,"hide()");
+ hide_button.callback(hide_cb, &mainw);
+
+ Fl_Button iconize_button(0,30,120,30,"iconize()");
+ iconize_button.callback(iconize_cb, &mainw);
+
+ Fl_Button show_button(0,60,120,30,"show()");
+ show_button.callback(show_cb, &mainw);
+
+ Fl_Button show_button2(0,90,120,30,"show this");
+ show_button2.callback(show_cb, &control);
+
+ // Fl_Box box(FL_NO_BOX,0,60,120,30,"Also try running\nwith -i switch");
+
+ control.end();
+ control.show();
+ control.callback(window_cb);
+ return Fl::run();
+}
+
+//
+// End of "$Id: iconize.cxx 5519 2006-10-11 03:12:15Z mike $".
+//
diff --git a/third_party/windows/fltk-1.1.10/test/image.cxx b/third_party/windows/fltk-1.1.10/test/image.cxx
new file mode 100644
index 0000000..197af20
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/image.cxx
@@ -0,0 +1,161 @@
+//
+// "$Id: image.cxx 5519 2006-10-11 03:12:15Z mike $"
+//
+// Fl_Image test program for the Fast Light Tool Kit (FLTK).
+//
+// Notice that Fl_Image is for a static, multiple-reuse image, such
+// as an icon or postage stamp. Use fl_draw_image to go directly
+// from an buffered image that changes often.
+//
+// Copyright 1998-2005 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 <FL/Fl.H>
+#include <FL/Fl_Window.H>
+#include <FL/Fl_Button.H>
+#include <FL/Fl_Image.H>
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+
+int width = 100;
+int height = 100;
+uchar *image;
+
+void make_image() {
+ image = new uchar[4*width*height];
+ uchar *p = image;
+ for (int y = 0; y < height; y++) {
+ double Y = double(y)/(height-1);
+ for (int x = 0; x < width; x++) {
+ double X = double(x)/(width-1);
+ *p++ = uchar(255*((1-X)*(1-Y))); // red in upper-left
+ *p++ = uchar(255*((1-X)*Y)); // green in lower-left
+ *p++ = uchar(255*(X*Y)); // blue in lower-right
+ X -= 0.5;
+ Y -= 0.5;
+ int alpha = (int)(255 * sqrt(X * X + Y * Y));
+ if (alpha < 255) *p++ = uchar(alpha); // alpha transparency
+ else *p++ = 255;
+ Y += 0.5;
+ }
+ }
+}
+
+#include <FL/Fl_Toggle_Button.H>
+
+Fl_Toggle_Button *leftb,*rightb,*topb,*bottomb,*insideb,*overb,*inactb;
+Fl_Button *b;
+Fl_Window *w;
+
+void button_cb(Fl_Widget *,void *) {
+ int i = 0;
+ if (leftb->value()) i |= FL_ALIGN_LEFT;
+ if (rightb->value()) i |= FL_ALIGN_RIGHT;
+ if (topb->value()) i |= FL_ALIGN_TOP;
+ if (bottomb->value()) i |= FL_ALIGN_BOTTOM;
+ if (insideb->value()) i |= FL_ALIGN_INSIDE;
+ if (overb->value()) i |= FL_ALIGN_TEXT_OVER_IMAGE;
+ b->align(i);
+ if (inactb->value()) b->deactivate();
+ else b->activate();
+ w->redraw();
+}
+
+#include <FL/x.H>
+#if !defined(WIN32) && !defined(__APPLE__)
+#include "list_visuals.cxx"
+#endif
+
+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;
+}
+
+int main(int argc, char **argv) {
+#if !defined(WIN32) && !defined(__APPLE__)
+ int i = 1;
+
+ Fl::args(argc,argv,i,arg);
+
+ 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 in overlay visuals
+ } else {
+ Fl::visual(FL_RGB);
+ }
+#endif
+
+ Fl_Window window(400,400); ::w = &window;
+ window.color(FL_WHITE);
+ Fl_Button b(140,160,120,120,"Image w/Alpha"); ::b = &b;
+
+ Fl_RGB_Image *rgb;
+ Fl_Image *dergb;
+
+ make_image();
+ rgb = new Fl_RGB_Image(image, width, height,4);
+ dergb = rgb->copy();
+ dergb->inactive();
+
+ b.image(rgb);
+ b.deimage(dergb);
+
+ leftb = new Fl_Toggle_Button(25,50,50,25,"left");
+ leftb->callback(button_cb);
+ rightb = new Fl_Toggle_Button(75,50,50,25,"right");
+ rightb->callback(button_cb);
+ topb = new Fl_Toggle_Button(125,50,50,25,"top");
+ topb->callback(button_cb);
+ bottomb = new Fl_Toggle_Button(175,50,50,25,"bottom");
+ bottomb->callback(button_cb);
+ insideb = new Fl_Toggle_Button(225,50,50,25,"inside");
+ insideb->callback(button_cb);
+ overb = new Fl_Toggle_Button(25,75,100,25,"text over");
+ overb->callback(button_cb);
+ inactb = new Fl_Toggle_Button(125,75,100,25,"inactive");
+ inactb->callback(button_cb);
+ window.resizable(window);
+ window.end();
+ window.show(argc, argv);
+ return Fl::run();
+}
+
+//
+// End of "$Id: image.cxx 5519 2006-10-11 03:12:15Z mike $".
+//
diff --git a/third_party/windows/fltk-1.1.10/test/inactive.fl b/third_party/windows/fltk-1.1.10/test/inactive.fl
new file mode 100644
index 0000000..56a8e51
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/inactive.fl
@@ -0,0 +1,120 @@
+# data file for the Fltk User Interface Designer (fluid)
+version 1.0107
+header_name {.h}
+code_name {.cxx}
+Function {} {open
+} {
+ Fl_Window {} {open
+ xywh {379 190 420 369} type Double resizable visible
+ } {
+ Fl_Group the_group {
+ label {activate()/deactivate() called on this Fl_Group} open
+ xywh {25 25 375 295} box ENGRAVED_FRAME align 17 resizable
+ } {
+ Fl_Button {} {
+ label button
+ xywh {50 50 105 25}
+ }
+ Fl_Light_Button {} {
+ label {light button}
+ xywh {50 80 105 25} value 1 align 16
+ }
+ Fl_Group {} {
+ label {Child group} open
+ xywh {50 130 105 125} box DOWN_FRAME
+ } {
+ Fl_Check_Button {} {
+ label red
+ xywh {50 170 105 25} type Radio down_box DIAMOND_DOWN_BOX selection_color 1 labelcolor 1
+ }
+ Fl_Check_Button {} {
+ label green
+ xywh {50 190 105 25} type Radio down_box DIAMOND_DOWN_BOX selection_color 2 labelcolor 2
+ }
+ Fl_Check_Button {} {
+ label blue
+ xywh {50 210 105 25} type Radio down_box DIAMOND_DOWN_BOX selection_color 4 labelcolor 4
+ }
+ Fl_Check_Button {} {
+ label white
+ xywh {50 230 105 25} type Radio down_box DIAMOND_DOWN_BOX selection_color 55 labelcolor 55
+ }
+ Fl_Check_Button {} {
+ label check
+ xywh {50 130 105 25} down_box DOWN_BOX
+ }
+ Fl_Round_Button {} {
+ label round
+ xywh {50 150 105 25} down_box ROUND_DOWN_BOX
+ }
+ }
+ Fl_Slider {} {
+ label Fl_Slider selected
+ xywh {165 50 24 205} value 0.5
+ }
+ Fl_Input {} {
+ xywh {195 50 195 30}
+ code0 {o->static_value("Fl_Input");}
+ }
+ Fl_Menu_Button {} {
+ label menu open
+ xywh {245 90 130 30}
+ } {
+ MenuItem {} {
+ label item
+ xywh {0 0 100 20} labelsize 14
+ }
+ MenuItem {} {
+ label item
+ xywh {10 10 100 20} labelsize 14
+ }
+ MenuItem {} {
+ label item
+ xywh {20 20 100 20} labelsize 14
+ }
+ MenuItem {} {
+ label item
+ xywh {30 30 100 20} labelsize 14
+ }
+ MenuItem {} {
+ label item
+ xywh {40 40 100 20} labelsize 14
+ }
+ }
+ Fl_Value_Output {} {
+ label {value:}
+ xywh {245 130 130 30} maximum 10000 step 1 textfont 5 textsize 24 textcolor 4
+ }
+ Fl_Box {} {
+ label Fl_Box
+ xywh {245 170 140 50} box EMBOSSED_FRAME labeltype SHADOW_LABEL labelfont 3 labelsize 38
+ }
+ Fl_Scrollbar {} {
+ label scrollbar
+ xywh {40 274 180 20} type Horizontal
+ }
+ Fl_Roller {} {
+ label roller
+ xywh {235 230 25 65}
+ }
+ Fl_Dial {} {
+ label dial
+ xywh {275 235 50 50}
+ }
+ Fl_Clock {} {
+ label clock
+ xywh {335 235 50 50}
+ }
+ }
+ Fl_Button {} {
+ label active
+ callback {the_group->activate();}
+ xywh {25 330 185 25} type Radio value 1
+ }
+ Fl_Button {} {
+ label inactive
+ callback {the_group->deactivate();}
+ xywh {220 330 180 25} type Radio
+ }
+ }
+}
diff --git a/third_party/windows/fltk-1.1.10/test/input.cxx b/third_party/windows/fltk-1.1.10/test/input.cxx
new file mode 100644
index 0000000..128b482
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/input.cxx
@@ -0,0 +1,142 @@
+//
+// "$Id: input.cxx 5519 2006-10-11 03:12:15Z mike $"
+//
+// Input field test program for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2005 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 <FL/Fl.H>
+#include <FL/Fl_Window.H>
+#include <FL/Fl_Input.H>
+#include <FL/Fl_Float_Input.H>
+#include <FL/Fl_Int_Input.H>
+#include <FL/Fl_Secret_Input.H>
+#include <FL/Fl_Multiline_Input.H>
+#include <FL/Fl_Button.H>
+#include <FL/Fl_Toggle_Button.H>
+#include <FL/Fl_Color_Chooser.H>
+
+void cb(Fl_Widget *ob) {
+ printf("Callback for %s '%s'\n",ob->label(),((Fl_Input*)ob)->value());
+}
+
+int when = 0;
+Fl_Input *input[5];
+
+void toggle_cb(Fl_Widget *o, long v) {
+ if (((Fl_Toggle_Button*)o)->value()) when |= v; else when &= ~v;
+ for (int i=0; i<5; i++) input[i]->when(when);
+}
+
+void test(Fl_Input *i) {
+ if (i->changed()) {
+ i->clear_changed(); printf("%s '%s'\n",i->label(),i->value());
+ }
+}
+
+void button_cb(Fl_Widget *,void *) {
+ for (int i=0; i<5; i++) test(input[i]);
+}
+
+void color_cb(Fl_Widget* button, void* v) {
+ Fl_Color c;
+ switch ((long)v) {
+ case 0: c = FL_BACKGROUND2_COLOR; break;
+ case 1: c = FL_SELECTION_COLOR; break;
+ default: c = FL_FOREGROUND_COLOR; break;
+ }
+ uchar r,g,b; Fl::get_color(c, r,g,b);
+ if (fl_color_chooser(0,r,g,b)) {
+ Fl::set_color(c,r,g,b); Fl::redraw();
+ button->labelcolor(fl_contrast(FL_BLACK,c));
+ button->redraw();
+ }
+}
+
+int main(int argc, char **argv) {
+ // the following two lines set the correct color scheme, so that
+ // calling fl_contrast below will return good results
+ Fl::args(argc, argv);
+ Fl::get_system_colors();
+ Fl_Window *window = new Fl_Window(400,400);
+
+ int y = 10;
+ input[0] = new Fl_Input(70,y,300,30,"Normal:"); y += 35;
+ input[0]->tooltip("Normal input field");
+ // input[0]->cursor_color(FL_SELECTION_COLOR);
+ // input[0]->maximum_size(20);
+ // input[0]->static_value("this is a testgarbage");
+ input[1] = new Fl_Float_Input(70,y,300,30,"Float:"); y += 35;
+ input[1]->tooltip("Input field for floating-point number");
+ input[2] = new Fl_Int_Input(70,y,300,30,"Int:"); y += 35;
+ input[2]->tooltip("Input field for integer number");
+ input[3] = new Fl_Secret_Input(70,y,300,30,"Secret:"); y += 35;
+ input[3]->tooltip("Input field for password");
+ input[4] = new Fl_Multiline_Input(70,y,300,100,"Multiline:"); y += 105;
+ input[4]->tooltip("Input field for short text with newlines");
+ input[4]->wrap(1);
+
+ for (int i = 0; i < 4; i++) {
+ input[i]->when(0); input[i]->callback(cb);
+ }
+ int y1 = y;
+
+ Fl_Button *b;
+ b = new Fl_Toggle_Button(10,y,200,25,"FL_WHEN_CHANGED");
+ b->callback(toggle_cb, FL_WHEN_CHANGED); y += 25;
+ b->tooltip("Do callback each time the text changes");
+ b = new Fl_Toggle_Button(10,y,200,25,"FL_WHEN_RELEASE");
+ b->callback(toggle_cb, FL_WHEN_RELEASE); y += 25;
+ b->tooltip("Do callback when widget loses focus");
+ b = new Fl_Toggle_Button(10,y,200,25,"FL_WHEN_ENTER_KEY");
+ b->callback(toggle_cb, FL_WHEN_ENTER_KEY); y += 25;
+ b->tooltip("Do callback when user hits Enter key");
+ b = new Fl_Toggle_Button(10,y,200,25,"FL_WHEN_NOT_CHANGED");
+ b->callback(toggle_cb, FL_WHEN_NOT_CHANGED); y += 25;
+ b->tooltip("Do callback even if the text is not changed");
+ y += 5;
+ b = new Fl_Button(10,y,200,25,"&print changed()");
+ b->callback(button_cb);
+ b->tooltip("Print widgets that have changed() flag set");
+
+ b = new Fl_Button(220,y1,100,25,"color"); y1 += 25;
+ b->color(input[0]->color()); b->callback(color_cb, (void*)0);
+ b->tooltip("Color behind the text");
+ b = new Fl_Button(220,y1,100,25,"selection_color"); y1 += 25;
+ b->color(input[0]->selection_color()); b->callback(color_cb, (void*)1);
+ b->labelcolor(fl_contrast(FL_BLACK,b->color()));
+ b->tooltip("Color behind selected text");
+ b = new Fl_Button(220,y1,100,25,"textcolor"); y1 += 25;
+ b->color(input[0]->textcolor()); b->callback(color_cb, (void*)2);
+ b->labelcolor(fl_contrast(FL_BLACK,b->color()));
+ b->tooltip("Color of the text");
+
+ window->end();
+ window->show(argc,argv);
+ return Fl::run();
+}
+
+//
+// End of "$Id: input.cxx 5519 2006-10-11 03:12:15Z mike $".
+//
diff --git a/third_party/windows/fltk-1.1.10/test/input_choice.cxx b/third_party/windows/fltk-1.1.10/test/input_choice.cxx
new file mode 100644
index 0000000..96e711e
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/input_choice.cxx
@@ -0,0 +1,68 @@
+//
+// "$Id: input_choice.cxx 5890 2007-06-07 17:38:49Z matt $"
+//
+// Test program for Fl_Input_Choice
+//
+// 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.
+//
+
+#include <stdio.h>
+#include <FL/Fl_Button.H>
+#include <FL/Fl_Window.H>
+#include <FL/Fl_Input_Choice.H>
+
+void buttcb(Fl_Widget*,void*data) {
+ Fl_Input_Choice *in=(Fl_Input_Choice *)data;
+ static int flag = 1;
+ flag ^= 1;
+ if ( flag ) in->activate();
+ else in->deactivate();
+ if (in->changed()) {
+ printf("Callback: changed() is set\n");
+ in->clear_changed();
+ }
+}
+
+void input_choice_cb(Fl_Widget*,void*data) {
+ Fl_Input_Choice *in=(Fl_Input_Choice *)data;
+ fprintf(stderr, "Value='%s'\n", (const char*)in->value());
+}
+
+int main(int argc, char **argv) {
+ Fl_Window win(300, 200);
+
+ Fl_Input_Choice in(40,40,100,28,"Test");
+ in.callback(input_choice_cb, (void*)&in);
+ in.add("one");
+ in.add("two");
+ in.add("three");
+ in.value(1);
+
+ Fl_Button onoff(40,150,200,28,"Activate/Deactivate");
+ onoff.callback(buttcb, (void*)&in);
+
+ win.end();
+ win.resizable(win);
+ win.show(argc, argv);
+ return Fl::run();
+}
+
+
+//
+// End of "$Id: input_choice.cxx 5890 2007-06-07 17:38:49Z matt $".
+//
diff --git a/third_party/windows/fltk-1.1.10/test/keyboard.cxx b/third_party/windows/fltk-1.1.10/test/keyboard.cxx
new file mode 100644
index 0000000..8077e22
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/keyboard.cxx
@@ -0,0 +1,158 @@
+//
+// "$Id: keyboard.cxx 5702 2007-02-21 15:49:38Z matt $"
+//
+// 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 after except shift, ctrl,
+// lock, and alt. They may also not agree about the symbols for the extra
+// keys Micro$oft put on the keyboard.
+//
+// On IRIX the backslash key does not work. A bug in XKeysymToKeycode?
+//
+// Copyright 1998-2005 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.h"
+
+#include <string.h>
+
+
+// these are used to identify which buttons are which:
+void key_cb(Fl_Button*, void*) {}
+void shift_cb(Fl_Button*, void*) {}
+void wheel_cb(Fl_Dial*, void*) {}
+
+// this is used to stop Esc from exiting the program:
+int handle(int e) {
+ return (e == FL_SHORTCUT); // eat all keystrokes
+}
+
+int MyWindow::handle(int msg) {
+ if (msg==FL_MOUSEWHEEL)
+ {
+ roller_x->value( roller_x->value() + Fl::e_dx * roller_x->step() );
+ roller_y->value( roller_y->value() + Fl::e_dy * roller_y->step() );
+ return 1;
+ }
+ return 0;
+}
+
+struct keycode_table{int n; const char* text;} table[] = {
+ {FL_Escape, "FL_Escape"},
+ {FL_BackSpace, "FL_BackSpace"},
+ {FL_Tab, "FL_Tab"},
+ {FL_Enter, "FL_Enter"},
+ {FL_Print, "FL_Print"},
+ {FL_Scroll_Lock, "FL_Scroll_Lock"},
+ {FL_Pause, "FL_Pause"},
+ {FL_Insert, "FL_Insert"},
+ {FL_Home, "FL_Home"},
+ {FL_Page_Up, "FL_Page_Up"},
+ {FL_Delete, "FL_Delete"},
+ {FL_End, "FL_End"},
+ {FL_Page_Down, "FL_Page_Down"},
+ {FL_Left, "FL_Left"},
+ {FL_Up, "FL_Up"},
+ {FL_Right, "FL_Right"},
+ {FL_Down, "FL_Down"},
+ {FL_Shift_L, "FL_Shift_L"},
+ {FL_Shift_R, "FL_Shift_R"},
+ {FL_Control_L, "FL_Control_L"},
+ {FL_Control_R, "FL_Control_R"},
+ {FL_Caps_Lock, "FL_Caps_Lock"},
+ {FL_Alt_L, "FL_Alt_L"},
+ {FL_Alt_R, "FL_Alt_R"},
+ {FL_Meta_L, "FL_Meta_L"},
+ {FL_Meta_R, "FL_Meta_R"},
+ {FL_Menu, "FL_Menu"},
+ {FL_Help, "FL_Help"},
+ {FL_Num_Lock, "FL_Num_Lock"},
+ {FL_KP_Enter, "FL_KP_Enter"}
+};
+
+int main(int argc, char** argv) {
+ Fl::add_handler(handle);
+ Fl_Window *window = make_window();
+ window->show(argc,argv);
+ while (Fl::wait()) {
+ const char *str;
+
+ // update all the buttons with the current key and shift state:
+ for (int i = 0; i < window->children(); i++) {
+ Fl_Widget* b = window->child(i);
+ if (b->callback() == (Fl_Callback*)key_cb) {
+ int i = (long)b->user_data();
+ if (!i) i = b->label()[0];
+ Fl_Button *btn = ((Fl_Button*)b);
+ int state = Fl::event_key(i);
+ if (btn->value()!=state)
+ btn->value(state);
+ } else if (b->callback() == (Fl_Callback*)shift_cb) {
+ int i = (long)b->user_data();
+ Fl_Button *btn = ((Fl_Button*)b);
+ int state = Fl::event_state(i);
+ if (btn->value()!=state)
+ btn->value(state);
+ }
+ }
+
+ // figure out the keyname:
+ char buffer[100];
+ const char *keyname = buffer;
+ int k = Fl::event_key();
+ if (!k)
+ keyname = "0";
+ else if (k < 256) {
+ sprintf(buffer, "'%c'", k);
+ } else if (k > FL_F && k <= FL_F_Last) {
+ sprintf(buffer, "FL_F+%d", k - FL_F);
+ } else if (k >= FL_KP && k <= FL_KP_Last) {
+ sprintf(buffer, "FL_KP+'%c'", k-FL_KP);
+ } else if (k >= FL_Button && k <= FL_Button+7) {
+ sprintf(buffer, "FL_Button+%d", k-FL_Button);
+ } 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;}
+ }
+ if (strcmp(key_output->value(), keyname))
+ key_output->value(keyname);
+
+ str = Fl::event_text();
+ if (strcmp(text_output->value(), str))
+ text_output->value(str);
+ }
+ return 0;
+}
+
+//
+// End of "$Id: keyboard.cxx 5702 2007-02-21 15:49:38Z matt $".
+//
diff --git a/third_party/windows/fltk-1.1.10/test/keyboard.h b/third_party/windows/fltk-1.1.10/test/keyboard.h
new file mode 100644
index 0000000..04ed75f
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/keyboard.h
@@ -0,0 +1,46 @@
+//
+// "$Id: keyboard.h 5519 2006-10-11 03:12:15Z mike $"
+//
+// Keyboard/event test header for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2005 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 keyboard_h
+# define keyboard_h
+# include <stdio.h>
+# include <FL/Fl.H>
+# include <FL/Fl_Window.H>
+
+class MyWindow : public Fl_Window {
+ int handle(int);
+public:
+ MyWindow(int w, int h, const char *t=0L)
+ : Fl_Window( w, h, t ) { }
+};
+
+#endif // !keyboard_h
+
+
+//
+// End of "$Id: keyboard.h 5519 2006-10-11 03:12:15Z mike $".
+//
diff --git a/third_party/windows/fltk-1.1.10/test/keyboard_ui.fl b/third_party/windows/fltk-1.1.10/test/keyboard_ui.fl
new file mode 100644
index 0000000..ff275d3
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/keyboard_ui.fl
@@ -0,0 +1,722 @@
+# data file for the Fltk User Interface Designer (fluid)
+version 1.0100
+header_name {.h}
+code_name {.cxx}
+gridx 5
+gridy 5
+snap 3
+Function {make_window()} {open
+} {
+ Fl_Window my_window {selected
+ xywh {461 296 494 203}
+ code0 {\#include "keyboard.h"}
+ class MyWindow visible
+ } {
+ Fl_Button {} {
+ label {Esc }
+ user_data FL_Escape user_data_type {void*}
+ callback key_cb
+ xywh {15 60 20 20} labelsize 8
+ }
+ Fl_Button {} {
+ label F1
+ user_data {FL_F+1} user_data_type {void*}
+ callback key_cb
+ xywh {50 60 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label F2
+ user_data {FL_F+2} user_data_type {void*}
+ callback key_cb
+ xywh {70 60 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label F3
+ user_data {FL_F+3} user_data_type {void*}
+ callback key_cb
+ xywh {90 60 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label F4
+ user_data {FL_F+4} user_data_type {void*}
+ callback key_cb
+ xywh {110 60 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label F5
+ user_data {FL_F+5} user_data_type {void*}
+ callback key_cb
+ xywh {140 60 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label F6
+ user_data {FL_F+6} user_data_type {void*}
+ callback key_cb
+ xywh {160 60 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label F7
+ user_data {FL_F+7} user_data_type {void*}
+ callback key_cb
+ xywh {180 60 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label F8
+ user_data {FL_F+8} user_data_type {void*}
+ callback key_cb
+ xywh {200 60 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label F9
+ user_data {FL_F+9} user_data_type {void*}
+ callback key_cb
+ xywh {230 60 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label F10
+ user_data {FL_F+10} user_data_type {void*}
+ callback key_cb
+ xywh {250 60 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label F11
+ user_data {FL_F+11} user_data_type {void*}
+ callback key_cb
+ xywh {270 60 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label F12
+ user_data {FL_F+12} user_data_type {void*}
+ callback key_cb
+ xywh {290 60 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label {Print }
+ user_data FL_Print user_data_type {void*}
+ callback key_cb
+ xywh {325 60 20 20} labelsize 8
+ }
+ Fl_Button {} {
+ label {Sclk }
+ user_data FL_Scroll_Lock user_data_type {void*}
+ callback key_cb
+ xywh {345 60 20 20} labelsize 8
+ }
+ Fl_Button {} {
+ label {Paus }
+ user_data FL_Pause user_data_type {void*}
+ callback key_cb
+ xywh {365 60 20 20} labelsize 8
+ }
+ Fl_Button {} {
+ label {`}
+ callback key_cb
+ xywh {15 90 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label 1
+ callback key_cb
+ xywh {35 90 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label 2
+ callback key_cb
+ xywh {55 90 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label 3
+ callback key_cb
+ xywh {75 90 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label 4
+ callback key_cb
+ xywh {95 90 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label 5
+ callback key_cb
+ xywh {115 90 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label 6
+ callback key_cb
+ xywh {135 90 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label 7
+ callback key_cb
+ xywh {155 90 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label 8
+ callback key_cb
+ xywh {175 90 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label 9
+ callback key_cb
+ xywh {195 90 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label 0
+ callback key_cb
+ xywh {215 90 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label {-}
+ callback key_cb
+ xywh {235 90 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label {=}
+ callback key_cb
+ xywh {255 90 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label Bksp
+ user_data FL_BackSpace user_data_type {void*}
+ callback key_cb
+ xywh {275 90 35 20} labeltype SHADOW_LABEL labelsize 8 align 20
+ }
+ Fl_Button {} {
+ label {Ins }
+ user_data FL_Insert user_data_type {void*}
+ callback key_cb
+ xywh {325 90 20 20} labelsize 8
+ }
+ Fl_Button {} {
+ label Home
+ user_data FL_Home user_data_type {void*}
+ callback key_cb
+ xywh {345 90 20 20} labelsize 8
+ }
+ Fl_Button {} {
+ label {pgup }
+ user_data FL_Page_Up user_data_type {void*}
+ callback key_cb
+ xywh {365 90 20 20} labelsize 8
+ }
+ Fl_Button {} {
+ label Num
+ user_data FL_Num_Lock user_data_type {void*}
+ callback key_cb
+ xywh {400 90 20 20} labelsize 8
+ }
+ Fl_Button {} {
+ label {/}
+ user_data {FL_KP+'/'} user_data_type {void*}
+ callback key_cb
+ xywh {420 90 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label {*}
+ user_data {FL_KP+'*'} user_data_type {void*}
+ callback key_cb
+ xywh {440 90 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label {-}
+ user_data {FL_KP+'-'} user_data_type {void*}
+ callback key_cb
+ xywh {460 90 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label Tab
+ user_data FL_Tab user_data_type {void*}
+ callback key_cb
+ xywh {15 110 27 20} labelsize 8 align 20
+ }
+ Fl_Button {} {
+ label Q
+ callback key_cb
+ xywh {42 110 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label W
+ callback key_cb
+ xywh {62 110 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label E
+ callback key_cb
+ xywh {82 110 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label R
+ callback key_cb
+ xywh {102 110 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label T
+ callback key_cb
+ xywh {122 110 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label Y
+ callback key_cb
+ xywh {142 110 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label U
+ callback key_cb
+ xywh {162 110 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label I
+ callback key_cb
+ xywh {182 110 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label O
+ callback key_cb
+ xywh {202 110 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label P
+ callback key_cb
+ xywh {222 110 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label {[}
+ callback key_cb
+ xywh {242 110 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label {]}
+ callback key_cb
+ xywh {262 110 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label {\\}
+ user_data {'|'}
+ callback key_cb
+ xywh {282 110 28 20} labelsize 10 align 20
+ }
+ Fl_Button {} {
+ label {Del }
+ user_data FL_Delete user_data_type {void*}
+ callback key_cb
+ xywh {325 110 20 20} labelsize 8
+ }
+ Fl_Button {} {
+ label {End }
+ user_data FL_End user_data_type {void*}
+ callback key_cb
+ xywh {345 110 20 20} labelsize 8
+ }
+ Fl_Button {} {
+ label {pgdn }
+ user_data FL_Page_Down user_data_type {void*}
+ callback key_cb
+ xywh {365 110 20 20} labelsize 8
+ }
+ Fl_Button {} {
+ label 7
+ user_data {FL_KP+'7'} user_data_type {void*}
+ callback key_cb
+ xywh {400 110 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label 8
+ user_data {FL_KP+'8'} user_data_type {void*}
+ callback key_cb
+ xywh {420 110 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label 9
+ user_data {FL_KP+'9'} user_data_type {void*}
+ callback key_cb
+ xywh {440 110 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label {+}
+ user_data {FL_KP+'+'} user_data_type {void*}
+ callback key_cb
+ xywh {460 110 20 40} labelsize 10 align 17
+ }
+ Fl_Button {} {
+ label Lock
+ user_data FL_Caps_Lock user_data_type {void*}
+ callback key_cb
+ xywh {15 130 36 20} labelsize 8 align 20
+ }
+ Fl_Button {} {
+ label A
+ callback key_cb
+ xywh {51 130 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label S
+ callback key_cb
+ xywh {71 130 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label D
+ callback key_cb
+ xywh {91 130 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label F
+ callback key_cb
+ xywh {111 130 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label G
+ callback key_cb
+ xywh {131 130 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label H
+ callback key_cb
+ xywh {151 130 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label J
+ callback key_cb
+ xywh {171 130 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label K
+ callback key_cb
+ xywh {191 130 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label L
+ callback key_cb
+ xywh {211 130 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label {;}
+ callback key_cb
+ xywh {231 130 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label {'}
+ callback key_cb
+ xywh {251 130 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label Enter
+ user_data FL_Enter user_data_type {void*}
+ callback key_cb
+ xywh {271 130 39 20} labelsize 8 align 20
+ }
+ Fl_Button {} {
+ label 4
+ user_data {FL_KP+'4'} user_data_type {void*}
+ callback key_cb
+ xywh {400 130 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label 5
+ user_data {FL_KP+'5'} user_data_type {void*}
+ callback key_cb
+ xywh {420 130 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label 6
+ user_data {FL_KP+'6'} user_data_type {void*}
+ callback key_cb
+ xywh {440 130 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label Shift
+ user_data FL_Shift_L user_data_type {void*}
+ callback key_cb
+ xywh {15 150 45 20} labelsize 8 align 20
+ }
+ Fl_Button {} {
+ label Z
+ callback key_cb
+ xywh {60 150 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label X
+ callback key_cb
+ xywh {80 150 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label C
+ callback key_cb
+ xywh {100 150 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label V
+ callback key_cb
+ xywh {120 150 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label B
+ callback key_cb
+ xywh {140 150 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label N
+ callback key_cb
+ xywh {160 150 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label M
+ callback key_cb
+ xywh {180 150 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label {,}
+ callback key_cb
+ xywh {200 150 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label {.}
+ callback key_cb
+ xywh {220 150 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label {/}
+ callback key_cb
+ xywh {240 150 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label Shift
+ user_data FL_Shift_R user_data_type {void*}
+ callback key_cb
+ xywh {260 150 50 20} labelsize 8 align 20
+ }
+ Fl_Button {} {
+ label {@8->}
+ user_data FL_Up user_data_type {void*}
+ callback key_cb
+ xywh {345 150 20 20} labeltype SHADOW_LABEL labelsize 10 labelcolor 47
+ }
+ Fl_Button {} {
+ label 1
+ user_data {FL_KP+'1'} user_data_type {void*}
+ callback key_cb
+ xywh {400 150 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label 2
+ user_data {FL_KP+'2'} user_data_type {void*}
+ callback key_cb
+ xywh {420 150 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label 3
+ user_data {FL_KP+'3'} user_data_type {void*}
+ callback key_cb
+ xywh {440 150 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ user_data FL_KP_Enter user_data_type {void*}
+ callback key_cb
+ xywh {460 150 20 40}
+ }
+ Fl_Button {} {
+ label Ctrl
+ user_data FL_Control_L user_data_type {void*}
+ callback key_cb
+ xywh {15 170 30 20} labelsize 8 align 20
+ }
+ Fl_Button {} {
+ label {Meta }
+ user_data FL_Meta_L user_data_type {void*}
+ callback key_cb
+ xywh {45 170 30 20} labelsize 8
+ }
+ Fl_Button {} {
+ label {Alt }
+ user_data FL_Alt_L user_data_type {void*}
+ callback key_cb
+ xywh {75 170 30 20} labelsize 8
+ }
+ Fl_Button {} {
+ user_data {' '} user_data_type {void*}
+ callback key_cb
+ xywh {105 170 85 20} labelsize 10
+ }
+ Fl_Button {} {
+ label {Alt }
+ user_data FL_Alt_R user_data_type {void*}
+ callback key_cb
+ xywh {190 170 30 20} labelsize 8
+ }
+ Fl_Button {} {
+ label {Meta }
+ user_data FL_Meta_R user_data_type {void*}
+ callback key_cb
+ xywh {220 170 30 20} labelsize 8
+ }
+ Fl_Button {} {
+ label {Menu }
+ user_data FL_Menu user_data_type {void*}
+ callback key_cb
+ xywh {250 170 30 20} labelsize 8
+ }
+ Fl_Button {} {
+ label Ctrl
+ user_data FL_Control_R user_data_type {void*}
+ callback key_cb
+ xywh {280 170 30 20} labelsize 8 align 20
+ }
+ Fl_Button {} {
+ label {@4->}
+ user_data FL_Left user_data_type {void*}
+ callback key_cb
+ xywh {325 170 20 20} labeltype SHADOW_LABEL labelsize 10 labelcolor 47
+ }
+ Fl_Button {} {
+ label {@2->}
+ user_data FL_Down user_data_type {void*}
+ callback key_cb
+ xywh {345 170 20 20} labeltype SHADOW_LABEL labelsize 10 labelcolor 47
+ }
+ Fl_Button {} {
+ label {@6->}
+ user_data FL_Right user_data_type {void*}
+ callback key_cb
+ xywh {365 170 20 20} labeltype SHADOW_LABEL labelsize 10 labelcolor 47
+ }
+ Fl_Button {} {
+ label 0
+ user_data {FL_KP+'0'} user_data_type {void*}
+ callback key_cb
+ xywh {400 170 40 20} labelsize 10 align 20
+ }
+ Fl_Button {} {
+ label {.}
+ user_data {FL_KP+'.'} user_data_type {void*}
+ callback key_cb
+ xywh {440 170 20 20} labelsize 10
+ }
+ Fl_Button {} {
+ label {shift }
+ user_data FL_SHIFT user_data_type {void*}
+ callback shift_cb
+ xywh {400 10 20 10} box THIN_UP_BOX selection_color 3 labelsize 8
+ }
+ Fl_Button {} {
+ label {lock }
+ user_data FL_CAPS_LOCK user_data_type {void*}
+ callback shift_cb
+ xywh {420 10 20 10} box THIN_UP_BOX selection_color 3 labelsize 8
+ }
+ Fl_Button {} {
+ label ctrl
+ user_data FL_CTRL user_data_type {void*}
+ callback shift_cb
+ xywh {440 10 20 10} box THIN_UP_BOX selection_color 3 labelsize 8
+ }
+ Fl_Button {} {
+ label alt
+ user_data FL_ALT user_data_type {void*}
+ callback shift_cb
+ xywh {460 10 20 10} box THIN_UP_BOX selection_color 3 labelsize 8
+ }
+ Fl_Button {} {
+ label num
+ user_data FL_NUM_LOCK user_data_type {void*}
+ callback shift_cb
+ xywh {400 20 20 10} box THIN_UP_BOX selection_color 3 labelsize 8
+ }
+ Fl_Button {} {
+ label {?}
+ user_data 0x20 user_data_type {void*}
+ callback shift_cb
+ xywh {420 20 20 10} box THIN_UP_BOX selection_color 3 labelsize 8
+ }
+ Fl_Button {} {
+ label {meta }
+ user_data FL_META user_data_type {void*}
+ callback shift_cb
+ xywh {440 20 20 10} box THIN_UP_BOX selection_color 3 labelsize 8
+ }
+ Fl_Button {} {
+ label sclk
+ user_data FL_SCROLL_LOCK user_data_type {void*}
+ callback shift_cb
+ xywh {460 20 20 10} box THIN_UP_BOX selection_color 3 labelsize 8
+ }
+ Fl_Button {} {
+ label b1
+ user_data FL_BUTTON1 user_data_type {void*}
+ callback shift_cb
+ xywh {400 30 20 10} box THIN_UP_BOX selection_color 3 labelsize 8
+ }
+ Fl_Button {} {
+ label b2
+ user_data FL_BUTTON2 user_data_type {void*}
+ callback shift_cb
+ xywh {420 30 20 10} box THIN_UP_BOX selection_color 3 labelsize 8
+ }
+ Fl_Button {} {
+ label b3
+ user_data FL_BUTTON3 user_data_type {void*}
+ callback shift_cb
+ xywh {440 30 20 10} box THIN_UP_BOX selection_color 3 labelsize 8
+ }
+ Fl_Button {} {
+ label whl
+ user_data 0x800 user_data_type {void*}
+ callback shift_cb
+ xywh {460 30 20 10} box THIN_UP_BOX selection_color 3 labelsize 8
+ }
+ Fl_Button {} {
+ label {?}
+ user_data 0x1000 user_data_type {void*}
+ callback shift_cb
+ xywh {400 40 20 10} box THIN_UP_BOX selection_color 3 labelsize 8
+ }
+ Fl_Button {} {
+ label {?}
+ user_data 0x2000 user_data_type {void*}
+ callback shift_cb
+ xywh {420 40 20 10} box THIN_UP_BOX selection_color 3 labelsize 8
+ }
+ Fl_Button {} {
+ label {?}
+ user_data 0x4000 user_data_type {void*}
+ callback shift_cb
+ xywh {440 40 20 10} box THIN_UP_BOX selection_color 3 labelsize 8
+ }
+ Fl_Button {} {
+ label {?}
+ user_data 0x8000 user_data_type {void*}
+ callback shift_cb
+ xywh {460 40 20 10} box THIN_UP_BOX selection_color 3 labelsize 8
+ }
+ Fl_Output key_output {
+ label {Fl::event_key():}
+ xywh {15 15 170 30} labelsize 8 align 5
+ }
+ Fl_Box {} {
+ label {Fl::event_state():}
+ xywh {395 10 85 40} labelsize 8 align 5
+ }
+ Fl_Output text_output {
+ label {Fl::event_text():}
+ xywh {195 15 190 30} labelsize 8 align 5
+ }
+ Fl_Button {} {
+ label help
+ user_data FL_Help user_data_type {void*}
+ callback key_cb
+ xywh {400 60 20 20} labelsize 8
+ }
+ Fl_Button {} {
+ label {=}
+ user_data {FL_KP+'='} user_data_type {void*}
+ callback key_cb
+ xywh {420 60 20 20} labelsize 10
+ }
+ Fl_Dial roller_x {
+ label {x:}
+ callback wheel_cb
+ xywh {440 60 20 20} box ROUND_UP_BOX selection_color 49 labelsize 9 align 5 step 0.1
+ }
+ Fl_Dial roller_y {
+ label {y:}
+ callback wheel_cb
+ xywh {460 60 20 20} box ROUND_UP_BOX selection_color 49 labelsize 9 align 5 step 0.1
+ }
+ }
+}
diff --git a/third_party/windows/fltk-1.1.10/test/label.cxx b/third_party/windows/fltk-1.1.10/test/label.cxx
new file mode 100644
index 0000000..e54103e
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/label.cxx
@@ -0,0 +1,162 @@
+//
+// "$Id: label.cxx 5519 2006-10-11 03:12:15Z mike $"
+//
+// Label test program for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2005 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 <FL/Fl.H>
+#include <FL/Fl_Double_Window.H>
+#include <FL/Fl_Box.H>
+#include <FL/Fl_Hor_Value_Slider.H>
+#include <FL/Fl_Toggle_Button.H>
+#include <FL/Fl_Input.H>
+#include <FL/Fl_Choice.H>
+#include <FL/fl_draw.H>
+
+Fl_Toggle_Button *leftb,*rightb,*topb,*bottomb,*insideb,*clipb,*wrapb;
+Fl_Box *text;
+Fl_Input *input;
+Fl_Hor_Value_Slider *fonts;
+Fl_Hor_Value_Slider *sizes;
+Fl_Double_Window *window;
+
+void button_cb(Fl_Widget *,void *) {
+ int i = 0;
+ if (leftb->value()) i |= FL_ALIGN_LEFT;
+ if (rightb->value()) i |= FL_ALIGN_RIGHT;
+ if (topb->value()) i |= FL_ALIGN_TOP;
+ if (bottomb->value()) i |= FL_ALIGN_BOTTOM;
+ if (insideb->value()) i |= FL_ALIGN_INSIDE;
+ if (clipb->value()) i |= FL_ALIGN_CLIP;
+ if (wrapb->value()) i |= FL_ALIGN_WRAP;
+ text->align(i);
+ window->redraw();
+}
+
+void font_cb(Fl_Widget *,void *) {
+ text->labelfont(int(fonts->value()));
+ window->redraw();
+}
+
+void size_cb(Fl_Widget *,void *) {
+ text->labelsize(int(sizes->value()));
+ window->redraw();
+}
+
+void input_cb(Fl_Widget *,void *) {
+ text->label(input->value());
+ window->redraw();
+}
+
+void normal_cb(Fl_Widget *,void *) {
+ text->labeltype(FL_NORMAL_LABEL);
+ window->redraw();
+}
+
+void symbol_cb(Fl_Widget *,void *) {
+ text->labeltype(FL_SYMBOL_LABEL);
+ if (input->value()[0] != '@') {
+ input->static_value("@->");
+ text->label("@->");
+ }
+ window->redraw();
+}
+
+void shadow_cb(Fl_Widget *,void *) {
+ text->labeltype(FL_SHADOW_LABEL);
+ window->redraw();
+}
+
+void embossed_cb(Fl_Widget *,void *) {
+ text->labeltype(FL_EMBOSSED_LABEL);
+ window->redraw();
+}
+
+void engraved_cb(Fl_Widget *,void *) {
+ text->labeltype(FL_ENGRAVED_LABEL);
+ window->redraw();
+}
+
+Fl_Menu_Item choices[] = {
+ {"FL_NORMAL_LABEL",0,normal_cb},
+ {"FL_SYMBOL_LABEL",0,symbol_cb},
+ {"FL_SHADOW_LABEL",0,shadow_cb},
+ {"FL_ENGRAVED_LABEL",0,engraved_cb},
+ {"FL_EMBOSSED_LABEL",0,embossed_cb},
+ {0}};
+
+int main(int argc, char **argv) {
+ window = new Fl_Double_Window(400,400);
+
+ input = new Fl_Input(50,0,350,25);
+ input->static_value("The quick brown fox jumped over the lazy dog.");
+ input->when(FL_WHEN_CHANGED);
+ input->callback(input_cb);
+
+ sizes= new Fl_Hor_Value_Slider(50,25,350,25,"Size:");
+ sizes->align(FL_ALIGN_LEFT);
+ sizes->bounds(1,64);
+ sizes->step(1);
+ sizes->value(14);
+ sizes->callback(size_cb);
+
+ fonts=new Fl_Hor_Value_Slider(50,50,350,25,"Font:");
+ fonts->align(FL_ALIGN_LEFT);
+ fonts->bounds(0,15);
+ fonts->step(1);
+ fonts->value(0);
+ fonts->callback(font_cb);
+
+ Fl_Group *g = new Fl_Group(0,0,0,0);
+ leftb = new Fl_Toggle_Button(50,75,50,25,"left");
+ leftb->callback(button_cb);
+ rightb = new Fl_Toggle_Button(100,75,50,25,"right");
+ rightb->callback(button_cb);
+ topb = new Fl_Toggle_Button(150,75,50,25,"top");
+ topb->callback(button_cb);
+ bottomb = new Fl_Toggle_Button(200,75,50,25,"bottom");
+ bottomb->callback(button_cb);
+ insideb = new Fl_Toggle_Button(250,75,50,25,"inside");
+ insideb->callback(button_cb);
+ wrapb = new Fl_Toggle_Button(300,75,50,25,"wrap");
+ wrapb->callback(button_cb);
+ clipb = new Fl_Toggle_Button(350,75,50,25,"clip");
+ clipb->callback(button_cb);
+ g->resizable(insideb);
+ g->forms_end();
+
+ Fl_Choice *c = new Fl_Choice(50,100,200,25);
+ c->menu(choices);
+
+ text= new Fl_Box(FL_FRAME_BOX,100,225,200,100,input->value());
+ text->align(FL_ALIGN_CENTER);
+ window->resizable(text);
+ window->forms_end();
+ window->show(argc,argv);
+ return Fl::run();
+}
+
+//
+// End of "$Id: label.cxx 5519 2006-10-11 03:12:15Z mike $".
+//
diff --git a/third_party/windows/fltk-1.1.10/test/line_style.cxx b/third_party/windows/fltk-1.1.10/test/line_style.cxx
new file mode 100644
index 0000000..d1f0e2f
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/line_style.cxx
@@ -0,0 +1,154 @@
+//
+// "$Id: line_style.cxx 5519 2006-10-11 03:12:15Z mike $"
+//
+// Line style demo for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 2000-2005 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 <FL/Fl.H>
+#include <FL/Fl_Window.H>
+#include <FL/Fl_Value_Slider.H>
+#include <FL/fl_draw.H>
+#include <FL/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((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(
+ (long)(choice[0]->mvalue()->user_data()) +
+ (long)(choice[1]->mvalue()->user_data()) +
+ (long)(choice[2]->mvalue()->user_data()),
+ (long)(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,"fl_line_style() 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();
+}
+
+int main(int argc, char **argv) {
+ makeform(argv[0]);
+ form->show(argc,argv);
+ return Fl::run();
+}
+
+
+//
+// End of "$Id: line_style.cxx 5519 2006-10-11 03:12:15Z mike $".
+//
diff --git a/third_party/windows/fltk-1.1.10/test/list_visuals.cxx b/third_party/windows/fltk-1.1.10/test/list_visuals.cxx
new file mode 100644
index 0000000..4d56996
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/list_visuals.cxx
@@ -0,0 +1,241 @@
+//
+// "$Id: list_visuals.cxx 5519 2006-10-11 03:12:15Z mike $"
+//
+// 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-2005 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
+//
+
+#if defined(WIN32) || defined(__APPLE__)
+#include <FL/Fl.H>
+#include <FL/fl_message.H>
+
+int main(int, char**) {
+ fl_alert("Currently, this program works only under X.");
+ return 1;
+}
+
+#else
+
+#include "config.h"
+
+#ifndef Fl_H
+
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include <X11/Xatom.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+Display *fl_display;
+int fl_screen;
+const char *dname;
+void fl_open_display() {
+ fl_display = XOpenDisplay(dname);
+ if (!fl_display) {
+ fprintf(stderr,"Can't open display: %s\n",XDisplayName(dname));
+ exit(1);
+ }
+ fl_screen = DefaultScreen(fl_display);
+}
+
+#endif
+
+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
+#include <X11/extensions/multibuf.h>
+#endif
+
+#if HAVE_XDBE
+#include <X11/extensions/Xdbe.h>
+#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() {
+ fl_open_display();
+ XVisualInfo vTemplate;
+ int num;
+ XVisualInfo *visualList = XGetVisualInfo(fl_display,0,&vTemplate,&num);
+
+ XPixmapFormatValues *pfvlist;
+ static int numpfv;
+ pfvlist = XListPixmapFormats(fl_display, &numpfv);
+
+ OverlayInfo *overlayInfo = 0;
+ int numoverlayinfo = 0;
+ Atom overlayVisualsAtom = XInternAtom(fl_display,"SERVER_OVERLAY_VISUALS",1);
+ if (overlayVisualsAtom) {
+ unsigned long sizeData, bytesLeft;
+ Atom actualType;
+ int actualFormat;
+ if (!XGetWindowProperty(fl_display, RootWindow(fl_display, fl_screen),
+ overlayVisualsAtom, 0L, 10000L, False,
+ overlayVisualsAtom, &actualType, &actualFormat,
+ &sizeData, &bytesLeft,
+ (unsigned char **) &overlayInfo))
+ numoverlayinfo = int(sizeData/4);
+ }
+
+#if HAVE_MULTIBUF
+ int event_base, error_base;
+ XmbufBufferInfo *mbuf, *sbuf;
+ int nmbuf = 0, nsbuf = 0;
+ if (XmbufQueryExtension(fl_display,&event_base, &error_base)) {
+ XmbufGetScreenInfo(fl_display,RootWindow(fl_display,fl_screen),
+ &nmbuf, &mbuf, &nsbuf, &sbuf);
+ }
+#endif
+
+#if HAVE_XDBE
+ int event_base, error_base;
+ int numdouble = 0;
+ XdbeVisualInfo *dbe = 0;
+ if (XdbeQueryExtension(fl_display, &event_base, &error_base)) {
+ Drawable root = RootWindow(fl_display,fl_screen);
+ int numscreens = 1;
+ XdbeScreenVisualInfo *a = XdbeGetVisualInfo(fl_display,&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(fl_display,fl_screen)))
+ printf(" (default visual)");
+
+ putchar('\n');
+ }
+}
+
+#endif
+
+#ifndef Fl_H
+int main(int argc, char **argv) {
+ if (argc == 1);
+ else if (argc == 2 && argv[1][0]!='-') dname = argv[1];
+ else {fprintf(stderr,"usage: %s <display>\n",argv[0]); exit(1);}
+ list_visuals();
+ return 0;
+}
+#endif
+
+//
+// End of "$Id: list_visuals.cxx 5519 2006-10-11 03:12:15Z mike $".
+//
diff --git a/third_party/windows/fltk-1.1.10/test/makedepend b/third_party/windows/fltk-1.1.10/test/makedepend
new file mode 100644
index 0000000..f8ace0f
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/makedepend
@@ -0,0 +1,388 @@
+# DO NOT DELETE THIS LINE -- make depend depends on it.
+unittests.o: unittests.cxx ../FL/Fl.H ../FL/Enumerations.H \
+ ../FL/Fl_Export.H ../FL/x.H ../FL/Fl_Window.H ../FL/Fl_Group.H \
+ ../FL/Fl_Widget.H ../FL/Fl_Window.H ../FL/Fl_Button.H ../FL/Fl_Box.H \
+ ../FL/fl_draw.H
+adjuster.o: adjuster.cxx ../FL/Fl.H ../FL/Enumerations.H \
+ ../FL/Fl_Export.H ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H \
+ ../FL/Fl_Adjuster.H ../FL/Fl_Valuator.H ../FL/Fl_Box.H
+arc.o: arc.cxx ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H \
+ ../FL/Fl_Double_Window.H ../FL/Fl_Window.H ../FL/Fl_Group.H \
+ ../FL/Fl_Widget.H ../FL/Fl_Hor_Value_Slider.H ../FL/Fl_Value_Slider.H \
+ ../FL/Fl_Slider.H ../FL/Fl_Valuator.H ../FL/fl_draw.H
+ask.o: ask.cxx ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H \
+ ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Input.H \
+ ../FL/Fl_Input_.H ../FL/Fl_Button.H ../FL/Fl_Return_Button.H \
+ ../FL/Fl_Button.H ../FL/fl_ask.H
+bitmap.o: bitmap.cxx ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H \
+ ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Button.H \
+ ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_Toggle_Button.H \
+ ../FL/Fl_Button.H
+blocks.o: blocks.cxx ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H \
+ ../FL/Fl_Double_Window.H ../FL/Fl_Window.H ../FL/Fl_Group.H \
+ ../FL/Fl_Widget.H ../FL/Fl_Button.H ../FL/Fl_Preferences.H \
+ ../FL/Fl_XPM_Image.H ../FL/Fl_Pixmap.H ../FL/Fl_Image.H \
+ ../FL/Fl_XBM_Image.H ../FL/Fl_Bitmap.H ../FL/Fl_Tiled_Image.H \
+ ../FL/fl_draw.H ../FL/x.H ../config.h pixmaps/blast.xpm pixmaps/red.xpm \
+ pixmaps/red_bomb.xpm pixmaps/green.xpm pixmaps/green_bomb.xpm \
+ pixmaps/blue.xpm pixmaps/blue_bomb.xpm pixmaps/yellow.xpm \
+ pixmaps/yellow_bomb.xpm pixmaps/cyan.xpm pixmaps/cyan_bomb.xpm \
+ pixmaps/magenta.xpm pixmaps/magenta_bomb.xpm pixmaps/gray.xpm \
+ pixmaps/gray_bomb.xpm
+boxtype.o: boxtype.cxx ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H \
+ ../FL/Fl_Double_Window.H ../FL/Fl_Window.H ../FL/Fl_Group.H \
+ ../FL/Fl_Widget.H ../FL/Fl_Box.H
+browser.o: browser.cxx ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H \
+ ../FL/Fl_Select_Browser.H ../FL/Fl_Browser.H ../FL/Fl_Browser_.H \
+ ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Scrollbar.H \
+ ../FL/Fl_Slider.H ../FL/Fl_Valuator.H ../FL/Fl_Double_Window.H \
+ ../FL/Fl_Window.H ../FL/Fl_Button.H ../FL/Fl_Int_Input.H \
+ ../FL/Fl_Input.H ../FL/Fl_Input_.H ../FL/fl_ask.H
+button.o: button.cxx ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H \
+ ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Button.H
+buttons.o: buttons.cxx ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H \
+ ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Button.H \
+ ../FL/Fl_Return_Button.H ../FL/Fl_Button.H ../FL/Fl_Repeat_Button.H \
+ ../FL/Fl.H ../FL/Fl_Check_Button.H ../FL/Fl_Light_Button.H \
+ ../FL/Fl_Light_Button.H ../FL/Fl_Round_Button.H ../FL/Fl_Tooltip.H \
+ ../FL/Fl_Widget.H
+checkers.o: checkers.cxx ../FL/Fl.H ../FL/Enumerations.H \
+ ../FL/Fl_Export.H ../FL/Fl_Double_Window.H ../FL/Fl_Window.H \
+ ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H \
+ ../FL/fl_draw.H ../FL/Fl_Menu_Item.H ../FL/fl_ask.H pixmaps/black_1.xbm \
+ pixmaps/black_2.xbm pixmaps/black_3.xbm pixmaps/black_4.xbm \
+ pixmaps/white_1.xbm pixmaps/white_2.xbm pixmaps/white_3.xbm \
+ pixmaps/white_4.xbm pixmaps/blackking_1.xbm pixmaps/blackking_2.xbm \
+ pixmaps/blackking_3.xbm pixmaps/blackking_4.xbm pixmaps/whiteking_1.xbm \
+ pixmaps/whiteking_2.xbm pixmaps/whiteking_3.xbm pixmaps/whiteking_4.xbm \
+ ../FL/Fl_Box.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H \
+ ../FL/Fl_Value_Output.H
+clock.o: clock.cxx ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H \
+ ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Clock.H \
+ ../FL/Fl_Round_Clock.H ../FL/Fl_Clock.H
+colbrowser.o: colbrowser.cxx ../FL/forms.H ../FL/Fl.H \
+ ../FL/Enumerations.H ../FL/Fl_Export.H ../FL/Fl_Group.H \
+ ../FL/Fl_Widget.H ../FL/Fl_Window.H ../FL/fl_draw.H \
+ ../FL/Fl_FormsBitmap.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H \
+ ../FL/Fl_FormsPixmap.H ../FL/Fl_Pixmap.H ../FL/Fl_Box.H \
+ ../FL/Fl_Browser.H ../FL/Fl_Browser_.H ../FL/Fl_Scrollbar.H \
+ ../FL/Fl_Slider.H ../FL/Fl_Valuator.H ../FL/Fl_Button.H \
+ ../FL/Fl_Light_Button.H ../FL/Fl_Round_Button.H ../FL/Fl_Check_Button.H \
+ ../FL/Fl_Chart.H ../FL/Fl_Choice.H ../FL/Fl_Menu_.H \
+ ../FL/Fl_Menu_Item.H ../FL/Fl_Clock.H ../FL/Fl_Counter.H \
+ ../FL/Fl_Dial.H ../FL/Fl_Free.H ../FL/fl_ask.H ../FL/fl_show_colormap.H \
+ ../FL/filename.H ../FL/Fl_File_Chooser.H ../FL/Fl.H \
+ ../FL/Fl_Double_Window.H ../FL/Fl_Group.H ../FL/Fl_Choice.H \
+ ../FL/Fl_Menu_Button.H ../FL/Fl_Button.H ../FL/Fl_Preferences.H \
+ ../FL/Fl_Tile.H ../FL/Fl_File_Browser.H ../FL/Fl_File_Icon.H \
+ ../FL/Fl_Box.H ../FL/Fl_Check_Button.H ../FL/Fl_File_Input.H \
+ ../FL/Fl_Input.H ../FL/Fl_Input_.H ../FL/Fl_Return_Button.H \
+ ../FL/fl_ask.H ../FL/Fl_Input.H ../FL/Fl_Menu_Button.H \
+ ../FL/Fl_Positioner.H ../FL/Fl_Value_Slider.H ../FL/Fl_Timer.H
+color_chooser.o: color_chooser.cxx ../FL/Fl.H ../FL/Enumerations.H \
+ ../FL/Fl_Export.H ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H \
+ ../FL/Fl_Box.H ../FL/Fl_Button.H ../FL/fl_show_colormap.H \
+ ../FL/Fl_Color_Chooser.H ../FL/Fl_Group.H ../FL/Fl_Return_Button.H \
+ ../FL/Fl_Button.H ../FL/Fl_Choice.H ../FL/Fl_Menu_.H \
+ ../FL/Fl_Menu_Item.H ../FL/Fl_Image.H ../FL/Fl_Value_Input.H \
+ ../FL/Fl_Valuator.H ../FL/Fl_Input.H ../FL/Fl_Input_.H ../FL/Fl_Image.H \
+ ../FL/x.H ../FL/Fl_Window.H ../FL/fl_draw.H list_visuals.cxx \
+ ../config.h
+cube.o: cube.cxx ../config.h ../FL/Fl.H ../FL/Enumerations.H \
+ ../FL/Fl_Export.H ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H \
+ ../FL/Fl_Box.H ../FL/Fl_Button.H ../FL/Fl_Radio_Light_Button.H \
+ ../FL/Fl_Light_Button.H ../FL/Fl_Button.H ../FL/Fl_Slider.H \
+ ../FL/Fl_Valuator.H ../FL/Fl_Gl_Window.H ../FL/Fl_Window.H ../FL/gl.h
+CubeMain.o: CubeMain.cxx ../config.h ../FL/Fl.H ../FL/Enumerations.H \
+ ../FL/Fl_Export.H CubeViewUI.h ../FL/Fl_Double_Window.H \
+ ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Group.H \
+ ../FL/Fl_Roller.H ../FL/Fl_Valuator.H ../FL/Fl_Slider.H ../FL/Fl_Box.H \
+ CubeView.h ../config.h ../FL/Fl_Gl_Window.H ../FL/gl.h \
+ ../FL/Fl_Value_Slider.H ../FL/Fl_Slider.H
+CubeView.o: CubeView.cxx CubeView.h ../config.h ../FL/Fl.H \
+ ../FL/Enumerations.H ../FL/Fl_Export.H ../FL/Fl_Gl_Window.H \
+ ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/gl.h
+cursor.o: cursor.cxx ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H \
+ ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H \
+ ../FL/Fl_Hor_Value_Slider.H ../FL/Fl_Value_Slider.H ../FL/Fl_Slider.H \
+ ../FL/Fl_Valuator.H ../FL/Fl_Choice.H ../FL/Fl_Menu_.H \
+ ../FL/Fl_Menu_Item.H ../FL/Fl_Image.H ../FL/fl_draw.H ../FL/Fl_Box.H
+curve.o: curve.cxx ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H \
+ ../FL/Fl_Double_Window.H ../FL/Fl_Window.H ../FL/Fl_Group.H \
+ ../FL/Fl_Widget.H ../FL/Fl_Hor_Value_Slider.H ../FL/Fl_Value_Slider.H \
+ ../FL/Fl_Slider.H ../FL/Fl_Valuator.H ../FL/fl_draw.H \
+ ../FL/Fl_Toggle_Button.H ../FL/Fl_Button.H
+demo.o: demo.cxx ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H \
+ ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Box.H \
+ ../FL/Fl_Button.H ../FL/Fl_Choice.H ../FL/Fl_Menu_.H \
+ ../FL/Fl_Menu_Item.H ../FL/Fl_Image.H ../FL/filename.H ../FL/x.H \
+ ../FL/Fl_Window.H
+doublebuffer.o: doublebuffer.cxx ../FL/Fl.H ../FL/Enumerations.H \
+ ../FL/Fl_Export.H ../FL/Fl_Single_Window.H ../FL/Fl_Window.H \
+ ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Double_Window.H \
+ ../FL/Fl_Box.H ../FL/fl_draw.H ../FL/Fl_Hor_Slider.H ../FL/Fl_Slider.H \
+ ../FL/Fl_Valuator.H ../FL/math.h
+editor.o: editor.cxx ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H \
+ ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Double_Window.H \
+ ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/fl_ask.H \
+ ../FL/Fl_File_Chooser.H ../FL/Fl_Choice.H ../FL/Fl_Menu_.H \
+ ../FL/Fl_Menu_Item.H ../FL/Fl_Image.H ../FL/Fl_Menu_Button.H \
+ ../FL/Fl_Button.H ../FL/Fl_Preferences.H ../FL/Fl_Tile.H \
+ ../FL/Fl_File_Browser.H ../FL/Fl_Browser.H ../FL/Fl_Browser_.H \
+ ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H \
+ ../FL/Fl_File_Icon.H ../FL/Fl.H ../FL/filename.H ../FL/Fl_Box.H \
+ ../FL/Fl_Check_Button.H ../FL/Fl_Light_Button.H ../FL/Fl_Button.H \
+ ../FL/Fl_File_Input.H ../FL/Fl_Input.H ../FL/Fl_Input_.H \
+ ../FL/Fl_Return_Button.H ../FL/Fl_Menu_Bar.H ../FL/Fl_Text_Buffer.H \
+ ../FL/Fl_Text_Editor.H ../FL/Fl_Text_Display.H ../FL/fl_draw.H \
+ ../FL/Fl_Text_Buffer.H
+fast_slow.o: fast_slow.cxx fast_slow.h ../FL/Fl.H ../FL/Enumerations.H \
+ ../FL/Fl_Export.H ../FL/Fl_Double_Window.H ../FL/Fl_Window.H \
+ ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Slider.H \
+ ../FL/Fl_Valuator.H ../FL/Fl_Box.H
+file_chooser.o: file_chooser.cxx ../FL/Fl_File_Chooser.H ../FL/Fl.H \
+ ../FL/Enumerations.H ../FL/Fl_Export.H ../FL/Fl_Double_Window.H \
+ ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Group.H \
+ ../FL/Fl_Choice.H ../FL/Fl_Menu_.H ../FL/Fl_Menu_Item.H \
+ ../FL/Fl_Image.H ../FL/Fl_Menu_Button.H ../FL/Fl_Button.H \
+ ../FL/Fl_Preferences.H ../FL/Fl_Tile.H ../FL/Fl_File_Browser.H \
+ ../FL/Fl_Browser.H ../FL/Fl_Browser_.H ../FL/Fl_Scrollbar.H \
+ ../FL/Fl_Slider.H ../FL/Fl_Valuator.H ../FL/Fl_File_Icon.H ../FL/Fl.H \
+ ../FL/filename.H ../FL/Fl_Box.H ../FL/Fl_Check_Button.H \
+ ../FL/Fl_Light_Button.H ../FL/Fl_Button.H ../FL/Fl_File_Input.H \
+ ../FL/Fl_Input.H ../FL/Fl_Input_.H ../FL/Fl_Return_Button.H \
+ ../FL/fl_ask.H ../FL/Fl_File_Icon.H ../FL/Fl_Shared_Image.H \
+ ../FL/Fl_PNM_Image.H ../FL/Fl_Light_Button.H
+fonts.o: fonts.cxx ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H \
+ ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H \
+ ../FL/Fl_Hold_Browser.H ../FL/Fl_Browser.H ../FL/Fl_Browser_.H \
+ ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H \
+ ../FL/fl_draw.H ../FL/Fl_Box.H ../FL/fl_ask.H
+forms.o: forms.cxx ../FL/forms.H ../FL/Fl.H ../FL/Enumerations.H \
+ ../FL/Fl_Export.H ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Window.H \
+ ../FL/fl_draw.H ../FL/Fl_FormsBitmap.H ../FL/Fl_Bitmap.H \
+ ../FL/Fl_Image.H ../FL/Fl_FormsPixmap.H ../FL/Fl_Pixmap.H \
+ ../FL/Fl_Box.H ../FL/Fl_Browser.H ../FL/Fl_Browser_.H \
+ ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H \
+ ../FL/Fl_Button.H ../FL/Fl_Light_Button.H ../FL/Fl_Round_Button.H \
+ ../FL/Fl_Check_Button.H ../FL/Fl_Chart.H ../FL/Fl_Choice.H \
+ ../FL/Fl_Menu_.H ../FL/Fl_Menu_Item.H ../FL/Fl_Clock.H \
+ ../FL/Fl_Counter.H ../FL/Fl_Dial.H ../FL/Fl_Free.H ../FL/fl_ask.H \
+ ../FL/fl_show_colormap.H ../FL/filename.H ../FL/Fl_File_Chooser.H \
+ ../FL/Fl.H ../FL/Fl_Double_Window.H ../FL/Fl_Group.H ../FL/Fl_Choice.H \
+ ../FL/Fl_Menu_Button.H ../FL/Fl_Button.H ../FL/Fl_Preferences.H \
+ ../FL/Fl_Tile.H ../FL/Fl_File_Browser.H ../FL/Fl_File_Icon.H \
+ ../FL/Fl_Box.H ../FL/Fl_Check_Button.H ../FL/Fl_File_Input.H \
+ ../FL/Fl_Input.H ../FL/Fl_Input_.H ../FL/Fl_Return_Button.H \
+ ../FL/fl_ask.H ../FL/Fl_Input.H ../FL/Fl_Menu_Button.H \
+ ../FL/Fl_Positioner.H ../FL/Fl_Value_Slider.H ../FL/Fl_Timer.H \
+ pixmaps/srs.xbm
+fractals.o: fractals.cxx ../config.h ../FL/glut.H ../FL/gl.h \
+ ../FL/Enumerations.H ../FL/Fl_Export.H ../FL/Fl.H ../FL/Fl_Gl_Window.H \
+ ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/glu.h \
+ fracviewer.h ../FL/Fl_Button.H ../FL/Fl_Group.H ../FL/Fl_Window.H
+fullscreen.o: fullscreen.cxx ../config.h ../FL/Fl.H ../FL/Enumerations.H \
+ ../FL/Fl_Export.H ../FL/Fl_Single_Window.H ../FL/Fl_Window.H \
+ ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Hor_Slider.H \
+ ../FL/Fl_Slider.H ../FL/Fl_Valuator.H ../FL/Fl_Toggle_Light_Button.H \
+ ../FL/Fl_Light_Button.H ../FL/Fl_Button.H ../FL/math.h ../FL/gl.h \
+ ../FL/Fl_Gl_Window.H
+gl_overlay.o: gl_overlay.cxx ../config.h ../FL/Fl.H ../FL/Enumerations.H \
+ ../FL/Fl_Export.H ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H \
+ ../FL/Fl_Hor_Slider.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H \
+ ../FL/Fl_Toggle_Button.H ../FL/Fl_Button.H ../FL/math.h ../FL/gl.h \
+ ../FL/Fl_Gl_Window.H ../FL/Fl_Window.H
+glpuzzle.o: glpuzzle.cxx ../config.h ../FL/glut.H ../FL/gl.h \
+ ../FL/Enumerations.H ../FL/Fl_Export.H ../FL/Fl.H ../FL/Fl_Gl_Window.H \
+ ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/glu.h \
+ trackball.c trackball.h
+hello.o: hello.cxx ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H \
+ ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Box.H \
+ ../FL/filename.H
+help.o: help.cxx ../FL/Fl_Help_Dialog.H ../FL/Fl.H ../FL/Enumerations.H \
+ ../FL/Fl_Export.H ../FL/Fl_Double_Window.H ../FL/Fl_Window.H \
+ ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Group.H ../FL/Fl_Button.H \
+ ../FL/Fl_Input.H ../FL/Fl_Input_.H ../FL/Fl_Box.H ../FL/Fl_Help_View.H \
+ ../FL/Fl.H ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H \
+ ../FL/fl_draw.H ../FL/Fl_Shared_Image.H ../FL/Fl_Image.H
+iconize.o: iconize.cxx ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H \
+ ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Button.H \
+ ../FL/Fl_Box.H
+image.o: image.cxx ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H \
+ ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Button.H \
+ ../FL/Fl_Image.H ../FL/Fl_Toggle_Button.H ../FL/Fl_Button.H ../FL/x.H \
+ ../FL/Fl_Window.H list_visuals.cxx ../config.h
+inactive.o: inactive.cxx inactive.h ../FL/Fl.H ../FL/Enumerations.H \
+ ../FL/Fl_Export.H ../FL/Fl_Double_Window.H ../FL/Fl_Window.H \
+ ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Group.H ../FL/Fl_Button.H \
+ ../FL/Fl_Light_Button.H ../FL/Fl_Button.H ../FL/Fl_Check_Button.H \
+ ../FL/Fl_Light_Button.H ../FL/Fl_Round_Button.H ../FL/Fl_Slider.H \
+ ../FL/Fl_Valuator.H ../FL/Fl_Input.H ../FL/Fl_Input_.H \
+ ../FL/Fl_Menu_Button.H ../FL/Fl_Menu_.H ../FL/Fl_Menu_Item.H \
+ ../FL/Fl_Image.H ../FL/Fl_Value_Output.H ../FL/Fl_Box.H \
+ ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H ../FL/Fl_Roller.H \
+ ../FL/Fl_Dial.H ../FL/Fl_Clock.H
+input.o: input.cxx ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H \
+ ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Input.H \
+ ../FL/Fl_Input_.H ../FL/Fl_Float_Input.H ../FL/Fl_Input.H \
+ ../FL/Fl_Int_Input.H ../FL/Fl_Secret_Input.H ../FL/Fl_Multiline_Input.H \
+ ../FL/Fl_Button.H ../FL/Fl_Toggle_Button.H ../FL/Fl_Button.H \
+ ../FL/Fl_Color_Chooser.H ../FL/Fl_Group.H ../FL/Fl_Box.H \
+ ../FL/Fl_Return_Button.H ../FL/Fl_Choice.H ../FL/Fl_Menu_.H \
+ ../FL/Fl_Menu_Item.H ../FL/Fl_Image.H ../FL/Fl_Value_Input.H \
+ ../FL/Fl_Valuator.H
+input_choice.o: input_choice.cxx ../FL/Fl_Button.H ../FL/Fl_Widget.H \
+ ../FL/Enumerations.H ../FL/Fl_Export.H ../FL/Fl_Window.H \
+ ../FL/Fl_Group.H ../FL/Fl_Input_Choice.H ../FL/Fl.H ../FL/Fl_Input.H \
+ ../FL/Fl_Input_.H ../FL/Fl_Menu_Button.H ../FL/Fl_Menu_.H \
+ ../FL/Fl_Menu_Item.H ../FL/Fl_Image.H ../FL/fl_draw.H
+keyboard.o: keyboard.cxx keyboard_ui.h ../FL/Fl.H ../FL/Enumerations.H \
+ ../FL/Fl_Export.H keyboard.h ../FL/Fl_Window.H ../FL/Fl_Group.H \
+ ../FL/Fl_Widget.H ../FL/Fl_Button.H ../FL/Fl_Output.H ../FL/Fl_Input.H \
+ ../FL/Fl_Input_.H ../FL/Fl_Box.H ../FL/Fl_Dial.H ../FL/Fl_Valuator.H
+label.o: label.cxx ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H \
+ ../FL/Fl_Double_Window.H ../FL/Fl_Window.H ../FL/Fl_Group.H \
+ ../FL/Fl_Widget.H ../FL/Fl_Box.H ../FL/Fl_Hor_Value_Slider.H \
+ ../FL/Fl_Value_Slider.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H \
+ ../FL/Fl_Toggle_Button.H ../FL/Fl_Button.H ../FL/Fl_Input.H \
+ ../FL/Fl_Input_.H ../FL/Fl_Choice.H ../FL/Fl_Menu_.H \
+ ../FL/Fl_Menu_Item.H ../FL/Fl_Image.H ../FL/fl_draw.H
+line_style.o: line_style.cxx ../FL/Fl.H ../FL/Enumerations.H \
+ ../FL/Fl_Export.H ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H \
+ ../FL/Fl_Value_Slider.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H \
+ ../FL/fl_draw.H ../FL/Fl_Choice.H ../FL/Fl_Menu_.H ../FL/Fl_Menu_Item.H \
+ ../FL/Fl_Image.H
+list_visuals.o: list_visuals.cxx ../config.h
+mandelbrot.o: mandelbrot.cxx mandelbrot_ui.h ../FL/Fl.H \
+ ../FL/Enumerations.H ../FL/Fl_Export.H mandelbrot.h ../FL/Fl_Box.H \
+ ../FL/Fl_Widget.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H \
+ ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Input.H ../FL/Fl_Input_.H \
+ ../FL/fl_draw.H
+menubar.o: menubar.cxx ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H \
+ ../FL/Fl_Box.H ../FL/Fl_Widget.H ../FL/Fl_Window.H ../FL/Fl_Group.H \
+ ../FL/Fl_Menu_Bar.H ../FL/Fl_Menu_.H ../FL/Fl_Menu_Item.H \
+ ../FL/Fl_Image.H ../FL/Fl_Toggle_Button.H ../FL/Fl_Button.H \
+ ../FL/Fl_Menu_Button.H ../FL/Fl_Choice.H ../src/flstring.h \
+ ../FL/Fl_Export.H ../config.h ../FL/fl_draw.H
+message.o: message.cxx ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H \
+ ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/fl_ask.H
+minimum.o: minimum.cxx ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H \
+ ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Slider.H \
+ ../FL/Fl_Valuator.H ../FL/Fl_Box.H ../FL/Fl_Return_Button.H \
+ ../FL/Fl_Button.H
+navigation.o: navigation.cxx ../FL/Fl.H ../FL/Enumerations.H \
+ ../FL/Fl_Export.H ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H \
+ ../FL/Fl_Input.H ../FL/Fl_Input_.H
+output.o: output.cxx ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H \
+ ../FL/Fl_Value_Input.H ../FL/Fl_Valuator.H ../FL/Fl_Widget.H \
+ ../FL/Fl_Input.H ../FL/Fl_Input_.H ../FL/Fl_Window.H ../FL/Fl_Group.H \
+ ../FL/Fl_Box.H ../FL/Fl_Hor_Value_Slider.H ../FL/Fl_Value_Slider.H \
+ ../FL/Fl_Slider.H ../FL/Fl_Toggle_Button.H ../FL/Fl_Button.H \
+ ../FL/Fl_Input.H ../FL/fl_draw.H ../FL/Fl_Output.H \
+ ../FL/Fl_Multiline_Output.H ../FL/Fl_Output.H
+overlay.o: overlay.cxx ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H \
+ ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H \
+ ../FL/Fl_Overlay_Window.H ../FL/Fl_Double_Window.H ../FL/Fl_Window.H \
+ ../FL/Fl_Button.H ../FL/fl_draw.H
+pack.o: pack.cxx ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H \
+ ../FL/Fl_Button.H ../FL/Fl_Widget.H ../FL/Fl_Light_Button.H \
+ ../FL/Fl_Button.H ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Scroll.H \
+ ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H \
+ ../FL/Fl_Value_Slider.H ../FL/Fl_Pack.H ../FL/Fl_Group.H
+pixmap_browser.o: pixmap_browser.cxx ../FL/Fl.H ../FL/Enumerations.H \
+ ../FL/Fl_Export.H ../FL/Fl_Box.H ../FL/Fl_Widget.H ../FL/Fl_Window.H \
+ ../FL/Fl_Group.H ../FL/Fl_Button.H ../FL/Fl_Shared_Image.H \
+ ../FL/Fl_Image.H ../FL/Fl_File_Chooser.H ../FL/Fl_Double_Window.H \
+ ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Choice.H ../FL/Fl_Menu_.H \
+ ../FL/Fl_Menu_Item.H ../FL/Fl_Menu_Button.H ../FL/Fl_Preferences.H \
+ ../FL/Fl_Tile.H ../FL/Fl_File_Browser.H ../FL/Fl_Browser.H \
+ ../FL/Fl_Browser_.H ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H \
+ ../FL/Fl_Valuator.H ../FL/Fl_File_Icon.H ../FL/Fl.H ../FL/filename.H \
+ ../FL/Fl_Check_Button.H ../FL/Fl_Light_Button.H ../FL/Fl_Button.H \
+ ../FL/Fl_File_Input.H ../FL/Fl_Input.H ../FL/Fl_Input_.H \
+ ../FL/Fl_Return_Button.H ../FL/fl_ask.H ../FL/fl_message.H \
+ ../FL/fl_ask.H
+pixmap.o: pixmap.cxx ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H \
+ ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Button.H \
+ ../FL/Fl_Pixmap.H ../FL/Fl_Image.H pixmaps/porsche.xpm \
+ ../FL/Fl_Toggle_Button.H ../FL/Fl_Button.H ../FL/Fl_Multi_Label.H
+preferences.o: preferences.cxx preferences.h ../FL/Fl.H \
+ ../FL/Enumerations.H ../FL/Fl_Export.H ../FL/Fl_Preferences.H \
+ ../FL/Fl_Double_Window.H ../FL/Fl_Window.H ../FL/Fl_Group.H \
+ ../FL/Fl_Widget.H ../FL/Fl_Button.H ../FL/Fl_Group.H ../FL/Fl_Input.H \
+ ../FL/Fl_Input_.H ../FL/Fl_Choice.H ../FL/Fl_Menu_.H \
+ ../FL/Fl_Menu_Item.H ../FL/Fl_Image.H ../FL/Fl_Round_Button.H \
+ ../FL/Fl_Light_Button.H ../FL/Fl_Button.H ../FL/Fl_Box.H \
+ ../FL/Fl_Check_Button.H ../FL/Fl_Value_Slider.H ../FL/Fl_Slider.H \
+ ../FL/Fl_Valuator.H ../FL/filename.H ../FL/fl_ask.H
+radio.o: radio.cxx radio.h ../FL/Fl.H ../FL/Enumerations.H \
+ ../FL/Fl_Export.H ../FL/Fl_Double_Window.H ../FL/Fl_Window.H \
+ ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Button.H \
+ ../FL/Fl_Return_Button.H ../FL/Fl_Button.H ../FL/Fl_Light_Button.H \
+ ../FL/Fl_Check_Button.H ../FL/Fl_Light_Button.H ../FL/Fl_Round_Button.H \
+ ../FL/Fl_Group.H
+resizebox.o: resizebox.cxx ../FL/Fl.H ../FL/Enumerations.H \
+ ../FL/Fl_Export.H ../FL/Fl_Single_Window.H ../FL/Fl_Window.H \
+ ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Box.H \
+ ../FL/Fl_Radio_Button.H ../FL/Fl_Button.H ../FL/fl_draw.H \
+ ../FL/fl_message.H ../FL/fl_ask.H
+resize.o: resize.cxx resize.h ../FL/Fl.H ../FL/Enumerations.H \
+ ../FL/Fl_Export.H ../FL/Fl_Double_Window.H ../FL/Fl_Window.H \
+ ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Button.H ../FL/Fl_Box.H
+scroll.o: scroll.cxx ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H \
+ ../FL/Fl_Double_Window.H ../FL/Fl_Window.H ../FL/Fl_Group.H \
+ ../FL/Fl_Widget.H ../FL/Fl_Scroll.H ../FL/Fl_Scrollbar.H \
+ ../FL/Fl_Slider.H ../FL/Fl_Valuator.H ../FL/Fl_Light_Button.H \
+ ../FL/Fl_Button.H ../FL/Fl_Choice.H ../FL/Fl_Menu_.H \
+ ../FL/Fl_Menu_Item.H ../FL/Fl_Image.H ../FL/Fl_Box.H ../FL/fl_draw.H \
+ ../FL/math.h
+shape.o: shape.cxx ../config.h ../FL/Fl.H ../FL/Enumerations.H \
+ ../FL/Fl_Export.H ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H \
+ ../FL/Fl_Hor_Slider.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H \
+ ../FL/math.h ../FL/gl.h ../FL/Fl_Gl_Window.H ../FL/Fl_Window.H
+subwindow.o: subwindow.cxx ../FL/Fl.H ../FL/Enumerations.H \
+ ../FL/Fl_Export.H ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H \
+ ../FL/Fl_Toggle_Button.H ../FL/Fl_Button.H ../FL/Fl_Menu_Button.H \
+ ../FL/Fl_Menu_.H ../FL/Fl_Menu_Item.H ../FL/Fl_Image.H ../FL/Fl_Box.H \
+ ../FL/Fl_Input.H ../FL/Fl_Input_.H ../FL/fl_draw.H
+sudoku.o: sudoku.cxx ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H \
+ ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Group.H \
+ ../FL/Fl_Widget.H ../FL/Fl_Button.H ../FL/Fl_Group.H ../FL/fl_ask.H \
+ ../FL/fl_draw.H ../FL/Fl_Help_Dialog.H ../FL/Fl_Double_Window.H \
+ ../FL/Fl_Window.H ../FL/Fl_Input.H ../FL/Fl_Input_.H ../FL/Fl_Box.H \
+ ../FL/Fl_Help_View.H ../FL/Fl.H ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H \
+ ../FL/Fl_Valuator.H ../FL/fl_draw.H ../FL/Fl_Shared_Image.H \
+ ../FL/Fl_Image.H ../FL/Fl_Preferences.H ../FL/Fl_Sys_Menu_Bar.H \
+ ../FL/Fl_Menu_Bar.H ../FL/Fl_Menu_.H ../FL/Fl_Menu_Item.H ../FL/x.H \
+ ../FL/math.h pixmaps/sudoku.xbm ../config.h
+symbols.o: symbols.cxx ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H \
+ ../FL/Fl_Single_Window.H ../FL/Fl_Window.H ../FL/Fl_Group.H \
+ ../FL/Fl_Widget.H ../FL/Fl_Box.H ../FL/Fl_Value_Slider.H \
+ ../FL/Fl_Slider.H ../FL/Fl_Valuator.H ../FL/fl_draw.H
+tabs.o: tabs.cxx tabs.h ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H \
+ ../FL/Fl_Double_Window.H ../FL/Fl_Window.H ../FL/Fl_Group.H \
+ ../FL/Fl_Widget.H ../FL/Fl_Box.H ../FL/Fl_Tabs.H ../FL/Fl_Group.H \
+ ../FL/Fl_Input.H ../FL/Fl_Input_.H ../FL/Fl_Button.H ../FL/fl_ask.H \
+ ../FL/Fl_Clock.H ../FL/Fl_Wizard.H ../FL/Fl_Return_Button.H \
+ ../FL/Fl_Button.H
+threads.o: threads.cxx ../config.h ../FL/Fl.H ../FL/Enumerations.H \
+ ../FL/Fl_Export.H ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H \
+ ../FL/Fl_Browser.H ../FL/Fl_Browser_.H ../FL/Fl_Scrollbar.H \
+ ../FL/Fl_Slider.H ../FL/Fl_Valuator.H ../FL/Fl_Value_Output.H threads.h
+tile.o: tile.cxx ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H \
+ ../FL/Fl_Double_Window.H ../FL/Fl_Window.H ../FL/Fl_Group.H \
+ ../FL/Fl_Widget.H ../FL/Fl_Tile.H ../FL/Fl_Box.H
+tiled_image.o: tiled_image.cxx ../FL/Fl.H ../FL/Enumerations.H \
+ ../FL/Fl_Export.H ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H \
+ ../FL/Fl_Button.H ../FL/Fl_Pixmap.H ../FL/Fl_Image.H \
+ ../FL/Fl_Tiled_Image.H pixmaps/tile.xpm ../FL/x.H ../FL/Fl_Window.H \
+ list_visuals.cxx ../config.h
+valuators.o: valuators.cxx valuators.h ../FL/Fl.H ../FL/Enumerations.H \
+ ../FL/Fl_Export.H ../FL/Fl_Double_Window.H ../FL/Fl_Window.H \
+ ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Box.H ../FL/Fl_Slider.H \
+ ../FL/Fl_Valuator.H ../FL/Fl_Value_Slider.H ../FL/Fl_Slider.H \
+ ../FL/Fl_Value_Input.H ../FL/Fl_Input.H ../FL/Fl_Input_.H \
+ ../FL/Fl_Value_Output.H ../FL/Fl_Scrollbar.H ../FL/Fl_Adjuster.H \
+ ../FL/Fl_Counter.H ../FL/Fl_Spinner.H ../FL/Enumerations.H \
+ ../FL/Fl_Group.H ../FL/Fl_Input.H ../FL/Fl_Repeat_Button.H ../FL/Fl.H \
+ ../FL/Fl_Button.H ../FL/Fl_Dial.H ../FL/Fl_Roller.H
diff --git a/third_party/windows/fltk-1.1.10/test/makefile.wat b/third_party/windows/fltk-1.1.10/test/makefile.wat
new file mode 100644
index 0000000..305fced
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/makefile.wat
@@ -0,0 +1,289 @@
+#
+# "$Id: makefile.wat 4359 2005-05-19 16:07:13Z mike $"
+#
+# Test/example program makefile for the Fast Light Tool Kit (FLTK).
+#
+# Copyright 1998-2004 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@fltk.org".
+#
+
+!include ../watcom.mif
+
+ALL = &
+ $(ODIR)/unittests$(EXEEXT) &
+ $(ODIR)/adjuster$(EXEEXT) &
+ $(ODIR)/arc$(EXEEXT) &
+ $(ODIR)/ask$(EXEEXT) &
+ $(ODIR)/bitmap$(EXEEXT) &
+ $(ODIR)/boxtype$(EXEEXT) &
+ $(ODIR)/browser$(EXEEXT) &
+ $(ODIR)/button$(EXEEXT) &
+ $(ODIR)/buttons$(EXEEXT) &
+ $(ODIR)/checkers$(EXEEXT) &
+ $(ODIR)/clock$(EXEEXT) &
+ $(ODIR)/colbrowser$(EXEEXT) &
+ $(ODIR)/color_chooser$(EXEEXT) &
+ $(ODIR)/cursor$(EXEEXT) &
+ $(ODIR)/curve$(EXEEXT) &
+ $(ODIR)/demo$(EXEEXT) &
+ $(ODIR)/doublebuffer$(EXEEXT) &
+ $(ODIR)/editor$(EXEEXT) &
+ $(ODIR)/fast_slow$(EXEEXT) &
+ $(ODIR)/file_chooser$(EXEEXT) &
+ $(ODIR)/fonts$(EXEEXT) &
+ $(ODIR)/forms$(EXEEXT) &
+ $(ODIR)/hello$(EXEEXT) &
+ $(ODIR)/help$(EXEEXT) &
+ $(ODIR)/iconize$(EXEEXT) &
+ $(ODIR)/image$(EXEEXT) &
+ $(ODIR)/inactive$(EXEEXT) &
+ $(ODIR)/input$(EXEEXT) &
+ $(ODIR)/keyboard$(EXEEXT) &
+ $(ODIR)/label$(EXEEXT) &
+ $(ODIR)/line_style$(EXEEXT) &
+ $(ODIR)/list_visuals$(EXEEXT) &
+ $(ODIR)/mandelbrot$(EXEEXT) &
+ $(ODIR)/menubar$(EXEEXT) &
+ $(ODIR)/message$(EXEEXT) &
+ $(ODIR)/minimum$(EXEEXT) &
+ $(ODIR)/navigation$(EXEEXT) &
+ $(ODIR)/output$(EXEEXT) &
+ $(ODIR)/overlay$(EXEEXT) &
+ $(ODIR)/pack$(EXEEXT) &
+ $(ODIR)/pixmap$(EXEEXT) &
+ $(ODIR)/pixmap_browser$(EXEEXT) &
+ $(ODIR)/preferences$(EXEEXT) &
+ $(ODIR)/radio$(EXEEXT) &
+ $(ODIR)/resize$(EXEEXT) &
+ $(ODIR)/resizebox$(EXEEXT) &
+ $(ODIR)/scroll$(EXEEXT) &
+ $(ODIR)/subwindow$(EXEEXT) &
+ $(ODIR)/symbols$(EXEEXT) &
+ $(ODIR)/tabs$(EXEEXT) &
+ $(ODIR)/threads$(EXEEXT) &
+ $(ODIR)/tile$(EXEEXT) &
+ $(ODIR)/tiled_image$(EXEEXT) &
+ $(ODIR)/valuators$(EXEEXT)
+
+GLALL = &
+ $(ODIR)/cube$(EXEEXT) &
+ $(ODIR)/CubeView$(EXEEXT) &
+ $(ODIR)/fractals$(EXEEXT) &
+ $(ODIR)/fullscreen$(EXEEXT) &
+ $(ODIR)/gl_overlay$(EXEEXT) &
+ $(ODIR)/glpuzzle$(EXEEXT) &
+ $(ODIR)/shape$(EXEEXT)
+
+all: $(ALL) $(GLALL)
+
+gldemos: $(GLALL)
+
+
+# FLUID file rules. We could put them in ../watcom.mif really, but that needs testing.
+.fl.cxx:
+ echo Generating $<...
+ -..\fluid\$(ODIR)\fluid$(EXEEXT) -c $[@
+
+.fl.h:
+ echo Generating $<...
+ -..\fluid\$(ODIR)\fluid$(EXEEXT) -c $[@
+
+# All demos depend on the FLTK library...
+$(ALL): $(LIBNAME)
+
+# General demos..... Normally a executable depending on an object file of the same name
+# shouldn't need a target line. But if different output directories are used, changes
+# in sources files are not picked up, so we do need a line per target.
+
+$(ODIR)/unittests$(EXEEXT) : $(ODIR)/unittests.obj
+
+$(ODIR)/adjuster$(EXEEXT) : $(ODIR)/adjuster.obj
+
+$(ODIR)/arc$(EXEEXT) : $(ODIR)/arc.obj
+
+$(ODIR)/ask$(EXEEXT) : $(ODIR)/ask.obj
+
+$(ODIR)/bitmap$(EXEEXT) : $(ODIR)/bitmap.obj
+
+$(ODIR)/boxtype$(EXEEXT) : $(ODIR)/boxtype.obj
+
+$(ODIR)/browser$(EXEEXT) : $(ODIR)/browser.obj
+
+$(ODIR)/button$(EXEEXT) : $(ODIR)/button.obj
+
+$(ODIR)/buttons$(EXEEXT) : $(ODIR)/buttons.obj
+
+$(ODIR)/checkers$(EXEEXT) : $(ODIR)/checkers.obj
+
+$(ODIR)/clock$(EXEEXT) : $(ODIR)/clock.obj
+
+$(ODIR)/colbrowser$(EXEEXT) : $(ODIR)/colbrowser.obj
+
+$(ODIR)/color_chooser$(EXEEXT) : $(ODIR)/color_chooser.obj
+
+$(ODIR)/cursor$(EXEEXT) : $(ODIR)/cursor.obj
+
+$(ODIR)/curve$(EXEEXT) : $(ODIR)/curve.obj
+
+$(ODIR)/demo$(EXEEXT) : $(ODIR)/demo.obj
+
+$(ODIR)/doublebuffer$(EXEEXT) : $(ODIR)/doublebuffer.obj
+
+$(ODIR)/editor$(EXEEXT) : $(ODIR)/editor.obj
+
+$(ODIR)/fast_slow$(EXEEXT) : $(ODIR)/fast_slow.obj
+
+$(ODIR)/file_chooser$(EXEEXT) : $(ODIR)/file_chooser.obj
+
+$(ODIR)/fonts$(EXEEXT) : $(ODIR)/fonts.obj
+
+$(ODIR)/forms$(EXEEXT) : $(ODIR)/forms.obj
+
+$(ODIR)/hello$(EXEEXT) : $(ODIR)/hello.obj
+
+$(ODIR)/help$(EXEEXT) : $(ODIR)/help.obj
+
+$(ODIR)/iconize$(EXEEXT) : $(ODIR)/iconize.obj
+
+$(ODIR)/image$(EXEEXT) : $(ODIR)/image.obj
+
+$(ODIR)/inactive$(EXEEXT) : $(ODIR)/inactive.obj
+
+$(ODIR)/input$(EXEEXT) : $(ODIR)/input.obj
+
+$(ODIR)/label$(EXEEXT) : $(ODIR)/label.obj
+
+$(ODIR)/line_style$(EXEEXT) : $(ODIR)/line_style.obj
+
+$(ODIR)/list_visuals$(EXEEXT) : $(ODIR)/list_visuals.obj
+
+$(ODIR)/menubar$(EXEEXT) : $(ODIR)/menubar.obj
+
+$(ODIR)/message$(EXEEXT) : $(ODIR)/message.obj
+
+$(ODIR)/minimum$(EXEEXT) : $(ODIR)/minimum.obj
+
+$(ODIR)/navigation$(EXEEXT) : $(ODIR)/navigation.obj
+
+$(ODIR)/output$(EXEEXT) : $(ODIR)/output.obj
+
+$(ODIR)/overlay$(EXEEXT) : $(ODIR)/overlay.obj
+
+$(ODIR)/pack$(EXEEXT) : $(ODIR)/pack.obj
+
+$(ODIR)/pixmap$(EXEEXT) : $(ODIR)/pixmap.obj
+
+$(ODIR)/pixmap_browser$(EXEEXT) : $(ODIR)/pixmap_browser.obj
+
+$(ODIR)/preferences$(EXEEXT) : $(ODIR)/preferences.obj
+
+$(ODIR)/radio$(EXEEXT) : $(ODIR)/radio.obj
+
+$(ODIR)/resize$(EXEEXT) : $(ODIR)/resize.obj
+
+$(ODIR)/resizebox$(EXEEXT) : $(ODIR)/resizebox.obj
+
+$(ODIR)/scroll$(EXEEXT) : $(ODIR)/scroll.obj
+
+$(ODIR)/subwindow$(EXEEXT) : $(ODIR)/subwindow.obj
+
+$(ODIR)/symbols$(EXEEXT) : $(ODIR)/symbols.obj
+
+$(ODIR)/tabs$(EXEEXT) : $(ODIR)/tabs.obj
+
+$(ODIR)/threads$(EXEEXT) : $(ODIR)/threads.obj
+
+$(ODIR)/tile$(EXEEXT) : $(ODIR)/tile.obj
+
+$(ODIR)/tiled_image$(EXEEXT) : $(ODIR)/tiled_image.obj
+
+$(ODIR)/valuators$(EXEEXT) : $(ODIR)/valuators.obj
+
+# Because keyboard_ui.obj is listed first, fluid will be used to generate the .cxx and .h file
+# so that when keyboard.obj is built, keyboard_ui.h is there.
+KBDOBJECTS=keyboard_ui.obj keyboard.obj
+$(ODIR)/keyboard$(EXEEXT): $(KBDOBJECTS) keyboard_ui.h
+ @%create $^*.lk1
+ @for %i in ($(KBDOBJECTS)) do @%append $^*.lk1 F $(ODIR)/%i
+ @for %i in ($(LIBS)) do @%append $^*.lk1 L %i
+ @for %i in ($(EXTRA_LIBS)) do @%append $^*.lk1 L %i
+ @for %i in ($(SYSLIBS)) do @%append $^*.lk1 L %i
+ $(LN) $(LNOPTS) name $^@ op map=$^* @$^*.lk1
+ @del $^*.lk1
+ @set KBDOBJECTS=
+
+MDLOBJECTS=mandelbrot_ui.obj mandelbrot.obj
+$(ODIR)/mandelbrot$(EXEEXT): $(MDLOBJECTS)
+ @%create $^*.lk1
+ @for %i in ($(MDLOBJECTS)) do @%append $^*.lk1 F $(ODIR)/%i
+ @for %i in ($(LIBS)) do @%append $^*.lk1 L %i
+ @for %i in ($(EXTRA_LIBS)) do @%append $^*.lk1 L %i
+ @for %i in ($(SYSLIBS)) do @%append $^*.lk1 L %i
+ $(LN) $(LNOPTS) name $^@ op map=$^* @$^*.lk1
+ @del $^*.lk1
+
+# All OpenGL demos depend on the FLTK and FLTK_GL libraries...
+$(GLALL): $(LIBNAME) $(LIBNAMEGL)
+
+# OpenGL demos...
+
+$(ODIR)/cube$(EXEEXT) : $(ODIR)/cube.obj
+
+$(ODIR)/fullscreen$(EXEEXT) : $(ODIR)/fullscreen.obj
+
+$(ODIR)/gl_overlay$(EXEEXT) : $(ODIR)/gl_overlay.obj
+
+$(ODIR)/glpuzzle$(EXEEXT) : $(ODIR)/glpuzzle.obj
+
+$(ODIR)/shape$(EXEEXT) : $(ODIR)/shape.obj
+
+CBVOBJECTS = CubeView.obj CubeViewUI.obj CubeMain.obj
+$(ODIR)/CubeView$(EXEEXT): $(CBVOBJECTS)
+ @%create $^*.lk1
+ @for %i in ($(CBVOBJECTS)) do @%append $^*.lk1 F $(ODIR)/%i
+ @for %i in ($(LIBS)) do @%append $^*.lk1 L %i
+ @for %i in ($(EXTRA_LIBS)) do @%append $^*.lk1 L %i
+ @for %i in ($(SYSLIBS)) do @%append $^*.lk1 L %i
+ $(LN) $(LNOPTS) name $^@ op map=$^* @$^*.lk1
+ @del $^*.lk1
+
+FRTOBJECTS = fractals.obj fracviewer.obj
+$(ODIR)/fractals$(EXEEXT): $(FRTOBJECTS)
+ @%create $^*.lk1
+ @for %i in ($(FRTOBJECTS)) do @%append $^*.lk1 F $(ODIR)/%i
+ @for %i in ($(LIBS)) do @%append $^*.lk1 L %i
+ @for %i in ($(EXTRA_LIBS)) do @%append $^*.lk1 L %i
+ @for %i in ($(SYSLIBS)) do @%append $^*.lk1 L %i
+ $(LN) $(LNOPTS) name $^@ op map=$^* @$^*.lk1
+ @del $^*.lk1
+
+#
+# Clean all directories
+#
+clean : .SYMBOLIC
+ @echo Cleaning up.
+CLEANEXTS = exe map sym obj lk1
+ @for %a in ($(CLEANEXTS)) do -rm -f $(ODIR)\*.%a
+ -rm -f *.err
+FLUIDMADE = fastslow inactive keyboard_ui preferences radio resize tabs valuators
+ @for %a in ($(FLUIDMADE)) do -rm -f %a.cxx %a.h
+
+#
+# End of "$Id: makefile.wat 4359 2005-05-19 16:07:13Z mike $".
+#
diff --git a/third_party/windows/fltk-1.1.10/test/mandelbrot.cxx b/third_party/windows/fltk-1.1.10/test/mandelbrot.cxx
new file mode 100644
index 0000000..27a40c2
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/mandelbrot.cxx
@@ -0,0 +1,203 @@
+//
+// "$Id: mandelbrot.cxx 6474 2008-10-19 20:15:48Z matt $"
+//
+// Mandelbrot set demo for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2005 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 "mandelbrot_ui.h"
+#include <FL/fl_draw.H>
+#include <stdio.h>
+#include <stdlib.h>
+
+Drawing_Window mbrot;
+Drawing_Window jbrot;
+
+void idle(void*) {
+ if (!mbrot.d->idle() && !(jbrot.d && jbrot.d->idle())) Fl::remove_idle(idle);
+}
+
+void set_idle() {
+ Fl::add_idle(idle);
+}
+
+static void window_callback(Fl_Widget*, void*) {exit(0);}
+
+int main(int argc, char **argv) {
+ mbrot.make_window();
+ mbrot.d->X = -.75;
+ mbrot.d->scale = 2.5;
+ mbrot.update_label();
+ int i = 0;
+ if (Fl::args(argc,argv,i) < argc) Fl::fatal(Fl::help);
+ Fl::visual(FL_RGB);
+ mbrot.window->callback(window_callback);
+ mbrot.window->show(argc,argv);
+ Fl::run();
+ return 0;
+}
+
+void Drawing_Window::update_label() {
+ char buffer[128];
+ sprintf(buffer, "%+.10f", d->X); x_input->value(buffer);
+ sprintf(buffer, "%+.10f", d->Y); y_input->value(buffer);
+ sprintf(buffer, "%.2g", d->scale); w_input->value(buffer);
+}
+
+void Drawing_Area::draw() {
+ draw_box();
+ drawn = 0;
+ set_idle();
+}
+
+int Drawing_Area::idle() {
+ if (!window()->visible()) return 0;
+ if (drawn < nextline) {
+ window()->make_current();
+ int yy = drawn+y()+4;
+ if (yy >= sy && yy <= sy+sh) erase_box();
+ fl_draw_image_mono(buffer+drawn*W,x()+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 Drawing_Area::erase_box() {
+ window()->make_current();
+ fl_overlay_clear();
+}
+
+int Drawing_Area::handle(int event) {
+ static int ix, iy;
+ static int dragged;
+ static int button;
+ int x2,y2;
+ switch (event) {
+ case FL_PUSH:
+ erase_box();
+ ix = Fl::event_x(); if (ix<x()) ix=x(); if (ix>=x()+w()) ix=x()+w()-1;
+ iy = Fl::event_y(); if (iy<y()) iy=y(); if (iy>=y()+h()) iy=y()+h()-1;
+ dragged = 0;
+ button = Fl::event_button();
+ return 1;
+ case FL_DRAG:
+ dragged = 1;
+ erase_box();
+ x2 = Fl::event_x(); if (x2<x()) x2=x(); if (x2>=x()+w()) x2=x()+w()-1;
+ y2 = Fl::event_y(); if (y2<y()) y2=y(); if (y2>=y()+h()) y2=y()+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;}
+ window()->make_current();
+ fl_overlay_rect(sx,sy,sw,sh);
+ return 1;
+ case FL_RELEASE:
+ if (button == 1) {
+ erase_box();
+ if (dragged && sw > 3 && sh > 3) {
+ X = X + (sx+sw/2-x()-W/2)*scale/W;
+ Y = Y + (-sy-sh/2+y()+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;
+ ((Drawing_Window*)(user_data()))->update_label();
+ new_display();
+ } else if (!julia) {
+ if (!jbrot.d) {
+ jbrot.make_window();
+ jbrot.d->julia = 1;
+ jbrot.d->X = 0;
+ jbrot.d->Y = 0;
+ jbrot.d->scale = 4;
+ jbrot.update_label();
+ }
+ jbrot.d->jX = X + (ix-x()-W/2)*scale/W;
+ jbrot.d->jY = Y + (H/2-iy+y())*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;
+ }
+ return 0;
+}
+
+void Drawing_Area::new_display() {
+ drawn = nextline = 0;
+ set_idle();
+}
+
+void Drawing_Area::resize(int XX,int YY,int WW,int HH) {
+ if (WW != w() || HH != h()) {
+ W = WW-6;
+ H = HH-8;
+ if (buffer) {delete[] buffer; buffer = 0; new_display();}
+ }
+ Fl_Box::resize(XX,YY,WW,HH);
+}
+
+//
+// End of "$Id: mandelbrot.cxx 6474 2008-10-19 20:15:48Z matt $".
+//
diff --git a/third_party/windows/fltk-1.1.10/test/mandelbrot.h b/third_party/windows/fltk-1.1.10/test/mandelbrot.h
new file mode 100644
index 0000000..179ea4e
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/mandelbrot.h
@@ -0,0 +1,74 @@
+//
+// "$Id: mandelbrot.h 5519 2006-10-11 03:12:15Z mike $"
+//
+// Mandelbrot set header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2005 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 <FL/Fl.H>
+#include <FL/Fl_Box.H>
+#include <FL/Fl_Slider.H>
+#include <FL/Fl_Window.H>
+#include <FL/Fl_Input.H>
+
+class Drawing_Area : public Fl_Box {
+ 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 resize(int,int,int,int);
+ void new_display();
+ enum {
+ MAX_BRIGHTNESS = 16,
+ DEFAULT_BRIGHTNESS = 16,
+ MAX_ITERATIONS = 14,
+ DEFAULT_ITERATIONS = 7
+ };
+ Drawing_Area(int x,int y,int w,int h) : Fl_Box(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 5519 2006-10-11 03:12:15Z mike $".
+//
diff --git a/third_party/windows/fltk-1.1.10/test/mandelbrot_ui.fl b/third_party/windows/fltk-1.1.10/test/mandelbrot_ui.fl
new file mode 100644
index 0000000..ae462d4
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/mandelbrot_ui.fl
@@ -0,0 +1,71 @@
+# data file for the Fltk User Interface Designer (fluid)
+version 1.0108
+header_name {.h}
+code_name {.cxx}
+decl {\#include "mandelbrot.h"} {public
+}
+
+decl {\#include <stdlib.h>} {}
+
+class Drawing_Window {open
+} {
+ Function {make_window()} {open return_type void
+ } {
+ Fl_Window window {open selected
+ xywh {178 479 450 520} type Single resizable
+ code0 {o->size_range(220,220);} visible
+ } {
+ Fl_Box d {
+ user_data this user_data_type {void*}
+ xywh {20 80 410 430} box DOWN_BOX color 0 selection_color 47 resizable
+ class Drawing_Area
+ }
+ Fl_Input x_input {
+ label {x:}
+ callback {d->X = atof(o->value());;
+d->new_display();}
+ xywh {30 15 125 30} type Float box THIN_DOWN_BOX color 8 selection_color 7 labelfont 11 labelsize 20 textfont 11 textsize 20
+ code0 {o->when(FL_WHEN_ENTER_KEY|FL_WHEN_RELEASE);}
+ }
+ Fl_Input y_input {
+ label {y:}
+ callback {d->Y = atof(o->value());
+d->new_display();}
+ xywh {175 15 125 30} type Float box THIN_DOWN_BOX color 8 selection_color 7 labelfont 11 labelsize 20 textfont 11 textsize 20
+ code0 {o->when(FL_WHEN_ENTER_KEY|FL_WHEN_RELEASE);}
+ }
+ Fl_Input w_input {
+ label {w:}
+ callback {d->scale = atof(o->value());
+d->new_display();}
+ xywh {325 15 105 30} type Float box THIN_DOWN_BOX color 8 selection_color 7 labelfont 11 labelsize 20 textfont 11 textsize 20
+ code0 {o->when(FL_WHEN_ENTER_KEY|FL_WHEN_RELEASE);}
+ }
+ Fl_Slider {} {
+ label {brightness:}
+ callback {d->brightness = int(o->value());
+d->new_display();}
+ xywh {80 50 160 15} type Horizontal box THIN_DOWN_BOX labelsize 10 align 4 step 1 slider_size 0.1
+ code0 {o->bounds(0,d->MAX_BRIGHTNESS);}
+ code2 {o->value(d->DEFAULT_BRIGHTNESS);}
+ code3 {o->slider(FL_UP_BOX);}
+ }
+ Fl_Box {} {
+ label {left: click = zoom out, drag = zoom in
+right click: Julia set}
+ xywh {240 50 190 30} labelsize 10 align 24 deactivate
+ }
+ Fl_Slider {} {
+ label {iterations:}
+ callback {d->iterations = 1<<int(o->value());
+d->new_display();}
+ xywh {80 65 160 15} type Horizontal box THIN_DOWN_BOX labelsize 10 align 4 step 1 slider_size 0.1
+ code0 {o->bounds(1,d->MAX_ITERATIONS);}
+ code2 {o->value(d->DEFAULT_ITERATIONS);}
+ code3 {o->slider(FL_UP_BOX);}
+ }
+ }
+ }
+ decl {void update_label();} {public
+ }
+}
diff --git a/third_party/windows/fltk-1.1.10/test/menubar.cxx b/third_party/windows/fltk-1.1.10/test/menubar.cxx
new file mode 100644
index 0000000..f198f3b
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/menubar.cxx
@@ -0,0 +1,247 @@
+//
+// "$Id: menubar.cxx 6610 2008-12-29 17:24:51Z matt $"
+//
+// Menubar test program for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2005 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 <FL/Fl.H>
+#include <FL/Fl_Box.H>
+#include <FL/Fl_Window.H>
+#include <FL/Fl_Menu_Bar.H>
+#include <FL/Fl_Toggle_Button.H>
+#include <FL/Fl_Menu_Button.H>
+#include <FL/Fl_Choice.H>
+#include <stdio.h>
+#include <stdlib.h>
+#include "../src/flstring.h"
+#include <FL/fl_draw.H>
+
+void window_cb(Fl_Widget* w, void*) {
+ puts("window callback called");
+ ((Fl_Window *)w)->hide();
+}
+
+void test_cb(Fl_Widget* w, void*) {
+ Fl_Menu_* mw = (Fl_Menu_*)w;
+ const Fl_Menu_Item* m = mw->mvalue();
+ if (!m)
+ printf("NULL\n");
+ else if (m->shortcut())
+ printf("%s - %s\n", m->label(), fl_shortcut_label(m->shortcut()));
+ else
+ printf("%s\n", m->label());
+}
+
+void quit_cb(Fl_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", FL_ALT+'o', 0, 0, FL_MENU_INACTIVE},
+ {"&Close", 0, 0},
+ {"&Quit", FL_ALT+'q', quit_cb, 0, FL_MENU_DIVIDER},
+ {"shortcut",'a'},
+ {"shortcut",FL_SHIFT+'a'},
+ {"shortcut",FL_CTRL+'a'},
+ {"shortcut",FL_CTRL+FL_SHIFT+'a'},
+ {"shortcut",FL_ALT+'a'},
+ {"shortcut",FL_ALT+FL_SHIFT+'a'},
+ {"shortcut",FL_ALT+FL_CTRL+'a'},
+ {"shortcut",FL_ALT+FL_SHIFT+FL_CTRL+'a', 0,0, FL_MENU_DIVIDER},
+ {"shortcut",'\r'/*FL_Enter*/},
+ {"shortcut",FL_CTRL+FL_Enter, 0,0, FL_MENU_DIVIDER},
+ {"shortcut",FL_F+1},
+ {"shortcut",FL_SHIFT+FL_F+1},
+ {"shortcut",FL_CTRL+FL_F+1},
+ {"shortcut",FL_SHIFT+FL_CTRL+FL_F+1},
+ {"shortcut",FL_ALT+FL_F+1},
+ {"shortcut",FL_ALT+FL_SHIFT+FL_F+1},
+ {"shortcut",FL_ALT+FL_CTRL+FL_F+1},
+ {"shortcut",FL_ALT+FL_SHIFT+FL_CTRL+FL_F+1, 0,0, FL_MENU_DIVIDER},
+ {"&Submenus", FL_ALT+'S', 0, (void*)"Submenu1", FL_SUBMENU},
+ {"A very long menu item"},
+ {"&submenu",FL_CTRL+'S', 0, (void*)"submenu2", FL_SUBMENU},
+ {"item 1"},
+ {"item 2"},
+ {"item 3"},
+ {"item 4"},
+ {0},
+ {"after submenu"},
+ {0},
+ {0},
+ {"&Edit",FL_F+2,0,0,FL_SUBMENU},
+ {"Undo", FL_ALT+'z', 0},
+ {"Redo", FL_ALT+'r', 0, 0, FL_MENU_DIVIDER},
+ {"Cut", FL_ALT+'x', 0},
+ {"Copy", FL_ALT+'c', 0},
+ {"Paste", FL_ALT+'v', 0},
+ {"Inactive",FL_ALT+'d', 0, 0, FL_MENU_INACTIVE},
+ {"Clear", 0, 0, 0, FL_MENU_DIVIDER},
+ {"Invisible",FL_ALT+'e', 0, 0, FL_MENU_INVISIBLE},
+ {"Preferences",0, 0},
+ {"Size", 0, 0},
+ {0},
+ {"&Checkbox",FL_F+3,0,0,FL_SUBMENU},
+ {"&Alpha", FL_F+2, 0, (void *)1, FL_MENU_TOGGLE},
+ {"&Beta", 0, 0, (void *)2, FL_MENU_TOGGLE},
+ {"&Gamma", 0, 0, (void *)3, FL_MENU_TOGGLE},
+ {"&Delta", 0, 0, (void *)4, FL_MENU_TOGGLE|FL_MENU_VALUE},
+ {"&Epsilon",0, 0, (void *)5, FL_MENU_TOGGLE},
+ {"&Pi", 0, 0, (void *)6, FL_MENU_TOGGLE},
+ {"&Mu", 0, 0, (void *)7, FL_MENU_TOGGLE|FL_MENU_DIVIDER},
+ {"Red", 0, 0, (void *)1, FL_MENU_TOGGLE, 0, 0, 0, 1},
+ {"Black", 0, 0, (void *)1, FL_MENU_TOGGLE|FL_MENU_DIVIDER},
+ {"00", 0, 0, (void *)1, FL_MENU_TOGGLE},
+ {"000", 0, 0, (void *)1, FL_MENU_TOGGLE},
+ {0},
+ {"&Radio",0,0,0,FL_SUBMENU},
+ {"&Alpha", 0, 0, (void *)1, FL_MENU_RADIO},
+ {"&Beta", 0, 0, (void *)2, FL_MENU_RADIO},
+ {"&Gamma", 0, 0, (void *)3, FL_MENU_RADIO},
+ {"&Delta", 0, 0, (void *)4, FL_MENU_RADIO|FL_MENU_VALUE},
+ {"&Epsilon",0, 0, (void *)5, FL_MENU_RADIO},
+ {"&Pi", 0, 0, (void *)6, FL_MENU_RADIO},
+ {"&Mu", 0, 0, (void *)7, FL_MENU_RADIO|FL_MENU_DIVIDER},
+ {"Red", 0, 0, (void *)1, FL_MENU_RADIO},
+ {"Black", 0, 0, (void *)1, FL_MENU_RADIO|FL_MENU_DIVIDER},
+ {"00", 0, 0, (void *)1, FL_MENU_RADIO},
+ {"000", 0, 0, (void *)1, FL_MENU_RADIO},
+ {0},
+ {"&Font",0,0,0,FL_SUBMENU /*, 0, FL_BOLD, 20*/},
+ {"Normal", 0, 0, 0, 0, 0, 0, 14},
+ {"Bold", 0, 0, 0, 0, 0, FL_BOLD, 14},
+ {"Italic", 0, 0, 0, 0, 0, FL_ITALIC, 14},
+ {"BoldItalic",0,0,0, 0, 0, FL_BOLD+FL_ITALIC, 14},
+ {"Small", 0, 0, 0, 0, 0, FL_BOLD+FL_ITALIC, 10},
+ {"Emboss", 0, 0, 0, 0, FL_EMBOSSED_LABEL},
+ {"Engrave", 0, 0, 0, 0, FL_ENGRAVED_LABEL},
+ {"Shadow", 0, 0, 0, 0, FL_SHADOW_LABEL},
+ {"@->", 0, 0, 0, 0, FL_SYMBOL_LABEL},
+ {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},
+ {"button",FL_F+4, 0, 0, FL_MENU_TOGGLE},
+ {0}
+};
+
+Fl_Menu_Item pulldown[] = {
+ {"Red", FL_ALT+'r'},
+ {"Green", FL_ALT+'g'},
+ {"Blue", FL_ALT+'b'},
+ {"Strange", FL_ALT+'s', 0, 0, FL_MENU_INACTIVE},
+ {"&Charm", FL_ALT+'c'},
+ {"Truth", FL_ALT+'t'},
+ {"Beauty", FL_ALT+'b'},
+ {0}
+};
+
+#define WIDTH 600
+
+Fl_Menu_* menus[4];
+
+class MyWindow : public Fl_Window {
+public:
+ MyWindow(int w, int h, const char *l=0)
+ : Fl_Window(w, h, l) { }
+ int handle(int event) {
+ switch (event) {
+ case FL_ENTER:
+// puts("ENTER"); break;
+ case FL_LEAVE:
+// puts("LEAVE"); break;
+ break;
+ }
+// printf("%d\n", event);
+ return Fl_Window::handle(event);
+ }
+};
+
+
+class MyButton : public Fl_Button {
+public:
+ MyButton(int x, int y,int w, int h, const char *l=0)
+ : Fl_Button(x, y, w, h, l) { }
+ int handle(int event) {
+ switch (event) {
+ case FL_ENTER:
+ puts("ENTER"); break;
+ case FL_LEAVE:
+ puts("LEAVE"); break;
+ }
+ printf("%d\n", event);
+ return Fl_Button::handle(event);
+ }
+};
+
+
+int main(int argc, char **argv) {
+ //Fl::set_color(Fl_Color(15),0,0,128);
+ for (int i=0; i<99; i++) {
+ char buf[100];
+ sprintf(buf,"item %d",i);
+ hugemenu[i].text = strdup(buf);
+ }
+ MyWindow window(WIDTH,400);
+ window.callback(window_cb);
+ Fl_Menu_Bar menubar(0,0,WIDTH,30); menubar.menu(menutable);
+ menubar.callback(test_cb);
+ menus[0] = &menubar;
+ MyButton bb(100, 125, 120, 25, "Erwinn");
+ Fl_Menu_Button mb1(100,100,120,25,"&menubutton"); mb1.menu(pulldown);
+ mb1.tooltip("this is a menu button");
+ mb1.callback(test_cb);
+ menus[1] = &mb1;
+ Fl_Choice ch(300,100,80,25,"&choice:"); ch.menu(pulldown);
+ ch.tooltip("this is a choice menu");
+ ch.callback(test_cb);
+ menus[2] = &ch;
+ Fl_Menu_Button mb(0,0,WIDTH,400,"&popup");
+ mb.type(Fl_Menu_Button::POPUP3);
+ mb.box(FL_NO_BOX);
+ mb.menu(menutable);
+ mb.remove(1); // delete the "File" submenu
+ mb.callback(test_cb);
+ menus[3] = &mb;
+ Fl_Box b(200,200,200,100,"Press right button\nfor a pop-up menu");
+ window.resizable(&mb);
+ window.size_range(300,400,0,400);
+ window.end();
+ window.show(argc, argv);
+ return Fl::run();
+}
+
+//
+// End of "$Id: menubar.cxx 6610 2008-12-29 17:24:51Z matt $".
+//
diff --git a/third_party/windows/fltk-1.1.10/test/message.cxx b/third_party/windows/fltk-1.1.10/test/message.cxx
new file mode 100644
index 0000000..349106e
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/message.cxx
@@ -0,0 +1,70 @@
+//
+// "$Id: message.cxx 5805 2007-05-09 12:42:39Z matt $"
+//
+// Message test program for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2005 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 <FL/Fl.H>
+#include <FL/Fl_Window.H>
+#include <FL/fl_ask.H>
+#include <stdio.h>
+
+int main(int argc, char **argv) {
+ Fl::scheme(NULL);
+ Fl::args(argc, argv);
+ Fl::get_system_colors();
+
+ fl_message("Spelling check sucessful, %d errors found with %g%% confidence",
+ 1002, 100*(15/77.0));
+
+ fl_alert(
+ "Quantum fluctuations in the space-time continuum detected,\n"
+ "you have %g seconds to comply.\n\n"
+ "\"In physics, spacetime is any mathematical model that combines\n"
+ "space and time into a single construct called the space-time\n"
+ "continuum. Spacetime is usually interpreted with space being\n"
+ "three-dimensional and time playing the role of the\n"
+ "fourth dimension.\" - Wikipedia",
+ 10.0);
+
+ printf("fl_choice returned %d\n",
+ fl_choice("Do you really want to %s?", "No", "Yes", 0L, "continue"));
+
+ printf("fl_choice returned %d\n",
+ fl_choice("Choose one of the following:","choice0","choice1","choice2"));
+ const char *r;
+
+ r = fl_input("Please enter a string for '%s':", "this is the default value",
+ "testing");
+ printf("fl_input returned \"%s\"\n", r ? r : "NULL");
+
+ r = fl_password("Enter %s's password:", 0, "somebody");
+ printf("fl_password returned \"%s\"\n", r ? r : "NULL");
+
+ return 0;
+}
+
+//
+// End of "$Id: message.cxx 5805 2007-05-09 12:42:39Z matt $".
+//
diff --git a/third_party/windows/fltk-1.1.10/test/minimum.cxx b/third_party/windows/fltk-1.1.10/test/minimum.cxx
new file mode 100644
index 0000000..318e3b4
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/minimum.cxx
@@ -0,0 +1,80 @@
+//
+// "$Id: minimum.cxx 5519 2006-10-11 03:12:15Z mike $"
+//
+// Minimal update test program for the Fast Light Tool Kit (FLTK).
+//
+// This is a test of the minimal update code. The right slider has a
+// label that extends outside it's border, and the minimal update
+// assummes this does not happen. Thus there is *supposed* to be
+// display errors when you move the right-most or any other slider.
+// If you *don't* see these errors, then the minimal update is
+// broken!!!
+//
+// I cannot emphasize how important it is to test this and make sure
+// any changes have not broken the minimal update. These sort of bugs
+// are extremely hard to fix and must be detected right away!
+//
+// The reason it is important to fix this is that otherwise you will
+// swiftly end up with a toolkit that thinks it has to draw the window
+// 20 times each time the display changes. I don't care how fast the
+// machine is, this is an insane waste of resources, and should be
+// stopped!
+//
+// Copyright 1998-2005 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 <FL/Fl.H>
+#include <FL/Fl_Window.H>
+#include <FL/Fl_Slider.H>
+#include <FL/Fl_Box.H>
+#include <FL/Fl_Return_Button.H>
+
+int main(int argc, char **argv) {
+ Fl_Window *window = new Fl_Window(400,320,argv[0]);
+ window->resizable(*(new Fl_Box(FL_ENGRAVED_FRAME,10,10,300,300,
+"MINIMUM UPDATE TEST\n"
+"\n"
+"The slider on the right purposely\n"
+"draws outside it's boundaries.\n"
+"Moving it should leave old copies\n"
+"of the label. These copies should\n"
+"*not* be erased by any actions\n"
+"other than hiding and showing\n"
+"of that portion of the window\n"
+"or changing the button that\n"
+"intesects them.")));
+
+ Fl_Slider *s;
+ s = new Fl_Slider(320,10,20,300,"Too_Big_Label");
+ s->align(0);
+
+ new Fl_Button(20,270,100,30,"Button");
+ new Fl_Return_Button(200,270,100,30,"Button");
+
+ window->show(argc, argv);
+ return Fl::run();
+}
+
+//
+// End of "$Id: minimum.cxx 5519 2006-10-11 03:12:15Z mike $".
+//
diff --git a/third_party/windows/fltk-1.1.10/test/navigation.cxx b/third_party/windows/fltk-1.1.10/test/navigation.cxx
new file mode 100644
index 0000000..2148c8b
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/navigation.cxx
@@ -0,0 +1,72 @@
+//
+// "$Id: navigation.cxx 5519 2006-10-11 03:12:15Z mike $"
+//
+// 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-2005 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 <FL/Fl.H>
+#include <FL/Fl_Window.H>
+#include <FL/Fl_Input.H>
+
+#define WIDTH 600
+#define HEIGHT 300
+#define GRID 25
+
+int main(int argc, char **argv) {
+ if (argc > 1) srand(atoi(argv[1]));
+ Fl_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:
+ Fl_Widget *j = 0;
+ int n; for (n=0; n < window.children(); n++) {
+ Fl_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 Fl_Input(x,y,w,h)),j);
+ }
+ window.show(argc, argv);
+ return Fl::run();
+}
+
+//
+// End of "$Id: navigation.cxx 5519 2006-10-11 03:12:15Z mike $".
+//
diff --git a/third_party/windows/fltk-1.1.10/test/output.cxx b/third_party/windows/fltk-1.1.10/test/output.cxx
new file mode 100644
index 0000000..56807a7
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/output.cxx
@@ -0,0 +1,105 @@
+//
+// "$Id: output.cxx 5519 2006-10-11 03:12:15Z mike $"
+//
+// Output test program for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2005 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 <FL/Fl.H>
+#include <FL/Fl_Value_Input.H> // necessary for bug in mingw32?
+#include <FL/Fl_Window.H>
+#include <FL/Fl_Box.H>
+#include <FL/Fl_Hor_Value_Slider.H>
+#include <FL/Fl_Toggle_Button.H>
+#include <FL/Fl_Input.H>
+#include <FL/fl_draw.H>
+#include <FL/Fl_Output.H>
+#include <FL/Fl_Multiline_Output.H>
+
+Fl_Output *text;
+Fl_Multiline_Output *text2;
+Fl_Input *input;
+Fl_Value_Slider *fonts;
+Fl_Value_Slider *sizes;
+Fl_Window *window;
+
+void font_cb(Fl_Widget *,void *) {
+ text->textfont(int(fonts->value()));
+ text->redraw();
+ text2->textfont(int(fonts->value()));
+ text2->redraw();
+}
+
+void size_cb(Fl_Widget *,void *) {
+ text->textsize(int(sizes->value()));
+ text->redraw();
+ text2->textsize(int(sizes->value()));
+ text2->redraw();
+}
+
+void input_cb(Fl_Widget *,void *) {
+ text->value(input->value());
+ text2->value(input->value());
+}
+
+int main(int argc, char **argv) {
+ window = new Fl_Window(400,400);
+
+ input = new Fl_Input(50,0,350,25);
+ input->static_value("The quick brown fox\njumped over\nthe lazy dog.");
+ input->when(FL_WHEN_CHANGED);
+ input->callback(input_cb);
+
+ sizes = new Fl_Hor_Value_Slider(50,25,350,25,"Size");
+ sizes->align(FL_ALIGN_LEFT);
+ sizes->bounds(1,64);
+ sizes->step(1);
+ sizes->value(14);
+ sizes->callback(size_cb);
+
+ fonts = new Fl_Hor_Value_Slider(50,50,350,25,"Font");
+ fonts->align(FL_ALIGN_LEFT);
+ fonts->bounds(0,15);
+ fonts->step(1);
+ fonts->value(0);
+ fonts->callback(font_cb);
+
+ text2 = new Fl_Multiline_Output(100,150,200,100,"Fl_Multiline_Output");
+ text2->value(input->value());
+ text2->align(FL_ALIGN_BOTTOM);
+ text2->tooltip("This is an Fl_Multiline_Output widget.");
+ window->resizable(text2);
+
+ text = new Fl_Output(100,280,200,30,"Fl_Output");
+ text->value(input->value());
+ text->align(FL_ALIGN_BOTTOM);
+ text->tooltip("This is an Fl_Output widget.");
+
+ window->forms_end();
+ window->show(argc,argv);
+ return Fl::run();
+}
+
+//
+// End of "$Id: output.cxx 5519 2006-10-11 03:12:15Z mike $".
+//
diff --git a/third_party/windows/fltk-1.1.10/test/overlay.cxx b/third_party/windows/fltk-1.1.10/test/overlay.cxx
new file mode 100644
index 0000000..2e888cd
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/overlay.cxx
@@ -0,0 +1,86 @@
+//
+// "$Id: overlay.cxx 5519 2006-10-11 03:12:15Z mike $"
+//
+// Overlay window test program for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2005 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 5519 2006-10-11 03:12:15Z mike $".
+//
diff --git a/third_party/windows/fltk-1.1.10/test/pack.cxx b/third_party/windows/fltk-1.1.10/test/pack.cxx
new file mode 100644
index 0000000..23df3fb
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/pack.cxx
@@ -0,0 +1,120 @@
+//
+// "$Id: pack.cxx 5519 2006-10-11 03:12:15Z mike $"
+//
+// Fl_Pack test program for the Fast Light Tool Kit (FLTK).
+//
+// Rather crude test of the Fl_Pack object.
+// Changing the type() of an Fl_Pack after it is displayed is not supported
+// so I have to do a lot of resizing of things before that.
+//
+// Copyright 1998-2005 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 <FL/Fl.H>
+#include <FL/Fl_Button.H>
+#include <FL/Fl_Light_Button.H>
+#include <FL/Fl_Window.H>
+#include <FL/Fl_Scroll.H>
+#include <FL/Fl_Value_Slider.H>
+#include <FL/Fl_Pack.H>
+
+Fl_Pack *pack;
+Fl_Scroll *scroll;
+
+void type_cb(Fl_Light_Button*, long v) {
+ for (int i = 0; i < pack->children(); i++) {
+ Fl_Widget* o = pack->child(i);
+ o->resize(0,0,25,25);
+ }
+ pack->resize(scroll->x(),scroll->y(),scroll->w(),scroll->h());
+ pack->parent()->redraw();
+ pack->type(uchar(v));
+ pack->redraw();
+}
+
+void spacing_cb(Fl_Value_Slider*o, long) {
+ pack->spacing(int(o->value()));
+ scroll->redraw();
+}
+
+int main(int argc, char **argv) {
+ Fl_Window *w;
+ {Fl_Window* o = new Fl_Window(360, 370);
+ w = o;
+ scroll = new Fl_Scroll(10,10,340,285);
+ {Fl_Pack* o = new Fl_Pack(10, 10, 340, 285);
+ pack = o;
+ o->box(FL_DOWN_FRAME);
+ //o->box(FL_ENGRAVED_FRAME);
+ new Fl_Button(35, 35, 25, 25, "b1");
+ new Fl_Button(45, 45, 25, 25, "b2");
+ new Fl_Button(55, 55, 25, 25, "b3");
+ new Fl_Button(65, 65, 25, 25, "b4");
+ new Fl_Button(75, 75, 25, 25, "b5");
+ new Fl_Button(85, 85, 25, 25, "b6");
+ new Fl_Button(95, 95, 25, 25, "b7");
+ new Fl_Button(105, 105, 25, 25, "b8");
+ new Fl_Button(115, 115, 25, 25, "b9");
+ new Fl_Button(125, 125, 25, 25, "b10");
+ new Fl_Button(135, 135, 25, 25, "b11");
+ new Fl_Button(145, 145, 25, 25, "b12");
+ new Fl_Button(155, 155, 25, 25, "b13");
+ new Fl_Button(165, 165, 25, 25, "b14");
+ new Fl_Button(175, 175, 25, 25, "b15");
+ new Fl_Button(185, 185, 25, 25, "b16");
+ new Fl_Button(195, 195, 25, 25, "b17");
+ new Fl_Button(205, 205, 25, 25, "b18");
+ new Fl_Button(215, 215, 25, 25, "b19");
+ new Fl_Button(225, 225, 25, 25, "b20");
+ new Fl_Button(235, 235, 25, 25, "b21");
+ new Fl_Button(245, 245, 25, 25, "b22");
+ new Fl_Button(255, 255, 25, 25, "b23");
+ new Fl_Button(265, 265, 25, 25, "b24");
+ o->end();
+ w->resizable(o);
+ }
+ scroll->end();
+ {Fl_Light_Button* o = new Fl_Light_Button(10, 305, 165, 25, "HORIZONTAL");
+ o->type(FL_RADIO_BUTTON);
+ o->callback((Fl_Callback*)type_cb, (void*)(Fl_Pack::HORIZONTAL));
+ }
+ {Fl_Light_Button* o = new Fl_Light_Button(185, 305, 165, 25, "VERTICAL");
+ o->type(FL_RADIO_BUTTON);
+ o->value(1);
+ o->callback((Fl_Callback*)type_cb, (void*)(Fl_Pack::VERTICAL));
+ }
+ {Fl_Value_Slider* o = new Fl_Value_Slider(100, 335, 250, 25, "Spacing: ");
+ o->align(FL_ALIGN_LEFT);
+ o->type(FL_HORIZONTAL);
+ o->range(0,30);
+ o->step(1);
+ o->callback((Fl_Callback*)spacing_cb);
+ }
+ w->end();
+ }
+ w->show(argc, argv);
+ return Fl::run();
+}
+
+//
+// End of "$Id: pack.cxx 5519 2006-10-11 03:12:15Z mike $".
+//
diff --git a/third_party/windows/fltk-1.1.10/test/pixmap.cxx b/third_party/windows/fltk-1.1.10/test/pixmap.cxx
new file mode 100644
index 0000000..78c3df2
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/pixmap.cxx
@@ -0,0 +1,102 @@
+//
+// "$Id: pixmap.cxx 5519 2006-10-11 03:12:15Z mike $"
+//
+// Pixmap label test program for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2005 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 <FL/Fl.H>
+#include <FL/Fl_Window.H>
+#include <FL/Fl_Button.H>
+#include <FL/Fl_Pixmap.H>
+#include <stdio.h>
+
+#include "pixmaps/porsche.xpm"
+
+#include <FL/Fl_Toggle_Button.H>
+
+Fl_Toggle_Button *leftb,*rightb,*topb,*bottomb,*insideb,*overb,*inactb;
+Fl_Button *b;
+Fl_Window *w;
+
+void button_cb(Fl_Widget *,void *) {
+ int i = 0;
+ if (leftb->value()) i |= FL_ALIGN_LEFT;
+ if (rightb->value()) i |= FL_ALIGN_RIGHT;
+ if (topb->value()) i |= FL_ALIGN_TOP;
+ if (bottomb->value()) i |= FL_ALIGN_BOTTOM;
+ if (insideb->value()) i |= FL_ALIGN_INSIDE;
+ if (overb->value()) i |= FL_ALIGN_TEXT_OVER_IMAGE;
+ b->align(i);
+ if (inactb->value()) b->deactivate();
+ else b->activate();
+ w->redraw();
+}
+
+int dvisual = 0;
+int arg(int, char **argv, int &i) {
+ if (argv[i][1] == '8') {dvisual = 1; i++; return 1;}
+ return 0;
+}
+
+#include <FL/Fl_Multi_Label.H>
+
+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_Button b(140,160,120,120,"Pixmap"); ::b = &b;
+ Fl_Pixmap *pixmap = new Fl_Pixmap(porsche_xpm);
+ Fl_Pixmap *depixmap;
+ depixmap = (Fl_Pixmap *)pixmap->copy();
+ depixmap->inactive();
+
+ b.image(pixmap);
+ b.deimage(depixmap);
+
+ leftb = new Fl_Toggle_Button(25,50,50,25,"left");
+ leftb->callback(button_cb);
+ rightb = new Fl_Toggle_Button(75,50,50,25,"right");
+ rightb->callback(button_cb);
+ topb = new Fl_Toggle_Button(125,50,50,25,"top");
+ topb->callback(button_cb);
+ bottomb = new Fl_Toggle_Button(175,50,50,25,"bottom");
+ bottomb->callback(button_cb);
+ insideb = new Fl_Toggle_Button(225,50,50,25,"inside");
+ insideb->callback(button_cb);
+ overb = new Fl_Toggle_Button(25,75,100,25,"text over");
+ overb->callback(button_cb);
+ inactb = new Fl_Toggle_Button(125,75,100,25,"inactive");
+ inactb->callback(button_cb);
+ if (!dvisual) Fl::visual(FL_RGB);
+ window.resizable(window);
+ window.end();
+ window.show(argc,argv);
+ return Fl::run();
+}
+
+//
+// End of "$Id: pixmap.cxx 5519 2006-10-11 03:12:15Z mike $".
+//
diff --git a/third_party/windows/fltk-1.1.10/test/pixmap_browser.cxx b/third_party/windows/fltk-1.1.10/test/pixmap_browser.cxx
new file mode 100644
index 0000000..b0a0eeb
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/pixmap_browser.cxx
@@ -0,0 +1,123 @@
+//
+// "$Id: pixmap_browser.cxx 5519 2006-10-11 03:12:15Z mike $"
+//
+// A shared image 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 <FL/Fl.H>
+#include <FL/Fl_Box.H>
+#include <FL/Fl_Window.H>
+#include <FL/Fl_Button.H>
+#include <FL/Fl_Shared_Image.H>
+#include <string.h>
+#include <errno.h>
+#include <FL/Fl_File_Chooser.H>
+#include <FL/fl_message.H>
+
+Fl_Box *b;
+Fl_Window *w;
+Fl_Shared_Image *img;
+
+
+static char name[1024];
+
+void load_file(const char *n) {
+ if (img) {
+ img->release();
+ img = 0L;
+ }
+ if (fl_filename_isdir(n)) {
+ b->label("@fileopen"); // show a generic folder
+ b->labelsize(64);
+ b->labelcolor(FL_LIGHT2);
+ b->image(0);
+ b->redraw();
+ return;
+ }
+ img = Fl_Shared_Image::get(n);
+ if (!img) {
+ b->label("@filenew"); // show an empty document
+ b->labelsize(64);
+ b->labelcolor(FL_LIGHT2);
+ b->image(0);
+ b->redraw();
+ return;
+ }
+ if (img->w() > b->w() || img->h() > b->h()) {
+ Fl_Image *temp;
+ if (img->w() > img->h()) temp = img->copy(b->w(), b->h() * img->h() / img->w());
+ else temp = img->copy(b->w() * img->w() / img->h(), b->h());
+
+ img->release();
+ img = (Fl_Shared_Image *)temp;
+ }
+ b->label(name);
+ b->labelsize(14);
+ b->labelcolor(FL_FOREGROUND_COLOR);
+ b->image(img);
+ b->redraw();
+}
+
+void file_cb(const char *n) {
+ if (!strcmp(name,n)) return;
+ load_file(n);
+ strcpy(name,n);
+ w->label(name);
+}
+
+void button_cb(Fl_Widget *,void *) {
+ fl_file_chooser_callback(file_cb);
+ fl_file_chooser("Image file?","*.{bm,bmp,gif,jpg,pbm,pgm,png,ppm,xbm,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;
+
+ fl_register_images();
+
+ Fl::args(argc,argv,i,arg);
+
+ Fl_Window window(400,435); ::w = &window;
+ Fl_Box b(10,45,380,380); ::b = &b;
+ b.box(FL_THIN_DOWN_BOX);
+ b.align(FL_ALIGN_INSIDE|FL_ALIGN_CENTER);
+ Fl_Button button(150,5,100,30,"load");
+ button.callback(button_cb);
+ if (!dvisual) Fl::visual(FL_RGB);
+ if (argv[1]) load_file(argv[1]);
+ window.resizable(window);
+ window.show(argc,argv);
+ return Fl::run();
+}
+
+//
+// End of "$Id: pixmap_browser.cxx 5519 2006-10-11 03:12:15Z mike $".
+//
diff --git a/third_party/windows/fltk-1.1.10/test/pixmaps/black_1.xbm b/third_party/windows/fltk-1.1.10/test/pixmaps/black_1.xbm
new file mode 100644
index 0000000..2e98be5
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/pixmaps/black_1.xbm
@@ -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,
+};
diff --git a/third_party/windows/fltk-1.1.10/test/pixmaps/black_2.xbm b/third_party/windows/fltk-1.1.10/test/pixmaps/black_2.xbm
new file mode 100644
index 0000000..7a034ba
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/pixmaps/black_2.xbm
@@ -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,
+};
diff --git a/third_party/windows/fltk-1.1.10/test/pixmaps/black_3.xbm b/third_party/windows/fltk-1.1.10/test/pixmaps/black_3.xbm
new file mode 100644
index 0000000..24dfcf9
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/pixmaps/black_3.xbm
@@ -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,
+};
diff --git a/third_party/windows/fltk-1.1.10/test/pixmaps/black_4.xbm b/third_party/windows/fltk-1.1.10/test/pixmaps/black_4.xbm
new file mode 100644
index 0000000..99ba45b
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/pixmaps/black_4.xbm
@@ -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,
+};
diff --git a/third_party/windows/fltk-1.1.10/test/pixmaps/blackking_1.xbm b/third_party/windows/fltk-1.1.10/test/pixmaps/blackking_1.xbm
new file mode 100644
index 0000000..9402316
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/pixmaps/blackking_1.xbm
@@ -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,
+};
diff --git a/third_party/windows/fltk-1.1.10/test/pixmaps/blackking_2.xbm b/third_party/windows/fltk-1.1.10/test/pixmaps/blackking_2.xbm
new file mode 100644
index 0000000..d684e09
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/pixmaps/blackking_2.xbm
@@ -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,
+};
diff --git a/third_party/windows/fltk-1.1.10/test/pixmaps/blackking_3.xbm b/third_party/windows/fltk-1.1.10/test/pixmaps/blackking_3.xbm
new file mode 100644
index 0000000..df7079c
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/pixmaps/blackking_3.xbm
@@ -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,
+};
diff --git a/third_party/windows/fltk-1.1.10/test/pixmaps/blackking_4.xbm b/third_party/windows/fltk-1.1.10/test/pixmaps/blackking_4.xbm
new file mode 100644
index 0000000..27504e6
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/pixmaps/blackking_4.xbm
@@ -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,
+};
diff --git a/third_party/windows/fltk-1.1.10/test/pixmaps/blast.xpm b/third_party/windows/fltk-1.1.10/test/pixmaps/blast.xpm
new file mode 100644
index 0000000..7bc5e5d
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/pixmaps/blast.xpm
@@ -0,0 +1,67 @@
+/* XPM */
+static const char * blast_xpm[] = {
+"32 32 32 1",
+" c #905518",
+". c #9F580E",
+"+ c #A36526",
+"@ c #AF6519",
+"# c #BF7429",
+"$ c #C77622",
+"% c #B67B3C",
+"& c #D07518",
+"* c #D88836",
+"= c #E48628",
+"- c #F28514",
+"; c #FF951C",
+"> c #FA9835",
+", c #FF982A",
+"' c #F49F48",
+") c #FFA82D",
+"! c #FFA93F",
+"~ c #FFBA1C",
+"{ c #FFB936",
+"] c #FFBA4C",
+"^ c #FFCA42",
+"/ c #FFD329",
+"( c #FFCF5E",
+"_ c #FFD94C",
+": c #FFE946",
+"< c #FFFB3E",
+"[ c #FFFB55",
+"} c #FEFC69",
+"| c #FFFE82",
+"1 c #FFFFA3",
+"2 c #FEFFCB",
+"3 c #FEFFFC",
+" % . ....@@@#@@.+.+++% ",
+" %%++++.....@######@@@@.++ % ",
+" %%% %++@@.@@@#$$#######@++++%% ",
+" %%+%+####@@$&&=*=&&$$####@++%%+",
+"+%+%#####&&&&&==='===*$$###%%%%+",
+"%+%%%%**=*&&&&>,>,>-=>==*$*##%%%",
+" %#****'=>---,))!),>>>==***#%#+",
+" @%*'''>>>>;;,{{{))))>>>''**#%+",
+" ..@#*'!]]]{)){^__^^{]!!!'''###+",
+" ..@$=']]((^^~~:::/__^{((!>**##@",
+"....&&=>(_|[::/<}[<[::_((!>==###",
+"....&&--!_}|}[<[}[}}}||_]!>>**##",
+"@@$$&&--;{:|1|[<|}|}||}_^]>>=*##",
+"##$$=-,;)~~<121<2|121}}:^])>=*$#",
+"#*'''!]{^_<<<1313332|}}}^{!>>*##",
+"%*'']((|}}||||<333321|[[_^]>==*#",
+"*''''((||112333333321|}[_^]!>=*#",
+"%%*''!]^_[[[}<13332}<[<:_])>>*$#",
+"##*==,,)~_:<[|212311}[</{),,=*$#",
+"#@$$==,;)~/<|1<2|<1}|[:^{)-=&&$@",
+".@@$&&-;)~:|}<<1}[|}[[:^{,-=&$@@",
+"..@@&&-;)(}[/<[|[<<}<:_^{),=&$@.",
+"...@&&=,{_(~~:[[<</[[^~]!>>=&$@@",
+" .@@$&'!({;;{/}::/~/_^)),>=*$#@+",
+" ..@$=''>,-;)^__~^{)^]),,==*$#@@",
+". @##*'==&--){({));;,{>>==$$#@++",
+"%++#%**$&&--,!));;;-->>=&$$##@+%",
+" +%%##@@@@&=>>>>>>=-==='$$#@@+++",
+" %%+@@..&.$&='==-&&&&&$*$#@@.+% ",
+" %%+ ....@$$*==&$&&&@$$##@@+ % ",
+" % ....@#*#$$$#@@@@@##+@++ ",
+" ..@####@@@@@..+@++% "};
diff --git a/third_party/windows/fltk-1.1.10/test/pixmaps/block.xcf.gz b/third_party/windows/fltk-1.1.10/test/pixmaps/block.xcf.gz
new file mode 100644
index 0000000..7e5e7a3
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/pixmaps/block.xcf.gz
Binary files differ
diff --git a/third_party/windows/fltk-1.1.10/test/pixmaps/blue.xpm b/third_party/windows/fltk-1.1.10/test/pixmaps/blue.xpm
new file mode 100644
index 0000000..0fbc922
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/pixmaps/blue.xpm
@@ -0,0 +1,67 @@
+/* XPM */
+static const char * blue_xpm[] = {
+"32 32 32 1",
+" c #000100",
+". c #0000A5",
+"+ c #020681",
+"@ c #0A008F",
+"# c #0001B2",
+"$ c #0100BA",
+"% c #0000D0",
+"& c #0C00C4",
+"* c #0008C4",
+"= c #0B00DB",
+"- c #13252E",
+"; c #171F44",
+"> c #1718B3",
+", c #1616C2",
+"' c #2628CF",
+") c #2C2BC6",
+"! c #2D30BD",
+"~ c #3D40D1",
+"{ c #4342BC",
+"] c #4344CA",
+"^ c #5253E1",
+"/ c #5858D4",
+"( c #5F5ECF",
+"_ c #6A69E7",
+": c #6E6EDD",
+"< c #7273D2",
+"[ c #7E7FDD",
+"} c #7E7FEC",
+"| c #8D8DDF",
+"1 c #8F90EF",
+"2 c #9D9EED",
+"3 c #A6A6E8",
+" ;+.*$##$$**$*$#$*&&.+; ",
+" -@&)_133333333333333|:!$@- ",
+" ;%%}22122222222233333333['$; ",
+" -&'1111111|2|21111|2223|332'&- ",
+" @*}}}}1}}}1}1111111[|[||||||*. ",
+";&/}[}}}}}}}[[[}}}}}[}[[||||[:&;",
+"+'::::_____:::<::__}_}:<<<<<[<)+",
+">)/_/_____::(::::_____:(<<<<<<].",
+"*^//^/////(((((//_^_^_///(((((/$",
+"#]]]]^^{/{{{{/{//^^^^^^///{(((($",
+".]~~~~]{{{{{{{]{]~~~~~~~]{]{{{(.",
+"#))))!!!{{{]!~!!~~'~''~~~]{{{{{.",
+"#))))!!!@!>!!))))''''''~)!!!{{+.",
+"$,,>>>@!>>)>,'''''''''''))!>!!!.",
+"$,,#>>>>.>,,&*%*'*''*',,,,,>>>>#",
+"&%%$#...#&&%*%***%%&*$,***,>#>>#",
+"$&%&*###&&%%&&&&,*&*,##$*$$#$$#$",
+"$&%%$$$*&%&**$$$&&&&&$#$***#,#.#",
+"$$$&$*&%%=&&$##$$**&&$**&&&$$#..",
+".#$$&&%%%%%&,....##$#$$&%%&&$#.#",
+".#$$&%%===%%&#.....###$&%%%&&#.#",
+"$$&&%=====%%$##.@..#.##&&&%%&$$#",
+"$$&&%==%==%&$###.....##$%&%&&$$$",
+"$$$&&%%%%%&&$$###..###$$&%&%&&$$",
+".$$&&&&$$&$$*&&*$$#$$$$$$%%%%%&.",
+"+$$$$&####$&$&&&&&$$&$$$$&%=%%=+",
+";##$$$#....$$&&&$&&%&&$$*&%==%%;",
+" @$,#$#.@..##.#$&&%%%&$&&=%%%%. ",
+" -$*$&&$.......#&&&%&&$&%==%%&- ",
+" ;$&&$#...#...$&%%%&&$&%=%=%; ",
+" -@%&$#..#...#$%&&&&&&&=%.- ",
+" ;+.#$#....#&&%%&&&&#+; "};
diff --git a/third_party/windows/fltk-1.1.10/test/pixmaps/blue_bomb.xpm b/third_party/windows/fltk-1.1.10/test/pixmaps/blue_bomb.xpm
new file mode 100644
index 0000000..a473833
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/pixmaps/blue_bomb.xpm
@@ -0,0 +1,67 @@
+/* XPM */
+static const char * blue_bomb_xpm[] = {
+"32 32 32 1",
+" c #000100",
+". c #010047",
+"+ c #00033E",
+"@ c #010345",
+"# c #010577",
+"$ c #0000A4",
+"% c #0001B7",
+"& c #0000C3",
+"* c #0000D0",
+"= c #13252E",
+"- c #1A2147",
+"; c #1E1E57",
+"> c #2023BC",
+", c #2526CD",
+"' c #343364",
+") c #363699",
+"! c #3237C5",
+"~ c #373BB4",
+"{ c #474875",
+"] c #4E4FD4",
+"^ c #5252C6",
+"/ c #5B5A85",
+"( c #6D6D94",
+"_ c #6666CE",
+": c #6465DE",
+"< c #6E6CAC",
+"[ c #7B7CDA",
+"} c #7C7DEB",
+"| c #8D8DDF",
+"1 c #8F90EF",
+"2 c #9D9EED",
+"3 c #A6A6E8",
+" -#$&%%%%%&&&&%%%&&&$#- ",
+" =$*,:133333333333333|}>%$= ",
+" -&,}22122222322233333333[>%- ",
+" =&,}111111|2|21111|22322332,&= ",
+" $,[1}1}1}}1}1111111[1|||<|||&$ ",
+"-%]}}}}}}}}}[[[}}}}}}[[[||||1:&-",
+"#,:_}:::}::[<((((((<[}}[[[[<[[,#",
+"%!:::::::_<(((((((((/<_:___[__]$",
+"&]]]]]]]://///(////////_^::___]%",
+"%]]]]]]^{{{/{{/{/{</{/{/^^^^^_^%",
+"$!!!!!]'{{{={{{{{{'{{{{{']]~^^^$",
+"%,!,!>)''-{''''''''''''{')]~~~~$",
+"%,>,!>)-'-'-''''''';''''')!!~~~$",
+"&,,$>>--;;-;;;;;;;;;);;;;->>>#!$",
+"&&&,$$;+;+;+;@;;.;;;;;;;;;%>,>>%",
+"%&&&$$++@+..@...;..@.@;@.;%,$%$%",
+"&&*&&%+++..@@@@@@@@@+@++@+%%%%%%",
+"&&&&%%+@+.@@+++@++@@@++++@&%%%$%",
+"%&&&&&+....+++++@+@+@+@@@@&%%%$$",
+"$%%&%&#.@..@+++++++++++@@#&&%$$$",
+"$%%%&*$....@+++++++++++@.$*&&%%$",
+"%%&&***#...@+++-++++++++#***&%%%",
+"&%&&***&...@+++++++++++@$&**&%%%",
+"&%%&****$.@@+++++++++++$&&*&&&&&",
+"$%%&&&&%&$#+@@+++++++#$%&&****&$",
+"#%%%%&%%$%$$#@.@@@+#$%%%%&*****#",
+"-%%%%%%$$$$%%%&%%&&&&%%&&&*****-",
+" $%%%&$$$$$$%$$%&&**&&%&******$ ",
+" =%%&&&$$$$$$$$%&&***%%&*****&= ",
+" -&&&&%$$$$$$$%%***&&&&****&- ",
+" =$&%%%$%$$$$%&&&&&&&&***$= ",
+" -#$%%%%$$$%%&&&&&&&%#- "};
diff --git a/third_party/windows/fltk-1.1.10/test/pixmaps/cyan.xpm b/third_party/windows/fltk-1.1.10/test/pixmaps/cyan.xpm
new file mode 100644
index 0000000..72c205b
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/pixmaps/cyan.xpm
@@ -0,0 +1,67 @@
+/* XPM */
+static const char * cyan_xpm[] = {
+"32 32 32 1",
+" c #000100",
+". c #143144",
+"+ c #0A4350",
+"@ c #038080",
+"# c #029795",
+"$ c #00A3A5",
+"% c #00ABAC",
+"& c #02B3B5",
+"* c #00BBBB",
+"= c #00C0C0",
+"- c #19B9BB",
+"; c #33B5B5",
+"> c #00CCCB",
+", c #12C5C5",
+"' c #47B2B1",
+") c #1AC9C9",
+"! c #09D2D1",
+"~ c #37C9CA",
+"{ c #46C5C6",
+"] c #24D9D8",
+"^ c #5CC5C3",
+"/ c #4BD0D1",
+"( c #55D8DA",
+"_ c #72D4D3",
+": c #53E3E3",
+"< c #66E0E2",
+"[ c #7EE2E1",
+"} c #70ECED",
+"| c #94E0E1",
+"1 c #8DEFED",
+"2 c #A1ECEC",
+"3 c #ADE8E6",
+" +@$=*&&&***=*&&&*==$@+ ",
+" .#>![123333222233323|<~*#. ",
+" +,]}1211212222212232333||**+ ",
+" .,]1211111222221112|||||3||>>. ",
+" #)[11111}}11[11111111[|||||[!# ",
+"+*<}<<}}1}1}[[[1}1}}1[[___|_|<>+",
+"@)_[[<}}}}}<[__<<}}}}1[___|^|_)@",
+"%](((<<<<<__/___[}}}}:[__^_^^_^%",
+"-(((((((((_{{_{/_(}:}<<<(___^^/*",
+"&////(/{{{{^/{{^/]:::::(_(/{^{^&",
+"%{//!/{;';{;{{~{{/]:]:]/~~/{^{;%",
+"%==,~,*;;;;'*~~~~~/!]]()~{{{;''#",
+";>/**;;;&;-;;~,)))//!!]~=---;';$",
+"*>=*;%;%;--*,)!)!>)!~!))~=~--%;%",
+";),=;%%%--))))!))!)))~,)),{--&;%",
+"=)>**%$%*=)>!>)),,))--*=)=***;**",
+"*)!>**%&=)!,,,===,,,*;*;==**&*&&",
+"*,>,=***>!),**-*=,,>=***,=*&*&%&",
+"*&==**,>>!>=&%&&***=***=>,=*%%%%",
+"%****>>!!!!>*%%%%%&*&**,>>>==%$$",
+"%%*==>!]]!!>*%%$$%%%*%=,>>>>>*%%",
+"%==,!]]]]]!>*&$$##$%%%&*,>>>*=&;",
+"**=>!]]]]]!>**%$$#%%%%*=,>>>=**&",
+"***,)!!!!!,****=%%#%%%&*=>>>>==*",
+"$*&=,),**,=*======***==**,>>>>>%",
+"@=&-*=&%%&&*==>>======*&=,>]]!!@",
+"+&&=&*&%$%%*****==,>,=*==!!!]]!+",
+" #&&=*&$$#$%%%%*=,>>>=*=,!!!!!# ",
+" .&====%%$%%%$$%=>>>)=*,!]]!!,. ",
+" +*,==*%#$$%#%*=>!>,=-,!]]!!+ ",
+" .#,=*%%%%$#$&=,>,,,=,)!]$. ",
+" +@$&*%%%$$%,,,,,,,,%@+ "};
diff --git a/third_party/windows/fltk-1.1.10/test/pixmaps/cyan_bomb.xpm b/third_party/windows/fltk-1.1.10/test/pixmaps/cyan_bomb.xpm
new file mode 100644
index 0000000..53135a2
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/pixmaps/cyan_bomb.xpm
@@ -0,0 +1,67 @@
+/* XPM */
+static const char * cyan_bomb_xpm[] = {
+"32 32 32 1",
+" c #000100",
+". c #003A3A",
+"+ c #133244",
+"@ c #004241",
+"# c #0A4551",
+"$ c #084948",
+"% c #1B5353",
+"& c #006C6D",
+"* c #286261",
+"= c #396767",
+"- c #0F8080",
+"; c #019795",
+"> c #507B7C",
+", c #00A7A9",
+"' c #5D8989",
+") c #00B7B7",
+"! c #00C1C1",
+"~ c #2FB2B3",
+"{ c #6D9A9A",
+"] c #00CAC9",
+"^ c #4AB4B3",
+"/ c #05D4D2",
+"( c #36C8C9",
+"_ c #53C4C3",
+": c #46D3D4",
+"< c #61D3D3",
+"[ c #75CECE",
+"} c #6FE2E1",
+"| c #82DFDE",
+"1 c #94E0E1",
+"2 c #89EFED",
+"3 c #A2ECEC",
+" #-,!))~))!)!!)~)!!!,-# ",
+" +;]:}2333333333333331<();+ ",
+" #!/}23333333333333333333[!!# ",
+" +!/322222221332223311111111:!+ ",
+" ;:2222222222|23222233111111|/; ",
+"#!:}|}222222|||}22222}|1[1[[1}]#",
+"-:<}}}}}}}}[^{{{{{{[[2}|[[[[[|!-",
+",:}:}:}}}<{'''''''{'{{[<<|[[[<_,",
+"!:<<:}::_'>'>>'>'''''''[<<<[_<:!",
+")(:::::^>>>>>>>>>>>''''>_::____~",
+",((:::(>===>=>=>>>=>>>>>'(:___^,",
+"~(((](;===#========&&=*=*^(_^^~;",
+")](()_&%%==%=%===*===*==*-~)^~~,",
+"!!!)~,=#.%%#%%%%*%******%=())~~,",
+")]()~,.%%%%%%%%%%%%%%%%%%%()))~)",
+"(!]!)^.....$%$$$$$$$$$$$$$)))))~",
+"!]:])~...%$$.@#@@@@@.@.$@@))))))",
+")]]]!(.$$.@@..@.@@@@@@..@$)))))~",
+"~!)!)!.$$%$.@....@#@.@@@#@()),,,",
+",)!~!(&@@@@$...........@$&]!)),,",
+")))!]]~$$$@$.........@@@$,:]!),,",
+"~)!!///&$$$@@...........&]]]!)))",
+"))!!://!%$$@...........@,]/]])))",
+"!))!///],@#$..........@;]]]]]!]!",
+",)!)!!!!!,&.@#@......*,)!]]]/]!,",
+"-)~!!!)),));&@@@$.@&;!)))!/////-",
+"#)~))),,;,,)))!)!!:]]!!!!]/////#",
+" ;))))),;,,)~~,)!!]/]!)!]/////; ",
+" +)!!!!),,,,,,,)!]]/!()!/////!+ ",
+" #)]!)),,,,,,,)!!/!]!)!////]# ",
+" +;]!),,,,,;,)!]]!!!!!]//,+ ",
+" #-,))));,,,!!]!]!!!)-# "};
diff --git a/third_party/windows/fltk-1.1.10/test/pixmaps/gray.xpm b/third_party/windows/fltk-1.1.10/test/pixmaps/gray.xpm
new file mode 100644
index 0000000..acbb2cb
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/pixmaps/gray.xpm
@@ -0,0 +1,67 @@
+/* XPM */
+static const char * gray_xpm[] = {
+"32 32 32 1",
+" c #000100",
+". c #2C393F",
+"+ c #394649",
+"@ c #666967",
+"# c #737572",
+"$ c #7A7C79",
+"% c #828481",
+"& c #878986",
+"* c #8C8E8B",
+"= c #90928F",
+"- c #939592",
+"; c #979996",
+"> c #999B98",
+", c #9C9E9A",
+"' c #9FA19E",
+") c #A1A0A4",
+"! c #A3A5A2",
+"~ c #A6A8A5",
+"{ c #A9ABA8",
+"] c #A9ACAF",
+"^ c #ABADAA",
+"/ c #AFB1AE",
+"( c #B3B5B3",
+"_ c #B9BBB8",
+": c #BABDC0",
+"< c #C1C3BF",
+"[ c #C2C3C7",
+"} c #C7C9C6",
+"| c #CBCDCB",
+"1 c #D1D3D0",
+"2 c #D9DBD8",
+"3 c #DFE1DE",
+" +@%;-**=---;-=*=;>>%@+ ",
+" .$':[2332233333222231[]-#. ",
+" +)(|33333222333332222221[)-+ ",
+" .;(22233333121333322|12|1|2]'. ",
+" #]|221222221112233222[2||||1]$ ",
+"+)[|[[2[3[3[2[1[[2[222||[[[[|<)+",
+"@~[[||[111[[|[[|2221[2[|}<<[[|~@",
+"%:|<[|[[[|[[[:[[[[[21|[[[_:((_]&",
+"-(::[[[[[:((((]:[[|[||<<[_<:::];",
+"=((((_(({^]](]]](<[[|[[:(:((]((*",
+"&]]((()))!')^(^^]([[<<__(]({~)]%",
+"*~^]])'>-))'){)]^]((:_:]]{)))>)%",
+"=)~!''>)--);){{]^{{^(((])~~!)==%",
+")~)))=**);;)']]{]]]]]]]{~!,)=)-&",
+"-',-**&*=)>)!{]~~~~!)!))])'>-==*",
+")))))&&&=;!~])')))))>)>,'';))-)*",
+"-'!)=**)=)!)')-;>,''-=*-))**==)&",
+"),);))*))]);)*--)>)))-==-)=)*&**",
+"*))-==)'!{!;*&**==---)=)>))*)%&&",
+"%&==))!)]])))*&&**&)**))!'-))&%%",
+"**)=)){^{^~)=&&%$%&&**=)))]))**&",
+"**-)!{]]]]{)))&$%%%*&&*;'''>))**",
+")=),]((((]!)*&&%$%$&&*)-))]);*)*",
+"==*)'!!'!~)*)))&)&&&&&*)>'')))-)",
+"%)*))))-);)-==)))&)&)*=-))!!))'%",
+"@=*=--*&&*==));-)=)=)))*->!]^^]@",
+"+=*=--*%$%&)&-)-))));-=)-){{]]]+",
+" #)*)*)&%$%&*&&*=;)!))*)){]]{~# ",
+" .*)*)*&&%&%%%%));]'))*>]{{])). ",
+" .=))))&%%&%%$&;,!)>-))!]]{~+ ",
+" .#;=&*)$&%%%)))!');-)'{]$. ",
+" +@$$)&)%$$&-,))>),;&@+ "};
diff --git a/third_party/windows/fltk-1.1.10/test/pixmaps/gray_bomb.xpm b/third_party/windows/fltk-1.1.10/test/pixmaps/gray_bomb.xpm
new file mode 100644
index 0000000..890c816
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/pixmaps/gray_bomb.xpm
@@ -0,0 +1,67 @@
+/* XPM */
+static const char * gray_bomb_xpm[] = {
+"32 32 32 1",
+" c #000100",
+". c #2C2E2B",
+"+ c #313330",
+"@ c #2E393E",
+"# c #363835",
+"$ c #3B3A3D",
+"% c #3B3D3B",
+"& c #3B464A",
+"* c #454644",
+"= c #48464A",
+"- c #50514F",
+"; c #585A57",
+"> c #616260",
+", c #686967",
+"' c #70716E",
+") c #787A78",
+"! c #818380",
+"~ c #868885",
+"{ c #8B8D8A",
+"] c #8F908D",
+"^ c #939491",
+"/ c #969895",
+"( c #9B9D9A",
+"_ c #A1A3A0",
+": c #A8AAA7",
+"< c #B0B3B0",
+"[ c #B9BBB8",
+"} c #C1C2C0",
+"| c #C9CBC8",
+"1 c #D2D3D1",
+"2 c #D9DBD8",
+"3 c #DFE1DE",
+" &,!/^]]]^////]]]/((!,& ",
+" @)_<12322232333322221}:^'@ ",
+" &(<133333313233332222221}_/& ",
+" @/}221233322113333221111111<_@ ",
+" )_1112223321212223212111}1}1<) ",
+"&^}1111111111}1111221111}}}}1}_&",
+",:}}}111111<:]~]^^^<}11}}}}}}}:,",
+"]<}}}}}}}}]~))~)~~]~]^}}}}}<<}<~",
+"/}<}}}}}_)))))))))~)~)~<}}}<<<<^",
+"]<<<<}<_,',,'''))))))))):<}<<<<]",
+"]<<<<<<,>>>,,,>>>,,),,,,)<<<_::~",
+"]_::<_~>->->->>>>>>>,,,,>^__:^/)",
+"^___((,====-=-->=>>=>=>>=)_(^(^!",
+"^:_(^^=-=-=-=-==-==>-----=__/^^]",
+"^_((^~$$*%=*==-=--======-=_(^(^]",
+"^__(]].+$$$%%*$$$$$*$@*%%=((^^^]",
+"/_:_^]@.+$$$+$++$$+$$$$$+$^^^^]]",
+"^___^^..$##++..$++$+....$$^]^]]]",
+"]^^(^($+$$$$.....++$.$.@$.(^]]~~",
+"~]^^//>+$++.$@.@.@......$>_(]]!~",
+"]]^(__~@$$$$......$.$@$+$)<_^]~~",
+"]^((_<<;##$.$..........$=__:(^]]",
+"^^((:<<^&#$$...........$~____^^]",
+"^^^((___!$+.$.@.....@.$)(___(((^",
+"~^^^__(^^~=$..$.@....=)^/_:::_:~",
+">^^^/^^]]]])=@.$..$=)^^^^(_<:<:,",
+"&]]^^]]))~~^^]]]^/__:(^^(__::::&",
+" )^]^^]]))~~]]]^^(_:_^(^_:<:::) ",
+" @^^(^^]~~])~)~]((___^/(:<_<_(@ ",
+" &^__(]])~]~)~^^_:__(^(_:<:_& ",
+" @)((]]]~~)~)^(__(((((_:<)@ ",
+" &,)]]]]])!]^(__(_((~>& "};
diff --git a/third_party/windows/fltk-1.1.10/test/pixmaps/green.xpm b/third_party/windows/fltk-1.1.10/test/pixmaps/green.xpm
new file mode 100644
index 0000000..cd027e0
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/pixmaps/green.xpm
@@ -0,0 +1,67 @@
+/* XPM */
+static const char * green_xpm[] = {
+"32 32 32 1",
+" c #000100",
+". c #022D01",
+"+ c #004300",
+"@ c #007F00",
+"# c #009400",
+"$ c #00A301",
+"% c #00AA00",
+"& c #00B600",
+"* c #04BC0A",
+"= c #00C100",
+"- c #02C805",
+"; c #00CC00",
+"> c #24B329",
+", c #00D400",
+"' c #18CA24",
+") c #3FB740",
+"! c #31C733",
+"~ c #3FC640",
+"{ c #31D633",
+"] c #4FC650",
+"^ c #5DD45D",
+"/ c #5BD957",
+"( c #51DF54",
+"_ c #6BD16D",
+": c #6AE26D",
+"< c #81DF81",
+"[ c #8DDB8C",
+"} c #7EE77F",
+"| c #79EE7A",
+"1 c #8FEF8F",
+"2 c #9DEC9D",
+"3 c #A6E7A5",
+" +@$=*&&&*====&&&===$@+ ",
+" .#;{:123333333333333[:!&#. ",
+" +-;|22222223222223333333<*=+ ",
+" .-,11111111221111122223[332!;. ",
+" #-}1}|}||1|111111}11<<[[[[[<;# ",
+"+*^}}}}|}||}}<<1||||}1<<[[[[[:;+",
+"@':^::|||||:___}}|||:|}_<_[_[_'@",
+"%{^:://///^_^^_^:/|(/::^______~%",
+"*(/////:^^^^_]]^^/((((:^^^]___]=",
+"%~~/~(/~]~]]~]]]/((((((//^]]]]^%",
+"%~!!!!~)))))~]~]~({({{{(~~~]))]$",
+"&!!!!~~))>))~!~!~!{({{(!~~~))))$",
+"&!!!*>>>>>>>>!!'{!{{{{{!!~>~)))$",
+"=-'*>&>%>&!*'--'{-''{-{'!!!%>#>%",
+"*='*>%$%&&'=-{;-'{-='=---=!&!%!%",
+"*--=&%%%&=;--;-=-=;=*&!**-=&&&&&",
+"=-;-=&%&==;;======--*&&&**&&&&&&",
+"*-;-=&**-,;==&&*==-==*&*=-*&&&%&",
+"&&=====;;,;=&&&&&*===&===-=*&&$%",
+"%&**==,,,,;-&%%%%%&&&**-;;;=&%%%",
+"%&&*-;,,,,,;=%%%$$%&%&*-;;;;=&%%",
+"&&=-,,,,,,,;=&$$$#%%%%&=-;;;-&&&",
+"**=-,,,,,,,=*&%$$$$%%%&=-;;;=*&&",
+"*&*=,,,,,,-=&=&&&%%%%&&*=-;;;===",
+"$*&*=-{=*===*=-==&&*&&*===;;;;;%",
+"@*&*==&%%&&*==--======*&*-;,,,;@",
+"+&&&&=&%$%%&=&*===-;;=&*=;,,,,,+",
+" #&&&&&%#$%%&%%&*-;;-=*=-,,,,,# ",
+" .&===&&$$$%$$%&==,;-=*=,,,,,-. ",
+" +&===&%$%%$$$&=;;;-==-,,,,-+ ",
+" .#-=&&%%%$$$&=-;=====;,,$. ",
+" +@$&&&%$$$%==----='&@+ "};
diff --git a/third_party/windows/fltk-1.1.10/test/pixmaps/green_bomb.xpm b/third_party/windows/fltk-1.1.10/test/pixmaps/green_bomb.xpm
new file mode 100644
index 0000000..3cd7298
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/pixmaps/green_bomb.xpm
@@ -0,0 +1,67 @@
+/* XPM */
+static const char * green_bomb_xpm[] = {
+"32 32 32 1",
+" c #000100",
+". c #003700",
+"+ c #003E00",
+"@ c #004405",
+"# c #004600",
+"$ c #005E00",
+"% c #1B541B",
+"& c #006E00",
+"* c #2C602D",
+"= c #008B00",
+"- c #3E6D3F",
+"; c #358335",
+"> c #00A800",
+", c #4E7B4E",
+"' c #00B700",
+") c #00C100",
+"! c #5E895F",
+"~ c #00CD00",
+"{ c #32B12E",
+"] c #40AA3D",
+"^ c #00D800",
+"/ c #28C42B",
+"( c #6D9A6E",
+"_ c #41C442",
+": c #5CCB5D",
+"< c #58DA59",
+"[ c #7EC678",
+"} c #73D173",
+"| c #73E773",
+"1 c #83EB84",
+"2 c #93EB92",
+"3 c #A0E7A0",
+" @&>)'''''))))''')))>&# ",
+" .=~~|2333333333333332|/'=. ",
+" +~^1222233333323333333332''@ ",
+" .)~212122123222222333333333/). ",
+" =~12111111121211112222[3[322~= ",
+"@)<1|11|||||121111||1112}[[[}|~@",
+"=/|||||||||}[!((((([}|}1}}}[}})=",
+">/<:<|<|<|(!!!(!((((((::|}1}}}_>",
+")<<<<<<<:!!!!!!!!!!!!(!}<:<::}:)",
+"'</</<_:-,-!-!,!,,,,,,,,:<<::::'",
+">_//</_,---------,,,;,,,;:___]:>",
+"'/////]-, --------*--;*--]_{_]]>",
+"'/////;.---.--***********;_{{{]>",
+")~))>{**.-.*.%%%*%%*%****%//{{>>",
+"'))/>>..%.*%%%%%#%%%%%%%%%'/'/>'",
+")~))'{...+++@@##%###@@@@#@)'/'/>",
+")~~~)'.@@@@@@@@@@@#%#@@@@@''>'''",
+"))~))'++@@##+++@@#+#@+.+@+'''''>",
+">)))')@####+.++++++++++@@@)''>>>",
+"'>')))&###@#+.....+++@+@#&~)'>>>",
+">''))~>#####+........++@#>^~)'>>",
+"'')~~^^&####++......+.++&)~~~'''",
+"'))~~^^)$###@+.......+++>~~~))''",
+"'/')~^^)>#@+++++......#=~)~~~)))",
+">''))))')>$++@@@#++++$>'))~~~~)>",
+"='''))''>')=&#+#+@+&>)'')~~^^^^=",
+"+'''''>>>>''))')))~)))'''~~^^~~#",
+" ='''''>=>>>>>'')~~~~)))~~^~~^= ",
+" .>)))''>=>>>>>'')~~~'))~^^^~~. ",
+" @))))'>>>>>=>>)~~~))))^^^~~+ ",
+" .=~)'>>>>>>>')~~~))))~^^>. ",
+" #&>'''>>=>>)~))))))>=@ "};
diff --git a/third_party/windows/fltk-1.1.10/test/pixmaps/magenta.xpm b/third_party/windows/fltk-1.1.10/test/pixmaps/magenta.xpm
new file mode 100644
index 0000000..971fde8
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/pixmaps/magenta.xpm
@@ -0,0 +1,67 @@
+/* XPM */
+static const char * magenta_xpm[] = {
+"32 32 32 1",
+" c #000100",
+". c #380F3F",
+"+ c #490754",
+"@ c #890089",
+"# c #9E02A1",
+"$ c #A800A6",
+"% c #AF00B1",
+"& c #B900B6",
+"* c #B902BE",
+"= c #C200C3",
+"- c #CC00C8",
+"; c #D100D2",
+"> c #DE00DB",
+", c #CC18CC",
+"' c #C324C3",
+") c #BC33BC",
+"! c #D629D5",
+"~ c #B93DB9",
+"{ c #D23BD2",
+"] c #D34BD2",
+"^ c #CF53D0",
+"/ c #CE5ECE",
+"( c #E551E4",
+"_ c #E366E3",
+": c #D473D4",
+"< c #DD6DDD",
+"[ c #EB7BEC",
+"} c #E683E5",
+"| c #DD8BDD",
+"1 c #F18FF2",
+"2 c #F09BF0",
+"3 c #E7A2E8",
+" +@#=*&%&*====&%&===$@+ ",
+" .@=!_233333333333333|/{*@. ",
+" +;>[22223333332233333333|'=+ ",
+" .=!12111112222122233333333|{-. ",
+" @,}}}}1[1[[1}21111}1|||||3||;# ",
+"+=_<[[[[[[[[}:}[[[[[}}}|||||:<=+",
+"@=<<<_<[__[<<:::[[_[_[<::::|::'@",
+"${_/______</:/:<______<//:::::]$",
+"*]]^]_]_^^^//^//__((___/^///://*",
+"%]]]]]]~^^~^~/~^^((((((]^^~/~//&",
+"$){{{]~~~~~~~])~^]((!((]]^~^~~~#",
+"%{{){')~~~~)))]{)'{{{!{{))~~~~~#",
+"%''')')~#)))''''{!!{{!{{{'~~~~~#",
+"=,='&#$%)&&&',!,,,',,!!''''%~#~$",
+"&,*'$$$$&'',,,-,,-,,'=,',''&)%%%",
+"==-=&$$%%&--,-,,',,==&&==,*&&&&%",
+"=;-;=&$&=;;;==*===,=**%'=&*%'&&%",
+"*=;=*&*&=;==**&*=====&&&*=&*&%%%",
+"%*==*-=;-;-=%%$&&*=&**==;==*%$$$",
+"$%&&*=;;;;;=&$%$$%%*&&*--;==*%%$",
+"%%*==;;>>;;;=%$$#$$%%%*=;;;-=%%%",
+"&&=,-;>>;>;-=%%###$$%%&==--;=&%%",
+"&&*;->>>>>;=&%%$#$$$$$%==;,--=&&",
+"=*&=;;;;;;-&**&&%$$$$%&&-=;;=&==",
+"$*%*===*&===&===***&****==;;;-;$",
+"@&&&*=%$%%*&=---==&===*&&=-;>;;@",
+"+*&&&&&$#$%&**&=&;=-==**=;;;>;;+",
+" @****%$##$%%$&&==;;-=&=-;>;;;@ ",
+" .%&==*%$#$$$#$%&=;;-=&=;;>;-;. ",
+" +====&$$$$$$$&----=*==;>;>;+ ",
+" .#==&%$$%##$%=;;-====;;;#. ",
+" +@#%*%$$##%*===-=-&$@+ "};
diff --git a/third_party/windows/fltk-1.1.10/test/pixmaps/magenta_bomb.xpm b/third_party/windows/fltk-1.1.10/test/pixmaps/magenta_bomb.xpm
new file mode 100644
index 0000000..0a05590
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/pixmaps/magenta_bomb.xpm
@@ -0,0 +1,67 @@
+/* XPM */
+static const char * magenta_bomb_xpm[] = {
+"32 32 32 1",
+" c #000100",
+". c #3A033B",
+"+ c #410142",
+"@ c #48004B",
+"# c #6C006C",
+"$ c #541954",
+"% c #840084",
+"& c #9B009D",
+"* c #612F61",
+"= c #AC00AC",
+"- c #792A7D",
+"; c #BA00B9",
+"> c #C200C2",
+", c #813285",
+"' c #D000D0",
+") c #734472",
+"! c #B91EBA",
+"~ c #8E488B",
+"{ c #B034B1",
+"] c #855A85",
+"^ c #CD31CD",
+"/ c #C643C7",
+"( c #967098",
+"_ c #AC6DAC",
+": c #C960CA",
+"< c #D859D8",
+"[ c #E770E7",
+"} c #E376E3",
+"| c #DD7CDD",
+"1 c #EF8BEF",
+"2 c #E894E8",
+"3 c #E7A2E8",
+" @%&>;;=;;>>>>;=;>>>=%@ ",
+" .&'^[1333333333333332:^;%. ",
+" @>'[22233333332333333333|^;@ ",
+" .'^121111112221112333333333^'. ",
+" &^1111111111222111122222_322'& ",
+"@><}}}1[1[[[}}1111[}}}|2|2|_2[>@",
+"%>}[}[[[[[[2_((((((2|[}|||||||>%",
+"=^<<<<<<[:_]((((((](]_:::::|:|/=",
+";<<<<<<<:]]]]]]]]]]]]]]::::::::>",
+";//<^<^:)))])])])])]]]]]<<:{::<=",
+"=/^^^</))))))))))))~))))~//<{:{&",
+";^/^^^%**) )***)*)*)*)*)){/{{{{=",
+";^^!/!-**************-***,{/{{{&",
+";>;!={*.*.*.*$*$$$$$*$*$**!!{{{=",
+";'>!=&..*.*.$$$$$$$$$$$$$$!;!!=!",
+">>>>!{.....$.@+@@@$+$+$+$$;!;!!=",
+";''>>=...++@+++++@@++...++;!;;;;",
+";>'';;.++@@+.+..+++++..+++>;;===",
+";;;>>>+++@++..++.+++++++++>;;===",
+"==;;;>%+@+@++.......++++@#>>;===",
+"=;;>>>=+@+@@+.........++@=''>===",
+";;>>'''#@@+++...........#>'>';==",
+";;>>'''^@@@++..........+=''>>>>;",
+";;;>''''=@++++......+.+&>>''>>;;",
+"=;;>>'>;>=#.++++.....#&;>>'''''=",
+"%!;;>;;===;%#++++++#&;;;;>'''''%",
+"@;;;;;;=&==>;;>;>>>'>>;;>''''''@",
+" &=!;;==&&======>>''>>;>>'''''& ",
+" .;;;>;==&===&=;;>''';;>'''''>. ",
+" @;>>>;=&&==&=;>'>'>>>''''''@ ",
+" .&>>==;==&=&=>'>>>>;>'''{. ",
+" @%======&&=;>'>'>>>!%@ "};
diff --git a/third_party/windows/fltk-1.1.10/test/pixmaps/porsche.xpm b/third_party/windows/fltk-1.1.10/test/pixmaps/porsche.xpm
new file mode 100644
index 0000000..a940c0c
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/pixmaps/porsche.xpm
@@ -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.... ",
+" ........ ",
+" .... ",
+" "};
diff --git a/third_party/windows/fltk-1.1.10/test/pixmaps/porsche1.xpm b/third_party/windows/fltk-1.1.10/test/pixmaps/porsche1.xpm
new file mode 100644
index 0000000..b4e1475
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/pixmaps/porsche1.xpm
@@ -0,0 +1,76 @@
+/* XPM */
+static const 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 ",
+" "
+} ;
diff --git a/third_party/windows/fltk-1.1.10/test/pixmaps/red.xpm b/third_party/windows/fltk-1.1.10/test/pixmaps/red.xpm
new file mode 100644
index 0000000..8aa57ce
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/pixmaps/red.xpm
@@ -0,0 +1,67 @@
+/* XPM */
+static const char * red_xpm[] = {
+"32 32 32 1",
+" c #000100",
+". c #2D0001",
+"+ c #440000",
+"@ c #850000",
+"# c #A20000",
+"$ c #AC0001",
+"% c #B70000",
+"& c #C30000",
+"* c #D10000",
+"= c #AB1111",
+"- c #BF0C10",
+"; c #DD0000",
+"> c #CD191B",
+", c #BB2222",
+"' c #B53A39",
+") c #CF2F30",
+"! c #C33738",
+"~ c #C34746",
+"{ c #E14548",
+"] c #D44D4C",
+"^ c #CC5554",
+"/ c #E25858",
+"( c #DB6161",
+"_ c #D16867",
+": c #E96A6B",
+"< c #E27373",
+"[ c #DA7D7E",
+"} c #EE8283",
+"| c #DD8D8C",
+"1 c #EF9191",
+"2 c #F09D9B",
+"3 c #E9A3A2",
+" +@#&%%%%%&&&&%%%&&&#@+ ",
+" .#*):1333333333333332(!$#. ",
+" +&><22223333332333333333[,%+ ",
+" .&)11111111122111233333333|)*. ",
+" #>}}1}}}}1}}|111}}}||[||||||># ",
+"+%/<<<}}:}<}}[<[}}}}}}[[[|||[(&+",
+"@)_<<<:<::<<_<<<<:::<<<[[[[[[[)@",
+"#)(((/(:::(_____<:::::(____[__!#",
+"%{^](//^^(^^^_^^((///:/(^^_^__^&",
+"%~]]]]]~~~^~^~^^~///{/]^^^~^_^^%",
+"$!!!!!]'~'~~~~~~~{{{{{{{~]~~'^^#",
+"%!){)!''''''!!!!!!!){){!!'~''''#",
+"%,),,,!!,',!,)))))))))))!!!''''#",
+"&>-,,====,=,,>>>>>>)>>>)),,,@''#",
+"%>--=====-->>>>>>>>>>)->>-),,==%",
+"&&&-$==#--&**&&&&&&&---%-------$",
+"&**&&%$%&&*&&&&-&&>&%%-%&&%$$--%",
+"%&*&&%%&&**&&-%%%&*&&%%&%&&%%%$$",
+"%%&&&%&&***&%$%%%%&&%%%&&&&%%$$$",
+"$%%%&&**;**&%$$$$$%%%%&***&&%$##",
+"$%%&&**;****&$$###$%%$%&&***&%%$",
+"%%&&**;;;;**%%#####$$%%%**&*&%$%",
+"%&&&*;*;*;*&%%$####$#$%%&***&&%%",
+"&%%&******&&%%%%$###$%%&&&&*&&&&",
+"#&%&&&&&&&&&&&&&&%%%%&%&&&***&&$",
+"@%%$&&$$$$%%&&&&&&&&%%&%%****;*@",
+"+%%%%&$###$%&%&&&&&**%%&%&*;*;*+",
+" @%$&%%###$$$%$%%&**&&&%**;**&# ",
+" .&%%&&$#######%&&***%&&**;**&. ",
+" +&*&&%$##$##$%&&**&&%&*;*;*+ ",
+" .#&&%%%#$###%&&&&&&&&*;*#. ",
+" +@#$$%%###$&&*&&&&&#@+ "};
diff --git a/third_party/windows/fltk-1.1.10/test/pixmaps/red_bomb.xpm b/third_party/windows/fltk-1.1.10/test/pixmaps/red_bomb.xpm
new file mode 100644
index 0000000..eb78474
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/pixmaps/red_bomb.xpm
@@ -0,0 +1,67 @@
+/* XPM */
+static const char * red_bomb_xpm[] = {
+"32 32 32 1",
+" c #000100",
+". c #340001",
+"+ c #3C0100",
+"@ c #410003",
+"# c #440000",
+"$ c #760000",
+"% c #4E1414",
+"& c #A60000",
+"* c #B70000",
+"= c #5F2928",
+"- c #C30000",
+"; c #CE0000",
+"> c #D90000",
+", c #BE1315",
+"' c #653A3B",
+") c #733C3C",
+"! c #B92223",
+"~ c #D31A1D",
+"{ c #744A49",
+"] c #AE3232",
+"^ c #CD3B3B",
+"/ c #875B5B",
+"( c #C04848",
+"_ c #9A6E6E",
+": c #D35A5A",
+"< c #C57170",
+"[ c #DF6D6D",
+"} c #D97D7D",
+"| c #ED8181",
+"1 c #DD8D8C",
+"2 c #EF9191",
+"3 c #EAA2A1",
+" #$&-*****----***---&$# ",
+" .&;~[2333333333333331[^*&. ",
+" @*~|23233333333333333333}!*# ",
+" .-~222222222332223333333331^-. ",
+" &,|||||||22||222|2|11}111112~& ",
+"@-:|||||||[||}}|||||||}}1<11}:-#",
+"$~[[[[[[[[[}_______<}|[}}<<}<},$",
+"&^:[::[::[</_/______/<<[[[}<<|(&",
+"-(:::^:^[{/////////////<:::::[(-",
+",^^^:^:({{{{{{{{{{{//{/{(:::(::*",
+"&^^^^^:){''{{{{{{{)))))/)((((((&",
+"*^^^^^]'''''''''')'){)))'(]((](&",
+"*,^~!!==''.'===='=)=)='=')!]]]]&",
+"-~,,!!%%.==%=%==%=%=====%=^!]]]&",
+"*~,,&!.%%.%%%%%%%%%%%%%%%%,,,,!*",
+"---~&&...%+%@%@#%#%#%%%%%%,,&,,&",
+"-;;;**%++%+###@@@@#@@@@###***&**",
+"*-;--*.#####@+@#@#@#@@++#@*****&",
+"**-*--######@+.@@@@#++@##@-**&*&",
+"&**-*-$####++.++.+++@+###$--**&&",
+"***-;;&######+.+...++++##&;;-**&",
+"&*--;>>$####@+....+.+.++$;;;-*&*",
+"**--;>>;####@@+.+...@..#&;;----*",
+"***-;;;>*##+++@@.+++.@@&--;;;-*-",
+"&-*-;;-*;*$+#@##+@.@+$&*--;;;;-&",
+"$*******&*&&$###@@+$&****-;>>>>$",
+"#*****&&&&&&***------*-*-;;>>>;#",
+" &*****&&&&*&***---;;-*-;;>;;;& ",
+" .*-*-*&&&&&&&&&-;;;--*-;>>>;-. ",
+" #*;--*&&&&&&&*--;;---->;>>;# ",
+" .&--*&*&&&&&*-;------->>&. ",
+" #$&***&&&&&--;-----*$@ "};
diff --git a/third_party/windows/fltk-1.1.10/test/pixmaps/srs.xbm b/third_party/windows/fltk-1.1.10/test/pixmaps/srs.xbm
new file mode 100644
index 0000000..7812af5
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/pixmaps/srs.xbm
@@ -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};
diff --git a/third_party/windows/fltk-1.1.10/test/pixmaps/sudoku.xbm b/third_party/windows/fltk-1.1.10/test/pixmaps/sudoku.xbm
new file mode 100644
index 0000000..68b37d1
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/pixmaps/sudoku.xbm
@@ -0,0 +1,14 @@
+#define sudoku_width 32
+#define sudoku_height 32
+static unsigned char sudoku_bits[] = {
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x0c, 0x30, 0xc0,
+ 0x63, 0xcc, 0x33, 0xcf, 0x63, 0x4c, 0x33, 0xcc, 0x63, 0x4c, 0x33, 0xcc,
+ 0x63, 0xcc, 0x33, 0xcc, 0x63, 0x0c, 0x33, 0xcc, 0x63, 0x0c, 0x33, 0xcc,
+ 0x03, 0x0c, 0x30, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x03, 0x0c, 0x30, 0xc0, 0xd3, 0xcc, 0x33, 0xcf, 0xd3, 0xcc, 0x30, 0xcc,
+ 0xd3, 0xcc, 0x33, 0xce, 0xf3, 0xcc, 0x32, 0xce, 0xc3, 0xcc, 0x32, 0xcc,
+ 0xc3, 0xcc, 0x33, 0xcf, 0x03, 0x0c, 0x30, 0xc0, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0x03, 0x0c, 0x30, 0xc0, 0xf3, 0xcc, 0x33, 0xcf,
+ 0x83, 0x4c, 0x33, 0xc1, 0xf3, 0xcc, 0x33, 0xcf, 0x33, 0x4c, 0x33, 0xcc,
+ 0x33, 0x4c, 0x33, 0xcc, 0xf3, 0xcc, 0x33, 0xcf, 0x03, 0x0c, 0x30, 0xc0,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
diff --git a/third_party/windows/fltk-1.1.10/test/pixmaps/tile.xpm b/third_party/windows/fltk-1.1.10/test/pixmaps/tile.xpm
new file mode 100644
index 0000000..dec1340
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/pixmaps/tile.xpm
@@ -0,0 +1,120 @@
+/* XPM */
+static const char * tile_xpm[] = {
+"100 100 17 1",
+" c None",
+". c #DCDCDC",
+"+ c #D9D9D9",
+"@ c #E4E4E4",
+"# c #DFDFDF",
+"$ c #CECECE",
+"% c #D2D2D2",
+"& c #C8C8C8",
+"* c #CACACA",
+"= c #C4C4C4",
+"- c #BEBEBE",
+"; c #D4D4D4",
+"> c #E8E8E8",
+", c #D6D6D6",
+"' c #C6C6C6",
+") c #B2B2B2",
+"! c #E2E2E2",
+".+@.##$%%$$$&*=..%$*%-;*>,%$%#>,$,%%*%*.#*%++$;+,,.&&=-%%+.$,#,=;%#,@.+,%>,+=-++@@#%$.++#,--;.=*+,,>",
+"%%.&$@.#,*%*&'%%&$;,*%%,&%;%,#..;$$%';+.+,++.%.;+@@@$'.;'..;@.+$%)&!!,.!>+%@%-*%@>#.+&&+.+$%,++$$#++",
+",.$&$+#+.%++$%,=$;$&'+.%%&-+++;%;;$%+%+;.#.+@!!..>#+$%;,$.+@,+.%-%%-%>#+.#+$%...%,!>>;$$$.%$+#+*++&*",
+",$;;;..-*!;*.+%=*%;*%%=&$+$++,-%;+++++++++++#@@@>@#,++;$%;++#.+++%&*=#.+;%>@+,...++$>@#&%*%;.$=$##=;",
+"%#$,+$$%,.++.%%,'*%;,$=-$+@,%*$+%.#+%,.++%;.,#@@@>#+*,$%;,++..@#.,+@+.#.+%#+!.,%#>%,,+>#.%$!#%=%$$#+",
+"+*'%$)&,+,+,+*%,,$,+,*-&++$%%*%#@#%$;+.%,!.+;+!@+>..,%$,$;..#,@.$;%.##.#!#;;++#.+%!.,%,.@##>%,>%$,+,",
+",,$$$%%%';+$%,$!,$,;;,..,&)%%+#!+..,++%%++#+#@+,##,;,%.%.+++.#;%+.,+#.,#+;#%.@,+#.+,#!,+.>#..,,++++.",
+";=-;##%=$%,.$%%+;%%%$+.%&%%%,.,%++..+++;%;;.+#.+%..%;+,#+$%.;,....+.++.+,$$.#>.$+@&+#;.@@.%!@.#+@!,%",
+"-$$&+%.,#;;&$$,*$+%%.#*='$,,+.;,+,##...$%++%.,++%,..+;%,%,,%+,.,##.+%%+@,'%#.++,,,%++.>++.>#+#>>.%,%",
+",!.;$$$#.;%'-'&*+++.$=*%;,++;;;.+;++,+++@@%++++..$..+%+&$.+*;,++.+;+*%+#+++...+;.%+##@.%@>#.!>#&%+=$",
+"...#%%,,;=-%$=%%@+.;==;=+#+%+*$#.%+%+@.++!,%,;;%..,,*,+'+,;;#.$%#%+%,.%&+#.$+@!%;,+##++#@!!#@@&%@..+",
+"+$=%%$#,$--$=$%+#,=%%,%;$;%.+.,,+!++#..++%;.%%$..,#;.+$#%$$#;.%;+..+,.%,%+,..@++..*+#,+.#>@#.+++!.+.",
+"..+'=;%$,+,%$*&%&=-;+#+%==..;,#,#.###@+$%,,$$;+@#.,;.*;.+&.#%*.>.,.#$'+.%%,,%##++;+,#*.@>#%%#@+%$@@.",
+"..;+.$%=$,##,,'=&$$%%++$$%,,;$;.,##.+#;++;#+;+.>..#$$%,%;,%+=$+#.!...+%,%++%;&+#$%.%#@,;+#.,#,+.+%;,",
+"%;+@++*$%%$+@,*&$$*&;%%.#,.$$,++#@@#.,+%.;%#+!#.,!#..'%;%+;%*%;+,!@..#,;.%%,+&,*$.,%@>!+;,###&;;#.;%",
+"$$;+.,.;%=$$$,+%+$,&$%,,.+=$%.,;##!#.#$%.+%,+.@.,#%*#%$$;+*.+,$%%@.+@..+,$%++$&%#+,.#,#@#.&$$++,+.,,",
+",%+.+$.;&;%+,$,+,+%%**$+*$+,%+%,$%.%;@+%##;;;;#+##%*$%'*&++.;.+;.#+;#>++,+*%%%++,,.#;=@@.+,;$&;%;%$-",
+"%'.+,'*;;;#+;&$#$$,%*,$=%,+,,%%$%%%+%!@++#;++&+.,.;,&$-%,;,++%..#+;++$+#,++,=%%+++!#++..+;;,%,%=&+..",
+"%,;+%&$$+#%%++%;$&&%%%'%,,+++%,%;*.+%%>..+,+##+%+;=.&&,%$#.%;%!@,+,%,,+++.+.*%%;$.%+#!+&,;,;+,%+$=,$",
+"%#.&%,-;+$+.,++$*$%&=$,,;#,.,&;&.,+%++;%.+%,+!#.;%%&*,,%.$,;&#!.%%%%++,.%,;+,%.#.$;++;%;++#,$=.++,$=",
+";%;%$,$%=%#.@,,$*%*=%;%%+%$.%&'+%$#.=,++&;$>#*..+,%+$+;,,#.;.@,%.+,+;,#++,$$+++.++,+#%%$%##.,++*$+;.",
+"$+%$;.,*$#+%.!..,%=*$&$;;%$%$+,$$%%%'++,+,.@#+.,$.,!;#;$,#,#++,%.%.,.+;.$%.,++%%$+,#%,+,$,.%.%$+.$,;",
+"-%@#..%$+;%+;,%.+,$$'$*+%%;,%$$%%+;;,&'%#.##...$#.!$'#>+&,+#,+$*+.;+#,%%;,.!+,+$$%+.+++*+..+,+%,#+.=",
+";%;###+@!;+$$;,$.+.%$$%.%.$*%&&,.,,;+;$&$+.+..$+#+$%.!.%$%%+#*;;&,#++%,,+,;#++$$%++,%,%%++!.+@.;*#,*",
+"*%%+@%+#,...,$;,'$++,;#&,,&'=&'*+++.%$-=$$%!..#,%%++>+=#%;+,++,++.%..+$;.+,+$%%+,.;&,#+,*.++##@;%,%-",
+"%$%#,.++$+#+%%+$'%&.,;#+$&$&&%-;,$.!+=*&=*.#;#.,%,@@$;#.*%..,+,#@..+,$%@,,.&%$;,%%$%,+%+%+&,@.##.+**",
+"%*..+%.;+#,+.$$,;*$$%+;+%%$,%'%;%*%.;%+$=,%*$++,+>+'..,$%;!%$##@+#..$%.%;,,%$%%;==..$%%,+,++$;@.&+>#",
+"%@@%'+$+.%.#.=&,%%%$';%&%$+.%&.%**+=$+#%.%%';%*$>.&=..%$$*...+,.;.#%.#+.@$%%.,$-&,,,%;*#%;#$,+;#+#@.",
+"!@.;=,.;$@.;+.$''%%=.;=;+%*,..;=&%=$+,&,+%,+;%$;,.&!.+%$+#,+,#.;.,%,.,.>!$$;;%;%,,$*%;%+#;;+#%#>!+,.",
+"##+-..+,+...+%+;$&&,*&,%,;%%%*+,%*,%%%%=-.+;##%,$$,!+!+%!,%%+#,%+;+.+;.%%;$$=+%+;,;'$,;++++..>>#%%##",
+"#+%@@;++.++%,;+.%*%-$%%;%.@%*$%.,+;%++'%&;&.>%@++%$%.,%+%$###.+*+#.,%++'#%$%&$%*%$;%+.+,##++!.+#!!.%",
+".-%##!@.%%$%;..;,+%$&%&%++.;+,+%%+;%;.++#$$@;#$.#%.=*$#,*+%$%+..+;;%++;;+!;$'%+'=%;;.##+.++.#+#.#.,.",
+"#@!#+#@.%+%$,++,,;;,+%*&%;+%%$=#+&$+**+#,+@..#.'$,#;,*,+!%%,%.#;%$%$&;,%%,.$%.%-$;;!@$%%..+.##!+,$.$",
+"..@>#@++;+;%%++..%;+!+%$;.;+'-%$+%,,=%.$+!+#@+%$>*-,%+..$=%%#.-=*%++$;%&%%&$.;%'%%.+%;.&,+#!!#+*;$*&",
+">@%+.;%%#+$+*$++$;*.+%%%+,+%*&$&,+;',@=%+$#.%*..&''&.+#.;$&$;%&&.$=&$,$%=*+.&&,.+.+;,.;;%.#.++,+''&.",
+"!+..$&+%$;.,++%,%%%,#,+.%+%$&,$*.+&.+$+%$.@&&+#%-=,,#;%%.#.$&%&+.%=','*$++.%%%.+.+%;++%,,#+,*.;%..@@",
+"$;+%,.&=-;++@..$$,%+!!%%.%$;$;;==%#.$$$$##;++#+$=$...;%*+%+.,%%$&$*%$==,#$&$$+,++,%;%++;%+%-$++.+!@%",
+".%;++.-*$%%;+.+$+;..++...,;*+%;%%.!$;+,++%+.+%;.;,,.;+%$,&&.#%&'-&%,=-,+%&&,+#+;;+,.+#+++,'%.;.##+$#",
+"...#%%%*=%+$+,+....+,+.;!++;$$%,.+,+$,++#+#>+.$++.$#++$%%$%+*&+,%=%==+%'=%%+.,.&%%+%#.%%,%%%.;++%%;&",
+"%+.+%+*+&;$%$$.+.!#;#+%=&#@,;$..%#;++=$,.#!#+..+#,,%$&&+;;,,$-+#;+-=$$&$%++,,$$%%+%.%$,*$%%+$%;=$,*%",
+".%;!.$$%#,+=$$%,!#@#;;+.%*=+#.,,.+%+.$+++%%,%.#>.;+$;$&++%'$,++.+%+,,=$'+++,*%,;+*;,%$,%+&*%++&-;%$$",
+"%++;+.%+$$%%$$%,+#.%.@.%;$++*>#+,;.&$@.!#='&@+@@..*$,%%+%$%$%#;+,;#%%$;+,+%$%$%++&%&;;%;$&$*&;;%;,$%",
+"%+=$#+,%&''++,.+$#.!+%%+;*%.!++*%+.',.%;!;.#.;#@+%%$;..%-%%*,;+,,%$$$.!+'$%%%$;+%%+.+++*+;$%;%,%;,;$",
+"*$$,,;;$$$$++#.$+%.@%;..%+.;#+&,.+*.;..$&,!.;+;..*%;,%%+%*'*&%!.'*$%$$'..++%,;$%%++;&+,%%%$%,,..++&&",
+"'&$,,+*%+%%..+;#.+#$%+.+.,+;%$.%+*$++,.%++#@#$'$.!%%;$-%%+$$-%+$,.+;&)'%;.!#,%%%++,%$%';,$%%.+%,#+&+",
+"'%,%*$%%%,,..;;..,+.+,%+,+,,*,#+&%%#.#.!.;@!%%...%.&=$+&&%,%#%*,;*;*=&'$;+.##,,+.$+,*-'%%+,;.;$'%%,,",
+".+,$--&$,+$&..#+%,%,$!+%++,+.%+%%$+%!#!##+++*$,@!#%-$+'%.$-+%%%&%$-**=&$%%.;%+#.;$%.$;+%,%,;;%;*$%;=",
+",;&===*;%*,=,#+##%).*%>#%+$#,*=.+%$+.$#.$+@%;*%+#..#+=+@#&$-*,..'-*;-$$;$=';,++#@%%$+@+%%%$$,+&&+;$#",
+";'=$+$;;)%=,%+..%+#,,%&$+#,.;$$.,+#;#+,$%##;;;%&+;#$&+.$;%%-&;.;&;-;$$=$*-$,.,;;.#!.,.,$%,,,%&*;%;..",
+"*)=)&%.#'-&,+%%#;;+>.$,+.*%#+!,,&,@;,,,.@=%&';,+.,;+.>.;&%=+*,+&,%;*;%%'-$++%.%,.%%+&$;%%,%.%=.=*%%*",
+".&&=-%%+.$,#,=;%#,@.+,%>,+=-++@@#%$.++#,--;.=*+,,>.+@.##$%%$$$&*=..%$*%-;*>,%$%#>,$,%%*%*.#*%++$;+,,",
+"@@$'.;'..;@.+$%)&!!,.!>+%@%-*%@>#.+&&+.+$%,++$$#++%%.&$@.#,*%*&'%%&$;,*%%,&%;%,#..;$$%';+.+,++.%.;+@",
+"#+$%;,$.+@,+.%-%%-%>#+.#+$%...%,!>>;$$$.%$+#+*++&*,.$&$+#+.%++$%,=$;$&'+.%%&-+++;%;;$%+%+;.#.+@!!..>",
+"#,++;$%;++#.+++%&*=#.+;%>@+,...++$>@#&%*%;.$=$##=;,$;;;..-*!;*.+%=*%;*%%=&$+$++,-%;+++++++++++#@@@>@",
+"#+*,$%;,++..@#.,+@+.#.+%#+!.,%#>%,,+>#.%$!#%=%$$#+%#$,+$$%,.++.%%,'*%;,$=-$+@,%*$+%.#+%,.++%;.,#@@@>",
+"..,%$,$;..#,@.$;%.##.#!#;;++#.+%!.,%,.@##>%,>%$,+,+*'%$)&,+,+,+*%,,$,+,*-&++$%%*%#@#%$;+.%,!.+;+!@+>",
+",;,%.%.+++.#;%+.,+#.,#+;#%.@,+#.+,#!,+.>#..,,++++.,,$$$%%%';+$%,$!,$,;;,..,&)%%+#!+..,++%%++#+#@+,##",
+".%;+,#+$%.;,....+.++.+,$$.#>.$+@&+#;.@@.%!@.#+@!,%;=-;##%=$%,.$%%+;%%%$+.%&%%%,.,%++..+++;%;;.+#.+%.",
+"..+;%,%,,%+,.,##.+%%+@,'%#.++,,,%++.>++.>#+#>>.%,%-$$&+%.,#;;&$$,*$+%%.#*='$,,+.;,+,##...$%++%.,++%,",
+"..+%+&$.+*;,++.+;+*%+#+++...+;.%+##@.%@>#.!>#&%+=$,!.;$$$#.;%'-'&*+++.$=*%;,++;;;.+;++,+++@@%++++..$",
+",,*,+'+,;;#.$%#%+%,.%&+#.$+@!%;,+##++#@!!#@@&%@..+...#%%,,;=-%$=%%@+.;==;=+#+%+*$#.%+%+@.++!,%,;;%..",
+"#;.+$#%$$#;.%;+..+,.%,%+,..@++..*+#,+.#>@#.+++!.+.+$=%%$#,$--$=$%+#,=%%,%;$;%.+.,,+!++#..++%;.%%$..,",
+",;.*;.+&.#%*.>.,.#$'+.%%,,%##++;+,#*.@>#%%#@+%$@@...+'=;%$,+,%$*&%&=-;+#+%==..;,#,#.###@+$%,,$$;+@#.",
+"#$$%,%;,%+=$+#.!...+%,%++%;&+#$%.%#@,;+#.,#,+.+%;,..;+.$%=$,##,,'=&$$%%++$$%,,;$;.,##.+#;++;#+;+.>..",
+"#..'%;%+;%*%;+,!@..#,;.%%,+&,*$.,%@>!+;,###&;;#.;%%;+@++*$%%$+@,*&$$*&;%%.#,.$$,++#@@#.,+%.;%#+!#.,!",
+"%*#%$$;+*.+,$%%@.+@..+,$%++$&%#+,.#,#@#.&$$++,+.,,$$;+.,.;%=$$$,+%+$,&$%,,.+=$%.,;##!#.#$%.+%,+.@.,#",
+"%*$%'*&++.;.+;.#+;#>++,+*%%%++,,.#;=@@.+,;$&;%;%$-,%+.+$.;&;%+,$,+,+%%**$+*$+,%+%,$%.%;@+%##;;;;#+##",
+";,&$-%,;,++%..#+;++$+#,++,=%%+++!#++..+;;,%,%=&+..%'.+,'*;;;#+;&$#$$,%*,$=%,+,,%%$%%%+%!@++#;++&+.,.",
+"=.&&,%$#.%;%!@,+,%,,+++.+.*%%;$.%+#!+&,;,;+,%+$=,$%,;+%&$$+#%%++%;$&&%%%'%,,+++%,%;*.+%%>..+,+##+%+;",
+"%&*,,%.$,;&#!.%%%%++,.%,;+,%.#.$;++;%;++#,$=.++,$=%#.&%,-;+$+.,++$*$%&=$,,;#,.,&;&.,+%++;%.+%,+!#.;%",
+"%+$+;,,#.;.@,%.+,+;,#++,$$+++.++,+#%%$%##.,++*$+;.;%;%$,$%=%#.@,,$*%*=%;%%+%$.%&'+%$#.=,++&;$>#*..+,",
+",!;#;$,#,#++,%.%.,.+;.$%.,++%%$+,#%,+,$,.%.%$+.$,;$+%$;.,*$#+%.!..,%=*$&$;;%$%$+,$$%%%'++,+,.@#+.,$.",
+"!$'#>+&,+#,+$*+.;+#,%%;,.!+,+$$%+.+++*+..+,+%,#+.=-%@#..%$+;%+;,%.+,$$'$*+%%;,%$$%%+;;,&'%#.##...$#.",
+"$%.!.%$%%+#*;;&,#++%,,+,;#++$$%++,%,%%++!.+@.;*#,*;%;###+@!;+$$;,$.+.%$$%.%.$*%&&,.,,;+;$&$+.+..$+#+",
+"++>+=#%;+,++,++.%..+$;.+,+$%%+,.;&,#+,*.++##@;%,%-*%%+@%+#,...,$;,'$++,;#&,,&'=&'*+++.%$-=$$%!..#,%%",
+"@@$;#.*%..,+,#@..+,$%@,,.&%$;,%%$%,+%+%+&,@.##.+**%$%#,.++$+#+%%+$'%&.,;#+$&$&&%-;,$.!+=*&=*.#;#.,%,",
+"+'..,$%;!%$##@+#..$%.%;,,%$%%;==..$%%,+,++$;@.&+>#%*..+%.;+#,+.$$,;*$$%+;+%%$,%'%;%*%.;%+$=,%*$++,+>",
+"&=..%$$*...+,.;.#%.#+.@$%%.,$-&,,,%;*#%;#$,+;#+#@.%@@%'+$+.%.#.=&,%%%$';%&%$+.%&.%**+=$+#%.%%';%*$>.",
+"&!.+%$+#,+,#.;.,%,.,.>!$$;;%;%,,$*%;%+#;;+#%#>!+,.!@.;=,.;$@.;+.$''%%=.;=;+%*,..;=&%=$+,&,+%,+;%$;,.",
+",!+!+%!,%%+#,%+;+.+;.%%;$$=+%+;,;'$,;++++..>>#%%####+-..+,+...+%+;$&&,*&,%,;%%%*+,%*,%%%%=-.+;##%,$$",
+"$%.,%+%$###.+*+#.,%++'#%$%&$%*%$;%+.+,##++!.+#!!.%#+%@@;++.++%,;+.%*%-$%%;%.@%*$%.,+;%++'%&;&.>%@++%",
+".=*$#,*+%$%+..+;;%++;;+!;$'%+'=%;;.##+.++.#+#.#.,..-%##!@.%%$%;..;,+%$&%&%++.;+,+%%+;%;.++#$$@;#$.#%",
+"#;,*,+!%%,%.#;%$%$&;,%%,.$%.%-$;;!@$%%..+.##!+,$.$#@!#+#@.%+%$,++,,;;,+%*&%;+%%$=#+&$+**+#,+@..#.'$,",
+"-,%+..$=%%#.-=*%++$;%&%%&$.;%'%%.+%;.&,+#!!#+*;$*&..@>#@++;+;%%++..%;+!+%$;.;+'-%$+%,,=%.$+!+#@+%$>*",
+"'&.+#.;$&$;%&&.$=&$,$%=*+.&&,.+.+;,.;;%.#.++,+''&.>@%+.;%%#+$+*$++$;*.+%%%+,+%*&$&,+;',@=%+$#.%*..&'",
+",,#;%%.#.$&%&+.%=','*$++.%%%.+.+%;++%,,#+,*.;%..@@!+..$&+%$;.,++%,%%%,#,+.%+%$&,$*.+&.+$+%$.@&&+#%-=",
+"...;%*+%+.,%%$&$*%$==,#$&$$+,++,%;%++;%+%-$++.+!@%$;+%,.&=-;++@..$$,%+!!%%.%$;$;;==%#.$$$$##;++#+$=$",
+",.;+%$,&&.#%&'-&%,=-,+%&&,+#+;;+,.+#+++,'%.;.##+$#.%;++.-*$%%;+.+$+;..++...,;*+%;%%.!$;+,++%+.+%;.;,",
+"$#++$%%$%+*&+,%=%==+%'=%%+.,.&%%+%#.%%,%%%.;++%%;&...#%%%*=%+$+,+....+,+.;!++;$$%,.+,+$,++#+#>+.$++.",
+",%$&&+;;,,$-+#;+-=$$&$%++,,$$%%+%.%$,*$%%+$%;=$,*%%+.+%+*+&;$%$$.+.!#;#+%=&#@,;$..%#;++=$,.#!#+..+#,",
+"+$;$&++%'$,++.+%+,,=$'+++,*%,;+*;,%$,%+&*%++&-;%$$.%;!.$$%#,+=$$%,!#@#;;+.%*=+#.,,.+%+.$+++%%,%.#>.;",
+"*$,%%+%$%$%#;+,;#%%$;+,+%$%$%++&%&;;%;$&$*&;;%;,$%%++;+.%+$$%%$$%,+#.%.@.%;$++*>#+,;.&$@.!#='&@+@@..",
+"%$;..%-%%*,;+,,%$$$.!+'$%%%$;+%%+.+++*+;$%;%,%;,;$%+=$#+,%&''++,.+$#.!+%%+;*%.!++*%+.',.%;!;.#.;#@+%",
+"%;,%%+%*'*&%!.'*$%$$'..++%,;$%%++;&+,%%%$%,,..++&&*$$,,;;$$$$++#.$+%.@%;..%+.;#+&,.+*.;..$&,!.;+;..*",
+"%%;$-%%+$$-%+$,.+;&)'%;.!#,%%%++,%$%';,$%%.+%,#+&+'&$,,+*%+%%..+;#.+#$%+.+.,+;%$.%+*$++,.%++#@#$'$.!",
+".&=$+&&%,%#%*,;*;*=&'$;+.##,,+.$+,*-'%%+,;.;$'%%,,'%,%*$%%%,,..;;..,+.+,%+,+,,*,#+&%%#.#.!.;@!%%...%",
+"%-$+'%.$-+%%%&%$-**=&$%%.;%+#.;$%.$;+%,%,;;%;*$%;=.+,$--&$,+$&..#+%,%,$!+%++,+.%+%%$+%!#!##+++*$,@!#",
+".#+=+@#&$-*,..'-*;-$$;$=';,++#@%%$+@+%%%$$,+&&+;$#,;&===*;%*,=,#+##%).*%>#%+$#,*=.+%$+.$#.$+@%;*%+#.",
+"#$&+.$;%%-&;.;&;-;$$=$*-$,.,;;.#!.,.,$%,,,%&*;%;..;'=$+$;;)%=,%+..%+#,,%&$+#,.;$$.,+#;#+,$%##;;;%&+;",
+";+.>.;&%=+*,+&,%;*;%%'-$++%.%,.%%+&$;%%,%.%=.=*%%**)=)&%.#'-&,+%%#;;+>.$,+.*%#+!,,&,@;,,,.@=%&';,+.,"};
diff --git a/third_party/windows/fltk-1.1.10/test/pixmaps/white_1.xbm b/third_party/windows/fltk-1.1.10/test/pixmaps/white_1.xbm
new file mode 100644
index 0000000..cb220eb
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/pixmaps/white_1.xbm
@@ -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,
+};
diff --git a/third_party/windows/fltk-1.1.10/test/pixmaps/white_2.xbm b/third_party/windows/fltk-1.1.10/test/pixmaps/white_2.xbm
new file mode 100644
index 0000000..90fc835
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/pixmaps/white_2.xbm
@@ -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,
+};
diff --git a/third_party/windows/fltk-1.1.10/test/pixmaps/white_3.xbm b/third_party/windows/fltk-1.1.10/test/pixmaps/white_3.xbm
new file mode 100644
index 0000000..0ff9cd0
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/pixmaps/white_3.xbm
@@ -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,
+};
diff --git a/third_party/windows/fltk-1.1.10/test/pixmaps/white_4.xbm b/third_party/windows/fltk-1.1.10/test/pixmaps/white_4.xbm
new file mode 100644
index 0000000..ce65928
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/pixmaps/white_4.xbm
@@ -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,
+};
diff --git a/third_party/windows/fltk-1.1.10/test/pixmaps/whiteking_1.xbm b/third_party/windows/fltk-1.1.10/test/pixmaps/whiteking_1.xbm
new file mode 100644
index 0000000..6943d4d
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/pixmaps/whiteking_1.xbm
@@ -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,
+};
diff --git a/third_party/windows/fltk-1.1.10/test/pixmaps/whiteking_2.xbm b/third_party/windows/fltk-1.1.10/test/pixmaps/whiteking_2.xbm
new file mode 100644
index 0000000..bea21c4
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/pixmaps/whiteking_2.xbm
@@ -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,
+};
diff --git a/third_party/windows/fltk-1.1.10/test/pixmaps/whiteking_3.xbm b/third_party/windows/fltk-1.1.10/test/pixmaps/whiteking_3.xbm
new file mode 100644
index 0000000..8b61515
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/pixmaps/whiteking_3.xbm
@@ -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,
+};
diff --git a/third_party/windows/fltk-1.1.10/test/pixmaps/whiteking_4.xbm b/third_party/windows/fltk-1.1.10/test/pixmaps/whiteking_4.xbm
new file mode 100644
index 0000000..b9816a0
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/pixmaps/whiteking_4.xbm
@@ -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,
+};
diff --git a/third_party/windows/fltk-1.1.10/test/pixmaps/yellow.xpm b/third_party/windows/fltk-1.1.10/test/pixmaps/yellow.xpm
new file mode 100644
index 0000000..d715f3a
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/pixmaps/yellow.xpm
@@ -0,0 +1,67 @@
+/* XPM */
+static const char * yellow_xpm[] = {
+"32 32 32 1",
+" c #000100",
+". c #2A4602",
+"+ c #435B00",
+"@ c #818600",
+"# c #969900",
+"$ c #A3A400",
+"% c #B0AF00",
+"& c #B4B425",
+"* c #BAB800",
+"= c #BABE02",
+"- c #B4B73F",
+"; c #C0C300",
+"> c #C7C905",
+", c #C6C821",
+"' c #CBCC00",
+") c #CAC835",
+"! c #C9C943",
+"~ c #D1D201",
+"{ c #C7C94E",
+"] c #CACB5D",
+"^ c #D8D700",
+"/ c #D9DB3C",
+"( c #D5D67B",
+"_ c #DADB6D",
+": c #DFDE57",
+"< c #DFDF64",
+"[ c #D9DB8A",
+"} c #EAEB76",
+"| c #E7E7A1",
+"1 c #EBEC82",
+"2 c #EEED91",
+"3 c #EEEF9C",
+" +@$;**%**==;=*%*=;;$@+ ",
+" .#'/<2||||||||||||||[_)*#. ",
+" +>^}32233||3|333||||||||(*=+ ",
+" .>'2222222233322223||||||||,'. ",
+" #,1111111112222212122[[[[[[[^# ",
+"+*:_111}}}}1_1(111}1111([[[[[_'+",
+"@,___}}}}}}_____1}}}}}_(((((((,@",
+"$/<<:<<<<<__](]]<}:}<}__](](](!$",
+"*:!<!::::{{]{]]{<:::::::<{]]]]{*",
+"*!!!:!!{{{]{{{{{!}///:::!<{]]]]*",
+"%!))/!!----{!!!!!::///::!!!{---$",
+"%))!))-&-&-&!&!!))/////)!!!!---$",
+"*,,)&*&&&&&&&),))))///,))&&----$",
+"=,,*&&$&&&&&)','''',,',,)))*&$&%",
+"=;,*&$$%%*>>'''/,/'),,'>>,)*&&&%",
+"*>';*&$&*;''',>;;>>'****,*****%%",
+"*'~'**%%;>~'>,;***''****;;******",
+"*>'>;***>'^****;'*>>;***;,**%*%%",
+"%*;*;*''^'~>*%%*****,*;*'>,*%%$%",
+"%****''^~^~;*%%%%%*****''''>=%%$",
+"%**>;'^^^^^'*%$$$$%%%**>''''*%%%",
+"%**>^^^^^^~^*%%$#$$%%%**>'~''=%%",
+"*;*>'^^^^^~;*%%$$$#$$%**'>~';==*",
+";***'^~'^~;;****%%%%%****>'';;*=",
+"%**;;>;**;;*;;;***%***;*;;'^~~>%",
+"@***,**%%****>''>;*;*;***>^~^~~@",
+"+*****%$#%%*****;>>'';***'^~^^~+",
+" #*****$$#%%%%****'''>*;'^~~~~# ",
+" .%;*,;%$$$$$$%**~^'>**>~^^^~>. ",
+" +*>'*%%$%%$$$**>'^';;*~^^~>+ ",
+" .#';*%$$%$$$*;';>>*>;~~^$. ",
+" +@#%**%$$$%>*>>>'*>$@+ "};
diff --git a/third_party/windows/fltk-1.1.10/test/pixmaps/yellow_bomb.xpm b/third_party/windows/fltk-1.1.10/test/pixmaps/yellow_bomb.xpm
new file mode 100644
index 0000000..aead40b
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/pixmaps/yellow_bomb.xpm
@@ -0,0 +1,67 @@
+/* XPM */
+static const char * yellow_bomb_xpm[] = {
+"32 32 32 1",
+" c #000100",
+". c #393900",
+"+ c #2A4602",
+"@ c #434101",
+"# c #474900",
+"$ c #435B00",
+"% c #515116",
+"& c #5B5C20",
+"* c #676800",
+"= c #666635",
+"- c #7C7B50",
+"; c #848323",
+"> c #838442",
+", c #8E9200",
+"' c #8A8A5F",
+") c #A6A600",
+"! c #9A9B6D",
+"~ c #B2B102",
+"{ c #AFB132",
+"] c #BAB900",
+"^ c #C1C300",
+"/ c #C6C42C",
+"( c #CFD000",
+"_ c #C7C84F",
+": c #CBCA40",
+"< c #CCCC67",
+"[ c #D7D984",
+"} c #E0E167",
+"| c #E0E07A",
+"1 c #E6E6A0",
+"2 c #EEEE88",
+"3 c #EDED97",
+" $,)]]]~]]]]^]]~]]^^),$ ",
+" +,(/}2111111111111113</~,+ ",
+" $((}33333113133311111111[]^$ ",
+" +^(233223233333233111111111/(+ ",
+" ,^2222222222332222233[[1[[1[() ",
+"$^}2|2}22}22|||22222}22[[[[[[}^$",
+",^}}}|}}}}}[!!'!!!![<|}|<[[[[[^,",
+"):_}}}}}}}!''''''!''!!<|<<<<<<_)",
+"^:}:}}:}<'''-''''''''!'<}_}<<<_]",
+"]_:}/:}{-=--------'>'>--_}_____]",
+"~::/:/_>=-=--=--=--=---->____<<)",
+"~:///:;=============>===={:{{{{)",
+"]^///:>%=.=.========&====>{:{{{,",
+"^^^]~{.=.==.=%%%&&&&&=&&&%/~{{{~",
+"]^^/))....=.%%=%%%%&%%%%%%/~~~~~",
+"^^^^/{.=...%@@@@%#%@%@%%%%]/~/~~",
+"^((^]~...%%@@@@.@@@@@@.@@@]]]~]]",
+"]^((]/..@@@%..@@@@@@@.@.@@]~~]~~",
+"~]]^]]@%@#@@...@@@@@@.@@@@^]~))~",
+")~]]^^;@##@#@........@@@#;^^]~))",
+"~~]]^()#@##@@......@..@@@)((^]~)",
+"~]^^(((*####@..........@*(((^~~]",
+"]]^^(((^##@@@..........@)^^(^]]]",
+"/]]((((()##@..........@)(((((^]]",
+")]~]((^^])*@@@@.....@*,]]^^((((~",
+",]]]]]]~~~~,*@@#@@@*,]]]^^((((^,",
+"$~~]/]~)))~]]]]]^^(((^]]^(((((($",
+" ,]~]~~),))~~~~]]^((^^]]((((((, ",
+" +]]^^^])))))))~^^(((]]^((((((+ ",
+" $^^^]~)))))))]^(((^^](((((($ ",
+" +,(^]~)~))))~]^^^^^/^((({+ ",
+" $,,~]~)),)~^^(^(^^^/,$ "};
diff --git a/third_party/windows/fltk-1.1.10/test/preferences.fl b/third_party/windows/fltk-1.1.10/test/preferences.fl
new file mode 100644
index 0000000..35d1eb1
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/preferences.fl
@@ -0,0 +1,324 @@
+# data file for the Fltk User Interface Designer (fluid)
+version 1.0107
+header_name {.h}
+code_name {.cxx}
+decl {\#include <FL/Fl_Preferences.H>} {public
+}
+
+decl {\#include <stdio.h>} {public
+}
+
+decl {\#include <stdlib.h>} {}
+
+decl {\#include <FL/filename.H>} {}
+
+decl {\#include <FL/fl_ask.H>} {}
+
+decl {void readPrefs();} {public
+}
+
+decl {void writePrefs();} {public
+}
+
+Function {closeWindowCB( Fl_Widget*, void* )} {open private return_type void
+} {
+ code {Fl::delete_widget(myWindow);} {}
+}
+
+Function {saveAndCloseWindowCB( Fl_Widget*, void* )} {open private return_type void
+} {
+ code {writePrefs();
+ Fl::delete_widget(myWindow);} {}
+}
+
+Function {} {open return_type int
+} {
+ Fl_Window myWindow {
+ label {My Preferences}
+ callback closeWindowCB open
+ xywh {394 64 298 311} type Double visible
+ } {
+ Fl_Button {} {
+ label Cancel
+ callback closeWindowCB
+ xywh {210 275 75 25}
+ }
+ Fl_Button {} {
+ label OK
+ callback saveAndCloseWindowCB
+ xywh {125 275 75 25}
+ }
+ Fl_Group {} {
+ label {Get Up:} open
+ xywh {20 30 115 225} box ENGRAVED_FRAME align 5
+ } {
+ Fl_Input wAlarm {
+ label {Alarm at:}
+ xywh {25 55 45 20} align 5
+ }
+ Fl_Choice wAmPm {open
+ xywh {75 55 55 20} down_box BORDER_BOX
+ } {
+ MenuItem {} {
+ label {a.m.}
+ xywh {0 0 100 20}
+ }
+ MenuItem {} {
+ label {p.m.}
+ xywh {0 0 100 20}
+ }
+ }
+ Fl_Choice wWear {
+ label {Wear:} open selected
+ xywh {25 100 105 20} down_box BORDER_BOX align 5
+ } {
+ MenuItem {} {
+ label shoes
+ xywh {0 0 100 20}
+ }
+ MenuItem {} {
+ label sandals
+ xywh {0 0 100 20}
+ }
+ MenuItem {} {
+ label {flip flops}
+ xywh {0 0 100 20}
+ }
+ MenuItem {} {
+ label {bare foot}
+ xywh {0 0 100 20}
+ }
+ }
+ Fl_Group {} {open
+ xywh {35 120 98 60}
+ } {
+ Fl_Round_Button wLeft {
+ label {left side}
+ xywh {35 120 95 25} type Radio down_box ROUND_DOWN_BOX
+ }
+ Fl_Round_Button wRight {
+ label {right side}
+ xywh {35 140 95 25} type Radio down_box ROUND_DOWN_BOX
+ }
+ Fl_Box {} {
+ label {of the bed}
+ xywh {38 160 95 20}
+ }
+ }
+ Fl_Check_Button wShower {
+ label shower
+ xywh {25 180 105 25} down_box DOWN_BOX
+ }
+ Fl_Check_Button wShave {
+ label shave
+ xywh {25 200 105 25} down_box DOWN_BOX
+ }
+ Fl_Check_Button wBrush {
+ label {brush teeth}
+ xywh {25 220 105 25} down_box DOWN_BOX
+ }
+ }
+ Fl_Group {} {
+ label {Breakfast::} open
+ xywh {160 30 115 225} box ENGRAVED_FRAME align 5
+ } {
+ Fl_Choice wDrink {
+ label {Drink:} open
+ xywh {165 50 105 20} down_box BORDER_BOX align 5
+ } {
+ MenuItem {} {
+ label coffee
+ xywh {10 10 100 20}
+ }
+ MenuItem {} {
+ label tea
+ xywh {10 10 100 20}
+ }
+ MenuItem {} {
+ label juice
+ xywh {10 10 100 20}
+ }
+ }
+ Fl_Check_Button wMilk {
+ label {with milk}
+ xywh {170 70 100 25} down_box DOWN_BOX
+ }
+ Fl_Choice wBread {
+ label {Bread:} open
+ xywh {165 110 105 20} down_box BORDER_BOX align 5
+ } {
+ MenuItem {} {
+ label wheat
+ xywh {0 0 100 20}
+ }
+ MenuItem {} {
+ label white
+ xywh {0 0 100 20}
+ }
+ MenuItem {} {
+ label rye
+ xywh {0 0 100 20}
+ }
+ MenuItem {} {
+ label {sour doh}
+ xywh {0 0 100 20}
+ }
+ }
+ Fl_Check_Button wButter {
+ label {with butter}
+ xywh {170 130 100 25} down_box DOWN_BOX
+ }
+ Fl_Input wEggs {
+ label eggs
+ xywh {165 163 30 20} type Int align 8
+ }
+ Fl_Value_Slider wMinutes {
+ label {min.}
+ xywh {175 185 70 20} type Horizontal align 8 minimum 2 maximum 6 value 3.1
+ }
+ Fl_Input wPaper {
+ label {Newspaper:}
+ xywh {165 225 105 20} align 5
+ }
+ }
+ }
+ code {readPrefs();} {}
+}
+
+Function {readPrefs()} {open return_type void
+} {
+ code {int boolValue;
+int intValue;
+char buffer[80];
+double doubleValue;
+
+Fl_Preferences app( Fl_Preferences::USER, "fltk.org", "test/preferences" );
+
+ char path[ FL_PATH_MAX ];
+ app.getUserdataPath( path, sizeof(path) );
+
+ Fl_Preferences bed( app, "Bed" );
+ bed.get( "alarm", buffer, "8:00", 79 );
+ wAlarm->value( buffer );
+
+ bed.get( "ampm", intValue, 0 );
+ wAmPm->value( intValue );
+
+ bed.get( "wear", intValue, 1 );
+ wWear->value( intValue );
+
+ int side;
+ bed.get( "side", side, 2 );
+ if ( side == 1 ) wLeft->value( 1 );
+ if ( side == 2 ) wRight->value( 1 );
+
+ int tasks;
+ bed.get( "taskFlags", tasks, 0x05 );
+ if ( tasks & 0x01 ) wShower->value( 1 );
+ if ( tasks & 0x02 ) wShave->value( 1 );
+ if ( tasks & 0x04 ) wBrush->value( 1 );
+
+ Fl_Preferences eat( app, "Breakfast" );
+
+ eat.get( "drink", intValue, 1 );
+ wDrink->value( intValue );
+
+ eat.get( "wMilk", boolValue, 0 );
+ wMilk->value( boolValue );
+
+ eat.get( "bread", intValue, 0 );
+ wBread->value( intValue );
+
+ eat.get( "wButter", boolValue, 1 );
+ wButter->value( boolValue );
+
+ eat.get( "nEggs", intValue, 2 );
+ sprintf( buffer, "%d", intValue );
+ wEggs->value( buffer );
+
+ eat.get( "minutes", doubleValue, 3.2 );
+ wMinutes->value( doubleValue );
+
+ char *flexBuffer;
+ eat.get( "newspaper", flexBuffer, "NY Tymes" );
+ wPaper->value( flexBuffer );
+ if ( flexBuffer ) free( flexBuffer );
+
+ eat.get( "foo", buffer, "bar", 80 );
+
+ /** sample code only:
+ Fl_Preferences prev( app, "PreviousStarts" );
+ {
+ int i, n;
+ prev.get( "n", n, 0 );
+ for ( i=0; i<n; i++ )
+ prev.get( Fl_Preferences::Name( i ), flexBuffer, "" );
+ }
+
+ unsigned int hex;
+ eat.get( "binFoo", (void*)&hex, 0, 0, sizeof( unsigned int ) );
+ void *data;
+ eat.get( "binFoo2", data, 0, 0 );
+ **/} {}
+}
+
+Function {writePrefs()} {open return_type void
+} {
+ code {Fl_Preferences app( Fl_Preferences::USER, "fltk.org", "test/preferences" );
+
+ Fl_Preferences bed( app, "Bed" );
+
+ bed.set( "alarm", wAlarm->value() );
+ bed.set( "ampm", wAmPm->value() );
+
+ bed.set( "wear", wWear->value() );
+
+ int side = 0;
+ if ( wLeft->value() ) side = 1;
+ if ( wRight->value() ) side = 2;
+ bed.set( "side", side );
+
+ int tasks = 0;
+ if ( wShower->value() ) tasks |= 0x01;
+ if ( wShave->value() ) tasks |= 0x02;
+ if ( wBrush->value() ) tasks |= 0x04;
+ bed.set( "taskFlags", tasks );
+
+ Fl_Preferences eat( app, "Breakfast" );
+
+ eat.set( "drink", wDrink->value() );
+ eat.set( "wMilk", wMilk->value() );
+ eat.set( "bread", wBread->value() );
+ eat.set( "wButter", wButter->value() );
+
+ eat.set( "nEggs", wEggs->value() );
+ eat.set( "minutes", wMinutes->value() );
+
+ eat.set( "newspaper", wPaper->value() );
+
+ eat.set( "foo", "bar\\nfly\\rBackslash: \\\\ and bell: \\007 and delete: \\177\\n" );
+
+ eat.set( Fl_Preferences::Name( 3 ), "Test3" );
+
+ /* sample: create a sub-sub-group */
+ Fl_Preferences eatMore( eat, "More" );
+
+ eatMore.set( "more", "stuff" );
+
+ /* all the following searches should return 1 */
+ int sum = 0;
+ sum += app.groupExists( "Breakfast" ); /* find 'eat' relative to 'app' */
+ sum += app.groupExists( "Breakfast/More" ); /* find 'eat.eatMore' relative to 'app' */
+ sum += app.groupExists( "./Breakfast/More" ); /* find 'eat.eatMore' relative to Preferences */
+ sum += eat.groupExists( "More" ); /* find 'eatMore' relative to 'eat' */
+ sum += eat.groupExists( "./Breakfast/More" ); /* find 'eat.eatMore' relative to Preferences */
+ sum += eat.groupExists( "." ); /* find myself ('eat') */
+ sum += eat.groupExists( "./" ); /* find the topmost group ('app') */
+ if ( sum != 7 )
+ fl_message( "Assertion failed:\\nNot all group entries were found!" );
+
+ /* sample code only: */
+ unsigned int hex = 0x2387efcd;
+ eat.set( "binFoo", (void*)&hex, sizeof( unsigned int ) );
+ eat.set( "binFoo2", (void*)&writePrefs, 256 );} {}
+}
diff --git a/third_party/windows/fltk-1.1.10/test/radio.fl b/third_party/windows/fltk-1.1.10/test/radio.fl
new file mode 100644
index 0000000..85da905
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/radio.fl
@@ -0,0 +1,74 @@
+# data file for the Fltk User Interface Designer (fluid)
+version 1.0100
+header_name {.h}
+code_name {.cxx}
+gridx 10
+gridy 5
+snap 3
+Function {} {open
+} {
+ Fl_Window {} {open
+ xywh {447 255 369 214} visible
+ } {
+ Fl_Button {} {
+ label Fl_Button
+ xywh {20 10 160 30}
+ }
+ Fl_Return_Button {} {
+ label Fl_Return_Button
+ xywh {20 50 160 30}
+ }
+ Fl_Light_Button {} {
+ label Fl_Light_Button
+ xywh {20 90 160 30}
+ }
+ Fl_Check_Button {} {
+ label Fl_Check_Button
+ xywh {20 130 160 30} down_box DOWN_BOX
+ }
+ Fl_Round_Button {} {
+ label Fl_Round_Button selected
+ xywh {20 170 160 30} down_box ROUND_DOWN_BOX
+ }
+ Fl_Group {} {
+ xywh {190 10 70 120} box THIN_UP_FRAME
+ } {
+ Fl_Round_Button {} {
+ label radio
+ xywh {190 10 70 30} type Radio down_box ROUND_DOWN_BOX
+ }
+ Fl_Round_Button {} {
+ label radio
+ xywh {190 40 70 30} type Radio down_box ROUND_DOWN_BOX
+ }
+ Fl_Round_Button {} {
+ label radio
+ xywh {190 70 70 30} type Radio down_box ROUND_DOWN_BOX
+ }
+ Fl_Round_Button {} {
+ label radio
+ xywh {190 100 70 30} type Radio down_box ROUND_DOWN_BOX
+ }
+ }
+ Fl_Group {} {open
+ xywh {270 10 90 115} box THIN_UP_BOX
+ } {
+ Fl_Button {} {
+ label radio
+ xywh {280 20 20 20} type Radio selection_color 1 align 8
+ }
+ Fl_Button {} {
+ label radio
+ xywh {280 45 20 20} type Radio selection_color 1 align 8
+ }
+ Fl_Button {} {
+ label radio
+ xywh {280 70 20 20} type Radio selection_color 1 align 8
+ }
+ Fl_Button {} {
+ label radio
+ xywh {280 95 20 20} type Radio selection_color 1 align 8
+ }
+ }
+ }
+}
diff --git a/third_party/windows/fltk-1.1.10/test/resize.fl b/third_party/windows/fltk-1.1.10/test/resize.fl
new file mode 100644
index 0000000..490fa13
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/resize.fl
@@ -0,0 +1,54 @@
+# data file for the Fltk User Interface Designer (fluid)
+version 1.00
+header_name {.h}
+code_name {.cxx}
+gridx 10
+gridy 10
+snap 3
+Function {} {open
+} {
+ Fl_Window {} {open
+ xywh {333 489 366 261} visible
+ } {
+ Fl_Button {} {
+ label {@<-}
+ callback {Fl_Window* w = o->window();
+w->position(w->x()-50,w->y());}
+ xywh {20 40 40 40} labeltype SYMBOL_LABEL
+ }
+ Fl_Button {} {
+ label {@2->}
+ callback {Fl_Window* w = o->window();
+w->position(w->x(),w->y()+50);}
+ xywh {60 80 40 40} labeltype SYMBOL_LABEL
+ }
+ Fl_Button {} {
+ label {@->}
+ callback {Fl_Window* w = o->window();
+w->position(w->x()+50,w->y());}
+ xywh {100 40 40 40} labeltype SYMBOL_LABEL
+ }
+ Fl_Button {} {
+ label {@8->}
+ callback {Fl_Window* w = o->window();
+w->position(w->x(),w->y()-50);}
+ xywh {60 0 40 40} labeltype SYMBOL_LABEL
+ }
+ Fl_Button {} {
+ label grow
+ callback {Fl_Window* w = o->window();
+w->size(w->w()+20, w->h()+20);}
+ xywh {30 130 110 40} labeltype SYMBOL_LABEL labelfont 1 labelsize 18
+ }
+ Fl_Button {} {
+ label shrink
+ callback {Fl_Window* w = o->window();
+w->size(w->w()-20, w->h()-20);}
+ xywh {30 190 110 40} labeltype SYMBOL_LABEL labelfont 1 labelsize 18
+ }
+ Fl_Box {} {
+ 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!} selected
+ xywh {150 10 160 220} box BORDER_BOX align 148
+ }
+ }
+}
diff --git a/third_party/windows/fltk-1.1.10/test/resizebox.cxx b/third_party/windows/fltk-1.1.10/test/resizebox.cxx
new file mode 100644
index 0000000..195c86e
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/resizebox.cxx
@@ -0,0 +1,102 @@
+//
+// "$Id: resizebox.cxx 5519 2006-10-11 03:12:15Z mike $"
+//
+// Resize box test program for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2005 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 (big ? 60 : 40)
+#define B 0
+#define W3 (5*W1+6*B)
+
+#include <FL/Fl.H>
+#include <FL/Fl_Single_Window.H>
+#include <FL/Fl_Box.H>
+#include <FL/Fl_Radio_Button.H>
+#include <FL/fl_draw.H>
+#include <FL/fl_message.H>
+
+Fl_Single_Window *window;
+Fl_Box *box;
+
+int big = 0;
+
+void b_cb(Fl_Widget *,long w) {
+ if (window->w() != W3 || window->h() != W3) {
+ fl_message("Put window back to minimum size before changing");
+ return;
+ }
+ window->init_sizes();
+ switch (w) {
+ case 0: box->hide(); window->box(FL_FLAT_BOX); window->resizable(0); return;
+ case 8: box->resize(W1+B,W1,2*W1,B); break;
+ case 2: box->resize(W1+B,W1+B+2*W1,2*W1,B); break;
+ case 4: box->resize(W1+B,W1,B,2*W1); break;
+ case 6: box->resize(W1+B+2*W1,W1+B,B,2*W1); break;
+ }
+ window->box(FL_NO_BOX);
+ if (w == 6 || w == 4)
+ box->label("re\nsiz\nab\nle");
+ else box->label("resizable");
+ box->show();
+ window->resizable(box);
+ window->redraw();
+}
+
+int main(int argc, char **argv) {
+ window = new Fl_Single_Window(W3,W3);
+ window->box(FL_NO_BOX);
+ Fl_Box *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 Fl_Box(FL_FRAME_BOX,x*(B+W1)+B,y*(B+W1)+B,W1,W1,0);
+ n->color(x+y+8);
+ }
+ n = new Fl_Box(FL_FRAME_BOX,B,4*W1+5*B,4*W1+3*B,W1,0);
+ n->color(12);
+ n = new Fl_Box(FL_FRAME_BOX,4*W1+5*B,B,W1,5*W1+4*B,0);
+ n->color(13);
+ n = new Fl_Box(FL_FRAME_BOX,W1+B+B,W1+B+B,2*W1+B,2*W1+B,0);
+ n->color(8);
+
+ Fl_Button *b = new Fl_Radio_Button(W1+B+50,W1+B+30,20,20,"@6>");
+ b->callback(b_cb,6);
+ (new Fl_Radio_Button(W1+B+30,W1+B+10,20,20,"@8>"))->callback(b_cb,8);
+ (new Fl_Radio_Button(W1+B+10,W1+B+30,20,20,"@4>"))->callback(b_cb,4);
+ (new Fl_Radio_Button(W1+B+30,W1+B+50,20,20,"@2>"))->callback(b_cb,2);
+ (new Fl_Radio_Button(W1+B+30,W1+B+30,20,20,"off"))->callback(b_cb,0);
+
+ box = new Fl_Box(FL_FLAT_BOX,0,0,0,0,"resizable");
+ box->color(FL_DARK2);
+ b->set();
+ b->do_callback();
+ window->end();
+
+ window->size_range(W3,W3);
+ window->show(argc,argv);
+ return Fl::run();
+}
+
+//
+// End of "$Id: resizebox.cxx 5519 2006-10-11 03:12:15Z mike $".
+//
diff --git a/third_party/windows/fltk-1.1.10/test/rgb.txt b/third_party/windows/fltk-1.1.10/test/rgb.txt
new file mode 100644
index 0000000..240e989
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/rgb.txt
@@ -0,0 +1,753 @@
+! $Xorg: rgb.txt,v 1.3 2000/08/17 19:54:00 cpqbld Exp $
+255 250 250 snow
+248 248 255 ghost white
+248 248 255 GhostWhite
+245 245 245 white smoke
+245 245 245 WhiteSmoke
+220 220 220 gainsboro
+255 250 240 floral white
+255 250 240 FloralWhite
+253 245 230 old lace
+253 245 230 OldLace
+250 240 230 linen
+250 235 215 antique white
+250 235 215 AntiqueWhite
+255 239 213 papaya whip
+255 239 213 PapayaWhip
+255 235 205 blanched almond
+255 235 205 BlanchedAlmond
+255 228 196 bisque
+255 218 185 peach puff
+255 218 185 PeachPuff
+255 222 173 navajo white
+255 222 173 NavajoWhite
+255 228 181 moccasin
+255 248 220 cornsilk
+255 255 240 ivory
+255 250 205 lemon chiffon
+255 250 205 LemonChiffon
+255 245 238 seashell
+240 255 240 honeydew
+245 255 250 mint cream
+245 255 250 MintCream
+240 255 255 azure
+240 248 255 alice blue
+240 248 255 AliceBlue
+230 230 250 lavender
+255 240 245 lavender blush
+255 240 245 LavenderBlush
+255 228 225 misty rose
+255 228 225 MistyRose
+255 255 255 white
+ 0 0 0 black
+ 47 79 79 dark slate gray
+ 47 79 79 DarkSlateGray
+ 47 79 79 dark slate grey
+ 47 79 79 DarkSlateGrey
+105 105 105 dim gray
+105 105 105 DimGray
+105 105 105 dim grey
+105 105 105 DimGrey
+112 128 144 slate gray
+112 128 144 SlateGray
+112 128 144 slate grey
+112 128 144 SlateGrey
+119 136 153 light slate gray
+119 136 153 LightSlateGray
+119 136 153 light slate grey
+119 136 153 LightSlateGrey
+190 190 190 gray
+190 190 190 grey
+211 211 211 light grey
+211 211 211 LightGrey
+211 211 211 light gray
+211 211 211 LightGray
+ 25 25 112 midnight blue
+ 25 25 112 MidnightBlue
+ 0 0 128 navy
+ 0 0 128 navy blue
+ 0 0 128 NavyBlue
+100 149 237 cornflower blue
+100 149 237 CornflowerBlue
+ 72 61 139 dark slate blue
+ 72 61 139 DarkSlateBlue
+106 90 205 slate blue
+106 90 205 SlateBlue
+123 104 238 medium slate blue
+123 104 238 MediumSlateBlue
+132 112 255 light slate blue
+132 112 255 LightSlateBlue
+ 0 0 205 medium blue
+ 0 0 205 MediumBlue
+ 65 105 225 royal blue
+ 65 105 225 RoyalBlue
+ 0 0 255 blue
+ 30 144 255 dodger blue
+ 30 144 255 DodgerBlue
+ 0 191 255 deep sky blue
+ 0 191 255 DeepSkyBlue
+135 206 235 sky blue
+135 206 235 SkyBlue
+135 206 250 light sky blue
+135 206 250 LightSkyBlue
+ 70 130 180 steel blue
+ 70 130 180 SteelBlue
+176 196 222 light steel blue
+176 196 222 LightSteelBlue
+173 216 230 light blue
+173 216 230 LightBlue
+176 224 230 powder blue
+176 224 230 PowderBlue
+175 238 238 pale turquoise
+175 238 238 PaleTurquoise
+ 0 206 209 dark turquoise
+ 0 206 209 DarkTurquoise
+ 72 209 204 medium turquoise
+ 72 209 204 MediumTurquoise
+ 64 224 208 turquoise
+ 0 255 255 cyan
+224 255 255 light cyan
+224 255 255 LightCyan
+ 95 158 160 cadet blue
+ 95 158 160 CadetBlue
+102 205 170 medium aquamarine
+102 205 170 MediumAquamarine
+127 255 212 aquamarine
+ 0 100 0 dark green
+ 0 100 0 DarkGreen
+ 85 107 47 dark olive green
+ 85 107 47 DarkOliveGreen
+143 188 143 dark sea green
+143 188 143 DarkSeaGreen
+ 46 139 87 sea green
+ 46 139 87 SeaGreen
+ 60 179 113 medium sea green
+ 60 179 113 MediumSeaGreen
+ 32 178 170 light sea green
+ 32 178 170 LightSeaGreen
+152 251 152 pale green
+152 251 152 PaleGreen
+ 0 255 127 spring green
+ 0 255 127 SpringGreen
+124 252 0 lawn green
+124 252 0 LawnGreen
+ 0 255 0 green
+127 255 0 chartreuse
+ 0 250 154 medium spring green
+ 0 250 154 MediumSpringGreen
+173 255 47 green yellow
+173 255 47 GreenYellow
+ 50 205 50 lime green
+ 50 205 50 LimeGreen
+154 205 50 yellow green
+154 205 50 YellowGreen
+ 34 139 34 forest green
+ 34 139 34 ForestGreen
+107 142 35 olive drab
+107 142 35 OliveDrab
+189 183 107 dark khaki
+189 183 107 DarkKhaki
+240 230 140 khaki
+238 232 170 pale goldenrod
+238 232 170 PaleGoldenrod
+250 250 210 light goldenrod yellow
+250 250 210 LightGoldenrodYellow
+255 255 224 light yellow
+255 255 224 LightYellow
+255 255 0 yellow
+255 215 0 gold
+238 221 130 light goldenrod
+238 221 130 LightGoldenrod
+218 165 32 goldenrod
+184 134 11 dark goldenrod
+184 134 11 DarkGoldenrod
+188 143 143 rosy brown
+188 143 143 RosyBrown
+205 92 92 indian red
+205 92 92 IndianRed
+139 69 19 saddle brown
+139 69 19 SaddleBrown
+160 82 45 sienna
+205 133 63 peru
+222 184 135 burlywood
+245 245 220 beige
+245 222 179 wheat
+244 164 96 sandy brown
+244 164 96 SandyBrown
+210 180 140 tan
+210 105 30 chocolate
+178 34 34 firebrick
+165 42 42 brown
+233 150 122 dark salmon
+233 150 122 DarkSalmon
+250 128 114 salmon
+255 160 122 light salmon
+255 160 122 LightSalmon
+255 165 0 orange
+255 140 0 dark orange
+255 140 0 DarkOrange
+255 127 80 coral
+240 128 128 light coral
+240 128 128 LightCoral
+255 99 71 tomato
+255 69 0 orange red
+255 69 0 OrangeRed
+255 0 0 red
+255 105 180 hot pink
+255 105 180 HotPink
+255 20 147 deep pink
+255 20 147 DeepPink
+255 192 203 pink
+255 182 193 light pink
+255 182 193 LightPink
+219 112 147 pale violet red
+219 112 147 PaleVioletRed
+176 48 96 maroon
+199 21 133 medium violet red
+199 21 133 MediumVioletRed
+208 32 144 violet red
+208 32 144 VioletRed
+255 0 255 magenta
+238 130 238 violet
+221 160 221 plum
+218 112 214 orchid
+186 85 211 medium orchid
+186 85 211 MediumOrchid
+153 50 204 dark orchid
+153 50 204 DarkOrchid
+148 0 211 dark violet
+148 0 211 DarkViolet
+138 43 226 blue violet
+138 43 226 BlueViolet
+160 32 240 purple
+147 112 219 medium purple
+147 112 219 MediumPurple
+216 191 216 thistle
+255 250 250 snow1
+238 233 233 snow2
+205 201 201 snow3
+139 137 137 snow4
+255 245 238 seashell1
+238 229 222 seashell2
+205 197 191 seashell3
+139 134 130 seashell4
+255 239 219 AntiqueWhite1
+238 223 204 AntiqueWhite2
+205 192 176 AntiqueWhite3
+139 131 120 AntiqueWhite4
+255 228 196 bisque1
+238 213 183 bisque2
+205 183 158 bisque3
+139 125 107 bisque4
+255 218 185 PeachPuff1
+238 203 173 PeachPuff2
+205 175 149 PeachPuff3
+139 119 101 PeachPuff4
+255 222 173 NavajoWhite1
+238 207 161 NavajoWhite2
+205 179 139 NavajoWhite3
+139 121 94 NavajoWhite4
+255 250 205 LemonChiffon1
+238 233 191 LemonChiffon2
+205 201 165 LemonChiffon3
+139 137 112 LemonChiffon4
+255 248 220 cornsilk1
+238 232 205 cornsilk2
+205 200 177 cornsilk3
+139 136 120 cornsilk4
+255 255 240 ivory1
+238 238 224 ivory2
+205 205 193 ivory3
+139 139 131 ivory4
+240 255 240 honeydew1
+224 238 224 honeydew2
+193 205 193 honeydew3
+131 139 131 honeydew4
+255 240 245 LavenderBlush1
+238 224 229 LavenderBlush2
+205 193 197 LavenderBlush3
+139 131 134 LavenderBlush4
+255 228 225 MistyRose1
+238 213 210 MistyRose2
+205 183 181 MistyRose3
+139 125 123 MistyRose4
+240 255 255 azure1
+224 238 238 azure2
+193 205 205 azure3
+131 139 139 azure4
+131 111 255 SlateBlue1
+122 103 238 SlateBlue2
+105 89 205 SlateBlue3
+ 71 60 139 SlateBlue4
+ 72 118 255 RoyalBlue1
+ 67 110 238 RoyalBlue2
+ 58 95 205 RoyalBlue3
+ 39 64 139 RoyalBlue4
+ 0 0 255 blue1
+ 0 0 238 blue2
+ 0 0 205 blue3
+ 0 0 139 blue4
+ 30 144 255 DodgerBlue1
+ 28 134 238 DodgerBlue2
+ 24 116 205 DodgerBlue3
+ 16 78 139 DodgerBlue4
+ 99 184 255 SteelBlue1
+ 92 172 238 SteelBlue2
+ 79 148 205 SteelBlue3
+ 54 100 139 SteelBlue4
+ 0 191 255 DeepSkyBlue1
+ 0 178 238 DeepSkyBlue2
+ 0 154 205 DeepSkyBlue3
+ 0 104 139 DeepSkyBlue4
+135 206 255 SkyBlue1
+126 192 238 SkyBlue2
+108 166 205 SkyBlue3
+ 74 112 139 SkyBlue4
+176 226 255 LightSkyBlue1
+164 211 238 LightSkyBlue2
+141 182 205 LightSkyBlue3
+ 96 123 139 LightSkyBlue4
+198 226 255 SlateGray1
+185 211 238 SlateGray2
+159 182 205 SlateGray3
+108 123 139 SlateGray4
+202 225 255 LightSteelBlue1
+188 210 238 LightSteelBlue2
+162 181 205 LightSteelBlue3
+110 123 139 LightSteelBlue4
+191 239 255 LightBlue1
+178 223 238 LightBlue2
+154 192 205 LightBlue3
+104 131 139 LightBlue4
+224 255 255 LightCyan1
+209 238 238 LightCyan2
+180 205 205 LightCyan3
+122 139 139 LightCyan4
+187 255 255 PaleTurquoise1
+174 238 238 PaleTurquoise2
+150 205 205 PaleTurquoise3
+102 139 139 PaleTurquoise4
+152 245 255 CadetBlue1
+142 229 238 CadetBlue2
+122 197 205 CadetBlue3
+ 83 134 139 CadetBlue4
+ 0 245 255 turquoise1
+ 0 229 238 turquoise2
+ 0 197 205 turquoise3
+ 0 134 139 turquoise4
+ 0 255 255 cyan1
+ 0 238 238 cyan2
+ 0 205 205 cyan3
+ 0 139 139 cyan4
+151 255 255 DarkSlateGray1
+141 238 238 DarkSlateGray2
+121 205 205 DarkSlateGray3
+ 82 139 139 DarkSlateGray4
+127 255 212 aquamarine1
+118 238 198 aquamarine2
+102 205 170 aquamarine3
+ 69 139 116 aquamarine4
+193 255 193 DarkSeaGreen1
+180 238 180 DarkSeaGreen2
+155 205 155 DarkSeaGreen3
+105 139 105 DarkSeaGreen4
+ 84 255 159 SeaGreen1
+ 78 238 148 SeaGreen2
+ 67 205 128 SeaGreen3
+ 46 139 87 SeaGreen4
+154 255 154 PaleGreen1
+144 238 144 PaleGreen2
+124 205 124 PaleGreen3
+ 84 139 84 PaleGreen4
+ 0 255 127 SpringGreen1
+ 0 238 118 SpringGreen2
+ 0 205 102 SpringGreen3
+ 0 139 69 SpringGreen4
+ 0 255 0 green1
+ 0 238 0 green2
+ 0 205 0 green3
+ 0 139 0 green4
+127 255 0 chartreuse1
+118 238 0 chartreuse2
+102 205 0 chartreuse3
+ 69 139 0 chartreuse4
+192 255 62 OliveDrab1
+179 238 58 OliveDrab2
+154 205 50 OliveDrab3
+105 139 34 OliveDrab4
+202 255 112 DarkOliveGreen1
+188 238 104 DarkOliveGreen2
+162 205 90 DarkOliveGreen3
+110 139 61 DarkOliveGreen4
+255 246 143 khaki1
+238 230 133 khaki2
+205 198 115 khaki3
+139 134 78 khaki4
+255 236 139 LightGoldenrod1
+238 220 130 LightGoldenrod2
+205 190 112 LightGoldenrod3
+139 129 76 LightGoldenrod4
+255 255 224 LightYellow1
+238 238 209 LightYellow2
+205 205 180 LightYellow3
+139 139 122 LightYellow4
+255 255 0 yellow1
+238 238 0 yellow2
+205 205 0 yellow3
+139 139 0 yellow4
+255 215 0 gold1
+238 201 0 gold2
+205 173 0 gold3
+139 117 0 gold4
+255 193 37 goldenrod1
+238 180 34 goldenrod2
+205 155 29 goldenrod3
+139 105 20 goldenrod4
+255 185 15 DarkGoldenrod1
+238 173 14 DarkGoldenrod2
+205 149 12 DarkGoldenrod3
+139 101 8 DarkGoldenrod4
+255 193 193 RosyBrown1
+238 180 180 RosyBrown2
+205 155 155 RosyBrown3
+139 105 105 RosyBrown4
+255 106 106 IndianRed1
+238 99 99 IndianRed2
+205 85 85 IndianRed3
+139 58 58 IndianRed4
+255 130 71 sienna1
+238 121 66 sienna2
+205 104 57 sienna3
+139 71 38 sienna4
+255 211 155 burlywood1
+238 197 145 burlywood2
+205 170 125 burlywood3
+139 115 85 burlywood4
+255 231 186 wheat1
+238 216 174 wheat2
+205 186 150 wheat3
+139 126 102 wheat4
+255 165 79 tan1
+238 154 73 tan2
+205 133 63 tan3
+139 90 43 tan4
+255 127 36 chocolate1
+238 118 33 chocolate2
+205 102 29 chocolate3
+139 69 19 chocolate4
+255 48 48 firebrick1
+238 44 44 firebrick2
+205 38 38 firebrick3
+139 26 26 firebrick4
+255 64 64 brown1
+238 59 59 brown2
+205 51 51 brown3
+139 35 35 brown4
+255 140 105 salmon1
+238 130 98 salmon2
+205 112 84 salmon3
+139 76 57 salmon4
+255 160 122 LightSalmon1
+238 149 114 LightSalmon2
+205 129 98 LightSalmon3
+139 87 66 LightSalmon4
+255 165 0 orange1
+238 154 0 orange2
+205 133 0 orange3
+139 90 0 orange4
+255 127 0 DarkOrange1
+238 118 0 DarkOrange2
+205 102 0 DarkOrange3
+139 69 0 DarkOrange4
+255 114 86 coral1
+238 106 80 coral2
+205 91 69 coral3
+139 62 47 coral4
+255 99 71 tomato1
+238 92 66 tomato2
+205 79 57 tomato3
+139 54 38 tomato4
+255 69 0 OrangeRed1
+238 64 0 OrangeRed2
+205 55 0 OrangeRed3
+139 37 0 OrangeRed4
+255 0 0 red1
+238 0 0 red2
+205 0 0 red3
+139 0 0 red4
+255 20 147 DeepPink1
+238 18 137 DeepPink2
+205 16 118 DeepPink3
+139 10 80 DeepPink4
+255 110 180 HotPink1
+238 106 167 HotPink2
+205 96 144 HotPink3
+139 58 98 HotPink4
+255 181 197 pink1
+238 169 184 pink2
+205 145 158 pink3
+139 99 108 pink4
+255 174 185 LightPink1
+238 162 173 LightPink2
+205 140 149 LightPink3
+139 95 101 LightPink4
+255 130 171 PaleVioletRed1
+238 121 159 PaleVioletRed2
+205 104 137 PaleVioletRed3
+139 71 93 PaleVioletRed4
+255 52 179 maroon1
+238 48 167 maroon2
+205 41 144 maroon3
+139 28 98 maroon4
+255 62 150 VioletRed1
+238 58 140 VioletRed2
+205 50 120 VioletRed3
+139 34 82 VioletRed4
+255 0 255 magenta1
+238 0 238 magenta2
+205 0 205 magenta3
+139 0 139 magenta4
+255 131 250 orchid1
+238 122 233 orchid2
+205 105 201 orchid3
+139 71 137 orchid4
+255 187 255 plum1
+238 174 238 plum2
+205 150 205 plum3
+139 102 139 plum4
+224 102 255 MediumOrchid1
+209 95 238 MediumOrchid2
+180 82 205 MediumOrchid3
+122 55 139 MediumOrchid4
+191 62 255 DarkOrchid1
+178 58 238 DarkOrchid2
+154 50 205 DarkOrchid3
+104 34 139 DarkOrchid4
+155 48 255 purple1
+145 44 238 purple2
+125 38 205 purple3
+ 85 26 139 purple4
+171 130 255 MediumPurple1
+159 121 238 MediumPurple2
+137 104 205 MediumPurple3
+ 93 71 139 MediumPurple4
+255 225 255 thistle1
+238 210 238 thistle2
+205 181 205 thistle3
+139 123 139 thistle4
+ 0 0 0 gray0
+ 0 0 0 grey0
+ 3 3 3 gray1
+ 3 3 3 grey1
+ 5 5 5 gray2
+ 5 5 5 grey2
+ 8 8 8 gray3
+ 8 8 8 grey3
+ 10 10 10 gray4
+ 10 10 10 grey4
+ 13 13 13 gray5
+ 13 13 13 grey5
+ 15 15 15 gray6
+ 15 15 15 grey6
+ 18 18 18 gray7
+ 18 18 18 grey7
+ 20 20 20 gray8
+ 20 20 20 grey8
+ 23 23 23 gray9
+ 23 23 23 grey9
+ 26 26 26 gray10
+ 26 26 26 grey10
+ 28 28 28 gray11
+ 28 28 28 grey11
+ 31 31 31 gray12
+ 31 31 31 grey12
+ 33 33 33 gray13
+ 33 33 33 grey13
+ 36 36 36 gray14
+ 36 36 36 grey14
+ 38 38 38 gray15
+ 38 38 38 grey15
+ 41 41 41 gray16
+ 41 41 41 grey16
+ 43 43 43 gray17
+ 43 43 43 grey17
+ 46 46 46 gray18
+ 46 46 46 grey18
+ 48 48 48 gray19
+ 48 48 48 grey19
+ 51 51 51 gray20
+ 51 51 51 grey20
+ 54 54 54 gray21
+ 54 54 54 grey21
+ 56 56 56 gray22
+ 56 56 56 grey22
+ 59 59 59 gray23
+ 59 59 59 grey23
+ 61 61 61 gray24
+ 61 61 61 grey24
+ 64 64 64 gray25
+ 64 64 64 grey25
+ 66 66 66 gray26
+ 66 66 66 grey26
+ 69 69 69 gray27
+ 69 69 69 grey27
+ 71 71 71 gray28
+ 71 71 71 grey28
+ 74 74 74 gray29
+ 74 74 74 grey29
+ 77 77 77 gray30
+ 77 77 77 grey30
+ 79 79 79 gray31
+ 79 79 79 grey31
+ 82 82 82 gray32
+ 82 82 82 grey32
+ 84 84 84 gray33
+ 84 84 84 grey33
+ 87 87 87 gray34
+ 87 87 87 grey34
+ 89 89 89 gray35
+ 89 89 89 grey35
+ 92 92 92 gray36
+ 92 92 92 grey36
+ 94 94 94 gray37
+ 94 94 94 grey37
+ 97 97 97 gray38
+ 97 97 97 grey38
+ 99 99 99 gray39
+ 99 99 99 grey39
+102 102 102 gray40
+102 102 102 grey40
+105 105 105 gray41
+105 105 105 grey41
+107 107 107 gray42
+107 107 107 grey42
+110 110 110 gray43
+110 110 110 grey43
+112 112 112 gray44
+112 112 112 grey44
+115 115 115 gray45
+115 115 115 grey45
+117 117 117 gray46
+117 117 117 grey46
+120 120 120 gray47
+120 120 120 grey47
+122 122 122 gray48
+122 122 122 grey48
+125 125 125 gray49
+125 125 125 grey49
+127 127 127 gray50
+127 127 127 grey50
+130 130 130 gray51
+130 130 130 grey51
+133 133 133 gray52
+133 133 133 grey52
+135 135 135 gray53
+135 135 135 grey53
+138 138 138 gray54
+138 138 138 grey54
+140 140 140 gray55
+140 140 140 grey55
+143 143 143 gray56
+143 143 143 grey56
+145 145 145 gray57
+145 145 145 grey57
+148 148 148 gray58
+148 148 148 grey58
+150 150 150 gray59
+150 150 150 grey59
+153 153 153 gray60
+153 153 153 grey60
+156 156 156 gray61
+156 156 156 grey61
+158 158 158 gray62
+158 158 158 grey62
+161 161 161 gray63
+161 161 161 grey63
+163 163 163 gray64
+163 163 163 grey64
+166 166 166 gray65
+166 166 166 grey65
+168 168 168 gray66
+168 168 168 grey66
+171 171 171 gray67
+171 171 171 grey67
+173 173 173 gray68
+173 173 173 grey68
+176 176 176 gray69
+176 176 176 grey69
+179 179 179 gray70
+179 179 179 grey70
+181 181 181 gray71
+181 181 181 grey71
+184 184 184 gray72
+184 184 184 grey72
+186 186 186 gray73
+186 186 186 grey73
+189 189 189 gray74
+189 189 189 grey74
+191 191 191 gray75
+191 191 191 grey75
+194 194 194 gray76
+194 194 194 grey76
+196 196 196 gray77
+196 196 196 grey77
+199 199 199 gray78
+199 199 199 grey78
+201 201 201 gray79
+201 201 201 grey79
+204 204 204 gray80
+204 204 204 grey80
+207 207 207 gray81
+207 207 207 grey81
+209 209 209 gray82
+209 209 209 grey82
+212 212 212 gray83
+212 212 212 grey83
+214 214 214 gray84
+214 214 214 grey84
+217 217 217 gray85
+217 217 217 grey85
+219 219 219 gray86
+219 219 219 grey86
+222 222 222 gray87
+222 222 222 grey87
+224 224 224 gray88
+224 224 224 grey88
+227 227 227 gray89
+227 227 227 grey89
+229 229 229 gray90
+229 229 229 grey90
+232 232 232 gray91
+232 232 232 grey91
+235 235 235 gray92
+235 235 235 grey92
+237 237 237 gray93
+237 237 237 grey93
+240 240 240 gray94
+240 240 240 grey94
+242 242 242 gray95
+242 242 242 grey95
+245 245 245 gray96
+245 245 245 grey96
+247 247 247 gray97
+247 247 247 grey97
+250 250 250 gray98
+250 250 250 grey98
+252 252 252 gray99
+252 252 252 grey99
+255 255 255 gray100
+255 255 255 grey100
+169 169 169 dark grey
+169 169 169 DarkGrey
+169 169 169 dark gray
+169 169 169 DarkGray
+0 0 139 dark blue
+0 0 139 DarkBlue
+0 139 139 dark cyan
+0 139 139 DarkCyan
+139 0 139 dark magenta
+139 0 139 DarkMagenta
+139 0 0 dark red
+139 0 0 DarkRed
+144 238 144 light green
+144 238 144 LightGreen
diff --git a/third_party/windows/fltk-1.1.10/test/scroll.cxx b/third_party/windows/fltk-1.1.10/test/scroll.cxx
new file mode 100644
index 0000000..509eaf1
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/scroll.cxx
@@ -0,0 +1,144 @@
+//
+// "$Id: scroll.cxx 5845 2007-05-20 00:01:06Z mike $"
+//
+// Fl_Scroll test program for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2005 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 <FL/Fl.H>
+#include <FL/Fl_Double_Window.H>
+#include <FL/Fl_Scroll.H>
+#include <FL/Fl_Light_Button.H>
+#include <FL/Fl_Choice.H>
+#include <FL/Fl_Box.H>
+#include <string.h>
+#include <stdio.h>
+#include <FL/fl_draw.H>
+#include <FL/math.h>
+
+class Drawing : public Fl_Widget {
+ void draw();
+public:
+ Drawing(int X,int Y,int W,int H,const char* L) : Fl_Widget(X,Y,W,H,L) {
+ align(FL_ALIGN_TOP);
+ box(FL_FLAT_BOX);
+ color(FL_WHITE);
+ }
+};
+
+void Drawing::draw() {
+ draw_box();
+ fl_push_matrix();
+ fl_translate(x()+w()/2, y()+h()/2);
+ fl_scale(w()/2, h()/2);
+ fl_color(FL_BLACK);
+ for (int i = 0; i < 20; i++) {
+ for (int j = i+1; j < 20; j++) {
+ fl_begin_line();
+ fl_vertex(cos(M_PI*i/10+.1), sin(M_PI*i/10+.1));
+ fl_vertex(cos(M_PI*j/10+.1), sin(M_PI*j/10+.1));
+ fl_end_line();
+ }
+ }
+ fl_pop_matrix();
+}
+
+Fl_Scroll* thescroll;
+
+void box_cb(Fl_Widget* o, void*) {
+ thescroll->box(((Fl_Button*)o)->value() ? FL_DOWN_FRAME : FL_NO_BOX);
+ thescroll->redraw();
+}
+
+void type_cb(Fl_Widget*, void* v) {
+ thescroll->type((uchar)((long)v));
+ thescroll->redraw();
+}
+
+Fl_Menu_Item choices[] = {
+ {"0", 0, type_cb, (void*)0},
+ {"HORIZONTAL", 0, type_cb, (void*)Fl_Scroll::HORIZONTAL},
+ {"VERTICAL", 0, type_cb, (void*)Fl_Scroll::VERTICAL},
+ {"BOTH", 0, type_cb, (void*)Fl_Scroll::BOTH},
+ {"HORIZONTAL_ALWAYS", 0, type_cb, (void*)Fl_Scroll::HORIZONTAL_ALWAYS},
+ {"VERTICAL_ALWAYS", 0, type_cb, (void*)Fl_Scroll::VERTICAL_ALWAYS},
+ {"BOTH_ALWAYS", 0, type_cb, (void*)Fl_Scroll::BOTH_ALWAYS},
+ {0}
+};
+
+void align_cb(Fl_Widget*, void* v) {
+ thescroll->scrollbar.align((uchar)((long)v));
+ thescroll->redraw();
+}
+
+Fl_Menu_Item align_choices[] = {
+ {"left+top", 0, align_cb, (void*)(FL_ALIGN_LEFT+FL_ALIGN_TOP)},
+ {"left+bottom", 0, align_cb, (void*)(FL_ALIGN_LEFT+FL_ALIGN_BOTTOM)},
+ {"right+top", 0, align_cb, (void*)(FL_ALIGN_RIGHT+FL_ALIGN_TOP)},
+ {"right+bottom", 0, align_cb, (void*)(FL_ALIGN_RIGHT+FL_ALIGN_BOTTOM)},
+ {0}
+};
+
+int main(int argc, char** argv) {
+ Fl_Window window(5*75,400);
+ window.box(FL_NO_BOX);
+ Fl_Scroll scroll(0,0,5*75,300);
+
+ int n = 0;
+ for (int y=0; y<16; y++) for (int x=0; x<5; x++) {
+ char buf[20]; sprintf(buf,"%d",n++);
+ Fl_Button* b = new Fl_Button(x*75,y*25+(y>=8?5*75:0),75,25);
+ b->copy_label(buf);
+ b->color(n);
+ b->labelcolor(FL_WHITE);
+ }
+ Drawing drawing(0,8*25,5*75,5*75,0);
+ scroll.end();
+ window.resizable(scroll);
+
+ Fl_Box box(0,300,5*75,window.h()-300); // gray area below the scroll
+ box.box(FL_FLAT_BOX);
+
+ Fl_Light_Button but1(150, 310, 200, 25, "box");
+ but1.callback(box_cb);
+
+ Fl_Choice choice(150, 335, 200, 25, "type():");
+ choice.menu(choices);
+ choice.value(3);
+
+ Fl_Choice achoice(150, 360, 200, 25, "scrollbar.align():");
+ achoice.menu(align_choices);
+ achoice.value(3);
+
+ thescroll = &scroll;
+
+ //scroll.box(FL_DOWN_BOX);
+ //scroll.type(Fl_Scroll::VERTICAL);
+ window.end();
+ window.show(argc,argv);
+ return Fl::run();
+}
+
+//
+// End of "$Id: scroll.cxx 5845 2007-05-20 00:01:06Z mike $".
+//
diff --git a/third_party/windows/fltk-1.1.10/test/shape.cxx b/third_party/windows/fltk-1.1.10/test/shape.cxx
new file mode 100644
index 0000000..0644ef7
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/shape.cxx
@@ -0,0 +1,117 @@
+//
+// "$Id: shape.cxx 5845 2007-05-20 00:01:06Z mike $"
+//
+// Tiny OpenGL demo program for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2005 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 <FL/Fl.H>
+#include <FL/Fl_Window.H>
+#include <FL/Fl_Hor_Slider.H>
+#include <FL/math.h>
+
+#if HAVE_GL
+
+#include <FL/gl.h>
+#include <FL/Fl_Gl_Window.H>
+
+class shape_window : public Fl_Gl_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) :
+Fl_Gl_Window(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 j=0; j<sides; j++) {
+ double ang = j*2*M_PI/sides;
+ glVertex3f(cos(ang),sin(ang),0);
+ }
+ glEnd();
+}
+
+#else
+
+#include <FL/Fl_Box.H>
+class shape_window : public Fl_Box {
+public:
+ int sides;
+ shape_window(int x,int y,int w,int h,const char *l=0)
+ :Fl_Box(FL_DOWN_BOX,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(Fl_Widget *o, void *p) {
+ shape_window *sw = (shape_window *)p;
+ sw->sides = int(((Fl_Slider *)o)->value());
+ sw->redraw();
+}
+
+int main(int argc, char **argv) {
+
+ Fl_Window window(300, 330);
+
+// 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:
+ Fl_Hor_Slider slider(50, 295, window.w()-60, 30, "Sides:");
+ slider.align(FL_ALIGN_LEFT);
+ slider.callback(sides_cb,&sw);
+ slider.value(sw.sides);
+ slider.step(1);
+ slider.bounds(3,40);
+
+ window.end();
+ window.show(argc,argv);
+
+ return Fl::run();
+}
+
+//
+// End of "$Id: shape.cxx 5845 2007-05-20 00:01:06Z mike $".
+//
diff --git a/third_party/windows/fltk-1.1.10/test/subwindow.cxx b/third_party/windows/fltk-1.1.10/test/subwindow.cxx
new file mode 100644
index 0000000..8ade788
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/subwindow.cxx
@@ -0,0 +1,191 @@
+//
+// "$Id: subwindow.cxx 6547 2008-12-06 11:15:29Z AlbrechtS $"
+//
+// 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-2005 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_Toggle_Button.H>
+#include <FL/Fl_Menu_Button.H>
+#include <FL/Fl_Box.H>
+#include <FL/Fl_Input.H>
+
+#ifdef DEBUG
+#include <FL/names.h>
+#endif
+
+// Define DEBUG_POS for a subwindow positioning test. This will draw
+// the last typed character at the cursor position, if no input widget
+// currently has the focus.
+// Note: The typed character is saved in the derived testwindow class,
+// regardless of the definition of DEBUG_POS. Only drawing the character
+// depends on this define.
+
+#ifdef DEBUG_POS
+#include <FL/fl_draw.H>
+#endif
+
+class EnterExit : public Fl_Box {
+ int handle(int);
+public:
+ EnterExit(int x, int y, int w, int h, const char *l) : Fl_Box(FL_BORDER_BOX,x,y,w,h,l) {}
+};
+
+int EnterExit::handle(int e) {
+ if (e == FL_ENTER) {color(FL_RED); redraw(); return 1;}
+ else if (e == FL_LEAVE) {color(FL_GRAY); redraw(); return 1;}
+ else return 0;
+}
+
+class testwindow : public Fl_Window {
+ int handle(int);
+ void draw();
+ int cx, cy; char key;
+ Fl_Cursor crsr;
+public:
+ testwindow(Fl_Boxtype b,int x,int y,const char *l)
+ : Fl_Window(x,y,l), crsr(FL_CURSOR_DEFAULT) {box(b); key = 0;}
+ testwindow(Fl_Boxtype b,int x,int y,int w,int h,const char *l)
+ : Fl_Window(x,y,w,h,l) {box(b); key = 0;}
+ void use_cursor(Fl_Cursor c) { crsr = c; }
+};
+
+void testwindow::draw() {
+#ifdef DEBUG
+ printf("%s : draw\n",label());
+#endif
+ Fl_Window::draw();
+#ifdef DEBUG_POS
+ if (key) fl_draw(&key, 1, cx, cy);
+#endif
+}
+
+int testwindow::handle(int e) {
+#ifdef DEBUG
+ if (e != FL_MOVE) printf("%s : %s\n",label(),fl_eventnames[e]);
+#endif
+ if (crsr!=FL_CURSOR_DEFAULT) {
+ if (e == FL_ENTER)
+ cursor(crsr);
+ if (e == FL_LEAVE)
+ cursor(FL_CURSOR_DEFAULT);
+ }
+ if (Fl_Window::handle(e)) return 1;
+ if (e == FL_FOCUS) return 1;
+ if (e == FL_PUSH) {Fl::focus(this); return 1;}
+ if (e == FL_KEYBOARD && Fl::event_text()[0]) {
+ key = Fl::event_text()[0];
+ cx = Fl::event_x();
+ cy = Fl::event_y();
+ redraw();
+ return 1;
+ }
+ return 0;
+}
+
+Fl_Menu_Button* popup;
+
+const char* bigmess =
+#if 1
+"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 argc, char **argv) {
+ testwindow *window =
+ new testwindow(FL_UP_BOX,400,400,"outer");
+ new Fl_Toggle_Button(310,310,80,80,"&outer");
+ new EnterExit(10,310,80,80,"enterexit");
+ new Fl_Input(160,310,140,25,"input1:");
+ new Fl_Input(160,340,140,25,"input2:");
+ (new Fl_Menu_Button(5,150,80,25,"menu&1"))->add(bigmess);
+ testwindow *subwindow =
+ new testwindow(FL_DOWN_BOX,100,100,200,200,"inner");
+ new Fl_Toggle_Button(110,110,80,80,"&inner");
+ new EnterExit(10,110,80,80,"enterexit");
+ (new Fl_Menu_Button(50,20,80,25,"menu&2"))->add(bigmess);
+ new Fl_Input(55,50,140,25,"input1:");
+ new Fl_Input(55,80,140,25,"input2:");
+ subwindow->resizable(subwindow);
+ window->resizable(subwindow);
+ subwindow->end();
+ subwindow->use_cursor(FL_CURSOR_HAND);
+ (new Fl_Box(FL_NO_BOX,0,0,400,100,
+ "A child Fl_Window with children of it's own may "
+ "be useful for imbedding controls into a GL or display "
+ "that needs a different visual. There are bugs with the "
+ "origins being different between drawing and events, "
+ "which I hope I have solved."
+ )) -> align(FL_ALIGN_WRAP);
+ popup = new Fl_Menu_Button(0,0,400,400);
+ popup->type(Fl_Menu_Button::POPUP3);
+ popup->add("This|is|a popup|menu");
+ popup->add(bigmess);
+ window->show(argc, argv);
+ return Fl::run();
+}
+
+//
+// End of "$Id: subwindow.cxx 6547 2008-12-06 11:15:29Z AlbrechtS $".
+//
diff --git a/third_party/windows/fltk-1.1.10/test/sudoku.app/Contents/Info.plist b/third_party/windows/fltk-1.1.10/test/sudoku.app/Contents/Info.plist
new file mode 100644
index 0000000..306606a
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/sudoku.app/Contents/Info.plist
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<plist version="0.9">
+ <dict>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+
+ <key>CFBundleExecutable</key>
+ <string>sudoku</string>
+
+ <key>CFBundleIdentifier</key>
+ <string>org.fltk.sudoku</string>
+
+ <key>CFBundleVersion</key>
+ <string>1.0</string>
+
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+
+ <key>NSHumanReadableCopyright</key>
+ <string>Copyright 2005-2006 by Michael Sweet</string>
+
+ <key>CFAppleHelpAnchor</key>
+ <string>help</string>
+
+ <key>CFBundleName</key>
+ <string>sudoku</string>
+
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+
+ <key>CFBundleSignature</key>
+ <string>FLSU</string>
+
+ <key>CFBundleIconFile</key>
+ <string>sudoku.icns</string>
+
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+
+ <key>CFBundleGetInfoString</key>
+ <string>1.0, Copyright 2005-2006 by Michael Sweet</string>
+
+ </dict>
+</plist>
diff --git a/third_party/windows/fltk-1.1.10/test/sudoku.app/Contents/PkgInfo b/third_party/windows/fltk-1.1.10/test/sudoku.app/Contents/PkgInfo
new file mode 100644
index 0000000..ffeeb7d
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/sudoku.app/Contents/PkgInfo
@@ -0,0 +1 @@
+FLSUFlsu
diff --git a/third_party/windows/fltk-1.1.10/test/sudoku.app/Contents/Resources/sudoku.icns b/third_party/windows/fltk-1.1.10/test/sudoku.app/Contents/Resources/sudoku.icns
new file mode 100644
index 0000000..9541d42
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/sudoku.app/Contents/Resources/sudoku.icns
Binary files differ
diff --git a/third_party/windows/fltk-1.1.10/test/sudoku.cxx b/third_party/windows/fltk-1.1.10/test/sudoku.cxx
new file mode 100644
index 0000000..79fc935
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/sudoku.cxx
@@ -0,0 +1,1335 @@
+//
+// "$Id: sudoku.cxx 6973 2009-12-21 16:35:06Z AlbrechtS $"
+//
+// Sudoku game using the Fast Light Tool Kit (FLTK).
+//
+// Copyright 2005-2007 by Michael Sweet.
+//
+// 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 <FL/Fl.H>
+#include <FL/Enumerations.H>
+#include <FL/Fl_Window.H>
+#include <FL/Fl_Button.H>
+#include <FL/Fl_Group.H>
+#include <FL/fl_ask.H>
+#include <FL/fl_draw.H>
+#include <FL/Fl_Help_Dialog.H>
+#include <FL/Fl_Preferences.H>
+#include <FL/Fl_Sys_Menu_Bar.H>
+#include <FL/x.H>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include <FL/math.h>
+
+#ifdef WIN32
+# include "sudokurc.h"
+#elif !defined(__APPLE__)
+# include "pixmaps/sudoku.xbm"
+#endif // WIN32
+
+// Audio headers...
+#include <config.h>
+
+#ifndef WIN32
+# include <unistd.h>
+#endif // !WIN32
+
+#ifdef HAVE_ALSA_ASOUNDLIB_H
+# define ALSA_PCM_NEW_HW_PARAMS_API
+# include <alsa/asoundlib.h>
+#endif // HAVE_ALSA_ASOUNDLIB_H
+#ifdef __APPLE__
+# include <CoreAudio/AudioHardware.h>
+#endif // __APPLE__
+#ifdef WIN32
+# include <mmsystem.h>
+#endif // WIN32
+
+
+//
+// Default sizes...
+//
+
+#define GROUP_SIZE 160
+#define CELL_SIZE 50
+#define CELL_OFFSET 5
+#ifdef __APPLE__
+# define MENU_OFFSET 0
+#else
+# define MENU_OFFSET 25
+#endif // __APPLE__
+
+// Sound class for Sudoku...
+//
+// There are MANY ways to implement sound in a FLTK application.
+// The approach we are using here is to conditionally compile OS-
+// specific code into the application - CoreAudio for MacOS X, the
+// standard Win32 API stuff for Windows, ALSA or X11 for Linux, and
+// X11 for all others. We have to support ALSA on Linux because the
+// current Xorg releases no longer support XBell() or the PC speaker.
+//
+// There are several good cross-platform audio libraries we could also
+// use, such as OpenAL, PortAudio, and SDL, however they were not chosen
+// for this application because of our limited use of sound.
+//
+// Many thanks to Ian MacArthur who provided sample code that led to
+// the CoreAudio implementation you see here!
+class SudokuSound {
+ // Private, OS-specific data...
+#ifdef __APPLE__
+ AudioDeviceID device;
+ AudioStreamBasicDescription format;
+ short *data;
+ int remaining;
+
+ static OSStatus audio_cb(AudioDeviceID device,
+ const AudioTimeStamp *current_time,
+ const AudioBufferList *data_in,
+ const AudioTimeStamp *time_in,
+ AudioBufferList *data_out,
+ const AudioTimeStamp *time_out,
+ void *client_data);
+#elif defined(WIN32)
+ HWAVEOUT device;
+ HGLOBAL header_handle;
+ LPWAVEHDR header_ptr;
+ HGLOBAL data_handle;
+ LPSTR data_ptr;
+
+#else
+# ifdef HAVE_ALSA_ASOUNDLIB_H
+ snd_pcm_t *handle;
+# endif // HAVE_ALSA_ASOUNDLIB_H
+#endif // __APPLE__
+
+ // Common data...
+ static int frequencies[9];
+ static short *sample_data[9];
+ static int sample_size;
+
+ public:
+
+ SudokuSound();
+ ~SudokuSound();
+
+ void play(char note);
+};
+
+
+// Sudoku cell class...
+class SudokuCell : public Fl_Widget {
+ bool readonly_;
+ int value_;
+ int test_value_[9];
+
+ public:
+
+ SudokuCell(int X, int Y, int W, int H);
+ void draw();
+ int handle(int event);
+ void readonly(bool r) { readonly_ = r; redraw(); }
+ bool readonly() const { return readonly_; }
+ void test_value(int v, int n) { test_value_[n] = v; redraw(); }
+ int test_value(int n) const { return test_value_[n]; }
+ void value(int v) {
+ value_ = v;
+ for (int i = 0; i < 8; i ++) test_value_[i] = 0;
+ redraw();
+ }
+ int value() const { return value_; }
+};
+
+
+// Sudoku window class...
+class Sudoku : public Fl_Window {
+ Fl_Sys_Menu_Bar *menubar_;
+ Fl_Group *grid_;
+ time_t seed_;
+ char grid_values_[9][9];
+ SudokuCell *grid_cells_[9][9];
+ Fl_Group *grid_groups_[3][3];
+ int difficulty_;
+ SudokuSound *sound_;
+
+ static void check_cb(Fl_Widget *widget, void *);
+ static void close_cb(Fl_Widget *widget, void *);
+ static void diff_cb(Fl_Widget *widget, void *d);
+ static void update_helpers_cb(Fl_Widget *, void *);
+ static void help_cb(Fl_Widget *, void *);
+ static void mute_cb(Fl_Widget *widget, void *);
+ static void new_cb(Fl_Widget *widget, void *);
+ static void reset_cb(Fl_Widget *widget, void *);
+ static void restart_cb(Fl_Widget *widget, void *);
+ void set_title();
+ static void solve_cb(Fl_Widget *widget, void *);
+
+ static Fl_Help_Dialog *help_dialog_;
+ static Fl_Preferences prefs_;
+ public:
+
+ Sudoku();
+ ~Sudoku();
+
+ void check_game(bool highlight = true);
+ void load_game();
+ void new_game(time_t seed);
+ int next_value(SudokuCell *c);
+ void resize(int X, int Y, int W, int H);
+ void save_game();
+ void solve_game();
+ void update_helpers();
+};
+
+
+// Sound class globals...
+int SudokuSound::frequencies[9] = {
+ 880, // A(5)
+ 988, // B(5)
+ 1046, // C(5)
+ 1174, // D(5)
+ 1318, // E(5)
+ 1396, // F(5)
+ 1568, // G(5)
+ 1760, // H (A6)
+ 1976 // I (B6)
+};
+short *SudokuSound::sample_data[9] = { 0 };
+int SudokuSound::sample_size = 0;
+
+
+// Initialize the SudokuSound class
+SudokuSound::SudokuSound() {
+ sample_size = 0;
+
+#ifdef __APPLE__
+ remaining = 0;
+
+ UInt32 size = sizeof(device);
+
+ if (AudioHardwareGetProperty(kAudioHardwarePropertyDefaultOutputDevice,
+ &size, (void *)&device) != noErr) return;
+
+ size = sizeof(format);
+ if (AudioDeviceGetProperty(device, 0, false, kAudioDevicePropertyStreamFormat,
+ &size, &format) != noErr) return;
+
+ // Set up a format we like...
+ format.mSampleRate = 44100.0; // 44.1kHz
+ format.mChannelsPerFrame = 2; // stereo
+
+ if (AudioDeviceSetProperty(device, NULL, 0, false,
+ kAudioDevicePropertyStreamFormat,
+ sizeof(format), &format) != noErr) return;
+
+ // Check we got linear pcm - what to do if we did not ???
+ if (format.mFormatID != kAudioFormatLinearPCM) return;
+
+ // Attach the callback
+ if (AudioDeviceAddIOProc(device, audio_cb, (void *)this) != noErr) return;
+
+ // Start the device...
+ AudioDeviceStart(device, audio_cb);
+
+ sample_size = (int)format.mSampleRate / 20;
+
+#elif defined(WIN32)
+ WAVEFORMATEX format;
+
+ memset(&format, 0, sizeof(format));
+ format.cbSize = sizeof(format);
+ format.wFormatTag = WAVE_FORMAT_PCM;
+ format.nChannels = 2;
+ format.nSamplesPerSec = 44100;
+ format.nAvgBytesPerSec = 44100 * 4;
+ format.nBlockAlign = 4;
+ format.wBitsPerSample = 16;
+
+ data_handle = GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE, format.nSamplesPerSec / 5);
+ if (!data_handle) return;
+
+ data_ptr = (LPSTR)GlobalLock(data_handle);
+
+ header_handle = GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE, sizeof(WAVEHDR));
+ if (!header_handle) return;
+
+ header_ptr = (WAVEHDR *)GlobalLock(header_handle);
+
+ header_ptr->lpData = data_ptr;
+ header_ptr->dwBufferLength = format.nSamplesPerSec / 5;
+ header_ptr->dwFlags = 0;
+ header_ptr->dwLoops = 0;
+
+ if (waveOutOpen(&device, WAVE_MAPPER, &format, 0, 0, WAVE_ALLOWSYNC)
+ != MMSYSERR_NOERROR) return;
+
+ waveOutPrepareHeader(device, header_ptr, sizeof(WAVEHDR));
+
+ sample_size = 44100 / 20;
+
+#else
+# ifdef HAVE_ALSA_ASOUNDLIB_H
+ handle = NULL;
+
+ if (snd_pcm_open(&handle, "default", SND_PCM_STREAM_PLAYBACK, 0) >= 0) {
+ // Initialize PCM sound stuff...
+ snd_pcm_hw_params_t *params;
+
+ snd_pcm_hw_params_alloca(&params);
+ snd_pcm_hw_params_any(handle, params);
+ snd_pcm_hw_params_set_access(handle, params, SND_PCM_ACCESS_RW_INTERLEAVED);
+ snd_pcm_hw_params_set_format(handle, params, SND_PCM_FORMAT_S16);
+ snd_pcm_hw_params_set_channels(handle, params, 2);
+ unsigned rate = 44100;
+ int dir;
+ snd_pcm_hw_params_set_rate_near(handle, params, &rate, &dir);
+ snd_pcm_uframes_t period = (int)rate / 4;
+ snd_pcm_hw_params_set_period_size_near(handle, params, &period, &dir);
+
+ sample_size = rate / 20;
+
+ if (snd_pcm_hw_params(handle, params) < 0) {
+ sample_size = 0;
+ snd_pcm_close(handle);
+ handle = NULL;
+ }
+ }
+# endif // HAVE_ALSA_ASOUNDLIB_H
+#endif // __APPLE__
+
+ if (sample_size) {
+ // Make each of the notes using a combination of sine and sawtooth waves
+ int attack = sample_size / 10;
+ int decay = 4 * sample_size / 5;
+
+ for (int i = 0; i < 9; i ++) {
+ sample_data[i] = new short[2 * sample_size];
+
+ short *sample_ptr = sample_data[i];
+
+ for (int j = 0; j < sample_size; j ++, sample_ptr += 2) {
+ double theta = 0.05 * frequencies[i] * j / sample_size;
+ double val = 0.5 * sin(2.0 * M_PI * theta) + theta - (int)theta - 0.5;
+
+ if (j < attack) {
+ *sample_ptr = (int)(32767 * val * j / attack);
+ } else if (j > decay) {
+ *sample_ptr = (int)(32767 * val * (sample_size - j + decay) /
+ sample_size);
+ } else *sample_ptr = (int)(32767 * val);
+
+ sample_ptr[1] = *sample_ptr;
+ }
+ }
+ }
+}
+
+
+// Cleanup the SudokuSound class
+SudokuSound::~SudokuSound() {
+#ifdef __APPLE__
+ if (sample_size) {
+ AudioDeviceStop(device, audio_cb);
+ AudioDeviceRemoveIOProc(device, audio_cb);
+ }
+
+#elif defined(WIN32)
+ if (sample_size) {
+ waveOutClose(device);
+
+ GlobalUnlock(header_handle);
+ GlobalFree(header_handle);
+
+ GlobalUnlock(data_handle);
+ GlobalFree(data_handle);
+ }
+
+#else
+# ifdef HAVE_ALSA_ASOUNDLIB_H
+ if (handle) {
+ snd_pcm_drain(handle);
+ snd_pcm_close(handle);
+ }
+# endif // HAVE_ALSA_ASOUNDLIB_H
+#endif // __APPLE__
+
+ if (sample_size) {
+ for (int i = 0; i < 9; i ++) {
+ delete[] sample_data[i];
+ }
+ }
+}
+
+
+#ifdef __APPLE__
+// Callback function for writing audio data...
+OSStatus
+SudokuSound::audio_cb(AudioDeviceID device,
+ const AudioTimeStamp *current_time,
+ const AudioBufferList *data_in,
+ const AudioTimeStamp *time_in,
+ AudioBufferList *data_out,
+ const AudioTimeStamp *time_out,
+ void *client_data) {
+ SudokuSound *ss = (SudokuSound *)client_data;
+ int count;
+ float *buffer;
+
+ if (!ss->remaining) return noErr;
+
+ for (count = data_out->mBuffers[0].mDataByteSize / sizeof(float),
+ buffer = (float*) data_out->mBuffers[0].mData;
+ ss->remaining > 0 && count > 0;
+ count --, ss->data ++, ss->remaining --) {
+ *buffer++ = *(ss->data) / 32767.0;
+ }
+
+ while (count > 0) {
+ *buffer++ = 0.0;
+ count --;
+ }
+
+ return noErr;
+}
+#endif // __APPLE__
+
+
+// Play a note for 250ms...
+void SudokuSound::play(char note) {
+ Fl::check();
+
+#ifdef __APPLE__
+ // Point to the next note...
+ data = sample_data[note - 'A'];
+ remaining = sample_size * 2;
+
+ // Wait for the sound to complete...
+ usleep(50000);
+
+#elif defined(WIN32)
+ if (sample_size) {
+ memcpy(data_ptr, sample_data[note - 'A'], sample_size * 4);
+
+ waveOutWrite(device, header_ptr, sizeof(WAVEHDR));
+
+ Sleep(50);
+ } else Beep(frequencies[note - 'A'], 50);
+
+#else
+# ifdef HAVE_ALSA_ASOUNDLIB_H
+ if (handle) {
+ // Use ALSA to play the sound...
+ if (snd_pcm_writei(handle, sample_data[note - 'A'], sample_size) < 0) {
+ snd_pcm_prepare(handle);
+ snd_pcm_writei(handle, sample_data[note - 'A'], sample_size);
+ }
+ usleep(50000);
+ return;
+ }
+# endif // HAVE_ALSA_ASOUNDLIB_H
+
+ // Just use standard X11 stuff...
+ XKeyboardState state;
+ XKeyboardControl control;
+
+ // Get original pitch and duration...
+ XGetKeyboardControl(fl_display, &state);
+
+ // Sound a tone for the given note...
+ control.bell_percent = 100;
+ control.bell_pitch = frequencies[note - 'A'];
+ control.bell_duration = 50;
+
+ XChangeKeyboardControl(fl_display,
+ KBBellPercent | KBBellPitch | KBBellDuration,
+ &control);
+ XBell(fl_display, 100);
+ XFlush(fl_display);
+
+ // Restore original pitch and duration...
+ control.bell_percent = state.bell_percent;
+ control.bell_pitch = state.bell_pitch;
+ control.bell_duration = state.bell_duration;
+
+ XChangeKeyboardControl(fl_display,
+ KBBellPercent | KBBellPitch | KBBellDuration,
+ &control);
+#endif // __APPLE__
+}
+
+
+// Create a cell widget
+SudokuCell::SudokuCell(int X, int Y, int W, int H)
+ : Fl_Widget(X, Y, W, H, 0) {
+ value(0);
+}
+
+
+// Draw cell
+void
+SudokuCell::draw() {
+ static Fl_Align align[8] = {
+ FL_ALIGN_TOP_LEFT,
+ FL_ALIGN_TOP,
+ FL_ALIGN_TOP_RIGHT,
+ FL_ALIGN_RIGHT,
+ FL_ALIGN_BOTTOM_RIGHT,
+ FL_ALIGN_BOTTOM,
+ FL_ALIGN_BOTTOM_LEFT,
+ FL_ALIGN_LEFT
+ };
+
+
+ // Draw the cell box...
+ if (readonly()) fl_draw_box(FL_UP_BOX, x(), y(), w(), h(), color());
+ else fl_draw_box(FL_DOWN_BOX, x(), y(), w(), h(), color());
+
+ // Draw the cell background...
+ if (Fl::focus() == this) {
+ Fl_Color c = fl_color_average(FL_SELECTION_COLOR, color(), 0.5f);
+ fl_color(c);
+ fl_rectf(x() + 4, y() + 4, w() - 8, h() - 8);
+ fl_color(fl_contrast(labelcolor(), c));
+ } else fl_color(labelcolor());
+
+ // Draw the cell value...
+ char s[2];
+
+ s[1] = '\0';
+
+ if (value_) {
+ s[0] = value_ + '0';
+
+ fl_font(FL_HELVETICA_BOLD, h() - 10);
+ fl_draw(s, x(), y(), w(), h(), FL_ALIGN_CENTER);
+ }
+
+ fl_font(FL_HELVETICA_BOLD, h() / 5);
+
+ for (int i = 0; i < 8; i ++) {
+ if (test_value_[i]) {
+ s[0] = test_value_[i] + '0';
+ fl_draw(s, x() + 5, y() + 5, w() - 10, h() - 10, align[i]);
+ }
+ }
+}
+
+
+// Handle events in cell
+int
+SudokuCell::handle(int event) {
+ switch (event) {
+ case FL_FOCUS :
+ Fl::focus(this);
+ redraw();
+ return 1;
+
+ case FL_UNFOCUS :
+ redraw();
+ return 1;
+
+ case FL_PUSH :
+ if (!readonly() && Fl::event_inside(this)) {
+ if (Fl::event_clicks()) {
+ // 2+ clicks increments/sets value
+ if (value()) {
+ if (value() < 9) value(value() + 1);
+ else value(1);
+ } else value(((Sudoku *)window())->next_value(this));
+ }
+
+ Fl::focus(this);
+ redraw();
+ return 1;
+ }
+ break;
+
+ case FL_KEYDOWN :
+ if (Fl::event_state() & FL_CTRL) break;
+ int key = Fl::event_key() - '0';
+ if (key < 0 || key > 9) key = Fl::event_key() - FL_KP - '0';
+ if (key > 0 && key <= 9) {
+ if (readonly()) {
+ fl_beep(FL_BEEP_ERROR);
+ return 1;
+ }
+
+ if (Fl::event_state() & (FL_SHIFT | FL_CAPS_LOCK)) {
+ int i;
+
+ for (i = 0; i < 8; i ++)
+ if (test_value_[i] == key) {
+ test_value_[i] = 0;
+ break;
+ }
+
+ if (i >= 8) {
+ for (i = 0; i < 8; i ++)
+ if (!test_value_[i]) {
+ test_value_[i] = key;
+ break;
+ }
+ }
+
+ if (i >= 8) {
+ for (i = 0; i < 7; i ++) test_value_[i] = test_value_[i + 1];
+ test_value_[i] = key;
+ }
+
+ redraw();
+ } else {
+ value(key);
+ do_callback();
+ }
+ return 1;
+ } else if (key == 0 || Fl::event_key() == FL_BackSpace ||
+ Fl::event_key() == FL_Delete) {
+ if (readonly()) {
+ fl_beep(FL_BEEP_ERROR);
+ return 1;
+ }
+
+ value(0);
+ do_callback();
+ return 1;
+ }
+ break;
+ }
+
+ return Fl_Widget::handle(event);
+}
+
+
+// Sudoku class globals...
+Fl_Help_Dialog *Sudoku::help_dialog_ = (Fl_Help_Dialog *)0;
+Fl_Preferences Sudoku::prefs_(Fl_Preferences::USER, "fltk.org", "sudoku");
+
+
+// Create a Sudoku game window...
+Sudoku::Sudoku()
+ : Fl_Window(GROUP_SIZE * 3, GROUP_SIZE * 3 + MENU_OFFSET, "Sudoku")
+{
+ int j, k;
+ Fl_Group *g;
+ SudokuCell *cell;
+ static Fl_Menu_Item items[] = {
+ { "&Game", 0, 0, 0, FL_SUBMENU },
+ { "&New Game", FL_COMMAND | 'n', new_cb, 0, FL_MENU_DIVIDER },
+ { "&Check Game", FL_COMMAND | 'c', check_cb, 0, 0 },
+ { "&Restart Game", FL_COMMAND | 'r', restart_cb, 0, 0 },
+ { "&Solve Game", FL_COMMAND | 's', solve_cb, 0, FL_MENU_DIVIDER },
+ { "&Update Helpers", 0, update_helpers_cb, 0, 0 },
+ { "&Mute Sound", FL_COMMAND | 'm', mute_cb, 0, FL_MENU_TOGGLE | FL_MENU_DIVIDER },
+ { "&Quit", FL_COMMAND | 'q', close_cb, 0, 0 },
+ { 0 },
+ { "&Difficulty", 0, 0, 0, FL_SUBMENU },
+ { "&Easy", 0, diff_cb, (void *)"0", FL_MENU_RADIO },
+ { "&Medium", 0, diff_cb, (void *)"1", FL_MENU_RADIO },
+ { "&Hard", 0, diff_cb, (void *)"2", FL_MENU_RADIO },
+ { "&Impossible", 0, diff_cb, (void *)"3", FL_MENU_RADIO },
+ { 0 },
+ { "&Help", 0, 0, 0, FL_SUBMENU },
+ { "&About Sudoku", FL_F + 1, help_cb, 0, 0 },
+ { 0 },
+ { 0 }
+ };
+
+
+ // Setup sound output...
+ prefs_.get("mute_sound", j, 0);
+ if (j) {
+ // Mute sound?
+ sound_ = NULL;
+ items[6].flags |= FL_MENU_VALUE;
+ } else sound_ = new SudokuSound();
+
+ // Menubar...
+ prefs_.get("difficulty", difficulty_, 0);
+ if (difficulty_ < 0 || difficulty_ > 3) difficulty_ = 0;
+
+ items[10 + difficulty_].flags |= FL_MENU_VALUE;
+
+ menubar_ = new Fl_Sys_Menu_Bar(0, 0, 3 * GROUP_SIZE, 25);
+ menubar_->menu(items);
+
+ // Create the grids...
+ grid_ = new Fl_Group(0, MENU_OFFSET, 3 * GROUP_SIZE, 3 * GROUP_SIZE);
+
+ for (j = 0; j < 3; j ++)
+ for (k = 0; k < 3; k ++) {
+ g = new Fl_Group(k * GROUP_SIZE, j * GROUP_SIZE + MENU_OFFSET,
+ GROUP_SIZE, GROUP_SIZE);
+ g->box(FL_BORDER_BOX);
+ if ((int)(j == 1) ^ (int)(k == 1)) g->color(FL_DARK3);
+ else g->color(FL_DARK2);
+ g->end();
+
+ grid_groups_[j][k] = g;
+ }
+
+ for (j = 0; j < 9; j ++)
+ for (k = 0; k < 9; k ++) {
+ cell = new SudokuCell(k * CELL_SIZE + CELL_OFFSET +
+ (k / 3) * (GROUP_SIZE - 3 * CELL_SIZE),
+ j * CELL_SIZE + CELL_OFFSET + MENU_OFFSET +
+ (j / 3) * (GROUP_SIZE - 3 * CELL_SIZE),
+ CELL_SIZE, CELL_SIZE);
+ cell->callback(reset_cb);
+ grid_cells_[j][k] = cell;
+ }
+
+ // Set icon for window (MacOS uses app bundle for icon...)
+#ifdef WIN32
+ icon((char *)LoadIcon(fl_display, MAKEINTRESOURCE(IDI_ICON)));
+#elif !defined(__APPLE__)
+ fl_open_display();
+ icon((char *)XCreateBitmapFromData(fl_display, DefaultRootWindow(fl_display),
+ (char *)sudoku_bits, sudoku_width,
+ sudoku_height));
+#endif // WIN32
+
+ // Catch window close events...
+ callback(close_cb);
+
+ // Make the window resizable...
+ resizable(grid_);
+ size_range(3 * GROUP_SIZE, 3 * GROUP_SIZE + MENU_OFFSET, 0, 0, 5, 5, 1);
+
+ // Restore the previous window dimensions...
+ int X, Y, W, H;
+
+ if (prefs_.get("x", X, -1)) {
+ prefs_.get("y", Y, -1);
+ prefs_.get("width", W, 3 * GROUP_SIZE);
+ prefs_.get("height", H, 3 * GROUP_SIZE + MENU_OFFSET);
+
+ resize(X, Y, W, H);
+ }
+
+ set_title();
+}
+
+
+// Destroy the sudoku window...
+Sudoku::~Sudoku() {
+ if (sound_) delete sound_;
+}
+
+
+// Check for a solution to the game...
+void
+Sudoku::check_cb(Fl_Widget *widget, void *) {
+ ((Sudoku *)(widget->window()))->check_game();
+}
+
+
+// Check if the user has correctly solved the game...
+void
+Sudoku::check_game(bool highlight) {
+ bool empty = false;
+ bool correct = true;
+ int j, k, m;
+
+ // Check the game for right/wrong answers...
+ for (j = 0; j < 9; j ++)
+ for (k = 0; k < 9; k ++) {
+ SudokuCell *cell = grid_cells_[j][k];
+ int val = cell->value();
+
+ if (cell->readonly()) continue;
+
+ if (!val) empty = true;
+ else {
+ for (m = 0; m < 9; m ++)
+ if ((j != m && grid_cells_[m][k]->value() == val) ||
+ (k != m && grid_cells_[j][m]->value() == val)) break;
+
+ if (m < 9) {
+ if (highlight) {
+ cell->color(FL_YELLOW);
+ cell->redraw();
+ }
+
+ correct = false;
+ } else if (highlight) {
+ cell->color(FL_LIGHT3);
+ cell->redraw();
+ }
+ }
+ }
+
+ // Check subgrids for duplicate numbers...
+ for (j = 0; j < 9; j += 3)
+ for (k = 0; k < 9; k += 3)
+ for (int jj = 0; jj < 3; jj ++)
+ for (int kk = 0; kk < 3; kk ++) {
+ SudokuCell *cell = grid_cells_[j + jj][k + kk];
+ int val = cell->value();
+
+ if (cell->readonly() || !val) continue;
+
+ int jjj;
+
+ for (jjj = 0; jjj < 3; jjj ++) {
+ int kkk;
+
+ for (kkk = 0; kkk < 3; kkk ++)
+ if (jj != jjj && kk != kkk &&
+ grid_cells_[j + jjj][k + kkk]->value() == val) break;
+
+ if (kkk < 3) break;
+ }
+
+ if (jjj < 3) {
+ if (highlight) {
+ cell->color(FL_YELLOW);
+ cell->redraw();
+ }
+
+ correct = false;
+ }
+ }
+
+ if (!empty && correct) {
+ // Success!
+ for (j = 0; j < 9; j ++) {
+ for (k = 0; k < 9; k ++) {
+ SudokuCell *cell = grid_cells_[j][k];
+ cell->color(FL_GREEN);
+ cell->readonly(1);
+ }
+
+ if (sound_) sound_->play('A' + grid_cells_[j][8]->value() - 1);
+ }
+ }
+}
+
+
+// Close the window, saving the game first...
+void
+Sudoku::close_cb(Fl_Widget *widget, void *) {
+ Sudoku *s = (Sudoku *)(widget->window() ? widget->window() : widget);
+
+ s->save_game();
+ s->hide();
+
+ if (help_dialog_) help_dialog_->hide();
+}
+
+
+// Set the level of difficulty...
+void
+Sudoku::diff_cb(Fl_Widget *widget, void *d) {
+ Sudoku *s = (Sudoku *)(widget->window() ? widget->window() : widget);
+ int diff = atoi((char *)d);
+
+ if (diff != s->difficulty_) {
+ s->difficulty_ = diff;
+ s->new_game(s->seed_);
+ s->set_title();
+
+ if (diff > 1)
+ {
+ // Display a message about the higher difficulty levels for the
+ // Sudoku zealots of the world...
+ int val;
+
+ prefs_.get("difficulty_warning", val, 0);
+
+ if (!val)
+ {
+ prefs_.set("difficulty_warning", 1);
+ fl_alert("Note: 'Hard' and 'Impossible' puzzles may have more than "
+ "one possible solution.\n"
+ "This is not an error or bug.");
+ }
+ }
+
+ prefs_.set("difficulty", s->difficulty_);
+ }
+}
+
+// Update the little marker numbers in all cells
+void
+Sudoku::update_helpers_cb(Fl_Widget *widget, void *) {
+ Sudoku *s = (Sudoku *)(widget->window() ? widget->window() : widget);
+ s->update_helpers();
+}
+
+void
+Sudoku::update_helpers() {
+ int j, k, m;
+
+ // First we delete any entries that the user may have made
+ for (j = 0; j < 9; j ++) {
+ for (k = 0; k < 9; k ++) {
+ SudokuCell *cell = grid_cells_[j][k];
+ for (m = 0; m < 8; m ++) {
+ cell->test_value(0, m);
+ }
+ }
+ }
+
+ // Now go through all cells and find out, what we can not be
+ for (j = 0; j < 81; j ++) {
+ char taken[10] = { 0 };
+ // Find our destination cell
+ int row = j / 9;
+ int col = j % 9;
+ SudokuCell *dst_cell = grid_cells_[row][col];
+ if (dst_cell->value()) continue;
+ // Find all values already taken in this row
+ for (k = 0; k < 9; k ++) {
+ SudokuCell *cell = grid_cells_[row][k];
+ int v = cell->value();
+ if (v) taken[v] = 1;
+ }
+ // Find all values already taken in this column
+ for (k = 0; k < 9; k ++) {
+ SudokuCell *cell = grid_cells_[k][col];
+ int v = cell->value();
+ if (v) taken[v] = 1;
+ }
+ // Now find all values already taken in this square
+ int ro = (row / 3) * 3;
+ int co = (col / 3) * 3;
+ for (k = 0; k < 3; k ++) {
+ for (m = 0; m < 3; m ++) {
+ SudokuCell *cell = grid_cells_[ro + k][co + m];
+ int v = cell->value();
+ if (v) taken[v] = 1;
+ }
+ }
+ // transfer our findings to the markers
+ for (m = 1, k = 0; m <= 9; m ++) {
+ if (!taken[m])
+ dst_cell->test_value(m, k ++);
+ }
+ }
+}
+
+
+// Show the on-line help...
+void
+Sudoku::help_cb(Fl_Widget *, void *) {
+ if (!help_dialog_) {
+ help_dialog_ = new Fl_Help_Dialog();
+
+ help_dialog_->value(
+ "<HTML>\n"
+ "<HEAD>\n"
+ "<TITLE>Sudoku Help</TITLE>\n"
+ "</HEAD>\n"
+ "<BODY BGCOLOR='#ffffff'>\n"
+
+ "<H2>About the Game</H2>\n"
+
+ "<P>Sudoku (pronounced soo-dough-coo with the emphasis on the\n"
+ "first syllable) is a simple number-based puzzle/game played on a\n"
+ "9x9 grid that is divided into 3x3 subgrids. The goal is to enter\n"
+ "a number from 1 to 9 in each cell so that each number appears\n"
+ "only once in each column and row. In addition, each 3x3 subgrid\n"
+ "may only contain one of each number.</P>\n"
+
+ "<P>This version of the puzzle is copyright 2005-2006 by Michael R\n"
+ "Sweet.</P>\n"
+
+ "<P><B>Note:</B> The 'Hard' and 'Impossible' difficulty\n"
+ "levels generate Sudoku puzzles with multiple possible solutions.\n"
+ "While some purists insist that these cannot be called 'Sudoku'\n"
+ "puzzles, the author (me) has personally solved many such puzzles\n"
+ "in published/printed Sudoku books and finds them far more\n"
+ "interesting than the simple single solution variety. If you don't\n"
+ "like it, don't play with the difficulty set to 'High' or\n"
+ "'Impossible'.</P>\n"
+
+ "<H2>How to Play the Game</H2>\n"
+
+ "<P>At the start of a new game, Sudoku fills in a random selection\n"
+ "of cells for you - the number of cells depends on the difficulty\n"
+ "level you use. Click in any of the empty cells or use the arrow\n"
+ "keys to highlight individual cells and press a number from 1 to 9\n"
+ "to fill in the cell. To clear a cell, press 0, Delete, or\n"
+ "Backspace. When you have successfully completed all subgrids, the\n"
+ "entire puzzle is highlighted in green until you start a new\n"
+ "game.</P>\n"
+
+ "<P>As you work to complete the puzzle, you can display possible\n"
+ "solutions inside each cell by holding the Shift key and pressing\n"
+ "each number in turn. Repeat the process to remove individual\n"
+ "numbers, or press a number without the Shift key to replace them\n"
+ "with the actual number to use.</P>\n"
+ "</BODY>\n"
+ );
+ }
+
+ help_dialog_->show();
+}
+
+
+// Load the game from saved preferences...
+void
+Sudoku::load_game() {
+ // Load the current values and state of each grid...
+ memset(grid_values_, 0, sizeof(grid_values_));
+
+ bool solved = true;
+
+ for (int j = 0; j < 9; j ++)
+ for (int k = 0; k < 9; k ++) {
+ char name[255];
+ int val;
+
+ SudokuCell *cell = grid_cells_[j][k];
+
+ sprintf(name, "value%d.%d", j, k);
+ if (!prefs_.get(name, val, 0)) {
+ j = 9;
+ grid_values_[0][0] = 0;
+ break;
+ }
+
+ grid_values_[j][k] = val;
+
+ sprintf(name, "state%d.%d", j, k);
+ prefs_.get(name, val, 0);
+ cell->value(val);
+
+ sprintf(name, "readonly%d.%d", j, k);
+ prefs_.get(name, val, 0);
+ cell->readonly(val);
+
+ if (val) cell->color(FL_GRAY);
+ else {
+ cell->color(FL_LIGHT3);
+ solved = false;
+ }
+
+ for (int m = 0; m < 8; m ++) {
+ sprintf(name, "test%d%d.%d", m, j, k);
+ prefs_.get(name, val, 0);
+ cell->test_value(val, m);
+ }
+ }
+
+ // If we didn't load any values or the last game was solved, then
+ // create a new game automatically...
+ if (solved || !grid_values_[0][0]) new_game(time(NULL));
+ else check_game(false);
+}
+
+
+// Mute/unmute sound...
+void
+Sudoku::mute_cb(Fl_Widget *widget, void *) {
+ Sudoku *s = (Sudoku *)(widget->window() ? widget->window() : widget);
+
+ if (s->sound_) {
+ delete s->sound_;
+ s->sound_ = NULL;
+ prefs_.set("mute_sound", 1);
+ } else {
+ s->sound_ = new SudokuSound();
+ prefs_.set("mute_sound", 0);
+ }
+}
+
+
+// Create a new game...
+void
+Sudoku::new_cb(Fl_Widget *widget, void *) {
+ Sudoku *s = (Sudoku *)(widget->window() ? widget->window() : widget);
+
+ if (s->grid_cells_[0][0]->color() != FL_GREEN) {
+ if (!fl_choice("Are you sure you want to change the difficulty level and "
+ "discard the current game?", "Keep Current Game", "Start New Game",
+ NULL)) return;
+ }
+
+ s->new_game(time(NULL));
+}
+
+
+// Create a new game...
+void
+Sudoku::new_game(time_t seed) {
+ int j, k, m, n, t, count;
+
+
+ // Generate a new (valid) Sudoku grid...
+ seed_ = seed;
+ srand(seed);
+
+ memset(grid_values_, 0, sizeof(grid_values_));
+
+ for (j = 0; j < 9; j += 3) {
+ for (k = 0; k < 9; k += 3) {
+ for (t = 1; t <= 9; t ++) {
+ for (count = 0; count < 20; count ++) {
+ m = j + (rand() % 3);
+ n = k + (rand() % 3);
+ if (!grid_values_[m][n]) {
+ int mm;
+
+ for (mm = 0; mm < m; mm ++)
+ if (grid_values_[mm][n] == t) break;
+
+ if (mm < m) continue;
+
+ int nn;
+
+ for (nn = 0; nn < n; nn ++)
+ if (grid_values_[m][nn] == t) break;
+
+ if (nn < n) continue;
+
+ grid_values_[m][n] = t;
+ break;
+ }
+ }
+
+ if (count == 20) {
+ // Unable to find a valid puzzle so far, so start over...
+ k = 9;
+ j = -3;
+ memset(grid_values_, 0, sizeof(grid_values_));
+ }
+ }
+ }
+ }
+
+ // Start by making all cells editable
+ SudokuCell *cell;
+
+ for (j = 0; j < 9; j ++)
+ for (k = 0; k < 9; k ++) {
+ cell = grid_cells_[j][k];
+
+ cell->value(0);
+ cell->readonly(0);
+ cell->color(FL_LIGHT3);
+ }
+
+ // Show N cells...
+ count = 11 * (5 - difficulty_);
+
+ int numbers[9];
+
+ for (j = 0; j < 9; j ++) numbers[j] = j + 1;
+
+ while (count > 0) {
+ for (j = 0; j < 20; j ++) {
+ k = rand() % 9;
+ m = rand() % 9;
+ t = numbers[k];
+ numbers[k] = numbers[m];
+ numbers[m] = t;
+ }
+
+ for (j = 0; count > 0 && j < 9; j ++) {
+ t = numbers[j];
+
+ for (k = 0; count > 0 && k < 9; k ++) {
+ cell = grid_cells_[j][k];
+
+ if (grid_values_[j][k] == t && !cell->readonly()) {
+ cell->value(grid_values_[j][k]);
+ cell->readonly(1);
+ cell->color(FL_GRAY);
+
+ count --;
+ break;
+ }
+ }
+ }
+ }
+}
+
+
+// Return the next available value for a cell...
+int
+Sudoku::next_value(SudokuCell *c) {
+ int j, k, m, n;
+
+
+ for (j = 0; j < 9; j ++) {
+ for (k = 0; k < 9; k ++)
+ if (grid_cells_[j][k] == c) break;
+
+ if (k < 9) break;
+ }
+
+ if (j == 9) return 1;
+
+ j -= j % 3;
+ k -= k % 3;
+
+ int numbers[9];
+
+ memset(numbers, 0, sizeof(numbers));
+
+ for (m = 0; m < 3; m ++)
+ for (n = 0; n < 3; n ++) {
+ c = grid_cells_[j + m][k + n];
+ if (c->value()) numbers[c->value() - 1] = 1;
+ }
+
+ for (j = 0; j < 9; j ++)
+ if (!numbers[j]) return j + 1;
+
+ return 1;
+}
+
+
+// Reset widget color to gray...
+void
+Sudoku::reset_cb(Fl_Widget *widget, void *) {
+ widget->color(FL_LIGHT3);
+ widget->redraw();
+
+ ((Sudoku *)(widget->window()))->check_game(false);
+}
+
+
+// Resize the window...
+void
+Sudoku::resize(int X, int Y, int W, int H) {
+ // Resize the window...
+ Fl_Window::resize(X, Y, W, H);
+
+ // Save the new window geometry...
+ prefs_.set("x", X);
+ prefs_.set("y", Y);
+ prefs_.set("width", W);
+ prefs_.set("height", H);
+}
+
+
+// Restart game from beginning...
+void
+Sudoku::restart_cb(Fl_Widget *widget, void *) {
+ Sudoku *s = (Sudoku *)(widget->window());
+ bool solved = true;
+
+ for (int j = 0; j < 9; j ++)
+ for (int k = 0; k < 9; k ++) {
+ SudokuCell *cell = s->grid_cells_[j][k];
+
+ if (!cell->readonly()) {
+ solved = false;
+ int v = cell->value();
+ cell->value(0);
+ cell->color(FL_LIGHT3);
+ if (v && s->sound_) s->sound_->play('A' + v - 1);
+ }
+ }
+
+ if (solved) s->new_game(s->seed_);
+}
+
+
+// Save the current game state...
+void
+Sudoku::save_game() {
+ // Save the current values and state of each grid...
+ for (int j = 0; j < 9; j ++)
+ for (int k = 0; k < 9; k ++) {
+ char name[255];
+ SudokuCell *cell = grid_cells_[j][k];
+
+ sprintf(name, "value%d.%d", j, k);
+ prefs_.set(name, grid_values_[j][k]);
+
+ sprintf(name, "state%d.%d", j, k);
+ prefs_.set(name, cell->value());
+
+ sprintf(name, "readonly%d.%d", j, k);
+ prefs_.set(name, cell->readonly());
+
+ for (int m = 0; m < 8; m ++) {
+ sprintf(name, "test%d%d.%d", m, j, k);
+ prefs_.set(name, cell->test_value(m));
+ }
+ }
+}
+
+
+// Set title of window...
+void
+Sudoku::set_title() {
+ static const char * const titles[] = {
+ "Sudoku - Easy",
+ "Sudoku - Medium",
+ "Sudoku - Hard",
+ "Sudoku - Impossible"
+ };
+
+ label(titles[difficulty_]);
+}
+
+
+// Solve the puzzle...
+void
+Sudoku::solve_cb(Fl_Widget *widget, void *) {
+ ((Sudoku *)(widget->window()))->solve_game();
+}
+
+
+// Solve the puzzle...
+void
+Sudoku::solve_game() {
+ int j, k;
+
+ for (j = 0; j < 9; j ++) {
+ for (k = 0; k < 9; k ++) {
+ SudokuCell *cell = grid_cells_[j][k];
+
+ cell->value(grid_values_[j][k]);
+ cell->readonly(1);
+ cell->color(FL_GRAY);
+ }
+
+ if (sound_) sound_->play('A' + grid_cells_[j][8]->value() - 1);
+ }
+}
+
+
+// Main entry for game...
+int
+main(int argc, char *argv[]) {
+ Sudoku s;
+
+ // Show the game...
+ s.show(argc, argv);
+
+ // Load the previous game...
+ s.load_game();
+
+ // Run until the user quits...
+ return (Fl::run());
+}
+
+
+//
+// End of "$Id: sudoku.cxx 6973 2009-12-21 16:35:06Z AlbrechtS $".
+//
diff --git a/third_party/windows/fltk-1.1.10/test/sudoku.ico b/third_party/windows/fltk-1.1.10/test/sudoku.ico
new file mode 100644
index 0000000..f5f1e4a
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/sudoku.ico
Binary files differ
diff --git a/third_party/windows/fltk-1.1.10/test/sudoku.rc b/third_party/windows/fltk-1.1.10/test/sudoku.rc
new file mode 100644
index 0000000..107c9a6
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/sudoku.rc
@@ -0,0 +1,72 @@
+//Microsoft Developer Studio generated resource script.
+//
+#include "sudokurc.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+//#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// English (U.S.) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+#ifdef _WIN32
+//LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+#pragma code_page(1252)
+#endif //_WIN32
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "icons.h\0"
+END
+
+3 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "\r\n"
+ "\0"
+END
+
+2 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "#include ""afxres.h""\r\n"
+ "\0"
+END
+
+#endif // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+IDI_ICON ICON DISCARDABLE "sudoku.ico"
+#endif // English (U.S.) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
+
diff --git a/third_party/windows/fltk-1.1.10/test/sudokurc.h b/third_party/windows/fltk-1.1.10/test/sudokurc.h
new file mode 100644
index 0000000..9a6bc90
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/sudokurc.h
@@ -0,0 +1,16 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Developer Studio generated include file.
+// Used by icons.rc
+//
+#define IDI_ICON 101
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE 105
+#define _APS_NEXT_COMMAND_VALUE 40001
+#define _APS_NEXT_CONTROL_VALUE 1000
+#define _APS_NEXT_SYMED_VALUE 101
+#endif
+#endif
diff --git a/third_party/windows/fltk-1.1.10/test/symbols.cxx b/third_party/windows/fltk-1.1.10/test/symbols.cxx
new file mode 100644
index 0000000..7e0000c
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/symbols.cxx
@@ -0,0 +1,159 @@
+//
+// "$Id: symbols.cxx 5845 2007-05-20 00:01:06Z mike $"
+//
+// Symbol test program for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2005 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 <string.h>
+#include <ctype.h>
+#include <FL/Fl.H>
+#include <FL/Fl_Single_Window.H>
+#include <FL/Fl_Box.H>
+#include <FL/Fl_Value_Slider.H>
+#include <FL/fl_draw.H>
+
+int N = 0;
+#define W 70
+#define H 70
+#define ROWS 6
+#define COLS 6
+
+Fl_Window *window;
+Fl_Value_Slider *orientation;
+Fl_Value_Slider *size;
+
+void slider_cb(Fl_Widget *, void *) {
+ static char buf[80];
+ int val = (int)orientation->value();
+ int sze = (int)size->value();
+ for (int i = window->children(); i--; ) { // all window children
+ Fl_Widget *wc = window->child(i);
+ const char *l = (const char *)(wc->user_data());
+ if ( l && *l == '@' ) { // all children with '@'
+ l ++;
+ if ( wc->box() == FL_NO_BOX ) { // ascii legend?
+ if (val&&sze) sprintf(buf, "@@%+d%d%s", sze, val, l);
+ else if (val) sprintf(buf, "@@%d%s", val, l);
+ else if (sze) sprintf(buf, "@@%+d%s", sze, l);
+ else sprintf(buf, "@@%s", l);
+ } else { // box with symbol
+ if (val&&sze) sprintf(buf, "@%+d%d%s", sze, val, l);
+ else if (val) sprintf(buf, "@%d%s", val, l);
+ else if (sze) sprintf(buf, "@%+d%s", sze, l);
+ else sprintf(buf, "@%s", l);
+ }
+ wc->copy_label(buf);
+ }
+ }
+ window->redraw();
+}
+
+void bt(const char *name) {
+ int x = N%COLS;
+ int y = N/COLS;
+ char buf[255];
+ N++;
+ x = x*W+10;
+ y = y*H+10;
+ sprintf(buf, "@%s", name);
+ Fl_Box *a = new Fl_Box(x,y,W-20,H-20);
+ a->box(FL_NO_BOX);
+ a->copy_label(buf);
+ a->align(FL_ALIGN_BOTTOM);
+ a->labelsize(11);
+ a->user_data((void *)name);
+ Fl_Box *b = new Fl_Box(x,y,W-20,H-20);
+ b->box(FL_UP_BOX);
+ b->copy_label(name);
+ b->labelcolor(FL_DARK3);
+ b->user_data((void *)name);
+}
+
+int main(int argc, char ** argv) {
+ window = new Fl_Single_Window(COLS*W,ROWS*H+60);
+bt("@->");
+bt("@>");
+bt("@>>");
+bt("@>|");
+bt("@>[]");
+bt("@|>");
+bt("@<-");
+bt("@<");
+bt("@<<");
+bt("@|<");
+bt("@[]<");
+bt("@<|");
+bt("@<->");
+bt("@-->");
+bt("@+");
+bt("@->|");
+bt("@||");
+bt("@arrow");
+bt("@returnarrow");
+bt("@square");
+bt("@circle");
+bt("@line");
+bt("@menu");
+bt("@UpArrow");
+bt("@DnArrow");
+bt("@search");
+bt("@FLTK");
+bt("@filenew");
+bt("@fileopen");
+bt("@filesave");
+bt("@filesaveas");
+bt("@fileprint");
+bt("@refresh");
+bt("@reload");
+bt("@undo");
+bt("@redo");
+
+ orientation = new Fl_Value_Slider(
+ (int)(window->w()*.05+.5), window->h()-40,
+ (int)(window->w()*.42+.5), 16, "Orientation");
+ orientation->type(FL_HORIZONTAL);
+ orientation->range(0.0, 9.0);
+ orientation->value(0.0);
+ orientation->step(1);
+ orientation->callback(slider_cb, 0);
+
+ size = new Fl_Value_Slider(
+ (int)(window->w()*.53+.5), window->h()-40,
+ (int)(window->w()*.42+.5), 16, "Size");
+ size->type(FL_HORIZONTAL);
+ size->range(-3.0, 9.0);
+ size->value(0.0);
+ size->step(1);
+ size->callback(slider_cb, 0);
+
+ window->resizable(window);
+ window->show(argc,argv);
+ return Fl::run();
+}
+
+//
+// End of "$Id: symbols.cxx 5845 2007-05-20 00:01:06Z mike $".
+//
diff --git a/third_party/windows/fltk-1.1.10/test/tabs.fl b/third_party/windows/fltk-1.1.10/test/tabs.fl
new file mode 100644
index 0000000..ae6477c
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/tabs.fl
@@ -0,0 +1,289 @@
+# data file for the Fltk User Interface Designer (fluid)
+version 1.0108
+header_name {.h}
+code_name {.cxx}
+Function {} {open
+} {
+ Fl_Window foo_window {
+ label {Comparison of Fl_Tab (left) vs. Fl_Wizard (right)} open
+ xywh {423 205 642 337} type Double resizable visible
+ } {
+ Fl_Box {} {
+ label {class Fl_Tabs}
+ xywh {95 0 130 35} labeltype ENGRAVED_LABEL labelfont 1
+ }
+ Fl_Tabs {} {
+ tooltip {the various index cards test different aspects of the Fl_Tabs widget} xywh {10 35 300 205} selection_color 4 labelcolor 7 resizable
+ } {
+ Fl_Group {} {
+ label {Label&1} open selected
+ tooltip {this Tab tests correct keyboard navigation between text input fields} xywh {10 60 300 180} selection_color 1 resizable
+ } {
+ Fl_Input {} {
+ label {input:}
+ tooltip {This is the first input field} xywh {60 80 240 40}
+ }
+ Fl_Input {} {
+ label {input2:}
+ xywh {60 120 240 30}
+ code0 {o->tooltip("");}
+ }
+ Fl_Input {} {
+ label {input3:}
+ xywh {60 150 240 80}
+ }
+ }
+ Fl_Group {} {
+ label {tab&2} open
+ tooltip {tab2 tests among other things the cooperation of modal windows and tabs} xywh {10 60 300 180} selection_color 2 hide
+ } {
+ Fl_Button {} {
+ label button1
+ callback {fl_message("Test to see if this modal window prevents you from "
+ "changing the tabs. It should.");}
+ xywh {20 90 100 30}
+ code0 {\#include <FL/fl_ask.H>}
+ }
+ Fl_Input {} {
+ label {input in box2}
+ xywh {140 130 100 30}
+ }
+ Fl_Button {} {
+ label {This is stuff inside the Fl_Group "tab2"}
+ xywh {30 170 260 30}
+ }
+ Fl_Button {} {
+ label {Test event blocking by modal window}
+ callback {fl_message("Make sure you cannot change the tabs while this modal window is up");}
+ xywh {30 200 260 30}
+ code0 {\#include <FL/fl_ask.H>}
+ }
+ }
+ Fl_Group {} {
+ label {tab&3} open
+ tooltip {tab3 checks for correct keyboard navigation} xywh {10 60 300 180} selection_color 3 hide
+ } {
+ Fl_Button {} {
+ label button2
+ xywh {20 90 60 80}
+ }
+ Fl_Button {} {
+ label button
+ xywh {80 90 60 80}
+ }
+ Fl_Button {} {
+ label button
+ xywh {140 90 60 80}
+ }
+ }
+ Fl_Group {} {
+ label {&tab4} open
+ tooltip {this tab show the issue of indicating a selcted tab if the tab layouts are very similar} xywh {10 60 300 180} selection_color 5 labeltype ENGRAVED_LABEL labelfont 2 hide
+ } {
+ Fl_Button {} {
+ label button2
+ xywh {20 80 60 110}
+ }
+ Fl_Button {} {
+ label button
+ xywh {80 80 60 110}
+ }
+ Fl_Button {} {
+ label button
+ xywh {140 80 60 110}
+ }
+ }
+ Fl_Group {} {
+ label {@fileprint &print} open
+ tooltip {tab5 verifies if visibility requests are handled correctly} xywh {10 60 300 180} hide
+ } {
+ Fl_Button {} {
+ label button2
+ tooltip {button2 has a different tooltp than tab5} xywh {20 75 60 80}
+ }
+ Fl_Button {} {
+ label button
+ xywh {90 75 60 80}
+ }
+ Fl_Clock {} {
+ label {Make sure this clock does not use processor time when this tab is hidden or window is iconized}
+ xywh {160 75 100 100} box OSHADOW_BOX color 238 selection_color 0 labelfont 8 labelsize 10 align 130
+ }
+ Fl_Group {} {open
+ xywh {20 175 40 55} box THIN_DOWN_BOX color 173 align 16
+ class Fl_Window
+ } {}
+ Fl_Group {} {
+ label {subwindows:} open
+ xywh {65 175 40 55} box THIN_DOWN_BOX color 167
+ class Fl_Window
+ } {}
+ Fl_Group {} {open
+ xywh {110 175 40 55} box THIN_DOWN_BOX color 239 align 16
+ class Fl_Window
+ } {}
+ }
+ }
+ Fl_Box {} {
+ label {class Fl_Wizard}
+ xywh {410 0 130 35} labeltype ENGRAVED_LABEL labelfont 1
+ }
+ Fl_Wizard wWizard {
+ xywh {325 60 300 180}
+ } {
+ Fl_Group {} {
+ label Label1 open
+ tooltip {this Tab tests correct keyboard navigation between text input fields} xywh {325 60 300 180} selection_color 1 resizable
+ } {
+ Fl_Input {} {
+ label {input:}
+ tooltip {This is the first input field} xywh {375 80 240 40}
+ }
+ Fl_Input {} {
+ label {input2:}
+ xywh {375 120 240 30}
+ code0 {o->tooltip("");}
+ }
+ Fl_Input {} {
+ label {input3:}
+ xywh {375 150 240 80}
+ }
+ }
+ Fl_Group {} {
+ label tab2 open
+ tooltip {tab2 tests among other things the cooperation of modal windows and tabs} xywh {325 60 300 180} selection_color 2 hide
+ } {
+ Fl_Button {} {
+ label button1
+ callback {fl_message("Test to see if this modal window prevents you from "
+ "changing the tabs. It should.");}
+ xywh {335 90 100 30}
+ code0 {\#include <FL/fl_ask.H>}
+ }
+ Fl_Input {} {
+ label {input in box2}
+ xywh {455 130 100 30}
+ }
+ Fl_Button {} {
+ label {This is stuff inside the Fl_Group "tab2"}
+ xywh {345 170 260 30}
+ }
+ Fl_Button {} {
+ label {Test event blocking by modal window}
+ callback {fl_message("Make sure you cannot change the tabs while this modal window is up");}
+ xywh {345 200 260 30}
+ code0 {\#include <FL/fl_ask.H>}
+ }
+ }
+ Fl_Group {} {
+ label tab3 open
+ tooltip {tab3 checks for correct keyboard navigation} xywh {325 60 300 180} selection_color 3 hide
+ } {
+ Fl_Button {} {
+ label button2
+ xywh {335 90 60 80}
+ }
+ Fl_Button {} {
+ label button
+ xywh {395 90 60 80}
+ }
+ Fl_Button {} {
+ label button
+ xywh {455 90 60 80}
+ }
+ }
+ Fl_Group {} {
+ label tab4 open
+ tooltip {this tab show the issue of indicating a selcted tab if the tab layouts are very similar} xywh {325 60 300 180} selection_color 5 labelfont 2 hide
+ } {
+ Fl_Button {} {
+ label button2
+ xywh {335 80 60 110}
+ }
+ Fl_Button {} {
+ label button
+ xywh {395 80 60 110}
+ }
+ Fl_Button {} {
+ label button
+ xywh {455 80 60 110}
+ }
+ }
+ Fl_Group {} {
+ label { tab5 } open
+ tooltip {tab5 verifies if visibility requests are handled correctly} xywh {325 60 300 180} labeltype ENGRAVED_LABEL hide
+ } {
+ Fl_Button {} {
+ label button2
+ tooltip {button2 has a different tooltp than tab5} xywh {335 75 60 80}
+ }
+ Fl_Button {} {
+ label button
+ xywh {405 75 60 80}
+ }
+ Fl_Clock {} {
+ label {Make sure this clock does not use processor time when this tab is hidden or window is iconized}
+ xywh {475 75 100 100} box OSHADOW_BOX color 238 selection_color 0 labelfont 8 labelsize 10 align 130
+ }
+ Fl_Group {} {open
+ xywh {335 175 40 55} box THIN_DOWN_BOX color 173 align 16
+ class Fl_Window
+ } {}
+ Fl_Group {} {
+ label {subwindows:} open
+ xywh {380 175 40 55} box THIN_DOWN_BOX color 167
+ class Fl_Window
+ } {}
+ Fl_Group {} {open
+ xywh {425 175 40 55} box THIN_DOWN_BOX color 239 align 16
+ class Fl_Window
+ } {}
+ }
+ }
+ Fl_Group {} {
+ xywh {410 245 130 25}
+ } {
+ Fl_Button {} {
+ label {@|<}
+ callback {wWizard->value(wWizard->child(0));}
+ tooltip {go to first page [Home]} xywh {410 245 30 25} shortcut 0xff50
+ }
+ Fl_Button {} {
+ label {@<}
+ callback {wWizard->prev();}
+ tooltip {go to previous page [left arrow]} xywh {440 245 30 25} shortcut 0xff51
+ }
+ Fl_Button {} {
+ label {@>}
+ callback {wWizard->next();}
+ tooltip {go to next page in wizard [right arrow]} xywh {480 245 30 25} shortcut 0xff53
+ }
+ Fl_Button {} {
+ label {@>|}
+ callback {int last = wWizard->children()-1;
+wWizard->value(wWizard->child(last));}
+ tooltip {go to last page [End]} xywh {510 245 30 25} shortcut 0xff57
+ }
+ }
+ Fl_Input {} {
+ label {inputA:}
+ xywh {60 255 130 25}
+ }
+ Fl_Input {} {
+ label {inputB:}
+ xywh {60 285 250 25}
+ }
+ Fl_Button {} {
+ label cancel
+ callback {exit(1);}
+ xywh {475 295 70 30}
+ code0 {\#include <stdlib.h>}
+ }
+ Fl_Return_Button {} {
+ label OK
+ callback {exit(0);}
+ xywh {555 295 70 30}
+ code0 {\#include <stdlib.h>}
+ }
+ }
+}
diff --git a/third_party/windows/fltk-1.1.10/test/threads.cxx b/third_party/windows/fltk-1.1.10/test/threads.cxx
new file mode 100644
index 0000000..763e0ba
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/threads.cxx
@@ -0,0 +1,173 @@
+//
+// "$Id: threads.cxx 5849 2007-05-20 16:32:37Z matt $"
+//
+// 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 <FL/Fl.H>
+# include <FL/Fl_Window.H>
+# include <FL/Fl_Browser.H>
+# include <FL/Fl_Value_Output.H>
+# include <FL/fl_ask.H>
+# include "threads.h"
+# include <stdio.h>
+# include <math.h>
+
+Fl_Thread prime_thread;
+
+Fl_Browser *browser1, *browser2;
+Fl_Value_Output *value1, *value2;
+int start2 = 3;
+
+void magic_number_cb(void *p)
+{
+ Fl_Value_Output *w = (Fl_Value_Output*)p;
+ w->labelcolor(FL_RED);
+ w->redraw_label();
+}
+
+void* prime_func(void* p)
+{
+ Fl_Browser* browser = (Fl_Browser*) p;
+ Fl_Value_Output *value;
+ int n;
+ int step;
+ char proud = 0;
+
+ if (browser == browser2) {
+ n = start2;
+ start2 += 2;
+ step = 12;
+ value = value2;
+ } else {
+ n = 3;
+ step = 2;
+ value = value1;
+ }
+
+ // very simple prime number calculator !
+ //
+ // The return at the end of this function can never be reached and thus
+ // will generate a warning with some compilers, however we need to have
+ // a return statement or other compilers will complain there is no return
+ // statement. To avoid warnings on all compilers, we fool the smart ones
+ // into beleiving that there is a chance that we reach the end by testing
+ // n>=0, knowing that logically, n will never be negative in this context.
+ if (n>=0) for (;;) {
+ int pp;
+ int hn = (int)sqrt((double)n);
+
+ for (pp=3; pp<=hn; pp+=2) if ( n%pp == 0 ) break;
+ if (pp >= hn) {
+ char s[128];
+ sprintf(s, "%d", n);
+
+ // Obtain a lock before we access the browser widget...
+ Fl::lock();
+
+ browser->add(s);
+ browser->bottomline(browser->size());
+ if (n > value->value()) value->value(n);
+ n += step;
+
+ // Release the lock...
+ Fl::unlock();
+
+ // Send a message to the main thread, at which point it will
+ // process any pending redraws for our browser widget. The
+ // message we pass here isn't used for anything, so we could also
+ // just pass NULL.
+ Fl::awake(p);
+ if (n>10000 && !proud) {
+ proud = 1;
+ Fl::awake(magic_number_cb, value);
+ }
+ } else {
+ // This should not be necessary since "n" and "step" are local variables,
+ // however it appears that at least MacOS X has some threading issues
+ // that cause semi-random corruption of the (stack) variables.
+ Fl::lock();
+ n += step;
+ Fl::unlock();
+ }
+ }
+ return 0L;
+}
+
+int main(int argc, char **argv)
+{
+ Fl_Window* w = new Fl_Window(200, 200, "Single Thread");
+ browser1 = new Fl_Browser(0, 0, 200, 175);
+ w->resizable(browser1);
+ value1 = new Fl_Value_Output(100, 175, 200, 25, "Max Prime:");
+ w->end();
+ w->show(argc, argv);
+ w = new Fl_Window(200, 200, "Six Threads");
+ browser2 = new Fl_Browser(0, 0, 200, 175);
+ w->resizable(browser2);
+ value2 = new Fl_Value_Output(100, 175, 200, 25, "Max Prime:");
+ w->end();
+ w->show();
+
+ browser1->add("Prime numbers:");
+ browser2->add("Prime numbers:");
+
+ // Enable multi-thread support by locking from the main
+ // thread. Fl::wait() and Fl::run() call Fl::unlock() and
+ // Fl::lock() as needed to release control to the child threads
+ // when it is safe to do so...
+ Fl::lock();
+
+ // Start threads...
+
+ // One thread displaying in one browser
+ fl_create_thread(prime_thread, prime_func, browser1);
+
+ // Several threads displaying in another browser
+ fl_create_thread(prime_thread, prime_func, browser2);
+ fl_create_thread(prime_thread, prime_func, browser2);
+ fl_create_thread(prime_thread, prime_func, browser2);
+ fl_create_thread(prime_thread, prime_func, browser2);
+ fl_create_thread(prime_thread, prime_func, browser2);
+ fl_create_thread(prime_thread, prime_func, browser2);
+
+ Fl::run();
+
+ return 0;
+}
+#else
+# include <FL/fl_ask.H>
+
+int main() {
+ fl_alert("Sorry, threading not supported on this platform!");
+}
+#endif // HAVE_PTHREAD || WIN32
+
+
+//
+// End of "$Id: threads.cxx 5849 2007-05-20 16:32:37Z matt $".
+//
diff --git a/third_party/windows/fltk-1.1.10/test/threads.h b/third_party/windows/fltk-1.1.10/test/threads.h
new file mode 100644
index 0000000..7d4e956
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/threads.h
@@ -0,0 +1,81 @@
+//
+// "$Id: threads.h 5519 2006-10-11 03:12:15Z mike $"
+//
+// Simple threading API 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
+//
+
+// Inline classes to provide portable support for threads and mutexes.
+//
+// FLTK does not use this (it has an internal mutex implementation
+// that is used if Fl::lock() is called). This header file's only
+// purpose is so we can write portable demo programs. It may be useful
+// or an inspiration to people who want to try writing multithreaded
+// programs themselves.
+//
+// FLTK has no multithreaded support unless the main thread calls Fl::lock().
+// This main thread is the only thread allowed to call Fl::run() or Fl::wait().
+// From then on FLTK will be locked except when the main thread is actually
+// waiting for events from the user. Other threads must call Fl::lock() and
+// Fl::unlock() to surround calls to FLTK (such as to change widgets or
+// redraw them).
+
+#ifndef Threads_H
+# define Threads_H
+
+# if HAVE_PTHREAD_H
+// Use POSIX threading...
+
+# include <pthread.h>
+
+typedef pthread_t Fl_Thread;
+
+static int fl_create_thread(Fl_Thread& t, void *(*f) (void *), void* p) {
+ return pthread_create((pthread_t*)&t, 0, f, p);
+}
+
+# elif defined(WIN32) && !defined(__WATCOMC__) // Use Windows threading...
+
+# include <windows.h>
+# include <process.h>
+
+typedef unsigned long Fl_Thread;
+
+static int fl_create_thread(Fl_Thread& t, void *(*f) (void *), void* p) {
+ return t = (Fl_Thread)_beginthread((void( __cdecl * )( void * ))f, 0, p);
+}
+
+# elif defined(__WATCOMC__)
+# include <process.h>
+
+typedef unsigned long Fl_Thread;
+
+static int fl_create_thread(Fl_Thread& t, void *(*f) (void *), void* p) {
+ return t = (Fl_Thread)_beginthread((void(* )( void * ))f, 32000, p);
+}
+# endif // !HAVE_PTHREAD_H
+#endif // !Threads_h
+
+//
+// End of "$Id: threads.h 5519 2006-10-11 03:12:15Z mike $".
+//
diff --git a/third_party/windows/fltk-1.1.10/test/tile.cxx b/third_party/windows/fltk-1.1.10/test/tile.cxx
new file mode 100644
index 0000000..22cd278
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/tile.cxx
@@ -0,0 +1,92 @@
+//
+// "$Id: tile.cxx 5912 2007-06-18 09:35:42Z matt $"
+//
+// Tile test program for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2005 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 <FL/Fl.H>
+#include <FL/Fl_Double_Window.H>
+#include <FL/Fl_Tile.H>
+#include <FL/Fl_Box.H>
+
+int main(int argc, char** argv) {
+ Fl_Window window(300,300);
+ window.box(FL_NO_BOX);
+ window.resizable(window);
+ Fl_Tile tile(0,0,300,300);
+ Fl_Box box0(0,0,150,150,"0");
+ box0.box(FL_DOWN_BOX);
+ box0.color(9);
+ box0.labelsize(36);
+ box0.align(FL_ALIGN_CLIP);
+ Fl_Window w1(150,0,150,150,"1");
+ w1.box(FL_NO_BOX);
+ Fl_Box box1(0,0,150,150,"1\nThis is a\nchild\nwindow");
+ box1.box(FL_DOWN_BOX);
+ box1.color(19);
+ box1.labelsize(18);
+ box1.align(FL_ALIGN_CLIP);
+ w1.resizable(box1);
+ w1.end();
+
+ // Fl_Tile tile2(0,150,150,150);
+ Fl_Box box2a(0,150,70,150,"2a");
+ box2a.box(FL_DOWN_BOX);
+ box2a.color(12);
+ box2a.labelsize(36);
+ box2a.align(FL_ALIGN_CLIP);
+ Fl_Box box2b(70,150,80,150,"2b");
+ box2b.box(FL_DOWN_BOX);
+ box2b.color(13);
+ box2b.labelsize(36);
+ box2b.align(FL_ALIGN_CLIP);
+ //tile2.end();
+
+ //Fl_Tile tile3(150,150,150,150);
+ Fl_Box box3a(150,150,150,70,"3a");
+ box3a.box(FL_DOWN_BOX);
+ box3a.color(12);
+ box3a.labelsize(36);
+ box3a.align(FL_ALIGN_CLIP);
+ Fl_Box box3b(150,150+70,150,80,"3b");
+ box3b.box(FL_DOWN_BOX);
+ box3b.color(13);
+ box3b.labelsize(36);
+ box3b.align(FL_ALIGN_CLIP);
+ //tile3.end();
+
+ Fl_Box r(10,0,300-10,300-10);
+ tile.resizable(r);
+ // r.box(FL_BORDER_FRAME);
+
+ tile.end();
+ window.end();
+ w1.show();
+ window.show(argc,argv);
+ return Fl::run();
+}
+
+//
+// End of "$Id: tile.cxx 5912 2007-06-18 09:35:42Z matt $".
+//
diff --git a/third_party/windows/fltk-1.1.10/test/tiled_image.cxx b/third_party/windows/fltk-1.1.10/test/tiled_image.cxx
new file mode 100644
index 0000000..b9f27ac
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/tiled_image.cxx
@@ -0,0 +1,105 @@
+//
+// "$Id: tiled_image.cxx 5519 2006-10-11 03:12:15Z mike $"
+//
+// Fl_Tiled_Image 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 <FL/Fl.H>
+#include <FL/Fl_Window.H>
+#include <FL/Fl_Button.H>
+#include <FL/Fl_Pixmap.H>
+#include <FL/Fl_Tiled_Image.H>
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+
+#include "pixmaps/tile.xpm"
+
+Fl_Button *b;
+Fl_Window *w;
+
+void button_cb(Fl_Widget *,void *) {
+ w->hide();
+}
+
+#include <FL/x.H>
+#if !defined(WIN32) && !defined(__APPLE__)
+#include "list_visuals.cxx"
+#endif
+
+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;
+}
+
+int main(int argc, char **argv) {
+#if !defined(WIN32) && !defined(__APPLE__)
+ int i = 1;
+
+ Fl::args(argc,argv,i,arg);
+
+ 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 in overlay visuals
+ } else {
+ Fl::visual(FL_RGB);
+ }
+#endif
+
+ Fl_Window window(400,400); ::w = &window;
+ Fl_Group group(0,0,400,400);
+ group.image(new Fl_Tiled_Image(new Fl_Pixmap((const char * const *)tile_xpm)));
+ group.align(FL_ALIGN_INSIDE);
+
+ Fl_Button b(340,365,50,25,"Close"); ::b = &b;
+ b.callback(button_cb);
+
+ group.end();
+
+ window.resizable(group);
+ window.end();
+ window.show(argc, argv);
+
+ return Fl::run();
+}
+
+//
+// End of "$Id: tiled_image.cxx 5519 2006-10-11 03:12:15Z mike $".
+//
diff --git a/third_party/windows/fltk-1.1.10/test/trackball.c b/third_party/windows/fltk-1.1.10/test/trackball.c
new file mode 100644
index 0000000..8025e31
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/trackball.c
@@ -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 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;
+}
+
diff --git a/third_party/windows/fltk-1.1.10/test/trackball.h b/third_party/windows/fltk-1.1.10/test/trackball.h
new file mode 100644
index 0000000..6f201f7
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/trackball.h
@@ -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]);
+
diff --git a/third_party/windows/fltk-1.1.10/test/unittests.cxx b/third_party/windows/fltk-1.1.10/test/unittests.cxx
new file mode 100644
index 0000000..5bc6ba4
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/unittests.cxx
@@ -0,0 +1,299 @@
+//
+// "$Id: unittests.cxx 5845 2007-05-20 00:01:06Z mike $"
+//
+// Unit tests for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2005 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 <FL/Fl.H>
+#include <FL/x.H>
+#include <FL/Fl_Window.H>
+#include <FL/Fl_Button.H>
+#include <FL/Fl_Box.H>
+#include <FL/fl_draw.H>
+
+Fl_Window *win = 0;
+
+int point_test_ix, line_test_ix, rect_test_ix, viewport_test_ix, circle_test_ix;
+
+void changePageCB(Fl_Widget*, void *ixvp) {
+ long ix = (long)ixvp;
+ long i = 0, n = win->children();
+ for ( ; i<n; i++)
+ win->child(i)->hide();
+ if (ix>=n || ix<0) ix = n-1;
+ win->child(ix)->show();
+}
+
+void newButton(int x, int y, int w, int h, const char *l, int ix, const char *tt) {
+ Fl_Button *b = new Fl_Button(x, y, w, h, l);
+ b->tooltip(tt);
+ b->callback(changePageCB, (void*)ix);
+}
+
+void createMenuPage() {
+ Fl_Group *page, *g;
+ page = new Fl_Group(0, 0, 600, 600);
+ g = new Fl_Group(100, 20, 460, 26, "drawing:");
+ g->align(FL_ALIGN_LEFT);
+ newButton(100+2, 22, 22, 22, "1", point_test_ix, "Testing pixel drawing");
+ newButton(125+2, 22, 22, 22, "2", line_test_ix, "Testing fl_line");
+ newButton(150+2, 22, 22, 22, "3", rect_test_ix, "Testing fl_rect");
+ newButton(175+2, 22, 22, 22, "4", viewport_test_ix, "Testing viewport alignment");
+ newButton(200+2, 22, 22, 22, "5", circle_test_ix, "Testing circle and oval drawing");
+ g->end();
+ page->end();
+}
+
+Fl_Group *beginTestPage(const char *l) {
+ int ix = win->children();
+ Fl_Group *g = new Fl_Group(0, 0, win->w(), win->h());
+ g->box(FL_FLAT_BOX);
+ g->hide();
+ newButton(20, 20, 20, 20, "M", -1, "Return to main menu");
+ newButton(20, 40, 20, 20, "@<", ix-1, "previous test");
+ newButton(20, 60, 20, 20, "@>", ix+1, "next test");
+ Fl_Box *bx = new Fl_Box(60, 20, win->w()-80, 100, l);
+ bx->box(FL_ENGRAVED_BOX);
+ bx->align(FL_ALIGN_INSIDE|FL_ALIGN_WRAP);
+ return g;
+}
+
+//------- test the point drawing capabilities of this implementation ----------
+class PointTest : public Fl_Widget {
+public: PointTest(int x, int y, int w, int h) : Fl_Widget(x, y, w, h) {}
+ void draw() {
+ int a = x(), b = y();
+ fl_color(FL_BLACK);
+ fl_rect(x(), y(), w(), h());
+ fl_point(a+10, b+10); fl_point(a+20, b+20);
+ fl_point(a+10, b+20); fl_point(a+20, b+10);
+ fl_color(FL_RED); a = x()+70;
+ fl_point(a+10, b+10); fl_point(a+20, b+20);
+ fl_point(a+10, b+20); fl_point(a+20, b+10);
+ fl_color(FL_GREEN); a = x(); b = y()+70;
+ fl_point(a+10, b+10); fl_point(a+20, b+20);
+ fl_point(a+10, b+20); fl_point(a+20, b+10);
+ fl_color(FL_BLUE); a = x()+70;
+ fl_point(a+10, b+10); fl_point(a+20, b+20);
+ fl_point(a+10, b+20); fl_point(a+20, b+10);
+ }
+};
+void fl_point_test() {
+ point_test_ix = win->children();
+ Fl_Group *page = beginTestPage(
+ "testing the fl_point call\n"
+ "You should see four pixels each in black, red, green and blue. "
+ "Make sure that pixels are not anti-aliased (blured across multiple pixels)!"
+ );
+ new PointTest(20, 140, 100, 100);
+ page->end();
+}
+
+//------- test the line drawing capabilities of this implementation ----------
+class LineTest : public Fl_Widget {
+public: LineTest(int x, int y, int w, int h) : Fl_Widget(x, y, w, h) {}
+ void draw() {
+ int a = x(), b = y(); fl_color(FL_BLACK); fl_rect(a, b, w(), h());
+ // testing fl_xyline(x, y, x1)
+ fl_color(FL_RED); fl_point(a+10, b+10); fl_point(a+20, b+10);
+ fl_color(FL_BLACK); fl_xyline(a+10, b+10, a+20);
+ // testing fl_xyline(x, y, x1, y2);
+ fl_color(FL_RED); fl_point(a+10, b+20); fl_point(a+20, b+20);
+ fl_point(a+20, b+30);
+ fl_color(FL_BLACK); fl_xyline(a+10, b+20, a+20, b+30);
+ // testing fl_xyline(x, y, x1, y2, x3);
+ fl_color(FL_RED); fl_point(a+10, b+40); fl_point(a+20, b+40);
+ fl_point(a+20, b+50); fl_point(a+30, b+50);
+ fl_color(FL_BLACK); fl_xyline(a+10, b+40, a+20, b+50, a+30);
+ //+++ add testing for the fl_yxline commands!
+ // testing fl_loop(x,y, x,y, x,y, x, y)
+ fl_color(FL_RED); fl_point(a+60, b+60); fl_point(a+90, b+60);
+ fl_point(a+60, b+90); fl_point(a+90, b+90);
+ fl_color(FL_BLACK);
+ fl_loop(a+60, b+60, a+90, b+60, a+90, b+90, a+60, b+90);
+ }
+};
+void fl_line_test() {
+ line_test_ix = win->children();
+ Fl_Group *page = beginTestPage(
+ "testing the integer based fl_line calls\n"
+ "No red pixels should be visible. "
+ "If you see bright red pixels, the line drawing alignment is off, "
+ "or the last pixel in a line does not get drawn. "
+ "If you see dark red pixels, anti-aliasing must be switched off."
+ );
+ new LineTest(20, 140, 100, 100);
+ page->end();
+}
+
+//------- test the line drawing capabilities of this implementation ----------
+class RectTest : public Fl_Widget {
+public: RectTest(int x, int y, int w, int h) : Fl_Widget(x, y, w, h) {}
+ void draw() {
+ int a = x(), b = y(); fl_color(FL_BLACK); fl_rect(a, b, w(), h());
+ // testing fl_rect() with positive size
+ fl_color(FL_RED); fl_loop(a+10, b+10, a+40, b+10, a+40, b+40, a+10, b+40);
+ fl_color(FL_GREEN); fl_loop(a+ 9, b+ 9, a+41, b+ 9, a+41, b+41, a+ 9, b+41);
+ fl_color(FL_GREEN); fl_loop(a+11, b+11, a+39, b+11, a+39, b+39, a+11, b+39);
+ fl_color(FL_BLACK); fl_rect(a+10, b+10, 31, 31);
+ // testing fl_rect() with positive size
+ fl_color(FL_RED); fl_loop(a+60, b+60, a+90, b+60, a+90, b+90, a+60, b+90);
+ fl_color(FL_GREEN); fl_loop(a+59, b+59, a+91, b+59, a+91, b+91, a+59, b+91);
+ fl_color(FL_BLACK); fl_rectf(a+60, b+60, 31, 31);
+ }
+};
+void fl_rect_test() {
+ rect_test_ix = win->children();
+ Fl_Group *page = beginTestPage(
+ "testing the fl_rect call\n"
+ "No red pixels should be visible. "
+ "If you see bright red lines, or if parts of the green frames are hidden, "
+ "the rect drawing alignment is off. "
+ );
+ new RectTest(20, 140, 100, 100);
+ page->end();
+}
+
+//------- test the line drawing capabilities of this implementation ----------
+class ViewportTest : public Fl_Widget {
+ int pos;
+public: ViewportTest(int x, int y, int w, int h, int p) : Fl_Widget(x, y, w, h),
+ pos(p) {}
+ void draw() {
+ if (pos&1) {
+ fl_color(FL_RED); fl_yxline(x()+w(), y(), y()+h());
+ fl_color(FL_GREEN); fl_yxline(x()+w()-1, y(), y()+h());
+ } else {
+ fl_color(FL_RED); fl_yxline(x()-1, y(), y()+h());
+ fl_color(FL_GREEN); fl_yxline(x(), y(), y()+h());
+ }
+ if (pos&2) {
+ fl_color(FL_RED); fl_xyline(x(), y()+h(), x()+w());
+ fl_color(FL_GREEN); fl_xyline(x(), y()+h()-1, x()+w());
+ } else {
+ fl_color(FL_RED); fl_xyline(x(), y()-1, x()+w());
+ fl_color(FL_GREEN); fl_xyline(x(), y(), x()+w());
+ }
+ fl_color(FL_BLACK);
+ fl_loop(x()+3, y()+3, x()+w()-4, y()+3, x()+w()-4, y()+h()-4, x()+3, y()+h()-4);
+ }
+};
+void fl_viewport_test() {
+ viewport_test_ix = win->children();
+ Fl_Group *page = beginTestPage(
+ "testing viewport alignment\n"
+ "Only green lines should be visible. "
+ "If red lines are visible in the corners of this window, "
+ "your viewport alignment and clipping is off. "
+ "If there is a space between the green lines and the window border, "
+ "the viewport is off, but some clipping may be working. "
+ "Also, your window size may be off to begin with."
+ );
+ new ViewportTest(0, 0, 20, 20, 0);
+ new ViewportTest(page->w()-20, 0, 20, 20, 1);
+ new ViewportTest(0, page->h()-20, 20, 20, 2);
+ new ViewportTest(page->w()-20,page->h()-20, 20, 20, 3);
+ page->end();
+}
+
+//------- test the circle drawing capabilities of this implementation ----------
+class CircleTest : public Fl_Widget {
+public: CircleTest(int x, int y, int w, int h) : Fl_Widget(x, y, w, h) {}
+ void draw() {
+ int a = x(), b = y(); fl_color(FL_BLACK); fl_rect(a, b, 100, 100);
+ // test fl_arc for full circles
+ fl_color(FL_GREEN); fl_rect(a+ 9, b+ 9, 33, 33);
+ fl_color(FL_RED); fl_xyline(a+24, b+10, a+27); fl_xyline(a+24, b+40, a+27);
+ fl_yxline(a+10, b+24, b+27); fl_yxline(a+40, b+24, b+27);
+ fl_color(FL_BLACK); fl_arc(a+10, b+10, 31, 31, 0.0, 360.0);
+ // test fl_arc segmet 1
+ fl_color(FL_GREEN); fl_rect(a+54, b+ 4, 43, 43);
+ fl_rect(a+54, b+4, 18, 18); fl_rect(a+79, b+29, 18, 18);
+ fl_color(FL_RED); fl_point(a+55, b+30); fl_point(a+70, b+45);
+ fl_point(a+80, b+5); fl_point(a+95, b+20);
+ fl_color(FL_BLACK); fl_arc(a+65, b+ 5, 31, 31, -35.0, 125.0);
+ // test fl_arc segmet 2
+ fl_color(FL_BLACK); fl_arc(a+55, b+15, 31, 31, 145.0, 305.0);
+ // test fl_pie for full circles
+ fl_color(FL_RED); fl_xyline(a+24, b+60, a+27); fl_xyline(a+24, b+90, a+27);
+ fl_yxline(a+10, b+74, b+77); fl_yxline(a+40, b+74, b+77);
+ fl_color(FL_GREEN); fl_rect(a+ 9, b+59, 33, 33);
+ fl_color(FL_BLACK); fl_pie(a+10, b+60, 31, 31, 0.0, 360.0);
+ // test fl_pie segmet 1
+ fl_color(FL_GREEN); fl_rect(a+54, b+54, 43, 43);
+ fl_rect(a+54, b+54, 18, 18); fl_rect(a+79, b+79, 18, 18);
+ fl_point(a+79, b+71); fl_point(a+71, b+79);
+ fl_color(FL_RED); fl_point(a+55, b+80); fl_point(a+70, b+95);
+ fl_point(a+80, b+55); fl_point(a+95, b+70);
+ fl_point(a+81, b+69); fl_point(a+69, b+81);
+ fl_color(FL_BLACK); fl_pie(a+65, b+55, 31, 31, -30.0, 120.0);
+ // test fl_pie segmet 2
+ fl_color(FL_BLACK); fl_pie(a+55, b+65, 31, 31, 150.0, 300.0);
+ //---- oval testing (horizontal squish)
+ a = x()+120; b = y(); fl_color(FL_BLACK); fl_rect(a, b, 100, 100);
+ fl_color(FL_GREEN);
+ fl_rect(a+19, b+9, 63, 33); fl_rect(a+19, b+59, 63, 33);
+ fl_color(FL_BLACK);
+ fl_arc(a+20, b+10, 61, 31, 0, 360); fl_pie(a+20, b+60, 61, 31, 0, 360);
+ //---- oval testing (horizontal squish)
+ a = x()+240; b = y(); fl_color(FL_BLACK); fl_rect(a, b, 100, 100);
+ fl_color(FL_GREEN);
+ fl_rect(a+9, b+19, 33, 63); fl_rect(a+59, b+19, 33, 63);
+ fl_color(FL_BLACK);
+ fl_arc(a+10, b+20, 31, 61, 0, 360); fl_pie(a+60, b+20, 31, 61, 0, 360);
+ }
+};
+void fl_circle_test() {
+ circle_test_ix = win->children();
+ Fl_Group *page = beginTestPage(
+ "testing int drawing of circles and ovals (fl_arc, fl_pie)\n"
+ "No red lines should be visible. "
+ "If you see bright red pixels, the circle drawing alignment is off. "
+ "If you see dark red pixels, your syste supports anti-aliasing "
+ "which should be of no concern. "
+ "The green rectangles should not be touched by circle drawings."
+ );
+ new CircleTest(20, 140, 340, 100);
+ page->end();
+}
+
+int main(int argc, char **argv) {
+ win = new Fl_Window(600, 600, "Unit Tests for FLTK");
+ // --- list all tests
+ fl_point_test();
+ fl_line_test();
+ fl_rect_test();
+ fl_viewport_test();
+ fl_circle_test();
+ // --- last page is the menu
+ createMenuPage();
+ win->end();
+ win->show(argc, argv);
+ return Fl::run();
+}
+
+
+//
+// End of "$Id: unittests.cxx 5845 2007-05-20 00:01:06Z mike $".
+//
diff --git a/third_party/windows/fltk-1.1.10/test/valuators.fl b/third_party/windows/fltk-1.1.10/test/valuators.fl
new file mode 100644
index 0000000..8c53b4d
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/valuators.fl
@@ -0,0 +1,198 @@
+# data file for the Fltk User Interface Designer (fluid)
+version 1.0107
+header_name {.h}
+code_name {.cxx}
+Function {callback(Fl_Widget* o, void*)} {open private return_type void
+} {
+ code {printf("%g \\r", ((Fl_Valuator*)o)->value());
+fflush(stdout);} {}
+}
+
+Function {} {open
+} {
+ Fl_Window {} {
+ label {Valuator classes, showing values for type()} open
+ xywh {479 151 580 510} type Double color 43 selection_color 43
+ code0 {\#include <stdio.h>} visible
+ } {
+ Fl_Box {} {
+ label Fl_Slider
+ xywh {10 10 280 210} box ENGRAVED_BOX labelfont 1 align 17
+ }
+ Fl_Slider {} {
+ label 0
+ callback callback
+ tooltip {Vertical Slider} xywh {30 45 20 145} selection_color 1 labelsize 8 align 1
+ }
+ Fl_Slider {} {
+ label FL_VERT_FILL_SLIDER
+ callback callback
+ xywh {70 55 20 145} type {Vert Fill} selection_color 1 labelsize 8
+ }
+ Fl_Slider {} {
+ label FL_VERT_NICE_SLIDER
+ callback callback
+ xywh {105 45 20 145} type {Vert Knob} box FLAT_BOX color 10 selection_color 1 labelsize 8 align 1
+ }
+ Fl_Slider {} {
+ label FL_HORIZONTAL
+ callback callback
+ xywh {140 80 130 20} type Horizontal selection_color 1 labelsize 8
+ }
+ Fl_Slider {} {
+ label FL_HOR_FILL_SLIDER
+ callback callback
+ xywh {140 120 130 20} type {Horz Fill} selection_color 1 labelsize 8
+ }
+ Fl_Slider {} {
+ label FL_HOR_NICE_SLIDER
+ callback callback
+ xywh {140 160 130 20} type {Horz Knob} box FLAT_BOX color 10 selection_color 1 labelsize 8
+ }
+ Fl_Box {} {
+ label Fl_Value_Slider
+ xywh {10 230 280 210} box ENGRAVED_BOX labelfont 1 align 17
+ }
+ Fl_Value_Slider {} {
+ label 0
+ callback callback
+ tooltip {Value Slider} xywh {30 260 30 145} selection_color 1 labelsize 8 align 1
+ }
+ Fl_Value_Slider {} {
+ label FL_VERT_FILL_SLIDER
+ callback callback
+ xywh {70 275 30 140} type {Vert Fill} selection_color 1 labelsize 8
+ }
+ Fl_Value_Slider {} {
+ label FL_VERT_NICE_SLIDER
+ callback callback
+ xywh {110 260 20 145} type {Vert Knob} box FLAT_BOX color 10 selection_color 1 labelsize 8 align 1
+ }
+ Fl_Value_Slider {} {
+ label FL_HOR_SLIDER
+ callback callback
+ xywh {140 290 130 20} type Horizontal selection_color 1 labelsize 8
+ }
+ Fl_Value_Slider {} {
+ label FL_HOR_FILL_SLIDER
+ callback callback
+ xywh {140 330 130 20} type {Horz Fill} selection_color 1 labelsize 8
+ }
+ Fl_Value_Slider {} {
+ label FL_HOR_NICE_SLIDER
+ callback callback
+ xywh {140 370 130 20} type {Horz Knob} box FLAT_BOX color 10 selection_color 1 labelsize 8
+ }
+ Fl_Box {} {
+ label Fl_Value_Input
+ xywh {10 450 135 50} box ENGRAVED_BOX labelfont 1 align 17
+ }
+ Fl_Value_Input {} {
+ label 0
+ callback callback
+ tooltip {Value Input} xywh {30 470 105 25} labelsize 8 maximum 100 step 0.1
+ }
+ Fl_Box {} {
+ label Fl_Value_Output
+ xywh {155 450 135 50} box ENGRAVED_BOX labelfont 1 align 17
+ }
+ Fl_Value_Output {} {
+ label 0
+ callback callback
+ tooltip {Value Output} xywh {170 470 105 25} labelsize 8 maximum 100 step 0.1
+ }
+ Fl_Box {} {
+ label { Fl_Scrollbar}
+ xywh {300 10 130 120} box ENGRAVED_BOX labelfont 1 align 21
+ }
+ Fl_Scrollbar {} {
+ label FL_HORIZONTAL
+ callback callback
+ tooltip {Horizontal Scrollbar} xywh {305 65 95 20} type Horizontal labelsize 8 maximum 100 value 20
+ }
+ Fl_Scrollbar {} {
+ label 0
+ callback callback
+ tooltip {Vertical Scrollbar} xywh {400 20 20 105} labelsize 8 align 1 maximum 100
+ }
+ Fl_Box {} {
+ label Fl_Adjuster
+ xywh {440 10 130 120} box ENGRAVED_BOX labelfont 1 align 17
+ }
+ Fl_Adjuster {} {
+ label {w()>h()}
+ callback callback
+ tooltip {Horizontal Adjuster} xywh {450 60 75 25} labelsize 8
+ }
+ Fl_Adjuster {} {
+ label {w()<h()}
+ callback callback
+ tooltip {Vertical Adjuster} xywh {530 35 25 75} labelsize 8
+ }
+ Fl_Box {} {
+ label Fl_Counter
+ xywh {300 140 130 120} box ENGRAVED_BOX labelfont 1 align 17
+ }
+ Fl_Counter {} {
+ label 0
+ callback callback
+ tooltip {Standard Counter} xywh {310 175 110 25} labelsize 8
+ }
+ Fl_Counter {} {
+ label FL_SIMPLE_COUNTER
+ callback callback
+ tooltip {Simple Counter} xywh {310 215 110 25} type Simple labelsize 8
+ }
+ Fl_Box {} {
+ label Fl_Spinner
+ xywh {440 140 130 120} box ENGRAVED_BOX labelfont 1 align 17
+ }
+ Fl_Spinner {} {
+ label FL_INT_INPUT
+ xywh {465 176 80 24} labelsize 8 align 2 minimum -30 maximum 30 step 2 value 5
+ }
+ Fl_Spinner {} {
+ label FL_FLOAT_INPUT
+ xywh {465 216 80 24} type Float labelsize 8 align 2 minimum 0 maximum 1 step 0.01 value 0.05
+ }
+ Fl_Box {} {
+ label Fl_Dial
+ xywh {300 270 270 105} box ENGRAVED_BOX labelfont 1 align 17
+ }
+ Fl_Dial {} {
+ label 0
+ callback callback
+ tooltip {Standard Dial} xywh {320 295 65 65} color 10 selection_color 1 labelsize 8 value 0.5
+ code0 {o->angles(0,315);}
+ }
+ Fl_Dial {} {
+ label FL_LINE_DIAL
+ callback callback
+ tooltip {Line Dial} xywh {400 295 65 65} type Line color 10 selection_color 1 labelsize 8 value 0.5
+ }
+ Fl_Dial {} {
+ label FL_FILL_DIAL
+ callback callback
+ tooltip {Fill Dial} xywh {480 295 65 65} type Fill color 10 selection_color 1 labelsize 8 value 1
+ code0 {o->angles(0,360);}
+ }
+ Fl_Box {} {
+ label Fl_Roller
+ xywh {300 385 150 115} box ENGRAVED_BOX labelfont 1 align 17
+ }
+ Fl_Roller {} {
+ label 0
+ callback callback
+ tooltip {Vertical Roller} xywh {315 390 20 95} labelsize 8
+ }
+ Fl_Roller {} {
+ label FL_HORIZONTAL
+ callback callback
+ tooltip {Horizontal Roller} xywh {345 430 90 20} type Horizontal labelsize 8
+ }
+ Fl_Box {} {
+ label {Some widgets have color(FL_GREEN) and color2(FL_RED) to show the areas these effect.} selected
+ xywh {460 385 110 115} box BORDER_FRAME color 0 selection_color 0 labelsize 11 align 128
+ }
+ }
+}