diff options
| author | Matthias Melcher <fltk@matthiasm.com> | 2011-01-08 16:31:55 +0000 |
|---|---|---|
| committer | Matthias Melcher <fltk@matthiasm.com> | 2011-01-08 16:31:55 +0000 |
| commit | 0b6b69caaa4de4cd3bf5a2e2ebb1a94b1132e823 (patch) | |
| tree | 4846fe3e800834b33783921688014c7b9cd2ee69 /branch-3.0-2011/test | |
| parent | 2dc664935d8109767c2d107c6b644082fe06ac05 (diff) | |
Accidentaly copied here
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8219 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'branch-3.0-2011/test')
160 files changed, 0 insertions, 27538 deletions
diff --git a/branch-3.0-2011/test/CMakeLists.txt b/branch-3.0-2011/test/CMakeLists.txt deleted file mode 100644 index a2cba8840..000000000 --- a/branch-3.0-2011/test/CMakeLists.txt +++ /dev/null @@ -1,138 +0,0 @@ -set(EXECUTABLE_OUTPUT_PATH ${FLTK_BINARY_DIR}/bin/examples) - -####################################################################### -# audio libs for test apps -if(WIN32) - set(AUDIOLIBS winmm) -elseif(APPLE) - set(AUDIOLIBS "-framework CoreAudio") -elseif(HAVE_ALSA_ASOUNDLIB_H) - set(AUDIOLIBS -lasound) -endif(WIN32) - -####################################################################### -macro(CREATE_EXAMPLE NAME SOURCES LIBRARIES) - set(srcs) - set(flsrcs) - foreach(src ${SOURCES}) - if("${src}" MATCHES ".fl$") - list(APPEND flsrcs ${src}) - else() - list(APPEND srcs ${src}) - endif("${src}" MATCHES ".fl$") - endforeach(src) - - if(flsrcs) - fltk_wrap_ui(${NAME} ${flsrcs}) - endif(flsrcs) - - add_executable(${NAME} WIN32 ${srcs} ${${NAME}_FLTK_UI_SRCS}) - if(flsrcs) - add_dependencies(${NAME} ${FLTK_FLUID_EXECUTABLE}) - endif(flsrcs) - target_link_libraries(${NAME} ${LIBRARIES}) - - # link in optional libraries - if(FLTK_HAVE_CAIRO) - target_link_libraries(${NAME} fltk_cairo) - endif(FLTK_HAVE_CAIRO) - - if(USE_XFT) - target_link_libraries(${NAME} ${X11_Xft_LIB}) - endif(USE_XFT) - - if(HAVE_XINERAMA) - target_link_libraries(${NAME} ${X11_Xinerama_LIB}) - endif(HAVE_XINERAMA) - - install(TARGETS ${NAME} - DESTINATION ${PREFIX_DOC}/examples - ) -endmacro(CREATE_EXAMPLE NAME SOURCES LIBRARIES) - -####################################################################### -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(blocks blocks.cxx "fltk;${AUDIOLIBS}") -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(device device.cxx fltk) -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(input_choice input_choice.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(native-filechooser native-filechooser.cxx "fltk;fltk_images") -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(rotated_text rotated_text.cxx fltk) -CREATE_EXAMPLE(scroll scroll.cxx fltk) -CREATE_EXAMPLE(subwindow subwindow.cxx fltk) -CREATE_EXAMPLE(sudoku sudoku.cxx "fltk;fltk_images;${AUDIOLIBS}") -CREATE_EXAMPLE(symbols symbols.cxx fltk) -CREATE_EXAMPLE(tabs tabs.fl fltk) -CREATE_EXAMPLE(table table.cxx fltk) -CREATE_EXAMPLE(threads threads.cxx fltk) -CREATE_EXAMPLE(tile tile.cxx fltk) -CREATE_EXAMPLE(tiled_image tiled_image.cxx fltk) -CREATE_EXAMPLE(tree tree.fl fltk) -CREATE_EXAMPLE(utf8 utf8.cxx fltk) -CREATE_EXAMPLE(valuators valuators.fl fltk) -CREATE_EXAMPLE(unittests unittests.cxx 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) - -# Cairo demo -if(FLTK_HAVE_CAIRO) - CREATE_EXAMPLE(cairo_test cairo_test.cxx fltk) -endif(FLTK_HAVE_CAIRO) diff --git a/branch-3.0-2011/test/CubeMain.cxx b/branch-3.0-2011/test/CubeMain.cxx deleted file mode 100644 index b2347c87e..000000000 --- a/branch-3.0-2011/test/CubeMain.cxx +++ /dev/null @@ -1,49 +0,0 @@ -// -// "$Id$" -// -// CubeView class . -// -// Copyright 1998-2010 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$". -// diff --git a/branch-3.0-2011/test/CubeView.cxx b/branch-3.0-2011/test/CubeView.cxx deleted file mode 100644 index 52d9d1604..000000000 --- a/branch-3.0-2011/test/CubeView.cxx +++ /dev/null @@ -1,173 +0,0 @@ -// -// "$Id$" -// -// CubeView class implementation for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2010 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$". -// diff --git a/branch-3.0-2011/test/CubeView.h b/branch-3.0-2011/test/CubeView.h deleted file mode 100644 index 86f38b6c0..000000000 --- a/branch-3.0-2011/test/CubeView.h +++ /dev/null @@ -1,124 +0,0 @@ -// -// "$Id$" -// -// CubeView class definitions for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2010 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$". -// diff --git a/branch-3.0-2011/test/CubeViewUI.fl b/branch-3.0-2011/test/CubeViewUI.fl deleted file mode 100644 index da8e196e0..000000000 --- a/branch-3.0-2011/test/CubeViewUI.fl +++ /dev/null @@ -1,75 +0,0 @@ -# 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/branch-3.0-2011/test/Makefile b/branch-3.0-2011/test/Makefile deleted file mode 100644 index e6eb159bf..000000000 --- a/branch-3.0-2011/test/Makefile +++ /dev/null @@ -1,506 +0,0 @@ -# -# "$Id$" -# -# Test/example program makefile for the Fast Light Tool Kit (FLTK). -# -# Copyright 1998-2010 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 \ - cairo_test.cxx \ - checkers.cxx \ - clock.cxx \ - colbrowser.cxx \ - color_chooser.cxx \ - cube.cxx \ - CubeMain.cxx \ - CubeView.cxx \ - cursor.cxx \ - curve.cxx \ - demo.cxx \ - device.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 \ - native-filechooser.cxx \ - navigation.cxx \ - output.cxx \ - overlay.cxx \ - pack.cxx \ - pixmap_browser.cxx \ - pixmap.cxx \ - preferences.cxx \ - device.cxx \ - radio.cxx \ - resizebox.cxx \ - resize.cxx \ - rotated_text.cxx \ - scroll.cxx \ - shape.cxx \ - subwindow.cxx \ - sudoku.cxx \ - symbols.cxx \ - table.cxx \ - tabs.cxx \ - threads.cxx \ - tile.cxx \ - tiled_image.cxx \ - tree.cxx \ - valuators.cxx \ - utf8.cxx - -ALL = \ - unittests$(EXEEXT) \ - adjuster$(EXEEXT) \ - arc$(EXEEXT) \ - ask$(EXEEXT) \ - bitmap$(EXEEXT) \ - blocks$(EXEEXT) \ - boxtype$(EXEEXT) \ - browser$(EXEEXT) \ - button$(EXEEXT) \ - buttons$(EXEEXT) \ - cairo_test$(EXEEXT) \ - checkers$(EXEEXT) \ - clock$(EXEEXT) \ - colbrowser$(EXEEXT) \ - color_chooser$(EXEEXT) \ - cursor$(EXEEXT) \ - curve$(EXEEXT) \ - demo$(EXEEXT) \ - device$(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) \ - native-filechooser$(EXEEXT) \ - navigation$(EXEEXT) \ - output$(EXEEXT) \ - overlay$(EXEEXT) \ - pack$(EXEEXT) \ - pixmap$(EXEEXT) \ - pixmap_browser$(EXEEXT) \ - preferences$(EXEEXT) \ - device$(EXEEXT) \ - radio$(EXEEXT) \ - resize$(EXEEXT) \ - resizebox$(EXEEXT) \ - rotated_text$(EXEEXT) \ - scroll$(EXEEXT) \ - subwindow$(EXEEXT) \ - sudoku$(EXEEXT) \ - symbols$(EXEEXT) \ - table$(EXEEXT) \ - tabs$(EXEEXT) \ - $(THREADS) \ - tile$(EXEEXT) \ - tiled_image$(EXEEXT) \ - tree$(EXEEXT) \ - valuators$(EXEEXT) \ - cairotest$(EXEEXT) \ - utf8$(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 - -unittests.cxx: unittest_about.cxx unittest_points.cxx unittest_lines.cxx unittest_circles.cxx \ - unittest_rects.cxx unittest_text.cxx unittest_viewport.cxx unittest_images.cxx - -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 - -checkers$(EXEEXT): checkers.o - echo Linking $@... - $(CXX) $(ARCHFLAGS) $(LDFLAGS) checkers.o -o $@ $(LINKFLTK) $(LDLIBS) - $(OSX_ONLY) $(INSTALL_BIN) checkers$(EXEEXT) checkers.app/Contents/MacOS - -clock$(EXEEXT): clock.o - -colbrowser$(EXEEXT): colbrowser.o - echo Linking $@... - $(CXX) $(ARCHFLAGS) $(LDFLAGS) -o $@ colbrowser.o $(LINKFLTKFORMS) $(LDLIBS) - -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) - -device$(EXEEXT): device.o $(IMGLIBNAME) - echo Linking $@... - $(CXX) $(ARCHFLAGS) $(LDFLAGS) device.o -o $@ $(LINKFLTKIMG) $(LDLIBS) - -doublebuffer$(EXEEXT): doublebuffer.o - -editor$(EXEEXT): editor.o - echo Linking $@... - $(CXX) $(ARCHFLAGS) $(LDFLAGS) editor.o -o $@ $(LINKFLTKIMG) $(LDLIBS) - -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) - -fonts$(EXEEXT): fonts.o - -forms$(EXEEXT): forms.o - echo Linking $@... - $(CXX) $(ARCHFLAGS) $(LDFLAGS) -o $@ forms.o $(LINKFLTKFORMS) $(LDLIBS) - -hello$(EXEEXT): hello.o - -help$(EXEEXT): help.o $(IMGLIBNAME) - echo Linking $@... - $(CXX) $(ARCHFLAGS) $(LDFLAGS) help.o -o $@ $(LINKFLTKIMG) $(LDLIBS) - -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) -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) - -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) -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 - -native-filechooser$(EXEEXT): native-filechooser.o $(IMGLIBNAME) - echo Linking $@... - $(CXX) $(ARCHFLAGS) $(LDFLAGS) native-filechooser.o -o $@ $(LINKFLTKIMG) $(LDLIBS) - -native-filechooser.o: ../FL/Fl_Native_File_Chooser_WIN32.H ../FL/Fl_Native_File_Chooser_MAC.H - -navigation$(EXEEXT): navigation.o - -output$(EXEEXT): output.o $(FLLIBNAME) - echo Linking $@... - $(CXX) $(ARCHFLAGS) $(LDFLAGS) -o $@ output.o $(LINKFLTKFORMS) $(LDLIBS) - -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) - -preferences$(EXEEXT): preferences.o -preferences.cxx: preferences.fl ../fluid/fluid$(EXEEXT) - -device$(EXEEXT): device.o - -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 - -rotated_text$(EXEEXT): rotated_text.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 - -sudoku.exe: sudoku.o sudoku.rc - echo Linking $@... - $(RC) sudoku.rc sudokures.o - $(CXX) $(ARCHFLAGS) $(LDFLAGS) sudoku.o sudokures.o -o $@ $(AUDIOLIBS) $(LINKFLTKIMG) $(LDLIBS) - -symbols$(EXEEXT): symbols.o - -table$(EXEEXT): table.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 - -tree$(EXEEXT): tree.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) -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) - -fractals$(EXEEXT): fractals.o fracviewer.o - echo Linking $@... - $(CXX) $(ARCHFLAGS) $(LDFLAGS) -o $@ fractals.o fracviewer.o $(LINKFLTKGL) $(LINKFLTK) $(GLDLIBS) - -fullscreen$(EXEEXT): fullscreen.o - echo Linking $@... - $(CXX) $(ARCHFLAGS) $(LDFLAGS) -o $@ fullscreen.o $(LINKFLTKGL) $(LINKFLTK) $(GLDLIBS) - -glpuzzle$(EXEEXT): glpuzzle.o - echo Linking $@... - $(CXX) $(ARCHFLAGS) $(LDFLAGS) -o $@ glpuzzle.o $(LINKFLTKGL) $(LINKFLTK) $(GLDLIBS) - -gl_overlay$(EXEEXT): gl_overlay.o - echo Linking $@... - $(CXX) $(ARCHFLAGS) $(LDFLAGS) -o $@ gl_overlay.o $(LINKFLTKGL) $(LINKFLTK) $(GLDLIBS) - -shape$(EXEEXT): shape.o - echo Linking $@... - $(CXX) $(ARCHFLAGS) $(LDFLAGS) -o $@ shape.o $(LINKFLTKGL) $(LINKFLTK) $(GLDLIBS) - -cairo_test$(EXEEXT): cairo_test.o - echo Linking $@... - $(CXX) $(ARCHFLAGS) $(CAIROFLAGS) $(LDFLAGS) -o $@ cairo_test.o $(LINKFLTK) $(LINKFLTKCAIRO) $(GLDLIBS) - -# -# End of "$Id$". -# diff --git a/branch-3.0-2011/test/README b/branch-3.0-2011/test/README deleted file mode 100644 index ce07c23a1..000000000 --- a/branch-3.0-2011/test/README +++ /dev/null @@ -1,30 +0,0 @@ -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/branch-3.0-2011/test/adjuster.cxx b/branch-3.0-2011/test/adjuster.cxx deleted file mode 100644 index 39442c0aa..000000000 --- a/branch-3.0-2011/test/adjuster.cxx +++ /dev/null @@ -1,66 +0,0 @@ -// -// "$Id$" -// -// Adjuster test program for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2010 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_Double_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_Double_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$". -// diff --git a/branch-3.0-2011/test/arc.cxx b/branch-3.0-2011/test/arc.cxx deleted file mode 100644 index 77d37a96f..000000000 --- a/branch-3.0-2011/test/arc.cxx +++ /dev/null @@ -1,99 +0,0 @@ -// -// "$Id$" -// -// Arc drawing test program for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2010 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_push_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[fl_intptr_t(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$". -// - diff --git a/branch-3.0-2011/test/ask.cxx b/branch-3.0-2011/test/ask.cxx deleted file mode 100644 index cfe1dcbd6..000000000 --- a/branch-3.0-2011/test/ask.cxx +++ /dev/null @@ -1,95 +0,0 @@ -// -// "$Id$" -// -// 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-2010 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_Double_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 update_input_text(Fl_Widget* o, const char *input) { - if (input) { - o->copy_label(input); - o->redraw(); - } -} - -void rename_me(Fl_Widget*o) { - const char *input = fl_input("Input:", o->label()); - update_input_text(o, input); -} - -void rename_me_pwd(Fl_Widget*o) { - const char *input = fl_password("Input PWD:", o->label()); - update_input_text(o, input); -} - -void window_callback(Fl_Widget*, void*) { - int rep = fl_choice("Are you sure you want to quit?", - "Cancel", "Quit", "Dunno"); - if (rep==1) - exit(0); - else if (rep==2) - fl_message("Well, maybe you should know before we quit."); -} - -int main(int argc, char **argv) { - char buffer[128] = "Test text"; - char buffer2[128] = "MyPassword"; - -// this is a test to make sure automatic destructors work. Pop up -// the question dialog several times and make sure it doesn't crash. -// fc: added more fl_ask common dialogs for test cases purposes. - - Fl_Double_Window window(200, 105); - Fl_Return_Button b(20, 10, 160, 35, buffer); b.callback(rename_me); - Fl_Button b2(20, 50, 160, 35, buffer2); b2.callback(rename_me_pwd); - 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$". -// diff --git a/branch-3.0-2011/test/bitmap.cxx b/branch-3.0-2011/test/bitmap.cxx deleted file mode 100644 index 550db63df..000000000 --- a/branch-3.0-2011/test/bitmap.cxx +++ /dev/null @@ -1,147 +0,0 @@ -// -// "$Id$" -// -// Bitmap label test program for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2010 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_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_Double_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_Double_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$". -// diff --git a/branch-3.0-2011/test/blocks.app/Contents/Info.plist b/branch-3.0-2011/test/blocks.app/Contents/Info.plist deleted file mode 100644 index dcc528aa1..000000000 --- a/branch-3.0-2011/test/blocks.app/Contents/Info.plist +++ /dev/null @@ -1,44 +0,0 @@ -<?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/branch-3.0-2011/test/blocks.app/Contents/PkgInfo b/branch-3.0-2011/test/blocks.app/Contents/PkgInfo deleted file mode 100644 index 103810afb..000000000 --- a/branch-3.0-2011/test/blocks.app/Contents/PkgInfo +++ /dev/null @@ -1 +0,0 @@ -BLKSBlks diff --git a/branch-3.0-2011/test/blocks.app/Contents/Resources/blocks.icns b/branch-3.0-2011/test/blocks.app/Contents/Resources/blocks.icns Binary files differdeleted file mode 100644 index 7e7ba24eb..000000000 --- a/branch-3.0-2011/test/blocks.app/Contents/Resources/blocks.icns +++ /dev/null diff --git a/branch-3.0-2011/test/blocks.cxx b/branch-3.0-2011/test/blocks.cxx deleted file mode 100644 index ec7e298da..000000000 --- a/branch-3.0-2011/test/blocks.cxx +++ /dev/null @@ -1,1030 +0,0 @@ -// -// "$Id$" -// -// "Block Attack!" scrolling blocks game using the Fast Light Tool Kit (FLTK). -// -// Copyright 2006-2010 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; -# if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 - AudioDeviceIOProcID audio_proc_id; -# endif - 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 and start the device -# if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 - if (AudioDeviceCreateIOProcID(device, audio_cb, (void *)this, &audio_proc_id) != noErr) return; - AudioDeviceStart(device, audio_proc_id); -# else - if (AudioDeviceAddIOProc(device, audio_cb, (void *)this) != noErr) return; - AudioDeviceStart(device, audio_cb); -# endif - - 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(¶ms); - 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) { -# if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 - AudioDeviceStop(device, audio_proc_id); - AudioDeviceDestroyIOProcID(device, audio_proc_id); -# else - AudioDeviceStop(device, audio_cb); - AudioDeviceRemoveIOProc(device, audio_cb); -# endif - } - -#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$". -// diff --git a/branch-3.0-2011/test/boxtype.cxx b/branch-3.0-2011/test/boxtype.cxx deleted file mode 100644 index 9316d3b6a..000000000 --- a/branch-3.0-2011/test/boxtype.cxx +++ /dev/null @@ -1,128 +0,0 @@ -// -// "$Id$" -// -// Boxtype test program for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2010 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_Double_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$". -// diff --git a/branch-3.0-2011/test/browser.cxx b/branch-3.0-2011/test/browser.cxx deleted file mode 100644 index e433c1cdb..000000000 --- a/branch-3.0-2011/test/browser.cxx +++ /dev/null @@ -1,197 +0,0 @@ -// -// "$Id$" -// -// Browser test program for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2010 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, - *sort; -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 -} - -void sort_cb(Fl_Widget *, void *) { - browser->sort(FL_SORT_ASCENDING); -} - -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_Double_Window window(480,400,fname); - browser = new Fl_Select_Browser(0,0,480,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)) { - int done = 0; -#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 - if ( i == argc ) - { - fname = "../test/browser.cxx"; - done = browser->load(fname); - } -#elif defined(USING_XCODE) - if ( i == argc ) - { - char buf[2048]; - strcpy(buf, argv[0]); - char *slash = strrchr(buf, '/'); - if (slash) - strcpy(slash, "/../Resources/browser.cxx"); - done = browser->load(buf); - } -#endif - if ( !done ) - { - fl_message("Can't load %s, %s\n", fname, strerror(errno)); - exit(1); - } - } - browser->position(0); - - field = new Fl_Int_Input(50, 350, 430, 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)"); - - sort = new Fl_Button(400, 375, 80, 25, "Sort"); - sort->callback(sort_cb); - - window.resizable(browser); - window.show(argc,argv); - return Fl::run(); -} - -// -// End of "$Id$". -// - diff --git a/branch-3.0-2011/test/button.cxx b/branch-3.0-2011/test/button.cxx deleted file mode 100644 index f2b9e8fad..000000000 --- a/branch-3.0-2011/test/button.cxx +++ /dev/null @@ -1,68 +0,0 @@ -// -// "$Id$" -// -// Button/callback test program for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2010 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]; - fgets(buf, sizeof(buf), stdin); - 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$". -// diff --git a/branch-3.0-2011/test/buttons.cxx b/branch-3.0-2011/test/buttons.cxx deleted file mode 100644 index c3c76d57f..000000000 --- a/branch-3.0-2011/test/buttons.cxx +++ /dev/null @@ -1,56 +0,0 @@ -// -// "$Id$" -// -// Another button test program for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2010 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); - Fl_Button *b = new Fl_Button(10, 10, 130, 30, "Fl_Button"); - b->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$". -// diff --git a/branch-3.0-2011/test/cairo_test.cxx b/branch-3.0-2011/test/cairo_test.cxx deleted file mode 100644 index 89811869c..000000000 --- a/branch-3.0-2011/test/cairo_test.cxx +++ /dev/null @@ -1,170 +0,0 @@ -// -// "$Id: arc.cxx 5115 2006-05-12 16:00:00Z fabien $" -// -// Arc drawing test program for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2010 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> - -#ifdef FLTK_HAVE_CAIRO - -#include <FL/Fl_Cairo_Window.H> -#include <FL/Fl_Box.H> -#include <FL/x.H> -#include <FL/fl_draw.H> -#include <FL/math.h> -#define DEF_WIDTH 0.03 - -// uncomment the following line to enable cairo context autolink feature: -// #define AUTOLINK - -// put your drawing stuff here -float drawargs[7] = {90, 90, 100, 100, 0, 360, 0}; -const char* name[7] = {"X", "Y", "W", "H", "start", "end", "rotate"}; - - -static void centered_text(cairo_t* cr, double x0,double y0,double w0,double h0, const char * my_text) { - cairo_select_font_face (cr, "Sans", CAIRO_FONT_SLANT_OBLIQUE,CAIRO_FONT_WEIGHT_BOLD); - cairo_set_source_rgba (cr, 0.9, 0.9, 0.4, 0.6); - cairo_text_extents_t extents; - cairo_text_extents (cr, my_text, &extents); - double x = (extents.width/2 + extents.x_bearing); - double y = (extents.height/2 + extents.y_bearing); - cairo_move_to (cr, x0+w0/2-x, y0+h0/2 - y); - cairo_text_path(cr,my_text); - cairo_fill_preserve (cr); - cairo_set_source_rgba (cr, 0, 0, 0,1); - cairo_set_line_width (cr, 0.004); - cairo_stroke (cr); - cairo_set_line_width (cr, DEF_WIDTH); - - -} - -static void round_button(cairo_t* cr, double x0, double y0, - double rect_width, double rect_height, double radius, - double r, double g, double b) { - - double x1,y1; - - - x1=x0+rect_width; - y1=y0+rect_height; - if (!rect_width || !rect_height) - return; - if (rect_width/2<radius) { - if (rect_height/2<radius) { - cairo_move_to (cr, x0, (y0 + y1)/2); - cairo_curve_to (cr, x0 ,y0, x0, y0, (x0 + x1)/2, y0); - cairo_curve_to (cr, x1, y0, x1, y0, x1, (y0 + y1)/2); - cairo_curve_to (cr, x1, y1, x1, y1, (x1 + x0)/2, y1); - cairo_curve_to (cr, x0, y1, x0, y1, x0, (y0 + y1)/2); - } else { - cairo_move_to (cr, x0, y0 + radius); - cairo_curve_to (cr, x0 ,y0, x0, y0, (x0 + x1)/2, y0); - cairo_curve_to (cr, x1, y0, x1, y0, x1, y0 + radius); - cairo_line_to (cr, x1 , y1 - radius); - cairo_curve_to (cr, x1, y1, x1, y1, (x1 + x0)/2, y1); - cairo_curve_to (cr, x0, y1, x0, y1, x0, y1- radius); - } - } else { - if (rect_height/2<radius) { - cairo_move_to (cr, x0, (y0 + y1)/2); - cairo_curve_to (cr, x0 , y0, x0 , y0, x0 + radius, y0); - cairo_line_to (cr, x1 - radius, y0); - cairo_curve_to (cr, x1, y0, x1, y0, x1, (y0 + y1)/2); - cairo_curve_to (cr, x1, y1, x1, y1, x1 - radius, y1); - cairo_line_to (cr, x0 + radius, y1); - cairo_curve_to (cr, x0, y1, x0, y1, x0, (y0 + y1)/2); - } else { - cairo_move_to (cr, x0, y0 + radius); - cairo_curve_to (cr, x0 , y0, x0 , y0, x0 + radius, y0); - cairo_line_to (cr, x1 - radius, y0); - cairo_curve_to (cr, x1, y0, x1, y0, x1, y0 + radius); - cairo_line_to (cr, x1 , y1 - radius); - cairo_curve_to (cr, x1, y1, x1, y1, x1 - radius, y1); - cairo_line_to (cr, x0 + radius, y1); - cairo_curve_to (cr, x0, y1, x0, y1, x0, y1- radius); - } - } - cairo_close_path (cr); - - cairo_pattern_t *pat= - //cairo_pattern_create_linear (0.0, 0.0, 0.0, 1.0); - cairo_pattern_create_radial (0.25, 0.24, 0.11, 0.24, 0.14, 0.35); - cairo_pattern_set_extend (pat, CAIRO_EXTEND_REFLECT); - - cairo_pattern_add_color_stop_rgba (pat, 1.0, r, g, b, 1); - cairo_pattern_add_color_stop_rgba (pat, 0.0, 1, 1, 1, 1); - cairo_set_source (cr, pat); - cairo_fill_preserve (cr); - cairo_pattern_destroy (pat); - - //cairo_set_source_rgb (cr, 0.5,0.5,1); cairo_fill_preserve (cr); - cairo_set_source_rgba (cr, 0, 0, 0.5, 0.3); - cairo_stroke (cr); - - cairo_set_font_size (cr, 0.08); - centered_text(cr,x0,y0,rect_width, rect_height, "FLTK loves Cairo!"); - -} -// The cairo rendering cb called during Fl_Cairo_Window::draw() : -static void my_cairo_draw_cb(Fl_Cairo_Window* window, cairo_t* cr) { - - int w= window->w(), h = window->h(); - - cairo_set_line_width (cr, DEF_WIDTH); - cairo_scale (cr, w,h); - - round_button(cr,0.1,0.05,0.8,0.2,0.4,0,0,1); - round_button(cr,0.1,0.35,0.8,0.2,0.4,1,0,0); - round_button(cr,0.1,0.65,0.8,0.2,0.4,0,1,0); - return; -} - -int main(int argc, char** argv) { -#ifdef AUTOLINK - Fl::cairo_autolink_context(true); -#endif - Fl_Cairo_Window window(300,300); - - window.resizable(&window); - window.color(FL_WHITE); - window.set_draw_cb(my_cairo_draw_cb); - window.show(argc,argv); - - return Fl::run(); -} -#else -#include <FL/fl_ask.H> - -int main(int argc, char** argv) { - fl_message("please configure fltk with CAIRO enabled (--enable-cairo or --enable-cairoext)"); - return 0; -} -#endif - -// -// End of "$Id: arc.cxx 5115 2006-05-12 16:00:00Z fabien $". -// diff --git a/branch-3.0-2011/test/checkers.app/Contents/Info.plist b/branch-3.0-2011/test/checkers.app/Contents/Info.plist deleted file mode 100644 index 1e77037d4..000000000 --- a/branch-3.0-2011/test/checkers.app/Contents/Info.plist +++ /dev/null @@ -1,44 +0,0 @@ -<?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-2010 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-2010 by Bill Spitzak and others</string> - - </dict> -</plist> diff --git a/branch-3.0-2011/test/checkers.app/Contents/PkgInfo b/branch-3.0-2011/test/checkers.app/Contents/PkgInfo deleted file mode 100644 index 5af7226a1..000000000 --- a/branch-3.0-2011/test/checkers.app/Contents/PkgInfo +++ /dev/null @@ -1 +0,0 @@ -FLSUFlsu diff --git a/branch-3.0-2011/test/checkers.app/Contents/Resources/checkers.icns b/branch-3.0-2011/test/checkers.app/Contents/Resources/checkers.icns Binary files differdeleted file mode 100644 index 5bdec121c..000000000 --- a/branch-3.0-2011/test/checkers.app/Contents/Resources/checkers.icns +++ /dev/null diff --git a/branch-3.0-2011/test/checkers.cxx b/branch-3.0-2011/test/checkers.cxx deleted file mode 100644 index b0584e019..000000000 --- a/branch-3.0-2011/test/checkers.cxx +++ /dev/null @@ -1,1371 +0,0 @@ -// -// "$Id$" -// -// 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-2010 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-2010 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 - -#undef check - -#include <string.h> -#include <stdlib.h> -#include <stdio.h> -#include <stdarg.h> -#include <time.h> - -#ifdef VT100 -#include <ctype.h> // toupper -#endif - -//////////////////////////////////////////////////////////////// -// 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 (!fgets(line, sizeof(line), stdin)) { - 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(); - // -- draw the board itself - fl_draw_box(box(),0,0,w(),h(),color()); - // -- draw all dark tiles - 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); - } - // -- draw outlines around the fileds - fl_color(FL_DARK3); - 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.color(FL_BACKGROUND_COLOR); - 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$". -// diff --git a/branch-3.0-2011/test/clock.cxx b/branch-3.0-2011/test/clock.cxx deleted file mode 100644 index f10fc1bbb..000000000 --- a/branch-3.0-2011/test/clock.cxx +++ /dev/null @@ -1,53 +0,0 @@ -// -// "$Id$" -// -// Clock test program for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2010 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_Clock.H> -#include <FL/Fl_Round_Clock.H> - -int main(int argc, char **argv) { - Fl_Double_Window window(220,220,"Fl_Clock"); - Fl_Clock c1(0,0,220,220); // c1.color(2,1); - window.resizable(c1); - window.end(); - Fl_Double_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$". -// diff --git a/branch-3.0-2011/test/colbrowser.cxx b/branch-3.0-2011/test/colbrowser.cxx deleted file mode 100644 index 8d172c86b..000000000 --- a/branch-3.0-2011/test/colbrowser.cxx +++ /dev/null @@ -1,349 +0,0 @@ -// -// "$Id$" -// -// X Color Browser demo program for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2010 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_Button.H> -#include <FL/Fl_Value_Slider.H> -#include <FL/Fl_Hold_Browser.H> -#include <FL/Fl_Box.H> - -#include <FL/fl_ask.H> -#include <FL/filename.H> - -#include <stdlib.h> -#include <stdio.h> -#include <string.h> - - -// some constants - -#define MAX_RGB 3000 - -#define FL_FREE_COL4 ((Fl_Color)(FL_FREE_COLOR+3)) -#define FL_INDIANRED ((Fl_Color)(164)) - - -static Fl_Double_Window *cl; -static Fl_Box *rescol; -static Fl_Button *dbobj; -static Fl_Hold_Browser *colbr; -static Fl_Value_Slider *rs, *gs, *bs; - -static 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::args(argc, argv); - - create_form_cl(); - -#ifdef USING_XCODE - // Xcode apps do not set the current directory - strcpy(dbname, argv[0]); - char *slash = strrchr(dbname, '/'); - if (slash) - strcpy(slash, "/../Resources/rgb.txt"); -#else - strcpy(dbname, "rgb.txt"); -#endif - - if (load_browser(dbname)) - dbobj->label(dbname); - else - dbobj->label("None"); - dbobj->redraw(); - - cl->size_range(cl->w(),cl->h(),2*cl->w(),2*cl->h()); - - cl->label("RGB Browser"); - cl->free_position(); - cl->show(argc,argv); - - return Fl::run(); -} - - -static void set_entry(int i) -{ - RGBdb *db = rgbdb + i; - Fl::set_color(FL_FREE_COL4, db->r, db->g, db->b); - rs->value(db->r); - gs->value(db->g); - bs->value(db->b); - rescol->redraw(); -} - - -static void br_cb(Fl_Widget *ob, long) -{ - int r = ((Fl_Browser *)ob)->value(); - - 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] == '!') { - if (fgets(buf,sizeof(buf)-1,fp)==0) { - /* ignore */ - } - } - - 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 = fl_fopen(__XOS2RedirRoot(fname), "r"))) -#else - if (!(fp = fl_fopen(fname, "r"))) -#endif - { - fl_alert("%s\n%s\n%s","Load", fname, "Can't open"); - return 0; - } - - /* read the items */ - - 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); - colbr->add(buf); - } - } - fclose(fp); - - if (db < dbs) - db->r = 1000; /* sentinel */ - else - { - db--; - db->r = 1000; - } - - colbr->topline(1); - colbr->select(1,1); - set_entry(0); - - 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 = colbr->topline(); - - r = int(rs->value()); - g = int(gs->value()); - b = int(bs->value()); - - // fl_freeze_form(cl); - Fl::set_color(FL_FREE_COL4, r, g, b); - rescol->redraw(); - i = search_entry(r, g, b); - /* change topline only if necessary */ - if(i < top || i > (top+15)) - colbr->topline(i-8); - colbr->select(i+1, 1); - // fl_unfreeze_form(cl); -} - - -/* change database */ -static void db_cb(Fl_Widget * ob, long) -{ - const char *p = fl_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 - ob->label(dbname); -} - - -static void done_cb(Fl_Widget *, long) -{ - exit(0); -} - - -static void create_form_cl(void) -{ - if (cl) - return; - - cl = new Fl_Double_Window(400,385); - cl->box(FL_UP_BOX); - cl->color(FL_INDIANRED, FL_GRAY); - - Fl_Box *title = new Fl_Box(40, 10, 300, 30, "Color Browser"); - title->box(FL_NO_BOX); - title->labelcolor(FL_RED); - title->labelsize(32); - title->labelfont(FL_HELVETICA_BOLD); - title->labeltype(FL_SHADOW_LABEL); - - dbobj = new Fl_Button(40, 50, 300, 25, ""); - dbobj->type(FL_NORMAL_BUTTON); - dbobj->box(FL_BORDER_BOX); - dbobj->color(FL_INDIANRED,FL_INDIANRED); - dbobj->callback(db_cb, 0); - - colbr = new Fl_Hold_Browser(10, 90, 280, 240, ""); - colbr->textfont(FL_COURIER); - colbr->callback(br_cb, 0); - colbr->box(FL_DOWN_BOX); - - rescol = new Fl_Box(300, 90, 90, 35, ""); - rescol->color(FL_FREE_COL4, FL_FREE_COL4); - rescol->box(FL_BORDER_BOX); - - rs = new Fl_Value_Slider(300, 130, 30, 200, ""); - rs->type(FL_VERT_FILL_SLIDER); - rs->color(FL_INDIANRED, FL_RED); - rs->bounds(0, 255); - rs->precision(0); - rs->callback(search_rgb, 0); - rs->when(FL_WHEN_RELEASE); - - gs = new Fl_Value_Slider(330, 130, 30, 200, ""); - gs->type(FL_VERT_FILL_SLIDER); - gs->color(FL_INDIANRED, FL_GREEN); - gs->bounds(0, 255); - gs->precision(0); - gs->callback(search_rgb, 1); - gs->when(FL_WHEN_RELEASE); - - bs = new Fl_Value_Slider(360, 130, 30, 200, ""); - bs->type(FL_VERT_FILL_SLIDER); - bs->color(FL_INDIANRED, FL_BLUE); - bs->bounds(0, 255); - bs->precision(0); - bs->callback(search_rgb, 2); - bs->when(FL_WHEN_RELEASE); - - Fl_Button *done = new Fl_Button(160, 345, 80, 30, "Done"); - done->type(FL_NORMAL_BUTTON); - done->callback(done_cb, 0); - - cl->end(); - cl->resizable(cl); -} - -// -// End of "$Id$". -// diff --git a/branch-3.0-2011/test/color_chooser.cxx b/branch-3.0-2011/test/color_chooser.cxx deleted file mode 100644 index 1658e53a1..000000000 --- a/branch-3.0-2011/test/color_chooser.cxx +++ /dev/null @@ -1,154 +0,0 @@ -// -// "$Id$" -// -// Color chooser test program for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2010 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,3)) 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 (i!=argc) { - 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$". -// diff --git a/branch-3.0-2011/test/connect.cxx b/branch-3.0-2011/test/connect.cxx deleted file mode 100644 index d303cf93d..000000000 --- a/branch-3.0-2011/test/connect.cxx +++ /dev/null @@ -1,77 +0,0 @@ -// -// "$Id$" -// -// 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-2010 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$". -// diff --git a/branch-3.0-2011/test/cube.cxx b/branch-3.0-2011/test/cube.cxx deleted file mode 100644 index 2e9bf04cf..000000000 --- a/branch-3.0-2011/test/cube.cxx +++ /dev/null @@ -1,231 +0,0 @@ -// -// "$Id$" -// -// Another forms test program for the Fast Light Tool Kit (FLTK). -// -// Modified to have 2 cubes to test multiple OpenGL contexts -// -// Copyright 1998-2010 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(); -} - -// added to demo printing -#include <FL/Fl_Sys_Menu_Bar.H> -#include <FL/Fl_Printer.H> - -void print_cb(Fl_Widget *w, void *data) -{ - Fl_Printer printer; - Fl_Window *win = Fl::first_window(); - if(!win) return; - if( printer.start_job(1) ) return; - if( printer.start_page() ) return; - printer.scale(0.5,0.5); - printer.print_widget( win ); - printer.end_page(); - printer.end_job(); -} -// end of printing demo - -int main(int argc, char **argv) { - makeform(argv[0]); - // added to demo printing - form->begin(); - static Fl_Menu_Item items[] = { - { "Print", 0, 0, 0, FL_SUBMENU }, - { "Print window", 0, print_cb, 0, 0 }, - { 0 }, - { 0 } - }; - Fl_Sys_Menu_Bar *menubar_; - menubar_ = new Fl_Sys_Menu_Bar(0, 0, 60, 20); - menubar_->box(FL_FLAT_BOX); - menubar_->menu(items); - form->end(); - // end of printing demo - 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$". -// diff --git a/branch-3.0-2011/test/cursor.cxx b/branch-3.0-2011/test/cursor.cxx deleted file mode 100644 index 3f3ab0c49..000000000 --- a/branch-3.0-2011/test/cursor.cxx +++ /dev/null @@ -1,165 +0,0 @@ -// -// "$Id$" -// -// Cursor test program for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2010 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_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)(fl_intptr_t)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_Double_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$". -// diff --git a/branch-3.0-2011/test/curve.cxx b/branch-3.0-2011/test/curve.cxx deleted file mode 100644 index f69f7241b..000000000 --- a/branch-3.0-2011/test/curve.cxx +++ /dev/null @@ -1,115 +0,0 @@ -// -// "$Id$" -// -// Curve test program for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2010 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_push_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[fl_intptr_t(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$". -// diff --git a/branch-3.0-2011/test/demo.cxx b/branch-3.0-2011/test/demo.cxx deleted file mode 100644 index b1f30eb17..000000000 --- a/branch-3.0-2011/test/demo.cxx +++ /dev/null @@ -1,429 +0,0 @@ -// -// "$Id$" -// -// Main demo program for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2010 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__ -#elif defined USING_XCODE -#include <ApplicationServices/ApplicationServices.h> -#else -# include <unistd.h> -#endif -#include <FL/Fl.H> -#include <FL/Fl_Double_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_Double_Window *form; -Fl_Button *but[9]; - -void create_the_forms() { - Fl_Widget *obj; - form = new Fl_Double_Window(350, 440); - obj = new Fl_Box(FL_FRAME_BOX,10,15,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,65,330,330,0); - obj->color(FL_GRAY-8); - obj = new Fl_Button(280,405,60,25,"Exit"); - obj->callback(doexit); - Fl_Choice *choice = new Fl_Choice(75, 405, 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,15,330,380); obj->type(FL_HIDDEN_BUTTON); - obj->callback(doback); - obj = but[0] = new Fl_Button( 30, 85,90,90); - obj = but[1] = new Fl_Button(130, 85,90,90); - obj = but[2] = new Fl_Button(230, 85,90,90); - obj = but[3] = new Fl_Button( 30,185,90,90); - obj = but[4] = new Fl_Button(130,185,90,90); - obj = but[5] = new Fl_Button(230,185,90,90); - obj = but[6] = new Fl_Button( 30,285,90,90); - obj = but[7] = new Fl_Button(130,285,90,90); - obj = but[8] = new Fl_Button(230,285,90,90); - for (int i=0; i<9; i++) { - but[i]->align(FL_ALIGN_WRAP); - but[i]->callback(dobut, i); - } - form->end(); -} - -/* Maintaining and building up the menus. */ - -typedef struct { - char name[64]; - int numb; - char iname[9][64]; - char icommand[9][64]; -} MENU; - -#define MAXMENU 32 - -MENU menus[MAXMENU]; -int mennumb = 0; - -int find_menu(const char* nnn) -/* Returns the number of a given menu name. */ -{ - int i; - for (i=0; i<mennumb; i++) - if (strcmp(menus[i].name,nnn) == 0) return i; - return -1; -} - -void create_menu(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; - -#elif defined USING_XCODE - char *cmd = strdup(menus[men].icommand[bn]); - char *arg = strchr(cmd, ' '); - - char command[2048], path[2048], app_path[2048]; - - // this neat litle block of code ensures that the current directory is set - // to the location of the Demo application. - CFBundleRef app = CFBundleGetMainBundle(); - CFURLRef url = CFBundleCopyBundleURL(app); - CFStringRef cc_app_path = CFURLCopyFileSystemPath(url, kCFURLPOSIXPathStyle); - CFStringGetCString(cc_app_path, app_path, 2048, kCFStringEncodingUTF8); - if (*app_path) { - char *n = strrchr(app_path, '/'); - if (n) { - *n = 0; - chdir(app_path); - } - } - - if (arg) { - *arg = 0; - if (strcmp(cmd, "../fluid/fluid")==0) { - fl_filename_absolute(path, 2048, "../../../../test/"); - sprintf(command, "open Fluid.app --args %s%s", path, arg+1); - } else { - fl_filename_absolute(path, 2048, "../../../../test/"); - sprintf(command, "open %s.app --args %s%s", cmd, path, arg+1); - } - } else { - sprintf(command, "open %s.app", cmd); - } -// puts(command); - system(command); - - free(cmd); -#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]); - if (system(command)==-1) { /* ignore */ } - - 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 = 0; - char line[256], mname[64],iname[64],cname[64]; - int i, j; - fin = fl_fopen(fname,"r"); -#if defined ( USING_XCODE ) - if (fin == NULL) { - // mac os bundle menu detection: - char* pos = strrchr(fname,'/'); - if (!pos) return 0; - *pos='\0'; - pos = strrchr(fname,'/'); - if (!pos) return 0; - strcpy(pos,"/Resources/demo.menu"); - fin = fl_fopen(fname,"r"); - } -#endif - if (fin == NULL) { - 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/html"); - char buf[FL_PATH_MAX]; - 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; - if (chdir(buf)==-1) { /* ignore */ } - } - push_menu("@main"); - form->show(argc,argv); - Fl::run(); - return 0; -} - -// -// End of "$Id$". -// - diff --git a/branch-3.0-2011/test/demo.menu b/branch-3.0-2011/test/demo.menu deleted file mode 100644 index 03143c254..000000000 --- a/branch-3.0-2011/test/demo.menu +++ /dev/null @@ -1,97 +0,0 @@ -# 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:more...:@xm - @xm:Fl_Menu:menubar - @xm:Fl_Table:table - @xm:Fl_Tree:tree - -@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:rotated text:rotated_text - @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 - @e:Print\nsupport:device - -@main:Other\nTests...:@o - @o:Color Choosers:color_chooser - @o:File Chooser:file_chooser - @o:Native File Chooser:native-filechooser - @o:Font Tests...:@of - @of:Fonts:fonts - @of:UTF-8:utf8 - @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/branch-3.0-2011/test/desktop/blocks-128.png b/branch-3.0-2011/test/desktop/blocks-128.png Binary files differdeleted file mode 100644 index 41e6d00da..000000000 --- a/branch-3.0-2011/test/desktop/blocks-128.png +++ /dev/null diff --git a/branch-3.0-2011/test/desktop/blocks-32.png b/branch-3.0-2011/test/desktop/blocks-32.png Binary files differdeleted file mode 100644 index 073bc0fa9..000000000 --- a/branch-3.0-2011/test/desktop/blocks-32.png +++ /dev/null diff --git a/branch-3.0-2011/test/desktop/blocks.desktop b/branch-3.0-2011/test/desktop/blocks.desktop deleted file mode 100644 index 9abf1165e..000000000 --- a/branch-3.0-2011/test/desktop/blocks.desktop +++ /dev/null @@ -1,9 +0,0 @@ -[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/branch-3.0-2011/test/desktop/checkers-128.png b/branch-3.0-2011/test/desktop/checkers-128.png Binary files differdeleted file mode 100644 index ed0252745..000000000 --- a/branch-3.0-2011/test/desktop/checkers-128.png +++ /dev/null diff --git a/branch-3.0-2011/test/desktop/checkers-32.png b/branch-3.0-2011/test/desktop/checkers-32.png Binary files differdeleted file mode 100644 index 4adcd6663..000000000 --- a/branch-3.0-2011/test/desktop/checkers-32.png +++ /dev/null diff --git a/branch-3.0-2011/test/desktop/checkers.desktop b/branch-3.0-2011/test/desktop/checkers.desktop deleted file mode 100644 index bc7273b3e..000000000 --- a/branch-3.0-2011/test/desktop/checkers.desktop +++ /dev/null @@ -1,9 +0,0 @@ -[Desktop Entry] -Name=Checkers -Comment=Checkers Game -TryExec=checkers -Exec=checkers -Icon=checkers -Terminal=false -Type=Application -Categories=Game;BoardGame; diff --git a/branch-3.0-2011/test/desktop/sudoku-128.png b/branch-3.0-2011/test/desktop/sudoku-128.png Binary files differdeleted file mode 100644 index 070a41016..000000000 --- a/branch-3.0-2011/test/desktop/sudoku-128.png +++ /dev/null diff --git a/branch-3.0-2011/test/desktop/sudoku-32.png b/branch-3.0-2011/test/desktop/sudoku-32.png Binary files differdeleted file mode 100644 index 154c27308..000000000 --- a/branch-3.0-2011/test/desktop/sudoku-32.png +++ /dev/null diff --git a/branch-3.0-2011/test/desktop/sudoku.desktop b/branch-3.0-2011/test/desktop/sudoku.desktop deleted file mode 100644 index b27e07dae..000000000 --- a/branch-3.0-2011/test/desktop/sudoku.desktop +++ /dev/null @@ -1,9 +0,0 @@ -[Desktop Entry] -Name=Sudoku -Comment=Suduku Number Game -TryExec=sudoku -Exec=sudoku -Icon=sudoku -Terminal=false -Type=Application -Categories=Game;LogicGame; diff --git a/branch-3.0-2011/test/device.cxx b/branch-3.0-2011/test/device.cxx deleted file mode 100644 index bd613a238..000000000 --- a/branch-3.0-2011/test/device.cxx +++ /dev/null @@ -1,734 +0,0 @@ -// Cartesian.H,v 0.9 -// -// Copyright 2000 by Roman Kantor. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public License -// version 2 as published by the Free Software Foundation. -// - -// This library is distributed 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 <math.h> -#include <FL/Fl.H> - -#include <FL/Fl_Overlay_Window.H> -#include <FL/Fl_Light_Button.H> -#include <FL/fl_draw.H> -#include <FL/Fl_Clock.H> -#include "pixmaps/porsche.xpm" -#include <FL/Fl_Pixmap.H> -#include <FL/Fl_Bitmap.H> -#include <FL/Fl_Round_Button.H> - - -#include <FL/Fl_Printer.H> - -//#include "fl_printer_chooser.H" - -#include <FL/Fl_File_Chooser.H> -#include <FL/fl_draw.H> - - -#define sorceress_width 75 -#define sorceress_height 75 - - -// shameles copy from bitmap... -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}; - -class MyWidget: public Fl_Box{ -protected: - void draw(){ - Fl_Box::draw(); - fl_color(FL_RED); - fl_rectf(x()+5,y()+5,w()-10,h()-10); - fl_push_clip(x()+6,y()+6,w()-12,h()-12); - fl_color(FL_DARK_GREEN); - fl_rectf(x()+5,y()+5,w()-10,h()-10); - fl_pop_clip(); - fl_color(FL_YELLOW); - fl_rectf(x()+7,y()+7,w()-14,h()-14); - fl_color(FL_BLUE); - - fl_rect(x()+8,y()+8,w()-16,h()-16); - fl_push_clip(x()+25,y()+25,w()-50, h()-50); - fl_color(FL_BLACK); - fl_rect(x()+24,y()+24,w()-48,h()-48); - fl_line(x()+27,y()+27,x()+w()-27,y()+h()-27); - fl_line(x()+27,y()+h()-27,x()+w()-27,y()+27); - //fl_rect(x()+30,y()+30,w()-60,h()-60); - fl_pop_clip(); - - } -public: - MyWidget(int x, int y):Fl_Box(x,y,100,100, "Clipping and rect(f):\nYellow rect.framed\nby B-Y-G-R rect. 1 p.\nthick. Your printer may \nrender very thin lines\nsurrounding \"X\""){ - align(FL_ALIGN_TOP); - labelsize(10); - }; -}; - - -class MyWidget2: public Fl_Box{ -protected: - void draw(){ - Fl_Box::draw(); - int d; -// fl_line_style(0); - for(d=y()+5;d<48+y();d+=2){ - fl_xyline(x()+5,d,x()+48); - } - - - - fl_push_clip(x()+52,y()+5,45,43); - for(d=y()+5;d<150+y();d+=3){ - fl_line(x()+52,d,x()+92,d-40); - } - fl_pop_clip(); - - - - - - - - - fl_line_style(FL_DASH); - fl_xyline(x()+5,y()+55,x()+48); - fl_line_style(FL_DOT); - fl_xyline(x()+5,y()+58,x()+48); - fl_line_style(FL_DASHDOT); - fl_xyline(x()+5,y()+61,x()+48); - fl_line_style(FL_DASHDOTDOT); - fl_xyline(x()+5,y()+64,x()+48); - fl_line_style(0,0,(char*)"\7\3\7\2"); - fl_xyline(x()+5,y()+67,x()+48); - - - - - - - fl_line_style(0); - - - - - fl_line(x()+5,y()+72,x()+25,y()+95); - fl_line(x()+8,y()+72,x()+28,y()+95,x()+31,y()+72); - - fl_color(FL_YELLOW); - fl_polygon(x()+11, y()+72,x()+27,y()+91,x()+29,y()+72); - fl_color(FL_RED); - fl_loop(x()+11, y()+72,x()+27,y()+91,x()+29,y()+72); - - fl_color(FL_BLUE); //// - fl_line_style(FL_SOLID, 6); - fl_loop(x()+31, y()+12,x()+47,y()+31,x()+49,y()+12); - fl_line_style(0); - - - fl_color(200,0,200); - fl_polygon(x()+35,y()+72,x()+33,y()+95,x()+48,y()+95,x()+43,y()+72); - fl_color(FL_GREEN); - fl_loop(x()+35,y()+72,x()+33,y()+95,x()+48,y()+95,x()+43,y()+72); - - - - fl_color(FL_BLUE); - fl_yxline(x()+65,y()+63,y()+66); - fl_color(FL_GREEN); - fl_yxline(x()+66,y()+66,y()+63); - - fl_color(FL_BLUE); - fl_rect(x()+80,y()+55,5,5); - fl_color(FL_YELLOW); - fl_rectf(x()+81,y()+56,3,3); - fl_color(FL_BLACK); - fl_point(x()+82,y()+57); - - fl_color(FL_BLUE); - fl_rect(x()+56, y()+79, 24, 17); - fl_color(FL_CYAN); - fl_rectf(x()+57, y()+80, 22 , 15 ); - fl_color(FL_RED); - fl_arc(x()+57, y()+80, 22 ,15 ,40, 270); - fl_color(FL_YELLOW); - fl_pie(x()+58, y()+81, 20 ,13 ,40, 270); - - - - - fl_line_style(0); - - - fl_color(FL_BLACK); - fl_point(x()+58,y()+58); - fl_color(FL_RED); - fl_yxline(x()+59,y()+58,y()+59); - fl_color(FL_GREEN); - fl_yxline(x()+60,y()+59,y()+58); - fl_color(FL_BLACK); - fl_xyline(x()+61,y()+58,x()+62); - fl_color(FL_RED); - fl_xyline(x()+62,y()+59,x()+61); - - fl_color(FL_GREEN); - fl_yxline(x()+57,y()+58,y()+59,x()+58); - fl_color(FL_BLUE); - fl_xyline(x()+58,y()+60,x()+56,y()+58); - fl_color(FL_RED); - fl_xyline(x()+58,y()+61,x()+56,y()+63); - fl_color(FL_GREEN); - fl_yxline(x()+57,y()+63,y()+62,x()+58); - - fl_color(FL_BLUE); - fl_line(x()+58,y()+63, x()+60, y()+65); - fl_color(FL_BLACK); - fl_line(x()+61,y()+65, x()+59, y()+63); - - - - - - - - - - fl_color(FL_BLACK); - }; - -public: - MyWidget2(int x, int y):Fl_Box(x,y,100,100, "Integer primitives"){ - labelsize(10); - align(FL_ALIGN_TOP); - }; -}; - - -class MyWidget3: public Fl_Box{ -protected: - void draw(){ - Fl_Box::draw(); - double d; -// fl_line_style(0); - fl_push_clip(x()+5,y()+5,45,43); - for(d=y()+5;d<95+y();d+=1.63){ - fl_begin_line(); - fl_vertex(x()+5,d); - fl_vertex(x()+48,d); - fl_end_line(); - } - fl_pop_clip(); - - fl_push_clip(x()+52,y()+5,45,43); - for(d=y()+5;d<150+y();d+=2.3052){ - fl_begin_line(); - fl_vertex(x()+52,d); - fl_vertex(x()+92,d-43); - fl_end_line(); - } - fl_pop_clip(); - - }; -public: - MyWidget3(int x, int y):Fl_Box(x,y,100,100, "Sub-pixel drawing of\nlines 1.63 points apart\nOn the screen you\ncan see aliasing, the\nprinter should render\nthem properly"){ - labelsize(10); - align(FL_ALIGN_TOP); - }; -}; - - - -class MyWidget4: public Fl_Box{ -protected: - void draw(){ - Fl_Box::draw(); - fl_push_matrix(); - fl_translate(x(),y()); - fl_scale(.75,.75); - - - - fl_line_style(FL_SOLID , 5); - fl_begin_line(); - fl_vertex(10, 160); - fl_vertex(40, 160); - fl_vertex(40, 190); - fl_end_line(); - fl_line_style(0); - - - fl_color(FL_RED); - fl_line_style(FL_SOLID | FL_CAP_FLAT |FL_JOIN_MITER , 5); - fl_begin_line(); - fl_vertex(10, 150); - fl_vertex(50, 150); - fl_vertex(50, 190); - fl_end_line(); - fl_line_style(0); - - fl_color(FL_GREEN); - fl_line_style(FL_SOLID | FL_CAP_ROUND |FL_JOIN_ROUND , 5); - fl_begin_line(); - fl_vertex(10, 140); - fl_vertex(60, 140); - fl_vertex(60, 190); - fl_end_line(); - fl_line_style(0); - - fl_color(FL_BLUE); - fl_line_style(FL_SOLID | FL_CAP_SQUARE |FL_JOIN_BEVEL , 5); - fl_begin_line(); - fl_vertex(10, 130); - fl_vertex(70, 130); - fl_vertex(70, 190); - fl_end_line(); - fl_line_style(0); - - fl_color(FL_BLACK); - fl_line_style(FL_DASH , 5); - fl_begin_line(); - fl_vertex(10, 120); - fl_vertex(80, 120); - fl_vertex(80, 190); - fl_end_line(); - fl_line_style(0); - - fl_color(FL_RED); - fl_line_style(FL_DASH |FL_CAP_FLAT , 5); - fl_begin_line(); - fl_vertex(10, 110); - fl_vertex(90, 110); - fl_vertex(90, 190); - fl_end_line(); - fl_line_style(0); - - fl_color(FL_GREEN); - fl_line_style(FL_DASH |FL_CAP_ROUND , 5); - fl_begin_line(); - fl_vertex(10, 100); - fl_vertex(100, 100); - fl_vertex(100, 190); - fl_end_line(); - fl_line_style(0); - - - fl_color(FL_BLUE); - fl_line_style(FL_DASH |FL_CAP_SQUARE , 5); - fl_begin_line(); - fl_vertex(10, 90); - fl_vertex(110, 90); - fl_vertex(110, 190); - fl_end_line(); - fl_line_style(0); - - fl_color(FL_BLACK); - fl_line_style(FL_DOT, 5); - fl_begin_line(); - fl_vertex(10, 80); - fl_vertex(120, 80); - fl_vertex(120, 190); - fl_end_line(); - fl_line_style(0); - - fl_color(FL_RED); - fl_line_style(FL_DOT | FL_CAP_FLAT, 5); - fl_begin_line(); - fl_vertex(10, 70); - fl_vertex(130, 70); - fl_vertex(130, 190); - fl_end_line(); - fl_line_style(0); - - fl_color(FL_GREEN); - fl_line_style(FL_DOT | FL_CAP_ROUND, 5); - fl_begin_line(); - fl_vertex(10, 60); - fl_vertex(140, 60); - fl_vertex(140, 190); - fl_end_line(); - fl_line_style(0); - - fl_color(FL_BLUE); - fl_line_style(FL_DOT | FL_CAP_SQUARE, 5); - fl_begin_line(); - fl_vertex(10, 50); - fl_vertex(150, 50); - fl_vertex(150, 190); - fl_end_line(); - fl_line_style(0); - - fl_color(FL_BLACK); - fl_line_style(FL_DASHDOT |FL_CAP_ROUND |FL_JOIN_ROUND , 5); - fl_begin_line(); - fl_vertex(10, 40); - fl_vertex(160, 40); - fl_vertex(160, 190); - fl_end_line(); - fl_line_style(0); - - fl_color(FL_RED); - fl_line_style(FL_DASHDOTDOT |FL_CAP_SQUARE |FL_JOIN_BEVEL , 5); - fl_begin_line(); - fl_vertex(10, 30); - fl_vertex(170, 30); - fl_vertex(170, 190); - fl_end_line(); - fl_line_style(0); - - - fl_color(FL_GREEN); - fl_line_style(FL_DASHDOTDOT |FL_CAP_ROUND |FL_JOIN_ROUND , 5); - fl_begin_line(); - fl_vertex(10, 20); - fl_vertex(180, 20); - fl_vertex(180, 190); - fl_end_line(); - fl_line_style(0); - - - fl_color(FL_BLUE); - fl_line_style(0, 5, (char*)"\12\3\4\2\2\1"); - fl_begin_line(); - fl_vertex(10, 10); - fl_vertex(190, 10); - fl_vertex(190, 190); - - fl_end_line(); - fl_line_style(0); - fl_pop_matrix(); - - fl_color(FL_BLACK); - - - - - }; -public: - MyWidget4(int x, int y):Fl_Box(x,y,150,150, "Line styles"){ - labelsize(10); - align(FL_ALIGN_TOP); - }; -}; - - -class MyWidget5: public Fl_Box{ -protected: - void draw(){ - Fl_Box::draw(); - //fl_push_clip(x(),y(),w(),h()); - fl_push_matrix(); - - - fl_translate(x(),y()); - fl_push_matrix(); - fl_mult_matrix(1,3,0,1,0,-20); - fl_color(FL_GREEN); - fl_begin_polygon(); - fl_vertex(10,10); - fl_vertex(100,-80); - fl_vertex(100,-190); - fl_end_polygon(); - - fl_color(FL_RED); - fl_line_style(FL_DASHDOT, 7); - fl_begin_loop(); - - - fl_vertex(10,10); - fl_vertex(100,-80); - fl_vertex(100,-190); - fl_end_loop(); - fl_line_style(0); - - fl_color(FL_BLUE); - fl_line_style(FL_SOLID, 3); - fl_begin_loop(); - fl_circle(60,-50,30); - fl_end_loop(); - fl_line_style(0); - - fl_pop_matrix(); - fl_scale(1.8,1); - - fl_color(FL_YELLOW); - fl_begin_polygon(); - fl_arc(30,90,20,-45,200); - fl_end_polygon(); - - fl_color(FL_BLACK); - fl_line_style(FL_DASH, 3); - fl_begin_line(); - fl_arc(30,90,20,-45,200); - fl_end_line(); - fl_line_style(0); - - fl_translate(15,0); - fl_scale(1.5,3); - fl_begin_complex_polygon(); - fl_vertex(30,70); - fl_arc(45,55,10,200,90); - fl_arc(55,45,8,-170,20); - fl_vertex(60,40); - fl_vertex(30,20); - fl_vertex(40,5); - fl_vertex(60,25); - //fl_vertex(50,50); - fl_curve(35,30,30,53,0,35,65,65); - fl_gap(); - fl_vertex(50,25); - fl_vertex(40,10); - fl_vertex(35,20); - fl_end_complex_polygon(); - - fl_pop_matrix(); - -// fl_color(FL_BLACK); -// fl_line_style(0); - //fl_pop_clip(); - - - - }; -public: - MyWidget5(int x, int y):Fl_Box(x,y,230,250, "Complex (double) drawings:\nBlue ellipse may not be\ncorrectly transformed\ndue to non-orthogonal\ntransformation"){ - labelsize(10); - align(FL_ALIGN_TOP); - }; -}; - - -uchar *image; -int width = 80; -int height = 80; - -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)(350 * sqrt(X * X + Y * Y)); - if (alpha < 255) *p++ = uchar(alpha); // alpha transparency - else *p++ = 255; - Y += 0.5; - } - } -} - - -void print(Fl_Widget *, void *w) { - Fl_Widget * g = (Fl_Widget *)w; - - Fl_Printer * p = new Fl_Printer(); - //p->page(Fl_Printer::A4); - //p->place(g, 70, 70, p->page_width() - 140, p->page_height() - 140, FL_ALIGN_CENTER); - if (!p->start_job(1)) { - p->start_page(); - p->print_widget(g); - p->end_page(); - p->end_job(); - } - delete p; -}; - -/*void print2(Fl_Widget *, void *w) { - Fl_Widget * g = (Fl_Widget *)w; - Fl_Printer * p = fl_printer_chooser(); - if(!p) return; - p->page(Fl_Printer::A4); - // fitting inside margins 1 inch wide - p->place(g, FL_INCH, FL_INCH, p->page_width() - 2 * FL_INCH, p->page_height() - 2 * FL_INCH, FL_ALIGN_CENTER); - Fl_Device * c = p->set_current(); - fl_draw(g); - c->set_current(); - delete p; -};*/ - - -class My_Button:public Fl_Button{ -protected: - void draw(){ - // Fl_Button::draw(); - if (type() == FL_HIDDEN_BUTTON) return; - Fl_Color col = value() ? selection_color() : color(); - draw_box(value() ? (down_box()?down_box():fl_down(box())) : box(), col); - fl_color(FL_WHITE); - fl_line_style(FL_SOLID,5); - fl_line(x()+15,y()+10,x()+w()-15,y()+h()-23); - fl_line(x()+w()-15,y()+10,x()+15,y()+h()-23); - fl_line_style(0); - draw_label(); - - }; -public: - My_Button(int x, int y, int w, int h, const char * label = 0):Fl_Button(x,y,w,h,label){} -}; - - -int main(int argc, char ** argv) { - - //Fl::scheme("plastic"); - - - - Fl_Window * w2 = new Fl_Window(500,560,"Graphics test"); - - - Fl_Group *c2 =new Fl_Group(3, 43, 494, 514 ); - - new MyWidget(10,140); - new MyWidget2(110,80); - new MyWidget3(220,140); - new MyWidget4(330,70); - new MyWidget5(140,270); - - make_image(); - Fl_RGB_Image *rgb = new Fl_RGB_Image(image, width, height, 4); - My_Button b_rgb(10,245,100,100,"RGB with alpha"); - b_rgb.image(rgb); - - My_Button b_pixmap(10,345,100,100,"Pixmap"); - Fl_Pixmap *pixmap = new Fl_Pixmap(porsche_xpm); - b_pixmap.image(pixmap); - - My_Button b_bitmap(10,445,100,100,"Bitmap"); -b_bitmap.labelcolor(FL_GREEN); - b_bitmap.image(new Fl_Bitmap(sorceress_bits,sorceress_width,sorceress_height)); - - new Fl_Clock(360,230,120,120); - Fl_Return_Button * ret = new Fl_Return_Button (360, 360, 120,30, "Return"); - ret->deactivate(); - Fl_Button but1(360, 390, 30, 30, "@->|"); - but1.labelcolor(FL_DARK3); - Fl_Button but2(390, 390, 30, 30, "@UpArrow"); - but2.labelcolor(FL_DARK3); - Fl_Button but3(420, 390, 30, 30, "@DnArrow"); - but3.labelcolor(FL_DARK3); - Fl_Button but4(450, 390, 30, 30, "@+"); - but4.labelcolor(FL_DARK3); - Fl_Button but5(360, 425, 120, 30, "Hello, World"); - but5.labelfont(FL_BOLD|FL_ITALIC); - but5.labeltype(FL_SHADOW_LABEL); - but5.box(FL_ROUND_UP_BOX); -// but5.selection_color(FL_WHITE); - - Fl_Button but6(360, 460, 120, 30, "Plastic"); - but6.box(FL_PLASTIC_UP_BOX); - - //Fl_Button but7(, 480, 120, 30, "Engraved box"); - //but7.box(FL_ENGRAVED_BOX); - { Fl_Group* o = new Fl_Group(360, 495, 120, 40); - o->box(FL_UP_BOX); - { Fl_Group* o = new Fl_Group(365, 500, 110, 30); - o->box(FL_THIN_UP_FRAME); - { Fl_Round_Button* o = new Fl_Round_Button(365, 500, 40, 30, "rad"); - o->value(1); - } - { Fl_Check_Button* o = new Fl_Check_Button(410, 500, 60, 30, "check"); - o->value(1); - - } - o->end(); - } - o->end(); - o->deactivate(); - } - Fl_Box tx(120,492,230,50,"Background is not printed because\nencapsulating group, which we are\n printing, has not set the box type"); - tx.box(FL_SHADOW_BOX); - tx.labelsize(12); - - - - c2->end(); - Fl_Button *b4 = new Fl_Button(10,5, 150, 25, "Print"); - b4->callback(print,c2); - /*Fl_Button *b5 = new Fl_Button(165,5, 90, 25, "Print"); - b5->tooltip("This is a tooltip"); - b5->callback(print2,c2);*/ - - w2->end(); - w2->show(argc, argv); - - - Fl::run(); - return 0; -}; diff --git a/branch-3.0-2011/test/doublebuffer.cxx b/branch-3.0-2011/test/doublebuffer.cxx deleted file mode 100644 index 72cfdea78..000000000 --- a/branch-3.0-2011/test/doublebuffer.cxx +++ /dev/null @@ -1,128 +0,0 @@ -// -// "$Id$" -// -// 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-2010 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$". -// diff --git a/branch-3.0-2011/test/editor.cxx b/branch-3.0-2011/test/editor.cxx deleted file mode 100644 index ffd8c1d57..000000000 --- a/branch-3.0-2011/test/editor.cxx +++ /dev/null @@ -1,813 +0,0 @@ -// -// "$Id$" -// -// 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-2010 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_Native_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> -#include <FL/filename.H> - -int changed = 0; -char filename[FL_PATH_MAX] = ""; -char title[FL_PATH_MAX]; -Fl_Text_Buffer *textbuf = 0; - - -// Syntax highlighting stuff... -#define TS 14 // default editor textsize -Fl_Text_Buffer *stylebuf = 0; -Fl_Text_Display::Style_Table_Entry - styletable[] = { // Style table - { FL_BLACK, FL_COURIER, TS }, // A - Plain - { FL_DARK_GREEN, FL_HELVETICA_ITALIC, TS }, // B - Line comments - { FL_DARK_GREEN, FL_HELVETICA_ITALIC, TS }, // C - Block comments - { FL_BLUE, FL_COURIER, TS }, // D - Strings - { FL_DARK_RED, FL_COURIER, TS }, // E - Directives - { FL_DARK_RED, FL_COURIER_BOLD, TS }, // F - Types - { FL_BLUE, FL_COURIER_BOLD, TS }, // 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)&255) || *text == '_')) { - // Might be a keyword... - for (temp = text, bufptr = buf; - (islower((*temp)&255) || *temp == '_') && bufptr < (buf + sizeof(buf) - 1); - *bufptr++ = *temp++); - - if (!islower((*temp)&255) && *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)&255) || *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(const char *newfile, int ipos) { - loading = 1; - int insert = (ipos != -1); - changed = insert; - if (!insert) strcpy(filename, ""); - int r; - if (!insert) r = textbuf->loadfile(newfile); - else r = textbuf->insertfile(newfile, ipos); - changed = changed || textbuf->input_file_was_transcoded; - 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(const 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; - Fl_Native_File_Chooser fnfc; - fnfc.title("Open file"); - fnfc.type(Fl_Native_File_Chooser::BROWSE_FILE); - if ( fnfc.show() ) return; - load_file(fnfc.filename(), -1); - -} - -void insert_cb(Fl_Widget*, void *v) { - Fl_Native_File_Chooser fnfc; - fnfc.title("Insert file"); - fnfc.type(Fl_Native_File_Chooser::BROWSE_FILE); - if ( fnfc.show() ) return; - EditorWindow *w = (EditorWindow *)v; - load_file(fnfc.filename(), 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) { - EditorWindow* w = (EditorWindow*)v; - - if (num_windows == 1) { - if (!check_save()) - return; - } - - w->hide(); - w->editor->buffer(0); - textbuf->remove_modify_callback(style_update, w->editor); - 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() { - Fl_Native_File_Chooser fnfc; - fnfc.title("Save File As?"); - fnfc.type(Fl_Native_File_Chooser::BROWSE_SAVE_FILE); - if ( fnfc.show() ) return; - save_file(fnfc.filename()); -} - -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_COMMAND + 'o', (Fl_Callback *)open_cb }, - { "&Insert File...", FL_COMMAND + 'i', (Fl_Callback *)insert_cb, 0, FL_MENU_DIVIDER }, - { "&Save File", FL_COMMAND + 's', (Fl_Callback *)save_cb }, - { "Save File &As...", FL_COMMAND + FL_SHIFT + 's', (Fl_Callback *)saveas_cb, 0, FL_MENU_DIVIDER }, - { "New &View", FL_ALT + 'v', (Fl_Callback *)view_cb, 0 }, - { "&Close View", FL_COMMAND + 'w', (Fl_Callback *)close_cb, 0, FL_MENU_DIVIDER }, - { "E&xit", FL_COMMAND + 'q', (Fl_Callback *)quit_cb, 0 }, - { 0 }, - - { "&Edit", 0, 0, 0, FL_SUBMENU }, - { "Cu&t", FL_COMMAND + 'x', (Fl_Callback *)cut_cb }, - { "&Copy", FL_COMMAND + 'c', (Fl_Callback *)copy_cb }, - { "&Paste", FL_COMMAND + 'v', (Fl_Callback *)paste_cb }, - { "&Delete", 0, (Fl_Callback *)delete_cb }, - { 0 }, - - { "&Search", 0, 0, 0, FL_SUBMENU }, - { "&Find...", FL_COMMAND + 'f', (Fl_Callback *)find_cb }, - { "F&ind Again", FL_COMMAND + 'g', find2_cb }, - { "&Replace...", FL_COMMAND + 'r', replace_cb }, - { "Re&place Again", FL_COMMAND + '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->textfont(FL_COURIER); - w->editor->textsize(TS); - //w->editor->wrap_mode(Fl_Text_Editor::WRAP_AT_BOUNDS, 250); - w->editor->buffer(textbuf); - w->editor->highlight_data(stylebuf, styletable, - sizeof(styletable) / sizeof(styletable[0]), - 'A', style_unfinished_cb, 0); - textbuf->text(); - style_init(); - 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; -//textbuf->transcoding_warning_action = NULL; - 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$". -// diff --git a/branch-3.0-2011/test/fast_slow.fl b/branch-3.0-2011/test/fast_slow.fl deleted file mode 100644 index 63e3762b3..000000000 --- a/branch-3.0-2011/test/fast_slow.fl +++ /dev/null @@ -1,40 +0,0 @@ -# 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/branch-3.0-2011/test/file_chooser.cxx b/branch-3.0-2011/test/file_chooser.cxx deleted file mode 100644 index a36a489b0..000000000 --- a/branch-3.0-2011/test/file_chooser.cxx +++ /dev/null @@ -1,390 +0,0 @@ -// -// "$Id$" -// -// File chooser test program. -// -// Copyright 1999-2010 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... -// -// extra_callback() - circle extra groups (none,group1,check_button); -// - -// -// 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 <FL/Fl_Double_Window.H> -#include <string.h> - - -// -// Globals... -// - -Fl_Input *filter; -Fl_File_Browser *files; -Fl_File_Chooser *fc; -Fl_Shared_Image *image = 0; - -// for choosing extra groups -Fl_Choice *ch_extra; -// first extra group -Fl_Group *encodings = (Fl_Group*)0; -Fl_Choice *ch_enc; -// second extra widget -Fl_Check_Button *version = (Fl_Check_Button*)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); - -void extra_callback(Fl_Choice*,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_Double_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_Double_Window(400, 215, "File Chooser Test"); - - filter = new Fl_Input(50, 10, 315, 25, "Filter:"); - int argn = 1; -#ifdef __APPLE__ - // OS X may add the process number as the first argument - ignore - if (argc>argn && strncmp(argv[1], "-psn_", 5)==0) - argn++; -#endif - if (argc > argn) - filter->value(argv[argn]); - 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); - - // - ch_extra = new Fl_Choice(150, 75, 150, 25, "Extra Group:"); - ch_extra->add("none|encodings group|check button"); - ch_extra->value(0); - ch_extra->callback((Fl_Callback *)extra_callback); - // - files = new Fl_File_Browser(50, 105, 340, 75, "Files:"); - files->align(FL_ALIGN_LEFT); - - button = new Fl_Button(340, 185, 50, 25, "Close"); - button->callback((Fl_Callback *)close_callback); - - window->resizable(files); - window->end(); - window->show(1, argv); - - Fl::run(); - - return (0); -} - - -void -extra_callback(Fl_Choice*w,void*) -{ - int val=w->value(); - if (0 == val) fc->add_extra(NULL); - else if (1 == val) { - if(!encodings){ - encodings=new Fl_Group(0,0,254,30); - ch_enc=new Fl_Choice(152,2,100,25,"Choose Encoding:"); - ch_enc->add("ASCII|Koi8-r|win1251|Utf-8"); - encodings->end(); - } - fc->add_extra(encodings); - } else { - if (!version) { - version = new Fl_Check_Button(5,0,200,25,"Save binary 1.0 version"); - } - fc->add_extra(version); - } -} - - -// -// '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[FL_PATH_MAX], // Preview filename - command[FL_PATH_MAX]; // 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[FL_PATH_MAX], // Preview filename - outname[FL_PATH_MAX], // Preview PS file - command[FL_PATH_MAX]; // 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 = fl_fopen(name, "rb"); - out = fl_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[FL_PATH_MAX]; // 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$". -// diff --git a/branch-3.0-2011/test/fl_jpeg_image.cxx b/branch-3.0-2011/test/fl_jpeg_image.cxx deleted file mode 100644 index 49c05082a..000000000 --- a/branch-3.0-2011/test/fl_jpeg_image.cxx +++ /dev/null @@ -1,203 +0,0 @@ -// -// "$Id$" -// -// 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-2010 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$". -// diff --git a/branch-3.0-2011/test/fonts.cxx b/branch-3.0-2011/test/fonts.cxx deleted file mode 100644 index 0543463ae..000000000 --- a/branch-3.0-2011/test/fonts.cxx +++ /dev/null @@ -1,208 +0,0 @@ -// -// "$Id$" -// -// Font demo program for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2010 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_Hold_Browser.H> -#include <FL/fl_draw.H> -#include <FL/Fl_Box.H> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -Fl_Double_Window *form; -Fl_Tile *tile; - -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[0x1000]; - -void create_the_forms() { - // create the sample string - int n = 0; - strcpy(label, "Hello, world!\n"); - int i = strlen(label); - ulong 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 < 0x600; c += 9) { - if (!(++n&(0x1f))) label[i++]='\n'; - i += fl_utf8encode((unsigned int)c, label + i); - } - label[i] = 0; - - // create the basic layout - form = new Fl_Double_Window(550,370); - - tile = new Fl_Tile(0, 0, 550, 370); - - Fl_Group *textgroup = new Fl_Group(0, 0, 550, 185); - textgroup->box(FL_FLAT_BOX); - 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); - textgroup->resizable(textobj); - textgroup->end(); - - Fl_Group *fontgroup = new Fl_Group(0, 185, 550, 185); - fontgroup->box(FL_FLAT_BOX); - fontobj = new Fl_Hold_Browser(10, 190, 390, 170); - fontobj->box(FL_FRAME_BOX); - fontobj->color(53,3); - fontobj->callback(font_cb); - sizeobj = new Fl_Hold_Browser(410, 190, 130, 170); - sizeobj->box(FL_FRAME_BOX); - sizeobj->color(53,3); - sizeobj->callback(size_cb); - fontgroup->resizable(fontobj); - fontgroup->end(); - - tile->end(); - - form->resizable(tile); - 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(); - -// For the Unicode test, get all fonts... -//#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';} - *p++ = '@'; *p++ = '.'; // Suppress subsequent formatting - some MS fonts have '@' in their name - 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$". -// diff --git a/branch-3.0-2011/test/forms.cxx b/branch-3.0-2011/test/forms.cxx deleted file mode 100644 index 9f7bbf9c5..000000000 --- a/branch-3.0-2011/test/forms.cxx +++ /dev/null @@ -1,239 +0,0 @@ -// -// "$Id$" -// -// 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-2010 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"}, - {FL_GTK_UP_BOX,"GTK up box"}, - {FL_GTK_ROUND_UP_BOX,"GTK round up box"}, - /* 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$". -// diff --git a/branch-3.0-2011/test/fractals.cxx b/branch-3.0-2011/test/fractals.cxx deleted file mode 100644 index f6e0fe9e3..000000000 --- a/branch-3.0-2011/test/fractals.cxx +++ /dev/null @@ -1,839 +0,0 @@ -// -// "$Id$" -// -// 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-2010 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 level_seed) -{ - 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); - - srand48(level_seed+1); - glPushMatrix(); - glRotatef(110 + drand48()*40, 0, 1, 0); - glRotatef(30 + drand48()*20, 0, 0, 1); - FractalTree(level + 1, level_seed+4); - glPopMatrix(); - - srand48(level_seed+2); - glPushMatrix(); - glRotatef(-130 + drand48()*40, 0, 1, 0); - glRotatef(30 + drand48()*20, 0, 0, 1); - FractalTree(level + 1, level_seed+5); - glPopMatrix(); - - srand48(level_seed+3); - glPushMatrix(); - glRotatef(-20 + drand48()*40, 0, 1, 0); - glRotatef(30 + drand48()*20, 0, 0, 1); - FractalTree(level + 1, level_seed+6); - 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, TreeSeed); - 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(fl_intptr_t(value));} - -void choosefract(Fl_Widget*, void *value) {choosefract(fl_intptr_t(value));} - -void handlemenu(Fl_Widget*, void *value) {handlemenu(fl_intptr_t(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$". -// diff --git a/branch-3.0-2011/test/fracviewer.cxx b/branch-3.0-2011/test/fracviewer.cxx deleted file mode 100644 index bc45cc045..000000000 --- a/branch-3.0-2011/test/fracviewer.cxx +++ /dev/null @@ -1,506 +0,0 @@ -/* - * 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/branch-3.0-2011/test/fracviewer.h b/branch-3.0-2011/test/fracviewer.h deleted file mode 100644 index b51e65e8c..000000000 --- a/branch-3.0-2011/test/fracviewer.h +++ /dev/null @@ -1,105 +0,0 @@ -/* - * 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/branch-3.0-2011/test/fromdos.c b/branch-3.0-2011/test/fromdos.c deleted file mode 100644 index 54dff5a9f..000000000 --- a/branch-3.0-2011/test/fromdos.c +++ /dev/null @@ -1,65 +0,0 @@ -/* 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/branch-3.0-2011/test/fullscreen.cxx b/branch-3.0-2011/test/fullscreen.cxx deleted file mode 100644 index 243a0066f..000000000 --- a/branch-3.0-2011/test/fullscreen.cxx +++ /dev/null @@ -1,255 +0,0 @@ -// -// "$Id$" -// -// 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-2010 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(); -#ifndef WIN32//necessary because fullscreen removes border - border_button->value(0); - border_button->do_callback(); -#endif - 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$". -// diff --git a/branch-3.0-2011/test/gl_overlay.cxx b/branch-3.0-2011/test/gl_overlay.cxx deleted file mode 100644 index be39518a8..000000000 --- a/branch-3.0-2011/test/gl_overlay.cxx +++ /dev/null @@ -1,157 +0,0 @@ -// -// "$Id$" -// -// OpenGL overlay test program for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2010 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$". -// diff --git a/branch-3.0-2011/test/glpuzzle.cxx b/branch-3.0-2011/test/glpuzzle.cxx deleted file mode 100644 index d312b3a74..000000000 --- a/branch-3.0-2011/test/glpuzzle.cxx +++ /dev/null @@ -1,1486 +0,0 @@ -// -// "$Id$" -// -// 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-2010 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$". -// diff --git a/branch-3.0-2011/test/hello.cxx b/branch-3.0-2011/test/hello.cxx deleted file mode 100644 index d0daff93f..000000000 --- a/branch-3.0-2011/test/hello.cxx +++ /dev/null @@ -1,58 +0,0 @@ -// -// "$Id$" -// -// Hello, World! program for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2010 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> - -int main(int argc, char **argv) { -#if (1) // FIXME: test screen dimensions and resolution. Remove before release ! - float ppi_h, ppi_v; - int x,y,w,h; - int n = Fl::screen_count(); - for (int i=0; i<n; i++) { - Fl::screen_xywh(x,y,w,h,i); - Fl::screen_dpi(ppi_h, ppi_v, i); - printf("Screen %2d (%4d,%4d,%4d,%4d) res. is %7.3f x %7.3f ppi\n", i, x,y,w,h, ppi_h, ppi_v); - } - fflush(stdout); -#endif // FIXME: test screen dimensions and resolution. Remove before release ! - Fl_Window *window = new Fl_Window(340,180); - Fl_Box *box = new Fl_Box(20,40,300,100,"Hello, World!"); - box->box(FL_UP_BOX); - 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$". -// - diff --git a/branch-3.0-2011/test/help.cxx b/branch-3.0-2011/test/help.cxx deleted file mode 100644 index aca3eeff8..000000000 --- a/branch-3.0-2011/test/help.cxx +++ /dev/null @@ -1,105 +0,0 @@ -// -// "$Id$" -// -// Fl_Help_Dialog test program. -// -// Copyright 1999-2010 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> - - -#ifdef USING_XCODE -#include <ApplicationServices/ApplicationServices.h> -void set_app_dir() { - char app_path[2048]; - CFBundleRef app = CFBundleGetMainBundle(); - CFURLRef url = CFBundleCopyBundleURL(app); - CFStringRef cc_app_path = CFURLCopyFileSystemPath(url, kCFURLPOSIXPathStyle); - CFStringGetCString(cc_app_path, app_path, 2048, kCFStringEncodingUTF8); - if (*app_path) { - char *n = strrchr(app_path, '/'); - if (n) { - *n = 0; - chdir(app_path); - } - } -} -#endif - - -// -// '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; - - int argn = 1; - -#ifdef USING_XCODE - - if (argc>argn && strncmp(argv[1], "-psn_", 5)==0) - argn++; - set_app_dir(); - - if (argc <= argn) - help->load("../../../../documentation/html/intro.html"); - else - help->load(argv[argn]); - -#else - - if (argc <= argn) - help->load("../documentation/html/intro.html"); - else - help->load(argv[1]); - -#endif - - help->show(1, argv); - - Fl::run(); - - delete help; - - return (0); -} - - -// -// End of "$Id$". -// diff --git a/branch-3.0-2011/test/iconize.cxx b/branch-3.0-2011/test/iconize.cxx deleted file mode 100644 index c1d130f2e..000000000 --- a/branch-3.0-2011/test/iconize.cxx +++ /dev/null @@ -1,83 +0,0 @@ -// -// "$Id$" -// -// Iconize test program for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2010 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$". -// diff --git a/branch-3.0-2011/test/image.cxx b/branch-3.0-2011/test/image.cxx deleted file mode 100644 index a70eca850..000000000 --- a/branch-3.0-2011/test/image.cxx +++ /dev/null @@ -1,161 +0,0 @@ -// -// "$Id$" -// -// 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-2010 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_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_Double_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_Double_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$". -// diff --git a/branch-3.0-2011/test/inactive.fl b/branch-3.0-2011/test/inactive.fl deleted file mode 100644 index e8e90377f..000000000 --- a/branch-3.0-2011/test/inactive.fl +++ /dev/null @@ -1,120 +0,0 @@ -# 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/branch-3.0-2011/test/input.cxx b/branch-3.0-2011/test/input.cxx deleted file mode 100644 index 79a04ef22..000000000 --- a/branch-3.0-2011/test/input.cxx +++ /dev/null @@ -1,171 +0,0 @@ -// -// "$Id$" -// -// Input field test program for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2010 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_Light_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()); - char utf8buf[10]; - int last = fl_utf8encode(i->index(i->position()), utf8buf); - utf8buf[last] = 0; - printf("Symbol at cursor position: %s\n", utf8buf); - } -} - -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 ((fl_intptr_t)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(); - } -} - -void tabnav_cb(Fl_Widget *w, void *v) { - Fl_Light_Button *b = (Fl_Light_Button*)w; - Fl_Multiline_Input *fmi = (Fl_Multiline_Input*)v; - fmi->tab_nav(b->value() ? 1 : 0); -} - -void arrownav_cb(Fl_Widget *w, void *v) { - Fl_Light_Button *b = (Fl_Light_Button*)w; - Fl::option(Fl::OPTION_ARROW_FOCUS, b->value() ? true : false); -} - -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,420); - - 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 (F1)"); - input[1]->shortcut(FL_F+1); - input[2] = new Fl_Int_Input(70,y,300,30,"Int:"); y += 35; - input[2]->tooltip("Input field for integer number (F2)"); - input[2]->shortcut(FL_F+2); - input[3] = new Fl_Secret_Input(70,y,300,30,"&Secret:"); y += 35; - input[3]->tooltip("Input field for password (Alt-S)"); - input[4] = new Fl_Multiline_Input(70,y,300,100,"&Multiline:"); y += 105; - input[4]->tooltip("Input field for short text with newlines (Alt-M)"); - 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()"); y += 25; - b->callback(button_cb); - b->tooltip("Print widgets that have changed() flag set"); - - b = new Fl_Light_Button(10,y,100,25," Tab Nav"); - b->tooltip("Control tab navigation for the multiline input field"); - b->callback(tabnav_cb, (void*)input[4]); - b->value(input[4]->tab_nav() ? 1 : 0); - b = new Fl_Light_Button(110,y,100,25," Arrow Nav"); y += 25; - b->tooltip("Control horizontal arrow key focus navigation behavior.\n" - "e.g. Fl::OPTION_ARROW_FOCUS"); - b->callback(arrownav_cb); - b->value(input[4]->tab_nav() ? 1 : 0); - b->value(Fl::option(Fl::OPTION_ARROW_FOCUS) ? 1 : 0); - - 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$". -// diff --git a/branch-3.0-2011/test/input_choice.cxx b/branch-3.0-2011/test/input_choice.cxx deleted file mode 100644 index 1e27bb51e..000000000 --- a/branch-3.0-2011/test/input_choice.cxx +++ /dev/null @@ -1,68 +0,0 @@ -// -// "$Id$" -// -// Test program for Fl_Input_Choice -// -// Copyright 1998-2010 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_Double_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_Double_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$". -// diff --git a/branch-3.0-2011/test/keyboard.cxx b/branch-3.0-2011/test/keyboard.cxx deleted file mode 100644 index 2d0034899..000000000 --- a/branch-3.0-2011/test/keyboard.cxx +++ /dev/null @@ -1,158 +0,0 @@ -// -// "$Id$" -// -// 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-2010 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); - MyWindow *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 = b->argument(); - 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 = b->argument(); - 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$". -// diff --git a/branch-3.0-2011/test/keyboard.h b/branch-3.0-2011/test/keyboard.h deleted file mode 100644 index 3b2c04de1..000000000 --- a/branch-3.0-2011/test/keyboard.h +++ /dev/null @@ -1,46 +0,0 @@ -// -// "$Id$" -// -// Keyboard/event test header for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2010 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$". -// diff --git a/branch-3.0-2011/test/keyboard_ui.fl b/branch-3.0-2011/test/keyboard_ui.fl deleted file mode 100644 index 60aab2ad4..000000000 --- a/branch-3.0-2011/test/keyboard_ui.fl +++ /dev/null @@ -1,719 +0,0 @@ -# data file for the Fltk User Interface Designer (fluid) -version 1.0300 -header_name {.h} -code_name {.cxx} -Function {make_window()} {open -} { - Fl_Window my_window {open selected - xywh {461 296 495 215} type Double - code0 {\#include "keyboard.h"} - class MyWindow visible - } { - Fl_Button {} { - label {Esc } - user_data FL_Escape user_data_type {void*} - callback key_cb - xywh {15 70 20 20} labelsize 8 - } - Fl_Button {} { - label F1 - user_data {FL_F+1} user_data_type {void*} - callback key_cb - xywh {50 70 20 20} labelsize 10 - } - Fl_Button {} { - label F2 - user_data {FL_F+2} user_data_type {void*} - callback key_cb - xywh {70 70 20 20} labelsize 10 - } - Fl_Button {} { - label F3 - user_data {FL_F+3} user_data_type {void*} - callback key_cb - xywh {90 70 20 20} labelsize 10 - } - Fl_Button {} { - label F4 - user_data {FL_F+4} user_data_type {void*} - callback key_cb - xywh {110 70 20 20} labelsize 10 - } - Fl_Button {} { - label F5 - user_data {FL_F+5} user_data_type {void*} - callback key_cb - xywh {140 70 20 20} labelsize 10 - } - Fl_Button {} { - label F6 - user_data {FL_F+6} user_data_type {void*} - callback key_cb - xywh {160 70 20 20} labelsize 10 - } - Fl_Button {} { - label F7 - user_data {FL_F+7} user_data_type {void*} - callback key_cb - xywh {180 70 20 20} labelsize 10 - } - Fl_Button {} { - label F8 - user_data {FL_F+8} user_data_type {void*} - callback key_cb - xywh {200 70 20 20} labelsize 10 - } - Fl_Button {} { - label F9 - user_data {FL_F+9} user_data_type {void*} - callback key_cb - xywh {230 70 20 20} labelsize 10 - } - Fl_Button {} { - label F10 - user_data {FL_F+10} user_data_type {void*} - callback key_cb - xywh {250 70 20 20} labelsize 10 - } - Fl_Button {} { - label F11 - user_data {FL_F+11} user_data_type {void*} - callback key_cb - xywh {270 70 20 20} labelsize 10 - } - Fl_Button {} { - label F12 - user_data {FL_F+12} user_data_type {void*} - callback key_cb - xywh {290 70 20 20} labelsize 10 - } - Fl_Button {} { - label {Print } - user_data FL_Print user_data_type {void*} - callback key_cb - xywh {325 70 20 20} labelsize 8 - } - Fl_Button {} { - label {Sclk } - user_data FL_Scroll_Lock user_data_type {void*} - callback key_cb - xywh {345 70 20 20} labelsize 8 - } - Fl_Button {} { - label {Paus } - user_data FL_Pause user_data_type {void*} - callback key_cb - xywh {365 70 20 20} labelsize 8 - } - Fl_Button {} { - label {`} - callback key_cb - xywh {15 100 20 20} labelsize 10 - } - Fl_Button {} { - label 1 - callback key_cb - xywh {35 100 20 20} labelsize 10 - } - Fl_Button {} { - label 2 - callback key_cb - xywh {55 100 20 20} labelsize 10 - } - Fl_Button {} { - label 3 - callback key_cb - xywh {75 100 20 20} labelsize 10 - } - Fl_Button {} { - label 4 - callback key_cb - xywh {95 100 20 20} labelsize 10 - } - Fl_Button {} { - label 5 - callback key_cb - xywh {115 100 20 20} labelsize 10 - } - Fl_Button {} { - label 6 - callback key_cb - xywh {135 100 20 20} labelsize 10 - } - Fl_Button {} { - label 7 - callback key_cb - xywh {155 100 20 20} labelsize 10 - } - Fl_Button {} { - label 8 - callback key_cb - xywh {175 100 20 20} labelsize 10 - } - Fl_Button {} { - label 9 - callback key_cb - xywh {195 100 20 20} labelsize 10 - } - Fl_Button {} { - label 0 - callback key_cb - xywh {215 100 20 20} labelsize 10 - } - Fl_Button {} { - label {-} - callback key_cb - xywh {235 100 20 20} labelsize 10 - } - Fl_Button {} { - label {=} - callback key_cb - xywh {255 100 20 20} labelsize 10 - } - Fl_Button {} { - label Bksp - user_data FL_BackSpace user_data_type {void*} - callback key_cb - xywh {275 100 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 100 20 20} labelsize 8 - } - Fl_Button {} { - label Home - user_data FL_Home user_data_type {void*} - callback key_cb - xywh {345 100 20 20} labelsize 8 - } - Fl_Button {} { - label {pgup } - user_data FL_Page_Up user_data_type {void*} - callback key_cb - xywh {365 100 20 20} labelsize 8 - } - Fl_Button {} { - label Num - user_data FL_Num_Lock user_data_type {void*} - callback key_cb - xywh {400 100 20 20} labelsize 8 - } - Fl_Button {} { - label {/} - user_data {FL_KP+'/'} user_data_type {void*} - callback key_cb - xywh {420 100 20 20} labelsize 10 - } - Fl_Button {} { - label {*} - user_data {FL_KP+'*'} user_data_type {void*} - callback key_cb - xywh {440 100 20 20} labelsize 10 - } - Fl_Button {} { - label {-} - user_data {FL_KP+'-'} user_data_type {void*} - callback key_cb - xywh {460 100 20 20} labelsize 10 - } - Fl_Button {} { - label Tab - user_data FL_Tab user_data_type {void*} - callback key_cb - xywh {15 120 27 20} labelsize 8 align 20 - } - Fl_Button {} { - label Q - callback key_cb - xywh {42 120 20 20} labelsize 10 - } - Fl_Button {} { - label W - callback key_cb - xywh {62 120 20 20} labelsize 10 - } - Fl_Button {} { - label E - callback key_cb - xywh {82 120 20 20} labelsize 10 - } - Fl_Button {} { - label R - callback key_cb - xywh {102 120 20 20} labelsize 10 - } - Fl_Button {} { - label T - callback key_cb - xywh {122 120 20 20} labelsize 10 - } - Fl_Button {} { - label Y - callback key_cb - xywh {142 120 20 20} labelsize 10 - } - Fl_Button {} { - label U - callback key_cb - xywh {162 120 20 20} labelsize 10 - } - Fl_Button {} { - label I - callback key_cb - xywh {182 120 20 20} labelsize 10 - } - Fl_Button {} { - label O - callback key_cb - xywh {202 120 20 20} labelsize 10 - } - Fl_Button {} { - label P - callback key_cb - xywh {222 120 20 20} labelsize 10 - } - Fl_Button {} { - label {[} - callback key_cb - xywh {242 120 20 20} labelsize 10 - } - Fl_Button {} { - label {]} - callback key_cb - xywh {262 120 20 20} labelsize 10 - } - Fl_Button {} { - label {\\} - user_data {'|'} - callback key_cb - xywh {282 120 28 20} labelsize 10 align 20 - } - Fl_Button {} { - label {Del } - user_data FL_Delete user_data_type {void*} - callback key_cb - xywh {325 120 20 20} labelsize 8 - } - Fl_Button {} { - label {End } - user_data FL_End user_data_type {void*} - callback key_cb - xywh {345 120 20 20} labelsize 8 - } - Fl_Button {} { - label {pgdn } - user_data FL_Page_Down user_data_type {void*} - callback key_cb - xywh {365 120 20 20} labelsize 8 - } - Fl_Button {} { - label 7 - user_data {FL_KP+'7'} user_data_type {void*} - callback key_cb - xywh {400 120 20 20} labelsize 10 - } - Fl_Button {} { - label 8 - user_data {FL_KP+'8'} user_data_type {void*} - callback key_cb - xywh {420 120 20 20} labelsize 10 - } - Fl_Button {} { - label 9 - user_data {FL_KP+'9'} user_data_type {void*} - callback key_cb - xywh {440 120 20 20} labelsize 10 - } - Fl_Button {} { - label {+} - user_data {FL_KP+'+'} user_data_type {void*} - callback key_cb - xywh {460 120 20 40} labelsize 10 align 17 - } - Fl_Button {} { - label Lock - user_data FL_Caps_Lock user_data_type {void*} - callback key_cb - xywh {15 140 36 20} labelsize 8 align 20 - } - Fl_Button {} { - label A - callback key_cb - xywh {51 140 20 20} labelsize 10 - } - Fl_Button {} { - label S - callback key_cb - xywh {71 140 20 20} labelsize 10 - } - Fl_Button {} { - label D - callback key_cb - xywh {91 140 20 20} labelsize 10 - } - Fl_Button {} { - label F - callback key_cb - xywh {111 140 20 20} labelsize 10 - } - Fl_Button {} { - label G - callback key_cb - xywh {131 140 20 20} labelsize 10 - } - Fl_Button {} { - label H - callback key_cb - xywh {151 140 20 20} labelsize 10 - } - Fl_Button {} { - label J - callback key_cb - xywh {171 140 20 20} labelsize 10 - } - Fl_Button {} { - label K - callback key_cb - xywh {191 140 20 20} labelsize 10 - } - Fl_Button {} { - label L - callback key_cb - xywh {211 140 20 20} labelsize 10 - } - Fl_Button {} { - label {;} - callback key_cb - xywh {231 140 20 20} labelsize 10 - } - Fl_Button {} { - label {'} - callback key_cb - xywh {251 140 20 20} labelsize 10 - } - Fl_Button {} { - label Enter - user_data FL_Enter user_data_type {void*} - callback key_cb - xywh {271 140 39 20} labelsize 8 align 20 - } - Fl_Button {} { - label 4 - user_data {FL_KP+'4'} user_data_type {void*} - callback key_cb - xywh {400 140 20 20} labelsize 10 - } - Fl_Button {} { - label 5 - user_data {FL_KP+'5'} user_data_type {void*} - callback key_cb - xywh {420 140 20 20} labelsize 10 - } - Fl_Button {} { - label 6 - user_data {FL_KP+'6'} user_data_type {void*} - callback key_cb - xywh {440 140 20 20} labelsize 10 - } - Fl_Button {} { - label Shift - user_data FL_Shift_L user_data_type {void*} - callback key_cb - xywh {15 160 45 20} labelsize 8 align 20 - } - Fl_Button {} { - label Z - callback key_cb - xywh {60 160 20 20} labelsize 10 - } - Fl_Button {} { - label X - callback key_cb - xywh {80 160 20 20} labelsize 10 - } - Fl_Button {} { - label C - callback key_cb - xywh {100 160 20 20} labelsize 10 - } - Fl_Button {} { - label V - callback key_cb - xywh {120 160 20 20} labelsize 10 - } - Fl_Button {} { - label B - callback key_cb - xywh {140 160 20 20} labelsize 10 - } - Fl_Button {} { - label N - callback key_cb - xywh {160 160 20 20} labelsize 10 - } - Fl_Button {} { - label M - callback key_cb - xywh {180 160 20 20} labelsize 10 - } - Fl_Button {} { - label {,} - callback key_cb - xywh {200 160 20 20} labelsize 10 - } - Fl_Button {} { - label {.} - callback key_cb - xywh {220 160 20 20} labelsize 10 - } - Fl_Button {} { - label {/} - callback key_cb - xywh {240 160 20 20} labelsize 10 - } - Fl_Button {} { - label Shift - user_data FL_Shift_R user_data_type {void*} - callback key_cb - xywh {260 160 50 20} labelsize 8 align 20 - } - Fl_Button {} { - label {@8->} - user_data FL_Up user_data_type {void*} - callback key_cb - xywh {345 160 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 160 20 20} labelsize 10 - } - Fl_Button {} { - label 2 - user_data {FL_KP+'2'} user_data_type {void*} - callback key_cb - xywh {420 160 20 20} labelsize 10 - } - Fl_Button {} { - label 3 - user_data {FL_KP+'3'} user_data_type {void*} - callback key_cb - xywh {440 160 20 20} labelsize 10 - } - Fl_Button {} { - user_data FL_KP_Enter user_data_type {void*} - callback key_cb - xywh {460 160 20 40} - } - Fl_Button {} { - label Ctrl - user_data FL_Control_L user_data_type {void*} - callback key_cb - xywh {15 180 30 20} labelsize 8 align 20 - } - Fl_Button {} { - label {Meta } - user_data FL_Meta_L user_data_type {void*} - callback key_cb - xywh {45 180 30 20} labelsize 8 - } - Fl_Button {} { - label {Alt } - user_data FL_Alt_L user_data_type {void*} - callback key_cb - xywh {75 180 30 20} labelsize 8 - } - Fl_Button {} { - user_data {' '} user_data_type {void*} - callback key_cb - xywh {105 180 85 20} labelsize 10 - } - Fl_Button {} { - label {Alt } - user_data FL_Alt_R user_data_type {void*} - callback key_cb - xywh {190 180 30 20} labelsize 8 - } - Fl_Button {} { - label {Meta } - user_data FL_Meta_R user_data_type {void*} - callback key_cb - xywh {220 180 30 20} labelsize 8 - } - Fl_Button {} { - label {Menu } - user_data FL_Menu user_data_type {void*} - callback key_cb - xywh {250 180 30 20} labelsize 8 - } - Fl_Button {} { - label Ctrl - user_data FL_Control_R user_data_type {void*} - callback key_cb - xywh {280 180 30 20} labelsize 8 align 20 - } - Fl_Button {} { - label {@4->} - user_data FL_Left user_data_type {void*} - callback key_cb - xywh {325 180 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 180 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 180 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 180 40 20} labelsize 10 align 20 - } - Fl_Button {} { - label {.} - user_data {FL_KP+'.'} user_data_type {void*} - callback key_cb - xywh {440 180 20 20} labelsize 10 - } - Fl_Button {} { - label {shift } - user_data FL_SHIFT user_data_type {void*} - callback shift_cb - xywh {400 15 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 15 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 15 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 15 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 25 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 25 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 25 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 25 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 35 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 35 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 35 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 35 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 45 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 45 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 45 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 45 20 10} box THIN_UP_BOX selection_color 3 labelsize 8 - } - Fl_Output key_output { - label {Fl::event_key():} - xywh {15 20 170 30} labelsize 9 align 5 - } - Fl_Box {} { - label {Fl::event_state():} - xywh {400 15 80 40} labelsize 9 align 5 - } - Fl_Output text_output { - label {Fl::event_text():} - xywh {195 20 190 30} labelsize 9 align 5 - } - Fl_Button {} { - label Help - user_data FL_Help user_data_type {void*} - callback key_cb - xywh {400 70 20 20} labelsize 8 - } - Fl_Button {} { - label {=} - user_data {FL_KP+'='} user_data_type {void*} - callback key_cb - xywh {420 70 20 20} labelsize 10 - } - Fl_Dial roller_x { - label {x:} - callback wheel_cb - xywh {440 70 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 70 20 20} box ROUND_UP_BOX selection_color 49 labelsize 9 align 5 step 0.1 - } - } -} diff --git a/branch-3.0-2011/test/label.cxx b/branch-3.0-2011/test/label.cxx deleted file mode 100644 index d3ad47dc1..000000000 --- a/branch-3.0-2011/test/label.cxx +++ /dev/null @@ -1,188 +0,0 @@ -// -// "$Id$" -// -// Label test program for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2010 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_Pixmap.H> -#include <FL/fl_draw.H> - -#include "pixmaps/blast.xpm" - -Fl_Toggle_Button *imageb, *imageovertextb, *imagenexttotextb, *imagebackdropb; -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; -Fl_Pixmap *img; - -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; - if (imageovertextb->value()) i |= FL_ALIGN_TEXT_OVER_IMAGE; - if (imagenexttotextb->value()) i |= FL_ALIGN_IMAGE_NEXT_TO_TEXT; - if (imagebackdropb->value()) i |= FL_ALIGN_IMAGE_BACKDROP; - text->align(i); - window->redraw(); -} - -void image_cb(Fl_Widget *,void *) { - if (imageb->value()) - text->image(img); - else - text->image(0); - 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) { - img = new Fl_Pixmap(blast_xpm); - - window = new Fl_Double_Window(400,400); - - input = new Fl_Input(50,375,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,350,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,325,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(50,275,350,50); - imageb = new Fl_Toggle_Button(50,275,50,25,"image"); - imageb->callback(image_cb); - imageovertextb = new Fl_Toggle_Button(100,275,50,25,"I - T"); - imageovertextb->callback(button_cb); - imagenexttotextb = new Fl_Toggle_Button(150,275,50,25,"I | T"); - imagenexttotextb->callback(button_cb); - imagebackdropb = new Fl_Toggle_Button(200,275,50,25,"back"); - imagebackdropb->callback(button_cb); - leftb = new Fl_Toggle_Button(50,300,50,25,"left"); - leftb->callback(button_cb); - rightb = new Fl_Toggle_Button(100,300,50,25,"right"); - rightb->callback(button_cb); - topb = new Fl_Toggle_Button(150,300,50,25,"top"); - topb->callback(button_cb); - bottomb = new Fl_Toggle_Button(200,300,50,25,"bottom"); - bottomb->callback(button_cb); - insideb = new Fl_Toggle_Button(250,300,50,25,"inside"); - insideb->callback(button_cb); - wrapb = new Fl_Toggle_Button(300,300,50,25,"wrap"); - wrapb->callback(button_cb); - clipb = new Fl_Toggle_Button(350,300,50,25,"clip"); - clipb->callback(button_cb); - g->resizable(insideb); - g->end(); - - Fl_Choice *c = new Fl_Choice(50,250,200,25); - c->menu(choices); - - text= new Fl_Box(FL_FRAME_BOX,100,75,200,100,input->value()); - text->align(FL_ALIGN_CENTER); - window->resizable(text); - window->end(); - window->show(argc,argv); - return Fl::run(); -} - -// -// End of "$Id$". -// diff --git a/branch-3.0-2011/test/line_style.cxx b/branch-3.0-2011/test/line_style.cxx deleted file mode 100644 index b9bca1722..000000000 --- a/branch-3.0-2011/test/line_style.cxx +++ /dev/null @@ -1,177 +0,0 @@ -// -// "$Id$" -// -// Line style demo for the Fast Light Tool Kit (FLTK). -// -// Copyright 2000-2010 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_Value_Slider.H> -#include <FL/fl_draw.H> -#include <FL/Fl_Choice.H> -#include <FL/Fl_Check_Button.H> -#include <FL/Fl_Box.H> - -Fl_Double_Window *form; -Fl_Slider *sliders[9]; -Fl_Choice *choice[3]; -Fl_Check_Button *draw_line; - -class test_box: public Fl_Double_Window { - void draw(); -public: - test_box(int x,int y,int w,int h,const char *l=0) - : Fl_Double_Window(x,y,w,h,l) {} -}*test; - -void test_box::draw() { - Fl_Double_Window::draw(); - fl_color((uchar)(sliders[0]->value()), - (uchar)(sliders[1]->value()), - (uchar)(sliders[2]->value())); - // dashes - char dashes[5]; - dashes[0] = char(sliders[5]->value()); - dashes[1] = char(sliders[6]->value()); - dashes[2] = char(sliders[7]->value()); - dashes[3] = char(sliders[8]->value()); - dashes[4] = 0; - fl_line_style( - choice[0]->mvalue()->argument() + - choice[1]->mvalue()->argument() + - choice[2]->mvalue()->argument(), - long(sliders[3]->value()), // width - dashes); - - // draw the defined fl_rect and fl_vertex first and then - // the additional one-pixel line, if enabled - // sliders[4] = x/y coordinate translation (default = 10) - - for (int i=0; i<draw_line->value()+1; i++) { - int move = (int)sliders[4]->value(); - fl_rect(move,move,w()-20,h()-20); - fl_begin_line(); - fl_vertex(move+25, move+25); - fl_vertex(w()-45+move, h()-45+move); - fl_vertex(w()-50+move, move+25); - fl_vertex(move+25, h()/2-10+move); - fl_end_line(); - // you must reset the line type when done: - fl_line_style(FL_SOLID); - fl_color(FL_BLACK); - } -} - -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_Double_Window(500,250,"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_Value_Slider(280,150,180,20,"Move"); - sliders[4]->bounds(-10,20); - draw_line = new Fl_Check_Button(280,170,20,20,"&Line"); - draw_line->align(FL_ALIGN_LEFT); - new Fl_Box (305,170,160,20,"add a 1-pixel black line"); - sliders[5] = new Fl_Slider(200,210,70,20,"Dash"); - sliders[5]->align(FL_ALIGN_TOP_LEFT); - sliders[5]->bounds(0,40); - sliders[6] = new Fl_Slider(270,210,70,20); - sliders[6]->bounds(0,40); - sliders[7] = new Fl_Slider(340,210,70,20); - sliders[7]->bounds(0,40); - sliders[8] = new Fl_Slider(410,210,70,20); - sliders[8]->bounds(0,40); - int i; - for (i=0;i<9;i++) { - sliders[i]->type(1); - if (i<5) sliders[i]->align(FL_ALIGN_LEFT); - sliders[i]->callback((Fl_Callback*)do_redraw); - sliders[i]->step(1); - } - sliders[0]->value(255); // R - sliders[1]->value(100); // G - sliders[2]->value(100); // B - sliders[4]->value(10); // move line coordinates - draw_line->value(0); - draw_line->callback((Fl_Callback*)do_redraw); - for (i=0;i<3;i++) { - choice[i]->value(0); - choice[i]->callback((Fl_Callback*)do_redraw); - } - test = new test_box(0,0,200,200); - 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$". -// diff --git a/branch-3.0-2011/test/list_visuals.cxx b/branch-3.0-2011/test/list_visuals.cxx deleted file mode 100644 index 44e33b64b..000000000 --- a/branch-3.0-2011/test/list_visuals.cxx +++ /dev/null @@ -1,241 +0,0 @@ -// -// "$Id$" -// -// 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-2010 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$". -// diff --git a/branch-3.0-2011/test/makedepend b/branch-3.0-2011/test/makedepend deleted file mode 100644 index ddc60500f..000000000 --- a/branch-3.0-2011/test/makedepend +++ /dev/null @@ -1,578 +0,0 @@ -# DO NOT DELETE THIS LINE -- make depend depends on it. - -unittests.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h -unittests.o: ../FL/Xutf8.h ../FL/Enumerations.H ../FL/Fl_Double_Window.H -unittests.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H -unittests.o: ../FL/Fl_Hold_Browser.H ../FL/Fl_Browser.H ../FL/Fl_Browser_.H -unittests.o: ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H -unittests.o: ../FL/Fl_Image.H ../FL/Fl_Help_View.H ../FL/Fl.H ../FL/fl_draw.H -unittests.o: ../FL/x.H ../FL/Enumerations.H ../FL/Fl_Window.H -unittests.o: ../FL/Fl_Device.H ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H -unittests.o: ../FL/Fl_Image.H ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H -unittests.o: ../FL/Fl_RGB_Image.H ../FL/Fl_Shared_Image.H ../FL/filename.H -unittests.o: ../FL/Fl_Group.H ../FL/Fl_Box.H ../FL/fl_draw.H -unittests.o: unittest_about.cxx unittest_points.cxx unittest_lines.cxx -unittests.o: unittest_rects.cxx unittest_circles.cxx unittest_text.cxx -unittests.o: unittest_images.cxx unittest_viewport.cxx -unittests.o: unittest_scrollbarsize.cxx ../FL/Fl_Browser.H ../FL/Fl_Tree.H -unittests.o: ../FL/Fl_Scrollbar.H ../FL/Fl_Tree_Item.H ../FL/Fl_Widget.H -unittests.o: ../FL/Fl_Tree_Item_Array.H ../FL/Fl_Tree_Prefs.H -unittests.o: ../FL/Fl_Value_Slider.H -adjuster.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h -adjuster.o: ../FL/Xutf8.h ../FL/Enumerations.H ../FL/Fl_Double_Window.H -adjuster.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H -adjuster.o: ../FL/Fl_Adjuster.H ../FL/Fl_Valuator.H ../FL/Fl_Box.H -arc.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h -arc.o: ../FL/Xutf8.h ../FL/Enumerations.H ../FL/Fl_Double_Window.H -arc.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H -arc.o: ../FL/Fl_Hor_Value_Slider.H ../FL/Fl_Value_Slider.H ../FL/Fl_Slider.H -arc.o: ../FL/Fl_Valuator.H ../FL/fl_draw.H -ask.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h -ask.o: ../FL/Xutf8.h ../FL/Enumerations.H ../FL/Fl_Double_Window.H -ask.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Input.H -ask.o: ../FL/Fl_Input_.H ../FL/Fl_Button.H ../FL/Fl_Return_Button.H -ask.o: ../FL/Fl_Button.H ../FL/fl_ask.H -bitmap.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h -bitmap.o: ../FL/Xutf8.h ../FL/Enumerations.H ../FL/Fl_Double_Window.H -bitmap.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H -bitmap.o: ../FL/Fl_Button.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H -bitmap.o: ../FL/Fl_Toggle_Button.H ../FL/Fl_Button.H -blocks.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h -blocks.o: ../FL/Xutf8.h ../FL/Enumerations.H ../FL/Fl_Double_Window.H -blocks.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H -blocks.o: ../FL/Fl_Button.H ../FL/Fl_Preferences.H ../FL/Fl_XPM_Image.H -blocks.o: ../FL/Fl_Pixmap.H ../FL/Fl_Image.H ../FL/Fl_XBM_Image.H -blocks.o: ../FL/Fl_Bitmap.H ../FL/Fl_Tiled_Image.H ../FL/fl_draw.H ../FL/x.H -blocks.o: ../config.h pixmaps/blast.xpm pixmaps/red.xpm pixmaps/red_bomb.xpm -blocks.o: pixmaps/green.xpm pixmaps/green_bomb.xpm pixmaps/blue.xpm -blocks.o: pixmaps/blue_bomb.xpm pixmaps/yellow.xpm pixmaps/yellow_bomb.xpm -blocks.o: pixmaps/cyan.xpm pixmaps/cyan_bomb.xpm pixmaps/magenta.xpm -blocks.o: pixmaps/magenta_bomb.xpm pixmaps/gray.xpm pixmaps/gray_bomb.xpm -boxtype.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h -boxtype.o: ../FL/Xutf8.h ../FL/Enumerations.H ../FL/Fl_Double_Window.H -boxtype.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H -boxtype.o: ../FL/Fl_Box.H -browser.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h -browser.o: ../FL/Xutf8.h ../FL/Enumerations.H ../FL/Fl_Select_Browser.H -browser.o: ../FL/Fl_Browser.H ../FL/Fl_Browser_.H ../FL/Fl_Scrollbar.H -browser.o: ../FL/Fl_Slider.H ../FL/Fl_Valuator.H ../FL/Fl_Image.H -browser.o: ../FL/Fl_Double_Window.H ../FL/Fl_Window.H ../FL/Fl_Group.H -browser.o: ../FL/Fl_Widget.H ../FL/Fl_Button.H ../FL/Fl_Int_Input.H -browser.o: ../FL/Fl_Input.H ../FL/Fl_Input_.H ../FL/fl_ask.H -button.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h -button.o: ../FL/Xutf8.h ../FL/Enumerations.H ../FL/Fl_Window.H -button.o: ../FL/Fl_Button.H -buttons.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h -buttons.o: ../FL/Xutf8.h ../FL/Enumerations.H ../FL/Fl_Window.H -buttons.o: ../FL/Fl_Button.H ../FL/Fl_Return_Button.H ../FL/Fl_Button.H -buttons.o: ../FL/Fl_Repeat_Button.H ../FL/Fl.H ../FL/Fl_Check_Button.H -buttons.o: ../FL/Fl_Light_Button.H ../FL/Fl_Light_Button.H -buttons.o: ../FL/Fl_Round_Button.H ../FL/Fl_Tooltip.H ../FL/Fl_Widget.H -cairo_test.o: ../config.h ../FL/fl_ask.H ../FL/Enumerations.H -cairo_test.o: ../FL/Fl_Export.H ../FL/fl_types.h -checkers.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h -checkers.o: ../FL/Xutf8.h ../FL/Enumerations.H ../FL/Fl_Double_Window.H -checkers.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H -checkers.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/fl_draw.H -checkers.o: ../FL/Fl_Menu_Item.H ../FL/fl_ask.H pixmaps/black_1.xbm -checkers.o: pixmaps/black_2.xbm pixmaps/black_3.xbm pixmaps/black_4.xbm -checkers.o: pixmaps/white_1.xbm pixmaps/white_2.xbm pixmaps/white_3.xbm -checkers.o: pixmaps/white_4.xbm pixmaps/blackking_1.xbm -checkers.o: pixmaps/blackking_2.xbm pixmaps/blackking_3.xbm -checkers.o: pixmaps/blackking_4.xbm pixmaps/whiteking_1.xbm -checkers.o: pixmaps/whiteking_2.xbm pixmaps/whiteking_3.xbm -checkers.o: pixmaps/whiteking_4.xbm ../FL/Fl_Box.H ../FL/Fl_Slider.H -checkers.o: ../FL/Fl_Valuator.H ../FL/Fl_Value_Output.H -clock.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h -clock.o: ../FL/Xutf8.h ../FL/Enumerations.H ../FL/Fl_Double_Window.H -clock.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H -clock.o: ../FL/Fl_Clock.H ../FL/Fl_Round_Clock.H ../FL/Fl_Clock.H -colbrowser.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h -colbrowser.o: ../FL/Xutf8.h ../FL/Enumerations.H ../FL/Fl_Double_Window.H -colbrowser.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H -colbrowser.o: ../FL/Fl_Button.H ../FL/Fl_Value_Slider.H ../FL/Fl_Slider.H -colbrowser.o: ../FL/Fl_Valuator.H ../FL/Fl_Hold_Browser.H ../FL/Fl_Browser.H -colbrowser.o: ../FL/Fl_Browser_.H ../FL/Fl_Scrollbar.H ../FL/Fl_Image.H -colbrowser.o: ../FL/Fl_Box.H ../FL/fl_ask.H ../FL/filename.H -color_chooser.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H -color_chooser.o: ../FL/fl_types.h ../FL/Xutf8.h ../FL/Enumerations.H -color_chooser.o: ../FL/Fl_Window.H ../FL/Fl_Box.H ../FL/Fl_Button.H -color_chooser.o: ../FL/fl_show_colormap.H ../FL/Fl_Color_Chooser.H -color_chooser.o: ../FL/Fl_Group.H ../FL/Fl_Return_Button.H ../FL/Fl_Button.H -color_chooser.o: ../FL/Fl_Choice.H ../FL/Fl_Menu_.H ../FL/Fl_Widget.H -color_chooser.o: ../FL/Fl_Menu_Item.H ../FL/Fl_Image.H ../FL/Fl_Value_Input.H -color_chooser.o: ../FL/Fl_Valuator.H ../FL/Fl_Input.H ../FL/Fl_Input_.H -color_chooser.o: ../FL/Fl_Image.H ../FL/x.H ../FL/Fl_Window.H -color_chooser.o: ../FL/Fl_Group.H ../FL/fl_draw.H list_visuals.cxx -color_chooser.o: ../config.h -cube.o: ../config.h ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H -cube.o: ../FL/fl_types.h ../FL/Xutf8.h ../FL/Enumerations.H ../FL/Fl_Window.H -cube.o: ../FL/Fl_Box.H ../FL/Fl_Button.H ../FL/Fl_Radio_Light_Button.H -cube.o: ../FL/Fl_Light_Button.H ../FL/Fl_Button.H ../FL/Fl_Slider.H -cube.o: ../FL/Fl_Valuator.H ../FL/Fl_Gl_Window.H ../FL/Fl_Window.H -cube.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/gl.h ../FL/Fl_Sys_Menu_Bar.H -cube.o: ../FL/Fl_Menu_Bar.H ../FL/Fl_Menu_.H ../FL/Fl_Menu_Item.H -cube.o: ../FL/Fl_Image.H ../FL/x.H ../FL/Fl_Printer.H ../FL/x.H -cube.o: ../FL/Fl_Paged_Device.H ../FL/Fl_Device.H ../FL/Fl_Plugin.H -cube.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H -cube.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H ../FL/fl_draw.H -cube.o: ../FL/Fl_PostScript.H -CubeMain.o: ../config.h ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H -CubeMain.o: ../FL/fl_types.h ../FL/Xutf8.h ../FL/Enumerations.H CubeViewUI.h -CubeMain.o: ../FL/Fl_Double_Window.H ../FL/Fl_Window.H ../FL/Fl_Group.H -CubeMain.o: ../FL/Fl_Widget.H ../FL/Fl_Group.H ../FL/Fl_Roller.H -CubeMain.o: ../FL/Fl_Valuator.H ../FL/Fl_Slider.H ../FL/Fl_Box.H CubeView.h -CubeMain.o: ../FL/Fl_Gl_Window.H ../FL/gl.h ../FL/Fl_Value_Slider.H -CubeMain.o: ../FL/Fl_Slider.H -CubeView.o: CubeView.h ../config.h ../FL/Fl.H ../FL/fl_utf8.h -CubeView.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Xutf8.h -CubeView.o: ../FL/Enumerations.H ../FL/Fl_Gl_Window.H ../FL/Fl_Window.H -CubeView.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/gl.h -cursor.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h -cursor.o: ../FL/Xutf8.h ../FL/Enumerations.H ../FL/Fl_Double_Window.H -cursor.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H -cursor.o: ../FL/Fl_Hor_Value_Slider.H ../FL/Fl_Value_Slider.H -cursor.o: ../FL/Fl_Slider.H ../FL/Fl_Valuator.H ../FL/Fl_Choice.H -cursor.o: ../FL/Fl_Menu_.H ../FL/Fl_Menu_Item.H ../FL/Fl_Image.H -cursor.o: ../FL/fl_draw.H ../FL/Fl_Box.H -curve.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h -curve.o: ../FL/Xutf8.h ../FL/Enumerations.H ../FL/Fl_Double_Window.H -curve.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H -curve.o: ../FL/Fl_Hor_Value_Slider.H ../FL/Fl_Value_Slider.H -curve.o: ../FL/Fl_Slider.H ../FL/Fl_Valuator.H ../FL/fl_draw.H -curve.o: ../FL/Fl_Toggle_Button.H ../FL/Fl_Button.H -demo.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h -demo.o: ../FL/Xutf8.h ../FL/Enumerations.H ../FL/Fl_Double_Window.H -demo.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Box.H -demo.o: ../FL/Fl_Button.H ../FL/Fl_Choice.H ../FL/Fl_Menu_.H -demo.o: ../FL/Fl_Menu_Item.H ../FL/Fl_Image.H ../FL/filename.H ../FL/x.H -device.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h -device.o: ../FL/Xutf8.h ../FL/Enumerations.H ../FL/Fl_Overlay_Window.H -device.o: ../FL/Fl_Double_Window.H ../FL/Fl_Window.H ../FL/Fl_Group.H -device.o: ../FL/Fl_Widget.H ../FL/Fl_Light_Button.H ../FL/fl_draw.H -device.o: ../FL/Fl_Clock.H pixmaps/porsche.xpm ../FL/Fl_Pixmap.H -device.o: ../FL/Fl_Image.H ../FL/Fl_Bitmap.H ../FL/Fl_Round_Button.H -device.o: ../FL/Fl_Light_Button.H ../FL/Fl_Button.H ../FL/Fl_Printer.H -device.o: ../FL/x.H ../FL/Fl_Paged_Device.H ../FL/Fl_Device.H -device.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H -device.o: ../FL/Fl_RGB_Image.H ../FL/Fl_Window.H ../FL/Fl_PostScript.H -device.o: ../FL/Fl_File_Chooser.H ../FL/Fl_Double_Window.H ../FL/Fl_Group.H -device.o: ../FL/Fl_Choice.H ../FL/Fl_Menu_.H ../FL/Fl_Menu_Item.H -device.o: ../FL/Fl_Menu_Button.H ../FL/Fl_Button.H ../FL/Fl_Preferences.H -device.o: ../FL/Fl_Tile.H ../FL/Fl_File_Browser.H ../FL/Fl_Browser.H -device.o: ../FL/Fl_Browser_.H ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H -device.o: ../FL/Fl_Valuator.H ../FL/Fl_File_Icon.H ../FL/Fl.H -device.o: ../FL/filename.H ../FL/Fl_Box.H ../FL/Fl_Check_Button.H -device.o: ../FL/Fl_File_Input.H ../FL/Fl_Input.H ../FL/Fl_Input_.H -device.o: ../FL/Fl_Return_Button.H ../FL/fl_ask.H -doublebuffer.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h -doublebuffer.o: ../FL/Xutf8.h ../FL/Enumerations.H ../FL/Fl_Single_Window.H -doublebuffer.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H -doublebuffer.o: ../FL/Fl_Double_Window.H ../FL/Fl_Box.H ../FL/fl_draw.H -doublebuffer.o: ../FL/Fl_Hor_Slider.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H -doublebuffer.o: ../FL/math.h -editor.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h -editor.o: ../FL/Xutf8.h ../FL/Enumerations.H ../FL/Fl_Group.H -editor.o: ../FL/Fl_Double_Window.H ../FL/Fl_Window.H ../FL/Fl_Group.H -editor.o: ../FL/Fl_Widget.H ../FL/fl_ask.H ../FL/Fl_Native_File_Chooser.H -editor.o: ../FL/Fl_Native_File_Chooser_FLTK.H ../FL/Fl_File_Chooser.H -editor.o: ../FL/Fl_Choice.H ../FL/Fl_Menu_.H ../FL/Fl_Menu_Item.H -editor.o: ../FL/Fl_Image.H ../FL/Fl_Menu_Button.H ../FL/Fl_Button.H -editor.o: ../FL/Fl_Preferences.H ../FL/Fl_Tile.H ../FL/Fl_File_Browser.H -editor.o: ../FL/Fl_Browser.H ../FL/Fl_Browser_.H ../FL/Fl_Scrollbar.H -editor.o: ../FL/Fl_Slider.H ../FL/Fl_Valuator.H ../FL/Fl_File_Icon.H -editor.o: ../FL/Fl.H ../FL/filename.H ../FL/Fl_Box.H ../FL/Fl_Check_Button.H -editor.o: ../FL/Fl_Light_Button.H ../FL/Fl_Button.H ../FL/Fl_File_Input.H -editor.o: ../FL/Fl_Input.H ../FL/Fl_Input_.H ../FL/Fl_Return_Button.H -editor.o: ../FL/Fl_Menu_Bar.H ../FL/Fl_Text_Buffer.H ../FL/Fl_Text_Editor.H -editor.o: ../FL/Fl_Text_Display.H ../FL/fl_draw.H ../FL/x.H -editor.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Device.H -editor.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H -editor.o: ../FL/Fl_Bitmap.H ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H -editor.o: ../FL/Fl_Text_Buffer.H ../FL/filename.H -fast_slow.o: fast_slow.h ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H -fast_slow.o: ../FL/fl_types.h ../FL/Xutf8.h ../FL/Enumerations.H -fast_slow.o: ../FL/Fl_Double_Window.H ../FL/Fl_Window.H ../FL/Fl_Group.H -fast_slow.o: ../FL/Fl_Widget.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H -fast_slow.o: ../FL/Fl_Box.H -file_chooser.o: ../FL/Fl_File_Chooser.H ../FL/Fl.H ../FL/fl_utf8.h -file_chooser.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Xutf8.h -file_chooser.o: ../FL/Enumerations.H ../FL/Fl_Double_Window.H -file_chooser.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H -file_chooser.o: ../FL/Fl_Group.H ../FL/Fl_Choice.H ../FL/Fl_Menu_.H -file_chooser.o: ../FL/Fl_Menu_Item.H ../FL/Fl_Image.H ../FL/Fl_Menu_Button.H -file_chooser.o: ../FL/Fl_Button.H ../FL/Fl_Preferences.H ../FL/Fl_Tile.H -file_chooser.o: ../FL/Fl_File_Browser.H ../FL/Fl_Browser.H -file_chooser.o: ../FL/Fl_Browser_.H ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H -file_chooser.o: ../FL/Fl_Valuator.H ../FL/Fl_File_Icon.H ../FL/Fl.H -file_chooser.o: ../FL/filename.H ../FL/Fl_Box.H ../FL/Fl_Check_Button.H -file_chooser.o: ../FL/Fl_Light_Button.H ../FL/Fl_Button.H -file_chooser.o: ../FL/Fl_File_Input.H ../FL/Fl_Input.H ../FL/Fl_Input_.H -file_chooser.o: ../FL/Fl_Return_Button.H ../FL/fl_ask.H ../FL/Fl_File_Icon.H -file_chooser.o: ../FL/Fl_Shared_Image.H ../FL/Fl_PNM_Image.H -file_chooser.o: ../FL/Fl_Light_Button.H -fonts.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h -fonts.o: ../FL/Xutf8.h ../FL/Enumerations.H ../FL/Fl_Double_Window.H -fonts.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Tile.H -fonts.o: ../FL/Fl_Hold_Browser.H ../FL/Fl_Browser.H ../FL/Fl_Browser_.H -fonts.o: ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H -fonts.o: ../FL/Fl_Image.H ../FL/fl_draw.H ../FL/Fl_Box.H ../FL/fl_ask.H -forms.o: ../FL/forms.H ../FL/Fl.H ../FL/Fl_Group.H ../FL/Fl_Widget.H -forms.o: ../FL/Enumerations.H ../FL/Fl_Export.H ../FL/fl_types.h -forms.o: ../FL/Fl_Window.H ../FL/fl_draw.H ../FL/x.H ../FL/Xutf8.h -forms.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Device.H -forms.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H -forms.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_Pixmap.H -forms.o: ../FL/Fl_RGB_Image.H ../FL/Fl_FormsBitmap.H ../FL/Fl_Bitmap.H -forms.o: ../FL/Fl_FormsPixmap.H ../FL/Fl_Pixmap.H ../FL/Fl_Box.H -forms.o: ../FL/Fl_Browser.H ../FL/Fl_Browser_.H ../FL/Fl_Scrollbar.H -forms.o: ../FL/Fl_Slider.H ../FL/Fl_Valuator.H ../FL/Fl.H ../FL/fl_utf8.h -forms.o: ../FL/Fl_Button.H ../FL/Fl_Light_Button.H ../FL/Fl_Round_Button.H -forms.o: ../FL/Fl_Check_Button.H ../FL/Fl_Chart.H ../FL/Fl_Choice.H -forms.o: ../FL/Fl_Menu_.H ../FL/Fl_Menu_Item.H ../FL/Fl_Clock.H -forms.o: ../FL/Fl_Counter.H ../FL/Fl_Dial.H ../FL/Fl_Free.H ../FL/fl_ask.H -forms.o: ../FL/fl_show_colormap.H ../FL/filename.H ../FL/Fl_File_Chooser.H -forms.o: ../FL/Fl_Double_Window.H ../FL/Fl_Group.H ../FL/Fl_Choice.H -forms.o: ../FL/Fl_Menu_Button.H ../FL/Fl_Button.H ../FL/Fl_Preferences.H -forms.o: ../FL/Fl_Tile.H ../FL/Fl_File_Browser.H ../FL/Fl_File_Icon.H -forms.o: ../FL/Fl_Box.H ../FL/Fl_Check_Button.H ../FL/Fl_File_Input.H -forms.o: ../FL/Fl_Input.H ../FL/Fl_Input_.H ../FL/Fl_Return_Button.H -forms.o: ../FL/fl_ask.H ../FL/Fl_Input.H ../FL/Fl_Menu_Button.H -forms.o: ../FL/Fl_Positioner.H ../FL/Fl_Value_Slider.H ../FL/Fl_Timer.H -forms.o: pixmaps/srs.xbm -fractals.o: ../config.h ../FL/glut.H ../FL/gl.h ../FL/Enumerations.H -fractals.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Fl.H -fractals.o: ../FL/Fl_Gl_Window.H ../FL/Fl_Window.H ../FL/Fl_Group.H -fractals.o: ../FL/Fl_Widget.H ../FL/glu.h fracviewer.h ../FL/Fl_Button.H -fractals.o: ../FL/Fl_Group.H ../FL/Fl_Window.H -fullscreen.o: ../config.h ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H -fullscreen.o: ../FL/fl_types.h ../FL/Xutf8.h ../FL/Enumerations.H -fullscreen.o: ../FL/Fl_Single_Window.H ../FL/Fl_Window.H ../FL/Fl_Group.H -fullscreen.o: ../FL/Fl_Widget.H ../FL/Fl_Hor_Slider.H ../FL/Fl_Slider.H -fullscreen.o: ../FL/Fl_Valuator.H ../FL/Fl_Toggle_Light_Button.H -fullscreen.o: ../FL/Fl_Light_Button.H ../FL/Fl_Button.H ../FL/math.h -fullscreen.o: ../FL/gl.h ../FL/Fl_Gl_Window.H -gl_overlay.o: ../config.h ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H -gl_overlay.o: ../FL/fl_types.h ../FL/Xutf8.h ../FL/Enumerations.H -gl_overlay.o: ../FL/Fl_Window.H ../FL/Fl_Hor_Slider.H ../FL/Fl_Slider.H -gl_overlay.o: ../FL/Fl_Valuator.H ../FL/Fl_Toggle_Button.H ../FL/Fl_Button.H -gl_overlay.o: ../FL/math.h ../FL/gl.h ../FL/Fl_Gl_Window.H ../FL/Fl_Window.H -gl_overlay.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H -glpuzzle.o: ../config.h ../FL/glut.H ../FL/gl.h ../FL/Enumerations.H -glpuzzle.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Fl.H -glpuzzle.o: ../FL/Fl_Gl_Window.H ../FL/Fl_Window.H ../FL/Fl_Group.H -glpuzzle.o: ../FL/Fl_Widget.H ../FL/glu.h trackball.c trackball.h -hello.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h -hello.o: ../FL/Xutf8.h ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Box.H -help.o: ../FL/Fl_Help_Dialog.H ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H -help.o: ../FL/fl_types.h ../FL/Xutf8.h ../FL/Enumerations.H -help.o: ../FL/Fl_Double_Window.H ../FL/Fl_Window.H ../FL/Fl_Group.H -help.o: ../FL/Fl_Widget.H ../FL/Fl_Group.H ../FL/Fl_Button.H ../FL/Fl_Input.H -help.o: ../FL/Fl_Input_.H ../FL/Fl_Box.H ../FL/Fl_Help_View.H ../FL/Fl.H -help.o: ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H -help.o: ../FL/fl_draw.H ../FL/x.H ../FL/Enumerations.H ../FL/Fl_Window.H -help.o: ../FL/Fl_Device.H ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H -help.o: ../FL/Fl_Image.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_Pixmap.H -help.o: ../FL/Fl_RGB_Image.H ../FL/Fl_Shared_Image.H ../FL/filename.H -iconize.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h -iconize.o: ../FL/Xutf8.h ../FL/Enumerations.H ../FL/Fl_Window.H -iconize.o: ../FL/Fl_Button.H ../FL/Fl_Box.H -image.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h -image.o: ../FL/Xutf8.h ../FL/Enumerations.H ../FL/Fl_Double_Window.H -image.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H -image.o: ../FL/Fl_Button.H ../FL/Fl_Image.H ../FL/Fl_Toggle_Button.H -image.o: ../FL/Fl_Button.H ../FL/x.H list_visuals.cxx ../config.h -inactive.o: inactive.h ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H -inactive.o: ../FL/fl_types.h ../FL/Xutf8.h ../FL/Enumerations.H -inactive.o: ../FL/Fl_Double_Window.H ../FL/Fl_Window.H ../FL/Fl_Group.H -inactive.o: ../FL/Fl_Widget.H ../FL/Fl_Group.H ../FL/Fl_Button.H -inactive.o: ../FL/Fl_Light_Button.H ../FL/Fl_Check_Button.H -inactive.o: ../FL/Fl_Light_Button.H ../FL/Fl_Button.H ../FL/Fl_Round_Button.H -inactive.o: ../FL/Fl_Slider.H ../FL/Fl_Valuator.H ../FL/Fl_Input.H -inactive.o: ../FL/Fl_Input_.H ../FL/Fl_Menu_Button.H ../FL/Fl_Menu_.H -inactive.o: ../FL/Fl_Menu_Item.H ../FL/Fl_Image.H ../FL/Fl_Value_Output.H -inactive.o: ../FL/Fl_Box.H ../FL/Fl_Scrollbar.H ../FL/Fl_Roller.H -inactive.o: ../FL/Fl_Dial.H ../FL/Fl_Clock.H -input.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h -input.o: ../FL/Xutf8.h ../FL/Enumerations.H ../FL/Fl_Window.H -input.o: ../FL/Fl_Input.H ../FL/Fl_Input_.H ../FL/Fl_Float_Input.H -input.o: ../FL/Fl_Input.H ../FL/Fl_Int_Input.H ../FL/Fl_Secret_Input.H -input.o: ../FL/Fl_Multiline_Input.H ../FL/Fl_Button.H -input.o: ../FL/Fl_Toggle_Button.H ../FL/Fl_Button.H ../FL/Fl_Light_Button.H -input.o: ../FL/Fl_Color_Chooser.H ../FL/Fl_Group.H ../FL/Fl_Box.H -input.o: ../FL/Fl_Return_Button.H ../FL/Fl_Choice.H ../FL/Fl_Menu_.H -input.o: ../FL/Fl_Widget.H ../FL/Fl_Menu_Item.H ../FL/Fl_Image.H -input.o: ../FL/Fl_Value_Input.H ../FL/Fl_Valuator.H -input_choice.o: ../FL/Fl_Button.H ../FL/Fl_Double_Window.H ../FL/Fl_Window.H -input_choice.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Enumerations.H -input_choice.o: ../FL/Fl_Export.H ../FL/fl_types.h ../FL/Fl_Input_Choice.H -input_choice.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Xutf8.h ../FL/Fl_Group.H -input_choice.o: ../FL/Fl_Input.H ../FL/Fl_Input_.H ../FL/Fl_Menu_Button.H -input_choice.o: ../FL/Fl_Menu_.H ../FL/Fl_Menu_Item.H ../FL/Fl_Image.H -input_choice.o: ../FL/fl_draw.H -keyboard.o: keyboard_ui.h ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H -keyboard.o: ../FL/fl_types.h ../FL/Xutf8.h ../FL/Enumerations.H keyboard.h -keyboard.o: ../FL/Fl_Window.H ../FL/Fl_Button.H ../FL/Fl_Output.H -keyboard.o: ../FL/Fl_Input.H ../FL/Fl_Input_.H ../FL/Fl_Box.H ../FL/Fl_Dial.H -label.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h -label.o: ../FL/Xutf8.h ../FL/Enumerations.H ../FL/Fl_Double_Window.H -label.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Box.H -label.o: ../FL/Fl_Hor_Value_Slider.H ../FL/Fl_Value_Slider.H -label.o: ../FL/Fl_Slider.H ../FL/Fl_Valuator.H ../FL/Fl_Toggle_Button.H -label.o: ../FL/Fl_Button.H ../FL/Fl_Input.H ../FL/Fl_Input_.H -label.o: ../FL/Fl_Choice.H ../FL/Fl_Menu_.H ../FL/Fl_Menu_Item.H -label.o: ../FL/Fl_Image.H ../FL/Fl_Pixmap.H ../FL/fl_draw.H pixmaps/blast.xpm -line_style.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h -line_style.o: ../FL/Xutf8.h ../FL/Enumerations.H ../FL/Fl_Double_Window.H -line_style.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H -line_style.o: ../FL/Fl_Value_Slider.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H -line_style.o: ../FL/fl_draw.H ../FL/Fl_Choice.H ../FL/Fl_Menu_.H -line_style.o: ../FL/Fl_Menu_Item.H ../FL/Fl_Image.H ../FL/Fl_Check_Button.H -line_style.o: ../FL/Fl_Light_Button.H ../FL/Fl_Button.H ../FL/Fl_Box.H -list_visuals.o: ../config.h -mandelbrot.o: mandelbrot_ui.h ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H -mandelbrot.o: ../FL/fl_types.h ../FL/Xutf8.h ../FL/Enumerations.H -mandelbrot.o: mandelbrot.h ../FL/Fl_Box.H ../FL/Fl_Slider.H -mandelbrot.o: ../FL/Fl_Valuator.H ../FL/Fl_Double_Window.H ../FL/Fl_Window.H -mandelbrot.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Input.H -mandelbrot.o: ../FL/Fl_Input_.H ../FL/Fl_Window.H ../FL/Fl_Float_Input.H -mandelbrot.o: ../FL/Fl_Input.H ../FL/fl_draw.H ../FL/Fl_Button.H -mandelbrot.o: ../FL/Fl_Printer.H ../FL/x.H ../FL/Fl_Paged_Device.H -mandelbrot.o: ../FL/Fl_Device.H ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H -mandelbrot.o: ../FL/Fl_Image.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H -mandelbrot.o: ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H ../FL/Fl_PostScript.H -menubar.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h -menubar.o: ../FL/Xutf8.h ../FL/Enumerations.H ../FL/Fl_Box.H -menubar.o: ../FL/Fl_Double_Window.H ../FL/Fl_Window.H ../FL/Fl_Group.H -menubar.o: ../FL/Fl_Widget.H ../FL/Fl_Menu_Bar.H ../FL/Fl_Menu_.H -menubar.o: ../FL/Fl_Menu_Item.H ../FL/Fl_Image.H ../FL/Fl_Toggle_Button.H -menubar.o: ../FL/Fl_Button.H ../FL/Fl_Menu_Button.H ../FL/Fl_Choice.H -menubar.o: ../src/flstring.h ../FL/Fl_Export.H ../config.h ../FL/fl_draw.H -message.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h -message.o: ../FL/Xutf8.h ../FL/Enumerations.H ../FL/Fl_Window.H -message.o: ../FL/fl_ask.H -minimum.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h -minimum.o: ../FL/Xutf8.h ../FL/Enumerations.H ../FL/Fl_Double_Window.H -minimum.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H -minimum.o: ../FL/Fl_Slider.H ../FL/Fl_Valuator.H ../FL/Fl_Box.H -minimum.o: ../FL/Fl_Return_Button.H ../FL/Fl_Button.H -native-filechooser.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H -native-filechooser.o: ../FL/fl_types.h ../FL/Xutf8.h ../FL/Enumerations.H -native-filechooser.o: ../FL/fl_ask.H ../FL/Fl_Window.H ../FL/Fl_Button.H -native-filechooser.o: ../FL/Fl_Input.H ../FL/Fl_Input_.H ../FL/Fl_Box.H -native-filechooser.o: ../FL/Fl_Native_File_Chooser.H -native-filechooser.o: ../FL/Fl_Native_File_Chooser_FLTK.H -native-filechooser.o: ../FL/Fl_File_Chooser.H ../FL/Fl_Double_Window.H -native-filechooser.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H -native-filechooser.o: ../FL/Fl_Group.H ../FL/Fl_Choice.H ../FL/Fl_Menu_.H -native-filechooser.o: ../FL/Fl_Menu_Item.H ../FL/Fl_Image.H -native-filechooser.o: ../FL/Fl_Menu_Button.H ../FL/Fl_Preferences.H -native-filechooser.o: ../FL/Fl_Tile.H ../FL/Fl_File_Browser.H -native-filechooser.o: ../FL/Fl_Browser.H ../FL/Fl_Browser_.H -native-filechooser.o: ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H -native-filechooser.o: ../FL/Fl_Valuator.H ../FL/Fl_File_Icon.H ../FL/Fl.H -native-filechooser.o: ../FL/filename.H ../FL/Fl_Check_Button.H -native-filechooser.o: ../FL/Fl_Light_Button.H ../FL/Fl_Button.H -native-filechooser.o: ../FL/Fl_File_Input.H ../FL/Fl_Return_Button.H -navigation.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h -navigation.o: ../FL/Xutf8.h ../FL/Enumerations.H ../FL/Fl_Window.H -navigation.o: ../FL/Fl_Input.H ../FL/Fl_Input_.H ../FL/Fl_Light_Button.H -output.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h -output.o: ../FL/Xutf8.h ../FL/Enumerations.H ../FL/Fl_Value_Input.H -output.o: ../FL/Fl_Valuator.H ../FL/Fl_Input.H ../FL/Fl_Input_.H -output.o: ../FL/Fl_Double_Window.H ../FL/Fl_Window.H ../FL/Fl_Group.H -output.o: ../FL/Fl_Widget.H ../FL/Fl_Box.H ../FL/Fl_Hor_Value_Slider.H -output.o: ../FL/Fl_Value_Slider.H ../FL/Fl_Slider.H ../FL/Fl_Toggle_Button.H -output.o: ../FL/Fl_Button.H ../FL/Fl_Input.H ../FL/fl_draw.H -output.o: ../FL/Fl_Output.H ../FL/Fl_Multiline_Output.H ../FL/Fl_Output.H -overlay.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h -overlay.o: ../FL/Xutf8.h ../FL/Enumerations.H ../FL/Fl_Window.H -overlay.o: ../FL/Fl_Overlay_Window.H ../FL/Fl_Double_Window.H -overlay.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H -overlay.o: ../FL/Fl_Button.H ../FL/fl_draw.H -pack.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h -pack.o: ../FL/Xutf8.h ../FL/Enumerations.H ../FL/Fl_Button.H -pack.o: ../FL/Fl_Light_Button.H ../FL/Fl_Double_Window.H ../FL/Fl_Window.H -pack.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Scroll.H -pack.o: ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H -pack.o: ../FL/Fl_Value_Slider.H ../FL/Fl_Pack.H ../FL/Fl_Group.H -pixmap_browser.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H -pixmap_browser.o: ../FL/fl_types.h ../FL/Xutf8.h ../FL/Enumerations.H -pixmap_browser.o: ../FL/Fl_Box.H ../FL/Fl_Double_Window.H ../FL/Fl_Window.H -pixmap_browser.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Button.H -pixmap_browser.o: ../FL/Fl_Shared_Image.H ../FL/Fl_Image.H -pixmap_browser.o: ../FL/Fl_File_Chooser.H ../FL/Fl_Group.H ../FL/Fl_Choice.H -pixmap_browser.o: ../FL/Fl_Menu_.H ../FL/Fl_Menu_Item.H -pixmap_browser.o: ../FL/Fl_Menu_Button.H ../FL/Fl_Preferences.H -pixmap_browser.o: ../FL/Fl_Tile.H ../FL/Fl_File_Browser.H ../FL/Fl_Browser.H -pixmap_browser.o: ../FL/Fl_Browser_.H ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H -pixmap_browser.o: ../FL/Fl_Valuator.H ../FL/Fl_File_Icon.H ../FL/Fl.H -pixmap_browser.o: ../FL/filename.H ../FL/Fl_Check_Button.H -pixmap_browser.o: ../FL/Fl_Light_Button.H ../FL/Fl_Button.H -pixmap_browser.o: ../FL/Fl_File_Input.H ../FL/Fl_Input.H ../FL/Fl_Input_.H -pixmap_browser.o: ../FL/Fl_Return_Button.H ../FL/fl_ask.H ../FL/fl_message.H -pixmap_browser.o: ../FL/fl_ask.H -pixmap.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h -pixmap.o: ../FL/Xutf8.h ../FL/Enumerations.H ../FL/Fl_Double_Window.H -pixmap.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H -pixmap.o: ../FL/Fl_Button.H ../FL/Fl_Pixmap.H ../FL/Fl_Image.H -pixmap.o: pixmaps/porsche.xpm ../FL/Fl_Toggle_Button.H ../FL/Fl_Button.H -pixmap.o: ../FL/Fl_Multi_Label.H -preferences.o: preferences.h ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H -preferences.o: ../FL/fl_types.h ../FL/Xutf8.h ../FL/Enumerations.H -preferences.o: ../FL/Fl_Preferences.H ../FL/Fl_Double_Window.H -preferences.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H -preferences.o: ../FL/Fl_Button.H ../FL/Fl_Group.H ../FL/Fl_Input.H -preferences.o: ../FL/Fl_Input_.H ../FL/Fl_Choice.H ../FL/Fl_Menu_.H -preferences.o: ../FL/Fl_Menu_Item.H ../FL/Fl_Image.H ../FL/Fl_Round_Button.H -preferences.o: ../FL/Fl_Light_Button.H ../FL/Fl_Button.H ../FL/Fl_Box.H -preferences.o: ../FL/Fl_Check_Button.H ../FL/Fl_Int_Input.H ../FL/Fl_Input.H -preferences.o: ../FL/Fl_Value_Slider.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H -preferences.o: ../FL/filename.H ../FL/fl_ask.H -device.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h -device.o: ../FL/Xutf8.h ../FL/Enumerations.H ../FL/Fl_Overlay_Window.H -device.o: ../FL/Fl_Double_Window.H ../FL/Fl_Window.H ../FL/Fl_Group.H -device.o: ../FL/Fl_Widget.H ../FL/Fl_Light_Button.H ../FL/fl_draw.H -device.o: ../FL/Fl_Clock.H pixmaps/porsche.xpm ../FL/Fl_Pixmap.H -device.o: ../FL/Fl_Image.H ../FL/Fl_Bitmap.H ../FL/Fl_Round_Button.H -device.o: ../FL/Fl_Light_Button.H ../FL/Fl_Button.H ../FL/Fl_Printer.H -device.o: ../FL/x.H ../FL/Fl_Paged_Device.H ../FL/Fl_Device.H -device.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H -device.o: ../FL/Fl_RGB_Image.H ../FL/Fl_Window.H ../FL/Fl_PostScript.H -device.o: ../FL/Fl_File_Chooser.H ../FL/Fl_Double_Window.H ../FL/Fl_Group.H -device.o: ../FL/Fl_Choice.H ../FL/Fl_Menu_.H ../FL/Fl_Menu_Item.H -device.o: ../FL/Fl_Menu_Button.H ../FL/Fl_Button.H ../FL/Fl_Preferences.H -device.o: ../FL/Fl_Tile.H ../FL/Fl_File_Browser.H ../FL/Fl_Browser.H -device.o: ../FL/Fl_Browser_.H ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H -device.o: ../FL/Fl_Valuator.H ../FL/Fl_File_Icon.H ../FL/Fl.H -device.o: ../FL/filename.H ../FL/Fl_Box.H ../FL/Fl_Check_Button.H -device.o: ../FL/Fl_File_Input.H ../FL/Fl_Input.H ../FL/Fl_Input_.H -device.o: ../FL/Fl_Return_Button.H ../FL/fl_ask.H -radio.o: radio.h ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H -radio.o: ../FL/fl_types.h ../FL/Xutf8.h ../FL/Enumerations.H -radio.o: ../FL/Fl_Double_Window.H ../FL/Fl_Window.H ../FL/Fl_Group.H -radio.o: ../FL/Fl_Widget.H ../FL/Fl_Button.H ../FL/Fl_Return_Button.H -radio.o: ../FL/Fl_Button.H ../FL/Fl_Light_Button.H ../FL/Fl_Check_Button.H -radio.o: ../FL/Fl_Light_Button.H ../FL/Fl_Round_Button.H ../FL/Fl_Group.H -radio.o: ../FL/Fl_Output.H ../FL/Fl_Input.H ../FL/Fl_Input_.H -resizebox.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h -resizebox.o: ../FL/Xutf8.h ../FL/Enumerations.H ../FL/Fl_Double_Window.H -resizebox.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H -resizebox.o: ../FL/Fl_Box.H ../FL/Fl_Radio_Button.H ../FL/Fl_Button.H -resizebox.o: ../FL/fl_draw.H ../FL/fl_message.H ../FL/fl_ask.H -resize.o: resize.h ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H -resize.o: ../FL/fl_types.h ../FL/Xutf8.h ../FL/Enumerations.H -resize.o: ../FL/Fl_Double_Window.H ../FL/Fl_Window.H ../FL/Fl_Group.H -resize.o: ../FL/Fl_Widget.H ../FL/Fl_Button.H ../FL/Fl_Box.H -rotated_text.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h -rotated_text.o: ../FL/Xutf8.h ../FL/Enumerations.H ../FL/Fl_Double_Window.H -rotated_text.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H -rotated_text.o: ../FL/Fl_Box.H ../FL/Fl_Hor_Value_Slider.H -rotated_text.o: ../FL/Fl_Value_Slider.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H -rotated_text.o: ../FL/Fl_Toggle_Button.H ../FL/Fl_Button.H ../FL/Fl_Input.H -rotated_text.o: ../FL/Fl_Input_.H ../FL/Fl_Choice.H ../FL/Fl_Menu_.H -rotated_text.o: ../FL/Fl_Menu_Item.H ../FL/Fl_Image.H ../FL/fl_draw.H -scroll.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h -scroll.o: ../FL/Xutf8.h ../FL/Enumerations.H ../FL/Fl_Double_Window.H -scroll.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H -scroll.o: ../FL/Fl_Scroll.H ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H -scroll.o: ../FL/Fl_Valuator.H ../FL/Fl_Light_Button.H ../FL/Fl_Choice.H -scroll.o: ../FL/Fl_Menu_.H ../FL/Fl_Menu_Item.H ../FL/Fl_Image.H -scroll.o: ../FL/Fl_Box.H ../FL/fl_draw.H ../FL/math.h -shape.o: ../config.h ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H -shape.o: ../FL/fl_types.h ../FL/Xutf8.h ../FL/Enumerations.H -shape.o: ../FL/Fl_Window.H ../FL/Fl_Hor_Slider.H ../FL/Fl_Slider.H -shape.o: ../FL/Fl_Valuator.H ../FL/math.h ../FL/gl.h ../FL/Fl_Gl_Window.H -shape.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H -subwindow.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h -subwindow.o: ../FL/Xutf8.h ../FL/Enumerations.H ../FL/Fl_Window.H -subwindow.o: ../FL/Fl_Toggle_Button.H ../FL/Fl_Button.H -subwindow.o: ../FL/Fl_Menu_Button.H ../FL/Fl_Menu_.H ../FL/Fl_Widget.H -subwindow.o: ../FL/Fl_Menu_Item.H ../FL/Fl_Image.H ../FL/Fl_Box.H -subwindow.o: ../FL/Fl_Input.H ../FL/Fl_Input_.H -sudoku.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h -sudoku.o: ../FL/Xutf8.h ../FL/Enumerations.H ../FL/Enumerations.H -sudoku.o: ../FL/Fl_Double_Window.H ../FL/Fl_Window.H ../FL/Fl_Group.H -sudoku.o: ../FL/Fl_Widget.H ../FL/Fl_Button.H ../FL/Fl_Group.H ../FL/fl_ask.H -sudoku.o: ../FL/fl_draw.H ../FL/Fl_Help_Dialog.H ../FL/Fl_Input.H -sudoku.o: ../FL/Fl_Input_.H ../FL/Fl_Box.H ../FL/Fl_Help_View.H ../FL/Fl.H -sudoku.o: ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H -sudoku.o: ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H ../FL/Fl_Device.H -sudoku.o: ../FL/Fl_Plugin.H ../FL/Fl_Preferences.H ../FL/Fl_Image.H -sudoku.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_Pixmap.H -sudoku.o: ../FL/Fl_RGB_Image.H ../FL/Fl_Shared_Image.H ../FL/filename.H -sudoku.o: ../FL/Fl_Preferences.H ../FL/Fl_Sys_Menu_Bar.H ../FL/Fl_Menu_Bar.H -sudoku.o: ../FL/Fl_Menu_.H ../FL/Fl_Menu_Item.H ../FL/x.H ../FL/math.h -sudoku.o: pixmaps/sudoku.xbm ../config.h -symbols.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h -symbols.o: ../FL/Xutf8.h ../FL/Enumerations.H ../FL/Fl_Double_Window.H -symbols.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H -symbols.o: ../FL/Fl_Box.H ../FL/Fl_Value_Slider.H ../FL/Fl_Slider.H -symbols.o: ../FL/Fl_Valuator.H ../FL/fl_draw.H -table.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h -table.o: ../FL/Xutf8.h ../FL/Enumerations.H ../FL/Fl_Window.H -table.o: ../FL/Fl_Input.H ../FL/Fl_Input_.H ../FL/Fl_Check_Button.H -table.o: ../FL/Fl_Light_Button.H ../FL/Fl_Button.H ../FL/Fl_Choice.H -table.o: ../FL/Fl_Menu_.H ../FL/Fl_Widget.H ../FL/Fl_Menu_Item.H -table.o: ../FL/Fl_Image.H ../FL/fl_draw.H ../FL/fl_ask.H ../FL/Fl_Table_Row.H -table.o: ../FL/Fl_Table.H ../FL/Fl_Group.H ../FL/Fl_Scroll.H ../FL/Fl_Group.H -table.o: ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H -table.o: ../FL/Fl_Box.H ../FL/Fl_Scrollbar.H -tabs.o: tabs.h ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h -tabs.o: ../FL/Xutf8.h ../FL/Enumerations.H ../FL/Fl_Double_Window.H -tabs.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Box.H -tabs.o: ../FL/Fl_Tabs.H ../FL/Fl_Group.H ../FL/Fl_Input.H ../FL/Fl_Input_.H -tabs.o: ../FL/Fl_Button.H ../FL/fl_ask.H ../FL/Fl_Clock.H ../FL/Fl_Wizard.H -tabs.o: ../FL/Fl_Return_Button.H ../FL/Fl_Button.H -threads.o: ../config.h ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H -threads.o: ../FL/fl_types.h ../FL/Xutf8.h ../FL/Enumerations.H -threads.o: ../FL/Fl_Double_Window.H ../FL/Fl_Window.H ../FL/Fl_Group.H -threads.o: ../FL/Fl_Widget.H ../FL/Fl_Browser.H ../FL/Fl_Value_Output.H -threads.o: ../FL/fl_ask.H threads.h -tile.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h -tile.o: ../FL/Xutf8.h ../FL/Enumerations.H ../FL/Fl_Double_Window.H -tile.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Tile.H -tile.o: ../FL/Fl_Box.H -tiled_image.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h -tiled_image.o: ../FL/Xutf8.h ../FL/Enumerations.H ../FL/Fl_Double_Window.H -tiled_image.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H -tiled_image.o: ../FL/Fl_Button.H ../FL/Fl_Pixmap.H ../FL/Fl_Image.H -tiled_image.o: ../FL/Fl_Tiled_Image.H pixmaps/tile.xpm ../FL/x.H -tiled_image.o: list_visuals.cxx ../config.h -tree.o: tree.h ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h -tree.o: ../FL/Xutf8.h ../FL/Enumerations.H ../FL/Fl_Pixmap.H ../FL/Fl_Image.H -tree.o: ../FL/Fl_Group.H ../FL/Fl_Tree.H ../FL/Fl_Scrollbar.H ../FL/fl_draw.H -tree.o: ../FL/Fl_Tree_Item.H ../FL/Fl_Widget.H ../FL/Fl_Image.H -tree.o: ../FL/Fl_Tree_Item_Array.H ../FL/Fl_Tree_Prefs.H ../FL/fl_ask.H -tree.o: ../FL/fl_message.H ../FL/fl_ask.H ../FL/Fl_File_Chooser.H -tree.o: ../FL/Fl_Double_Window.H ../FL/Fl_Window.H ../FL/Fl_Group.H -tree.o: ../FL/Fl_Widget.H ../FL/Fl_Choice.H ../FL/Fl_Menu_.H -tree.o: ../FL/Fl_Menu_Item.H ../FL/Fl_Menu_Button.H ../FL/Fl_Button.H -tree.o: ../FL/Fl_Preferences.H ../FL/Fl_Tile.H ../FL/Fl_File_Browser.H -tree.o: ../FL/Fl_Browser.H ../FL/Fl_Browser_.H ../FL/Fl_Scrollbar.H -tree.o: ../FL/Fl_Slider.H ../FL/Fl_Valuator.H ../FL/Fl_File_Icon.H ../FL/Fl.H -tree.o: ../FL/filename.H ../FL/Fl_Box.H ../FL/Fl_Check_Button.H -tree.o: ../FL/Fl_Light_Button.H ../FL/Fl_Button.H ../FL/Fl_File_Input.H -tree.o: ../FL/Fl_Input.H ../FL/Fl_Input_.H ../FL/Fl_Return_Button.H -tree.o: ../FL/Fl_Value_Slider.H ../FL/Fl_Light_Button.H -valuators.o: valuators.h ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H -valuators.o: ../FL/fl_types.h ../FL/Xutf8.h ../FL/Enumerations.H -valuators.o: ../FL/Fl_Double_Window.H ../FL/Fl_Window.H ../FL/Fl_Group.H -valuators.o: ../FL/Fl_Widget.H ../FL/Fl_Box.H ../FL/Fl_Slider.H -valuators.o: ../FL/Fl_Valuator.H ../FL/Fl_Value_Slider.H ../FL/Fl_Slider.H -valuators.o: ../FL/Fl_Value_Input.H ../FL/Fl_Input.H ../FL/Fl_Input_.H -valuators.o: ../FL/Fl_Value_Output.H ../FL/Fl_Scrollbar.H ../FL/Fl_Adjuster.H -valuators.o: ../FL/Fl_Counter.H ../FL/Fl_Spinner.H ../FL/Enumerations.H -valuators.o: ../FL/Fl_Group.H ../FL/Fl_Input.H ../FL/Fl_Repeat_Button.H -valuators.o: ../FL/Fl.H ../FL/Fl_Button.H ../FL/Fl_Dial.H ../FL/Fl_Roller.H -utf8.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h -utf8.o: ../FL/Xutf8.h ../FL/Enumerations.H ../FL/Fl_Double_Window.H -utf8.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H -utf8.o: ../FL/Fl_Scroll.H ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H -utf8.o: ../FL/Fl_Valuator.H ../FL/Fl_Choice.H ../FL/Fl_Menu_.H -utf8.o: ../FL/Fl_Menu_Item.H ../FL/Fl_Image.H ../FL/Fl_Input.H -utf8.o: ../FL/Fl_Input_.H ../FL/Fl_Box.H ../FL/Fl_Tile.H -utf8.o: ../FL/Fl_Hold_Browser.H ../FL/Fl_Browser.H ../FL/Fl_Browser_.H -utf8.o: ../FL/Fl_Value_Output.H ../FL/Fl_Button.H ../FL/Fl_Check_Button.H -utf8.o: ../FL/Fl_Light_Button.H ../FL/Fl_Button.H ../FL/Fl_Output.H -utf8.o: ../FL/Fl_Input.H ../FL/fl_draw.H ../FL/fl_utf8.h diff --git a/branch-3.0-2011/test/makefile.wat b/branch-3.0-2011/test/makefile.wat deleted file mode 100644 index 4eb5281a2..000000000 --- a/branch-3.0-2011/test/makefile.wat +++ /dev/null @@ -1,294 +0,0 @@ -#
-# "$Id$"
-#
-# Test/example program makefile for the Fast Light Tool Kit (FLTK).
-#
-# Copyright 1998-2010 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 ../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)/native-filechooser$(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)/native-filechooser$(EXEEXT) : $(ODIR)/native-filechooser.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$".
-#
diff --git a/branch-3.0-2011/test/mandelbrot.cxx b/branch-3.0-2011/test/mandelbrot.cxx deleted file mode 100644 index b04b0710f..000000000 --- a/branch-3.0-2011/test/mandelbrot.cxx +++ /dev/null @@ -1,227 +0,0 @@ -// -// "$Id$" -// -// Mandelbrot set demo for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2010 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 <FL/Fl_Button.H> -#include <FL/Fl_Printer.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);} - -static void print(Fl_Widget *o, void *data) -{ - Fl_Printer printer; - Fl_Window *win = o->window(); - if(!win->visible()) return; - win->make_current(); - uchar *image_data = fl_read_image(NULL, 0, 0, win->w(), win->h(), 0); - if( printer.start_job(1) ) return; - if( printer.start_page() ) return; - printer.scale(.7,.7); - fl_draw_image(image_data, 0,0, win->w(), win->h()); - printer.end_page(); - delete image_data; - printer.end_job(); -} - -int main(int argc, char **argv) { - mbrot.make_window(); - mbrot.window->begin(); - Fl_Button* o = new Fl_Button(0, 0, 0, 0, NULL); - o->callback(print,NULL); - o->shortcut(FL_CTRL+'p'); - mbrot.window->end(); - - 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$". -// diff --git a/branch-3.0-2011/test/mandelbrot.h b/branch-3.0-2011/test/mandelbrot.h deleted file mode 100644 index 237dfbad1..000000000 --- a/branch-3.0-2011/test/mandelbrot.h +++ /dev/null @@ -1,74 +0,0 @@ -// -// "$Id$" -// -// Mandelbrot set header file for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2010 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_Double_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$". -// diff --git a/branch-3.0-2011/test/mandelbrot_ui.fl b/branch-3.0-2011/test/mandelbrot_ui.fl deleted file mode 100644 index 6c6072e07..000000000 --- a/branch-3.0-2011/test/mandelbrot_ui.fl +++ /dev/null @@ -1,72 +0,0 @@ -# data file for the Fltk User Interface Designer (fluid) -version 1.0300 -header_name {.h} -code_name {.cxx} -decl {\#include "mandelbrot.h"} {public local -} - -decl {\#include <stdlib.h>} {private local -} - -class Drawing_Window {open -} { - Function {make_window()} {open return_type void - } { - Fl_Window window {open - 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 48 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 48 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 48 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, ctrl-P: Print} selected - 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 local - } -} diff --git a/branch-3.0-2011/test/menubar.cxx b/branch-3.0-2011/test/menubar.cxx deleted file mode 100644 index 2db724ae6..000000000 --- a/branch-3.0-2011/test/menubar.cxx +++ /dev/null @@ -1,223 +0,0 @@ -// -// "$Id$" -// -// Menubar test program for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2010 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_Double_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_Double_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}, - {"&International",0,0,0,FL_SUBMENU}, - {"Sharp Ess",0x0000df}, - {"A Umlaut",0x0000c4}, - {"a Umlaut",0x0000e4}, - {"Euro currency",FL_COMMAND+0x0020ac}, - {"the &\xc3\xbc Umlaut"}, // ü - {"the capital &\xc3\x9c"}, // Ü - {"convert \xc2\xa5 to &\xc2\xa3"}, // Yen to GBP - {"convert \xc2\xa5 to &\xe2\x82\xac"}, // Yen to Euro - {"Hangul character Sios &\xe3\x85\x85"}, - {"Hangul character Cieuc", 0x003148}, - {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 700 - -Fl_Menu_* menus[4]; - -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); - } - Fl_Double_Window 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; - 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$". -// diff --git a/branch-3.0-2011/test/message.cxx b/branch-3.0-2011/test/message.cxx deleted file mode 100644 index c08ded67a..000000000 --- a/branch-3.0-2011/test/message.cxx +++ /dev/null @@ -1,70 +0,0 @@ -// -// "$Id$" -// -// Message test program for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2010 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$". -// diff --git a/branch-3.0-2011/test/minimum.cxx b/branch-3.0-2011/test/minimum.cxx deleted file mode 100644 index 9ac51be4f..000000000 --- a/branch-3.0-2011/test/minimum.cxx +++ /dev/null @@ -1,80 +0,0 @@ -// -// "$Id$" -// -// 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-2010 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_Double_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_Double_Window *window = new Fl_Double_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$". -// diff --git a/branch-3.0-2011/test/native-filechooser.cxx b/branch-3.0-2011/test/native-filechooser.cxx deleted file mode 100644 index a2f1192dc..000000000 --- a/branch-3.0-2011/test/native-filechooser.cxx +++ /dev/null @@ -1,104 +0,0 @@ -// -// "$Id$" -// -// Simple test of the Fl_Native_File_Chooser. -// -// Copyright 1998-2010 by Bill Spitzak and others. -// Copyright 2004 Greg Ercolano. -// -// 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_ask.H> // fl_beep() -#include <FL/Fl_Window.H> -#include <FL/Fl_Button.H> -#include <FL/Fl_Input.H> -#include <FL/Fl_Box.H> -#include <FL/Fl_Native_File_Chooser.H> - -// GLOBALS -Fl_Input *G_filename = NULL; - -void Butt_CB(Fl_Widget*, void*) { - // Create native chooser - Fl_Native_File_Chooser native; - native.title("Pick a file"); - native.type(Fl_Native_File_Chooser::BROWSE_FILE); - native.filter("Text\t*.txt\n" - "C Files\t*.{cxx,h,c}\n" - "Apps\t*.{app}\n"); // TODO: need to add kNavSupportPackages to non-cocoa <FNFC>_MAC.cxx - native.preset_file(G_filename->value()); - // Show native chooser - switch ( native.show() ) { - case -1: fprintf(stderr, "ERROR: %s\n", native.errmsg()); break; // ERROR - case 1: fprintf(stderr, "*** CANCEL\n"); fl_beep(); break; // CANCEL - default: // PICKED FILE - if ( native.filename() ) { - G_filename->value(native.filename()); - } else { - G_filename->value("NULL"); - } - break; - } -} - -int main(int argc, char **argv) { - //// For a nicer looking browser under linux, call Fl_File_Icon::load_system_icons(); - //// (If you do this, you'll need to link with fltk_images) - //// NOTE: If you do not load the system icons, the file chooser will still work, but - //// no icons will be shown. However, this means you do not need to link in the - //// fltk_images library, potentially reducing the size of your executable. - //// Loading the system icons is not required by the OSX or Windows native file choosers. -#if !defined(WIN32) && !defined(__APPLE__) - Fl_File_Icon::load_system_icons(); -#endif - - int argn = 1; -#ifdef __APPLE__ - // OS X may add the process number as the first argument - ignore - if (argc>argn && strncmp(argv[1], "-psn_", 5)==0) - argn++; -#endif - - Fl_Window *win = new Fl_Window(600, 100, "Native File Chooser Test"); - win->size_range(300, 100, 0, 100); - win->begin(); - { - int y = 10; - G_filename = new Fl_Input(80, y, win->w()-80-10, 25, "Filename"); - G_filename->value(argc <= argn ? "." : argv[argn]); - G_filename->tooltip("Default filename"); - y += G_filename->h() + 5; - Fl_Button *but = new Fl_Button(win->w()-80-10, win->h()-25-10, 80, 25, "Pick File"); - but->callback(Butt_CB); - Fl_Box *dummy = new Fl_Box(80, 0, 430, 100); - dummy->hide(); - win->resizable(dummy); - } - win->end(); - win->show(argc, argv); - return(Fl::run()); -} - -// -// End of "$Id$". -// - diff --git a/branch-3.0-2011/test/navigation.cxx b/branch-3.0-2011/test/navigation.cxx deleted file mode 100644 index 99f081476..000000000 --- a/branch-3.0-2011/test/navigation.cxx +++ /dev/null @@ -1,83 +0,0 @@ -// -// "$Id$" -// -// 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-2010 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> -#include <FL/Fl_Light_Button.H> - -#define WIDTH 600 -#define HEIGHT 300 -#define GRID 25 - -void ToggleArrowFocus_CB(Fl_Widget *w, void*) { - Fl_Light_Button *b = (Fl_Light_Button*)w; - Fl::option(Fl::OPTION_ARROW_FOCUS, b->value() ? true : false); -} -int main(int argc, char **argv) { - if (argc > 1) srand(atoi(argv[1])); - Fl_Window window(WIDTH,HEIGHT+40,argv[0]); - // Include a toggle button to control arrow focus - Fl_Light_Button arrowfocus_butt(10,HEIGHT+10,130,20," Arrow Focus"); - arrowfocus_butt.callback(ToggleArrowFocus_CB); - arrowfocus_butt.value(Fl::option(Fl::OPTION_ARROW_FOCUS) ? 1 : 0); // use default - arrowfocus_butt.tooltip("Control horizontal arrow key focus navigation behavior.\n" - "e.g. Fl::OPTION_ARROW_FOCUS"); - 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$". -// diff --git a/branch-3.0-2011/test/output.cxx b/branch-3.0-2011/test/output.cxx deleted file mode 100644 index 43161edb8..000000000 --- a/branch-3.0-2011/test/output.cxx +++ /dev/null @@ -1,105 +0,0 @@ -// -// "$Id$" -// -// Output test program for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2010 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_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_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_Double_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_Double_Window(400,400); - - input = new Fl_Input(50,375,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,350,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,325,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,90,200,30,"Fl_Output"); - text->value(input->value()); - text->align(FL_ALIGN_BOTTOM); - text->tooltip("This is an Fl_Output widget."); - - window->end(); - window->show(argc,argv); - return Fl::run(); -} - -// -// End of "$Id$". -// diff --git a/branch-3.0-2011/test/overlay.cxx b/branch-3.0-2011/test/overlay.cxx deleted file mode 100644 index 3f896ab54..000000000 --- a/branch-3.0-2011/test/overlay.cxx +++ /dev/null @@ -1,86 +0,0 @@ -// -// "$Id$" -// -// Overlay window test program for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2010 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$". -// diff --git a/branch-3.0-2011/test/pack.cxx b/branch-3.0-2011/test/pack.cxx deleted file mode 100644 index fa5940d68..000000000 --- a/branch-3.0-2011/test/pack.cxx +++ /dev/null @@ -1,120 +0,0 @@ -// -// "$Id$" -// -// 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-2010 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_Double_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_Double_Window *w; - {Fl_Double_Window* o = new Fl_Double_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$". -// diff --git a/branch-3.0-2011/test/pixmap.cxx b/branch-3.0-2011/test/pixmap.cxx deleted file mode 100644 index 2f54c7809..000000000 --- a/branch-3.0-2011/test/pixmap.cxx +++ /dev/null @@ -1,102 +0,0 @@ -// -// "$Id$" -// -// Pixmap label test program for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2010 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_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_Double_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_Double_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$". -// diff --git a/branch-3.0-2011/test/pixmap_browser.cxx b/branch-3.0-2011/test/pixmap_browser.cxx deleted file mode 100644 index 112fdcd40..000000000 --- a/branch-3.0-2011/test/pixmap_browser.cxx +++ /dev/null @@ -1,123 +0,0 @@ -// -// "$Id$" -// -// A shared image test program for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2010 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_Double_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_Double_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); - puts(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_Double_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$". -// diff --git a/branch-3.0-2011/test/pixmaps/black_1.xbm b/branch-3.0-2011/test/pixmaps/black_1.xbm deleted file mode 100644 index a9d800f98..000000000 --- a/branch-3.0-2011/test/pixmaps/black_1.xbm +++ /dev/null @@ -1,60 +0,0 @@ -#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/branch-3.0-2011/test/pixmaps/black_2.xbm b/branch-3.0-2011/test/pixmaps/black_2.xbm deleted file mode 100644 index b324fd124..000000000 --- a/branch-3.0-2011/test/pixmaps/black_2.xbm +++ /dev/null @@ -1,60 +0,0 @@ -#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/branch-3.0-2011/test/pixmaps/black_3.xbm b/branch-3.0-2011/test/pixmaps/black_3.xbm deleted file mode 100644 index ead6e086a..000000000 --- a/branch-3.0-2011/test/pixmaps/black_3.xbm +++ /dev/null @@ -1,60 +0,0 @@ -#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/branch-3.0-2011/test/pixmaps/black_4.xbm b/branch-3.0-2011/test/pixmaps/black_4.xbm deleted file mode 100644 index 4132263e6..000000000 --- a/branch-3.0-2011/test/pixmaps/black_4.xbm +++ /dev/null @@ -1,60 +0,0 @@ -#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/branch-3.0-2011/test/pixmaps/blackking_1.xbm b/branch-3.0-2011/test/pixmaps/blackking_1.xbm deleted file mode 100644 index f764eade6..000000000 --- a/branch-3.0-2011/test/pixmaps/blackking_1.xbm +++ /dev/null @@ -1,60 +0,0 @@ -#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/branch-3.0-2011/test/pixmaps/blackking_2.xbm b/branch-3.0-2011/test/pixmaps/blackking_2.xbm deleted file mode 100644 index 9be617b5a..000000000 --- a/branch-3.0-2011/test/pixmaps/blackking_2.xbm +++ /dev/null @@ -1,60 +0,0 @@ -#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/branch-3.0-2011/test/pixmaps/blackking_3.xbm b/branch-3.0-2011/test/pixmaps/blackking_3.xbm deleted file mode 100644 index b4a688360..000000000 --- a/branch-3.0-2011/test/pixmaps/blackking_3.xbm +++ /dev/null @@ -1,60 +0,0 @@ -#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/branch-3.0-2011/test/pixmaps/blackking_4.xbm b/branch-3.0-2011/test/pixmaps/blackking_4.xbm deleted file mode 100644 index a7078623e..000000000 --- a/branch-3.0-2011/test/pixmaps/blackking_4.xbm +++ /dev/null @@ -1,60 +0,0 @@ -#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/branch-3.0-2011/test/pixmaps/blast.xpm b/branch-3.0-2011/test/pixmaps/blast.xpm deleted file mode 100644 index 19d0bc7b0..000000000 --- a/branch-3.0-2011/test/pixmaps/blast.xpm +++ /dev/null @@ -1,67 +0,0 @@ -/* 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/branch-3.0-2011/test/pixmaps/block.xcf.gz b/branch-3.0-2011/test/pixmaps/block.xcf.gz Binary files differdeleted file mode 100644 index d35488a25..000000000 --- a/branch-3.0-2011/test/pixmaps/block.xcf.gz +++ /dev/null diff --git a/branch-3.0-2011/test/pixmaps/blue.xpm b/branch-3.0-2011/test/pixmaps/blue.xpm deleted file mode 100644 index 89c412e63..000000000 --- a/branch-3.0-2011/test/pixmaps/blue.xpm +++ /dev/null @@ -1,67 +0,0 @@ -/* 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/branch-3.0-2011/test/pixmaps/blue_bomb.xpm b/branch-3.0-2011/test/pixmaps/blue_bomb.xpm deleted file mode 100644 index 72c267eca..000000000 --- a/branch-3.0-2011/test/pixmaps/blue_bomb.xpm +++ /dev/null @@ -1,67 +0,0 @@ -/* 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/branch-3.0-2011/test/pixmaps/cyan.xpm b/branch-3.0-2011/test/pixmaps/cyan.xpm deleted file mode 100644 index 37f74d6dd..000000000 --- a/branch-3.0-2011/test/pixmaps/cyan.xpm +++ /dev/null @@ -1,67 +0,0 @@ -/* 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/branch-3.0-2011/test/pixmaps/cyan_bomb.xpm b/branch-3.0-2011/test/pixmaps/cyan_bomb.xpm deleted file mode 100644 index 4936f849c..000000000 --- a/branch-3.0-2011/test/pixmaps/cyan_bomb.xpm +++ /dev/null @@ -1,67 +0,0 @@ -/* 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/branch-3.0-2011/test/pixmaps/gray.xpm b/branch-3.0-2011/test/pixmaps/gray.xpm deleted file mode 100644 index e5da3fc54..000000000 --- a/branch-3.0-2011/test/pixmaps/gray.xpm +++ /dev/null @@ -1,67 +0,0 @@ -/* 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/branch-3.0-2011/test/pixmaps/gray_bomb.xpm b/branch-3.0-2011/test/pixmaps/gray_bomb.xpm deleted file mode 100644 index 808c50136..000000000 --- a/branch-3.0-2011/test/pixmaps/gray_bomb.xpm +++ /dev/null @@ -1,67 +0,0 @@ -/* 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/branch-3.0-2011/test/pixmaps/green.xpm b/branch-3.0-2011/test/pixmaps/green.xpm deleted file mode 100644 index 6a5889797..000000000 --- a/branch-3.0-2011/test/pixmaps/green.xpm +++ /dev/null @@ -1,67 +0,0 @@ -/* 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/branch-3.0-2011/test/pixmaps/green_bomb.xpm b/branch-3.0-2011/test/pixmaps/green_bomb.xpm deleted file mode 100644 index 7e1d5e751..000000000 --- a/branch-3.0-2011/test/pixmaps/green_bomb.xpm +++ /dev/null @@ -1,67 +0,0 @@ -/* 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/branch-3.0-2011/test/pixmaps/magenta.xpm b/branch-3.0-2011/test/pixmaps/magenta.xpm deleted file mode 100644 index 2405cee0c..000000000 --- a/branch-3.0-2011/test/pixmaps/magenta.xpm +++ /dev/null @@ -1,67 +0,0 @@ -/* 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/branch-3.0-2011/test/pixmaps/magenta_bomb.xpm b/branch-3.0-2011/test/pixmaps/magenta_bomb.xpm deleted file mode 100644 index 4cd1816ca..000000000 --- a/branch-3.0-2011/test/pixmaps/magenta_bomb.xpm +++ /dev/null @@ -1,67 +0,0 @@ -/* 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/branch-3.0-2011/test/pixmaps/porsche.xpm b/branch-3.0-2011/test/pixmaps/porsche.xpm deleted file mode 100644 index be33073ff..000000000 --- a/branch-3.0-2011/test/pixmaps/porsche.xpm +++ /dev/null @@ -1,71 +0,0 @@ -/* 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/branch-3.0-2011/test/pixmaps/porsche1.xpm b/branch-3.0-2011/test/pixmaps/porsche1.xpm deleted file mode 100644 index 3a54665da..000000000 --- a/branch-3.0-2011/test/pixmaps/porsche1.xpm +++ /dev/null @@ -1,76 +0,0 @@ -/* 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/branch-3.0-2011/test/pixmaps/red.xpm b/branch-3.0-2011/test/pixmaps/red.xpm deleted file mode 100644 index 46726184d..000000000 --- a/branch-3.0-2011/test/pixmaps/red.xpm +++ /dev/null @@ -1,67 +0,0 @@ -/* 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/branch-3.0-2011/test/pixmaps/red_bomb.xpm b/branch-3.0-2011/test/pixmaps/red_bomb.xpm deleted file mode 100644 index 312fbd331..000000000 --- a/branch-3.0-2011/test/pixmaps/red_bomb.xpm +++ /dev/null @@ -1,67 +0,0 @@ -/* 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/branch-3.0-2011/test/pixmaps/srs.xbm b/branch-3.0-2011/test/pixmaps/srs.xbm deleted file mode 100644 index b6a9c7440..000000000 --- a/branch-3.0-2011/test/pixmaps/srs.xbm +++ /dev/null @@ -1,67 +0,0 @@ -#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/branch-3.0-2011/test/pixmaps/sudoku.xbm b/branch-3.0-2011/test/pixmaps/sudoku.xbm deleted file mode 100644 index 02ea1a108..000000000 --- a/branch-3.0-2011/test/pixmaps/sudoku.xbm +++ /dev/null @@ -1,14 +0,0 @@ -#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/branch-3.0-2011/test/pixmaps/tile.xpm b/branch-3.0-2011/test/pixmaps/tile.xpm deleted file mode 100644 index ddc656eff..000000000 --- a/branch-3.0-2011/test/pixmaps/tile.xpm +++ /dev/null @@ -1,120 +0,0 @@ -/* 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/branch-3.0-2011/test/pixmaps/white_1.xbm b/branch-3.0-2011/test/pixmaps/white_1.xbm deleted file mode 100644 index 0ade331f6..000000000 --- a/branch-3.0-2011/test/pixmaps/white_1.xbm +++ /dev/null @@ -1,60 +0,0 @@ -#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/branch-3.0-2011/test/pixmaps/white_2.xbm b/branch-3.0-2011/test/pixmaps/white_2.xbm deleted file mode 100644 index b916d1226..000000000 --- a/branch-3.0-2011/test/pixmaps/white_2.xbm +++ /dev/null @@ -1,60 +0,0 @@ -#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/branch-3.0-2011/test/pixmaps/white_3.xbm b/branch-3.0-2011/test/pixmaps/white_3.xbm deleted file mode 100644 index 9b721d25b..000000000 --- a/branch-3.0-2011/test/pixmaps/white_3.xbm +++ /dev/null @@ -1,60 +0,0 @@ -#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/branch-3.0-2011/test/pixmaps/white_4.xbm b/branch-3.0-2011/test/pixmaps/white_4.xbm deleted file mode 100644 index 189f497a8..000000000 --- a/branch-3.0-2011/test/pixmaps/white_4.xbm +++ /dev/null @@ -1,60 +0,0 @@ -#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/branch-3.0-2011/test/pixmaps/whiteking_1.xbm b/branch-3.0-2011/test/pixmaps/whiteking_1.xbm deleted file mode 100644 index 2a3fd088b..000000000 --- a/branch-3.0-2011/test/pixmaps/whiteking_1.xbm +++ /dev/null @@ -1,60 +0,0 @@ -#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/branch-3.0-2011/test/pixmaps/whiteking_2.xbm b/branch-3.0-2011/test/pixmaps/whiteking_2.xbm deleted file mode 100644 index 9f2e24d23..000000000 --- a/branch-3.0-2011/test/pixmaps/whiteking_2.xbm +++ /dev/null @@ -1,60 +0,0 @@ -#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/branch-3.0-2011/test/pixmaps/whiteking_3.xbm b/branch-3.0-2011/test/pixmaps/whiteking_3.xbm deleted file mode 100644 index 95b017d4e..000000000 --- a/branch-3.0-2011/test/pixmaps/whiteking_3.xbm +++ /dev/null @@ -1,60 +0,0 @@ -#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/branch-3.0-2011/test/pixmaps/whiteking_4.xbm b/branch-3.0-2011/test/pixmaps/whiteking_4.xbm deleted file mode 100644 index 6257a5db4..000000000 --- a/branch-3.0-2011/test/pixmaps/whiteking_4.xbm +++ /dev/null @@ -1,60 +0,0 @@ -#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/branch-3.0-2011/test/pixmaps/yellow.xpm b/branch-3.0-2011/test/pixmaps/yellow.xpm deleted file mode 100644 index b493296a9..000000000 --- a/branch-3.0-2011/test/pixmaps/yellow.xpm +++ /dev/null @@ -1,67 +0,0 @@ -/* 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/branch-3.0-2011/test/pixmaps/yellow_bomb.xpm b/branch-3.0-2011/test/pixmaps/yellow_bomb.xpm deleted file mode 100644 index f95ee9b41..000000000 --- a/branch-3.0-2011/test/pixmaps/yellow_bomb.xpm +++ /dev/null @@ -1,67 +0,0 @@ -/* 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/branch-3.0-2011/test/preferences.fl b/branch-3.0-2011/test/preferences.fl deleted file mode 100644 index 0190f6651..000000000 --- a/branch-3.0-2011/test/preferences.fl +++ /dev/null @@ -1,328 +0,0 @@ -# data file for the Fltk User Interface Designer (fluid) -version 1.0300 -header_name {.h} -code_name {.cxx} -decl {\#include <FL/Fl_Preferences.H>} {public local -} - -decl {\#include <stdio.h>} {public local -} - -decl {\#include <stdlib.h>} {private local -} - -decl {\#include <FL/filename.H>} {private local -} - -decl {\#include <FL/fl_ask.H>} {private local -} - -decl {void readPrefs();} {public local -} - -decl {void writePrefs();} {public local -} - -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 - 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 );} {selected - } -} diff --git a/branch-3.0-2011/test/radio.fl b/branch-3.0-2011/test/radio.fl deleted file mode 100644 index e8ec5e6d1..000000000 --- a/branch-3.0-2011/test/radio.fl +++ /dev/null @@ -1,100 +0,0 @@ -# data file for the Fltk User Interface Designer (fluid) -version 1.0300 -header_name {.h} -code_name {.cxx} -Function {button_cb(Fl_Button *b, void *)} { - comment {Buttons test callback} open private return_type void -} { - code {char msg[256]; -sprintf(msg, "Label: '%s'\\nValue: %d", b->label(),b->value()); -cb_info->value(msg); -cb_info->redraw(); -printf("%s\\n",msg);} {selected - } -} - -Function {} {open -} { - Fl_Window {} {open - xywh {463 67 369 214} type Double visible - } { - Fl_Button {} { - label {&Fl_Button A1} - tooltip {Normal button (callback called only when released)} xywh {20 10 160 30} labelsize 13 - code0 {o->callback((Fl_Callback*) button_cb);} - } - Fl_Button {} { - label {Fl_Button &A2} - tooltip {Normal button with callback called when changed (push and released)} xywh {20 44 160 30} labelsize 13 when 1 - code0 {o->callback((Fl_Callback*) button_cb);} - } - Fl_Return_Button {} { - label {Fl_Return_Button &B} - tooltip {Button with Return key as default shortcut} xywh {20 78 160 30} labelsize 13 - code0 {o->callback((Fl_Callback*) button_cb);} - } - Fl_Light_Button {} { - label {Fl_Light_Button &C} - tooltip {Button with toggle state and a visual indicator of the current state} xywh {20 113 160 30} labelsize 13 - code0 {o->callback((Fl_Callback*) button_cb);} - } - Fl_Check_Button {} { - label {Fl_Check_Button &D} - tooltip {Check button with toggle state} xywh {20 148 160 30} down_box DOWN_BOX labelsize 13 - code0 {o->callback((Fl_Callback*) button_cb);} - } - Fl_Round_Button {} { - label {Fl_Round_Button &E} - tooltip {Round Button with toggle state} xywh {20 178 160 30} down_box ROUND_DOWN_BOX labelsize 13 - code0 {o->callback((Fl_Callback*) button_cb);} - } - Fl_Group {} {open - xywh {190 10 70 120} box THIN_UP_FRAME - } { - Fl_Round_Button {} { - label {radio &1} - tooltip {Radio button, only one button is set at a time, in the corresponding group.} xywh {190 10 70 30} type Radio down_box ROUND_DOWN_BOX - code0 {o->callback((Fl_Callback*) button_cb);} - } - Fl_Round_Button {} { - label {radio &2} - tooltip {Radio button, only one button is set at a time, in the corresponding group.} xywh {190 40 70 30} type Radio down_box ROUND_DOWN_BOX - code0 {o->callback((Fl_Callback*) button_cb);} - } - Fl_Round_Button {} { - label {radio &3} - tooltip {Radio button, only one button is set at a time, in the corresponding group.} xywh {190 70 70 30} type Radio down_box ROUND_DOWN_BOX - code0 {o->callback((Fl_Callback*) button_cb);} - } - Fl_Round_Button {} { - label {radio &4} - tooltip {Radio button, only one button is set at a time, in the corresponding group.} xywh {190 100 70 30} type Radio down_box ROUND_DOWN_BOX - code0 {o->callback((Fl_Callback*) button_cb);} - } - } - Fl_Group {} {open - xywh {270 10 90 120} box THIN_UP_BOX - } { - Fl_Button {} { - label radio - tooltip {Custom look button, only one button is set at a time, in the corresponding group.} xywh {280 20 20 20} type Radio selection_color 1 align 8 - } - Fl_Button {} { - label radio - tooltip {Custom look button, only one button is set at a time, in the corresponding group.} xywh {280 45 20 20} type Radio selection_color 1 align 8 - } - Fl_Button {} { - label radio - tooltip {Custom look button, only one button is set at a time, in the corresponding group.} xywh {280 70 20 20} type Radio selection_color 1 align 8 - } - Fl_Button {} { - label radio - tooltip {Custom look button, only one button is set at a time, in the corresponding group.} xywh {280 95 20 20} type Radio selection_color 1 align 8 - } - } - Fl_Output cb_info { - label {callback:} - xywh {190 148 170 62} type Multiline align 133 textsize 12 - } - } -} diff --git a/branch-3.0-2011/test/resize.fl b/branch-3.0-2011/test/resize.fl deleted file mode 100644 index 3b2180153..000000000 --- a/branch-3.0-2011/test/resize.fl +++ /dev/null @@ -1,51 +0,0 @@ -# data file for the Fltk User Interface Designer (fluid) -version 1.0300 -header_name {.h} -code_name {.cxx} -Function {} {open -} { - Fl_Window {} {open - xywh {333 489 366 261} type Double resizable visible - } { - Fl_Button {} { - label {@<-} - callback {Fl_Window* w = o->window(); -w->position(w->x()-50,w->y());} - xywh {20 40 40 40} - } - Fl_Button {} { - label {@2->} - callback {Fl_Window* w = o->window(); -w->position(w->x(),w->y()+50);} - xywh {60 80 40 40} - } - Fl_Button {} { - label {@->} - callback {Fl_Window* w = o->window(); -w->position(w->x()+50,w->y());} - xywh {100 40 40 40} - } - Fl_Button {} { - label {@8->} - callback {Fl_Window* w = o->window(); -w->position(w->x(),w->y()-50);} - xywh {60 0 40 40} - } - Fl_Button {} { - label grow - callback {Fl_Window* w = o->window(); -w->size(w->w()+20, w->h()+20);} - xywh {30 130 110 40} 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} 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/branch-3.0-2011/test/resizebox.cxx b/branch-3.0-2011/test/resizebox.cxx deleted file mode 100644 index 7ce83c3d6..000000000 --- a/branch-3.0-2011/test/resizebox.cxx +++ /dev/null @@ -1,102 +0,0 @@ -// -// "$Id$" -// -// Resize box test program for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2010 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_Double_Window.H> -#include <FL/Fl_Box.H> -#include <FL/Fl_Radio_Button.H> -#include <FL/fl_draw.H> -#include <FL/fl_message.H> - -Fl_Double_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_Double_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$". -// diff --git a/branch-3.0-2011/test/rgb.txt b/branch-3.0-2011/test/rgb.txt deleted file mode 100644 index 62eb8961e..000000000 --- a/branch-3.0-2011/test/rgb.txt +++ /dev/null @@ -1,753 +0,0 @@ -! $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/branch-3.0-2011/test/rotated_text.cxx b/branch-3.0-2011/test/rotated_text.cxx deleted file mode 100644 index f85308654..000000000 --- a/branch-3.0-2011/test/rotated_text.cxx +++ /dev/null @@ -1,228 +0,0 @@ -// -// "$Id: label.cxx 6626 2009-01-12 14:52:45Z fabien $" -// -// Label test program for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2010 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> - -#include <math.h> -#ifndef M_PI -#define M_PI 3.141592654 -#endif - -Fl_Toggle_Button *leftb,*rightb,*clipb; -//Fl_Box *text; -Fl_Input *input; -Fl_Hor_Value_Slider *fonts; -Fl_Hor_Value_Slider *sizes; -Fl_Hor_Value_Slider *angles; -Fl_Double_Window *window; - -//code taken from fl_engraved_label.cxx -class Rotated_Label_Box : public Fl_Widget{ - protected: - void draw(){ - draw_box(); - fl_font(labelfont(), labelsize()); - fl_color(labelcolor()); - int dx(0),dy(0); - - if(rt_align&FL_ALIGN_CLIP)fl_push_clip(x(),y(),w(),h()); - else fl_push_no_clip(); - fl_measure(rt_text,dx,dy); - if(rt_align&FL_ALIGN_LEFT){ - dx=dy=0; - }else if(rt_align&FL_ALIGN_RIGHT){ - dy=(int)(-sin(M_PI*(double)(rt_angle+180)/180.)*(double)dx); - dx=(int)(cos(M_PI*(double)(rt_angle+180)/180.)*(double)dx); - }else{ - dy=(int)(sin(M_PI*(double)rt_angle/180.)*(double)dx); - dx=(int)(-cos(M_PI*(double)rt_angle/180.)*(double)dx); - dx/=2;dy/=2; - } - if(labeltype()==FL_SHADOW_LABEL)shadow_label(x()+w()/2+dx,y()+h()/2+dy); - else if(labeltype()==FL_ENGRAVED_LABEL)engraved_label(x()+w()/2+dx,y()+h()/2+dy); - else if(labeltype()==FL_EMBOSSED_LABEL)embossed_label(x()+w()/2+dx,y()+h()/2+dy); - else{ - fl_draw(rt_angle,rt_text,x()+w()/2+dx,y()+h()/2+dy); - } - fl_pop_clip(); - draw_label(); - } - void innards(int X, int Y, int data[][3], int n){ - for (int i = 0; i < n; i++) { - fl_color((Fl_Color)(i < n-1 ? data[i][2] : labelcolor())); - fl_draw(rt_angle,rt_text, X+data[i][0], Y+data[i][1]); - } - } - - void shadow_label(int X, int Y){ - static int data[2][3] = {{2,2,FL_DARK3},{0,0,0}}; - innards(X, Y, data, 2); - } - - void engraved_label(int X, int Y){ - static int data[7][3] = { - {1,0,FL_LIGHT3},{1,1,FL_LIGHT3},{0,1,FL_LIGHT3}, - {-1,0,FL_DARK3},{-1,-1,FL_DARK3},{0,-1,FL_DARK3}, - {0,0,0}}; - innards(X, Y, data, 7); - } - - void embossed_label(int X, int Y){ - static int data[7][3] = { - {-1,0,FL_LIGHT3},{-1,-1,FL_LIGHT3},{0,-1,FL_LIGHT3}, - {1,0,FL_DARK3},{1,1,FL_DARK3},{0,1,FL_DARK3}, - {0,0,0}}; - innards(X, Y, data, 7); - } - - public: - Rotated_Label_Box(int X, int Y, int W, int H, const char*L=0): - Fl_Widget(X,Y,W,H,L),rt_angle(0),rt_align((Fl_Align)0){ - rt_text=input->value(); - }; - int rt_angle; - const char* rt_text; - Fl_Align rt_align; -}*text; - - -void button_cb(Fl_Widget *,void *) { - int i = 0; - if (leftb->value()) i |= FL_ALIGN_LEFT; - if (rightb->value()) i |= FL_ALIGN_RIGHT; - if (clipb->value()) i |= FL_ALIGN_CLIP; - text->rt_align=(Fl_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 angle_cb(Fl_Widget *,void *) { - text->rt_angle=(int)angles->value(); - window->redraw(); -} - -void input_cb(Fl_Widget *,void *) { - text->rt_text=input->value(); - window->redraw(); -} - -void normal_cb(Fl_Widget *,void *) { - text->labeltype(FL_NORMAL_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_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,425); - - angles= new Fl_Hor_Value_Slider(50,400,350,25,"Angle:"); - angles->align(FL_ALIGN_LEFT); - angles->bounds(-360,360); - angles->step(1); - angles->value(0); - angles->callback(angle_cb); - - input = new Fl_Input(50,375,350,25); - input->static_value("Rotate Me!!!"); - input->when(FL_WHEN_CHANGED); - input->callback(input_cb); - - sizes= new Fl_Hor_Value_Slider(50,350,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,325,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(50,300,350,25); - leftb = new Fl_Toggle_Button(50,300,50,25,"left"); - leftb->callback(button_cb); - rightb = new Fl_Toggle_Button(100,300,50,25,"right"); - rightb->callback(button_cb); - clipb = new Fl_Toggle_Button(350,300,50,25,"clip"); - clipb->callback(button_cb); - g->resizable(rightb); - g->end(); - - Fl_Choice *c = new Fl_Choice(50,275,200,25); - c->menu(choices); - - text= new Rotated_Label_Box(100,75,200,100,"Widget with rotated text"); - text->box(FL_FRAME_BOX); - text->align(FL_ALIGN_BOTTOM); - window->resizable(text); - window->end(); - window->show(argc,argv); - return Fl::run(); -} - -// -// End of "$Id: label.cxx 6626 2009-01-12 14:52:45Z fabien $". -// diff --git a/branch-3.0-2011/test/scroll.cxx b/branch-3.0-2011/test/scroll.cxx deleted file mode 100644 index 0cc229b5d..000000000 --- a/branch-3.0-2011/test/scroll.cxx +++ /dev/null @@ -1,144 +0,0 @@ -// -// "$Id$" -// -// Fl_Scroll test program for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2010 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)((fl_intptr_t)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)((fl_intptr_t)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$". -// diff --git a/branch-3.0-2011/test/shape.cxx b/branch-3.0-2011/test/shape.cxx deleted file mode 100644 index e68030248..000000000 --- a/branch-3.0-2011/test/shape.cxx +++ /dev/null @@ -1,117 +0,0 @@ -// -// "$Id$" -// -// Tiny OpenGL demo program for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2010 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$". -// diff --git a/branch-3.0-2011/test/subwindow.cxx b/branch-3.0-2011/test/subwindow.cxx deleted file mode 100644 index d96255ca7..000000000 --- a/branch-3.0-2011/test/subwindow.cxx +++ /dev/null @@ -1,191 +0,0 @@ -// -// "$Id$" -// -// 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-2010 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$". -// diff --git a/branch-3.0-2011/test/sudoku.app/Contents/Info.plist b/branch-3.0-2011/test/sudoku.app/Contents/Info.plist deleted file mode 100644 index 00eeb0516..000000000 --- a/branch-3.0-2011/test/sudoku.app/Contents/Info.plist +++ /dev/null @@ -1,44 +0,0 @@ -<?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/branch-3.0-2011/test/sudoku.app/Contents/PkgInfo b/branch-3.0-2011/test/sudoku.app/Contents/PkgInfo deleted file mode 100644 index 5af7226a1..000000000 --- a/branch-3.0-2011/test/sudoku.app/Contents/PkgInfo +++ /dev/null @@ -1 +0,0 @@ -FLSUFlsu diff --git a/branch-3.0-2011/test/sudoku.app/Contents/Resources/sudoku.icns b/branch-3.0-2011/test/sudoku.app/Contents/Resources/sudoku.icns Binary files differdeleted file mode 100644 index abbe75ef0..000000000 --- a/branch-3.0-2011/test/sudoku.app/Contents/Resources/sudoku.icns +++ /dev/null diff --git a/branch-3.0-2011/test/sudoku.cxx b/branch-3.0-2011/test/sudoku.cxx deleted file mode 100644 index d15af6b58..000000000 --- a/branch-3.0-2011/test/sudoku.cxx +++ /dev/null @@ -1,1346 +0,0 @@ -// -// "$Id$" -// -// Sudoku game using the Fast Light Tool Kit (FLTK). -// -// Copyright 2005-2010 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_Double_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; -# if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 - AudioDeviceIOProcID audio_proc_id; -# endif - 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_Double_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 and start the device -# if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 - if (AudioDeviceCreateIOProcID(device, audio_cb, (void *)this, &audio_proc_id) != noErr) return; - AudioDeviceStart(device, audio_proc_id); -# else - if (AudioDeviceAddIOProc(device, audio_cb, (void *)this) != noErr) return; - AudioDeviceStart(device, audio_cb); -# endif - - 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(¶ms); - 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) { -# if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 - AudioDeviceStop(device, audio_proc_id); - AudioDeviceDestroyIOProcID(device, audio_proc_id); -# else - AudioDeviceStop(device, audio_cb); - AudioDeviceRemoveIOProc(device, audio_cb); -# endif - } - -#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_Double_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-2010 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_Double_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$". -// diff --git a/branch-3.0-2011/test/sudoku.ico b/branch-3.0-2011/test/sudoku.ico Binary files differdeleted file mode 100644 index f5f1e4ad5..000000000 --- a/branch-3.0-2011/test/sudoku.ico +++ /dev/null diff --git a/branch-3.0-2011/test/sudoku.rc b/branch-3.0-2011/test/sudoku.rc deleted file mode 100644 index 107c9a69f..000000000 --- a/branch-3.0-2011/test/sudoku.rc +++ /dev/null @@ -1,72 +0,0 @@ -//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/branch-3.0-2011/test/sudokurc.h b/branch-3.0-2011/test/sudokurc.h deleted file mode 100644 index 0cea5434d..000000000 --- a/branch-3.0-2011/test/sudokurc.h +++ /dev/null @@ -1,16 +0,0 @@ -//{{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/branch-3.0-2011/test/symbols.cxx b/branch-3.0-2011/test/symbols.cxx deleted file mode 100644 index 5b082bf32..000000000 --- a/branch-3.0-2011/test/symbols.cxx +++ /dev/null @@ -1,159 +0,0 @@ -// -// "$Id$" -// -// Symbol test program for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2010 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_Double_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_Double_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_Double_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$". -// diff --git a/branch-3.0-2011/test/table.cxx b/branch-3.0-2011/test/table.cxx deleted file mode 100644 index c36713ef5..000000000 --- a/branch-3.0-2011/test/table.cxx +++ /dev/null @@ -1,493 +0,0 @@ -// -// exercisetablerow -- Exercise all aspects of the Fl_Table_Row widget -// - -#include <stdio.h> -#include <string.h> -#ifdef WIN32 -#include <stdlib.h> // atoi -#endif /*WIN32*/ - -#include <FL/Fl.H> -#include <FL/Fl_Window.H> -#include <FL/Fl_Input.H> -#include <FL/Fl_Check_Button.H> -#include <FL/Fl_Choice.H> -#include <FL/fl_draw.H> -#include <FL/fl_ask.H> -#include <FL/Fl_Table_Row.H> - -// Simple demonstration class to derive from Fl_Table_Row -class DemoTable : public Fl_Table_Row -{ -private: - Fl_Color cell_bgcolor; // color of cell's bg color - Fl_Color cell_fgcolor; // color of cell's fg color - -protected: - void draw_cell(TableContext context, // table cell drawing - int R=0, int C=0, int X=0, int Y=0, int W=0, int H=0); - static void event_callback(Fl_Widget*, void*); - void event_callback2(); // callback for table events - -public: - DemoTable(int x, int y, int w, int h, const char *l=0) : Fl_Table_Row(x,y,w,h,l) - { - cell_bgcolor = FL_WHITE; - cell_fgcolor = FL_BLACK; - callback(&event_callback, (void*)this); - end(); - } - ~DemoTable() { } - Fl_Color GetCellFGColor() const { return(cell_fgcolor); } - Fl_Color GetCellBGColor() const { return(cell_bgcolor); } - void SetCellFGColor(Fl_Color val) { cell_fgcolor = val; } - void SetCellBGColor(Fl_Color val) { cell_bgcolor = val; } -}; - -// Handle drawing all cells in table -void DemoTable::draw_cell(TableContext context, - int R, int C, int X, int Y, int W, int H) -{ - static char s[40]; - sprintf(s, "%d/%d", R, C); // text for each cell - - switch ( context ) - { - case CONTEXT_STARTPAGE: - fl_font(FL_HELVETICA, 16); - return; - - case CONTEXT_COL_HEADER: - fl_push_clip(X, Y, W, H); - { - fl_draw_box(FL_THIN_UP_BOX, X, Y, W, H, col_header_color()); - fl_color(FL_BLACK); - fl_draw(s, X, Y, W, H, FL_ALIGN_CENTER); - } - fl_pop_clip(); - return; - - case CONTEXT_ROW_HEADER: - fl_push_clip(X, Y, W, H); - { - fl_draw_box(FL_THIN_UP_BOX, X, Y, W, H, row_header_color()); - fl_color(FL_BLACK); - fl_draw(s, X, Y, W, H, FL_ALIGN_CENTER); - } - fl_pop_clip(); - return; - - case CONTEXT_CELL: - { - fl_push_clip(X, Y, W, H); - { - // BG COLOR - fl_color( row_selected(R) ? selection_color() : cell_bgcolor); - fl_rectf(X, Y, W, H); - - // TEXT - fl_color(cell_fgcolor); - fl_draw(s, X, Y, W, H, FL_ALIGN_CENTER); - - // BORDER - fl_color(color()); - fl_rect(X, Y, W, H); - } - fl_pop_clip(); - return; - } - - case CONTEXT_TABLE: - fprintf(stderr, "TABLE CONTEXT CALLED\n"); - return; - - case CONTEXT_ENDPAGE: - case CONTEXT_RC_RESIZE: - case CONTEXT_NONE: - return; - } -} - -// Callback whenever someone clicks on different parts of the table -void DemoTable::event_callback(Fl_Widget*, void *data) -{ - DemoTable *o = (DemoTable*)data; - o->event_callback2(); -} - -void DemoTable::event_callback2() -{ - int R = callback_row(), - C = callback_col(); - TableContext context = callback_context(); - printf("'%s' callback: ", (label() ? label() : "?")); - printf("Row=%d Col=%d Context=%d Event=%d InteractiveResize? %d\n", - R, C, (int)context, (int)Fl::event(), (int)is_interactive_resize()); -} - -// GLOBAL TABLE WIDGET -static DemoTable *G_table = 0; - -void setrows_cb(Fl_Widget*, void *data) -{ - Fl_Input *in = (Fl_Input*)data; - int rows = atoi(in->value()); - if ( rows < 0 ) rows = 0; - G_table->rows(rows); -} - -void setcols_cb(Fl_Widget*, void *data) -{ - Fl_Input *in = (Fl_Input*)data; - int cols = atoi(in->value()); - if ( cols < 0 ) cols = 0; - G_table->cols(cols); -} - -void setrowheader_cb(Fl_Widget*, void *data) -{ - Fl_Check_Button *check = (Fl_Check_Button*)data; - G_table->row_header(check->value()); -} - -void setcolheader_cb(Fl_Widget*, void *data) -{ - Fl_Check_Button *check = (Fl_Check_Button*)data; - G_table->col_header(check->value()); -} - -void setrowresize_cb(Fl_Widget*, void *data) -{ - Fl_Check_Button *check = (Fl_Check_Button*)data; - G_table->row_resize(check->value()); -} - -void setcolresize_cb(Fl_Widget*, void *data) -{ - Fl_Check_Button *check = (Fl_Check_Button*)data; - G_table->col_resize(check->value()); -} - -void setpositionrow_cb(Fl_Widget *w, void *data) -{ - Fl_Input *in = (Fl_Input*)data; - int toprow = atoi(in->value()); - if ( toprow < 0 || toprow >= G_table->rows() ) - { fl_alert("Must be in range 0 thru #rows"); } - else - { G_table->row_position(toprow); } -} - -void setpositioncol_cb(Fl_Widget *w, void *data) -{ - Fl_Input *in = (Fl_Input*)data; - int leftcol = atoi(in->value()); - if ( leftcol < 0 || leftcol >= G_table->cols() ) - { fl_alert("Must be in range 0 thru #cols"); } - else - { G_table->col_position(leftcol); } -} - -void setrowheaderwidth_cb(Fl_Widget *w, void *data) -{ - Fl_Input *in = (Fl_Input*)data; - int val = atoi(in->value()); - if ( val < 1 ) { val = 1; in->value("1"); } - G_table->row_header_width(val); -} - -void setcolheaderheight_cb(Fl_Widget *w, void *data) -{ - Fl_Input *in = (Fl_Input*)data; - int val = atoi(in->value()); - if ( val < 1 ) { val = 1; in->value("1"); } - G_table->col_header_height(val); -} - -void setrowheadercolor_cb(Fl_Widget *w, void *data) -{ - Fl_Input *in = (Fl_Input*)data; - int val = atoi(in->value()); - if ( val < 0 ) { fl_alert("Must be a color >0"); } - else { G_table->row_header_color(Fl_Color(val)); } -} - -void setcolheadercolor_cb(Fl_Widget *w, void *data) -{ - Fl_Input *in = (Fl_Input*)data; - int val = atoi(in->value()); - if ( val < 0 ) { fl_alert("Must be a color >0"); } - else { G_table->col_header_color(Fl_Color(val)); } -} - -void setrowheightall_cb(Fl_Widget *w, void *data) -{ - Fl_Input *in = (Fl_Input*)data; - int val = atoi(in->value()); - if ( val < 0 ) { val = 0; in->value("0"); } - G_table->row_height_all(val); -} - -void setcolwidthall_cb(Fl_Widget *w, void *data) -{ - Fl_Input *in = (Fl_Input*)data; - int val = atoi(in->value()); - if ( val < 0 ) { val = 0; in->value("0"); } - G_table->col_width_all(val); -} - -void settablecolor_cb(Fl_Widget *w, void *data) -{ - Fl_Input *in = (Fl_Input*)data; - int val = atoi(in->value()); - if ( val < 0 ) { fl_alert("Must be a color >0"); } - else { G_table->color(Fl_Color(val)); } - G_table->redraw(); -} - -void setcellfgcolor_cb(Fl_Widget *w, void *data) -{ - Fl_Input *in = (Fl_Input*)data; - int val = atoi(in->value()); - if ( val < 0 ) { fl_alert("Must be a color >0"); } - else { G_table->SetCellFGColor(Fl_Color(val)); } - G_table->redraw(); -} - -void setcellbgcolor_cb(Fl_Widget *w, void *data) -{ - Fl_Input *in = (Fl_Input*)data; - int val = atoi(in->value()); - if ( val < 0 ) { fl_alert("Must be a color >0"); } - else { G_table->SetCellBGColor(Fl_Color(val)); } - G_table->redraw(); -} - -char *itoa(int val) -{ - static char s[80]; - sprintf(s, "%d", val); - return(s); -} - -void tablebox_choice_cb(Fl_Widget *w, void *data) -{ - G_table->table_box((Fl_Boxtype)(fl_intptr_t)data); - G_table->redraw(); -} - -void widgetbox_choice_cb(Fl_Widget *w, void *data) -{ - G_table->box((Fl_Boxtype)(fl_intptr_t)data); - G_table->resize(G_table->x(), G_table->y(), G_table->w(), G_table->h()); -} - -void type_choice_cb(Fl_Widget *w, void *data) -{ - G_table->type((Fl_Table_Row::TableRowSelectMode)(fl_intptr_t)data); -} - -Fl_Menu_Item tablebox_choices[] = { - {"No Box", 0, tablebox_choice_cb, (void*)FL_NO_BOX }, - {"Flat Box", 0, tablebox_choice_cb, (void*)FL_FLAT_BOX }, - {"Up Box", 0, tablebox_choice_cb, (void*)FL_UP_BOX }, - {"Down Box", 0, tablebox_choice_cb, (void*)FL_DOWN_BOX }, - {"Up Frame", 0, tablebox_choice_cb, (void*)FL_UP_FRAME }, - {"Down Frame", 0, tablebox_choice_cb, (void*)FL_DOWN_FRAME }, - {"Thin Up Box", 0, tablebox_choice_cb, (void*)FL_THIN_UP_BOX }, - {"Thin Down Box", 0, tablebox_choice_cb, (void*)FL_THIN_DOWN_BOX }, - {"Thin Up Frame", 0, tablebox_choice_cb, (void*)FL_THIN_UP_FRAME }, - {"Thin Down Frame",0, tablebox_choice_cb, (void*)FL_THIN_DOWN_FRAME }, - {"Engraved Box", 0, tablebox_choice_cb, (void*)FL_ENGRAVED_BOX }, - {"Embossed Box", 0, tablebox_choice_cb, (void*)FL_EMBOSSED_BOX }, - {"Engraved Frame", 0, tablebox_choice_cb, (void*)FL_ENGRAVED_FRAME }, - {"Embossed Frame", 0, tablebox_choice_cb, (void*)FL_EMBOSSED_FRAME }, - {"Border Box", 0, tablebox_choice_cb, (void*)FL_BORDER_BOX }, - {"Shadow Box", 0, tablebox_choice_cb, (void*)FL_SHADOW_BOX }, - {"Border Frame", 0, tablebox_choice_cb, (void*)FL_BORDER_FRAME }, - {0} -}; - -Fl_Menu_Item widgetbox_choices[] = { - {"No Box", 0, widgetbox_choice_cb, (void*)FL_NO_BOX }, -//{"Flat Box", 0, widgetbox_choice_cb, (void*)FL_FLAT_BOX }, -//{"Up Box", 0, widgetbox_choice_cb, (void*)FL_UP_BOX }, -//{"Down Box", 0, widgetbox_choice_cb, (void*)FL_DOWN_BOX }, - {"Up Frame", 0, widgetbox_choice_cb, (void*)FL_UP_FRAME }, - {"Down Frame", 0, widgetbox_choice_cb, (void*)FL_DOWN_FRAME }, -//{"Thin Up Box", 0, widgetbox_choice_cb, (void*)FL_THIN_UP_BOX }, -//{"Thin Down Box", 0, widgetbox_choice_cb, (void*)FL_THIN_DOWN_BOX }, - {"Thin Up Frame", 0, widgetbox_choice_cb, (void*)FL_THIN_UP_FRAME }, - {"Thin Down Frame",0, widgetbox_choice_cb, (void*)FL_THIN_DOWN_FRAME }, -//{"Engraved Box", 0, widgetbox_choice_cb, (void*)FL_ENGRAVED_BOX }, -//{"Embossed Box", 0, widgetbox_choice_cb, (void*)FL_EMBOSSED_BOX }, - {"Engraved Frame", 0, widgetbox_choice_cb, (void*)FL_ENGRAVED_FRAME }, - {"Embossed Frame", 0, widgetbox_choice_cb, (void*)FL_EMBOSSED_FRAME }, -//{"Border Box", 0, widgetbox_choice_cb, (void*)FL_BORDER_BOX }, -//{"Shadow Box", 0, widgetbox_choice_cb, (void*)FL_SHADOW_BOX }, - {"Border Frame", 0, widgetbox_choice_cb, (void*)FL_BORDER_FRAME }, - {0} -}; - -Fl_Menu_Item type_choices[] = { - {"SelectNone", 0, type_choice_cb, (void*)Fl_Table_Row::SELECT_NONE }, - {"SelectSingle", 0, type_choice_cb, (void*)Fl_Table_Row::SELECT_SINGLE }, - {"SelectMulti", 0, type_choice_cb, (void*)Fl_Table_Row::SELECT_MULTI }, - {0} -}; - -int main(int argc, char **argv) -{ - Fl_Window win(900, 730); - - G_table = new DemoTable(20, 20, 860, 460, "Demo"); - G_table->selection_color(FL_YELLOW); - G_table->when(FL_WHEN_RELEASE|FL_WHEN_CHANGED); - G_table->table_box(FL_NO_BOX); - G_table->col_resize_min(4); - G_table->row_resize_min(4); - - // ROWS - G_table->row_header(1); - G_table->row_header_width(60); - G_table->row_resize(1); - G_table->rows(500); - G_table->row_height_all(20); - - // COLS - G_table->cols(500); - G_table->col_header(1); - G_table->col_header_height(25); - G_table->col_resize(1); - G_table->col_width_all(80); - - // Add children to window - win.begin(); - - // ROW - Fl_Input setrows(150, 500, 120, 25, "Rows"); - setrows.labelsize(12); - setrows.value(itoa(G_table->rows())); - setrows.callback(setrows_cb, (void*)&setrows); - setrows.when(FL_WHEN_RELEASE); - - Fl_Input rowheightall(400, 500, 120, 25, "Row Height"); - rowheightall.labelsize(12); - rowheightall.value(itoa(G_table->row_height(0))); - rowheightall.callback(setrowheightall_cb, (void*)&rowheightall); - rowheightall.when(FL_WHEN_RELEASE); - - Fl_Input positionrow(650, 500, 120, 25, "Row Position"); - positionrow.labelsize(12); - positionrow.value("1"); - positionrow.callback(setpositionrow_cb, (void*)&positionrow); - positionrow.when(FL_WHEN_RELEASE); - - // COL - Fl_Input setcols(150, 530, 120, 25, "Cols"); - setcols.labelsize(12); - setcols.value(itoa(G_table->cols())); - setcols.callback(setcols_cb, (void*)&setcols); - setcols.when(FL_WHEN_RELEASE); - - Fl_Input colwidthall(400, 530, 120, 25, "Col Width"); - colwidthall.labelsize(12); - colwidthall.value(itoa(G_table->col_width(0))); - colwidthall.callback(setcolwidthall_cb, (void*)&colwidthall); - colwidthall.when(FL_WHEN_RELEASE); - - Fl_Input positioncol(650, 530, 120, 25, "Col Position"); - positioncol.labelsize(12); - positioncol.value("1"); - positioncol.callback(setpositioncol_cb, (void*)&positioncol); - positioncol.when(FL_WHEN_RELEASE); - - // ROW HEADER - Fl_Input rowheaderwidth(150, 570, 120, 25, "Row Header Width"); - rowheaderwidth.labelsize(12); - rowheaderwidth.value(itoa(G_table->row_header_width())); - rowheaderwidth.callback(setrowheaderwidth_cb, (void*)&rowheaderwidth); - rowheaderwidth.when(FL_WHEN_RELEASE); - - Fl_Input rowheadercolor(400, 570, 120, 25, "Row Header Color"); - rowheadercolor.labelsize(12); - rowheadercolor.value(itoa((int)G_table->row_header_color())); - rowheadercolor.callback(setrowheadercolor_cb, (void*)&rowheadercolor); - rowheadercolor.when(FL_WHEN_RELEASE); - - Fl_Check_Button rowheader(550, 570, 120, 25, "Row Headers?"); - rowheader.labelsize(12); - rowheader.callback(setrowheader_cb, (void*)&rowheader); - rowheader.value(G_table->row_header() ? 1 : 0); - - Fl_Check_Button rowresize(700, 570, 120, 25, "Row Resize?"); - rowresize.labelsize(12); - rowresize.callback(setrowresize_cb, (void*)&rowresize); - rowresize.value(G_table->row_resize() ? 1 : 0); - - // COL HEADER - Fl_Input colheaderheight(150, 600, 120, 25, "Col Header Height"); - colheaderheight.labelsize(12); - colheaderheight.value(itoa(G_table->col_header_height())); - colheaderheight.callback(setcolheaderheight_cb, (void*)&colheaderheight); - colheaderheight.when(FL_WHEN_RELEASE); - - Fl_Input colheadercolor(400, 600, 120, 25, "Col Header Color"); - colheadercolor.labelsize(12); - colheadercolor.value(itoa((int)G_table->col_header_color())); - colheadercolor.callback(setcolheadercolor_cb, (void*)&colheadercolor); - colheadercolor.when(FL_WHEN_RELEASE); - - Fl_Check_Button colheader(550, 600, 120, 25, "Col Headers?"); - colheader.labelsize(12); - colheader.callback(setcolheader_cb, (void*)&colheader); - colheader.value(G_table->col_header() ? 1 : 0); - - Fl_Check_Button colresize(700, 600, 120, 25, "Col Resize?"); - colresize.labelsize(12); - colresize.callback(setcolresize_cb, (void*)&colresize); - colresize.value(G_table->col_resize() ? 1 : 0); - - Fl_Choice tablebox(150, 640, 120, 25, "Table Box"); - tablebox.labelsize(12); - tablebox.textsize(12); - tablebox.menu(tablebox_choices); - tablebox.value(0); - - Fl_Choice widgetbox(150, 670, 120, 25, "Widget Box"); - widgetbox.labelsize(12); - widgetbox.textsize(12); - widgetbox.menu(widgetbox_choices); - widgetbox.value(2); // down frame - - Fl_Input tablecolor(400, 640, 120, 25, "Table Color"); - tablecolor.labelsize(12); - tablecolor.value(itoa((int)G_table->color())); - tablecolor.callback(settablecolor_cb, (void*)&tablecolor); - tablecolor.when(FL_WHEN_RELEASE); - - Fl_Input cellbgcolor(400, 670, 120, 25, "Cell BG Color"); - cellbgcolor.labelsize(12); - cellbgcolor.value(itoa((int)G_table->GetCellBGColor())); - cellbgcolor.callback(setcellbgcolor_cb, (void*)&cellbgcolor); - cellbgcolor.when(FL_WHEN_RELEASE); - - Fl_Input cellfgcolor(400, 700, 120, 25, "Cell FG Color"); - cellfgcolor.labelsize(12); - cellfgcolor.value(itoa((int)G_table->GetCellFGColor())); - cellfgcolor.callback(setcellfgcolor_cb, (void*)&cellfgcolor); - cellfgcolor.when(FL_WHEN_RELEASE); - - Fl_Choice type(650, 640, 120, 25, "Type"); - type.labelsize(12); - type.textsize(12); - type.menu(type_choices); - type.value(2); - - win.end(); - win.resizable(*G_table); - win.show(argc, argv); - - return(Fl::run()); -} diff --git a/branch-3.0-2011/test/tabs.fl b/branch-3.0-2011/test/tabs.fl deleted file mode 100644 index 29b8b3738..000000000 --- a/branch-3.0-2011/test/tabs.fl +++ /dev/null @@ -1,289 +0,0 @@ -# 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/branch-3.0-2011/test/threads.cxx b/branch-3.0-2011/test/threads.cxx deleted file mode 100644 index fb59a2765..000000000 --- a/branch-3.0-2011/test/threads.cxx +++ /dev/null @@ -1,173 +0,0 @@ -// -// "$Id$" -// -// Threading example program for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2010 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_Double_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_Double_Window* w = new Fl_Double_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_Double_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$". -// diff --git a/branch-3.0-2011/test/threads.h b/branch-3.0-2011/test/threads.h deleted file mode 100644 index d602f784a..000000000 --- a/branch-3.0-2011/test/threads.h +++ /dev/null @@ -1,81 +0,0 @@ -// -// "$Id$" -// -// Simple threading API for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2010 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$". -// diff --git a/branch-3.0-2011/test/tile.cxx b/branch-3.0-2011/test/tile.cxx deleted file mode 100644 index bbd1e5703..000000000 --- a/branch-3.0-2011/test/tile.cxx +++ /dev/null @@ -1,97 +0,0 @@ -// -// "$Id$" -// -// Tile test program for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2010 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> - -//#define TEST_INACTIVE - -int main(int argc, char** argv) { - Fl_Double_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_Double_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(); -#ifdef TEST_INACTIVE // test inactive case - tile.deactivate(); -#endif - w1.show(); - window.show(argc,argv); - return Fl::run(); -} - -// -// End of "$Id$". -// diff --git a/branch-3.0-2011/test/tiled_image.cxx b/branch-3.0-2011/test/tiled_image.cxx deleted file mode 100644 index f18ce9c32..000000000 --- a/branch-3.0-2011/test/tiled_image.cxx +++ /dev/null @@ -1,105 +0,0 @@ -// -// "$Id$" -// -// Fl_Tiled_Image test program for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2010 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_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_Double_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_Double_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$". -// diff --git a/branch-3.0-2011/test/trackball.c b/branch-3.0-2011/test/trackball.c deleted file mode 100644 index f23d3db30..000000000 --- a/branch-3.0-2011/test/trackball.c +++ /dev/null @@ -1,324 +0,0 @@ -/* - * (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/branch-3.0-2011/test/trackball.h b/branch-3.0-2011/test/trackball.h deleted file mode 100644 index b676fb4e5..000000000 --- a/branch-3.0-2011/test/trackball.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - * (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/branch-3.0-2011/test/tree.fl b/branch-3.0-2011/test/tree.fl deleted file mode 100644 index 5fec7fd60..000000000 --- a/branch-3.0-2011/test/tree.fl +++ /dev/null @@ -1,863 +0,0 @@ -# data file for the Fltk User Interface Designer (fluid) -version 1.0300 -header_name {.h} -code_name {.cxx} -decl {\#include <stdio.h>} {public global -} - -decl {\#include <FL/Fl.H>} {public global -} - -decl {\#include <FL/Fl_Pixmap.H>} {public global -} - -decl {\#include <FL/Fl_Group.H>} {public global -} - -decl {\#include <FL/Fl_Tree.H>} {public global -} - -decl {\#include <FL/fl_ask.H>} {public global -} - -decl {\#include <FL/fl_message.H>} {public global -} - -decl {\#include <FL/Fl_File_Chooser.H>} {public global -} - -decl {\#include <FL/Fl_Preferences.H>} {public global -} - -decl {int G_cb_counter = 0;} { - comment {// Global callback event counter} private local -} - -Function {reason_as_name(Fl_Tree_Reason reason)} {open return_type {const char*} -} { - code {switch ( reason ) { - case FL_TREE_REASON_NONE: return("none"); - case FL_TREE_REASON_SELECTED: return("selected"); - case FL_TREE_REASON_DESELECTED: return("deselected"); - case FL_TREE_REASON_OPENED: return("opened"); - case FL_TREE_REASON_CLOSED: return("closed"); - default: return("???"); - }} {} -} - -Function {Button_CB(Fl_Widget*w, void*data)} {return_type void -} { - code {fprintf(stderr, "'%s' button pushed\\n", w->label());} {} -} - -Function {RebuildTree()} {} { - code {// REBUILD THE TREE TO MAKE CURRENT "DEFAULT" PREFS TAKE EFFECT -tree->clear(); -tree->add("Aaa"); -tree->add("Bbb"); -tree->add("Ccc"); -tree->add("Ddd"); -tree->add("Bbb/child-01"); -tree->add("Bbb/child-01/111"); -tree->add("Bbb/child-01/222"); -tree->add("Bbb/child-01/333"); -tree->add("Bbb/child-02"); -tree->add("Bbb/child-03"); -tree->add("Bbb/child-04"); - -{ - static Fl_Button *but = 0; - // Assign an FLTK widget to one of the items - Fl_Tree_Item *i; - if ( ( i = tree->find_item("Bbb/child-03") ) != NULL ) { - if ( !but ) { // only do this once at program startup - tree->begin(); - but = new Fl_Button(1,1,140,1,"ccc button"); // we control w() only - but->labelsize(10); - but->callback(Button_CB); - } - i->widget(but); - tree->end(); - } -} -{ - // Assign an FLTK group to one of the items with widgets - Fl_Tree_Item *i; - if ( ( i = tree->find_item("Bbb/child-04") ) != NULL ) { - static Fl_Group *grp = 0; - if ( !grp ) { // only do this once at program startup - tree->begin(); - grp = new Fl_Group(100,100,140,18); // build group.. tree handles position - grp->color(FL_WHITE); - grp->begin(); - Fl_Button *abut = new Fl_Button(grp->x()+0 ,grp->y()+2,65,15,"D1"); - abut->labelsize(10); - abut->callback(Button_CB); - Fl_Button *bbut = new Fl_Button(grp->x()+75,grp->y()+2,65,15,"D2"); - bbut->labelsize(10); - bbut->callback(Button_CB); - grp->end(); - grp->resizable(grp); - tree->end(); - } - i->widget(grp); - } -} - -// Add an 'Ascending' node, and create it sorted -tree->sortorder(FL_TREE_SORT_NONE); -tree->add("Ascending")->close(); -tree->sortorder(FL_TREE_SORT_ASCENDING); -tree->add("Ascending/Zzz"); -tree->add("Ascending/Xxx"); -tree->add("Ascending/Aaa"); -tree->add("Ascending/Bbb"); -tree->add("Ascending/Yyy"); -tree->add("Ascending/Ccc"); - -// Add a 'Descending' node, and create it sorted -tree->sortorder(FL_TREE_SORT_NONE); -tree->add("Descending")->close(); -tree->sortorder(FL_TREE_SORT_DESCENDING); -tree->add("Descending/Zzz"); -tree->add("Descending/Xxx"); -tree->add("Descending/Aaa"); -tree->add("Descending/Bbb"); -tree->add("Descending/Yyy"); -tree->add("Descending/Ccc"); - -// Add 500 items in numerical order -tree->sortorder(FL_TREE_SORT_NONE); -for ( int t=0; t<500; t++ ) { - static char s[80]; - sprintf(s, "500 Items/item %04d", t); - tree->add(s); -} -tree->close("500 Items"); // close the 500 items by default - -tree->redraw();} {} -} - -Function {} {open -} { - Fl_Window window { - label tree open - xywh {1153 115 580 695} type Double visible - } { - Fl_Group tree { - user_data 1234 - callback {G_cb_counter++; // Increment callback counter whenever tree callback is invoked - -Fl_Tree_Item *item = tree->callback_item(); -if ( item ) { - fprintf(stderr, "TREE CALLBACK: label='%s' userdata=%ld reason=%s\\n", - item->label(), - (long)(fl_intptr_t)tree->user_data(), - reason_as_name(tree->callback_reason())); -} else { - fprintf(stderr, "TREE CALLBACK: reason=%s item=(no item -- probably multiple items were changed at once)\\n", - reason_as_name(tree->callback_reason())); -}} open - xywh {15 15 550 390} box DOWN_BOX color 55 - class Fl_Tree - } {} - Fl_Value_Slider margintop_slider { - label {margintop()} - user_data tree - callback {int val = (int)margintop_slider->value(); -tree->margintop(val); -tree->redraw();} - tooltip {Changes the top margin for the tree widget} xywh {190 414 240 16} type Horizontal labelsize 12 align 4 step 0.01 textsize 12 - code0 {o->value(tree->margintop());} - code1 {o->range(0.0, 100.0);} - code2 {o->step(1.0);} - code3 {o->color(46); o->selection_color(FL_RED);} - } - Fl_Value_Slider marginleft_slider { - label {marginleft()} - user_data tree - callback {int val = (int)marginleft_slider->value(); -tree->marginleft(val); -tree->redraw();} - tooltip {Changes the left margin for the tree widget} xywh {190 434 240 16} type Horizontal labelsize 12 align 4 step 0.01 textsize 12 - code0 {o->value(tree->marginleft());} - code1 {o->range(0.0, 100.0);} - code2 {o->step(1.0);} - code3 {o->color(46); o->selection_color(FL_RED);} - } - Fl_Value_Slider openchild_marginbottom_slider { - label {openchild_marginbottom()} - user_data tree - callback {int val = (int)openchild_marginbottom_slider->value(); -tree->openchild_marginbottom(val); -tree->redraw();} - tooltip {Changes the vertical space below an open child tree} xywh {190 454 240 16} type Horizontal labelsize 12 align 4 step 0.01 textsize 12 - code0 {o->value(tree->openchild_marginbottom());} - code1 {o->range(0.0, 100.0);} - code2 {o->step(1.0);} - code3 {o->color(46); o->selection_color(FL_RED);} - } - Fl_Value_Slider labelsize_slider { - label {Text size} - user_data tree - callback {int size = (int)labelsize_slider->value(); - -// DO SELECTED ITEMS -int count = 0; -for ( Fl_Tree_Item *item=tree->first(); item; item = tree->next(item) ) { - if ( item->is_selected() ) { - item->labelsize(size); - count++; - } -} - -// NO ITEMS SELECTED? DO ALL -if ( ! count ) { - for ( Fl_Tree_Item *item=tree->first(); item; item = tree->next(item) ) { - item->labelsize(size); - } -} - -tree->redraw();} - tooltip {Changes the font size of the selected items -If none selected, all are changed} xywh {190 474 240 16} type Horizontal labelsize 12 align 4 step 0.01 textsize 12 - code0 {o->value(tree->labelsize());} - code1 {o->range(5.0, 200.0);} - code2 {o->step(1.0);} - code3 {o->color(46); o->selection_color(FL_RED);} - } - Fl_Value_Slider connectorwidth_slider { - label {Connector width} - user_data tree - callback {tree->connectorwidth((int)connectorwidth_slider->value());} - tooltip {Tests Fl_Tree::connectorwidth()} xywh {190 494 240 16} type Horizontal labelsize 12 align 4 step 0.01 textsize 12 - code0 {o->value(tree->connectorwidth());} - code1 {o->range(1.0, 100.0);} - code2 {o->step(1.0);} - code3 {o->color(46); o->selection_color(FL_RED);} - } - Fl_Check_Button usericon_radio { - label {Enable user icons?} - user_data tree - callback {static const char *L_folder_xpm[] = { - "11 11 3 1", - ". c None", - "x c \#d8d833", - "@ c \#808011", - "...........", - ".....@@@@..", - "....@xxxx@.", - "@@@@@xxxx@@", - "@xxxxxxxxx@", - "@xxxxxxxxx@", - "@xxxxxxxxx@", - "@xxxxxxxxx@", - "@xxxxxxxxx@", - "@xxxxxxxxx@", - "@@@@@@@@@@@"}; -static Fl_Pixmap L_folderpixmap(L_folder_xpm); - -static const char *L_document_xpm[] = { - "11 11 3 1", - ". c None", - "x c \#d8d8f8", - "@ c \#202060", - ".@@@@@@@@@.", - ".@xxxxxxx@.", - ".@xxxxxxx@.", - ".@xxxxxxx@.", - ".@xxxxxxx@.", - ".@xxxxxxx@.", - ".@xxxxxxx@.", - ".@xxxxxxx@.", - ".@xxxxxxx@.", - ".@xxxxxxx@.", - ".@@@@@@@@@."}; -static Fl_Pixmap L_documentpixmap(L_document_xpm); - -Fl_Tree_Item *i = 0; -if ( usericon_radio->value() ) { - tree->usericon(&L_folderpixmap); - if ( ( i = tree->find_item("Bbb/bgb/111") ) != NULL ) i->usericon(&L_documentpixmap); - if ( ( i = tree->find_item("Bbb/bgb/222") ) != NULL ) i->usericon(&L_documentpixmap); - if ( ( i = tree->find_item("Bbb/bgb/333") ) != NULL ) i->usericon(&L_documentpixmap); -} else { - tree->usericon(0); - if ( ( i = tree->find_item("Bbb/bgb/111") ) != NULL ) i->usericon(0); - if ( ( i = tree->find_item("Bbb/bgb/222") ) != NULL ) i->usericon(0); - if ( ( i = tree->find_item("Bbb/bgb/333") ) != NULL ) i->usericon(0); -}} - tooltip {Tests Fl_Tree_Item::usericon()} xywh {90 525 130 16} down_box DOWN_BOX labelsize 11 - } - Fl_Check_Button showroot_radio { - label {Show root?} - user_data tree - callback {int onoff = showroot_radio->value(); -tree->showroot(onoff);} - tooltip {Tests Fl_Tree_Item::usericon()} xywh {90 542 130 16} down_box DOWN_BOX labelsize 11 - code0 {int onoff = tree->showroot(); showroot_radio->value(onoff);} - } - Fl_Check_Button visiblefocus_checkbox { - label {Visible focus?} - user_data tree - callback {int onoff = visiblefocus_checkbox->value(); -tree->visible_focus(onoff);} - tooltip {Toggles the tree's visible_focus() -This toggles the visible 'focus box'} xywh {90 559 130 16} down_box DOWN_BOX labelsize 11 - code0 {int onoff = tree->visible_focus(); visiblefocus_checkbox->value(onoff);} - } - Fl_Choice collapseicons_chooser { - label {Collapse icons} - callback {static const char *L_open_xpm[] = { -\#ifdef __APPLE__ - "11 11 3 1", - ". c \#fefefe", - "\# c \#444444", - "@ c \#000000", - "\#\#\#\#\#\#\#\#\#\#\#", - "\#.........\#", - "\#.........\#", - "\#....@....\#", - "\#....@....\#", - "\#..@@@@@..\#", - "\#....@....\#", - "\#....@....\#", - "\#.........\#", - "\#.........\#", - "\#\#\#\#\#\#\#\#\#\#\#" -\#else - "11 11 2 1", - ". c None", - "@ c \#000000", - "...@.......", - "...@@......", - "...@@@.....", - "...@@@@....", - "...@@@@@...", - "...@@@@@@..", - "...@@@@@...", - "...@@@@....", - "...@@@.....", - "...@@......", - "...@......." -\#endif - }; -static Fl_Pixmap L_openpixmap(L_open_xpm); - -static const char *L_close_xpm[] = { -\#ifdef __APPLE__ - "11 11 3 1", - ". c \#fefefe", - "\# c \#444444", - "@ c \#000000", - "\#\#\#\#\#\#\#\#\#\#\#", - "\#.........\#", - "\#.........\#", - "\#.........\#", - "\#.........\#", - "\#..@@@@@..\#", - "\#.........\#", - "\#.........\#", - "\#.........\#", - "\#.........\#", - "\#\#\#\#\#\#\#\#\#\#\#" -\#else - "11 11 2 1", - ". c None", - "@ c \#000000", - "...........", - "...........", - "...........", - "...........", - "...........", - "@@@@@@@@@@@", - ".@@@@@@@@@.", - "..@@@@@@@..", - "...@@@@@...", - "....@@@....", - ".....@....." -\#endif - }; -static Fl_Pixmap L_closepixmap(L_close_xpm); - -switch ( collapseicons_chooser->value() ) { - case 0: - tree->showcollapse(1); - tree->openicon(0); - tree->closeicon(0); - break; - case 1: - tree->showcollapse(1); - tree->openicon(&L_openpixmap); - tree->closeicon(&L_closepixmap); - break; - case 2: - tree->showcollapse(0); - break; -}} open - tooltip {Tests Fl_Tree::openicon() and Fl_Tree::closeicon()} xywh {115 589 110 16} down_box BORDER_BOX labelsize 11 textsize 11 - } { - MenuItem {} { - label Normal - xywh {0 0 36 21} labelsize 11 - } - MenuItem {} { - label Custom - xywh {10 10 36 21} labelsize 11 - } - MenuItem {} { - label Off - xywh {20 20 36 21} labelsize 11 - } - } - Fl_Choice connectorstyle_chooser { - label {Line style} - callback {// CHANGE COLLAPSESTYLE -switch ( connectorstyle_chooser->value() ) { - case 0: tree->connectorstyle(FL_TREE_CONNECTOR_NONE); break; - case 1: tree->connectorstyle(FL_TREE_CONNECTOR_DOTTED); break; - case 2: tree->connectorstyle(FL_TREE_CONNECTOR_SOLID); break; -}} open - tooltip {Tests connectorstyle() bit flags} xywh {115 609 110 16} down_box BORDER_BOX labelsize 11 textsize 11 - code0 {switch (tree->connectorstyle()) { case FL_TREE_CONNECTOR_NONE: connectorstyle_chooser->value(0); break; case FL_TREE_CONNECTOR_DOTTED: connectorstyle_chooser->value(1); break; case FL_TREE_CONNECTOR_SOLID: connectorstyle_chooser->value(2); break; }} - } { - MenuItem {} { - label None - xywh {30 30 36 21} labelsize 11 - } - MenuItem {} { - label Dotted - xywh {10 10 36 21} labelsize 11 - } - MenuItem {} { - label Solid - xywh {20 20 36 21} labelsize 11 - } - } - Fl_Choice labelcolor_chooser { - label {Item Text Color} - callback {// Set color.. -Fl_Color c = Fl_Color(0x00000000); -switch ( labelcolor_chooser->value() ) { - case 0: c = Fl_Color(0x00000000); break; // black - case 1: c = Fl_Color(0xd0000000); break; // red - case 2: c = Fl_Color(0x00a00000); break; // green - case 3: c = Fl_Color(0x0000a000); break; // blue - default: c = Fl_Color(0x00000000); break; // black -} - -// DO SELECTED ITEMS -int count = 0; - for ( Fl_Tree_Item *item=tree->first(); item; item = tree->next(item) ) { - if ( item->is_selected() ) { - item->labelcolor(c); - count++; - } -} - -// NO ITEMS SELECTED? DO ALL -if ( ! count ) { - for ( Fl_Tree_Item *item=tree->first(); item; item = tree->next(item) ) { - item->labelcolor(c); - } -} - -tree->redraw();} open - tooltip {Changes the label color for the selected items -If no items selected, all are changed} xywh {115 629 110 16} down_box BORDER_BOX labelsize 11 textsize 11 - } { - MenuItem {} { - label Black - xywh {20 20 36 21} labelsize 11 - } - MenuItem {} { - label Red - xywh {30 30 36 21} labelsize 11 - } - MenuItem {} { - label Green - xywh {40 40 36 21} labelsize 11 - } - MenuItem {} { - label Blue - xywh {50 50 36 21} labelsize 11 - } - } - Fl_Choice selectmode_chooser { - label {Selection Mode} - callback {// Set selection mode -switch ( selectmode_chooser->value() ) { - case 0: tree->selectmode(FL_TREE_SELECT_NONE); break; // None - case 1: tree->selectmode(FL_TREE_SELECT_SINGLE); break; // Single - case 2: tree->selectmode(FL_TREE_SELECT_MULTI); break; // Multi - default: tree->selectmode(FL_TREE_SELECT_SINGLE); break; // Single -}} - tooltip {Sets how Fl_Tree handles mouse selection of tree items} xywh {115 649 110 16} down_box BORDER_BOX labelsize 11 textsize 11 - code0 {selectmode_chooser->value(1);} - code1 {cb_selectmode_chooser(selectmode_chooser, (void*)0);} - } { - MenuItem {} { - label None - xywh {30 30 36 21} labelsize 11 - } - MenuItem {} { - label Single - xywh {40 40 36 21} labelsize 11 - } - MenuItem {} { - label Multi - xywh {50 50 36 21} labelsize 11 - } - } - Fl_Choice whenmode_chooser { - label When - callback {// Set when mode -switch ( whenmode_chooser->value() ) { - case 0: tree->when(FL_WHEN_RELEASE); break; - case 1: tree->when(FL_WHEN_CHANGED); break; - case 2: tree->when(FL_WHEN_NEVER); break; - default: tree->when(FL_WHEN_RELEASE); break; -}} open - tooltip {Sets when() the tree's callback is invoked} xywh {115 669 110 16} down_box BORDER_BOX labelsize 11 textsize 11 - code0 {whenmode_chooser->value(1);} - code1 {cb_whenmode_chooser(whenmode_chooser, (void*)0);} - } { - MenuItem {} { - label Changed - xywh {40 40 36 21} labelsize 11 - } - MenuItem {} { - label Released - xywh {50 50 36 21} labelsize 11 - } - MenuItem {} { - label Never - xywh {60 60 36 21} labelsize 11 - } - } - Fl_Box showitem_box { - label {show_item() -} - xywh {480 425 70 82} box GTK_DOWN_BOX color 47 labelsize 11 align 1 - } - Fl_Button {} { - label Show - callback {Fl_Tree_Item *item = tree->next_selected_item(); -tree->show_item(item);} selected - tooltip {Tests show_item() with no position specified. -Makes the selected item visible IF it is off-screen. -No change made if it is not off-screen.} xywh {495 434 40 17} labelsize 11 - } - Fl_Button {} { - label Top - callback {Fl_Tree_Item *item = tree->next_selected_item(); -tree->show_item_top(item);} - tooltip {Test show_item_top(). -Scrolls selected item to the top of the display -(only works if scrollbar showing) -To use: -1) open '500 items' -2) select item 0010 -3) Hit Top/Mid/Bot} xywh {495 451 40 16} labelsize 11 - } - Fl_Button {} { - label Mid - callback {Fl_Tree_Item *item = tree->next_selected_item(); -tree->show_item_middle(item);} - tooltip {Tests show_item_middle(). -Scrolls the selected item to the middle of the display -To use: - 1) open '500 items' - 2) select 'item 0010' - 3) Hit Top/Mid/Bot} xywh {495 467 40 16} labelsize 11 - } - Fl_Button {} { - label Bot - callback {Fl_Tree_Item *item = tree->next_selected_item(); -tree->show_item_bottom(item);} - tooltip {Tests show_item_bottom(). -Scrolls the selected item to the bottom of the display -To use: - 1) open '500 items' - 2) select 'item 0010' - 3) Hit Top/Mid/Bot} xywh {495 483 40 16} labelsize 11 - } - Fl_Box docallback_box { - label {Selection State Changes} - xywh {245 527 320 77} box GTK_DOWN_BOX color 47 labelsize 12 align 1 - } - Fl_Button selectall_button { - label {Select All} - callback {tree->select_all(0); -tree->redraw();} - tooltip {Selects all items in the tree} xywh {260 539 75 16} labelsize 9 - } - Fl_Button deselectall_button { - label {Deselect All} - callback {tree->deselect_all(0); -tree->redraw();} - tooltip {Deselects all items in the tree} xywh {260 559 75 16} labelsize 9 - } - Fl_Light_Button bbbselect_toggle { - label { Select Bbb} - callback {// Toggle select of just the Bbb item (not children) -Fl_Tree_Item *bbb = tree->find_item("/Bbb"); -if ( !bbb) { - fl_alert("FAIL: Couldn't find item '/Bbb'???"); - return; -} -int onoff = bbbselect_toggle->value(); -if ( onoff ) tree->select(bbb); // select /Bbb -else tree->deselect(bbb); // deselect /Bbb} - tooltip {Toggle selection of just the /Bbb item -(Not children)} xywh {350 540 95 15} selection_color 1 labelsize 9 - } - Fl_Light_Button bbbselect2_toggle { - label { Select Bbb+} - callback {// Toggle select of just the Bbb item and its immediate children -Fl_Tree_Item *bbb = tree->find_item("/Bbb"); -if ( !bbb) { - fl_alert("FAIL: Couldn't find item '/Bbb'???"); - return; -} -int onoff = bbbselect2_toggle->value(); -if ( onoff ) tree->select_all(bbb); // select /Bbb and its children -else tree->deselect_all(bbb); // deselect /Bbb and its children} - tooltip {Toggle selection of the /Bbb item and its children} xywh {350 560 95 15} selection_color 1 labelsize 9 - } - Fl_Light_Button bbbchild02select_toggle { - label { Toggle child-02} - callback {// Toggle select of just the /Bbb/child-02 item -int onoff = bbbchild02select_toggle->value(); -if ( onoff ) tree->select("/Bbb/child-02"); -else tree->deselect("/Bbb/child-02");} - tooltip {Toggle the single item /Bbb/child-02} xywh {350 579 95 16} selection_color 1 labelsize 9 - } - Fl_Light_Button rootselect_toggle { - label {Select ROOT} - callback {// Toggle select of ROOT item and its children -Fl_Tree_Item *item = tree->find_item("/ROOT"); -if ( !item) { - fl_alert("FAIL: Couldn't find item '/ROOT'???"); - return; -} -int onoff = rootselect_toggle->value(); -if ( onoff ) tree->select(item); // select /ROOT and its children -else tree->deselect(item); // deselect /ROOT and its children} - tooltip {Toggle selection of the ROOT item} xywh {460 540 90 15} selection_color 1 labelsize 9 - } - Fl_Light_Button rootselect2_toggle { - label {Select ROOT+} - callback {// Toggle select of ROOT item and its children -Fl_Tree_Item *item = tree->find_item("/ROOT"); -if ( !item) { - fl_alert("FAIL: Couldn't find item '/ROOT'???"); - return; -} -int onoff = rootselect2_toggle->value(); -if ( onoff ) tree->select_all(item); // select /ROOT and its children -else tree->deselect_all(item); // deselect /ROOT and its children} - tooltip {Toggle selection of the ROOT item and all children} xywh {460 560 90 15} selection_color 1 labelsize 9 - } - Fl_Light_Button deactivate_toggle { - label { Deactivate} - callback {int onoff = deactivate_toggle->value() ? 0 : 1; - -int count = 0; -for ( Fl_Tree_Item *item=tree->first(); item; item = tree->next(item) ) { - if ( item->is_selected() ) { - item->activate(onoff); - ++count; - } -} - -if ( count == 0 ) { - for ( Fl_Tree_Item *item=tree->first(); item; item = tree->next(item) ) { - item->activate(onoff); - } -} - -tree->redraw();} - tooltip {Toggle the deactivation state of the selected items. -If none are selected, all are set.} xywh {280 634 90 16} selection_color 1 labelsize 9 - } - Fl_Light_Button bold_toggle { - label { Bold Font} - callback {int face = bold_toggle->value() ? FL_HELVETICA_BOLD : FL_HELVETICA; - -// DO SELECTED ITEMS -int count = 0; -for ( Fl_Tree_Item *item=tree->first(); item; item = tree->next(item) ) { - if ( item->is_selected() ) { - item->labelfont(face); - count++; - } -} - -// NO ITEMS SELECTED? DO ALL -if ( ! count ) { - for ( Fl_Tree_Item *item=tree->first(); item; item = tree->next(item) ) { - item->labelfont(face); - } -} - -tree->redraw();} - tooltip {Toggles bold font for selected items -If nothing selected, all are changed} xywh {280 654 90 16} selection_color 1 labelsize 9 - } - Fl_Button loaddb_button { - label {Load Database...} - callback {const char *filename = fl_file_chooser("Select a Preferences style Database", "Preferences(*.prefs)", 0L); -if (filename) { - tree->clear(); - Fl_Preferences prefs(filename, 0L, 0L); - tree->load(prefs); - tree->redraw(); -}} - tooltip {Load the contents of an Fl_Preferences database into the tree view} xywh {380 614 90 16} labelsize 9 - } - Fl_Button insertabove_button { - label {Insert Above} - callback {Fl_Tree_Item *item=tree->first(); -while (item) { - if ( item->is_selected() ) { - tree->insert_above(item, "AaaAaa"); - tree->insert_above(item, "BbbBbb"); - tree->insert_above(item, "CccCcc"); - } - item = item->next(); -} - -tree->redraw();} - tooltip {Inserts three items above the selected items} xywh {380 634 90 16} labelsize 9 - } - Fl_Button rebuildtree_button { - label {Rebuild Tree} - callback {RebuildTree();} - tooltip {Rebuilds the tree with defaults} xywh {380 654 90 16} labelsize 9 - } - Fl_Button showpathname_button { - label {Show Pathname} - callback {Fl_Tree_Item *item = tree->first_selected_item(); -if ( !item ) { fl_message("No item was selected"); return; } - -char pathname[256]; -switch ( tree->item_pathname(pathname, sizeof(pathname), item) ) { - case 0: fl_message("Pathname for '%s' is: \\"%s\\"", (item->label() ? item->label() : "???"), pathname); break; - case -1: fl_message("item_pathname() returned -1 (NOT FOUND)"); break; - case -2: fl_message("item_pathname() returned -2 (STRING TOO LONG)"); break; -}} - tooltip {Show the pathname for the selected item. Tests the Fl_Tree::item_pathname() method.} xywh {380 674 90 16} labelsize 8 - } - Fl_Button showselected_button { - label {Show Selected} - callback {fprintf(stderr, "--- SELECTED ITEMS\\n"); -for ( Fl_Tree_Item *item = tree->first_selected_item(); - item; - item = tree->next_selected_item(item) ) { - fprintf(stderr, "\\t%s\\n", item->label() ? item->label() : "???"); -}} - tooltip {Clears the selected items} xywh {475 614 90 16} labelsize 9 - } - Fl_Button clearselected_button { - label {Remove Selected} - callback {Fl_Tree_Item *item=tree->first(); -while (item) { - if ( item->is_selected() ) { - if ( tree->remove(item) == -1 ) break; - item = tree->first(); - } else { - item = item->next(); - } -} - -tree->redraw();} - tooltip {Removes the selected items} xywh {475 634 90 16} labelsize 9 - } - Fl_Button clearall_button { - label {Clear All} - callback {tree->clear(); -tree->redraw();} - tooltip {Clears all items -Tests Fl_Tree::clear()} xywh {475 654 90 16} labelsize 9 - } - Fl_Button testcallbackflag_button { - label {Test Callback Flag} - callback {Fl_Tree_Item *root = tree->root(); -fprintf(stderr, "--- Checking docallback off\\n"); - -//// "OFF" TEST - -// open/close: Make sure these methods don't trigger cb -G_cb_counter = 0; tree->close(root, 0); if ( G_cb_counter ) fl_alert("FAILED 'OFF' TEST\\n close(item) triggered cb!"); -G_cb_counter = 0; tree->open(root, 0); if ( G_cb_counter ) fl_alert("FAILED 'OFF' TEST\\n open(item) triggered cb!"); -G_cb_counter = 0; tree->open_toggle(root, 0); if ( G_cb_counter ) fl_alert("FAILED 'OFF' TEST\\n open_toggle(item) triggered cb!"); -G_cb_counter = 0; tree->open("ROOT", 0); if ( G_cb_counter ) fl_alert("FAILED 'OFF' TEST\\n open(path) triggered cb!"); -G_cb_counter = 0; tree->close("ROOT", 0); if ( G_cb_counter ) fl_alert("FAILED 'OFF' TEST\\n close(path) triggered cb!"); -tree->open(root,0); // leave root open - -// select/deselect: Make sure these methods don't trigger cb -G_cb_counter = 0; tree->select(root, 0); if ( G_cb_counter ) fl_alert("FAILED 'OFF' TEST\\n select(item) triggered cb!"); -G_cb_counter = 0; tree->deselect(root, 0); if ( G_cb_counter ) fl_alert("FAILED 'OFF' TEST\\n deselect(item) triggered cb!"); -G_cb_counter = 0; tree->select_toggle(root, 0); if ( G_cb_counter ) fl_alert("FAILED 'OFF' TEST\\n select_toggle(item) triggered cb!"); -G_cb_counter = 0; tree->deselect("ROOT", 0); if ( G_cb_counter ) fl_alert("FAILED 'OFF' TEST\\n deselect(path) triggered cb!"); -G_cb_counter = 0; tree->select("ROOT", 0); if ( G_cb_counter ) fl_alert("FAILED 'OFF' TEST\\n select(path) triggered cb!"); -tree->deselect("ROOT"); // leave deselected - -//// "ON" TEST - -// open/close: Make sure these methods don't trigger cb -G_cb_counter = 0; tree->close(root, 1); if ( !G_cb_counter ) fl_alert("FAILED 'ON' TEST\\n close(item) cb wasn't triggered!"); -G_cb_counter = 0; tree->open(root, 1); if ( !G_cb_counter ) fl_alert("FAILED 'ON' TEST\\n open(item) cb wasn't triggered!"); -G_cb_counter = 0; tree->open_toggle(root, 1); if ( !G_cb_counter ) fl_alert("FAILED 'ON' TEST\\n open_toggle(item) cb wasn't triggered!"); -G_cb_counter = 0; tree->open(root, 1); if ( !G_cb_counter ) fl_alert("FAILED 'ON' TEST\\n open(item)[2] cb wasn't triggered!"); -G_cb_counter = 0; tree->close(root, 1); if ( !G_cb_counter ) fl_alert("FAILED 'ON' TEST\\n close(item)[2] cb wasn't triggered!"); -G_cb_counter = 0; tree->open("ROOT", 1); if ( !G_cb_counter ) fl_alert("FAILED 'ON' TEST\\n open(path) cb wasn't triggered!"); -G_cb_counter = 0; tree->close("ROOT", 1); if ( !G_cb_counter ) fl_alert("FAILED 'ON' TEST\\n close(path) cb wasn't triggered!"); -tree->open(root,0); // leave root open - -// select/deselect: Make sure these methods don't trigger cb -G_cb_counter = 0; tree->select(root, 1); if ( !G_cb_counter ) fl_alert("FAILED 'ON' TEST\\n select(item) cb wasn't triggered!"); -G_cb_counter = 0; tree->deselect(root, 1); if ( !G_cb_counter ) fl_alert("FAILED 'ON' TEST\\n deselect(item) cb wasn't triggered!"); -G_cb_counter = 0; tree->select_toggle(root, 1); if ( !G_cb_counter ) fl_alert("FAILED 'ON' TEST\\n select_toggle(item) cb wasn't triggered!"); -G_cb_counter = 0; tree->deselect("ROOT", 1); if ( !G_cb_counter ) fl_alert("FAILED 'ON' TEST\\n deselect(path) cb wasn't triggered!"); -G_cb_counter = 0; tree->select("ROOT", 1); if ( !G_cb_counter ) fl_alert("FAILED 'ON' TEST\\n select(path) cb wasn't triggered!"); -tree->deselect("ROOT"); // leave deselected - -//// "default" TEST (should be same as 'on' - -// open/close: Make sure these methods don't trigger cb -G_cb_counter = 0; tree->close(root); if ( !G_cb_counter ) fl_alert("FAILED 'DEFAULT' TEST: close(item) cb wasn't triggered!"); -G_cb_counter = 0; tree->open(root); if ( !G_cb_counter ) fl_alert("FAILED 'DEFAULT' TEST: open(item) cb wasn't triggered!"); -G_cb_counter = 0; tree->open_toggle(root); if ( !G_cb_counter ) fl_alert("FAILED 'DEFAULT' TEST: open_toggle(item) cb wasn't triggered!"); -G_cb_counter = 0; tree->open("ROOT"); if ( !G_cb_counter ) fl_alert("FAILED 'DEFAULT' TEST: open(path) cb wasn't triggered!"); -G_cb_counter = 0; tree->close("ROOT"); if ( !G_cb_counter ) fl_alert("FAILED 'DEFAULT' TEST: close(path) cb wasn't triggered!"); -tree->open(root,0); // leave root open - -// select/deselect: Make sure these methods don't trigger cb -G_cb_counter = 0; tree->select(root); if ( !G_cb_counter ) fl_alert("FAILED 'DEFAULT' TEST\\n select(item) cb wasn't triggered!"); -G_cb_counter = 0; tree->deselect(root); if ( !G_cb_counter ) fl_alert("FAILED 'DEFAULT' TEST\\n deselect(item) cb wasn't triggered!"); -G_cb_counter = 0; tree->select_toggle(root); if ( !G_cb_counter ) fl_alert("FAILED 'DEFAULT' TEST\\n select_toggle(item) cb wasn't triggered!"); -G_cb_counter = 0; tree->deselect("ROOT"); if ( !G_cb_counter ) fl_alert("FAILED 'DEFAULT' TEST\\n deselect(path) cb wasn't triggered!"); -G_cb_counter = 0; tree->select("ROOT"); if ( !G_cb_counter ) fl_alert("FAILED 'DEFAULT' TEST\\n select(path) cb wasn't triggered!"); -tree->deselect("ROOT"); // leave deselected - -fl_alert("TEST COMPLETED\\n If you didn't see any error dialogs, test PASSED.");} - tooltip {Test the 'docallback' argument can disable callbacks.} xywh {475 674 90 16} labelsize 8 - } - } - code {// Initialize Tree -tree->root_label("ROOT"); -RebuildTree(); -/*tree->show_self();*/} {} - code {// FLTK stuff - -//Fl::scheme("gtk+"); - -window->resizable(window); -window->size_range(window->w(), window->h(), 0, 0); - - if ( tree->when() == FL_WHEN_CHANGED ) whenmode_chooser->value(0); -else if ( tree->when() == FL_WHEN_RELEASE ) whenmode_chooser->value(1); -else if ( tree->when() == FL_WHEN_NEVER ) whenmode_chooser->value(2);} {} -} diff --git a/branch-3.0-2011/test/unittest_about.cxx b/branch-3.0-2011/test/unittest_about.cxx deleted file mode 100644 index 89125044f..000000000 --- a/branch-3.0-2011/test/unittest_about.cxx +++ /dev/null @@ -1,69 +0,0 @@ -// -// "$Id$" -// -// Unit tests for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2010 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_Help_View.H> - -// -//------- Introduction to FLTK drawing test ------- -// -class About : public Fl_Help_View { -public: - static Fl_Widget *create() { - return new About(TESTAREA_X, TESTAREA_Y, TESTAREA_W, TESTAREA_H); - } - About(int x, int y, int w, int h) : Fl_Help_View(x, y, w, h) { - value( -"<htmL><body><h2>About Unit Testing...</h2>\n" -"The Unit Testing application can be used to verify correct graphics rendering " -"on the current platform. The core developer team uses this program to make sure that the " -"FLTK user experience is identical on all supported graphics systems." -"<h3>the UI Designer</h3>\n" -"<p>Designing a good user interface is an art. Widgets must be selected and carefully positioned " -"to create a consistent look and feel for the user. Text must fit into given boxes and graphic " -"elements must be correctly aligned. A good UI library will give consistent results on any " -"supported platform and render all graphics in the way the UI designer intended.</p>\n" -"<p>FLTK supports a large collection of platforms and graphics drivers. This unit testing " -"application contains modules which will test rendering and alignment for most " -"FLTK core graphics functions.</p>\n" -"<h3>the Developer</h3>\n" -"<p>Unittest is also a great help when implementing new graphics drivers. The tests are sorted " -"in the same order in which a new graphics driver could be implemented. Most tests rely " -"on the previous test to function correctly, so sticking to the given order is a good idea.</p>\n" -"<h3>Conventions</h3>\n" -"<p>Two layers of graphics are drawn for most tests. The lower layer contains " -"red and green pixels. The upper layer contains black pixels. The test is rendered correctly " -"if all red pixels are covered, but none of the green pixels. The top graphics layer can be " -"switched on and off.</p>" -"</body></html>"); - } -}; - -UnitTest about("About...", About::create); - -// -// End of "$Id$". -// diff --git a/branch-3.0-2011/test/unittest_circles.cxx b/branch-3.0-2011/test/unittest_circles.cxx deleted file mode 100644 index 334120520..000000000 --- a/branch-3.0-2011/test/unittest_circles.cxx +++ /dev/null @@ -1,99 +0,0 @@ -// -// "$Id$" -// -// Unit tests for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2010 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_Box.H> -#include <FL/fl_draw.H> - -// -//------- test the circle drawing capabilities of this implementation ---------- -// -class CircleTest : public Fl_Box { -public: - static Fl_Widget *create() { - return new CircleTest(TESTAREA_X, TESTAREA_Y, TESTAREA_W, TESTAREA_H); - } - CircleTest(int x, int y, int w, int h) : Fl_Box(x, y, w, h) { - label("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 system supports anti-aliasing " - "which should be of no concern. " - "The green rectangles should not be overwritten by circle drawings."); - align(FL_ALIGN_INSIDE|FL_ALIGN_BOTTOM|FL_ALIGN_LEFT|FL_ALIGN_WRAP); - box(FL_BORDER_BOX); - } - void draw() { - Fl_Box::draw(); - int a = x()+10, b = y()+10; 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 +=120; b += 0; 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 += 120; b += 0; 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); - } -}; - -UnitTest circle("circles and arcs", CircleTest::create); - -// -// End of "$Id$" -// diff --git a/branch-3.0-2011/test/unittest_images.cxx b/branch-3.0-2011/test/unittest_images.cxx deleted file mode 100644 index 25dfdd2cf..000000000 --- a/branch-3.0-2011/test/unittest_images.cxx +++ /dev/null @@ -1,129 +0,0 @@ -// -// "$Id$" -// -// Unit tests for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2010 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_Box.H> -#include <FL/fl_draw.H> - -// Note: currently (March 2010) fl_draw_image() supports transparency with -// alpha channel only on Apple (Mac OS X), but Fl_RGB_Image->draw() -// supports transparency on all platforms ! - -// -//------- test the image drawing capabilities of this implementation ---------- -// -class ImageTest : public Fl_Box { -public: - static Fl_Widget *create() { - int x, y; - uchar *dg, *dga, *drgb, *drgba; - dg = img_gray = (uchar*)malloc(128*128*1); - dga = img_gray_a = (uchar*)malloc(128*128*2); - drgb = img_rgb = (uchar*)malloc(128*128*3); - drgba = img_rgba = (uchar*)malloc(128*128*4); - for (y=0; y<128; y++) { - for (x=0; x<128; x++) { - *drgba++ = *drgb++ = *dga++ = *dg++ = y<<1; - *drgba++ = *drgb++ = x<<1; - *drgba++ = *drgb++ = (127-x)<<1; - *drgba++ = *dga++ = x+y; - } - } - i_rgba = new Fl_RGB_Image (img_rgba,128,128,4); - i_ga = new Fl_RGB_Image (img_gray_a,128,128,2); - return new ImageTest(TESTAREA_X, TESTAREA_Y, TESTAREA_W, TESTAREA_H); - } - static uchar *img_gray; - static uchar *img_gray_a; - static uchar *img_rgb; - static uchar *img_rgba; - static Fl_RGB_Image *i_rgba; - static Fl_RGB_Image *i_ga; - ImageTest(int x, int y, int w, int h) : Fl_Box(x, y, w, h) { - label("Testing Image Drawing\n\n" - "This test renders four images, two of them with a checker board\n" - "visible through the graphics. Color and gray gradients should be\n" - "visible. This does not test any image formats such as JPEG."); - align(FL_ALIGN_INSIDE|FL_ALIGN_BOTTOM|FL_ALIGN_LEFT|FL_ALIGN_WRAP); - box(FL_BORDER_BOX); - } - void draw() { - Fl_Box::draw(); - - // top left: RGB - - int xx = x()+10, yy = y()+10; - fl_color(FL_BLACK); fl_rect(xx, yy, 130, 130); - fl_draw_image(img_rgb, xx+1, yy+1, 128, 128, 3); - fl_draw("RGB", xx+134, yy+64); - - // bottom left: RGBA - - xx = x()+10; yy = y()+10+134; - fl_color(FL_BLACK); fl_rectf(xx, yy, 130, 130); - fl_color(FL_WHITE); fl_rectf(xx+1, yy+1, 64, 64); - fl_color(FL_WHITE); fl_rectf(xx+65, yy+65, 64, 64); -#ifdef __APPLE__ - fl_draw_image(img_rgba, xx+1, yy+1, 128, 128, 4); // Apple: okay w/alpha -#else - i_rgba->draw(xx+1,yy+1); // only Fl_RGB_Image->draw() works with alpha -#endif - fl_color(FL_BLACK); fl_draw("RGBA", xx+134, yy+64); - - // top right: Gray - - xx = x()+10+200; yy = y()+10; - fl_color(FL_BLACK); fl_rect(xx, yy, 130, 130); - fl_draw_image(img_gray, xx+1, yy+1, 128, 128, 1); - fl_draw("Gray", xx+134, yy+64); - - // bottom right: Gray+Alpha - - xx = x()+10+200; yy = y()+10+134; - fl_color(FL_BLACK); fl_rectf(xx, yy, 130, 130); - fl_color(FL_WHITE); fl_rectf(xx+1, yy+1, 64, 64); - fl_color(FL_WHITE); fl_rectf(xx+65, yy+65, 64, 64); -#ifdef __APPLE__ - fl_draw_image(img_gray_a, xx+1, yy+1, 128, 128, 2); // Apple: okay w/alpha -#else - i_ga->draw(xx+1,yy+1); // only Fl_RGB_Image->draw() works with alpha -#endif - fl_color(FL_BLACK); fl_draw("Gray+Alpha", xx+134, yy+64); - } -}; - -uchar *ImageTest::img_gray = 0; -uchar *ImageTest::img_gray_a = 0; -uchar *ImageTest::img_rgb = 0; -uchar *ImageTest::img_rgba = 0; -Fl_RGB_Image *ImageTest::i_rgba = 0; -Fl_RGB_Image *ImageTest::i_ga = 0; - -UnitTest images("drawing images", ImageTest::create); - -// -// End of "$Id$" -// diff --git a/branch-3.0-2011/test/unittest_lines.cxx b/branch-3.0-2011/test/unittest_lines.cxx deleted file mode 100644 index 8158b1f89..000000000 --- a/branch-3.0-2011/test/unittest_lines.cxx +++ /dev/null @@ -1,75 +0,0 @@ -// -// "$Id$" -// -// Unit tests for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2010 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_Box.H> -#include <FL/fl_draw.H> - -// -//------- test the line drawing capabilities of this implementation ---------- -// -class LineTest : public Fl_Box { -public: - static Fl_Widget *create() { - return new LineTest(TESTAREA_X, TESTAREA_Y, TESTAREA_W, TESTAREA_H); - } - LineTest(int x, int y, int w, int h) : Fl_Box(x, y, w, h) { - label("testing the integer based fl_line calls\n" - "No red pixels should be visible.\n" - "If you see bright red pixels, the line drawing alignment is off,\n" - "or the last pixel in a line does not get drawn.\n" - "If you see dark red pixels, anti-aliasing must be switched off."); - align(FL_ALIGN_INSIDE|FL_ALIGN_BOTTOM|FL_ALIGN_LEFT|FL_ALIGN_WRAP); - box(FL_BORDER_BOX); - } - void draw() { - Fl_Box::draw(); - int a = x()+10, b = y()+10; fl_color(FL_BLACK); fl_rect(a, b, 100, 100); - // 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); - } -}; - -UnitTest lines("drawing lines", LineTest::create); - -// -// End of "$Id$" -// diff --git a/branch-3.0-2011/test/unittest_points.cxx b/branch-3.0-2011/test/unittest_points.cxx deleted file mode 100644 index d74f60741..000000000 --- a/branch-3.0-2011/test/unittest_points.cxx +++ /dev/null @@ -1,69 +0,0 @@ -// -// "$Id$: -// -// Unit tests for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2010 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_Box.H> -#include <FL/fl_draw.H> - -// -//------- test the point drawing capabilities of this implementation ---------- -// -class PointTest : public Fl_Box { -public: - static Fl_Widget *create() { - return new PointTest(TESTAREA_X, TESTAREA_Y, TESTAREA_W, TESTAREA_H); - } - PointTest(int x, int y, int w, int h) : Fl_Box(x, y, w, h) { - label("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 (blurred across multiple pixels)!"); - align(FL_ALIGN_INSIDE|FL_ALIGN_BOTTOM|FL_ALIGN_LEFT|FL_ALIGN_WRAP); - box(FL_BORDER_BOX); - } - void draw() { - Fl_Box::draw(); - int a = x()+10, b = y()+10; - fl_color(FL_WHITE); fl_rectf(a, b, 90, 90); - fl_color(FL_BLACK); fl_rect(a, b, 90, 90); - 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()+10; 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); - } -}; - -UnitTest points("drawing points", PointTest::create); - -// -// End of "$Id$" -// diff --git a/branch-3.0-2011/test/unittest_rects.cxx b/branch-3.0-2011/test/unittest_rects.cxx deleted file mode 100644 index 2ac5a5680..000000000 --- a/branch-3.0-2011/test/unittest_rects.cxx +++ /dev/null @@ -1,66 +0,0 @@ -// -// "$Id$" -// -// Unit tests for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2010 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_Box.H> -#include <FL/fl_draw.H> // fl_text_extents() - -// -//------- test the rectangle drawing capabilities of this implementation ---------- -// -class RectTest : public Fl_Box { -public: - static Fl_Widget *create() { - return new RectTest(TESTAREA_X, TESTAREA_Y, TESTAREA_W, TESTAREA_H); - } - RectTest(int x, int y, int w, int h) : Fl_Box(x, y, w, h) { - label("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."); - align(FL_ALIGN_INSIDE|FL_ALIGN_BOTTOM|FL_ALIGN_LEFT|FL_ALIGN_WRAP); - box(FL_BORDER_BOX); - } - void draw() { - Fl_Box::draw(); - int a = x()+10, b = y()+10; fl_color(FL_BLACK); fl_rect(a, b, 100, 100); - // 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); - } -}; - -UnitTest rects("rectangles", RectTest::create); - -// -// End of "$Id$" -// diff --git a/branch-3.0-2011/test/unittest_scrollbarsize.cxx b/branch-3.0-2011/test/unittest_scrollbarsize.cxx deleted file mode 100644 index 9a26a5960..000000000 --- a/branch-3.0-2011/test/unittest_scrollbarsize.cxx +++ /dev/null @@ -1,165 +0,0 @@ -// -// "$Id$" -// -// Unit tests for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2010 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_Group.H> -#include <FL/Fl_Browser.H> -#include <FL/Fl_Tree.H> -#include <FL/Fl_Value_Slider.H> - -// -// Test new 1.3.x global vs. local scrollbar sizing -// -class ScrollBarSizeTest : public Fl_Group { - Fl_Browser *brow_a, *brow_b, *brow_c; - Fl_Tree *tree_a, *tree_b, *tree_c; - - Fl_Browser *makebrowser(int X,int Y,int W,int H,const char*L=0) { - Fl_Browser *b = new Fl_Browser(X,Y,W,H,L); - b->type(FL_MULTI_BROWSER); - b->align(FL_ALIGN_TOP); - b->add("Papa"); b->add("Delta"); b->add("Hotel"); - b->add("Long entry will show h-bar"); - b->add("Charlie"); b->add("Echo"); b->add("Foxtrot"); - b->add("Golf"); b->add("Lima"); b->add("Victor"); - b->add("Alpha"); b->add("Xray"); b->add("Yankee"); - b->add("Oscar"); b->add("India"); b->add("Juliet"); - b->add("Kilo"); b->add("Mike"); b->add("Sierra"); - b->add("November"); b->add("Tango"); b->add("Quebec"); - b->add("Bravo"); b->add("Romeo"); b->add("Uniform"); - b->add("Whisky"); b->add("Zulu"); - b->add("Papa"); b->add("Delta"); b->add("Hotel"); - b->add("Charlie"); b->add("Echo"); b->add("Foxtrot"); - b->add("Golf"); b->add("Lima"); b->add("Victor"); - b->add("Alpha"); b->add("Xray"); b->add("Yankee"); - b->add("Oscar"); b->add("India"); b->add("Juliet"); - b->add("Kilo"); b->add("Mike"); b->add("Sierra"); - b->add("November"); b->add("Tango"); b->add("Quebec"); - b->add("Bravo"); b->add("Romeo"); b->add("Uniform"); - b->add("Whisky"); b->add("Zulu"); - return(b); - } - Fl_Tree *maketree(int X,int Y,int W,int H,const char*L=0) { - Fl_Tree *b = new Fl_Tree(X,Y,W,H,L); - b->type(FL_TREE_SELECT_MULTI); - b->align(FL_ALIGN_TOP); - b->add("Papa"); b->add("Delta"); b->add("Hotel"); - b->add("Long entry will show h-bar"); - b->add("Charlie"); b->add("Echo"); b->add("Foxtrot"); - b->add("Golf"); b->add("Lima"); b->add("Victor"); - b->add("Alpha"); b->add("Xray"); b->add("Yankee"); - b->add("Oscar"); b->add("India"); b->add("Juliet"); - b->add("Kilo"); b->add("Mike"); b->add("Sierra"); - b->add("November"); b->add("Tango"); b->add("Quebec"); - b->add("Bravo"); b->add("Romeo"); b->add("Uniform"); - b->add("Whisky"); b->add("Zulu"); - return(b); - } - void slide_cb2(Fl_Value_Slider *in) { - const char *label = in->label(); - int val = int(in->value()); - //fprintf(stderr, "VAL='%d'\n",val); - if ( strcmp(label,"A: Scroll Size") == 0 ) { - brow_a->scrollbar_size(val); - tree_a->scrollbar_size(val); - } else { - Fl::scrollbar_size(val); - } - in->window()->redraw(); - } - static void slide_cb(Fl_Widget *w, void *data) { - ScrollBarSizeTest *o = (ScrollBarSizeTest*)data; - o->slide_cb2((Fl_Value_Slider*)w); - } -public: - static Fl_Widget *create() { - return(new ScrollBarSizeTest(TESTAREA_X, TESTAREA_Y, TESTAREA_W, TESTAREA_H)); - } - - // CTOR - ScrollBarSizeTest(int X, int Y, int W, int H) : Fl_Group(X,Y,W,H) { - begin(); - // _____________ _______________ - // |_____________| |_______________| - // --- ----- <-- tgrpy - // brow_a brow_b brow_c | 14 | - // ---------- ---------- ---------- --- | <-- browy - // | | | | | | | | - // | | | | | | |browh | - // | | | | | | | | - // ---------- ---------- ---------- --- tgrph - // | | - // tree_a tree_b tree_c | 20 | - // ---------- ---------- ---------- --- | <-- treey - // | | | | | | | | - // | | | | | | |treeh | - // | | | | | | | | - // ---------- ---------- ---------- --- ------ - // - int tgrpy = Y+30; - int tgrph = H-130; - int browy = tgrpy+14; - int browh = tgrph/2 - 20; - int treey = browy + browh + 20; - int treeh = browh; - brow_a = makebrowser(X+ 10,browy,100,browh,"Browser A"); - brow_b = makebrowser(X+120,browy,100,browh,"Browser B"); - brow_c = makebrowser(X+240,browy,100,browh,"Browser C"); - tree_a = maketree(X+ 10,treey,100,treeh,"Tree A"); - tree_b = maketree(X+120,treey,100,treeh,"Tree B"); - tree_c = maketree(X+240,treey,100,treeh,"Tree C"); - Fl_Value_Slider *slide_glob = new Fl_Value_Slider(X+100,Y,100,18,"Global Scroll Size"); - slide_glob->value(16); - slide_glob->type(FL_HORIZONTAL); - slide_glob->align(FL_ALIGN_LEFT); - slide_glob->range(0.0, 30.0); - slide_glob->step(1.0); - slide_glob->callback(slide_cb, (void*)this); - slide_glob->labelsize(12); - Fl_Value_Slider *slide_browa = new Fl_Value_Slider(X+350,Y,100,18,"A: Scroll Size"); - slide_browa->value(16); - slide_browa->type(FL_HORIZONTAL); - slide_browa->align(FL_ALIGN_LEFT); - slide_browa->range(0.0, 30.0); - slide_browa->step(1.0); - slide_browa->callback(slide_cb, (void*)this); - slide_browa->labelsize(12); - end(); - label("Verify global scroll sizing and per-widget scroll sizing.\n" - "Scrollbar's size should change interactively as size sliders are changed.\n" - "Changing 'Global Scroll Size' should affect all three browser's scrollbars UNLESS\n" - "the 'A: Scroll Size' slider is changed, in which case its value will take precedence\n" - "for 'Browser A', and the global size will only affect Browser B and C."); - labelsize(12); - align(FL_ALIGN_INSIDE|FL_ALIGN_BOTTOM|FL_ALIGN_LEFT|FL_ALIGN_WRAP); - } -}; - -UnitTest scrollbarsize("scrollbar size", ScrollBarSizeTest::create); - -// -// End of "$Id$" -// diff --git a/branch-3.0-2011/test/unittest_text.cxx b/branch-3.0-2011/test/unittest_text.cxx deleted file mode 100644 index a638eb556..000000000 --- a/branch-3.0-2011/test/unittest_text.cxx +++ /dev/null @@ -1,97 +0,0 @@ -// -// "$Id$" -// -// Unit tests for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2010 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_Box.H> -#include <FL/fl_draw.H> - -// -// --- fl_text_extents() tests ----------------------------------------------- -// -class TextExtentsTest : public Fl_Widget -{ - void DrawTextAndBoxes(const char *txt, int X, int Y) { - int wo = 0, ho = 0; - int dx, dy; - // First, we draw the bounding boxes (fl_measure and fl_text_extents) - // draw fl_measure() typographical bounding box - fl_measure(txt, wo, ho, 0); - int desc = fl_descent(); - fl_color(FL_RED); - fl_rect(X, Y-ho+desc, wo, ho); - // draw fl_text_extents() glyph bounding box - fl_text_extents(txt, dx, dy, wo, ho); - fl_color(FL_GREEN); - fl_rect(X+dx, Y+dy, wo, ho); - // Then we draw the text to show how it fits insode each of the two boxes - fl_color(FL_BLACK); - fl_draw(txt, X, Y); - } -public: - static Fl_Widget *create() { - return new TextExtentsTest(TESTAREA_X, TESTAREA_Y, TESTAREA_W, TESTAREA_H); - } - TextExtentsTest(int x, int y, int w, int h) : Fl_Widget(x, y, w, h) {} - void draw(void) { - int x0 = x(); // origin is current window position for Fl_Box - int y0 = y(); - int w0 = w(); - int h0 = h(); - fl_push_clip(x0, y0, w0, h0); // reset local clipping - { - // set the background colour - slightly off-white to enhance the green bounding box - fl_color(fl_gray_ramp(FL_NUM_GRAY - 3)); - fl_rectf(x0, y0, w0, h0); - - fl_font(FL_HELVETICA, 30); - int xx = x0+55; - int yy = y0+40; - DrawTextAndBoxes("!abcdeABCDE\"#A", xx, yy); yy += 50; // mixed string - DrawTextAndBoxes("oacs", xx, yy); xx += 100; // small glyphs - DrawTextAndBoxes("qjgIPT", xx, yy); yy += 50; xx -= 100; // glyphs with descenders - DrawTextAndBoxes("````````", xx, yy); yy += 50; // high small glyphs - DrawTextAndBoxes("--------", xx, yy); yy += 50; // mid small glyphs - DrawTextAndBoxes("________", xx, yy); yy += 50; // low small glyphs - - fl_font(FL_HELVETICA, 14); - fl_color(FL_RED); fl_draw("fl_measure bounding box in RED", xx, yy); yy += 20; - fl_color(FL_GREEN); fl_draw("fl_text_extents bounding box in GREEN", xx, yy); - fl_color(FL_BLACK); - xx = x0 + 10; yy += 30; - fl_draw("NOTE: On systems with text anti-aliasing (e.g. OSX Quartz)", xx, yy); - w0 = h0 = 0; fl_measure("NOTE: ", w0, h0, 0); - xx += w0; yy += h0; - fl_draw("text may leak slightly outside the fl_text_extents()", xx, yy); - } - fl_pop_clip(); // remove the local clip - } -}; - -UnitTest textExtents("rendering text", TextExtentsTest::create); - -// -// End of "$Id$" -// diff --git a/branch-3.0-2011/test/unittest_viewport.cxx b/branch-3.0-2011/test/unittest_viewport.cxx deleted file mode 100644 index 4a23e70bd..000000000 --- a/branch-3.0-2011/test/unittest_viewport.cxx +++ /dev/null @@ -1,64 +0,0 @@ -// -// "$Id$" -// -// Unit tests for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2010 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_Box.H> -#include <FL/fl_draw.H> - -// -//------- test viewport clipping ---------- -// -class ViewportTest : public Fl_Box { -public: - static Fl_Widget *create() { - return new ViewportTest(TESTAREA_X, TESTAREA_Y, TESTAREA_W, TESTAREA_H); - } - ViewportTest(int x, int y, int w, int h) : Fl_Box(x, y, w, h) { - label("Testing Viewport Alignment\n\n" - "Only green lines should be visible.\n" - "If red lines are visible in the corners of this window,\n" - "your viewport alignment and clipping is off.\n" - "If there is a space between the green lines and the window border,\n" - "the viewport is off, but some clipping may be working.\n" - "Also, your window size may be off to begin with."); - align(FL_ALIGN_INSIDE|FL_ALIGN_CENTER|FL_ALIGN_WRAP); - box(FL_BORDER_BOX); - } - void show() { - Fl_Box::show(); - mainwin->testAlignment(1); - } - void hide() { - Fl_Box::hide(); - mainwin->testAlignment(0); - } -}; - -UnitTest viewport("viewport test", ViewportTest::create); - -// -// End of "$Id$ -// diff --git a/branch-3.0-2011/test/unittests.cxx b/branch-3.0-2011/test/unittests.cxx deleted file mode 100644 index 85c2414e8..000000000 --- a/branch-3.0-2011/test/unittests.cxx +++ /dev/null @@ -1,208 +0,0 @@ -// -// "$Id$" -// -// Unit tests for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2010 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 -// -// Fltk unit tests -// v0.1 - Greg combines Matthias + Ian's tests -// v0.2 - Ian's 02/12/09 fixes applied -// v0.3 - Fixes to circle desc, augmented extent tests, fixed indents, added show(argc,argv) -// v1.0 - Submit for svn -// v1.1 - Matthias seperated all tests into multiple source files for hopefully easier handling - -#include <FL/Fl.H> -#include <FL/Fl_Double_Window.H> -#include <FL/Fl_Hold_Browser.H> -#include <FL/Fl_Help_View.H> -#include <FL/Fl_Group.H> -#include <FL/Fl_Box.H> -#include <FL/fl_draw.H> // fl_text_extents() - -// WINDOW/WIDGET SIZES -#define MAINWIN_W 700 // main window w() -#define MAINWIN_H 400 // main window h() -#define BROWSER_X 10 // browser x() -#define BROWSER_Y 25 // browser y() -#define BROWSER_W 150 // browser w() -#define BROWSER_H MAINWIN_H-35 // browser h() -#define TESTAREA_X (BROWSER_W + 20) // test area x() -#define TESTAREA_Y 25 // test area y() -#define TESTAREA_W (MAINWIN_W - BROWSER_W - 30) // test area w() -#define TESTAREA_H BROWSER_H // test area h() - -typedef void (*UnitTestCallback)(const char*,Fl_Group*); - -class MainWindow *mainwin = 0; -Fl_Hold_Browser *browser = 0; - -// This class helps to automagically register a new test with the unittest app. -// Please see the examples on how this is used. -class UnitTest { -public: - UnitTest(const char *label, Fl_Widget* (*create)()) : - fWidget(0L) - { - fLabel = strdup(label); - fCreate = create; - add(this); - } - ~UnitTest() { - delete fWidget; - free(fLabel); - } - const char *label() { - return fLabel; - } - void create() { - fWidget = fCreate(); - if (fWidget) fWidget->hide(); - } - void show() { - if (fWidget) fWidget->show(); - } - void hide() { - if (fWidget) fWidget->hide(); - } - static int numTest() { return nTest; } - static UnitTest *test(int i) { return fTest[i]; } -private: - char *fLabel; - Fl_Widget *(*fCreate)(); - Fl_Widget *fWidget; - - static void add(UnitTest *t) { - fTest[nTest] = t; - nTest++; - } - static int nTest; - static UnitTest *fTest[200]; -}; - -int UnitTest::nTest = 0; -UnitTest *UnitTest::fTest[]; - - -// The main window needs an additional drawing feature in order to support -// the viewport alignment test. -class MainWindow : public Fl_Double_Window { -public: - MainWindow(int w, int h, const char *l=0L) : - Fl_Double_Window(w, h, l), - fTestAlignment(0) - { } - // this code is used by the viewport alignment test - void drawAlignmentIndicators() { - const int sze = 16; - // top left corner - fl_color(FL_GREEN); fl_yxline(0, sze, 0, sze); - fl_color(FL_RED); fl_yxline(-1, sze, -1, sze); - fl_color(FL_WHITE); fl_rectf(3, 3, sze-2, sze-2); - fl_color(FL_BLACK); fl_rect(3, 3, sze-2, sze-2); - // bottom left corner - fl_color(FL_GREEN); fl_yxline(0, h()-sze-1, h()-1, sze); - fl_color(FL_RED); fl_yxline(-1, h()-sze-1, h(), sze); - fl_color(FL_WHITE); fl_rectf(3, h()-sze-1, sze-2, sze-2); - fl_color(FL_BLACK); fl_rect(3, h()-sze-1, sze-2, sze-2); - // bottom right corner - fl_color(FL_GREEN); fl_yxline(w()-1, h()-sze-1, h()-1, w()-sze-1); - fl_color(FL_RED); fl_yxline(w(), h()-sze-1, h(), w()-sze-1); - fl_color(FL_WHITE); fl_rectf(w()-sze-1, h()-sze-1, sze-2, sze-2); - fl_color(FL_BLACK); fl_rect(w()-sze-1, h()-sze-1, sze-2, sze-2); - // top right corner - fl_color(FL_GREEN); fl_yxline(w()-1, sze, 0, w()-sze-1); - fl_color(FL_RED); fl_yxline(w(), sze, -1, w()-sze-1); - fl_color(FL_WHITE); fl_rectf(w()-sze-1, 3, sze-2, sze-2); - fl_color(FL_BLACK); fl_rect(w()-sze-1, 3, sze-2, sze-2); - } - void draw() { - Fl_Double_Window::draw(); - if (fTestAlignment) { - drawAlignmentIndicators(); - } - } - void testAlignment(int v) { - fTestAlignment = v; - redraw(); - } - int fTestAlignment; -}; - -//------- include the various unit tests as inline code ------- - -#include "unittest_about.cxx" -#include "unittest_points.cxx" -#include "unittest_lines.cxx" -#include "unittest_rects.cxx" -#include "unittest_circles.cxx" -#include "unittest_text.cxx" -#include "unittest_images.cxx" -#include "unittest_viewport.cxx" -#include "unittest_scrollbarsize.cxx" - - -// callback whenever the browser value changes -void Browser_CB(Fl_Widget*, void*) { - for ( int t=1; t<=browser->size(); t++ ) { - UnitTest *ti = (UnitTest*)browser->data(t); - if ( browser->selected(t) ) { - ti->show(); - } else { - ti->hide(); - } - } -} - - -// this is the main call. It creates the window and adds all previously -// registered tests to the browser widget. -int main(int argc, char **argv) { - Fl::args(argc,argv); - Fl::visual(FL_RGB); - mainwin = new MainWindow(MAINWIN_W, MAINWIN_H, "Fltk Unit Tests"); - browser = new Fl_Hold_Browser(BROWSER_X, BROWSER_Y, BROWSER_W, BROWSER_H, "Unit Tests"); - browser->align(FL_ALIGN_TOP|FL_ALIGN_LEFT); - browser->when(FL_WHEN_CHANGED); - browser->callback(Browser_CB); - - int i, n = UnitTest::numTest(); - for (i=0; i<n; i++) { - UnitTest *t = UnitTest::test(i); - mainwin->begin(); - t->create(); - mainwin->end(); - browser->add(t->label(), (void*)t); - } - - ///// - mainwin->resizable(mainwin); - mainwin->show(argc,argv); - // Select first test in browser, and show that test. - browser->select(1); - Browser_CB(browser,0); - return(Fl::run()); -} - -// -// End of "$Id$". -// diff --git a/branch-3.0-2011/test/utf8.cxx b/branch-3.0-2011/test/utf8.cxx deleted file mode 100644 index b5ba56fab..000000000 --- a/branch-3.0-2011/test/utf8.cxx +++ /dev/null @@ -1,718 +0,0 @@ -// -// "$Id$" -// -// UTF-8 test program for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2010 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_Choice.H> -#include <FL/Fl_Input.H> -#include <FL/Fl_Box.H> -#include <FL/Fl_Tile.H> -#include <FL/Fl_Hold_Browser.H> -#include <FL/Fl_Value_Output.H> -#include <FL/Fl_Button.H> -#include <FL/Fl_Check_Button.H> -#include <FL/Fl_Output.H> -#include <FL/fl_draw.H> -#include <FL/fl_utf8.h> - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <math.h> - -// -// Font chooser widget for the Fast Light Tool Kit(FLTK). -// - - -#define DEF_SIZE 16 // default value for the font size picker - - -static Fl_Double_Window *fnt_chooser_win; -static Fl_Hold_Browser *fontobj; -static Fl_Hold_Browser *sizeobj; - -static Fl_Value_Output *fnt_cnt; -static Fl_Button *refresh_btn; -static Fl_Button *choose_btn; -static Fl_Output *fix_prop; -static Fl_Check_Button *own_face; - -static int **sizes = NULL; -static int *numsizes = NULL; -static int pickedsize = DEF_SIZE; -static char label[1000]; - -static Fl_Double_Window *main_win; -static Fl_Scroll *thescroll; -static Fl_Font extra_font; - -static int font_count = 0; -static int first_free = 0; - - -/* - Class for displaying sample fonts. - */ -class FontDisplay : public Fl_Widget -{ - void draw(void); - -public: - int font, size; - - int test_fixed_pitch(void); - - 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 = DEF_SIZE; - } -}; - - -/* - Draw the sample text. - */ -void FontDisplay::draw(void) -{ - draw_box(); - fl_font((Fl_Font)font, size); - fl_color(FL_BLACK); - fl_draw(label(), x() + 3, y() + 3, w() - 6, h() - 6, align()); -} - - -int FontDisplay::test_fixed_pitch(void) -{ - int w1, w2; - int h1, h2; - - w1 = w2 = 0; - h1 = h2 = 0; - - fl_font((Fl_Font)font, size); - - fl_measure("MHMHWWMHMHMHM###WWX__--HUW", w1, h1, 0); - fl_measure("iiiiiiiiiiiiiiiiiiiiiiiiii", w2, h2, 0); - - if (w1 == w2) return 1; // exact match - fixed pitch - - // Is the font "nearly" fixed pitch? If it is within 5%, say it is... - double f1 = (double)w1; - double f2 = (double)w2; - double delta = fabs(f1 - f2) * 5.0; - if (delta <= f1) return 2; // nearly fixed pitch... - - return 0; // NOT fixed pitch -} - - -static FontDisplay *textobj; - - -static void size_cb(Fl_Widget *, long) -{ - int size_idx = sizeobj->value(); - - if (!size_idx) return; - - const char *c = sizeobj->text(size_idx); - - while (*c < '0' || *c > '9') c++; // find the first numeric char - pickedsize = atoi(c); // convert the number string to a value - - // Now set the font view to the selected size and redraw it. - textobj->size = pickedsize; - textobj->redraw(); -} - - -static void font_cb(Fl_Widget *, long) -{ - int font_idx = fontobj->value() + first_free; - - if (!font_idx) return; - font_idx--; - - textobj->font = font_idx; - sizeobj->clear(); - - int size_count = numsizes[font_idx-first_free]; - int *size_array = sizes[font_idx-first_free]; - if (!size_count) - { - // no preferred sizes - probably TT fonts etc... - } - else if (size_array[0] == 0) - { - // many sizes, probably a scaleable font with preferred sizes - int j = 1; - for (int i = 1; i <= 64 || i < size_array[size_count - 1]; i++) - { - char buf[16]; - if (j < size_count && i == size_array[j]) - { - sprintf(buf, "@b%d", i); - j++; - } - else - sprintf(buf, "%d", i); - sizeobj->add(buf); - } - sizeobj->value(pickedsize); - } - else - { - // some sizes, probably a font with a few fixed sizes available - int w = 0; - for (int i = 0; i < size_count; i++) - { - // find the nearest available size to the current picked size - if (size_array[i] <= pickedsize) w = i; - - char buf[16]; - sprintf(buf, "@b%d", size_array[i]); - sizeobj->add(buf); - } - sizeobj->value(w + 1); - } - size_cb(sizeobj, 0); // force selection of nearest valid size, then redraw - - // Now check to see if the font looks like a fixed pitch font or not... - int looks_fixed = textobj->test_fixed_pitch(); - if(looks_fixed) - { - if (looks_fixed > 1) - fix_prop->value("near"); - else - fix_prop->value("fixed"); - } - else - { - fix_prop->value("prop"); - } -} - - -static void choose_cb(Fl_Widget *, long) -{ - int font_idx = fontobj->value() + first_free; - if (!font_idx) - { - puts("No font chosen"); - } - else - { - int font_type; - font_idx -= 1; - const char *name = Fl::get_font_name((Fl_Font)font_idx, &font_type); - printf("idx %d\nUser name :%s:\n", font_idx, name); - printf("FLTK name :%s:\n", Fl::get_font((Fl_Font)font_idx)); - - Fl::set_font(extra_font, (Fl_Font)font_idx); - // Fl::set_font(extra_font, Fl::get_font((Fl_Font)font_idx)); - } - - int size_idx = sizeobj->value(); - if (!size_idx) - { - puts("No size selected"); - } - else - { - const char *c = sizeobj->text(size_idx); - while (*c < '0' || *c > '9') c++; // find the first numeric char - int pickedsize = atoi(c); // convert the number string to a value - - printf("size %d\n\n", pickedsize); - } - - fflush(stdout); - main_win->redraw(); -} - - -static void refresh_cb(Fl_Widget *, long) -{ - main_win->redraw(); -} - - -static void own_face_cb(Fl_Widget *, void *) -{ - int font_idx; - int cursor_restore = 0; - static int i_was = -1; // used to keep track of where we were in the list... - - if (i_was < 0) { // not been here before - i_was = 1; - } else { - i_was = fontobj->topline(); // record which was the topmost visible line - fontobj->clear(); - // Populating the font widget can be slower than an old dog with three legs - // on a bad day, show a wait cursor - fnt_chooser_win->cursor(FL_CURSOR_WAIT); - cursor_restore = 1; - } - - - // Populate the font list with the names of the fonts found - for (font_idx = first_free; font_idx < font_count; font_idx++) - { - int font_type; - const char *name = Fl::get_font_name((Fl_Font)font_idx, &font_type); - char buffer[128]; - - if(own_face->value() == 0) { - char *p = buffer; - // if the font is BOLD, set the bold attribute in the list - if (font_type & FL_BOLD) { - *p++ = '@'; - *p++ = 'b'; - } - if (font_type & FL_ITALIC) { // ditto for italic fonts - *p++ = '@'; - *p++ = 'i'; - } - // Suppress subsequent formatting - some MS fonts have '@' in their name - *p++ = '@'; - *p++ = '.'; - strcpy(p, name); - } else { - // Show font in its own face - // this is neat, but really slow on some systems: - // uses each font to display its own name - sprintf (buffer, "@F%d@.%s", font_idx, name); - } - fontobj->add(buffer); - } - // now put the browser position back the way it was... more or less - fontobj->topline(i_was); - // restore the cursor - if(cursor_restore) fnt_chooser_win->cursor(FL_CURSOR_DEFAULT); -} - - -static void create_font_widget() -{ - // Create the font sample label - strcpy(label, "Font Sample\n"); - int i = 12; // strlen(label); - int n = 0; - ulong 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 < 0x600; c += 9) { - if (!(++n&(0x1f))) label[i++]='\n'; - i += fl_utf8encode((unsigned int)c, label + i); - } - label[i] = 0; - - // Create the window layout - fnt_chooser_win = new Fl_Double_Window(380, 420, "Font Selector"); - { - Fl_Tile *tile = new Fl_Tile(0, 0, 380, 420); - { - Fl_Group *textgroup = new Fl_Group(0, 0, 380, 105); - { - - textobj = new FontDisplay(FL_FRAME_BOX, 10, 10, 360, 90, label); - textobj->align(FL_ALIGN_TOP|FL_ALIGN_LEFT|FL_ALIGN_INSIDE|FL_ALIGN_CLIP); - textobj->color(53, 3); - - textgroup->box(FL_FLAT_BOX); - textgroup->resizable(textobj); - textgroup->end(); - } - Fl_Group *fontgroup = new Fl_Group(0, 105, 380, 315); - { - fontobj = new Fl_Hold_Browser(10, 110, 290, 270); - fontobj->box(FL_FRAME_BOX); - fontobj->color(53, 3); - fontobj->callback(font_cb); - fnt_chooser_win->resizable(fontobj); - - sizeobj = new Fl_Hold_Browser(310, 110, 60, 270); - sizeobj->box(FL_FRAME_BOX); - sizeobj->color(53, 3); - sizeobj->callback(size_cb); - - // Create the status bar - Fl_Group *stat_bar = new Fl_Group (10, 385, 380, 30); - { - fnt_cnt = new Fl_Value_Output(10, 390, 40, 20); - fnt_cnt->label("fonts"); - fnt_cnt->align(FL_ALIGN_RIGHT); - - fix_prop = new Fl_Output(100, 390, 40, 20); - fix_prop->color(FL_BACKGROUND_COLOR); - fix_prop->value("prop"); - fix_prop->clear_visible_focus(); - - own_face = new Fl_Check_Button(150, 390, 40, 20, "Self"); - own_face->value(0); - own_face->type(FL_TOGGLE_BUTTON); - own_face->clear_visible_focus(); - own_face->callback(own_face_cb); - own_face->tooltip("Display font names in their own face"); - - Fl_Box * dummy = new Fl_Box(220, 390, 1, 1); - - choose_btn = new Fl_Button(240, 385, 60, 30); - choose_btn->label("Select"); - choose_btn->callback(choose_cb); - - refresh_btn = new Fl_Button(310, 385, 60, 30); - refresh_btn->label("Refresh"); - refresh_btn->callback(refresh_cb); - - stat_bar->resizable (dummy); - stat_bar->end(); - } - - fontgroup->box(FL_FLAT_BOX); - fontgroup->resizable(fontobj); - fontgroup->end(); - } - tile->end(); - } - fnt_chooser_win->resizable(tile); - fnt_chooser_win->end(); - } -} - - -int make_font_chooser(void) -{ - int font_idx; - - // create the widget frame - create_font_widget(); - - // Load the systems available fonts - ask for everything - // font_count = Fl::set_fonts("*"); -#ifdef WIN32 - font_count = Fl::set_fonts("*"); -#elif __APPLE__ - font_count = Fl::set_fonts("*"); -#else - // Load the systems available fonts - ask for everything that claims to be - // iso10646 compatible - font_count = Fl::set_fonts("-*-*-*-*-*-*-*-*-*-*-*-*-iso10646-1"); -#endif - - // allocate space for the sizes and numsizes array, now we know how many - // entries it needs - sizes = new int*[font_count]; - numsizes = new int[font_count]; - - // Populate the font list with the names of the fonts found - first_free = FL_FREE_FONT; - for (font_idx = first_free; font_idx < font_count; font_idx++) - { - // Find out how many sizes are supported for each font face - int *size_array; - int size_count = Fl::get_font_sizes((Fl_Font)font_idx, size_array); - numsizes[font_idx-first_free] = size_count; - // if the font has multiple sizes, populate the 2-D sizes array - if (size_count) - { - sizes[font_idx-first_free] = new int[size_count]; - for (int j = 0; j < size_count; j++) - sizes[font_idx-first_free][j] = size_array[j]; - } - } // end of font list filling loop - - // Call this once to get the font browser loaded up - own_face_cb(NULL, 0); - - fontobj->value(1); - // optional hard-coded font for testing - do not use! - // fontobj->textfont(261); - - font_cb(fontobj, 0); - - fnt_cnt->value(font_count); - - return font_count; - -} // make_font_chooser - -/* End of Font Chooser Widget code */ - - - -/* Unicode Font display widget */ - -void box_cb(Fl_Widget* o, void*) { - thescroll->box(((Fl_Button*)o)->value() ? FL_DOWN_FRAME : FL_NO_BOX); - thescroll->redraw(); -} - - -class right_left_input : public Fl_Input -{ -public: - right_left_input (int x, int y, int w, int h) : Fl_Input(x, y, w, h) {}; - void draw() { - if (type() == FL_HIDDEN_INPUT) return; - Fl_Boxtype b = box(); - if (damage() & FL_DAMAGE_ALL) draw_box(b, color()); - drawtext(x()+Fl::box_dx(b)+3, y()+Fl::box_dy(b), - w()-Fl::box_dw(b)-6, h()-Fl::box_dh(b)); - } - void drawtext(int X, int Y, int W, int H) { - fl_color(textcolor()); - fl_font(textfont(), textsize()); - fl_rtl_draw(value(), strlen(value()), - X + W, Y + fl_height() -fl_descent()); - } -}; - - -void i7_cb(Fl_Widget *w, void *d) -{ - int i = 0; - char nb[] = "01234567"; - Fl_Input *i7 = (Fl_Input*)w; - Fl_Input *i8 = (Fl_Input*)d; - static char buf[1024]; - const char *ptr = i7->value(); - while (ptr && *ptr) { - if (*ptr < ' ' || *ptr > 126) { - buf[i++] = '\\'; - buf[i++] = nb[((*ptr >> 6) & 0x3)]; - buf[i++] = nb[((*ptr >> 3) & 0x7)]; - buf[i++] = nb[(*ptr & 0x7)]; - } else { - if (*ptr == '\\') buf[i++] = '\\'; - buf[i++] = *ptr; - } - ptr++; - } - buf[i] = 0; - i8->value(buf); -} - - -class UCharDropBox : public Fl_Output { -public: - UCharDropBox(int x, int y, int w, int h, const char *label=0) : - Fl_Output(x, y, w, h, label) { } - int handle(int event) { - switch (event) { - case FL_DND_ENTER: return 1; - case FL_DND_DRAG: return 1; - case FL_DND_RELEASE: return 1; - case FL_PASTE: - { - static const char lut[] = "0123456789abcdef"; - const char *t = Fl::event_text(); - int i, n; - unsigned int ucode = fl_utf8decode(t, t+Fl::event_length(), &n); - if (n==0) { - value(""); - return 1; - } - char buffer[200], *d = buffer; - for (i=0; i<n; i++) *d++ = t[i]; - *d++ = ' '; - for (i=0; i<n; i++) { - *d++ = '\\'; *d++ = 'x'; - *d++ = lut[(t[i]>>4)&0x0f]; *d++ = lut[t[i]&0x0f]; - } - *d++ = ' '; - *d++ = '0'; - *d++ = 'x'; - *d++ = lut[(ucode>>20)&0x0f]; *d++ = lut[(ucode>>16)&0x0f]; - *d++ = lut[(ucode>>12)&0x0f]; *d++ = lut[(ucode>>8)&0x0f]; - *d++ = lut[(ucode>>4)&0x0f]; *d++ = lut[ucode&0x0f]; - *d++ = 0; - value(buffer); - } - return 1; - } - return Fl_Output::handle(event); - } -}; - - -int main(int argc, char** argv) -{ - int l; - const char *latin1 = - "\x41\x42\x43\x61\x62\x63\xe0\xe8\xe9\xef\xe2\xee\xf6\xfc\xe3\x31\x32\x33"; - char *utf8 = (char*) malloc(strlen(latin1) * 5 + 1); - l = 0; - // l = fl_latin12utf((const unsigned char*)latin1, strlen(latin1), utf8); - l = fl_utf8froma(utf8, (strlen(latin1) * 5 + 1), latin1, strlen(latin1)); - - make_font_chooser(); - extra_font = FL_TIMES_BOLD_ITALIC; - - /* setup the extra font */ - Fl::set_font(extra_font, -#ifdef WIN32 - " Arial Unicode MS" -#elif __APPLE__ - "Monaco" -#else - "-*-*-*-*-*-*-*-*-*-*-*-*-iso10646-1" -#endif - ); - - main_win = new Fl_Double_Window (200 + 5*75, 400, "Unicode Display Test"); - main_win->begin(); - - Fl_Input i1(5, 5, 190, 25); - utf8[l] = '\0'; - i1.value(utf8); - Fl_Scroll scroll(200,0,5 * 75,400); - - int off = 2; - if (argc > 1) { - off = (int)strtoul(argv[1], NULL, 0); - off /= 16; - } - argc = 1; - for (long y=off; y< 0x10000 / 16; y++) { - int o = 0; - char bu[25]; - char buf[16*6]; - int i = 16 * y; - for (int x=0; x<16; x++) { - int l; - l = fl_utf8encode(i, buf + o); - if (l < 1) l = 1; - o += l; - i++; - } - buf[o] = '\0'; - sprintf(bu, "0x%04lX", y * 16); - Fl_Input* b = new Fl_Input(200,(y-off)*25,60,25); - b->value(strdup(bu)); - b = new Fl_Input(260,(y-off)*25,400,25); - b->textfont(extra_font); - b->value(strdup(buf)); - } - main_win->resizable(scroll); - scroll.end(); - - thescroll = &scroll; - - char *utf8l = (char*) malloc(strlen(utf8) * 3 + 1); - Fl_Input i2(5, 35, 190, 25); - l = fl_utf_tolower((const unsigned char*)utf8, l, utf8l); - utf8l[l] = '\0'; - i2.value(utf8l); - - char *utf8u = (char*) malloc(strlen(utf8l) * 3 + 1); - Fl_Input i3(5, 65, 190, 25); - l = fl_utf_toupper((const unsigned char*)utf8l, l, utf8u); - utf8u[l] = '\0'; - i3.value(utf8u); - - const char *ltr_txt = "\\->e\xCC\x82=\xC3\xAA"; - Fl_Input i4(5, 90, 190, 25); - i4.value(ltr_txt); - i4.textfont(extra_font); - - wchar_t r_to_l_txt[] = {/*8238,*/ - 1610, 1608, 1606, 1604, 1603, 1608, 1583, 0}; - - char abuf[40]; - // l = fl_unicode2utf(r_to_l_txt, 8, abuf); - l = fl_utf8fromwc(abuf, 40, r_to_l_txt, 8); - abuf[l] = 0; - - right_left_input i5(5, 115, 190, 50); - i5.textfont(extra_font); - i5.textsize(30); - i5.value(abuf); - - Fl_Input i7(5, 230, 190, 25); - Fl_Input i8(5, 260, 190, 25); - i7.callback(i7_cb, &i8); - i7.textsize(20); - i7.value(abuf); - i7.when(FL_WHEN_CHANGED); - - wchar_t r_to_l_txt1[] = { /*8238,*/ - 1610, 0x20, 1608, 0x20, 1606, 0x20, - 1604, 0x20, 1603, 0x20, 1608, 0x20, 1583, 0}; - - // l = fl_unicode2utf(r_to_l_txt1, 14, abuf); - l = fl_utf8fromwc(abuf, 40, r_to_l_txt1, 14); - abuf[l] = 0; - right_left_input i6(5, 175, 190, 50); - i6.textfont(extra_font); - i6.textsize(30); - i6.value(abuf); - - // Now try Greg Ercolano's Japanese test sequence - // SOME JAPANESE UTF-8 TEXT - const char *utfstr = - "\xe4\xbd\x95\xe3\x82\x82\xe8\xa1" - "\x8c\xe3\x82\x8b\xe3\x80\x82"; - - UCharDropBox db(5, 300, 190, 30); - db.textsize(16); - db.value("unichar drop box"); - - Fl_Output o9(5, 330, 190, 45); - o9.textfont(extra_font); - o9.textsize(30); - o9.value(utfstr); - - - main_win->end(); - fl_set_status(0, 370, 100, 30); - - main_win->show(argc,argv); - - fnt_chooser_win->show(); - - int ret = Fl::run(); - - // Free up the sizes arrays we allocated - if(numsizes) {delete [] numsizes;} - if(sizes) {delete [] sizes;} - - return ret; -} - -// -// End of "$Id$". -// diff --git a/branch-3.0-2011/test/valuators.fl b/branch-3.0-2011/test/valuators.fl deleted file mode 100644 index 668a462f6..000000000 --- a/branch-3.0-2011/test/valuators.fl +++ /dev/null @@ -1,198 +0,0 @@ -# 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 - } - } -} |
