Browse Source

Bring FLTK 1.3.0 into GIT.

tags/v1.3.1000
Jonathan Moore Liles 10 years ago
commit
912ae82e72
100 changed files with 18026 additions and 0 deletions
  1. +2
    -0
      ANNOUNCEMENT
  2. +3638
    -0
      CHANGES
  3. +49
    -0
      CMake/FLTKConfig.cmake.in
  4. +8
    -0
      CMake/UseFLTK.cmake.in
  5. +19
    -0
      CMake/cmake_uninstall.cmake.in
  6. +17
    -0
      CMake/install-symlinks.cmake.in
  7. +10
    -0
      CMake/posixScandir.cxx
  8. +691
    -0
      CMakeLists.txt
  9. +530
    -0
      COPYING
  10. +62
    -0
      CREDITS
  11. +38
    -0
      DartConfig.cmake
  12. +959
    -0
      FL/Enumerations.H
  13. +1174
    -0
      FL/Fl.H
  14. +82
    -0
      FL/Fl_Adjuster.H
  15. +50
    -0
      FL/Fl_BMP_Image.H
  16. +85
    -0
      FL/Fl_Bitmap.H
  17. +69
    -0
      FL/Fl_Box.H
  18. +324
    -0
      FL/Fl_Browser.H
  19. +378
    -0
      FL/Fl_Browser_.H
  20. +180
    -0
      FL/Fl_Button.H
  21. +97
    -0
      FL/Fl_Cairo.H
  22. +92
    -0
      FL/Fl_Cairo_Window.H
  23. +160
    -0
      FL/Fl_Chart.H
  24. +122
    -0
      FL/Fl_Check_Browser.H
  25. +60
    -0
      FL/Fl_Check_Button.H
  26. +108
    -0
      FL/Fl_Choice.H
  27. +137
    -0
      FL/Fl_Clock.H
  28. +199
    -0
      FL/Fl_Color_Chooser.H
  29. +124
    -0
      FL/Fl_Counter.H
  30. +558
    -0
      FL/Fl_Device.H
  31. +97
    -0
      FL/Fl_Dial.H
  32. +81
    -0
      FL/Fl_Double_Window.H
  33. +49
    -0
      FL/Fl_Export.H
  34. +120
    -0
      FL/Fl_File_Browser.H
  35. +247
    -0
      FL/Fl_File_Chooser.H
  36. +168
    -0
      FL/Fl_File_Icon.H
  37. +106
    -0
      FL/Fl_File_Input.H
  38. +48
    -0
      FL/Fl_Fill_Dial.H
  39. +47
    -0
      FL/Fl_Fill_Slider.H
  40. +62
    -0
      FL/Fl_Float_Input.H
  41. +56
    -0
      FL/Fl_FormsBitmap.H
  42. +63
    -0
      FL/Fl_FormsPixmap.H
  43. +89
    -0
      FL/Fl_Free.H
  44. +51
    -0
      FL/Fl_GIF_Image.H
  45. +240
    -0
      FL/Fl_Gl_Window.H
  46. +230
    -0
      FL/Fl_Group.H
  47. +95
    -0
      FL/Fl_Help_Dialog.H
  48. +396
    -0
      FL/Fl_Help_View.H
  49. +65
    -0
      FL/Fl_Hold_Browser.H
  50. +46
    -0
      FL/Fl_Hor_Fill_Slider.H
  51. +46
    -0
      FL/Fl_Hor_Nice_Slider.H
  52. +60
    -0
      FL/Fl_Hor_Slider.H
  53. +46
    -0
      FL/Fl_Hor_Value_Slider.H
  54. +215
    -0
      FL/Fl_Image.H
  55. +277
    -0
      FL/Fl_Input.H
  56. +497
    -0
      FL/Fl_Input_.H
  57. +222
    -0
      FL/Fl_Input_Choice.H
  58. +61
    -0
      FL/Fl_Int_Input.H
  59. +53
    -0
      FL/Fl_JPEG_Image.H
  60. +59
    -0
      FL/Fl_Light_Button.H
  61. +46
    -0
      FL/Fl_Line_Dial.H
  62. +33
    -0
      FL/Fl_Menu.H
  63. +168
    -0
      FL/Fl_Menu_.H
  64. +89
    -0
      FL/Fl_Menu_Bar.H
  65. +86
    -0
      FL/Fl_Menu_Button.H
  66. +443
    -0
      FL/Fl_Menu_Item.H
  67. +68
    -0
      FL/Fl_Menu_Window.H
  68. +66
    -0
      FL/Fl_Multi_Browser.H
  69. +47
    -0
      FL/Fl_Multi_Label.H
  70. +75
    -0
      FL/Fl_Multiline_Input.H
  71. +70
    -0
      FL/Fl_Multiline_Output.H
  72. +305
    -0
      FL/Fl_Native_File_Chooser.H
  73. +46
    -0
      FL/Fl_Nice_Slider.H
  74. +36
    -0
      FL/Fl_Object.H
  75. +77
    -0
      FL/Fl_Output.H
  76. +79
    -0
      FL/Fl_Overlay_Window.H
  77. +55
    -0
      FL/Fl_PNG_Image.H
  78. +52
    -0
      FL/Fl_PNM_Image.H
  79. +84
    -0
      FL/Fl_Pack.H
  80. +153
    -0
      FL/Fl_Paged_Device.H
  81. +99
    -0
      FL/Fl_Pixmap.H
  82. +104
    -0
      FL/Fl_Plugin.H
  83. +103
    -0
      FL/Fl_Positioner.H
  84. +253
    -0
      FL/Fl_PostScript.H
  85. +276
    -0
      FL/Fl_Preferences.H
  86. +214
    -0
      FL/Fl_Printer.H
  87. +81
    -0
      FL/Fl_Progress.H
  88. +35
    -0
      FL/Fl_RGB_Image.H
  89. +46
    -0
      FL/Fl_Radio_Button.H
  90. +46
    -0
      FL/Fl_Radio_Light_Button.H
  91. +46
    -0
      FL/Fl_Radio_Round_Button.H
  92. +63
    -0
      FL/Fl_Repeat_Button.H
  93. +60
    -0
      FL/Fl_Return_Button.H
  94. +56
    -0
      FL/Fl_Roller.H
  95. +57
    -0
      FL/Fl_Round_Button.H
  96. +48
    -0
      FL/Fl_Round_Clock.H
  97. +199
    -0
      FL/Fl_Scroll.H
  98. +120
    -0
      FL/Fl_Scrollbar.H
  99. +64
    -0
      FL/Fl_Secret_Input.H
  100. +64
    -0
      FL/Fl_Select_Browser.H

+ 2
- 0
ANNOUNCEMENT View File

@@ -0,0 +1,2 @@
The initial FLTK 1.3 is based on the final 1.1.8.


+ 3638
- 0
CHANGES
File diff suppressed because it is too large
View File


+ 49
- 0
CMake/FLTKConfig.cmake.in View File

@@ -0,0 +1,49 @@
#
# FLTKConfig.cmake - FLTK CMake configuration file for external projects.
#
# This file is configured by FLTK and used by the UseFLTK.cmake module
# to load FLTK's settings for an external project.

set(FLTK_FOUND TRUE)
set(FLTK_VERSION @FLTK_VERSION_FULL@)

set(FLTK_FLUID_EXECUTABLE "@FLTK_FLUID_PATH@")

if(NOT "@EXE_LINKER_FLAGS@" STREQUAL "")
set(FLTK_EXE_LINKER_FLAGS "@EXE_LINKER_FLAGS@")
endif(NOT "@EXE_LINKER_FLAGS@" STREQUAL "")

set(FLTK_USE_FILE "@PREFIX_CONFIG@/UseFLTK.cmake")

set(FLTK_DIR "@PREFIX_CONFIG@")

set(FLTK_BIN_DIR "@PREFIX_BIN@")
set(FLTK_LIB_DIR "@PREFIX_LIB@")
set(FLTK_INCLUDE_DIR "@PREFIX_INCLUDE@")
set(FLTK_DATA_DIR "@PREFIX_DATA@")
set(FLTK_DOC_DIR "@PREFIX_DOC@")

set(FLTK_SHARED_LIBS_FOUND @OPTION_BUILD_SHARED_LIBS@)
set(FLTK_CAIRO_FOUND @FLTK_CAIRO_FOUND@)
set(FLTK_GL_FOUND @FLTK_GL_FOUND@)
set(FLTK_THREADS_FOUND @FLTK_THREADS_FOUND@)
set(FLTK_PTHREADS_FOUND @FLTK_PTHREADS_FOUND@)
set(FLTK_BUILTIN_JPEG_FOUND @FLTK_BUILTIN_JPEG_FOUND@)
set(FLTK_BUILTIN_ZLIB_FOUND @FLTK_BUILTIN_ZLIB_FOUND@)
set(FLTK_BUILTIN_PNG_FOUND @FLTK_BUILTIN_PNG_FOUND@)
set(FLTK_XINERAMA_FOUND @FLTK_XINERAMA_FOUND@)
set(FLTK_XFT_FOUND @FLTK_XFT_FOUND@)
set(FLTK_XDBE_FOUND @FLTK_XDBE_FOUND@)

set(FLTK_CAIRO_FOUND @FLTK_CAIRO_FOUND@)
set(FLTK_GL_FOUND @FLTK_GL_FOUND@)
set(FLTK_THREADS_FOUND @FLTK_THREADS_FOUND@)
set(FLTK_PTHREADS_FOUND @FLTK_PTHREADS_FOUND@)
set(FLTK_BUILTIN_JPEG_FOUND @FLTK_BUILTIN_JPEG_FOUND@)
set(FLTK_BUILTIN_ZLIB_FOUND @FLTK_BUILTIN_ZLIB_FOUND@)
set(FLTK_BUILTIN_PNG_FOUND @FLTK_BUILTIN_PNG_FOUND@)
set(FLTK_XINERAMA_FOUND @FLTK_XINERAMA_FOUND@)
set(FLTK_XFT_FOUND @FLTK_XFT_FOUND@)
set(FLTK_XDBE_FOUND @FLTK_XDBE_FOUND@)

include("@PREFIX_CONFIG@/FLTKLibraries.cmake")

+ 8
- 0
CMake/UseFLTK.cmake.in View File

@@ -0,0 +1,8 @@
#
# automatically generated - do not edit

include_directories("@PREFIX_INCLUDE@")

if(FLTK_EXE_LINKER_FLAGS)
list(APPEND CMAKE_EXE_LINKER_FLAGS "${FLTK_EXE_LINKER_FLAGS}")
endif(FLTK_EXE_LINKER_FLAGS)

+ 19
- 0
CMake/cmake_uninstall.cmake.in View File

@@ -0,0 +1,19 @@
if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
message(FATAL_ERROR
"Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")

file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
string(REGEX REPLACE "\n" ";" files "${files}")

foreach(file ${files})
message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
exec_program("@CMAKE_COMMAND@"
ARGS "-E remove -f \"$ENV{DESTDIR}${file}\""
OUTPUT_VARIABLE rm_out
RETURN_VALUE rm_retval
)
if(NOT "${rm_retval}" STREQUAL 0)
message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
endif(NOT "${rm_retval}" STREQUAL 0)
endforeach(file)

+ 17
- 0
CMake/install-symlinks.cmake.in View File

@@ -0,0 +1,17 @@

# On unix create backward compatibility symlinks
if(NOT EXISTS @PREFIX_INCLUDE@/Fl)
EXECUTE_PROCESS(COMMAND ln -s FL Fl
WORKING_DIRECTORY @PREFIX_INCLUDE@
)
endif(NOT EXISTS @PREFIX_INCLUDE@/Fl)

file(GLOB FLTK_HEADER_FILES @PREFIX_INCLUDE@/FL/*.H)
foreach(file ${FLTK_HEADER_FILES})
GET_FILENAME_COMPONENT(nameWE ${file} NAME_WE)
if(NOT EXISTS @PREFIX_INCLUDE@/FL/${nameWE}.h)
EXECUTE_PROCESS(COMMAND ln -s ${nameWE}.H ${nameWE}.h
WORKING_DIRECTORY @PREFIX_INCLUDE@/FL
)
endif()
endforeach(file)

+ 10
- 0
CMake/posixScandir.cxx View File

@@ -0,0 +1,10 @@

#include <dirent.h>

int func (const char *d, dirent ***list, void *sort) {
int n = scandir(d, list, 0, (int(*)(const dirent **, const dirent **))sort);
}

int main() {
return 0;
}

+ 691
- 0
CMakeLists.txt View File

@@ -0,0 +1,691 @@
#
# "$Id: CMakeLists.txt 8198 2011-01-06 10:24:58Z manolo $"
#
# Main CMakeLists.txt to build the FLTK project using CMake (www.cmake.org)
# Written by Andy Cedilnik and Julien Jomier
#
# 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
#

#######################################################################
# basic setup
#######################################################################
project(FLTK)
cmake_minimum_required(VERSION 2.6)

# The FLTK version
set(FLTK_VERSION_MAJOR "1")
set(FLTK_VERSION_MINOR "3")
set(FLTK_VERSION_PATCH "0")
set(FLTK_VERSION "${FLTK_VERSION_MAJOR}.${FLTK_VERSION_MINOR}")
set(FLTK_VERSION_FULL "${FLTK_VERSION}.${FLTK_VERSION_PATCH}")

set(EXECUTABLE_OUTPUT_PATH ${FLTK_BINARY_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${FLTK_BINARY_DIR}/lib)
set(ARCHIVE_OUTPUT_PATH ${FLTK_BINARY_DIR}/lib)

# Search for modules in the FLTK source dir first
set(CMAKE_MODULE_PATH "${FLTK_SOURCE_DIR}/CMake")

include_directories(${FLTK_BINARY_DIR} ${FLTK_SOURCE_DIR})

#######################################################################
# platform dependent information
#######################################################################

include(TestBigEndian)
TEST_BIG_ENDIAN(WORDS_BIGENDIAN)

if(APPLE)
set(__APPLE_QUARTZ__ 1)
set(HAVE_STRTOLL 1)
set(HAVE_STRCASECMP 1)
set(HAVE_DIRENT_H 1)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -framework Cocoa")
endif(APPLE)

if(WIN32)
if(MSVC)
add_definitions(-DWIN32_LEAN_AND_MEAN)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
endif(MSVC)
if(CMAKE_C_COMPILER_ID STREQUAL GNU)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-subsystem,windows")
endif(CMAKE_C_COMPILER_ID STREQUAL GNU)
if(MINGW AND EXISTS /mingw)
list(APPEND CMAKE_PREFIX_PATH /mingw)
endif(MINGW AND EXISTS /mingw)
endif(WIN32)

#######################################################################
# size of ints
include(CheckTypeSize)

CHECK_TYPE_SIZE(short SIZEOF_SHORT)
CHECK_TYPE_SIZE(int SIZEOF_INT)
CHECK_TYPE_SIZE(long SIZEOF_LONG)
CHECK_TYPE_SIZE("long long" HAVE_LONG_LONG)

if(${SIZEOF_SHORT} MATCHES "^2$")
set(U16 "unsigned short")
endif(${SIZEOF_SHORT} MATCHES "^2$")

if(${SIZEOF_INT} MATCHES "^4$")
set(U32 "unsigned")
else()
if(${SIZEOF_LONG} MATCHES "^4$")
set(U32 "unsigned long")
endif(${SIZEOF_LONG} MATCHES "^4$")
endif(${SIZEOF_INT} MATCHES "^4$")

if(${SIZEOF_INT} MATCHES "^8$")
set(U64 "unsigned")
else()
if(${SIZEOF_LONG} MATCHES "^8$")
set(U64 "unsigned long")
endif(${SIZEOF_LONG} MATCHES "^8$")
endif(${SIZEOF_INT} MATCHES "^8$")

#######################################################################
# check for headers, libraries and functions
#######################################################################
# headers
find_file(HAVE_ALSA_ASOUNDLIB_H alsa/asoundlib.h)
find_file(HAVE_DIRENT_H dirent.h)
find_file(HAVE_DLFCN_H dlfcn.h)
find_file(HAVE_FREETYPE_H freetype.h PATH_SUFFIXES freetype2)
find_file(HAVE_GL_GL_H GL/gl.h)
find_file(HAVE_GL_GLU_H GL/glu.h)
find_file(HAVE_LIBPNG_PNG_H libpng/png.h)
find_file(HAVE_LOCALE_H locale.h)
find_file(HAVE_NDIR_H ndir.h)
find_file(HAVE_OPENGL_GLU_H OpenGL/glu.h)
find_file(HAVE_PNG_H png.h)
find_file(HAVE_PTHREAD_H pthread.h)
find_file(HAVE_STDIO_H stdio.h)
find_file(HAVE_STRINGS_H strings.h)
find_file(HAVE_SYS_DIR_H sys/dir.h)
find_file(HAVE_SYS_NDIR_H sys/ndir.h)
find_file(HAVE_SYS_SELECT_H sys/select.h)
find_file(HAVE_SYS_STDTYPES_H sys/stdtypes.h)
find_path(HAVE_XDBE_H Xdbe.h PATH_SUFFIXES X11/extensions extensions)

mark_as_advanced(HAVE_ALSA_ASOUNDLIB_H HAVE_DIRENT_H HAVE_DLFCN_H)
mark_as_advanced(HAVE_FREETYPE_H HAVE_GL_GL_H HAVE_GL_GLU_H)
mark_as_advanced(HAVE_LIBPNG_PNG_H HAVE_LOCALE_H HAVE_NDIR_H)
mark_as_advanced(HAVE_OPENGL_GLU_H HAVE_PNG_H HAVE_PTHREAD_H)
mark_as_advanced(HAVE_STDIO_H HAVE_STRINGS_H HAVE_SYS_DIR_H)
mark_as_advanced(HAVE_SYS_NDIR_H HAVE_SYS_SELECT_H)
mark_as_advanced(HAVE_SYS_STDTYPES_H HAVE_XDBE_H)

# where to find freetype headers
find_path(FREETYPE_PATH freetype/config/ftheader.h PATH_SUFFIXES freetype2)
if(FREETYPE_PATH)
include_directories(${FREETYPE_PATH})
endif(FREETYPE_PATH)
mark_as_advanced(FREETYPE_PATH)

#######################################################################
# libraries
find_library(LIB_CAIRO cairo)
find_library(LIB_fontconfig fontconfig)
find_library(LIB_freetype freetype)
find_library(LIB_GL GL)
find_library(LIB_MesaGL MesaGL)
find_library(LIB_jpeg jpeg)
find_library(LIB_png png)
find_library(LIB_zlib z)

mark_as_advanced(LIB_CAIRO LIB_fontconfig LIB_freetype)
mark_as_advanced(LIB_GL LIB_MesaGL)
mark_as_advanced(LIB_jpeg LIB_png LIB_zlib)

#######################################################################
# functions
include(CheckFunctionExists)

if(HAVE_DLFCN_H)
set(CMAKE_REQUIRED_LIBRARIES dl)
endif(HAVE_DLFCN_H)
CHECK_FUNCTION_EXISTS(dlsym HAVE_DLSYM)

CHECK_FUNCTION_EXISTS(localeconv HAVE_LOCALECONV)

if(LIB_png)
set(CMAKE_REQUIRED_LIBRARIES png)
endif(LIB_png)
CHECK_FUNCTION_EXISTS(png_get_valid HAVE_PNG_GET_VALID)
CHECK_FUNCTION_EXISTS(png_set_tRNS_to_alpha HAVE_PNG_SET_TRNS_TO_ALPHA)

CHECK_FUNCTION_EXISTS(scandir HAVE_SCANDIR)
CHECK_FUNCTION_EXISTS(snprintf HAVE_SNPRINTF)

# not really true but we convert strcasecmp calls to _stricmp calls in flstring.h
if(MSVC)
set(HAVE_STRCASECMP 1)
endif(MSVC)
CHECK_FUNCTION_EXISTS(strcasecmp HAVE_STRCASECMP)

CHECK_FUNCTION_EXISTS(strlcat HAVE_STRLCAT)
CHECK_FUNCTION_EXISTS(strlcpy HAVE_STRLCPY)
CHECK_FUNCTION_EXISTS(strtoll HAVE_STRTOLL)
CHECK_FUNCTION_EXISTS(vsnprintf HAVE_VSNPRINTF)

set(CMAKE_REQUIRED_LIBRARIES)

if(HAVE_SCANDIR AND NOT HAVE_SCANDIR_POSIX)
set(MSG "POSIX compatible scandir")
message(STATUS "Looking for ${MSG}")
try_compile(V
${FLTK_BINARY_DIR}
${FLTK_SOURCE_DIR}/CMake/posixScandir.cxx
)
if(V)
message(STATUS "${MSG} - found")
set(HAVE_SCANDIR_POSIX 1 CACHE INTERNAL "")
else()
message(STATUS "${MSG} - not found")
set(HAVE_SCANDIR_POSIX HAVE_SCANDIR_POSIX-NOTFOUND)
endif(V)
endif(HAVE_SCANDIR AND NOT HAVE_SCANDIR_POSIX)
mark_as_advanced(HAVE_SCANDIR_POSIX)

#######################################################################
# options
#######################################################################
set(OPTION_OPTIM ""
CACHE STRING
"custom optimization flags"
)
add_definitions(${OPTION_OPTIM})

#######################################################################
set(OPTION_ARCHFLAGS ""
CACHE STRING
"custom architecture flags"
)
add_definitions(${OPTION_ARCHFLAGS})

#######################################################################
set(OPTION_PREFIX_BIN ""
CACHE STRING
"where to install executables - leave empty to use {CMAKE_INSTALL_PREFIX}/bin"
)

if(OPTION_PREFIX_BIN)
set(PREFIX_BIN ${OPTION_PREFIX_BIN} CACHE INTERNAL "" FORCE)
else()
set(PREFIX_BIN ${CMAKE_INSTALL_PREFIX}/bin CACHE INTERNAL "" FORCE)
endif(OPTION_PREFIX_BIN)

#######################################################################
set(OPTION_PREFIX_LIB ""
CACHE STRING
"where to install libraries - leave empty to use {CMAKE_INSTALL_PREFIX}/lib"
)

if(OPTION_PREFIX_LIB)
set(PREFIX_LIB ${OPTION_PREFIX_LIB} CACHE INTERNAL "" FORCE)
else()
set(PREFIX_LIB ${CMAKE_INSTALL_PREFIX}/lib CACHE INTERNAL "" FORCE)
endif(OPTION_PREFIX_LIB)

#######################################################################
set(OPTION_PREFIX_INCLUDE ""
CACHE STRING
"where to install include files - leave empty to use {CMAKE_INSTALL_PREFIX}/include"
)

if(OPTION_PREFIX_INCLUDE)
set(PREFIX_INCLUDE ${OPTION_PREFIX_INCLUDE} CACHE INTERNAL "" FORCE)
else()
set(PREFIX_INCLUDE ${CMAKE_INSTALL_PREFIX}/include CACHE INTERNAL "" FORCE)
endif(OPTION_PREFIX_INCLUDE)

#######################################################################
set(OPTION_PREFIX_DATA ""
CACHE STRING
"where to install data files - leave empty to use {CMAKE_INSTALL_PREFIX}/share/FLTK"
)

if(OPTION_PREFIX_DATA)
set(PREFIX_DATA ${OPTION_PREFIX_DATA} CACHE INTERNAL "" FORCE)
else()
set(PREFIX_DATA ${CMAKE_INSTALL_PREFIX}/share/FLTK CACHE INTERNAL "" FORCE)
endif(OPTION_PREFIX_DATA)

#######################################################################
set(OPTION_PREFIX_DOC ""
CACHE STRING
"where to install doc files - leave empty to use {CMAKE_INSTALL_PREFIX}/share/doc/FLTK"
)

if(OPTION_PREFIX_DOC)
set(PREFIX_DOC ${OPTION_PREFIX_DOC} CACHE INTERNAL "" FORCE)
else()
set(PREFIX_DOC ${CMAKE_INSTALL_PREFIX}/share/doc/FLTK CACHE INTERNAL "" FORCE)
endif(OPTION_PREFIX_DOC)

#######################################################################
if(WIN32)
set(DEFAULT_CONFIG "${CMAKE_INSTALL_PREFIX}/CMake")
elseif(APPLE)
set(DEFAULT_CONFIG "${CMAKE_INSTALL_PREFIX}/FLTK/.framework/Resources/CMake")
else()
set(DEFAULT_CONFIG "${CMAKE_INSTALL_PREFIX}/lib/FLTK-${FLTK_VERSION}")
endif(WIN32)

set(OPTION_PREFIX_CONFIG ""
CACHE STRING
"where to install CMake config files - leave empty to use ${DEFAULT_CONFIG}"
)

if(OPTION_PREFIX_CONFIG)
set(PREFIX_CONFIG "${OPTION_PREFIX_CONFIG}" CACHE INTERNAL "" FORCE)
else()
set(PREFIX_CONFIG "${DEFAULT_CONFIG}" CACHE INTERNAL "" FORCE)
endif(OPTION_PREFIX_CONFIG)

#######################################################################
if(CMAKE_HOST_UNIX)
set(OPTION_PREFIX_MAN ""
CACHE STRING
"where to install man files - leave empty to use {CMAKE_INSTALL_PREFIX}/man"
)

if(OPTION_PREFIX_MAN)
set(PREFIX_MAN ${OPTION_PREFIX_MAN} CACHE INTERNAL "" FORCE)
else()
set(PREFIX_MAN ${CMAKE_INSTALL_PREFIX}/man CACHE INTERNAL "" FORCE)
endif(OPTION_PREFIX_MAN)

option(OPTION_CREATE_LINKS "create backwards compatibility links" OFF)
endif(CMAKE_HOST_UNIX)

#######################################################################
if(APPLE)
option(OPTION_APPLE_X11 "use X11" OFF)
endif(APPLE)

if(NOT APPLE OR OPTION_APPLE_X11)
include(FindX11)
if(X11_FOUND)
set(USE_X11 1)
list(APPEND FLTK_CFLAGS -DUSE_X11)
list(APPEND FLTK_LDLIBS -lX11)
endif(X11_FOUND)
endif(NOT APPLE OR OPTION_APPLE_X11)

#######################################################################
option(OPTION_USE_POLL "use poll if available" OFF)

if(OPTION_USE_POLL)
CHECK_FUNCTION_EXISTS(poll USE_POLL)
endif(OPTION_USE_POLL)

#######################################################################
option(OPTION_BUILD_SHARED_LIBS "Build shared libraries" OFF)

#######################################################################
option(OPTION_BUILD_EXAMPLES "build example programs" ON)

#######################################################################
include(FindPkgConfig)

option(OPTION_CAIRO "use lib Cairo" OFF)
option(OPTION_CAIROEXT
"use fltk code instrumentation for cairo extended use" OFF
)

if(OPTION_CAIRO OR OPTION_CAIROEXT AND LIB_CAIRO)
pkg_search_module(PKG_CAIRO cairo)
endif(OPTION_CAIRO OR OPTION_CAIROEXT AND LIB_CAIRO)

if(PKG_CAIRO_FOUND)
set(FLTK_HAVE_CAIRO 1)
add_subdirectory(cairo)
list(APPEND FLTK_LDLIBS -lcairo -lpixman-1)
include_directories(${PKG_CAIRO_INCLUDE_DIRS})
string(REPLACE ";" " " CAIROFLAGS "${PKG_CAIRO_CFLAGS}")
endif(PKG_CAIRO_FOUND)

if(LIB_CAIRO AND OPTION_CAIROEXT AND PKG_CAIRO_FOUND)
set(FLTK_USE_CAIRO 1)
set(FLTK_CAIRO_FOUND TRUE)
else()
set(FLTK_CAIRO_FOUND FALSE)
endif(LIB_CAIRO AND OPTION_CAIROEXT AND PKG_CAIRO_FOUND)

#######################################################################
set(HAVE_GL LIB_GL OR LIB_MesaGL)

if(HAVE_GL)
option(OPTION_USE_GL "use OpenGL" ON)
endif(HAVE_GL)

if(OPTION_USE_GL)
include(FindOpenGL)
endif(OPTION_USE_GL)

if(OPENGL_FOUND)
set(CMAKE_REQUIRED_INCLUDES ${OPENGL_INCLUDE_DIR}/GL)
set(CMAKE_REQUIRED_LIBRARIES -lGLU -lGL)
CHECK_FUNCTION_EXISTS(glXGetProcAddressARB HAVE_GLXGETPROCADDRESSARB)
set(FLTK_GL_FOUND TRUE)
else()
set(FLTK_GL_FOUND FALSE)
endif(OPENGL_FOUND)

#######################################################################
option(OPTION_USE_THREADS "use multi-threading" ON)

if(OPTION_USE_THREADS)
include(FindThreads)
endif(OPTION_USE_THREADS)

if(OPTION_USE_THREADS AND CMAKE_HAVE_THREADS_LIBRARY)
add_definitions("-D_THREAD_SAFE -D_REENTRANT")
set(USE_THREADS 1)
set(FLTK_THREADS_FOUND TRUE)
else()
set(FLTK_THREADS_FOUND FALSE)
endif(OPTION_USE_THREADS AND CMAKE_HAVE_THREADS_LIBRARY)

if(OPTION_USE_THREADS AND CMAKE_USE_PTHREADS_INIT)
set(HAVE_PTHREAD 1)
list(APPEND FLTK_LDLIBS -lpthread)
list(APPEND FLTK_CFLAGS -D_THREAD_SAFE -D_REENTRANT)
set(FLTK_PTHREADS_FOUND TRUE)
else()
set(HAVE_PTHREAD 0)
set(HAVE_PTHREAD_H 0)
set(FLTK_PTHREADS_FOUND FALSE)
endif(OPTION_USE_THREADS AND CMAKE_USE_PTHREADS_INIT)

#######################################################################
option(OPTION_LARGE_FILE "enable large file support" ON)

if(OPTION_LARGE_FILE)
if(NOT MSVC)
add_definitions(-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE)
list(APPEND FLTK_CFLAGS -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE)
endif(NOT MSVC)
endif(OPTION_LARGE_FILE)

#######################################################################
option(OPTION_USE_SYSTEM_LIBJPEG "Use's system libjpeg" ON)

if(OPTION_USE_SYSTEM_LIBJPEG AND LIB_jpeg)
include(FindJPEG)
endif(OPTION_USE_SYSTEM_LIBJPEG AND LIB_jpeg)

if(OPTION_USE_SYSTEM_LIBJPEG AND JPEG_FOUND)
set(FLTK_JPEG_LIBRARIES ${JPEG_LIBRARIES})
include_directories(${JPEG_INCLUDE_DIR})
set(FLTK_BUILTIN_JPEG_FOUND FALSE)
else()
add_subdirectory(jpeg)
set(FLTK_JPEG_LIBRARIES fltk_jpeg)
include_directories(${FLTK_SOURCE_DIR}/jpeg)
set(FLTK_BUILTIN_JPEG_FOUND TRUE)
endif(OPTION_USE_SYSTEM_LIBJPEG AND JPEG_FOUND)

if(OPTION_USE_SYSTEM_LIBJPEG AND NOT JPEG_FOUND)
message(STATUS "\ncannot find system jpeg library - using built-in\n")
endif(OPTION_USE_SYSTEM_LIBJPEG AND NOT JPEG_FOUND)

set(HAVE_LIBJPEG 1)

#######################################################################
option(OPTION_USE_SYSTEM_ZLIB "Use's system zlib" ON)

if(OPTION_USE_SYSTEM_ZLIB AND LIB_zlib)
include(FindZLIB)
endif(OPTION_USE_SYSTEM_ZLIB AND LIB_zlib)

if(OPTION_USE_SYSTEM_ZLIB AND ZLIB_FOUND)
set(FLTK_ZLIB_LIBRARIES ${ZLIB_LIBRARIES})
include_directories(${ZLIB_INCLUDE_DIRS})
set(FLTK_BUILTIN_ZLIB_FOUND FALSE)
else()
add_subdirectory(zlib)
set(FLTK_ZLIB_LIBRARIES fltk_z)
set(ZLIB_INCLUDE_DIR ${FLTK_SOURCE_DIR}/zlib)
include_directories(${FLTK_SOURCE_DIR}/zlib)
set(FLTK_BUILTIN_ZLIB_FOUND TRUE)
endif(OPTION_USE_SYSTEM_ZLIB AND ZLIB_FOUND)

if(OPTION_USE_SYSTEM_ZLIB AND NOT ZLIB_FOUND)
message(STATUS "\ncannot find system zlib library - using built-in\n")
endif(OPTION_USE_SYSTEM_ZLIB AND NOT ZLIB_FOUND)

set(HAVE_LIBZ 1)

#######################################################################
option(OPTION_USE_SYSTEM_LIBPNG "Use's system libpng" ON)

if(OPTION_USE_SYSTEM_LIBPNG AND LIB_png)
include(FindPNG)
endif(OPTION_USE_SYSTEM_LIBPNG AND LIB_png)

if(OPTION_USE_SYSTEM_LIBPNG AND PNG_FOUND)
set(FLTK_PNG_LIBRARIES ${PNG_LIBRARIES})
include_directories(${PNG_INCLUDE_DIR})
add_definitions(${PNG_DEFINITIONS})
set(FLTK_BUILTIN_PNG_FOUND FALSE)
else()
add_subdirectory(png)
set(FLTK_PNG_LIBRARIES fltk_png)
set(HAVE_PNG_H 1)
set(HAVE_PNG_GET_VALID 1)
set(HAVE_PNG_SET_TRNS_TO_ALPHA 1)
include_directories(${FLTK_SOURCE_DIR}/png)
set(FLTK_BUILTIN_PNG_FOUND TRUE)
endif(OPTION_USE_SYSTEM_LIBPNG AND PNG_FOUND)

if(OPTION_USE_SYSTEM_LIBPNG AND NOT PNG_FOUND)
message(STATUS "\ncannot find system png library - using built-in\n")
endif(OPTION_USE_SYSTEM_LIBPNG AND NOT PNG_FOUND)

set(HAVE_LIBPNG 1)

#######################################################################
if(X11_Xinerama_FOUND)
option(OPTION_USE_XINERAMA "use lib Xinerama" ON)
endif(X11_Xinerama_FOUND)

if(OPTION_USE_XINERAMA)
set(HAVE_XINERAMA ${X11_Xinerama_FOUND})
include_directories(${X11_Xinerama_INCLUDE_PATH})
list(APPEND FLTK_LDLIBS -lXinerama)
set(FLTK_XINERAMA_FOUND TRUE)
else()
set(FLTK_XINERAMA_FOUND FALSE)
endif(OPTION_USE_XINERAMA)

#######################################################################
if(X11_Xft_FOUND)
option(OPTION_USE_XFT "use lib Xft" ON)
endif(X11_Xft_FOUND)

if(OPTION_USE_XFT)
set(USE_XFT X11_Xft_FOUND)
list(APPEND FLTK_LDLIBS -lXft)
set(FLTK_XFT_FOUND TRUE)
else()
set(FLTK_XFT_FOUND FALSE)
endif(OPTION_USE_XFT)

#######################################################################
if(X11_FOUND)
option(OPTION_USE_XDBE "use lib Xdbe" ON)
endif(X11_FOUND)

if(OPTION_USE_XDBE AND HAVE_XDBE_H)
set(HAVE_XDBE 1)
set(FLTK_XDBE_FOUND TRUE)
else()
set(FLTK_XDBE_FOUND FALSE)
endif(OPTION_USE_XDBE AND HAVE_XDBE_H)

#######################################################################
# final setup and config
#######################################################################
# Set the fluid executable path
if(CMAKE_CROSSCOMPILING)
find_file(FLUID_PATH
NAMES fluid fluid.exe
PATHS ENV PATH
NO_CMAKE_FIND_ROOT_PATH
)
add_executable(fluid IMPORTED)
set(FLTK_FLUID_EXECUTABLE ${FLUID_PATH})
set(FLTK_FLUID_PATH ${FLUID_PATH})
set_target_properties(fluid
PROPERTIES IMPORTED_LOCATION ${FLUID_PATH}
)
else()
add_subdirectory(fluid)
set(FLTK_FLUID_EXECUTABLE fluid)
set(FLTK_FLUID_PATH ${PREFIX_BIN}/fluid)
endif(CMAKE_CROSSCOMPILING)

add_subdirectory(src)

# generate FLTKConfig.cmake
string(REPLACE ";" " " EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}")
configure_file(
${FLTK_SOURCE_DIR}/CMake/FLTKConfig.cmake.in
${EXECUTABLE_OUTPUT_PATH}/FLTKConfig.cmake
@ONLY
)

# generate UseFLTK.cmake
configure_file(
${FLTK_SOURCE_DIR}/CMake/UseFLTK.cmake.in
${EXECUTABLE_OUTPUT_PATH}/UseFLTK.cmake
@ONLY
)

# generate config.h
configure_file(
"${FLTK_SOURCE_DIR}/configh.cmake.in"
"${FLTK_BINARY_DIR}/config.h"
@ONLY
)

# generate fltk-config
get_filename_component(CC ${CMAKE_C_COMPILER} NAME)
get_filename_component(CXX ${CMAKE_CXX_COMPILER} NAME)

string(REPLACE ";" " " C_FLAGS "${FLTK_CFLAGS}")

if(X11_Xext_FOUND)
list(APPEND FLTK_LDLIBS -lXext)
endif(X11_Xext_FOUND)
string(REPLACE ";" " " LD_LIBS "${FLTK_LDLIBS}")

configure_file(
"${FLTK_SOURCE_DIR}/fltk-config.cmake.in"
"${FLTK_BINARY_DIR}/fltk-config"
@ONLY
)
if(UNIX)
execute_process(COMMAND chmod 755 fltk-config
WORKING_DIRECTORY "${FLTK_BINARY_DIR}"
)
endif(UNIX)

if(OPTION_CREATE_LINKS)
configure_file(
"${FLTK_SOURCE_DIR}/CMake/install-symlinks.cmake.in"
"${FLTK_BINARY_DIR}/install-symlinks.cmake"
@ONLY
)
endif(OPTION_CREATE_LINKS)

# generate uninstall target
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/CMake/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
@ONLY
)
add_custom_target(uninstall
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
)

#######################################################################
# build examples - these have to be after fluid is built/imported
#######################################################################
if(OPTION_BUILD_EXAMPLES)
add_subdirectory(test)
endif(OPTION_BUILD_EXAMPLES)

#######################################################################
# installation
#######################################################################

install(DIRECTORY ${FLTK_SOURCE_DIR}/FL
DESTINATION ${PREFIX_INCLUDE} USE_SOURCE_PERMISSIONS
PATTERN ".svn" EXCLUDE
)

if(OPTION_CREATE_LINKS)
install(SCRIPT ${FLTK_BINARY_DIR}/install-symlinks.cmake)
endif(OPTION_CREATE_LINKS)

install(PROGRAMS ${FLTK_BINARY_DIR}/fltk-config
DESTINATION ${PREFIX_BIN}
OPTIONAL
)

install(EXPORT fltk-install
DESTINATION ${PREFIX_CONFIG}
FILE FLTKLibraries.cmake
)

install(FILES ${EXECUTABLE_OUTPUT_PATH}/FLTKConfig.cmake
DESTINATION ${PREFIX_CONFIG}
)

install(FILES ${EXECUTABLE_OUTPUT_PATH}/UseFLTK.cmake
DESTINATION ${PREFIX_CONFIG}
)

if(CMAKE_HOST_UNIX)
macro(INSTALL_MAN FILE LEVEL)
install(FILES
${FLTK_SOURCE_DIR}/documentation/src/${FILE}.man
DESTINATION ${PREFIX_MAN}/man${LEVEL}
RENAME ${FILE}.${LEVEL}
)
endmacro(INSTALL_MAN FILE LEVEL)

INSTALL_MAN(fluid 1)
INSTALL_MAN(fltk-config 1)
INSTALL_MAN(fltk 3)
INSTALL_MAN(blocks 6)
INSTALL_MAN(checkers 6)
INSTALL_MAN(sudoku 6)

endif(CMAKE_HOST_UNIX)


+ 530
- 0
COPYING View File

@@ -0,0 +1,530 @@
FLTK License
December 11, 2001

The FLTK library and included programs are provided under the terms
of the GNU Library General Public License (LGPL) with the following
exceptions:

1. Modifications to the FLTK configure script, config
header file, and makefiles by themselves to support
a specific platform do not constitute a modified or
derivative work.

The authors do request that such modifications be
contributed to the FLTK project - send all contributions
through the "Software Trouble Report" on the following page:
http://www.fltk.org/str.php

2. Widgets that are subclassed from FLTK widgets do not
constitute a derivative work.

3. Static linking of applications and widgets to the
FLTK library does not constitute a derivative work
and does not require the author to provide source
code for the application or widget, use the shared
FLTK libraries, or link their applications or
widgets against a user-supplied version of FLTK.

If you link the application or widget to a modified
version of FLTK, then the changes to FLTK must be
provided under the terms of the LGPL in sections
1, 2, and 4.

4. You do not have to provide a copy of the FLTK license
with programs that are linked to the FLTK library, nor
do you have to identify the FLTK license in your
program or documentation as required by section 6
of the LGPL.

However, programs must still identify their use of FLTK.
The following example statement can be included in user
documentation to satisfy this requirement:

[program/widget] is based in part on the work of
the FLTK project (http://www.fltk.org).

-----------------------------------------------------------------------

GNU LIBRARY GENERAL PUBLIC LICENSE
Version 2, June 1991

Copyright (C) 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.

[This is the first released version of the library GPL. It is
numbered 2 because it goes with version 2 of the ordinary GPL.]

Preamble

The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.

This license, the Library General Public License, applies to some
specially designated Free Software Foundation software, and to any
other libraries whose authors decide to use it. You can use it for
your libraries, too.

When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.

To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if
you distribute copies of the library, or if you modify it.

For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link a program with the library, you must provide
complete object files to the recipients so that they can relink them
with the library, after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.

Our method of protecting your rights has two steps: (1) copyright
the library, and (2) offer you this license which gives you legal
permission to copy, distribute and/or modify the library.

Also, for each distributor's protection, we want to make certain
that everyone understands that there is no warranty for this free
library. If the library is modified by someone else and passed on, we
want its recipients to know that what they have is not the original
version, so that any problems introduced by others will not reflect on
the original authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that companies distributing free
software will individually obtain patent licenses, thus in effect
transforming the program into proprietary software. To prevent this,
we have made it clear that any patent must be licensed for everyone's
free use or not licensed at all.

Most GNU software, including some libraries, is covered by the ordinary
GNU General Public License, which was designed for utility programs. This
license, the GNU Library General Public License, applies to certain
designated libraries. This license is quite different from the ordinary
one; be sure to read it in full, and don't assume that anything in it is
the same as in the ordinary license.

The reason we have a separate public license for some libraries is that
they blur the distinction we usually make between modifying or adding to a
program and simply using it. Linking a program with a library, without
changing the library, is in some sense simply using the library, and is
analogous to running a utility program or application program. However, in
a textual and legal sense, the linked executable is a combined work, a
derivative of the original library, and the ordinary General Public License
treats it as such.

Because of this blurred distinction, using the ordinary General
Public License for libraries did not effectively promote software
sharing, because most developers did not use the libraries. We
concluded that weaker conditions might promote sharing better.

However, unrestricted linking of non-free programs would deprive the
users of those programs of all benefit from the free status of the
libraries themselves. This Library General Public License is intended to
permit developers of non-free programs to use free libraries, while
preserving your freedom as a user of such programs to change the free
libraries that are incorporated in them. (We have not seen how to achieve
this as regards changes in header files, but we have achieved it as regards
changes in the actual functions of the Library.) The hope is that this
will lead to faster development of free libraries.

The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, while the latter only
works together with the library.

Note that it is possible for a library to be covered by the ordinary
General Public License rather than by this special one.
GNU LIBRARY GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

0. This License Agreement applies to any software library which
contains a notice placed by the copyright holder or other authorized
party saying it may be distributed under the terms of this Library
General Public License (also called "this License"). Each licensee is
addressed as "you".

A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.

The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)

"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.

Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.

1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.

You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:

a) The modified work must itself be a software library.

b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.

c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.

d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.

(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)

These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.

Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.

In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.

3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.

This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.

4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.

If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.

5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.

However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.

When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.

If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)

Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also compile or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.

You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:

a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)

b) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.

c) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.

d) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.

For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the source code distributed need not include anything that is normally
distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.

It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:

a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.

b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.

8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.

9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.

10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.

If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.

It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.

This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.

12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.

13. The Free Software Foundation may publish revised and/or new
versions of the Library General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.

Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.

NO WARRANTY

15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.

END OF TERMS AND CONDITIONS
Appendix: How to Apply These Terms to Your New Libraries

If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).

To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.

<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>

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., 675 Mass Ave, Cambridge, MA 02139, USA.

Also add information on how to contact you by electronic and paper mail.

You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:

Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.

<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice

That's all there is to it!

+ 62
- 0
CREDITS View File

@@ -0,0 +1,62 @@
CREDITS - Fast Light Tool Kit (FLTK) Version 1.3.0
--------------------------------------------------

This file lists the people responsible for the toolkit you
are now using. If you've looking for your name in lights
but we've forgotten you here, please use the report on the
following page, and we'll update this file accordingly:

http://www.fltk.org/str.php


CORE DEVELOPERS

The following people do the day-to-day development of FLTK:

Fabien Costantini (fabien67@users.sf.net)
Craig P. Earls
Curtis Edwards (trilec@users.sourceforge.net)
Gustavo Hime (hime@users.sourceforge.net)
Talbot Hughes
Robert Kesterson (robertk@users.sourceforge.net)
Matthias Melcher (mm@robowerk.com)
James Dean Palmer (jamespalmer@users.sourceforge.net)
Vincent Penne (vincentp@users.sourceforge.net)
Bill Spitzak (spitzak@users.sourceforge.net)
Michael Sweet (easysw@users.sourceforge.net)
Carl Thompson (clip@users.sourceforge.net)
Nafees Bin Zafar (nafees@users.sourceforge.net)


OTHER CONTRIBUTORS

The following people have contributed fixes or enhancements
for FLTK:

Teun Burgers
Paul Chambers
Stephen Davies
Yuri D'Elia
Domingo Alvarez Duarte
Greg Ercolano
Yuri Fedorchenko
George Garvey
Duncan Gibson
Manolo Gouy
Mikael Hultgren
Stuart Levy
Howard Lightstone
Mike Lindner
Alexander Mai
Pierre Ossman
Alexander Rabi
James Roth
Albrecht Schlosser
Andrea Suatoni
Michael Surette
Paul Sydney
Aaron Ucko
Emanuele Vicentini
Josef Vitu
Jim Wilson
Ken Yarnall

+ 38
- 0
DartConfig.cmake View File

@@ -0,0 +1,38 @@
# Dashboard is opened for submissions for a 24 hour period starting at
# the specified NIGHLY_START_TIME. Time is specified in 24 hour format.
SET (NIGHTLY_START_TIME "21:00:00 EDT")

# Dart server to submit results (used by client)
SET (DROP_METHOD "http")
SET (DROP_SITE "public.kitware.com")
SET (DROP_LOCATION "/cgi-bin/HTTPUploadDartFile.cgi")
SET (TRIGGER_SITE "http://${DROP_SITE}/cgi-bin/Submit-Fltk-TestingResults.pl")

# Project Home Page
SET (PROJECT_URL "http://www.fltk.org")

# Dart server configuration
SET (ROLLUP_URL "http://${DROP_SITE}/cgi-bin/fltk-rollup-dashboard.sh")
SET (CVS_WEB_URL "http://cvs.sourceforge.net/viewcvs.py/fltk/fltk/")
SET (CVS_WEB_CVSROOT "fltk")

SET (USE_GNATS "On")
SET (GNATS_WEB_URL "http://www.fltk.org/str.php")

# Continuous email delivery variables
SET (CONTINUOUS_FROM "fltk-dashboard@public.kitware.com")
SET (SMTP_MAILHOST "public.kitware.com")
SET (CONTINUOUS_MONITOR_LIST "fltk-dashboard@public.kitware.com")
SET (CONTINUOUS_BASE_URL "http://public.kitware.com/Fltk/Testing")

SET (DELIVER_BROKEN_BUILD_EMAIL_WITH_TEST_FAILURES ON)
SET (DELIVER_BROKEN_BUILD_EMAIL "Continuous Nightly")
SET (EMAIL_FROM "fltk-dashboard@public.kitware.com")
SET (DARTBOARD_BASE_URL "http://public.kitware.com/Fltk/Testing")

SET (DELIVER_BROKEN_BUILD_EMAIL_WITH_CONFIGURE_FAILURES 1)
SET (DELIVER_BROKEN_BUILD_EMAIL_WITH_BUILD_ERRORS 1)
SET (DELIVER_BROKEN_BUILD_EMAIL_WITH_BUILD_WARNINGS 1)
SET (DELIVER_BROKEN_BUILD_EMAIL_WITH_TEST_NOT_RUNS 1)
SET (DELIVER_BROKEN_BUILD_EMAIL_WITH_TEST_FAILURES 1)


+ 959
- 0
FL/Enumerations.H View File

@@ -0,0 +1,959 @@
//
// "$Id: Enumerations.H 8710 2011-05-21 21:55:59Z manolo $"
//
// Enumerations for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2011 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
//

/** \file
This file contains type definitions and general enumerations.
*/

#ifndef Fl_Enumerations_H
#define Fl_Enumerations_H

# include "Fl_Export.H"
# include "fl_types.h"

/** \name Version Numbers

FLTK defines some constants to help the programmer to
find out, for which FLTK version a program is compiled.
The following constants are defined:
*/
/*@{*/

/**
The major release version of this FLTK library.
\sa FL_VERSION
*/
#define FL_MAJOR_VERSION 1

/**
The minor release version for this library.

FLTK remains mostly source-code compatible between minor version changes.
*/
#define FL_MINOR_VERSION 3

/**
The patch version for this library.

FLTK remains binary compatible between patches.
*/
#define FL_PATCH_VERSION 0

/**
The FLTK version number as a \em double.

FL_VERSION is a double that describes the major and minor version numbers.
Version 1.1 is actually stored as 1.01 to allow for more than 9 minor
releases.

The FL_MAJOR_VERSION, FL_MINOR_VERSION, and FL_PATCH_VERSION constants
give the integral values for the major, minor, and patch releases
respectively.
*/
#define FL_VERSION ((double)FL_MAJOR_VERSION + \
(double)FL_MINOR_VERSION * 0.01 + \
(double)FL_PATCH_VERSION * 0.0001)

/*@}*/ // group: Version Numbers

/**
Every time a user moves the mouse pointer, clicks a button,
or presses a key, an event is generated and sent to your
application. Events can also come from other programs like the
window manager.
Events are identified by the integer argument passed to the
Fl_Widget::handle() virtual method. Other information about the
most recent event is stored in static locations and acquired by
calling the Fl::event_*() methods. This static information remains
valid until the next event is read from the window system, so it
is ok to look at it outside of the handle() method.

\sa Fl::event_text(), Fl::event_key(), class Fl::
*/
enum Fl_Event { // events
/** No event. */
FL_NO_EVENT = 0,

/** A mouse button has gone down with the mouse pointing at this
widget. You can find out what button by calling Fl::event_button().
You find out the mouse position by calling Fl::event_x() and
Fl::event_y().

A widget indicates that it "wants" the mouse click by returning non-zero
from its Fl_Widget::handle() method. It will then become the
Fl::pushed() widget and will get FL_DRAG and the matching FL_RELEASE events.
If Fl_Widget::handle() returns zero then FLTK will try sending the FL_PUSH
to another widget.
*/
FL_PUSH = 1,

/** A mouse button has been released. You can find out what button by
calling Fl::event_button().

In order to receive the FL_RELEASE event, the widget must return
non-zero when handling FL_PUSH.
*/
FL_RELEASE = 2,

/** The mouse has been moved to point at this widget. This can
be used for highlighting feedback. If a widget wants to
highlight or otherwise track the mouse, it indicates this by
returning non-zero from its handle() method. It then
becomes the Fl::belowmouse() widget and will receive
FL_MOVE and FL_LEAVE events.
*/
FL_ENTER = 3,

/** The mouse has moved out of the widget.
In order to receive the FL_LEAVE event, the widget must
return non-zero when handling FL_ENTER.
*/
FL_LEAVE = 4,

/** The mouse has moved with a button held down. The current button state
is in Fl::event_state(). The mouse position is in Fl::event_x() and
Fl::event_y().

In order to receive FL_DRAG events, the widget must return non-zero
when handling FL_PUSH.
*/
FL_DRAG = 5,

/** This indicates an <I>attempt</I> to give a widget the keyboard focus.

If a widget wants the focus, it should change itself to display the
fact that it has the focus, and return non-zero from its handle() method.
It then becomes the Fl::focus() widget and gets FL_KEYDOWN, FL_KEYUP,
and FL_UNFOCUS events.

The focus will change either because the window manager changed which
window gets the focus, or because the user tried to navigate using tab,
arrows, or other keys. You can check Fl::event_key() to figure out why
it moved. For navigation it will be the key pressed and for interaction
with the window manager it will be zero.
*/
FL_FOCUS = 6,
/** This event is sent to the previous Fl::focus() widget when another
widget gets the focus or the window loses focus.
*/
FL_UNFOCUS = 7,

/** A key was pressed (FL_KEYDOWN) or released (FL_KEYUP).
Fl_KEYBOARD is a synonym for FL_KEYDOWN.
The key can be found in Fl::event_key().
The text that the key should insert can be found with Fl::event_text()
and its length is in Fl::event_length(). If you use the key handle()
should return 1. If you return zero then FLTK assumes you ignored the
key and will then attempt to send it to a parent widget. If none of
them want it, it will change the event into a FL_SHORTCUT event.

To receive FL_KEYBOARD events you must also respond to the FL_FOCUS
and FL_UNFOCUS events.

If you are writing a text-editing widget you may also want to call
the Fl::compose() function to translate individual keystrokes into
non-ASCII characters.

FL_KEYUP events are sent to the widget that currently has focus. This
is not necessarily the same widget that received the corresponding
FL_KEYDOWN event because focus may have changed between events.
*/
FL_KEYDOWN = 8,

/** Equivalent to FL_KEYDOWN.
\see FL_KEYDOWN
*/
FL_KEYBOARD = 8,
/** Key release event.
\see FL_KEYDOWN
*/
FL_KEYUP = 9,

/** The user clicked the close button of a window.
This event is used internally only to trigger the callback of
Fl_Window derived classed. The default callback closes the
window calling Fl_Window::hide().
*/
FL_CLOSE = 10,

/** The mouse has moved without any mouse buttons held down.
This event is sent to the Fl::belowmouse() widget.

In order to receive FL_MOVE events, the widget must return
non-zero when handling FL_ENTER.
*/
FL_MOVE = 11,

/** If the Fl::focus() widget is zero or ignores an FL_KEYBOARD
event then FLTK tries sending this event to every widget it
can, until one of them returns non-zero. FL_SHORTCUT is first
sent to the Fl::belowmouse() widget, then its parents and siblings,
and eventually to every widget in the window, trying to find an
object that returns non-zero. FLTK tries really hard to not to ignore
any keystrokes!

You can also make "global" shortcuts by using Fl::add_handler(). A
global shortcut will work no matter what windows are displayed or
which one has the focus.
*/
FL_SHORTCUT = 12,

/** This widget is no longer active, due to Fl_Widget::deactivate()
being called on it or one of its parents. Fl_Widget::active() may
still be true after this, the widget is only active if Fl_Widget::active()
is true on it and all its parents (use Fl_Widget::active_r() to check this).
*/
FL_DEACTIVATE = 13,

/** This widget is now active, due to Fl_Widget::activate() being
called on it or one of its parents.
*/
FL_ACTIVATE = 14,

/** This widget is no longer visible, due to Fl_Widget::hide() being
called on it or one of its parents, or due to a parent window being
minimized. Fl_Widget::visible() may still be true after this, but the
widget is visible only if visible() is true for it and all its
parents (use Fl_Widget::visible_r() to check this).
*/
FL_HIDE = 15,

/** This widget is visible again, due to Fl_Widget::show() being called on
it or one of its parents, or due to a parent window being restored.
Child Fl_Windows respond to this by actually creating the window if not
done already, so if you subclass a window, be sure to pass FL_SHOW
to the base class Fl_Widget::handle() method!
*/
FL_SHOW = 16,

/** You should get this event some time after you call Fl::paste().
The contents of Fl::event_text() is the text to insert and the number
of characters is in Fl::event_length().
*/
FL_PASTE = 17,

/** The Fl::selection_owner() will get this event before the selection is
moved to another widget. This indicates that some other widget or program
has claimed the selection. Motif programs used this to clear the selection
indication. Most modern programs ignore this.
*/
FL_SELECTIONCLEAR = 18,

/** The user has moved the mouse wheel. The Fl::event_dx() and Fl::event_dy()
methods can be used to find the amount to scroll horizontally and vertically.
*/
FL_MOUSEWHEEL = 19,

/** The mouse has been moved to point at this widget. A widget that is
interested in receiving drag'n'drop data must return 1 to receive
FL_DND_DRAG, FL_DND_LEAVE and FL_DND_RELEASE events.
*/
FL_DND_ENTER = 20,

/** The mouse has been moved inside a widget while dragging data. A
widget that is interested in receiving drag'n'drop data should
indicate the possible drop position.
*/
FL_DND_DRAG = 21,

/** The mouse has moved out of the widget.
*/
FL_DND_LEAVE = 22,

/** The user has released the mouse button dropping data into the widget.
If the widget returns 1, it will receive the data in the immediately
following FL_PASTE event.
*/
FL_DND_RELEASE = 23
};

/** \name When Conditions */
/*@{*/
/** These constants determine when a callback is performed.

\sa Fl_Widget::when();
\todo doxygen comments for values are incomplete and maybe wrong or unclear
*/
enum Fl_When { // Fl_Widget::when():
FL_WHEN_NEVER = 0, ///< Never call the callback
FL_WHEN_CHANGED = 1, ///< Do the callback only when the widget value changes
FL_WHEN_NOT_CHANGED = 2, ///< Do the callback whenever the user interacts with the widget
FL_WHEN_RELEASE = 4, ///< Do the callback when the button or key is released and the value changes
FL_WHEN_RELEASE_ALWAYS= 6, ///< Do the callback when the button or key is released, even if the value doesn't change
FL_WHEN_ENTER_KEY = 8, ///< Do the callback when the user presses the ENTER key and the value changes
FL_WHEN_ENTER_KEY_ALWAYS=10, ///< Do the callback when the user presses the ENTER key, even if the value doesn't change
FL_WHEN_ENTER_KEY_CHANGED=11 ///< ?
};

/*@}*/ // group: When Conditions

/** \name Mouse and Keyboard Events

This and the following constants define the non-ASCII keys on the
keyboard for FL_KEYBOARD and FL_SHORTCUT events.

\todo FL_Button and FL_key... constants could be structured better
(use an enum or some doxygen grouping ?)
\sa Fl::event_key() and Fl::get_key(int) (use ascii letters for all other keys):
*/

/*@{*/

// FIXME: These codes collide with valid Unicode keys

#define FL_Button 0xfee8 ///< A mouse button; use Fl_Button + n for mouse button n.
#define FL_BackSpace 0xff08 ///< The backspace key.
#define FL_Tab 0xff09 ///< The tab key.
#define FL_Enter 0xff0d ///< The enter key.
#define FL_Pause 0xff13 ///< The pause key.
#define FL_Scroll_Lock 0xff14 ///< The scroll lock key.
#define FL_Escape 0xff1b ///< The escape key.
#define FL_Home 0xff50 ///< The home key.
#define FL_Left 0xff51 ///< The left arrow key.
#define FL_Up 0xff52 ///< The up arrow key.
#define FL_Right 0xff53 ///< The right arrow key.
#define FL_Down 0xff54 ///< The down arrow key.
#define FL_Page_Up 0xff55 ///< The page-up key.
#define FL_Page_Down 0xff56 ///< The page-down key.
#define FL_End 0xff57 ///< The end key.
#define FL_Print 0xff61 ///< The print (or print-screen) key.
#define FL_Insert 0xff63 ///< The insert key.
#define FL_Menu 0xff67 ///< The menu key.
#define FL_Help 0xff68 ///< The 'help' key on Mac keyboards
#define FL_Num_Lock 0xff7f ///< The num lock key.
#define FL_KP 0xff80 ///< One of the keypad numbers; use FL_KP + n for number n.
#define FL_KP_Enter 0xff8d ///< The enter key on the keypad, same as Fl_KP+'\\r'.
#define FL_KP_Last 0xffbd ///< The last keypad key; use to range-check keypad.
#define FL_F 0xffbd ///< One of the function keys; use FL_F + n for function key n.
#define FL_F_Last 0xffe0 ///< The last function key; use to range-check function keys.
#define FL_Shift_L 0xffe1 ///< The lefthand shift key.
#define FL_Shift_R 0xffe2 ///< The righthand shift key.
#define FL_Control_L 0xffe3 ///< The lefthand control key.
#define FL_Control_R 0xffe4 ///< The righthand control key.
#define FL_Caps_Lock 0xffe5 ///< The caps lock key.
#define FL_Meta_L 0xffe7 ///< The left meta/Windows key.
#define FL_Meta_R 0xffe8 ///< The right meta/Windows key.
#define FL_Alt_L 0xffe9 ///< The left alt key.
#define FL_Alt_R 0xffea ///< The right alt key.
#define FL_Delete 0xffff ///< The delete key.

// These use the Private Use Area (PUA) of the Basic Multilingual Plane
// of Unicode. Guaranteed not to conflict with a proper Unicode character.

// These primarily map to the XFree86 keysym range
#define FL_Volume_Down 0xEF11 /* Volume control down */
#define FL_Volume_Mute 0xEF12 /* Mute sound from the system */
#define FL_Volume_Up 0xEF13 /* Volume control up */
#define FL_Media_Play 0xEF14 /* Start playing of audio */
#define FL_Media_Stop 0xEF15 /* Stop playing audio */
#define FL_Media_Prev 0xEF16 /* Previous track */
#define FL_Media_Next 0xEF17 /* Next track */
#define FL_Home_Page 0xEF18 /* Display user's home page */
#define FL_Mail 0xEF19 /* Invoke user's mail program */
#define FL_Search 0xEF1B /* Search */
#define FL_Back 0xEF26 /* Like back on a browser */
#define FL_Forward 0xEF27 /* Like forward on a browser */
#define FL_Stop 0xEF28 /* Stop current operation */
#define FL_Refresh 0xEF29 /* Refresh the page */
#define FL_Sleep 0xEF2F /* Put system to sleep */
#define FL_Favorites 0xEF30 /* Show favorite locations */

/*@}*/ // group: Mouse and Keyboard Events

/** \name Mouse Buttons

These constants define the button numbers for FL_PUSH and FL_RELEASE events.
\sa Fl::event_button()
*/

/*@{*/

#define FL_LEFT_MOUSE 1 ///< The left mouse button
#define FL_MIDDLE_MOUSE 2 ///< The middle mouse button
#define FL_RIGHT_MOUSE 3 ///< The right mouse button

/*@}*/ // group: Mouse Buttons


/** \name Event States

The following constants define bits in the Fl::event_state() value.
*/

/*@{*/ // group: Event States

// FIXME: it would be nice to have the modifiers in the upper 8 bit so that
// a unicode ke (24bit) can be sent as an unsigned with the modifiers.

#define FL_SHIFT 0x00010000 ///< One of the shift keys is down
#define FL_CAPS_LOCK 0x00020000 ///< The caps lock is on
#define FL_CTRL 0x00040000 ///< One of the ctrl keys is down
#define FL_ALT 0x00080000 ///< One of the alt keys is down
#define FL_NUM_LOCK 0x00100000 ///< The num lock is on
// most X servers do this?
#define FL_META 0x00400000 ///< One of the meta/Windows keys is down
// correct for XFree86
#define FL_SCROLL_LOCK 0x00800000 ///< The scroll lock is on
// correct for XFree86
#define FL_BUTTON1 0x01000000 ///< Mouse button 1 is pushed
#define FL_BUTTON2 0x02000000 ///< Mouse button 2 is pushed
#define FL_BUTTON3 0x04000000 ///< Mouse button 3 is pushed
#define FL_BUTTONS 0x7f000000 ///< Any mouse button is pushed
#define FL_BUTTON(n) (0x00800000<<(n)) ///< Mouse button n (n > 0) is pushed

#define FL_KEY_MASK 0x0000ffff ///< All keys are 16 bit for now
// FIXME: Unicode needs 24 bits!

#ifdef __APPLE__
# define FL_COMMAND FL_META ///< An alias for FL_CTRL on WIN32 and X11, or FL_META on MacOS X
# define FL_CONTROL FL_CTRL ///< An alias for FL_META on WIN32 and X11, or FL_CTRL on MacOS X
#else
# define FL_COMMAND FL_CTRL ///< An alias for FL_CTRL on WIN32 and X11, or FL_META on MacOS X
# define FL_CONTROL FL_META ///< An alias for FL_META on WIN32 and X11, or FL_CTRL on MacOS X
#endif // __APPLE__

/*@}*/ // group: Event States

/** \name Box Types
\brief FLTK standard box types
This enum defines the standard box types included with FLTK.
FL_NO_BOX means nothing is drawn at all, so whatever is already
on the screen remains. The FL_..._FRAME types only draw their edges,
leaving the interior unchanged. The blue color in Figure 1
is the area that is not drawn by the frame types.
\image html boxtypes.png "Figure 1: FLTK standard box types"
\image latex boxtypes.png "FLTK standard box types" width=10cm
\todo Description of boxtypes is incomplete.
See below for the defined enum Fl_Boxtype.
\see src/Fl_get_system_colors.cxx
*/
/*@{*/
enum Fl_Boxtype { // boxtypes (if you change these you must fix fl_boxtype.C):

FL_NO_BOX = 0, ///< nothing is drawn at all, this box is invisible
FL_FLAT_BOX, ///< a flat box
FL_UP_BOX, ///< see figure 1
FL_DOWN_BOX, ///< see figure 1
FL_UP_FRAME, ///< see figure 1
FL_DOWN_FRAME, ///< see figure 1
FL_THIN_UP_BOX, ///< see figure 1
FL_THIN_DOWN_BOX, ///< see figure 1
FL_THIN_UP_FRAME, ///< see figure 1
FL_THIN_DOWN_FRAME, ///< see figure 1
FL_ENGRAVED_BOX, ///< see figure 1
FL_EMBOSSED_BOX, ///< see figure 1
FL_ENGRAVED_FRAME, ///< see figure 1
FL_EMBOSSED_FRAME, ///< see figure 1
FL_BORDER_BOX, ///< see figure 1
_FL_SHADOW_BOX, ///< see figure 1
FL_BORDER_FRAME, ///< see figure 1
_FL_SHADOW_FRAME, ///< see figure 1
_FL_ROUNDED_BOX, ///< see figure 1
_FL_RSHADOW_BOX, ///< see figure 1
_FL_ROUNDED_FRAME, ///< see figure 1
_FL_RFLAT_BOX, ///< see figure 1
_FL_ROUND_UP_BOX, ///< see figure 1
_FL_ROUND_DOWN_BOX, ///< see figure 1
_FL_DIAMOND_UP_BOX, ///< see figure 1
_FL_DIAMOND_DOWN_BOX, ///< see figure 1
_FL_OVAL_BOX, ///< see figure 1
_FL_OSHADOW_BOX, ///< see figure 1
_FL_OVAL_FRAME, ///< see figure 1
_FL_OFLAT_BOX, ///< see figure 1
_FL_PLASTIC_UP_BOX, ///< plastic version of FL_UP_BOX
_FL_PLASTIC_DOWN_BOX, ///< plastic version of FL_DOWN_BOX
_FL_PLASTIC_UP_FRAME, ///< plastic version of FL_UP_FRAME
_FL_PLASTIC_DOWN_FRAME, ///< plastic version of FL_DOWN_FRAME
_FL_PLASTIC_THIN_UP_BOX, ///< plastic version of FL_THIN_UP_BOX
_FL_PLASTIC_THIN_DOWN_BOX, ///< plastic version of FL_THIN_DOWN_BOX
_FL_PLASTIC_ROUND_UP_BOX, ///< plastic version of FL_ROUND_UP_BOX
_FL_PLASTIC_ROUND_DOWN_BOX, ///< plastic version of FL_ROUND_DOWN_BOX
_FL_GTK_UP_BOX, ///< gtk+ version of FL_UP_BOX
_FL_GTK_DOWN_BOX, ///< gtk+ version of FL_DOWN_BOX
_FL_GTK_UP_FRAME, ///< gtk+ version of FL_UP_FRAME
_FL_GTK_DOWN_FRAME, ///< gtk+ version of FL_DOWN_RAME
_FL_GTK_THIN_UP_BOX, ///< gtk+ version of FL_THIN_UP_BOX
_FL_GTK_THIN_DOWN_BOX, ///< gtk+ version of FL_THIN_DOWN_BOX
_FL_GTK_THIN_UP_FRAME, ///< gtk+ version of FL_UP_FRAME
_FL_GTK_THIN_DOWN_FRAME, ///< gtk+ version of FL_THIN_DOWN_FRAME
_FL_GTK_ROUND_UP_BOX, ///< gtk+ version of FL_ROUND_UP_BOX
_FL_GTK_ROUND_DOWN_BOX, ///< gtk+ version of FL_ROUND_DOWN_BOX
FL_FREE_BOXTYPE ///< the first free box type for creation of new box types
};
extern FL_EXPORT Fl_Boxtype fl_define_FL_ROUND_UP_BOX();
#define FL_ROUND_UP_BOX fl_define_FL_ROUND_UP_BOX()
#define FL_ROUND_DOWN_BOX (Fl_Boxtype)(fl_define_FL_ROUND_UP_BOX()+1)
extern FL_EXPORT Fl_Boxtype fl_define_FL_SHADOW_BOX();
#define FL_SHADOW_BOX fl_define_FL_SHADOW_BOX()
#define FL_SHADOW_FRAME (Fl_Boxtype)(fl_define_FL_SHADOW_BOX()+2)
extern FL_EXPORT Fl_Boxtype fl_define_FL_ROUNDED_BOX();
#define FL_ROUNDED_BOX fl_define_FL_ROUNDED_BOX()
#define FL_ROUNDED_FRAME (Fl_Boxtype)(fl_define_FL_ROUNDED_BOX()+2)
extern FL_EXPORT Fl_Boxtype fl_define_FL_RFLAT_BOX();
#define FL_RFLAT_BOX fl_define_FL_RFLAT_BOX()
extern FL_EXPORT Fl_Boxtype fl_define_FL_RSHADOW_BOX();
#define FL_RSHADOW_BOX fl_define_FL_RSHADOW_BOX()
extern FL_EXPORT Fl_Boxtype fl_define_FL_DIAMOND_BOX();
#define FL_DIAMOND_UP_BOX fl_define_FL_DIAMOND_BOX()
#define FL_DIAMOND_DOWN_BOX (Fl_Boxtype)(fl_define_FL_DIAMOND_BOX()+1)
extern FL_EXPORT Fl_Boxtype fl_define_FL_OVAL_BOX();
#define FL_OVAL_BOX fl_define_FL_OVAL_BOX()
#define FL_OSHADOW_BOX (Fl_Boxtype)(fl_define_FL_OVAL_BOX()+1)
#define FL_OVAL_FRAME (Fl_Boxtype)(fl_define_FL_OVAL_BOX()+2)
#define FL_OFLAT_BOX (Fl_Boxtype)(fl_define_FL_OVAL_BOX()+3)

extern FL_EXPORT Fl_Boxtype fl_define_FL_PLASTIC_UP_BOX();
#define FL_PLASTIC_UP_BOX fl_define_FL_PLASTIC_UP_BOX()
#define FL_PLASTIC_DOWN_BOX (Fl_Boxtype)(fl_define_FL_PLASTIC_UP_BOX()+1)
#define FL_PLASTIC_UP_FRAME (Fl_Boxtype)(fl_define_FL_PLASTIC_UP_BOX()+2)
#define FL_PLASTIC_DOWN_FRAME (Fl_Boxtype)(fl_define_FL_PLASTIC_UP_BOX()+3)
#define FL_PLASTIC_THIN_UP_BOX (Fl_Boxtype)(fl_define_FL_PLASTIC_UP_BOX()+4)
#define FL_PLASTIC_THIN_DOWN_BOX (Fl_Boxtype)(fl_define_FL_PLASTIC_UP_BOX()+5)
#define FL_PLASTIC_ROUND_UP_BOX (Fl_Boxtype)(fl_define_FL_PLASTIC_UP_BOX()+6)
#define FL_PLASTIC_ROUND_DOWN_BOX (Fl_Boxtype)(fl_define_FL_PLASTIC_UP_BOX()+7)

extern FL_EXPORT Fl_Boxtype fl_define_FL_GTK_UP_BOX();
#define FL_GTK_UP_BOX fl_define_FL_GTK_UP_BOX()
#define FL_GTK_DOWN_BOX (Fl_Boxtype)(fl_define_FL_GTK_UP_BOX()+1)
#define FL_GTK_UP_FRAME (Fl_Boxtype)(fl_define_FL_GTK_UP_BOX()+2)
#define FL_GTK_DOWN_FRAME (Fl_Boxtype)(fl_define_FL_GTK_UP_BOX()+3)
#define FL_GTK_THIN_UP_BOX (Fl_Boxtype)(fl_define_FL_GTK_UP_BOX()+4)
#define FL_GTK_THIN_DOWN_BOX (Fl_Boxtype)(fl_define_FL_GTK_UP_BOX()+5)
#define FL_GTK_THIN_UP_FRAME (Fl_Boxtype)(fl_define_FL_GTK_UP_BOX()+6)
#define FL_GTK_THIN_DOWN_FRAME (Fl_Boxtype)(fl_define_FL_GTK_UP_BOX()+7)
#define FL_GTK_ROUND_UP_BOX (Fl_Boxtype)(fl_define_FL_GTK_UP_BOX()+8)
#define FL_GTK_ROUND_DOWN_BOX (Fl_Boxtype)(fl_define_FL_GTK_UP_BOX()+9)

// conversions of box types to other boxtypes:
/**
Get the filled version of a frame.
If no filled version of a given frame exists, the behavior of this function
is undefined and some random box or frame is returned.
*/
inline Fl_Boxtype fl_box(Fl_Boxtype b) {
return (Fl_Boxtype)((b<FL_UP_BOX||b%4>1)?b:(b-2));
}
/**
Get the "pressed" or "down" version of a box.
If no "down" version of a given box exists, the behavior of this function
is undefined and some random box or frame is returned.
*/
inline Fl_Boxtype fl_down(Fl_Boxtype b) {
return (Fl_Boxtype)((b<FL_UP_BOX)?b:(b|1));
}
/**
Get the unfilled, frame only version of a box.
If no frame version of a given box exists, the behavior of this function
is undefined and some random box or frame is returned.
*/
inline Fl_Boxtype fl_frame(Fl_Boxtype b) {
return (Fl_Boxtype)((b%4<2)?b:(b+2));
<