Browse Source

Update fltk to fltk-1.4.x-r12630

mingodad 8 years ago
parent
commit
fb50d2e34c
100 changed files with 13035 additions and 15770 deletions
  1. 15 2
      fltk/ANNOUNCEMENT
  2. 145 3767
      fltk/CHANGES
  3. 68 45
      fltk/CMakeLists.txt
  4. 530 530
      fltk/COPYING
  5. 57 56
      fltk/CREDITS
  6. 684 576
      fltk/FL/Enumerations.H
  7. 307 226
      fltk/FL/Fl.H
  8. 75 76
      fltk/FL/Fl_Adjuster.H
  9. 43 44
      fltk/FL/Fl_BMP_Image.H
  10. 73 79
      fltk/FL/Fl_Bitmap.H
  11. 60 65
      fltk/FL/Fl_Box.H
  12. 330 320
      fltk/FL/Fl_Browser.H
  13. 374 374
      fltk/FL/Fl_Browser_.H
  14. 180 173
      fltk/FL/Fl_Button.H
  15. 88 88
      fltk/FL/Fl_Cairo.H
  16. 84 85
      fltk/FL/Fl_Cairo_Window.H
  17. 152 153
      fltk/FL/Fl_Chart.H
  18. 114 115
      fltk/FL/Fl_Check_Browser.H
  19. 40 53
      fltk/FL/Fl_Check_Button.H
  20. 107 101
      fltk/FL/Fl_Choice.H
  21. 170 132
      fltk/FL/Fl_Clock.H
  22. 194 198
      fltk/FL/Fl_Color_Chooser.H
  23. 38 75
      fltk/FL/Fl_Copy_Surface.H
  24. 114 113
      fltk/FL/Fl_Counter.H
  25. 143 588
      fltk/FL/Fl_Device.H
  26. 89 89
      fltk/FL/Fl_Dial.H
  27. 68 70
      fltk/FL/Fl_Double_Window.H
  28. 42 40
      fltk/FL/Fl_Export.H
  29. 112 113
      fltk/FL/Fl_File_Browser.H
  30. 245 238
      fltk/FL/Fl_File_Chooser.H
  31. 159 159
      fltk/FL/Fl_File_Icon.H
  32. 97 98
      fltk/FL/Fl_File_Input.H
  33. 39 39
      fltk/FL/Fl_Fill_Dial.H
  34. 38 39
      fltk/FL/Fl_Fill_Slider.H
  35. 53 54
      fltk/FL/Fl_Float_Input.H
  36. 47 47
      fltk/FL/Fl_FormsBitmap.H
  37. 54 54
      fltk/FL/Fl_FormsPixmap.H
  38. 80 80
      fltk/FL/Fl_Free.H
  39. 43 44
      fltk/FL/Fl_GIF_Image.H
  40. 249 233
      fltk/FL/Fl_Gl_Window.H
  41. 193 0
      fltk/FL/Fl_Gl_Window_Driver.H
  42. 504 0
      fltk/FL/Fl_Graphics_Driver.H
  43. 257 255
      fltk/FL/Fl_Group.H
  44. 92 88
      fltk/FL/Fl_Help_Dialog.H
  45. 453 453
      fltk/FL/Fl_Help_View.H
  46. 52 54
      fltk/FL/Fl_Hold_Browser.H
  47. 37 38
      fltk/FL/Fl_Hor_Fill_Slider.H
  48. 37 38
      fltk/FL/Fl_Hor_Nice_Slider.H
  49. 46 47
      fltk/FL/Fl_Hor_Slider.H
  50. 37 38
      fltk/FL/Fl_Hor_Value_Slider.H
  51. 272 245
      fltk/FL/Fl_Image.H
  52. 80 51
      fltk/FL/Fl_Image_Surface.H
  53. 292 290
      fltk/FL/Fl_Input.H
  54. 506 506
      fltk/FL/Fl_Input_.H
  55. 180 224
      fltk/FL/Fl_Input_Choice.H
  56. 52 53
      fltk/FL/Fl_Int_Input.H
  57. 46 47
      fltk/FL/Fl_JPEG_Image.H
  58. 51 52
      fltk/FL/Fl_Light_Button.H
  59. 37 38
      fltk/FL/Fl_Line_Dial.H
  60. 24 24
      fltk/FL/Fl_Menu.H
  61. 191 176
      fltk/FL/Fl_Menu_.H
  62. 104 81
      fltk/FL/Fl_Menu_Bar.H
  63. 87 80
      fltk/FL/Fl_Menu_Button.H
  64. 450 436
      fltk/FL/Fl_Menu_Item.H
  65. 58 59
      fltk/FL/Fl_Menu_Window.H
  66. 55 54
      fltk/FL/Fl_Multi_Browser.H
  67. 105 39
      fltk/FL/Fl_Multi_Label.H
  68. 61 62
      fltk/FL/Fl_Multiline_Input.H
  69. 57 58
      fltk/FL/Fl_Multiline_Output.H
  70. 220 295
      fltk/FL/Fl_Native_File_Chooser.H
  71. 37 38
      fltk/FL/Fl_Nice_Slider.H
  72. 27 27
      fltk/FL/Fl_Object.H
  73. 63 64
      fltk/FL/Fl_Output.H
  74. 79 78
      fltk/FL/Fl_Overlay_Window.H
  75. 48 49
      fltk/FL/Fl_PNG_Image.H
  76. 44 45
      fltk/FL/Fl_PNM_Image.H
  77. 79 80
      fltk/FL/Fl_Pack.H
  78. 128 153
      fltk/FL/Fl_Paged_Device.H
  79. 257 257
      fltk/FL/Fl_Pdf.H
  80. 88 104
      fltk/FL/Fl_Pixmap.H
  81. 2 2
      fltk/FL/Fl_Plugin.H
  82. 95 96
      fltk/FL/Fl_Positioner.H
  83. 272 229
      fltk/FL/Fl_PostScript.H
  84. 262 261
      fltk/FL/Fl_Preferences.H
  85. 139 211
      fltk/FL/Fl_Printer.H
  86. 73 74
      fltk/FL/Fl_Progress.H
  87. 26 26
      fltk/FL/Fl_RGB_Image.H
  88. 37 38
      fltk/FL/Fl_Radio_Button.H
  89. 37 38
      fltk/FL/Fl_Radio_Light_Button.H
  90. 37 38
      fltk/FL/Fl_Radio_Round_Button.H
  91. 82 0
      fltk/FL/Fl_Rect.H
  92. 55 56
      fltk/FL/Fl_Repeat_Button.H
  93. 51 52
      fltk/FL/Fl_Return_Button.H
  94. 48 49
      fltk/FL/Fl_Roller.H
  95. 45 49
      fltk/FL/Fl_Round_Button.H
  96. 40 40
      fltk/FL/Fl_Round_Clock.H
  97. 140 0
      fltk/FL/Fl_SVG_Image.H
  98. 190 0
      fltk/FL/Fl_Screen_Driver.H
  99. 206 192
      fltk/FL/Fl_Scroll.H
  100. 112 112
      fltk/FL/Fl_Scrollbar.H

+ 15 - 2
fltk/ANNOUNCEMENT

@@ -1,2 +1,15 @@
-The initial FLTK 1.3 is based on the final 1.1.8.
-
+FLTK 1.4 is based on the final release of FLTK 1.3.4.
+
+Technically the branch was forked earlier, but all changes in FLTK 1.3.4
+have also been (modified and) committed in branch-1.3-porting, which is
+the base of branch-1.4.
+
+FLTK 1.4 is intended to be mostly API compatible with FLTK 1.3.4 so
+you don't need to change source code when you switch to FLTK 1.4.
+
+However, the platform dependent code in FLTK 1.4 was rewritten to enable
+better porting to new platforms. Basically all platform dependent code
+has been isolated and implemented in virtual methods of "driver" classes.
+See src/drivers and subdirectories.
+
+More to come ...

+ 145 - 3767
fltk/CHANGES

@@ -1,3770 +1,148 @@
-CHANGES IN FLTK 1.3.3                                              RELEASED: MMM DD YYYY
-
-	- on Linux/Unix, class Fl_Native_File_Chooser uses file dialogs of the Gnome
-	  environment (provided by the libgtk dynamic library), when this is available,
-	  and falls back to FLTK's Fl_File_Chooser, when it's not (STR #3088).
-        - added class Fl_Copy_Surface allowing to copy graphical data to the clipboard 
-	  in a cross-platform way (STR #3058).
-	- added support for pasting graphical data from the clipboard to an FLTK widget.
-	- added class Fl_Image_Surface allowing to draw into an Fl_Image object. 
-	- removed constraint that lines are limited to 1024 chars in widget labels and browser lines (STR #2990).
-	- fix crash if Fl_Window::flush() was called, but window not shown() (STR #3028).
-	- new method Fl::scheme_is(const char *name) returns 1 if current scheme is name.
-	- Fixed recent MinGW build WRT configure not finding strcasecmp() (STR #2994).
-	  Note: This fix is temporary and should be revisited later.
-	- Fixed missing libdl dependency in CMake builds (STR #2977).
-	- Fixed segfault in fl_set_fonts_xft.cxx when loading fonts not named
-	  as expected (STR #2976).
-	- Removed autoconf/configure and CMake tests and defines for
-	  unused function strtoll().
-	- Fixed access of protected member (STR #2903)
-	- Implemented support for the Mac OS text input system that deals with character composition
-	  and input of languages with large character sets (e.g., Chinese and Japanese). This
-	  implementation has been reported to work well for Chinese. Superficial testing suggests
-	  it's also operational for Japanese. In-depth testing remains needed though.
-	- Mac OS version of Fl_Native_File_Chooser: when using filters in a save file dialog,
-	  the output file extension gets changed when the user modifies the output file type.
-	- Removed the now unused src/Fl_mac.cxx
-	- Fixed various Mac specific opengl issues (STR #2944)
-        - Added new method Fl_Widget::top_window() (STR #2948)
-        - Added new method Fl_Widget::top_window_offset() (part of STR #2944)
-	- Added ability to get notifications whenever the clipboard changes (STR#2636)
-	  New methods:
-	      Fl::add_clipboard_notify(Fl_Clipboard_Notify_Handler h, void *data = 0)
-	      Fl::remove_clipboard_notify(Fl_Clipboard_Notify_Handler h)
-        - Fl_Tree_Item: added four new public accessor methods:
-	    label_x(), label_y(), label_w(), label_h().
-	    (Useful for new item_draw_callback() ABI feature)
-
-    1.3.3 ABI FEATURES
-	  (To enable the following ABI features, put: #define FLTK_ABI_VERSION 10303
-	  at the top of your FL/Enumerations.H and rebuild FLTK and your app)
+Changes in FLTK 1.4.0					Released: ??? ?? 2017
 
-	- Made Fl_Help_View::handle() public and Fl_Help_View::draw() protected
-	  to enable inheritance and for consistency (STR #2834).
-	  Note: both methods were private.
-	- Added Fl_Table::tab_cell_nav() for controlling Tab key navigation of table
-	- Added Fl_Tree::get_selected_items(), returns the selected items as an array
-        - Added Fl_Tree::item_draw_callback(), letting one define a custom draw function
-	           for Fl_Tree_Item's.
-	- Fl_Tree: various related changes:
-	    o Added horizontal scrollbar
-	    o Separated draw() and tree size calculation
-	    o Added new public methods:
-	        > resize()           -- uses optimized dim calc, avoids tree recalc
-		> next_item()        -- added parameters: direction, visibility
-		> extend_selection() -- added parameters, improved algorithm
-		> calc_dimensions()  -- calc tix/y/w/h, tox/y/w/h and scrollbars
-		> calc_tree()        -- calc tree_w/tree_h
-		> recalc_tree()      -- schedules calc_tree()
-		> first_visible_item(), last_visible_item(), next_visible_item()
-		> first_selected_item(), last_selected_item(), next_selected_item()
-	    o Added protected variables:
-	        > _tix/y/w/h      -- tree widget 'inner' dimension
-		> _tox/y/w/h      -- tree widget 'outer' dimension
-		> _tree_w,_tree_h -- entire tree hierarchy width/height
-	    o Deprecated:
-	        > item_clicked() -- use callback_item() instead
-		> first_visible() -- use first_visible_item() instead
-		> last_visible() -- use last_visible_item() instead
+  General Information about this Release
 
-	- Fl_Tree_Item: various related changes:
-	    o Added Fl_Tree ptr: needed for auto-recalc when item modified directly
-	    o Added new methods tree(), recalc_tree()
-	    o Added new ctor that accepts Fl_Tree*
-	    o draw() parameters changed to include tree size calculations
-	    o Deprecated:
-	       > ctor using Fl_Tree_Prefs parameter (Fl_Tree* version better,
-	         and must be used for 1.3.3 ABI features to work correctly)
-	       > next_displayed() -- use next_visible() instead
-	       > prev_displayed() -- use prev_visible() instead
-	- test/tree: added tests for newly added features
+  - FLTK 1.4.0 is based on FLTK 1.3.4 (released Nov 15 2016),
+    see CHANGES_1.3 for more information.
 
-CHANGES IN FLTK 1.3.2                                              RELEASED: Dec 12 2012
-
-	- Removed unnecessary drawing calls (STR #2898)
-        - Fixed regression in FLTK 1.3.1 for unbundled Mac OS FLTK applications that
-	  did not appear in dock nor have a menu bar (STR #2890).
-        - Fl_Table::clear() now calls table->clear() for consistency. (STR #2889)
-	- Fixed Fl_Scroll widget that fails under Mac OS X 10.8 and retina display (STR #2887).
-	- Prevents scrollbars from drawing when widget is sized too small to be visible (STR #2886).
-	- Documented how to make a Mac OS X FLTK application launchable by dropping files on its icon.
-	- Fixed a Mac-specific issue appeared with OS 10.8 (Mountain Lion): long delay before
-	  opening when the application is started by dragging a file on the application icon.
-	- Fixed use of PNG image from in-memory data (STR #2884).
-	- Added static Fl_RGB_Image::max_size(size_t) to limit the maximum memory size allowed to
-	  RGB images (STR #2881).
-
-CHANGES IN FLTK 1.3.1
-
-	- Fixed utf_strncasecmp and utf_strcasecmp
-	- Moved all inline constructors into source file to avoid bad DLLs
-	- Fixed Fl_Widget::copy_label() and Fl_Window::copy_label() when
-	  called with the old label() (STR #2836)
-	- Fixed Fl_Input_::maximum_size() documentation and replace() method
-	  to honor maximum_size() as number of allowed characters (STR #2747).
-	- Fixed a potential crash if Fl_Double_Window::flush() was called
-	  before show()
-	- Fixed regression (in FLTK 1.3.0) that could clear a radio
-	  button by using the keyboard (space or shortcut) (STR #2748)
-	- Fixed fl_pie() drawing too small on X11 (STR #2703)
-	- Fixed Fl_Menu issue with unusual menu flags (STR #2680)
-	- Fixed Windows DLL import of fl_xid() (STR #2670)
-	- Added Fl::screen_work_area() functions that compute the work area
-	of a screen. These functions improve the positioning of menus.
-	Changed Fl::x(), Fl::y(), Fl::w(), Fl::h() functions
-	to return the origin and size of the work area of the main screen
-	(STR #2695 + 2697)
-	- Created the FL_SCREEN_CONFIGURATION_CHANGED event that is triggered
-	when a screen is added, removed, moved or when resolution is changed
-	(STR #2600)
-	- Improved the description of page size and orientation by 
-	Fl_PostScript_File_Device.
-	- Added support for horizontal wheel movement under X11 and MSWindows Vista
-	and above (STR #2644).
-
-    1.3.1 ABI FEATURES
-	  (To enable the following ABI features, put: #define FLTK_ABI_VERSION 10301
-	  at the top of your FL/Enumerations.H and rebuild FLTK and your app)
-        - Fl_Tree optimized to support large trees (eg. 100k items):
-	  Added _next_sibling and _prev_sibling to Fl_Tree_Item class,
-	  and support methods.
-
-
-CHANGES IN FLTK 1.3.0
-
-	  New Features
-
-	- Added UTF-8 Unicode support throughout FLTK and Fluid
-	- Added Fl_Tree widget for hierarchical views
-	- Added Fl_Table widget for widget layout
-	- Added Fl_Native_Filechooser as a widget and global options
-	- Added printing support (Fl_Printer class and friends) for native
-	  printing on Windows and Mac OS X, PostScript printing on X11
-	  with CUPS or lp, and PostScript file output on all platforms
-	- Added basic Fl_Device abstraction layer for all drawing functions
-	- Moved OS X code base to the more modern Cocoa toolkit thanks
-	  to the awesome work of Manolo Gouy (STR #2221)
-
-	  API and ABI compatibility to FLTK 1.1.x
-
-	- All strings are expected to be in UTF-8 Unicode encoding
-	- Replaced Fl_Scroll::position(int,int) with scroll_to(int,int)
-	  to avoid overriding Fl_Widget::position(int,int) (STR #1303)
-	- Although FLTK 1.3 maintains source code compatibility as good
-	  as possible, the binary interface changed considerably.
-	- Updated the bundled libpng to v1.5.1 (released Feb  3, 2011)
-	- Updated the bundled libjpeg to v8c   (released Jan 16, 2011)
-	- Updated the bundled zlib to v1.2.5   (released Apr 19, 2010)
-
-	  API enhancements and changes
-
-	- Changed font index to 32 bit
-	- Changed font size to 32 bit
-        - Changed widget coordinates to 32 bit
-	- Corrected const methods of Fl_Text_{Buffer|Display|Selection}
-	  to be declared const, corrected an Fl_Text_Buffer attrib. typo
-	- All draw() methods of widgets are now protected (STR #2142).
-	- Changed Fl_Group::clip_children() to public (STR #2017)
-	- Changed socket library to winsock2 (ws2_32.dll) instead of 
-	  wsock32.dll for Windows. The dll is now loaded dynamically only 
-	  if/when needed.	  
-	- Changed hide() and show() methods. They are now virtual from 
-	  Fl_Widget.
-	- Added new label and image alignments (STR #2269)
-	- Added global UI options (STR #2471)
-	- Added class Fl_Widget_Tracker to simplify safe handling of widget
-	  deletion in callbacks. This is used in Fl_Widget::do_callback()
-	  to prevent accessing widgets after deletion in the callback.
-	- Added sorting to Fl_Browser_ (STR #2113)
-	- Added new method client_area() for easier positioning of children
-	  in Fl_Tabs (STR #2480)
-	- Added interface to set color chooser mode (STR #2407)
-	- Added Fl_Menu_::find_item by callback
-	- Added loading jpeg images from memory
-        - Added support for shortcuts for Fl_Input_, Fl_Value_Input, and 
-	  Fl_Text_Display derived widgets (STR #1770)
-        - Added Fl_Menu_ methods: insert(), find_index(), clear_submenu()
-	- Hotspot behavior of fl_message() and other common dialogs is now
-	  optional (STR #2561).
-	- Common dialogs like fl_message() and fl_ask() can now have a window
-	  title (STR #2562).
-
-	  IDE support and command line build options
-
-	- FLTK now supports Apple Xcode 3, MS VisualC 2008, and
-	  MS VisualC 2010. MS VisualC 6 support is maintained as a
-	  compatibility base for VisualC.net, etc. . FLTK continues
-	  to support configure/make and improved CMake build files.
-	- Added step by step README's for MSWindows, OS X, and four
-	  Linux distros.
-	- Added "ide" subdirectory for all IDE support files
-	- Added template to generate new projects with Xcode.
-	- Added --enable-cairo and --enable-cairoext  configure options.
-	- redesigned CMake files (STR #2317).
-	- The new configure option --enable-x11 (lowercase 'x') enables
-	  Cygwin builds under Windows (with --enable-cygwin) to use X11
-	  instead of GDI drawing (STR #2147, #2183) and is ignored otherwise.
-	- Changed "fltk-config --post foo" to create an application
-	  bundle rather than attaching a resource fork.
-	- Changed default for configure option --with-links for common
-	  misspellings on case sensitive file systems like Unix/Linux.
-	  The new default is --without-links; use --with-links on
-	  Unix/Linux only if you need the links (e.g. lowercase '.h')
-
-	  Fluid
-
-	- Added argument-less constructor in Fluid Widget Class
-	- Added jpeg support to Fluid image() element
-	- Added binary data type to Fluid
-	- Empty functions in Fluid no longer create an
-	  implementation (STR #2259)
-	- Fixed internationalisation of menus using Fluid (STR #2246)
-	- Fixed menu item counting issue in Fluid (STR #2322)
-	- Fixed lost top item in Fluid's tree browser (STR #2233)
-	- Fixed Fluid dependency on X11 (STR #2261)
-	- Fixed Fluid textcolor output (STR #1992)
-	- Fixed wrong default value of Fl_Spinner in Fluid (STR #1991)
-
-	  Documentation
-
-	- Added documentation for event delivery (STR #1983)
-	- Added Fl_Scroll::bbox() documentation (STR #1893)
-	- Updated documentation for Fl_Input_
-	- Updated Copyright dates to 2010 (STR #2036)
-	- Updated mirror sites in documentation (STR #2220)
-	- Fixed documentation for Fl_Progress (STR #2209)
-	- Fixed documentation (added missing COMCTL32.LIB dependency)
-
-	  Other Improvements
-
-	- Added drag'n'drop support for Fl_Text_*
-	- Added visual feedback for button shortcuts (STR #2372)
-	- Added callback when double-clicking file in a file chooser
-	  (STR #2346)
-	- Added alternative Xft font names (STR #2215)
-	- Added mouse!=0 check in Fl_Glut_Window::handle (STR #2381)	
-	- Added indexing to Fl_Preferences
-	- Added OS X cursor control to Fl_Input (STR #2169)
-	- Added menu shortcut alignment for OS X
-	- Added drop box to UTF-8 test that will show the UTF-8 encoding
-	  for the first dropped character
-	- Added flexible gap size for text buffer (STR #2046)
-	- Added clarification to Fl_GL_Window mode function (STR #1945)
-	- Added alternative text input awareness on OS X 
-	- Improved handling of composed keys in OS X 10.5 and up
-	- Improved stability of fl_read_image (STR #2021)
-	- Much faster fl_read_image() for Windows (STR #2387).
-	- Improved support for faulty X11 clients (STR #2385)
-	- Integrated default menu into Demo test app	
-	- Replaced _WIN32 symbols that had come with UTF-8 and the
-	  new Fl_Table widget with WIN32
-	- Widgets now remove stale entries from the default callback
-	  queue when they are deleted (STR #2302)
-	- Managing all Widget flags in a single location now (STR #2161)
-	- File chooser preview now recognizes UTF-8 encoded 
-	  text files (STR #2218)
-	- Setting a default font for Xft (STR #2216)
-	- Restructured the unittest application
-	- Fl_Preferences.H now doesn't include windows.h any more
-	  (Windows only, STR #2173).
-	- Fl_Window::draw() now doesn't reset its x/y-coordinates to 0
-	  anymore before drawing itself and its children.
-	- Fl_Help_View handles HTML2 font color specification (STR #890)
-	- Widgets now remove themselves from their parent group (if any),
-	  when destroyed (STR #1894)
-	- Changed Fl_Group and Fl_Scroll to resize themselves before
-	  resizing their children (STR #2032)
-
-	  Bug Fixes
-
-	- Fixed potential crash in fl_xid() on Linux (STR #2635)
-	- Fixed keyboard navigation in fl_choice() (STR #2591)
-	- Fixed alpha blending under X11 when line data size != 0 (STR #2606)
-	- Fixed Fl_Tabs selection border drawing, if tabs are at the bottom
-	  of the widget (STR #2480)
-	- Fixed Compiling with mingw-w64 (STR #2308).
-	- Fixed crashes when detecting illegal UTF-8 sequences
-	  in Fl_Text_* widgets (STR #2348)
-	- Fixed Fl_Text_Display Tabulator calculations (STR #2450)
-	- Fixed file access code to use UTF-8 strings (STR #2440)
-	- Fixed ARM Unicode cross compilation issue (STR #2432)
-	- Fixed xclass support for Fl_Window (STR #2053)
-	- Fixed Caps Lock handling in X11/XIM (STR #2366)
-	- Fixed handling of missing fonts in Xft (STR #2355)
-	- Fixed OpenGL hide/show issue in OS X (STR #2260)
-	- Fixed File Chooser preview hang if a device was choosen
-	- Fixed blinking of selection when the mouse was dragged 
-	  outside of the Fl_Text_* widget
-	- Fixed Unicode support for Fl_Text_* widgets
-	- Fixed menu and shortcut handling (STR #2243)
-	- Fixed fltk-config to give --libs on one line (STR #2408)
-	- Fixed outside label redraw damage areas (STR #2436)
-	- Fixed compile errors when HAVE_LIBJPEG was not defined 
-	  (STR #2382)
-	- Fixed special handling for ISO back-tab keycode (STR #2369)
-	- Fixed static allocation in Fl_Tabs (STR #2370)
-	- Fixed Fl_Widget::measure_label() to const (STR #2406)
-	- Fixed unbalanced Windows OleInitialize/OleUnitialize calls
-	  when loading/unloading the FLTK dll (STR #2417)
-	- Fixed X11/XDBE double buffering (STR #2152, #2197)
-	- Fixed menu and tooltip window animation bug under X11 (compiz)
-	  by setting an appropriate window type (STR #2082)
-	- Fixed max. fd calculation, if USE_POLL is enabled (STR #2324)
-	- Fixed clipping for offscreen rendering (OSX, STR #2330)
-	- Fixed possibility of wrong flags() in Fl_Window::iconlabel()
-	  (STR #2161)
-	- Fixed Scrollbar events when max is less than min (STR #2283)
-	- Fixed crash in test/Editor when freeing buffer 
-	  too soon (STR #2294) 
-	- Fixed Fl_Preferences Cygwin wide character bug (STR #2164)
-	- Fixed sorting in Fl_Browser - last item would not 
-	  be sorted (STR #2300)
-	- Fixed window levels in OS X Cocoa (STR #2316)
-	- Fixed a buffer overflow in fl_utf8from_mb() (STR #2279)
-	- Fixed a Windows GDI leak when testing alpha blending capabilities
-	- Fixed crashes for recursive common dialogs (STR #1986, #2150)
-	- Fixed a name conflict with new (VS 2008 Express) winsock2.h
-	  versions and another conflict that produced compile errors
-	  with VS 2008 Express (STR #2301)
-	- Fixed all color related calls to Fl_Color type (STR #2208)
-	- Fixed Fl_Choice contrast with light-on-dark settings (STR #2219)
-	- Fixed X server "lock", if a modal dialog window is opened
-	  while a menu is active (STR #1986)
-	- Fixed Windows compile bug with "#define USE_COLORMAP 0"
-	  (STR #2241)
-	- Fixed glibc 2.10 compiler problems (Fedora 11 and others)
-	  with scandir() and strchr() (STR #2222)
-	- Fixed OpenGL shared context handling (STR #2135)
-	- Fixed gray-scale images with alpha channel (STR #2105)
-	- Fixed unexpected shortcut behavior for Win32 (STR #2199)
-	- Fixed fl_draw_image to obey the alpha channel (OS X only)
-	- Fix for multiple popups, when dragging and calling fl_alert()
-	  and friends from the callback (STR #2159)
-	- Fixed control key keycodes with modifiers on OS X
-	- Fixed bad system menu handling in OS X (STR #2153)
-	- Fixed File Input mouse pointer dragging (STR #2181)
-	- Fixed 'del' keycode on OS X
-	- Fixed OS X support for sending and receiving dnd data as UTF-8
-	- Fixed Copy/Paste operations with UTF-8, UTF-16 support and
-	  fltk1.1 compatibility. (STR #2104, 2121).
-	- Fixed fl_set_spot() for Windows (STR #2101)
-	- Fixed callback that would not be called when shortcut was used 
-	  with radio and toggle buttons in default FL_RELEASE mode.
-	- Fixed a problem with TrackMouseEvent() (Windows only) that would
-	  generate wrong FL_LEAVE events with subwindows. TrackMouseEvent
-	  is now enabled by default (it was disabled for GNU compilers).
-	  It can be disabled by defining NO_TRACK_MOUSE.
-	  Improved test/subwindow.cxx (STR #2079)
-	- Fixed menu position close to screen border (STR #2057)
-	- Fixed adding an idle handler during a draw() call (STR #1950)
-	- Fixed first modifier key event (STR #1952)
-	- Fixed Fl_Scroll inside Fl_Scroll (STR #265)
-
-	  Removed features
-
-	- Removed Watcom compiler support because it was introduced in
-	  1.1.6 as a partial solution and never completed.
-	- Removed an XForms compatibility "feature" that prevented the
-	  down array of Fl_Menu_Button from drawing (STR #2141).
-	- Removed support for gcc 2.x (or older)
-	- Removed redundant Fl_Group casts
-
-CHANGES IN FLTK 1.1.9
-
-	- Improved color contrast in secondary selection blocks
-	  of Fl_Text_Display (STR #1917)
-	- Fixed regression in callback handling (STR #1918)
-	- Fixed wrong relative path when absolute path has a 
-	  trailing slash in fl_filename_relative (STR #1920)
-	- Fixed multiple selection of files and directories in
-	  Fl_File_Chooser (STR #1913)
-	- Fixed MSWindows crash when selecting umlauts
-	  in Fl_Help_View (STR #1912)
-
-
-CHANGES IN FLTK 1.1.8
-
-	- Documentation fixes  (STR #1454, STR #1455, STR #1456,
-	  STR #1457, STR #1458, STR #1460, STR #1481, STR #1578,
-	  STR #1639, STR #1645, STR #1644, STR #1792, STR #1793,
-	  STR #1742, STR #1777, STR #1794, STR #1827, STR #1843,
-	  STR #1796, STR #1815, STR #1726, STR #1753, STR #1855,
-	  STR #1862, STR #1867, STR #1874, STR #1888)
-	- Fixed library path in Makefile (STR #1885)
-	- Fixed image read for partial regions on X11 
-	  (STR #1716)
-	- Fixed KDE/Gnome icon paths (STR #1795)
-	- Fixed Tab key to wrap around menu bars (STR #1877)
-	- Fixed possible timer leak in Scrollbar (STR #1880)
-	- Added documentation about the potential limitations
-	  of Fl::grab on newer operating systems (STR #1747)
-	- Fixed lockout when mixing popups and alerts
-	  (STR # 1869)
-	- Fixed recursion crash in event handling (STR #1873)
-	- Fixed missing return code in 'fltk-config' (STR #1875)
-	- Fixed inconsistencies with CHANGED flags (STR #1719)
-	- Fixed message sent to hidden widgets (STR #1849)
-	- Fixed width calculation in Fl_Help_View (STR #1868)
-	- Fixed offset bug in OS X pixmap code (STR #1856)
-	- Fixed potential buffer overrun 
-	  in Fl_Preferences (STR #1853)
-	- Fixed method attributes in consecutive class
-	  declarations in FLUID (STR #1741)
-	- FLUID checks for seperately declared callbacks to 
-	  avoid a bogus "extern" declaration (STR #1776)
-	- Added "protected" class memebrs in FLUID
-	- Double-clicking a widget in a FLUID layout will show 
-	  the item in the widget browser
-	- Fixed color highlighting in Text_Display
-	- Fixed 16 bit PNM image support (STR #1847)
-	- Fixed exposure event on zero size windows (STR #1824)
-	- Fixed overlay offset for OS X Quartz (STR #1729)
-	- gl_font() support for Xft+X11 (STR #1809)
-	- Fl_Gl_Window::mode() needed to hide and show the window
-	  when toggling stereo mode (STR #1846)
-	- Fl_Gl_Window::show() did not work reliably on Mac OS X
-	  (STR #1707)
-	- Added Fl_Group::clip_children() methods to support
-	  automatic clipping of child widget drawing (STR #1844)
-	- Fl_Browser_ and friends now support FL_WHEN_ENTER_KEY
-	  for both Enter/Return and double-clicks (STR #1818)
-	- Fl_Help_View did not release the images it used (STR
-	  #1817)
-	- Shared libraries would not build on 64-bit Linux
-	  systems with an existing non-PIC FLTK installation
-	  (STR #1791)
-	- Fl_Browser::hide() and Fl_Browser::show() did not
-	  correctly update the scrollbar (STR #1724)
-	- The configure script now shows a summry of the
-	  configuration results (STR #1810)
-	- "fltk-config --use-* --libs" did not list all of the
-	  dependent libraries (STR #1799)
-	- Hiding a nested window on WIN32 caused 100% CPU (STR #1748)
-	- Changing the window size in FLUID would not mark the 
-	  project as modified (STR #1751)
-	- Fixed fl_filename_isdir for "/"-path (STR #1761)
-	- Fixed Fl_Chart drawing (STR #1756)
-	- Fixed mapping of subwindows with unmapped parent
-	  windows (STR #1706)
-	- Fixed rendering of grayscale images with alpha
-	  channel (STR #1703)
-	- Fixed occasional incomplete refresh (STR #1681)
-	- Improved fl_down, fl_frame, added fl_box (STR #1678)
-	- Fixed selection of submenu items in 
-	  input_choice (STR #1676)
-	- Fixed calculation of stride for image scaling and
-	  color manipulation (STR #1673)
-	- Made -O3 the default optimization on Cygwin/Mingw since
-	  -Os currently creates bad code (STR #1656)
-	- OSF/Tru64 now uses 'install-sh' instead of 'install' to
-	  accomodate for a missing '-d' option (STR #1632)
-	- New option in Fluid project settings to translate all
-	  shortcut modifiers from FL_META or FL_CTRL to FL_COMMAND
-	- Made icon size fixed (50x50) in fl_message etc. (STR #1626)
-	- Fixed selection of first word in Fl_Help_View
-	- Fixed endless loop in Fl_Text_Display (STR #1655)
-	- Allowing shortcuts in Tabs (STR #1652)
-	- Fixed Makefile "make clean" (STR #1642,
-	  STR #1643, STR #1641)
-	- The sample RPM spec file now enables large file support
-	  and threading support (STR #1603)
-	- Changed minimum contrast between background and text to 
-	  99 and added more weight to the blue component to improve
-	  readability for certain color combinations (STR #1625)
-	- Fixed VCNet OpenGL project file (STR #1617)
-	- Fixed scrolling of clipped areas in MSWindows (STR
-	  #1601)
-	- Fixed clipping in OS X Quartz offscreen buffers (STR
-	  #1595)
-	- Now flush file chooser preferences after every change to
-	  avoid data loss (STR #1609)
-	- The Fl_File_Chooser constructor now saves and restores the
-	  current group (STR #1611)
-	- Added Fl::awake(fn*,void*) to set a handler for thread
-	  messages (STR #1536)
-	- Added "mute sound" option to Sudoku game.
-	- Updated the bundled zlib to v1.2.3.
-	- Updated the bundled libpng to v1.2.16.
-	- "make install" now uses the install command (or the
-	  included install-sh script) to copy files to the
-	  install directories, to ensure that permissions are
-	  correct.
-	- Fixed DLL generation via MingW/Cygwin (STR #1546)
-	- FLUID incorrectly opened the display when generating
-	  source code for Fl_Help_View widgets (STR #1318)
-	- Fl_Double_Window did not always show the scheme
-	  background image.
-	- Fixed first window behavior in OS X (STR #1548)
-	- Fixed calculation of character widths for OS X
-	  Quartz rendering (no STR)
-	- Fixed OS X mouse click handling (STR #1504)
-	- Added missing GLUT functions so that FLTK can be used
-	  as a fairly complete C++ replacement for the original
-	  GLUT library (STR #1522)
-	- Fl::awake() could block on X11 and OSX (STR #1537)
-	- Updated recursive mutex code to run on platforms other
-	  than Linux and to do a run-time check to determine
-	  whether they are supported by the kernel (STR #1575)
-	- WIN32 did check callbacks after the event processing instead of
-	  before as documented (STR #1535)
-	- Fl_File_Chooser now hides the window before doing a callback
-	  when the user clicks on the OK button (STR #1565)
-	- Fixed indentation of nested HTML elements (STR #1549)
-	- Made layout of Fl_Help_Dialog consistent with other
-	  help windows and web browsers.
-	- Improved GTK+ schemed round box (STR #1531)
-	- Fluid avoids writing unsupported combinations of the 
-	  "when()" flags (STR #1501)
-	- Fl_Browser_ would allow keyboard callbacks even though
-	  "when()" was set to "never" (STR #1501)
-	- Added automated little helpers to Sudoku 
-	- Added example code for Wizard with the
-	  Tabs demo (STR #1564)
-	- Optimized Fl_Tabs drawing for speed (STR #1520)
-	- OS X resource fork now obsolete (STR #1453)
-	- Added chapter 10 about multithreading (STR #1532, 
-	  1533)
-	- OS X system menu bar top level attribute support 
-	  improved (STR #1505)
-	- Fixed Quartz image drawing bug (STR #1438)
-	- Fixed Quartz fl_read_image
-	- Overlay drawing is now avoiding XOR mode (STR #1438) 
-	- Fixed Scroll crash in Fluid Live Mode (STR #1524) 
-	- Fixed mousewheel event propagation (STR #1521) 
-	- Fixed drawing issues of a tile in a scroll (STR #1507) 
-	- Fixed dismissing buttons in menu bars (STR #1494) 
-	- Making a child group visible in a Fl_Tabs or Fl_Wizard
-	  group now shows that tab or pane.
-	- Added fl_open_uri() function as proposed on
-	  fltk.development.
-	- Added Fl::has_check() which previously was prototyped
-	  and documented, but not implemented (STR #1542)
-	- Enabled Fl::add_check() on OS X (STR #1534)
-	- Documented tooltip inheritance (STR #1467)
-	- Better event mouse handling fixing detached menus and
-	  sticky tooltips (STR #1463, STR #449)
-	- Added Fl::scrollbar_size() methods that are used by all
-	  of the scrollbar-using widgets (STR #1500)
-	- fl_read_image() was broken on Intel-based Macs (STR
-	  #1490)
-	- Fl_Progress was using the wrong width to calculate 
-	  progress (STR #1492)
-	- Fl::x(), Fl::y(), Fl::w(), and Fl::h() did not report
-	  the desktop work area on X11 (STR #1482)
-	- Shortcut events could be sent to the wrong window (STR
-	  #1451)
-	- Fl_Spinner did not handle the arrow keys properly (STR
-	  #1476)
-	- Fl_File_Browser did not calculate the width of
-	  directory items correctly (STR #1469, STR #1470)
-	- Fl_Pack incorrectly started widgets at an offset of 1/2
-	  the spacing value.
-	- FLUID did not generate correct window class code if
-	  the class name was not a standard FLTK window class.
-	- FLUID incorrectly included <FL/Fl_classname.H> for
-	  widget classes that were not subclassed from a standard
-	  FLTK widget class.
-	- The demo master test program now supports scheme
-	  selection and all demos use it (STR #1459)
-	- fl_arc() and fl_pie() did not draw properly on WIN32
-	  when the start and end points were identical (STR
-	  #1461)
-	- Fl_Input and Fl_Text_Editor now hide the mouse pointer
-	  when typing into them (STR #1466)
-	- Implemented alpha blending for Quartz, WIN32, and X11
-	- Check buttons did not redraw properly with box() set to
-	  FL_NO_BOX (STR #1440)
-	- Added the Bluecurve-inspired scheme "gtk+".
-	- Updated documentation (STR #1420, STR #1421)
-	- Fixed font caching issue (STR #1415)
-	- Fixed crash in fl_file_chooser (STR #1410)
-	- Fixed Fluid hotspot bug (STR #1416)
-	- Fixed image copy code (STR #1412)
-	- Fixed latin-to-roman text conversion (STR #1411)
-	- Fixed Cygwin timeout for "select" calls (STR #1151)
-	- Improved Mac OS X subwindow handling (STR #1402)
-	- Fixed more inconsistencies between fl_draw and
-	  fl_measure (STR #1408)
-	- Fixed fl_measure which mistook a trailing '@@' for a
-	  symbol (STR #1406)
-	- Fixed GLUT behavior on window creation (STR #1403)
-	- Fixed OS X bug that would hide tooltips before they
-	  were shown (STR #1392)
-	- Fixed Fl_Tabs tooltip reappearing (STR #1324)
-	- Added a new demo game called "Block Attack!"
-	- Updated the Sudoku game to show a notice about Hard and
-	  Impossible puzzles having multiple solutions which are
-	  not a bug or error (STR #1361)
-	- Fixed filechooser to behave as documented when file
-	  pattern changes (STR #1359)
-	- Completed the global function index and added an
-	  alphabetical list of all methods (STR #1319)
-	- Avoiding problems with some platforms that don't 
-	  implement hypot() (STR #1366)
-	- Fixed floating point value formatting for Fl_Spinner
-	  (STR #1331)
-	- Fixed Fl_Positioner callback when released (STR #1387)
-	- Fixed WIN32 zero size window issue (STR #1387)
-	- Fixed Sudoku window positioning (STR #1398)
-	- Fluid Code Declarations can now handle C++ style
-	  comments (STR #1383)
-	- Fixed uninitialized data in OS X and WIN32 timeout
-	  functions (STR #1374).
-	- Fixed speed issues when measuring text on OS X with
-	  Quartz (STR #1386).
-	- Fixed focus issues on OS X (STR #1377)
-	- Optional precision argument when storing floats or 
-	  doubles in a Preferences file (STR #1381)
-	- Fixed callback not called when using arrow keys in
-	  Fl_Slider (STR #1333)
-	- Changing the shortcut of a widget in fluid now marks the
-	  document as dirty (STR #1382)
-	- Fl_Text_Editor now correctly handles middle mouse
-	  clicks (STR #1384)
-	- Added some GLUT4 functions (STR #1370)
-	- Added "context_changed()" function for OpenGL windows
-	  which allows efficient texture loading (STR #1372)
-	- Added missing "const" to GLUT call (STR #1371)
-	- Fixed stray FL_RELEASE events after clicking system
-	  areas on OS X (STR #1376)
-	- FLUID now only writes definitions of "o" and "w"
-	  variables as needed, reducing the number of "variable
-	  is shadowed" warnings from GCC.
-	- Added access to Xft font pointer (STR #1328)
-	- Fixed endianness in OS X mouse cursor graphics (STR
-	  #1348)
-	- Fixed crash on mixed use of keyboard and mouse for
-	  Fl_Menu_Button (STR #1356)
-	- Fixed Fl_Window::visible() and shown() for OS X
-	  (STR #1341)
-	- Fixed Fl_Window::copy_label() losing copy (STR #1332)
-	- Documentation fixes (STR #1336, STR #1329, STR #1339,
-	  STR #1340)
-	- Added support for floating point Fl_Spinner in the
-	  API, documentation, and Fluid (STR #1331)
-	- Repeat button now cancels timeout if it should get 
-	  deactivated during a callback (STR #1330)
-	- Added support for assigning Fl_Menu_Items to array 
-	  variables in Fluid (STR #1280)
-	- Added --with-archflags configure option to allow
-	  passing of specific architecture-selection options to
-	  the compiler and linker.
-	- Fixed WIN32 window stacking bug (STR #1296)
-	- Fixed wrong code generated by FLUID for Scrollbars (STR
-	  #1287)
-	- Loading a file would not update the Widget Properties
-	  dialog in FLUID (STR #1326)
-	- Fixed key compose sequences for shifted keys (STR
-	  #1194)
-	- Added text selection and copy to Fl_Help_View.
-	- Fixed position of popup menu titles (STR #1322)
-	- Showing any window will disable the current tooltip
-	  so it won't pop over menus (STR #1321)
-	- Updated documentation to reflect limitation of 
-	  Fl::delete_widget() (STR #1306)
-	- Fixed line wrapping in Fl_Text_Display (STR #1227)
-	- New function Fl::event_original_key() returns key code
-	  before NumLock handling.
-	- Many OS X Quartz fixes (STR #1310, etc.)
-	- Fixed shortcut and default focus for message dialogs
-	  (STR #1298)
-	- Fixed focus issues (STR #1286, STR #1289, STR #1296)
-	- Fixed window resizing in OS X (STR #1297)
-	- In FLUID, declarations starting with the keyword
-	  'typedef', 'class', or 'struct' are now treated
-	  correctly if inside a class (STR #1283)
-	- Tabs now show the correct tooltip (STR #1282)
-	- Included fltk.spec in configure.in (STR #1274)
-	- Fixed insufficiently invalidated cache 
-	  in Fl_Browser (STR #1265)
-	- Attempt to fix multi monitor issues (STR #1153)
-	- Fixed warnings when compiling w/Cygwin (STR #1152)
-	- Fixed missing reset of flag in FLUID (STR #1187)
-	- Fixed maximizing in OS X (STR #1221)
-	- Fixed 'make distclean' to remove binaries inside
-	  MacOS app packages (STR #1169)
-	- FLUID Code Viewer is now truly a viewer, not a text
-	  editor because edited text can not be saved.
-	- Fl_Spinner is now fully supported by FLUID (STR #1158)
-	- Fixed usage of deleted object after menu pulldown
-	  (STR #1162)
-	- Calling fl_font(0, 0) under Xft would access a NULL
-	  pointer (STR #1205)
-	- Setting a new value in Fl_Input_ wil now actually move
-	  cursor to the end of the input field as documented
-	  (STR #1161)
-	- FLUID crashed on WIN32 with international characters
-	  (STR #1176)
-	- Fl_Check_Browser did not allow the user to toggle the
-	  check boxes (STR #1232)
-	- Fl_Help_View crashed on WIN32 with international
-	  characters (STR #1228)
-	- Fl::run() no longer clears resources on WIN32 (STR
-	  #1231)
-	- Fl::add_timeout() leaked resources on OSX (STR #1233)
-	- Accented characters could not be entered on OSX (STR
-	  #1195)
-	- The caret key lookup was missing for OS X
-	- FLUID didn't handle loading .fl files with
-	  international characters properly with all compilers
-	  (STR #1150)
-	- Fl_Spinner's minimum() and maximum() "get" methods were
-	  misspelled (STR #1146)
-	- The largefile support changes in 1.1.7 broke binary
-	  compability for fl_filename_list(); you must now use
-	  "--enable-largefile" when configuring to get large file
-	  support, and the large file support definitions are
-	  added to the output of "fltk-config --cflags" (STR
-	  #1159)
-
-
-CHANGES IN FLTK 1.1.7
-
-	- Documentation fixes (STR #571, STR #648, STR #692, STR
-	  #730, STR #744, STR #745, STR #931, STR #942, STR #960,
-	  STR #969)
-	- Various menu widget fixes (STR #1140, STR #1143, STR
-	  #1144)
-	- The threads demo would display negative prime numbers
-	  on MacOS X; this appears to be a MacOS X bug, but we
-	  added a workaround to "fix" this (STR #1138)
-	- Fl::dnd() now sets the content type of the drag to
-	  "text/uri-list" when it sees the dragged text is
-	  composed of URIs.
-	- Fixed keyboard shortcut handling in FLUID and shortcut
-	  labeling in FLTK (STR #1129)
-	- Fixed include path for CMake build (STR #1123)
-	- Fixed unnecessary delay in WIN32 event handling 
-	  (STR #1104)
-	- Fixed handling of Ctrl-C in Fl_Text_Display (STR #1122)
-	- OS X Quartz version now draw a nice resize control (STR
-	  #1099)
-	- FLTK now enables large file support when available (STR
-	  #1087)
-	- Fl_Clock_Output depended on a time value that was the
-	  same as an unsigned long, which is incorrect for WIN64
-	  and VC++ 2005 (STR #1079)
-	- Fl_Text_Display::wrap_mode() would crash if no buffer
-	  was associated with the widget (STR #1069)
-	- Updated the default label and text colors of all widgets
-	  to use FL_FOREGROUND_COLOR instead of FL_BLACK (STR
-	  #1052)
-	- Fl::set_fonts() now works with Xft (STR #1012)
-	- Fl_Value_Input now uses the screen-absolute position
-	  instead of the window-relative position when dragging
-	  the value; this avoids some jumping conditions (STR
-	  #1037)
-	- Menus now pop up fully inside the screen if possible
-	  (STR #973)
-	- Fixed illegal access in Preferences (STR #1025)
-	- Fixed x-offset problem in Help_Widget (STR #998)
-	- Clipboard will persist if owner window is hidden (STR
-	  #1019)
-	- Fixed handling of Win32 Device Contexts (STR #1007)
-	- Fixed C++ style comments in C files (STR #997)
-	- Fixed signedness of scanf() argument (STR #996)
-	- Fixed cross-compiling problem (STR #995).
-	- FLUID now knows if a static callback is already
-	  declared in a class and won't declare it 'extern' (STR
-	  #776)
-	- Some actions in FLUID would not set the  "changed" flag
-	  (STR #984, STR #999)
-	- fl_filename_list now always appends a forward slash to
-	  directory names (STR #874)
-	- Multiline Input will update right if a space character is
-	  inserted in word wrap mode (STR #981)
-	- FLUID group labels redraw correctly (STR #959)
-	- FLUID now updates color of Fl_Tabs children (STR #979)
-	- FLUID now supports 'size_range()' (STR #851)
-	- FLUID selection boxes now synchronised (STR #964)
-	- fl_filename_list() now recognizes pathnames without
-	  trailing  slash as directions (STR #854)
-	- Fl_Text_Display now auto-scrolls in all 
-	  directions (STR #915)
-	- Borderless windows will not show in the taskbar anymore
-	  on X11 (STR #933)
-	- Fixed event_text() field on FL_DND_* event on 
-	  OS X and WIN32 (STR #968)
-	- The fltk-config utility now supports "--cc" and "--cxx"
-	  options to get the C and C++ compilers that were used
-	  to compile FLTK (STR #868)
-	- Fl_Valuator-derived widgets could show more digits than
-	  were necessary (STR #971)
-	- Fl_GIF_Image did not handle images with an incorrect
-	  number of data bits (STR #914)
-	- Fixed some plastic drawing artifacts (STR #906)
-	- Fl_Help_View now draws the box outside the scrollbars,
-	  like the other scrollable widgets (STR #871)
-	- The fltk-config script now handles invocation via a
-	  symlink (STR #869)
-	- Updated WIN32 cut/paste code to consistently handle DOS
-	  text (STR #961)
-	- Added shared library support for Cygwin and MingW (STR
-	  #893)
-	- Fl_File_Chooser did not implement the user_data()
-	  methods (STR #970)
-	- Compilation could fail if a previous installation of
-	  FLTK was in the same (non-standard) directory as an
-	  image library (STR #926)
-	- Fixed OSX compilation problems with non-HFS filesystems
-	  (STR #972)
-	- Problems with CMake on MinGW have been solved, thanks
-	  to Mr. "fltk.x0", who submitted the patch. (STR #863)
-	- Fixed memory leak in Fl_Check_Browser reported by
-	  "miguel2i". (STR #967)
-	- Fl_File_Input could draw in the wrong window (STR #958)
-	- WIN32: Internal WM_PAINT message now ignored (STR #831)
-	- Added Windows support for Fl_Window::xclass() (STR #848)
-	- Floating point input field allows characters from
-	  current locale (STR #903)
-	- Fixed integration of Fl_Input_Choice into FLUID (STR
-	  #879)
-	- New windows touching the right screen border would be 
-	  positioned all the way to the left (STR #898)
-	- Made pie drawing size for WIN32 and OS X the same as
-	  X11 (STR #905)
-	- Fixed OS X issue with OpenGL windows inside of Tabs
-	  (STR #602)
-	- FLUID Code Editor would occasionally not draw the last
-	  character in the buffer (STR #798)
-	- FLUID Declaration private flag fixed (STR #799)
-	- FLUID overlay now shows a seperate bounding box of
-	  selected items with correct handles and a dotted
-	  boundig box for all  labels (STR #790)
-	- Fixed left overhang of large chracters in Fl_Input_
-	  (STR #941)
-	- Fixed button resizing in File Chooser (STR #884)
-	- Fixed FLUID redraw issue (STR #912)
-	- Added 32bit BMP Image file format support (STR #918)
-	- Value Sliders would not receive focus when clicked on
-	  (STR #911)
-	- Added redraw of some widgets to show focus change (STR
-	  #910)
-	- Fl::set_font would not clear 'pretty' name (STR #902)
-	- Fixed unescaped '@' in fonts demo (STR #867)
-	- FLUID should not open the Display connection anymore if
-	  creating code only (STR #904)
-	- Improved hidden copy / ctor implementation (STR #860)
-	- Increased matrix stack depth and added over/underflow
-	  error (STR #924)
-	- Reverted Mac Carbon Clipping simplification that broke
-	  subwindow clipping (STR #908, SVN r4386)
-	- Fixed bitmap scaling code
-	- Fixed tiny memory leak (STR #878)
-	- Fixed hang on corrupt jpeg (STR #915)
-	- Fixed static allocation of font buffer in demo (STR #909)
-	- Added symbols 'refresh', 'reload', 'undo', and 'redo'.
-	- Fixed focus loss on Fl_Window:resize()
-	- Fl::delete_widget would hang fl_wait after deleting the
-	  window (STR #679)
-	- Fl::paste would sometimes not recoginze external 
-	  changes of the clipboard (STR #722)
-	- Clipping fixes for OSX
-	- Removed attempt to find items via 
-	  Fl_Menu_::find_item() in linked submenus
-	- FLUID interactive window resizing fixes (STR #873, 791)
-	- FLUID panel resize and alignment fixes (STR #891)
-	- Fl_Window::show(argc, argv) now sets the scheme before
-	  showing the window; this should eliminate any
-	  flickering between the standard and plastic schemes on
-	  startup (STR #886)
-	- Selected tabs are now drawn slightly larger than
-	  unselected tabs so they stand out more (STR #882)
-	- Round Plastic boxes now draw round (STR #841)
-	- FL_PLASTIC_DOWN_BOX drew with artifacts (STR #852)
-	- Changed initializations on WIN32 (STR #862)
-	- Fl_Preferences::getUserdataPath() didn't work for
-	  sub-groups (STR #872)
-	- Fixed some redraw issues on Windows XP.
-	- FLUID didn't set the initial size of widgets properly
-	  (STR #850)
-	- Fl_Tabs would steal focus away from its children on a
-	  window focus change (STR #870)
-	- filename_relative() now converts the current directory
-	  to forward slashes as needed on WIN32 (STR #816)
-	- Fl_File_Chooser::value() and ::directory() now handle
-	  paths with backslashes on WIN32 (STR #811)
-	- Added the standard rgb.txt file from X11 to the test
-	  directory, allowing all platforms to try the colbrowser
-	  demo (STR #843)
-	- Resizing of OpenGL subwindows was broken on OSX (STR #804)
-	- The fltk-config script now supports running from a
-	  source directory (STR #840)
-	- Fl_Browser_ didn't update the position properly when an
-	  item was deleted (STR #839)
-	- fl_contrast() now compares the luminosity of each color
-	  (STR #837)
-	- Fl_Input_ crashed on some platforms when wrapping
-	  international text characters (STR #836)
-	- Fixed some BMP images loading bugs (STR #825)
-	- Fl_File_Chooser now returns directory names with a
-	  trailing slash to avoid problems with relative
-	  filenames (STR #819)
-	- Fl_Help_View now supports the FONT and U elements (STR
-	  #815)
-	- OpenGL windows that were completely off-screen caused
-	  problems with some graphics cards on WIN32 (STR #831)
-	- Multiple screen support didn't work on Windows NT and
-	  95 (STR #821)
-	- Fl_Scrollbar didn't compute the correct knob size when
-	  using the "nice" types (STR #845)
-	- fl_draw() would segfault on WIN32 if no font was set;
-	  it now uses the default font (STR #828)
-	- Fl_Browser_ was calling the callback multiple times for
-	  a single selection change with FL_WHEN_CHANGED (STR
-	  #834)
-	- Added "filenew", "fileopen", "filesave", "filesaveas",
-	  and "fileprint" symbols with standard toolbar
-	  symbology.
-	- Updated Fl_Tabs to check the contrast of the label
-	  color against the tab background, and to highlight the
-	  top 5 lines of the tab pane with the selection color so
-	  that selected tabs stand out more.
-	- The example programs can now compile separate from the
-	  FLTK source distribution (STR #809)
-	- The example programs are now installed with the
-	  documentation (STR #809)
-	- Fixed the drawing of the Fl_Browser_ selection box (STR
-	  #786)
-	- Dropped Codewarrier project files and support.
-	- The FLTK string functions are now compiled in on all
-	  systems (STR #774)
-	- Fixed symbol demo label bug (STR #777)
-	- Fixed position of menu titles (STR #795)
-	- Added missing Fl_Window::copy_label() method.
-	- Fixed wrong tooltip in FLUID (STR #784)
-	- Added zlib path to FLUID (STR #783)
-	- Menus and other pop-up windows now obey screen
-	  boundaries on multi-screen displays (STR #781)
-	- Fl_Chart would draw outside its bounding box (STR #780)
-	- Added Fl::screen_count() and Fl::screen_xywh() APIs to
-	  support multi-screen displays.
-	- FLUID now supports direct creation of widget classes.
-	- Fl_File_Chooser now correctly handles multiple
-	  selections that are a mix of files and directories.
-	- Fl_File_Chooser no longer resets the type() when
-	  choosing a single file, and it now works when selecting
-	  multiple directories (STR #747)
-	- Fl_File_Icon::load_system_icons() now only loads 16x16
-	  and 32x32 icon images to improve startup performance.
-	- Pressing Enter in the file chooser when selecting a
-	  directory will choose that directory if it is currently
-	  shown (STR #746)
-	- Added a fl_file_chooser_ok_label() function to set the
-	  "OK" button label for the fl_file_chooser() and
-	  fl_dir_chooser() functions.
-	- Added Fl_File_Chooser::ok_label() methods to set the
-	  "OK" button label.
-	- The fl_ask() function is now deprecated since it does
-	  not conform to the FLTK Human Interface Guidelines.
-	- The Fl_File_Chooser window now properly resizes its
-	  controls (STR #766)
-	- The Fl_Help_Dialog window now properly resizes its
-	  controls (STR #768)
-	- The Fl_File_Chooser favorites window is now resizable
-	  (STR #770)
-	- Now provide FL_PLASTIC_ROUND_UP/DOWN_BOX box types
-	  which are used by the plastic scheme.
-	- FLUID windows that are resized through the widget panel
-	  now remain resizable by the window manager.
-	- Increased the size of the background image used by
-	  the plastic scheme to reduce the CPU load of redraws
-	  (STR #769)
-	- Fixed a syntax highlighting bug in the editor demo.
-	- Fl_Progress now contrasts the label color with the bar
-	  color, so labels will be readable at all times.
-	- fl_read_image() didn't use the right red, green, and
-	  blue masks on XFree86.
-	- Fixed Quickdraw drawing of 3 and 4 sided polygons (STR
-	  #765)
-	- Fixed fl_message() code so that it does not get
-	  accidentaly addded to the current group (STR #253)
-	- FLUID now highlights code in the widget callback and
-	  code editors.
-	- FLUID now supports printing of windows.
-	- Fixed inactive drawing of border, embossed, and
-	  engraved box types.
-	- Added Fl_Spinner widget (another combination of
-	  existing widgets in a header file)
-	- FLUID now provides support for UI templates.
-	- fl_not_clipped() incorrectly used the current window
-	  dimensions for gross clipping, which interfered with
-	  off-screen rendering.
-	- Fl_Window::draw() and Fl_Window::iconlabel() could leak
-	  memory if copy_label() was used on the window.
-	- fl_shortcut_label() now shows letter shortcuts in
-	  uppercase, e.g. "Ctrl+N" instead of "Ctrl+n" to be
-	  consistent with other toolkits.
-	- FLUID now provides unlimited undo/redo support.
-	- FLUID now provides an option to choose which scheme
-	  (default, none, plastic) to display.
-	- Fixed scheme background issue with windows in FLUID.
-	- In FLUID, new widgets are now created with the ideal
-	  size by default, and menu bars are positioned to use
-	  the entire width of the window.
-	- Added Layout/Widget Size submenu to select default
-	  label and text size (Tiny, Small, and Normal).
-	- Added Edit/Duplicate command to FLUID to duplicate the
-	  current selection.
-	- FLUID now tracks the current state of the widget bin
-	  and overlays.
-	- Now fill the widget image paths with relative
-	  filenames.
-	- Fixed frame drawing of Fl_Text_Display (STR #762)
-	- Fl_Clock_Output::value() did not return the previously
-	  set value (STR #748)
-	- Added comment type to FLUID. This is useful for
-	  generating copyright notices in the source and header
-	  files.
-	- Fl_Valuator would not format text output with decimal 
-	  point when the step value was fractional, but above 1.
-	- fl_filename_relative() didn't compare drive letters in
-	  a case-insensitive way (STR #741)
-	- Fixed menu item width calculations with symbols (STR
-	  #740)
-	- The keyboard shortcut handling code did not handle
-	  8-bit characters properly (STR #731)
-	- Fl_JPEG_Image could still crash an app with a corrupt
-	  JPEG file (STR #739)
-	- Using the layout alignment controls on a menu widget
-	  would cause FLUID to crash (STR #742)
-	- Added QNX bug workaround for menu handling (STR #704)
-	- Added Greg Ercolano's simple Fl_Input_Choice widget
-	  which is a combination of the Fl_Input and
-	  Fl_Menu_Button widgets (STR #650)
-	- Fl_Multiline_Input now scrolls the full height of the
-	  widget instead of 5 lines when the user presses PageUp
-	  or PageDown (STR #727)
-	- CMake build fixes (STR #724)
-	- Fl_Browser::swap() didn't handle redraws properly when
-	  the swapped lines had different heights (STR #729)
-	- FL_MOUSEWHEEL events are now sent first to the widget
-	  under the mouse pointer and then to the first widget
-	  which accepts them. This is similar to the way
-	  shortcut events are handled and is consistent with the
-	  way the mouse wheel is handled by other toolkits.
-	- Fl::wait() could block on WIN32 if the window was
-	  deleted via Fl::delete_widget() (STR #679)
-	- Fl_Preferences::RootNode did not find the user's home
-	  directory on some non-US versions of Windows (STR
-	  #720)
-	- Fl_Window::hide() didn't delete the current clipping
-	  region on WIN32, causing a GDI resource leak in some
-	  situations (STR #723)
-	- Removed a few warnings when compiling on OS X
-	- Fl_Menu now draws the arrow more like other toolkits
-	  and 2.0 (STR #651)
-	- Fixed a VC++ compiler error in Fl_JPEG_Image.cxx (STR
-	  #676)
-	- FL_SHADOW_BOX/FRAME drew outside of the bounding box
-	  (STR #694)
-	- Fl_Widget::copy_label(NULL) didn't work (STR #707)
-	- Fl_Choice now allows click selection like
-	  Fl_Menu_Button and Fl_Menubar (STR #706)
-	- Updated cmake support (STR #645)
-	- Fl_Check_Browser didn't draw properly when inactive
-	  (STR #681)
-	- Removed some redundant code in Fl_Group::handle() (STR
-	  #669)
-	- The file chooser didn't always deactivate the OK
-	  button when necessary (STR #653)
-	- Image drawing on OSX changed the current drawing
-	  colors (STR #662)
-	- Fixed some compiler errors on WIN32 (STR #647, STR
-	  #726)
-	- FLUID didn't update the widget panel X/Y/W/H values
-	  when moving the selected window (STR #701)
-	- FLUID didn't use the label type constant names for
-	  menu items, causing them to be drawn using the normal
-	  label type (STR #668)
-	- Fl_File_Chooser was slow with large directories (STR
-	  #654)
-	- FLUID didn't add xclass() calls to windows (STR #718)
-	- The X11 DND code did not correctly select a text
-	  format for incoming data (STR #711)
-	- Fixes to Fl_JPEG_Image error handler.
-	- Fl_Menu::popup() and ::pulldown() would crash an
-	  application if a callback created widgets before they
-	  returned (STR #685)
-	- Fl_Double_Window would cause a full redraw, even if
-	  only small parts of the UI were changed on Mac OS X.
-	- Fl_JPEG_Image did not correctly handle errors reported
-	  by the JPEG library (STR #652)
-	- Fl_Menu now draws sub-menu arrows like other toolkits
-	  and FLTK 2.0 (STR #651)
-	- Fixed a compiler warning in Fl_Window.H (STR #641)
-	- Tooltips disabled shortcut processing (STR #643)
-	- Fl::event_number() didn't always match the value sent
-	  to the handle() method (STR #634)
-	- Fl_Shared_Image::reload() didn't set the image_
-	  pointer properly in all cases (STR #632)
-	- Fl_Help_View::topline() incorrectly set the changed()
-	  flag (STR #631)
-	- Fl_Choice::value() now supports NULL or -1 to deselect
-	  the current item (STR #637)
-	- More VC++ 6 project file fixes (STR #638)
-	- Added missing Watcom makefile in the test directory
-	  (STR #636)
-	- Fl_Text_Display::word_left would hang if the cursor
-	  was at position 0 (STR #635)
-
-
-CHANGES IN FLTK 1.1.6
-
-	- Documentation updates (STR #552, STR #608)
-	- Added the 2.0 Fl_Widget::copy_label() method to
-	  allow FLTK 1.x applications to have their label
-	  strings managed by FLTK (STR #630)
-	- Added Fl::delete_widget() method to safely delete
-	  widgets in callback methods (STR #629)
-	- Fl_Widget::damage(uchar,int,int,int,int) didn't clip
-	  the bounding box properly (STR #626)
-	- Windows could appear on the wrong screen on OSX (STR
-	  #628)
-	- Fl_Double_Window produced an error on resize with X11
-	- FLUID didn't display menu items using images properly
-	  (STR #564)
-	- Fl_Sys_Menu_Bar didn't compile on case-sensitive
-	  file-systems (STR #622)
-	- FLUID didn't handle default function parameters
-	  properly (STR #579)
-	- Moving or resizing widgets in FLUID didn't always
-	  update the widget panel (STR #600)
-	- FLTK windows could appear off-screen on X11 (STR #586)
-	- The configure script did not support
-	  --disable-localfoo to completely disable image file
-	  support (STR #582)
-	- The Visual C++ 6.0 project files still listed the old
-	  JPEG, PNG, and ZLIB library names (STR #577)
-	- Fixed the scandir() conditional code for HP-UX 11i
-	  (STR #585)
-	- Fl_Text_Display didn't support CTRL/CMD-A/C (STR #601)
-	- Watcom fixes (STR #581, STR #584, STR #594, STR #595,
-	  STR #623, STR #627)
-	- Fixed library include order when building DSOs on
-	  MacOS X (STR #596)
-	- fl_xid() could cause a WIN32 application to crash (STR
-	  #560, STR #576, STR #618)
-	- Fl_Browser::remove_() removed the item from the list
-	  before computing the item height, which caused
-	  problems with some programs (STR #613)
-
-
-CHANGES IN FLTK 1.1.5
-
-	- Documentation updates (STR #568, STR #570)
-	- Shortcuts were incorrectly underlined in multi-line
-	  labels (STR #566)
-	- More CMake updates (STR #499)
-	- The Watcom C++ compiler needed a small change (STR
-	  #567)
-	- Added DESTDIR support and now remove all man pages for
-	  the "uninstall" target (STR #545)
-	- Fix PNG drawing on buggy WIN32 graphics cards (STR
-	  #548)
-	- The configure script didn't propagate the CPPFLAGS
-	  environment variable (STR #549)
-	- The numpad keys didn't work properly on WIN32 (STR
-	  #502)
-	- fl_input() and friends now set the input focus to the
-	  text field when the dialog is shown (STR #553)
-	- Fixed background color mixup when drawing Fl_Choice
-	  menus (STR #544)
-	- Fixed MingW makefiles (STR #550)
-	- More VC++ project file tweaking (STR #559)
-	- Fl_PNG_Image didn't use the png_set_trns_to_alpha
-	  function when available (STR #547)
-	- The FL_UNFOCUS event wasn't always sent when switching
-	  tabs (STR #558)
-
-
-CHANGES IN FLTK 1.1.5rc3
-
-	- Documentation updates (STR #505, STR #513)
-	- Updated PNG library source to 1.2.7.
-	- Updated ZLIB library source to 1.2.1.
-	- Fixed VC++ project file problems (STR #476, STR #478,
-	  STR #520, STR #527, STR #537)
-	- Now look for 8 bits of alpha when the developer has
-	  requested FL_RGB8 (STR #541)
-	- The last line in an Fl_Help_View widget was not
-	  aligned properly (STR #536)
-	- The "search" symbol looked like a Q (STR #536)
-	- Changed Fl_Help_View::get_color() to use a lookup
-	  table to avoid serious Borland C++ 5.5 compiler bugs
-	  (STR #533)
-	- Fixed Watcom compiler warnings with FL/Fl_Widget.H
-	  (STR #540)
-	- The image class copy() methods did not always make a
-	  separate copy of the image data (STR #539)
-	- Fixed an edge case in fl_old_shortcut() that could
-	  cause it to read beyond then end of the shortcut
-	  string (used for XForms named shortcuts)
-	- Added (unsupported) CMake files (STR #499)
-	- Tooltips would not reappear on the same widget, and
-	  the initial tooltip delay was not used after a tooltip
-	  was shown (STR #465)
-	- Fixed a compile problem with the Linux 2.6 threading
-	  support (STR #483)
-	- Fixed problems with 2-byte Xpm files on 64-bit
-	  platforms (STR #525)
-	- FLTK didn't handle the ReparentNotify event on X11
-	  (STR #524)
-	- The old source file "fl_set_gray.cxx" is not needed
-	  (STR #516)
-	- Fl_Text_Display still called delete[] instead of
-	  free() in one place (STR #503)
-	- The symbol test program did not handle the @+ symbol
-	  properly (STR #490)
-	- Fl_File_Chooser didn't correctly call isprint() and
-	  isspace() when checking to see if the current file was
-	  text that can be previewed (STR #517)
-	- FLUID didn't compile with Borland C++ due to a
-	  compiler bug (STR #496)
-	- Fl_Positioner did not handle reversed min and max
-	  values (STR #510)
-	- fl_descent(), fl_height(), and fl_width() would crash
-	  a program if you didn't call fl_font() first; they now
-	  return -1 if no font is set (STR #500)
-	- Added test/unittests to verify pixel drawing and 
-	  alignment across platforms
-	- Fl_Menu_::find_item() didn't determine the menu path
-	  properly (STR #481)
-	- The build system now installs image library header
-	  files in FL/images/filename.h so that FLTK programs
-	  will use the same header files as the FLTK image
-	  libraries.
-	- The build system now creates image libraries named
-	  "libfltk_name.a" instead of "libname.a" to avoid
-	  clobbering an existing installed library (STR #480)
-
-
-CHANGES IN FLTK 1.1.5rc2
-
-	- Documentation updates (STR #365, STR #399, STR #407,
-	  STR #412, STR #414, STR #452, STR #462)
-	- Fl_Text_Display did not handle drawing of overlapping
-	  text (italic next to plain, etc.) properly (STR #381)
-	- All of the core widgets now consistently set changed()
-	  before calling the callback function for a change in
-	  value; this allows programs to check the changed()
-	  state in a callback to see why they are being called
-	  (STR #475)
-	- Fl_File_Chooser did not handle some cases for filename
-	  completion (STR #376)
-	- Fl_Help_View didn't properly compute the default
-	  maximum width of the page properly, resulting in
-	  non-wrapped text in table cells (STR #464)
-	- Fl_Text_Editor no longer tries to emulate the Emacs
-	  CTRL-A shortcut to move to the first column, since
-	  there is a key for that and the widget does not
-	  emulate any other Emacs keys (STR #421)
-	- Fl_File_Chooser always disabled the OK button when the
-	  user pressed DELETE or BACKSPACE (STR #397)
-	- Added Fl_Browser::swap() methods (STR #459)
-	- Fl_Counter didn't use a thin down box for the text
-	  field if the box type was set to FL_THIN_UP_BOX (STR
-	  #467)
-	- Fl_Help_View now resets the scrollbars if they go
-	  outside the current view (STR #464)
-	- fl_dir_chooser() did not show the previous selection
-	  as documented (STR #443)
-	- Fl_Text_Display used delete[] instead of free() in
-	  some places (STR #466)
-	- FLTK now includes copies of the PNG, JPEG, and ZLIB
-	  libraries for platforms that do not have them (STR
-	  #441)
-	- The fltk-config script did not include the
-	  "-mno-cygwin" option under CygWin (STR #434)
-	- Fl_Help_View::find() did not check for a NULL value
-	  (STR #442)
-	- Added search symbol to the search field of
-	  Fl_Help_Dialog (STR #417)
-	- Added two new symbols, @search and @FLTK, which can be
-	  used in labels.
-	- MacOS X: fixed NumLock mixup, added support for
-	  FL_Menu and FL_Delete keys on external (PC) keyboards
-	  (STR #445)
-	- Fl_File_Icon::draw() did not support drawing of complex
-	  polygons in icon descriptions (STR #474)
-	- The configure script now offers options for JPEG, PNG,
-	  and ZLIB libraries (STR #416)
-	- The first menu item in a list would not go invisible 
-	  (STR #406)
-	- Fl_Text_Buffer::replace() now range checks its input
-	  (STR #385)
-	- FLTK now builds with the current release of MinGW (STR
-	  #325, STR #401, STR #402)
-	- FLTK now honors the numlock key state (STR #369)
-	- The Fl_Text_Display widget did not redraw selections
-	  when focus changed (STR #390)
-	- The plastic background image is now less contrasty
-	  (STR #394)
-	- Fl_Scroll now uses a full redraw when the scheme is
-	  set to plastic and the box type is a frame (STR #205)
-	- Fl_Window::resize() did not work properly with KDE 3.2
-	  (STR #356)
-	- FLTK didn't delete font bitmaps when the last OpenGL
-	  window was deleted, preventing future text from
-	  displaying (STR #310)
-	- FLUID didn't include a full initialization record for
-	  the trailing NULL menu items (STR #375)
-	- Fl_Browser::item_width() did not properly handle
-	  format modifiers (STR #372)
-	- Fl_Browser::item_height() did not handle columns
-	  properly (STR #371)
-	- Fl_Gl_Window's on WIN32 now prefer accelerated pixel
-	  formats over generic formats (STR #382)
-	- Fl_Window::resize() did not work on some systems if
-	  the window was not shown (STR #373)
-	- FLUID did not write the user_data type if the
-	  user_data field was empty (STR #374)
-	- The value(const Fl_Menu_Item*) method was not
-	  implemented for Fl_Choice (STR #366)
-        - Fl_Pack didn't draw child widget labels the same way
-          as Fl_Group, causing display problems (STR #360)
-        - fl_read_image() didn't work when reading from an
-          offscreen buffer with some X11 servers (STR #364)
-
-
-CHANGES IN FLTK 1.1.5rc1
-
-	- Documentation updates (STR #186, STR #245, STR #250,
-	  STR #277, STR #281, STR #328, STR #338)
-	- fl_scroll() did not handle scrolling from off-screen on
-	  WIN32 (STR #315)
-	- Fl_File_Chooser did not allow manual entry of a drive
-	  letter (STR #339)
-	- Fl_Menu now uses the boxtype to redraw the menu
-	  background (STR #204)
-	- Fl_Scroll now shows the background image when a framed
-	  box type is used and the Fl_Scroll is a direct
-	  decendent of a window (STR #205)
-	- Added a new_directory_tooltip string pointer to allow
-	  localization of the file chooser's new directory
-	  button (STR #340)
-	- Added Fl_Menu_::find_item() method (STR #316)
-	- The Fl_Widget copy operator definitions were not
-	  conditionally compiled properly (STR #329)
-	- FLUID's Layout functionality did not move child
-	  widgets when laying out group widgets (STR #319)
-	- FLUID's Layout->Center In Group functionality did not
-	  properly handle widgets that were children of a
-	  Fl_Window widget (STR #318)
-	- The Fl_Text_Display destructor did not remove the
-	  predelete callback associated with the current buffer
-	  (STR #332)
-	- Fixed several bugs in the MacOS X Fl::add_fd()
-	  handling (STR #333, STR #337)
-	- The Fl_Text_Display widget did not display selections
-	  set by the application (STR #322)
-	- FLUID crashed if you did layout with a window widget
-	  (STR #317)
-	- Fl_Scroll::clear() didn't remove the child widget from
-	  the Fl_Scroll widget (STR #327)
-	- Fl_Value_Slider::draw_bg() didn't always apply the
-	  clipping rectangle (STR #235)
-	- fl_filename_relative() returned the wrong string if
-	  the absolute pathname was equal to the current working
-	  directory (STR #224)
-	- Fl_Help_Dialog didn't correctly restore the scroll
-	  position when going forward/back in the link history
-	  if the file changed (STR #218)
-	- glutGetModifiers() did not mask off extra state bits,
-	  confusing some GLUT-based applications (STR #213)
-	- Fixed mouse capture problems on MacOS X (STR #209, STR
-	  #229)
-	- Fl_Sys_Menu_Bar is now built into the library for
-	  MacOS X (STR #229)
-	- Fl_Menu_ now provides item_pathname() methods to get
-	  the "pathname" of a menu item, e.g. "File/Quit" (STR
-	  #283)
-	- Fl_Text_Display now provides cursor_color() methods to
-	  get and set the cursor color (STR #271)
-	- Fl_Scroll didn't honor FL_NO_BOX (STR #305)
-	- FLUID declaration blocks didn't support public/private
-	  definitions (STR #301)
-	- Fl_Preferences incorrectly created the preferences
-	  directory before necessary (STR #247)
-	- The WIN32 project files still defined the (obsolete)
-	  FL_STATIC constant (STR #279)
-	- Fl_Text_Display::buffer() did not support NULL values,
-	  making it impossible to clean up text buffers from a
-	  subclass (STR #295)
-	- Fl_Text_Display did not support a NULL
-	  unfinishedStyleCB function (STR #241)
-	- Fl::background2() incorrectly marked the foreground
-	  color as initialized (STR #255)
-	- Fixed the X11 CTRL + "-" detection code to properly
-	  track the state of the CTRL key (STR #264)
-	- Fl_File_Icon::load_system_icons() didn't support KDE
-	  3.x (STR #299)
-	- WIN32's scandir() emulation did not allocate enough
-	  memory for directory names (STR #263)
-	- Fl::compose() did not handle special keys like
-	  backspace properly (STR #293)
-	- Fl_Choice did not clip its text when drawing using the
-	  plastic scheme (STR #287)
-	- Fl_Group incorrectly mapped the emacs CTRL keys to
-	  keyboard navigation (STR #228)
-	- Fl_File_Browser::load() didn't handle a NULL directory
-	  name (STR #266)
-	- 64-bit library fixes (STR #261)
-	- The Fl_Valuator::format() function did not limit the
-	  size of the number buffer (STR #268)
-	- The keypad Enter key works as the normal Enter/Return
-	  key in common widgets (STR #191)
-	- Fixed some OS/2-specific build problems (STR #185, STR
-	  #197)
-	- Calling Fl_Text_Display::buffer() with the same buffer
-	  would cause an application to lockup (STR #196)
-	- Some of the widgets could crash an application if the
-	  cursor was changed after a window was deleted (STR
-	  #181)
-	- The Fl_Gl_Window WIN32 pixel format code did not
-	  choose the pixel format with the largest depth buffer
-	  (STR #175)
-	- The configure script didn't leave space between the
-	  CFLAGS/CXXFLAGS and X_CFLAGS variables (STR #174)
-	- The Fl_JPEG_Image and Fl_PNG_Image classes did not
-	  trap errors from the corresponding image libraries
-	  (STR #168)
-	- Added "--with-links" configure option to control
-	  whether symlinks are created for the FLTK header files
-	  (STR #164)
-	- Added new hoverdelay() to Fl_Tooltip to control how
-	  quickly recent tooltips appear (STR #126)
-	- FLUID now sets the size range when a window is shown.
-	  This seems to be necessary with some window managers
-	  (STR #166)
-
-
-CHANGES IN FLTK 1.1.4
-
-	- The fl_read_image() function was not implemented on
-	  OSX (STR #161)
-	- VC++ 7.1 didn't like how the copy operators were
-	  disabled for the Fl_Widget class; now include inline
-	  code which will never be used but makes VC++ happy
-	  (STR #156)
-	- Fixed an IRIX compile problem caused by a missing
-	  #include (STR #157)
-	- FLUID didn't write color/selection_color() calls using
-	  the symbolic names when possible, nor did it cast
-	  integer colors to Fl_Color (STR #146)
-	- Fl_File_Chooser was very close for multiple file
-	  selection in large directories (STR #140)
-	- Fl_Text_Display/Editor did not disable the current
-	  selection when focus was shifted to another widget
-	  (STR #131)
-	- Fl_Choice didn't use the normal focus box when the
-	  plastic scheme was in use (STR #129)
-	- Fl_Text_Editor didn't use selection_color()
-	  consistently (STR #130)
-	- The fltk_forms, fltk_gl, and fltk_images DSO's and
-	  HP-UX shared libraries are now linked against the fltk
-	  shared library to provide complete dependency
-	  resolution (STR #118)
-	- The configure.in file did not work with autoconf 2.57.
-	- FLUID didn't redraw widgets when changing the X, Y, W,
-	  or H values in the widget panel (STR #120)
-	- Fl_Window::show(argc, argv) wasn't calling
-	  Fl::get_system_colors() as documented (STR #119)
-	- DSO (shared library) building wasn't quite right for
-	  some platforms (STR #118)
-	- OSX: some changes to make ProjectBuilder compiles
-	  possible.
-	- OSX: FLTK would not know where a window was positioned
-	  by the OS. As a result, popup menus could open at 
-	  wrong positions.
-
-
-CHANGES IN FLTK 1.1.4rc2
-
-	- Fl_Window::show(argc,argv) incorrectly opened the
-	  display prior to parsing the arguments; this prevented
-	  the "-display foo" option from working (STR #111)
-	- Images were not clipped properly on MacOS X (STR #114)
-	- Fl::reload_scheme() and Fl::scheme("foo") incorrectly
-	  called Fl::get_system_colors().  This prevented an
-	  application from setting its own color preferences
-	  (STR #115)
-	- The 'Enter' key event on OS X would not set
-	  Fl::e_text.
-	- Changed behaviour of FLUID to always paste into
-	  a selected group (STR #88)
-	- Menuitem now changes font, even if fontsize
-	  is not set (STR #110)
-	- Swapped shortcut labels in OS X (STR #86)
-	- Non-square Fl_Dial would calculate angle from user
-	  input wrong (STR #101)
-	- Updated documentatiopn of fl_draw (STR #94)
-	  and Fl_Menu_::add() (STR #99)
-	- FLUID collapse triangle events were not offset by
-          horizontal scroll (STR #106)
-	- QuitAppleEvent now correctly returns from Fl::run()
-          instead of just exiting (STR #87)
-	- Hiding the first created OpenGL context was not
-	  possible. FLTK now manages a list of contexts (STR #77)
-	- FLUID didn't keep the double/single buffer type for
-	  windows.
-	- FLTK didn't work with Xft2.
-	- OSX window resizing didn't work (STR #64)
-	- Fixed MacOS X shared library generation (STR #51)
-	- Several widgets defined their own size() method but
-	  didn't provide an inline method that mapped to the
-	  Fl_Widget::size() method (STR #62)
-	- Fl_Scroll didn't provide its own clear() method, so
-	  calling clear() on a Fl_Scroll widget would also
-	  destroy the scrollbars (STR #75)
-	- Fl::event_text() was sometimes initialized to NULL
-	  instead of an empty string (STR #70)
-	- fl_draw() didn't properly handle a trailing escaped
-	  "@" character (STR #84)
-	- Added documentation for all forms of
-	  Fl_Widget::damage() (STR #61)
-	- Fl_Double_Window now has a type() value of
-	  FL_DOUBLE_WINDOW, to allow double-buffered windows to
-	  process redraws properly on WIN32 (STR #46)
-	- Added FL_DAMAGE_USER1 and FL_DAMAGE_USER2 damage bits
-	  for use by widget developers (STR #57)
-	- Fl_Help_View didn't support numeric character entities
-	  (STR #66)
-	- Menu shortcuts didn't use the Mac key names under
-	  MacOS X (STR #71)
-	- CodeWarrior Mac OS X updated to work with current
-	  CW8.3 (STR #34)
-	- Apple-C/X/V/Z didn't work in the Fl_Input widget due
-	  to a bad mapping to control keys (STR #79)
-	- Added the OSX-specific fl_open_callback() function to
-	  handle Open Documents messages from the Finder (STR
-	  #80)
-	- The configure script contained erroneous whitespace in
-	  various tests which caused errors on some platforms
-	  (STR #60)
-	- The fltk-config script still supported the deprecated
-	  --prefix and --exec-prefix options; dropped them since
-	  they serve no useful purpose and would never have
-	  worked for the intended purpose anyways... (STR #56)
-	- fl_filename_list returned 0 on Win32 if no directory
-	  existed (STR #54)
-	- Pressing 'home' after the last letter in a Text_Editor
-	  would move the cursor to pos 0 (STR #39)
-	- Fl::get_key(x) would mix up Ctrl and Meta on OS X (STR
-	  #55)
-	- The configure script used the wrong dynamic library
-	  linking command for OSX (STR #51)
-	- The Fl_Text_Editor widget did not set changed() nor
-	  did it call the widget's callback function for
-	  FL_WHEN_CHANGED when processing characters that
-	  Fl::compose() handles (STR #52)
-
-
-CHANGES IN FLTK 1.1.4rc1
-
-	- The file chooser did not reset the click count when
-	  changing directories; if you clicked on a file in the
-	  same position after changing directories with a
-	  double-click, the chooser treated it as a triple
-	  click (STR #27)
-	- Symbols with outlines did not get drawn inactive.
-	- The Fl_Help_View widget now provides a find() method
-	  to search for text within the page.
-	- The Fl_Help_Dialog widget now provides a search box
-	  for entering text to search for.
-	- The default font encoding on OSX did not match the
-	  default on WIN32 or X11.
-	- Menu items were not drawn using the font specified in
-	  the Fl_Menu_Item structure (STR #30)
-	- Long menus that were aligned such that the top of an
-	  item was exactly at the top of the screen would not
-	  scroll (STR #33)
-	- The OS issues appendix incorrectly stated that MacOS
-	  8.6 and 9 were supported; they are not (STR #28)
-	- Fixed handling of nested double-buffered windows (STR
-	  #1)
-	- Showing a subwindow inside a hidden window would crash
-	  the application (STR #23)
-	- OSX users couldn't enter some special chars when using
-	  some foreign key layouts (STR #32)
-	- Hiding subwindows on OSX would hide the parent window
-	  (STR #22)
-	- Added thin plastic box types.
-	- Fl_Pack ignored the box() setting and cleared any
-	  unused areas to the widget color; it now only does so
-	  if the box() is set to something other than FL_NO_BOX.
-	- Updated the Fl_Tabs widget to offset the first tab by
-	  the box dx value to avoid visual errors.
-	- Updated the plastic up box to draw only a single
-	  border frame instead of the old double one for
-	  improved appearance.
-	- Updated the default background color on OSX to provide
-	  better contrast.
-	- Fl_Text_Display and friends now look for the next
-	  non-punctuation/space character for word boundaries
-	  (STR #26)
-	- gl_font() didn't work properly for X11 when Xft was
-	  used (STR #12)
-	- Fl_File_Browser incorrectly included "." on WIN32 (STR
-	  #9)
-	- Include shellapi.h instead of ShellAPI.h in the WIN32
-	  drag-n-drop code in order to work with the MingW cross
-	  compiler (STR #6)
-	- The cursor was not properly restored when doing
-	  drag-n-drop on X11 (STR #4)
-	- Fl::remove_fd() didn't recalculate the highest file
-	  descriptor properly (STR #20)
-	- Fl_Preferences::deleteGroup() didn't work properly
-	  (STR #13)
-	- Fixed the fl_show_file_selector() function - it was
-	  copying using the wrong string size (STR #14)
-	- fl_font() and fl_size() were not implemented on MacOS
-	  X.
-	- Sorted the icon menu bar in FLUID.
-	- Fixed minor memory access complaints from Valgrind
-	- Compiling src/flstring.h on OS X with BSD header would
-	  fail.
-	- Fl_Text_Editor didn't scroll the buffer when the user
-	  pressed Ctrl+End or Ctrl+Home.
-	- Fl_Text_Editor didn't show its cursor when the mouse
-	  was moved inside the window.
-	- FLUID now uses an Fl_Text_Display widget for command
-	  output, which allows you to copy and paste text from
-	  command output into other windows.
-	- Fl_Gl_Window could cause a bus error on MacOS X if the
-	  parent window was not yet shown.
-	- FLUID could crash after displaying a syntax error
-	  dialog for the callback code.
-	- FLUID would reset the callback code if you opened the
-	  widget panel for multiple widgets.
-	- Added a NULL check to Fl_Text_Display (SF Bug #706921).
-	- The fltk-config script placed the LDFLAGS at the wrong
-	  place in the linker options.
-	- Fl_Text_Display didn't draw the outer box in the right
-	  dimensions, so it was invisible.
-	- Fl_Help_Dialog used the same color for links as for
-	  the background, causing links to be invisible on pages
-	  without a background color set.
-
-
-CHANGES IN FLTK 1.1.3
-
-	- Documentation updates.
-	- FLTK now ignores KeyRelease events when X11 sends them
-	  for repeating keys.
-	- FLUID now supports up to two additional qualifiers
-	  before a class name (FL_EXPORT, etc.) to aide in
-	  developing DLL interfaces for WIN32.
-	- Additional NULL checks in Fl_Button,
-	  fl_draw_boxtype(), Fl_File_Chooser, and
-	  Fl_Window::hotspot().
-	- The Fl_Preferences header file needed to FL_EXPORT all
-	  of the nested classes for WIN32.
-	- Fl_Double_Window couldn't be nested on WIN32. [SF Bug
-	  #658219]
-	- Fl_Slider didn't call the callback function when the
-	  user changed the value using the keyboard and the
-	  "when" condition was FL_WHEN_RELEASE. [SF Bug #647072]
-	- Lines with less than 2 unique vertices and polygons
-	  with less the 3 unique vertices were not drawn
-	  properly. [SF Bug #647067]
-	- The size_range() values were not honored under MacOS
-	  X. [SF Bug #647074]
-	- OpenGL windows didn't resize correctly on MacOS X.
-          [SF Bug #667855]
-	- The menus incorrectly used the overlay visual when one
-	  or more menu items contained an image. [SF Bug #653846]
-	- Changed some error messages to use Fl::error() instead
-	  of fprintf()...
-	- Fl_Text_Buffer and Fl_Text_Display used free to free
-	  memory that was allocated using the new operator.
-	- Tweeked the plastic scheme under MacOSX to better
-	  match the colors.
-	- The Fl_Image.H always included the x.H header file,
-	  which included many system headers that could
-	  interfere with normal GUI applications.  It now uses
-	  the corresponding based types for the image id and
-	  mask to avoid this.
-	- The FLUID widget panel wasn't sorted, so keyboard
-	  navigation was strange. [SF Bug #647069]
-	- Fl_Scroll didn't compute the location of labels to the
-	  right or below when determining the area to erase.
-	- Added backward-compatibility macro for
-	  filename_setext().
-	- Fl_Bitmap::copy(), Fl_Pixmap::copy(), and
-	  Fl_RGB_Image::copy() all could overflow the source
-	  image when scaling the image.
-	- Double/triple clicks in Fl_Input fields didn't copy
-	  the expanded selection to the clipboard.
-	- Fl_Glut_Window and Fl_Gl_Window didn't always initialize
-	  the OpenGL context on MacOS.
-
-
-CHANGES IN FLTK 1.1.2
-
-	- Fl_Menu_Bar now supports drawing vertical dividers
-	  between menu items and submenus in the menu bar.
-	- Fl_File_Chooser::value() didn't return NULL when the
-	  user clicked Cancel while selecting a directory.  This
-	  bug also affected fl_dir_chooser().
-	- Fl_Menu_::add(const char *) used too small a menu item
-	  label buffer and didn't do bounds checking.
-	- Eliminate some compiler warnings with CodeWarrier
-	  under WIN32 (Paul Chambers)
-	- Fl_Gl_Window widgets did not resize properly under
-	  MacOS X.
-	- The cursor could be set for the wrong window in the
-	  text widgets.
-	- Fl_Check_Browser didn't provide const char * add
-	  methods as documented.
-	- Fl_Check_Browser didn't draw the same style of check
-	  marks at the other widgets.
-	- Fl_Button, Fl_Choice, and Fl_Menu_Button incorrectly
-	  activated the button/menu when the spacebar was
-	  pressed in conjunction with shift, control, alt, or
-	  meta.
-	- FLTK should now compile with Xft 2.0.
-	- Some versions of Tru64 4.0 have snprintf and
-	  vnsprintf, but don't have the prototypes for those
-	  functions.
-	- FLTK had trouble doing character composition with some
-	  keyboard layouts under X11 (in particular, Belgian).
-	- Fl_Text_Editor would cause a segfault if the user
-	  pressed CTRL-V (paste) without having any data in the
-	  clipboard...
-	- The tab key moved backwards in menus instead of
-	  forwards.  Shift-tab still moves backwards.
-	- The redraw_label() method didn't damage the parent
-	  window when the label was outside the widget's
-	  bounding box.
-	- Added a "draw_children()" method to Fl_Group to make
-	  subclassing Fl_Group with a custom draw() function
-	  easier.
-	- Fl_Text_Editor now supports basic undo functionality.
-	- FLUID now uses Fl_Text_Editor widgets for all
-	  multi-line code fields.
-	- Added new widget bin and icons to FLUID.
-	- FLUID would try running multiple commands in parallel,
-	  even though it wasn't capable of handling it.
-	- FLUID didn't generate code for some attributes when
-	  using custom/named widget classes.
-	- Added a new FL_COMMAND state bit which maps to FL_CTRL
-	  on X11 and WIN32 and FL_META on MacOS.
-	- MacOS keyboard modifiers mapping corrections. Cmd and
-	  Control are no longer swapped, event_key and event_text
-	  return (mostly) the same values as on other platforms.
-	- The Fl_Tabs widget should no longer be a focus hog;
-	  previously it would take focus from child widgets.
-	- The file chooser now activates the OK button when
-	  opening a directory in directory selection mode.
-	- Fixed a bug in the file chooser when entering an
-	  absolute path.
-	- Back-ported some FLTK 2.0 tooltip changes to eliminate
-	  erroneous tooltip display.
-	- MacOS windows were resizable, even when size_range
-	  would not allow for resizing.
-	- Fl_Text_Editor now supports Shift+Delete, Ctrl+Insert,
-	  and Shift+Insert for cut, copy, and paste,
-	  respectively.
-	- Fl_Text_Display didn't restore the mouse pointer when
-	  hidden.
-	- Fl::arg() now ignores the MacOS X -psn_N_NNNNN option.
-	- Added another change to the WIN32 redraw handling for
-	  the MingW compilers.
-	- Fl_File_Chooser didn't handle WIN32 home directories
-	  that used backslashes instead of forward slashes.
-	- Fl_Text_Display didn't limit the resize height to 1
-	  line.
-	- Fl_Scrollbar widgets incorrectly took keyboard focus
-	  when clicked on. This caused widgets such as
-	  Fl_Text_Display to hide the cursor when you scrolled
-	  the text.
-
-
-CHANGES IN FLTK 1.1.1
-
-	- Fl_Text_Display didn't always show the cursor.
-	- Fl_Tabs now only redraws the tabs themselves when
-	  making focus changes.  This reduces flicker in tabbed
-	  interfaces.
-	- The WIN32 redraw handler now correctly merges the FLTK
-	  and Windows redraw regions.
-	- The Fl_Text_* widgets use the C++ bool type, which is
-	  not supported by older C++ compilers.  Added a
-	  configure check and workaround code for this.
-	- Fl_X::set_xid() didn't initialize the backbuffer_bad
-	  element that was used with XDBE.
-	- Fl_Shared_Image::uncache() was not implemented.
-	- Fl::set_font() didn't 0-initialize all font descriptor
-	  data.
-	- Some OpenGL implementations don't support single-
-	  buffered visuals. The Fl_Gl_Window class now emulates
-	  single-buffered windows using double-buffered
-	  windows.
-	- Added a workaround for a compiler bug in Borland C++
-	  that prevented Fl_Help_View.cxx from compiling.
-	- Checkmarks didn't scale properly; copied the 2.0 check
-	  mark code over.
-	- Replaced several memcpy's with memmove's for
-	  portability (memmove allows for overlapping copies,
-	  memcpy does not)
-	- Bug #621737: Fl_Bitmap::copy(), Fl_Pixmap::copy(), and
-	  Fl_RGB_Image::copy() now range-check the new width and
-	  height to make sure they are positive integers.
-	- Bug #621740: the WIN32 port needed to handle WM_MOUSELEAVE events
-	  in order to avoid problems with tooltips.
-	- Fl_PNM_Image didn't set the "alloc" flag for the data,
-	  which could lead to a memory leak.
-	- fl_filename_match() was inconsistently doing case-
-	  insensitive matching.
-	- Fl_Button redraw fix for bug #620979 (focus boxes and
-	  check buttons).
-	- Fl_Text_Display fix for bug #620633 (crash on
-	  redisplay).
-	- Fl_Output now calls its callback when the user clicks
-	  or drags in the widget.
-	- Shortcuts now cause buttons to take focus when visible
-	  focus is enabled.
-	- fl_filename_relative() didn't check that the path was
-	  absolute under WIN32.
-	- fl_filename_relative() didn't check that the path was
-	  on the current drive under WIN32.
-	- The Fl_BMP_Image class now handles 16-bit BMP files
-	  and BMP files with a transparency mask.
-	- The fltk-config script didn't add the required include
-	  path, if any, when compiling a program.
-	- Added a license clarification that the FLTK manual is
-	  covered by the same license as FLTK itself.
-	- Fl_Check_Browser wasn't documented.
-	- Fl_Preferences::Node::addChild(), deleteEntry(), and
-	  remove() didn't set the "dirty" flag.
-	- The "no change" button didn't work in the FLUID widget
-	  panel.
-	- Vertical scrollbars did not draw the arrows inactive
-	  when the scrollbar was inactive.
-
-
-CHANGES IN FLTK 1.1.0
-
-	- Documentation updates.
-	- Added a Fl_Widget::redraw_label() method which flags a
-	  redraw of the appropriate area.  This helps to
-	  eliminate flicker when updating the value of a widget.
-	- Fl_Wizard::value() now resets the mouse cursor to the
-	  window's default cursor.
-	- Fl_File_Chooser::type() didn't enable/disable the new
-	  directory button correctly.
-	- Fl_Preferences::entryExists() did not work properly.
-	- FLUID's image file chooser pattern was incorrect.
-	- Fl_File_Icon::load_system_icons() now detects KDE
-	  icons in /opt/kde, /usr/local, and /usr automatically,
-	  and supports the KDEDIR environment variable as well.
-	- Submenus now display to the left of the parent menu if
-	  they won't fit to the right.  Previously they would
-	  display right on top of the parent menu...
-	- Fl_Menu_:add() didn't handle a trailing "\" character
-	  gracefully.
-	- Clicking/dragging the middle mouse button in a
-	  scrollbar now moves directly to that scroll position,
-	  matching the behavior of other toolkits.
-	- Added some more range checking to the Fl_Text_Display
-	  widget.
-	- The editor demo did not correctly update the style
-	  (syntax highlighting) information.
-
-
-CHANGES IN FLTK 1.1.0rc7
-
-	- Updated the Fl_Text_Buffer and Fl_Text_Display classes
-	  to be based on NEdit 5.3 (patch from George Garvey).
-	- Fixed a problem with Fl::wait(0.0) on MacOS X 10.2;
-	  this affected the fractals demo and other OpenGL
-	  applications.
-	- Fl_Glut_Window now takes keyboard focus and handles
-	  shortcut events.
-	- The MacOS X implementation of fl_ready() now checks
-	  the event queue for events.
-	- Fl_PNM_Image now supports the XV/GIMP thumbnail format
-	  (P7).
-	- Fl_Preferences would not find groups inside the root 
-	  group.
-	- Small bug fixes for Fl_Chart, Fl_Scrollbar, Fl_Tabs,
-	  and FLUID from Matthew Morrise.
-	- Fl_Chart didn't have its own destructor, so data in
-	  the chart wasn't freed.
-	- Fl_Menu_Button no longer responds to focus or keyboard
-	  events when box() is FL_NO_BOX.
-	- FLTK convenience dialogs put the buttons in the wrong
-	  order.
-	- Fl_BMP_Image didn't load 4-bit BMP files properly.
-	- Minor tweeks to the WIN32 DLL support.
-	- Fl_Text_Display::resize() could go into an infinite
-	  loop if the buffer is emptied.
-	- Fl::handle() didn't pass FL_RELEASE events to the
-	  grab() widget if pushed() was set (for proper menu
-	  handling...)
-	- DND events were being sent to the target window
-	  instead of the target widget under WIN32.
-	- The newest Cygwin needs the same scandir() handling as
-	  HP-UX.
-	- FLUID didn't register the image formats in the
-	  fltk_images library, and had some other image
-	  management problems.
-	- Fixed one more redraw bug in Fl_Browser_ where we
-	  weren't using the box function to erase empty space in
-	  the list.
-	- Fl_Text_Display::buffer() now calls resize() to show
-	  the buffer.
-	- Fl_Help_View didn't support HTML comments.
-	- Fl_Help_View didn't include the extra cellpadding when
-	  handling colspan attributes in cells.
-	- Fl_Help_View didn't support table alignment.
-
-
-CHANGES IN FLTK 1.1.0rc6
-
-	- Documentation updates.
-	- Fl::handle() didn't apply the modal tests for
-	  FL_RELEASE events, which caused Fl_Tabs to allow users
-	  to change tabs even when a modal window was open.
-	- Fl_Browser_, Fl_Input_, Fl_Slider now use the box
-	  function to erase the background.  This fixes some
-	  long-standing redraw problems.
-	- More snprintf/strlcpy/strlcat changes where needed.
-	- Fl::get_font_name() would leak 128 bytes.
-	- Eliminated most of the "shadowed" variables to avoid
-	  potential problems with using the wrong copy of "foo"
-	  in a class method.
-	- Moved Fl_BMP_Image, Fl_GIF_Image, and Fl_PNM_Image to
-	  the fltk_images library, so the only image formats
-	  that are supported by the core library are XBM and XPM
-	  files.  This reduces the size of the FLTK core library
-	  by about 16k...
-	- The Fl_Text_Display::resize() method was incorrectly
-	  flagged as protected.
-	- Fixed some memory/initialization bugs in
-	  Fl_File_Chooser that valgrind caught.
-	- The PNG library png_read_destroy() is deprecated and
-	  does not free all of the memory allocated by
-	  png_create_read_struct(). This caused a memory leak in
-	  FLTK apps that loaded PNG images.
-	- Added uncache() method to Fl_Image and friends.
-	- Added image() methods to Fl_Menu_Item.
-	- Added default_cursor() method and data to Fl_Window.
-	- Fl_Group would send FL_ENTER events before FL_LEAVE
-	  events, causing problems with adjacent widgets.
-	- Fixed filename problems with Fl_File_Chooser -
-	  changing the filename field directly or choosing files
-	  from the root directory could yield interesting
-	  filenames.
-	- Fl_Input_ could crash if it received an empty paste
-	  event.
-	- The mouse pointer now changes to the I beam
-	  (FL_CURSOR_INSERT) when moved over an input field or
-	  text widget.
-	- "make install" didn't automatically (re)compile the
-	  FLUID executable.
-	- Added an Fl::get_boxtype() method to get the current
-	  drawing function for a specific box type.
-	- Fl_Output and Fl_Multiline_Output didn't prevent
-	  middle-mouse pastes.
-	- Fl_JPEG_Image didn't compile out-of-the-box with Cygwin
-	  due to a bug in the Cygwin JPEG library headers.
-	- Fl_BMP_Image still didn't work with some old BMP files.
-	- "make distclean" didn't really clean out everything.
-	- Tweeked the look of the check button with a patch from
-	  Albrecht Schlosser.
-
-
-CHANGES IN FLTK 1.1.0rc5
-
-	- Added "wrap" type bit to Fl_Input_, so you can now
-	  have a multiline text field that wraps text.
-	- Setting the value() of an output text field no longer
-	  selects the text in it.
-	- Output text fields now show a caret for the cursor
-	  instead of the vertical bar.
-	- The newButton and previewButton widgets are now public
-	  members of the Fl_File_Chooser class.  This allows
-	  developers to disable or hide the "new directory" and
-	  "preview" buttons as desired.
-	- Added new visible focus flag bit and methods to
-	  Fl_Widget, so it is now possible to do both global and
-	  per-widget keyboard focus control.
-	- Removed extra 3 pixel border around input fields.
-	- No longer quote characters from 0x80 to 0x9f in input
-	  fields.
-	- Improved speed of Fl_Browser_::display() method with
-	  large lists (patch from Stephen Davies.)
-	- Fl_Help_View didn't properly handle NULL from the link
-	  callback (the original filename/directory name were
-	  not preserved...)
-	- Fl_Help_View didn't use the boxtype border values when
-	  clipping the page that was displayed.
-	- Added first steps to CodeWarrior/OS_X support (see
-	  fltk-1.1.x/CodeWarrior/OS_X.sit)
-	- Cleaned up the WIN32 export definitions for some of
-	  the widget classes.
-	- Fixed a filename completion bug when changing
-	  directories.
-	- Fl_File_Chooser::value() would return directories with
-	  a trailing slash, but would not accept a directory
-	  without a trailing slash.
-	- When installing shared libraries, FLUID is now linked
-	  against the shared libraries.
-	- MacOS: missing compile rule for .dylib files.
-	- Fl_Group::current(), Fl_Group::begin(), and
-	  Fl_Group::end() are no longer inlined so that they are
-	  properly exported in DLLs under WIN32.  Similar
-	  changes for all static inline methods in other
-	  classes.
-	- MacOS: support for Mac system menu (Fl_Sys_Menu_Bar)
-	- MacOS: wait(0) would not handle all pending events
-	- Added new makeinclude file for MingW using GCC 3.1.x.
-	- Fl_Choice::value(n) didn't range check "n".
-	- The MingW and OS/2 makeinclude files didn't have the
-	  new fltk_images library definitions.
-	- Fl_Text_Editor didn't scroll the text in the widget
-	  when dragging text.
-	- Config header file changes for Borland C++.
-	- FLTK didn't provide a Fl::remove_handler() method.
-
-
-CHANGES IN FLTK 1.1.0rc4
-
-	- Added new filter_value() methods to Fl_File_Chooser to
-	  get and set the current file filters.
-	- Added support for custom filters to Fl_File_Chooser.
-	- Added Borland C++ Builder IDE project files from
-	  Alexey Parshin.
-	- Resource leak fixes under WIN32 from Ori Berger.
-	- Now register a WIN32 message for thread messages.
-	- Fl_Window didn't initialize the min and max window
-	  size fields.
-	- The JPEG and PNG image classes have been moved to the
-	  fltk_images library, a la FLTK 2.0.  You can register
-	  all image file formats provided in fltk_images using
-	  the new fl_register_images() function.
-	- Fl_XBM_Image didn't correctly load XBM files.
-	- MacOS: Added Greg Ercolano's file descriptor support.
-	- MacOS: Fixed text width bug.
-	- A change in fl_fix_focus() broken click-focus in FLWM.
-	- Cygwin with -mnocygwin didn't like the FL/math.h
-	  header file.
-	- Fl_Browser_ cleared the click count unnecessarily.
-	- MacOS: Pixmap draw fix, gl_font implemented
-	  FL_FOCUS fix, window type fix for modal and nonmodal
-	  windows, glut uninitialised 'display' proc fix
-	- Now support FLTK_1_0_COMPAT symbol to define
-	  compatibility macros for the old FLTK 1.0.x function
-	  names to the 1.1.x names.
-	- Now translate the window coordinates when a window is
-	  shown, moved, or resized.  This should fix the "menus
-	  showing up at the wrong position" bug under XFree86.
-	- Fixed some more problems with the Fl_BMP_Image file
-	  loader.
-	- BC++ fixes.
-	- The pixmap_browser demo didn't check for a NULL image
-	  pointer.
-	- Fl_File_Icon::find() now uses fl_filename_isdir()
-	  under WIN32 to check for directories.
-	- Fl_File_Chooser's preview code called refcount()
-	  on the deleted image's object.
-	- Fixed another problem with the Fl_BMP_Image loader.
-	- The fl_file_chooser() callback was being called with a
-	  NULL filename.
-	- Documented that fl_push_clip() is preferred over
-	  fl_clip(), with a corresponding source change.
-	- Minor changes to the MacOS X event handling code.
-	- Added syntax highlighting example code to the editor
-	  test program.
-	- Fl_Text_Display didn't range check style buffer
-	  values.
-	- Added "dark" color constants (FL_DARK_RED, etc.)
-	- The MacOS font code was missing definitions for
-	  fl_font_ and fl_size_.
-
-
-CHANGES IN FLTK 1.1.0rc3
-
-	- Documentation updates.
-	- New file chooser from design contest.
-	- Did some testing with Valgrind and fixed some memory
-	  problems in Fl_Help_View::Fl_HelpView,
-	  Fl_Menu_::remove(), Fl_Text_Display::draw_vline(), and
-	  resizeform() (convenience dialogs).
-	- Fixed some redraw() bugs, and now redraw portions of
-	  the parent widget when the label appears outside the
-	  widget.
-	- The boolean (char) value methods in Fl_Preferences
-	  have been removed since some C++ compilers can't
-	  handle char and int value methods with the same name.
-	- Added fl_read_image() function.
-	- Fixed Fl_Valuator::format() so that the correct format
-	  type is used when step == 1.0.
-	- Fl_Help_View didn't support the TT markup.
-	- Fl_Shared_Image used a double-pointer to the image
-	  handler functions, which was unnecessary and
-	  unintuitive.
-	- Fl_PNM_Image didn't load the height of the image
-	  properly.
-	- Fl_BMP_Image, Fl_JPEG_Image, Fl_PNG_Image, and
-	  Fl_Shared_Image didn't delete image data that was
-	  allocated.
-	- Enabled the OpenGL and threads demos when compiling
-	  for MingW.
-	- Fl_File_Input didn't update the directory buttons if a
-	  callback was registered with the widget.
-	- The file chooser would return the last selected
-	  file(s) when cancel was pressed.
-	- The file chooser limited the resizing of the chooser
-	  window unnecessarily.
-	- Fixed WM_PAINT handling under WIN32.
-	- Minor tweeks to MingW and OS/2 config headers.
-	- Fl_Value_Input now correctly determines if step()
-	  specifies an integer value.
-	- Fl_Help_View didn't add links inside PRE elements.
-	- OS/2 build fixes from Alexander Mai.
-	- Now use strlcat() instead of strncat() which could
-	  cause buffer overflows.
-	- Now use of strlcpy() instead of strncpy() to simplify
-	  the code.
-	- Drag-n-drop under WIN32 now shows a [+] cursor instead
-	  of the link cursor.
-	- Fixed widget width tooltip and default argument
-	  handling code in FLUID.
-	- Fixed colors used when drawing antialiased text using
-	  Xft.
-	- Fl_Preferences::makePath() now uses access() instead
-	  of stat() when checking to see if the destination
-	  directory already exists.
-	- Fl_BMP_Image now supports older BMP files with the 12
-	  byte header.
-	- Optimized the redrawing of tabs and radio/check
-	  buttons when the keyboard focus changes.
-	- More tooltip fixes.
-	- DND text operations would loop under X11.
-
-
-CHANGES IN FLTK 1.1.0rc2
-
-	- Portability fixes.
-	- Backported 2.0 tooltip changes.
-	- Several of the valuators did not support tooltips.
-	- The last menu item in a menu didn't pick up on font
-	  changes.
-	- FLUID now properly handles default argument parameters
-	  properly.
-	- Fixed WM_PAINT handling under WIN32 - didn't validate
-	  the correct region that was drawn.
-	- Fl_Multiline_Output would insert the enter key.
-	- Fl_File_Browser didn't clip items to the column width.
-	- Fl_Window::draw() cleared the window label but didn't
-	  restore it, so windows could lose their titles.
-	- Eliminated multiple definitions of dirent structure
-	  when compiling under WIN32.
-	- Adjusted the size of the circle that is drawn inside
-	  radio buttons to scale better for larger labels.
-	- FLUID was opening the display when it shouldn't have.
-	- Fl_File_Chooser.cxx defined the file chooser functions
-	  again; they should only be defined in the header file.
-	- Wide arcs would draw with "teeth".
-	- The preferences demo included Fl/Fl_Preferences.H
-	  instead of FL/Fl_Preferences.H.
-
-
-CHANGES IN FLTK 1.1.0rc1
-
-	- The fl_file_chooser() and fl_dir_chooser() functions
-	  now support an optional "relative" argument to get
-	  relative pathnames; the default is to return absolute
-	  pathnames.
-	- The backspace and delete keys now work as expected in
-	  the file chooser when doing filename completion.
-	- FLUID now supports running shell commands.
-	- New Fl_File_Input widget that shows directory
-	  separators with filename in input field.
-	- The Fl_File_Chooser dialog now shows the absolute path
-	  in the filename field using the Fl_File_Input widget.
-	- FLUID now keeps track of grid, tooltip, and other
-	  GUI options, along with the last 10 files opened.
-	- Tooltip windows would show up in the task bar under
-	  WIN32.
-	- Now append trailing slash to directory names in names
-	  in WIN32 version of scandir().  This takes care of a
-	  file chooser performance problem with large
-	  directories.
-	- Added Fl_Preferences class from Matthias Melcher,
-	  including binary data support.
-	- FLUID now recognizes the "using" keyword in
-	  declarations.
-	- fl_file_chooser() didn't highlight the requested file
-	  the second time the file chooser dialog was shown.
-	- Fixed rendering of Fl_Light_Button with the plastic
-	  scheme.
-	- Fixed a bug in the MacOS font enumeration code.
-	- Now show a "locked" icon next to static/private
-	  elements in FLUID, and "unlocked" icon next to
-	  global/public elements.
-	- Implemented Fl_Menu_Item image labels using older
-	  1.0.x labeltype method.
-	- Updated the PNG library check to support both png.h
-	  and libpng/png.h.
-	- Fixed a recursion bug in tooltips that was causing
-	  random crashes.
-	- fl_file_chooser() could cause a segfault when passed a
-	  NULL filename parameter in some situations.
-	- Added a "-g" option to fltk-config to support quick
-	  compiling with debugging enabled.
-	- Fixed redraw problem with Fl_Input and anti-aliased
-	  text.
-	- Added threading support for MacOS X and Darwin.
-	- The filesystem list in the file chooser now works under
-	  MacOS X and Darwin.
-	- The fl_msg structure now contains all data passed to
-	  the WndProc function under WIN32.
-	- Fixed some window focus/positioning problems under
-	  MacOS X.
-	- Added fl_create_alphamask() function to create an alpha
-	  mask from 8-bit data; currently this always generates a
-	  1-bit screen-door bitmask, however in the future it will
-	  allow us to generate N-bit masks as needed by various
-	  OS's.
-	- Fl_File_Browser::load() didn't properly show drives
-	  when compiled in Cygwin mode.
-	- Now pass correctly pass keyboard and mouse events to
-	  widget under tooltip as needed...
-	- Added new Fl::dnd_text_ops() methods to enable/disable
-	  drag-and-drop text operations.
-	- Fl_Input now supports clicking inside a selection to
-	  set the new text position when drag-and-drop is
-	  enabled.
-	- Added support of X resources for scheme, dnd_text_ops,
-	  tooltips, and visible_focus...
-	- Fixed some case problems in includes for the MacOS X
-	  code.
-	- Fl_Widget::handle() returned 1 for FL_ENTER and
-	  FL_LEAVE events, which caused some compatibility
-	  problems with 1.0 code.
-	- Fl_Box::handle() now returns 1 for FL_ENTER and
-	  FL_LEAVE events so that tooltips will work with Fl_Box
-	  widgets.
-	- Some source files still defined strcasecmp and
-	  strncasecmp under WIN32.
-	- Some source files still used the "false" and "true"
-	  C++ keywords, even though several of our "supported"
-	  C++ compilers don't support them.  Using 0 and 1 until
-	  FLTK 2.0 (which uses the bool type instead of int for
-	  any boolean values...)
-	- Minor Fl_Color revamping, so that color constants map
-	  to the color cube and FL_FOREGROUND_COLOR,
-	  FL_BACKGROUND_COLOR, FL_BACKGROUND2_COLOR,
-	  FL_INACTIVE_COLOR, and FL_SELECTION_COLOR map to the
-	  user-defined colors.
-
-
-CHANGES IN FLTK 1.1.0b13
-
-	- Fixed a bug in the Xft support in Fl_Window::hide()
-	  (the config header wasn't included, so the Xft code
-	  wasn't getting called)
-	- Xdbe support must now be enabled explicitly using
-	  --enable-xdbe due to inconsistent bugs in XFree86 and
-	  others.
-	- Windows resized by a program would revert to their
-	  original size when moved under WIN32.
-	- Cygwin can only compile the new WIN32 drag-n-drop code
-	  using GCC 3.x.
-	- Tooltips now appear for inactive and output widgets.
-	- Tooltips no longer steal keyboard events other than
-	  ESCape.
-	- Tooltips are no longer delayed when moving between
-	  adjacent widgets.
-	- fl_beep(FL_BEEP_DEFAULT) now uses the PC speaker under
-	  Windows (0xFFFFFFFF) rather than an event sound.
-	- The configure script didn't include the -mwindows or
-	  -DWIN32 compiler options in the output of fltk-config
-	  when using the Cygwin tools.
-	- Fl_Output didn't take input focus when needed, so it
-	  was unable to support CTRL-C for copying text in the
-	  field and did not unhighlight selections when the
-	  widget lost focus.
-	- The fl_filename_name() function didn't handle a NULL
-	  input string.
-	- The input field used by the fl_input() and
-	  fl_password() functions was resized too small in
-	  1.1.0b12.
-	- Added casts in fl_set_fonts_win32.cxx for VC++ 5.0.
-	- Fl_File_Icon::find() did not check the basename of a
-	  filename for a match; this caused matches for a
-	  specific filename (e.g. "fluid") to fail.
-	- The Fl_Shared_Image class now supports additional
-	  image handling functions - this allows you to support
-	  additional image file formats transparently.
-
-
-CHANGES IN FLTK 1.1.0b12
-
-	- Documentation updates.
-	- Fl_Choice didn't clip the current value properly - it
-	  wasn't accounting for the box border width.
-	- The forms compatibility functions are now placed in a
-	  "fltk_forms" library to match FLTK 2.0.
-	- Renamed down() and frame() to fl_down() and
-	  fl_frame(), filename_xyz() to fl_filename_xyz(), and
-	  all of the define_FL_FOO() functions for the custom
-	  boxtypes to fl_define_FL_FOO() to avoid namespace
-	  clashes.
-	- Stereo OpenGL support (patch from Stuart Levy)
-	- All of the convenience functions defined in fl_ask.H
-	  now resize the widgets and dialog window as needed for
-	  the labels and prompt.
-	- Backported FLTK 2.0 dual cut/paste buffer code.
-	- Added support for Xft library to provide anti-aliased
-	  text on X11.
-	- Fl_Help_View didn't keep track of the background color
-	  of cells properly.
-	- Fl_Browser::item_width() didn't compute the width of
-	  the item properly when column_widths() was set.
-	- Fl_Button didn't check to see if the widget could
-	  accept focus before taking input focus.
-	- Fl_Help_View didn't preserve target names (e.g.
-	  "filename.html#target") when following links.
-	- Drag-and-drop support for MacOS.
-	- Updated MacOS issues documentation.
-
-
-CHANGES IN FLTK 1.1.0b11
-
-	- Now conditionally use the WIN32 TrackMouseEvent API
-	  (default is no...)
-	- Fixed a table rendering bug in the Fl_Help_View
-	  widget.
-	- The fltk-config script now recognizes all common C++
-	  extensions.
-	- The menu code was using overlay visuals when the
-	  scheme was set to "plastic".
-	- Fixed some drawing problems with Fl_Light_Button and
-	  its subclasses.
-	- Fixed a minor event propagation bug in Fl_Group that
-	  caused mousewheel events to be passed to scrollbars
-	  that were not visible.
-	- The fl_file_chooser() function did not preserve the
-	  old file/directory like the old file chooser did.
-	- The prototypes for fl_input() and fl_password() did
-	  not default the "default value" to NULL.
-	- Fl_Tabs now draws tabs using the selection_color() of
-	  the child groups; this allows the tabs to be colored
-	  separately from the body.  Selected tabs are a mix of
-	  the Fl_Tabs selection_color() and the child group's
-	  selection_color().
-	- Fl_Tabs didn't include images in the measurement of
-	  the tabs if no label text was defined.
-	- The WIN32 code didn't return 0 from the window
-	  procedure after handling WM_PAINT messages.
-	- fl_draw() would incorrectly test the clipping of
-	  labels the lay outside the bounding box.
-	- filename_relative() didn't always return the correct
-	  relative path.
-	- Updated the test makefile to work with more versions
-	  of "make".
-	- Added new "--with-optim" configure option to set the
-	  optimization flags to use when compiling FLTK.
-	- The fltk-config script no longer reports the
-	  optimization flags that were used to compile FLTK.
-	- Initial port of FLTK 2.0 drag-and-drop support.
-
-
-CHANGES IN FLTK 1.1.0b10
-
-	- Fixed the new WIN32 TrackMouseEvent code.
-	- Fixed the VC++ project files to link against
-	  comctl32.lib.
-
-
-CHANGES IN FLTK 1.1.0b9
-
-	- Better FL_LEAVE event handling for WIN32.
-	- The alpha mask was bit-reversed.
-	- Fl::scheme() applied the scheme tile image to overlay
-	  and menu windows, which caused problems when the
-	  overlay planes were in use.
-	- Fixed Fl::event_button() value when hiding tooltip on
-	  some systems.
-	- Added Fl_BMP_Image class to support loading of Windows
-	  bitmap (BMP) files.
-	- The shiny demo didn't work on some systems (no
-	  single-buffered OpenGL visual), and the new box types
-	  were reset when show(argc, argv) was called.
-	- Fl::scheme() didn't update windows that were not
-	  shown.
-	- The fractals demo would get far ahead of the UI with
-	  some Linux OpenGL drivers.  Now use glFinish() instead
-	  of glFlush() so we are at most 1 frame ahead.
-	- The fractals demo Y axis controls were backwards for
-	  the "flying" mode.
-	- MacOS: cleaned up src/Fl_mac.cxx
-	- MacOS: fixed Fl::wait(0.0), fixed Cmd-Q handling
-	- Update CygWin support for Fl::add_fd().
-	- Update the plastic scheme to not override the default
-	  colors - move the color code to the MacOS-specific
-	  code.  Also updates the tile image colormap to match
-	  the current background color.
-	- Add fl_parse_color() to X11 as well, removing a bunch
-	  of conditional code and providing a common interface
-	  for looking up color values.
-	- Fixed the make problems in the test directory - some
-	  make programs had trouble handling the recursive
-	  dependencies on the FLUID files...
-	- Now use rint() to round floating-point coordinates.
-	- Demo cleanup - made sure they all worked with schemes.
-	- Fl_Tabs no longer clears the unused area of the tab
-	  bar.
-	- Added show(argc, argv) method to Fl_Help_Dialog.
-	- MacOS: implemented cut/copy/paste.
-	- MacOS: improved keyboard handling, fixed keyboard
-	  focus handling, fixed get_key, modified 'keyboard'
-	  demo to show second mouse wheel and additional keys
-	  'help' and FL_NK+'='
-
-
-CHANGES IN FLTK 1.1.0b8
-
-	- OS/2 build fixes.
-	- fl_draw() didn't ignore symbol escapes properly for
-	  the browsers...
-	- New Fl::scheme() methods from FLTK 2.0; currently only
-	  the standard ("") and plastic ("plastic") methods are
-	  supported.  Schemes can be set on the command-line
-	  ("-scheme plastic") or using the FLTK_SCHEME
-	  environment variable.
-	- MacOS: fixed iBook keyboard handling, moved 
-	  remaining message handling to Carbon, added mouse
-	  capture support, added timer support, added overlay
-	  support, fixed double-buffering side effects.
-	- The configure script wasn't using the -fpermissive or
-	  -fno-exceptions options with GCC.
-	- Fl_JPEG_Image and friends didn't set the depth if the
-	  image file couldn't be loaded; since Fl_RGB_Image
-	  didn't check for this, it could fail when displaying
-	  or copying these images.
-	- filename_absolute() did not always free its temporary
-	  buffer.
-	- filename_relative() did not do a case-insensitive
-	  comparison under MacOS, OS/2, and Windows.
-	- filename_isdir() didn't properly handle "D:L" under
-	  WIN32.
-	- Fl_Shared_Image::get() did not check to see if the
-	  image could not be loaded.
-	- Fl_Help_View didn't clear the line array in the
-	  Fl_Help_Block structure; this causes erratic
-	  formatting for some pages.
-	- The font and size members of Fl_Help_Block were never
-	  used.
-	- The threading functions (Fl::lock() and friends) were
-	  not exported under WIN32.
-	- The Fl_Text_Display destructor deleted the scrollbars
-	  twice...
-	- Fl_Help_View didn't reset the horizontal scroll
-	  position when showing a new page.
-	- Fl_Pack now allows any child widget to be the
-	  resizable() widget, not just the last one.
-	- MacOS: opaque window resizing, all events except 
-	  Mac menus are now handled using Carbon, window 
-	  activation fixed, GL_SWAP_TYPE default changed to 
-	  make gl_overlay work.
-	- Fl_Help_View::resize() didn't resize the horizontal
-	  scrollbar.
-	- MacOS: list all fonts, fixed clipping and mouse
-	  pointer bugs.
-	- The Fl_File_Chooser widget now uses hotspot() to
-	  position the dialog under the mouse pointer prior to
-	  showing it.
-	- Added a configure check for *BSD - use -pthread option
-	  instead of -lpthread.
-	- Fl_Text_Display could get in an infinite loop when
-	  redrawing a portion of the screen.  Added a check for
-	  the return value from fl_clip_box() so that the
-	  correct bounding box is used.
-	- Removed the Fl_Mutex and Fl_Signal_Mutex classes from
-	  the threads example, since they weren't being used
-	  and apparently are not very portable.
-	- Fl_Help_View now ignores links when the link callback
-	  returns NULL, and displays a sensible error message
-	  when an unhandled URI scheme is used (e.g. http:,
-	  ftp:)
-	- Fl_File_Icon::load_system_icons() no longer complains
-	  about missing icon files, just files that exist but
-	  can't be loaded.
-	- FLUID didn't list the plastic box and frame types.
-	- Now hide the tooltip window whenever a window is
-	  hidden.  Otherwise a tooltip window could keep an
-	  application running.
-	- Updated FLUID to only append a trailing semicolon to
-	  code lines in a callback (so "#include" and friends
-	  will work...)
-	- The Fl_Color_Chooser widget now supports keyboard
-	  navigation.
-	- Fixed button and valuator widgets to call Fl::focus()
-	  instead of take_focus().
-	- Tweeked the radio button drawing code for better
-	  circles with different boxtypes.
-	- The Fl_File_Chooser widget did not provide a shown()
-	  method, and fl_file_chooser() and fl_dir_chooser() did
-	  not wait on shown(); this would cause them to return
-	  prematurely if you switched desktops/workspaces.
-	- Cosmetic changes to plastic boxtypes.  Now look much
-	  better for large areas and the buttons now have a much
-	  greater "3D" feeling to them.
-	- Added new Fl::draw_box_active() method so that
-	  boxtypes can find out if the widget they are drawing
-	  for is active or not.
-	- Fl_Button and its subclasses did not redraw the parent
-	  when the boxtype was FL_NO_BOX and they lost keyboard
-	  focus (the parent redraw clears the focus box.)
-	- Fixed the example program makefile - wasn't building
-	  the mandelbrot and shiny demos right.
-	- Fl::set_font(Fl_Font, Fl_Font) was not implemented.
-	- Fixed the documentation Makefile commands; was not
-	  using the fltk.book file for some reason...
-
-
-CHANGES IN FLTK 1.1.0b7
-
-	- More documentation updates...
-	- Mac OS X support works 95%
-	- The Fl_Window::hotspot() off-screen avoidance code was
-	  commented out.
-	- Mac OS X uses mostly Carbon event handling to support
-	  Mousewheel, three buttons, all modifier keys, etc.
-	- Updated paragraph 4 of the FLTK license exceptions;
-	  there was some question about the requirement to show
-	  that a program uses FLTK, which is required by section
-	  6 of the LGPL. The new exemption specifies that
-	  inclusion of the FLTK license is not required, just a
-	  statement that the program uses FLTK.
-	- Fl_Button::handle() was calling take_focus() for both
-	  FL_PUSH and FL_DRAG.
-	- File and memory fixes for Fl_GIF_Image, Fl_PNG_Image,
-	  Fl_PNM_Image, Fl_Shared_Image, Fl_Tiled_Image, and
-	  Fl_XBM_Image.
-	- filename_match() didn't handle backslashes properly
-	  under WIN32, and didn't use a case-insensitive
-	  comparison under MacOS X.
-	- The Fl class was missing access methods for the
-	  FL_MOUSEWHEEL event values - Fl::event_dx() and
-	  Fl::event_dy().
-	- The default help string didn't include the -nokbd
-	  option.
-	- "make uninstall" didn't uninstall the static OpenGL
-	  widget library.
-	- Mac cursor shapes added...
-	- Fl_Text_Display would lockup when all text was
-	  deleted; for example, when running the editor
-	  demo, you couldn't load a second file.
-	- Added Fl::lock() and friends from FLTK 2.0 to
-	  support multi-threaded applications; see the
-	  "threads" demo for an example of this.
-	- Fl_Check_Button and Fl_Round_Button now use the
-	  FL_NO_BOX box type to show the background of the
-	  parent widget.
-	- Tweeked the plastic boxtype code to draw with the
-	  right shading for narrow, but horizontal buttons.
-	- Fl_Progress now shades the bounding box instead of
-	  drawing a polygon inside it.
-	- Fl::warning() under WIN32 defaults to no action. This
-	  avoids warning dialogs when an image file cannot be
-	  loaded.
-	- Some Win32 drivers would draw into wrong buffers
-	  after OpenGL mode change
-	- The file chooser would cause a segfault if you
-	  clicked in an empty area of the file list.
-	- Fl_File_Icon::labeltype() would cause a segfault
-	  if the value pointer was NULL.
-	- Fl_File_Icon::load_image() could cause segfaults
-	  (NULL data and incrementing the data pointer too
-	  often.)
-	- Fl_File_Icon::load_image() now handles 2-byte
-	  per color XPM files.
-	- Some Win32 drivers would draw into wrong buffers
-	  after OpenGL mode change.
-	- Message handling and Resources for MacOS port.
-	- Fl_Help_View could get in an infinitely loop when
-	  determining the maximum width of the page; this
-	  was due to a bug in the get_length() method with
-	  percentages (100% width would cause the bug.)
-	- Don't need -lgdi32 for CygWin, since -mwindows
-	  does this for us.
-	- The WIN32 event handler did not properly handle
-	  WM_SYNCPAINT messages.
-	- Fl_Tabs now uses the boxtype exclusively to draw
-	  both the tabs and surrounding box, so alternate
-	  box types actually work and the look is a little
-	  nicer.
-	- Fixed the drawing of large areas with the new
-	  plastic boxtypes.
-	- Updated the Visual C++ demo projects to use FLUID
-	  to generate the GUI files as needed.
-	- The demo program didn't load the right menu file
-	  when compiled for debugging under WIN32.
-	- Added plastic box types to forms demo.
-	- Added mousewheel to keyboard demo.
-	- The Fl_Text_Editor widget caused an infinite loop
-	  when it received keyboard focus.
-	- filename_isdir() didn't properly handle drive letters
-	  properly; WIN32 needs a trailing slash for drive
-	  letters by themselves, but cannot have a trailing
-	  slash for directory names, go figure...
-	- The Fl_Text_Buffer and Fl_Text_Display classes did not
-	  initialize all of their members.
-	- fl_normal_label() had a totally redundant set of
-	  if/else tests, which the new code handles all from
-	  fl_draw().
-	- The Fl_File_Chooser dialog contained two hotspots.
-	- The fl_draw_pixmap() function didn't free the 2-byte
-	  color lookup table properly (delete instead of
-	  delete[]).
-	- fl_draw() reset the text color under WIN32, causing
-	  bitmaps to draw incorrectly.
-	- Fl::get_font_sizes() is now implemented under WIN32.
-	- Fl_Text_Display now uses the same default colors for
-	  selection and text as Fl_Input_ and friends.
-	- Changed the default line scrolling in Fl_Text_Display
-	  to 3 lines for the mouse wheel and scrollbar arrows.
-
-
-CHANGES IN FLTK 1.1.0b6
-
-	- Documentation updates...
-	- The configure script now works within the CygWin
-	  environment.
-	- Tooltips are now enabled by default, but are not
-	  re-enabled when calling the Fl_Widget::tooltip()
-	  method.
-	- Added new Fl::version() method to get the current
-	  FLTK library version (for shared libraries/DLLs)
-	- Added new Fl::event() method to get the current
-	  event that is being processed.
-	- Added new fl_beep() function to do audible
-	  notifications of various types.
-	- Added new Fl_GIF_Image, Fl_JPEG_Image, Fl_PNG_Image,
-	  Fl_PNM_Image, Fl_XBM_Image, and Fl_XPM_Image classes.
-	- Added new Fl_Shared_Image class, a la FLTK 2.0.
-	- Added new Fl_Tiled_Image class for tiled backgrounds.
-	- Added new copy(), desaturate(), inactive(), and
-	  color_average() methods to the Fl_Image classes.
-	- Added a horizontal scrollbar to the Fl_Help_View
-	  widget.
-	- Added new FL_PLASTIC_{UP/DOWN}_{BOX/FRAME} boxtypes
-	  for a more "modern" look (sort of a cross between KDE
-	  2.2 and Aqua.)
-	- Fl_Float_Input and Fl_Int_Input no longer accept
-	  pasted text that is not a floating point or integer
-	  value.  Pasted numbers now replace text in these
-	  widgets.
-	- Implemented the Fl_File_Icon::load_png() method.
-	- The Fl_File_Icon::load_system_icons() method now
-	  supports KDE 2.x icons.
-	- Fixed PNG support in Fl_Help_View.
-	- Removed the "Microsoft" mode button from the menubar
-	  demo.
-	- The browser demo now makes sure that the input field
-	  contains a number.
-	- The Fl_Browser::make_visible() method now range checks
-	  the input.
-	- Updated the fl_draw() and fl_measure() methods to
-	  accept an optional draw_symbols argument, which
-	  controls whether symbols are drawn in the text.
-	- Added new Fl::visible_focus() methods to control
-	  whether the focus box is drawn.
-	- The focus box is now drawn using the contrast color.
-	- Fl_Repeat_Button didn't accept keyboard focus.
-	- Added new Fl::visible_focus() method and standard
-	  "-kbd" and "-nokbd" options in Fl::args() processing
-	  to control whether keyboard focus is shown and handled
-	  by non-text widgets.
-	- The wrong tooltip could be shown if the user moved the
-	  mouse over adjacent widgets with tooltips.
-	- The drop-down button on Fl_Choice widgets was not
-	  limited in width.
-	- Tooltips could appear off the screen.
-	- Mouse wheel events are now sent to the focus widget
-	  first, then to any other interested widget.
-	- The Fl_RGB_Image class now supports images with an
-	  alpha channel.  Images are currently drawn using
-	  "screen door" transparency...  See the "image" demo
-	  for an example.
-	- Added new fl_create_bitmask() and fl_delete_bitmask()
-	  functions that create bitmap objects for masking and
-	  bitmap drawing.
-	- Was sending FL_RELEASE events for buttons 4 and 5
-	  under X11, which are only for FL_MOUSEWHEEL.
-	- Fl_Help_View now supports the EM and STRONG elements.
-	- Didn't do callbacks when changing tabs via keyboard.
-	- FLUID didn't write tooltip strings to the message
-	  catalog file.
-	- Fl_File_Icon now uses Fl_Shared_Image to load icon
-	  images; the load_png() and load_xpm() methods have
-	  been replaced by a single load_image() method.
-	- Fl_File_Icon::load_system_icons() now does a better
-	  job of finding KDE icons.
-	- Now use Fl::warning() and Fl::error() in place of
-	  printf's in some of the newer widgets.
-	- The default behavior of Fl::error() is now to display
-	  an error but not to exit; Fl::fatal() still exits.
-	- FLUID now uses the Fl_Shared_Image class, so FLUID-
-	  generated GUIs can embed any of the supported image
-	  file formats.
-	- New filename_relative() function to convert an
-	  absolute filename to a relative one.
-	- Updated the filename_absolute(), filename_expand(),
-	  and filename_setext() functions to take the
-	  destination string size, with inline functions for the
-	  old FL_PATH_MAX size.
-	- fl_file_chooser() and fl_dir_chooser() now return a
-	  relative path.
-	- Fl_Help_View now supports all ampersand escapes.
-
-
-CHANGES IN FLTK 1.1.0b5
-
-	**** NOTE: DUE TO CHANGES IN THE WIDGET CLASSES,  ****
-	****       YOU MUST RECOMPILE ALL SOURCE FILES    ****
-	****       THAT USE FLTK!!!                       ****
-
-	- All FLTK color values are now 32-bits and support
-	  both the legacy 8-bit color values as well as 24-bit
-	  RGB values (0xRRGGBB00 for 24-bit RGB, 0x000000II
-	  for indexed color).
-	- Fl::set_boxtype() and fl_internal_boxtype() now keep
-	  track of when a boxtype is changed; this allows you to
-	  override the "special" boxtypes without references to
-	  those boxtypes causing them to be reset.
-	- Fl_Help_Func now takes a Fl_Widget pointer as well as
-	  a pathname.
-	- Added code to support FL_KEYUP events.
-	- Focus did not return to the Fl_Text_Display and Editor
-	  widgets when scrolling and then clicking inside the
-	  editor window.
-	- Now set the line size of the vertical scrollbar in the
-	  text editor to 1.
-	- The symbols demo didn't show the strings needed to
-	  show the corresponding symbol (the label string was
-	  not quoted...)
-	- FLTK should now compile with Cygwin cleanly.
-	- Shortcut changes were not being saved by FLUID.
-	- FLUID didn't write the deimage() static data.
-
-
-CHANGES IN FLTK 1.1.0b4
-
-	**** NOTE: DUE TO CHANGES IN THE FL_WIDGET CLASS, ****
-	****       YOU MUST RECOMPILE ALL SOURCE FILES    ****
-	****       THAT USE FLTK!!!                       ****
-
-	- Updated the flags_ member of Fl_Widget to be an
-	  integer instead of uchar, to support the new
-	  FL_OVERRIDE flag for Fl_Window.
-
-	- The parent() method of Fl_Widget now uses pointers to
-	  Fl_Group instead of Fl_Widget.
-
-	- Fl_Window now provides the FLTK 2.0 "override()" and
-	  "set_override()" methods for windows.
-
-	- Added a configure check (and warning) for GCC 3.0.x.
-
-	- Updated the configure script to check for the
-	  png_set_tRNS_to_alpha() function.
-
-	- Updated the config.h files for all platforms for the
-	  image and FLTK documentation defines.
-
-	- Updated the makeinclude files for all platforms to
-	  match the current makeinclude.in file.
-
-	- FLUID would crash if you cleared an image for a
-	  widget.
-
-	- Fl_Help_View::add_image() did not initialize the image
-	  member of the base (unscaled) image.
-
-	- Fl_Help_View didn't support A elements with both a
-	  NAME and HREF attribute - the HREF was ignored.
-
-	- Miscellaneous compile warning fixes.
-
-	- Tooltips were being reset by Fl::belowmouse(), which
-	  caused problems with the FLUID main window (flashing
-	  tooltip windows and serious problems with KDE 2.2)
-
-	- The editor demo had the save and discard button
-	  actions reversed.
-
-	- The Fl_Help_View widget now uses
-	  png_destroy_read_struct() if the older
-	  png_read_destroy() function is not available.
-
-	- The WIN32 DLL library now includes the OpenGL widgets.
-	  This is a simpler solution for the export/import
-	  dillemma under WIN32, as OpenGL and non-OpenGL symbols
-	  need to be exported at different times with the
-	  separate library scheme.  Since OpenGL is standard
-	  under Windows, this is less of a problem than under
-	  UNIX...
-
-
-CHANGES IN FLTK 1.1.0b3
-
-	- The top-level makefile did not include the makeinclude
-	  file, causing the fltk-config installation commands to
-	  fail.
-
-	- The fl_file_chooser.cxx source file conflicted with
-	  Fl_File_Chooser.cxx under Windows.  Similarly, the
-	  fl_file_chooser.H header file conflicts with the
-	  Fl_File_Chooser.H header file.
-
-	- Now save and restore the GDI pen object when
-	  responding to WIN32 paint messages.
-
-	- Documentation updates from A. Suatoni.
-
-
-CHANGES IN FLTK 1.1.0b2
-
-	- New fltk-config script.
-
-	- Fixed image/text label handling; in b1 the label
-	  needed a non-blank text string to display the image. 
-	  This bug also caused all sorts of crashes and display
-	  problems.
-
-	- Added new filetype() method to Fl_FileBrowser to allow
-	  for file or directory browsing.
-
-	- Fixed the drawing of the focus box around
-	  Fl_Return_Button.
-
-	- Fixed menu item measurement bug (wasn't initializing
-	  image pointers to 0...)
-
-	- Radio and checkbox menu items now draw with the new
-	  style (round radio buttons with dots and square check
-	  buttons with check marks.)
-
-	- Improved the appearance of Fl_Check_Button.
-
-	- Improved the Fl_HelpView table formatting code; now
-	  dynamically sizes the table columns, and supports
-	  COLSPAN.
-
-	- The FLUID keyboard shortcuts now work as expected
-	  (CTRL-C copies, SHIFT-CTRL-C writes code, etc.)
-
-	- The FLTK_DOCDIR environment variable can now be
-	  used to tell FLUID where to find the on-line
-	  documentation files.
-
-	- FLUID now supports image labels in addition to text
-	  labels + text over image alignment.
-
-	- FLUID now supports tooltips.
-
-	- The widget panel in FLUID is now tabbed, a la FLTK
-	  2.0.
-
-	- The FLUID pixmap destructor tried to free 1 too many
-	  lines of image data.
-
-	- FLUID now provides on-line help.
-
-	- Changed Fl_FileXYZ to Fl_File_XYZ.
-
-	- Changed Fl_HelpXYZ to Fl_Help_XYZ.
-
-	- Tooltip fixes for Fl_Browser_, Fl_Choice, and Fl_Input_.
-
-	- Added tooltips to FLUID, help dialog, and file chooser.
-
-	- Now load system icons in FLUID.
-
-
-CHANGES IN FLTK 1.1.0b1
-
-	- Added new image() and deimage() methods to support
-	  image + text labels more easily.
-
-	- Added new alignment bit FL_ALIGN_TEXT_OVER_IMAGE.
-
-	- Added tooltip support using Jacques Tremblay's tooltip
-	  patch.
-
-	- Added keyboard navigation to all widgets.
-
-	- Added support for mouse wheels using the new
-	  FL_MOUSEWHEEL event type.  Get the mouse wheel
-	  movement values from Fl::e_dx (horizontal) and
-	  Fl::e_dy (vertical).
-
-	- Added the Fl_Check_Browser, Fl_FileBrowser,
-	  Fl_FileChooser, Fl_FileIcon, Fl_HelpDialog,
-	  Fl_HelpView, Fl_Progress, and Fl_Wizard widgets from
-	  the bazaar.
-
-	- Added 2.0 Fl_Text_Display and Fl_Text_Editor widgets
-	  based on NEdit.
-
-	- The Fl_Choice widget now looks more line a combo box
-	  than a Motif option menu.
-
-	- Moved the OpenGL widgets into a separate library
-	  called fltkgl - this eliminates shared library
-	  dependencies on OpenGL when no OpenGL functionality is
-	  used/required.
-
-	- FLUID now supports the new Fl_CheckBrowser,
-	  Fl_FileBrowser, Fl_FileIcon, Fl_HelpView,
-	  Fl_Text_Display, Fl_Text_Editor, and Fl_Wizard
-	  widgets.
-
-	- Updated configure stuff to support shared libraries
-	  under AIX (link to -lfltk_s)
-
-	- Symbol labels can now contain regular text.
-
-	- FLUID now supports relative filenames for the source
-	  and header files you generate.
-
-	- Fl_Menu_Item::add() didn't use the flags that were
-	  passed in.
-
-	- Fixed a bug in Fl_Scrollbar - clicking in the "trough"
-	  of the scrollbar would move the scroller in the wrong
-	  direction.
-
-	- Made the Forms pixmap parameter const to match the
-	  Fl_Pixmap.H definitions.
-
-	- Changed the Fl_Pixmap constructor to use the explicit
-	  keyword which should work for all C++ compilers.
-
-	- Fl_Menu_add of a menu item with the same name as an
-	  existing submenu title would mess up by replacing that
-	  menu title, it now adds a new item.
-
-	- Fl_Menu::add() of text starting with '/' to a menu is
-	  assummed to be a filename. So "/foo/bar" creates a
-	  single menu item. You can also put filenames into
-	  submenus by doing "submenu//foo/bar", this will create
-	  a submenu called "submenu" with an item "/foo/bar".
-	  Menu items starting with "\_" will insert an item
-	  starting with '_' rather than a divider line. These
-	  changes make the menus compatable with fltk 2.0.
-
-	- Another little fix for the BoXX OpenGL overlays.
-
-	- Fl_Gl_Window no longer blanks the mouse pointer on
-	  WIN32 unless an OpenGL overlay is being used.  This
-	  should make non-overlay displays faster when a cursor
-	  is set.
-
-
-CHANGES SINCE FLTK 1.0.10
-
-	- CHANGED THE DEFAULT RUN-TIME LINKING TO "MULTITHREADED
-	  DLL". You'll need to change your project settings to
-	  use this as well or you'll get errors.
-
-	- Added new --disable-gl option to configure script.
-
-	- Added new const const pointer versions of pixmap
-	  functions to eliminate an annoying pointer warning
-	  message that was generated by the Sun and other C++
-	  compilers.
-
-	- Eliminated all "var hides class::var" warnings.
-
-	- Eliminated all "string literal converted to char *"
-	  warnings.
-
-	- OS/2 updates from Alexander Mai.
-
-	- Tidied up the HTML documentation to be more standards
-	  compliant.
-
-	- Compiling with -DBOXX_BUGS will work around some
-	  problems with the newest X drivers that BoXX delivers,
-	  the problems all affect use of Overlays for normal X
-	  drawing and OpenGL drawing. Normal compilation is
-	  unchanged.
-
-	- The file chooser buttons use user_data() rather than
-	  the label to decide what to do, allowing the label to
-	  be somewhat cleaner.
-
-	- Selection color on X changed to blue, to match what
-	  happens on Windows now.
-
-	- Added support for AIX (static library only).
-
-	- Added support for SunOS 4.x
-
-	- Now process WIN32 WM_ACTIVATEAPP message to reset the
-	  key and button states in Fl::e_state.
-
-	- Fl_has_idle only tested N-1 callbacks and missed one.
-
-	- Restored WM_SYNCPAINT handling under WIN32; this fixed
-	  a refresh bug under some versions of Windows.
-
-	- Check for OpenGL headers before checking to see if
-	  OpenGL is supported.  This should eliminate compile
-	  errors due to missing non-FLTK header files...
-
-	- Add -D_INCLUDE_POSIX_SOURCE option when compiling with
-	  the HP compilers.
-
-	- Replaced remaining _WIN32 symbols with WIN32
-
-	- Removed reference to unused GL/glu.h header file, which is missing on
-	  some Linux systems.
-
-	- Fl_Gl_Window has a new method to allow you to get and set the context:
-
-	      void Fl_Gl_Window::context(void*, int destroy = 0)
-	      void* Fl_Gl_Window::context() const;
-
-	  Return or set a pointer to the GLContext that this window is
-	  using. This is a system-dependent structure, but it is portable to
-	  copy the context from one window to another. You can also set it to
-	  NULL, which will force FLTK to recreate the context the next time
-	  make_current() is called, this is useful for getting around bugs in
-	  OpenGL implementations.
-
-	  If destroy_flag is true the context will be destroyed by fltk when
-	  the window is destroyed, or when the mode() is changed, or the next
-	  time context(x) is called.
-
-	- Some cleanup of Fl_Gl_Choice to move most of the system dependent
-	  #ifdefs into Fl_Gl_Choice.cxx.
-
-	- Fl_Gl_Window does not set drawbuffer(BACKBUFFER) for
-	  single-buffered windows.
-
-	- Fl_Input::replace(...) correctly updates the display
-	  if the replaced region does not include the mark,
-	  point, or selected region.
-
-	- Added Fl::add_check(...), Fl::remove_check, and
-	  Fl::has_check. These are similar to idle callbacks but
-	  are only called just before it waits for new events.
-	  They can be used to watch for changes in global state
-	  and respond to them.
-
-	- "accu-timer": some changes to repeat_timeout that seem
-	  to make it accurate on Unix and WIN32 at speeds up to
-	  500000 timeouts/second (and 700000 on Linux), and
-	  within about .001% as accurate as the system clock.
-
-	- Fix to Fl_Valuator::step() by Guillermo Andrade.
-
-	- Fixed the FLUID write-menu bug introduced in 1.0.10
-
-	- Fl::flush() now calls GdiFlush() under WIN32 to
-	  ensure that all graphics are drawn.
-
-	- fl_curve() now uses a much better algorithim to figure
-	  out how many pieces to cut the curve into.
-
-	- FLUID now uses GetTempPath() under WIN32 to determine
-	  where to store the clipboard.
-
-	- Right-ctrl does not delete selected text in Fl_Input,
-	  until you type a composed character.
-
-	- Added simple FLTK and FLUID manual pages.
-
-	- Fl_Gl_Window leaked memory under WIN32.
-
-	- The colbrowser demo was missing an include file when
-	  compiled under OS/2.
-
-
-CHANGES SINCE FLTK 1.0.9
-
-	- Added a strcasecmp() function to FLUID; AIX doesn't
-	  have it.
-
-	- Bug #115509: Fl_Scroll not repainting background.
-
-	- Updated the configure script and makeinclude.in file
-	  to work with the Sun PRO compilers.
-
-	- Disabled the WIN32 async socket select code by default:
-	  it doesn't seem to work anymore...
-
-	- Fl::below_mouse() was incorrectly clearing e_is_click;
-	  this prevented any double-clicks from getting
-	  through...
-
-	- No longer clear Fl::keysym on every event, this makes
-	  better back compatability and fixes Win2000
-
-	- FLUID now restores which tab in an Fl_Tabs was
-	  selected when loads .fl files.
-
-	- Hack to fix the annoying "raise another application
-	  when a modal window is closed" problem on WIN32.
-
-	- Fl_Tabs now draws the background behind the tabs.
-
-	- Fl::set_fonts() on WIN32 fixed to work before the
-	  first window is shown.
-
-	- CUA function keys, code submitted by George Yohng
-	  <[email protected]>
-
-	- Another attempt to get glut.h to work on WIN32.
-
-	- Fl_Menu_::add() ignores '&' signs when comparing menu
-	  items, so you don't have to make the shortcuts the
-	  same all the time.
-
-	- Fixed bit-flipping patterns in WIN32 bitmap code.
-
-	- Fixed size of data written by gif images to .C files
-
-	- Menu titles and buttons in the menubar can be images
-	  (allows it to be used as a toolbar)
-
-	- Reads selectBackground from the xrdb database to set
-	  the selection color. Adding this to your .Xdefaults
-	  will make fltk and Motif programs look much more
-	  Windoze-like:
-
-	      *selectForeground: white
-	      *selectBackground: #000080
-
-	- FL_WHEN_RELEASE on Fl_Input will now do the callback
-	  when the input field is hidden, for instance when it
-	  is on a tab and the user switches to another tab.
-
-	- Fl_Gl_Window with an overlay on X always resized any
-	  child windows even if you turned resizable() off
-	  because it turned it back on to resize the overlay
-	  window. This patch avoids changing resizable().
-
-	- Fix so multiple Fl::add_idle() calls works
-
-	- The input focus got messed up if you called
-	  Fl_Tabs::value(x) and there was something that took
-	  focus on an earlier tab.
-
-	- Removed some (not all) of the warnings when compiled
-	  with -Wwrite-strings, this should also get similar
-	  warnings Solaris produces.
-
-	- Made Fl_Browser not hide the Fl_Widget::show() method
-
-	- Changes & additions for OS/2 from Alexander Mai
-
-	- Patch from Mike Lindner to make the turning on/off of
-	  scrollbars on Fl_Scroll smarter.
-
-	- Added missing FL_EXPORT for Fl_Valuator::format()
-
-	- Shortcuts for "buttons" in a Fl_Menu_Bar work again.
-
-	- Fix for cut/paste support and Xdnd.
-
-	- Shortcuts for submenu titles in a menubar pop up the
-	  submenu (rather than calling the callback)
-
-	- Added documentation for GL_SWAP_TYPE
-
-	- Buttons with box(FL_NO_BOX) did not draw.  Apparently
-	  they did in older versions of fltk, I restored this.
-	  (bug 108771)
-
-	- Removed 8-bit colormap drawing code that was not doing
-	  anything in fl_draw_image due to the colormap
-	  allocation changes.  I also made fl_color(r,g,b)
-	  actually allocate the requested color rather than the
-	  nearest fltk color-cube color (this is only done for
-	  the first color that maps to a given entry in the fltk
-	  color cube), the result is that pixmaps with a small
-	  number of colors are drawn much more accurately. The
-	  resulting code seems to produce better images and is a
-	  good deal smaller!
-
-	- Fixed makeinclude.in so CFLAGS are used for c source
-	  code instead of CXXFLAGS. (bug 108694)
-
-	- Better fix for gif files suggested by pauly (bug
-	  108770)
-
-	- Performance of Fl_Gl_Window may be improved on some
-	  types of OpenGL implementations, in particular MESA
-	  or other software emulators, by setting the
-	  GL_SWAP_TYPE environment variable.  This variable
-	  declares what is in the back buffer after you do a
-	  swapbuffers:
-
-	      setenv GL_SWAP_TYPE COPY
-
-	      This indicates that the back buffer is copied to
-	      the front buffer, and still contains it's old
-	      data. This is true of many hardware
-	      implementations.  Setting this will speed up
-	      emulation of overlays, and widgets that can do
-	      partial update can take advantage of this as
-	      damage() will not be cleared to -1.
-
-	      setenv GL_SWAP_TYPE NODAMAGE
-
-	      This indicates that nothing changes the back
-	      buffer except drawing into it.  This is true of
-	      MESA and Win32 software emulation and perhaps some
-	      hardware emulation on systems with lots of memory.
-
-	  All other values for GL_SWAP_TYPE, and not setting
-	  the variable, cause fltk to assumme that the back
-	  buffer must be completely redrawn after a swap.
-
-	  This is easily tested by running the gl_overlay demo
-	  program and seeing if the display is correct when
-	  you drag another window over it or if you drag the
-	  window off the screen and back on. You have to exit
-	  and run the program again for it to see any changes
-	  to the environment variable.
-
-	- Optimized colormap usage on 8-bit displays with
-	  images. New code only allocates colors as they are
-	  needed (still converts indexed images to full RGB and
-	  dithers, tho...)
-
-	- Fixed .gif files in FLUID, they were broken by the fix
-	  for large .xpm files in version 1.0.9.
-
-	- Fix for OpenGL hardware overlays with the transparent
-	  index != 0. Tested on the brand new HP Linux
-	  Workstations, this is the only bug encountered.  Both
-	  X and OpenGL hardware overlay works perfectly on
-	  these, though configue may not enable it by
-	  default...)
-
-	- Fl_Choice and all other Fl_Menu_ subclasses draw the
-	  items using textcolor() as the default color of the
-	  text.
-
-	- Fix suggested by Stuart Levy to fix scrolling when
-	  deleting items from the browser.
-
-	- Replaced the -$(MAKEFLAGS) with $(MFLAGS) as per the
-	  gmake documenation.  Apperntly this works with other
-	  make programs and MAKEFLAGS is passed invisibly by
-	  gmake, though the documenation is not too clear...
-
-
-CHANGES SINCE FLTK 1.0.8
-
-	- More documentation fixes.
-	- GLUT_STROKE_*_ROMAN in glut.h are defined as 0,1 on
-	  WIN32 to match the glut header files there.
-	- Added Fl::has_timeout() and Fl::has_idle() functions.
-	- Added new Fl::repeat_timeout() method that
-	  measures time from when the last timeout was called. 
-	  This has slightly less overhead and allows accurate
-	  spacing of timeouts.
-	- More Cygwin changes
-	- FLUID could crash with identifiers with trailing
-	  whitespace.
-	- Fixed the XPM loading code in FLUID to handle files
-	  longer than 2048 lines.
-	- Added a bunch of missing FL_EXTERN's to glut.h to
-	  eliminate GLUT linking errors under WIN32.
-	- Fix for sliders so that clicking on one with a small
-	  (or zero) slider_size will not move the slider.
-	- fl_shortcut.cxx didn't export fl_old_shortcut() in the
-	  WIN32 DLL.
-	- Fixed xpaint link in the documentation.
-	- Included Fl_Input word-wrap fixes from Alexander Rabi
-	  Beels. This will not affect things much because
-	  word-wrap is normally disabled.
-	- Patch from Stuart Levy so the *last* widget in an
-	  Fl_Pack may be resizable.  This should be compatable
-	  because resizable didn't do anything before so there
-	  was no reason to set it.
-	- Cleaned up the timeout and Fl::wait() code.  The new
-	  code calls the clock function less than half as much,
-	  which results in a noticable performance improvement
-	  in some apps.
-	- Fl::wait(time) with a time greater than the system can
-	  handle (24.855 days on NT, the same on some Unix
-	  systems) will now act as though the time is infinity. 
-	  Before it would do unpredictable things.
-	- "USE_POLL" now compiles and works, although it is
-	  disabled by default. poll() is an alternative to the
-	  UNIX select() call which is available on some version
-	  of UNIX and may be faster depending on the platform;
-	  try it by editing config.h.
-	- The WIN32 USE_ASYNC_SELECT code now does translation
-	  and dispatching of the select events; this makes
-	  Windows a lot happier.
-	- Added a check for an open display in Fl::wait() so
-	  that you don't need an open window under X to call it.
-
-	  [changes in snapshot 2]
-
-	- fl_old_shortcut() wasn't being exported in the WIN32 DLL
-	  project.
-	- Updated Cygwin and Mingw makefiles.
-	- Updated the BC++ project file.
-	- You can no longer insert control chars into Fl_Int/Float_Input.
-	- Fl_Multiline_Input now resets the horizontal position when
-	  focus is changed; this caused problems when multiple multiline
-	  widgets were used in an application.
-	- All handle() methods are now public, and all draw() methods are
-	  now protected in FLTK widgets.
-	- More fixes to the OpenGL overlay code on win32.  This now
-	  seems to work quite reliably on several different pieces of
-	  hardware. Apparently doing SetLayerPaletteEntries with a
-	  palette larger than the overlay size caused the drivers to
-	  screw up in unpredictable ways. Also SwapBuffers swapped both
-	  the overlay and main window, which is not what fltk's
-	  interface wanted, this was easy to fix however.
-	- Patch for full scrollbars so that clicking on them does not
-	  move anything.
-	- Documentation fixes.
-	- Better horizontal scrolling of Fl_Input when cursor is near
-	  the end of the line.
-	- Fl_Input::value(x) selects all text.
-	- Fl_Output and Fl_Multiline_Output would scroll to the end
-	  of the text.
-	- filename_isdir() now drops any trailing slash from the
-	  filename (needed for Windows)
-	- Added return type for main() function in line_style demo.
-	- Running FLUID with the "-cs" option writes the I18N message
-	  file.
-	- The WIN32 version of XParseGeometry() didn't initialize some
-	  variables.  This caused a compiler warning but did not affect
-	  the actual code.
-
-	  [changes in snapshot 1]
-
-	- EMail changes - [email protected] now officially
-	  [email protected].
-	- The FLTK DLL project file didn't include fl_compose.cxx
-	- Dropped the GCC -fno-rtti option since it caused problems
-	  with existing programs.
-	- Moved the .fl rules back to the test directory.
-	- Fixed some makefile and spec file problems.
-	- Fixed hardware overlays.  The problem was the new
-	  fl_clipped() code, which tests against the current window
-	  size.  The hardware overlay code did not set the current
-	  window when drawing the overlay.  I needed hardware overlay
-	  for DD's code, I'm not sure if these fixes are good enough to
-	  enable this in our general release.  Hardware overlay still
-	  only works on SGI Irix.
-	- Some patches to turn off the MSVC++ -Oa (assumme no aliasing)
-	  optimization flag.  Suprisingly this only broke a few parts
-	  of fltk, or at least these are the only ones I found.
-	- Does not unmap child windows when the main window is
-	  iconized.  This reduces flashing when the window is
-	  deiconized.
-	- Fl::key() is set to zero by all events except key down/up. 
-	  This will allow you to reliably test if an event or callback
-	  was produced by a keystroke.  Fixes the bug posted about
-	  stopping Escape from closing the window.
-	- User defined cursors on OpenGL windows slowed down NT a
-	  *LOT*.  Some attempts to fix this by turning off the cursor
-	  while drawing the window.
-	- Filename completion in the file chooser works better on NT. 
-	  Typing TAB fixes the case of everything you typed to match
-	  the shortest name that can be completed.
-
-
-CHANGES SINCE FLTK 1.0.7
-
-	- Many documentation changes/fixes/improvements.
-	- FLUID didn't save Fl_Double_Window's as
-	  double-buffered windows.
-	- Fl_Menu_ text color is used if Fl_Menu_Item text color
-	  is not set.
-	- Added Fl::first_window(window) method to change the
-	  "top" window that is used when showing modal windows.
-	  By default it is the window the user last
-	  clicked/typed in.
-	- The Fl_Menu::global() handler now uses the current top
-	  window instead of the menu bar for modal stuff.
-	- Added fl_line_style() function to set the line style. 
-	  Note that user-defined line styles ONLY WORK UNDER X11
-	  and Windows NT/2000. Windows 95/98 do, however,
-	  support the "standard" line styles.
-	- Fl::wait() does not return immediately when no windows
-	- XForms keyboard shortcuts using hex keycode constants
-	  now work.
-	- Updated the configure script for *BSD and to turn off
-	  exceptions and RTTI in the FLTK library itself (does
-	  not affect applications which use these things)
-	- FLUID now supports I18N using the POSIX or GNU
-	  mechanisms.
-	- Fixed definition of glutBitmapWidth to match header
-	  file.
-	- Does not turn visible() on when a window is iconized()
-	  or if a modal window is shown and it's parent is
-	  iconized.  This allows the code "while (w->visible()
-	  && w->damage()) Fl::check();" to reliably wait for the
-	  window to be mapped and drawn the first time.
-	- Setting box(FL_NO_BOX) on a button makes it an
-	  invisible overlay
-	- FL_NORMAL_SIZE is now a global variable so you can
-	  change the default text size prior to creating your
-	  widgets.
-	- Menus now draw properly with a box type of
-	  FL_FLAT_BOX.
-	- Cygwin fixes to compile in POSIX mode.
-	- Fl_Value_Input callback can call value() or
-	  destructor.
-	- OpenGL overlays now work under Windows NT!
-	- Fl_Slider and Fl_Scrollbar could cause a divide by
-	  zero.
-	- Clicking in an Fl_Input field no longer selects the
-	  whole field, it just moves the text cursor.
-	- Tru64 UNIX fixes for filename_list()
-	- Fl_Browser now draws itself properly when deactivated.
-	- FLUID GUIs now use Courier font for all code input.
-	- The FLUID OK and Cancel buttons are now all shown in
-	  the same order in all windows.
-	- Fixes to compile under GCC 2.95.2
-	- Fixed the BC5 project files.
-	- FL_LEFT_MOUSE and friends are now in
-	  <FL/Enumerations.H>
-	- Fixes for fake OpenGL overlay code under WIN32.
-	- Message windows are now resizeable.
-	- On WIN32 non_modal (but not modal) windows have the
-	  close and size boxes.
-	- Fl_Button and friends didn't honor the
-	  FL_WHEN_NOT_CHANGED condition.
-	- Disabled XDBE on all platforms.
-	- XGetDefault patch from James Roth
-	- New fl_open_display(Display *) function to allow FLTK
-	  to share a display connection with another toolkit
-	  (like Xt, GTK, etc.)
-	- Shortcut labels for special keys should now display
-	  properly under WIN32.
-	- fl_set_fonts() did not reuse fonts.
-	- Fixed shortcut problem under WIN32 when the focus
-	  window changes.
-	- "dead" keys should now work under X11.
-	- Fixes to make FLTK compile with GCC 2.95.2
-	- FL_SHORTCUT fix for I18N.
-	- Fixed cut/paste problems under WIN32
-	- FLUID now produces correct code for nested class
-	  destructors.
-	- Nested windows should now redraw properly under WIN32.
-	- "table" is now static in fl_cursor.cxx
-	- Fl_Chart used the textcolor() and not the color() for
-	  horizontal bar charts.
-	- Now set the input hint for TWM and TWM-derived window
-	  managers.
-	- Now look for TrueColor visual if FLTK is compiled with
-	  USE_COLORMAP == 0.
-	- Fl_Scrollbar could generate a divide-by-0 error if the
-	  min and max values were the same.
-	- Fl_Menu_::remove() now removes whole submenus if
-	  needed.
-	- Scrollbar buttons now draw themselves pushed in as
-	  needed.
-	- Fixed the gl_overlay demo (and gl overlays in general)
-	  when they are faked with no hardware and the window is
-	  resized.
-	- Selections weren't shown in Fl_Browser widgets when an
-	  item used the @B (background) format.
-	- Windows can now be resized by the program under X11
-	  for more window managers.
-	- OS/2 makeinclude updates.
-	- Added Fl.H required by an inline function in
-	  Fl_Repeat_Button.H
-	- Fl_add_idle adds new functions to the end of the queue
-	  ring, rather than the start, so they are executed in
-	  the order added, and a callback that adds itself does
-	  not prevent others from being called.
-	- FLUID lets you type in code that starts with '#' for
-	  cpp directives.
-	- XBell() could be called before the X11 display was
-	  opened, causing a segfault.
-	- Fixed Fl_Gl_Window::ortho() - Borland C++ doesn't
-	  define GLint to "int", but instead to "long"...
-	- Fixed Fl_Browser scrollbars within an Fl_Scroll
-	  widget.
-	- Fl_Output (and non-focused Fl_Input) now scroll in
-	  response to position()
-	- Fl_Input now does not scroll horizontally if the
-	  entire string will fit in the widget.
-	- Fl_Scrollbar didn't push the right arrow buttons when
-	  you clicked outside the scroller.
-	- Now use WSAAsyncSelect() for better socket performance
-	  with Fl::add_fd()
-
-
-CHANGES SINCE FLTK 1.0.6
-
-	- Fixed Fl_Input_ bug under WIN32 - no longer stop accepting input
-	  when one of the "Windows" keys is pressed.
-	- Now call TranslateEvent for all events under WIN32.
-	- Fixes for OpenBSD and NetBSD
-	- The FL_CURSOR_HAND cursor now uses the IDC_HAND cursor instead of
-	  IDC_UPARROW under Windows 98 and 2000.
-	- Fl_Scrollbar now does a page-up/down when you click outside the
-	  scroller.
-	- Fl_Window::show(0, NULL) causes core dump
-	- Fixed a compile-time error in fl_call_main.c for Borland C++.
-	- "fluid -c filename.fl" would try to open an X display if the
-	  FLUID file contained an Fl_Browser widget.
-	- Fl_Browser now correctly measures items with @C or @B color
-	  formatting commands.
-	- Fixed a bitmap drawing bug for WIN32 (bit reversal table was wrong)
-	- fl_xyz() dialogs now set a title in the title bar.
-	- fl_alert() sounds the bell under X11.
-	- fl_xyz() dialogs now call MessageBeep() under WIN32.
-	- Fl_Browser_ didn't draw the selection box with the inactive color
-	  when the browser wasn't activated.
-	- Fl_Browser now responds to FL_KEYBOARD as well as FL_SHORTCUT.  If
-	  you subclass it to accept focus then keyboard navigation will work.
-	- Fl_Tile and Fl_Tabs do their callback when the user changes their
-	  display.
-	- Made some of the private methods of Fl_Browser protected.
-	- Now set win_gravity correctly, this helps some X
-	  window managers that use it position the window where
-	  FLTK wants it to be.
-	- 0-width browsers crashed.
-	- Minor change: if the X window manager does not do
-	  anything else with windows that don't have their
-	  position specified, the windows appear centered in the
-	  screen, rather than in the top-left corner.  This
-	  happened with modal windows under Irix 4Dwm.  This
-	  also causes windows to be centered when no window
-	  manager is running, which might be useful for
-	  installation gui programs?
-	- Clicking in an Fl_Input field the first time selects the entire
-	  field.
-	- Clicking the middle mouse button in an Fl_Input field now inserts
-	  the text at the indicated position instead of the cursor position.
-	- Drag-selecting text in an Fl_Input field now copies the text
-	  automatically.
-	- Fl::flush() no longer calls the draw() method for invisible windows.
-	- Calling deactivate() on an invisible widget could cause an
-	  infinite loop in some obscure cases.
-	- Added #pragma's for SGI C++ compilers - the 6.{23} X headers had
-	  errors in them.
-	- Fl_Gl_Window::ortho() changed so that text and images
-	  are not erased if the origin is off the left/bottom of the
-	  window.
-	- Small change to Fl_Input so that a click that gives it
-	  the focus also selects all the text.
-	- Fixed a slider drawing problem.
-	- You can now add/delete children of Fl_Tabs widgets whether or
-	  not they are visible.
-	- Now embed woff options for SGI C++ compilers (gets rid of X11
-	  header warnings)
-	- draw_pixmap used a cast that the Digital UNIX C++ compiler didn't
-	  like.
-	- The GLUT function key constants were off by one.
-	- The XPM reading code didn't handle RGB colors other than #rrggbb.
-
-
-CHANGES SINCE FLTK 1.0.5
-
-    - Fl_win32.cxx defined WM_MOUSE_LEAVE instead of WM_MOUSELEAVE.
-    - Fl_get_key_win32.cxx needed to include <ctype.h>
-    - gl_draw_pixmap.cxx needed a pointer cast for ANSI C++.
-    - Fl_Repeat_Button didn't always delete its timeout.
-    - Now keep track of the current OpenGL context; this provides
-      significant performance improvements for OpenGL applications
-      with a single context.
-
-
-CHANGES SINCE FLTK 1.0.4
-
-    - Fl_Roller didn't handle a width and height of 0.
-    - filename_list() fix for FreeBSD.
-    - Fixed RPM install docos - needed "--install" option...
-    - Fl_Browser_ wouldn't draw the vertical scrollbar right away if it
-      added a horizontal one which covered the last line.
-    - Fl_Tabs problems - single-character labels don't show up (problem in
-      measure_tabs() or measure_label() methods?), and doesn't clear top
-      tab area before drawing tabs.
-    - Fl_Browser needs a destructor.
-    - fl_draw_label() quoted characters between 0x80 and 0xa0, which
-      caused problems for some programs using the WinANSI character set.
-    - FLUID didn't handle declared class destructors.
-    - Fixed another WIN32 cut/paste bug.
-    - Fl_Tabs didn't work properly when there was only 1 tab.
-    - Fl_Menu::add() didn't delete the old array.
-    - Fl_Repeat_Button didn't delete its timeout when disabled.
-    - fl_draw() would crash if no font was set (now defaults to
-      a 14-pixel Helvetica font)
-    - Can't forward declare classes; need to check for "class ", "struct ",
-      "union ", etc.  See Bill's message
-    - Added #pragma around xlib.h for IRIX
-    - FL_KEYBOARD events have the correct x/y when sent to child X
-      windows. Note that if you worked around this bug by adjusting the
-      x/y yourself you will have to change your code. In addition all
-      events have the correct x/y when sent to the grab() widget.  And
-      the code to do all this was simplified a lot.
-    - The XPM code didn't handle named colors with spaces in the names.
-    - Pressing ESCape closed the window with pointer focus, even if there
-      was a modal window open (now closes the modal window).
-    - FLUID no longer produces trigraphs accidentally in the image data.
-    - FLUID uses string constant concatenation to produce shorter image
-      data.
-    - The Fl_Group deletion code crashed if there was exactly one child
-      widget.
-    - Simulated overlays in single-buffered Fl_Gl_Windows now draw
-      correctly (though very slowly as it requires the entire window to
-      be redrawn to erase the overlay).  This fix ported our Digital
-      Domain programs better to systems with no overlay hardware.
-    - Added support for extern "C" declarations in FLUID.
-    - Added Fl_Pack support to FLUID.
-    - Fixed the order of #include's in FLUID generated header files.
-    - Fixed detection of vsnprintf and snprintf under HP-UX 10.20 once
-      and for all.
-    - The checkers demo did not compile with GCC 2.95
-    - FLUID didn't output virtual destructors properly.
-    - Added inline "make_visible()" method to Fl_Browser.
-    - Fl::wait() now returns immediately if any timeouts are
-      called.
-    - 16-bit XPM files are now properly handled.
-    - Fl_Window::resize() was missing FL_EXPORT (caused problems
-      with Windows DLLs)
-    - FLUID was writing extern declarations twice.
-    - New FLUID arrow key functionality: arrows move by one pixel, shift+arrow
-      resizes, ctrl+arrow steps by grid
-
-
-CHANGES SINCE FLTK 1.0.3
-
-    - Documentation updates
-    - Fl_Browser::bottomline(size) didn't scroll to the bottom
-      if the second-to-last line was visible.
-    - fl_wait() didn't poll FDs properly for WIN32.
-    - Fixed DLL definitions for BC++.
-    - FLUID now handles nested classes properly.
-    - The "connect" demo now does a wait() for the PPP process
-      so that you aren't left with a lot of zombie processes.
-    - Fixed the FLTK colormap to use FF instead of F4 for full
-      intensity values.
-    - Minor change to scrollbar drawing code to match other
-      toolkits.
-    - New selections would cancel themselves out in WIN32.
-    - The header file links were broken in the IRIX
-      distributions.
-    - fl_elapsed() now always uses GetClockTick() for WIN32.
-    - fl_display is now initialized to GetModuleHandle(NULL) -
-      this fixes problems people had with Cygwin and MingW32.
-    - WinMain() is no longer compiled in with Cygwin and
-      MingW32; it wasn't being used for those compilers anyways.
-    - Added Solaris compiler options to configure script.
-    - Fl_Value_Input wouldn't update properly if you set the
-      value from a callback.
-    - Fl_Tile wouldn't resize if the resizeable widget was the
-      last child.
-    - Was missing #include <ctype.h> and #include <stdlib.h> in
-      several files, which caused problems on some platforms.
-    - Fixed another case where Fl_Browser_ could get in an
-      infinite resizing loop.
-    - Fl_win32.cxx now includes <FL/filename.H> to export missing
-      DLL symbols.
-    - FLUID didn't handle member functions that include the
-      scope operator.
-    - Fl_Chart was dividing by 0 if there were no data samples
-      or if they were all the same (min == max).
-
-
-CHANGES SINCE FLTK 1.0.2
-
-    - XDBE is now enabled for IRIX 6.[234] as well as 6.5.
-    - FLUID didn't write the when() condition properly.
-    - Tab/space/backtab/backspace can be used to navigate
-      through menus.
-    - Changed $(DSONAME) in the src/Makefile to "libfltk.so.1
-      libfltk.sl.1".
-    - Fl_Browser could read past the end of the string when
-      computing the item height.
-    - Fl_Browser could get in an infinite loop when checking to
-      see if scrollbars needed to be displayed.
-    - FLUID now honors the return type of the outermost widget. 
-      This was a problem when substituting Fl_Group in an
-      Fl_Window widget.
-    - Fl_Menu_::copy() wasn't allocating a power of 2 for the
-      array size.
-    - FLWM would crash if fl_xmousewin was deleted.
-    - The fast_slow demo now uses output widgets.
-    - Timers under WIN32 were unreliable.
-
-
-CHANGES SINCE FLTK 1.0.1
-
-    - Documentation updates
-    - The Visual C++ project files didn't include fl_add_idle.cxx.
-    - LIBRARY/DSO name inconsistencies in src/Makefile.
-    - src/Makefile didn't clean the DSO.
-    - The valuator demo now has only a single callback.
-    - The code looked for HAVE_SYS_SELECT_H, but the
-      config file uses HAVE_SYS_SELECT.
-    - Fl_Image redraw not quite right under X11 or WIN32
-    - Problems with timeouts & cube demo under WIN32
-    - FLUID problems with inline functions.
-    - Documentation fixes...
-    - Fl_Browser::item_height() didn't handle blank lines or
-      non-default fonts properly.
-    - FL/math.h didn't have #ifndef...#define...#endif guards
-      against multiple inclusion...
-    - Fl_Menu_::copy() fix - didn't allocate power of 2...
-    - Fl::damage() now remains true until all windows are actually
-      redrawn.
-    - Fl_Widget destructor, hide(), and deactivate() methods no longer
-      send FL_LEAVE, FL_RELEASE, or FL_UNFOCUS events to the widget
-      (which could cause applications to crash).
-    - FLUID now outputs symbolic names for align() and when().
-    - Fixed select() to use maxfd + 1 instead of maxfd.
-    - Added "Fl::remove_fd(fd, when)" function so you can remove the
-      read and write callbacks separately.
-    - The Fl::add_fd() and Fl::add_timeout() arrays are now dynamically
-      allocated.
-    - FLUID didn't always turn the FL_SUBMENU flag on for submenu titles.
-    - The "extra code" in FLUID now is placed before the "o->end()" call
-      for Fl_Group and its derived classes.
-    - You can now set a FL_Window widget's class in FLUID to Fl_Group to
-      generate a function or class that builds part of a GUI (i.e. no window).
-    - FLUID now displays "Save file before exiting?" with the standard yes,
-      no, and cancel buttons rather than "Discard changes?".
-    - Fl_Menu_::add() now works with any type of menu, even one set with
-      the menu() method.
-    - The keypad keys were not always decoded properly under X11.
-    - Some pointers were not being turned off when widgets were deleted,
-      which caused some applications (like FLWM) to crash.
-
-
-CHANGES SINCE FLTK 1.0
-
-    - Documentation fixes.
-    - Fl::check() didn't return the correct value, breaking a number
-      of applications.
-    - Fixed FLUID bug that caused styles patch to crash when you delete
-      a menu item.
-    - Updated valuators demo to put the values in the gui box.
-    - Fl_Browser_::item_height() didn't always compute the correct
-      value.
-    - Fixed the alignment of Fl_Choice text.
-    - Fixes for OS/2.
-    - Fl_Menu_Item::clear() didn't clear value.
-    - Added some changes to make FLTK work with Borland C++.
-    - ANSI C++ fixes.
-    - Plugged a memory leak in the fractal demo.
-    - Fl::add_timeout() didn't work under WIN32 with small values.
-    - The configure script and makefiles now define DSONAME and
-      use the static library for all example programs.    
+  - CMake is the primary supported build system in FLTK 1.4.0 and later.
+    CMake can be used to generate Makefiles, IDE project files, and
+    several other build systems by using different "generators" provided
+    by CMake (for instance Ninja, CodeBlocks, Eclipse, KDevelop3, Xcode, etc.).
+    See README.CMake.txt for more information.
+
+  - autoconf/configure is still supported by the FLTK team for backwards
+    compatibility with older systems that lack CMake support.
+
+
+  New Features and Extensions
+
+  - (add new items here)
+  - MacOS platform: Added support for rescaling the GUI of any app at run-time
+    using the command/+/-/0/ keystrokes.
+  - MSWindows platform: Added optional support for rescaling the GUI of any app
+    at run-time using the ctrl/+/-/0/ keystrokes. This requires to build the
+    FLTK library with -DFLTK_HIDPI_SUPPORT (for now). This option also makes
+    app detect the desktop scaling factor and automatically scale their GUI
+    accordingly. This effectively renders WIN32 FLTK apps "per-monitor DPI-aware"
+    whereas they were "DPI-unaware" with FLTK 1.3.4.
+  - FLTK apps on the MacOS platform contain automatically a Window menu, which,
+    under MacOS ≥ 10.12, allows to group/ungroup windows in tabbed form. The new
+    Fl_Sys_Menu_Bar::window_menu_style() function allows to specify various
+    styles for the Window menu, even not to create it.
+  - New function: int fl_open_ext(const char* fname, int binary, int oflags, ...)
+    to control the opening of files in binary/text mode in a cross-platform way.
+  - New Fl_SVG_Image class: gives support of scalable vector graphics images
+    to FLTK using the nanosvg software.
+  - Fl_Text_Selection got a new method length() and returns 0 in length()
+    and in all offsets (start(), end(), position()) if no text is selected
+    (selected() == false). The behavior in FLTK 1.3 and earlier versions
+    (returning undefined values if !selected()) was confusing.
+  - Added support for MacOS 10.13 "High Sierra".
+  - New method Fl_Group::bounds() replaces Fl_Group::sizes() which is now
+    deprecated. Fl_Group::bounds() uses the new class Fl_Rect that contains
+    widget coordinates and sizes x(), y(), w(), and h() (STR #3385).
+    Documentation for bounds() and its internal structure was added.
+  - X11 platform: Added support for HiDPI displays and for rescaling any window
+    at run-time under user control. Under the gnome desktop, FLTK applications
+    detect the current gnome scaling factor and use it to scale all FLTK windows.
+    Under other desktops, the FLTK_SCALING_FACTOR environment variable can be
+    used to set the starting scaling factor of all FLTK applications.
+    In addition, it is possible to rescale all FLTK windows mapped to a screen
+    by typing ctrl-'+' (enlarge), ctrl-'-' (shrink) or ctrl-'0' (back to starting
+    factor value). Windows moved between screens adjust to the scaling factor of
+    their screen. This supports desktops mixing screens with distinct resolutions.
+    [HiDPI displays have been supported since FLTK 1.3.3 for the WIN32 and MacOS platforms].
+  - New method shadow(int) allows to disable the shadows of the hands
+    of Fl_Clock, Fl_Clock_Output, and derived widgets.
+  - New method Fl_Tabs::tab_align() allows to set alignment of tab labels,
+    particularly to support icons on tab labels (STR #3076).
+  - Added '--enable-print' option to configure effective under X11 platforms
+    and with 'yes' default value. Using '--enable-print=no' removes print
+    and PostScript support from the FLTK library, thus reducing its size.
+  - Added Fl_Surface_Device::push_current(new_surface) and
+    Fl_Surface_Device::pop_current() to set/unset the current surface
+    receiving graphics commands.
+  - X11 platform: Added support for drawing text with the pango library
+    which allows to draw most scripts supported by Unicode, including CJK
+    and right-to-left scripts. The corresponding CMake option is
+    OPTION_USE_PANGO. The corresponding configure option is --enable-pango.
+    This option is OFF by default.
+
+  New Configuration Options (ABI Version)
+
+  - The library can be built without support for SVG images using the
+    --disable-nanosvg configure option or turning off OPTION_USE_NANOSVG in CMake.
+  - FLTK's ABI version can be configured with 'configure' and CMake.
+    See documentation in README.abi-version.txt.
+
+
+  1.4.0 ABI FEATURES
+
+  - None. FLTK 1.4.0 has a new ABI, breaking 1.3.x ABI.
+
+
+  Other Improvements
+
+  - (add new items here)
+  - The Fl_Boxtype and Fl_Labeltype definitions contained enum values
+    (names) with a leading underscore (e.g. _FL_MULTI_LABEL) that had to
+    be used in this form. Now all boxtypes and labeltypes can and should
+    be used without the leading underscore. A note was added to the enum
+    documentations to make clear that the leading underscore must not be
+    used in user code, although the enum documentation still contains
+    leading underscores for technical reasons (internal use).
+  - The blocks demo program got a new keyboard shortcut (ALT+SHIFT+H) to
+    reset the user's high score. It is now slower than before in higher
+    levels, hence you can expect higher scores (due to a bug fix in the
+    timer code). You can use the '+' key to increase the level at all times.
+  - Some methods of Fl_Tabs are now virtual and/or protected for easier
+    subclassing without code duplication (STR #3211 and others).
+    To be continued...
+  - Separated Fl_Input_Choice.H and Fl_Input_Choice.cxx (STR #2750, #2752).
+  - Separated Fl_Spinner.H and Fl_Spinner.cxx (STR #2776).
+  - New method Fl_Spinner::wrap(int) allows to set wrap mode at bounds if
+    value is changed by pressing or holding one of the buttons (STR #3365).
+  - Fl_Spinner now handles Up and Down keys when the input field has
+    keyboard focus (STR #2989).
+  - Renamed test/help.cxx demo program to test/help_dialog.cxx to avoid
+    name conflict with CMake's auto-generated target 'help'.
+  - Many documentation fixes, clarifications, and enhancements.
+
+
+  Bug Fixes
+
+  - (add new items here)
+  - Fix Fl_PNG_Image error handling. An error was potentially caused
+    by error handling of the image library with setjmp/longjmp.
+  - Fix Fl_Browser background and text color parsing (STR #3376).
+  - Fix Windows CreateDC/DeleteDC mismatch (STR #3373).
+  - Fix Fl_Tabs label drawing for Fl_Window children (STR #3075).
+  - Fix line number alignment in Fl_Text_Display/Editor (STR #3363).
+  - Fix ignored buffer pre-allocation (requestedSize) in Fl_Text_Buffer.
+    See fltk.general "Fl_Text_Buffer constructor bug" on Dec 5, 2016.
+  - Fix build with configure --enable-cairo --enable-cairoext,
+    see this report in fltk.general:
+    https://groups.google.com/forum/#!topic/fltkgeneral/x80qQ6wt0s4
+
+
+  Removed Features
+
+  - Bundled IDE project files (Xcode and Visual Studio) have been
+    removed. Please use CMake to generate your IDE project files.
+    See README.CMake.txt for more information.
+
+
+Changes in FLTK 1.3
+
+  See CHANGES_1.3
+
+
+Changes in FLTK 1.1
+
+  See CHANGES_1.1
+
+
+Changes in FLTK 1.0
+
+  See CHANGES_1.0

+ 68 - 45
fltk/CMakeLists.txt

@@ -1,53 +1,76 @@
-#
-# "$Id: CMakeLists.txt 10098 2014-02-09 18:41:29Z AlbrechtS $"
-#
-# Main CMakeLists.txt to build the FLTK project using CMake (www.cmake.org)
+#
+# "$Id: CMakeLists.txt 12630 2018-01-10 20:49:03Z AlbrechtS $"
+#
+# Main CMakeLists.txt to build the FLTK project using CMake (www.cmake.org)
 # Written by Michael Surette
-#
-# Copyright 1998-2010 by Bill Spitzak and others.
-#
-# This library is free software. Distribution and use rights are outlined in
-# the file "COPYING" which should have been included with this file.  If this
-# file is missing or damaged, see the license at:
-#
-#     http://www.fltk.org/COPYING.php
-#
-# Please report all bugs and problems on the following page:
-#
-#     http://www.fltk.org/str.php
-#
-
-project(FLTK)
-cmake_minimum_required(VERSION 2.8)
-
-#######################################################################
+#
+# Copyright 1998-2018 by Bill Spitzak and others.
+#
+# This library is free software. Distribution and use rights are outlined in
+# the file "COPYING" which should have been included with this file.  If this
+# file is missing or damaged, see the license at:
+#
+#     http://www.fltk.org/COPYING.php
+#
+# Please report all bugs and problems on the following page:
+#
+#     http://www.fltk.org/str.php
+#
+
+# Prevent annoying warning under Cygwin; this must be before project().
+# Remove when CMake >= 2.8.4 is required
+set(CMAKE_LEGACY_CYGWIN_WIN32 0)
+
+project(FLTK)
+cmake_minimum_required(VERSION 2.6.3)
+
+#######################################################################
+# define some macros
+#######################################################################
+include(CMake/macros.cmake)
+
+#######################################################################
 # basic setup
-#######################################################################
+#######################################################################
 include(CMake/setup.cmake)
-
-#######################################################################
-# check for headers, libraries and functions
-#######################################################################
+
+#######################################################################
+# check for headers, libraries and functions
+#######################################################################
 include(CMake/resources.cmake)
-
-#######################################################################
-# options
-#######################################################################
+
+#######################################################################
+# options
+#######################################################################
 include(CMake/options.cmake)
-
-#######################################################################
+
+#######################################################################
+# variables shared by export and install
+# export.cmake creates configuration files for direct use in a built but uninstalled FLTK
+# install.cmake creates these files for an installed FLTK
+# these two would only differ in paths, so common variables are set here
+#######################################################################
+include(CMake/variables.cmake)
+
+#######################################################################
 # final config and export
-#######################################################################
+#######################################################################
 include(CMake/export.cmake)
-
-#######################################################################
-# build examples - these have to be after fluid is built/imported
-#######################################################################
-if(OPTION_BUILD_EXAMPLES)
-   add_subdirectory(test)
-endif(OPTION_BUILD_EXAMPLES)
-
-#######################################################################
-# installation
-#######################################################################
+
+configure_file(
+ ${CMAKE_CURRENT_SOURCE_DIR}/abi-version.cmake.in
+ ${CMAKE_CURRENT_BINARY_DIR}/FL/abi-version.h
+ @ONLY
+ )
+
+#######################################################################
+# build examples - these have to be built after fluid is built/imported
+#######################################################################
+if(OPTION_BUILD_EXAMPLES)
+   add_subdirectory(test)
+endif(OPTION_BUILD_EXAMPLES)
+
+#######################################################################
+# installation
+#######################################################################
 include(CMake/install.cmake)

+ 530 - 530
fltk/COPYING

@@ -1,530 +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!
+                             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!

+ 57 - 56
fltk/CREDITS

@@ -1,70 +1,71 @@
-CREDITS - Fast Light Tool Kit (FLTK) Version 1.3.2
---------------------------------------------------
-
+CREDITS - Fast Light Tool Kit (FLTK) Version 1.4.0
+--------------------------------------------------
+
     This file lists the people responsible for the toolkit you are
     now using.  If you've been 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 ([email protected])
+    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:
+
 	Greg Ercolano
 	Manolo Gouy
+	Lauri Kasanen
 	Ian MacArthur
-	Matthias Melcher ([email protected])
 	Pierre Ossman
 	Albrecht Schlosser
 
     These people have previously been active developers of FLTK:
 
-	Craig P. Earls
-	Curtis Edwards ([email protected])
-	Gustavo Hime ([email protected])
-	Talbot Hughes
-	Robert Kesterson ([email protected])
-	James Dean Palmer ([email protected])
-	Vincent Penne ([email protected])
-	Bill Spitzak ([email protected])
-	Michael Sweet ([email protected])
-	Carl Thompson ([email protected])
-	Nafees Bin Zafar ([email protected])
-
-
-OTHER CONTRIBUTORS
-
-    The following people have contributed fixes or enhancements
-    for FLTK:
-
+	Fabien Costantini ([email protected])
+	Craig P. Earls
+	Curtis Edwards ([email protected])
+	Gustavo Hime ([email protected])
+	Talbot Hughes
+	Robert Kesterson ([email protected])
+	Matthias Melcher ([email protected])
+	James Dean Palmer ([email protected])
+	Vincent Penne ([email protected])
+	Bill Spitzak ([email protected])
+	Michael Sweet ([email protected])
+	Carl Thompson ([email protected])
+	Nafees Bin Zafar ([email protected])
+
+
+OTHER CONTRIBUTORS
+
+    The following people have contributed fixes or enhancements
+    for FLTK:
+
         Laszlo Z. Antal (LZA)
-	Teun Burgers
-	Paul Chambers
-	Stephen Davies
-	Yuri D'Elia
-	Domingo Alvarez Duarte
-	Yuri Fedorchenko
-	George Garvey
-	Duncan Gibson
-	Mikael Hultgren
-	Stuart Levy
+	Teun Burgers
+	Paul Chambers
+	Stephen Davies
+	Yuri D'Elia
+	Domingo Alvarez Duarte
+	Yuri Fedorchenko
+	George Garvey
+	Duncan Gibson
+	Mikael Hultgren
+	Stuart Levy
 	Jean-Marc Lienher (OksiD)
-	Howard Lightstone
-	Mike Lindner
-	Alexander Mai
-	Alexander Rabi
-	James Roth
+	Howard Lightstone
+	Mike Lindner
+	Alexander Mai
+	Alexander Rabi
+	James Roth
 	Ivan Nieto (Mr.Satan)
 	Jamie Snape
-	Andrea Suatoni
-	Michael Surette
-	Paul Sydney
-	Aaron Ucko
-	Emanuele Vicentini
-	Josef Vitu
-	Jim Wilson
-	Ken Yarnall
+	Andrea Suatoni
+	Michael Surette
+	Paul Sydney
+	Aaron Ucko
+	Emanuele Vicentini
+	Josef Vitu
+	Jim Wilson
+	Ken Yarnall

File diff suppressed because it is too large
+ 684 - 576
fltk/FL/Enumerations.H


+ 307 - 226
fltk/FL/Fl.H

@@ -1,9 +1,9 @@
 //
-// "$Id: Fl.H 10186 2014-06-07 12:01:59Z manolo $"
+// "$Id: Fl.H 12344 2017-07-20 15:06:11Z AlbrechtS $"
 //
 // Main header file for the Fast Light Tool Kit (FLTK).
 //
-// Copyright 1998-2010 by Bill Spitzak and others.
+// Copyright 1998-2016 by Bill Spitzak and others.
 //
 // This library is free software. Distribution and use rights are outlined in
 // the file "COPYING" which should have been included with this file.  If this
@@ -23,6 +23,9 @@
 #ifndef Fl_H
 #  define Fl_H
 
+#include <FL/Fl_Export.H>
+
+#include <FL/platform_types.h> // for FL_SOCKET
 #ifdef FLTK_HAVE_CAIRO
 # include <FL/Fl_Cairo.H>
 #endif
@@ -37,22 +40,25 @@
 #    undef check
 #  endif
 
+#  ifdef BSD
+#    undef BSD
+#  endif
+
 
 class Fl_Widget;
 class Fl_Window;
 class Fl_Image;
 class Fl_Label;
+class Fl_Screen_Driver;
+class Fl_System_Driver;
 
-// Keep avoiding having the socket deps at that level but mke sure it will work in both 32 & 64 bit builds
-#if defined(WIN32) && !defined(__CYGWIN__)
-# if defined(_WIN64)
-#  define FL_SOCKET unsigned __int64
-# else
-#  define FL_SOCKET int
-# endif
-#else
-# define FL_SOCKET int
-#endif
+// Pointers you can use to change FLTK to another language.
+// Note: Similar pointers are defined in FL/fl_ask.H and src/fl_ask.cxx
+
+extern FL_EXPORT const char* fl_local_alt;   ///< string pointer used in shortcuts, you can change it to another language
+extern FL_EXPORT const char* fl_local_ctrl;  ///< string pointer used in shortcuts, you can change it to another language
+extern FL_EXPORT const char* fl_local_meta;  ///< string pointer used in shortcuts, you can change it to another language
+extern FL_EXPORT const char* fl_local_shift; ///< string pointer used in shortcuts, you can change it to another language
 
 /** \defgroup  callback_functions Callback function typedefs
  \brief Typedefs defined in <FL/Fl.H> for callback or handler functions passed as function parameters.
@@ -96,6 +102,9 @@ typedef void (*Fl_FD_Handler)(FL_SOCKET fd, void *data);
 /** Signature of add_handler functions passed as parameters */
 typedef int (*Fl_Event_Handler)(int event);
 
+/** Signature of add_system_handler functions passed as parameters */
+typedef int (*Fl_System_Handler)(void *event, void *data);
+
 /** Signature of set_abort functions passed as parameters */
 typedef void (*Fl_Abort_Handler)(const char *format,...);
 
@@ -217,8 +226,46 @@ Fl_Vector_Based_On_Malloc(Char, char, 32);
 */
 class FL_EXPORT Fl {
   Fl() {}; // no constructor!
-  
+
+private:
+
+  static int use_high_res_GL_;
+
+public:
+
+  static Fl_Screen_Driver *screen_driver();
+  static Fl_System_Driver *system_driver();
+
+public: // run time information about compile time configuration
+  /** \defgroup cfg_gfx runtime graphics driver configuration */
+  /** @{ */
+  static bool cfg_gfx_xlib;   ///< X11 Xlib rendering available, usually on Linux systems
+  static bool cfg_gfx_quartz; ///< Quartz rendering available, usually on OS X systems
+  static bool cfg_gfx_gdi;    ///< GDI rendering available, usually on MSWindows systems
+  static bool cfg_gfx_opengl; ///< OpenGL rendering available, available on many platforms
+  static bool cfg_gfx_cairo;  ///< Cairo rendering available, available on many platforms
+  static bool cfg_gfx_directx;///< DirectX rendering available, usually on MSWindows systems
+  /** @} */
+  /** \defgroup cfg_prn runtime printer driver configuration */
+  /** @{ */
+  static bool cfg_prn_ps;     ///< PostScript rendering available, usually on Linux systems
+  static bool cfg_prn_quartz; ///< Quartz rendering available, usually on OS X systems
+  static bool cfg_prn_gdi;    ///< GDI rendering available, usually on MSWindows systems
+  /** @} */
+  /** \defgroup cfg_win runtime window and event manager configuration */
+  /** @{ */
+  static bool cfg_win_x11;    ///< X11 window management available, usually on Linux systems
+  static bool cfg_win_cocoa;  ///< Cocoa window management available, usually on OS X systems
+  static bool cfg_win_win32;  ///< WIN32 window management available, on low level MSWindows
+  /** @} */
+  /** \defgroup cfg_sys runtime system configuration */
+  /** @{ */
+  static bool cfg_sys_posix;  ///< Posix system available, usually on Linux and OS X systems, but also Cygwin
+  static bool cfg_sys_win32;  ///< WIN32 system available, on MSWindows
+  /** @} */
+
 public: // should be private!
+
 #ifndef FL_DOXYGEN
   static int e_number;
   static int e_x;
@@ -250,12 +297,11 @@ public: // should be private!
   static void* user_data;
   static Fl_Do_Call_Timeout do_call_timeout_;
   static Fl_Do_at_widget_destroy_Handler do_at_widget_destroy_;
-#ifdef __APPLE__
-  static int marked_text_length(void); // returns length of marked text
-  static void reset_marked_text(); // resets marked text
-  static void insertion_point_location(int x, int y, int height); // sets window coordinates & height of insertion point
-#endif
-#endif
+  static void reset_marked_text(); // resets marked text
+  static void insertion_point_location(int x, int y, int height); // sets window coordinates & height of insertion point
+#endif // FL_DOXYGEN
+
+
   /**
     If true then flush() will do something.
   */
@@ -314,8 +360,8 @@ public:
 private:
   static unsigned char options_[OPTION_LAST];
   static unsigned char options_read_;
-
-public:
+  
+public:  
   /*
    Return a global setting for all FLTK applications, possibly overridden
    by a setting specifically for this application.
@@ -358,6 +404,36 @@ public:
 
   // API version number
   static double version();
+  static int api_version();
+
+  // ABI version number
+  static int abi_version();
+
+  /**
+    Returns whether the runtime library ABI version is correct.
+
+    This enables you to check the ABI version of the linked FLTK
+    library at runtime.
+
+    Returns 1 (true) if the compiled ABI version (in the header files)
+    and the linked library ABI version (used at runtime) are the same,
+    0 (false) otherwise.
+
+    Argument \p val can be used to query a particular library ABI version.
+    Use for instance 10303 to query if the runtime library is compatible
+    with FLTK ABI version 1.3.3. This is rarely useful.
+
+    The default \p val argument is FL_ABI_VERSION, which checks the version
+    defined at configure time (i.e. in the header files at program
+    compilation time) against the linked library version used at runtime.
+    This is particularly useful if you linked with a shared object library,
+    but it also concerns static linking.
+
+    \see Fl::abi_version()
+  */
+  static inline int abi_check(const int val = FL_ABI_VERSION) {
+    return val == abi_version();
+  }
 
   // argument parsers:
   static int arg(int argc, char **argv, int& i);
@@ -424,9 +500,9 @@ public:
     return (scheme_ && name && !strcmp(name,scheme_));
   }
   /**
-    Called by scheme according to scheme name.
-    Loads or reloads the current scheme selection.
-    See void scheme(const char *name)
+    Called by scheme according to scheme name. 
+    Loads or reloads the current scheme selection. 
+    See void scheme(const char *name) 
   */
   static int reload_scheme(); // platform dependent
   static int scrollbar_size();
@@ -443,26 +519,30 @@ public:
   Adds a one-shot timeout callback.  The function will be called by
   Fl::wait() at <i>t</i> seconds after this function is called.
   The optional void* argument is passed to the callback.
-
+  
   You can have multiple timeout callbacks. To remove a timeout
   callback use Fl::remove_timeout().
-
+  
   If you need more accurate, repeated timeouts, use Fl::repeat_timeout() to
   reschedule the subsequent timeouts.
-
+  
   The following code will print "TICK" each second on
   stdout with a fair degree of accuracy:
-
+  
   \code
-     void callback(void*) {
-       puts("TICK");
-       Fl::repeat_timeout(1.0, callback);
-     }
-
-     int main() {
-       Fl::add_timeout(1.0, callback);
-       return Fl::run();
-     }
+#include <stdio.h>
+#include <FL/Fl.H>
+#include <FL/Fl_Window.H>
+void callback(void*) {
+  printf("TICK\n");
+  Fl::repeat_timeout(1.0, callback);    // retrigger timeout
+}
+int main() {
+  Fl_Window win(100,100);
+  win.show();
+  Fl::add_timeout(1.0, callback);       // set up first timeout
+  return Fl::run();
+}
   \endcode
   */
   static void add_timeout(double t, Fl_Timeout_Handler,void* = 0); // platform dependent
@@ -470,16 +550,16 @@ public:
   Repeats a timeout callback from the expiration of the
   previous timeout, allowing for more accurate timing. You may only call
   this method inside a timeout callback.
-
+  
   The following code will print "TICK" each second on
   stdout with a fair degree of accuracy:
-
+  
   \code
      void callback(void*) {
        puts("TICK");
        Fl::repeat_timeout(1.0, callback);
      }
-
+  
      int main() {
        Fl::add_timeout(1.0, callback);
        return Fl::run();
@@ -492,21 +572,23 @@ public:
   static void add_check(Fl_Timeout_Handler, void* = 0);
   static int  has_check(Fl_Timeout_Handler, void* = 0);
   static void remove_check(Fl_Timeout_Handler, void* = 0);
+  // private
+  static void run_checks();
   /**
     Adds file descriptor fd to listen to.
-
+    
     When the fd becomes ready for reading Fl::wait() will call the
     callback and then return. The callback is passed the fd and the
     arbitrary void* argument.
-
+    
     The second version takes a when bitfield, with the bits
     FL_READ, FL_WRITE, and FL_EXCEPT defined,
     to indicate when the callback should be done.
-
-    There can only be one callback of each type for a file descriptor.
+    
+    There can only be one callback of each type for a file descriptor. 
     Fl::remove_fd() gets rid of <I>all</I> the callbacks for a given
     file descriptor.
-
+    
     Under UNIX <I>any</I> file descriptor can be monitored (files,
     devices, pipes, sockets, etc.). Due to limitations in Microsoft Windows,
     WIN32 applications can only monitor sockets.
@@ -530,7 +612,7 @@ public:
     @{ */
   /**
   FLTK calls Fl::warning() to output a warning message.
-
+  
   The default version on Windows returns \e without printing a warning
   message, because Windows programs normally don't have stderr (a console
   window) enabled.
@@ -549,7 +631,7 @@ public:
   static void (*warning)(const char*, ...);
   /**
   FLTK calls Fl::error() to output a normal error message.
-
+  
   The default version on Windows displays the error message in a MessageBox window.
 
   The default version on all other platforms prints the error message to stderr.
@@ -564,11 +646,11 @@ public:
   static void (*error)(const char*, ...);
   /**
   FLTK calls Fl::fatal() to output a fatal error message.
-
+  
   The default version on Windows displays the error message in a MessageBox window.
 
   The default version on all other platforms prints the error message to stderr.
-
+  
   You can override the behavior by setting the function pointer to your
   own routine.
 
@@ -655,14 +737,14 @@ public:
   /**
     Returns the mouse position on the screen of the event.  To find the
     absolute position of an Fl_Window on the screen, use the
-    difference between event_x_root(),event_y_root() and
+    difference between event_x_root(),event_y_root() and 
     event_x(),event_y().
   */
   static int event_x_root()	{return e_x_root;}
   /**
     Returns the mouse position on the screen of the event.  To find the
     absolute position of an Fl_Window on the screen, use the
-    difference between event_x_root(),event_y_root() and
+    difference between event_x_root(),event_y_root() and 
     event_x(),event_y().
   */
   static int event_y_root()	{return e_y_root;}
@@ -678,24 +760,24 @@ public:
   static int event_dy()	{return e_dy;}
   /**
     Return where the mouse is on the screen by doing a round-trip query to
-    the server.  You should use Fl::event_x_root() and
+    the server.  You should use Fl::event_x_root() and 
     Fl::event_y_root() if possible, but this is necessary if you are
     not sure if a mouse event has been processed recently (such as to
     position your first window).  If the display is not open, this will
     open it.
   */
-  static void get_mouse(int &,int &); // platform dependent
+  static void get_mouse(int &,int &);
   /**
     Returns non zero if we had a double click event.
-    \retval Non-zero if the most recent FL_PUSH or FL_KEYBOARD was a "double click".
-    \retval  N-1 for  N clicks.
+    \retval Non-zero if the most recent FL_PUSH or FL_KEYBOARD was a "double click".  
+    \retval  N-1 for  N clicks. 
     A double click is counted if the same button is pressed
     again while event_is_click() is true.
-
+    
    */
   static int event_clicks()	{return e_clicks;}
   /**
-    Manually sets the number returned by Fl::event_clicks().
+    Manually sets the number returned by Fl::event_clicks().  
     This can be used to set it to zero so that
     later code does not think an item was double-clicked.
     \param[in] i corresponds to no double-click if 0, i+1 mouse clicks otherwise
@@ -719,28 +801,31 @@ public:
   static void event_is_click(int i) {e_is_click = i;}
   /**
     Gets which particular mouse button caused the current event.
+
     This returns garbage if the most recent event was not a FL_PUSH or FL_RELEASE event.
     \retval FL_LEFT_MOUSE \retval FL_MIDDLE_MOUSE \retval FL_RIGHT_MOUSE.
     \see Fl::event_buttons()
   */
   static int event_button()	{return e_keysym-FL_Button;}
   /**
-    This is a bitfield of what shift states were on and what mouse buttons
-    were held down during the most recent event. The second version
-    returns non-zero if any of the passed bits are turned on.
-    The legal bits are:
-
-    \li FL_SHIFT
-    \li FL_CAPS_LOCK
-    \li FL_CTRL
-    \li FL_ALT
-    \li FL_NUM_LOCK
-    \li FL_META
-    \li FL_SCROLL_LOCK
-    \li FL_BUTTON1
-    \li FL_BUTTON2
-    \li FL_BUTTON3
+    Returns the keyboard and mouse button states of the last event.
 
+    This is a bitfield of what shift states were on and what mouse buttons
+    were held down during the most recent event.
+
+    The legal event state bits are:
+
+    - FL_SHIFT
+    - FL_CAPS_LOCK
+    - FL_CTRL
+    - FL_ALT
+    - FL_NUM_LOCK
+    - FL_META
+    - FL_SCROLL_LOCK
+    - FL_BUTTON1
+    - FL_BUTTON2
+    - FL_BUTTON3
+    
     X servers do not agree on shift states, and FL_NUM_LOCK, FL_META, and
     FL_SCROLL_LOCK may not work. The values were selected to match the
     XFree86 server on Linux. In addition there is a bug in the way X works
@@ -748,8 +833,13 @@ public:
     <I>after</I> the shift key is pressed or released.
   */
   static int event_state()	{return e_state;}
-  /** See int event_state() */
-  static int event_state(int i) {return e_state&i;}
+
+  /** Returns non-zero if any of the passed event state bits are turned on.
+
+    Use \p mask to pass the event states you're interested in.
+    The legal event state bits are defined in Fl::event_state().
+  */
+  static int event_state(int mask) {return e_state&mask;}
   
   static int event_timestamp() {return e_timestamp;} //milisecond timestamp
   static int getMilliCount(); //return millisecond timestamp
@@ -758,36 +848,36 @@ public:
     Gets which key on the keyboard was last pushed.
 
     The returned integer 'key code' is not necessarily a text
-    equivalent for the keystroke. For instance: if someone presses '5' on the
+    equivalent for the keystroke. For instance: if someone presses '5' on the 
     numeric keypad with numlock on, Fl::event_key() may return the 'key code'
     for this key, and NOT the character '5'. To always get the '5', use Fl::event_text() instead.
-
+    
     \returns an integer 'key code', or 0 if the last event was not a key press or release.
     \see int event_key(int), event_text(), compose(int&).
   */
   static int event_key()	{return e_keysym;}
   /**
     Returns the keycode of the last key event, regardless of the NumLock state.
-
-    If NumLock is deactivated, FLTK translates events from the
-    numeric keypad into the corresponding arrow key events.
+      
+    If NumLock is deactivated, FLTK translates events from the 
+    numeric keypad into the corresponding arrow key events. 
     event_key() returns the translated key code, whereas
     event_original_key() returns the keycode before NumLock translation.
   */
   static int event_original_key(){return e_original_keysym;}
-  /**
+  /** 
     Returns true if the given \p key was held
     down (or pressed) <I>during</I> the last event.  This is constant until
     the next event is read from the server.
-
+    
     Fl::get_key(int) returns true if the given key is held down <I>now</I>.
     Under X this requires a round-trip to the server and is <I>much</I>
     slower than Fl::event_key(int).
-
+    
     Keys are identified by the <I>unshifted</I> values. FLTK defines a
     set of symbols that should work on most modern machines for every key
     on the keyboard:
-
+    
     \li All keys on the main keyboard producing a printable ASCII
 	character use the value of that ASCII character (as though shift,
 	ctrl, and caps lock were not on). The space bar is 32.
@@ -795,7 +885,7 @@ public:
 	character use the value of that ASCII character plus FL_KP.
 	The highest possible value is FL_KP_Last so you can
 	range-check to see if something is  on the keypad.
-    \li All numbered function keys use the number on the function key plus
+    \li All numbered function keys use the number on the function key plus 
 	FL_F.  The highest possible number is FL_F_Last, so you
 	can range-check a value.
     \li Buttons on the mouse are considered keys, and use the button
@@ -810,22 +900,22 @@ public:
 	symbols used by Fl::event_state().
 
     On X Fl::get_key(FL_Button+n) does not work.
-
+    
     On WIN32 Fl::get_key(FL_KP_Enter) and Fl::event_key(FL_KP_Enter) do not work.
   */
   static int event_key(int key);
-  /**
-    Returns true if the given \p key is held down <I>now</I>.
+  /** 
+    Returns true if the given \p key is held down <I>now</I>.  
     Under X this requires a round-trip to the server and is <I>much</I>
     slower than Fl::event_key(int). \see event_key(int)
   */
   static int get_key(int key); // platform dependent
-  /**
+  /** 
     Returns the text associated with the current event, including FL_PASTE or FL_DND_RELEASE events.
     This can be used in response to FL_KEYUP, FL_KEYDOWN, FL_PASTE, and FL_DND_RELEASE.
 
     When responding to FL_KEYUP/FL_KEYDOWN, use this function instead of Fl::event_key()
-    to get the text equivalent of keystrokes suitable for inserting into strings
+    to get the text equivalent of keystrokes suitable for inserting into strings 
     and text widgets.
 
     The returned string is guaranteed to be NULL terminated.
@@ -844,7 +934,7 @@ public:
   static int event_length() {return e_length;}
   
   /** During an FL_PASTE event of non-textual data, returns a pointer to the pasted data.
-   The returned data is an Fl_Image * when the result of Fl::event_clipboard_type() is Fl::clipboard_image.
+   The returned data is an Fl_RGB_Image * when the result of Fl::event_clipboard_type() is Fl::clipboard_image.
    */
   static void *event_clipboard() { return e_clipboard_data; }
   /** Returns the type of the pasted data during an FL_PASTE event.
@@ -859,6 +949,9 @@ public:
   static int event_inside(const Fl_Widget*);
   static int test_shortcut(Fl_Shortcut);
 
+  static void enable_im();
+  static void disable_im();
+
   // event destinations:
   static int handle(int e, Fl_Window* w);
   static int handle_(int, Fl_Window*);
@@ -878,6 +971,8 @@ public:
   static void remove_focus_changing_handler() {Fl::focus_changing_handler = NULL;};
   static void add_handler(Fl_Event_Handler h);
   static void remove_handler(Fl_Event_Handler h);
+  static void add_system_handler(Fl_System_Handler h, void *data);
+  static void remove_system_handler(Fl_System_Handler h);
   static void event_dispatch(Fl_Event_Dispatch d);
   static Fl_Event_Dispatch event_dispatch();
   /** @} */
@@ -887,62 +982,61 @@ public:
    @{ */
   // cut/paste:
   /**
-  Copies the data pointed to by \p stuff to the selection buffer
-  (\p destination is 0) or
-  the clipboard (\p destination is 1).
+  Copies the data pointed to by \p stuff to the selection buffer 
+  (\p destination is 0), the clipboard (\p destination is 1), or
+  both (\p destination is 2). Copying to both is only relevant on X11,
+  on other platforms it maps to the clipboard (1).
   \p len is the number of relevant bytes in \p stuff.
   \p type is always Fl::clipboard_plain_text.
   The selection buffer is used for
-  middle-mouse pastes and for drag-and-drop selections. The
+  middle-mouse pastes and for drag-and-drop selections. The 
   clipboard is used for traditional copy/cut/paste operations.
+   
+   \note This function is, at present, intended only to copy UTF-8 encoded textual data.
+   To copy graphical data, use the Fl_Copy_Surface class. The \p type argument may allow
+   in the future to copy other kinds of data.
   */
-#if FLTK_ABI_VERSION >= 10303 || defined(FL_DOXYGEN)
   static void copy(const char* stuff, int len, int destination = 0, const char *type = Fl::clipboard_plain_text); // platform dependent
-#else
-  static void copy(const char* stuff, int len, int destination, const char *type);
-  static void copy(const char* stuff, int len, int destination = 0);
-#endif
-  
-#if !(defined(__APPLE__) || defined(WIN32) || defined(FL_DOXYGEN))
-  static void copy_image(const unsigned char* data, int W, int H, int destination = 0); // platform dependent
-#endif
+
   /**
-  Pastes the data from the selection buffer (\p source is 0) or the clipboard 
-  (\p source is 1) into \p receiver.  If \p source is 1,
-  the optional \p type argument indicates what type of data is requested from the clipboard
-  (at present, Fl::clipboard_plain_text - requesting text data - and 
-  Fl::clipboard_image - requesting image data - are possible).
-  Set things up so the handle function of the \p receiver widget will be called with an FL_PASTE event some
-  time in the future if the clipboard does contain data of the requested type. During processing of this event,
-  and if \p type is Fl::clipboard_plain_text, the text data from the specified \p source are in Fl::event_text()
-  with UTF-8 encoding, and the number of characters in Fl::event_length();
-  if \p type is Fl::clipboard_image, Fl::event_clipboard() returns a pointer to the
-  image data, as an Fl_Image *.
-  The receiver
-  should be prepared to be called \e directly by this, or for
-  it to happen \e later, or possibly <i>not at all</i>.  This
-  allows the window system to take as long as necessary to retrieve
-  the paste buffer (or even to screw up completely) without complex
-  and error-prone synchronization code in FLTK.
-
-  The selection buffer is used for middle-mouse pastes and for
-  drag-and-drop selections. The clipboard is used for traditional
-  copy/cut/paste operations.
+   Pastes the data from the selection buffer (\p source is 0) or the clipboard
+   (\p source is 1) into \p receiver.
+   
+   The selection buffer (\p source is 0) is used for middle-mouse pastes and for
+   drag-and-drop selections. The clipboard (\p source is 1) is used for
+   copy/cut/paste operations.
+   
+   If \p source is 1, the optional \p type argument indicates what type of data is requested from the clipboard.
+   At present, Fl::clipboard_plain_text (requesting text data) and
+   Fl::clipboard_image (requesting image data) are possible.
+   Set things up so the handle function of the \p receiver widget will be called with an FL_PASTE event some
+   time in the future if the clipboard does contain data of the requested type.
+   While processing the FL_PASTE event:
+   \li if \p type is Fl::clipboard_plain_text, the text string from the specified \p source is in Fl::event_text()
+   with UTF-8 encoding, and the number of bytes in Fl::event_length().
+   If Fl::paste() gets called during the drop step of a files-drag-and-drop operation,
+   Fl::event_text() contains a list of filenames (see \ref events_dnd).
+   \li if \p type is Fl::clipboard_image, the pointer returned by Fl::event_clipboard() can be safely cast to
+   type Fl_RGB_Image * to obtain a pointer to the pasted image.
+   If \p receiver accepts the clipboard image, receiver.handle() should return 1 and the
+   application should take ownership of this image (that is, delete it after use).
+   Conversely, if receiver.handle() returns 0, the application must not use the image.
+   
+   The receiver should be prepared to be called \e directly by this, or for
+   it to happen \e later, or possibly <i>not at all</i>.  This
+   allows the window system to take as long as necessary to retrieve
+   the paste buffer (or even to screw up completely) without complex
+   and error-prone synchronization code in FLTK.
    
    \par Platform details for image data:
-   \li Unix/Linux platform: Image data in PNG or BMP formats are recognized. Requires linking with the fltk_images library.
+   \li Unix/Linux platform: Clipboard images in PNG or BMP formats are recognized. Requires linking with the fltk_images library.
    \li MSWindows platform: Both bitmap and vectorial (Enhanced metafile) data from clipboard
    can be pasted as image data.
    \li Mac OS X platform: Both bitmap (TIFF) and vectorial (PDF) data from clipboard
    can be pasted as image data.
-    
    */
-#if FLTK_ABI_VERSION >= 10303 || defined(FL_DOXYGEN)
-  static void paste(Fl_Widget &receiver, int source, const char *type = Fl::clipboard_plain_text); // platform dependent
-#else
-  static void paste(Fl_Widget &receiver, int source, const char *type);
-  static void paste(Fl_Widget &receiver, int source /*=0*/);
-#endif
+  static void paste(Fl_Widget &receiver, int source, const char *type = Fl::clipboard_plain_text);
+  
   /**
   FLTK will call the registered callback whenever there is a change to the
   selection buffer or the clipboard. The source argument indicates which
@@ -986,71 +1080,50 @@ public:
     filled with relevant data before calling this method. FLTK will
     then initiate the system wide drag and drop handling. Dropped data
     will be marked as <i>text</i>.
-
+   
     Create a selection first using:
     Fl::copy(const char *stuff, int len, 0)
   */
   static int dnd(); // platform dependent
 
   // These are for back-compatibility only:
-  /**  back-compatibility only: Gets the widget owning the current selection
+  /**  back-compatibility only: Gets the widget owning the current selection  
        \see Fl_Widget* selection_owner(Fl_Widget*) */
   static Fl_Widget* selection_owner() {return selection_owner_;}
   static void selection_owner(Fl_Widget*);
   static void selection(Fl_Widget &owner, const char*, int len);
   static void paste(Fl_Widget &receiver);
 /** @} */
+
+
 /** \defgroup  fl_screen  Screen functions
 	fl global screen functions declared in <FL/Fl.H>
      @{ */
-  // screen size:
-  /** Returns the leftmost x coordinate of the main screen work area. */
-  static int x(); // platform dependent
-  /** Returns the topmost y coordinate of the main screen work area. */
-  static int y(); // platform dependent
-  /** Returns the width in pixels of the main screen work area. */
-  static int w(); // platform dependent
-  /** Returns the height in pixels of the main screen work area. */
-  static int h(); // platform dependent
+  static int x(); // via screen driver
+  static int y(); // via screen driver
+  static int w(); // via screen driver
+  static int h(); // via screen driver
 
   // multi-head support:
-  static int screen_count();
-  /**
-      Gets the bounding box of a screen that contains the mouse pointer.
-      \param[out]  X,Y,W,H the corresponding screen bounding box
-      \see void screen_xywh(int &x, int &y, int &w, int &h, int mx, int my)
-  */
-  static void screen_xywh(int &X, int &Y, int &W, int &H) {
-    int x, y;
-    Fl::get_mouse(x, y);
-    screen_xywh(X, Y, W, H, x, y);
-  }
-  static void screen_xywh(int &X, int &Y, int &W, int &H, int mx, int my);
-  static void screen_xywh(int &X, int &Y, int &W, int &H, int n); 
-  static void screen_xywh(int &X, int &Y, int &W, int &H, int mx, int my, int mw, int mh);
-  static int screen_num(int x, int y);
-  static int screen_num(int x, int y, int w, int h);
-  static void screen_dpi(float &h, float &v, int n=0);
-  static void screen_work_area(int &X, int &Y, int &W, int &H, int mx, int my);
-  static void screen_work_area(int &X, int &Y, int &W, int &H, int n);
-  /** 
-   Gets the bounding box of the work area of the screen that contains the mouse pointer.
-   \param[out]  X,Y,W,H the work area bounding box
-   \see void screen_work_area(int &x, int &y, int &w, int &h, int mx, int my) 
-   */
-  static void screen_work_area(int &X, int &Y, int &W, int &H) {
-    int x, y;
-    Fl::get_mouse(x, y);
-    screen_work_area(X, Y, W, H, x, y);
-  }
+  static int screen_count(); // via screen driver
+  static void screen_xywh(int &X, int &Y, int &W, int &H); // via screen driver
+  static void screen_xywh(int &X, int &Y, int &W, int &H, int mx, int my); // via screen driver
+  static void screen_xywh(int &X, int &Y, int &W, int &H, int n); // via screen driver
+  static void screen_xywh(int &X, int &Y, int &W, int &H, int mx, int my, int mw, int mh); // via screen driver
+  static int screen_num(int x, int y); // via screen driver
+  static int screen_num(int x, int y, int w, int h); // via screen driver
+  static void screen_dpi(float &h, float &v, int n=0); // via screen driver
+  static void screen_work_area(int &X, int &Y, int &W, int &H, int mx, int my); // via screen driver
+  static void screen_work_area(int &X, int &Y, int &W, int &H, int n); // via screen driver
+  static void screen_work_area(int &X, int &Y, int &W, int &H); // via screen driver
+/**   @} */
 
-  /**   @} */
 
   /** \defgroup  fl_attributes  Color & Font functions
 	fl global color, font functions.
-   These functions are declared in <FL/Fl.H> or <FL/fl_draw.H>.
+   These functions are declared in <FL/Fl.H> or <FL/fl_draw.H>. 
      @{ */
-
+ 
   // color map:
   static void	set_color(Fl_Color, uchar, uchar, uchar);
   /**
@@ -1074,9 +1147,9 @@ public:
     is useful if you are presenting a choice to the user.  There is no
     guarantee that each face has a different name.  The return value points
     to a static buffer that is overwritten each call.
-
+    
     The integer pointed to by \p attributes (if the pointer is not
-    zero) is set to zero, FL_BOLD or FL_ITALIC or
+    zero) is set to zero, FL_BOLD or FL_ITALIC or 
     FL_BOLD | FL_ITALIC.  To locate a "family" of fonts, search
     forward and back for a set with non-zero attributes, these faces along
     with the face with a zero attribute before them constitute a family.
@@ -1101,7 +1174,7 @@ public:
     face table.  It will attempt to put "families" of faces together, so
     that the normal one is first, followed by bold, italic, and bold
     italic.
-
+    
     The optional argument is a string to describe the set of fonts to
     add.  Passing NULL will select only fonts that have the
     ISO8859-1 character set (and are thus usable by normal text).  Passing
@@ -1111,7 +1184,7 @@ public:
     values may be useful but are system dependent.  With WIN32 NULL
     selects fonts with ISO8859-1 encoding and non-NULL selects
     all fonts.
-
+    
     The return value is how many faces are in the table after this is done.
   */
   static Fl_Font set_fonts(const char* = 0); // platform dependent
@@ -1119,7 +1192,7 @@ public:
   /**   @} */
  /** \defgroup  fl_drawings  Drawing functions
   FLTK global graphics and GUI drawing functions.
-  These functions are declared in <FL/fl_draw.H>,
+  These functions are declared in <FL/fl_draw.H>, 
   and in <FL/x.H> for offscreen buffer-related ones.
      @{ */
   // <Hack to re-order the 'Drawing functions' group>
@@ -1139,10 +1212,13 @@ public:
   static int box_dy(Fl_Boxtype);
   static int box_dw(Fl_Boxtype);
   static int box_dh(Fl_Boxtype);
+
   static int draw_box_active();
+  static Fl_Color box_color(Fl_Color);
+  static void set_box_color(Fl_Color);
 
   // back compatibility:
-  /** \addtogroup fl_windows
+  /** \addtogroup fl_windows 
     @{ */
   /** For back compatibility, sets the void Fl::fatal handler callback */
   static void set_abort(Fl_Abort_Handler f) {fatal = f;}
@@ -1154,7 +1230,7 @@ public:
   static void set_atclose(Fl_Atclose_Handler f) {atclose = f;}
   /**   @} */
 
-  /** \addtogroup fl_events
+  /** \addtogroup fl_events 
     @{ */
   /** Returns non-zero if the Shift key is pressed. */
   static int event_shift() {return e_state&FL_SHIFT;}
@@ -1166,9 +1242,9 @@ public:
   static int event_alt() {return e_state&FL_ALT;}
   /**
     Returns the mouse buttons state bits; if non-zero, then at least one
-    button is pressed now.  This function returns the button state at the
-    time of the event. During an FL_RELEASE event, the state
-    of the released button will be 0. To find out, which button
+    button is pressed now.  This function returns the button state at the 
+    time of the event. During an FL_RELEASE event, the state 
+    of the released button will be 0. To find out, which button 
     caused an FL_RELEASE event, you can use Fl::event_button() instead.
     \return a bit mask value like { [FL_BUTTON1] | [FL_BUTTON2] | [FL_BUTTON3] }
   */
@@ -1219,15 +1295,15 @@ public:
 
   // Drag-n-drop text operation methods...
   /**
-    Gets or sets whether drag and drop text operations are supported.
+    Sets whether drag and drop text operations are supported.
     This specifically affects whether selected text can
     be dragged from text fields or dragged within a text field as a
     cut/paste shortcut.
   */
   static void dnd_text_ops(int v) { option(OPTION_DND_TEXT, (v!=0)); }
   /**
-    Gets or sets whether drag and drop text operations are
-    supported. This specifically affects whether selected text can
+    Gets whether drag and drop text operations are
+    supported. This returns whether selected text can
     be dragged from text fields or dragged within a text field as a
     cut/paste shortcut.
   */
@@ -1242,16 +1318,6 @@ public:
   static void awake(void* message = 0);
   /** See void awake(void* message=0). */
   static int awake(Fl_Awake_Handler cb, void* message = 0);
- 
-  // Cross platform sleep API
-
-  /** flexible sleep function in seconds, accepts decimals typically up to 100usec resolution (depends on your hardware) */
-  static void sleep(double seconds);
-  /** milli seconds sleep */
-  static void msleep(unsigned long milliseconds);
-  /** microseconds sleep */
-  static void usleep(unsigned long long microseconds);
-  
   /**
     The thread_message() method returns the last message
     that was sent from a child by the awake() method.
@@ -1297,34 +1363,46 @@ public:
   static void release_widget_pointer(Fl_Widget *&w);
   static void clear_widget_pointer(Fl_Widget const *w);
   /** @} */
+  
+  /**  sets whether GL windows should be drawn at high resolution on Apple
+   computers with retina displays
+   \version 1.3.4
+   */
+  static void use_high_res_GL(int val) { use_high_res_GL_ = val; }
+  /**  returns whether GL windows should be drawn at high resolution on Apple
+   computers with retina displays.
+   Default is no.
+   \version 1.3.4
+   */
+  static int use_high_res_GL() { return use_high_res_GL_; }
 
 #ifdef FLTK_HAVE_CAIRO
-  /** \defgroup group_cairo Cairo support functions and classes
-      @{
+  /** \defgroup group_cairo Cairo Support Functions and Classes
+      @{ 
   */
 public:
   // Cairo support API
   static cairo_t * cairo_make_current(Fl_Window* w);
    /** when FLTK_HAVE_CAIRO is defined and cairo_autolink_context() is true,
-      any current window dc is linked to a current context.
+      any current window dc is linked to a current cairo context.
       This is not the default, because it may not be necessary
       to add cairo support to all fltk supported windows.
       When you wish to associate a cairo context in this mode,
       you need to call explicitly in your draw() overridden method,
-      FL::cairo_make_current(Fl_Window*). This will create a cairo context
-      but only for this Window.
-      Still in custom cairo application it is possible to handle
+      Fl::cairo_make_current(Fl_Window*). This will create a cairo context
+      but only for this Window. 
+      Still in custom cairo application it is possible to handle 
       completely this process automatically by setting \p alink to true.
       In this last case, you don't need anymore to call Fl::cairo_make_current().
       You can use Fl::cairo_cc() to get the current cairo context anytime.
      \note Only available when configure has the --enable-cairo option
   */
   static void cairo_autolink_context(bool alink) {cairo_state_.autolink(alink);}
-  /**
+  /** 
     Gets the current autolink mode for cairo support.
-    \retval false if no cairo context autolink is made for each window.
-    \retval true if any fltk window is attached a cairo context when it
-    is current. \see void cairo_autolink_context(bool alink)
+    \retval false if no cairo context autolink is made for each window. 
+    \retval true if any fltk window is attached a cairo context when it 
+    is current. \see void cairo_autolink_context(bool alink) 
     \note Only available when configure has the --enable-cairo option
  */
   static bool cairo_autolink_context() {return cairo_state_.autolink();}
@@ -1334,14 +1412,14 @@ public:
       Set \p own to true if you want fltk to handle this cc deletion.
      \note Only available when configure has the --enable-cairo option
 */
-  static void cairo_cc(cairo_t * c, bool own=false){ cairo_state_.cc(c, own); }
+  static void cairo_cc(cairo_t * c, bool own=false){ cairo_state_.cc(c, own); } 
 
 private:
   static cairo_t * cairo_make_current(void* gc);
   static cairo_t * cairo_make_current(void* gc, int W, int H);
   static Fl_Cairo_State cairo_state_;
 public:
-  /** @} */
+  /** @} */ 
 
 #endif // FLTK_HAVE_CAIRO
 
@@ -1351,39 +1429,42 @@ public:
   This class should be used to control safe widget deletion.
 
   You can use an Fl_Widget_Tracker object to watch another widget, if you
-  need to know, if this widget has been deleted during a callback.
+  need to know whether this widget has been deleted during a callback.
 
   This simplifies the use of the "safe widget deletion" methods
   Fl::watch_widget_pointer() and Fl::release_widget_pointer() and
-  makes their use more reliable, because the destructor autmatically
+  makes their use more reliable, because the destructor automatically
   releases the widget pointer from the widget watch list.
 
-  It is intended to be used as an automatic (local/stack) variable,
-  such that the automatic destructor is called when the object's
+  Fl_Widget_Tracker is intended to be used as an automatic (local/stack)
+  variable, such that its destructor is called when the object's
   scope is left. This ensures that no stale widget pointers are
   left in the widget watch list (see example below).
-
+  
   You can also create Fl_Widget_Tracker objects with \c new, but then it
   is your responsibility to delete the object (and thus remove the
-  widget pointer from the watch list) when it is not needed any more.
+  widget pointer from the watch list) when it is no longer needed.
 
   Example:
 
   \code
-    int MyClass::handle (int event) {
+  int MyClass::handle (int event) {
 
-      if (...) {
-	Fl_Widget_Tracker wp(this);	// watch myself
-	do_callback();			// call the callback
+    if (...) {
+      Fl_Widget_Tracker wp(this);           // watch myself
+      do_callback();                        // call the callback
 
-	if (wp.deleted()) return 1;	// exit, if deleted
+      if (wp.deleted()) return 1;           // exit, if deleted
 
-	// Now we are sure that the widget has not been deleted.
-	// It is safe to access the widget
+      // Now we are sure that the widget has not been deleted,
+      // and it is safe to access the widget:
 
-	clear_changed();		// access the widget
-      }
+      box(FL_FLAT_BOX);
+      color(FL_WHITE);
+      redraw();
+      clear_changed();		// access the widget
     }
+  }
   \endcode
 
 */
@@ -1435,5 +1516,5 @@ public:
 #endif // !Fl_H
 
 //
-// End of "$Id: Fl.H 10186 2014-06-07 12:01:59Z manolo $".
+// End of "$Id: Fl.H 12525 2017-10-25 05:26:49Z manolo $".
 //

+ 75 - 76
fltk/FL/Fl_Adjuster.H

@@ -1,76 +1,75 @@
-//
-// "$Id: Fl_Adjuster.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
-//
-// Adjuster widget header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_Adjuster widget . */
-
-// 3-button "slider", made for Nuke
-
-#ifndef Fl_Adjuster_H
-#define Fl_Adjuster_H
-
-#ifndef Fl_Valuator_H
-#include "Fl_Valuator.H"
-#endif
-
-/**
-  The Fl_Adjuster widget was stolen from Prisms, and has proven
-  to be very useful for values that need a large dynamic range.
-  \image html adjuster1.png 
-  \image latex adjuster1.png "Fl_Adjuster" width=4cm
-  <P>When you  press a button and drag to the right the value increases.
-  When you drag  to the left it decreases.  The largest button adjusts by
-  100 *  step(), the next by 10 * step() and that
-  smallest button  by step().  Clicking on the buttons
-  increments by 10 times the  amount dragging by a pixel does. Shift +
-  click decrements by 10 times  the amount.
-*/
-class FL_EXPORT Fl_Adjuster : public Fl_Valuator {
-  int drag;
-  int ix;
-  int soft_;
-protected:
-  void draw();
-  int handle(int);
-  void value_damage();
-public:
-  Fl_Adjuster(int X,int Y,int W,int H,const char *l=0);
-  /**
-    If "soft" is turned on, the user is allowed to drag the value outside
-    the range.  If they drag the value to one of the ends, let go, then
-    grab again and continue to drag, they can get to any value.  Default is
-    one.
-  */
-  void soft(int s) {soft_ = s;}
-  /**
-    If "soft" is turned on, the user is allowed to drag the value outside
-    the range.  If they drag the value to one of the ends, let go, then
-    grab again and continue to drag, they can get to any value.  Default is
-    one.
-  */
-  int soft() const {return soft_;}
-
-//DAD Extensios
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_Adjuster, Fl_Valuator)
-};
-
-#endif
-
-//
-// End of "$Id: Fl_Adjuster.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
-//
+//
+// "$Id: Fl_Adjuster.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
+//
+// Adjuster widget header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2010 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_Adjuster widget . */
+
+// 3-button "slider", made for Nuke
+
+#ifndef Fl_Adjuster_H
+#define Fl_Adjuster_H
+
+#ifndef Fl_Valuator_H
+#include "Fl_Valuator.H"
+#endif
+
+/**
+  The Fl_Adjuster widget was stolen from Prisms, and has proven
+  to be very useful for values that need a large dynamic range.
+  \image html adjuster1.png 
+  \image latex adjuster1.png "Fl_Adjuster" width=4cm
+  <P>When you  press a button and drag to the right the value increases.
+  When you drag  to the left it decreases.  The largest button adjusts by
+  100 *  step(), the next by 10 * step() and that
+  smallest button  by step().  Clicking on the buttons
+  increments by 10 times the  amount dragging by a pixel does. Shift +
+  click decrements by 10 times  the amount.
+*/
+class FL_EXPORT Fl_Adjuster : public Fl_Valuator {
+  int drag;
+  int ix;
+  int soft_;
+protected:
+  void draw();
+  int handle(int);
+  void value_damage();
+public:
+  Fl_Adjuster(int X,int Y,int W,int H,const char *l=0);
+  /**
+    If "soft" is turned on, the user is allowed to drag the value outside
+    the range.  If they drag the value to one of the ends, let go, then
+    grab again and continue to drag, they can get to any value.  Default is
+    one.
+  */
+  void soft(int s) {soft_ = s;}
+  /**
+    If "soft" is turned on, the user is allowed to drag the value outside
+    the range.  If they drag the value to one of the ends, let go, then
+    grab again and continue to drag, they can get to any value.  Default is
+    one.
+  */
+  int soft() const {return soft_;}
+//DAD Extensios
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_Adjuster, Fl_Valuator)
+};
+
+#endif
+
+//
+// End of "$Id: Fl_Adjuster.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
+//

+ 43 - 44
fltk/FL/Fl_BMP_Image.H

@@ -1,44 +1,43 @@
-//
-// "$Id: Fl_BMP_Image.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
-//
-// BMP image header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_BMP_Image widget . */
-
-#ifndef Fl_BMP_Image_H
-#define Fl_BMP_Image_H
-#  include "Fl_Image.H"
-
-/**
-  The Fl_BMP_Image class supports loading, caching,
-  and drawing of Windows Bitmap (BMP) image files.
-*/
-class FL_EXPORT Fl_BMP_Image : public Fl_RGB_Image {
-
-  public:
-
-  Fl_BMP_Image(const char* filename);
-
-//DAD Extensios
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_BMP_Image, Fl_RGB_Image)
-};
-
-#endif
-
-//
-// End of "$Id: Fl_BMP_Image.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
-//
+//
+// "$Id: Fl_BMP_Image.H 10732 2015-05-23 23:42:26Z matt $"
+//
+// BMP image header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2010 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_BMP_Image widget . */
+
+#ifndef Fl_BMP_Image_H
+#define Fl_BMP_Image_H
+#  include "Fl_Image.H"
+
+/**
+ The Fl_BMP_Image class supports loading, caching,
+ and drawing of Windows Bitmap (BMP) image files. 
+ */
+class FL_EXPORT Fl_BMP_Image : public Fl_RGB_Image {
+
+  public:
+
+  Fl_BMP_Image(const char* filename);
+//DAD Extensios
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_BMP_Image, Fl_RGB_Image)
+};
+
+#endif
+
+//
+// End of "$Id: Fl_BMP_Image.H 10732 2015-05-23 23:42:26Z matt $".
+//

+ 73 - 79
fltk/FL/Fl_Bitmap.H

@@ -1,80 +1,74 @@
-//
-// "$Id: Fl_Bitmap.H 10110 2014-02-22 14:51:50Z manolo $"
-//
-// Bitmap header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_Bitmap widget . */
-
-#ifndef Fl_Bitmap_H
-#define Fl_Bitmap_H
-#  include "Fl_Image.H"
-
-class Fl_Widget;
-class Fl_Menu_Item;
-
-/**
-  The Fl_Bitmap class supports caching and drawing of mono-color
-  (bitmap) images. Images are drawn using the current color.
-*/
-class FL_EXPORT Fl_Bitmap : public Fl_Image {
-  friend class Fl_Quartz_Graphics_Driver;
-  friend class Fl_GDI_Graphics_Driver;
-  friend class Fl_GDI_Printer_Graphics_Driver;
-  friend class Fl_Xlib_Graphics_Driver;
-public:
-
-  /** pointer to raw bitmap data */
-  const uchar *array;
-  /** Non-zero if array points to bitmap data allocated internally */
-  int alloc_array;
-  
-  private:
-  int start(int XP, int YP, int WP, int HP, int &cx, int &cy, 
+//
+// "$Id: Fl_Bitmap.H 12433 2017-09-09 12:35:06Z manolo $"
+//
+// Bitmap header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2017 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_Bitmap widget . */
+
+#ifndef Fl_Bitmap_H
+#define Fl_Bitmap_H
+#include "Fl_Image.H"
+#include "Fl_Widget.H" // for fl_uintptr_t
+
+class Fl_Widget;
+struct Fl_Menu_Item;
+
+/**
+  The Fl_Bitmap class supports caching and drawing of mono-color
+  (bitmap) images. Images are drawn using the current color.
+*/
+class FL_EXPORT Fl_Bitmap : public Fl_Image {
+  friend class Fl_Graphics_Driver;
+public:
+  /** pointer to raw bitmap data */
+  const uchar *array;
+  /** Non-zero if array points to bitmap data allocated internally */
+  int alloc_array;
+  
+private:
+  int prepare(int XP, int YP, int WP, int HP, int &cx, int &cy,
 	    int &X, int &Y, int &W, int &H);
-#if defined(__APPLE__) || defined(WIN32)
-  /** for internal use */
-  void *id_;
-#else
-  /** for internal use */
-  unsigned id_;
-#endif // __APPLE__ || WIN32
-
-  public:
-
-  /** The constructors create a new bitmap from the specified bitmap data */
-  Fl_Bitmap(const uchar *bits, int W, int H) :
-    Fl_Image(W,H,0), array(bits), alloc_array(0), id_(0) {data((const char **)&array, 1);}
-  /** The constructors create a new bitmap from the specified bitmap data */
-  Fl_Bitmap(const char *bits, int W, int H) :
-    Fl_Image(W,H,0), array((const uchar *)bits), alloc_array(0), id_(0) {data((const char **)&array, 1);}
-  virtual ~Fl_Bitmap();
-  virtual Fl_Image *copy(int W, int H);
-  Fl_Image *copy() { return copy(w(), h()); }
-  virtual void draw(int X, int Y, int W, int H, int cx=0, int cy=0);
-  void draw(int X, int Y) {draw(X, Y, w(), h(), 0, 0);}
-  virtual void label(Fl_Widget*w);
-  virtual void label(Fl_Menu_Item*m);
-  virtual void uncache();
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_Bitmap, Fl_Image)
-};
-
-#endif
-
-//
-// End of "$Id: Fl_Bitmap.H 10110 2014-02-22 14:51:50Z manolo $".
-//
+  /** for internal use */
+  fl_uintptr_t id_;
+  float cache_scale_; // graphics scaling value when id_ was computed
+  
+protected:
+  virtual int draw_scaled(int X, int Y, int W, int H);
+
+public:
+  /** The constructors create a new bitmap from the specified bitmap data */
+  Fl_Bitmap(const uchar *bits, int W, int H) :
+    Fl_Image(W,H,0), array(bits), alloc_array(0), id_(0), cache_scale_(1) {data((const char **)&array, 1);}
+  /** The constructors create a new bitmap from the specified bitmap data */
+  Fl_Bitmap(const char *bits, int W, int H) :
+    Fl_Image(W,H,0), array((const uchar *)bits), alloc_array(0), id_(0), cache_scale_(1) {data((const char **)&array, 1);}
+  virtual ~Fl_Bitmap();
+  virtual Fl_Image *copy(int W, int H);
+  Fl_Image *copy() { return copy(w(), h()); }
+  virtual void draw(int X, int Y, int W, int H, int cx=0, int cy=0);
+  void draw(int X, int Y) {draw(X, Y, w(), h(), 0, 0);}
+  virtual void label(Fl_Widget*w);
+  virtual void label(Fl_Menu_Item*m);
+  virtual void uncache();
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_Bitmap, Fl_Image)
+};
+
+#endif
+
+//
+// End of "$Id: Fl_Bitmap.H 12433 2017-09-09 12:35:06Z manolo $".
+//

+ 60 - 65
fltk/FL/Fl_Box.H

@@ -1,65 +1,60 @@
-//
-// "$Id: Fl_Box.H 9672 2012-08-17 09:18:06Z manolo $"
-//
-// Box header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_Box widget . */
-
-#ifndef Fl_Box_H
-#define Fl_Box_H
-
-#ifndef Fl_Widget_H
-#include <FL/Fl_Widget.H>
-#endif
-
-/**
-  This widget simply draws its box, and possibly its label.  Putting it
-  before some other widgets and making it big enough to surround them
-  will let you draw a frame around them.
-*/
-class FL_EXPORT Fl_Box : public Fl_Widget {
-#ifdef LUAFLTK
-public:
-#else
-protected:
-#endif
-  void draw();
-public:
-  /**
-    - The first constructor sets box() to FL_NO_BOX, which
-    means it is invisible. However such widgets are useful as placeholders
-    or Fl_Group::resizable()
-    values.  To change the box to something visible, use box(n).
-    - The second form of the constructor sets the box to the specified box
-    type.
-    <P>The destructor removes the box.
-  */
-  Fl_Box(int X, int Y, int W, int H, const char *l=0);
-  
-  /**    See Fl_Box::Fl_Box(int x, int y, int w, int h, const char * = 0)   */
-  Fl_Box(Fl_Boxtype b, int X, int Y, int W, int H, const char *l);
-
-  virtual int handle(int);
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_Box, Fl_Widget)
-};
-
-#endif
-
-//
-// End of "$Id: Fl_Box.H 9672 2012-08-17 09:18:06Z manolo $".
-//
+//
+// "$Id: Fl_Box.H 9672 2012-08-17 09:18:06Z manolo $"
+//
+// Box header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2010 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_Box widget . */
+
+#ifndef Fl_Box_H
+#define Fl_Box_H
+
+#ifndef Fl_Widget_H
+#include "Fl_Widget.H"
+#endif
+
+/**
+  This widget simply draws its box, and possibly its label.  Putting it
+  before some other widgets and making it big enough to surround them
+  will let you draw a frame around them.
+*/
+class FL_EXPORT Fl_Box : public Fl_Widget {
+//protected:
+public:
+  void draw();
+  /**
+    - The first constructor sets box() to FL_NO_BOX, which
+    means it is invisible. However such widgets are useful as placeholders
+    or Fl_Group::resizable()
+    values.  To change the box to something visible, use box(n).
+    - The second form of the constructor sets the box to the specified box
+    type.
+    <P>The destructor removes the box.
+  */
+  Fl_Box(int X, int Y, int W, int H, const char *l=0);
+
+  /**    See Fl_Box::Fl_Box(int x, int y, int w, int h, const char * = 0)   */
+  Fl_Box(Fl_Boxtype b, int X, int Y, int W, int H, const char *l);
+
+  virtual int handle(int);
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_Box, Fl_Widget)
+};
+
+#endif
+
+//
+// End of "$Id: Fl_Box.H 9672 2012-08-17 09:18:06Z manolo $".
+//

+ 330 - 320
fltk/FL/Fl_Browser.H

@@ -1,321 +1,331 @@
-//
-// "$Id: Fl_Browser.H 9682 2012-09-17 22:44:54Z greg.ercolano $"
-//
-// Browser header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2011 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_Browser widget . */
-
-// Forms-compatible browser.  Probably useful for other
-// lists of textual data.  Notice that the line numbers
-// start from 1, and 0 means "no line".
-
-#ifndef Fl_Browser_H
-#define Fl_Browser_H
-
-#include "Fl_Browser_.H"
-#include "Fl_Image.H"
-
-struct FL_BLINE;
-
-/**
-  The Fl_Browser widget displays a scrolling list of text
-  lines, and manages all the storage for the text.  This is not a text
-  editor or spreadsheet!  But it is useful for showing a vertical list of
-  named objects to the user.
-
-  Each line in the browser is identified by number. <I>The numbers
-  start at one</I> (this is so that zero can be reserved for "no line" in
-  the selective browsers). <I>Unless otherwise noted, the methods do not
-  check to see if the passed line number is in range and legal.  It must
-  always be greater than zero and &lt;= size().</I>
-
-  Each line contains a null-terminated string of text and a void *
-  data pointer.  The text string is displayed, the void *
-  pointer can be used by the callbacks to reference the object the text
-  describes.
-
-  The base class does nothing when the user clicks on it.  The
-  subclasses
-  Fl_Select_Browser,
-  Fl_Hold_Browser, and
-  Fl_Multi_Browser react to user clicks to select lines in
-  the browser and do callbacks.
-
-  The base class
-  Fl_Browser_ provides the scrolling and selection mechanisms of
-  this and all the subclasses, but the dimensions and appearance of each
-  item are determined by the subclass. You can use Fl_Browser_
-  to display information other than text, or text that is dynamically
-  produced from your own data structures. If you find that loading the
-  browser is a lot of work or is inefficient, you may want to make a
-  subclass of Fl_Browser_.
-
-  Some common coding patterns used for working with Fl_Browser:
-  \code
-      // How to loop through all the items in the browser
-      for ( int t=1; t<=browser->size(); t++ ) {       // index 1 based..!
-	  printf("item #%d, label='%s'\n", t, browser->text(t));
-      }
-  \endcode
-
-  Note: If you are <I>subclassing</I> Fl_Browser, it's more efficient
-  to use the protected methods item_first() and item_next(), since
-  Fl_Browser internally uses linked lists to manage the browser's items.
-  For more info, see find_item(int).
-*/
-class FL_EXPORT Fl_Browser : public Fl_Browser_ {
-
-  FL_BLINE *first;		// the array of lines
-  FL_BLINE *last;
-  FL_BLINE *cache;
-  int cacheline;		// line number of cache
-  int lines;                	// Number of lines
-  int full_height_;
-  const int* column_widths_;
-  int* column_widths_owned_;
-  char format_char_;		// alternative to @-sign
-  char column_char_;		// alternative to tab
-
-protected:
-
-  // required routines for Fl_Browser_ subclass:
-  void* item_first() const ;
-  void* item_next(void* item) const ;
-  void* item_prev(void* item) const ;
-  void* item_last()const ;
-  int item_selected(void* item) const ;
-  void item_select(void* item, int val);
-  int item_height(void* item) const ;
-  int item_width(void* item) const ;
-  void item_draw(void* item, int X, int Y, int W, int H) const ;
-  int full_height() const ;
-  int incr_height() const ;
-  const char *item_text(void *item) const;
-  /** Swap the items \p a and \p b.
-      You must call redraw() to make any changes visible.
-      \param[in] a,b the items to be swapped.
-      \see swap(int,int), item_swap()
-   */
-  void item_swap(void *a, void *b) { swap((FL_BLINE*)a, (FL_BLINE*)b); }
-  /** Return the item at specified \p line.
-      \param[in] line The line of the item to return. (1 based)
-      \returns The item, or NULL if line out of range.
-      \see item_at(), find_line(), lineno()
-   */
-  void *item_at(int line) const { return (void*)find_line(line); }
-
-  FL_BLINE* find_line(int line) const ;
-  FL_BLINE* _remove(int line) ;
-  void insert(int line, FL_BLINE* item);
-  int lineno(void *item) const ;
-  void swap(FL_BLINE *a, FL_BLINE *b);
-
-public:
-
-  void remove(int line);
-  void add(const char* newtext, void* d = 0);
-  void insert(int line, const char* newtext, void* d = 0);
-  void move(int to, int from);
-  int  load(const char* filename);
-  void swap(int a, int b);
-  void clear();
-
-  /**
-    Returns how many lines are in the browser.
-    The last line number is equal to this.
-    Returns 0 if browser is empty.
-  */
-  int size() const { return lines; }
-  void size(int W, int H) { Fl_Widget::size(W, H); }
-
-  int topline() const ;
-  /** For internal use only? */
-  enum Fl_Line_Position { TOP, BOTTOM, MIDDLE };
-  void lineposition(int line, Fl_Line_Position pos);
-  /**
-    Scrolls the browser so the top item in the browser
-    is showing the specified \p line.
-    \param[in] line The line to be displayed at the top.
-    \see topline(), middleline(), bottomline(), displayed(), lineposition()
-   */
-  void topline(int line) { lineposition(line, TOP); }
-  /**
-    Scrolls the browser so the bottom item in the browser
-    is showing the specified \p line.
-    \param[in] line The line to be displayed at the bottom.
-    \see topline(), middleline(), bottomline(), displayed(), lineposition()
-   */
-  void bottomline(int line) { lineposition(line, BOTTOM); }
-  /**
-    Scrolls the browser so the middle item in the browser
-    is showing the specified \p line.
-    \param[in] line The line to be displayed in the middle.
-    \see topline(), middleline(), bottomline(), displayed(), lineposition()
-   */
-  void middleline(int line) { lineposition(line, MIDDLE); }
-
-  int select(int line, int val=1);
-  int selected(int line) const ;
-  void show(int line);
-  /** Shows the entire Fl_Browser widget -- opposite of hide(). */
-  void show() { Fl_Widget::show(); }
-  void hide(int line);
-  /** Hides the entire Fl_Browser widget -- opposite of show(). */
-  void hide() { Fl_Widget::hide(); }
-  int visible(int line) const ;
-
-  int value() const ;
-  /**
-    Sets the browser's value(), which selects the specified \p line.
-    This is the same as calling select(line).
-    \see select(), selected(), value(), item_select(), item_selected()
-   */
-  void value(int line) { select(line); }
-  const char* text(int line) const ;
-  void text(int line, const char* newtext);
-  void* data(int line) const ;
-  void data(int line, void* d);
-  int lineno_for_data(void *data) const ;
-
-  Fl_Browser(int X, int Y, int W, int H, const char *L = 0);
-  /**
-    The destructor deletes all list items and destroys the browser.
-   */
-  ~Fl_Browser();
-
-  /**
-    Gets the current format code prefix character, which by default is '\@'.
-    A string of formatting codes at the start of each column are stripped off
-    and used to modify how the rest of the line is printed:
-
-    \li <tt>'\@.'</tt> Print rest of line, don't look for more '\@' signs
-    \li <tt>'\@\@'</tt> Print rest of line starting with '\@'
-    \li <tt>'\@l'</tt> Use a LARGE (24 point) font
-    \li <tt>'\@m'</tt> Use a medium large (18 point) font
-    \li <tt>'\@s'</tt> Use a <SMALL>small</SMALL> (11 point) font
-    \li <tt>'\@b'</tt> Use a <B>bold</B> font (adds FL_BOLD to font)
-    \li <tt>'\@i'</tt> Use an <I>italic</I> font (adds FL_ITALIC to font)
-    \li <tt>'\@f' or '\@t'</tt> Use a fixed-pitch
-    font (sets font to FL_COURIER)
-    \li <tt>'\@c'</tt> Center the line horizontally
-    \li <tt>'\@r'</tt> Right-justify the text
-    \li <tt>'\@B0', '\@B1', ... '\@B255'</tt> Fill the backgound with
-    fl_color(n)
-    \li <tt>'\@C0', '\@C1', ... '\@C255'</tt> Use fl_color(n) to draw the text
-    \li <tt>'\@F0', '\@F1', ...</tt> Use fl_font(n) to draw the text
-    \li <tt>'\@S1', '\@S2', ...</tt> Use point size n to draw the text
-    \li <tt>'\@u' or '\@_'</tt> Underline the text.
-    \li <tt>'\@-'</tt> draw an engraved line through the middle.
-
-    Notice that the '\@.' command can be used to reliably
-    terminate the parsing.  To print a random string in a random color, use
-    <tt>sprintf("@C%d@.%s", color, string)</tt> and it will work even if the
-    string starts with a digit or has the format character in it.
-  */
-  char format_char() const { return format_char_; }
-  /**
-    Sets the current format code prefix character to \p c.
-    The default prefix is '\@'.  Set the prefix to 0 to disable formatting.
-    \see format_char() for list of '\@' codes
-  */
-  void format_char(char c) { format_char_ = c; }
-  /**
-    Gets the current column separator character.
-    The default is '\\t' (tab).
-    \see column_char(), column_widths()
-  */
-  char column_char() const { return column_char_; }
-  /**
-    Sets the column separator to c.
-    This will only have an effect if you also set column_widths().
-    The default is '\\t' (tab).
-    \see column_char(), column_widths()
-  */
-  void column_char(char c) { column_char_ = c; }
-  /**
-    Gets the current column width array.
-    This array is zero-terminated and specifies the widths in pixels of
-    each column. The text is split at each column_char() and each part is
-    formatted into it's own column.  After the last column any remaining
-    text is formatted into the space between the last column and the
-    right edge of the browser, even if the text contains instances of
-    column_char() .  The default value is a one-element array of just
-    a zero, which means there are no columns.
-
-    Example:
-    \code
-  Fl_Browser *b = new Fl_Browser(..);
+//
+// "$Id: Fl_Browser.H 11465 2016-03-29 11:54:44Z AlbrechtS $"
+//
+// Browser header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2016 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_Browser widget . */
+
+// Forms-compatible browser.  Probably useful for other
+// lists of textual data.  Notice that the line numbers
+// start from 1, and 0 means "no line".
+
+#ifndef Fl_Browser_H
+#define Fl_Browser_H
+
+#include "Fl_Browser_.H"
+#include "Fl_Image.H"
+
+struct FL_BLINE;
+
+/**
+  The Fl_Browser widget displays a scrolling list of text
+  lines, and manages all the storage for the text.  This is not a text
+  editor or spreadsheet!  But it is useful for showing a vertical list of
+  named objects to the user.
+  
+  Each line in the browser is identified by number. <I>The numbers
+  start at one</I> (this is so that zero can be reserved for "no line" in
+  the selective browsers). <I>Unless otherwise noted, the methods do not
+  check to see if the passed line number is in range and legal.  It must
+  always be greater than zero and &lt;= size().</I>
+
+  Each line contains a null-terminated string of text and a void *
+  data pointer.  The text string is displayed, the void *
+  pointer can be used by the callbacks to reference the object the text
+  describes.
+
+  The base class does nothing when the user clicks on it.  The
+  subclasses 
+  Fl_Select_Browser, 
+  Fl_Hold_Browser, and 
+  Fl_Multi_Browser react to user clicks to select lines in
+  the browser and do callbacks.
+
+  The base class
+  Fl_Browser_ provides the scrolling and selection mechanisms of
+  this and all the subclasses, but the dimensions and appearance of each
+  item are determined by the subclass. You can use Fl_Browser_
+  to display information other than text, or text that is dynamically
+  produced from your own data structures. If you find that loading the
+  browser is a lot of work or is inefficient, you may want to make a
+  subclass of Fl_Browser_.
+
+  Some common coding patterns used for working with Fl_Browser:
+  \code
+      // How to loop through all the items in the browser
+      for ( int t=1; t<=browser->size(); t++ ) {       // index 1 based..!
+	  printf("item #%d, label='%s'\n", t, browser->text(t));
+      }
+  \endcode
+
+  Note: If you are <I>subclassing</I> Fl_Browser, it's more efficient
+  to use the protected methods item_first() and item_next(), since
+  Fl_Browser internally uses linked lists to manage the browser's items.
+  For more info, see find_item(int).
+*/
+class FL_EXPORT Fl_Browser : public Fl_Browser_ {
+
+  FL_BLINE *first;		// the array of lines
+  FL_BLINE *last;
+  FL_BLINE *cache;
+  int cacheline;		// line number of cache
+  int lines;                	// Number of lines
+  int full_height_;
+  const int* column_widths_;
+  int* column_widths_owned_;
+  char format_char_;		// alternative to @-sign
+  char column_char_;		// alternative to tab
+
+protected:
+
+  // required routines for Fl_Browser_ subclass:
+  void* item_first() const ;
+  void* item_next(void* item) const ;
+  void* item_prev(void* item) const ;
+  void* item_last()const ;
+  int item_selected(void* item) const ;
+  void item_select(void* item, int val);
+  int item_height(void* item) const ;
+  int item_width(void* item) const ;
+  void item_draw(void* item, int X, int Y, int W, int H) const ;
+  int full_height() const ;
+  int incr_height() const ;
+  const char *item_text(void *item) const;
+  /** Swap the items \p a and \p b.
+      You must call redraw() to make any changes visible.
+      \param[in] a,b the items to be swapped.
+      \see swap(int,int), item_swap()
+   */
+  void item_swap(void *a, void *b) { swap((FL_BLINE*)a, (FL_BLINE*)b); }
+  /** Return the item at specified \p line.
+      \param[in] line The line of the item to return. (1 based)
+      \returns The item, or NULL if line out of range.
+      \see item_at(), find_line(), lineno()
+   */
+  void *item_at(int line) const { return (void*)find_line(line); }
+
+  FL_BLINE* find_line(int line) const ;
+  FL_BLINE* _remove(int line) ;
+  void insert(int line, FL_BLINE* item);
+  int lineno(void *item) const ;
+  void swap(FL_BLINE *a, FL_BLINE *b);
+
+public:
+
+  void remove(int line);
+  void add(const char* newtext, void* d = 0);
+  void insert(int line, const char* newtext, void* d = 0);
+  void move(int to, int from);
+  int  load(const char* filename);
+  void swap(int a, int b);
+  void clear();
+
+  /**
+    Returns how many lines are in the browser.
+    The last line number is equal to this.
+    Returns 0 if browser is empty.
+  */
+  int size() const { return lines; }
+  void size(int W, int H) { Fl_Widget::size(W, H); }
+
+  /**
+    Gets the default text size (in pixels) for the lines in the browser.
+  */
+  Fl_Fontsize textsize() const { return Fl_Browser_::textsize(); }
+
+  /*
+    Sets the default text size for the lines in the browser to newSize.
+    Defined and documented in Fl_Browser.cxx
+  */
+  void textsize(Fl_Fontsize newSize);
+
+  int topline() const ;
+  /** For internal use only? */
+  enum Fl_Line_Position { TOP, BOTTOM, MIDDLE };
+  void lineposition(int line, Fl_Line_Position pos);
+  /**
+    Scrolls the browser so the top item in the browser
+    is showing the specified \p line.
+    \param[in] line The line to be displayed at the top.
+    \see topline(), middleline(), bottomline(), displayed(), lineposition()
+   */
+  void topline(int line) { lineposition(line, TOP); }
+  /**
+    Scrolls the browser so the bottom item in the browser
+    is showing the specified \p line.
+    \param[in] line The line to be displayed at the bottom.
+    \see topline(), middleline(), bottomline(), displayed(), lineposition()
+   */
+  void bottomline(int line) { lineposition(line, BOTTOM); }
+  /**
+    Scrolls the browser so the middle item in the browser
+    is showing the specified \p line.
+    \param[in] line The line to be displayed in the middle.
+    \see topline(), middleline(), bottomline(), displayed(), lineposition()
+   */
+  void middleline(int line) { lineposition(line, MIDDLE); }
+
+  int select(int line, int val=1);
+  int selected(int line) const ;
+  void show(int line);
+  /** Shows the entire Fl_Browser widget -- opposite of hide(). */
+  void show() { Fl_Widget::show(); }
+  void hide(int line);
+  /** Hides the entire Fl_Browser widget -- opposite of show(). */
+  void hide() { Fl_Widget::hide(); }
+  int visible(int line) const ;
+
+  int value() const ;
+  /**
+    Sets the browser's value(), which selects the specified \p line.
+    This is the same as calling select(line).
+    \see select(), selected(), value(), item_select(), item_selected()
+   */
+  void value(int line) { select(line); }
+  const char* text(int line) const ;
+  void text(int line, const char* newtext);
+  void* data(int line) const ;
+  void data(int line, void* d);
+  int lineno_for_data(void *data) const ;
+
+  Fl_Browser(int X, int Y, int W, int H, const char *L = 0);
+  /**
+    The destructor deletes all list items and destroys the browser.
+   */
+  ~Fl_Browser();
+
+  /**
+    Gets the current format code prefix character, which by default is '\@'.
+    A string of formatting codes at the start of each column are stripped off
+    and used to modify how the rest of the line is printed:
+    
+    \li <tt>'\@.'</tt> Print rest of line, don't look for more '\@' signs
+    \li <tt>'\@\@'</tt> Print rest of line starting with '\@'
+    \li <tt>'\@l'</tt> Use a LARGE (24 point) font
+    \li <tt>'\@m'</tt> Use a medium large (18 point) font
+    \li <tt>'\@s'</tt> Use a <SMALL>small</SMALL> (11 point) font
+    \li <tt>'\@b'</tt> Use a <B>bold</B> font (adds FL_BOLD to font)
+    \li <tt>'\@i'</tt> Use an <I>italic</I> font (adds FL_ITALIC to font)
+    \li <tt>'\@f' or '\@t'</tt> Use a fixed-pitch
+    font (sets font to FL_COURIER)
+    \li <tt>'\@c'</tt> Center the line horizontally
+    \li <tt>'\@r'</tt> Right-justify the text
+    \li <tt>'\@B0', '\@B1', ... '\@B255'</tt> Fill the backgound with
+    fl_color(n)
+    \li <tt>'\@C0', '\@C1', ... '\@C255'</tt> Use fl_color(n) to draw the text
+    \li <tt>'\@F0', '\@F1', ...</tt> Use fl_font(n) to draw the text
+    \li <tt>'\@S1', '\@S2', ...</tt> Use point size n to draw the text
+    \li <tt>'\@u' or '\@_'</tt> Underline the text.
+    \li <tt>'\@-'</tt> draw an engraved line through the middle.
+
+    Notice that the '\@.' command can be used to reliably
+    terminate the parsing.  To print a random string in a random color, use 
+    <tt>sprintf("@C%d@.%s", color, string)</tt> and it will work even if the
+    string starts with a digit or has the format character in it.
+  */
+  char format_char() const { return format_char_; }
+  /**
+    Sets the current format code prefix character to \p c.
+    The default prefix is '\@'.  Set the prefix to 0 to disable formatting.
+    \see format_char() for list of '\@' codes
+  */
+  void format_char(char c) { format_char_ = c; }
+  /**
+    Gets the current column separator character.
+    The default is '\\t' (tab).
+    \see column_char(), column_widths()
+  */
+  char column_char() const { return column_char_; }
+  /**
+    Sets the column separator to c.
+    This will only have an effect if you also set column_widths().
+    The default is '\\t' (tab).
+    \see column_char(), column_widths()
+  */
+  void column_char(char c) { column_char_ = c; }
+  /**
+    Gets the current column width array.
+    This array is zero-terminated and specifies the widths in pixels of
+    each column. The text is split at each column_char() and each part is
+    formatted into it's own column.  After the last column any remaining
+    text is formatted into the space between the last column and the
+    right edge of the browser, even if the text contains instances of
+    column_char() .  The default value is a one-element array of just
+    a zero, which means there are no columns.
+
+    Example:
+    \code
+  Fl_Browser *b = new Fl_Browser(..);
   static int widths[] = { 50, 50, 50, 70, 70, 40, 40, 70, 70, 50, 0 };  // widths for each column
-  b->column_widths(widths); // assign array to widget
-  b->column_char('\t');     // use tab as the column character
-  b->add("USER\tPID\tCPU\tMEM\tVSZ\tRSS\tTTY\tSTAT\tSTART\tTIME\tCOMMAND");
-  b->add("root\t2888\t0.0\t0.0\t1352\t0\ttty3\tSW\tAug15\t0:00\t@b@f/sbin/mingetty tty3");
-  b->add("root\t13115\t0.0\t0.0\t1352\t0\ttty2\tSW\tAug30\t0:00\t@b@f/sbin/mingetty tty2");
-  [..]
-    \endcode
-    \see column_char(), column_widths()
-  */
-  const int* column_widths() const { return column_widths_; }
-  int* column_widths_owned() { return column_widths_owned_; }
-  /**
-    Sets the current array to \p arr.  Make sure the last entry is zero.
-    \see column_char(), column_widths()
-  */
-  void column_widths(const int* arr) { column_widths_ = arr; }
-  void column_widths_owned(int* arr) { column_widths_owned_ = arr; column_widths_ = arr;}
-
-  /**
-    Returns non-zero if \p line has been scrolled to a position where it is being displayed.
-    Checks to see if the item's vertical position is within the top and bottom
-    edges of the display window. This does NOT take into account the hide()/show()
-    status of the widget or item.
-    \param[in] line The line to be checked
-    \returns 1 if visible, 0 if not visible.
-    \see topline(), middleline(), bottomline(), displayed(), lineposition()
-  */
-  int displayed(int line) const { return Fl_Browser_::displayed(find_line(line)); }
-
-  /**
-    Make the item at the specified \p line visible().
-    Functionally similar to show(int line).
-    If \p line is out of range, redisplay top or bottom of list as appropriate.
-    \param[in] line The line to be made visible.
-    \see show(int), hide(int), display(), visible(), make_visible()
-  */
-  void make_visible(int line) {
-    if (line < 1) Fl_Browser_::display(find_line(1));
-    else if (line > lines) Fl_Browser_::display(find_line(lines));
-    else Fl_Browser_::display(find_line(line));
-  }
-
-  // icon support
-  void icon(int line, Fl_Image* icon);
-  Fl_Image* icon(int line) const;
-  void remove_icon(int line);
-
-  /** For back compatibility only. */
-  void replace(int a, const char* b) { text(a, b); }
-  void display(int line, int val=1);
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_Browser, Fl_Browser_)
-};
-
-#endif
-
-//
-// End of "$Id: Fl_Browser.H 9682 2012-09-17 22:44:54Z greg.ercolano $".
-//
+  b->column_widths(widths); // assign array to widget
+  b->column_char('\t');     // use tab as the column character
+  b->add("USER\tPID\tCPU\tMEM\tVSZ\tRSS\tTTY\tSTAT\tSTART\tTIME\tCOMMAND");
+  b->add("root\t2888\t0.0\t0.0\t1352\t0\ttty3\tSW\tAug15\t0:00\t@b@f/sbin/mingetty tty3");
+  b->add("root\t13115\t0.0\t0.0\t1352\t0\ttty2\tSW\tAug30\t0:00\t@b@f/sbin/mingetty tty2");
+  [..]
+    \endcode
+    \see column_char(), column_widths()
+  */
+  const int* column_widths() const { return column_widths_; }
+  int* column_widths_owned() { return column_widths_owned_; }
+  /**
+    Sets the current array to \p arr.  Make sure the last entry is zero.
+    \see column_char(), column_widths()
+  */
+  void column_widths(const int* arr) { column_widths_ = arr; }
+  void column_widths_owned(int* arr) { column_widths_owned_ = arr; column_widths_ = arr;}
+
+  /**
+    Returns non-zero if \p line has been scrolled to a position where it is being displayed.
+    Checks to see if the item's vertical position is within the top and bottom
+    edges of the display window. This does NOT take into account the hide()/show()
+    status of the widget or item.
+    \param[in] line The line to be checked
+    \returns 1 if visible, 0 if not visible.
+    \see topline(), middleline(), bottomline(), displayed(), lineposition()
+  */
+  int displayed(int line) const { return Fl_Browser_::displayed(find_line(line)); }
+
+  /**
+    Make the item at the specified \p line visible().
+    Functionally similar to show(int line).
+    If \p line is out of range, redisplay top or bottom of list as appropriate.
+    \param[in] line The line to be made visible.
+    \see show(int), hide(int), display(), visible(), make_visible()
+  */
+  void make_visible(int line) {
+    if (line < 1) Fl_Browser_::display(find_line(1));
+    else if (line > lines) Fl_Browser_::display(find_line(lines));
+    else Fl_Browser_::display(find_line(line));
+  }
+
+  // icon support
+  void icon(int line, Fl_Image* icon);
+  Fl_Image* icon(int line) const;
+  void remove_icon(int line);
+
+  /** For back compatibility only. */
+  void replace(int a, const char* b) { text(a, b); }
+  void display(int line, int val=1);
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_Browser, Fl_Browser_)
+};
+
+#endif
+
+//
+// End of "$Id: Fl_Browser.H 11465 2016-03-29 11:54:44Z AlbrechtS $".
+//

+ 374 - 374
fltk/FL/Fl_Browser_.H

@@ -1,62 +1,63 @@
-//
-// "$Id: Fl_Browser_.H 9846 2013-03-23 21:24:18Z greg.ercolano $"
-//
-// Common browser header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_Browser_ widget . */
-
-// Yes, I know this should be a template...
-
-#ifndef Fl_Browser__H
-#define Fl_Browser__H
-
-#ifndef Fl_Group_H
-#include "Fl_Group.H"
-#endif
-#include "Fl_Scrollbar.H"
-#include <FL/Fl.H>		// Fl::scrollbar_size()
-
-#define FL_NORMAL_BROWSER	0	/**< type() of Fl_Browser */
-#define FL_SELECT_BROWSER	1	/**< type() of FL_Select_Browser */
-#define FL_HOLD_BROWSER		2	/**< type() of Fl_Hold_Browser */
-#define FL_MULTI_BROWSER	3	/**< type() of Fl_Multi_Browser */
-
-#define FL_SORT_ASCENDING	0	/**< sort browser items in ascending alphabetic order. */
-#define FL_SORT_DESCENDING	1	/**< sort in descending order */
-
-/**
-  This is the base class for browsers.  To be useful it must be
-  subclassed and several virtual functions defined.  The Forms-compatible
-  browser and the file chooser's browser are subclassed off of this.
-
-  This has been designed so that the subclass has complete control
-  over the storage of the data, although because next() and 
-  prev() functions are used to index, it works best as a linked list
-  or as a large block of characters in which the line breaks must be
-  searched for.
-
-  A great deal of work has been done so that the "height" of a data
-  object does not need to be determined until it is drawn.  This is
-  useful if actually figuring out the size of an object requires
-  accessing image data or doing stat() on a file or doing some
-  other slow operation.
-
-  Keyboard navigation of browser items
-  ------------------------------------
+//
+// "$Id: Fl_Browser_.H 12459 2017-09-14 00:50:36Z greg.ercolano $"
+//
+// Common browser header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2016 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_Browser_ widget . */
+
+// Yes, I know this should be a template...
+
+#ifndef Fl_Browser__H
+#define Fl_Browser__H
+
+#ifndef Fl_Group_H
+#include "Fl_Group.H"
+#endif
+#include "Fl_Scrollbar.H"
+#include <FL/Fl.H>		// Fl::scrollbar_size()
+
+#define FL_NORMAL_BROWSER	0	/**< type() of Fl_Browser */
+#define FL_SELECT_BROWSER	1	/**< type() of FL_Select_Browser */
+#define FL_HOLD_BROWSER		2	/**< type() of Fl_Hold_Browser */
+#define FL_MULTI_BROWSER	3	/**< type() of Fl_Multi_Browser */
+
+#define FL_SORT_ASCENDING	0	/**< sort browser items in ascending alphabetic order. */
+#define FL_SORT_DESCENDING	1	/**< sort in descending order */
+
+/**
+  This is the base class for browsers.  To be useful it must be
+  subclassed and several virtual functions defined.  The Forms-compatible
+  browser and the file chooser's browser are subclassed off of this.
+
+  This has been designed so that the subclass has complete control
+  over the storage of the data, although because next() and 
+  prev() functions are used to index, it works best as a linked list
+  or as a large block of characters in which the line breaks must be
+  searched for.
+
+  A great deal of work has been done so that the "height" of a data
+  object does not need to be determined until it is drawn.  This is
+  useful if actually figuring out the size of an object requires
+  accessing image data or doing stat() on a file or doing some
+  other slow operation.
+
+Keyboard navigation of browser items
+------------------------------------
+
   The keyboard navigation of browser items is only possible if
   visible_focus() is enabled. If disabled, the widget rejects keyboard focus;
   Tab and Shift-Tab focus navigation will skip the widget.
@@ -73,318 +74,317 @@
   (or Ctrl) is combined with Up/Down arrow keys, the current item's
   selection state is extended to the next item. In this way one can
   extend a selection or de-selection.
-*/
-class FL_EXPORT Fl_Browser_ : public Fl_Group {
-  int position_;	// where user wants it scrolled to
-  int real_position_;	// the current vertical scrolling position
-  int hposition_;	// where user wants it panned to
-  int real_hposition_;	// the current horizontal scrolling position
-  int offset_;		// how far down top_ item the real_position is
-  int max_width;	// widest object seen so far
-  uchar has_scrollbar_;	// which scrollbars are enabled
-  Fl_Font textfont_;
-  Fl_Fontsize textsize_;
-  Fl_Color textcolor_;
-  void* top_;		// which item scrolling position is in
-  void* selection_;	// which is selected (except for FL_MULTI_BROWSER)
-  void *redraw1,*redraw2; // minimal update pointers
-  void* max_width_item;	// which item has max_width_
-  int scrollbar_size_;	// size of scrollbar trough
-
-  void update_top();
-
-protected:
-
-  // All of the following must be supplied by the subclass:
-  /**
-    This method must be provided by the subclass 
-    to return the first item in the list.
-    \see item_first(), item_next(), item_last(), item_prev()
-   */
-  virtual void *item_first() const = 0;
-  /**
-    This method must be provided by the subclass
-    to return the item in the list after \p item.
-    \see item_first(), item_next(), item_last(), item_prev()
-   */
-  virtual void *item_next(void *item) const = 0;
-  /**
-    This method must be provided by the subclass
-    to return the item in the list before \p item.
-    \see item_first(), item_next(), item_last(), item_prev()
-   */
-  virtual void *item_prev(void *item) const = 0;
-  /**
-    This method must be provided by the subclass
-    to return the last item in the list.
-    \see item_first(), item_next(), item_last(), item_prev()
-   */
-  virtual void *item_last() const { return 0L; }
-  /** 
-    This method must be provided by the subclass to return 
-    the height of \p item in pixels.
-    Allow for two additional pixels for the list selection box.
-    \param[in] item The item whose height is returned.
-    \returns The height of the specified \p item in pixels.
-    \see item_height(), item_width(), item_quick_height()
-  */
-  virtual int item_height(void *item) const = 0;
-  /**
-    This method must be provided by the subclass to return the width of the
-    \p item in pixels.  Allow for two additional pixels for the list
-    selection box.
-    \param[in] item The item whose width is returned.
-    \returns The width of the item in pixels.
-  */
-  virtual int item_width(void *item) const = 0;
-  virtual int item_quick_height(void *item) const ;
-  /**
-    This method must be provided by the subclass to draw the \p item
-    in the area indicated by \p X, \p Y, \p W, \p H.
-  */
-  virtual void item_draw(void *item,int X,int Y,int W,int H) const = 0;
-  /**
-    This optional method returns a string (label) that may be used for sorting. 
-    \param[in] item The item whose label text is returned.
-    \returns The item's text label. (Can be NULL if blank)
-   */
-  virtual const char *item_text(void *item) const { (void)item; return 0L; }
-  /**
-    This optional method should be provided by the subclass 
-    to efficiently swap browser items \p a and \p b, such as for sorting.
-    \param[in] a,b The two items to be swapped.
-   */
-  virtual void item_swap(void *a,void *b) { (void)a; (void)b; }
-  /**
-    This method must be provided by the subclass 
-    to return the item for the specified \p index. 
-    \param[in] index The \p index of the item to be returned
-    \returns The item at the specified \p index.
-   */
-  virtual void *item_at(int index) const { (void)index; return 0L; }
-  // you don't have to provide these but it may help speed it up:
-  virtual int full_width() const ;	// current width of all items
-  virtual int full_height() const ;	// current height of all items
-  virtual int incr_height() const ;	// average height of an item
-  // These only need to be done by subclass if you want a multi-browser:
-  virtual void item_select(void *item,int val=1);
-  virtual int item_selected(void *item) const ;
-
-  // things the subclass may want to call:
-  /**
-    Returns the item that appears at the top of the list.
-   */
-  void *top() const { return top_; }
-  /**
-    Returns the item currently selected, or NULL if there is no selection.
-    
-    For multiple selection browsers this call returns the currently focused item,
-    even if it is not selected. To find all selected items, call 
-    Fl_Multi_Browser::selected() for every item in question.
-  */
-  void *selection() const { return selection_; }
-  void new_list(); // completely clobber all data, as though list replaced
-  void deleting(void *item); // get rid of any pointers to item
-  void replacing(void *a,void *b); // change a pointers to b
-  void swapping(void *a,void *b); // exchange pointers a and b
-  void inserting(void *a,void *b); // insert b near a
-  int displayed(void *item) const ; // true if this item is visible
-  void redraw_line(void *item); // minimal update, no change in size
-  /**
-    This method will cause the entire list to be redrawn.
-    \see redraw_lines(), redraw_line()
-   */
-  void redraw_lines() { damage(FL_DAMAGE_SCROLL); } // redraw all of them
-  void bbox(int &X,int &Y,int &W,int &H) const;
-  int leftedge() const;	// x position after scrollbar & border
-  void *find_item(int ypos); // item under mouse
-  
-  void draw();
-  Fl_Browser_(int X,int Y,int W,int H,const char *L=0);
-
-public:
-
-  /**
-    Vertical scrollbar. Public, so that it can be accessed directly.
-   */
-  Fl_Scrollbar scrollbar;
-  /**
-    Horizontal scrollbar. Public, so that it can be accessed directly.
-   */
-  Fl_Scrollbar hscrollbar;
-
-  int handle(int event);
-  void resize(int X,int Y,int W,int H);
-
-  int select(void *item,int val=1,int docallbacks=0);
-  int select_only(void *item,int docallbacks=0);
-  int deselect(int docallbacks=0);
-  /**
-    Gets the vertical scroll position of the list as a pixel position \p pos.
-    The position returned is how many pixels of the list are scrolled off the top edge
-    of the screen.  Example: A position of '3' indicates the top 3 pixels of 
-    the list are scrolled off the top edge of the screen.
-    \see position(), hposition()
-  */
-  int position() const { return position_; }
-  void position(int pos); // scroll to here
-  /**
-    Gets the horizontal scroll position of the list as a pixel position \p pos.
-    The position returned is how many pixels of the list are scrolled off the left edge
-    of the screen. Example: A position of '18' indicates the left 18 pixels of
-    the list are scrolled off the left edge of the screen.
-    \see position(), hposition()
-  */
-  int hposition() const { return hposition_; }
-  void hposition(int); // pan to here
-  void display(void *item); // scroll so this item is shown
-
-  /**
-    Values for has_scrollbar().
-   */
-  /** Anonymous enum bit flags for has_scrollbar().
-     -  bit 0: horizontal
-     -  bit 1: vertical
-     -  bit 2: 'always' (to be combined with bits 0 and 1)
-     -  bit 3-31: reserved for future use
-   */
-  enum { // values for has_scrollbar()
-    HORIZONTAL = 1,		///< Only show horizontal scrollbar.
-    VERTICAL = 2,		///< Only show vertical scrollbar.
-    BOTH = 3,			///< Show both scrollbars. (default)
-    ALWAYS_ON = 4,		///< Specified scrollbar(s) should 'always' be shown (to be used with HORIZONTAL/VERTICAL)
-    HORIZONTAL_ALWAYS = 5,	///< Horizontal scrollbar always on.
-    VERTICAL_ALWAYS = 6,	///< Vertical scrollbar always on.
-    BOTH_ALWAYS = 7		///< Both scrollbars always on.
-  };
-  /**
-    Returns the current scrollbar mode, see Fl_Browser_::has_scrollbar(uchar)
-   */
-  uchar has_scrollbar() const { return has_scrollbar_; }
-  /**
-    Sets whether the widget should have scrollbars or not (default Fl_Browser_::BOTH).
-    By default you can scroll in both directions, and the scrollbars
-    disappear if the data will fit in the widget.  
-    has_scrollbar() changes this based on the value of \p mode:
-  
-    - 0 - No scrollbars.
-
-    - Fl_Browser_::HORIZONTAL - Only a horizontal scrollbar.
-
-    - Fl_Browser_::VERTICAL - Only a vertical scrollbar.
-
-    - Fl_Browser_::BOTH - The default is both scrollbars.
-
-    - Fl_Browser_::HORIZONTAL_ALWAYS - Horizontal scrollbar always on,
-      vertical always off.
-
-    - Fl_Browser_::VERTICAL_ALWAYS - Vertical scrollbar always on,
-      horizontal always off.
-
-    - Fl_Browser_::BOTH_ALWAYS - Both always on.
-  */
-  void has_scrollbar(uchar mode) { has_scrollbar_ = mode; }
-
-  /**
-    Gets the default text font for the lines in the browser.
-    \see textfont(), textsize(), textcolor()
-  */
-  Fl_Font textfont() const { return textfont_; }
-  /**
-    Sets the default text font for the lines in the browser to \p font.
-  */
-  void textfont(Fl_Font font) { textfont_ = font; }
-
-  /**
-    Gets the default text size (in pixels) for the lines in the browser.
-  */
-  Fl_Fontsize textsize() const { return textsize_; }
-  /**
-    Sets the default text size (in pixels) for the lines in the browser to \p size.
-  */
-  void textsize(Fl_Fontsize newSize) { textsize_ = newSize; }
-
-  /**
-    Gets the default text color for the lines in the browser.
-  */
-  Fl_Color textcolor() const { return textcolor_; }
-  /**
-    Sets the default text color for the lines in the browser to color \p col.
-  */
-  void textcolor(Fl_Color col) { textcolor_ = col; }
-
-  /**
-    Gets the current size of the scrollbars' troughs, in pixels.
-
-    If this value is zero (default), this widget will use the 
-    Fl::scrollbar_size() value as the scrollbar's width.
-  
-    \returns Scrollbar size in pixels, or 0 if the global Fl::scrollsize() is being used.
-    \see Fl::scrollbar_size(int)
-  */
-  int scrollbar_size() const {
-      return(scrollbar_size_);
-  }
-  /**
-    Sets the pixel size of the scrollbars' troughs to \p newSize, in pixels.
-
-    Normally you should not need this method, and should use
-    Fl::scrollbar_size(int) instead to manage the size of ALL 
-    your widgets' scrollbars. This ensures your application 
-    has a consistent UI, is the default behavior, and is normally
-    what you want.
-
-    Only use THIS method if you really need to override the global
-    scrollbar size. The need for this should be rare.
-    
-    Setting \p newSize to the special value of 0 causes the widget to
-    track the global Fl::scrollbar_size(), which is the default.
-    
-    \param[in] newSize Sets the scrollbar size in pixels.\n
-                    If 0 (default), scrollbar size tracks the global Fl::scrollbar_size()
-    \see Fl::scrollbar_size()
-  */
-  void scrollbar_size(int newSize) {
-      scrollbar_size_ = newSize;
-  }   
-  /**
-    This method has been deprecated, existing for backwards compatibility only.
-    Use scrollbar_size() instead.
-    This method always returns the global value Fl::scrollbar_size().
-    \returns Always returns the global value Fl::scrollbar_size().
-    \todo This method should eventually be removed in 1.4+
-  */
-  int scrollbar_width() const {
-      return(Fl::scrollbar_size());
-  }
-  /**
-    This method has been deprecated, existing for backwards compatibility only.
-    Use scrollbar_size(int) instead.
-    This method sets the global Fl::scrollbar_size(), and forces this
-    instance of the widget to use it.
-    \todo This method should eventually be removed in 1.4+
-  */
-  void scrollbar_width(int width) {
-      Fl::scrollbar_size(width);
-      scrollbar_size_ = 0;
-  }
-  /**
-    Moves the vertical scrollbar to the righthand side of the list.
-    For back compatibility.
-  */
-  void scrollbar_right() { scrollbar.align(FL_ALIGN_RIGHT); }
-  /**
-    Moves the vertical scrollbar to the lefthand side of the list.
-    For back compatibility.
-  */
-  void scrollbar_left() { scrollbar.align(FL_ALIGN_LEFT); }
-  void sort(int flags=0);
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_Browser_, Fl_Group)
-};
-
-#endif
-
-//
-// End of "$Id: Fl_Browser_.H 9846 2013-03-23 21:24:18Z greg.ercolano $".
-//
+*/
+class FL_EXPORT Fl_Browser_ : public Fl_Group {
+  int position_;	// where user wants it scrolled to
+  int real_position_;	// the current vertical scrolling position
+  int hposition_;	// where user wants it panned to
+  int real_hposition_;	// the current horizontal scrolling position
+  int offset_;		// how far down top_ item the real_position is
+  int max_width;	// widest object seen so far
+  uchar has_scrollbar_;	// which scrollbars are enabled
+  Fl_Font textfont_;
+  Fl_Fontsize textsize_;
+  Fl_Color textcolor_;
+  void* top_;		// which item scrolling position is in
+  void* selection_;	// which is selected (except for FL_MULTI_BROWSER)
+  void *redraw1,*redraw2; // minimal update pointers
+  void* max_width_item;	// which item has max_width_
+  int scrollbar_size_;	// size of scrollbar trough
+
+  void update_top();
+
+protected:
+
+  // All of the following must be supplied by the subclass:
+  /**
+    This method must be provided by the subclass 
+    to return the first item in the list.
+    \see item_first(), item_next(), item_last(), item_prev()
+   */
+  virtual void *item_first() const = 0;
+  /**
+    This method must be provided by the subclass
+    to return the item in the list after \p item.
+    \see item_first(), item_next(), item_last(), item_prev()
+   */
+  virtual void *item_next(void *item) const = 0;
+  /**
+    This method must be provided by the subclass
+    to return the item in the list before \p item.
+    \see item_first(), item_next(), item_last(), item_prev()
+   */
+  virtual void *item_prev(void *item) const = 0;
+  /**
+    This method must be provided by the subclass
+    to return the last item in the list.
+    \see item_first(), item_next(), item_last(), item_prev()
+   */
+  virtual void *item_last() const { return 0L; }
+  /** 
+    This method must be provided by the subclass to return 
+    the height of \p item in pixels.
+    Allow for two additional pixels for the list selection box.
+    \param[in] item The item whose height is returned.
+    \returns The height of the specified \p item in pixels.
+    \see item_height(), item_width(), item_quick_height()
+  */
+  virtual int item_height(void *item) const = 0;
+  /**
+    This method must be provided by the subclass to return the width of the
+    \p item in pixels.  Allow for two additional pixels for the list
+    selection box.
+    \param[in] item The item whose width is returned.
+    \returns The width of the item in pixels.
+  */
+  virtual int item_width(void *item) const = 0;
+  virtual int item_quick_height(void *item) const ;
+  /**
+    This method must be provided by the subclass to draw the \p item
+    in the area indicated by \p X, \p Y, \p W, \p H.
+  */
+  virtual void item_draw(void *item,int X,int Y,int W,int H) const = 0;
+  /**
+    This optional method returns a string (label) that may be used for sorting. 
+    \param[in] item The item whose label text is returned.
+    \returns The item's text label. (Can be NULL if blank)
+   */
+  virtual const char *item_text(void *item) const { (void)item; return 0L; }
+  /**
+    This optional method should be provided by the subclass 
+    to efficiently swap browser items \p a and \p b, such as for sorting.
+    \param[in] a,b The two items to be swapped.
+   */
+  virtual void item_swap(void *a,void *b) { (void)a; (void)b; }
+  /**
+    This method must be provided by the subclass 
+    to return the item for the specified \p index. 
+    \param[in] index The \p index of the item to be returned
+    \returns The item at the specified \p index.
+   */
+  virtual void *item_at(int index) const { (void)index; return 0L; }
+  // you don't have to provide these but it may help speed it up:
+  virtual int full_width() const ;	// current width of all items
+  virtual int full_height() const ;	// current height of all items
+  virtual int incr_height() const ;	// average height of an item
+  // These only need to be done by subclass if you want a multi-browser:
+  virtual void item_select(void *item,int val=1);
+  virtual int item_selected(void *item) const ;
+
+  // things the subclass may want to call:
+  /**
+    Returns the item that appears at the top of the list.
+   */
+  void *top() const { return top_; }
+  /**
+    Returns the item currently selected, or NULL if there is no selection.
+    
+    For multiple selection browsers this call returns the currently focused item,
+    even if it is not selected. To find all selected items, call 
+    Fl_Multi_Browser::selected() for every item in question.
+  */
+  void *selection() const { return selection_; }
+  void new_list(); // completely clobber all data, as though list replaced
+  void deleting(void *item); // get rid of any pointers to item
+  void replacing(void *a,void *b); // change a pointers to b
+  void swapping(void *a,void *b); // exchange pointers a and b
+  void inserting(void *a,void *b); // insert b near a
+  int displayed(void *item) const ; // true if this item is visible
+  void redraw_line(void *item); // minimal update, no change in size
+  /**
+    This method will cause the entire list to be redrawn.
+    \see redraw_lines(), redraw_line()
+   */
+  void redraw_lines() { damage(FL_DAMAGE_SCROLL); } // redraw all of them
+  void bbox(int &X,int &Y,int &W,int &H) const;
+  int leftedge() const;	// x position after scrollbar & border
+  void *find_item(int ypos); // item under mouse
+  
+  void draw();
+  Fl_Browser_(int X,int Y,int W,int H,const char *L=0);
+
+public:
+
+  /**
+    Vertical scrollbar. Public, so that it can be accessed directly.
+   */
+  Fl_Scrollbar scrollbar;
+  /**
+    Horizontal scrollbar. Public, so that it can be accessed directly.
+   */
+  Fl_Scrollbar hscrollbar;
+
+  int handle(int event);
+  void resize(int X,int Y,int W,int H);
+
+  int select(void *item,int val=1,int docallbacks=0);
+  int select_only(void *item,int docallbacks=0);
+  int deselect(int docallbacks=0);
+  /**
+    Gets the vertical scroll position of the list as a pixel position \p pos.
+    The position returned is how many pixels of the list are scrolled off the top edge
+    of the screen.  Example: A position of '3' indicates the top 3 pixels of 
+    the list are scrolled off the top edge of the screen.
+    \see position(), hposition()
+  */
+  int position() const { return position_; }
+  void position(int pos); // scroll to here
+  /**
+    Gets the horizontal scroll position of the list as a pixel position \p pos.
+    The position returned is how many pixels of the list are scrolled off the left edge
+    of the screen. Example: A position of '18' indicates the left 18 pixels of
+    the list are scrolled off the left edge of the screen.
+    \see position(), hposition()
+  */
+  int hposition() const { return hposition_; }
+  void hposition(int); // pan to here
+  void display(void *item); // scroll so this item is shown
+
+  /**
+    Values for has_scrollbar().
+   */
+  /** Anonymous enum bit flags for has_scrollbar().
+     -  bit 0: horizontal
+     -  bit 1: vertical
+     -  bit 2: 'always' (to be combined with bits 0 and 1)
+     -  bit 3-31: reserved for future use
+   */
+  enum { // values for has_scrollbar()
+    HORIZONTAL = 1,		///< Only show horizontal scrollbar.
+    VERTICAL = 2,		///< Only show vertical scrollbar.
+    BOTH = 3,			///< Show both scrollbars. (default)
+    ALWAYS_ON = 4,		///< Specified scrollbar(s) should 'always' be shown (to be used with HORIZONTAL/VERTICAL)
+    HORIZONTAL_ALWAYS = 5,	///< Horizontal scrollbar always on.
+    VERTICAL_ALWAYS = 6,	///< Vertical scrollbar always on.
+    BOTH_ALWAYS = 7		///< Both scrollbars always on.
+  };
+  /**
+    Returns the current scrollbar mode, see Fl_Browser_::has_scrollbar(uchar)
+   */
+  uchar has_scrollbar() const { return has_scrollbar_; }
+  /**
+    Sets whether the widget should have scrollbars or not (default Fl_Browser_::BOTH).
+    By default you can scroll in both directions, and the scrollbars
+    disappear if the data will fit in the widget.  
+    has_scrollbar() changes this based on the value of \p mode:
+  
+    - 0 - No scrollbars.
+
+    - Fl_Browser_::HORIZONTAL - Only a horizontal scrollbar.
+
+    - Fl_Browser_::VERTICAL - Only a vertical scrollbar.
+
+    - Fl_Browser_::BOTH - The default is both scrollbars.
+
+    - Fl_Browser_::HORIZONTAL_ALWAYS - Horizontal scrollbar always on,
+      vertical always off.
+
+    - Fl_Browser_::VERTICAL_ALWAYS - Vertical scrollbar always on,
+      horizontal always off.
+
+    - Fl_Browser_::BOTH_ALWAYS - Both always on.
+  */
+  void has_scrollbar(uchar mode) { has_scrollbar_ = mode; }
+
+  /**
+    Gets the default text font for the lines in the browser.
+    \see textfont(), textsize(), textcolor()
+  */
+  Fl_Font textfont() const { return textfont_; }
+  /**
+    Sets the default text font for the lines in the browser to \p font.
+  */
+  void textfont(Fl_Font font) { textfont_ = font; }
+
+  /**
+    Gets the default text size (in pixels) for the lines in the browser.
+  */
+  Fl_Fontsize textsize() const { return textsize_; }
+  /**
+    Sets the default text size (in pixels) for the lines in the browser to \p size.
+  */
+  void textsize(Fl_Fontsize newSize) { textsize_ = newSize; }
+
+  /**
+    Gets the default text color for the lines in the browser.
+  */
+  Fl_Color textcolor() const { return textcolor_; }
+  /**
+    Sets the default text color for the lines in the browser to color \p col.
+  */
+  void textcolor(Fl_Color col) { textcolor_ = col; }
+
+  /**
+    Gets the current size of the scrollbars' troughs, in pixels.
+
+    If this value is zero (default), this widget will use the 
+    Fl::scrollbar_size() value as the scrollbar's width.
+  
+    \returns Scrollbar size in pixels, or 0 if the global Fl::scrollbar_size() is being used.
+    \see Fl::scrollbar_size(int)
+  */
+  int scrollbar_size() const {
+      return(scrollbar_size_);
+  }
+  /**
+    Sets the pixel size of the scrollbars' troughs to \p newSize, in pixels.
+
+    Normally you should not need this method, and should use
+    Fl::scrollbar_size(int) instead to manage the size of ALL 
+    your widgets' scrollbars. This ensures your application 
+    has a consistent UI, is the default behavior, and is normally
+    what you want.
+
+    Only use THIS method if you really need to override the global
+    scrollbar size. The need for this should be rare.
+    
+    Setting \p newSize to the special value of 0 causes the widget to
+    track the global Fl::scrollbar_size(), which is the default.
+    
+    \param[in] newSize Sets the scrollbar size in pixels.\n
+                    If 0 (default), scrollbar size tracks the global Fl::scrollbar_size()
+    \see Fl::scrollbar_size()
+  */
+  void scrollbar_size(int newSize) {
+      scrollbar_size_ = newSize;
+  }   
+  /**
+    This method has been deprecated, existing for backwards compatibility only.
+    Use scrollbar_size() instead.
+    This method always returns the global value Fl::scrollbar_size().
+    \returns Always returns the global value Fl::scrollbar_size().
+    \todo This method should eventually be removed in 1.4+
+  */
+  int scrollbar_width() const {
+      return(Fl::scrollbar_size());
+  }
+  /**
+    This method has been deprecated, existing for backwards compatibility only.
+    Use scrollbar_size(int) instead.
+    This method sets the global Fl::scrollbar_size(), and forces this
+    instance of the widget to use it.
+    \todo This method should eventually be removed in 1.4+
+  */
+  void scrollbar_width(int width) {
+      Fl::scrollbar_size(width);
+      scrollbar_size_ = 0;
+  }
+  /**
+    Moves the vertical scrollbar to the righthand side of the list.
+    For back compatibility.
+  */
+  void scrollbar_right() { scrollbar.align(FL_ALIGN_RIGHT); }
+  /**
+    Moves the vertical scrollbar to the lefthand side of the list.
+    For back compatibility.
+  */
+  void scrollbar_left() { scrollbar.align(FL_ALIGN_LEFT); }
+  void sort(int flags=0);
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_Browser_, Fl_Group)
+};
+
+#endif
+
+//
+// End of "$Id: Fl_Browser_.H 12459 2017-09-14 00:50:36Z greg.ercolano $".
+//

+ 180 - 173
fltk/FL/Fl_Button.H

@@ -1,173 +1,180 @@
-//
-// "$Id: Fl_Button.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
-//
-// Button header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_Button widget . */
-
-#ifndef Fl_Button_H
-#define Fl_Button_H
-
-#ifndef Fl_Widget_H
-#include "Fl_Widget.H"
-#endif
-
-// values for type()
-#define FL_NORMAL_BUTTON	0   /**< value() will be set to 1 during the press of the button and 
-                                         reverts back to 0 when the button is released */
-#define FL_TOGGLE_BUTTON	1   ///< value() toggles between 0 and 1 at every click of the button
-#define FL_RADIO_BUTTON		(FL_RESERVED_TYPE+2) /**< is set to 1 at button press, and all other
-				         buttons in the same group with <tt>type() == FL_RADIO_BUTTON</tt>
-				         are set to zero.*/
-#define FL_HIDDEN_BUTTON	3   ///< for Forms compatibility
-
-extern FL_EXPORT Fl_Shortcut fl_old_shortcut(const char*);
-
-class Fl_Widget_Tracker;
-
-/**
-  \class Fl_Button
-  \brief Buttons generate callbacks when they are clicked by the user.
-  
-  You control exactly when and how by changing the values for type() and
-  when().  Buttons can also generate callbacks in response to \c FL_SHORTCUT
-  events.  The button can either have an explicit shortcut(int s) value or a
-  letter shortcut can be indicated in the label() with an '\&' character
-  before it.  For the label shortcut it does not matter if \e Alt is held
-  down, but if you have an input field in the same window, the user will have
-  to hold down the \e Alt key so that the input field does not eat the event
-  first as an \c FL_KEYBOARD event.
-
-  \todo Refactor the doxygen comments for Fl_Button type() documentation.
-
-  For an Fl_Button object, the type() call returns one of:
-  \li \c FL_NORMAL_BUTTON (0): value() remains unchanged after button press.
-  \li \c FL_TOGGLE_BUTTON: value() is inverted after button press.
-  \li \c FL_RADIO_BUTTON: value() is set to 1 after button press, and all other
-         buttons in the current group with <tt>type() == FL_RADIO_BUTTON</tt>
-	 are set to zero.
-
-  \todo Refactor the doxygen comments for Fl_Button when() documentation.
-
-  For an Fl_Button object, the following when() values are useful, the default
-  being \c FL_WHEN_RELEASE:
-  \li \c 0: The callback is not done, instead changed() is turned on.
-  \li \c FL_WHEN_RELEASE: The callback is done after the user successfully
-         clicks the button, or when a shortcut is typed.
-  \li \c FL_WHEN_CHANGED: The callback is done each time the value() changes
-         (when the user pushes and releases the button, and as the mouse is
-	 dragged around in and out of the button).
-*/
-class FL_EXPORT Fl_Button : public Fl_Widget {
-
-  int shortcut_;
-  char value_;
-  char oldval;
-  uchar down_box_;
-
-protected:
-
-  static Fl_Widget_Tracker *key_release_tracker;
-  static void key_release_timeout(void*);
-  void simulate_key_action();
-  
-  virtual void draw();
-
-public:
-
-  virtual int handle(int);
-
-  Fl_Button(int X, int Y, int W, int H, const char *L = 0);
-
-  int value(int v);
-
-  /**
-    Returns the current value of the button (0 or 1).
-   */
-  char value() const {return value_;}
-
-  /**
-    Same as \c value(1).
-    \see value(int v)
-   */
-  int set() {return value(1);}
-
-  /**
-    Same as \c value(0).
-    \see value(int v)
-   */
-  int clear() {return value(0);}
-
-  void setonly(); // this should only be called on FL_RADIO_BUTTONs
-
-  /**
-    Returns the current shortcut key for the button.
-    \retval int
-   */
-  int shortcut() const {return shortcut_;}
-
-  /**
-    Sets the shortcut key to \c s.
-    Setting this overrides the use of '\&' in the label().
-    The value is a bitwise OR of a key and a set of shift flags, for example:
-    <tt>FL_ALT | 'a'</tt>, or
-    <tt>FL_ALT | (FL_F + 10)</tt>, or just
-    <tt>'a'</tt>.
-    A value of 0 disables the shortcut.
-
-    The key can be any value returned by Fl::event_key(), but will usually be
-    an ASCII letter.  Use a lower-case letter unless you require the shift key
-    to be held down.
-
-    The shift flags can be any set of values accepted by Fl::event_state().
-    If the bit is on, that shift key must be pushed.  Meta, Alt, Ctrl, and
-    Shift must be off if they are not in the shift flags (zero for the other
-    bits indicates a "don't care" setting).
-    \param[in] s bitwise OR of key and shift flags
-   */
-  void shortcut(int s) {shortcut_ = s;}
-
-  /**
-    Returns the current down box type, which is drawn when value() is non-zero.
-    \retval Fl_Boxtype
-   */
-  Fl_Boxtype down_box() const {return (Fl_Boxtype)down_box_;}
-
-  /**
-    Sets the down box type. The default value of 0 causes FLTK to figure out
-    the correct matching down version of box().
-    \param[in] b down box type
-   */
-  void down_box(Fl_Boxtype b) {down_box_ = b;}
-
-  /// (for backwards compatibility)
-  void shortcut(const char *s) {shortcut(fl_old_shortcut(s));}
-
-  /// (for backwards compatibility)
-  Fl_Color down_color() const {return selection_color();}
-
-  /// (for backwards compatibility)
-  void down_color(unsigned c) {selection_color(c);}
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_Button, Fl_Widget)
-};
-
-#endif
-
-//
-// End of "$Id: Fl_Button.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
-//
+//
+// "$Id: Fl_Button.H 10386 2014-10-19 20:17:17Z AlbrechtS $"
+//
+// Button header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2014 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file. If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_Button widget . */
+
+#ifndef Fl_Button_H
+#define Fl_Button_H
+
+#ifndef Fl_Widget_H
+#include "Fl_Widget.H"
+#endif
+
+// values for type()
+#define FL_NORMAL_BUTTON	0   /**< value() will be set to 1 during the press of the button and
+                                         reverts back to 0 when the button is released */
+#define FL_TOGGLE_BUTTON	1   ///< value() toggles between 0 and 1 at every click of the button
+#define FL_RADIO_BUTTON		(FL_RESERVED_TYPE+2) /**< is set to 1 at button press, and all other
+				         buttons in the same group with <tt>type() == FL_RADIO_BUTTON</tt>
+				         are set to zero.*/
+#define FL_HIDDEN_BUTTON	3   ///< for Forms compatibility
+
+extern FL_EXPORT Fl_Shortcut fl_old_shortcut(const char*);
+
+class Fl_Widget_Tracker;
+
+/**
+  \class Fl_Button
+  \brief Buttons generate callbacks when they are clicked by the user.
+
+  You control exactly when and how by changing the values for type() and
+  when().  Buttons can also generate callbacks in response to \c FL_SHORTCUT
+  events.  The button can either have an explicit shortcut(int s) value or a
+  letter shortcut can be indicated in the label() with an '\&' character
+  before it.  For the label shortcut it does not matter if \e Alt is held
+  down, but if you have an input field in the same window, the user will have
+  to hold down the \e Alt key so that the input field does not eat the event
+  first as an \c FL_KEYBOARD event.
+
+  \todo Refactor the doxygen comments for Fl_Button type() documentation.
+
+  For an Fl_Button object, the type() call returns one of:
+  \li \c FL_NORMAL_BUTTON (0): value() remains unchanged after button press.
+  \li \c FL_TOGGLE_BUTTON: value() is inverted after button press.
+  \li \c FL_RADIO_BUTTON: value() is set to 1 after button press, and all other
+         buttons in the current group with <tt>type() == FL_RADIO_BUTTON</tt>
+	 are set to zero.
+
+  \todo Refactor the doxygen comments for Fl_Button when() documentation.
+
+  For an Fl_Button object, the following when() values are useful, the default
+  being \c FL_WHEN_RELEASE:
+  \li \c 0: The callback is not done, instead changed() is turned on.
+  \li \c FL_WHEN_RELEASE: The callback is done after the user successfully
+         clicks the button, or when a shortcut is typed.
+  \li \c FL_WHEN_CHANGED: The callback is done each time the value() changes
+         (when the user pushes and releases the button, and as the mouse is
+	 dragged around in and out of the button).
+*/
+
+class FL_EXPORT Fl_Button : public Fl_Widget {
+
+  int shortcut_;
+  char value_;
+  char oldval;
+  uchar down_box_;
+  uchar handle_return_;
+
+protected:
+
+  static Fl_Widget_Tracker *key_release_tracker;
+  static void key_release_timeout(void*);
+  void simulate_key_action();
+
+  virtual void draw();
+
+public:
+
+  virtual int handle(int);
+
+  Fl_Button(int X, int Y, int W, int H, const char *L = 0);
+
+  int value(int v);
+
+  /**
+    Returns the current value of the button (0 or 1).
+   */
+  char value() const {return value_;}
+
+  /**
+    Same as \c value(1).
+    \see value(int v)
+   */
+  int set() {return value(1);}
+
+  /**
+    Same as \c value(0).
+    \see value(int v)
+   */
+  int clear() {return value(0);}
+
+  void setonly(); // this should only be called on FL_RADIO_BUTTONs
+
+  /**
+    Returns the current shortcut key for the button.
+    \retval int
+   */
+  int shortcut() const {return shortcut_;}
+
+  /**
+    Sets the shortcut key to \c s.
+    Setting this overrides the use of '\&' in the label().
+    The value is a bitwise OR of a key and a set of shift flags, for example:
+    <tt>FL_ALT | 'a'</tt>, or
+    <tt>FL_ALT | (FL_F + 10)</tt>, or just
+    <tt>'a'</tt>.
+    A value of 0 disables the shortcut.
+
+    The key can be any value returned by Fl::event_key(), but will usually be
+    an ASCII letter.  Use a lower-case letter unless you require the shift key
+    to be held down.
+
+    The shift flags can be any set of values accepted by Fl::event_state().
+    If the bit is on, that shift key must be pushed.  Meta, Alt, Ctrl, and
+    Shift must be off if they are not in the shift flags (zero for the other
+    bits indicates a "don't care" setting).
+    \param[in] s bitwise OR of key and shift flags
+   */
+  void shortcut(int s) {shortcut_ = s;}
+
+  void handle_return(uchar bval) {handle_return_ = bval;}
+  int handle_return() const {return handle_return_;}
+  /**
+    Returns the current down box type, which is drawn when value() is non-zero.
+    \retval Fl_Boxtype
+   */
+  Fl_Boxtype down_box() const {return (Fl_Boxtype)down_box_;}
+
+  /**
+    Sets the down box type. The default value of 0 causes FLTK to figure out
+    the correct matching down version of box().
+
+    Some derived classes (e.g. Fl_Round_Button and Fl_Light_Button use
+    down_box() for special purposes. See docs of these classes.
+
+    \param[in] b down box type
+   */
+  void down_box(Fl_Boxtype b) {down_box_ = b;}
+
+  /// (for backwards compatibility)
+  void shortcut(const char *s) {shortcut(fl_old_shortcut(s));}
+
+  /// (for backwards compatibility)
+  Fl_Color down_color() const {return selection_color();}
+
+  /// (for backwards compatibility)
+  void down_color(unsigned c) {selection_color(c);}
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_Button, Fl_Widget)
+};
+
+#endif
+
+//
+// End of "$Id: Fl_Button.H 10386 2014-10-19 20:17:17Z AlbrechtS $".
+//

+ 88 - 88
fltk/FL/Fl_Cairo.H

@@ -1,88 +1,88 @@
-//
-// "$Id: Fl_Cairo.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
-//
-// Main header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-    Handling transparently platform dependent cairo include files 
-*/
-
-#ifndef FL_CAIRO_H
-# define FL_CAIRO_H
-# ifdef FLTK_HAVE_CAIRO
-
-// Cairo is currently supported for the following platforms:
-// Win32, Apple Quartz, X11
-
-# include <FL/Fl_Export.H>
-
-# if defined(USE_X11) // X11
-#  include <cairo-xlib.h>
-# elif defined(WIN32)
-#  include <cairo-win32.h>
-# elif defined(__APPLE_QUARTZ__)
-#  include <cairo-quartz.h>
-# else
-#  error Cairo is not supported on that platform.
-# endif
-
-/** 
-   \addtogroup group_cairo
-   @{
-*/
-
-/** 
-   Contains all the necessary info on the current cairo context.
-   A private internal & unique corresponding object is created to
-   permit cairo context state handling while keeping it opaque.
-   For internal use only.
-   \note Only available when configure has the --enable-cairo option
-*/
-class FL_EXPORT Fl_Cairo_State {
-public:
-  Fl_Cairo_State() : cc_(0), own_cc_(false), autolink_(false), window_(0), gc_(0) {}
-
-    // access attributes
-    cairo_t* cc() const {return cc_;}		 ///< Gets the current cairo context
-    bool autolink() const {return autolink_;}	 ///< Gets the autolink option. See Fl::cairo_autolink_context(bool)
-    /** Sets the current cairo context, \p own indicates cc deletion is handle externally by user */
-    void cc(cairo_t* c, bool own=true)  {	 
-	if (cc_ && own_cc_) cairo_destroy(cc_); 
-	cc_=c;
-	if (!cc_) window_=0;
-	own_cc_=own;
-    }
-    void  autolink(bool b);                     ///< Sets the autolink option, only available with --enable-cairoext
-    void  window(void* w)  {window_=w;}		///< Sets the window \p w to keep track on
-    void* window() const {return window_;}	///< Gets the last window attached to a cc
-    void  gc(void* c)  {gc_=c;}		        ///< Sets the gc \p c to keep track on
-    void* gc() const {return gc_;}		///< Gets the last gc attached to a cc
-
-private:
-    cairo_t * cc_;	 // contains the unique autoupdated cairo context
-    bool own_cc_;	 // indicates whether we must delete the cc, useful for internal cleanup
-    bool autolink_;	 // true by default, permits to prevent the automatic cairo mapping on fltk windows for custom cairo implementations
-    void* window_, *gc_; // for keeping track internally of last win+gc treated
-};
-
-/** @} */
-
-# endif // FLTK_HAVE_CAIRO
-#endif // FL_CAIRO_H
-
-//
-// End of "$Id: Fl_Cairo.H 8864 2011-07-19 04:49:30Z greg.ercolano $" .
-//
+//
+// "$Id: Fl_Cairo.H 11168 2016-02-13 18:02:17Z AlbrechtS $"
+//
+// Main header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2016 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+    Handling transparently platform dependent cairo include files 
+*/
+
+#ifndef FL_CAIRO_H
+# define FL_CAIRO_H
+# ifdef FLTK_HAVE_CAIRO
+
+// Cairo is currently supported for the following platforms:
+// Win32, Apple Quartz, X11
+
+# include <FL/Fl_Export.H>
+
+# include <cairo.h>
+
+/** 
+   \addtogroup group_cairo
+   @{
+*/
+
+/** 
+   Contains all the necessary info on the current cairo context.
+   A private internal & unique corresponding object is created to
+   permit cairo context state handling while keeping it opaque.
+   For internal use only.
+   \note Only available when configure has the --enable-cairo option
+*/
+class FL_EXPORT Fl_Cairo_State {
+public:
+  Fl_Cairo_State() : cc_(0), own_cc_(false), autolink_(false), window_(0), gc_(0) {}
+
+    // access attributes
+    cairo_t* cc() const {return cc_;}		 ///< Gets the current cairo context
+    bool autolink() const {return autolink_;}	 ///< Gets the autolink option. See Fl::cairo_autolink_context(bool)
+    /** Sets the current cairo context.
+
+	\p own == \e true (the default) indicates that the cairo context \p c
+	will be deleted by FLTK internally when another cc is set later.
+
+	\p own == \e false indicates cc deletion is handled externally
+	by the user program.
+    */
+    void cc(cairo_t* c, bool own=true)  {
+	if (cc_ && own_cc_) cairo_destroy(cc_);
+	cc_=c;
+	if (!cc_) window_=0;
+	own_cc_=own;
+    }
+    void  autolink(bool b);                     ///< Sets the autolink option, only available with --enable-cairoext
+    void  window(void* w)  {window_=w;}		///< Sets the window \p w to keep track on
+    void* window() const {return window_;}	///< Gets the last window attached to a cc
+    void  gc(void* c)  {gc_=c;}		        ///< Sets the gc \p c to keep track on
+    void* gc() const {return gc_;}		///< Gets the last gc attached to a cc
+
+private:
+    cairo_t * cc_;	 // contains the unique autoupdated cairo context
+    bool own_cc_;	 // indicates whether we must delete the cc, useful for internal cleanup
+    bool autolink_;	 // false by default, prevents the automatic cairo mapping on fltk windows
+			 // for custom cairo implementations.
+    void* window_, *gc_; // for keeping track internally of last win+gc treated
+};
+
+/** @} */
+
+# endif // FLTK_HAVE_CAIRO
+#endif // FL_CAIRO_H
+
+//
+// End of "$Id: Fl_Cairo.H 11168 2016-02-13 18:02:17Z AlbrechtS $" .
+//

+ 84 - 85
fltk/FL/Fl_Cairo_Window.H

@@ -1,85 +1,84 @@
-//
-// "$Id: Fl_Cairo_Window.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
-//
-// Main header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-    Fl_Cairo_Window Handling transparently a fltk window incorporte a cairo draw callback.
-*/
-
-#ifndef FL_CAIRO_WINDOW_H
-# define FL_CAIRO_WINDOW_H
-# ifdef FLTK_HAVE_CAIRO
-
-// Cairo is currently supported for the following platforms:
-// Win32, Apple Quartz, X11
-#  include <FL/Fl.H>
-#  include <FL/Fl_Double_Window.H>
-
-/** 
-   \addtogroup group_cairo
-   @{
-*/
-
-/**
-   This defines a pre-configured cairo fltk window.
-   This class overloads the virtual draw() method for you,
-   so that the only thing you have to do is to provide your cairo code.
-   All cairo context handling is achieved transparently.
-   \note You can alternatively define your custom cairo fltk window,
-   and thus at least override the draw() method to provide custom cairo
-   support. In this case you will probably use Fl::cairo_make_current(Fl_Window*)
-   to attach a context to your window. You should do it only when your window is 
-   the current window. \see Fl_Window::current()
-*/
-class FL_EXPORT Fl_Cairo_Window : public Fl_Double_Window {
-
-public:
-  Fl_Cairo_Window(int w, int h) : Fl_Double_Window(w,h),draw_cb_(0) {}
-
-protected:
-  /** Overloaded to provide cairo callback support */
-  void draw() {
-    Fl_Double_Window::draw();
-    // manual method ? if yes explicitly get a cairo_context here
-    if (!Fl::cairo_autolink_context()) 
-      Fl::cairo_make_current(this); 
-    if (draw_cb_) draw_cb_(this, Fl::cairo_cc());
-  }
-
-public:
-  /** This defines the cairo draw callback prototype that you must further */
-  typedef void (*cairo_draw_cb) (Fl_Cairo_Window* self, cairo_t* def);
-  /** 
-    You must provide a draw callback which will implement your cairo rendering.
-    This method will permit you to set your cairo callback to \p cb.
-  */
-  void set_draw_cb(cairo_draw_cb  cb){draw_cb_=cb;}
-private:
-    cairo_draw_cb draw_cb_;
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_Cairo_Window, public Fl_Double_Window)
-};
-
-
-/** @} */
-
-# endif // FLTK_HAVE_CAIRO
-#endif // FL_CAIRO_WINDOW_H
-
-//
-// End of "$Id: Fl_Cairo_Window.H 8864 2011-07-19 04:49:30Z greg.ercolano $" .
-//
+//
+// "$Id: Fl_Cairo_Window.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
+//
+// Main header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2010 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+    Fl_Cairo_Window Handling transparently a fltk window incorporte a cairo draw callback.
+*/
+
+#ifndef FL_CAIRO_WINDOW_H
+# define FL_CAIRO_WINDOW_H
+# ifdef FLTK_HAVE_CAIRO
+
+// Cairo is currently supported for the following platforms:
+// Win32, Apple Quartz, X11
+#  include <FL/Fl.H>
+#  include <FL/Fl_Double_Window.H>
+
+/** 
+   \addtogroup group_cairo
+   @{
+*/
+
+/**
+   This defines a pre-configured cairo fltk window.
+   This class overloads the virtual draw() method for you,
+   so that the only thing you have to do is to provide your cairo code.
+   All cairo context handling is achieved transparently.
+   \note You can alternatively define your custom cairo fltk window,
+   and thus at least override the draw() method to provide custom cairo
+   support. In this case you will probably use Fl::cairo_make_current(Fl_Window*)
+   to attach a context to your window. You should do it only when your window is 
+   the current window. \see Fl_Window::current()
+*/
+class FL_EXPORT Fl_Cairo_Window : public Fl_Double_Window {
+
+public:
+  Fl_Cairo_Window(int w, int h) : Fl_Double_Window(w,h),draw_cb_(0) {}
+
+protected:
+  /** Overloaded to provide cairo callback support */
+  void draw() {
+    Fl_Double_Window::draw();
+    // manual method ? if yes explicitly get a cairo_context here
+    if (!Fl::cairo_autolink_context()) 
+      Fl::cairo_make_current(this); 
+    if (draw_cb_) draw_cb_(this, Fl::cairo_cc());
+  }
+
+public:
+  /** This defines the cairo draw callback prototype that you must further */
+  typedef void (*cairo_draw_cb) (Fl_Cairo_Window* self, cairo_t* def);
+  /** 
+    You must provide a draw callback which will implement your cairo rendering.
+    This method will permit you to set your cairo callback to \p cb.
+  */
+  void set_draw_cb(cairo_draw_cb  cb){draw_cb_=cb;}
+private:
+    cairo_draw_cb draw_cb_;
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_Cairo_Window, public Fl_Double_Window)
+};
+
+
+/** @} */
+
+# endif // FLTK_HAVE_CAIRO
+#endif // FL_CAIRO_WINDOW_H
+
+//
+// End of "$Id: Fl_Cairo_Window.H 8864 2011-07-19 04:49:30Z greg.ercolano $" .
+//

+ 152 - 153
fltk/FL/Fl_Chart.H

@@ -1,153 +1,152 @@
-//
-// "$Id: Fl_Chart.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
-//
-// Forms chart header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_Chart widget . */
-
-#ifndef Fl_Chart_H
-#define Fl_Chart_H
-
-#ifndef Fl_Widget_H
-#include "Fl_Widget.H"
-#endif
-
-// values for type()
-#define FL_BAR_CHART		0	/**< type() for Bar Chart variant */
-#define FL_HORBAR_CHART		1	/**< type() for Horizontal Bar Chart variant */
-#define FL_LINE_CHART		2	/**< type() for Line Chart variant */
-#define FL_FILL_CHART		3	/**< type() for Fill Line Chart variant */
-#define FL_SPIKE_CHART		4	/**< type() for Spike Chart variant */
-#define FL_PIE_CHART		5	/**< type() for Pie Chart variant */
-#define FL_SPECIALPIE_CHART	6	/**< type() for Special Pie Chart variant */
-
-#define FL_FILLED_CHART  FL_FILL_CHART	/**< for compatibility */
-
-#define FL_CHART_MAX		128	/**< max entries per chart */
-#define FL_CHART_LABEL_MAX	18	/**< max label length for entry */
-
-/** For internal use only */
-struct FL_CHART_ENTRY {
-   float val;				/**< For internal use only. */
-   unsigned col;			/**< For internal use only. */
-   char str[FL_CHART_LABEL_MAX+1];	/**< For internal use only. */
-};
-
-/**
-  \class Fl_Chart
-  \brief Fl_Chart displays simple charts.
-  It is provided for Forms compatibility.
-
-  \image html charts.png  
-  \image latex charts.png  "Fl_Chart" width=10cm
-  \todo Refactor Fl_Chart::type() information.
-
-  The type of an Fl_Chart object can be set using type(uchar t) to:
-  \li \c FL_BAR_CHART: Each sample value is drawn as a vertical bar.
-  \li \c FL_FILLED_CHART: The chart is filled from the bottom of the graph
-         to the sample values.
-  \li \c FL_HORBAR_CHART: Each sample value is drawn as a horizontal bar.
-  \li \c FL_LINE_CHART: The chart is drawn as a polyline with vertices at
-         each sample value.
-  \li \c FL_PIE_CHART: A pie chart is drawn with each sample value being
-         drawn as a proportionate slice in the circle.
-  \li \c FL_SPECIALPIE_CHART: Like \c FL_PIE_CHART, but the first slice is
-         separated from the pie.
-  \li \c FL_SPIKE_CHART: Each sample value is drawn as a vertical line.
- */
-class FL_EXPORT Fl_Chart : public Fl_Widget {
-    int numb;
-    int maxnumb;
-    int sizenumb;
-    FL_CHART_ENTRY *entries;
-    double min,max;
-    uchar autosize_;
-    Fl_Font textfont_;
-    Fl_Fontsize textsize_;
-    Fl_Color textcolor_;
-protected:
-    void draw();
-public:
-    Fl_Chart(int X, int Y, int W, int H, const char *L = 0);
-
-    ~Fl_Chart();
-
-    void clear();
-
-    void add(double val, const char *str = 0, unsigned col = 0);
-
-    void insert(int ind, double val, const char *str = 0, unsigned col = 0);
-
-    void replace(int ind, double val, const char *str = 0, unsigned col = 0);
-
-    /**
-      Gets the lower and upper bounds of the chart values.
-      \param[out] a, b are set to lower, upper
-     */
-    void bounds(double *a,double *b) const {*a = min; *b = max;}
-
-    void bounds(double a,double b);
-
-    /**
-      Returns the number of data values in the chart.
-     */
-    int size() const {return numb;}
-
-    void size(int W, int H) { Fl_Widget::size(W, H); }
-
-    /**
-      Gets the maximum number of data values for a chart.
-     */
-    int maxsize() const {return maxnumb;}
-
-    void maxsize(int m);
-
-    /** Gets the chart's text font */
-    Fl_Font textfont() const {return textfont_;}
-    /** Sets the chart's text font to \p s. */
-    void textfont(Fl_Font s) {textfont_ = s;}
-
-    /** Gets the chart's text size */
-    Fl_Fontsize textsize() const {return textsize_;}
-    /** gets the chart's text size to \p s. */
-    void textsize(Fl_Fontsize s) {textsize_ = s;}
-
-    /** Gets the chart's text color */
-    Fl_Color textcolor() const {return textcolor_;}
-    /** gets the chart's text color to \p n. */
-    void textcolor(Fl_Color n) {textcolor_ = n;}
-
-    /**
-      Get whether the chart will automatically adjust the bounds of the chart.
-      \returns non-zero if auto-sizing is enabled and zero if disabled.
-     */
-    uchar autosize() const {return autosize_;}
-
-    /**
-      Set whether the chart will automatically adjust the bounds of the chart.
-      \param[in] n non-zero to enable automatic resizing, zero to disable.
-     */
-    void autosize(uchar n) {autosize_ = n;}
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_Chart, Fl_Widget)
-};
-
-#endif
-
-//
-// End of "$Id: Fl_Chart.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
-//
+//
+// "$Id: Fl_Chart.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
+//
+// Forms chart header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2010 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_Chart widget . */
+
+#ifndef Fl_Chart_H
+#define Fl_Chart_H
+
+#ifndef Fl_Widget_H
+#include "Fl_Widget.H"
+#endif
+
+// values for type()
+#define FL_BAR_CHART		0	/**< type() for Bar Chart variant */
+#define FL_HORBAR_CHART		1	/**< type() for Horizontal Bar Chart variant */
+#define FL_LINE_CHART		2	/**< type() for Line Chart variant */
+#define FL_FILL_CHART		3	/**< type() for Fill Line Chart variant */
+#define FL_SPIKE_CHART		4	/**< type() for Spike Chart variant */
+#define FL_PIE_CHART		5	/**< type() for Pie Chart variant */
+#define FL_SPECIALPIE_CHART	6	/**< type() for Special Pie Chart variant */
+
+#define FL_FILLED_CHART  FL_FILL_CHART	/**< for compatibility */
+
+#define FL_CHART_MAX		128	/**< max entries per chart */
+#define FL_CHART_LABEL_MAX	18	/**< max label length for entry */
+
+/** For internal use only */
+struct FL_CHART_ENTRY {
+   float val;				/**< For internal use only. */
+   unsigned col;			/**< For internal use only. */
+   char str[FL_CHART_LABEL_MAX+1];	/**< For internal use only. */
+};
+
+/**
+  \class Fl_Chart
+  \brief Fl_Chart displays simple charts.
+  It is provided for Forms compatibility.
+
+  \image html charts.png  
+  \image latex charts.png  "Fl_Chart" width=10cm
+  \todo Refactor Fl_Chart::type() information.
+
+  The type of an Fl_Chart object can be set using type(uchar t) to:
+  \li \c FL_BAR_CHART: Each sample value is drawn as a vertical bar.
+  \li \c FL_FILLED_CHART: The chart is filled from the bottom of the graph
+         to the sample values.
+  \li \c FL_HORBAR_CHART: Each sample value is drawn as a horizontal bar.
+  \li \c FL_LINE_CHART: The chart is drawn as a polyline with vertices at
+         each sample value.
+  \li \c FL_PIE_CHART: A pie chart is drawn with each sample value being
+         drawn as a proportionate slice in the circle.
+  \li \c FL_SPECIALPIE_CHART: Like \c FL_PIE_CHART, but the first slice is
+         separated from the pie.
+  \li \c FL_SPIKE_CHART: Each sample value is drawn as a vertical line.
+ */
+class FL_EXPORT Fl_Chart : public Fl_Widget {
+    int numb;
+    int maxnumb;
+    int sizenumb;
+    FL_CHART_ENTRY *entries;
+    double min,max;
+    uchar autosize_;
+    Fl_Font textfont_;
+    Fl_Fontsize textsize_;
+    Fl_Color textcolor_;
+protected:
+    void draw();
+public:
+    Fl_Chart(int X, int Y, int W, int H, const char *L = 0);
+
+    ~Fl_Chart();
+
+    void clear();
+
+    void add(double val, const char *str = 0, unsigned col = 0);
+
+    void insert(int ind, double val, const char *str = 0, unsigned col = 0);
+
+    void replace(int ind, double val, const char *str = 0, unsigned col = 0);
+
+    /**
+      Gets the lower and upper bounds of the chart values.
+      \param[out] a, b are set to lower, upper
+     */
+    void bounds(double *a,double *b) const {*a = min; *b = max;}
+
+    void bounds(double a,double b);
+
+    /**
+      Returns the number of data values in the chart.
+     */
+    int size() const {return numb;}
+
+    void size(int W, int H) { Fl_Widget::size(W, H); }
+
+    /**
+      Gets the maximum number of data values for a chart.
+     */
+    int maxsize() const {return maxnumb;}
+
+    void maxsize(int m);
+
+    /** Gets the chart's text font */
+    Fl_Font textfont() const {return textfont_;}
+    /** Sets the chart's text font to \p s. */
+    void textfont(Fl_Font s) {textfont_ = s;}
+
+    /** Gets the chart's text size */
+    Fl_Fontsize textsize() const {return textsize_;}
+    /** gets the chart's text size to \p s. */
+    void textsize(Fl_Fontsize s) {textsize_ = s;}
+
+    /** Gets the chart's text color */
+    Fl_Color textcolor() const {return textcolor_;}
+    /** gets the chart's text color to \p n. */
+    void textcolor(Fl_Color n) {textcolor_ = n;}
+
+    /**
+      Get whether the chart will automatically adjust the bounds of the chart.
+      \returns non-zero if auto-sizing is enabled and zero if disabled.
+     */
+    uchar autosize() const {return autosize_;}
+
+    /**
+      Set whether the chart will automatically adjust the bounds of the chart.
+      \param[in] n non-zero to enable automatic resizing, zero to disable.
+     */
+    void autosize(uchar n) {autosize_ = n;}
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_Chart, Fl_Widget)
+};
+
+#endif
+
+//
+// End of "$Id: Fl_Chart.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
+//

+ 114 - 115
fltk/FL/Fl_Check_Browser.H

@@ -1,115 +1,114 @@
-//
-// "$Id: Fl_Check_Browser.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
-//
-// Fl_Check_Browser header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_Check_Browser widget . */
-
-#ifndef Fl_Check_Browser_H
-#define Fl_Check_Browser_H
-
-#include "Fl.H"
-#include "Fl_Browser_.H"
-
-/**
-  The Fl_Check_Browser widget displays a scrolling list of text
-  lines that may be selected and/or checked by the user.
-*/
-class FL_EXPORT Fl_Check_Browser : public Fl_Browser_ {
-  /* required routines for Fl_Browser_ subclass: */
-
-  void *item_first() const;
-  void *item_next(void *) const;
-  void *item_prev(void *) const;
-  int item_height(void *) const;
-  int item_width(void *) const;
-  void item_draw(void *, int, int, int, int) const;
-  void item_select(void *, int);
-  int item_selected(void *) const;
-
-  /* private data */
-
-  public: // IRIX 5.3 C++ compiler doesn't support private structures...
-
-#ifndef FL_DOXYGEN
-  /** For internal use only. */
-  struct cb_item {
-	  cb_item *next;	/**< For internal use only. */
-	  cb_item *prev;	/**< For internal use only. */
-	  char checked;		/**< For internal use only. */
-	  char selected;	/**< For internal use only. */
-	  char *text;		/**< For internal use only. */
-  };
-#endif // !FL_DOXYGEN
-
-  private:
-
-  cb_item *first;
-  cb_item *last;
-  cb_item *cache;
-  int cached_item;
-  int nitems_;
-  int nchecked_;
-  cb_item *find_item(int) const;
-  int lineno(cb_item *) const;
-
-  public:
-
-  Fl_Check_Browser(int x, int y, int w, int h, const char *l = 0);
-   /** The destructor deletes all list items and destroys the browser. */
-  ~Fl_Check_Browser() { clear(); }
-  int add(char *s);               // add an (unchecked) item
-  int add(char *s, int b);        // add an item and set checked
-				  // both return the new nitems()
-  int remove(int item);           // delete an item. Returns nitems()
-
-  // inline const char * methods to avoid breaking binary compatibility...
-   /** See int Fl_Check_Browser::add(char *s) */
-  int add(const char *s) { return add((char *)s); }
-  /** See int Fl_Check_Browser::add(char *s) */
-  int add(const char *s, int b) { return add((char *)s, b); }
-
-  void clear();                   // delete all items
-  /**
-    Returns how many lines are in the browser.  The last line number is equal to
-    this.
-  */
-  int nitems() const { return nitems_; }
-  /**    Returns how many items are currently checked.  */
-  int nchecked() const { return nchecked_; }
-  int checked(int item) const;
-  void checked(int item, int b);
-  /**    Equivalent to Fl_Check_Browser::checked(item, 1).  */
-  void set_checked(int item) { checked(item, 1); }
-  void check_all();
-  void check_none();
-  int value() const;              // currently selected item
-  char *text(int item) const;     // returns pointer to internal buffer
-
-  protected:
-
-  int handle(int);
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_Check_Browser, Fl_Browser_)
-};
-
-#endif // Fl_Check_Browser_H
-
-//
-// End of "$Id: Fl_Check_Browser.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
-//
-
+//
+// "$Id: Fl_Check_Browser.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
+//
+// Fl_Check_Browser header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2010 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_Check_Browser widget . */
+
+#ifndef Fl_Check_Browser_H
+#define Fl_Check_Browser_H
+
+#include "Fl.H"
+#include "Fl_Browser_.H"
+
+/**
+  The Fl_Check_Browser widget displays a scrolling list of text
+  lines that may be selected and/or checked by the user.
+*/
+class FL_EXPORT Fl_Check_Browser : public Fl_Browser_ {
+  /* required routines for Fl_Browser_ subclass: */
+
+  void *item_first() const;
+  void *item_next(void *) const;
+  void *item_prev(void *) const;
+  int item_height(void *) const;
+  int item_width(void *) const;
+  void item_draw(void *, int, int, int, int) const;
+  void item_select(void *, int);
+  int item_selected(void *) const;
+
+  /* private data */
+
+  public: // IRIX 5.3 C++ compiler doesn't support private structures...
+
+#ifndef FL_DOXYGEN
+  /** For internal use only. */
+  struct cb_item {
+	  cb_item *next;	/**< For internal use only. */
+	  cb_item *prev;	/**< For internal use only. */
+	  char checked;		/**< For internal use only. */
+	  char selected;	/**< For internal use only. */
+	  char *text;		/**< For internal use only. */
+  };
+#endif // !FL_DOXYGEN
+
+  private:
+
+  cb_item *first;
+  cb_item *last;
+  cb_item *cache;
+  int cached_item;
+  int nitems_;
+  int nchecked_;
+  cb_item *find_item(int) const;
+  int lineno(cb_item *) const;
+
+  public:
+
+  Fl_Check_Browser(int x, int y, int w, int h, const char *l = 0);
+   /** The destructor deletes all list items and destroys the browser. */
+  ~Fl_Check_Browser() { clear(); }
+  int add(char *s);               // add an (unchecked) item
+  int add(char *s, int b);        // add an item and set checked
+				  // both return the new nitems()
+  int remove(int item);           // delete an item. Returns nitems()
+
+  // inline const char * methods to avoid breaking binary compatibility...
+   /** See int Fl_Check_Browser::add(char *s) */
+  int add(const char *s) { return add((char *)s); }
+  /** See int Fl_Check_Browser::add(char *s) */
+  int add(const char *s, int b) { return add((char *)s, b); }
+
+  void clear();                   // delete all items
+  /**
+    Returns how many lines are in the browser.  The last line number is equal to
+    this.
+  */
+  int nitems() const { return nitems_; }
+  /**    Returns how many items are currently checked.  */
+  int nchecked() const { return nchecked_; }
+  int checked(int item) const;
+  void checked(int item, int b);
+  /**    Equivalent to Fl_Check_Browser::checked(item, 1).  */
+  void set_checked(int item) { checked(item, 1); }
+  void check_all();
+  void check_none();
+  int value() const;              // currently selected item
+  char *text(int item) const;     // returns pointer to internal buffer
+
+  protected:
+
+  int handle(int);
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_Check_Browser, Fl_Browser_)
+};
+
+#endif // Fl_Check_Browser_H
+
+//
+// End of "$Id: Fl_Check_Browser.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
+//
+

+ 40 - 53
fltk/FL/Fl_Check_Button.H

@@ -1,53 +1,40 @@
-//
-// "$Id: Fl_Check_Button.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
-//
-// Check button header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_Check_Button widget . */
-
-#ifndef Fl_Check_Button_H
-#define Fl_Check_Button_H
-
-#include "Fl_Light_Button.H"
-
-/**
-  \class Fl_Check_Button
-  \brief A button with an "checkmark" to show its status.
-
-  \image html Fl_Check_Button.png
-  \image latex Fl_Check_Button.png  "Fl_Check_Button" width=4cm
-  Buttons generate callbacks when they are clicked by the user. You control
-  exactly when and how by changing the values for type() and when().
-
-  The Fl_Check_Button subclass displays its "ON" state by showing a "checkmark"
-  rather than drawing itself pushed in.
-  
-  \todo Refactor Fl_Check_Button doxygen comments (add color() info etc?)
-  \todo Generate Fl_Check_Button.gif with visible checkmark.
- */
-class FL_EXPORT Fl_Check_Button : public Fl_Light_Button {
-public:
-  Fl_Check_Button(int X, int Y, int W, int H, const char *L = 0);
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_Check_Button, Fl_Light_Button)
-};
-
-#endif
-
-//
-// End of "$Id: Fl_Check_Button.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
-//
+//
+// "$Id: Fl_Check_Button.H 10386 2014-10-19 20:17:17Z AlbrechtS $"
+//
+// Check button header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2014 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file. If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+#ifndef Fl_Check_Button_H
+#define Fl_Check_Button_H
+
+#include "Fl_Light_Button.H"
+
+/*
+  class: Fl_Check_Button.
+
+  A button with a "checkmark" to show its status.
+*/
+
+class FL_EXPORT Fl_Check_Button : public Fl_Light_Button {
+public:
+  Fl_Check_Button(int X, int Y, int W, int H, const char *L = 0);
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_Check_Button, Fl_Light_Button)
+};
+
+#endif
+
+//
+// End of "$Id: Fl_Check_Button.H 10386 2014-10-19 20:17:17Z AlbrechtS $".
+//

+ 107 - 101
fltk/FL/Fl_Choice.H

@@ -1,101 +1,107 @@
-//
-// "$Id: Fl_Choice.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
-//
-// Choice header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_Choice widget . */
-
-#ifndef Fl_Choice_H
-#define Fl_Choice_H
-
-#include "Fl_Menu_.H"
-
-/**
-  \class Fl_Choice
-  \brief A button that is used to pop up a menu.
-
-  This is a button that, when pushed, pops up a menu (or hierarchy of menus)
-  defined by an array of Fl_Menu_Item objects.
-  Motif calls this an OptionButton.
-
-  The only difference between this and a Fl_Menu_Button is that the name of
-  the most recent chosen menu item is displayed inside the box, while the
-  label is displayed outside the box. However, since the use of this is most
-  often to control a single variable rather than do individual callbacks,
-  some of the Fl_Menu_Button methods are redescribed here in those terms.
-
-  When the user picks an item off the menu the value() is set to that item
-  and then the item's callback is done with the menu_button as the
-  \c Fl_Widget* argument. If the item does not have a callback the
-  menu_button's callback is done instead.
-
-  All three mouse buttons pop up the menu. The Forms behavior of the first
-  two buttons to increment/decrement the choice is not implemented.  This
-  could be added with a subclass, however.
-
-  The menu will also pop up in response to shortcuts indicated by putting
-  a '\&' character in the label().  See Fl_Button::shortcut(int s) for a
-  description of this.
-
-  Typing the shortcut() of any of the items will do exactly the same as when
-  you pick the item with the mouse.  The '\&' character in item names are
-  only looked at when the menu is popped up, however.
-
-  \image html choice.png
-  \image latex choice.png  "Fl_Choice" width=4cm
-  \todo Refactor the doxygen comments for Fl_Choice changed() documentation.
-
-  \li <tt>int Fl_Widget::changed() const</tt>
-      This value is true the user picks a different value. <em>It is turned
-      off by value() and just before doing a callback (the callback can turn
-      it back on if desired).</em>
-  \li <tt>void Fl_Widget::set_changed()</tt>
-      This method sets the changed() flag.
-  \li <tt>void Fl_Widget::clear_changed()</tt>
-      This method clears the changed() flag.
-  \li <tt>Fl_Boxtype Fl_Choice::down_box() const</tt>
-      Gets the current down box, which is used when the menu is popped up.
-      The default down box type is \c FL_DOWN_BOX.
-  \li <tt>void Fl_Choice::down_box(Fl_Boxtype b)</tt>
-      Sets the current down box type to \p b.
- */
-class FL_EXPORT Fl_Choice : public Fl_Menu_ {
-protected:
-  void draw();
-public:
-  int handle(int);
-
-  Fl_Choice(int X, int Y, int W, int H, const char *L = 0);
-
-  /**
-    Gets the index of the last item chosen by the user.
-    The index is zero initially.
-   */
-  int value() const {return Fl_Menu_::value();}
-
-  int value(int v);
-
-  int value(const Fl_Menu_Item* v);
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_Choice, Fl_Menu_)
-};
-
-#endif
-
-//
-// End of "$Id: Fl_Choice.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
-//
+//
+// "$Id: Fl_Choice.H 10513 2015-01-10 22:05:15Z greg.ercolano $"
+//
+// Choice header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2010 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_Choice widget . */
+
+#ifndef Fl_Choice_H
+#define Fl_Choice_H
+
+#include "Fl_Menu_.H"
+
+/**
+  \class Fl_Choice
+  \brief A button that is used to pop up a menu.
+
+  This is a button that, when pushed, pops up a menu (or hierarchy of menus)
+  defined by an array of Fl_Menu_Item objects.
+  Motif calls this an OptionButton.
+
+  The only difference between this and a Fl_Menu_Button is that the name of
+  the most recent chosen menu item is displayed inside the box, while the
+  label is displayed outside the box. However, since the use of this is most
+  often to control a single variable rather than do individual callbacks,
+  some of the Fl_Menu_Button methods are redescribed here in those terms.
+
+  When the user clicks a menu item, value() is set to that item
+  and then:
+
+      - The item's callback is done if one has been set; the
+        Fl_Choice is passed as the Fl_Widget* argument, 
+        along with any userdata configured for the callback.
+
+      - If the item does not have a callback, the Fl_Choice widget's
+        callback is done instead, along with any userdata configured
+        for it.  The callback can determine which item was picked using
+        value(), mvalue(), item_pathname(), etc.
+
+  All three mouse buttons pop up the menu. The Forms behavior of the first
+  two buttons to increment/decrement the choice is not implemented.  This
+  could be added with a subclass, however.
+
+  The menu will also pop up in response to shortcuts indicated by putting
+  a '\&' character in the label().  See Fl_Button::shortcut(int s) for a
+  description of this.
+
+  Typing the shortcut() of any of the items will do exactly the same as when
+  you pick the item with the mouse.  The '\&' character in item names are
+  only looked at when the menu is popped up, however.
+
+  \image html choice.png
+  \image latex choice.png  "Fl_Choice" width=4cm
+  \todo Refactor the doxygen comments for Fl_Choice changed() documentation.
+
+  \li <tt>int Fl_Widget::changed() const</tt>
+      This value is true the user picks a different value. <em>It is turned
+      off by value() and just before doing a callback (the callback can turn
+      it back on if desired).</em>
+  \li <tt>void Fl_Widget::set_changed()</tt>
+      This method sets the changed() flag.
+  \li <tt>void Fl_Widget::clear_changed()</tt>
+      This method clears the changed() flag.
+  \li <tt>Fl_Boxtype Fl_Choice::down_box() const</tt>
+      Gets the current down box, which is used when the menu is popped up.
+      The default down box type is \c FL_DOWN_BOX.
+  \li <tt>void Fl_Choice::down_box(Fl_Boxtype b)</tt>
+      Sets the current down box type to \p b.
+ */
+class FL_EXPORT Fl_Choice : public Fl_Menu_ {
+protected:
+  void draw();
+public:
+  int handle(int);
+
+  Fl_Choice(int X, int Y, int W, int H, const char *L = 0);
+
+  /**
+    Gets the index of the last item chosen by the user.
+    The index is zero initially.
+   */
+  int value() const {return Fl_Menu_::value();}
+
+  int value(int v);
+
+  int value(const Fl_Menu_Item* v);
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_Choice, Fl_Menu_)
+};
+
+#endif
+
+//
+// End of "$Id: Fl_Choice.H 10513 2015-01-10 22:05:15Z greg.ercolano $".
+//

+ 170 - 132
fltk/FL/Fl_Clock.H

@@ -1,132 +1,170 @@
-//
-// "$Id: Fl_Clock.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
-//
-// Clock header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_Clock, Fl_Clock_Output widgets . */
-
-#ifndef Fl_Clock_H
-#define Fl_Clock_H
-
-#ifndef Fl_Widget_H
-#include "Fl_Widget.H"
-#endif
-
-// values for type:
-#define FL_SQUARE_CLOCK		0	/**< type() of Square Clock variant */
-#define FL_ROUND_CLOCK		1	/**< type() of Round Clock variant */
-#define FL_ANALOG_CLOCK FL_SQUARE_CLOCK	/**< An analog clock is square */
-#define FL_DIGITAL_CLOCK FL_SQUARE_CLOCK /**< Not yet implemented */
-
-// fabien: Please keep the horizontal formatting of both images in class desc, 
-// don't lose vert. space for nothing!
-
-/**
-  \class Fl_Clock_Output
-  \brief This widget can be used to display a program-supplied time.
-  
-  The time shown on the clock is not updated. To display the current time,
-  use Fl_Clock instead.
-
-  \htmlonly <BR>  <table align=CENTER border=1 cellpadding=5 >  
-  <caption align=bottom>type() FL_SQUARE_CLOCK and FL_ROUND_CLOCK </caption> <TR><TD> \endhtmlonly
-  \image html clock.png  
-  \htmlonly </TD> <TD> \endhtmlonly
-  \image html round_clock.png 
-  \htmlonly </TD> </TR> </table> \endhtmlonly
-  \image latex clock.png "FL_SQUARE_CLOCK type" width=4cm
-  \image latex round_clock.png "FL_ROUND_CLOCK type" width=4cm
- */
-class FL_EXPORT Fl_Clock_Output : public Fl_Widget {
-  int hour_, minute_, second_;
-  ulong value_;
-  void drawhands(Fl_Color,Fl_Color); // part of draw
-protected:
-  void draw();
-  void draw(int X, int Y, int W, int H);
-public:
-
-  Fl_Clock_Output(int X, int Y, int W, int H, const char *L = 0);
-
-  void value(ulong v);	// set to this Unix time
-  
-  void value(int H, int m, int s);
-
-  /**
-    Returns the displayed time.
-    Returns the time in seconds since the UNIX epoch (January 1, 1970).
-    \see value(ulong)
-   */
-  ulong value() const {return value_;}
-
-  /**
-    Returns the displayed hour (0 to 23).
-    \see value(), minute(), second()
-   */
-  int hour() const {return hour_;}
-
-  /**
-    Returns the displayed minute (0 to 59).
-    \see value(), hour(), second()
-   */
-  int minute() const {return minute_;}
-
-  /**
-    Returns the displayed second (0 to 60, 60=leap second).
-    \see value(), hour(), minute()
-   */
-  int second() const {return second_;}
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_Clock_Output, Fl_Widget)
-};
-
-// a Fl_Clock displays the current time always by using a timeout:
-
-/**
-  \class Fl_Clock
-  \brief This widget provides a round analog clock display.
-
-  Fl_Clock is provided for Forms compatibility. 
-  It installs a 1-second timeout callback using Fl::add_timeout().
-  You can choose the rounded or square type of the clock with type(), see below.
-  \htmlonly <BR>  <table align=CENTER border=1 cellpadding=5 >  
-  <caption align=bottom>type() FL_SQUARE_CLOCK and FL_ROUND_CLOCK </caption> <TR><TD> \endhtmlonly
-  \image html clock.png  
-  \htmlonly </TD> <TD> \endhtmlonly
-  \image html round_clock.png 
-  \htmlonly </TD> </TR> </table> \endhtmlonly
-  \image latex clock.png "FL_SQUARE_CLOCK type" width=4cm  
-  \image latex round_clock.png "FL_ROUND_CLOCK type" width=4cm
- */
-class FL_EXPORT Fl_Clock : public Fl_Clock_Output {
-public:
-  int handle(int);
-
-  Fl_Clock(int X, int Y, int W, int H,  const char *L = 0);
-  
-  Fl_Clock(uchar t, int X, int Y, int W, int H, const char *L);
-  
-  ~Fl_Clock();
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_Clock, Fl_Clock_Output)
-};
-
-#endif
-
-//
-// End of "$Id: Fl_Clock.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
-//
+//
+// "$Id: Fl_Clock.H 12238 2017-05-15 15:35:30Z AlbrechtS $"
+//
+// Clock header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2017 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_Clock, Fl_Clock_Output widgets . */
+
+#ifndef Fl_Clock_H
+#define Fl_Clock_H
+
+#ifndef Fl_Widget_H
+#include "Fl_Widget.H"
+#endif
+
+// Values for type():
+// Please change doxygen documentation below (class Fl_Clock_Output)
+// accordingly as well when changing the following type values:
+
+#define FL_SQUARE_CLOCK		0	/**< type() of Square Clock variant */
+#define FL_ROUND_CLOCK		1	/**< type() of Round Clock variant */
+#define FL_ANALOG_CLOCK FL_SQUARE_CLOCK	/**< An analog clock is square */
+#define FL_DIGITAL_CLOCK FL_SQUARE_CLOCK /**< Not yet implemented */
+
+// fabien: Please keep the horizontal formatting of both images in class desc, 
+// don't lose vertical space for nothing!
+
+/**
+  \class Fl_Clock_Output
+  \brief This widget can be used to display a program-supplied time.
+
+  The time shown on the clock is not updated. To display the current time,
+  use Fl_Clock instead.
+
+  \htmlonly <BR>  <table align=CENTER border=1 cellpadding=5 >  
+  <caption align=bottom>type() FL_SQUARE_CLOCK and FL_ROUND_CLOCK </caption> <TR><TD> \endhtmlonly
+  \image html clock.png  
+  \htmlonly </TD> <TD> \endhtmlonly
+  \image html round_clock.png 
+  \htmlonly </TD> </TR> </table> \endhtmlonly
+  \image latex clock.png "FL_SQUARE_CLOCK type" width=4cm
+  \image latex round_clock.png "FL_ROUND_CLOCK type" width=4cm
+
+  Values for clock type() (\#include \<FL/Clock.H\>):
+
+  \code
+    #define FL_SQUARE_CLOCK		0	// Square Clock variant
+    #define FL_ROUND_CLOCK		1	// Round Clock variant
+    #define FL_ANALOG_CLOCK FL_SQUARE_CLOCK	// An analog clock is square
+    #define FL_DIGITAL_CLOCK FL_SQUARE_CLOCK	// Not yet implemented
+  \endcode
+
+ */
+class FL_EXPORT Fl_Clock_Output : public Fl_Widget {
+  int hour_, minute_, second_;
+  ulong value_;
+  int shadow_; // draw shadows of hands
+  void drawhands(Fl_Color,Fl_Color); // part of draw
+protected:
+  void draw();
+  void draw(int X, int Y, int W, int H);
+public:
+
+  Fl_Clock_Output(int X, int Y, int W, int H, const char *L = 0);
+
+  void value(ulong v);	// set to this Unix time
+  
+  void value(int H, int m, int s);
+
+  /**
+    Returns the displayed time.
+    Returns the time in seconds since the UNIX epoch (January 1, 1970).
+    \see value(ulong)
+   */
+  ulong value() const {return value_;}
+
+  /**
+    Returns the displayed hour (0 to 23).
+    \see value(), minute(), second()
+   */
+  int hour() const {return hour_;}
+
+  /**
+    Returns the displayed minute (0 to 59).
+    \see value(), hour(), second()
+   */
+  int minute() const {return minute_;}
+
+  /**
+    Returns the displayed second (0 to 60, 60=leap second).
+    \see value(), hour(), minute()
+   */
+  int second() const {return second_;}
+
+  /**
+    Returns the shadow drawing mode of the hands.
+
+    \returns	shadow drawing mode of the hands
+    \retval 0	no shadows
+    \retval 1	draw shadows of hands (default)
+  */
+  int shadow() const {return shadow_;}
+
+  /**
+    Sets the shadow drawing mode of the hands.
+
+    Enables (1) or disables (0) drawing the hands with shadows.
+
+    Values except 0 and 1 are reserved for future extensions and
+    yield undefined behavior.
+
+    The default is to draw the shadows (1).
+
+    \param[in]	mode	1 = shadows (default), 0 = no shadows
+  */
+  void shadow(int mode) { shadow_ = mode ? 1 : 0; }
+};
+
+// a Fl_Clock displays the current time always by using a timeout:
+
+/**
+  \class Fl_Clock
+  \brief This widget provides a round analog clock display.
+
+  Fl_Clock is provided for Forms compatibility. 
+  It installs a 1-second timeout callback using Fl::add_timeout().
+  You can choose the rounded or square type of the clock with type().
+  Please see Fl_Clock_Output widget for applicable values.
+
+  \htmlonly <BR>  <table align=CENTER border=1 cellpadding=5 >  
+  <caption align=bottom>type() FL_SQUARE_CLOCK and FL_ROUND_CLOCK </caption> <TR><TD> \endhtmlonly
+  \image html clock.png  
+  \htmlonly </TD> <TD> \endhtmlonly
+  \image html round_clock.png 
+  \htmlonly </TD> </TR> </table> \endhtmlonly
+  \image latex clock.png "FL_SQUARE_CLOCK type" width=4cm  
+  \image latex round_clock.png "FL_ROUND_CLOCK type" width=4cm
+
+  \see class Fl_Clock_Output
+ */
+class FL_EXPORT Fl_Clock : public Fl_Clock_Output {
+public:
+  int handle(int);
+
+  Fl_Clock(int X, int Y, int W, int H,  const char *L = 0);
+  
+  Fl_Clock(uchar t, int X, int Y, int W, int H, const char *L);
+  
+  ~Fl_Clock();
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_Clock, Fl_Clock_Output)
+};
+
+#endif
+
+//
+// End of "$Id: Fl_Clock.H 12238 2017-05-15 15:35:30Z AlbrechtS $".
+//

+ 194 - 198
fltk/FL/Fl_Color_Chooser.H

@@ -1,198 +1,194 @@
-//
-// "$Id: Fl_Color_Chooser.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
-//
-// Color chooser header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/** \file
-   Fl_Color_Chooser widget . */
-
-// The color chooser object and the color chooser popup.  The popup
-// is just a window containing a single color chooser and some boxes
-// to indicate the current and cancelled color.
-
-#ifndef Fl_Color_Chooser_H
-#define Fl_Color_Chooser_H
-
-#include <FL/Fl_Group.H>
-#include <FL/Fl_Box.H>
-#include <FL/Fl_Return_Button.H>
-#include <FL/Fl_Choice.H>
-#include <FL/Fl_Value_Input.H>
-
-#ifndef FL_DOXYGEN
-
-/** For internal use only */
-class FL_EXPORT Flcc_HueBox : public Fl_Widget {
-  int px, py;
-protected:
-  void draw();
-  int handle_key(int);
-public:
-  int handle(int);
-  Flcc_HueBox(int X, int Y, int W, int H) : Fl_Widget(X,Y,W,H) {
-  px = py = 0;}
-
-DECLARE_CLASS_CHEAP_RTTI_2(Flcc_HueBox, Fl_Widget)
-};
-
-/** For internal use only */
-class FL_EXPORT Flcc_ValueBox : public Fl_Widget {
-  int py;
-protected:
-  void draw();
-  int handle_key(int);
-public:
-  int handle(int);
-  Flcc_ValueBox(int X, int Y, int W, int H) : Fl_Widget(X,Y,W,H) {
-  py = 0;}
-
-DECLARE_CLASS_CHEAP_RTTI_2(Flcc_ValueBox, Fl_Widget)
-};
-
-/** For internal use only */
-class FL_EXPORT Flcc_Value_Input : public Fl_Value_Input {
-public:
-  int format(char*);
-  Flcc_Value_Input(int X, int Y, int W, int H) : Fl_Value_Input(X,Y,W,H) {}
-
-DECLARE_CLASS_CHEAP_RTTI_2(Flcc_Value_Input, Fl_Value_Input)
-};
-
-#endif // !FL_DOXYGEN
-
-/** \addtogroup group_comdlg 
-    @{ */
-
-/**
-  \class Fl_Color_Chooser
-  \brief The Fl_Color_Chooser widget provides a standard RGB color chooser.
-
-  \image html fl_color_chooser.jpg
-  \image latex fl_color_chooser.jpg "fl_color_chooser()" width=5cm
-
-  You can place any number of the widgets into a panel of your own design.
-  The diagram shows the widget as part of a color chooser dialog created by
-  the fl_color_chooser() function. The Fl_Color_Chooser widget contains the
-  hue box, value slider, and rgb input fields from the above diagram (it
-  does not have the color chips or the Cancel or OK buttons).
-  The callback is done every time the user changes the rgb value. It is not
-  done if they move the hue control in a way that produces the \e same rgb
-  value, such as when saturation or value is zero.
-
-  The fl_color_chooser() function pops up a window to let the user pick an
-  arbitrary RGB color. They can pick the hue and saturation in the "hue box"
-  on the left (hold down CTRL to just change the saturation), and the
-  brightness using the vertical slider. Or they can type the 8-bit numbers
-  into the RGB Fl_Value_Input fields, or drag the mouse across them to adjust
-  them.  The pull-down menu lets the user set the input fields to show RGB,
-  HSV, or 8-bit RGB (0 to 255).
-
-  fl_color_chooser() returns non-zero if the user picks ok, and updates the
-  RGB values.  If the user picks cancel or closes the window this returns
-  zero and leaves RGB unchanged.
-
-  If you use the color chooser on an 8-bit screen, it will allocate all the
-  available colors, leaving you no space to exactly represent the color the
-  user picks! You can however use fl_rectf() to fill a region with a simulated
-  color using dithering.
- */
-/** @} */
-class FL_EXPORT Fl_Color_Chooser : public Fl_Group {
-  Flcc_HueBox huebox;
-  Flcc_ValueBox valuebox;
-  Fl_Choice choice;
-  Flcc_Value_Input rvalue;
-  Flcc_Value_Input gvalue;
-  Flcc_Value_Input bvalue;
-  Fl_Box resize_box;
-  double hue_, saturation_, value_;
-  double r_, g_, b_;
-  void set_valuators();
-  static void rgb_cb(Fl_Widget*, void*);
-  static void mode_cb(Fl_Widget*, void*);
-public:
-  
-  /** 
-   Returns which Fl_Color_Chooser variant is currently active 
-   \return color modes are rgb(0), byte(1), hex(2), or hsv(3)   
-   */
-  int mode() {return choice.value();}
-  
-  /** 
-   Set which Fl_Color_Chooser variant is currently active 
-   \param[in] newMode color modes are rgb(0), byte(1), hex(2), or hsv(3)   
-   */
-  void mode(int newMode);
-  
-  /**
-    Returns the current hue.
-    0 <= hue < 6. Zero is red, one is yellow, two is green, etc.
-    <em>This value is convenient for the internal calculations - some other
-    systems consider hue to run from zero to one, or from 0 to 360.</em>
-   */
-  double hue() const {return hue_;}
-
-  /**
-    Returns the saturation.
-    0 <= saturation <= 1.
-   */
-  double saturation() const {return saturation_;}
-
-  /**
-    Returns the value/brightness.
-    0 <= value <= 1.
-   */
-  double value() const {return value_;}
-
-  /**
-    Returns the current red value.
-    0 <= r <= 1.
-   */
-  double r() const {return r_;}
-
-  /**
-    Returns the current green value.
-    0 <= g <= 1.
-   */
-  double g() const {return g_;}
-
-  /**
-    Returns the current blue value.
-    0 <= b <= 1.
-   */
-  double b() const {return b_;}
-
-  int hsv(double H, double S, double V);
-
-  int rgb(double R, double G, double B);
-
-  static void hsv2rgb(double H, double S, double V, double& R, double& G, double& B);
-
-  static void rgb2hsv(double R, double G, double B, double& H, double& S, double& V);
-
-  Fl_Color_Chooser(int X, int Y, int W, int H, const char *L = 0);
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_Color_Chooser, Fl_Group)
-};
-
-FL_EXPORT int fl_color_chooser(const char* name, double& r, double& g, double& b, int m=-1);
-FL_EXPORT int fl_color_chooser(const char* name, uchar& r, uchar& g, uchar& b, int m=-1);
-
-#endif
-
-//
-// End of "$Id: Fl_Color_Chooser.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
-//
+//
+// "$Id: Fl_Color_Chooser.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
+//
+// Color chooser header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2010 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/** \file
+   Fl_Color_Chooser widget . */
+
+// The color chooser object and the color chooser popup.  The popup
+// is just a window containing a single color chooser and some boxes
+// to indicate the current and cancelled color.
+
+#ifndef Fl_Color_Chooser_H
+#define Fl_Color_Chooser_H
+
+#include <FL/Fl_Group.H>
+#include <FL/Fl_Box.H>
+#include <FL/Fl_Return_Button.H>
+#include <FL/Fl_Choice.H>
+#include <FL/Fl_Value_Input.H>
+
+#ifndef FL_DOXYGEN
+
+/** For internal use only */
+class FL_EXPORT Flcc_HueBox : public Fl_Widget {
+  int px, py;
+protected:
+  void draw();
+  int handle_key(int);
+public:
+  int handle(int);
+  Flcc_HueBox(int X, int Y, int W, int H) : Fl_Widget(X,Y,W,H) {
+  px = py = 0;}
+DECLARE_CLASS_CHEAP_RTTI_2(Flcc_HueBox, Fl_Widget)
+};
+
+/** For internal use only */
+class FL_EXPORT Flcc_ValueBox : public Fl_Widget {
+  int py;
+protected:
+  void draw();
+  int handle_key(int);
+public:
+  int handle(int);
+  Flcc_ValueBox(int X, int Y, int W, int H) : Fl_Widget(X,Y,W,H) {
+  py = 0;}
+DECLARE_CLASS_CHEAP_RTTI_2(Flcc_ValueBox, Fl_Widget)
+};
+
+/** For internal use only */
+class FL_EXPORT Flcc_Value_Input : public Fl_Value_Input {
+public:
+  int format(char*);
+  Flcc_Value_Input(int X, int Y, int W, int H) : Fl_Value_Input(X,Y,W,H) {}
+DECLARE_CLASS_CHEAP_RTTI_2(Flcc_Value_Input, Fl_Value_Input)
+};
+
+#endif // !FL_DOXYGEN
+
+/** \addtogroup group_comdlg 
+    @{ */
+
+/**
+  \class Fl_Color_Chooser
+  \brief The Fl_Color_Chooser widget provides a standard RGB color chooser.
+
+  \image html fl_color_chooser.jpg
+  \image latex fl_color_chooser.jpg "fl_color_chooser()" width=5cm
+
+  You can place any number of the widgets into a panel of your own design.
+  The diagram shows the widget as part of a color chooser dialog created by
+  the fl_color_chooser() function. The Fl_Color_Chooser widget contains the
+  hue box, value slider, and rgb input fields from the above diagram (it
+  does not have the color chips or the Cancel or OK buttons).
+  The callback is done every time the user changes the rgb value. It is not
+  done if they move the hue control in a way that produces the \e same rgb
+  value, such as when saturation or value is zero.
+
+  The fl_color_chooser() function pops up a window to let the user pick an
+  arbitrary RGB color. They can pick the hue and saturation in the "hue box"
+  on the left (hold down CTRL to just change the saturation), and the
+  brightness using the vertical slider. Or they can type the 8-bit numbers
+  into the RGB Fl_Value_Input fields, or drag the mouse across them to adjust
+  them.  The pull-down menu lets the user set the input fields to show RGB,
+  HSV, or 8-bit RGB (0 to 255).
+
+  fl_color_chooser() returns non-zero if the user picks ok, and updates the
+  RGB values.  If the user picks cancel or closes the window this returns
+  zero and leaves RGB unchanged.
+
+  If you use the color chooser on an 8-bit screen, it will allocate all the
+  available colors, leaving you no space to exactly represent the color the
+  user picks! You can however use fl_rectf() to fill a region with a simulated
+  color using dithering.
+ */
+/** @} */
+class FL_EXPORT Fl_Color_Chooser : public Fl_Group {
+  Flcc_HueBox huebox;
+  Flcc_ValueBox valuebox;
+  Fl_Choice choice;
+  Flcc_Value_Input rvalue;
+  Flcc_Value_Input gvalue;
+  Flcc_Value_Input bvalue;
+  Fl_Box resize_box;
+  double hue_, saturation_, value_;
+  double r_, g_, b_;
+  void set_valuators();
+  static void rgb_cb(Fl_Widget*, void*);
+  static void mode_cb(Fl_Widget*, void*);
+public:
+  
+  /** 
+   Returns which Fl_Color_Chooser variant is currently active 
+   \return color modes are rgb(0), byte(1), hex(2), or hsv(3)   
+   */
+  int mode() {return choice.value();}
+  
+  /** 
+   Set which Fl_Color_Chooser variant is currently active 
+   \param[in] newMode color modes are rgb(0), byte(1), hex(2), or hsv(3)   
+   */
+  void mode(int newMode);
+  
+  /**
+    Returns the current hue.
+    0 <= hue < 6. Zero is red, one is yellow, two is green, etc.
+    <em>This value is convenient for the internal calculations - some other
+    systems consider hue to run from zero to one, or from 0 to 360.</em>
+   */
+  double hue() const {return hue_;}
+
+  /**
+    Returns the saturation.
+    0 <= saturation <= 1.
+   */
+  double saturation() const {return saturation_;}
+
+  /**
+    Returns the value/brightness.
+    0 <= value <= 1.
+   */
+  double value() const {return value_;}
+
+  /**
+    Returns the current red value.
+    0 <= r <= 1.
+   */
+  double r() const {return r_;}
+
+  /**
+    Returns the current green value.
+    0 <= g <= 1.
+   */
+  double g() const {return g_;}
+
+  /**
+    Returns the current blue value.
+    0 <= b <= 1.
+   */
+  double b() const {return b_;}
+
+  int hsv(double H, double S, double V);
+
+  int rgb(double R, double G, double B);
+
+  static void hsv2rgb(double H, double S, double V, double& R, double& G, double& B);
+
+  static void rgb2hsv(double R, double G, double B, double& H, double& S, double& V);
+
+  Fl_Color_Chooser(int X, int Y, int W, int H, const char *L = 0);
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_Color_Chooser, Fl_Group)
+};
+
+FL_EXPORT int fl_color_chooser(const char* name, double& r, double& g, double& b, int m=-1);
+FL_EXPORT int fl_color_chooser(const char* name, uchar& r, uchar& g, uchar& b, int m=-1);
+
+#endif
+
+//
+// End of "$Id: Fl_Color_Chooser.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
+//

+ 38 - 75
fltk/FL/Fl_Copy_Surface.H

@@ -1,5 +1,5 @@
 //
-// "$Id: Fl_Copy_Surface.H 10172 2014-05-24 16:21:46Z manolo $"
+// "$Id: Fl_Copy_Surface.H 12125 2016-11-30 07:09:48Z manolo $"
 //
 // Copy-to-clipboard code for the Fast Light Tool Kit (FLTK).
 //
@@ -19,12 +19,7 @@
 #ifndef Fl_Copy_Surface_H
 #define Fl_Copy_Surface_H
 
-#include <FL/Fl_Paged_Device.H>
-#include <FL/Fl_Printer.H>
-
-#if defined(__APPLE__)
-#include <ApplicationServices/ApplicationServices.h>
-#endif
+#include <FL/Fl_Widget_Surface.H>
 
 /** Supports copying of graphical data to the clipboard.
  
@@ -45,91 +40,59 @@
  \endcode
  Platform details:
  \li MSWindows: Transparent RGB images copy without transparency.
- The graphical data is copied to the clipboard as an 'enhanced metafile'.
- \li Mac OS: The graphical data is copied to the clipboard (a.k.a. pasteboard) in 2 'flavors': 
- 1) in vectorial form as PDF data; 2) in bitmap form as a TIFF image (or PICT for Mac OS 10.3). 
+ The graphical data are copied to the clipboard as an 'enhanced metafile'.
+ \li Mac OS: The graphical data are copied to the clipboard (a.k.a. pasteboard) in two 'flavors':
+ 1) in vectorial form as PDF data; 2) in bitmap form as a TIFF image. 
  Applications to which the clipboard content is pasted can use the flavor that suits them best.
- \li X11: the graphical data is copied to the clipboard as an image in BMP format.
+ \li X11: the graphical data are copied to the clipboard as an image in BMP format.
 */
-class Fl_Copy_Surface : public Fl_Surface_Device {
+class FL_EXPORT Fl_Copy_Surface : public Fl_Widget_Surface {
 private:
-  int width;
-  int height;
-  Fl_Paged_Device *helper;
-#ifdef __APPLE__
-  CFMutableDataRef pdfdata;
-  CGContextRef oldgc;
-  CGContextRef gc;
-  void prepare_copy_pdf_and_tiff(int w, int h);
-  void complete_copy_pdf_and_tiff();
-  void init_PDF_context(int w, int h);
-  static size_t MyPutBytes(void* info, const void* buffer, size_t count);
-#elif defined(WIN32)
-  HDC oldgc;
-  HDC gc;
-#else // Xlib
-  Fl_Offscreen xid;
-  Window oldwindow;
-  Fl_Surface_Device *_ss;
-#endif
+  class Fl_Copy_Surface_Driver *platform_surface;
+protected:
+  void translate(int x, int y);
+  void untranslate();
 public:
-  static const char *class_id;
-  const char *class_name() {return class_id;};
   Fl_Copy_Surface(int w, int h);
   ~Fl_Copy_Surface();
   void set_current();
-  void draw(Fl_Widget* widget, int delta_x = 0, int delta_y = 0);
+  /** Returns the pixel width of the copy surface */
+  int w();
+  /** Returns the pixel height of the copy surface */
+  int h();
+  void origin(int *x, int *y);
+  void origin(int x, int y);
+  int printable_rect(int *w, int *h);
 };
 
-#if defined(__APPLE__)
 
-/* Mac class to reimplement Fl_Paged_Device::printable_rect() */
-class Fl_Quartz_Surface_ : public Fl_System_Printer {
+/** A base class describing the interface between FLTK and draw-to-clipboard operations.
+ This class is only for internal use by the FLTK library.
+ A supported platform should implement the virtual methods of this class
+ in order to support drawing to the clipboard through class Fl_Copy_Surface.
+ */
+class Fl_Copy_Surface_Driver : public Fl_Widget_Surface {
+  friend class Fl_Copy_Surface;
 protected:
   int width;
   int height;
-public:
-  static const char *class_id;
-  const char *class_name() {return class_id;};
-  Fl_Quartz_Surface_(int w, int h);
-  virtual int printable_rect(int *w, int *h);
-  virtual ~Fl_Quartz_Surface_() {};
-};
-
-#elif defined(WIN32)
-
-/* Win class to implement translate()/untranslate() */
-class Fl_GDI_Surface_ : public Fl_Paged_Device {
-  int width;
-  int height;
-  unsigned depth;
-  POINT origins[10];
-public:
-  static const char *class_id;
-  const char *class_name() {return class_id;};
-  Fl_GDI_Surface_();
-  virtual void translate(int x, int y);
-  virtual void untranslate();
-  virtual ~Fl_GDI_Surface_();
-};
-
-#elif !defined(FL_DOXYGEN)
-
-/* Xlib class to implement translate()/untranslate() */
-class Fl_Xlib_Surface_ : public Fl_Paged_Device {
-public:
-  static const char *class_id;
-  const char *class_name() {return class_id;};
-  Fl_Xlib_Surface_();
-  virtual void translate(int x, int y);
-  virtual void untranslate();
-  virtual ~Fl_Xlib_Surface_();
+  Fl_Copy_Surface_Driver(int w, int h) : Fl_Widget_Surface(NULL), width(w), height(h) {}
+  virtual ~Fl_Copy_Surface_Driver() {}
+  virtual void set_current() {}
+  virtual void translate(int x, int y) {}
+  virtual void untranslate() {}
+  int printable_rect(int *w, int *h) {*w = width; *h = height; return 0;}
+  virtual Fl_RGB_Image *image() {return NULL;}
+  /** Each platform implements this function its own way.
+   It returns an object implementing all virtual functions
+   of class Fl_Copy_Surface_Driver for the plaform.
+   */
+  static Fl_Copy_Surface_Driver *newCopySurfaceDriver(int w, int h);
 };
 
-#endif
 
 #endif // Fl_Copy_Surface_H
 
 //
-// End of "$Id: Fl_Copy_Surface.H 10172 2014-05-24 16:21:46Z manolo $".
+// End of "$Id: Fl_Copy_Surface.H 12125 2016-11-30 07:09:48Z manolo $".
 //

+ 114 - 113
fltk/FL/Fl_Counter.H

@@ -1,113 +1,114 @@
-//
-// "$Id: Fl_Counter.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
-//
-// Counter header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_Counter widget . */
-
-// A numerical value with up/down step buttons.  From Forms.
-
-#ifndef Fl_Counter_H
-#define Fl_Counter_H
-
-#ifndef Fl_Valuator_H
-#include "Fl_Valuator.H"
-#endif
-
-// values for type():
-#define FL_NORMAL_COUNTER	0	/**< type() for counter with fast buttons */
-#define FL_SIMPLE_COUNTER	1	/**< type() for counter without fast buttons */
-
-/**
-  Controls a single floating point value with button (or keyboard) arrows.
-  Double arrows buttons achieve larger steps than simple arrows.
-  \see Fl_Spinner for value input with vertical step arrows.
-  <P align=center>\image html counter.png</P>
-  \image latex counter.png "Fl_Counter" width=4cm
-
-  \todo Refactor the doxygen comments for Fl_Counter type() documentation.
-
-  The type of an Fl_Counter object can be set using type(uchar t) to:
-  \li \c FL_NORMAL_COUNTER: Displays a counter with 4 arrow buttons.
-  \li \c FL_SIMPLE_COUNTER: Displays a counter with only 2 arrow buttons.
-*/
-class FL_EXPORT Fl_Counter : public Fl_Valuator {
-
-  Fl_Font textfont_;
-  Fl_Fontsize textsize_;
-  Fl_Color textcolor_;
-  double lstep_;
-  uchar mouseobj;
-  static void repeat_callback(void *);
-  int calc_mouseobj();
-  void increment_cb();
-
-public:
-
-  int handle(int);
-  void draw();
-
-  Fl_Counter(int X, int Y, int W, int H, const char* L = 0);
-  ~Fl_Counter();
-
-  /**
-    Sets the increment for the large step buttons.
-    The default value is 1.0.
-    \param[in] a large step increment.
-  */
-  void lstep(double a) {lstep_ = a;}
-
-  /**
-    Sets the increments for the normal and large step buttons.
-    \param[in] a, b normal and large step increments.
-  */
-  void step(double a,double b) {Fl_Valuator::step(a); lstep_ = b;}
-
-  /**
-    Sets the increment for the normal step buttons.
-    \param[in] a normal step increment.
-  */
-  void step(double a) {Fl_Valuator::step(a);}
-
-  /**
-    Returns the increment for normal step buttons.
-   */
-  double step() const {return Fl_Valuator::step();}
-
-  /** Gets the text font */
-  Fl_Font textfont() const {return textfont_;}
-  /** Sets the text font to \p s */
-  void textfont(Fl_Font s) {textfont_ = s;}
-
-  /** Gets the font size */
-  Fl_Fontsize textsize() const {return textsize_;}
-  /** Sets the font size to \p s */
-  void textsize(Fl_Fontsize s) {textsize_ = s;}
-
-  /** Gets the font color */
-  Fl_Color textcolor() const {return textcolor_;}
-  /** Sets the font color to \p s */
-  void textcolor(Fl_Color s) {textcolor_ = s;}
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_Counter, Fl_Valuator)
-};
-
-#endif
-
-//
-// End of "$Id: Fl_Counter.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
-//
+//
+// "$Id: Fl_Counter.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
+//
+// Counter header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2010 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_Counter widget . */
+
+// A numerical value with up/down step buttons.  From Forms.
+
+#ifndef Fl_Counter_H
+#define Fl_Counter_H
+
+#ifndef Fl_Valuator_H
+#include "Fl_Valuator.H"
+#endif
+
+// values for type():
+#define FL_NORMAL_COUNTER	0	/**< type() for counter with fast buttons */
+#define FL_SIMPLE_COUNTER	1	/**< type() for counter without fast buttons */
+
+/**
+  Controls a single floating point value with button (or keyboard) arrows.
+  Double arrows buttons achieve larger steps than simple arrows.
+  \see Fl_Spinner for value input with vertical step arrows.
+  <P align=center>\image html counter.png</P>
+  \image latex counter.png "Fl_Counter" width=4cm
+
+  \todo Refactor the doxygen comments for Fl_Counter type() documentation.
+
+  The type of an Fl_Counter object can be set using type(uchar t) to:
+  \li \c FL_NORMAL_COUNTER: Displays a counter with 4 arrow buttons.
+  \li \c FL_SIMPLE_COUNTER: Displays a counter with only 2 arrow buttons.
+*/
+class FL_EXPORT Fl_Counter : public Fl_Valuator {
+
+  Fl_Font textfont_;
+  Fl_Fontsize textsize_;
+  Fl_Color textcolor_;
+  double lstep_;
+  uchar mouseobj;
+  static void repeat_callback(void *);
+  int calc_mouseobj();
+  void increment_cb();
+
+
+public:
+
+  int handle(int);
+  void draw();
+
+  Fl_Counter(int X, int Y, int W, int H, const char* L = 0);
+  ~Fl_Counter();
+
+  /**
+    Sets the increment for the large step buttons.
+    The default value is 1.0.
+    \param[in] a large step increment.
+  */
+  void lstep(double a) {lstep_ = a;}
+
+  /**
+    Sets the increments for the normal and large step buttons.
+    \param[in] a, b normal and large step increments.
+  */
+  void step(double a,double b) {Fl_Valuator::step(a); lstep_ = b;}
+
+  /**
+    Sets the increment for the normal step buttons.
+    \param[in] a normal step increment.
+  */
+  void step(double a) {Fl_Valuator::step(a);}
+
+  /**
+    Returns the increment for normal step buttons.
+   */
+  double step() const {return Fl_Valuator::step();}
+
+  /** Gets the text font */
+  Fl_Font textfont() const {return textfont_;}
+  /** Sets the text font to \p s */
+  void textfont(Fl_Font s) {textfont_ = s;}
+
+  /** Gets the font size */
+  Fl_Fontsize textsize() const {return textsize_;}
+  /** Sets the font size to \p s */
+  void textsize(Fl_Fontsize s) {textsize_ = s;}
+
+  /** Gets the font color */
+  Fl_Color textcolor() const {return textcolor_;}
+  /** Sets the font color to \p s */
+  void textcolor(Fl_Color s) {textcolor_ = s;}
+
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_Counter, Fl_Valuator)
+};
+
+#endif
+
+//
+// End of "$Id: Fl_Counter.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
+//

+ 143 - 588
fltk/FL/Fl_Device.H

@@ -1,588 +1,143 @@
-//
-// "$Id: Fl_Device.H 10110 2014-02-22 14:51:50Z manolo $"
-//
-// Definition of classes Fl_Device, Fl_Graphics_Driver, Fl_Surface_Device, Fl_Display_Device
-// for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 2010-2012 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/** \file Fl_Device.H
- \brief declaration of classes Fl_Device, Fl_Graphics_Driver, Fl_Surface_Device,
- Fl_Display_Device, Fl_Device_Plugin.
-*/
-
-#ifndef Fl_Device_H
-#define Fl_Device_H
-
-#include <FL/x.H>
-#include <FL/Fl_Plugin.H>
-#include <FL/Fl_Image.H>
-#include <FL/Fl_Bitmap.H>
-#include <FL/Fl_Pixmap.H>
-#include <FL/Fl_RGB_Image.H>
-#include <stdlib.h>
-
-class Fl_Graphics_Driver;
-class Fl_Font_Descriptor;
-/** \brief Points to the driver that currently receives all graphics requests */
-FL_EXPORT extern Fl_Graphics_Driver *fl_graphics_driver;
-
-/**
- signature of image generation callback function.
- \param[in]  data  user data passed to function
- \param[in]  x,y,w position and width of scan line in image
- \param[out] buf   buffer for generated image data. You must copy \p w
- pixels from scanline \p y, starting at pixel \p x
- to this buffer.
- */
-typedef void (*Fl_Draw_Image_Cb)(void* data,int x,int y,int w,uchar* buf);
-
-// typedef what the x,y fields in a point are:
-#ifdef WIN32
-typedef int COORD_T;
-#  define XPOINT XPoint
-#elif defined(__APPLE__)
-typedef float COORD_T;
-typedef struct { float x; float y; } QPoint;
-#  define XPOINT QPoint
-extern float fl_quartz_line_width_;
-#else
-typedef short COORD_T;
-#  define XPOINT XPoint
-#endif
-
-/**
- \brief All graphical output devices and all graphics systems.
- */
-class FL_EXPORT Fl_Device {
-public:
-  /** A string that identifies each subclass of Fl_Device.
-     Function class_name() applied to a device of this class returns this string.
-   */
-  static const char *class_id;
-  /**
-   Returns the name of the class of this object.
-   Use of the class_name() function is discouraged because it will be removed from future FLTK versions.
-
-   The class of an instance of an Fl_Device subclass can be checked with code such as:
-   \code
-   if ( instance->class_name() == Fl_Printer::class_id ) { ... }
-   \endcode
-   */
-  virtual const char *class_name() {return class_id;};
-  /**
-   Virtual destructor.
-
-   The destructor of Fl_Device must be virtual to make the destructors of
-   derived classes being called correctly on destruction.
-   */
-  virtual ~Fl_Device() {};
-};
-
-#define FL_REGION_STACK_SIZE 10
-#define FL_MATRIX_STACK_SIZE 32
-/**
- \brief A virtual class subclassed for each graphics driver FLTK uses.
- *
- The virtual methods of this class are those that a graphics driver should implement to
- support all of FLTK drawing functions.
- <br> The public API for drawing operations is functionally presented in \ref drawing and as function lists
- in the \ref fl_drawings and \ref fl_attributes modules.
-  */
-class FL_EXPORT Fl_Graphics_Driver : public Fl_Device {
-public:
-  /** A 2D coordinate transformation matrix
-   */
-  struct matrix {double a, b, c, d, x, y;};
-private:
-  static const matrix m0;
-  Fl_Font font_; // current font
-  Fl_Fontsize size_; // current font size
-  Fl_Color color_; // current color
-  int sptr;
-  static const int matrix_stack_size = FL_MATRIX_STACK_SIZE;
-  matrix stack[FL_MATRIX_STACK_SIZE];
-  matrix m;
-  int n, p_size, gap_;
-  XPOINT *p;
-  int what;
-  int fl_clip_state_number;
-  int rstackptr;
-  static const int region_stack_max = FL_REGION_STACK_SIZE - 1;
-  Fl_Region rstack[FL_REGION_STACK_SIZE];
-#ifdef WIN32
-  int numcount;
-  int counts[20];
-#endif
-  Fl_Font_Descriptor *font_descriptor_;
-  void transformed_vertex0(COORD_T x, COORD_T y);
-  void fixloop();
-
-protected:
-#ifndef FL_DOXYGEN
-  enum {LINE, LOOP, POLYGON, POINT_};
-  inline int vertex_no() { return n; }
-  inline XPOINT *vertices() {return p;}
-  inline int vertex_kind() {return what;}
-#endif
-/*  ** \brief red color for background and/or mixing if device does not support masking or alpha *
-  uchar bg_r_;
-  ** \brief green color for background and/or mixing if device does not support masking or alpha *
-  uchar bg_g_;
-  ** \brief blue color for background and/or mixing if device does not support masking or alpha *
-  uchar bg_b_; */
-  friend class Fl_Pixmap;
-  friend class Fl_Bitmap;
-  friend class Fl_RGB_Image;
-  friend void fl_rect(int x, int y, int w, int h);
-  friend void fl_rectf(int x, int y, int w, int h);
-  friend void fl_line_style(int style, int width, char* dashes);
-  friend void fl_xyline(int x, int y, int x1);
-  friend void fl_xyline(int x, int y, int x1, int y2);
-  friend void fl_xyline(int x, int y, int x1, int y2, int x3);
-  friend void fl_yxline(int x, int y, int y1);
-  friend void fl_yxline(int x, int y, int y1, int x2);
-  friend void fl_yxline(int x, int y, int y1, int x2, int y3);
-  friend void fl_line(int x, int y, int x1, int y1);
-  friend void fl_line(int x, int y, int x1, int y1, int x2, int y2);
-  friend void fl_draw(const char *str, int n, int x, int y);
-#ifdef __APPLE__
-  friend void fl_draw(const char *str, int n, float x, float y);
-#endif
-  friend void fl_draw(int angle, const char *str, int n, int x, int y);
-  friend void fl_rtl_draw(const char *str, int n, int x, int y);
-  friend void fl_font(Fl_Font face, Fl_Fontsize size);
-  friend void fl_color(Fl_Color c);
-  friend void fl_color(uchar r, uchar g, uchar b);
-  friend void fl_point(int x, int y);
-  friend void fl_loop(int x0, int y0, int x1, int y1, int x2, int y2);
-  friend void fl_loop(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3);
-  friend void fl_polygon(int x0, int y0, int x1, int y1, int x2, int y2);
-  friend void fl_polygon(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3);
-  friend void fl_begin_points();
-  friend void fl_begin_line();
-  friend void fl_begin_loop();
-  friend void fl_begin_polygon();
-  friend void fl_vertex(double x, double y);
-  friend void fl_curve(double X0, double Y0, double X1, double Y1, double X2, double Y2, double X3, double Y3);
-  friend void fl_circle(double x, double y, double r);
-  friend void fl_arc(double x, double y, double r, double start, double end);
-  friend void fl_arc(int x, int y, int w, int h, double a1, double a2);
-  friend void fl_pie(int x, int y, int w, int h, double a1, double a2);
-  friend void fl_end_points();
-  friend void fl_end_line();
-  friend void fl_end_loop();
-  friend void fl_end_polygon();
-  friend void fl_transformed_vertex(double xf, double yf);
-  friend void fl_push_clip(int x, int y, int w, int h);
-  friend int fl_clip_box(int x, int y, int w, int h, int &X, int &Y, int &W, int &H);
-  friend int fl_not_clipped(int x, int y, int w, int h);
-  friend void fl_push_no_clip();
-  friend void fl_pop_clip();
-  friend void fl_begin_complex_polygon();
-  friend void fl_gap();
-  friend void fl_end_complex_polygon();
-  friend void fl_push_matrix();
-  friend void fl_pop_matrix();
-  friend void fl_mult_matrix(double a, double b, double c, double d, double x, double y);
-  friend void fl_scale(double x, double y);
-  friend void fl_scale(double x);
-  friend void fl_translate(double x, double y);
-  friend void fl_rotate(double d);
-  friend double fl_transform_x(double x, double y);
-  friend double fl_transform_y(double x, double y);
-  friend double fl_transform_dx(double x, double y);
-  friend double fl_transform_dy(double x, double y);
-  friend Fl_Region fl_clip_region();
-  friend void fl_clip_region(Fl_Region r);
-  friend void fl_restore_clip();
-
-  friend void fl_draw_image(const uchar* buf, int X,int Y,int W,int H, int D, int L);
-  friend void fl_draw_image_mono(const uchar* buf, int X,int Y,int W,int H, int D, int L);
-  friend void fl_draw_image(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D);
-  friend FL_EXPORT void fl_draw_image_mono(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D);
-  friend FL_EXPORT void gl_start();
-  friend void fl_copy_offscreen(int x, int y, int w, int h, Fl_Offscreen pixmap, int srcx, int srcy);
-  matrix *fl_matrix; /**< Points to the current coordinate transformation matrix */
-
-  /** \brief The constructor. */
-  Fl_Graphics_Driver();
-  /** \brief see fl_rect(int x, int y, int w, int h). */
-  virtual void rect(int x, int y, int w, int h);
-  /** \brief see fl_rectf(int x, int y, int w, int h). */
-  virtual void rectf(int x, int y, int w, int h);
-  /** \brief see fl_line_style(int style, int width, char* dashes). */
-  virtual void line_style(int style, int width=0, char* dashes=0);
-  /** \brief see fl_xyline(int x, int y, int x1). */
-  virtual void xyline(int x, int y, int x1);
-  /** \brief see fl_xyline(int x, int y, int x1, int y2). */
-  virtual void xyline(int x, int y, int x1, int y2);
-  /** \brief see fl_xyline(int x, int y, int x1, int y2, int x3). */
-  virtual void xyline(int x, int y, int x1, int y2, int x3);
-  /** \brief see fl_yxline(int x, int y, int y1). */
-  virtual void yxline(int x, int y, int y1);
-  /** \brief see fl_yxline(int x, int y, int y1, int x2). */
-  virtual void yxline(int x, int y, int y1, int x2);
-  /** \brief see fl_yxline(int x, int y, int y1, int x2, int y3). */
-  virtual void yxline(int x, int y, int y1, int x2, int y3);
-  /** \brief see fl_line(int x, int y, int x1, int y1). */
-  virtual void line(int x, int y, int x1, int y1);
-  /** \brief see fl_line(int x, int y, int x1, int y1, int x2, int y2). */
-  virtual void line(int x, int y, int x1, int y1, int x2, int y2);
-  /** \brief see fl_draw(const char *str, int n, int x, int y). */
-  virtual void draw(const char *str, int n, int x, int y) {}
-#ifdef __APPLE__
-  virtual void draw(const char *str, int n, float x, float y) { draw(str, n, (int)(x+0.5), (int)(y+0.5));}
-#endif
-  /** \brief see fl_draw(int angle, const char *str, int n, int x, int y). */
-  virtual void draw(int angle, const char *str, int n, int x, int y) {}
-  /** \brief see fl_rtl_draw(const char *str, int n, int x, int y). */
-  virtual void rtl_draw(const char *str, int n, int x, int y) {};
-  /** \brief see fl_color(Fl_Color c). */
-  virtual void color(Fl_Color c) {color_ = c;}
-  /** \brief see fl_color(uchar r, uchar g, uchar b). */
-  virtual void color(uchar r, uchar g, uchar b) {}
-  /** \brief see fl_point(int x, int y). */
-  virtual void point(int x, int y);
-  /** \brief see fl_loop(int x0, int y0, int x1, int y1, int x2, int y2). */
-  virtual void loop(int x0, int y0, int x1, int y1, int x2, int y2);
-  /** \brief see fl_loop(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3). */
-  virtual void loop(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3);
-  /** \brief see fl_polygon(int x0, int y0, int x1, int y1, int x2, int y2). */
-  virtual void polygon(int x0, int y0, int x1, int y1, int x2, int y2);
-  /** \brief see fl_polygon(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3). */
-  virtual void polygon(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3);
-  /** \brief see fl_begin_points(). */
-  virtual void begin_points();
-  /** \brief see fl_begin_line(). */
-  virtual void begin_line();
-  /** \brief see fl_begin_loop(). */
-  virtual void begin_loop();
-  /** \brief see fl_begin_polygon(). */
-  virtual void begin_polygon();
-  /** \brief see fl_vertex(double x, double y). */
-  virtual void vertex(double x, double y);
-  /** \brief see fl_curve(double X0, double Y0, double X1, double Y1, double X2, double Y2, double X3, double Y3). */
-  virtual void curve(double X0, double Y0, double X1, double Y1, double X2, double Y2, double X3, double Y3);
-  /** \brief see fl_circle(double x, double y, double r). */
-  virtual void circle(double x, double y, double r);
-  /** \brief see fl_arc(double x, double y, double r, double start, double end). */
-  virtual void arc(double x, double y, double r, double start, double end);
-  /** \brief see fl_arc(int x, int y, int w, int h, double a1, double a2). */
-  virtual void arc(int x, int y, int w, int h, double a1, double a2);
-  /** \brief see fl_pie(int x, int y, int w, int h, double a1, double a2). */
-  virtual void pie(int x, int y, int w, int h, double a1, double a2);
-  /** \brief see fl_end_points(). */
-  virtual void end_points();
-  /** \brief see fl_end_line(). */
-  virtual void end_line();
-  /** \brief see fl_end_loop(). */
-  virtual void end_loop();
-  /** \brief see fl_end_polygon(). */
-  virtual void end_polygon();
-  /** \brief see fl_begin_complex_polygon(). */
-  virtual void begin_complex_polygon();
-  /** \brief see fl_gap(). */
-  virtual void gap();
-  /** \brief see fl_end_complex_polygon(). */
-  virtual void end_complex_polygon();
-  /** \brief see fl_transformed_vertex(double xf, double yf). */
-  virtual void transformed_vertex(double xf, double yf);
-  /** \brief see fl_push_clip(int x, int y, int w, int h). */
-  virtual void push_clip(int x, int y, int w, int h);
-  /** \brief see fl_clip_box(int x, int y, int w, int h, int &X, int &Y, int &W, int &H). */
-  virtual int clip_box(int x, int y, int w, int h, int &X, int &Y, int &W, int &H);
-  /** \brief see fl_not_clipped(int x, int y, int w, int h). */
-  virtual int not_clipped(int x, int y, int w, int h);
-  /** \brief see fl_push_no_clip(). */
-  virtual void push_no_clip();
-  /** \brief see fl_pop_clip(). */
-  virtual void pop_clip();
-
-  /** \brief see fl_push_matrix(). */
-  void push_matrix();
-  /** \brief see fl_pop_matrix(). */
-  void pop_matrix();
-  /** \brief see fl_mult_matrix(double a, double b, double c, double d, double x, double y). */
-  void mult_matrix(double a, double b, double c, double d, double x, double y);
-  /** \brief see fl_scale(double x, double y). */
-  inline void scale(double x, double y) { mult_matrix(x,0,0,y,0,0); }
-  /** \brief see fl_scale(double x). */
-  inline void scale(double x) { mult_matrix(x,0,0,x,0,0); }
-  /** \brief see fl_translate(double x, double y). */
-  inline void translate(double x,double y) { mult_matrix(1,0,0,1,x,y); }
-  /** \brief see fl_rotate(double d). */
-  void rotate(double d);
-  /** \brief see fl_transform_x(double x, double y). */
-  double transform_x(double x, double y);
-  /** \brief see fl_transform_y(double x, double y). */
-  double transform_y(double x, double y);
-  /** \brief see fl_transform_dx(double x, double y). */
-  double transform_dx(double x, double y);
-  /** \brief see fl_transform_dy(double x, double y). */
-  double transform_dy(double x, double y);
-  /** \brief see fl_clip_region(). */
-  Fl_Region clip_region();
-  /** \brief see fl_clip_region(Fl_Region r). */
-  void clip_region(Fl_Region r);
-  /** \brief see fl_restore_clip(). */
-  void restore_clip();
-
-  // Images
-  /** \brief see fl_draw_image(const uchar* buf, int X,int Y,int W,int H, int D, int L). */
-  virtual   void draw_image(const uchar* buf, int X,int Y,int W,int H, int D=3, int L=0) {}
-  /** \brief see fl_draw_image_mono(const uchar* buf, int X,int Y,int W,int H, int D, int L). */
-  virtual   void draw_image_mono(const uchar* buf, int X,int Y,int W,int H, int D=1, int L=0) {}
-  /** \brief see fl_draw_image(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D). */
-  virtual   void draw_image(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=3) {}
-  /** \brief see fl_draw_image_mono(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D). */
-  virtual   void draw_image_mono(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=1) {}
-  // Image classes
-  /** \brief Draws an Fl_RGB_Image object to the device.
-   *
-   Specifies a bounding box for the image, with the origin (upper left-hand corner) of
-   the image offset by the cx and cy arguments.
-   */
-  virtual   void draw(Fl_RGB_Image * rgb,int XP, int YP, int WP, int HP, int cx, int cy) {}
-  /** \brief Draws an Fl_Pixmap object to the device.
-   *
-   Specifies a bounding box for the image, with the origin (upper left-hand corner) of
-   the image offset by the cx and cy arguments.
-   */
-  virtual   void draw(Fl_Pixmap * pxm,int XP, int YP, int WP, int HP, int cx, int cy) {}
-  /** \brief Draws an Fl_Bitmap object to the device.
-   *
-   Specifies a bounding box for the image, with the origin (upper left-hand corner) of
-   the image offset by the cx and cy arguments.
-   */
-  virtual void draw(Fl_Bitmap *bm, int XP, int YP, int WP, int HP, int cx, int cy) {}
-#if FLTK_ABI_VERSION >= 10301
-  virtual
-#endif
-  void copy_offscreen(int x, int y, int w, int h, Fl_Offscreen pixmap, int srcx, int srcy);
-
-public:
-  static const char *class_id;
-  virtual const char *class_name() {return class_id;};
-  /** \brief see fl_font(Fl_Font face, Fl_Fontsize size). */
-  virtual void font(Fl_Font face, Fl_Fontsize fsize) {font_ = face; size_ = fsize;}
-  /** \brief see fl_font(void). */
-  Fl_Font font() {return font_; }
-  /** \brief see fl_size(). */
-  Fl_Fontsize size() {return size_; }
-  /** \brief see fl_width(const char *str, int n). */
-  virtual double width(const char *str, int n) {return 0;}
-  /** \brief see fl_width(unsigned int n). */
-  virtual inline double width(unsigned int c) { char ch = (char)c; return width(&ch, 1); }
-  /** \brief see fl_text_extents(const char*, int n, int& dx, int& dy, int& w, int& h). */
-  virtual void text_extents(const char*, int n, int& dx, int& dy, int& w, int& h);
-  /** \brief see fl_height(). */
-  virtual int height() {return size();}
-  /** \brief see fl_descent(). */
-  virtual int descent() {return 0;}
-  /** \brief see fl_color(void). */
-  Fl_Color color() {return color_;}
-  /** Returns a pointer to the current Fl_Font_Descriptor for the graphics driver */
-  inline Fl_Font_Descriptor *font_descriptor() { return font_descriptor_;}
-  /** Sets the current Fl_Font_Descriptor for the graphics driver */
-  inline void font_descriptor(Fl_Font_Descriptor *d) { font_descriptor_ = d;}
-  /** \brief The destructor */
-  virtual ~Fl_Graphics_Driver() { if (p) free(p); }
-  virtual int xdpi(){return 0;}
-  virtual int ydpi(){return 0;}
-};
-
-#if defined(__APPLE__) || defined(FL_DOXYGEN)
-/**
- \brief The Mac OS X-specific graphics class.
- *
- This class is implemented only on the Mac OS X platform.
- */
-class FL_EXPORT Fl_Quartz_Graphics_Driver : public Fl_Graphics_Driver {
-public:
-  static const char *class_id;
-  const char *class_name() {return class_id;};
-  void color(Fl_Color c);
-  void color(uchar r, uchar g, uchar b);
-  void draw(const char* str, int n, int x, int y);
-#ifdef __APPLE__
-  void draw(const char *str, int n, float x, float y);
-#endif
-  void draw(int angle, const char *str, int n, int x, int y);
-  void rtl_draw(const char* str, int n, int x, int y);
-  void font(Fl_Font face, Fl_Fontsize size);
-  void draw(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy);
-  void draw(Fl_Bitmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy);
-  void draw(Fl_RGB_Image *img, int XP, int YP, int WP, int HP, int cx, int cy);
-  void draw_image(const uchar* buf, int X,int Y,int W,int H, int D=3, int L=0);
-  void draw_image(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=3);
-  void draw_image_mono(const uchar* buf, int X,int Y,int W,int H, int D=1, int L=0);
-  void draw_image_mono(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=1);
-  double width(const char *str, int n);
-  double width(unsigned int c);
-  void text_extents(const char*, int n, int& dx, int& dy, int& w, int& h);
-  int height();
-  int descent();
-#if ! defined(FL_DOXYGEN)
-  static Fl_Offscreen create_offscreen_with_alpha(int w, int h);
-#endif
-  void copy_offscreen(int x, int y, int w, int h, Fl_Offscreen pixmap, int srcx, int srcy);
-};
-#endif
-#if defined(WIN32) || defined(FL_DOXYGEN)
-/**
- \brief The MSWindows-specific graphics class.
- *
- This class is implemented only on the MSWindows platform.
- */
-class FL_EXPORT Fl_GDI_Graphics_Driver : public Fl_Graphics_Driver {
-public:
-  static const char *class_id;
-  const char *class_name() {return class_id;};
-  void color(Fl_Color c);
-  void color(uchar r, uchar g, uchar b);
-  void draw(const char* str, int n, int x, int y);
-  void draw(int angle, const char *str, int n, int x, int y);
-  void rtl_draw(const char* str, int n, int x, int y);
-  void font(Fl_Font face, Fl_Fontsize size);
-  void draw(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy);
-  void draw(Fl_Bitmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy);
-  void draw(Fl_RGB_Image *img, int XP, int YP, int WP, int HP, int cx, int cy);
-  void draw_image(const uchar* buf, int X,int Y,int W,int H, int D=3, int L=0);
-  void draw_image(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=3);
-  void draw_image_mono(const uchar* buf, int X,int Y,int W,int H, int D=1, int L=0);
-  void draw_image_mono(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=1);
-  double width(const char *str, int n);
-  double width(unsigned int c);
-  void text_extents(const char*, int n, int& dx, int& dy, int& w, int& h);
-  int height();
-  int descent();
-#if ! defined(FL_DOXYGEN)
-  void copy_offscreen_with_alpha(int x,int y,int w,int h,HBITMAP bitmap,int srcx,int srcy);
-#endif
-  void copy_offscreen(int x, int y, int w, int h, Fl_Offscreen pixmap, int srcx, int srcy);
-};
-
-/**
- The graphics driver used when printing on MSWindows.
- *
- This class is implemented only on the MSWindows platform. It 's extremely similar to Fl_GDI_Graphics_Driver.
- */
-class FL_EXPORT Fl_GDI_Printer_Graphics_Driver : public Fl_GDI_Graphics_Driver {
-public:
-  static const char *class_id;
-  const char *class_name() {return class_id;};
-  void draw(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy);
-  void draw(Fl_Bitmap *bm, int XP, int YP, int WP, int HP, int cx, int cy);
-};
-#endif
-#if !(defined(__APPLE__) || defined(WIN32))
-/**
- \brief The Xlib-specific graphics class.
- *
- This class is implemented only on the Xlib platform.
- */
-class Fl_Xlib_Graphics_Driver : public Fl_Graphics_Driver {
-public:
-  static const char *class_id;
-  const char *class_name() {return class_id;};
-  void color(Fl_Color c);
-  void color(uchar r, uchar g, uchar b);
-  void draw(const char* str, int n, int x, int y);
-  void draw(int angle, const char *str, int n, int x, int y);
-  void rtl_draw(const char* str, int n, int x, int y);
-  void font(Fl_Font face, Fl_Fontsize size);
-  void draw(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy);
-  void draw(Fl_Bitmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy);
-  void draw(Fl_RGB_Image *img, int XP, int YP, int WP, int HP, int cx, int cy);
-  void draw_image(const uchar* buf, int X,int Y,int W,int H, int D=3, int L=0);
-  void draw_image(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=3);
-  void draw_image_mono(const uchar* buf, int X,int Y,int W,int H, int D=1, int L=0);
-  void draw_image_mono(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=1);
-  double width(const char *str, int n);
-  double width(unsigned int c);
-  void text_extents(const char*, int n, int& dx, int& dy, int& w, int& h);
-  int height();
-  int descent();
-  void copy_offscreen(int x, int y, int w, int h, Fl_Offscreen pixmap, int srcx, int srcy);
-};
-#endif
-
-/**
- \brief A surface that's susceptible to receive graphical output.
- */
-class FL_EXPORT Fl_Surface_Device : public Fl_Device {
-  /** \brief The graphics driver in use by this surface. */
-  Fl_Graphics_Driver *_driver;
-  static Fl_Surface_Device *_surface; // the surface that currently receives graphics output
-protected:
-  /** \brief Constructor that sets the graphics driver to use for the created surface. */
-  Fl_Surface_Device(Fl_Graphics_Driver *graphics_driver) {_driver = graphics_driver; };
-public:
-  static const char *class_id;
-  const char *class_name() {return class_id;};
-  virtual void set_current(void);
-  /** \brief Sets the graphics driver of this drawing surface. */
-  inline void driver(Fl_Graphics_Driver *graphics_driver) {_driver = graphics_driver;};
-  /** \brief Returns the graphics driver of this drawing surface. */
-  inline Fl_Graphics_Driver *driver() {return _driver; };
-  /** \brief the surface that currently receives graphics output */
-  static inline Fl_Surface_Device *surface() {return _surface; };
-  /** \brief The destructor. */
-  virtual ~Fl_Surface_Device() {}
-  virtual int xdpi(){return 0;}
-  virtual int ydpi(){return 0;}
-};
-
-/**
- \brief A display to which the computer can draw.
- */
-class FL_EXPORT Fl_Display_Device : public Fl_Surface_Device {
-  static Fl_Display_Device *_display; // the platform display device
-public:
-  static const char *class_id;
-  const char *class_name() {return class_id;};
-  /** \brief A constructor that sets the graphics driver used by the display */
-  Fl_Display_Device(Fl_Graphics_Driver *graphics_driver);
-  /** Returns the platform display device. */
-  static inline Fl_Display_Device *display_device() {return _display;};
-};
-
-/**
- This plugin socket allows the integration of new device drivers for special
- window or screen types. It is currently used to provide an automated printing
- service for OpenGL windows, if linked with fltk_gl.
- */
-class FL_EXPORT Fl_Device_Plugin : public Fl_Plugin {
-public:
-  /** \brief The constructor */
-  Fl_Device_Plugin(const char *pluginName)
-  : Fl_Plugin(klass(), pluginName) { }
-  /** \brief Returns the class name */
-  virtual const char *klass() { return "fltk:device"; }
-  /** \brief Returns the plugin name */
-  virtual const char *name() = 0;
-  /** \brief Prints a widget
-   \param w the widget
-   \param x,y offsets where to print relatively to coordinates origin
-   \param height height of the current drawing area
-   */
-  virtual int print(Fl_Widget* w, int x, int y, int height) = 0;
-};
-
-#endif // Fl_Device_H
-
-//
-// End of "$Id: Fl_Device.H 10110 2014-02-22 14:51:50Z manolo $".
-//
+//
+// "$Id: Fl_Device.H 12226 2017-04-25 12:42:22Z manolo $"
+//
+// Definition of classes Fl_Surface_Device, Fl_Display_Device
+// for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 2010-2017 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/** \file Fl_Device.H 
+ \brief declaration of classes Fl_Surface_Device, Fl_Display_Device, Fl_Device_Plugin.
+*/
+
+#ifndef Fl_Device_H
+#define Fl_Device_H
+
+#include <FL/Fl_Plugin.H>
+#include <stdlib.h>
+
+class Fl_Graphics_Driver;
+class Fl_RGB_Image;
+class Fl_Widget;
+
+/**
+ A drawing surface that's susceptible to receive graphical output.
+ Any FLTK application has at any time a current drawing surface to which all drawing requests are directed.
+ The current surface is given by Fl_Surface_Device::surface().
+ When main() begins running, the current drawing surface has been set to the computer's display, 
+ an instance of the Fl_Display_Device class.
+
+ A drawing surface other than the computer's display, is typically used as follows:
+ <ol><li> Create \c surface, an object from a particular Fl_Surface_Device derived class (e.g., Fl_Copy_Surface, Fl_Printer).
+ <li> Call \c Fl_Surface_Device::push_current(surface); to redirect all graphics requests to \c surface which becomes the new
+ current drawing surface (not necessary with class Fl_Printer because it is done by Fl_Printer::start_job()).
+ <li> At this point all of the \ref fl_drawings (e.g., fl_rect()) or the \ref fl_attributes or \ref drawing_images functions
+ (e.g., fl_draw_image(), Fl_Image::draw()) operate on the new current drawing surface.
+ Certain drawing surfaces allow additional ways to draw to them (e.g., Fl_Printer::print_widget(), Fl_Image_Surface::draw()).
+ <li> After all drawing requests have been performed, redirect graphics requests back to their previous destination
+ with \c Fl_Surface_Device::pop_current();.
+ <li> Delete \c surface.
+ </ol>
+ For back-compatibility, it is also possible to use the Fl_Surface_Device::set_current() member function
+ to change the current drawing surface, once to the new surface, once to the previous one.
+ */
+class FL_EXPORT Fl_Surface_Device {
+  /** The graphics driver in use by this surface. */
+  Fl_Graphics_Driver *pGraphicsDriver;
+  static Fl_Surface_Device *surface_; // the surface that currently receives graphics requests
+  static Fl_Surface_Device *default_surface(); // create surface if none exists yet
+  /* Some drawing surfaces (e.g., Fl_XXX_Image_Surface_Driver) re-implement this.
+   Gets called each time a surface ceases to be the current drawing surface.
+   The next_current argument gives the drawing surface that will become current next */
+  virtual void end_current_(Fl_Surface_Device *next_current) {}
+protected:
+  /** Constructor that sets the graphics driver to use for the created surface. */
+  Fl_Surface_Device(Fl_Graphics_Driver *graphics_driver) {pGraphicsDriver = graphics_driver; }
+public:
+  /** A string that identifies each subclass of Fl_Device.
+     Function class_name() applied to a device of this class returns this string.
+   */
+  static const char *class_id;
+  /**
+   Returns the name of the class of this object.
+   Use of the class_name() function is discouraged because it will be removed from future FLTK versions.
+
+   The class of an instance of an Fl_Device subclass can be checked with code such as:
+   \code
+   if ( instance->class_name() == Fl_Printer::class_id ) { ... }
+   \endcode
+   */
+  virtual const char *class_name() {return class_id;};
+  virtual void set_current(void);
+  /** \brief Sets the graphics driver of this drawing surface. */
+  inline void driver(Fl_Graphics_Driver *graphics_driver) {pGraphicsDriver = graphics_driver;};
+  /** \brief Returns the graphics driver of this drawing surface. */
+  inline Fl_Graphics_Driver *driver() {return pGraphicsDriver; };
+  /** The current drawing surface.
+   In other words, the Fl_Surface_Device object that currently receives all graphics requests */
+  static inline Fl_Surface_Device *surface() {
+    return surface_ ? surface_ : default_surface();
+  };
+  /** \brief The destructor. */
+  virtual ~Fl_Surface_Device();
+  static void push_current(Fl_Surface_Device *new_current);
+  static Fl_Surface_Device *pop_current();
+};
+
+/**
+ A display to which the computer can draw.
+ When the program begins running, an object of class Fl_Display_Device has been created and made the current drawing surface.
+ */
+class FL_EXPORT Fl_Display_Device : public Fl_Surface_Device {
+  Fl_Display_Device(Fl_Graphics_Driver *graphics_driver);
+public:
+  static Fl_Display_Device *display_device();
+
+  static const char *class_id;
+  const char *class_name() {return class_id;};
+};
+
+/**
+ This plugin socket allows the integration of new device drivers for special
+ window or screen types. 
+ This class is not intended for use outside the FLTK library.
+ It is currently used to provide an automated printing
+ service and screen capture for OpenGL windows, if linked with fltk_gl.
+ */
+class FL_EXPORT Fl_Device_Plugin : public Fl_Plugin {
+public:
+  /** \brief The constructor */
+  Fl_Device_Plugin(const char *pluginName)
+  : Fl_Plugin(klass(), pluginName) { }
+  /** \brief Returns the class name */
+  virtual const char *klass() { return "fltk:device"; }
+  /** \brief Returns the plugin name */
+  virtual const char *name() = 0;
+  /** \brief Prints a widget 
+   \param w the widget
+   \param x,y offsets where to print relatively to coordinates origin
+   \param height height of the current drawing area
+   */
+  virtual int print(Fl_Widget* w, int x, int y, int height) = 0;
+  /** captures a rectangle of a widget as an image
+   \return The captured pixels as an RGB image
+   */
+  virtual Fl_RGB_Image* rectangle_capture(Fl_Widget *widget, int x, int y, int w, int h) = 0;
+};
+
+#endif // Fl_Device_H
+
+//
+// End of "$Id: Fl_Device.H 12226 2017-04-25 12:42:22Z manolo $".
+//

+ 89 - 89
fltk/FL/Fl_Dial.H

@@ -1,89 +1,89 @@
-//
-// "$Id: Fl_Dial.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
-//
-// Dial header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_Dial widget . */
-
-#ifndef Fl_Dial_H
-#define Fl_Dial_H
-
-#ifndef Fl_Valuator_H
-#include "Fl_Valuator.H"
-#endif
-
-// values for type():
-#define FL_NORMAL_DIAL	0	/**< type() for dial variant with dot */
-#define FL_LINE_DIAL	1	/**< type() for dial variant with line */
-#define FL_FILL_DIAL	2	/**< type() for dial variant with filled arc */
-
-/**
-  The Fl_Dial widget provides a circular dial to control a
-  single floating point value.
-  <P ALIGN=CENTER>\image html dial.png 
-  \image latex dial.png "Fl_Dial" width=4cm
-  Use type() to set the type of the dial to:
-  <UL>
-  <LI>FL_NORMAL_DIAL - Draws a normal dial with a knob. </LI>
-  <LI>FL_LINE_DIAL - Draws a dial with a line. </LI>
-  <LI>FL_FILL_DIAL - Draws a dial with a filled arc. </LI>
-  </UL>
-
-*/
-class FL_EXPORT Fl_Dial : public Fl_Valuator {
-
-  short a1,a2;
-
-protected:
-
-  // these allow subclasses to put the dial in a smaller area:
-  void draw(int X, int Y, int W, int H);
-  int handle(int event, int X, int Y, int W, int H);
-  void draw();
-
-public:
-
-  int handle(int);
-  /**
-    Creates a new Fl_Dial widget using the given position, size,
-    and label string. The default type is FL_NORMAL_DIAL.
-  */
-  Fl_Dial(int x,int y,int w,int h, const char *l = 0);
-  /** 
-     Sets Or gets the angles used for the minimum and maximum values.  The default
-     values are 45 and 315 (0 degrees is straight down and the angles
-     progress clockwise).  Normally angle1 is less than angle2, but if you
-     reverse them the dial moves counter-clockwise.
-  */
-  short angle1() const {return a1;}
-  /** See short angle1() const */
-  void angle1(short a) {a1 = a;}
-  /** See short angle1() const */
-  short angle2() const {return a2;}
-  /** See short angle1() const */
-  void angle2(short a) {a2 = a;}
-  /** See short angle1() const */
-  void angles(short a, short b) {a1 = a; a2 = b;}
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_Dial, Fl_Valuator)
-};
-
-#endif
-
-//
-// End of "$Id: Fl_Dial.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
-//
+//
+// "$Id: Fl_Dial.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
+//
+// Dial header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2010 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_Dial widget . */
+
+#ifndef Fl_Dial_H
+#define Fl_Dial_H
+
+#ifndef Fl_Valuator_H
+#include "Fl_Valuator.H"
+#endif
+
+// values for type():
+#define FL_NORMAL_DIAL	0	/**< type() for dial variant with dot */
+#define FL_LINE_DIAL	1	/**< type() for dial variant with line */
+#define FL_FILL_DIAL	2	/**< type() for dial variant with filled arc */
+
+/**
+  The Fl_Dial widget provides a circular dial to control a
+  single floating point value.
+  <P ALIGN=CENTER>\image html dial.png 
+  \image latex dial.png "Fl_Dial" width=4cm
+  Use type() to set the type of the dial to:
+  <UL>
+  <LI>FL_NORMAL_DIAL - Draws a normal dial with a knob. </LI>
+  <LI>FL_LINE_DIAL - Draws a dial with a line. </LI>
+  <LI>FL_FILL_DIAL - Draws a dial with a filled arc. </LI>
+  </UL>
+
+*/
+class FL_EXPORT Fl_Dial : public Fl_Valuator {
+
+  short a1,a2;
+
+protected:
+
+  // these allow subclasses to put the dial in a smaller area:
+  void draw(int X, int Y, int W, int H);
+  int handle(int event, int X, int Y, int W, int H);
+  void draw();
+
+public:
+
+  int handle(int);
+  /**
+    Creates a new Fl_Dial widget using the given position, size,
+    and label string. The default type is FL_NORMAL_DIAL.
+  */
+  Fl_Dial(int x,int y,int w,int h, const char *l = 0);
+  /** 
+     Sets Or gets the angles used for the minimum and maximum values.  The default
+     values are 45 and 315 (0 degrees is straight down and the angles
+     progress clockwise).  Normally angle1 is less than angle2, but if you
+     reverse them the dial moves counter-clockwise.
+  */
+  short angle1() const {return a1;}
+  /** See short angle1() const */
+  void angle1(short a) {a1 = a;}
+  /** See short angle1() const */
+  short angle2() const {return a2;}
+  /** See short angle1() const */
+  void angle2(short a) {a2 = a;}
+  /** See short angle1() const */
+  void angles(short a, short b) {a1 = a; a2 = b;}
+
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_Dial, Fl_Valuator)
+};
+
+#endif
+
+//
+// End of "$Id: Fl_Dial.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
+//

+ 68 - 70
fltk/FL/Fl_Double_Window.H

@@ -1,74 +1,72 @@
-//
-// "$Id: Fl_Double_Window.H 9637 2012-07-24 04:37:22Z matt $"
-//
-// Double-buffered window header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_Double_Window widget . */
-
-#ifndef Fl_Double_Window_H
-#define Fl_Double_Window_H
-
-#include "Fl_Window.H"
-
-/**
-  The Fl_Double_Window provides a double-buffered window.
-  If possible this will use the X double buffering extension (Xdbe).  If
-  not, it will draw the window data into an off-screen pixmap, and then
-  copy it to the on-screen window.
-  <P>It is highly recommended that you put the following code before the
-  first show() of <I>any</I> window in your program: </P>
-  \code
-  Fl::visual(FL_DOUBLE|FL_INDEX)
-  \endcode
-  This makes sure you can use Xdbe on servers where double buffering
-  does not exist for every visual.
-*/
-class FL_EXPORT Fl_Double_Window : public Fl_Window {
-protected:
-  void flush(int eraseoverlay);
-  /**
-    Force double buffering, even if the OS already buffers windows
-    (overlays need that on MacOS and Windows2000)
-  */
-  char force_doublebuffering_;
-public:
-  void show();
-  void show(int a, char **b) {Fl_Window::show(a,b);}
-  void flush();
-  void resize(int,int,int,int);
-  void hide();
-  ~Fl_Double_Window();
-  
-  /**
+//
+// "$Id: Fl_Double_Window.H 11359 2016-03-13 22:16:37Z matt $"
+//
+// Double-buffered window header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2010 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_Double_Window widget . */
+
+#ifndef Fl_Double_Window_H
+#define Fl_Double_Window_H
+
+#include "Fl_Window.H"
+
+/**
+  The Fl_Double_Window provides a double-buffered window.
+  If possible this will use the X double buffering extension (Xdbe).  If
+  not, it will draw the window data into an off-screen pixmap, and then
+  copy it to the on-screen window.
+  <P>It is highly recommended that you put the following code before the
+  first show() of <I>any</I> window in your program: </P>
+  \code
+  Fl::visual(FL_DOUBLE|FL_INDEX)
+  \endcode
+  This makes sure you can use Xdbe on servers where double buffering
+  does not exist for every visual.
+*/
+class FL_EXPORT Fl_Double_Window : public Fl_Window
+{
+public:
+  /**
+    Return non-null if this is an Fl_Overlay_Window object.
+  */
+  virtual Fl_Double_Window *as_double_window() {return this; }
+  void show();
+  void show(int a, char **b) {Fl_Window::show(a,b);}
+  void resize(int,int,int,int);
+  void hide();
+  void flush();
+  ~Fl_Double_Window();
+  
+  /**
    Creates a new Fl_Double_Window widget using the given
    position, size, and label (title) string.
-  */
-  Fl_Double_Window(int W, int H, const char *l = 0);
-  
+  */
+  Fl_Double_Window(int W, int H, const char *l = 0);
+  
   /**
    See  Fl_Double_Window::Fl_Double_Window(int w, int h, const char *label = 0)
-  */
-  Fl_Double_Window(int X, int Y, int W, int H, const char *l = 0);
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_Double_Window, Fl_Window)
-};
-
-#endif
-
-//
-// End of "$Id: Fl_Double_Window.H 9637 2012-07-24 04:37:22Z matt $".
-//
+  */
+  Fl_Double_Window(int X, int Y, int W, int H, const char *l = 0);
+
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_Double_Window, Fl_Window)
+};
+
+#endif
+
+//
+// End of "$Id: Fl_Double_Window.H 11359 2016-03-13 22:16:37Z matt $".
+//

+ 42 - 40
fltk/FL/Fl_Export.H

@@ -1,40 +1,42 @@
-/*
- * "$Id: Fl_Export.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
- *
- * WIN32 DLL export .
- *
- * Copyright 1998-2010 by Bill Spitzak and others.
- *
- * This library is free software. Distribution and use rights are outlined in
- * the file "COPYING" which should have been included with this file.  If this
- * file is missing or damaged, see the license at:
- *
- *     http://www.fltk.org/COPYING.php
- *
- * Please report all bugs and problems on the following page:
- *
- *     http://www.fltk.org/str.php
- */
-
-#ifndef Fl_Export_H
-#  define Fl_Export_H
-
-/*
- * The following is only used when building DLLs under WIN32...
- */
-
-#  if defined(FL_DLL)
-#    ifdef FL_LIBRARY
-#      define FL_EXPORT	__declspec(dllexport)
-#    else
-#      define FL_EXPORT	__declspec(dllimport)
-#    endif /* FL_LIBRARY */
-#  else
-#    define FL_EXPORT
-#  endif /* FL_DLL */
-
-#endif /* !Fl_Export_H */
-
-/*
- * End of "$Id: Fl_Export.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
- */
+/*
+ * "$Id: Fl_Export.H 10236 2014-08-21 12:29:48Z cand $"
+ *
+ * WIN32 DLL export .
+ *
+ * Copyright 1998-2010 by Bill Spitzak and others.
+ *
+ * This library is free software. Distribution and use rights are outlined in
+ * the file "COPYING" which should have been included with this file.  If this
+ * file is missing or damaged, see the license at:
+ *
+ *     http://www.fltk.org/COPYING.php
+ *
+ * Please report all bugs and problems on the following page:
+ *
+ *     http://www.fltk.org/str.php
+ */
+
+#ifndef Fl_Export_H
+#  define Fl_Export_H
+
+/*
+ * The following is only used when building DLLs under WIN32...
+ */
+
+#  if defined(FL_DLL)
+#    ifdef FL_LIBRARY
+#      define FL_EXPORT	__declspec(dllexport)
+#    else
+#      define FL_EXPORT	__declspec(dllimport)
+#    endif /* FL_LIBRARY */
+#  elif __GNUC__ >= 4
+#    define FL_EXPORT __attribute__ ((visibility ("default")))
+#  else
+#    define FL_EXPORT
+#  endif /* FL_DLL */
+
+#endif /* !Fl_Export_H */
+
+/*
+ * End of "$Id: Fl_Export.H 10236 2014-08-21 12:29:48Z cand $".
+ */

+ 112 - 113
fltk/FL/Fl_File_Browser.H

@@ -1,113 +1,112 @@
-//
-// "$Id: Fl_File_Browser.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
-//
-// FileBrowser definitions.
-//
-// Copyright 1999-2010 by Michael Sweet.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_File_Browser widget . */
-
-//
-// Include necessary header files...
-//
-
-#ifndef _Fl_File_Browser_H_
-#  define _Fl_File_Browser_H_
-
-#  include "Fl_Browser.H"
-#  include "Fl_File_Icon.H"
-#  include "filename.H"
-
-
-//
-// Fl_File_Browser class...
-//
-
-/** The Fl_File_Browser widget displays a list of filenames, optionally with file-specific icons. */
-class FL_EXPORT Fl_File_Browser : public Fl_Browser {
-  
-  int		filetype_;
-  const char	*directory_;
-  uchar		iconsize_;
-  const char	*pattern_;
-
-  int		full_height() const;
-  int		item_height(void *) const;
-  int		item_width(void *) const;
-  void		item_draw(void *, int, int, int, int) const;
-  int		incr_height() const { return (item_height(0)); }
-
-public:
-  enum { FILES, DIRECTORIES };
-
-  /**
-    The constructor creates the Fl_File_Browser widget at the specified position and size.
-    The destructor destroys the widget and frees all memory that has been allocated.
-  */
-  Fl_File_Browser(int, int, int, int, const char * = 0);
-
-  /**    Sets or gets the size of the icons. The default size is 20 pixels.  */
-  uchar		iconsize() const { return (iconsize_); };
-  /**    Sets or gets the size of the icons. The default size is 20 pixels.  */
-  void		iconsize(uchar s) { iconsize_ = s; redraw(); };
-
-  /**
-    Sets or gets the filename filter. The pattern matching uses
-    the fl_filename_match()
-    function in FLTK.
-  */
-  void	filter(const char *pattern);
-  /**
-    Sets or gets the filename filter. The pattern matching uses
-    the fl_filename_match()
-    function in FLTK.
-  */
-  const char	*filter() const { return (pattern_); };
-
-  /**
-    Loads the specified directory into the browser. If icons have been
-    loaded then the correct icon is associated with each file in the list.
-    
-    <P>The sort argument specifies a sort function to be used with
-    fl_filename_list().
-  */
-  int		load(const char *directory, Fl_File_Sort_F *sort = fl_numericsort);
-
-  Fl_Fontsize  textsize() const { return Fl_Browser::textsize(); };
-  void		textsize(Fl_Fontsize s) { Fl_Browser::textsize(s); iconsize_ = (uchar)(3 * s / 2); };
-
-  /**
-    Sets or gets the file browser type, FILES or
-    DIRECTORIES. When set to FILES, both
-    files and directories are shown. Otherwise only directories are
-    shown.
-  */
-  int		filetype() const { return (filetype_); };
-  /**
-    Sets or gets the file browser type, FILES or
-    DIRECTORIES. When set to FILES, both
-    files and directories are shown. Otherwise only directories are
-    shown.
-  */
-  void		filetype(int t) { filetype_ = t; };
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_File_Browser, Fl_Browser)
-};
-
-#endif // !_Fl_File_Browser_H_
-
-//
-// End of "$Id: Fl_File_Browser.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
-//
+//
+// "$Id: Fl_File_Browser.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
+//
+// FileBrowser definitions.
+//
+// Copyright 1999-2010 by Michael Sweet.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_File_Browser widget . */
+
+//
+// Include necessary header files...
+//
+
+#ifndef _Fl_File_Browser_H_
+#  define _Fl_File_Browser_H_
+
+#  include "Fl_Browser.H"
+#  include "Fl_File_Icon.H"
+#  include "filename.H"
+
+
+//
+// Fl_File_Browser class...
+//
+
+/** The Fl_File_Browser widget displays a list of filenames, optionally with file-specific icons. */
+class FL_EXPORT Fl_File_Browser : public Fl_Browser {
+  
+  int		filetype_;
+  const char	*directory_;
+  uchar		iconsize_;
+  const char	*pattern_;
+
+  int		full_height() const;
+  int		item_height(void *) const;
+  int		item_width(void *) const;
+  void		item_draw(void *, int, int, int, int) const;
+  int		incr_height() const { return (item_height(0)); }
+
+public:
+  enum { FILES, DIRECTORIES };
+
+  /**
+    The constructor creates the Fl_File_Browser widget at the specified position and size.
+    The destructor destroys the widget and frees all memory that has been allocated.
+  */
+  Fl_File_Browser(int, int, int, int, const char * = 0);
+
+  /**    Sets or gets the size of the icons. The default size is 20 pixels.  */
+  uchar		iconsize() const { return (iconsize_); };
+  /**    Sets or gets the size of the icons. The default size is 20 pixels.  */
+  void		iconsize(uchar s) { iconsize_ = s; redraw(); };
+
+  /**
+    Sets or gets the filename filter. The pattern matching uses
+    the fl_filename_match()
+    function in FLTK.
+  */
+  void	filter(const char *pattern);
+  /**
+    Sets or gets the filename filter. The pattern matching uses
+    the fl_filename_match()
+    function in FLTK.
+  */
+  const char	*filter() const { return (pattern_); };
+
+  /**
+    Loads the specified directory into the browser. If icons have been
+    loaded then the correct icon is associated with each file in the list.
+    
+    <P>The sort argument specifies a sort function to be used with
+    fl_filename_list().
+  */
+  int		load(const char *directory, Fl_File_Sort_F *sort = fl_numericsort);
+
+  Fl_Fontsize  textsize() const { return Fl_Browser::textsize(); };
+  void		textsize(Fl_Fontsize s) { Fl_Browser::textsize(s); iconsize_ = (uchar)(3 * s / 2); };
+
+  /**
+    Sets or gets the file browser type, FILES or
+    DIRECTORIES. When set to FILES, both
+    files and directories are shown. Otherwise only directories are
+    shown.
+  */
+  int		filetype() const { return (filetype_); };
+  /**
+    Sets or gets the file browser type, FILES or
+    DIRECTORIES. When set to FILES, both
+    files and directories are shown. Otherwise only directories are
+    shown.
+  */
+  void		filetype(int t) { filetype_ = t; };
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_File_Browser, Fl_Browser)
+};
+
+#endif // !_Fl_File_Browser_H_
+
+//
+// End of "$Id: Fl_File_Browser.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
+//

+ 245 - 238
fltk/FL/Fl_File_Chooser.H

@@ -1,238 +1,245 @@
-//
-// "$Id: Fl_File_Chooser.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
-//
-// Fl_File_Chooser dialog for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2011 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-// generated by Fast Light User Interface Designer (fluid) version 1.0300
-
-#ifndef Fl_File_Chooser_H
-#define Fl_File_Chooser_H
-#include <FL/Fl.H>
-#include <FL/Fl_Double_Window.H>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <FL/Fl_Group.H>
-#include <FL/Fl_Choice.H>
-#include <FL/Fl_Menu_Button.H>
-#include <FL/Fl_Button.H>
-#include <FL/Fl_Preferences.H>
-#include <FL/Fl_Tile.H>
-#include <FL/Fl_File_Browser.H>
-#include <FL/Fl_Box.H>
-#include <FL/Fl_Check_Button.H>
-#include <FL/Fl_File_Input.H>
-#include <FL/Fl_Return_Button.H>
-#include <FL/fl_ask.H>
-
-class FL_EXPORT Fl_File_Chooser {
-public:
-  enum { SINGLE = 0, MULTI = 1, CREATE = 2, DIRECTORY = 4 }; 
-private:
-  static Fl_Preferences prefs_; 
-  void (*callback_)(Fl_File_Chooser*, void *); 
-  void *data_; 
-  char directory_[FL_PATH_MAX]; 
-  char pattern_[FL_PATH_MAX]; 
-  char preview_text_[2048]; 
-  int type_; 
-  void favoritesButtonCB(); 
-  void favoritesCB(Fl_Widget *w); 
-  void fileListCB(); 
-  void fileNameCB(); 
-  void newdir(); 
-  static void previewCB(Fl_File_Chooser *fc); 
-  void showChoiceCB(); 
-  void update_favorites(); 
-  void update_preview(); 
-public:
-  Fl_File_Chooser(const char *d, const char *p, int t, const char *title);
-private:
-  Fl_Double_Window *window;
-  void cb_window_i(Fl_Double_Window*, void*);
-  static void cb_window(Fl_Double_Window*, void*);
-  Fl_Choice *showChoice;
-  void cb_showChoice_i(Fl_Choice*, void*);
-  static void cb_showChoice(Fl_Choice*, void*);
-  Fl_Menu_Button *favoritesButton;
-  void cb_favoritesButton_i(Fl_Menu_Button*, void*);
-  static void cb_favoritesButton(Fl_Menu_Button*, void*);
-public:
-  Fl_Button *newButton;
-private:
-  void cb_newButton_i(Fl_Button*, void*);
-  static void cb_newButton(Fl_Button*, void*);
-  void cb__i(Fl_Tile*, void*);
-  static void cb_(Fl_Tile*, void*);
-  Fl_File_Browser *fileList;
-  void cb_fileList_i(Fl_File_Browser*, void*);
-  static void cb_fileList(Fl_File_Browser*, void*);
-  Fl_Box *previewBox;
-public:
-  Fl_Check_Button *previewButton;
-private:
-  void cb_previewButton_i(Fl_Check_Button*, void*);
-  static void cb_previewButton(Fl_Check_Button*, void*);
-public:
-  Fl_Check_Button *showHiddenButton;
-private:
-  void cb_showHiddenButton_i(Fl_Check_Button*, void*);
-  static void cb_showHiddenButton(Fl_Check_Button*, void*);
-  Fl_File_Input *fileName;
-  void cb_fileName_i(Fl_File_Input*, void*);
-  static void cb_fileName(Fl_File_Input*, void*);
-  Fl_Return_Button *okButton;
-  void cb_okButton_i(Fl_Return_Button*, void*);
-  static void cb_okButton(Fl_Return_Button*, void*);
-  Fl_Button *cancelButton;
-  void cb_cancelButton_i(Fl_Button*, void*);
-  static void cb_cancelButton(Fl_Button*, void*);
-  Fl_Double_Window *favWindow;
-  Fl_File_Browser *favList;
-  void cb_favList_i(Fl_File_Browser*, void*);
-  static void cb_favList(Fl_File_Browser*, void*);
-  Fl_Button *favUpButton;
-  void cb_favUpButton_i(Fl_Button*, void*);
-  static void cb_favUpButton(Fl_Button*, void*);
-  Fl_Button *favDeleteButton;
-  void cb_favDeleteButton_i(Fl_Button*, void*);
-  static void cb_favDeleteButton(Fl_Button*, void*);
-  Fl_Button *favDownButton;
-  void cb_favDownButton_i(Fl_Button*, void*);
-  static void cb_favDownButton(Fl_Button*, void*);
-  Fl_Button *favCancelButton;
-  void cb_favCancelButton_i(Fl_Button*, void*);
-  static void cb_favCancelButton(Fl_Button*, void*);
-  Fl_Return_Button *favOkButton;
-  void cb_favOkButton_i(Fl_Return_Button*, void*);
-  static void cb_favOkButton(Fl_Return_Button*, void*);
-public:
-  ~Fl_File_Chooser();
-  void callback(void (*cb)(Fl_File_Chooser *, void *), void *d = 0);
-  void color(Fl_Color c);
-  Fl_Color color();
-  int count(); 
-  void directory(const char *d); 
-  char * directory();
-  void filter(const char *p); 
-  const char * filter();
-  int filter_value();
-  void filter_value(int f);
-  void hide();
-  void iconsize(uchar s);
-  uchar iconsize();
-  void label(const char *l);
-  const char * label();
-  void ok_label(const char *l);
-  const char * ok_label();
-  void preview(int e); 
-  int preview() const { return previewButton->value(); }; 
-private:
-  void showHidden(int e); 
-  void remove_hidden_files(); 
-public:
-  void rescan(); 
-  void rescan_keep_filename(); 
-  void show();
-  int shown();
-  void textcolor(Fl_Color c);
-  Fl_Color textcolor();
-  void textfont(Fl_Font f);
-  Fl_Font textfont();
-  void textsize(Fl_Fontsize s);
-  Fl_Fontsize textsize();
-  void type(int t);
-  int type();
-  void * user_data() const;
-  void user_data(void *d);
-  const char *value(int f = 1); 
-  void value(const char *filename); 
-  int visible();
-  /**
-     [standard text may be customized at run-time]
-  */
-  static const char *add_favorites_label; 
-  /**
-     [standard text may be customized at run-time]
-  */
-  static const char *all_files_label; 
-  /**
-     [standard text may be customized at run-time]
-  */
-  static const char *custom_filter_label; 
-  /**
-     [standard text may be customized at run-time]
-  */
-  static const char *existing_file_label; 
-  /**
-     [standard text may be customized at run-time]
-  */
-  static const char *favorites_label; 
-  /**
-     [standard text may be customized at run-time]
-  */
-  static const char *filename_label; 
-  /**
-     [standard text may be customized at run-time]
-  */
-  static const char *filesystems_label; 
-  /**
-     [standard text may be customized at run-time]
-  */
-  static const char *manage_favorites_label; 
-  /**
-     [standard text may be customized at run-time]
-  */
-  static const char *new_directory_label; 
-  /**
-     [standard text may be customized at run-time]
-  */
-  static const char *new_directory_tooltip; 
-  /**
-     [standard text may be customized at run-time]
-  */
-  static const char *preview_label; 
-  /**
-     [standard text may be customized at run-time]
-  */
-  static const char *save_label; 
-  /**
-     [standard text may be customized at run-time]
-  */
-  static const char *show_label; 
-  /** 
-     [standard text may be customized at run-time]
- */
-  static const char *hidden_label;
-  /**
-     the sort function that is used when loading
-     the contents of a directory.
-  */
-  static Fl_File_Sort_F *sort; 
-private:
-  Fl_Widget* ext_group; 
-public:
-  Fl_Widget* add_extra(Fl_Widget* gr);
-};
-FL_EXPORT char *fl_dir_chooser(const char *message,const char *fname,int relative=0);
-FL_EXPORT char *fl_file_chooser(const char *message,const char *pat,const char *fname,int relative=0);
-FL_EXPORT void fl_file_chooser_callback(void (*cb)(const char*));
-FL_EXPORT void fl_file_chooser_ok_label(const char*l);
-#endif
-
-//
-// End of "$Id: Fl_File_Chooser.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
-//
+//
+// "$Id: Fl_File_Chooser.H 11957 2016-09-20 13:35:44Z AlbrechtS $"
+//
+// Fl_File_Chooser dialog for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2015 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+// =======================================================================
+//  DO NOT EDIT FL/Fl_File_Chooser.H and src/Fl_File_Chooser.cxx !!!
+// =======================================================================
+//  Please use fluid to change src/Fl_File_Chooser.fl interactively
+//  and then use fluid to "write code" or edit and use fluid -c .
+// =======================================================================
+//
+
+// generated by Fast Light User Interface Designer (fluid) version 1.0400
+
+#ifndef Fl_File_Chooser_H
+#define Fl_File_Chooser_H
+#include <FL/Fl.H>
+#include <FL/Fl_Double_Window.H>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <FL/Fl_Group.H>
+#include <FL/Fl_Choice.H>
+#include <FL/Fl_Menu_Button.H>
+#include <FL/Fl_Button.H>
+#include <FL/Fl_Preferences.H>
+#include <FL/Fl_Tile.H>
+#include <FL/Fl_File_Browser.H>
+#include <FL/Fl_Box.H>
+#include <FL/Fl_Check_Button.H>
+#include <FL/Fl_File_Input.H>
+#include <FL/Fl_Return_Button.H>
+#include <FL/fl_ask.H>
+
+class FL_EXPORT Fl_File_Chooser {
+public:
+  enum { SINGLE = 0, MULTI = 1, CREATE = 2, DIRECTORY = 4 }; 
+private:
+  static Fl_Preferences *prefs_; 
+  void (*callback_)(Fl_File_Chooser*, void *); 
+  void *data_; 
+  char directory_[FL_PATH_MAX]; 
+  char pattern_[FL_PATH_MAX]; 
+  char preview_text_[2048]; 
+  int type_; 
+  void favoritesButtonCB(); 
+  void favoritesCB(Fl_Widget *w); 
+  void fileListCB(); 
+  void fileNameCB(); 
+  void newdir(); 
+  static void previewCB(Fl_File_Chooser *fc); 
+  void showChoiceCB(); 
+  void update_favorites(); 
+  void update_preview(); 
+public:
+  Fl_File_Chooser(const char *d, const char *p, int t, const char *title);
+private:
+  Fl_Double_Window *window;
+  inline void cb_window_i(Fl_Double_Window*, void*);
+  static void cb_window(Fl_Double_Window*, void*);
+  Fl_Choice *showChoice;
+  inline void cb_showChoice_i(Fl_Choice*, void*);
+  static void cb_showChoice(Fl_Choice*, void*);
+  Fl_Menu_Button *favoritesButton;
+  inline void cb_favoritesButton_i(Fl_Menu_Button*, void*);
+  static void cb_favoritesButton(Fl_Menu_Button*, void*);
+public:
+  Fl_Button *newButton;
+private:
+  inline void cb_newButton_i(Fl_Button*, void*);
+  static void cb_newButton(Fl_Button*, void*);
+  inline void cb__i(Fl_Tile*, void*);
+  static void cb_(Fl_Tile*, void*);
+  Fl_File_Browser *fileList;
+  inline void cb_fileList_i(Fl_File_Browser*, void*);
+  static void cb_fileList(Fl_File_Browser*, void*);
+  Fl_Box *previewBox;
+public:
+  Fl_Check_Button *previewButton;
+private:
+  inline void cb_previewButton_i(Fl_Check_Button*, void*);
+  static void cb_previewButton(Fl_Check_Button*, void*);
+public:
+  Fl_Check_Button *showHiddenButton;
+private:
+  inline void cb_showHiddenButton_i(Fl_Check_Button*, void*);
+  static void cb_showHiddenButton(Fl_Check_Button*, void*);
+  Fl_File_Input *fileName;
+  inline void cb_fileName_i(Fl_File_Input*, void*);
+  static void cb_fileName(Fl_File_Input*, void*);
+  Fl_Return_Button *okButton;
+  inline void cb_okButton_i(Fl_Return_Button*, void*);
+  static void cb_okButton(Fl_Return_Button*, void*);
+  Fl_Button *cancelButton;
+  inline void cb_cancelButton_i(Fl_Button*, void*);
+  static void cb_cancelButton(Fl_Button*, void*);
+  Fl_Double_Window *favWindow;
+  Fl_File_Browser *favList;
+  inline void cb_favList_i(Fl_File_Browser*, void*);
+  static void cb_favList(Fl_File_Browser*, void*);
+  Fl_Button *favUpButton;
+  inline void cb_favUpButton_i(Fl_Button*, void*);
+  static void cb_favUpButton(Fl_Button*, void*);
+  Fl_Button *favDeleteButton;
+  inline void cb_favDeleteButton_i(Fl_Button*, void*);
+  static void cb_favDeleteButton(Fl_Button*, void*);
+  Fl_Button *favDownButton;
+  inline void cb_favDownButton_i(Fl_Button*, void*);
+  static void cb_favDownButton(Fl_Button*, void*);
+  Fl_Button *favCancelButton;
+  inline void cb_favCancelButton_i(Fl_Button*, void*);
+  static void cb_favCancelButton(Fl_Button*, void*);
+  Fl_Return_Button *favOkButton;
+  inline void cb_favOkButton_i(Fl_Return_Button*, void*);
+  static void cb_favOkButton(Fl_Return_Button*, void*);
+public:
+  ~Fl_File_Chooser();
+  void callback(void (*cb)(Fl_File_Chooser *, void *), void *d = 0);
+  void color(Fl_Color c);
+  Fl_Color color();
+  int count(); 
+  void directory(const char *d); 
+  char * directory();
+  void filter(const char *p); 
+  const char * filter();
+  int filter_value();
+  void filter_value(int f);
+  void hide();
+  void iconsize(uchar s);
+  uchar iconsize();
+  void label(const char *l);
+  const char * label();
+  void ok_label(const char *l);
+  const char * ok_label();
+  void preview(int e); 
+  int preview() const { return previewButton->value(); }; 
+private:
+  void showHidden(int e); 
+  void remove_hidden_files(); 
+public:
+  void rescan(); 
+  void rescan_keep_filename(); 
+  void show(); 
+  int shown();
+  void textcolor(Fl_Color c);
+  Fl_Color textcolor();
+  void textfont(Fl_Font f);
+  Fl_Font textfont();
+  void textsize(Fl_Fontsize s);
+  Fl_Fontsize textsize();
+  void type(int t);
+  int type();
+  void * user_data() const;
+  void user_data(void *d);
+  const char *value(int f = 1); 
+  void value(const char *filename); 
+  int visible();
+  /**
+   [standard text may be customized at run-time]
+  */
+  static const char *add_favorites_label; 
+  /**
+   [standard text may be customized at run-time]
+  */
+  static const char *all_files_label; 
+  /**
+   [standard text may be customized at run-time]
+  */
+  static const char *custom_filter_label; 
+  /**
+   [standard text may be customized at run-time]
+  */
+  static const char *existing_file_label; 
+  /**
+   [standard text may be customized at run-time]
+  */
+  static const char *favorites_label; 
+  /**
+   [standard text may be customized at run-time]
+  */
+  static const char *filename_label; 
+  /**
+   [standard text may be customized at run-time]
+  */
+  static const char *filesystems_label; 
+  /**
+   [standard text may be customized at run-time]
+  */
+  static const char *manage_favorites_label; 
+  /**
+   [standard text may be customized at run-time]
+  */
+  static const char *new_directory_label; 
+  /**
+   [standard text may be customized at run-time]
+  */
+  static const char *new_directory_tooltip; 
+  /**
+   [standard text may be customized at run-time]
+  */
+  static const char *preview_label; 
+  /**
+   [standard text may be customized at run-time]
+  */
+  static const char *save_label; 
+  /**
+   [standard text may be customized at run-time]
+  */
+  static const char *show_label; 
+  /**
+   [standard text may be customized at run-time]
+  */
+  static const char *hidden_label; 
+  /**
+   the sort function that is used when loading
+   the contents of a directory.
+  */
+  static Fl_File_Sort_F *sort; 
+private:
+  Fl_Widget* ext_group; 
+public:
+  Fl_Widget* add_extra(Fl_Widget* gr);
+};
+FL_EXPORT char *fl_dir_chooser(const char *message,const char *fname,int relative=0);
+FL_EXPORT char *fl_file_chooser(const char *message,const char *pat,const char *fname,int relative=0);
+FL_EXPORT void fl_file_chooser_callback(void (*cb)(const char*));
+FL_EXPORT void fl_file_chooser_ok_label(const char*l);
+#endif
+
+//
+// End of "$Id: Fl_File_Chooser.H 11957 2016-09-20 13:35:44Z AlbrechtS $".
+//

+ 159 - 159
fltk/FL/Fl_File_Icon.H

@@ -1,159 +1,159 @@
-//
-// "$Id: Fl_File_Icon.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
-//
-// Fl_File_Icon definitions.
-//
-// Copyright 1999-2010 by Michael Sweet.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_File_Icon widget . */
-
-//
-// Include necessary header files...
-//
-
-#ifndef _Fl_Fl_File_Icon_H_
-#  define _Fl_Fl_File_Icon_H_
-
-#  include "Fl.H"
-
-
-//
-// Special color value for the icon color.
-//
-
-#  define FL_ICON_COLOR (Fl_Color)0xffffffff	/**< icon color [background?]*/
-
-
-//
-// Fl_File_Icon class...
-//
-
-/** 
-  The Fl_File_Icon class manages icon images that can be used 
-  as labels in other widgets and as icons in the FileBrowser widget.
-*/
-class FL_EXPORT Fl_File_Icon {			//// Icon data
-
-  static Fl_File_Icon *first_;	// Pointer to first icon/filetype
-  Fl_File_Icon	*next_;		// Pointer to next icon/filetype
-  const char	*pattern_;	// Pattern string
-  int		type_;		// Match only if directory or file?
-  int		num_data_;	// Number of data elements
-  int		alloc_data_;	// Number of allocated elements
-  short		*data_;		// Icon data
-
-  public:
-
-  enum				// File types
-  {
-    ANY,			// Any kind of file
-    PLAIN,			// Only plain files
-    FIFO,			// Only named pipes
-    DEVICE,			// Only character and block devices
-    LINK,			// Only symbolic links
-    DIRECTORY			// Only directories
-  };
-
-  enum				// Data opcodes
-  {
-    END,			// End of primitive/icon
-    COLOR,			// Followed by color value (2 shorts)
-    LINE,			// Start of line
-    CLOSEDLINE,			// Start of closed line
-    POLYGON,			// Start of polygon
-    OUTLINEPOLYGON,		// Followed by outline color (2 shorts)
-    VERTEX			// Followed by scaled X,Y
-  };
-
-  Fl_File_Icon(const char *p, int t, int nd = 0, short *d = 0);
-  ~Fl_File_Icon();
-
-  short		*add(short d);
-
-  /**
-    Adds a color value to the icon array, returning a pointer to it.
-    \param[in] c color value
-  */
-  short		*add_color(Fl_Color c)
-		{ short *d = add((short)COLOR); add((short)(c >> 16)); add((short)c); return (d); }
-
-  /**
-    Adds a vertex value to the icon array, returning a pointer to it.
-    The integer version accepts coordinates from 0 to 10000.
-    The origin (0.0) is in the lower-lefthand corner of the icon.
-    \param[in] x, y vertex coordinates
-  */
-  short		*add_vertex(int x, int y)
-		{ short *d = add((short)VERTEX); add((short)x); add((short)y); return (d); }
-
-  /**
-    Adds a vertex value to the icon array, returning a pointer to it.
-    The floating point version goes from 0.0 to 1.0.
-    The origin (0.0) is in the lower-lefthand corner of the icon.
-    \param[in] x, y vertex coordinates
-  */
-  short		*add_vertex(float x, float y)
-		{ short *d = add((short)VERTEX); add((short)(x * 10000.0));
-		  add((short)(y * 10000.0)); return (d); }
-
-  /** Clears all icon data from the icon.*/
-  void		clear() { num_data_ = 0; }
-
-  void		draw(int x, int y, int w, int h, Fl_Color ic, int active = 1);
-
-  void		label(Fl_Widget *w);
-
-  static void	labeltype(const Fl_Label *o, int x, int y, int w, int h, Fl_Align a);
-  void		load(const char *f);
-  int		load_fti(const char *fti);
-  int		load_image(const char *i);
-
-  /** Returns next file icon object. See Fl_File_Icon::first() */
-  Fl_File_Icon	*next() { return (next_); }
-
-  /** Returns the filename matching pattern for the icon.*/
-  const char	*pattern() { return (pattern_); }
-
-  /**  Returns the number of words of data used by the icon.*/
-  int		size() { return (num_data_); }
-
-  /**
-    Returns the filetype associated with the icon, which can be one of the
-    following:
-  
-    \li Fl_File_Icon::ANY, any kind of file.
-    \li Fl_File_Icon::PLAIN, plain files.
-    \li Fl_File_Icon::FIFO, named pipes.
-    \li Fl_File_Icon::DEVICE, character and block devices.
-    \li Fl_File_Icon::LINK, symbolic links.
-    \li Fl_File_Icon::DIRECTORY, directories.
-  */
-  int		type() { return (type_); }
-
-  /**  Returns the data array for the icon.*/
-  short		*value() { return (data_); }
-
-  static Fl_File_Icon *find(const char *filename, int filetype = ANY);
-
-  /** Returns a pointer to the first icon in the list.*/
-  static Fl_File_Icon *first() { return (first_); }
-  static void	load_system_icons(void);
-};
-
-#endif // !_Fl_Fl_File_Icon_H_
-
-//
-// End of "$Id: Fl_File_Icon.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
-//
+//
+// "$Id: Fl_File_Icon.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
+//
+// Fl_File_Icon definitions.
+//
+// Copyright 1999-2010 by Michael Sweet.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_File_Icon widget . */
+
+//
+// Include necessary header files...
+//
+
+#ifndef _Fl_Fl_File_Icon_H_
+#  define _Fl_Fl_File_Icon_H_
+
+#  include "Fl.H"
+
+
+//
+// Special color value for the icon color.
+//
+
+#  define FL_ICON_COLOR (Fl_Color)0xffffffff	/**< icon color [background?]*/
+
+
+//
+// Fl_File_Icon class...
+//
+
+/** 
+  The Fl_File_Icon class manages icon images that can be used 
+  as labels in other widgets and as icons in the FileBrowser widget.
+*/
+class FL_EXPORT Fl_File_Icon {			//// Icon data
+
+  static Fl_File_Icon *first_;	// Pointer to first icon/filetype
+  Fl_File_Icon	*next_;		// Pointer to next icon/filetype
+  const char	*pattern_;	// Pattern string
+  int		type_;		// Match only if directory or file?
+  int		num_data_;	// Number of data elements
+  int		alloc_data_;	// Number of allocated elements
+  short		*data_;		// Icon data
+
+  public:
+
+  enum				// File types
+  {
+    ANY,			// Any kind of file
+    PLAIN,			// Only plain files
+    FIFO,			// Only named pipes
+    DEVICE,			// Only character and block devices
+    LINK,			// Only symbolic links
+    DIRECTORY			// Only directories
+  };
+
+  enum				// Data opcodes
+  {
+    END,			// End of primitive/icon
+    COLOR,			// Followed by color value (2 shorts)
+    LINE,			// Start of line
+    CLOSEDLINE,			// Start of closed line
+    POLYGON,			// Start of polygon
+    OUTLINEPOLYGON,		// Followed by outline color (2 shorts)
+    VERTEX			// Followed by scaled X,Y
+  };
+
+  Fl_File_Icon(const char *p, int t, int nd = 0, short *d = 0);
+  ~Fl_File_Icon();
+
+  short		*add(short d);
+
+  /**
+    Adds a color value to the icon array, returning a pointer to it.
+    \param[in] c color value
+  */
+  short		*add_color(Fl_Color c)
+		{ short *d = add((short)COLOR); add((short)(c >> 16)); add((short)c); return (d); }
+
+  /**
+    Adds a vertex value to the icon array, returning a pointer to it.
+    The integer version accepts coordinates from 0 to 10000.
+    The origin (0.0) is in the lower-lefthand corner of the icon.
+    \param[in] x, y vertex coordinates
+  */
+  short		*add_vertex(int x, int y)
+		{ short *d = add((short)VERTEX); add((short)x); add((short)y); return (d); }
+
+  /**
+    Adds a vertex value to the icon array, returning a pointer to it.
+    The floating point version goes from 0.0 to 1.0.
+    The origin (0.0) is in the lower-lefthand corner of the icon.
+    \param[in] x, y vertex coordinates
+  */
+  short		*add_vertex(float x, float y)
+		{ short *d = add((short)VERTEX); add((short)(x * 10000.0));
+		  add((short)(y * 10000.0)); return (d); }
+
+  /** Clears all icon data from the icon.*/
+  void		clear() { num_data_ = 0; }
+
+  void		draw(int x, int y, int w, int h, Fl_Color ic, int active = 1);
+
+  void		label(Fl_Widget *w);
+
+  static void	labeltype(const Fl_Label *o, int x, int y, int w, int h, Fl_Align a);
+  void		load(const char *f);
+  int		load_fti(const char *fti);
+  int		load_image(const char *i);
+
+  /** Returns next file icon object. See Fl_File_Icon::first() */
+  Fl_File_Icon	*next() { return (next_); }
+
+  /** Returns the filename matching pattern for the icon.*/
+  const char	*pattern() { return (pattern_); }
+
+  /**  Returns the number of words of data used by the icon.*/
+  int		size() { return (num_data_); }
+
+  /**
+    Returns the filetype associated with the icon, which can be one of the
+    following:
+  
+    \li Fl_File_Icon::ANY, any kind of file.
+    \li Fl_File_Icon::PLAIN, plain files.
+    \li Fl_File_Icon::FIFO, named pipes.
+    \li Fl_File_Icon::DEVICE, character and block devices.
+    \li Fl_File_Icon::LINK, symbolic links.
+    \li Fl_File_Icon::DIRECTORY, directories.
+  */
+  int		type() { return (type_); }
+
+  /**  Returns the data array for the icon.*/
+  short		*value() { return (data_); }
+
+  static Fl_File_Icon *find(const char *filename, int filetype = ANY);
+
+  /** Returns a pointer to the first icon in the list.*/
+  static Fl_File_Icon *first() { return (first_); }
+  static void	load_system_icons(void);
+};
+
+#endif // !_Fl_Fl_File_Icon_H_
+
+//
+// End of "$Id: Fl_File_Icon.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
+//

+ 97 - 98
fltk/FL/Fl_File_Input.H

@@ -1,99 +1,98 @@
-//
-// "$Id: Fl_File_Input.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
-//
-// File_Input header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-// Original version Copyright 1998 by Curtis Edwards.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_File_Input widget . */
-
-#ifndef Fl_File_Input_H
-#  define Fl_File_Input_H
-
-#  include <FL/Fl_Input.H>
-
-/**
-  \class Fl_File_Input
-  \brief This widget displays a pathname in a text input field.
-
-  A navigation bar located above the input field allows the user to
-  navigate upward in the directory tree.
-  You may want to handle FL_WHEN_CHANGED events for tracking text changes
-  and also FL_WHEN_RELEASE for button release when changing to parent dir.
+//
+// "$Id: Fl_File_Input.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
+//
+// File_Input header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2010 by Bill Spitzak and others.
+// Original version Copyright 1998 by Curtis Edwards.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_File_Input widget . */
+
+#ifndef Fl_File_Input_H
+#  define Fl_File_Input_H
+
+#  include <FL/Fl_Input.H>
+
+/**
+  \class Fl_File_Input
+  \brief This widget displays a pathname in a text input field.
+
+  A navigation bar located above the input field allows the user to
+  navigate upward in the directory tree.
+  You may want to handle FL_WHEN_CHANGED events for tracking text changes
+  and also FL_WHEN_RELEASE for button release when changing to parent dir.
   FL_WHEN_RELEASE callback won't be called if the directory clicked
-  is the same as the current one.
-
-  <P align=CENTER> \image html Fl_File_Input.png </P> 
-  \image latex Fl_File_Input.png "Fl_File_Input"  width=6cm
-
-  \note As all Fl_Input derived objects, Fl_File_Input may call its callback
-  when losing focus (see FL_UNFOCUS) to update its state like its cursor shape.
-  One resulting side effect is that you should call clear_changed() early in your callback
-  to avoid reentrant calls if you plan to show another window or dialog box in the callback.
-*/
-class FL_EXPORT Fl_File_Input : public Fl_Input {
-  
-  Fl_Color	errorcolor_;
-  char		ok_entry_;
-  uchar		down_box_;
-  short		buttons_[200];
-  short		pressed_;
-
-  void		draw_buttons();
-  int		handle_button(int event);
-  void		update_buttons();
-
-public:
-
-  Fl_File_Input(int X, int Y, int W, int H, const char *L=0);
-
-  virtual int handle(int event);
-
-protected:
-  virtual void draw();
-
-public:
-  /** Gets the box type used for the navigation bar. */
-  Fl_Boxtype	down_box() const { return (Fl_Boxtype)down_box_; }
-  /** Sets the box type to use for the navigation bar.  */
-  void		down_box(Fl_Boxtype b) { down_box_ = b; }
-
-  /**
-    Gets the current error color.
-    \todo Better docs for Fl_File_Input::errorcolor() - is it even used?
-  */
-  Fl_Color	errorcolor() const { return errorcolor_; }
-  /** Sets the current error color to \p c */
-  void		errorcolor(Fl_Color c) { errorcolor_ = c; }
-
-  int	value(const char *str);
-  int	value(const char *str, int len);
-
-  /**
-    Returns the current value, which is a pointer to an internal buffer
-    and is valid only until the next event is handled.
-  */
-  const char	*value() { return Fl_Input_::value(); }
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_File_Input, Fl_Input)
-};
-
-#endif // !Fl_File_Input_H
-
-
-//
-// End of "$Id: Fl_File_Input.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
-//
+  is the same as the current one.
+
+  <P align=CENTER> \image html Fl_File_Input.png </P> 
+  \image latex Fl_File_Input.png "Fl_File_Input"  width=6cm
+
+  \note As all Fl_Input derived objects, Fl_File_Input may call its callback
+  when losing focus (see FL_UNFOCUS) to update its state like its cursor shape.
+  One resulting side effect is that you should call clear_changed() early in your callback
+  to avoid reentrant calls if you plan to show another window or dialog box in the callback.
+*/
+class FL_EXPORT Fl_File_Input : public Fl_Input {
+  
+  Fl_Color	errorcolor_;
+  char		ok_entry_;
+  uchar		down_box_;
+  short		buttons_[200];
+  short		pressed_;
+
+  void		draw_buttons();
+  int		handle_button(int event);
+  void		update_buttons();
+
+public:
+
+  Fl_File_Input(int X, int Y, int W, int H, const char *L=0);
+
+  virtual int handle(int event);
+
+protected:
+  virtual void draw();
+
+public:
+  /** Gets the box type used for the navigation bar. */
+  Fl_Boxtype	down_box() const { return (Fl_Boxtype)down_box_; }
+  /** Sets the box type to use for the navigation bar.  */
+  void		down_box(Fl_Boxtype b) { down_box_ = b; }
+
+  /**
+    Gets the current error color.
+    \todo Better docs for Fl_File_Input::errorcolor() - is it even used?
+  */
+  Fl_Color	errorcolor() const { return errorcolor_; }
+  /** Sets the current error color to \p c */
+  void		errorcolor(Fl_Color c) { errorcolor_ = c; }
+
+  int	value(const char *str);
+  int	value(const char *str, int len);
+
+  /**
+    Returns the current value, which is a pointer to an internal buffer
+    and is valid only until the next event is handled.
+  */
+  const char	*value() { return Fl_Input_::value(); }
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_File_Input, Fl_Input)
+};
+
+#endif // !Fl_File_Input_H
+
+
+//
+// End of "$Id: Fl_File_Input.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
+//

+ 39 - 39
fltk/FL/Fl_Fill_Dial.H

@@ -1,39 +1,39 @@
-//
-// "$Id: Fl_Fill_Dial.H 9637 2012-07-24 04:37:22Z matt $"
-//
-// Filled dial header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_Fill_Dial widget . */
-
-#ifndef Fl_Fill_Dial_H
-#define Fl_Fill_Dial_H
-
-#include "Fl_Dial.H"
-
-/** Draws a dial with a filled arc */
-class FL_EXPORT Fl_Fill_Dial : public Fl_Dial {
-public:
-  /** Creates a filled dial, also setting its type to FL_FILL_DIAL. */
-  Fl_Fill_Dial(int X,int Y,int W,int H, const char *L = 0);
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_Fill_Dial, Fl_Dial)
-};
-
-#endif
-
-//
-// End of "$Id: Fl_Fill_Dial.H 9637 2012-07-24 04:37:22Z matt $".
-//
+//
+// "$Id: Fl_Fill_Dial.H 9637 2012-07-24 04:37:22Z matt $"
+//
+// Filled dial header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2010 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_Fill_Dial widget . */
+
+#ifndef Fl_Fill_Dial_H
+#define Fl_Fill_Dial_H
+
+#include "Fl_Dial.H"
+
+/** Draws a dial with a filled arc */
+class FL_EXPORT Fl_Fill_Dial : public Fl_Dial {
+public:
+  /** Creates a filled dial, also setting its type to FL_FILL_DIAL. */
+  Fl_Fill_Dial(int X,int Y,int W,int H, const char *L = 0);
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_Fill_Dial, Fl_Dial)
+};
+
+#endif
+
+//
+// End of "$Id: Fl_Fill_Dial.H 9637 2012-07-24 04:37:22Z matt $".
+//

+ 38 - 39
fltk/FL/Fl_Fill_Slider.H

@@ -1,39 +1,38 @@
-//
-// "$Id: Fl_Fill_Slider.H 9637 2012-07-24 04:37:22Z matt $"
-//
-// Filled slider header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_Fill_Slider widget . */
-
-#ifndef Fl_Fill_Slider_H
-#define Fl_Fill_Slider_H
-
-#include "Fl_Slider.H"
-/** Widget that draws a filled horizontal  slider,  useful as a progress or value meter*/
-class FL_EXPORT Fl_Fill_Slider : public Fl_Slider {
-public:
-  /** Creates the slider from its position,size and optional title. */
-  Fl_Fill_Slider(int X,int Y,int W,int H,const char *L=0);
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_Fill_Slider, Fl_Slider)
-
-};
-
-#endif
-
-//
-// End of "$Id: Fl_Fill_Slider.H 9637 2012-07-24 04:37:22Z matt $".
-//
+//
+// "$Id: Fl_Fill_Slider.H 9637 2012-07-24 04:37:22Z matt $"
+//
+// Filled slider header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2010 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_Fill_Slider widget . */
+
+#ifndef Fl_Fill_Slider_H
+#define Fl_Fill_Slider_H
+
+#include "Fl_Slider.H"
+/** Widget that draws a filled horizontal  slider,  useful as a progress or value meter*/
+class FL_EXPORT Fl_Fill_Slider : public Fl_Slider {
+public:
+  /** Creates the slider from its position,size and optional title. */
+  Fl_Fill_Slider(int X,int Y,int W,int H,const char *L=0);
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_Fill_Slider, Fl_Slider)
+};
+
+#endif
+
+//
+// End of "$Id: Fl_Fill_Slider.H 9637 2012-07-24 04:37:22Z matt $".
+//

+ 53 - 54
fltk/FL/Fl_Float_Input.H

@@ -1,55 +1,54 @@
-//
-// "$Id: Fl_Float_Input.H 9637 2012-07-24 04:37:22Z matt $"
-//
-// Floating point input header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2011 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_Float_Input widget . */
-
-#ifndef Fl_Float_Input_H
-#define Fl_Float_Input_H
-
-#include "Fl_Input.H"
-
-/**
-  The Fl_Float_Input class is a subclass of Fl_Input
-  that only allows the user to type floating point numbers (sign,
-  digits, decimal point, more digits, 'E' or 'e', sign, digits).
-*/
-class FL_EXPORT Fl_Float_Input : public Fl_Input {
-public:
-  /**
+//
+// "$Id: Fl_Float_Input.H 9637 2012-07-24 04:37:22Z matt $"
+//
+// Floating point input header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2011 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_Float_Input widget . */
+
+#ifndef Fl_Float_Input_H
+#define Fl_Float_Input_H
+
+#include "Fl_Input.H"
+
+/**
+  The Fl_Float_Input class is a subclass of Fl_Input
+  that only allows the user to type floating point numbers (sign,
+  digits, decimal point, more digits, 'E' or 'e', sign, digits).
+*/
+class FL_EXPORT Fl_Float_Input : public Fl_Input {
+public:
+  /**
     Creates a new Fl_Float_Input widget using the given position,
-    size, and label string. The default boxtype is FL_DOWN_BOX.
-
-    Inherited destructor destroys the widget and any value associated with it.
-  */
-  Fl_Float_Input(int X,int Y,int W,int H,const char *l = 0);
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_Float_Input, Fl_Input)
-};
-
-class FL_EXPORT Fl_Float_Input_Fmt : public Fl_Float_Input {
-public:
-  Fl_Float_Input_Fmt(int X,int Y,int W,int H,const char *l = 0)
-      : Fl_Float_Input(X,Y,W,H,l) {use_numeric_format(1);}
-};
-
-#endif
-
-//
-// End of "$Id: Fl_Float_Input.H 9637 2012-07-24 04:37:22Z matt $".
-//
+    size, and label string. The default boxtype is FL_DOWN_BOX.
+
+    Inherited destructor destroys the widget and any value associated with it.
+  */
+  Fl_Float_Input(int X,int Y,int W,int H,const char *l = 0);
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_Float_Input, Fl_Input)
+};
+
+class FL_EXPORT Fl_Float_Input_Fmt : public Fl_Float_Input {
+public:
+  Fl_Float_Input_Fmt(int X,int Y,int W,int H,const char *l = 0)
+      : Fl_Float_Input(X,Y,W,H,l) {use_numeric_format(1);}
+};
+
+#endif
+
+//
+// End of "$Id: Fl_Float_Input.H 9637 2012-07-24 04:37:22Z matt $".
+//

+ 47 - 47
fltk/FL/Fl_FormsBitmap.H

@@ -1,47 +1,47 @@
-//
-// "$Id: Fl_FormsBitmap.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
-//
-// Forms bitmap header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_FormsBitmap widget . */
-
-#ifndef Fl_FormsBitmap_H
-#define Fl_FormsBitmap_H
-
-#include "Fl_Bitmap.H"
-
-/** 
-    Forms compatibility Bitmap Image Widget
-*/
-class FL_EXPORT Fl_FormsBitmap : public Fl_Widget {
-    Fl_Bitmap *b;
-protected:
-    void draw();
-public:
-    Fl_FormsBitmap(Fl_Boxtype, int, int, int, int, const char * = 0);
-    void set(int W, int H, const uchar *bits);
-    /** Sets a new bitmap. */
-    void bitmap(Fl_Bitmap *B) {b = B;}
-    /** Gets a the current associated Fl_Bitmap objects. */
-    Fl_Bitmap *bitmap() const {return b;}
-};
-
-#endif
-
-//
-// End of "$Id: Fl_FormsBitmap.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
-//
+//
+// "$Id: Fl_FormsBitmap.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
+//
+// Forms bitmap header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2010 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_FormsBitmap widget . */
+
+#ifndef Fl_FormsBitmap_H
+#define Fl_FormsBitmap_H
+
+#include "Fl_Bitmap.H"
+
+/** 
+    Forms compatibility Bitmap Image Widget
+*/
+class FL_EXPORT Fl_FormsBitmap : public Fl_Widget {
+    Fl_Bitmap *b;
+protected:
+    void draw();
+public:
+    Fl_FormsBitmap(Fl_Boxtype, int, int, int, int, const char * = 0);
+    void set(int W, int H, const uchar *bits);
+    /** Sets a new bitmap. */
+    void bitmap(Fl_Bitmap *B) {b = B;}
+    /** Gets a the current associated Fl_Bitmap objects. */
+    Fl_Bitmap *bitmap() const {return b;}
+};
+
+#endif
+
+//
+// End of "$Id: Fl_FormsBitmap.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
+//

+ 54 - 54
fltk/FL/Fl_FormsPixmap.H

@@ -1,54 +1,54 @@
-//
-// "$Id: Fl_FormsPixmap.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
-//
-// Forms pixmap header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_FormsPixmap widget . */
-
-#ifndef Fl_FormsPixmap_H
-#define Fl_FormsPixmap_H
-
-#include "Fl_Pixmap.H"
-
-/**
-  \class Fl_FormsPixmap
-  \brief Forms pixmap drawing routines
-*/
-class FL_EXPORT Fl_FormsPixmap : public Fl_Widget {
-    Fl_Pixmap *b;
-protected:
-    void draw();
-public:
-    Fl_FormsPixmap(Fl_Boxtype t, int X, int Y, int W, int H, const char *L= 0);
-
-    void set(/*const*/char * const * bits);
-
-    /**
-      Set the internal pixmap pointer to an existing pixmap.
-      \param[in] B existing pixmap
-    */
-    void Pixmap(Fl_Pixmap *B) {b = B;}
-
-    /** Get the internal pixmap pointer. */
-    Fl_Pixmap *Pixmap() const {return b;}
-};
-
-#endif
-
-//
-// End of "$Id: Fl_FormsPixmap.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
-//
+//
+// "$Id: Fl_FormsPixmap.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
+//
+// Forms pixmap header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2010 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_FormsPixmap widget . */
+
+#ifndef Fl_FormsPixmap_H
+#define Fl_FormsPixmap_H
+
+#include "Fl_Pixmap.H"
+
+/**
+  \class Fl_FormsPixmap
+  \brief Forms pixmap drawing routines
+*/
+class FL_EXPORT Fl_FormsPixmap : public Fl_Widget {
+    Fl_Pixmap *b;
+protected:
+    void draw();
+public:
+    Fl_FormsPixmap(Fl_Boxtype t, int X, int Y, int W, int H, const char *L= 0);
+
+    void set(/*const*/char * const * bits);
+
+    /**
+      Set the internal pixmap pointer to an existing pixmap.
+      \param[in] B existing pixmap
+    */
+    void Pixmap(Fl_Pixmap *B) {b = B;}
+
+    /** Get the internal pixmap pointer. */
+    Fl_Pixmap *Pixmap() const {return b;}
+};
+
+#endif
+
+//
+// End of "$Id: Fl_FormsPixmap.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
+//

+ 80 - 80
fltk/FL/Fl_Free.H

@@ -1,80 +1,80 @@
-//
-// "$Id: Fl_Free.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
-//
-// Forms free header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_Free widget . */
-
-#ifndef Fl_Free_H
-#define Fl_Free_H
-
-#ifndef Fl_Widget_H
-#include "Fl_Widget.H"
-#endif
-
-#define FL_NORMAL_FREE		1 /**< normal event handling */
-#define FL_SLEEPING_FREE	2 /**< deactivate event handling */
-#define FL_INPUT_FREE		3 /**< accepts FL_FOCUS events */
-#define FL_CONTINUOUS_FREE	4 /**< repeated timeout handling */
-#define FL_ALL_FREE		5 /**< FL_INPUT_FREE and FL_CONTINOUS_FREE */
-
-/** appropriate signature for handle function */
-typedef int (*FL_HANDLEPTR)(Fl_Widget *, int , float, float, char);
-
-/**
-  Emulation of the Forms "free" widget.
-  
-  This emulation allows the free demo to run, and appears to be useful for
-  porting programs written in Forms which use the free widget or make
-  subclasses of the Forms widgets.
-
-  There are five types of free, which determine when the handle function
-  is called:
-  
-  \li \c FL_NORMAL_FREE      normal event handling.
-  \li \c FL_SLEEPING_FREE    deactivates event handling (widget is inactive).
-  \li \c FL_INPUT_FREE       accepts FL_FOCUS events.
-  \li \c FL_CONTINUOUS_FREE  sets a timeout callback 100 times a second and
-                             provides an FL_STEP event. This has obvious
-			     detrimental effects on machine performance.
-  \li \c FL_ALL_FREE         same as FL_INPUT_FREE and FL_CONTINUOUS_FREE.
- 
-*/
-class FL_EXPORT Fl_Free : public Fl_Widget {
-    FL_HANDLEPTR hfunc;
-    static void step(void *);
-protected:
-    void draw();
-public:
-    int handle(int e);
-  Fl_Free(uchar t,int X,int Y,int W,int H,const char *L,FL_HANDLEPTR hdl);
-  ~Fl_Free();
-};
-
-// old event names for compatibility:
-#define FL_MOUSE	FL_DRAG /**< for backward compatibility */
-#define FL_DRAW		100     /**< for backward compatibility [UNUSED]*/
-#define FL_STEP		101     /**< for backward compatibility */
-#define FL_FREEMEM	102     /**< for backward compatibility [UNUSED]*/
-#define FL_FREEZE	103     /**< for backward compatibility [UNUSED]*/
-#define FL_THAW		104     /**< for backward compatibility [UNUSED]*/
-
-#endif
-
-//
-// End of "$Id: Fl_Free.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
-//
+//
+// "$Id: Fl_Free.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
+//
+// Forms free header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2010 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_Free widget . */
+
+#ifndef Fl_Free_H
+#define Fl_Free_H
+
+#ifndef Fl_Widget_H
+#include "Fl_Widget.H"
+#endif
+
+#define FL_NORMAL_FREE		1 /**< normal event handling */
+#define FL_SLEEPING_FREE	2 /**< deactivate event handling */
+#define FL_INPUT_FREE		3 /**< accepts FL_FOCUS events */
+#define FL_CONTINUOUS_FREE	4 /**< repeated timeout handling */
+#define FL_ALL_FREE		5 /**< FL_INPUT_FREE and FL_CONTINOUS_FREE */
+
+/** appropriate signature for handle function */
+typedef int (*FL_HANDLEPTR)(Fl_Widget *, int , float, float, char);
+
+/**
+  Emulation of the Forms "free" widget.
+  
+  This emulation allows the free demo to run, and appears to be useful for
+  porting programs written in Forms which use the free widget or make
+  subclasses of the Forms widgets.
+
+  There are five types of free, which determine when the handle function
+  is called:
+  
+  \li \c FL_NORMAL_FREE      normal event handling.
+  \li \c FL_SLEEPING_FREE    deactivates event handling (widget is inactive).
+  \li \c FL_INPUT_FREE       accepts FL_FOCUS events.
+  \li \c FL_CONTINUOUS_FREE  sets a timeout callback 100 times a second and
+                             provides an FL_STEP event. This has obvious
+			     detrimental effects on machine performance.
+  \li \c FL_ALL_FREE         same as FL_INPUT_FREE and FL_CONTINUOUS_FREE.
+ 
+*/
+class FL_EXPORT Fl_Free : public Fl_Widget {
+    FL_HANDLEPTR hfunc;
+    static void step(void *);
+protected:
+    void draw();
+public:
+    int handle(int e);
+  Fl_Free(uchar t,int X,int Y,int W,int H,const char *L,FL_HANDLEPTR hdl);
+  ~Fl_Free();
+};
+
+// old event names for compatibility:
+#define FL_MOUSE	FL_DRAG /**< for backward compatibility */
+#define FL_DRAW		100     /**< for backward compatibility [UNUSED]*/
+#define FL_STEP		101     /**< for backward compatibility */
+#define FL_FREEMEM	102     /**< for backward compatibility [UNUSED]*/
+#define FL_FREEZE	103     /**< for backward compatibility [UNUSED]*/
+#define FL_THAW		104     /**< for backward compatibility [UNUSED]*/
+
+#endif
+
+//
+// End of "$Id: Fl_Free.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
+//

+ 43 - 44
fltk/FL/Fl_GIF_Image.H

@@ -1,44 +1,43 @@
-//
-// "$Id: Fl_GIF_Image.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
-//
-// GIF image header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_GIF_Image widget . */
-
-#ifndef Fl_GIF_Image_H
-#define Fl_GIF_Image_H
-#  include "Fl_Pixmap.H"
-
-/**
-  The Fl_GIF_Image class supports loading, caching,
-  and drawing of Compuserve GIF<SUP>SM</SUP> images. The class
-  loads the first image and supports transparency.
-*/
-class FL_EXPORT Fl_GIF_Image : public Fl_Pixmap {
-
-  public:
-
-  Fl_GIF_Image(const char* filename);
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_GIF_Image, Fl_Pixmap)
-};
-
-#endif
-
-//
-// End of "$Id: Fl_GIF_Image.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
-//
+//
+// "$Id: Fl_GIF_Image.H 10732 2015-05-23 23:42:26Z matt $"
+//
+// GIF image header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2010 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_GIF_Image widget . */
+
+#ifndef Fl_GIF_Image_H
+#define Fl_GIF_Image_H
+#  include "Fl_Pixmap.H"
+
+/**
+ The Fl_GIF_Image class supports loading, caching,
+ and drawing of Compuserve GIF<SUP>SM</SUP> images. The class
+ loads the first image and supports transparency.
+ */
+class FL_EXPORT Fl_GIF_Image : public Fl_Pixmap {
+
+  public:
+
+  Fl_GIF_Image(const char* filename);
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_GIF_Image, Fl_Pixmap)
+};
+
+#endif
+
+//
+// End of "$Id: Fl_GIF_Image.H 10732 2015-05-23 23:42:26Z matt $".
+//

+ 249 - 233
fltk/FL/Fl_Gl_Window.H

@@ -1,234 +1,250 @@
-//
-// "$Id: Fl_Gl_Window.H 10063 2014-01-16 15:38:06Z manolo $"
-//
-// OpenGL header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_Gl_Window widget . */
-
-#ifndef Fl_Gl_Window_H
-#define Fl_Gl_Window_H
-
-#include "Fl_Window.H"
-
-#ifndef GLContext
-/**
-  Opaque pointer type to hide system specific implementation.
-*/
-typedef void* GLContext; // actually a GLXContext or HGLDC
-#endif
-
-class Fl_Gl_Choice; // structure to hold result of glXChooseVisual
-
-/**
-  The Fl_Gl_Window widget sets things up so OpenGL works.
-  
-  It also keeps an OpenGL "context" for that window, so that changes to the
-  lighting and projection may be reused between redraws. Fl_Gl_Window
-  also flushes the OpenGL streams and swaps buffers after draw() returns.
-
-  OpenGL hardware typically provides some overlay bit planes, which
-  are very useful for drawing UI controls atop your 3D graphics.  If the
-  overlay hardware is not provided, FLTK tries to simulate the overlay.
-  This works pretty well if your graphics are double buffered, but not
-  very well for single-buffered.
-
-  Please note that the FLTK drawing and clipping functions
-  will not work inside an Fl_Gl_Window. All drawing
-  should be done using OpenGL calls exclusively.
-  Even though Fl_Gl_Window is derived from Fl_Group, 
-  it is not useful to add other FLTK Widgets as children,
-  unless those widgets are modified to draw using OpenGL calls.
-*/
-class FL_EXPORT Fl_Gl_Window : public Fl_Window {
-
-  int mode_;
-  const int *alist;
-  Fl_Gl_Choice *g;
-  GLContext context_;
-  char valid_f_;
-  char damage1_; // damage() of back buffer
-  virtual void draw_overlay();
-  void init();
-
-  void *overlay;
-  void make_overlay();
-  friend class _Fl_Gl_Overlay;
-
-  static int can_do(int, const int *);
-  int mode(int, const int *);
+//
+// "$Id: Fl_Gl_Window.H 11794 2016-06-22 07:45:53Z manolo $"
+//
+// OpenGL header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2016 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_Gl_Window widget . */
+
+#ifndef Fl_Gl_Window_H
+#define Fl_Gl_Window_H
+
+#include "Fl_Window.H"
+
+class Fl_Gl_Choice; // structure to hold result of glXChooseVisual
+class Fl_Gl_Window_Driver;
+/**
+  The Fl_Gl_Window widget sets things up so OpenGL works.
+  
+  It also keeps an OpenGL "context" for that window, so that changes to the
+  lighting and projection may be reused between redraws. Fl_Gl_Window
+  also flushes the OpenGL streams and swaps buffers after draw() returns.
+
+  OpenGL hardware typically provides some overlay bit planes, which
+  are very useful for drawing UI controls atop your 3D graphics.  If the
+  overlay hardware is not provided, FLTK tries to simulate the overlay.
+  This works pretty well if your graphics are double buffered, but not
+  very well for single-buffered.
+
+  Please note that the FLTK drawing and clipping functions
+  will not work inside an Fl_Gl_Window. All drawing
+  should be done using OpenGL calls exclusively.
+  Even though Fl_Gl_Window is derived from Fl_Group, 
+  it is not useful to add other FLTK Widgets as children,
+  unless those widgets are modified to draw using OpenGL calls.
+*/
+class FL_EXPORT Fl_Gl_Window : public Fl_Window {
+  friend class Fl_Gl_Window_Driver;
+  Fl_Gl_Window_Driver *pGlWindowDriver;
+
+  int mode_;
+  const int *alist;
+  Fl_Gl_Choice *g;
+  GLContext context_;
+  char valid_f_;
+  char damage1_; // damage() of back buffer
+  virtual void draw_overlay();
+  void init();
+
+  void *overlay;
+
+  static int can_do(int, const int *);
+  int mode(int, const int *);
   static int gl_plugin_linkage();
-
-public:
-
-  void show();
-  void show(int a, char **b) {Fl_Window::show(a,b);}
-  void flush();
-  void hide();
-  void resize(int,int,int,int);
-  int handle(int);
-  
-  /**
-    Is turned off when FLTK creates a new context for this window or 
-    when the window resizes, and is turned on \e after draw() is called.
-    You can use this inside your draw() method to avoid unnecessarily
-    initializing the OpenGL context. Just do this:
-    \code
-    void mywindow::draw() {
-     if (!valid()) {
-       glViewport(0,0,w(),h());
-       glFrustum(...);
-       ...other initialization...
-     }
-     if (!context_valid()) {
-       ...load textures, etc. ...
-     }
-     ... draw your geometry here ...
-    }
-    \endcode
-    
-    You can turn valid() on by calling valid(1).  You
-    should only do this after fixing the transformation inside a draw()
-    or after make_current().  This is done automatically after 
-    draw() returns.
-  */
-  char valid() const {return valid_f_ & 1;}
-  /**
-    See char Fl_Gl_Window::valid() const 
-  */
-  void valid(char v) {if (v) valid_f_ |= 1; else valid_f_ &= 0xfe;}
-  void invalidate();
-
-  /**
-    Will only be set if the 
-    OpenGL context is created or recreated. It differs from
-    Fl_Gl_Window::valid() which is also set whenever the context
-    changes size.
-  */
-  char context_valid() const {return valid_f_ & 2;}
-  /**
-    See char Fl_Gl_Window::context_valid() const 
-  */
-  void context_valid(char v) {if (v) valid_f_ |= 2; else valid_f_ &= 0xfd;}
-
-  /**  Returns non-zero if the hardware supports the given or current OpenGL mode. */
-  static int can_do(int m) {return can_do(m,0);}
-  /**  Returns non-zero if the hardware supports the given or current OpenGL mode. */
-  static int can_do(const int *m) {return can_do(0, m);}
-  /**  Returns non-zero if the hardware supports the given or current OpenGL mode. */
-  int can_do() {return can_do(mode_,alist);}
-  /**
-    Set or change the OpenGL capabilites of the window.  The value can be
-    any of the following OR'd together:
-
-    - \c FL_RGB - RGB color (not indexed)
-    - \c FL_RGB8 - RGB color with at least 8 bits of each color
-    - \c FL_INDEX - Indexed mode
-    - \c FL_SINGLE - not double buffered
-    - \c FL_DOUBLE - double buffered
-    - \c FL_ACCUM - accumulation buffer
-    - \c FL_ALPHA - alpha channel in color
-    - \c FL_DEPTH - depth buffer
-    - \c FL_STENCIL - stencil buffer
-    - \c FL_MULTISAMPLE - multisample antialiasing
-
-    FL_RGB and FL_SINGLE have a value of zero, so they
-    are "on" unless you give FL_INDEX or FL_DOUBLE.
-
-    If the desired combination cannot be done, FLTK will try turning off 
-    FL_MULTISAMPLE.  If this also fails the show() will call 
-    Fl::error() and not show the window.
-
-    You can change the mode while the window is displayed.  This is most
-    useful for turning double-buffering on and off.  Under X this will
-    cause the old X window to be destroyed and a new one to be created.  If
-    this is a top-level window this will unfortunately also cause the
-    window to blink, raise to the top, and be de-iconized, and the xid()
-    will change, possibly breaking other code.  It is best to make the GL
-    window a child of another window if you wish to do this!
-
-    mode() must not be called within draw() since it
-    changes the current context.
-  */
-  Fl_Mode mode() const {return (Fl_Mode)mode_;}
-  /** See Fl_Mode mode() const */
-  int mode(int a) {return mode(a,0);}
-  /** See Fl_Mode mode() const */
-  int mode(const int *a) {return mode(0, a);}
-  /** void See void context(void* v, int destroy_flag) */
-  void* context() const {return context_;}
-  void context(void*, int destroy_flag = 0);
-  void make_current();
-  void swap_buffers();
-  void ortho();
-
-  /**
-    Returns true if the hardware overlay is possible.  If this is false,
-    FLTK will try to simulate the overlay, with significant loss of update
-    speed.  Calling this will cause FLTK to open the display.
-  */
-  int can_do_overlay();
-  /**
-    This method causes draw_overlay() to be called at a later time.
-    Initially the overlay is clear. If you want the window to display
-    something in the overlay when it first appears, you must call this
-    immediately after you show() your window.
-  */
-  void redraw_overlay();
-  void hide_overlay();
-  /**
-    The make_overlay_current() method selects the OpenGL context
-    for the widget's overlay.  It is called automatically prior to the 
-    draw_overlay() method being called and can also be used to
-    implement feedback and/or selection within the handle()
-    method.
-  */
-  void make_overlay_current();
-
-  // Note: Doxygen docs in Fl_Widget.H to avoid redundancy.
-  virtual Fl_Gl_Window* as_gl_window() {return this;}
-  
-  ~Fl_Gl_Window();
-  /**
-    Creates a new Fl_Gl_Window widget using the given size, and label string. 
-    The default boxtype is FL_NO_BOX. The default mode is FL_RGB|FL_DOUBLE|FL_DEPTH.
-  */
-  Fl_Gl_Window(int W, int H, const char *l=0) : Fl_Window(W,H,l) {init();}
-  /**
-    Creates a new Fl_Gl_Window widget using the given position,
-    size, and label string. The default boxtype is FL_NO_BOX. The
-    default mode is FL_RGB|FL_DOUBLE|FL_DEPTH.
-  */
-
-  Fl_Gl_Window(int X, int Y, int W, int H, const char *l=0)
-    : Fl_Window(X,Y,W,H,l) {init();}
-
-protected:
-  /**
-    Draws the Fl_Gl_Window.
-
-    You \e \b must override the draw() method.
-  */
-  virtual void draw();
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_Gl_Window, Fl_Window)
-};
-
-#endif
-
-//
-// End of "$Id: Fl_Gl_Window.H 10063 2014-01-16 15:38:06Z manolo $".
-//
+protected:
+  virtual void draw();
+
+public:
+  void show();
+  /** Same as Fl_Window::show(int a, char **b) */
+  void show(int a, char **b) {Fl_Window::show(a,b);}
+  void flush();
+  void hide();
+  void resize(int,int,int,int);
+  int handle(int);
+  /** Returns a pointer to the window's Fl_Gl_Window_Driver object */
+  Fl_Gl_Window_Driver *gl_driver() {return pGlWindowDriver;}
+  
+  /**
+    Is turned off when FLTK creates a new context for this window or 
+    when the window resizes, and is turned on \e after draw() is called.
+    You can use this inside your draw() method to avoid unnecessarily
+    initializing the OpenGL context. Just do this:
+    \code
+    void mywindow::draw() {
+     if (!valid()) {
+       glViewport(0,0,pixel_w(),pixel_h());
+       glFrustum(...);
+       ...other initialization...
+     }
+     if (!context_valid()) {
+       ...load textures, etc. ...
+     }
+     ... draw your geometry here ...
+    }
+    \endcode
+    
+    You can turn valid() on by calling valid(1).  You
+    should only do this after fixing the transformation inside a draw()
+    or after make_current().  This is done automatically after 
+    draw() returns.
+  */
+  char valid() const {return valid_f_ & 1;}
+  /**
+    See char Fl_Gl_Window::valid() const 
+  */
+  void valid(char v) {if (v) valid_f_ |= 1; else valid_f_ &= 0xfe;}
+  void invalidate();
+
+  /**
+    Will only be set if the 
+    OpenGL context is created or recreated. It differs from
+    Fl_Gl_Window::valid() which is also set whenever the context
+    changes size.
+  */
+  char context_valid() const {return valid_f_ & 2;}
+  /**
+    See char Fl_Gl_Window::context_valid() const 
+  */
+  void context_valid(char v) {if (v) valid_f_ |= 2; else valid_f_ &= 0xfd;}
+
+  /**  Returns non-zero if the hardware supports the given OpenGL mode. */
+  static int can_do(int m) {return can_do(m,0);}
+  /**  Returns non-zero if the hardware supports the given OpenGL mode.
+   \see Fl_Gl_Window::mode(const int *a) */
+  static int can_do(const int *m) {return can_do(0, m);}
+  /**  Returns non-zero if the hardware supports the current OpenGL mode. */
+  int can_do() {return can_do(mode_,alist);}
+  /** Returns the current OpenGL capabilites of the window.
+   Don't use this if capabilities were set through Fl_Gl_Window::mode(const int *a).
+   */
+  Fl_Mode mode() const {return (Fl_Mode)mode_;}
+  /**
+   Set or change the OpenGL capabilites of the window.  The value can be
+   any of the following OR'd together:
+   
+   - \c FL_RGB - RGB color (not indexed)
+   - \c FL_RGB8 - RGB color with at least 8 bits of each color
+   - \c FL_INDEX - Indexed mode
+   - \c FL_SINGLE - not double buffered
+   - \c FL_DOUBLE - double buffered
+   - \c FL_ACCUM - accumulation buffer
+   - \c FL_ALPHA - alpha channel in color
+   - \c FL_DEPTH - depth buffer
+   - \c FL_STENCIL - stencil buffer
+   - \c FL_MULTISAMPLE - multisample antialiasing
+   - \c FL_OPENGL3 - use OpenGL version 3.0 or more when running Mac OS.
+   
+   FL_RGB and FL_SINGLE have a value of zero, so they
+   are "on" unless you give FL_INDEX or FL_DOUBLE.
+   
+   If the desired combination cannot be done, FLTK will try turning off
+   FL_MULTISAMPLE.  If this also fails the show() will call
+   Fl::error() and not show the window.
+   
+   You can change the mode while the window is displayed.  This is most
+   useful for turning double-buffering on and off.  Under X this will
+   cause the old X window to be destroyed and a new one to be created.  If
+   this is a top-level window this will unfortunately also cause the
+   window to blink, raise to the top, and be de-iconized, and the xid()
+   will change, possibly breaking other code.  It is best to make the GL
+   window a child of another window if you wish to do this!
+   
+   mode() must not be called within draw() since it
+   changes the current context.
+   
+   \note On the <b>MSWindows and Unix/Linux platforms</b>, FLTK produces
+   contexts for the highest OpenGL version supported by the hardware. Such contexts
+   are also compatible with lower OpenGL versions. On the <b>Apple OS X
+   platform</b>, it is necessary to decide whether the source code targets
+   OpenGL versions higher or lower than 3.0. By default, FLTK
+   creates contexts adequate for OpenGL versions 1 and 2. To get contexts
+   for OpenGL 3.0 or higher, the <tt>FL_OPENGL3</tt> flag and Mac OS
+   version 10.7 or higher are required (in that case the context is NOT 
+   compatible with OpenGL versions 1 or 2). The <tt>FL_OPENGL3</tt> flag has no
+   effect on non-Apple platforms.
+   
+   \version the <tt>FL_OPENGL3</tt> flag appeared in version 1.3.4
+   */
+  int mode(int a) {return mode(a,0);}
+  /** Set the OpenGL capabilites of the window using platform-specific data.
+   \param a zero-ending array of platform-specific attributes and attribute values
+   <p><b>Unix/Linux platform</b>: attributes are GLX attributes adequate for the 3rd argument of
+   the <tt>glXChooseVisual()</tt> function (e.g., <tt>GLX_DOUBLEBUFFER</tt>, defined by including <GL/glx.h>).
+   \note What attributes are adequate here is subject to change.
+   The preferred, stable public API is Fl_Gl_Window::mode(int a).
+   <p><b>MSWindows platform</b>: this member function is of no use.
+   <p><b>Mac OS X platform</b>: attributes belong to the <tt>CGLPixelFormatAttribute</tt> enumeration
+   (defined by including <tt><OpenGL/OpenGL.h></tt>, e.g., <tt>kCGLPFADoubleBuffer</tt>)
+   and may be followed by adequate attribute values.
+   */
+  int mode(const int *a) {return mode(0, a);}
+  /** Returns a pointer to the GLContext that this window is using.
+   \see void context(GLContext c, int destroy_flag) */
+  GLContext context() const {return context_;}
+  void context(GLContext, int destroy_flag = 0);
+  void make_current();
+  void swap_buffers();
+  void ortho();
+
+  int can_do_overlay();
+  void redraw_overlay();
+  void hide_overlay();
+  void make_overlay_current();
+
+  // Note: Doxygen docs in Fl_Widget.H to avoid redundancy.
+  virtual Fl_Gl_Window* as_gl_window() {return this;}
+  
+  float pixels_per_unit();
+  /** Gives the window width in OpenGL pixels.
+   Generally identical with the result of the w() function, but for a window mapped to
+   an Apple 'retina' display, and if Fl::use_high_res_GL(bool) is set to true,
+   pixel_w() returns 2 * w(). This method detects when the window has been moved
+   between low and high resolution displays and automatically adjusts the returned value.
+   \version 1.3.4
+   */
+  int pixel_w() { return int(pixels_per_unit() * w() + 0.5f); }
+  /** Gives the window height in OpenGL pixels.
+   Generally identical with the result of the h() function, but for a window mapped to
+   an Apple 'retina' display, and if Fl::use_high_res_GL(bool) is set to true,
+   pixel_h() returns 2 * h(). This method detects when the window has been moved
+   between low and high resolution displays and automatically adjusts the returned value.
+   \version 1.3.4
+   */
+  int pixel_h() { return int(pixels_per_unit() * h() + 0.5f); }
+  
+  ~Fl_Gl_Window();
+  /**
+    Creates a new Fl_Gl_Window widget using the given size, and label string. 
+    The default boxtype is FL_NO_BOX. The default mode is FL_RGB|FL_DOUBLE|FL_DEPTH.
+  */
+  Fl_Gl_Window(int W, int H, const char *l=0) : Fl_Window(W,H,l) {init();}
+  /**
+    Creates a new Fl_Gl_Window widget using the given position,
+    size, and label string. The default boxtype is FL_NO_BOX. The
+    default mode is FL_RGB|FL_DOUBLE|FL_DEPTH.
+  */
+
+  Fl_Gl_Window(int X, int Y, int W, int H, const char *l=0)
+    : Fl_Window(X,Y,W,H,l) {init();}
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_Gl_Window, Fl_Window)
+};
+
+#endif // Fl_Gl_Window_H
+
+//
+// End of "$Id: Fl_Gl_Window.H 11794 2016-06-22 07:45:53Z manolo $".
+//

+ 193 - 0
fltk/FL/Fl_Gl_Window_Driver.H

@@ -0,0 +1,193 @@
+//
+// "$Id: Fl_Gl_Window_Driver.H 12617 2017-12-30 10:43:36Z manolo $"
+//
+// Definition of class Fl_Gl_Window_Driver, and of its platform-specific derived classes
+// for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 2016-2017 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+#ifndef Fl_Gl_Window_Driver_H
+#define Fl_Gl_Window_Driver_H
+
+#if defined(FL_PORTING)
+# pragma message "FL_PORTING: please, derive and implement the Fl_Gl_Window_Driver class for your platform"
+#endif
+
+#include <FL/Fl_Gl_Window.H>
+
+class Fl_Gl_Choice;
+class Fl_Font_Descriptor;
+
+/* The constructor of each Fl_Gl_Window object creates also an object from a
+ platform-specific derived class from this class.
+ */
+class Fl_Gl_Window_Driver {
+protected:
+  Fl_Gl_Window *pWindow;
+public:
+  Fl_Gl_Choice* g() {return pWindow->g;}
+  void g(Fl_Gl_Choice *c) {pWindow->g = c;}
+  int mode() {return pWindow->mode_;}
+  void mode(int m) { pWindow->mode_ = m;}
+  const int *alist() {return pWindow->alist;}
+  void alist(const int *l) { pWindow->alist = l;}
+  void* overlay() {return pWindow->overlay;}
+  void draw_overlay() {pWindow->draw_overlay();}
+  
+  Fl_Gl_Window_Driver(Fl_Gl_Window *win) : pWindow(win) {}
+  virtual ~Fl_Gl_Window_Driver() {}
+  static Fl_Gl_Window_Driver *newGlWindowDriver(Fl_Gl_Window *w);
+  static Fl_Gl_Window_Driver *global();
+  virtual float pixels_per_unit() {return 1;}
+  virtual void before_show(int& need_redraw) {}
+  virtual void after_show(int need_redraw) {}
+  virtual void invalidate();
+  virtual int mode_(int m, const int *a) {return 0;}
+  virtual void make_current_before() {}
+  virtual void make_current_after() {}
+  virtual void swap_buffers() {}
+  virtual void resize(int is_a_resize, int w, int h) {}
+  virtual char swap_type();
+  virtual void flush_context() {}
+  virtual int flush_begin(char& valid_f) {return 0;}
+  virtual void hide_overlay(void *& overlay) {}
+  static Fl_Gl_Choice *find_begin(int m, const int *alistp);
+  // Return one of these structures for a given gl mode.
+  // The second argument is a glX attribute list, and is used if mode is zero.
+  // This is not supported on Win32:
+  virtual Fl_Gl_Choice *find(int mode, const int *alistp) {return NULL;}
+  virtual GLContext create_gl_context(Fl_Window* window, const Fl_Gl_Choice* g, int layer = 0) {return 0;}
+  virtual void set_gl_context(Fl_Window* w, GLContext context) {}
+  virtual void delete_gl_context(GLContext) {}
+  virtual void make_overlay(void* &o);
+  virtual void hide_overlay() {}
+  virtual void make_overlay_current() {}
+  virtual void redraw_overlay() {}
+  virtual int can_do_overlay() {return 0;}
+  virtual void waitGL() {} // support for gl_finish() function
+  virtual void gl_visual(Fl_Gl_Choice*); // support for Fl::gl_visual() function
+  virtual void gl_start() {} // support for gl_start() function
+  virtual void* GetProcAddress(const char *procName); // support for glutGetProcAddress()
+  virtual void draw_string(const char* str, int n); // support for gl_draw()
+  virtual void get_list(Fl_Font_Descriptor* fd, int r) {} // support for gl_draw() without textures
+  virtual void gl_bitmap_font(Fl_Font_Descriptor *fl_fontsize) {} // support for gl_font() without textures
+  virtual int overlay_color(Fl_Color i) {return 0;} // support for gl_color() with HAVE_GL_OVERLAY
+};
+
+#ifdef FL_CFG_GFX_QUARTZ
+#ifdef __OBJC__
+@class NSOpenGLPixelFormat;
+#else
+class NSOpenGLPixelFormat;
+#endif // __OBJC__
+
+class Fl_Cocoa_Gl_Window_Driver : public Fl_Gl_Window_Driver {
+  friend class Fl_Gl_Window_Driver;
+  Fl_Cocoa_Gl_Window_Driver(Fl_Gl_Window *win) : Fl_Gl_Window_Driver(win) {}
+  virtual float pixels_per_unit();
+  virtual void before_show(int& need_redraw);
+  virtual void after_show(int need_redraw);
+  virtual int mode_(int m, const int *a);
+  virtual void make_current_before();
+  virtual void swap_buffers();
+  virtual void resize(int is_a_resize, int w, int h);
+  virtual char swap_type();
+  virtual void flush_context();
+  virtual Fl_Gl_Choice *find(int m, const int *alistp);
+  virtual GLContext create_gl_context(Fl_Window* window, const Fl_Gl_Choice* g, int layer = 0);
+  virtual void set_gl_context(Fl_Window* w, GLContext context);
+  virtual void delete_gl_context(GLContext);
+  virtual void make_overlay_current();
+  virtual void redraw_overlay();
+  virtual void gl_start();
+  virtual void draw_string(const char* str, int n);
+  static NSOpenGLContext* create_GLcontext_for_window(NSOpenGLPixelFormat *pixelformat, NSOpenGLContext *shared_ctx, Fl_Window *window);
+  static NSOpenGLPixelFormat *mode_to_NSOpenGLPixelFormat(int mode, const int*); // uses Objective-c
+  static void GLcontext_update(NSOpenGLContext*); // uses Objective-c
+  static void GLcontext_release(NSOpenGLContext*); // uses Objective-c
+  static void GLcontext_makecurrent(NSOpenGLContext*); // uses Objective-c
+  static void GL_cleardrawable(void); // uses Objective-c
+};
+#endif // FL_CFG_GFX_QUARTZ
+
+
+#ifdef FL_CFG_GFX_GDI
+
+class Fl_WinAPI_Gl_Window_Driver : public Fl_Gl_Window_Driver {
+  friend class Fl_Gl_Window_Driver;
+  Fl_WinAPI_Gl_Window_Driver(Fl_Gl_Window *win) : Fl_Gl_Window_Driver(win) {}
+  virtual float pixels_per_unit();
+  virtual int mode_(int m, const int *a);
+  virtual void make_current_after();
+  virtual void swap_buffers();
+  virtual void invalidate() {}
+  virtual int flush_begin(char& valid_f);
+  virtual void hide_overlay(void *& overlay);
+  virtual Fl_Gl_Choice *find(int m, const int *alistp);
+  virtual GLContext create_gl_context(Fl_Window* window, const Fl_Gl_Choice* g, int layer = 0);
+  virtual void set_gl_context(Fl_Window* w, GLContext context);
+  virtual void delete_gl_context(GLContext);
+  virtual void make_overlay_current();
+  virtual void redraw_overlay();
+  virtual void* GetProcAddress(const char *procName);
+  virtual void gl_bitmap_font(Fl_Font_Descriptor *fl_fontsize);
+  virtual void get_list(Fl_Font_Descriptor *fd, int r);
+#if HAVE_GL_OVERLAY
+  virtual int can_do_overlay();
+  virtual int overlay_color(Fl_Color i);
+#endif
+};
+
+#endif // FL_CFG_GFX_GDI
+
+
+#ifdef FL_CFG_GFX_XLIB
+#include <X11/Xutil.h>
+class Fl_X11_Gl_Window_Driver : public Fl_Gl_Window_Driver {
+  friend class Fl_Gl_Window_Driver;
+  Fl_X11_Gl_Window_Driver(Fl_Gl_Window *win) : Fl_Gl_Window_Driver(win) {}
+  virtual float pixels_per_unit();
+  virtual void before_show(int& need_redraw);
+  virtual int mode_(int m, const int *a);
+  virtual void swap_buffers();
+  virtual void resize(int is_a_resize, int w, int h);
+  virtual char swap_type();
+  virtual Fl_Gl_Choice *find(int m, const int *alistp);
+  virtual GLContext create_gl_context(Fl_Window* window, const Fl_Gl_Choice* g, int layer = 0);
+  virtual void set_gl_context(Fl_Window* w, GLContext context);
+  virtual void delete_gl_context(GLContext);
+#if HAVE_GL_OVERLAY
+  virtual void make_overlay(void *&o);
+  virtual int can_do_overlay();
+  virtual void hide_overlay();
+  virtual int overlay_color(Fl_Color i);
+#endif
+  virtual void make_overlay_current();
+  virtual void redraw_overlay();
+  virtual void waitGL();
+  virtual void gl_visual(Fl_Gl_Choice*); // support for Fl::gl_visual()
+  virtual void gl_start();
+  virtual void gl_bitmap_font(Fl_Font_Descriptor *fl_fontsize);
+  virtual void get_list(Fl_Font_Descriptor *fd, int r);
+public:
+  static GLContext create_gl_context(XVisualInfo* vis);
+};
+
+#endif // FL_CFG_GFX_XLIB
+
+#endif /* Fl_Gl_Window_Driver_H */
+
+//
+// End of "$Id: Fl_Gl_Window_Driver.H 12617 2017-12-30 10:43:36Z manolo $".
+//

+ 504 - 0
fltk/FL/Fl_Graphics_Driver.H

@@ -0,0 +1,504 @@
+//
+// "$Id: Fl_Graphics_Driver.H 12595 2017-12-18 12:13:33Z manolo $"
+//
+// Definition of classes  Fl_Graphics_Driver, Fl_Surface_Device, Fl_Display_Device
+// for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 2010-2017 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/** \file Fl_Graphics_Driver.H
+ \brief declaration of class Fl_Graphics_Driver.
+*/
+
+#ifndef FL_GRAPHICS_DRIVER_H
+#define FL_GRAPHICS_DRIVER_H
+
+#include <FL/Fl_Device.H>
+#include <FL/Fl_Image.H>
+#include <FL/Fl_Bitmap.H>
+#include <FL/Fl_Pixmap.H>
+#include <FL/Fl_RGB_Image.H>
+#include <stdlib.h>
+
+class Fl_Graphics_Driver;
+class Fl_Shared_Image;
+class Fl_Font_Descriptor;
+/** \brief Points to the driver that currently receives all graphics requests */
+FL_EXPORT extern Fl_Graphics_Driver *fl_graphics_driver;
+
+/**
+ signature of image generation callback function.
+ \param[in]  data  user data passed to function
+ \param[in]  x,y,w position and width of scan line in image
+ \param[out] buf   buffer for generated image data. You must copy \p w
+ pixels from scanline \p y, starting at pixel \p x
+ to this buffer.
+ */
+typedef void (*Fl_Draw_Image_Cb)(void* data,int x,int y,int w,uchar* buf);
+
+struct Fl_Fontdesc;
+
+#define FL_REGION_STACK_SIZE 10
+#define FL_MATRIX_STACK_SIZE 32
+/**
+ An abstract class subclassed for each graphics driver FLTK uses.
+ Typically, FLTK applications do not use directly objects from this class. Rather, they perform
+ drawing operations (e.g., fl_rectf()) that operate on the current drawing surface (see Fl_Surface_Device).
+ Drawing operations are functionally presented in \ref drawing and as function lists
+ in the \ref fl_drawings and \ref fl_attributes modules.
+ 
+ \p <tt>Fl_Surface_Device::surface()->driver()</tt>
+ gives at any time the graphics driver used by all drawing operations. 
+ For compatibility with older FLTK versions, the \ref fl_graphics_driver global variable gives the same result.
+ Its value changes when
+ drawing operations are directed to another drawing surface by Fl_Surface_Device::push_current() /
+ Fl_Surface_Device::pop_current() / Fl_Surface_Device::set_current().
+
+ \p The Fl_Graphics_Driver class is of interest if one wants to perform new kinds of drawing operations.
+ An example would be to draw to a PDF file. This would involve creating a new Fl_Graphics_Driver derived
+ class. This new class should implement all virtual methods of the Fl_Graphics_Driver class
+ to support all FLTK drawing functions.
+ 
+ \p The Fl_Graphics_Driver class is essential for developers of the FLTK library.
+ Each platform supported by FLTK requires to create a derived class of Fl_Graphics_Driver that
+ implements all its virtual member functions according to the platform.
+ */
+class FL_EXPORT Fl_Graphics_Driver {
+  friend class Fl_Surface_Device;
+  friend class Fl_Display_Device;
+  friend class Fl_Screen_Driver;
+  friend class Fl_Window_Driver;
+  friend class Fl_Pixmap;
+  friend class Fl_Bitmap;
+  friend class Fl_RGB_Image;
+  friend class Fl_Shared_Image;
+  friend void fl_draw_image(const uchar* buf, int X,int Y,int W,int H, int D, int L);
+  friend void fl_draw_image_mono(const uchar* buf, int X,int Y,int W,int H, int D, int L);
+  friend void fl_draw_image_mono(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D);
+  friend void fl_draw_image(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D);
+  friend void fl_copy_offscreen(int x, int y, int w, int h, Fl_Offscreen pixmap, int srcx, int srcy);
+  friend FL_EXPORT int fl_draw_pixmap(const char*const* cdata, int x, int y, Fl_Color bg);
+  friend FL_EXPORT void gl_start();
+  friend FL_EXPORT Fl_Bitmask fl_create_bitmask(int w, int h, const uchar *array);
+  friend FL_EXPORT void fl_delete_bitmask(Fl_Bitmask);
+private:
+  // some platforms may need to reimplement this
+  virtual void set_current_();
+protected:
+  float scale_; // scale between user and graphical coordinates: graphical = user * scale_
+  /** Sets the current value of the scaling factor */
+  virtual void scale(float f) { scale_ = f; }
+public:
+  // The following functions create the various graphics drivers that are required
+  // for core operations. They must be implemented as members of Fl_Graphics_Driver,
+  // but located in the device driver module that is linked to the core library
+  /** Instantiate the graphics driver adequate to draw to the platform's display driver.
+   Each platform implements this method its own way.
+   */
+  static Fl_Graphics_Driver *newMainGraphicsDriver();
+  /** A 2D coordinate transformation matrix */
+  struct matrix {double a, b, c, d, x, y;};
+  /** Features that a derived class may possess.  */
+  typedef enum {
+    NATIVE = 1, /**< native graphics driver for the platform */
+    PRINTER = 2 /**< graphics driver for a printer drawing surface */
+  } driver_feature;
+
+protected:
+  int fl_clip_state_number; ///< For internal use by FLTK
+  static const matrix m0; ///< For internal use by FLTK
+  Fl_Font font_; ///< current font
+  Fl_Fontsize size_; ///< current font size
+  Fl_Color color_; ///< current color
+  int sptr;///< For internal use by FLTK
+  static const int matrix_stack_size = FL_MATRIX_STACK_SIZE; ///< For internal use by FLTK
+  matrix stack[FL_MATRIX_STACK_SIZE]; ///< For internal use by FLTK
+  matrix m; ///< current transformation matrix
+  int n; ///< For internal use by FLTK
+  int gap_; ///< For internal use by FLTK
+  int what; ///< For internal use by FLTK
+  int rstackptr; ///< For internal use by FLTK
+  static const int region_stack_max = FL_REGION_STACK_SIZE - 1; ///< For internal use by FLTK
+  Fl_Region rstack[FL_REGION_STACK_SIZE]; ///< For internal use by FLTK
+  Fl_Font_Descriptor *font_descriptor_; ///< For internal use by FLTK
+#ifndef FL_DOXYGEN
+  enum {LINE, LOOP, POLYGON, POINT_};
+  inline int vertex_no() { return n; }
+  inline int vertex_kind() {return what;}
+#endif
+  matrix *fl_matrix; /**< Points to the current coordinate transformation matrix */
+  virtual void global_gc();
+  /** Support function for Fl_Pixmap drawing */
+  virtual fl_uintptr_t cache(Fl_Pixmap *img, int w, int h, const char *const*array) { return 0; }
+  /** Support function for Fl_Bitmap drawing */
+  virtual fl_uintptr_t cache(Fl_Bitmap *img, int w, int h, const uchar *array) { return 0; }
+  /** Support function for Fl_RGB_Image drawing */
+  virtual void uncache(Fl_RGB_Image *img, fl_uintptr_t &id_, fl_uintptr_t &mask_) { }
+  // --- implementation is in src/drivers/xxx/Fl_xxx_Graphics_Driver_image.cxx
+  /** see fl_draw_image(const uchar* buf, int X,int Y,int W,int H, int D, int L) */
+  virtual void draw_image(const uchar* buf, int X,int Y,int W,int H, int D=3, int L=0) {}
+  /** see fl_draw_image_mono(const uchar* buf, int X,int Y,int W,int H, int D, int L) */
+  virtual void draw_image_mono(const uchar* buf, int X,int Y,int W,int H, int D=1, int L=0) {}
+  /** see fl_draw_image(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D) */
+  virtual void draw_image(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=3) {}
+  /** see fl_draw_image_mono(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D) */
+  virtual void draw_image_mono(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=1) {}
+  /** \brief Draws an Fl_RGB_Image object using this graphics driver.
+   *
+   Specifies a bounding box for the image, with the origin (upper left-hand corner) of
+   the image offset by the cx and cy arguments.
+   */
+  virtual void draw(Fl_RGB_Image * rgb,int XP, int YP, int WP, int HP, int cx, int cy) {}
+  /** \brief Draws an Fl_Pixmap object using this graphics driver.
+   *
+   Specifies a bounding box for the image, with the origin (upper left-hand corner) of
+   the image offset by the cx and cy arguments.
+   */
+  virtual void draw(Fl_Pixmap * pxm,int XP, int YP, int WP, int HP, int cx, int cy) {}
+  /** \brief Draws an Fl_Bitmap object using this graphics driver.
+   *
+   Specifies a bounding box for the image, with the origin (upper left-hand corner) of
+   the image offset by the cx and cy arguments.
+   */
+  virtual void draw(Fl_Bitmap *bm, int XP, int YP, int WP, int HP, int cx, int cy) {}
+  virtual void draw(Fl_Shared_Image *shared, int X, int Y);
+  virtual void copy_offscreen(int x, int y, int w, int h, Fl_Offscreen pixmap, int srcx, int srcy);
+
+  /** Support function for image drawing */
+  virtual Fl_Bitmask create_bitmask(int w, int h, const uchar *array) {return 0; }
+  /** Support function for image drawing */
+  virtual void delete_bitmask(Fl_Bitmask bm) {}
+  /** For internal library use only */
+  static void change_image_size(Fl_Image *img, int W, int H) {
+    img->w(W);
+    img->h(H);
+  }
+  // Support function for image drawing
+  virtual void uncache_pixmap(fl_uintptr_t p);
+  // accessor functions to protected image members
+  int start_image(Fl_Image *img, int XP, int YP, int WP, int HP, int &cx, int &cy,
+                int &X, int &Y, int &W, int &H);
+  /** Accessor to a private member variable of Fl_RGB_Image */
+  static fl_uintptr_t* id(Fl_RGB_Image *rgb) {return &(rgb->id_);}
+  /** Accessor to a private member variable of Fl_Pixmap */
+  static fl_uintptr_t* id(Fl_Pixmap *pm) {return &(pm->id_);}
+  /** Accessor to a private member variable of Fl_Bitmap */
+  static fl_uintptr_t* id(Fl_Bitmap *bm) {return &(bm->id_);}
+  /** Accessor to a private member variable of Fl_RGB_Image */
+  static fl_uintptr_t* mask(Fl_RGB_Image *rgb) {return &(rgb->mask_);}
+  /** Accessor to a private member variable of Fl_Pixmap */
+  static fl_uintptr_t* mask(Fl_Pixmap *pm) {return &(pm->mask_);}
+  /** Accessor to a private member variable of Fl_Pixmap */
+  static float* cache_scale(Fl_Pixmap *pm) {return &(pm->cache_scale_);}
+  /** Accessor to a private member variable of Fl_Bitmap */
+  static float* cache_scale(Fl_Bitmap *bm) {return &(bm->cache_scale_);}
+  /** Accessor to a private member variable of Fl_RGB_Image */
+  static float* cache_scale(Fl_RGB_Image *rgb) {return &(rgb->cache_scale_);}
+  /** Accessor to a private member variable of Fl_Pixmap */
+  static Fl_Color* pixmap_bg_color(Fl_Pixmap *pm) {return &(pm->pixmap_bg_color);}
+  /** For internal library use only */
+  static void draw_empty(Fl_Image* img, int X, int Y) {img->draw_empty(X, Y);}
+  /** Accessor to a private member function of Fl_Bitmap */
+  static int prepare(Fl_Bitmap *bm, int XP, int YP, int WP, int HP, int &cx, int &cy,
+                   int &X, int &Y, int &W, int &H) {
+    return bm->prepare(XP,YP,WP,HP,cx,cy,X,Y,W,H);
+  }
+  /** Accessor to a private member function of Fl_Pixmap */
+  static int prepare(Fl_Pixmap *pm, int XP, int YP, int WP, int HP, int &cx, int &cy,
+                     int &X, int &Y, int &W, int &H) {
+    return pm->prepare(XP,YP,WP,HP,cx,cy,X,Y,W,H);
+  }
+
+public:
+  Fl_Graphics_Driver();
+  virtual ~Fl_Graphics_Driver() {} ///< Destructor
+  static Fl_Graphics_Driver &default_driver();
+  /** Current scale factor between FLTK and graphical coordinates: graphical = FLTK * scale() */
+  float scale() { return scale_; }
+  /** Return whether the graphics driver can do alpha blending */
+  virtual char can_do_alpha_blending() { return 0; }
+  // --- implementation is in src/fl_rect.cxx which includes src/drivers/xxx/Fl_xxx_Graphics_Driver_rect.cxx
+  /** see fl_point() */
+  virtual void point(int x, int y) {}
+  /** see fl_rect() */
+  virtual void rect(int x, int y, int w, int h) {}
+  virtual void focus_rect(int x, int y, int w, int h);
+  /** see fl_rectf() */
+  virtual void rectf(int x, int y, int w, int h) {}
+  /** see fl_line(int, int, int, int) */
+  virtual void line(int x, int y, int x1, int y1) {}
+  /** see fl_line(int, int, int, int, int, int) */
+  virtual void line(int x, int y, int x1, int y1, int x2, int y2) {}
+  /** see fl_xyline(int, int, int) */
+  virtual void xyline(int x, int y, int x1) {}
+  /** see fl_xyline(int, int, int, int) */
+  virtual void xyline(int x, int y, int x1, int y2) {}
+  /** see fl_xyline(int, int, int, int, int) */
+  virtual void xyline(int x, int y, int x1, int y2, int x3) {}
+  /** see fl_yxline(int, int, int) */
+  virtual void yxline(int x, int y, int y1) {}
+  /** see fl_yxline(int, int, int, int) */
+  virtual void yxline(int x, int y, int y1, int x2) {}
+  /** see fl_yxline(int, int, int, int, int) */
+  virtual void yxline(int x, int y, int y1, int x2, int y3) {}
+  /** see fl_loop(int, int, int, int, int, int) */
+  virtual void loop(int x0, int y0, int x1, int y1, int x2, int y2) {}
+  /** see fl_loop(int, int, int, int, int, int, int, int) */
+  virtual void loop(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3) {}
+  /** see fl_polygon(int, int, int, int, int, int) */
+  virtual void polygon(int x0, int y0, int x1, int y1, int x2, int y2) {}
+  /** see fl_polygon(int, int, int, int, int, int, int, int) */
+  virtual void polygon(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3) {}
+  // --- clipping
+  /** see fl_push_clip() */
+  virtual void push_clip(int x, int y, int w, int h) {}
+  /** see fl_clip_box() */
+  virtual int clip_box(int x, int y, int w, int h, int &X, int &Y, int &W, int &H) {return 0;}
+  /** see fl_not_clipped() */
+  virtual int not_clipped(int x, int y, int w, int h) {return 1;}
+  /** see fl_push_no_clip() */
+  virtual void push_no_clip() {}
+  /** see fl_pop_clip() */
+  virtual void pop_clip() {}
+  virtual Fl_Region clip_region();              // has default implementation
+  virtual void clip_region(Fl_Region r);        // has default implementation
+  virtual void restore_clip();
+  // --- implementation is in src/fl_vertex.cxx which includes src/drivers/xxx/Fl_xxx_Graphics_Driver_vertex.cxx
+  virtual void push_matrix();
+  virtual void pop_matrix();
+  virtual void mult_matrix(double a, double b, double c, double d, double x, double y);
+  virtual void rotate(double d);
+  virtual void translate(double x,double y);
+  virtual void begin_points();
+  virtual void begin_line();
+  virtual void begin_loop();
+  virtual void begin_polygon();
+  /** see fl_begin_complex_polygon() */
+  virtual void begin_complex_polygon() {}
+  virtual double transform_x(double x, double y);
+  virtual double transform_y(double x, double y);
+  virtual double transform_dx(double x, double y);
+  virtual double transform_dy(double x, double y);
+  /** see fl_transformed_vertex() */
+  virtual void transformed_vertex(double xf, double yf) {}
+  /** see fl_vertex() */
+  virtual void vertex(double x, double y) {}
+  /** see fl_end_points() */
+  virtual void end_points() {}
+  /** see fl_end_line() */
+  virtual void end_line() {}
+  /** see fl_end_loop() */
+  virtual void end_loop() {}
+  /** see fl_end_polygon() */
+  virtual void end_polygon() {}
+  /** see fl_end_complex_polygon() */
+  virtual void end_complex_polygon() {}
+  /** see fl_gap() */
+  virtual void gap() {}
+  /** see fl_circle() */
+  virtual void circle(double x, double y, double r) {}
+  // --- implementation is in src/fl_arc.cxx which includes src/drivers/xxx/Fl_xxx_Graphics_Driver_arc.cxx if needed
+  virtual void arc(double x, double y, double r, double start, double end);
+  // --- implementation is in src/fl_arci.cxx which includes src/drivers/xxx/Fl_xxx_Graphics_Driver_arci.cxx
+  /** see fl_arc(int x, int y, int w, int h, double a1, double a2) */
+  virtual void arc(int x, int y, int w, int h, double a1, double a2) {}
+  /** see fl_pie() */
+  virtual void pie(int x, int y, int w, int h, double a1, double a2) {}
+  // --- implementation is in src/fl_curve.cxx which includes src/drivers/xxx/Fl_xxx_Graphics_Driver_curve.cxx if needed
+  virtual void curve(double X0, double Y0, double X1, double Y1, double X2, double Y2, double X3, double Y3);
+  // --- implementation is in src/fl_line_style.cxx which includes src/cfg_gfx/xxx_line_style.cxx
+  /** see fl_line_style() */
+  virtual void line_style(int style, int width=0, char* dashes=0) {}
+  // --- implementation is in src/fl_color.cxx which includes src/cfg_gfx/xxx_color.cxx
+  /** see fl_color(Fl_Color) */
+  virtual void color(Fl_Color c) { color_ = c; }
+  virtual void set_color(Fl_Color i, unsigned int c);
+  virtual void free_color(Fl_Color i, int overlay);
+  /** see fl_color(void) */
+  virtual Fl_Color color() { return color_; }
+  /** see fl_color(uchar, uchar, uchar) */
+  virtual void color(uchar r, uchar g, uchar b) {}
+  /** see fl_draw(const char *str, int n, int x, int y) */
+  virtual void draw(const char *str, int n, int x, int y) {}
+  /** Draw the first \p n bytes of the string \p str starting at position \p x , \p y */
+  virtual void draw(const char *str, int n, float x, float y) { draw(str, n, (int)(x+0.5), (int)(y+0.5));}
+  /** see fl_draw(int angle, const char *str, int n, int x, int y) */
+  virtual void draw(int angle, const char *str, int n, int x, int y) { draw(str, n, x, y); }
+  /** see fl_rtl_draw(const char *str, int n, int x, int y) */
+  virtual void rtl_draw(const char *str, int n, int x, int y) { draw(str, n, x, y); }
+  /** Returns non-zero if the graphics driver possesses the \p feature */
+  virtual int has_feature(driver_feature feature) { return 0; }
+  /** see fl_font(Fl_Font, Fl_Fontsize) */
+  virtual void font(Fl_Font face, Fl_Fontsize fsize) {font_ = face; size_ = fsize;}
+  /** see fl_font(void) */
+  virtual Fl_Font font() {return font_; }
+  /** Return the current font size */
+  virtual Fl_Fontsize size() {return size_; }
+  /** Compute the width of the first \p n bytes of the string \p str if drawn with current font */
+  virtual double width(const char *str, int n) { return 0; }
+  /** Compute the width of Unicode character \p c if drawn with current font */
+  virtual double width(unsigned int c) { char ch = (char)c; return width(&ch, 1); }
+  virtual void text_extents(const char*, int n, int& dx, int& dy, int& w, int& h);
+  /** Return the current line height */
+  virtual int height() { return size(); }
+  /** Return the current line descent */
+  virtual int descent() { return 0; }
+  /** Return the current Fl_Font_Descriptor */
+  inline Fl_Font_Descriptor *font_descriptor() { return font_descriptor_;}
+  /** Set the current Fl_Font_Descriptor */
+  virtual void font_descriptor(Fl_Font_Descriptor *d) { font_descriptor_ = d;}
+  /** Sets the value of the driver-specific graphics context. */
+  virtual void gc(void*) {}
+  /** Returns the driver-specific graphics context, of NULL if there's none. */
+  virtual void *gc(void) {return NULL;}
+  /** Support for pixmap drawing */
+  virtual uchar **mask_bitmap() { return 0; }
+  /** Support for pixmap drawing */
+  virtual void mask_bitmap(uchar **) {}
+  // default implementation may be enough
+  /** Support for PostScript drawing */
+  virtual float scale_font_for_PostScript(Fl_Font_Descriptor *desc, int s) { return float(s); }
+  // default implementation may be enough
+  /** Support for PostScript drawing */
+  virtual float scale_bitmap_for_PostScript() { return 2; }
+  virtual void set_spot(int font, int size, int X, int Y, int W, int H, Fl_Window *win);
+  virtual void reset_spot();
+  // each platform implements these 3 functions its own way
+  virtual void add_rectangle_to_region(Fl_Region r, int x, int y, int w, int h);
+  virtual Fl_Region XRectangleRegion(int x, int y, int w, int h);
+  virtual void XDestroyRegion(Fl_Region r);
+  /** Support for Fl::get_font_name() */
+  virtual const char* get_font_name(Fl_Font fnum, int* ap) {return NULL;}
+  /** Support for Fl::get_font_sizes() */
+  virtual int get_font_sizes(Fl_Font fnum, int*& sizep) {return 0;}
+  /** Support for Fl::set_fonts() */
+  virtual Fl_Font set_fonts(const char *name) {return 0;}
+  /** Some platforms may need to implement this to support fonts */
+  virtual Fl_Fontdesc* calc_fl_fonts(void) {return NULL;}
+  /** Support for Fl::set_font() */
+  virtual unsigned font_desc_size() {return 0;}
+  /** Support for Fl::get_font() */
+  virtual const char *font_name(int num) {return NULL;}
+  /** Support for Fl::set_font() */
+  virtual void font_name(int num, const char *name) {}
+  /** Support function for Fl_Shared_Image drawing */
+  virtual int draw_scaled(Fl_Image *img, int X, int Y, int W, int H);
+};
+
+#ifndef FL_DOXYGEN
+/* Abstract class Fl_Scalable_Graphics_Driver is platform-independent.
+ It supports the scaling of all graphics coordinates by a
+ float factor helpful to support HiDPI displays.
+ This class does :
+ - compute scaled coordinates
+ - scale the cached offscreen of image objects
+ - scale the pixel arrays used when performing direct image draws
+ - call the member functions of a platform-specific,
+ Fl_Scalable_Graphics_Driver-derived class that do the drawings with adequately 
+ scaled coordinates. The member functions are named with the _unscaled suffix.
+ - scale and unscale the clipping region.
+ 
+ This class is presently used on the X11 platform to support HiDPI displays.
+ In the future, it may also be used on the WIN32 platform.
+ */
+class FL_EXPORT Fl_Scalable_Graphics_Driver : public Fl_Graphics_Driver {
+public:
+  Fl_Scalable_Graphics_Driver();
+protected:
+  int line_width_;
+  void cache_size(Fl_Image *img, int &width, int &height);
+  virtual Fl_Region scale_clip(float f)=0;
+  void unscale_clip(Fl_Region r);
+  virtual void draw(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy);
+  virtual void draw_unscaled(Fl_Pixmap *pxm, float s, int XP, int YP, int WP, int HP, int cx, int cy)=0;
+  virtual void draw(Fl_Bitmap *bm, int XP, int YP, int WP, int HP, int cx, int cy);
+  virtual void draw_unscaled(Fl_Bitmap *bm, float s, int XP, int YP, int WP, int HP, int cx, int cy)=0;
+  virtual void draw(Fl_RGB_Image *img, int XP, int YP, int WP, int HP, int cx, int cy);
+  virtual void draw_unscaled(Fl_RGB_Image *img, float s, int XP, int YP, int WP, int HP, int cx, int cy)=0;
+  virtual void draw(Fl_Shared_Image *shared, int X, int Y);
+  virtual void point(int x, int y);
+  virtual void point_unscaled(float x, float y) = 0;
+  virtual void rect(int x, int y, int w, int h);
+  virtual void rect_unscaled(float x, float y, float w, float h) = 0;
+  virtual void rectf(int x, int y, int w, int h);
+  virtual void rectf_unscaled(float x, float y, float w, float h) = 0;
+  virtual void line(int x, int y, int x1, int y1);
+  virtual void line_unscaled(float x, float y, float x1, float y1) = 0;
+  virtual void line(int x, int y, int x1, int y1, int x2, int y2);
+  virtual void line_unscaled(float x, float y, float x1, float y1, float x2, float y2) = 0;
+  virtual void xyline(int x, int y, int x1);
+  virtual void xyline(int x, int y, int x1, int y2);
+  virtual void xyline(int x, int y, int x1, int y2, int x3);
+  virtual void xyline_unscaled(float x, float y, float x1)=0;
+  virtual void yxline(int x, int y, int y1);
+  virtual void yxline(int x, int y, int y1, int x2);
+  virtual void yxline(int x, int y, int y1, int x2, int y3);
+  virtual void yxline_unscaled(float x, float y, float y1)=0;
+  virtual void loop(int x0, int y0, int x1, int y1, int x2, int y2);
+  virtual void loop_unscaled(float x0, float y0, float x1, float y1, float x2, float y2)=0;
+  virtual void loop(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3);
+  virtual void loop_unscaled(float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3)=0;
+  virtual void polygon(int x0, int y0, int x1, int y1, int x2, int y2);
+  virtual void polygon_unscaled(float x0, float y0, float x1, float y1, float x2, float y2)=0;
+  virtual void polygon(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3);
+  virtual void polygon_unscaled(float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3)=0;
+  virtual void circle(double x, double y, double r);
+  virtual void ellipse_unscaled(double xt, double yt, double rx, double ry)=0;
+  virtual void font(Fl_Font face, Fl_Fontsize size);
+  virtual void font_unscaled(Fl_Font face, Fl_Fontsize size)=0;
+  virtual double width(const char *str, int n);
+  virtual double width(unsigned int c);
+  virtual double width_unscaled(const char *str, int n)=0;
+  virtual double width_unscaled(unsigned int c)=0;
+  virtual Fl_Fontsize size();
+  virtual Fl_Fontsize size_unscaled()=0;
+  virtual void text_extents(const char *str, int n, int &dx, int &dy, int &w, int &h);
+  virtual void text_extents_unscaled(const char *str, int n, int &dx, int &dy, int &w, int &h)=0;
+  virtual int height();
+  virtual int descent();
+  virtual int height_unscaled()=0;
+  virtual int descent_unscaled()=0;
+  virtual void draw(const char *str, int n, int x, int y);
+  virtual void draw_unscaled(const char *str, int n, int x, int y)=0;
+  virtual void draw(int angle, const char *str, int n, int x, int y);
+  virtual void draw_unscaled(int angle, const char *str, int n, int x, int y)=0;
+  virtual void rtl_draw(const char* str, int n, int x, int y);
+  virtual void rtl_draw_unscaled(const char* str, int n, int x, int y)=0;
+  virtual void arc(int x, int y, int w, int h, double a1, double a2);
+  virtual void arc_unscaled(float x, float y, float w, float h, double a1, double a2)=0;
+  virtual void pie(int x, int y, int w, int h, double a1, double a2);
+  virtual void pie_unscaled(float x, float y, float w, float h, double a1, double a2)=0;
+  virtual void line_style(int style, int width=0, char* dashes=0);
+  virtual void line_style_unscaled(int style, float width, char* dashes)=0;
+  void draw_image_rescale(void *buf, Fl_Draw_Image_Cb cb, int X, int Y, int W, int H, int D, int L, bool mono, float s);
+  virtual void draw_image_unscaled(const uchar* buf, int X,int Y,int W,int H, int D=3, int L=0)=0;
+  virtual void draw_image_unscaled(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=3)=0;
+  void draw_image(const uchar* buf, int X,int Y,int W,int H, int D=3, int L=0);
+  void draw_image(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=3);
+  virtual void draw_image_mono_unscaled(const uchar* buf, int x, int y, int w, int h, int d, int l)=0;
+  void draw_image_mono(const uchar* buf, int X,int Y,int W,int H, int D=1, int L=0);
+  virtual void draw_image_mono_unscaled(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=1)=0;
+  void draw_image_mono(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=1);
+
+  void transformed_vertex(double xf, double yf);
+  virtual void transformed_vertex0(float x, float y)=0;
+  void vertex(double x, double y);
+};
+#endif // FL_DOXYGEN
+
+#endif // FL_GRAPHICS_DRIVER_H
+
+//
+// End of "$Id: Fl_Graphics_Driver.H 12595 2017-12-18 12:13:33Z manolo $".
+//

+ 257 - 255
fltk/FL/Fl_Group.H

@@ -1,255 +1,257 @@
-//
-// "$Id: Fl_Group.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
-//
-// Group header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_Group, Fl_End classes . */
-
-#ifndef Fl_Group_H
-#define Fl_Group_H
-
-#ifndef Fl_Widget_H
-#include <FL/Fl_Widget.H>
-#endif
-
-typedef int (*Fl_User_Event_Handler)(Fl_Widget *w, int event);
-
-struct st_widget_sizes {
-    int x,y,w,h;
-    Fl_Fontsize labelsize, textsize;
-};
-
-/**
-  The Fl_Group class is the FLTK container widget. It maintains
-  an array of child widgets. These children can themselves be any widget
-  including Fl_Group. The most important subclass of Fl_Group
-  is Fl_Window, however groups can also be used to control radio buttons
-  or to enforce resize behavior.
-*/
-class FL_EXPORT Fl_Group : public Fl_Widget {
-
-  Fl_Widget** array_;
-  Fl_Widget* savedfocus_;
-  Fl_Widget* resizable_;
-  int children_;
-  st_widget_sizes *sizes_; // remembered initial sizes of children
-
-  int navigation(int);
-  static Fl_Group *current_;
-  Fl_User_Event_Handler user_handler_;
-
-  // unimplemented copy ctor and assignment operator
-  Fl_Group(const Fl_Group&);
-  Fl_Group& operator=(const Fl_Group&);
-
-protected:
-  void draw();
-  void draw_child(Fl_Widget& widget) const;
-  void draw_children();
-  void draw_outside_label(const Fl_Widget& widget) const ;
-  void update_child(Fl_Widget& widget) const;
-  st_widget_sizes  *sizes();
-
-public:
-
-  int handle(int);
-
-  void user_handler(Fl_User_Event_Handler uh) {user_handler_ = uh;};
-  Fl_User_Event_Handler user_handler() {return user_handler_;};
-
-  void begin();
-  void end();
-  static Fl_Group *current();
-  static void current(Fl_Group *g);
-
-  /**
-    Returns how many child widgets the group has.
-  */
-  int children() const {return children_;}
-  /**
-    Returns array()[n].  <i>No range checking is done!</i>
-  */
-  Fl_Widget* child(int n) const {return array()[n];}
-  int find(const Fl_Widget*) const;
-  /**
-    See int Fl_Group::find(const Fl_Widget *w) const
-  */
-  int find(const Fl_Widget& o) const {return find(&o);}
-  Fl_Widget* const* array() const;
-
-  void resize(int,int,int,int);
-  /**
-    Creates a new Fl_Group widget using the given position, size,
-    and label string. The default boxtype is FL_NO_BOX.
-  */
-  Fl_Group(int,int,int,int, const char * = 0);
-  virtual ~Fl_Group();
-  void add(Fl_Widget&);
-  /**
-    See void Fl_Group::add(Fl_Widget &w)
-  */
-  void add(Fl_Widget* o) {add(*o);}
-  void insert(Fl_Widget&, int i);
-  /**
-    This does insert(w, find(before)).  This will append the
-    widget if \p before is not in the group.
-  */
-  void insert(Fl_Widget& o, Fl_Widget* before) {insert(o,find(before));}
-  void remove(int index);
-  void remove(Fl_Widget&);
-  /**
-    Removes the widget \p o from the group.
-    \sa void remove(Fl_Widget&)
-  */
-  void remove(Fl_Widget* o) {remove(*o);}
-  virtual void clear(); //make it virtual so derived classes will work properly when casted to Fl_Group
-
-  /**
-    See void Fl_Group::resizable(Fl_Widget *box)
-  */
-  void resizable(Fl_Widget& o) {resizable_ = &o;}
-  /**
-    The resizable widget defines the resizing box for the group. When the
-    group is resized it calculates a new size and position for all of its
-    children. Widgets that are horizontally or vertically inside the
-    dimensions of the box are scaled to the new size. Widgets outside the
-    box are moved.
-
-    In these examples the gray area is the resizable:
-
-    \image html resizebox1.png
-    
-    \image html resizebox2.png
-    
-    \image latex resizebox1.png "before resize"  width=4cm
-    
-    \image latex resizebox2.png "after resize"   width=4cm
-
-    The resizable may be set to the group itself, in which case all the
-    contents are resized. This is the default value for Fl_Group,
-    although NULL is the default for Fl_Window and Fl_Pack.
-
-    If the resizable is NULL then all widgets remain a fixed size
-    and distance from the top-left corner.
-
-    It is possible to achieve any type of resize behavior by using an
-    invisible Fl_Box as the resizable and/or by using a hierarchy
-    of child Fl_Group's.
-  */
-  void resizable(Fl_Widget* o) {resizable_ = o;}
-  /**
-    See void Fl_Group::resizable(Fl_Widget *box) 
-  */
-  Fl_Widget* resizable() const {return resizable_;}
-  /**
-    Adds a widget to the group and makes it the resizable widget.
-  */
-  void add_resizable(Fl_Widget& o) {resizable_ = &o; add(o);}
-  void init_sizes();
-
-  /**
-    Controls whether the group widget clips the drawing of
-    child widgets to its bounding box.
-    
-    Set \p c to 1 if you want to clip the child widgets to the
-    bounding box.
-
-    The default is to not clip (0) the drawing of child widgets.
-  */
-  void clip_children(int c) { if (c) set_flag(CLIP_CHILDREN); else clear_flag(CLIP_CHILDREN); }
-  /**
-    Returns the current clipping mode.
-
-    \return true, if clipping is enabled, false otherwise.
-
-    \see void Fl_Group::clip_children(int c)
-  */
-  unsigned int clip_children() { return (flags() & CLIP_CHILDREN) != 0; }
-
-  // Note: Doxygen docs in Fl_Widget.H to avoid redundancy.
-  virtual Fl_Group* as_group() { return this; }
-
-  // back compatibility functions:
-
-  /**
-    \deprecated This is for backwards compatibility only. You should use
-    \e W->%take_focus() instead.
-    \sa Fl_Widget::take_focus();
-  */
-  void focus(Fl_Widget* W) {W->take_focus();}
-
-  /** This is for forms compatibility only */
-  Fl_Widget* & _ddfdesign_kludge() {return resizable_;}
-
-  /** This is for forms compatibility only */
-  void forms_end();
-
-  /** Resize the label and font size of its children */
-  void resizefont(float font_scale);
-
-  protected:
-
-  /*!
-    Inner implementation of layout(). The child widgets are resized
-    and positioned so that the area that was initially surrounded by this
-    widget now fits inside the rectangle.
-
-    \a r is a rectangle, in the coordinate system of this Fl_Group (ie 0,0
-    is the top-left corner of the Fl_Group).
-
-    \a layout_damage controls what is done. If FL_LAYOUT_W or FL_LAYOUT_H are
-    off then no resizing or moving of widgets in that direction is done.
-
-    This is used by Fl_Scroll to resize the widgets to fit inside the
-    scrollbars.
-  */
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_Group, Fl_Widget)
-};
-
-// dummy class used to end child groups in constructors for complex
-// subclasses of Fl_Group:
-/**
-  This is a dummy class that allows you to end a Fl_Group in a constructor list of a
-  class:
-  \code 
-   class MyClass {
-   Fl_Group group;
-   Fl_Button button_in_group;
-   Fl_End end;
-   Fl_Button button_outside_group;
-   MyClass();
-  };
-  MyClass::MyClass() :
-   group(10,10,100,100),
-   button_in_group(20,20,60,30),
-   end(),
-   button_outside_group(10,120,60,30)
-  {} 
-  \endcode
-*/
-class FL_EXPORT Fl_End {
-public:
-  /** All it does is calling Fl_Group::current()->end() */
-  Fl_End() {Fl_Group::current()->end();}
-};
-
-#endif
-
-//
-// End of "$Id: Fl_Group.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
-//
+//
+// "$Id: Fl_Group.H 12302 2017-07-07 19:16:40Z AlbrechtS $"
+//
+// Group header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2017 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_Group, Fl_End classes . */
+
+#ifndef Fl_Group_H
+#define Fl_Group_H
+
+#include "Fl_Widget.H"
+//#include "Fl_Rect.H"
+
+typedef int (*Fl_User_Event_Handler)(Fl_Widget *w, int event);
+
+struct st_widget_sizes {
+    int x,y,w,h;
+    Fl_Fontsize labelsize, textsize;
+};
+/**
+  The Fl_Group class is the FLTK container widget. It maintains
+  an array of child widgets. These children can themselves be any widget
+  including Fl_Group. The most important subclass of Fl_Group
+  is Fl_Window, however groups can also be used to control radio buttons
+  or to enforce resize behavior.
+
+  The tab and arrow keys are used to move the focus between widgets of
+  this group, and to other groups. The only modifier grabbed is shift
+  (for shift-tab), so that ctrl-tab, alt-up, and such are free
+  for the app to use as shortcuts.
+*/
+class FL_EXPORT Fl_Group : public Fl_Widget {
+
+  Fl_Widget** array_;
+  Fl_Widget* savedfocus_;
+  Fl_Widget* resizable_;
+  int children_;
+  st_widget_sizes *sizes_; // remembered initial sizes of children
+
+  int navigation(int);
+  static Fl_Group *current_;
+  Fl_User_Event_Handler user_handler_;
+  // unimplemented copy ctor and assignment operator
+  Fl_Group(const Fl_Group&);
+  Fl_Group& operator=(const Fl_Group&);
+
+public:
+  void draw();
+protected:
+  void draw_child(Fl_Widget& widget) const;
+  void draw_children();
+  void draw_outside_label(const Fl_Widget& widget) const ;
+  void update_child(Fl_Widget& widget) const;
+  st_widget_sizes  *sizes();
+
+public:
+
+  int handle(int);
+  void user_handler(Fl_User_Event_Handler uh) {user_handler_ = uh;};
+  Fl_User_Event_Handler user_handler() {return user_handler_;};
+  void begin();
+  void end();
+  static Fl_Group *current();
+  static void current(Fl_Group *g);
+
+  /**
+    Returns how many child widgets the group has.
+  */
+  int children() const {return children_;}
+  /**
+    Returns array()[n].  <i>No range checking is done!</i>
+  */
+  Fl_Widget* child(int n) const {return array()[n];}
+  int find(const Fl_Widget*) const;
+  /**
+    See int Fl_Group::find(const Fl_Widget *w) const
+  */
+  int find(const Fl_Widget& o) const {return find(&o);}
+  Fl_Widget* const* array() const;
+
+  void resize(int,int,int,int);
+  /**
+    Creates a new Fl_Group widget using the given position, size,
+    and label string. The default boxtype is FL_NO_BOX.
+  */
+  Fl_Group(int,int,int,int, const char * = 0);
+  virtual ~Fl_Group();
+  void add(Fl_Widget&);
+  /**
+    See void Fl_Group::add(Fl_Widget &w)
+  */
+  void add(Fl_Widget* o) {add(*o);}
+  void insert(Fl_Widget&, int i);
+  /**
+    This does insert(w, find(before)).  This will append the
+    widget if \p before is not in the group.
+  */
+  void insert(Fl_Widget& o, Fl_Widget* before) {insert(o,find(before));}
+  void remove(int index);
+  void remove(Fl_Widget&);
+  /**
+    Removes the widget \p o from the group.
+    \sa void remove(Fl_Widget&)
+  */
+  void remove(Fl_Widget* o) {remove(*o);}
+  virtual void clear(); //make it virtual so derived classes will work properly when casted to Fl_Group
+
+  /**
+    See void Fl_Group::resizable(Fl_Widget *box)
+  */
+  void resizable(Fl_Widget& o) {resizable_ = &o;}
+  /**
+    The resizable widget defines the resizing box for the group. When the
+    group is resized it calculates a new size and position for all of its
+    children. Widgets that are horizontally or vertically inside the
+    dimensions of the box are scaled to the new size. Widgets outside the
+    box are moved.
+
+    In these examples the gray area is the resizable:
+
+    \image html resizebox1.png
+
+    <br>
+
+    \image html resizebox2.png
+
+    \image latex resizebox1.png "before resize"  width=4cm
+
+    \image latex resizebox2.png "after resize"   width=4.85cm
+
+    The resizable may be set to the group itself, in which case all the
+    contents are resized. This is the default value for Fl_Group,
+    although NULL is the default for Fl_Window and Fl_Pack.
+
+    If the resizable is NULL then all widgets remain a fixed size
+    and distance from the top-left corner.
+
+    It is possible to achieve any type of resize behavior by using an
+    invisible Fl_Box as the resizable and/or by using a hierarchy
+    of child Fl_Group's.
+  */
+  void resizable(Fl_Widget* o) {resizable_ = o;}
+  /**
+    See void Fl_Group::resizable(Fl_Widget *box)
+  */
+  Fl_Widget* resizable() const {return resizable_;}
+  /**
+    Adds a widget to the group and makes it the resizable widget.
+  */
+  void add_resizable(Fl_Widget& o) {resizable_ = &o; add(o);}
+  void init_sizes();
+
+  /**
+    Controls whether the group widget clips the drawing of
+    child widgets to its bounding box.
+
+    Set \p c to 1 if you want to clip the child widgets to the
+    bounding box.
+
+    The default is to not clip (0) the drawing of child widgets.
+  */
+  void clip_children(int c) { if (c) set_flag(CLIP_CHILDREN); else clear_flag(CLIP_CHILDREN); }
+  /**
+    Returns the current clipping mode.
+
+    \return true, if clipping is enabled, false otherwise.
+
+    \see void Fl_Group::clip_children(int c)
+  */
+  unsigned int clip_children() { return (flags() & CLIP_CHILDREN) != 0; }
+
+  // Note: Doxygen docs in Fl_Widget.H to avoid redundancy.
+  virtual Fl_Group* as_group() { return this; }
+
+  // back compatibility functions:
+
+  /**
+    \deprecated This is for backwards compatibility only. You should use
+    \e W->%take_focus() instead.
+    \sa Fl_Widget::take_focus();
+  */
+  void focus(Fl_Widget* W) {W->take_focus();}
+
+  /** This is for forms compatibility only */
+  Fl_Widget* & _ddfdesign_kludge() {return resizable_;}
+
+  /** This is for forms compatibility only */
+  void forms_end();
+  /** Resize the label and font size of its children */
+  void resizefont(float font_scale);
+
+  protected:
+
+  /*!
+    Inner implementation of layout(). The child widgets are resized
+    and positioned so that the area that was initially surrounded by this
+    widget now fits inside the rectangle.
+
+    \a r is a rectangle, in the coordinate system of this Fl_Group (ie 0,0
+    is the top-left corner of the Fl_Group).
+
+    \a layout_damage controls what is done. If FL_LAYOUT_W or FL_LAYOUT_H are
+    off then no resizing or moving of widgets in that direction is done.
+
+    This is used by Fl_Scroll to resize the widgets to fit inside the
+    scrollbars.
+  */
+
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_Group, Fl_Widget)
+};
+
+// dummy class used to end child groups in constructors for complex
+// subclasses of Fl_Group:
+/**
+  This is a dummy class that allows you to end a Fl_Group in a constructor list of a
+  class:
+  \code
+   class MyClass {
+   Fl_Group group;
+   Fl_Button button_in_group;
+   Fl_End end;
+   Fl_Button button_outside_group;
+   MyClass();
+  };
+  MyClass::MyClass() :
+   group(10,10,100,100),
+   button_in_group(20,20,60,30),
+   end(),
+   button_outside_group(10,120,60,30)
+  {}
+  \endcode
+*/
+class FL_EXPORT Fl_End {
+public:
+  /** All it does is calling Fl_Group::current()->end() */
+  Fl_End() {Fl_Group::current()->end();}
+};
+
+#endif
+
+//
+// End of "$Id: Fl_Group.H 12302 2017-07-07 19:16:40Z AlbrechtS $".
+//

+ 92 - 88
fltk/FL/Fl_Help_Dialog.H

@@ -1,88 +1,92 @@
-//
-// "$Id: Fl_Help_Dialog.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
-//
-// Fl_Help_Dialog dialog for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_Help_Dialog widget . */
-
-// generated by Fast Light User Interface Designer (fluid) version 1.0108
-
-#ifndef Fl_Help_Dialog_H
-#define Fl_Help_Dialog_H
-#include <FL/Fl.H>
-#include <FL/Fl_Double_Window.H>
-#include <FL/Fl_Group.H>
-#include <FL/Fl_Button.H>
-#include <FL/Fl_Input.H>
-#include <FL/Fl_Box.H>
-#include <FL/Fl_Help_View.H>
-
-class FL_EXPORT Fl_Help_Dialog {
-  int index_; 
-  int max_; 
-  int line_[100];                 // FIXME: we must remove those static numbers
-  char file_[100][FL_PATH_MAX];   // FIXME: we must remove those static numbers
-  int find_pos_; 
-public:
-  Fl_Help_Dialog();
-private:
-  Fl_Double_Window *window_;
-  Fl_Button *back_;
-  void cb_back__i(Fl_Button*, void*);
-  static void cb_back_(Fl_Button*, void*);
-  Fl_Button *forward_;
-  void cb_forward__i(Fl_Button*, void*);
-  static void cb_forward_(Fl_Button*, void*);
-  Fl_Button *smaller_;
-  void cb_smaller__i(Fl_Button*, void*);
-  static void cb_smaller_(Fl_Button*, void*);
-  Fl_Button *larger_;
-  void cb_larger__i(Fl_Button*, void*);
-  static void cb_larger_(Fl_Button*, void*);
-  Fl_Input *find_;
-  void cb_find__i(Fl_Input*, void*);
-  static void cb_find_(Fl_Input*, void*);
-  Fl_Help_View *view_;
-  void cb_view__i(Fl_Help_View*, void*);
-  static void cb_view_(Fl_Help_View*, void*);
-public:
-  ~Fl_Help_Dialog();
-  int h();
-  void hide();
-  void load(const char *f);
-  void position(int xx, int yy);
-  void resize(int xx, int yy, int ww, int hh);
-  void show();
-  void show(int argc, char **argv);
-  void textsize(Fl_Fontsize s);
-  Fl_Fontsize textsize();
-  void topline(const char *n);
-  void topline(int n);
-  void value(const char *f);
-  const char * value() const;
-  int visible();
-  int w();
-  int x();
-  int y();
-
-DECLARE_CLASS_CHEAP_RTTI_1(Fl_Help_Dialog)
-};
-#endif
-
-//
-// End of "$Id: Fl_Help_Dialog.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
-//
+//
+// "$Id: Fl_Help_Dialog.H 11088 2016-01-30 00:56:42Z AlbrechtS $"
+//
+// Fl_Help_Dialog dialog for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2015 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+// ========================================================================
+//  DO NOT EDIT FL/Fl_Help_Dialog.H and src/Fl_Help_Dialog.cxx !!!
+// ========================================================================
+//  Please use fluid to change src/Fl_Help_Dialog.fl interactively
+//  and then use fluid to "write code" or edit and use fluid -c .
+// ========================================================================
+//
+
+// generated by Fast Light User Interface Designer (fluid) version 1.0400
+
+#ifndef Fl_Help_Dialog_H
+#define Fl_Help_Dialog_H
+#include <FL/Fl.H>
+#include <FL/Fl_Double_Window.H>
+#include <FL/Fl_Group.H>
+#include <FL/Fl_Button.H>
+#include <FL/Fl_Input.H>
+#include <FL/Fl_Box.H>
+#include <FL/Fl_Help_View.H>
+
+class FL_EXPORT Fl_Help_Dialog {
+  int index_; 
+  int max_; 
+  int line_[100]; // FIXME: we must remove those static numbers
+  char file_[100][FL_PATH_MAX]; // FIXME: we must remove those static numbers
+  int find_pos_; 
+public:
+  Fl_Help_Dialog();
+private:
+  Fl_Double_Window *window_;
+  Fl_Button *back_;
+  inline void cb_back__i(Fl_Button*, void*);
+  static void cb_back_(Fl_Button*, void*);
+  Fl_Button *forward_;
+  inline void cb_forward__i(Fl_Button*, void*);
+  static void cb_forward_(Fl_Button*, void*);
+  Fl_Button *smaller_;
+  inline void cb_smaller__i(Fl_Button*, void*);
+  static void cb_smaller_(Fl_Button*, void*);
+  Fl_Button *larger_;
+  inline void cb_larger__i(Fl_Button*, void*);
+  static void cb_larger_(Fl_Button*, void*);
+  Fl_Input *find_;
+  inline void cb_find__i(Fl_Input*, void*);
+  static void cb_find_(Fl_Input*, void*);
+  Fl_Help_View *view_;
+  inline void cb_view__i(Fl_Help_View*, void*);
+  static void cb_view_(Fl_Help_View*, void*);
+public:
+  virtual ~Fl_Help_Dialog();
+  int h();
+  void hide();
+  void load(const char *f);
+  void position(int xx, int yy);
+  void resize(int xx, int yy, int ww, int hh);
+  void show();
+  void show(int argc, char **argv);
+  void textsize(Fl_Fontsize s);
+  Fl_Fontsize textsize();
+  void topline(const char *n);
+  void topline(int n);
+  void value(const char *f);
+  const char * value() const;
+  int visible();
+  int w();
+  int x();
+  int y();
+
+DECLARE_CLASS_CHEAP_RTTI_1(Fl_Help_Dialog)
+};
+#endif
+
+//
+// End of "$Id: Fl_Help_Dialog.H 11088 2016-01-30 00:56:42Z AlbrechtS $".
+//

+ 453 - 453
fltk/FL/Fl_Help_View.H

@@ -1,453 +1,453 @@
-//
-// "$Id: Fl_Help_View.H 9126 2011-10-04 13:10:55Z manolo $"
-//
-// Help Viewer widget definitions.
-//
-// Copyright 1997-2010 by Easy Software Products.
-// Image support by Matthias Melcher, Copyright 2000-2009.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-// Inline:
-//
-//   Fl_Help_View::directory()  - Get the directory string.
-//   Fl_Help_View::filename()   - Get the filename string.
-//   Fl_Help_View::link()       - Set the link callback.
-//   Fl_Help_View::size()       - Get the total document length.
-//   Fl_Help_View::size()       - Set the document width and height.
-//   Fl_Help_View::textcolor()  - Set the default text color.
-//   Fl_Help_View::textcolor()  - Get the default text color.
-//   Fl_Help_View::textsize()   - Set the default font size.
-//   Fl_Help_View::textsize()   - Get the default font size.
-//   Fl_Help_View::title()      - Get the title string.
-//   Fl_Help_View::topline()    - Get the top line in document.
-//   Fl_Help_View::leftline()   - Get the left line position.
-//   Fl_Help_View::value()      - Get the HTML text value.
-//   Fl_Help_View::monofont()   - Set the default mono font.
-//   Fl_Help_View::monofont()   - Get the default mono font.
-//   Fl_Help_View::reformat()   - Format the help text.
-//   Fl_Help_View::sansfont()   - Set the default sans font.
-//   Fl_Help_View::sansfont()   - Get the default sans font.
-//   Fl_Help_View::serifont()   - Set the default serif font.
-//   Fl_Help_View::serifont()   - Get the default serif font.
-//
-
-#ifndef Fl_Help_View_H
-#  define Fl_Help_View_H
-
-//
-// Include necessary header files...
-//
-
-#  include <stdio.h>
-#  include <FL/Fl.H>
-#  include <FL/Fl_Group.H>
-#  include <FL/Fl_Scrollbar.H>
-#  include <FL/fl_draw.H>
-#  include <FL/Fl_Shared_Image.H>
-#  include <FL/filename.H>
-
-//
-// Fl_Help_Func type - link callback function for files...
-//
-
-typedef const char *(Fl_Help_Func)(Fl_Widget *, const char *, const char *);
-
-//
-// Fl_Help_Block structure
-//
-
-// note: we can change private structs accessed by pointers
-struct Fl_Help_Block
-{
-  const char *start, // Start of text
-    *end; // End of text
-  unsigned char border; // Draw border?
-  Fl_Color border_color;	// Border color
-  Fl_Color bgcolor; // Background color
-  int x, // Indentation/starting X coordinate
-    y, // Starting Y coordinate
-    w, // Width
-    h; // Height
-  // new fields, removed int line[32];
-  unsigned char fsize; // current font size
-  unsigned char font; // current font
-  int  maxh, // max image height
-    imgy, // image y position
-    pre, // pre text flag
-    type, // blockquote/ol/ul/li type parameter
-    tag, // tag/element fourcc int
-    line, // Left starting position for each line
-    cbi; // current block index
-};
-
-//
-// Fl_Help_Link structure
-//
-
-struct Fl_Help_Link
-{
-  char filename[192], // Link reference filename
-    name[32]; // Link target name, blank if none
-  int x, // X offset of link text
-    y, // Y offset of link text
-    w, // Width of link text
-    h; // Height of link text
-};
-
-//
-// Fl_Help_Target structure
-//
-
-// note: hijacking this lets us add new data members via the d-pointer
-struct Fl_Help_Target
-{
-  // new fields, removed char name[32]; int y;
-  Fl_Help_Link *targets, // Targets
-    *linkp; // Currently clicked link
-  unsigned char ispush, // link is pushed
-    islink, // link clicked
-    resized, // window resized
-    ispath, // is path used
-    nstyle, // navigation style flag
-    isnew, // is new page
-    pad7, //
-    pad8; //
-  int top, // current topline
-    ltop, // last topline
-    isnav, // is nav link
-    rwidth, // resize width
-    cssurllen, // css url length
-    csswordlen, // css word length
-    *cssword; // css word value
-  long rtime, // resize time
-    rsec, // resize seconds
-    rmil, // resize millisecs
-    csstextlen; // css text length
-  char *csstext, // css text value
-    *cssurl, // css url value
-    path[1024], // current file path
-    lpath[1024]; // last file path
-  int nfonts, // number of fonts in stack
-    fonts[100][2]; // font stack
-};
-
-//
-// Fl_Help_View class...
-//
-
-class FL_EXPORT Fl_Help_View : public Fl_Group // Help viewer widget
-{
-private:
-
-  enum { RIGHT = -1, CENTER, LEFT }; // Alignments
-
-  char title_[1024]; // Title string
-  Fl_Color defcolor_, // Default text color
-    bgcolor_, // Background color
-    textcolor_, // Text color
-    linkcolor_; // Link color
-  unsigned char textfont_, // Default font - replaced
-    textsize_; // Default font size - replaced
-  const char *value_; // HTML text value
-
-  int nblocks_, // Number of blocks/lines
-    ablocks_; // Allocated blocks
-  Fl_Help_Block *blocks_; // Blocks
-
-  Fl_Help_Func *link_; // Link transform function
-
-  int nlinks_, // Number of links
-    alinks_; // Allocated links
-  Fl_Help_Link *links_; // Links
-
-  int ntargets_, // Number of targets
-    atargets_; // Allocated targets
-  Fl_Help_Target *d; // d-pointer struct - was *targets_
-  // note: we can rename existing data members
-
-  char directory_[FL_PATH_MAX], // Directory for current file
-    filename_[FL_PATH_MAX]; // Current filename
-  int topline_, // Top line in document
-    leftline_, // Left line position
-    size_, // Total document length
-    hsize_, // Maximum document width
-	scrollbar_size_;	///< Size for both scrollbars
-  Fl_Scrollbar scrollbar_, // Vertical scrollbar for document
-    hscrollbar_; // Horizontal scrollbar
-
-  // Text selection
-  Fl_Offscreen Fl_Help_View_buffer;
-  int selection_first; // Text selection
-  int selection_last;
-  int selection_push_first;
-  int selection_push_last;
-  int selection_drag_first;
-  int selection_drag_last;
-  int selected;
-  int draw_mode;
-  int mouse_x;
-  int mouse_y;
-  int current_pos;
-  Fl_Help_View *current_view;
-  Fl_Color hv_selection_color;
-  Fl_Color hv_selection_text_color;
-
-  // new private static class variables
-  int serifont_; // default serif font
-  int sansfont_; // default sans font
-  int monofont_; // default monospace font
-  unsigned char fontsize_; // default font size
-  short face_[250][4]; // font face table [m,b,i,p]
-  unsigned char flet_[30]; // first face for letter table
-  unsigned char fref_[1000]; // face reference table
-
-  int default_margin_;  //internall padding
-  int tr_td_adjust_;    //when printint with pdfs
-
-  Fl_Help_Block *add_block(const char *sp, int xx, int yy, int ww, int hh, unsigned char bc = 0);
-  void add_link(const char *np, int xx, int yy, int ww, int hh);
-  void add_target(const char *np, int yy);
-  static int compare_targets(const Fl_Help_Target *t0, const Fl_Help_Target *t1);
-  int do_align(Fl_Help_Block *b, int li, int xx, int ca, int &sl);
-  void draw();
-  void format();
-  void format_table(int *tw, int *maxcols, const char *tp);
-  void free_data();
-  int get_align(const char *ap, int da);
-  const char *get_attr(const char *ap, const char *np, char *buf, int sb);
-  Fl_Color get_color(const char *np, Fl_Color dc);
-  Fl_Shared_Image *get_image(const char *np, int iw, int ih);
-  int get_length(const char *lp);
-  //int handle(int event); // moved to public
-  // note: you can remove private non-virtual functions if not called by inline functions
-
-  void initfont(unsigned char &fi, unsigned char &fs) { // Reset stack - replaced, for when nfonts > 255
-    d->nfonts = 0;
-    fl_font(fi = d->fonts[0][0] = serifont_, fs = d->fonts[0][1] = fontsize_);
-  }
-  void pushfont(unsigned char fi, unsigned char fs) { // Push font - replaced
-    if (d->nfonts < 99) d->nfonts ++;
-    fl_font(d->fonts[d->nfonts][0] = fi, d->fonts[d->nfonts][1] = fs);
-  }
-  void popfont(unsigned char &fi, unsigned char &fs) { // Pop font - replaced
-    if (d->nfonts > 0) d->nfonts --;
-    fl_font(fi = d->fonts[d->nfonts][0], fs = d->fonts[d->nfonts][1]);
-  }
-
-  void hv_draw(const char *tp, int xx, int yy);
-  char begin_selection();
-  char extend_selection();
-  void end_selection(int cb = 0);
-  void clear_global_selection();
-  Fl_Help_Link *find_link(int xx, int yy);
-  void follow_link(Fl_Help_Link *lp);
-
-  // new private functions
-  // note: for BC we can't modify existing function declarations
-  Fl_Help_Block *add_block(const Fl_Help_Block &b, const char *sp, int ww);
-  unsigned char build_faces();
-  static int cmp_targets(const Fl_Help_Link *t0, const Fl_Help_Link *t1);
-  const char *format_table(int &tw, int *maxcols, const char *tp, int xx, int rc);
-  int get_css_value(const char *sp, const char *pp, char *vp);
-  int get_font_size(const char *hp);
-  int get_length(const char *lp, int hw);
-  int load_css(const char *fp);
-  void parse_css(Fl_Help_Block &b, const char *sp, char *buf);
-  void popfont(int &fi, unsigned char &fs);
-  void pushfont(int fi, unsigned char fs);
-
-public:
-
-  Fl_Help_View(int xx, int yy, int ww, int hh, const char *lp = 0);
-  ~Fl_Help_View();
-
-  const char *directory() const { // Get the directory string
-    if (directory_[0]) return directory_;
-    else return (const char *)0;
-  }
-  const char *filename() const { // Get the filename string
-    if (filename_[0]) return filename_;
-    else return (const char *)0;
-  }
-
-  int find(const char *sp, int pos = 0);
-
-  /**
-    This method assigns a callback function to use when a link is
-    followed or a file is loaded (via Fl_Help_View::load()) that
-    requires a different file or path.
-
-    The callback function receives a pointer to the Fl_Help_View
-    widget and the URI or full pathname for the file in question.
-    It must return a pathname that can be opened as a local file or NULL:
-
-    \code
-    const char *fn(Fl_Widget *w, const char *uri);
-    \endcode
-
-    The link function can be used to retrieve remote or virtual
-    documents, returning a temporary file that contains the actual
-    data. If the link function returns NULL, the value of
-    the Fl_Help_View widget will remain unchanged.
-
-    If the link callback cannot handle the URI scheme, it should
-    return the uri value unchanged or set the value() of the widget
-    before returning NULL.
-  */
-  void link(Fl_Help_Func *fn) { // Set the link callback
-    link_ = fn;
-  }
-
-  int load(const char *fp);
-  void resize(int xx, int yy, int ww, int hh);
-
-  int size() const { // Get the total document length
-    return size_;
-  }
-  void size(int ww, int hh) { // Set the document width and height
-    Fl_Widget::size(ww, hh);
-  }
-  void textcolor(Fl_Color tc) { // Set the default text color
-    if (textcolor_ == defcolor_) textcolor_ = tc;
-    defcolor_ = tc;
-  }
-  Fl_Color textcolor() const { // Get the default text color
-    return defcolor_;
-  }
-  void textfont(unsigned char fi) { // Set the text font, obsolete
-    textfont_ = fi;
-    //format(); // removed
-	// note: we can remove the contents of inline functions
-  }
-  Fl_Font textfont() const { // Get the text font, obsolete
-    return textfont_;
-  }
-  void textsize(unsigned char fs) { // Set the default font size
-    fontsize_ = fs;
-    //format(); // removed
-  }
-  Fl_Fontsize textsize() const { // Get the default font size
-    return fontsize_;
-  }
-  const char *title() { // Get the title string
-    return title_;
-  }
-
-  void topline(const char *np);
-  void topline(int yy);
-  int topline() const { // Get the top line in document
-    return topline_;
-  }
-
-  void leftline(int xx);
-  int leftline() const { // Get the left line position
-    return leftline_;
-  }
-
-  void value(const char *tp);
-  const char *value() const { // Get the HTML text value
-    return value_;
-  }
-
-  void clear_selection();
-  void select_all();
-
-  /**
-    Gets the current size of the scrollbars' troughs, in pixels.
-
-    If this value is zero (default), this widget will use the
-    Fl::scrollbar_size() value as the scrollbar's width.
-
-    \returns Scrollbar size in pixels, or 0 if the global Fl::scrollbar_size() is being used.
-    \see Fl::scrollbar_size(int)
-  */
-  int scrollbar_size() const {
-      return(scrollbar_size_);
-  }
-  /**
-    Sets the pixel size of the scrollbars' troughs to the \p size, in pixels.
-
-    Normally you should not need this method, and should use
-    Fl::scrollbar_size(int) instead to manage the size of ALL
-    your widgets' scrollbars. This ensures your application
-    has a consistent UI, is the default behavior, and is normally
-    what you want.
-
-    Only use THIS method if you really need to override the global
-    scrollbar size. The need for this should be rare.
-
-    Setting \p size to the special value of 0 causes the widget to
-    track the global Fl::scrollbar_size(), which is the default.
-
-    \param[in] size Sets the scrollbar size in pixels.\n
-                    If 0 (default), scrollbar size tracks the global Fl::scrollbar_size()
-    \see Fl::scrollbar_size()
-  */
-  void scrollbar_size(int size) {
-      scrollbar_size_ = size;
-  }
-  
-  // new public functions
-  int fileislink();
-  void filepath(const char *fp);
-  char *filepath();
-  int font_face(const char *sp);
-  int font_style(int fi, unsigned char fs);
-  int gettopline();
-  int handle(int event); // moved from private
-
-  void monofont(int fi) { // set the default mono font
-    monofont_ = fi;
-  }
-  int monofont() const { // get the default mono font
-    return monofont_;
-  }
-  void reformat() { // format the help text - wrapper function
-    format();
-  }
-  void sansfont(int fi) { // set the default sans font
-    sansfont_ = fi;
-  }
-  int sansfont() const { // get the default sans font
-    return sansfont_;
-  }
-  void serifont(int fi) { // set the default serif font
-    serifont_ = fi;
-  }
-  int serifont() const { // get the default serif font
-    return serifont_;
-  }
-
-  void setstyle(int flag);
-
-  void default_margin(int value) { // set the default margin
-    default_margin_ = value;
-  }
-  int default_margin() const { // get the default margin
-    return default_margin_;
-  }
-
-  void tr_td_adjust(int value) { // set the pdf print adjust
-    tr_td_adjust_ = value;
-  }
-  int tr_td_adjust() const { // get the pdf print adjust
-    return tr_td_adjust_;
-  }
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_Help_View, Fl_Group)
-};
-
-#endif // !Fl_Help_View_H
-
-//
-// End of "$Id: Fl_Help_View.H 5991 2007-12-15 16:08:23Z mike $".
-//
+//
+// "$Id: Fl_Help_View.H 9126 2011-10-04 13:10:55Z manolo $"
+//
+// Help Viewer widget definitions.
+//
+// Copyright 1997-2010 by Easy Software Products.
+// Image support by Matthias Melcher, Copyright 2000-2009.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+// Inline:
+//
+//   Fl_Help_View::directory()  - Get the directory string.
+//   Fl_Help_View::filename()   - Get the filename string.
+//   Fl_Help_View::link()       - Set the link callback.
+//   Fl_Help_View::size()       - Get the total document length.
+//   Fl_Help_View::size()       - Set the document width and height.
+//   Fl_Help_View::textcolor()  - Set the default text color.
+//   Fl_Help_View::textcolor()  - Get the default text color.
+//   Fl_Help_View::textsize()   - Set the default font size.
+//   Fl_Help_View::textsize()   - Get the default font size.
+//   Fl_Help_View::title()      - Get the title string.
+//   Fl_Help_View::topline()    - Get the top line in document.
+//   Fl_Help_View::leftline()   - Get the left line position.
+//   Fl_Help_View::value()      - Get the HTML text value.
+//   Fl_Help_View::monofont()   - Set the default mono font.
+//   Fl_Help_View::monofont()   - Get the default mono font.
+//   Fl_Help_View::reformat()   - Format the help text.
+//   Fl_Help_View::sansfont()   - Set the default sans font.
+//   Fl_Help_View::sansfont()   - Get the default sans font.
+//   Fl_Help_View::serifont()   - Set the default serif font.
+//   Fl_Help_View::serifont()   - Get the default serif font.
+//
+
+#ifndef Fl_Help_View_H
+#  define Fl_Help_View_H
+
+//
+// Include necessary header files...
+//
+
+#  include <stdio.h>
+#  include <FL/Fl.H>
+#  include <FL/Fl_Group.H>
+#  include <FL/Fl_Scrollbar.H>
+#  include <FL/fl_draw.H>
+#  include <FL/Fl_Shared_Image.H>
+#  include <FL/filename.H>
+
+//
+// Fl_Help_Func type - link callback function for files...
+//
+
+typedef const char *(Fl_Help_Func)(Fl_Widget *, const char *, const char *);
+
+//
+// Fl_Help_Block structure
+//
+
+// note: we can change private structs accessed by pointers
+struct Fl_Help_Block
+{
+  const char *start, // Start of text
+    *end; // End of text
+  unsigned char border; // Draw border?
+  Fl_Color border_color;	// Border color
+  Fl_Color bgcolor; // Background color
+  int x, // Indentation/starting X coordinate
+    y, // Starting Y coordinate
+    w, // Width
+    h; // Height
+  // new fields, removed int line[32];
+  unsigned char fsize; // current font size
+  unsigned char font; // current font
+  int  maxh, // max image height
+    imgy, // image y position
+    pre, // pre text flag
+    type, // blockquote/ol/ul/li type parameter
+    tag, // tag/element fourcc int
+    line, // Left starting position for each line
+    cbi; // current block index
+};
+
+//
+// Fl_Help_Link structure
+//
+
+struct Fl_Help_Link
+{
+  char filename[192], // Link reference filename
+    name[32]; // Link target name, blank if none
+  int x, // X offset of link text
+    y, // Y offset of link text
+    w, // Width of link text
+    h; // Height of link text
+};
+
+//
+// Fl_Help_Target structure
+//
+
+// note: hijacking this lets us add new data members via the d-pointer
+struct Fl_Help_Target
+{
+  // new fields, removed char name[32]; int y;
+  Fl_Help_Link *targets, // Targets
+    *linkp; // Currently clicked link
+  unsigned char ispush, // link is pushed
+    islink, // link clicked
+    resized, // window resized
+    ispath, // is path used
+    nstyle, // navigation style flag
+    isnew, // is new page
+    pad7, //
+    pad8; //
+  int top, // current topline
+    ltop, // last topline
+    isnav, // is nav link
+    rwidth, // resize width
+    cssurllen, // css url length
+    csswordlen, // css word length
+    *cssword; // css word value
+  long rtime, // resize time
+    rsec, // resize seconds
+    rmil, // resize millisecs
+    csstextlen; // css text length
+  char *csstext, // css text value
+    *cssurl, // css url value
+    path[1024], // current file path
+    lpath[1024]; // last file path
+  int nfonts, // number of fonts in stack
+    fonts[100][2]; // font stack
+};
+
+//
+// Fl_Help_View class...
+//
+
+class FL_EXPORT Fl_Help_View : public Fl_Group // Help viewer widget
+{
+private:
+
+  enum { RIGHT = -1, CENTER, LEFT }; // Alignments
+
+  char title_[1024]; // Title string
+  Fl_Color defcolor_, // Default text color
+    bgcolor_, // Background color
+    textcolor_, // Text color
+    linkcolor_; // Link color
+  unsigned char textfont_, // Default font - replaced
+    textsize_; // Default font size - replaced
+  const char *value_; // HTML text value
+
+  int nblocks_, // Number of blocks/lines
+    ablocks_; // Allocated blocks
+  Fl_Help_Block *blocks_; // Blocks
+
+  Fl_Help_Func *link_; // Link transform function
+
+  int nlinks_, // Number of links
+    alinks_; // Allocated links
+  Fl_Help_Link *links_; // Links
+
+  int ntargets_, // Number of targets
+    atargets_; // Allocated targets
+  Fl_Help_Target *d; // d-pointer struct - was *targets_
+  // note: we can rename existing data members
+
+  char directory_[FL_PATH_MAX], // Directory for current file
+    filename_[FL_PATH_MAX]; // Current filename
+  int topline_, // Top line in document
+    leftline_, // Left line position
+    size_, // Total document length
+    hsize_, // Maximum document width
+	scrollbar_size_;	///< Size for both scrollbars
+  Fl_Scrollbar scrollbar_, // Vertical scrollbar for document
+    hscrollbar_; // Horizontal scrollbar
+
+  // Text selection
+  Fl_Offscreen Fl_Help_View_buffer;
+  int selection_first; // Text selection
+  int selection_last;
+  int selection_push_first;
+  int selection_push_last;
+  int selection_drag_first;
+  int selection_drag_last;
+  int selected;
+  int draw_mode;
+  int mouse_x;
+  int mouse_y;
+  int current_pos;
+  Fl_Help_View *current_view;
+  Fl_Color hv_selection_color;
+  Fl_Color hv_selection_text_color;
+
+  // new private static class variables
+  int serifont_; // default serif font
+  int sansfont_; // default sans font
+  int monofont_; // default monospace font
+  unsigned char fontsize_; // default font size
+  short face_[250][4]; // font face table [m,b,i,p]
+  unsigned char flet_[30]; // first face for letter table
+  unsigned char fref_[1000]; // face reference table
+
+  int default_margin_;  //internall padding
+  int tr_td_adjust_;    //when printint with pdfs
+
+  Fl_Help_Block *add_block(const char *sp, int xx, int yy, int ww, int hh, unsigned char bc = 0);
+  void add_link(const char *np, int xx, int yy, int ww, int hh);
+  void add_target(const char *np, int yy);
+  static int compare_targets(const Fl_Help_Target *t0, const Fl_Help_Target *t1);
+  int do_align(Fl_Help_Block *b, int li, int xx, int ca, int &sl);
+  void draw();
+  void format();
+  void format_table(int *tw, int *maxcols, const char *tp);
+  void free_data();
+  int get_align(const char *ap, int da);
+  const char *get_attr(const char *ap, const char *np, char *buf, int sb);
+  Fl_Color get_color(const char *np, Fl_Color dc);
+  Fl_Shared_Image *get_image(const char *np, int iw, int ih);
+  int get_length(const char *lp);
+  //int handle(int event); // moved to public
+  // note: you can remove private non-virtual functions if not called by inline functions
+
+  void initfont(unsigned char &fi, unsigned char &fs) { // Reset stack - replaced, for when nfonts > 255
+    d->nfonts = 0;
+    fl_font(fi = d->fonts[0][0] = serifont_, fs = d->fonts[0][1] = fontsize_);
+  }
+  void pushfont(unsigned char fi, unsigned char fs) { // Push font - replaced
+    if (d->nfonts < 99) d->nfonts ++;
+    fl_font(d->fonts[d->nfonts][0] = fi, d->fonts[d->nfonts][1] = fs);
+  }
+  void popfont(unsigned char &fi, unsigned char &fs) { // Pop font - replaced
+    if (d->nfonts > 0) d->nfonts --;
+    fl_font(fi = d->fonts[d->nfonts][0], fs = d->fonts[d->nfonts][1]);
+  }
+
+  void hv_draw(const char *tp, int xx, int yy);
+  char begin_selection();
+  char extend_selection();
+  void end_selection(int cb = 0);
+  void clear_global_selection();
+  Fl_Help_Link *find_link(int xx, int yy);
+  void follow_link(Fl_Help_Link *lp);
+
+  // new private functions
+  // note: for BC we can't modify existing function declarations
+  Fl_Help_Block *add_block(const Fl_Help_Block &b, const char *sp, int ww);
+  unsigned char build_faces();
+  static int cmp_targets(const Fl_Help_Link *t0, const Fl_Help_Link *t1);
+  const char *format_table(int &tw, int *maxcols, const char *tp, int xx, int rc);
+  int get_css_value(const char *sp, const char *pp, char *vp);
+  int get_font_size(const char *hp);
+  int get_length(const char *lp, int hw);
+  int load_css(const char *fp);
+  void parse_css(Fl_Help_Block &b, const char *sp, char *buf);
+  void popfont(int &fi, unsigned char &fs);
+  void pushfont(int fi, unsigned char fs);
+
+public:
+
+  Fl_Help_View(int xx, int yy, int ww, int hh, const char *lp = 0);
+  ~Fl_Help_View();
+
+  const char *directory() const { // Get the directory string
+    if (directory_[0]) return directory_;
+    else return (const char *)0;
+  }
+  const char *filename() const { // Get the filename string
+    if (filename_[0]) return filename_;
+    else return (const char *)0;
+  }
+
+  int find(const char *sp, int pos = 0);
+
+  /**
+    This method assigns a callback function to use when a link is
+    followed or a file is loaded (via Fl_Help_View::load()) that
+    requires a different file or path.
+
+    The callback function receives a pointer to the Fl_Help_View
+    widget and the URI or full pathname for the file in question.
+    It must return a pathname that can be opened as a local file or NULL:
+
+    \code
+    const char *fn(Fl_Widget *w, const char *uri);
+    \endcode
+
+    The link function can be used to retrieve remote or virtual
+    documents, returning a temporary file that contains the actual
+    data. If the link function returns NULL, the value of
+    the Fl_Help_View widget will remain unchanged.
+
+    If the link callback cannot handle the URI scheme, it should
+    return the uri value unchanged or set the value() of the widget
+    before returning NULL.
+  */
+  void link(Fl_Help_Func *fn) { // Set the link callback
+    link_ = fn;
+  }
+
+  int load(const char *fp);
+  void resize(int xx, int yy, int ww, int hh);
+
+  int size() const { // Get the total document length
+    return size_;
+  }
+  void size(int ww, int hh) { // Set the document width and height
+    Fl_Widget::size(ww, hh);
+  }
+  void textcolor(Fl_Color tc) { // Set the default text color
+    if (textcolor_ == defcolor_) textcolor_ = tc;
+    defcolor_ = tc;
+  }
+  Fl_Color textcolor() const { // Get the default text color
+    return defcolor_;
+  }
+  void textfont(unsigned char fi) { // Set the text font, obsolete
+    textfont_ = fi;
+    //format(); // removed
+	// note: we can remove the contents of inline functions
+  }
+  Fl_Font textfont() const { // Get the text font, obsolete
+    return textfont_;
+  }
+  void textsize(unsigned char fs) { // Set the default font size
+    fontsize_ = fs;
+    //format(); // removed
+  }
+  Fl_Fontsize textsize() const { // Get the default font size
+    return fontsize_;
+  }
+  const char *title() { // Get the title string
+    return title_;
+  }
+
+  void topline(const char *np);
+  void topline(int yy);
+  int topline() const { // Get the top line in document
+    return topline_;
+  }
+
+  void leftline(int xx);
+  int leftline() const { // Get the left line position
+    return leftline_;
+  }
+
+  void value(const char *tp);
+  const char *value() const { // Get the HTML text value
+    return value_;
+  }
+
+  void clear_selection();
+  void select_all();
+
+  /**
+    Gets the current size of the scrollbars' troughs, in pixels.
+
+    If this value is zero (default), this widget will use the
+    Fl::scrollbar_size() value as the scrollbar's width.
+
+    \returns Scrollbar size in pixels, or 0 if the global Fl::scrollbar_size() is being used.
+    \see Fl::scrollbar_size(int)
+  */
+  int scrollbar_size() const {
+      return(scrollbar_size_);
+  }
+  /**
+    Sets the pixel size of the scrollbars' troughs to the \p size, in pixels.
+
+    Normally you should not need this method, and should use
+    Fl::scrollbar_size(int) instead to manage the size of ALL
+    your widgets' scrollbars. This ensures your application
+    has a consistent UI, is the default behavior, and is normally
+    what you want.
+
+    Only use THIS method if you really need to override the global
+    scrollbar size. The need for this should be rare.
+
+    Setting \p size to the special value of 0 causes the widget to
+    track the global Fl::scrollbar_size(), which is the default.
+
+    \param[in] size Sets the scrollbar size in pixels.\n
+                    If 0 (default), scrollbar size tracks the global Fl::scrollbar_size()
+    \see Fl::scrollbar_size()
+  */
+  void scrollbar_size(int size) {
+      scrollbar_size_ = size;
+  }
+  
+  // new public functions
+  int fileislink();
+  void filepath(const char *fp);
+  char *filepath();
+  int font_face(const char *sp);
+  int font_style(int fi, unsigned char fs);
+  int gettopline();
+  int handle(int event); // moved from private
+
+  void monofont(int fi) { // set the default mono font
+    monofont_ = fi;
+  }
+  int monofont() const { // get the default mono font
+    return monofont_;
+  }
+  void reformat() { // format the help text - wrapper function
+    format();
+  }
+  void sansfont(int fi) { // set the default sans font
+    sansfont_ = fi;
+  }
+  int sansfont() const { // get the default sans font
+    return sansfont_;
+  }
+  void serifont(int fi) { // set the default serif font
+    serifont_ = fi;
+  }
+  int serifont() const { // get the default serif font
+    return serifont_;
+  }
+
+  void setstyle(int flag);
+
+  void default_margin(int value) { // set the default margin
+    default_margin_ = value;
+  }
+  int default_margin() const { // get the default margin
+    return default_margin_;
+  }
+
+  void tr_td_adjust(int value) { // set the pdf print adjust
+    tr_td_adjust_ = value;
+  }
+  int tr_td_adjust() const { // get the pdf print adjust
+    return tr_td_adjust_;
+  }
+
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_Help_View, Fl_Group)
+};
+
+#endif // !Fl_Help_View_H
+
+//
+// End of "$Id: Fl_Help_View.H 5991 2007-12-15 16:08:23Z mike $".
+//

+ 52 - 54
fltk/FL/Fl_Hold_Browser.H

@@ -1,54 +1,52 @@
-//
-// "$Id: Fl_Hold_Browser.H 9637 2012-07-24 04:37:22Z matt $"
-//
-// Hold browser header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_Hold_Browser widget . */
-
-#ifndef Fl_Hold_Browser_H
-#define Fl_Hold_Browser_H
-
-#include "Fl_Browser.H"
-
-/**
-  The Fl_Hold_Browser is a subclass of Fl_Browser
-  which lets the user select a single item, or no items by clicking on
-  the empty space.  As long as the mouse button is held down the item
-  pointed to by it is highlighted, and this highlighting remains on when
-  the mouse button is released. Normally the callback is done when the
-  user releases the mouse, but you can change this with when().
-  <P>See Fl_Browser for methods to add and remove lines from the browser.
-*/
-class FL_EXPORT Fl_Hold_Browser : public Fl_Browser {
-public:
-  /**
-    Creates a new Fl_Hold_Browser widget using the given
-    position, size, and label string. The default boxtype is FL_DOWN_BOX.
-    The constructor specializes Fl_Browser() by setting the type to FL_HOLD_BROWSER.
-    The destructor destroys the widget and frees all memory that has been allocated.
- */
-  Fl_Hold_Browser(int X,int Y,int W,int H,const char *L=0);
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_Hold_Browser, Fl_Browser)
-
-};
-
-#endif
-
-//
-// End of "$Id: Fl_Hold_Browser.H 9637 2012-07-24 04:37:22Z matt $".
-//
+//
+// "$Id: Fl_Hold_Browser.H 9637 2012-07-24 04:37:22Z matt $"
+//
+// Hold browser header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2010 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_Hold_Browser widget . */
+
+#ifndef Fl_Hold_Browser_H
+#define Fl_Hold_Browser_H
+
+#include "Fl_Browser.H"
+
+/**
+  The Fl_Hold_Browser is a subclass of Fl_Browser
+  which lets the user select a single item, or no items by clicking on
+  the empty space.  As long as the mouse button is held down the item
+  pointed to by it is highlighted, and this highlighting remains on when
+  the mouse button is released. Normally the callback is done when the
+  user releases the mouse, but you can change this with when().
+  <P>See Fl_Browser for methods to add and remove lines from the browser.
+*/
+class FL_EXPORT Fl_Hold_Browser : public Fl_Browser {
+public:
+  /**
+    Creates a new Fl_Hold_Browser widget using the given
+    position, size, and label string. The default boxtype is FL_DOWN_BOX.
+    The constructor specializes Fl_Browser() by setting the type to FL_HOLD_BROWSER.
+    The destructor destroys the widget and frees all memory that has been allocated.
+ */
+  Fl_Hold_Browser(int X,int Y,int W,int H,const char *L=0);
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_Hold_Browser, Fl_Browser)
+};
+
+#endif
+
+//
+// End of "$Id: Fl_Hold_Browser.H 9637 2012-07-24 04:37:22Z matt $".
+//

+ 37 - 38
fltk/FL/Fl_Hor_Fill_Slider.H

@@ -1,38 +1,37 @@
-//
-// "$Id: Fl_Hor_Fill_Slider.H 9637 2012-07-24 04:37:22Z matt $"
-//
-// Horizontal fill slider header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_Hor_Fill_Slider widget . */
-
-#ifndef Fl_Hor_Fill_Slider_H
-#define Fl_Hor_Fill_Slider_H
-
-#include "Fl_Slider.H"
-
-class FL_EXPORT Fl_Hor_Fill_Slider : public Fl_Slider {
-public:
-    Fl_Hor_Fill_Slider(int X,int Y,int W,int H,const char *L=0);
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_Hor_Fill_Slider, Fl_Slider)
-};
-
-#endif
-
-//
-// End of "$Id: Fl_Hor_Fill_Slider.H 9637 2012-07-24 04:37:22Z matt $".
-//
+//
+// "$Id: Fl_Hor_Fill_Slider.H 9637 2012-07-24 04:37:22Z matt $"
+//
+// Horizontal fill slider header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2010 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_Hor_Fill_Slider widget . */
+
+#ifndef Fl_Hor_Fill_Slider_H
+#define Fl_Hor_Fill_Slider_H
+
+#include "Fl_Slider.H"
+
+class FL_EXPORT Fl_Hor_Fill_Slider : public Fl_Slider {
+public:
+  Fl_Hor_Fill_Slider(int X,int Y,int W,int H,const char *L=0);
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_Hor_Fill_Slider, Fl_Slider)
+};
+
+#endif
+
+//
+// End of "$Id: Fl_Hor_Fill_Slider.H 9637 2012-07-24 04:37:22Z matt $".
+//

+ 37 - 38
fltk/FL/Fl_Hor_Nice_Slider.H

@@ -1,38 +1,37 @@
-//
-// "$Id: Fl_Hor_Nice_Slider.H 9637 2012-07-24 04:37:22Z matt $"
-//
-// Horizontal "nice" slider header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_Hor_Nice_Slider widget . */
-
-#ifndef Fl_Hor_Nice_Slider_H
-#define Fl_Hor_Nice_Slider_H
-
-#include "Fl_Slider.H"
-
-class FL_EXPORT Fl_Hor_Nice_Slider : public Fl_Slider {
-public:
-  Fl_Hor_Nice_Slider(int X,int Y,int W,int H,const char *L=0);
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_Hor_Nice_Slider, Fl_Slider)
-};
-
-#endif
-
-//
-// End of "$Id: Fl_Hor_Nice_Slider.H 9637 2012-07-24 04:37:22Z matt $".
-//
+//
+// "$Id: Fl_Hor_Nice_Slider.H 9637 2012-07-24 04:37:22Z matt $"
+//
+// Horizontal "nice" slider header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2010 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_Hor_Nice_Slider widget . */
+
+#ifndef Fl_Hor_Nice_Slider_H
+#define Fl_Hor_Nice_Slider_H
+
+#include "Fl_Slider.H"
+
+class FL_EXPORT Fl_Hor_Nice_Slider : public Fl_Slider {
+public:
+  Fl_Hor_Nice_Slider(int X,int Y,int W,int H,const char *L=0);
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_Hor_Nice_Slider, Fl_Slider)
+};
+
+#endif
+
+//
+// End of "$Id: Fl_Hor_Nice_Slider.H 9637 2012-07-24 04:37:22Z matt $".
+//

+ 46 - 47
fltk/FL/Fl_Hor_Slider.H

@@ -1,47 +1,46 @@
-//
-// "$Id: Fl_Hor_Slider.H 9637 2012-07-24 04:37:22Z matt $"
-//
-// Horizontal slider header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2011 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_Hor_Slider widget . */
-
-#ifndef Fl_Hor_Slider_H
-#define Fl_Hor_Slider_H
-
-#include "Fl_Slider.H"
-
-/** Horizontal Slider class.
-
-  \see class Fl_Slider.
-*/
-class FL_EXPORT Fl_Hor_Slider : public Fl_Slider {
-public:
-
-  /**
-    Creates a new Fl_Hor_Slider widget using the given position,
-    size, and label string.
-  */
-  Fl_Hor_Slider(int X,int Y,int W,int H,const char *l=0);
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_Hor_Slider, Fl_Slider)
-};
-
-#endif
-
-//
-// End of "$Id: Fl_Hor_Slider.H 9637 2012-07-24 04:37:22Z matt $".
-//
+//
+// "$Id: Fl_Hor_Slider.H 9637 2012-07-24 04:37:22Z matt $"
+//
+// Horizontal slider header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2011 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_Hor_Slider widget . */
+
+#ifndef Fl_Hor_Slider_H
+#define Fl_Hor_Slider_H
+
+#include "Fl_Slider.H"
+
+/** Horizontal Slider class.
+
+  \see class Fl_Slider.
+*/
+class FL_EXPORT Fl_Hor_Slider : public Fl_Slider {
+public:
+
+  /**
+    Creates a new Fl_Hor_Slider widget using the given position,
+    size, and label string.
+  */
+  Fl_Hor_Slider(int X,int Y,int W,int H,const char *l=0);
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_Hor_Slider, Fl_Slider)
+};
+
+#endif
+
+//
+// End of "$Id: Fl_Hor_Slider.H 9637 2012-07-24 04:37:22Z matt $".
+//

+ 37 - 38
fltk/FL/Fl_Hor_Value_Slider.H

@@ -1,38 +1,37 @@
-//
-// "$Id: Fl_Hor_Value_Slider.H 9637 2012-07-24 04:37:22Z matt $"
-//
-// Horizontal value slider header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_Hor_Value_Slider widget . */
-
-#ifndef Fl_Hor_Value_Slider_H
-#define Fl_Hor_Value_Slider_H
-
-#include "Fl_Value_Slider.H"
-
-class FL_EXPORT Fl_Hor_Value_Slider : public Fl_Value_Slider {
-public:
-  Fl_Hor_Value_Slider(int X,int Y,int W,int H,const char *l=0);
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_Hor_Value_Slider, Fl_Value_Slider)
-};
-
-#endif
-
-//
-// End of "$Id: Fl_Hor_Value_Slider.H 9637 2012-07-24 04:37:22Z matt $".
-//
+//
+// "$Id: Fl_Hor_Value_Slider.H 9637 2012-07-24 04:37:22Z matt $"
+//
+// Horizontal value slider header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2010 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_Hor_Value_Slider widget . */
+
+#ifndef Fl_Hor_Value_Slider_H
+#define Fl_Hor_Value_Slider_H
+
+#include "Fl_Value_Slider.H"
+
+class FL_EXPORT Fl_Hor_Value_Slider : public Fl_Value_Slider {
+public:
+  Fl_Hor_Value_Slider(int X,int Y,int W,int H,const char *l=0);
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_Hor_Value_Slider, Fl_Value_Slider)
+};
+
+#endif
+
+//
+// End of "$Id: Fl_Hor_Value_Slider.H 9637 2012-07-24 04:37:22Z matt $".
+//

+ 272 - 245
fltk/FL/Fl_Image.H

@@ -1,247 +1,274 @@
-//
-// "$Id: Fl_Image.H 10192 2014-06-12 13:28:04Z ossman $"
-//
-// Image header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2011 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_Image, Fl_RGB_Image classes . */
-
-#ifndef Fl_Image_H
-#  define Fl_Image_H
-
-#  include "Enumerations.H"
-#include <stdlib.h>
-
-#ifndef Fl_Widget_H
-#include "Fl_Widget.H"
-#endif
-
+//
+// "$Id: Fl_Image.H 12443 2017-09-11 18:54:10Z AlbrechtS $"
+//
+// Image header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2017 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/** \file
+   Fl_Image, Fl_RGB_Image classes. */
+
+#ifndef Fl_Image_H
+#define Fl_Image_H
+
+#include "Enumerations.H"
+#include <stdlib.h>
+#include "Fl_Widget.H" // for fl_uintptr_t
+
 class Fl_Widget;
-class Fl_Pixmap;
-class Fl_Menu_Item;
-class Fl_Label;
-
-/**
-  Fl_Image is the base class used for caching and
-  drawing all kinds of images in FLTK. This class keeps track of
-  common image data such as the pixels, colormap, width, height,
-  and depth. Virtual methods are used to provide type-specific
-  image handling.</P>
-  
-  <P>Since the Fl_Image class does not support image
-  drawing by itself, calling the draw() method results in
-  a box with an X in it being drawn instead.
-*/
-class FL_EXPORT Fl_Image {
-  int w_, h_, d_, ld_, count_;
-  const char * const *data_;
-
-  // Forbid use of copy contructor and assign operator
-  Fl_Image & operator=(const Fl_Image &);
-  Fl_Image(const Fl_Image &);
-
-  protected:
-
-  /**
-    Sets the current image width in pixels.
-  */
-  void w(int W) {w_ = W;}
-  /**
-    Sets the current image height in pixels.
-  */
-  void h(int H) {h_ = H;}
-  /**
-    Sets the current image depth.
-  */
-  void d(int D) {d_ = D;}
-  /**
-   Sets the current line data size in bytes.
-   */
-  void ld(int LD) {ld_ = LD;}
-  /** 
-   Sets the current array pointer and count of pointers in the array.
-   */
-  void data(const char * const *p, int c) {data_ = p; count_ = c;}
-  void draw_empty(int X, int Y);
-
-  static void labeltype(const Fl_Label *lo, int lx, int ly, int lw, int lh, Fl_Align la);
-  static void measure(const Fl_Label *lo, int &lw, int &lh);
-
-  public:
-
-  /** 
-   Returns the current image width in pixels.
-  */
-  int w() const {return w_;}
-  /**     Returns the current image height in pixels.
-   */
-  int h() const {return h_;}
-  /**
-    Returns the current image depth. 
-   The return value will be 0 for bitmaps, 1 for
-    pixmaps, and 1 to 4 for color images.</P>
-  */
-  int d() const {return d_;}
-  /**
-    Returns the current line data size in bytes. 
-    Line data is extra data that is included
-    after each line of color image data and is normally not present.
-  */
-  int ld() const {return ld_;}
-  /**
-    The count() method returns the number of data values
-    associated with the image. The value will be 0 for images with
-    no associated data, 1 for bitmap and color images, and greater
-    than 2 for pixmap images.
-  */
-  int count() const {return count_;}
-  /**
-    Returns a pointer to the current image data array. 
-    Use the count() method to find the size of the data array.
-  */
-  const char * const *data() const {return data_;}
-  
-  /**
-    The constructor creates an empty image with the specified
-    width, height, and depth. The width and height are in pixels.
-    The depth is 0 for bitmaps, 1 for pixmap (colormap) images, and
-    1 to 4 for color images.
-  */
-  Fl_Image(int W, int H, int D) {w_ = W; h_ = H; d_ = D; ld_ = 0; count_ = 0; data_ = 0;}
-  virtual ~Fl_Image();
-  virtual Fl_Image *copy(int W, int H);
-  /**
-    The copy() method creates a copy of the specified
-    image. If the width and height are provided, the image is
-    resized to the specified size. The image should be deleted (or in
-    the case of Fl_Shared_Image, released) when you are done
-    with it.
-  */
-  Fl_Image *copy() { return copy(w(), h()); }
-  virtual void color_average(Fl_Color c, float i);
-  /**
-    The inactive() method calls
-    color_average(FL_BACKGROUND_COLOR, 0.33f) to produce 
-    an image that appears grayed out. <I>This method does not 
-    alter the original image data.</I>
-  */
-  void inactive() { color_average(FL_GRAY, .33f); }
-  virtual void desaturate();
-  virtual void label(Fl_Widget*w);
-  virtual void label(Fl_Menu_Item*m);
-  /**
-    Draws the image with a bounding box. 
-    This form specifies
-    a bounding box for the image, with the origin
-    (upper-lefthand corner) of the image offset by the cx
-    and cy arguments.
-  */
-  virtual void draw(int X, int Y, int W, int H, int cx=0, int cy=0); // platform dependent
-  /**
-    Draws the image. 
-    This form specifies the upper-lefthand corner of the image.
-  */
-  void draw(int X, int Y) {draw(X, Y, w(), h(), 0, 0);} // platform dependent
-  virtual void uncache();
-
-DECLARE_CLASS_CHEAP_RTTI_1(Fl_Image)
-};
-
-/**
-  The Fl_RGB_Image class supports caching and drawing
-  of full-color images with 1 to 4 channels of color information.
-  Images with an even number of channels are assumed to contain
-  alpha information, which is used to blend the image with the
-  contents of the screen.</P>
-  
-  <P>Fl_RGB_Image is defined in
-  &lt;FL/Fl_Image.H&gt;, however for compatibility reasons
-  &lt;FL/Fl_RGB_Image.H&gt; should be included.
-*/
-class FL_EXPORT Fl_RGB_Image : public Fl_Image {
-  friend class Fl_Quartz_Graphics_Driver;
-  friend class Fl_GDI_Graphics_Driver;
-  friend class Fl_Xlib_Graphics_Driver;
-  static size_t max_size_;
-public:
-
-  const uchar *array;
-  int alloc_array; // Non-zero if array was allocated
-
-  private:
-
-#if defined(__APPLE__) || defined(WIN32)
-  void *id_; // for internal use
-  void *mask_; // for internal use (mask bitmap)
-#else
-  unsigned id_; // for internal use
-  unsigned mask_; // for internal use (mask bitmap)
-#endif // __APPLE__ || WIN32
-
-  public:
-
-/**
-  The constructor creates a new image from the specified data.
-  \param[in] bits   The image data array.
-  \param[in] W      The width of the image in pixels
-  \param[in] H      The height of the image in pixels
-  \param[in] D      The image depth, or 'number of channels'. Default=3<br>
-                    If D=1, each uchar in bits[] is a grayscale pixel value.<br>
-		    If D=2, each uchar pair in bits[] is a grayscale + alpha pixel value.<br>
-		    If D=3, each uchar triplet in bits[] is an R/G/B pixel value<br>
-		    If D=4, each uchar quad in bits[] is an R/G/B/A pixel value.
-  \param[in] LD     Line data size (default=0).<br>
-                    Line data is extra data that is included after each line
-		    of color image data and is normally not present. 
-  \see Fl_Image::data(), Fl_Image::w(), Fl_Image::h(), Fl_Image::d(), Fl_Image::ld()
-  */
-  Fl_RGB_Image(const uchar *bits, int W, int H, int D=3, int LD=0) :
-    Fl_Image(W,H,D), array(bits), alloc_array(0), id_(0), mask_(0) {data((const char **)&array, 1); ld(LD);}
+class Fl_Pixmap;
+struct Fl_Menu_Item;
+struct Fl_Label;
+class Fl_RGB_Image;
+
+
+/** \enum Fl_RGB_Scaling
+ The scaling algorithm to use for RGB images.
+*/
+enum Fl_RGB_Scaling {
+  FL_RGB_SCALING_NEAREST = 0, ///< default RGB image scaling algorithm
+  FL_RGB_SCALING_BILINEAR     ///< more accurate, but slower RGB image scaling algorithm
+};
+
+
+/**
+ \brief Base class for image caching and drawing.
+ 
+ Fl_Image is the base class used for caching and drawing all kinds of images 
+ in FLTK. This class keeps track of common image data such as the pixels, 
+ colormap, width, height, and depth. Virtual methods are used to provide 
+ type-specific image handling.
+  
+ Since the Fl_Image class does not support image
+ drawing by itself, calling the draw() method results in
+ a box with an X in it being drawn instead.
+*/
+class FL_EXPORT Fl_Image {
+  friend class Fl_Graphics_Driver;
+public:
+  static const int ERR_NO_IMAGE    = -1;
+  static const int ERR_FILE_ACCESS = -2;
+  static const int ERR_FORMAT      = -3;
+    
+private:
+  int w_, h_, d_, ld_, count_;
+  const char * const *data_;
+  static Fl_RGB_Scaling RGB_scaling_;
+
+  // Forbid use of copy constructor and assign operator
+  Fl_Image & operator=(const Fl_Image &);
+  Fl_Image(const Fl_Image &);
+
+protected:
+
+  /**
+   Sets the current image width in pixels.
+   */
+  void w(int W) {w_ = W;}
+  /**
+   Sets the current image height in pixels.
+   */
+  void h(int H) {h_ = H;}
+  /**
+   Sets the current image depth.
+   */
+  void d(int D) {d_ = D;}
+  /**
+   Sets the current line data size in bytes.
+
+   Color images may contain extra data that is included after every
+   line of color image data and is normally not present.
+
+   If \p LD is zero, then line data size is assumed to be w() * d() bytes.
+
+   If \p LD is non-zero, then it must be positive and larger than w() * d()
+   to account for the extra data per line.
+   */
+  void ld(int LD) {ld_ = LD;}
+  /** 
+   Sets the current array pointer and count of pointers in the array.
+   */
+  void data(const char * const *p, int c) {data_ = p; count_ = c;}
+  void draw_empty(int X, int Y);
+
+  static void labeltype(const Fl_Label *lo, int lx, int ly, int lw, int lh, Fl_Align la);
+  static void measure(const Fl_Label *lo, int &lw, int &lh);
+  virtual int draw_scaled(int X, int Y, int W, int H);
+
+public:
+
+  /** 
+   Returns the current image width in pixels.
+   */
+  int w() const {return w_;}
+  /**
+   Returns the current image height in pixels.
+   */
+  int h() const {return h_;}
+  /**
+   Returns the current image depth.
+   The return value will be 0 for bitmaps, 1 for
+   pixmaps, and 1 to 4 for color images.</P>
+   */
+  int d() const {return d_;}
+  /**
+   Returns the current line data size in bytes.
+   \see ld(int)
+   */
+  int ld() const {return ld_;}
+  /**
+   The count() method returns the number of data values
+   associated with the image. The value will be 0 for images with
+   no associated data, 1 for bitmap and color images, and greater
+   than 2 for pixmap images.
+   */
+  int count() const {return count_;}
+  /**
+   Returns a pointer to the current image data array.
+   Use the count() method to find the size of the data array.
+   */
+  const char * const *data() const {return data_;}
+  int fail();
+  Fl_Image(int W, int H, int D);
+  virtual ~Fl_Image();
+  virtual Fl_Image *copy(int W, int H);
+  /**
+   The copy() method creates a copy of the specified
+   image. If the width and height are provided, the image is
+   resized to the specified size. The image should be deleted (or in
+   the case of Fl_Shared_Image, released) when you are done
+   with it.
+   */
+  Fl_Image *copy() { return copy(w(), h()); }
+  virtual void color_average(Fl_Color c, float i);
+  /**
+   The inactive() method calls
+   color_average(FL_BACKGROUND_COLOR, 0.33f) to produce
+   an image that appears grayed out.
+
+   An internal copy is made of the original image before
+   changes are applied, to avoid modifying the original image.
+   */
+  void inactive() { color_average(FL_GRAY, .33f); }
+  virtual void desaturate();
+  virtual void label(Fl_Widget*w);
+  virtual void label(Fl_Menu_Item*m);
+  /**
+   Draws the image to the current drawing surface with a bounding box.
+   Arguments <tt>X,Y,W,H</tt> specify
+   a bounding box for the image, with the origin        
+   (upper-left corner) of the image offset by the \c cx
+   and \c cy arguments.
+   
+   In other words:  <tt>fl_push_clip(X,Y,W,H)</tt> is applied,
+   the image is drawn with its upper-left corner at <tt>X-cx,Y-cy</tt> and its own width and height,
+   <tt>fl_pop_clip</tt><tt>()</tt> is applied.
+   */
+  virtual void draw(int X, int Y, int W, int H, int cx=0, int cy=0); // platform dependent
+  /**
+   Draws the image to the current drawing surface.
+   \param X, Y specify the upper-lefthand corner of the image.
+   */
+  void draw(int X, int Y) {draw(X, Y, w(), h(), 0, 0);} // platform dependent
+  virtual void uncache();
+
+  // used by fl_define_FL_IMAGE_LABEL() to avoid 'friend' declaration
+  static Fl_Labeltype define_FL_IMAGE_LABEL();
+
+  // set RGB image scaling method
+  static void RGB_scaling(Fl_RGB_Scaling);
+
+  // get RGB image scaling method
+  static Fl_RGB_Scaling RGB_scaling();
+  /** Use this method if you have an Fl_Image object and want to know whether it is derived 
+   from class Fl_RGB_Image. 
+   If the method returns non-NULL, then the image in question is
+   derived from Fl_RGB_Image, and the returned value is a pointer to this image.
+   */
+  virtual Fl_RGB_Image *as_rgb_image() {return NULL;}
+
+DECLARE_CLASS_CHEAP_RTTI_1(Fl_Image)
+};
+
+
+/**
+  The Fl_RGB_Image class supports caching and drawing
+  of full-color images with 1 to 4 channels of color information.
+  Images with an even number of channels are assumed to contain
+  alpha information, which is used to blend the image with the
+  contents of the screen.
+
+  Fl_RGB_Image is defined in
+  &lt;FL/Fl_Image.H&gt;, however for compatibility reasons
+  &lt;FL/Fl_RGB_Image.H&gt; should be included.
+*/
+class FL_EXPORT Fl_RGB_Image : public Fl_Image {
+  friend class Fl_Graphics_Driver;
+  static size_t max_size_;
+public:
+
+  /** Points to the start of the object's data array
+   */
+  const uchar *array;
+  /** If non-zero, the object's data array is delete[]'d when deleting the object.
+   */
+  int alloc_array;
+
+private:
+  // These two variables are used to cache the image and mask for the main display graphics driver
+  fl_uintptr_t id_;
+  fl_uintptr_t mask_;
+  float cache_scale_; // graphics scaling value when id_ was computed
+  
+protected:
+  virtual int draw_scaled(int X, int Y, int W, int H);
+
+public:
+
+  Fl_RGB_Image(const uchar *bits, int W, int H, int D=3, int LD=0);
   Fl_RGB_Image(const Fl_Pixmap *pxm, Fl_Color bg=FL_GRAY);
-  virtual ~Fl_RGB_Image();
-  virtual Fl_Image *copy(int W, int H);
-  Fl_Image *copy() { return copy(w(), h()); }
-  virtual void color_average(Fl_Color c, float i);
-  virtual void desaturate();
-  virtual void draw(int X, int Y, int W, int H, int cx=0, int cy=0);
-  void draw(int X, int Y) {draw(X, Y, w(), h(), 0, 0);}
-  virtual void label(Fl_Widget*w);
-  virtual void label(Fl_Menu_Item*m);
-  virtual void uncache();
-  /** Sets the maximum allowed image size in bytes when creating an Fl_RGB_Image object.
-
-   The image size in bytes of an Fl_RGB_Image object is the value of the product w() * h() * d().
-   If this product exceeds size, the created object of a derived class of Fl_RGB_Image 
-   won't be loaded with the image data.
-   This does not apply to direct RGB image creation with 
-   Fl_RGB_Image::Fl_RGB_Image(const uchar *bits, int W, int H, int D, int LD).
-   The default max_size() value is essentially infinite. 
-   */
-  static void max_size(size_t size) { max_size_ = size;}
-  /** Returns the maximum allowed image size in bytes when creating an Fl_RGB_Image object.
-   
-   \sa  void Fl_RGB_Image::max_size(size_t)
-   */
-  static size_t max_size() {return max_size_;}
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_RGB_Image, Fl_Image)
-};
-
-#endif // !Fl_Image_H
-
-//
-// End of "$Id: Fl_Image.H 10192 2014-06-12 13:28:04Z ossman $".
-//
+  virtual ~Fl_RGB_Image();
+  virtual Fl_Image *copy(int W, int H);
+  Fl_Image *copy() { return copy(w(), h()); }
+  virtual void color_average(Fl_Color c, float i);
+  virtual void desaturate();
+  virtual void draw(int X, int Y, int W, int H, int cx=0, int cy=0);
+  void draw(int X, int Y) {draw(X, Y, w(), h(), 0, 0);}
+  virtual void label(Fl_Widget*w);
+  virtual void label(Fl_Menu_Item*m);
+  virtual void uncache();
+  /** Sets the maximum allowed image size in bytes when creating an Fl_RGB_Image object.
+   
+   The image size in bytes of an Fl_RGB_Image object is the value of the product w() * h() * d().
+   If this product exceeds size, the created object of a derived class of Fl_RGB_Image 
+   won't be loaded with the image data.
+   This does not apply to direct RGB image creation with 
+   Fl_RGB_Image::Fl_RGB_Image(const uchar *bits, int W, int H, int D, int LD).
+   The default max_size() value is essentially infinite. 
+   */
+  static void max_size(size_t size) { max_size_ = size;}
+  /** Returns the maximum allowed image size in bytes when creating an Fl_RGB_Image object.
+   
+   \sa  void Fl_RGB_Image::max_size(size_t)
+   */
+  static size_t max_size() {return max_size_;}
+  virtual Fl_RGB_Image *as_rgb_image() {return this;}
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_RGB_Image, Fl_Image)
+};
+
+#endif // !Fl_Image_H
+
+//
+// End of "$Id: Fl_Image.H 12443 2017-09-11 18:54:10Z AlbrechtS $".
+//

+ 80 - 51
fltk/FL/Fl_Image_Surface.H

@@ -1,9 +1,9 @@
 //
-// "$Id: Fl_Image_Surface.H 10172 2014-05-24 16:21:46Z manolo $"
+// "$Id: Fl_Image_Surface.H 12125 2016-11-30 07:09:48Z manolo $"
 //
 // Draw-to-image code for the Fast Light Tool Kit (FLTK).
 //
-// Copyright 1998-2014 by Bill Spitzak and others.
+// Copyright 1998-2016 by Bill Spitzak and others.
 //
 // This library is free software. Distribution and use rights are outlined in
 // the file "COPYING" which should have been included with this file.  If this
@@ -19,72 +19,101 @@
 #ifndef Fl_Image_Surface_H
 #define Fl_Image_Surface_H
 
-#include <FL/Fl_Copy_Surface.H>
+#include <FL/Fl_Widget_Surface.H>
 #include <FL/Fl_Image.H>
+#include <FL/Fl_Shared_Image.H>
+#include <FL/Fl_Graphics_Driver.H> // for Fl_Offscreen
 
 
-/** Directs all graphics requests to an Fl_Image.
+/** 
+ \brief Directs all graphics requests to an Fl_Image.
  
- After creation of an Fl_Image_Surface object, call set_current() on it, and all subsequent graphics requests
- will be recorded in the image. It's possible to draw widgets (using Fl_Image_Surface::draw()) 
- or to use any of the \ref fl_drawings or the \ref fl_attributes.
- Finally, call image() on the object to obtain a newly allocated Fl_Image object.
- <br> Fl_GL_Window objects can be drawn in the image as well. 
+ After creation of an Fl_Image_Surface object, call set_current() on it, and all
+ subsequent graphics requests will be recorded in the image. It's possible to 
+ draw widgets (using Fl_Image_Surface::draw()) or to use any of the 
+ \ref fl_drawings or the \ref fl_attributes. Finally, call image() on the object
+ to obtain a newly allocated Fl_RGB_Image object.
+ Fl_GL_Window objects can be drawn in the image as well.
  
- <br> Usage example:
+ Usage example:
  \code
- Fl_Widget *g = ...; // a widget you want to draw in an image
- Fl_Image_Surface *img_surf = new Fl_Image_Surface(g->w(), g->h()); // create an Fl_Image_Surface object
- img_surf->set_current(); // direct graphics requests to the image
- fl_color(FL_WHITE); fl_rectf(0, 0, g->w(), g->h()); // draw a white background
- img_surf->draw(g); // draw the g widget in the image
- Fl_Image* image = img_surf->image(); // get the resulting image
- delete img_surf; // delete the img_surf object
- Fl_Display_Device::display_device()->set_current();  // direct graphics requests back to the display
+ // this is the widget that you want to draw into an image
+ Fl_Widget *g = ...;
+
+ // create an Fl_Image_Surface object
+ Fl_Image_Surface *image_surface = new Fl_Image_Surface(g->w(), g->h());
+ 
+ // direct all further graphics requests to the image
+ image_surface->set_current();
+
+ // draw a white background
+ fl_color(FL_WHITE); 
+ fl_rectf(0, 0, g->w(), g->h());
+
+ // draw the g widget in the image
+ image_surface->draw(g);
+
+ // get the resulting image
+ Fl_RGB_Image* image = image_surface->image();
+ 
+ // delete the image_surface object, but not the image itself
+ delete image_surface;
+
+ // direct graphics requests back to the screen
+ Fl_Display_Device::display_device()->set_current();
  \endcode
 */
-class Fl_Image_Surface : public Fl_Surface_Device {
+class FL_EXPORT Fl_Image_Surface : public Fl_Widget_Surface {
+  friend FL_EXPORT Fl_Offscreen fl_create_offscreen(int w, int h);
+  friend FL_EXPORT void fl_begin_offscreen(Fl_Offscreen ctx);
+  friend FL_EXPORT void fl_end_offscreen(void);
+  friend FL_EXPORT void fl_delete_offscreen(Fl_Offscreen ctx);
 private:
-  Fl_Offscreen offscreen;
-  int width;
-  int height;
-  Fl_Paged_Device *helper;
-#ifdef __APPLE__
-#elif defined(WIN32)
-  HDC _sgc; 
-  Window _sw; 
-  Fl_Surface_Device *_ss;
-  int _savedc;
-#else
-  Fl_Surface_Device *previous;
-  Window pre_window;
-  GC gc;
-#endif
+  class Fl_Image_Surface_Driver *platform_surface;
+protected:
+  void translate(int x, int y);
+  void untranslate();
 public:
-  static const char *class_id;
-  const char *class_name() {return class_id;};
-  Fl_Image_Surface(int w, int h);
+  Fl_Image_Surface(int w, int h, int high_res = 0, Fl_Offscreen off = 0);
   ~Fl_Image_Surface();
   void set_current();
-  void draw(Fl_Widget*, int delta_x = 0, int delta_y = 0);
-  Fl_Image *image();
+  Fl_RGB_Image *image();
+  Fl_Shared_Image *highres_image();
+  void origin(int *x, int *y);
+  void origin(int x, int y);
+  int printable_rect(int *w, int *h);
+  Fl_Offscreen get_offscreen_before_delete();
+  Fl_Offscreen offscreen();
 };
 
-#ifdef __APPLE__
-/* Mac class to implement translate()/untranslate() for a flipped bitmap graphics context */
-class Fl_Quartz_Flipped_Surface_ : public Fl_Quartz_Surface_ {
-public:
-  static const char *class_id;
-  const char *class_name() {return class_id;};
-  Fl_Quartz_Flipped_Surface_(int w, int h);
-  void translate(int x, int y);
-  void untranslate();
-  virtual ~Fl_Quartz_Flipped_Surface_() {};
+
+/** A base class describing the interface between FLTK and draw-to-image operations.
+ This class is only for internal use by the FLTK library.
+ A supported platform should implement the virtual methods of this class
+ in order to support drawing to an Fl_RGB_Image through class Fl_Image_Surface.
+ */
+class Fl_Image_Surface_Driver : public Fl_Widget_Surface {
+  friend class Fl_Image_Surface;
+protected:
+  int width;
+  int height;
+  Fl_Offscreen offscreen;
+  Fl_Image_Surface_Driver(int w, int h, int high_res, Fl_Offscreen off) : Fl_Widget_Surface(NULL), width(w), height(h), offscreen(off) {}
+  virtual ~Fl_Image_Surface_Driver() {}
+  virtual void set_current() {}
+  virtual void translate(int x, int y) {}
+  virtual void untranslate() {}
+  int printable_rect(int *w, int *h) {*w = width; *h = height; return 0;}
+  virtual Fl_RGB_Image *image() {return NULL;}
+  /** Each platform implements this function its own way.
+   It returns an object implementing all virtual functions
+   of class Fl_Image_Surface_Driver for the plaform.
+   */
+  static Fl_Image_Surface_Driver *newImageSurfaceDriver(int w, int h, int high_res, Fl_Offscreen off);
 };
-#endif 
 
 #endif // Fl_Image_Surface_H
 
 //
-// End of "$Id: Fl_Image_Surface.H 10172 2014-05-24 16:21:46Z manolo $".
+// End of "$Id: Fl_Image_Surface.H 12125 2016-11-30 07:09:48Z manolo $".
 //

+ 292 - 290
fltk/FL/Fl_Input.H

@@ -1,290 +1,292 @@
-//
-// "$Id: Fl_Input.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
-//
-// Input header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_Input widget . */
-
-#ifndef Fl_Input_H
-#define Fl_Input_H
-
-#include "Fl_Input_.H"
-
-/**
-  This is the FLTK text input widget. It displays a single line
-  of text and lets the user edit it. Normally it is drawn with an
-  inset box and a white background. The text may contain any
-  characters, and will correctly display any UTF text, using
-  ^X notation for unprintable control characters. It assumes the
-  font can draw any characters of the used scripts, which is true
-  for standard fonts under MSWindows and Mac OS X.
-  Characters can be input using the keyboard or the character palette/map.
-  Character composition is done using dead keys and/or a compose
-  key as defined by the operating system.
-  <P>
-  <TABLE WIDTH=90% BORDER=1 SUMMARY="Fl_Input keyboard and mouse bindings.">
-    <CAPTION ALIGN=TOP>Fl_Input keyboard and mouse bindings.</CAPTION>
-    <TR><TD NOWRAP="NOWRAP" WIDTH="1%">
-      <B>Mouse button 1</B>
-    </TD><TD>
-      Moves the cursor to this point.
-      Drag selects characters.
-      Double click selects words.
-      Triple click selects all line.
-      Shift+click extends the selection.
-      When you select text it is automatically copied to the selection buffer.
-    </TD></TR><TR><TD NOWRAP="NOWRAP">
-      <B>Mouse button 2</B>
-    </TD><TD>
-      Insert the selection buffer at the point clicked.
-      You can also select a region and replace it with the selection buffer
-      by selecting the region with mouse button 2.
-    </TD></TR><TR><TD NOWRAP="NOWRAP">
-      <B>Mouse button 3</B>
-    </TD><TD>
-      Currently acts like button 1.
-    </TD></TR><TR><TD NOWRAP="NOWRAP">
-      <B>Backspace</B>
-    </TD><TD>
-      Deletes one character to the left, or deletes the selected region.
-    </TD></TR><TR><TD NOWRAP="NOWRAP">
-      <B>Delete</B>
-    </TD><TD>
-      Deletes one character to the right, or deletes the selected region.
-      Combine with Shift for equivalent of ^X (copy+cut).
-    </TD></TR><TR><TD NOWRAP="NOWRAP">
-      <B>Enter</b>
-    </TD><TD>
-      May cause the callback, see when().
-  </TD></TR></TABLE>
-
-  <P>
-
-  <TABLE WIDTH="90%" BORDER="1" SUMMARY="Fl_Input platform specific keyboard bindings.">
-    <CAPTION ALIGN=TOP>Fl_Input platform specific keyboard bindings.</CAPTION>
-  <TR>
-    <TD NOWRAP="NOWRAP" WIDTH="1%"><B> Windows/Linux </B></TD>
-    <TD NOWRAP="NOWRAP" WIDTH="1%"><B> Mac </B></TD>
-    <TD NOWRAP="NOWRAP"           ><B> Function </B></TD>
-
-  </TR><TR>
-    <TD NOWRAP="NOWRAP"><B> ^A </B></TD>
-    <TD NOWRAP="NOWRAP"><B> Command-A </B></TD>
-    <TD>
-      <B>Selects all text in the widget.</B>
-
-  </TD></TR><TR>
-    <TD NOWRAP="NOWRAP"><B> ^C </B></TD>
-    <TD NOWRAP="NOWRAP"><B> Command-C </B></TD>
-    <TD>
-      <B>Copy the current selection to the clipboard.</B>
-
-  </TD></TR><TR>
-    <TD NOWRAP="NOWRAP"><B> ^I </B></TD>
-    <TD NOWRAP="NOWRAP"><B> ^I </B></TD>
-    <TD>
-      <B>Insert a tab.</B>
-
-  </TD></TR><TR>
-    <TD NOWRAP="NOWRAP"><B> ^J </B></TD>
-    <TD NOWRAP="NOWRAP"><B> ^J </B></TD>
-    <TD>
-      <B>Insert a Line Feed.</B> <BR>
-      (Similar to literal 'Enter' character)
-
-  </TD></TR><TR>
-    <TD NOWRAP="NOWRAP"><B> ^L </B></TD>
-    <TD NOWRAP="NOWRAP"><B> ^L </B></TD>
-    <TD>
-      <B>Insert a Form Feed.</B>
-
-  </TD></TR><TR>
-    <TD NOWRAP="NOWRAP"><B> ^M </B></TD>
-    <TD NOWRAP="NOWRAP"><B> ^M </B></TD>
-    <TD>
-      <B>Insert a Carriage Return.</B>
-
-  </TD></TR><TR>
-    <TD NOWRAP="NOWRAP"><B> ^V,<BR>Shift-Insert </B></TD>
-    <TD NOWRAP="NOWRAP"><B> Command-V </B></TD>
-    <TD>
-      <B>Paste the clipboard.</B> <BR>
-      (Macs keyboards don't have "Insert" keys,
-      but if they did, Shift-Insert would work)
-
-  </TD></TR><TR>
-    <TD NOWRAP="NOWRAP"><B> ^X,<BR>Shift-Delete </B></TD>
-    <TD NOWRAP="NOWRAP"><B> Command-X,<BR>Shift-Delete </B></TD>
-    <TD>
-      <B>Cut.</B> <BR>
-      Copy the selection to the clipboard and delete it.
-      (If there's no selection, Shift-Delete acts like Delete)
-
-  </TD></TR><TR>
-    <TD NOWRAP="NOWRAP"><B> ^Z </B></TD>
-    <TD NOWRAP="NOWRAP"><B> Command-Z </B></TD>
-    <TD>
-      <B>Undo.</B> <BR>
-      This is a single-level undo mechanism, but all adjacent
-      deletions and insertions are concatenated into a single "undo".
-      Often this will undo a lot more than you expected.
-
-  </TD></TR><TR>
-    <TD NOWRAP="NOWRAP"><B> Shift-^Z </B></TD>
-    <TD NOWRAP="NOWRAP"><B> Shift-Command-Z </B></TD>
-    <TD>
-      <B>Redo.</B> <BR>
-      Currently same behavior as ^Z.
-      Reserved for future multilevel undo/redo.
-
-  </TD></TR><TR>
-    <TD NOWRAP="NOWRAP"><B> Arrow Keys </B></TD>
-    <TD NOWRAP="NOWRAP"><B> Arrow Keys </B></TD>
-    <TD>
-      <B>Standard cursor movement.</B> <BR>
-      Can be combined with Shift to extend selection.
-
-  </TD></TR><TR>
-    <TD NOWRAP="NOWRAP"><B> Home </B></TD>
-    <TD NOWRAP="NOWRAP"><B> Command-Up,<BR>Command-Left </B></TD>
-    <TD>
-      <B>Move to start of line.</B> <BR>
-      Can be combined with Shift to extend selection.
-
-  </TD></TR><TR>
-    <TD NOWRAP="NOWRAP"><B> End </B></TD>
-    <TD NOWRAP="NOWRAP"><B> Command-Down,<BR>Command-Right </B></TD>
-    <TD>
-      <B>Move to end of line.</B> <BR>
-      Can be combined with Shift to extend selection.
-
-  </TD></TR><TR>
-    <TD NOWRAP="NOWRAP"><B>Ctrl-Home</B></TD>
-    <TD NOWRAP="NOWRAP"><B>Command-Up,<BR>Command-PgUp,<BR>Ctrl-Left</B></TD>
-    <TD>
-      <B>Move to top of document/field.</B> <BR>
-      In single line input, moves to start of line.
-      In multiline input, moves to start of top line.
-      Can be combined with Shift to extend selection.
-
-  </TD></TR><TR>
-    <TD NOWRAP="NOWRAP"><B> Ctrl-End </B></TD>
-    <TD NOWRAP="NOWRAP"><B> Command-End,<BR>Command-PgDn,<BR>Ctrl-Right</B></TD>
-    <TD>
-      <B>Move to bottom of document/field.</B> <BR>
-      In single line input, moves to end of line.
-      In multiline input, moves to end of last line.
-      Can be combined with Shift to extend selection.
-
-  </TD></TR><TR>
-    <TD NOWRAP="NOWRAP"><B> Ctrl-Left </B></TD>
-    <TD NOWRAP="NOWRAP"><B> Alt-Left </B></TD>
-    <TD>
-      <B>Word left.</B> <BR>
-      Can be combined with Shift to extend selection.
-
-  </TD></TR><TR>
-    <TD NOWRAP="NOWRAP"><B> Ctrl-Right </B></TD>
-    <TD NOWRAP="NOWRAP"><B> Alt-Right </B></TD>
-    <TD>
-      <B>Word right.</B> <BR>
-      Can be combined with Shift to extend selection.
-
-  </TD></TR><TR>
-    <TD NOWRAP="NOWRAP"><B> Ctrl-Backspace </B></TD>
-    <TD NOWRAP="NOWRAP"><B> Alt-Backspace </B></TD>
-    <TD>
-      <B>Delete word left.</B>
-
-  </TD></TR><TR>
-    <TD NOWRAP="NOWRAP"><B> Ctrl-Delete </B></TD>
-    <TD NOWRAP="NOWRAP"><B> Alt-Delete </B></TD>
-    <TD>
-      <B>Delete word right.</B>
-
-  </TD></TR></TABLE>
-  */
-class FL_EXPORT Fl_Input : public Fl_Input_ {
-  int handle_key();
-  int shift_position(int p);
-  int shift_up_down_position(int p);
-  void handle_mouse(int keepmark=0);
-
-  // Private keyboard functions
-  int kf_lines_up(int repeat_num);
-  int kf_lines_down(int repeat_num);
-  int kf_page_up();
-  int kf_page_down();
-  int kf_insert_toggle();
-  int kf_delete_word_right();
-  int kf_delete_word_left();
-  int kf_delete_sol();
-  int kf_delete_eol();
-  int kf_delete_char_right();
-  int kf_delete_char_left();
-  int kf_move_sol();
-  int kf_move_eol();
-  int kf_clear_eol();
-  int kf_move_char_left();
-  int kf_move_char_right();
-  int kf_move_word_left();
-  int kf_move_word_right();
-  int kf_move_up_and_sol();
-  int kf_move_down_and_eol();
-  int kf_top();
-  int kf_bottom();
-  int kf_select_all();
-  int kf_undo();
-  int kf_redo();
-  int kf_copy();
-  int kf_paste();
-  int kf_copy_cut();
-
-protected:
-  void draw();
-  /*[0] = decimal_places, [1] = decimal_separator, [2] = thousands_separator*/
-  static char default_number_format_[4];
-  char *number_format_;
-public:
-  int handle(int);
-  Fl_Input(int,int,int,int,const char * = 0);
-  ~Fl_Input();
-  int right_to_left() {return flags() & NUMERIC_RIGHT_TO_LEFT;};
-  void right_to_left(int bool_right_to_left) {
-        bool_right_to_left ? set_flag(NUMERIC_RIGHT_TO_LEFT) :
-            clear_flag(NUMERIC_RIGHT_TO_LEFT);
-        };
-  int use_numeric_format() {return flags() & USE_NUMERIC_FORMAT;};
-  void use_numeric_format(int bool_numeric_format) {
-        bool_numeric_format ? set_flag(USE_NUMERIC_FORMAT) :
-            clear_flag(USE_NUMERIC_FORMAT);
-        };
-  static const char *default_number_format();
-  static void default_number_format(const char *format);
-  const char *number_format() {return number_format_;};
-  void number_format(const char *format);
-  int decimal_places();
-  void decimal_places(int count);
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_Input, Fl_Input_)
-};
-
-#endif
-
-//
-// End of "$Id: Fl_Input.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
-//
+//
+// "$Id: Fl_Input.H 11544 2016-04-06 19:39:15Z manolo $"
+//
+// Input header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2010 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_Input widget . */
+
+#ifndef Fl_Input_H
+#define Fl_Input_H
+
+#include "Fl_Input_.H"
+
+/**
+  This is the FLTK text input widget. It displays a single line
+  of text and lets the user edit it. Normally it is drawn with an
+  inset box and a white background. The text may contain any
+  characters, and will correctly display any UTF text, using
+  ^X notation for unprintable control characters. It assumes the
+  font can draw any characters of the used scripts, which is true
+  for standard fonts under MSWindows and Mac OS X.
+  Characters can be input using the keyboard or the character palette/map.
+  Character composition is done using dead keys and/or a compose
+  key as defined by the operating system.
+  <P>
+  <TABLE WIDTH=90% BORDER=1 SUMMARY="Fl_Input keyboard and mouse bindings.">
+    <CAPTION ALIGN=TOP>Fl_Input keyboard and mouse bindings.</CAPTION>
+    <TR><TD NOWRAP="NOWRAP" WIDTH="1%">
+      <B>Mouse button 1</B> 
+    </TD><TD>
+      Moves the cursor to this point. 
+      Drag selects characters. 
+      Double click selects words. 
+      Triple click selects all line.
+      Shift+click extends the selection.
+      When you select text it is automatically copied to the selection buffer.
+    </TD></TR><TR><TD NOWRAP="NOWRAP">
+      <B>Mouse button 2</B> 
+    </TD><TD>
+      Insert the selection buffer at the point clicked.
+      You can also select a region and replace it with the selection buffer
+      by selecting the region with mouse button 2.
+    </TD></TR><TR><TD NOWRAP="NOWRAP">
+      <B>Mouse button 3</B>
+    </TD><TD>
+      Currently acts like button 1.
+    </TD></TR><TR><TD NOWRAP="NOWRAP">
+      <B>Backspace</B>
+    </TD><TD>
+      Deletes one character to the left, or deletes the selected region.
+    </TD></TR><TR><TD NOWRAP="NOWRAP">
+      <B>Delete</B>
+    </TD><TD>
+      Deletes one character to the right, or deletes the selected region.
+      Combine with Shift for equivalent of ^X (copy+cut).
+    </TD></TR><TR><TD NOWRAP="NOWRAP">
+      <B>Enter</b>
+    </TD><TD>
+      May cause the callback, see when().
+  </TD></TR></TABLE>
+
+  <P>
+
+  <TABLE WIDTH="90%" BORDER="1" SUMMARY="Fl_Input platform specific keyboard bindings.">
+    <CAPTION ALIGN=TOP>Fl_Input platform specific keyboard bindings.</CAPTION>
+  <TR>
+    <TD NOWRAP="NOWRAP" WIDTH="1%"><B> Windows/Linux </B></TD>
+    <TD NOWRAP="NOWRAP" WIDTH="1%"><B> Mac </B></TD>
+    <TD NOWRAP="NOWRAP"           ><B> Function </B></TD>
+
+  </TR><TR>
+    <TD NOWRAP="NOWRAP"><B> ^A </B></TD>
+    <TD NOWRAP="NOWRAP"><B> Command-A </B></TD>
+    <TD>
+      <B>Selects all text in the widget.</B>
+
+  </TD></TR><TR>
+    <TD NOWRAP="NOWRAP"><B> ^C </B></TD>
+    <TD NOWRAP="NOWRAP"><B> Command-C </B></TD>
+    <TD>
+      <B>Copy the current selection to the clipboard.</B>
+
+  </TD></TR><TR>
+    <TD NOWRAP="NOWRAP"><B> ^I </B></TD>
+    <TD NOWRAP="NOWRAP"><B> ^I </B></TD>
+    <TD>
+      <B>Insert a tab.</B>
+
+  </TD></TR><TR>
+    <TD NOWRAP="NOWRAP"><B> ^J </B></TD>
+    <TD NOWRAP="NOWRAP"><B> ^J </B></TD>
+    <TD>
+      <B>Insert a Line Feed.</B> <BR>
+      (Similar to literal 'Enter' character)
+
+  </TD></TR><TR>
+    <TD NOWRAP="NOWRAP"><B> ^L </B></TD>
+    <TD NOWRAP="NOWRAP"><B> ^L </B></TD>
+    <TD>
+      <B>Insert a Form Feed.</B>
+
+  </TD></TR><TR>
+    <TD NOWRAP="NOWRAP"><B> ^M </B></TD>
+    <TD NOWRAP="NOWRAP"><B> ^M </B></TD>
+    <TD>
+      <B>Insert a Carriage Return.</B>
+
+  </TD></TR><TR>
+    <TD NOWRAP="NOWRAP"><B> ^V,<BR>Shift-Insert </B></TD>
+    <TD NOWRAP="NOWRAP"><B> Command-V </B></TD>
+    <TD>
+      <B>Paste the clipboard.</B> <BR>
+      (Macs keyboards don't have "Insert" keys, 
+      but if they did, Shift-Insert would work)
+
+  </TD></TR><TR>
+    <TD NOWRAP="NOWRAP"><B> ^X,<BR>Shift-Delete </B></TD>
+    <TD NOWRAP="NOWRAP"><B> Command-X,<BR>Shift-Delete </B></TD>
+    <TD>
+      <B>Cut.</B> <BR>
+      Copy the selection to the clipboard and delete it.
+      (If there's no selection, Shift-Delete acts like Delete)
+
+  </TD></TR><TR>
+    <TD NOWRAP="NOWRAP"><B> ^Z </B></TD>
+    <TD NOWRAP="NOWRAP"><B> Command-Z </B></TD>
+    <TD>
+      <B>Undo.</B> <BR>
+      This is a single-level undo mechanism, but all adjacent 
+      deletions and insertions are concatenated into a single "undo".
+      Often this will undo a lot more than you expected. 
+
+  </TD></TR><TR>
+    <TD NOWRAP="NOWRAP"><B> Shift-^Z </B></TD>
+    <TD NOWRAP="NOWRAP"><B> Shift-Command-Z </B></TD>
+    <TD>
+      <B>Redo.</B> <BR>
+      Currently same behavior as ^Z. 
+      Reserved for future multilevel undo/redo.
+
+  </TD></TR><TR>
+    <TD NOWRAP="NOWRAP"><B> Arrow Keys </B></TD>
+    <TD NOWRAP="NOWRAP"><B> Arrow Keys </B></TD>
+    <TD>
+      <B>Standard cursor movement.</B> <BR>
+      Can be combined with Shift to extend selection.
+
+  </TD></TR><TR>
+    <TD NOWRAP="NOWRAP"><B> Home </B></TD>
+    <TD NOWRAP="NOWRAP"><B> Command-Up,<BR>Command-Left </B></TD>
+    <TD>
+      <B>Move to start of line.</B> <BR>
+      Can be combined with Shift to extend selection.
+
+  </TD></TR><TR>
+    <TD NOWRAP="NOWRAP"><B> End </B></TD>
+    <TD NOWRAP="NOWRAP"><B> Command-Down,<BR>Command-Right </B></TD>
+    <TD>
+      <B>Move to end of line.</B> <BR>
+      Can be combined with Shift to extend selection.
+
+  </TD></TR><TR>
+    <TD NOWRAP="NOWRAP"><B>Ctrl-Home</B></TD>
+    <TD NOWRAP="NOWRAP"><B>Command-Up,<BR>Command-PgUp,<BR>Ctrl-Left</B></TD>
+    <TD>
+      <B>Move to top of document/field.</B> <BR>
+      In single line input, moves to start of line.
+      In multiline input, moves to start of top line.
+      Can be combined with Shift to extend selection.
+
+  </TD></TR><TR>
+    <TD NOWRAP="NOWRAP"><B> Ctrl-End </B></TD>
+    <TD NOWRAP="NOWRAP"><B> Command-End,<BR>Command-PgDn,<BR>Ctrl-Right</B></TD>
+    <TD>
+      <B>Move to bottom of document/field.</B> <BR>
+      In single line input, moves to end of line.
+      In multiline input, moves to end of last line.
+      Can be combined with Shift to extend selection.
+
+  </TD></TR><TR>
+    <TD NOWRAP="NOWRAP"><B> Ctrl-Left </B></TD>
+    <TD NOWRAP="NOWRAP"><B> Alt-Left </B></TD>
+    <TD>
+      <B>Word left.</B> <BR>
+      Can be combined with Shift to extend selection.
+
+  </TD></TR><TR>
+    <TD NOWRAP="NOWRAP"><B> Ctrl-Right </B></TD>
+    <TD NOWRAP="NOWRAP"><B> Alt-Right </B></TD>
+    <TD>
+      <B>Word right.</B> <BR>
+      Can be combined with Shift to extend selection.
+
+  </TD></TR><TR>
+    <TD NOWRAP="NOWRAP"><B> Ctrl-Backspace </B></TD>
+    <TD NOWRAP="NOWRAP"><B> Alt-Backspace </B></TD>
+    <TD>
+      <B>Delete word left.</B>
+
+  </TD></TR><TR>
+    <TD NOWRAP="NOWRAP"><B> Ctrl-Delete </B></TD>
+    <TD NOWRAP="NOWRAP"><B> Alt-Delete </B></TD>
+    <TD>
+      <B>Delete word right.</B>
+
+  </TD></TR></TABLE>
+  */
+class FL_EXPORT Fl_Input : public Fl_Input_ {
+  friend class Fl_Screen_Driver;
+  friend class Fl_Cocoa_Screen_Driver; // Not ideal, but probably no other platform will use it
+  int handle_key();
+  int shift_position(int p);
+  int shift_up_down_position(int p);
+  void handle_mouse(int keepmark=0);
+
+  // Private keyboard functions
+  int kf_lines_up(int repeat_num);
+  int kf_lines_down(int repeat_num);
+  int kf_page_up();
+  int kf_page_down();
+  int kf_insert_toggle();
+  int kf_delete_word_right();
+  int kf_delete_word_left();
+  int kf_delete_sol();
+  int kf_delete_eol();
+  int kf_delete_char_right();
+  int kf_delete_char_left();
+  int kf_move_sol();
+  int kf_move_eol();
+  int kf_clear_eol();
+  int kf_move_char_left();
+  int kf_move_char_right();
+  int kf_move_word_left();
+  int kf_move_word_right();
+  int kf_move_up_and_sol();
+  int kf_move_down_and_eol();
+  int kf_top();
+  int kf_bottom();
+  int kf_select_all();
+  int kf_undo();
+  int kf_redo();
+  int kf_copy();
+  int kf_paste();
+  int kf_copy_cut();
+
+protected:
+  void draw();
+  /*[0] = decimal_places, [1] = decimal_separator, [2] = thousands_separator*/
+  static char default_number_format_[4];
+  char *number_format_;
+public:
+  int handle(int);
+  Fl_Input(int,int,int,int,const char * = 0);
+  ~Fl_Input();
+  int right_to_left() {return flags() & NUMERIC_RIGHT_TO_LEFT;};
+  void right_to_left(int bool_right_to_left) {
+        bool_right_to_left ? set_flag(NUMERIC_RIGHT_TO_LEFT) :
+            clear_flag(NUMERIC_RIGHT_TO_LEFT);
+        };
+  int use_numeric_format() {return flags() & USE_NUMERIC_FORMAT;};
+  void use_numeric_format(int bool_numeric_format) {
+        bool_numeric_format ? set_flag(USE_NUMERIC_FORMAT) :
+            clear_flag(USE_NUMERIC_FORMAT);
+        };
+  static const char *default_number_format();
+  static void default_number_format(const char *format);
+  const char *number_format() {return number_format_;};
+  void number_format(const char *format);
+  int decimal_places();
+  void decimal_places(int count);
+
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_Input, Fl_Input_)
+};
+
+#endif 
+
+//
+// End of "$Id: Fl_Input.H 11544 2016-04-06 19:39:15Z manolo $".
+//

+ 506 - 506
fltk/FL/Fl_Input_.H

@@ -1,510 +1,510 @@
-//
-// "$Id: Fl_Input_.H 10134 2014-04-29 02:56:34Z greg.ercolano $"
-//
-// Input base class header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2011 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_Input_ widget . */
-
-#ifndef Fl_Input__H
-#define Fl_Input__H
-
-#ifndef Fl_Widget_H
-#include "Fl_Widget.H"
-#endif
-
-#define FL_NORMAL_INPUT		0
-#define FL_FLOAT_INPUT		1
-#define FL_INT_INPUT		2
-#define FL_HIDDEN_INPUT		3
-#define FL_MULTILINE_INPUT	4
-#define FL_SECRET_INPUT		5
-#define FL_INPUT_TYPE		7
-#define FL_INPUT_READONLY	8
-#define FL_NORMAL_OUTPUT	(FL_NORMAL_INPUT | FL_INPUT_READONLY)
-#define FL_MULTILINE_OUTPUT	(FL_MULTILINE_INPUT | FL_INPUT_READONLY)
-#define FL_INPUT_WRAP		16
-#define FL_MULTILINE_INPUT_WRAP	(FL_MULTILINE_INPUT | FL_INPUT_WRAP)
-#define FL_MULTILINE_OUTPUT_WRAP (FL_MULTILINE_INPUT | FL_INPUT_READONLY | FL_INPUT_WRAP)
-
-/**
-  This class provides a low-overhead text input field.
-
-  This is a virtual base class below Fl_Input. It has all
-  the same interfaces, but lacks the handle() and
-  draw() method. You may want to subclass it if you are
-  one of those people who likes to change how the editing keys
-  work. It may also be useful for adding scrollbars
-  to the input field.
-
-  This can act like any of the subclasses of Fl_Input, by
-  setting type() to one of the following values:
-
-  \code
-  #define FL_NORMAL_INPUT	   0
-  #define FL_FLOAT_INPUT	   1
-  #define FL_INT_INPUT		   2
-  #define FL_MULTILINE_INPUT	   4
-  #define FL_SECRET_INPUT	   5
-  #define FL_INPUT_TYPE		   7
-  #define FL_INPUT_READONLY	   8
-  #define FL_NORMAL_OUTPUT	   (FL_NORMAL_INPUT | FL_INPUT_READONLY)
-  #define FL_MULTILINE_OUTPUT	   (FL_MULTILINE_INPUT | FL_INPUT_READONLY)
-  #define FL_INPUT_WRAP		   16
-  #define FL_MULTILINE_INPUT_WRAP  (FL_MULTILINE_INPUT | FL_INPUT_WRAP)
-  #define FL_MULTILINE_OUTPUT_WRAP (FL_MULTILINE_INPUT | FL_INPUT_READONLY | FL_INPUT_WRAP)
-  \endcode
-
-  All variables that represent an index into a text buffer are byte-oriented,
-  not character oriented, counting from 0 (at or before the first character)
-  to size() (at the end of the buffer, after the last byte). Since UTF-8
-  characters can be up to six bytes long, simply incrementing such an index
-  will not reliably advance to the next character in the text buffer.
-
-  Indices and pointers into the text buffer should always point at a 7 bit ASCII
-  character or the beginning of a UTF-8 character sequence. Behavior for false
-  UTF-8 sequences and pointers into the middle of a sequence are undefined.
-
-  \see Fl_Text_Display, Fl_Text_Editor for more powerful text handling widgets
-
-  \internal
-  When porting this widget from ASCII to UTF-8, previously legal pointers into
-  the text of this widget can become illegal by pointing into the middle of
-  a UTF-8 sequence. This is not a big problem for Fl_Input_ because all code
-  in this module is quite tolerant. It could be problematic though when deriving
-  from this class because no feedback for illegal pointers is given. Additionally,
-  a careless "copy" call can put partial UTF-8 sequences into the clipboard.
-
-  None of these issues should be disastrous. Nevertheless, we should
-  discuss how FLTK should handle false UTF-8 sequences and pointers.
-*/
-class FL_EXPORT Fl_Input_ : public Fl_Widget {
-
-  /** \internal Storage for the text field. */
-  const char* value_;
-
-  /** \internal Buffer memory for expanded text. \see expand() */
-  char* buffer;
-
-  /** \internal Size of text in bytes in the \p value_ field. */
-  int size_;
-
-  /** \internal \todo Please document me! */
-  int bufsize;
-  
-  /** \internal Position of the cursor in the document. */
-  int position_;
-
-  /** \internal Position of the other end of the selected text. If \p position_ equals 
-      \p mark_, no text is selected */
-  int mark_;
-
-  /** \internal Behavior of Tab key in multiline input widget. 
-      If enabled (default) Tab causes focus nav, otherwise Tab is inserted 
-      as a character. */
-  int tab_nav_;
-
-  /** \internal Offset to text origin within widget bounds */
-  int xscroll_, yscroll_;
-
-  /** \internal Minimal update pointer. Display requires redraw from here to the end
-      of the buffer. */
-  int mu_p;
-
-  /** \internal Maximum number of characters. */
-  int maximum_size_;
-
-  /** \internal Shortcut key that will fetch focus for this widget. */
-  int shortcut_;
-
-  /** \internal This is set if no text but only the cursor needs updating. */
-  uchar erase_cursor_only;
-
-  /** \internal The font used for the entire text. */
-  Fl_Font textfont_;
-
-  /** \internal Height of the font used for the entire text. */
-  Fl_Fontsize textsize_;
-
-  /** \internal color of the entire text */
-  Fl_Color textcolor_;
-
-  /** \internal color of the text cursor */
-  Fl_Color cursor_color_;
-
-  /** \internal Horizontal cursor position in pixels while moving up or down. */
-  static double up_down_pos;
-
-  /** \internal Flag to remember last cursor move. */
-  static int was_up_down;
-
-  /* Convert a given text segment into the text that will be rendered on screen. */
-  const char* expand(const char*, char*) const;
-
-  /* Calculates the width in pixels of part of a text buffer. */
-  double expandpos(const char*, const char*, const char*, int*) const;
-
-  /* Mark a range of characters for update. */
-  void minimal_update(int, int);
-
-  /* Mark a range of characters for update. */
-  void minimal_update(int p);
-
-  /* Copy the value from a possibly static entry into the internal buffer. */
-  void put_in_buffer(int newsize);
-
-  /* Set the current font and font size. */
-  void setfont() const;
-
-protected:
-
-  /* Find the start of a word. */
-  int word_start(int i) const;
-
-  /* Find the end of a word. */
-  int word_end(int i) const;
-
-  /* Find the start of a line. */
-  int line_start(int i) const;
-  
-  /* Find the end of a line. */
-  int line_end(int i) const;
-
-  /* Draw the text in the passed bounding box. */
-  void drawtext(int, int, int, int);
-
-  /* Move the cursor to the column given by up_down_pos. */
-  int up_down_position(int, int keepmark=0);
-
-  /* Handle mouse clicks and mouse moves. */
-  void handle_mouse(int, int, int, int, int keepmark=0);
-
-  /* Handle all kinds of text field related events. */
-  int handletext(int e, int, int, int, int);
-
-  /* Check the when() field and do a callback if indicated. */
-  void maybe_do_callback();
-
-  /** \internal Horizontal offset of text to left edge of widget. */
-  int xscroll() const {return xscroll_;}
-
-  /** \internal Vertical offset of text to top edge of widget. */
-  int yscroll() const {return yscroll_;}
-  void yscroll(int yOffset) { yscroll_ = yOffset; damage(FL_DAMAGE_EXPOSE);}
-
-  /* Return the number of lines displayed on a single page.  */
-  int linesPerPage();
-
-public:
-
-  /* Change the size of the widget. */
-  void resize(int, int, int, int);
-
-  /* Constructor */
-  Fl_Input_(int, int, int, int, const char* = 0);
-
-  /* Destructor */
-  ~Fl_Input_();
-
-  /* Changes the widget text. */
-  int value(const char*);
-
-  /* Changes the widget text. */
-  int value(const char*, int);
-
-  /* Changes the widget text. */
-  int static_value(const char*);
-
-  /* Changes the widget text. */
-  int static_value(const char*, int);
-
-  /**
-      Returns the text displayed in the widget.
-
-      This function returns the current value, which is a pointer
-      to the internal buffer and is valid only until the next event is
-      handled.
-  
-      \return pointer to an internal buffer - do not free() this    
-      \see Fl_Input_::value(const char*)
-  */
-  const char* value() const {return value_;}
-
-  int value_int(int v);
-  int value_int();
-  int value_float(double v);
-  double value_float();
-
-  /* Returns the character at index \p i. */
-  Fl_Char index(int i) const;
-
-  /**
-    Returns the number of bytes in value(). 
-  
-    This may be greater than <tt>strlen(value())</tt> if there are 
-    \c nul characters in the text.
-
-    \return number of bytes in the text
-  */
-  int size() const {return size_;}
-
-  /** Sets the width and height of this widget.
-    \param [in] W, H new width and height
-    \see Fl_Widget::size(int, int) */
-  void size(int W, int H) { Fl_Widget::size(W, H); }
-
-  /** Gets the maximum length of the input field in characters.
-    \see maximum_size(int). */
-  int maximum_size() const {return maximum_size_;}
-
-  /** Sets the maximum length of the input field in characters.
-    This limits the number of <b>characters</b> that can be inserted
-    in the widget.
-    \since FLTK 1.3 this is different than the buffer size, since one
-    character can be more than one byte in UTF-8 encoding. In FLTK 1.1
-    this was the same (one byte = one character).
-  */
-  void maximum_size(int m) {maximum_size_ = m;}
-
-  /** Gets the position of the text cursor.
-    \return the cursor position as an index in the range 0..size()
-    \see position(int, int)
-  */
-  int position() const {return position_;}
-
-  /** Gets the current selection mark. 
-    \return index into the text */
-  int mark() const {return mark_;}
-
-  /* Sets the index for the cursor and mark. */
-  int position(int p, int m);
-
-  /** Sets the cursor position and mark.
-    position(n) is the same as <tt>position(n, n)</tt>.
-    \param p new index for cursor and mark
-    \return 0 if no positions changed
-    \see position(int, int), position(), mark(int)
-  */
-  int position(int p) {return position(p, p);}
-
-  /** Sets the current selection mark. 
-    mark(n) is the same as <tt>position(position(),n)</tt>.
-    \param m new index of the mark 
-    \return 0 if the mark did not change
-    \see position(), position(int, int) */
-  int mark(int m) {return position(position(), m);}
-
-  /** Selects all text
-    markall() is  the same as <tt>position(0); return position(size(),mark())</tt>.
-    \return 0 if the mark did not change
-    \see position(), position(int, int) */
-  int markall() {position(0); return position(size(), mark());}
-
-  /* Deletes text from b to e and inserts the new string text. */
-  int replace(int, int, const char*, int=0);
-
-  /**
-    Deletes the current selection.
-
-    This function deletes the currently selected text
-    \e without storing it in the clipboard. To use the clipboard,
-    you may call copy() first or copy_cuts() after
-    this call.
-
-    \return 0 if no data was copied
-  */
-  int cut() {return replace(position(), mark(), 0);}
-
-  /**
-    Deletes the next \p n bytes rounded to characters before or after the cursor.
-
-    This function deletes the currently selected text
-    \e without storing it in the clipboard. To use the clipboard,
-    you may call copy() first or copy_cuts() after
-    this call.
-
-    \param n number of bytes rounded to full characters and clamped to the buffer.
-           A negative number will cut characters to the left of the cursor.
-    \return 0 if no data was copied
-  */
-  int cut(int n) {return replace(position(), position()+n, 0);}
-
-  /**
-    Deletes all characters between index \p a and \p b.
-
-    This function deletes the currently selected text
-    \e without storing it in the clipboard. To use the clipboard,
-    you may call copy() first or copy_cuts() after
-    this call.
-
-    \param a, b range of bytes rounded to full characters and clamped to the buffer
-    \return 0 if no data was copied
-  */
-  int cut(int a, int b) {return replace(a, b, 0);}
-
-  /**
-    Inserts text at the cursor position.
-
-    This function inserts the string in \p t at the cursor
-    position() and moves the new position and mark to
-    the end of the inserted text.
-
-    \param [in] t text that will be inserted
-    \param [in] l length of text, or 0 if the string is terminated by \c nul.
-    \return 0 if no text was inserted
-  */
-  int insert(const char* t, int l=0){return replace(position_, mark_, t, l);}
-
-  /* Put the current selection into the clipboard. */
-  int copy(int clipboard);
-
-  /* Undo previous changes to the text buffer. */
-  int undo();
-
-  /* Copy the yank buffer to the clipboard. */
-  int copy_cuts();
-
-  /** Return the shortcut key associated with this widget.
-    \return shortcut keystroke
-    \see Fl_Button::shortcut() */
-  int shortcut() const {return shortcut_;}
-
-  /** 
-    Sets the shortcut key associated with this widget.
-    Pressing the shortcut key gives text editing focus to this widget.
-    \param [in] s new shortcut keystroke 
-    \see Fl_Button::shortcut() 
-  */
-  void shortcut(int s) {shortcut_ = s;}
-
-  /** Gets the font of the text in the input field.
-    \return the current Fl_Font index */
-  Fl_Font textfont() const {return textfont_;}
-
-  /** Sets the font of the text in the input field.
-    The text font defaults to \c FL_HELVETICA.
-    \param [in] s the new text font */
-  void textfont(Fl_Font s) {textfont_ = s;}
-
-  /** Gets the size of the text in the input field.
-    \return the text height in pixels */
-  Fl_Fontsize textsize() const {return textsize_;}
-
-  /** Sets the size of the text in the input field.
-    The text height defaults to \c FL_NORMAL_SIZE.
-    \param [in] s the new font height in pixel units */
-  void textsize(Fl_Fontsize s) {textsize_ = s;}
-
-  /** Gets the color of the text in the input field.
-    \return the text color
-    \see textcolor(Fl_Color) */
-  Fl_Color textcolor() const {return textcolor_;}
-
-  /** Sets the color of the text in the input field.
-    The text color defaults to \c FL_FOREGROUND_COLOR.
-    \param [in] n new text color
-    \see textcolor() */
-  void textcolor(Fl_Color n) {textcolor_ = n;}
-
-  /** Gets the color of the cursor.  
-    \return the current cursor color */
-  Fl_Color cursor_color() const {return cursor_color_;}
-
-  /** Sets the color of the cursor.  
-    The default color for the cursor is \c FL_BLACK.
-    \param [in] n the new cursor color */
-  void cursor_color(Fl_Color n) {cursor_color_ = n;}
-
-  /** Gets the input field type. 
-    \return the current input type */
-  int input_type() const {return type() & FL_INPUT_TYPE; }
-
-  /** Sets the input field type. 
-    A redraw() is required to reformat the input field.
-    \param [in] t new input type */
-  void input_type(int t) { type((uchar)(t | readonly())); }
-
-  /** Gets the read-only state of the input field.  
-    \return non-zero if this widget is read-only */
-  int readonly() const { return type() & FL_INPUT_READONLY; }
-
-  /** Sets the read-only state of the input field.  
-    \param [in] b if \p b is 0, the text in this widget can be edited by the user */
-  void readonly(int b) { if (b) type((uchar)(type() | FL_INPUT_READONLY));
-                         else type((uchar)(type() & ~FL_INPUT_READONLY)); }
-
-  /**
-    Gets  the word wrapping state of the input field. 
-    Word wrap is only functional with multi-line input fields.
-  */
-  int wrap() const { return type() & FL_INPUT_WRAP; }
-
-  /**
-    Sets the word wrapping state of the input field. 
-    Word wrap is only functional with multi-line input fields.
-  */
-  void wrap(int b) { if (b) type((uchar)(type() | FL_INPUT_WRAP));
-                         else type((uchar)(type() & ~FL_INPUT_WRAP)); }
-
-  /**
-    Sets whether the Tab key does focus navigation, 
-    or inserts tab characters into Fl_Multiline_Input.
-
-    By default this flag is enabled to provide the 'normal' behavior 
-    most users expect; Tab navigates focus to the next widget. 
-    To inserting an actual Tab character, users can use Ctrl-I
-    or copy/paste.
-
-    Disabling this flag gives the old FLTK behavior where Tab
-    inserts a tab character into the text field, in which case
-    only the mouse can be used to navigate to the next field.
-
-    History: This flag was provided for backwards support of FLTK's old 1.1.x
-    behavior where Tab inserts a tab character instead of navigating 
-    focus to the next widget. This behavior was unique to Fl_Multiline_Input. 
-    With the advent of Fl_Text_Editor, this old behavior has been deprecated.
-
-    \param [in] val If \p val is 1, Tab advances focus (default).<BR>
-                    If \p val is 0, Tab inserts a tab character (old FLTK behavior).
+//
+// "$Id: Fl_Input_.H 10807 2015-07-21 13:55:13Z AlbrechtS $"
+//
+// Input base class header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2015 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_Input_ widget . */
+
+#ifndef Fl_Input__H
+#define Fl_Input__H
+
+#ifndef Fl_Widget_H
+#include "Fl_Widget.H"
+#endif
+
+#define FL_NORMAL_INPUT		0
+#define FL_FLOAT_INPUT		1
+#define FL_INT_INPUT		2
+#define FL_HIDDEN_INPUT		3
+#define FL_MULTILINE_INPUT	4
+#define FL_SECRET_INPUT		5
+#define FL_INPUT_TYPE		7
+#define FL_INPUT_READONLY	8
+#define FL_NORMAL_OUTPUT	(FL_NORMAL_INPUT | FL_INPUT_READONLY)
+#define FL_MULTILINE_OUTPUT	(FL_MULTILINE_INPUT | FL_INPUT_READONLY)
+#define FL_INPUT_WRAP		16
+#define FL_MULTILINE_INPUT_WRAP	(FL_MULTILINE_INPUT | FL_INPUT_WRAP)
+#define FL_MULTILINE_OUTPUT_WRAP (FL_MULTILINE_INPUT | FL_INPUT_READONLY | FL_INPUT_WRAP)
+
+/**
+  This class provides a low-overhead text input field.
+
+  This is a virtual base class below Fl_Input. It has all
+  the same interfaces, but lacks the handle() and
+  draw() method. You may want to subclass it if you are
+  one of those people who likes to change how the editing keys
+  work. It may also be useful for adding scrollbars
+  to the input field.
+
+  This can act like any of the subclasses of Fl_Input, by
+  setting type() to one of the following values:
+
+  \code
+  #define FL_NORMAL_INPUT	   0
+  #define FL_FLOAT_INPUT	   1
+  #define FL_INT_INPUT		   2
+  #define FL_MULTILINE_INPUT	   4
+  #define FL_SECRET_INPUT	   5
+  #define FL_INPUT_TYPE		   7
+  #define FL_INPUT_READONLY	   8
+  #define FL_NORMAL_OUTPUT	   (FL_NORMAL_INPUT | FL_INPUT_READONLY)
+  #define FL_MULTILINE_OUTPUT	   (FL_MULTILINE_INPUT | FL_INPUT_READONLY)
+  #define FL_INPUT_WRAP		   16
+  #define FL_MULTILINE_INPUT_WRAP  (FL_MULTILINE_INPUT | FL_INPUT_WRAP)
+  #define FL_MULTILINE_OUTPUT_WRAP (FL_MULTILINE_INPUT | FL_INPUT_READONLY | FL_INPUT_WRAP)
+  \endcode
+
+  All variables that represent an index into a text buffer are byte-oriented,
+  not character oriented, counting from 0 (at or before the first character)
+  to size() (at the end of the buffer, after the last byte). Since UTF-8
+  characters can be up to six bytes long, simply incrementing such an index
+  will not reliably advance to the next character in the text buffer.
+
+  Indices and pointers into the text buffer should always point at a 7 bit ASCII
+  character or the beginning of a UTF-8 character sequence. Behavior for false
+  UTF-8 sequences and pointers into the middle of a sequence are undefined.
+
+  \see Fl_Text_Display, Fl_Text_Editor for more powerful text handling widgets
+
+  \internal
+  When porting this widget from ASCII to UTF-8, previously legal pointers into
+  the text of this widget can become illegal by pointing into the middle of
+  a UTF-8 sequence. This is not a big problem for Fl_Input_ because all code
+  in this module is quite tolerant. It could be problematic though when deriving
+  from this class because no feedback for illegal pointers is given. Additionally,
+  a careless "copy" call can put partial UTF-8 sequences into the clipboard.
+
+  None of these issues should be disastrous. Nevertheless, we should
+  discuss how FLTK should handle false UTF-8 sequences and pointers.
+*/
+class FL_EXPORT Fl_Input_ : public Fl_Widget {
+
+  /** \internal Storage for the text field. */
+  const char* value_;
+
+  /** \internal Buffer memory for expanded text. \see expand() */
+  char* buffer;
+
+  /** \internal Size of text in bytes in the \p value_ field. */
+  int size_;
+
+  /** \internal Current size of internal value() buffer in bytes. */
+  int bufsize;
+
+  /** \internal Position of the cursor in the document. */
+  int position_;
+
+  /** \internal Position of the other end of the selected text.
+      If \p position_ equals \p mark_, no text is selected */
+  int mark_;
+
+  /** \internal Behavior of Tab key in multiline input widget. 
+      If enabled (default) Tab causes focus nav, otherwise Tab is inserted 
+      as a character. */
+  int tab_nav_;
+
+  /** \internal Offset to text origin within widget bounds */
+  int xscroll_, yscroll_;
+
+  /** \internal Minimal update pointer. Display requires redraw from here to the end
+      of the buffer. */
+  int mu_p;
+
+  /** \internal Maximum number of (UTF-8) characters a user can input. */
+  int maximum_size_;
+
+  /** \internal Shortcut key that will fetch focus for this widget. */
+  int shortcut_;
+
+  /** \internal This is set if no text but only the cursor needs updating. */
+  uchar erase_cursor_only;
+
+  /** \internal The font used for the entire text. */
+  Fl_Font textfont_;
+
+  /** \internal Height of the font used for the entire text. */
+  Fl_Fontsize textsize_;
+
+  /** \internal color of the entire text */
+  Fl_Color textcolor_;
+
+  /** \internal color of the text cursor */
+  Fl_Color cursor_color_;
+
+  /** \internal Horizontal cursor position in pixels while moving up or down. */
+  static double up_down_pos;
+
+  /** \internal Flag to remember last cursor move. */
+  static int was_up_down;
+
+  /* Convert a given text segment into the text that will be rendered on screen. */
+  const char* expand(const char*, char*) const;
+
+  /* Calculates the width in pixels of part of a text buffer. */
+  double expandpos(const char*, const char*, const char*, int*) const;
+
+  /* Mark a range of characters for update. */
+  void minimal_update(int, int);
+
+  /* Mark a range of characters for update. */
+  void minimal_update(int p);
+
+  /* Copy the value from a possibly static entry into the internal buffer. */
+  void put_in_buffer(int newsize);
+
+  /* Set the current font and font size. */
+  void setfont() const;
+
+protected:
+
+  /* Find the start of a word. */
+  int word_start(int i) const;
+
+  /* Find the end of a word. */
+  int word_end(int i) const;
+
+  /* Find the start of a line. */
+  int line_start(int i) const;
+  
+  /* Find the end of a line. */
+  int line_end(int i) const;
+
+  /* Draw the text in the passed bounding box. */
+  void drawtext(int, int, int, int);
+
+  /* Move the cursor to the column given by up_down_pos. */
+  int up_down_position(int, int keepmark=0);
+
+  /* Handle mouse clicks and mouse moves. */
+  void handle_mouse(int, int, int, int, int keepmark=0);
+
+  /* Handle all kinds of text field related events. */
+  int handletext(int e, int, int, int, int);
+
+  /* Check the when() field and do a callback if indicated. */
+  void maybe_do_callback();
+
+  /** \internal Horizontal offset of text to left edge of widget. */
+  int xscroll() const {return xscroll_;}
+
+  /** \internal Vertical offset of text to top edge of widget. */
+  int yscroll() const {return yscroll_;}
+  void yscroll(int yOffset) { yscroll_ = yOffset; damage(FL_DAMAGE_EXPOSE);}
+
+  /* Return the number of lines displayed on a single page.  */
+  int linesPerPage();
+
+public:
+
+  /* Change the size of the widget. */
+  void resize(int, int, int, int);
+
+  /* Constructor */
+  Fl_Input_(int, int, int, int, const char* = 0);
+
+  /* Destructor */
+  ~Fl_Input_();
+
+  /* Changes the widget text. */
+  int value(const char*);
+
+  /* Changes the widget text. */
+  int value(const char*, int);
+
+  /* Changes the widget text. */
+  int static_value(const char*);
+
+  /* Changes the widget text. */
+  int static_value(const char*, int);
+
+  /**
+      Returns the text displayed in the widget.
+
+      This function returns the current value, which is a pointer
+      to the internal buffer and is valid only until the next event is
+      handled.
+  
+      \return pointer to an internal buffer - do not free() this    
+      \see Fl_Input_::value(const char*)
+  */
+  const char* value() const {return value_;}
+
+  int value_int(int v);
+  int value_int();
+  int value_float(double v);
+  double value_float();
+  /* Returns the character at index \p i. */
+  Fl_Char index(int i) const;
+
+  /**
+    Returns the number of bytes in value(). 
+  
+    This may be greater than <tt>strlen(value())</tt> if there are 
+    \c nul characters in the text.
+
+    \return number of bytes in the text
+  */
+  int size() const {return size_;}
+
+  /** Sets the width and height of this widget.
+    \param [in] W, H new width and height
+    \see Fl_Widget::size(int, int) */
+  void size(int W, int H) { Fl_Widget::size(W, H); }
+
+  /** Gets the maximum length of the input field in characters.
+    \see maximum_size(int). */
+  int maximum_size() const {return maximum_size_;}
+
+  /** Sets the maximum length of the input field in characters.
+
+    This limits the number of <b>characters</b> that can be inserted
+    in the widget.
+
+    Since FLTK 1.3 this is different than the buffer size, since one
+    character can be more than one byte in UTF-8 encoding. In FLTK 1.1
+    this was the same (one byte = one character).
+  */
+  void maximum_size(int m) {maximum_size_ = m;}
+
+  /** Gets the position of the text cursor.
+    \return the cursor position as an index in the range 0..size()
+    \see position(int, int)
+  */
+  int position() const {return position_;}
+
+  /** Gets the current selection mark. 
+    \return index into the text */
+  int mark() const {return mark_;}
+
+  /* Sets the index for the cursor and mark. */
+  int position(int p, int m);
+
+  /** Sets the cursor position and mark.
+    position(n) is the same as <tt>position(n, n)</tt>.
+    \param p new index for cursor and mark
+    \return 0 if no positions changed
+    \see position(int, int), position(), mark(int)
+  */
+  int position(int p) {return position(p, p);}
+
+  /** Sets the current selection mark. 
+    mark(n) is the same as <tt>position(position(),n)</tt>.
+    \param m new index of the mark 
+    \return 0 if the mark did not change
+    \see position(), position(int, int) */
+  int mark(int m) {return position(position(), m);}
+
+  /** Selects all text
+    markall() is  the same as <tt>position(0); return position(size(),mark())</tt>.
+    \return 0 if the mark did not change
+    \see position(), position(int, int) */
+  int markall() {position(0); return position(size(), mark());}
+
+  /* Deletes text from \p b to \p e and inserts the new string \p text. */
+  int replace(int b, int e, const char *text, int ilen=0);
+
+  /**
+    Deletes the current selection.
+
+    This function deletes the currently selected text
+    \e without storing it in the clipboard. To use the clipboard,
+    you may call copy() first or copy_cuts() after
+    this call.
+
+    \return 0 if no data was copied
+  */
+  int cut() {return replace(position(), mark(), 0);}
+
+  /**
+    Deletes the next \p n bytes rounded to characters before or after the cursor.
+
+    This function deletes the currently selected text
+    \e without storing it in the clipboard. To use the clipboard,
+    you may call copy() first or copy_cuts() after
+    this call.
+
+    \param n number of bytes rounded to full characters and clamped to the buffer.
+           A negative number will cut characters to the left of the cursor.
+    \return 0 if no data was copied
+  */
+  int cut(int n) {return replace(position(), position()+n, 0);}
+
+  /**
+    Deletes all characters between index \p a and \p b.
+
+    This function deletes the currently selected text
+    \e without storing it in the clipboard. To use the clipboard,
+    you may call copy() first or copy_cuts() after
+    this call.
+
+    \param a, b range of bytes rounded to full characters and clamped to the buffer
+    \return 0 if no data was copied
+  */
+  int cut(int a, int b) {return replace(a, b, 0);}
+
+  /**
+    Inserts text at the cursor position.
+
+    This function inserts the string in \p t at the cursor
+    position() and moves the new position and mark to
+    the end of the inserted text.
+
+    \param [in] t text that will be inserted
+    \param [in] l length of text, or 0 if the string is terminated by \c nul.
+    \return 0 if no text was inserted
+  */
+  int insert(const char* t, int l=0){return replace(position_, mark_, t, l);}
+
+  /* Put the current selection into the clipboard. */
+  int copy(int clipboard);
+
+  /* Undo previous changes to the text buffer. */
+  int undo();
+
+  /* Copy the yank buffer to the clipboard. */
+  int copy_cuts();
+
+  /** Return the shortcut key associated with this widget.
+    \return shortcut keystroke
+    \see Fl_Button::shortcut() */
+  int shortcut() const {return shortcut_;}
+
+  /** 
+    Sets the shortcut key associated with this widget.
+    Pressing the shortcut key gives text editing focus to this widget.
+    \param [in] s new shortcut keystroke 
+    \see Fl_Button::shortcut() 
+  */
+  void shortcut(int s) {shortcut_ = s;}
+
+  /** Gets the font of the text in the input field.
+    \return the current Fl_Font index */
+  Fl_Font textfont() const {return textfont_;}
+
+  /** Sets the font of the text in the input field.
+    The text font defaults to \c FL_HELVETICA.
+    \param [in] s the new text font */
+  void textfont(Fl_Font s) {textfont_ = s;}
+
+  /** Gets the size of the text in the input field.
+    \return the text height in pixels */
+  Fl_Fontsize textsize() const {return textsize_;}
+
+  /** Sets the size of the text in the input field.
+    The text height defaults to \c FL_NORMAL_SIZE.
+    \param [in] s the new font height in pixel units */
+  void textsize(Fl_Fontsize s) {textsize_ = s;}
+
+  /** Gets the color of the text in the input field.
+    \return the text color
+    \see textcolor(Fl_Color) */
+  Fl_Color textcolor() const {return textcolor_;}
+
+  /** Sets the color of the text in the input field.
+    The text color defaults to \c FL_FOREGROUND_COLOR.
+    \param [in] n new text color
+    \see textcolor() */
+  void textcolor(Fl_Color n) {textcolor_ = n;}
+
+  /** Gets the color of the cursor.  
+    \return the current cursor color */
+  Fl_Color cursor_color() const {return cursor_color_;}
+
+  /** Sets the color of the cursor.  
+    The default color for the cursor is \c FL_BLACK.
+    \param [in] n the new cursor color */
+  void cursor_color(Fl_Color n) {cursor_color_ = n;}
+
+  /** Gets the input field type. 
+    \return the current input type */
+  int input_type() const {return type() & FL_INPUT_TYPE; }
+
+  /** Sets the input field type. 
+    A redraw() is required to reformat the input field.
+    \param [in] t new input type */
+  void input_type(int t) { type((uchar)(t | readonly())); }
+
+  /** Gets the read-only state of the input field.  
+    \return non-zero if this widget is read-only */
+  int readonly() const { return type() & FL_INPUT_READONLY; }
+
+  /** Sets the read-only state of the input field.  
+    \param [in] b if \p b is 0, the text in this widget can be edited by the user */
+  void readonly(int b) { if (b) type((uchar)(type() | FL_INPUT_READONLY));
+                         else type((uchar)(type() & ~FL_INPUT_READONLY)); }
+
+  /**
+    Gets  the word wrapping state of the input field. 
+    Word wrap is only functional with multi-line input fields.
+  */
+  int wrap() const { return type() & FL_INPUT_WRAP; }
+
+  /**
+    Sets the word wrapping state of the input field. 
+    Word wrap is only functional with multi-line input fields.
+  */
+  void wrap(int b) { if (b) type((uchar)(type() | FL_INPUT_WRAP));
+                         else type((uchar)(type() & ~FL_INPUT_WRAP)); }
+
+  /**
+    Sets whether the Tab key does focus navigation, 
+    or inserts tab characters into Fl_Multiline_Input.
+
+    By default this flag is enabled to provide the 'normal' behavior 
+    most users expect; Tab navigates focus to the next widget. 
+    To inserting an actual Tab character, users can use Ctrl-I
+    or copy/paste.
+
+    Disabling this flag gives the old FLTK behavior where Tab
+    inserts a tab character into the text field, in which case
+    only the mouse can be used to navigate to the next field.
+
+    History: This flag was provided for backwards support of FLTK's old 1.1.x
+    behavior where Tab inserts a tab character instead of navigating 
+    focus to the next widget. This behavior was unique to Fl_Multiline_Input. 
+    With the advent of Fl_Text_Editor, this old behavior has been deprecated.
+
+    \param [in] val If \p val is 1, Tab advances focus (default).<BR>
+                    If \p val is 0, Tab inserts a tab character (old FLTK behavior).
 
     \see tab_nav(), Fl::OPTION_ARROW_FOCUS.
-  */
-  void tab_nav(int val) {
-    tab_nav_ = val;
-  }
-
-  /**
-    Gets whether the Tab key causes focus navigation in multiline input fields or not.
-
-    If enabled (default), hitting Tab causes focus navigation to the next widget.
-
-    If disabled, hitting Tab inserts a tab character into the text field.
-    \returns 1 if Tab advances focus (default), 0 if Tab inserts tab characters.
+  */
+  void tab_nav(int val) {
+    tab_nav_ = val;
+  }
+
+  /**
+    Gets whether the Tab key causes focus navigation in multiline input fields or not.
+
+    If enabled (default), hitting Tab causes focus navigation to the next widget.
+
+    If disabled, hitting Tab inserts a tab character into the text field.
+    \returns 1 if Tab advances focus (default), 0 if Tab inserts tab characters.
 
     \see tab_nav(int), Fl::OPTION_ARROW_FOCUS.
-  */
-  int tab_nav() const {
-    return tab_nav_;
-  }
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_Input_, Fl_Widget)
-};
-
-#endif 
-
-//
-// End of "$Id: Fl_Input_.H 10134 2014-04-29 02:56:34Z greg.ercolano $".
-//
+  */
+  int tab_nav() const {
+    return tab_nav_;
+  }
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_Input_, Fl_Widget)
+};
+
+#endif 
+
+//
+// End of "$Id: Fl_Input_.H 10807 2015-07-21 13:55:13Z AlbrechtS $".
+//

+ 180 - 224
fltk/FL/Fl_Input_Choice.H

@@ -1,224 +1,180 @@
-//
-// "$Id: Fl_Input_Choice.H 9740 2012-12-09 17:45:24Z manolo $"
-//
-// An input/chooser widget.
-//            ______________  ____
-//           |              || __ |
-//           | input area   || \/ |
-//           |______________||____|
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-// Copyright 2004 by Greg Ercolano.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_Input_Choice widget . */
-
-#ifndef Fl_Input_Choice_H
-#define Fl_Input_Choice_H
-
-#include <FL/Fl.H>
-#include <FL/Fl_Group.H>
-#include <FL/Fl_Input.H>
-#include <FL/Fl_Menu_Button.H>
-#include <FL/fl_draw.H>
-#include <string.h>
-
-/**
-  A combination of the input widget and a menu button.
-
-  \image html input_choice.jpg
-  \image latex input_choice.jpg "Fl_Input_Choice widget" width=6cm
-
-  The user can either type into the input area, or use the
-  menu button chooser on the right to choose an item which loads
-  the input area with the selected text.
-  <P>
-  The application can directly access both the internal Fl_Input 
-  and Fl_Menu_Button widgets respectively using the input() and menubutton()
-  accessor methods.
-*/
-class FL_EXPORT Fl_Input_Choice : public Fl_Group {
-  // Private class to handle slightly 'special' behavior of menu button
-  class InputMenuButton : public Fl_Menu_Button {
-    void draw() {
-      draw_box(FL_UP_BOX, color());
-      fl_color(active_r() ? labelcolor() : fl_inactive(labelcolor()));
-      int xc = x()+w()/2, yc=y()+h()/2;
-      fl_polygon(xc-5,yc-3,xc+5,yc-3,xc,yc+3);
-      if (Fl::focus() == this) draw_focus();
-    }
-  public:
-    InputMenuButton(int X,int Y,int W,int H,const char*L=0) : 
-	Fl_Menu_Button(X, Y, W, H, L) { box(FL_UP_BOX); }
-  };
-
-  Fl_Input *inp_;
-  InputMenuButton *menu_;
-
-  static void menu_cb(Fl_Widget*, void *data) { 
-    Fl_Input_Choice *o=(Fl_Input_Choice *)data;
-    Fl_Widget_Tracker wp(o);
-    const Fl_Menu_Item *item = o->menubutton()->mvalue();
-    if (item && item->flags & (FL_SUBMENU|FL_SUBMENU_POINTER)) return;	// ignore submenus
-    if (!strcmp(o->inp_->value(), o->menu_->text()))
-    {
-      o->Fl_Widget::clear_changed();
-      if (o->when() & FL_WHEN_NOT_CHANGED)
-	o->do_callback();
-    }
-    else
-    {
-      o->inp_->value(o->menu_->text());
-      o->inp_->set_changed();
-      o->Fl_Widget::set_changed();
-      if (o->when() & (FL_WHEN_CHANGED|FL_WHEN_RELEASE))
-	o->do_callback();
-    }
-    
-    if (wp.deleted()) return;
-
-    if (o->callback() != default_callback)
-    {
-      o->Fl_Widget::clear_changed();
-      o->inp_->clear_changed();
-    }
-  }
-
-  static void inp_cb(Fl_Widget*, void *data) { 
-    Fl_Input_Choice *o=(Fl_Input_Choice *)data;
-    Fl_Widget_Tracker wp(o);
-    if (o->inp_->changed()) {
-      o->Fl_Widget::set_changed();
-      if (o->when() & (FL_WHEN_CHANGED|FL_WHEN_RELEASE))
-	o->do_callback();
-    } else {
-      o->Fl_Widget::clear_changed();
-      if (o->when() & FL_WHEN_NOT_CHANGED)
-	o->do_callback();
-    }
-    
-    if (wp.deleted()) return;
-
-    if (o->callback() != default_callback)
-      o->Fl_Widget::clear_changed();
-  }
-
-  // Custom resize behavior -- input stretches, menu button doesn't
-  inline int inp_x() { return(x() + Fl::box_dx(box())); }
-  inline int inp_y() { return(y() + Fl::box_dy(box())); }
-  inline int inp_w() { return(w() - Fl::box_dw(box()) - 20); }
-  inline int inp_h() { return(h() - Fl::box_dh(box())); }
-
-  inline int menu_x() { return(x() + w() - 20 - Fl::box_dx(box())); }
-  inline int menu_y() { return(y() + Fl::box_dy(box())); }
-  inline int menu_w() { return(20); }
-  inline int menu_h() { return(h() - Fl::box_dh(box())); }
-
-public:
-  /**
-    Creates a new Fl_Input_Choice widget using the given position, size,
-    and label string.
-    Inherited destructor destroys the widget and any values associated with it.
-  */
-  Fl_Input_Choice(int X,int Y,int W,int H,const char*L=0);
-  
-  /** Adds an item to the menu.
-   You can access the more complex Fl_Menu_Button::add() methods 
-   (setting callbacks, userdata, etc), via menubutton(). Example:
-   \code
-   Fl_Input_Choice *choice = new Fl_Input_Choice(100,10,120,25,"Fonts");
-   Fl_Menu_Button *mb = choice->menubutton();             // use Fl_Input_Choice's Fl_Menu_Button
-   mb->add("Helvetica", 0, MyFont_CB,     (void*)mydata); // use Fl_Menu_Button's add() methods
-   mb->add("Courier",   0, MyFont_CB,     (void*)mydata);
-   mb->add("More..",    0, FontDialog_CB, (void*)mydata);
-   \endcode
-   */
-  void add(const char *s) { menu_->add(s);  }
-  /** Returns the combined changed() state of the input and menu button widget. */
-  int changed() const { return inp_->changed() | Fl_Widget::changed();}
-  /** Clears the changed() state of both input and menu button widgets. */
-  void clear_changed() { 
-    inp_->clear_changed();
-    Fl_Widget::clear_changed();
-  }
-  /** Sets the changed() state of both input and menu button widgets
-   to the specfied value.*/
-  void set_changed() { 
-    inp_->set_changed();
-    // no need to call Fl_Widget::set_changed()
-  }
-  /** Removes all items from the menu. */
-  void clear() { menu_->clear(); }
-  /** Gets the box type of the menu button */
-  Fl_Boxtype down_box() const { return (menu_->down_box()); }
-  /** Sets the box type of the menu button */
-  void down_box(Fl_Boxtype b) { menu_->down_box(b); }
-  /** Gets the Fl_Menu_Item array used for the menu. */
-  const Fl_Menu_Item *menu() { return (menu_->menu()); }
-  /** Sets the Fl_Menu_Item array used for the menu. */
-  void menu(const Fl_Menu_Item *m) { menu_->menu(m); }
-  void resize(int X, int Y, int W, int H) {
-    Fl_Group::resize(X,Y,W,H);
-    inp_->resize(inp_x(), inp_y(), inp_w(), inp_h());
-    menu_->resize(menu_x(), menu_y(), menu_w(), menu_h());
-  }
-  /// Gets the Fl_Input text field's text color.
-  Fl_Color textcolor() const { return (inp_->textcolor());}
-  /// Sets the Fl_Input text field's text color to \p c.
-  void textcolor(Fl_Color c) { inp_->textcolor(c);}
-  /// Gets the Fl_Input text field's font style.
-  Fl_Font textfont() const { return (inp_->textfont());}
-  /// Sets the Fl_Input text field's font style to \p f.
-  void textfont(Fl_Font f) { inp_->textfont(f);}
-  /// Gets the Fl_Input text field's font size
-  Fl_Fontsize textsize() const { return (inp_->textsize()); }
-  /// Sets the Fl_Input text field's font size to \p s.
-  void textsize(Fl_Fontsize s) { inp_->textsize(s); }
-  /// Returns the Fl_Input text field's current contents.
-  const char* value() const { return (inp_->value()); }
-  /** Sets the Fl_Input text field's contents to \p val.
-   Does not affect the menu selection.*/
-  void value(const char *val) { inp_->value(val); }
-  /** Chooses item# \p val in the menu, and sets the Fl_Input text field
-   to that value. Any previous text is cleared.*/
-  void value(int val) {
-    menu_->value(val);
-    inp_->value(menu_->text(val));
-  }
-  /** Returns a pointer to the internal Fl_Menu_Button widget.
-   This can be used to access any of the methods of the menu button, e.g.
-   \code
-   Fl_Input_Choice *choice = new Fl_Input_Choice(100,10,120,25,"Choice:");
-   [..]
-   // Print all the items in the choice menu
-   for ( int t=0; t<choice->menubutton()->size(); t++ ) {
-       const Fl_Menu_Item &item = choice->menubutton()->menu()[t];
-       printf("item %d -- label=%s\n", t, item.label() ? item.label() : "(Null)");
-   }
-   \endcode
-  */
-  Fl_Menu_Button *menubutton() { return menu_; }
-  /** Returns a pointer to the internal Fl_Input widget.
-   This can be used to directly access all of the Fl_Input widget's
-   methods.*/
-  Fl_Input *input() { return inp_; }
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_Input_Choice, Fl_Group)
-};
-
-#endif // !Fl_Input_Choice_H
-
-//
-// End of "$Id: Fl_Input_Choice.H 9740 2012-12-09 17:45:24Z manolo $".
-//
+//
+// "$Id: Fl_Input_Choice.H 12192 2017-03-11 23:26:32Z AlbrechtS $"
+//
+// An input/chooser widget.
+//            ______________  ____
+//           |              || __ |
+//           | input area   || \/ |
+//           |______________||____|
+//
+// Copyright 1998-2017 by Bill Spitzak and others.
+// Copyright 2004 by Greg Ercolano.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_Input_Choice widget . */
+
+#ifndef Fl_Input_Choice_H
+#define Fl_Input_Choice_H
+
+#include <FL/Fl.H>
+#include <FL/Fl_Group.H>
+#include <FL/Fl_Input.H>
+#include <FL/Fl_Menu_Button.H>
+
+// Leaving these two headers so builds don't break if user includes this
+// header and uses items from fl_draw or string (but doesn't include in src).
+// Note: this would ensure compatibility with FLTK 1.3.x.
+// Shall we? Currently not!
+// #include <FL/fl_draw.H>
+// #include <string.h>
+
+/*
+  A combination of the input widget and a menu button.
+
+  The user can either type into the input area, or use the
+  menu button chooser on the right to choose an item which loads
+  the input area with the selected text.
+
+  Note: doxygen docs in src/Fl_Input_Choice.cxx
+*/
+
+class FL_EXPORT Fl_Input_Choice : public Fl_Group {
+
+  // Private class to handle slightly 'special' behavior of menu button
+  class InputMenuButton : public Fl_Menu_Button {
+    void draw();
+  public:
+    InputMenuButton(int X, int Y, int W, int H, const char *L=0);
+  };
+
+  Fl_Input *inp_;
+  InputMenuButton *menu_;
+
+  // note: this is used by the Fl_Input_Choice ctor.
+  static void menu_cb(Fl_Widget*, void *data);
+
+  // note: this is used by the Fl_Input_Choice ctor.
+  static void inp_cb(Fl_Widget*, void *data);
+
+  // Custom resize behavior -- input stretches, menu button doesn't
+  inline int inp_x() { return(x() + Fl::box_dx(box())); }
+  inline int inp_y() { return(y() + Fl::box_dy(box())); }
+  inline int inp_w() { return(w() - Fl::box_dw(box()) - 20); }
+  inline int inp_h() { return(h() - Fl::box_dh(box())); }
+
+  inline int menu_x() { return(x() + w() - 20 - Fl::box_dx(box())); }
+  inline int menu_y() { return(y() + Fl::box_dy(box())); }
+  inline int menu_w() { return(20); }
+  inline int menu_h() { return(h() - Fl::box_dh(box())); }
+
+public:
+
+  Fl_Input_Choice(int X, int Y, int W, int H, const char *L=0);
+
+  void resize(int X, int Y, int W, int H);
+
+  /** Adds an item to the menu.
+    You can access the more complex Fl_Menu_Button::add() methods
+    (setting callbacks, userdata, etc), via menubutton(). Example:
+    \code
+    Fl_Input_Choice *choice = new Fl_Input_Choice(100,10,120,25,"Fonts");
+    Fl_Menu_Button *mb = choice->menubutton();             // use Fl_Input_Choice's Fl_Menu_Button
+    mb->add("Helvetica", 0, MyFont_CB,     (void*)mydata); // use Fl_Menu_Button's add() methods
+    mb->add("Courier",   0, MyFont_CB,     (void*)mydata);
+    mb->add("More..",    0, FontDialog_CB, (void*)mydata);
+    \endcode
+  */
+  void add(const char *s) { menu_->add(s); }
+
+  /** Returns the combined changed() state of the input and menu button widget. */
+  int changed() const { return inp_->changed() | Fl_Widget::changed(); }
+
+  // Clears the changed() state of both input and menu button widgets.
+  void clear_changed();
+
+  // Sets the changed() state of both input and menu button widgets.
+  void set_changed();
+
+  /** Removes all items from the menu. */
+  void clear() { menu_->clear(); }
+
+  /** Gets the box type of the menu button */
+  Fl_Boxtype down_box() const { return (menu_->down_box()); }
+
+  /** Sets the box type of the menu button */
+  void down_box(Fl_Boxtype b) { menu_->down_box(b); }
+
+  /** Gets the Fl_Menu_Item array used for the menu. */
+  const Fl_Menu_Item *menu() { return (menu_->menu()); }
+
+  /** Sets the Fl_Menu_Item array used for the menu. */
+  void menu(const Fl_Menu_Item *m) { menu_->menu(m); }
+
+  /// Gets the Fl_Input text field's text color.
+  Fl_Color textcolor() const { return (inp_->textcolor());}
+
+  /// Sets the Fl_Input text field's text color to \p c.
+  void textcolor(Fl_Color c) { inp_->textcolor(c);}
+
+  /// Gets the Fl_Input text field's font style.
+  Fl_Font textfont() const { return (inp_->textfont());}
+
+  /// Sets the Fl_Input text field's font style to \p f.
+  void textfont(Fl_Font f) { inp_->textfont(f);}
+
+  /// Gets the Fl_Input text field's font size
+  Fl_Fontsize textsize() const { return (inp_->textsize()); }
+
+  /// Sets the Fl_Input text field's font size to \p s.
+  void textsize(Fl_Fontsize s) { inp_->textsize(s); }
+
+  /// Returns the Fl_Input text field's current contents.
+  const char* value() const { return (inp_->value()); }
+
+  /** Sets the Fl_Input text field's contents to \p val.
+    Does not affect the menu selection.
+    \see void value(int val)
+  */
+  void value(const char *val) { inp_->value(val); }
+
+  /* Chooses item# \p val in the menu, and sets the Fl_Input text field
+    to that value. Any previous text is cleared. */
+  void value(int val);
+
+  /** Returns a pointer to the internal Fl_Menu_Button widget.
+    This can be used to access any of the methods of the menu button, e.g.
+    \code
+    Fl_Input_Choice *choice = new Fl_Input_Choice(100,10,120,25,"Choice:");
+    [..]
+    // Print all the items in the choice menu
+    for ( int t=0; t<choice->menubutton()->size(); t++ ) {
+       const Fl_Menu_Item &item = choice->menubutton()->menu()[t];
+       printf("item %d -- label=%s\n", t, item.label() ? item.label() : "(Null)");
+    }
+    \endcode
+  */
+  Fl_Menu_Button *menubutton() { return menu_; }
+
+  /** Returns a pointer to the internal Fl_Input widget.
+    This can be used to directly access all of the Fl_Input widget's methods.
+  */
+  Fl_Input *input() { return inp_; }
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_Input_Choice, Fl_Group)
+};
+
+#endif // !Fl_Input_Choice_H
+
+//
+// End of "$Id: Fl_Input_Choice.H 12192 2017-03-11 23:26:32Z AlbrechtS $".
+//

+ 52 - 53
fltk/FL/Fl_Int_Input.H

@@ -1,53 +1,52 @@
-//
-// "$Id: Fl_Int_Input.H 9637 2012-07-24 04:37:22Z matt $"
-//
-// Integer input header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_Int_Input widget . */
-
-#ifndef Fl_Int_Input_H
-#define Fl_Int_Input_H
-
-#include "Fl_Input.H"
-
-/**
-  The Fl_Int_Input class is a subclass of Fl_Input that only allows
-  the user to type decimal digits (or hex numbers of the form 0xaef).
-*/
-class FL_EXPORT Fl_Int_Input : public Fl_Input {
-public:
-  /**
-    Creates a new Fl_Int_Input widget using the given position,
-    size, and label string. The default boxtype is FL_DOWN_BOX.
-
-    Inherited destructor destroys the widget and any value associated with it.
-  */
-  Fl_Int_Input(int X,int Y,int W,int H,const char *l = 0);
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_Int_Input, Fl_Input)
-};
-
-class FL_EXPORT Fl_Int_Input_Fmt : public Fl_Int_Input {
-public:
-  Fl_Int_Input_Fmt(int X,int Y,int W,int H,const char *l = 0)
-      : Fl_Int_Input(X,Y,W,H,l) {use_numeric_format(1);}
-};
-
-#endif
-//
-// End of "$Id: Fl_Int_Input.H 9637 2012-07-24 04:37:22Z matt $".
-//
+//
+// "$Id: Fl_Int_Input.H 9637 2012-07-24 04:37:22Z matt $"
+//
+// Integer input header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2010 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_Int_Input widget . */
+
+#ifndef Fl_Int_Input_H
+#define Fl_Int_Input_H
+
+#include "Fl_Input.H"
+
+/**
+  The Fl_Int_Input class is a subclass of Fl_Input that only allows
+  the user to type decimal digits (or hex numbers of the form 0xaef).
+*/
+class FL_EXPORT Fl_Int_Input : public Fl_Input {
+public:
+  /**
+    Creates a new Fl_Int_Input widget using the given position,
+    size, and label string. The default boxtype is FL_DOWN_BOX.
+
+    Inherited destructor destroys the widget and any value associated with it.
+  */
+  Fl_Int_Input(int X,int Y,int W,int H,const char *l = 0);
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_Int_Input, Fl_Input)
+};
+
+class FL_EXPORT Fl_Int_Input_Fmt : public Fl_Int_Input {
+public:
+  Fl_Int_Input_Fmt(int X,int Y,int W,int H,const char *l = 0)
+      : Fl_Int_Input(X,Y,W,H,l) {use_numeric_format(1);}
+};
+
+#endif
+//
+// End of "$Id: Fl_Int_Input.H 9637 2012-07-24 04:37:22Z matt $".
+//

+ 46 - 47
fltk/FL/Fl_JPEG_Image.H

@@ -1,47 +1,46 @@
-//
-// "$Id: Fl_JPEG_Image.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
-//
-// JPEG image header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_JPEG_Image class . */
-
-#ifndef Fl_JPEG_Image_H
-#define Fl_JPEG_Image_H
-#  include "Fl_Image.H"
-
-/**
-  The Fl_JPEG_Image class supports loading, caching,
-  and drawing of Joint Photographic Experts Group (JPEG) File
-  Interchange Format (JFIF) images. The class supports grayscale
-  and color (RGB) JPEG image files.
-*/
-class FL_EXPORT Fl_JPEG_Image : public Fl_RGB_Image {
-
-public:
-
-  Fl_JPEG_Image(const char *filename);
-  Fl_JPEG_Image(const char *name, const unsigned char *data);
-  static int encode(Fl_Image *img, int quality, unsigned char **outbuffer, int &outlen);
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_JPEG_Image, Fl_RGB_Image)
-};
-
-#endif
-
-//
-// End of "$Id: Fl_JPEG_Image.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
-//
+//
+// "$Id: Fl_JPEG_Image.H 10732 2015-05-23 23:42:26Z matt $"
+//
+// JPEG image header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2010 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_JPEG_Image class . */
+
+#ifndef Fl_JPEG_Image_H
+#define Fl_JPEG_Image_H
+#  include "Fl_Image.H"
+
+/**
+ The Fl_JPEG_Image class supports loading, caching,
+ and drawing of Joint Photographic Experts Group (JPEG) File
+ Interchange Format (JFIF) images. The class supports grayscale
+ and color (RGB) JPEG image files.
+ */
+class FL_EXPORT Fl_JPEG_Image : public Fl_RGB_Image {
+
+public:
+
+  Fl_JPEG_Image(const char *filename);
+  Fl_JPEG_Image(const char *name, const unsigned char *data);
+  static int encode(Fl_Image *img, int quality, unsigned char **outbuffer, int &outlen);
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_JPEG_Image, Fl_RGB_Image)
+};
+
+#endif
+
+//
+// End of "$Id: Fl_JPEG_Image.H 10732 2015-05-23 23:42:26Z matt $".
+//

+ 51 - 52
fltk/FL/Fl_Light_Button.H

@@ -1,52 +1,51 @@
-//
-// "$Id: Fl_Light_Button.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
-//
-// Lighted button header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_Light_Button widget . */
-
-#ifndef Fl_Light_Button_H
-#define Fl_Light_Button_H
-
-#include "Fl_Button.H"
-
-/**
-  This subclass displays the "on" state by turning on a light, 
-  rather than drawing pushed in.  The shape of the  "light" 
-  is initially set to FL_DOWN_BOX.  The color of the light when
-  on is controlled with selection_color(), which defaults to FL_YELLOW.
-
-  Buttons generate callbacks when they are clicked by the user.  You
-  control exactly when and how by changing the values for type() and when().
-  <P ALIGN=CENTER>\image html Fl_Light_Button.png</P> 
-  \image latex Fl_Light_Button.png "Fl_Light_Button" width=4cm
-*/
-class FL_EXPORT Fl_Light_Button : public Fl_Button {
-protected:
-    virtual void draw();
-public:
-    virtual int handle(int);
-    Fl_Light_Button(int x,int y,int w,int h,const char *l = 0);
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_Light_Button, Fl_Button)
-};
-
-#endif
-
-//
-// End of "$Id: Fl_Light_Button.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
-//
+//
+// "$Id: Fl_Light_Button.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
+//
+// Lighted button header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2010 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_Light_Button widget . */
+
+#ifndef Fl_Light_Button_H
+#define Fl_Light_Button_H
+
+#include "Fl_Button.H"
+
+/**
+  This subclass displays the "on" state by turning on a light, 
+  rather than drawing pushed in.  The shape of the  "light" 
+  is initially set to FL_DOWN_BOX.  The color of the light when
+  on is controlled with selection_color(), which defaults to FL_YELLOW.
+
+  Buttons generate callbacks when they are clicked by the user.  You
+  control exactly when and how by changing the values for type() and when().
+  <P ALIGN=CENTER>\image html Fl_Light_Button.png</P> 
+  \image latex Fl_Light_Button.png "Fl_Light_Button" width=4cm
+*/
+class FL_EXPORT Fl_Light_Button : public Fl_Button {
+protected:
+    virtual void draw();
+public:
+    virtual int handle(int);
+    Fl_Light_Button(int x,int y,int w,int h,const char *l = 0);
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_Light_Button, Fl_Button)
+};
+
+#endif
+
+//
+// End of "$Id: Fl_Light_Button.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
+//

+ 37 - 38
fltk/FL/Fl_Line_Dial.H

@@ -1,38 +1,37 @@
-//
-// "$Id: Fl_Line_Dial.H 9637 2012-07-24 04:37:22Z matt $"
-//
-// Line dial header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_Line_Dial widget . */
-
-#ifndef Fl_Line_Dial_H
-#define Fl_Line_Dial_H
-
-#include "Fl_Dial.H"
-
-class FL_EXPORT Fl_Line_Dial : public Fl_Dial {
-public:
-  Fl_Line_Dial(int X,int Y,int W,int H, const char *L = 0);
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_Line_Dial, Fl_Dial)
-};
-
-#endif
-
-//
-// End of "$Id: Fl_Line_Dial.H 9637 2012-07-24 04:37:22Z matt $".
-//
+//
+// "$Id: Fl_Line_Dial.H 9637 2012-07-24 04:37:22Z matt $"
+//
+// Line dial header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2010 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_Line_Dial widget . */
+
+#ifndef Fl_Line_Dial_H
+#define Fl_Line_Dial_H
+
+#include "Fl_Dial.H"
+
+class FL_EXPORT Fl_Line_Dial : public Fl_Dial {
+public:
+  Fl_Line_Dial(int X,int Y,int W,int H, const char *L = 0);
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_Line_Dial, Fl_Dial)
+};
+
+#endif
+
+//
+// End of "$Id: Fl_Line_Dial.H 9637 2012-07-24 04:37:22Z matt $".
+//

+ 24 - 24
fltk/FL/Fl_Menu.H

@@ -1,24 +1,24 @@
-//
-// "$Id: Fl_Menu.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
-//
-// Old menu header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-// this include file is for back compatibility only
-#include "Fl_Menu_Item.H"
-
-//
-// End of "$Id: Fl_Menu.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
-//
+//
+// "$Id: Fl_Menu.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
+//
+// Old menu header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2010 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+// this include file is for back compatibility only
+#include "Fl_Menu_Item.H"
+
+//
+// End of "$Id: Fl_Menu.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
+//

+ 191 - 176
fltk/FL/Fl_Menu_.H

@@ -1,176 +1,191 @@
-//
-// "$Id: Fl_Menu_.H 9202 2011-12-08 17:10:11Z greg.ercolano $"
-//
-// Menu base class header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_Menu_ widget . */
-
-#ifndef Fl_Menu__H
-#define Fl_Menu__H
-
-#ifndef Fl_Widget_H
-#include "Fl_Widget.H"
-#endif
-#include "Fl_Menu_Item.H"
-
-/**
-  Base class of all widgets that have a menu in FLTK.
-  Currently FLTK provides you with 
-  Fl_Menu_Button, Fl_Menu_Bar, and Fl_Choice.
-  
-  <P>The class contains a pointer to an array of structures of type  Fl_Menu_Item.  The
-  array may either be supplied directly by the user program, or it may
-  be "private": a dynamically allocated array managed by the Fl_Menu_.
-*/
-class FL_EXPORT Fl_Menu_ : public Fl_Widget {
-
-  Fl_Menu_Item *menu_;
-  const Fl_Menu_Item *value_;
-
-protected:
-
-  uchar alloc;			// flag indicates if menu_ is a dynamic copy (=1) or not (=0)
-  uchar down_box_;
-  Fl_Font textfont_;
-  Fl_Fontsize textsize_;
-  Fl_Color textcolor_;
-
-public:
-  Fl_Menu_(int,int,int,int,const char * =0);
-  ~Fl_Menu_();
-
-  int item_pathname(char *name, int namelen, const Fl_Menu_Item *finditem=0) const;
-  const Fl_Menu_Item* picked(const Fl_Menu_Item*);
-  const Fl_Menu_Item* find_item(const char *name);
-  const Fl_Menu_Item* find_item(Fl_Callback*);
-  int find_index(const char *name) const;
-  int find_index(const Fl_Menu_Item *item) const;
-  int find_index(Fl_Callback *cb) const;
-
-  /**
-    Returns the menu item with the entered shortcut (key value).
-
-    This searches the complete menu() for a shortcut that matches the
-    entered key value.  It must be called for a FL_KEYBOARD or FL_SHORTCUT
-    event.
-
-    If a match is found, the menu's callback will be called.
-
-    \return matched Fl_Menu_Item or NULL.
-  */
-  const Fl_Menu_Item* test_shortcut() {return picked(menu()->test_shortcut());}
-  void global();
-
-  /**
-    Returns a pointer to the array of Fl_Menu_Items.  This will either be
-    the value passed to menu(value) or the private copy.
-    \sa size() -- returns the size of the Fl_Menu_Item array.
-
-    \b Example: How to walk the array:
-    \code
-    for ( int t=0; t<menubar->size(); t++ ) {                // walk array of items
-        const Fl_Menu_Item &item = menubar->menu()[t];       // get each item
-        fprintf(stderr, "item #%d -- label=%s, value=%s type=%s\n",
-            t,
-            item.label() ? item.label() : "(Null)",          // menu terminators have NULL labels
-            (item.flags & FL_MENU_VALUE) ? "set" : "clear",  // value of toggle or radio items
-            (item.flags & FL_SUBMENU) ? "Submenu" : "Item"); // see if item is a submenu or actual item
-    }
-    \endcode
-
-  */  
-  const Fl_Menu_Item *menu() const {return menu_;}
-  Fl_Menu_Item *menu_at(int idx) {return (idx >= 0 && idx < size()) ? &menu_[idx] : 0;}
-  void menu(const Fl_Menu_Item *m);
-  void copy(const Fl_Menu_Item *m, void* user_data = 0);
-  int insert(int index, const char*, int shortcut, Fl_Callback*, void* = 0, int = 0);
-  int  add(const char*, int shortcut, Fl_Callback*, void* = 0, int = 0);
-  /** See int Fl_Menu_::add(const char* label, int shortcut, Fl_Callback*, void *user_data=0, int flags=0) */
-  int  add(const char* a, const char* b, Fl_Callback* c, void* d = 0, int e = 0) {
-      return add(a,fl_old_shortcut(b),c,d,e);
-  }
-  /** See int Fl_Menu_::insert(const char* label, int shortcut, Fl_Callback*, void *user_data=0, int flags=0) */
-  int insert(int index, const char* a, const char* b, Fl_Callback* c, void* d = 0, int e = 0) {
-      return insert(index,a,fl_old_shortcut(b),c,d,e);
-  }
-  int  add(const char *);
-  int  size() const ;
-  void size(int W, int H) { Fl_Widget::size(W, H); }
-  void clear();
-  int clear_submenu(int index);
-  void replace(int,const char *);
-  void remove(int);
- /** Changes the shortcut of item i to n.  */
-  void shortcut(int i, int s) {menu_[i].shortcut(s);}
-  /** Sets the flags of item i.  For a list of the flags, see Fl_Menu_Item.  */
-  void mode(int i,int fl) {menu_[i].flags = fl;}
-  /** Gets the flags of item i.  For a list of the flags, see Fl_Menu_Item.  */
-  int  mode(int i) const {return menu_[i].flags;}
-
-  /** Returns a pointer to the last menu item that was picked.  */
-  const Fl_Menu_Item *mvalue() const {return value_;}
-  /** Returns the index into menu() of the last item chosen by the user.  It is zero initially. */
-  int value() const {return value_ ? (int)(value_-menu_) : -1;}
-  int value(const Fl_Menu_Item*);
-  /**
-    The value is the index into menu() of the last item chosen by
-    the user.  It is zero initially.  You can set it as an integer, or set
-    it with a pointer to a menu item.  The set routines return non-zero if
-    the new value is different than the old one.
-  */
-  int value(int i) {return value(menu_+i);}
-  /** Returns the title of the last item chosen.  */
-  const char *text() const {return value_ ? value_->text : 0;}
-  /** Returns the title of item i.  */
-  const char *text(int i) const {return menu_[i].text;}
-
-  /** Gets the current font of menu item labels.  */
-  Fl_Font textfont() const {return textfont_;}
-  /**  Sets the current font of menu item labels.  */
-  void textfont(Fl_Font c) {textfont_=c;}
-  /**  Gets the font size of menu item labels.  */
-  Fl_Fontsize textsize() const {return textsize_;}
-  /**  Sets the font size of menu item labels.  */
-  void textsize(Fl_Fontsize c) {textsize_=c;}
-  /** Get the current color of menu item labels.  */
-  Fl_Color textcolor() const {return textcolor_;}
-  /** Sets the current color of menu item labels. */
-  void textcolor(Fl_Color c) {textcolor_=c;}
-
-  /**
-    This box type is used to surround the currently-selected items in the
-    menus.  If this is FL_NO_BOX then it acts like 
-    FL_THIN_UP_BOX and selection_color() acts like 
-    FL_WHITE, for back compatibility.    
-  */
-  Fl_Boxtype down_box() const {return (Fl_Boxtype)down_box_;}
-  /**    See Fl_Boxtype Fl_Menu_::down_box() const   */
-  void down_box(Fl_Boxtype b) {down_box_ = b;}
-
-  /** For back compatibility, same as selection_color() */
-  Fl_Color down_color() const {return selection_color();}
-  /** For back compatibility, same as selection_color() */
-  void down_color(unsigned c) {selection_color(c);}
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_Menu_, Fl_Widget)
-};
-
-#endif
-
-//
-// End of "$Id: Fl_Menu_.H 9202 2011-12-08 17:10:11Z greg.ercolano $".
-//
+//
+// "$Id: Fl_Menu_.H 11802 2016-07-09 17:14:22Z AlbrechtS $"
+//
+// Menu base class header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2016 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_Menu_ widget . */
+
+#ifndef Fl_Menu__H
+#define Fl_Menu__H
+
+#ifndef Fl_Widget_H
+#include "Fl_Widget.H"
+#endif
+#include "Fl_Menu_Item.H"
+
+/**
+  Base class of all widgets that have a menu in FLTK.
+
+  Currently FLTK provides you with Fl_Menu_Button, Fl_Menu_Bar, and Fl_Choice.
+
+  The class contains a pointer to an array of structures of type Fl_Menu_Item.
+  The array may either be supplied directly by the user program, or it may
+  be "private": a dynamically allocated array managed by the Fl_Menu_.
+
+  When the user clicks a menu item, value() is set to that item
+  and then:
+
+    - If the Fl_Menu_Item has a callback set, that callback
+      is invoked with any userdata configured for it.
+      (The Fl_Menu_ widget's callback is NOT invoked.)
+
+    - For any Fl_Menu_Items that \b don't have a callback set,
+      the Fl_Menu_ widget's callback is invoked with any userdata
+      configured for it. The callback can determine which item
+      was picked using value(), mvalue(), item_pathname(), etc.
+*/
+class FL_EXPORT Fl_Menu_ : public Fl_Widget {
+
+  Fl_Menu_Item *menu_;
+  const Fl_Menu_Item *value_;
+
+protected:
+
+  uchar alloc;			// flag indicates if menu_ is a dynamic copy (=1) or not (=0)
+  uchar down_box_;
+  Fl_Font textfont_;
+  Fl_Fontsize textsize_;
+  Fl_Color textcolor_;
+
+  int item_pathname_(char *name, int namelen, const Fl_Menu_Item *finditem,
+                     const Fl_Menu_Item *menu=0) const;
+public:
+  Fl_Menu_(int,int,int,int,const char * =0);
+  ~Fl_Menu_();
+
+  int item_pathname(char *name, int namelen, const Fl_Menu_Item *finditem=0) const;
+  const Fl_Menu_Item* picked(const Fl_Menu_Item*);
+  const Fl_Menu_Item* find_item(const char *name);
+  const Fl_Menu_Item* find_item(Fl_Callback*);
+  int find_index(const char *name) const;
+  int find_index(const Fl_Menu_Item *item) const;
+  int find_index(Fl_Callback *cb) const;
+
+  /**
+    Returns the menu item with the entered shortcut (key value).
+
+    This searches the complete menu() for a shortcut that matches the
+    entered key value.  It must be called for a FL_KEYBOARD or FL_SHORTCUT
+    event.
+
+    If a match is found, the menu's callback will be called.
+
+    \return matched Fl_Menu_Item or NULL.
+  */
+  const Fl_Menu_Item* test_shortcut() {return picked(menu()->test_shortcut());}
+  void global();
+
+  /**
+    Returns a pointer to the array of Fl_Menu_Items.  This will either be
+    the value passed to menu(value) or the private copy.
+    \sa size() -- returns the size of the Fl_Menu_Item array.
+
+    \b Example: How to walk the array:
+    \code
+    for ( int t=0; t<menubar->size(); t++ ) {                // walk array of items
+        const Fl_Menu_Item &item = menubar->menu()[t];       // get each item
+        fprintf(stderr, "item #%d -- label=%s, value=%s type=%s\n",
+            t,
+            item.label() ? item.label() : "(Null)",          // menu terminators have NULL labels
+            (item.flags & FL_MENU_VALUE) ? "set" : "clear",  // value of toggle or radio items
+            (item.flags & FL_SUBMENU) ? "Submenu" : "Item"); // see if item is a submenu or actual item
+    }
+    \endcode
+
+  */
+  const Fl_Menu_Item *menu() const {return menu_;}
+  Fl_Menu_Item *menu_at(int idx) {return (idx >= 0 && idx < size()) ? &menu_[idx] : 0;}
+  void menu(const Fl_Menu_Item *m);
+  void copy(const Fl_Menu_Item *m, void* user_data = 0);
+  int insert(int index, const char*, int shortcut, Fl_Callback*, void* = 0, int = 0);
+  int  add(const char*, int shortcut, Fl_Callback*, void* = 0, int = 0); // see src/Fl_Menu_add.cxx
+  /** See int Fl_Menu_::add(const char* label, int shortcut, Fl_Callback*, void *user_data=0, int flags=0) */
+  int  add(const char* a, const char* b, Fl_Callback* c, void* d = 0, int e = 0) {
+      return add(a,fl_old_shortcut(b),c,d,e);
+  }
+  /** See int Fl_Menu_::insert(const char* label, int shortcut, Fl_Callback*, void *user_data=0, int flags=0) */
+  int insert(int index, const char* a, const char* b, Fl_Callback* c, void* d = 0, int e = 0) {
+      return insert(index,a,fl_old_shortcut(b),c,d,e);
+  }
+  int  add(const char *);
+  int  size() const ;
+  void size(int W, int H) { Fl_Widget::size(W, H); }
+  void clear();
+  int clear_submenu(int index);
+  void replace(int,const char *);
+  void remove(int);
+  /** Changes the shortcut of item \p i to \p s. */
+  void shortcut(int i, int s) {menu_[i].shortcut(s);}
+  /** Sets the flags of item i.  For a list of the flags, see Fl_Menu_Item.  */
+  void mode(int i,int fl) {menu_[i].flags = fl;}
+  /** Gets the flags of item i.  For a list of the flags, see Fl_Menu_Item.  */
+  int  mode(int i) const {return menu_[i].flags;}
+
+  /** Returns a pointer to the last menu item that was picked.  */
+  const Fl_Menu_Item *mvalue() const {return value_;}
+  /** Returns the index into menu() of the last item chosen by the user.  It is zero initially. */
+  int value() const {return value_ ? (int)(value_-menu_) : -1;}
+  int value(const Fl_Menu_Item*);
+  /**
+    The value is the index into menu() of the last item chosen by
+    the user.  It is zero initially.  You can set it as an integer, or set
+    it with a pointer to a menu item.  The set routines return non-zero if
+    the new value is different than the old one.
+  */
+  int value(int i) {return value(menu_+i);}
+  /** Returns the title of the last item chosen.  */
+  const char *text() const {return value_ ? value_->text : 0;}
+  /** Returns the title of item i.  */
+  const char *text(int i) const {return menu_[i].text;}
+
+  /** Gets the current font of menu item labels.  */
+  Fl_Font textfont() const {return textfont_;}
+  /**  Sets the current font of menu item labels.  */
+  void textfont(Fl_Font c) {textfont_=c;}
+  /**  Gets the font size of menu item labels.  */
+  Fl_Fontsize textsize() const {return textsize_;}
+  /**  Sets the font size of menu item labels.  */
+  void textsize(Fl_Fontsize c) {textsize_=c;}
+  /** Get the current color of menu item labels.  */
+  Fl_Color textcolor() const {return textcolor_;}
+  /** Sets the current color of menu item labels. */
+  void textcolor(Fl_Color c) {textcolor_=c;}
+
+  /**
+    This box type is used to surround the currently-selected items in the
+    menus.  If this is FL_NO_BOX then it acts like
+    FL_THIN_UP_BOX and selection_color() acts like
+    FL_WHITE, for back compatibility.
+  */
+  Fl_Boxtype down_box() const {return (Fl_Boxtype)down_box_;}
+  /**    See Fl_Boxtype Fl_Menu_::down_box() const   */
+  void down_box(Fl_Boxtype b) {down_box_ = b;}
+
+  /** For back compatibility, same as selection_color() */
+  Fl_Color down_color() const {return selection_color();}
+  /** For back compatibility, same as selection_color() */
+  void down_color(unsigned c) {selection_color(c);}
+  void setonly(Fl_Menu_Item* item);
+
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_Menu_, Fl_Widget)
+};
+
+#endif
+
+//
+// End of "$Id: Fl_Menu_.H 11802 2016-07-09 17:14:22Z AlbrechtS $".
+//

+ 104 - 81
fltk/FL/Fl_Menu_Bar.H

@@ -1,81 +1,104 @@
-//
-// "$Id: Fl_Menu_Bar.H 9637 2012-07-24 04:37:22Z matt $"
-//
-// Menu bar header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_Menu_Bar widget . */
-
-#ifndef Fl_Menu_Bar_H
-#define Fl_Menu_Bar_H
-
-#include "Fl_Menu_.H"
-
-/**
-  This widget provides a standard menubar interface.  Usually you will
-  put this widget along the top edge of your window.  The height of the
-  widget should be 30 for the menu titles to draw correctly with the
-  default font.
-  <P>The items on the bar and the menus they bring up are defined by a
-  single Fl_Menu_Item
-  array.  Because a Fl_Menu_Item array defines a hierarchy, the
-  top level menu defines the items in the menubar, while the submenus
-  define the pull-down menus. Sub-sub menus and lower pop up to the right
-  of the submenus. </P>
-  <P ALIGN=CENTER>\image html  menubar.png</P>
-  \image latex  menubar.png " menubar" width=12cm
-  <P>If there is an item in the top menu that is not a title of a
-  submenu, then it acts like a "button" in the menubar.  Clicking on it
-  will pick it. </P>
-  <P>When the user picks an item off the menu, the item's callback is
-  done with the menubar as the Fl_Widget* argument.  If the item
-  does not have a callback the menubar's callback is done instead. </P>
-  <P>Submenus will also pop up in response to shortcuts indicated by
-  putting a '&' character in the name field of the menu item. If you put a
-  '&' character in a top-level "button" then the shortcut picks it.  The
-  '&' character in submenus is ignored until the menu is popped up. </P>
-  <P>Typing the shortcut() of any of the menu items will cause
-  callbacks exactly the same as when you pick the item with the mouse.
-*/
-class FL_EXPORT Fl_Menu_Bar : public Fl_Menu_ {
-protected:
-    void draw();
-public:
-    int handle(int);
-  /**
-      Creates a new Fl_Menu_Bar widget using the given position,
-    size, and label string. The default boxtype is FL_UP_BOX.
-    <P>The constructor sets menu() to NULL.  See 
-    Fl_Menu_ for the methods to set or change the menu. </P>
-    <P>labelsize(), labelfont(), and labelcolor()
-    are used to control how the menubar items are drawn.  They are
-    initialized from the Fl_Menu static variables, but you can
-    change them if desired. </P>
-    <P>label() is ignored unless you change align() to
-    put it outside the menubar.
-    <P>The destructor removes the Fl_Menu_Bar widget and all of its
-    menu items.
-  */
-    Fl_Menu_Bar(int X, int Y, int W, int H,const char *l=0);
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_Menu_Bar, Fl_Menu_)
-};
-
-#endif
-
-//
-// End of "$Id: Fl_Menu_Bar.H 9637 2012-07-24 04:37:22Z matt $".
-//
+//
+// "$Id: Fl_Menu_Bar.H 12575 2017-12-02 16:20:30Z manolo $"
+//
+// Menu bar header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2017 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_Menu_Bar widget . */
+
+#ifndef Fl_Menu_Bar_H
+#define Fl_Menu_Bar_H
+
+#include "Fl_Menu_.H"
+
+/**
+  This widget provides a standard menubar interface.  Usually you will
+  put this widget along the top edge of your window.  The height of the
+  widget should be 30 for the menu titles to draw correctly with the
+  default font.
+
+  The items on the bar and the menus they bring up are defined by a
+  single Fl_Menu_Item array.
+  Because a Fl_Menu_Item array defines a hierarchy, the
+  top level menu defines the items in the menubar, while the submenus
+  define the pull-down menus. Sub-sub menus and lower pop up to the right
+  of the submenus.
+
+  \image html  menubar.png
+  \image latex  menubar.png " menubar" width=12cm
+
+  If there is an item in the top menu that is not a title of a
+  submenu, then it acts like a "button" in the menubar.  Clicking on it
+  will pick it.
+
+  When the user clicks a menu item, value() is set to that item
+  and then:
+
+    - The item's callback is done if one has been set; the
+      Fl_Menu_Bar is passed as the Fl_Widget* argument,
+      along with any userdata configured for the callback.
+
+    - If the item does not have a callback, the Fl_Menu_Bar's callback
+      is done instead, along with any userdata configured for the callback.
+      The callback can determine which item was picked using
+      value(), mvalue(), item_pathname(), etc.
+
+  Submenus will also pop up in response to shortcuts indicated by
+  putting a '&' character in the name field of the menu item. If you put a
+  '&' character in a top-level "button" then the shortcut picks it.  The
+  '&' character in submenus is ignored until the menu is popped up.
+
+  Typing the shortcut() of any of the menu items will cause
+  callbacks exactly the same as when you pick the item with the mouse.
+*/
+class FL_EXPORT Fl_Menu_Bar : public Fl_Menu_ {
+  friend class Fl_Sys_Menu_Bar_Driver;
+protected:
+    void draw();
+public:
+    int handle(int);
+  /**
+    Creates a new Fl_Menu_Bar widget using the given position,
+    size, and label string. The default boxtype is FL_UP_BOX.
+
+    The constructor sets menu() to NULL.  See
+    Fl_Menu_ for the methods to set or change the menu.
+
+    labelsize(), labelfont(), and labelcolor()
+    are used to control how the menubar items are drawn.  They are
+    initialized from the Fl_Menu static variables, but you can
+    change them if desired.
+
+    label() is ignored unless you change align() to
+    put it outside the menubar.
+
+    The destructor removes the Fl_Menu_Bar widget and all of its
+    menu items.
+  */
+  Fl_Menu_Bar(int X, int Y, int W, int H, const char *l=0);
+  /** Updates the menu bar after any change to its items.
+   This is useful when the menu bar can be an Fl_Sys_Menu_Bar object.
+   */
+  virtual void update() {}
+
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_Menu_Bar, Fl_Menu_)
+};
+
+#endif
+
+//
+// End of "$Id: Fl_Menu_Bar.H 12575 2017-12-02 16:20:30Z manolo $".
+//

+ 87 - 80
fltk/FL/Fl_Menu_Button.H

@@ -1,80 +1,87 @@
-//
-// "$Id: Fl_Menu_Button.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
-//
-// Menu button header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_Menu_Button widget . */
-
-#ifndef Fl_Menu_Button_H
-#define Fl_Menu_Button_H
-
-#include "Fl_Menu_.H"
-
-/**
-  This is a button that when pushed pops up a menu (or hierarchy of
-  menus) defined by an array of
-  Fl_Menu_Item objects.
-  <P ALIGN=CENTER>\image html  menu_button.png</P>
-  \image latex  menu_button.png " menu_button" width=5cm
-  <P>Normally any mouse button will pop up a menu and it is lined up
-  below the button as shown in the picture.  However an Fl_Menu_Button
-  may also control a pop-up menu.  This is done by setting the type().
-  If type() is zero a normal menu button is produced.
-  If it is nonzero then this is a pop-up menu. The bits in type() indicate
-  what mouse buttons pop up the menu (see Fl_Menu_Button::popup_buttons). </P>
-  <P>The menu will also pop up in response to shortcuts indicated by
-  putting a '&' character in the label(). </P>
-  <P>Typing the shortcut() of any of the menu items will cause
-  callbacks exactly the same as when you pick the item with the mouse.
-  The '&' character in menu item names are only looked at when the menu is
-  popped up, however. </P>
-  <P>When the user picks an item off the menu, the item's callback is
-  done with the menu_button as the Fl_Widget* argument.  If the
-  item does not have a callback the menu_button's callback is done
-  instead.
-*/
-class FL_EXPORT Fl_Menu_Button : public Fl_Menu_ {
-protected:
-  void draw();
-public:
-  /**
-   \brief indicate what mouse buttons pop up the menu.
-
-   Values for type() used to indicate what mouse buttons pop up the menu.
-   Fl_Menu_Button::POPUP3 is usually what you want.
-   */
-  enum popup_buttons {POPUP1 = 1, /**< pops up with the mouse 1st button. */
-    POPUP2,  /**< pops up with the mouse 2nd button. */
-    POPUP12, /**< pops up with the mouse 1st or 2nd buttons. */
-    POPUP3,   /**< pops up with the mouse 3rd button. */
-    POPUP13,  /**< pops up with the mouse 1st or 3rd buttons. */
-    POPUP23,  /**< pops up with the mouse 2nd or 3rd buttons. */
-    POPUP123 /**< pops up with any mouse button. */
-  };
-  int handle(int);
-  const Fl_Menu_Item* popup();
-  const Fl_Menu_Item* popup(int x, int y);
-  Fl_Menu_Button(int,int,int,int,const char * =0);
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_Menu_Button, Fl_Menu_)
-};
-
-#endif
-
-//
-// End of "$Id: Fl_Menu_Button.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
-//
+//
+// "$Id: Fl_Menu_Button.H 10513 2015-01-10 22:05:15Z greg.ercolano $"
+//
+// Menu button header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2010 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_Menu_Button widget . */
+
+#ifndef Fl_Menu_Button_H
+#define Fl_Menu_Button_H
+
+#include "Fl_Menu_.H"
+
+/**
+  This is a button that when pushed pops up a menu (or hierarchy of
+  menus) defined by an array of 
+  Fl_Menu_Item objects.
+  <P ALIGN=CENTER>\image html  menu_button.png</P>
+  \image latex  menu_button.png " menu_button" width=5cm
+  <P>Normally any mouse button will pop up a menu and it is lined up
+  below the button as shown in the picture.  However an Fl_Menu_Button
+  may also control a pop-up menu.  This is done by setting the type().
+  If type() is zero a normal menu button is produced. 
+  If it is nonzero then this is a pop-up menu. The bits in type() indicate 
+  what mouse buttons pop up the menu (see Fl_Menu_Button::popup_buttons). </P>
+  <P>The menu will also pop up in response to shortcuts indicated by
+  putting a '&' character in the label(). </P>
+  <P>Typing the shortcut() of any of the menu items will cause
+  callbacks exactly the same as when you pick the item with the mouse.
+  The '&' character in menu item names are only looked at when the menu is
+  popped up, however. </P>
+
+  When the user clicks a menu item, value() is set to that item
+  and then:
+
+      - The item's callback is done if one has been set; the
+        Fl_Menu_Button is passed as the Fl_Widget* argument, 
+        along with any userdata configured for the callback.
+
+      - If the item does not have a callback, the Fl_Menu_Button's callback
+        is done instead, along with any userdata configured for it.
+        The callback can determine which item was picked using
+        value(), mvalue(), item_pathname(), etc.
+*/
+class FL_EXPORT Fl_Menu_Button : public Fl_Menu_ {
+protected:
+  void draw();
+public:
+  /**
+   \brief indicate what mouse buttons pop up the menu.
+   
+   Values for type() used to indicate what mouse buttons pop up the menu. 
+   Fl_Menu_Button::POPUP3 is usually what you want.
+   */  
+  enum popup_buttons {POPUP1 = 1, /**< pops up with the mouse 1st button. */
+    POPUP2,  /**< pops up with the mouse 2nd button. */
+    POPUP12, /**< pops up with the mouse 1st or 2nd buttons. */
+    POPUP3,   /**< pops up with the mouse 3rd button. */
+    POPUP13,  /**< pops up with the mouse 1st or 3rd buttons. */
+    POPUP23,  /**< pops up with the mouse 2nd or 3rd buttons. */
+    POPUP123 /**< pops up with any mouse button. */
+  };
+  int handle(int);
+  const Fl_Menu_Item* popup();
+  const Fl_Menu_Item* popup(int x, int y);
+  Fl_Menu_Button(int,int,int,int,const char * =0);
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_Menu_Button, Fl_Menu_)
+};
+
+#endif
+
+//
+// End of "$Id: Fl_Menu_Button.H 10513 2015-01-10 22:05:15Z greg.ercolano $".
+//

+ 450 - 436
fltk/FL/Fl_Menu_Item.H

@@ -1,436 +1,450 @@
-//
-// "$Id: Fl_Menu_Item.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
-//
-// Menu item header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-#ifndef Fl_Menu_Item_H
-#define Fl_Menu_Item_H
-
-#  include "Fl_Widget.H"
-#  include "Fl_Image.H"
-
-#  if defined(__APPLE__) && defined(check)
-#    undef check
-#  endif
-
-enum { // values for flags:
-  FL_MENU_INACTIVE = 1,		///< Deactivate menu item (gray out)
-  FL_MENU_TOGGLE= 2,		///< Item is a checkbox toggle (shows checkbox for on/off state)
-  FL_MENU_VALUE = 4,		///< The on/off state for checkbox/radio buttons (if set, state is 'on')
-  FL_MENU_RADIO = 8,		///< Item is a radio button (one checkbox of many can be on)
-  FL_MENU_INVISIBLE = 0x10,	///< Item will not show up (shortcut will work)
-  FL_SUBMENU_POINTER = 0x20,	///< Indicates user_data() is a pointer to another menu array
-  FL_SUBMENU = 0x40,		///< This item is a submenu to other items
-  FL_MENU_DIVIDER = 0x80,	///< Creates divider line below this item. Also ends a group of radio buttons.
-  FL_MENU_HORIZONTAL = 0x100	///< ??? -- reserved
-};
-
-extern FL_EXPORT Fl_Shortcut fl_old_shortcut(const char*);
-
-class Fl_Menu_;
-
-/**
-  The Fl_Menu_Item structure defines a single menu item that
-  is used by the Fl_Menu_ class.  
-  \code
-  class Fl_Menu_Item {
-   const char*		text;     // label()
-   ulong		shortcut_;
-   Fl_Callback*		callback_;
-   void*		user_data_;
-   int			flags;
-   uchar		labeltype_;
-   uchar		labelfont_;
-   uchar		labelsize_;
-   uchar		labelcolor_;
-  };
-  
-  enum { // values for flags:
-   FL_MENU_INACTIVE	= 1,      // Deactivate menu item (gray out)
-   FL_MENU_TOGGLE	= 2,      // Item is a checkbox toggle (shows checkbox for on/off state)
-   FL_MENU_VALUE	= 4,      // The on/off state for checkbox/radio buttons (if set, state is 'on')
-   FL_MENU_RADIO	= 8,      // Item is a radio button (one checkbox of many can be on)
-   FL_MENU_INVISIBLE	= 0x10,   // Item will not show up (shortcut will work)
-   FL_SUBMENU_POINTER	= 0x20,   // Indicates user_data() is a pointer to another menu array
-   FL_SUBMENU		= 0x40,   // This item is a submenu to other items
-   FL_MENU_DIVIDER	= 0x80,   // Creates divider line below this item. Also ends a group of radio buttons.
-   FL_MENU_HORIZONTAL	= 0x100   // ??? -- reserved
-  };
-  \endcode
-  Typically menu items are statically defined; for example:
-  \code
-  Fl_Menu_Item popup[] = {
-   {"&alpha",   FL_ALT+'a', the_cb, (void*)1},
-   {"&beta",    FL_ALT+'b', the_cb, (void*)2},
-   {"gamma",    FL_ALT+'c', the_cb, (void*)3, FL_MENU_DIVIDER},
-   {"&strange",  0,   strange_cb},
-   {"&charm",    0,   charm_cb},
-   {"&truth",    0,   truth_cb},
-   {"b&eauty",   0,   beauty_cb},
-   {"sub&menu",  0,   0, 0, FL_SUBMENU},
-   {"one"},
-   {"two"},
-   {"three"},
-   {0},
-   {"inactive", FL_ALT+'i', 0, 0, FL_MENU_INACTIVE|FL_MENU_DIVIDER},
-   {"invisible",FL_ALT+'i', 0, 0, FL_MENU_INVISIBLE},
-   {"check",    FL_ALT+'i', 0, 0, FL_MENU_TOGGLE|FL_MENU_VALUE},
-   {"box",      FL_ALT+'i', 0, 0, FL_MENU_TOGGLE},
-   {0}};
-  \endcode
-  produces:
-
-  \image html   menu.png
-  \image latex  menu.png "menu" width=10cm
-
-  A submenu title is identified by the bit FL_SUBMENU in the 
-  flags field, and ends with a label() that is NULL.
-  You can nest menus to any depth.  A pointer to the first item in the
-  submenu can be treated as an Fl_Menu array itself.  It is also
-  possible to make separate submenu arrays with FL_SUBMENU_POINTER flags.
-
-  You should use the method functions to access structure members and
-  not access them directly to avoid compatibility problems with future
-  releases of FLTK.
-*/
-class FL_EXPORT Fl_Menu_Item {
-public:
-  const char *text;	    ///< menu item text, returned by label()
-  int shortcut_;	    ///< menu item shortcut
-  Fl_Callback *callback_;   ///< menu item callback
-  void *user_data_;	    ///< menu item user_data for the menu's callback
-  int flags;		    ///< menu item flags like FL_MENU_TOGGLE, FL_MENU_RADIO
-  uchar labeltype_;	    ///< how the menu item text looks like
-  Fl_Font labelfont_;	    ///< which font for this menu item text
-  Fl_Fontsize labelsize_;   ///< size of menu item text
-  Fl_Color labelcolor_;	    ///< menu item text color
-
-  // advance N items, skipping submenus:
-  const Fl_Menu_Item *next(int=1) const;
-
-  /**
-    Advances a pointer by n items through a menu array, skipping
-    the contents of submenus and invisible items. There are two calls so
-    that you can advance through const and non-const data.
-  */
-  Fl_Menu_Item *next(int i=1) {
-    return (Fl_Menu_Item*)(((const Fl_Menu_Item*)this)->next(i));}
-
-  /** Returns the first menu item, same as next(0). */
-  const Fl_Menu_Item *first() const { return next(0); }
-
-  /** Returns the first menu item, same as next(0). */
-  Fl_Menu_Item *first() { return next(0); }
-
-  // methods on menu items:
-  /**
-    Returns the title of the item.
-    A NULL here indicates the end of the menu (or of a submenu).
-    A '&' in the item will print an underscore under the next letter,
-    and if the menu is popped up that letter will be a "shortcut" to pick
-    that item.  To get a real '&' put two in a row.
-  */
-  const char* label() const {return text;}
-
-  /**    See const char* Fl_Menu_Item::label() const   */
-  void label(const char* a) {text=a;}
-
-  /**    See const char* Fl_Menu_Item::label() const   */
-  void label(Fl_Labeltype a,const char* b) {labeltype_ = a; text = b;}
-
-  /**
-    Returns the menu item's labeltype.
-    A labeltype identifies a routine that draws the label of the
-    widget.  This can be used for special effects such as emboss, or to use
-    the label() pointer as another form of data such as a bitmap.
-    The value FL_NORMAL_LABEL prints the label as text.
-  */
-  Fl_Labeltype labeltype() const {return (Fl_Labeltype)labeltype_;}
-
-  /**
-    Sets the menu item's labeltype.
-    A labeltype identifies a routine that draws the label of the
-    widget.  This can be used for special effects such as emboss, or to use
-    the label() pointer as another form of data such as a bitmap.
-    The value FL_NORMAL_LABEL prints the label as text.
-  */
-  void labeltype(Fl_Labeltype a) {labeltype_ = a;}
-
-  /**
-    Gets the menu item's label color.
-    This color is passed to the labeltype routine, and is typically the
-    color of the label text.  This defaults to FL_BLACK.  If this
-    color is not black fltk will \b not use overlay bitplanes to draw
-    the menu - this is so that images put in the menu draw correctly.
-  */
-  Fl_Color labelcolor() const {return labelcolor_;}
-
-  /**
-    Sets the menu item's label color.
-    \see Fl_Color Fl_Menu_Item::labelcolor() const
-  */
-  void labelcolor(Fl_Color a) {labelcolor_ = a;}
-  /**
-    Gets the menu item's label font.
-    Fonts are identified by small 8-bit indexes into a table. See the
-    enumeration list for predefined fonts. The default value is a
-    Helvetica font. The function Fl::set_font() can define new fonts.
-  */
-  Fl_Font labelfont() const {return labelfont_;}
-
-  /**
-    Sets the menu item's label font.
-    Fonts are identified by small 8-bit indexes into a table. See the
-    enumeration list for predefined fonts. The default value is a
-    Helvetica font.  The function Fl::set_font() can define new fonts.
-  */
-  void labelfont(Fl_Font a) {labelfont_ = a;}
-
-  /** Gets the label font pixel size/height. */
-  Fl_Fontsize labelsize() const {return labelsize_;}
-
-  /** Sets the label font pixel size/height.*/
-  void labelsize(Fl_Fontsize a) {labelsize_ = a;}
-
-  /**
-    Returns the callback function that is set for the menu item.
-    Each item has space for a callback function and an argument for that
-    function. Due to back compatibility, the Fl_Menu_Item itself
-    is not passed to the callback, instead you have to get it by calling
-    ((Fl_Menu_*)w)->mvalue() where w is the widget argument.
-  */
-  Fl_Callback_p callback() const {return callback_;}
-
-  /**
-    Sets the menu item's callback function and userdata() argument.
-    \see Fl_Callback_p Fl_MenuItem::callback() const
-  */
-  void callback(Fl_Callback* c, void* p) {callback_=c; user_data_=p;}
-
-  /**
-    Sets the menu item's callback function.
-    This method does not set the userdata() argument.
-    \see Fl_Callback_p Fl_MenuItem::callback() const
-   */
-  void callback(Fl_Callback* c) {callback_=c;}
-
-  /**
-    Sets the menu item's callback function.
-    This method does not set the userdata() argument.
-    \see Fl_Callback_p Fl_MenuItem::callback() const
-   */
-  void callback(Fl_Callback0*c) {callback_=(Fl_Callback*)c;}
-
-  /**
-    Sets the menu item's callback function and userdata() argument.
-    This method does not set the userdata() argument.
-    The argument \p is cast to void* and stored as the userdata()
-    for the menu item's callback function.
-    \see Fl_Callback_p Fl_MenuItem::callback() const
-   */
-  void callback(Fl_Callback1*c, long p=0) {callback_=(Fl_Callback*)c; user_data_=(void*)p;}
-
-  /**
-    Gets the user_data() argument that is sent to the callback function.
-  */
-  void* user_data() const {return user_data_;}
-  /**
-    Sets the user_data() argument that is sent to the callback function.
-  */
-  void user_data(void* v) {user_data_ = v;}
-  /**
-    Gets the user_data() argument that is sent to the callback function.
-    For convenience you can also define the callback as taking a long
-    argument.  This method casts the stored userdata() argument to long
-    and returns it as a \e long value.
-  */
-  long argument() const {return (long)(fl_intptr_t)user_data_;}
-  /**
-    Sets the user_data() argument that is sent to the callback function.
-    For convenience you can also define the callback as taking a long
-    argument.  This method casts the given argument \p v to void*
-    and stores it in the menu item's userdata() member.
-    This may not be portable to some machines.
-  */
-  void argument(long v) {user_data_ = (void*)v;}
-
-  /** Gets what key combination shortcut will trigger the menu item. */
-  int shortcut() const {return shortcut_;}
-
-  /**
-    Sets exactly what key combination will trigger the menu item.  The
-    value is a logical 'or' of a key and a set of shift flags, for instance 
-    FL_ALT+'a' or FL_ALT+FL_F+10 or just 'a'.  A value of
-    zero disables the shortcut.
-
-    The key can be any value returned by Fl::event_key(), but will usually 
-    be an ASCII letter. Use a lower-case letter unless you require the shift 
-    key to be held down.
-
-    The shift flags can be any set of values accepted by Fl::event_state().
-    If the bit is on that shift key must be pushed.  Meta, Alt, Ctrl, 
-    and Shift must be off if they are not in the shift flags (zero for the 
-    other bits indicates a "don't care" setting).
-  */
-  void shortcut(int s) {shortcut_ = s;}
-  /**
-    Returns true if either FL_SUBMENU or FL_SUBMENU_POINTER
-    is on in the flags. FL_SUBMENU indicates an embedded submenu
-    that goes from the next item through the next one with a NULL
-    label(). FL_SUBMENU_POINTER indicates that user_data()
-    is a pointer to another menu array.
-  */
-  int submenu() const {return flags&(FL_SUBMENU|FL_SUBMENU_POINTER);}
-  /**
-    Returns true if a checkbox will be drawn next to this item.
-    This is true if FL_MENU_TOGGLE or FL_MENU_RADIO is set in the flags.
-  */
-  int checkbox() const {return flags&FL_MENU_TOGGLE;}
-  /**
-    Returns true if this item is a radio item.
-    When a radio button is selected all "adjacent" radio buttons are
-    turned off.  A set of radio items is delimited by an item that has
-    radio() false, or by an item with FL_MENU_DIVIDER turned on.
-  */
-  int radio() const {return flags&FL_MENU_RADIO;}
-  /** Returns the current value of the check or radio item. */
-  int value() const {return flags&FL_MENU_VALUE;}
-  /**
-    Turns the check or radio item "on" for the menu item. Note that this
-    does not turn off any adjacent radio items like set_only() does.
-  */
-  void set() {flags |= FL_MENU_VALUE;}
-
-  /** Turns the check or radio item "off" for the menu item. */
-  void clear() {flags &= ~FL_MENU_VALUE;}
-
-  void setonly();
-
-  /** Gets the visibility of an item. */
-  int visible() const {return !(flags&FL_MENU_INVISIBLE);}
-
-  /** Makes an item visible in the menu. */
-  void show() {flags &= ~FL_MENU_INVISIBLE;}
-
-  /** Hides an item in the menu. */
-  void hide() {flags |= FL_MENU_INVISIBLE;}
-
-  /** Gets whether or not the item can be picked. */
-  int active() const {return !(flags&FL_MENU_INACTIVE);}
-
-  /** Allows a menu item to be picked. */
-  void activate() {flags &= ~FL_MENU_INACTIVE;}
-  /**
-    Prevents a menu item from being picked. Note that this will also cause
-    the menu item to appear grayed-out.
-  */
-  void deactivate() {flags |= FL_MENU_INACTIVE;}
-  /** Returns non 0 if FL_INACTIVE and FL_INVISIBLE are cleared, 0 otherwise. */
-  int activevisible() const {return !(flags & (FL_MENU_INACTIVE|FL_MENU_INVISIBLE));}
-
-  // compatibility for FLUID so it can set the image of a menu item...
-
-  /** compatibility api for FLUID, same as a->label(this) */
-  void image(Fl_Image* a) {a->label(this);}
-
-  /** compatibility api for FLUID, same as a.label(this) */
-  void image(Fl_Image& a) {a.label(this);}
-
-  // used by menubar:
-  int measure(int* h, const Fl_Menu_*) const;
-  void draw(int x, int y, int w, int h, const Fl_Menu_*, int t=0) const;
-
-  // popup menus without using an Fl_Menu_ widget:
-  const Fl_Menu_Item* popup(
-    int X, int Y,
-    const char *title = 0,
-    const Fl_Menu_Item* picked=0,
-    const Fl_Menu_* = 0) const;
-  const Fl_Menu_Item* pulldown(
-    int X, int Y, int W, int H,
-    const Fl_Menu_Item* picked = 0,
-    const Fl_Menu_* = 0,
-    const Fl_Menu_Item* title = 0,
-    int menubar=0) const;
-  const Fl_Menu_Item* test_shortcut() const;
-  const Fl_Menu_Item* find_shortcut(int *ip=0, const bool require_alt = false) const;
-
-  /**
-    Calls the Fl_Menu_Item item's callback, and provides the Fl_Widget argument.
-    The callback is called with the stored user_data() as its second argument.
-    You must first check that callback() is non-zero before calling this.
-  */
-  void do_callback(Fl_Widget* o) const {callback_(o, user_data_);}
-
-  /**
-    Calls the Fl_Menu_Item item's callback, and provides the Fl_Widget argument.
-    This call overrides the callback's second argument with the given value \p arg.
-    You must first check that callback() is non-zero before calling this.
-  */
-  void do_callback(Fl_Widget* o,void* arg) const {callback_(o, arg);}
-
-  /**
-    Calls the Fl_Menu_Item item's callback, and provides the Fl_Widget argument.
-    This call overrides the callback's second argument with the
-    given value \p arg. long \p arg is cast to void* when calling
-    the callback.
-    You must first check that callback() is non-zero before calling this.
-  */
-  void do_callback(Fl_Widget* o,long arg) const {callback_(o, (void*)arg);}
-
-  // back-compatibility, do not use:
-
-  /** back compatibility only \deprecated. */
-  int checked() const {return flags&FL_MENU_VALUE;}
-
-  /** back compatibility only \deprecated. */
-  void check() {flags |= FL_MENU_VALUE;}
-
-  /** back compatibility only \deprecated. */
-  void uncheck() {flags &= ~FL_MENU_VALUE;}
-
-  Fl_Menu_Item *menu_at(int idx) {return (idx >= 0 && idx < size()) ? &this[idx] : 0;};
-  int insert(int,const char*,int,Fl_Callback*,void* =0, int =0);
-  int add(const char*, int shortcut, Fl_Callback*, void* =0, int = 0);
-
-  /** See int add(const char*, int shortcut, Fl_Callback*, void*, int) */
-  int add(const char*a, const char* b, Fl_Callback* c,
-	  void* d = 0, int e = 0) {
-    return add(a,fl_old_shortcut(b),c,d,e);}
-
-  int size() const ;
-};
-
-typedef Fl_Menu_Item Fl_Menu; // back compatibility
-
-enum {	// back-compatibility enum:
-  FL_PUP_NONE	= 0,
-  FL_PUP_GREY	= FL_MENU_INACTIVE,
-  FL_PUP_GRAY	= FL_MENU_INACTIVE,
-  FL_MENU_BOX	= FL_MENU_TOGGLE,
-  FL_PUP_BOX	= FL_MENU_TOGGLE,
-  FL_MENU_CHECK	= FL_MENU_VALUE,
-  FL_PUP_CHECK	= FL_MENU_VALUE,
-  FL_PUP_RADIO	= FL_MENU_RADIO,
-  FL_PUP_INVISIBLE = FL_MENU_INVISIBLE,
-  FL_PUP_SUBMENU = FL_SUBMENU_POINTER
-};
-
-#endif
-
-//
-// End of "$Id: Fl_Menu_Item.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
-//
+//
+// "$Id: Fl_Menu_Item.H 12443 2017-09-11 18:54:10Z AlbrechtS $"
+//
+// Menu item header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2010 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+#ifndef Fl_Menu_Item_H
+#define Fl_Menu_Item_H
+
+#  include "Fl_Widget.H"
+#  include "Fl_Image.H"
+#  include <FL/platform_types.h> // for FL_COMMAND and FL_CONTROL
+
+// doxygen needs the following line to enable e.g. ::FL_MENU_TOGGLE to link to the enums
+/// @file
+
+enum { // values for flags:
+  FL_MENU_INACTIVE = 1,		///< Deactivate menu item (gray out)
+  FL_MENU_TOGGLE= 2,		///< Item is a checkbox toggle (shows checkbox for on/off state)
+  FL_MENU_VALUE = 4,		///< The on/off state for checkbox/radio buttons (if set, state is 'on')
+  FL_MENU_RADIO = 8,		///< Item is a radio button (one checkbox of many can be on)
+  FL_MENU_INVISIBLE = 0x10,	///< Item will not show up (shortcut will work)
+  FL_SUBMENU_POINTER = 0x20,	///< Indicates user_data() is a pointer to another menu array
+  FL_SUBMENU = 0x40,		///< This item is a submenu to other items
+  FL_MENU_DIVIDER = 0x80,	///< Creates divider line below this item. Also ends a group of radio buttons.
+  FL_MENU_HORIZONTAL = 0x100	///< ??? -- reserved
+};
+
+extern FL_EXPORT Fl_Shortcut fl_old_shortcut(const char*);
+
+class Fl_Menu_;
+
+/**
+  The Fl_Menu_Item structure defines a single menu item that
+  is used by the Fl_Menu_ class.  
+  \code
+  class Fl_Menu_Item {
+   const char*   text;     // label()
+   ulong         shortcut_;
+   Fl_Callback*  callback_;
+   void*         user_data_;
+   int           flags;
+   uchar         labeltype_;
+   uchar         labelfont_;
+   uchar         labelsize_;
+   uchar         labelcolor_;
+  };
+  
+  enum { // values for flags:
+   FL_MENU_INACTIVE   = 1,      // Deactivate menu item (gray out)
+   FL_MENU_TOGGLE     = 2,      // Item is a checkbox toggle (shows checkbox for on/off state)
+   FL_MENU_VALUE      = 4,      // The on/off state for checkbox/radio buttons (if set, state is 'on')
+   FL_MENU_RADIO      = 8,      // Item is a radio button (one checkbox of many can be on)
+   FL_MENU_INVISIBLE  = 0x10,   // Item will not show up (shortcut will work)
+   FL_SUBMENU_POINTER = 0x20,   // Indicates user_data() is a pointer to another menu array
+   FL_SUBMENU         = 0x40,   // This item is a submenu to other items
+   FL_MENU_DIVIDER    = 0x80,   // Creates divider line below this item. Also ends a group of radio buttons.
+   FL_MENU_HORIZONTAL = 0x100   // ??? -- reserved
+  };
+  \endcode
+  Typically menu items are statically defined; for example:
+  \code
+  Fl_Menu_Item popup[] = {
+   {"&alpha",    FL_ALT+'a', the_cb, (void*)1},
+   {"&beta",     FL_ALT+'b', the_cb, (void*)2},
+   {"gamma",     FL_ALT+'c', the_cb, (void*)3, FL_MENU_DIVIDER},
+   {"&strange",  0,          strange_cb},
+   {"&charm",    0,          charm_cb},
+   {"&truth",    0,          truth_cb},
+   {"b&eauty",   0,          beauty_cb},
+   {"sub&menu",  0,          0, 0, FL_SUBMENU},
+   {"one"},
+   {"two"},
+   {"three"},
+   {0},
+   {"inactive", FL_ALT+'i', 0, 0, FL_MENU_INACTIVE|FL_MENU_DIVIDER},
+   {"invisible",FL_ALT+'i', 0, 0, FL_MENU_INVISIBLE},
+   {"check",    FL_ALT+'i', 0, 0, FL_MENU_TOGGLE|FL_MENU_VALUE},
+   {"box",      FL_ALT+'i', 0, 0, FL_MENU_TOGGLE},
+   {0}};
+  \endcode
+  produces:
+
+  \image html   menu.png
+  \image latex  menu.png "menu" width=10cm
+
+  A submenu title is identified by the bit FL_SUBMENU in the 
+  flags field, and ends with a label() that is NULL.
+  You can nest menus to any depth.  A pointer to the first item in the
+  submenu can be treated as an Fl_Menu array itself.  It is also
+  possible to make separate submenu arrays with FL_SUBMENU_POINTER flags.
+
+  You should use the method functions to access structure members and
+  not access them directly to avoid compatibility problems with future
+  releases of FLTK.
+*/
+class FL_EXPORT Fl_Menu_Item {
+public:
+  const char *text;	    ///< menu item text, returned by label()
+  int shortcut_;	    ///< menu item shortcut
+  Fl_Callback *callback_;   ///< menu item callback
+  void *user_data_;	    ///< menu item user_data for the menu's callback
+  int flags;		    ///< menu item flags like FL_MENU_TOGGLE, FL_MENU_RADIO
+  uchar labeltype_;	    ///< how the menu item text looks like
+  Fl_Font labelfont_;	    ///< which font for this menu item text
+  Fl_Fontsize labelsize_;   ///< size of menu item text
+  Fl_Color labelcolor_;	    ///< menu item text color
+
+  // advance N items, skipping submenus:
+  const Fl_Menu_Item *next(int=1) const;
+
+  /**
+    Advances a pointer by n items through a menu array, skipping
+    the contents of submenus and invisible items. There are two calls so
+    that you can advance through const and non-const data.
+  */
+  Fl_Menu_Item *next(int i=1) {
+    return (Fl_Menu_Item*)(((const Fl_Menu_Item*)this)->next(i));}
+
+  /** Returns the first menu item, same as next(0). */
+  const Fl_Menu_Item *first() const { return next(0); }
+
+  /** Returns the first menu item, same as next(0). */
+  Fl_Menu_Item *first() { return next(0); }
+
+  // methods on menu items:
+  /**
+    Returns the title of the item.
+    A NULL here indicates the end of the menu (or of a submenu).
+    A '&' in the item will print an underscore under the next letter,
+    and if the menu is popped up that letter will be a "shortcut" to pick
+    that item.  To get a real '&' put two in a row.
+  */
+  const char* label() const {return text;}
+
+  /**    See const char* Fl_Menu_Item::label() const   */
+  void label(const char* a) {text=a;}
+
+  /**    See const char* Fl_Menu_Item::label() const   */
+  void label(Fl_Labeltype a,const char* b) {labeltype_ = a; text = b;}
+
+  /**
+    Returns the menu item's labeltype.
+    A labeltype identifies a routine that draws the label of the
+    widget.  This can be used for special effects such as emboss, or to use
+    the label() pointer as another form of data such as a bitmap.
+    The value FL_NORMAL_LABEL prints the label as text.
+  */
+  Fl_Labeltype labeltype() const {return (Fl_Labeltype)labeltype_;}
+
+  /**
+    Sets the menu item's labeltype.
+    A labeltype identifies a routine that draws the label of the
+    widget.  This can be used for special effects such as emboss, or to use
+    the label() pointer as another form of data such as a bitmap.
+    The value FL_NORMAL_LABEL prints the label as text.
+  */
+  void labeltype(Fl_Labeltype a) {labeltype_ = a;}
+
+  /**
+    Gets the menu item's label color.
+    This color is passed to the labeltype routine, and is typically the
+    color of the label text.  This defaults to FL_BLACK.  If this
+    color is not black fltk will \b not use overlay bitplanes to draw
+    the menu - this is so that images put in the menu draw correctly.
+  */
+  Fl_Color labelcolor() const {return labelcolor_;}
+
+  /**
+    Sets the menu item's label color.
+    \see Fl_Color Fl_Menu_Item::labelcolor() const
+  */
+  void labelcolor(Fl_Color a) {labelcolor_ = a;}
+  /**
+    Gets the menu item's label font.
+    Fonts are identified by small 8-bit indexes into a table. See the
+    enumeration list for predefined fonts. The default value is a
+    Helvetica font. The function Fl::set_font() can define new fonts.
+  */
+  Fl_Font labelfont() const {return labelfont_;}
+
+  /**
+    Sets the menu item's label font.
+    Fonts are identified by small 8-bit indexes into a table. See the
+    enumeration list for predefined fonts. The default value is a
+    Helvetica font.  The function Fl::set_font() can define new fonts.
+  */
+  void labelfont(Fl_Font a) {labelfont_ = a;}
+
+  /** Gets the label font pixel size/height. */
+  Fl_Fontsize labelsize() const {return labelsize_;}
+
+  /** Sets the label font pixel size/height.*/
+  void labelsize(Fl_Fontsize a) {labelsize_ = a;}
+
+  /**
+    Returns the callback function that is set for the menu item.
+    Each item has space for a callback function and an argument for that
+    function. Due to back compatibility, the Fl_Menu_Item itself
+    is not passed to the callback, instead you have to get it by calling
+    ((Fl_Menu_*)w)->mvalue() where w is the widget argument.
+  */
+  Fl_Callback_p callback() const {return callback_;}
+
+  /**
+    Sets the menu item's callback function and userdata() argument.
+    \see Fl_Callback_p Fl_MenuItem::callback() const
+  */
+  void callback(Fl_Callback* c, void* p) {callback_=c; user_data_=p;}
+
+  /**
+    Sets the menu item's callback function.
+    This method does not set the userdata() argument.
+    \see Fl_Callback_p Fl_MenuItem::callback() const
+   */
+  void callback(Fl_Callback* c) {callback_=c;}
+
+  /**
+    Sets the menu item's callback function.
+    This method does not set the userdata() argument.
+    \see Fl_Callback_p Fl_MenuItem::callback() const
+   */
+  void callback(Fl_Callback0*c) {callback_=(Fl_Callback*)c;}
+
+  /**
+    Sets the menu item's callback function and userdata() argument.
+    This method does not set the userdata() argument.
+    The argument \p is cast to void* and stored as the userdata()
+    for the menu item's callback function.
+    \see Fl_Callback_p Fl_MenuItem::callback() const
+   */
+  void callback(Fl_Callback1*c, long p=0) {callback_=(Fl_Callback*)c; user_data_=(void*)(fl_intptr_t)p;}
+
+  /**
+    Gets the user_data() argument that is sent to the callback function.
+  */
+  void* user_data() const {return user_data_;}
+  /**
+    Sets the user_data() argument that is sent to the callback function.
+  */
+  void user_data(void* v) {user_data_ = v;}
+  /**
+    Gets the user_data() argument that is sent to the callback function.
+    For convenience you can also define the callback as taking a long
+    argument.  This method casts the stored userdata() argument to long
+    and returns it as a \e long value.
+  */
+  long argument() const {return (long)(fl_intptr_t)user_data_;}
+  /**
+    Sets the user_data() argument that is sent to the callback function.
+    For convenience you can also define the callback as taking a long
+    argument.  This method casts the given argument \p v to void*
+    and stores it in the menu item's userdata() member.
+    This may not be portable to some machines.
+  */
+  void argument(long v) {user_data_ = (void*)(fl_intptr_t)v;}
+
+  /** Gets what key combination shortcut will trigger the menu item. */
+  int shortcut() const {return shortcut_;}
+
+  /**
+    Sets exactly what key combination will trigger the menu item.  The
+    value is a logical 'or' of a key and a set of shift flags, for instance 
+    FL_ALT+'a' or FL_ALT+FL_F+10 or just 'a'.  A value of
+    zero disables the shortcut.
+
+    The key can be any value returned by Fl::event_key(), but will usually 
+    be an ASCII letter. Use a lower-case letter unless you require the shift 
+    key to be held down.
+
+    The shift flags can be any set of values accepted by Fl::event_state().
+    If the bit is on that shift key must be pushed.  Meta, Alt, Ctrl, 
+    and Shift must be off if they are not in the shift flags (zero for the 
+    other bits indicates a "don't care" setting).
+  */
+  void shortcut(int s) {shortcut_ = s;}
+  /**
+    Returns true if either FL_SUBMENU or FL_SUBMENU_POINTER
+    is on in the flags. FL_SUBMENU indicates an embedded submenu
+    that goes from the next item through the next one with a NULL
+    label(). FL_SUBMENU_POINTER indicates that user_data()
+    is a pointer to another menu array.
+  */
+  int submenu() const {return flags&(FL_SUBMENU|FL_SUBMENU_POINTER);}
+  /**
+    Returns true if a checkbox will be drawn next to this item.
+    This is true if FL_MENU_TOGGLE or FL_MENU_RADIO is set in the flags.
+  */
+  int checkbox() const {return flags&FL_MENU_TOGGLE;}
+  /**
+    Returns true if this item is a radio item.
+    When a radio button is selected all "adjacent" radio buttons are
+    turned off.  A set of radio items is delimited by an item that has
+    radio() false, or by an item with FL_MENU_DIVIDER turned on.
+  */
+  int radio() const {return flags&FL_MENU_RADIO;}
+  /** Returns the current value of the check or radio item.
+      This is zero (0) if the menu item is not checked and
+      non-zero otherwise. You should not rely on a particular value,
+      only zero or non-zero.
+      \note The returned value for a checked menu item as of FLTK 1.3.2
+      is FL_MENU_VALUE (4), but may be 1 in a future version.
+  */
+  int value() const {return flags&FL_MENU_VALUE;}
+  /**
+    Turns the check or radio item "on" for the menu item. Note that this
+    does not turn off any adjacent radio items like set_only() does.
+  */
+  void set() {flags |= FL_MENU_VALUE;}
+
+  /** Turns the check or radio item "off" for the menu item. */
+  void clear() {flags &= ~FL_MENU_VALUE;}
+
+  void setonly();
+
+  /** Gets the visibility of an item. */
+  int visible() const {return !(flags&FL_MENU_INVISIBLE);}
+
+  /** Makes an item visible in the menu. */
+  void show() {flags &= ~FL_MENU_INVISIBLE;}
+
+  /** Hides an item in the menu. */
+  void hide() {flags |= FL_MENU_INVISIBLE;}
+
+  /** Gets whether or not the item can be picked. */
+  int active() const {return !(flags&FL_MENU_INACTIVE);}
+
+  /** Allows a menu item to be picked. */
+  void activate() {flags &= ~FL_MENU_INACTIVE;}
+  /**
+    Prevents a menu item from being picked. Note that this will also cause
+    the menu item to appear grayed-out.
+  */
+  void deactivate() {flags |= FL_MENU_INACTIVE;}
+  /** Returns non 0 if FL_INACTIVE and FL_INVISIBLE are cleared, 0 otherwise. */
+  int activevisible() const {return !(flags & (FL_MENU_INACTIVE|FL_MENU_INVISIBLE));}
+
+  // compatibility for FLUID so it can set the image of a menu item...
+
+  /** Compatibility API for FLUID, same as image->label(this).
+
+    \note This method is intended for internal use by fluid and may
+      not do what you expect.
+  */
+  void image(Fl_Image* image) {image->label(this);}
+
+  /** Compatibility API for FLUID, same as image.label(this).
+
+    \note This method is intended for internal use by fluid and may
+      not do what you expect.
+  */
+  void image(Fl_Image& image) {image.label(this);}
+
+  // used by menubar:
+  int measure(int* h, const Fl_Menu_*) const;
+  void draw(int x, int y, int w, int h, const Fl_Menu_*, int t=0) const;
+
+  // popup menus without using an Fl_Menu_ widget:
+  const Fl_Menu_Item* popup(
+    int X, int Y,
+    const char *title = 0,
+    const Fl_Menu_Item* picked=0,
+    const Fl_Menu_* = 0) const;
+  const Fl_Menu_Item* pulldown(
+    int X, int Y, int W, int H,
+    const Fl_Menu_Item* picked = 0,
+    const Fl_Menu_* = 0,
+    const Fl_Menu_Item* title = 0,
+    int menubar=0) const;
+  const Fl_Menu_Item* test_shortcut() const;
+  const Fl_Menu_Item* find_shortcut(int *ip=0, const bool require_alt = false) const;
+
+  /**
+    Calls the Fl_Menu_Item item's callback, and provides the Fl_Widget argument.
+    The callback is called with the stored user_data() as its second argument.
+    You must first check that callback() is non-zero before calling this.
+  */
+  void do_callback(Fl_Widget* o) const {callback_(o, user_data_);}
+
+  /**
+    Calls the Fl_Menu_Item item's callback, and provides the Fl_Widget argument.
+    This call overrides the callback's second argument with the given value \p arg.
+    You must first check that callback() is non-zero before calling this.
+  */
+  void do_callback(Fl_Widget* o,void* arg) const {callback_(o, arg);}
+
+  /**
+    Calls the Fl_Menu_Item item's callback, and provides the Fl_Widget argument.
+    This call overrides the callback's second argument with the
+    given value \p arg. long \p arg is cast to void* when calling
+    the callback.
+    You must first check that callback() is non-zero before calling this.
+  */
+  void do_callback(Fl_Widget* o,long arg) const {callback_(o, (void*)(fl_intptr_t)arg);}
+
+  // back-compatibility, do not use:
+
+  /** back compatibility only \deprecated. */
+  int checked() const {return flags&FL_MENU_VALUE;}
+
+  /** back compatibility only \deprecated. */
+  void check() {flags |= FL_MENU_VALUE;}
+
+  /** back compatibility only \deprecated. */
+  void uncheck() {flags &= ~FL_MENU_VALUE;}
+
+  Fl_Menu_Item *menu_at(int idx) {return (idx >= 0 && idx < size()) ? &this[idx] : 0;};
+  int insert(int,const char*,int,Fl_Callback*,void* =0, int =0);
+  int add(const char*, int shortcut, Fl_Callback*, void* =0, int = 0);
+
+  /** See int add(const char*, int shortcut, Fl_Callback*, void*, int) */
+  int add(const char*a, const char* b, Fl_Callback* c,
+	  void* d = 0, int e = 0) {
+    return add(a,fl_old_shortcut(b),c,d,e);}
+
+  int size() const ;
+};
+
+typedef Fl_Menu_Item Fl_Menu; // back compatibility
+
+enum {	// back-compatibility enum:
+  FL_PUP_NONE	= 0,
+  FL_PUP_GREY	= FL_MENU_INACTIVE,
+  FL_PUP_GRAY	= FL_MENU_INACTIVE,
+  FL_MENU_BOX	= FL_MENU_TOGGLE,
+  FL_PUP_BOX	= FL_MENU_TOGGLE,
+  FL_MENU_CHECK	= FL_MENU_VALUE,
+  FL_PUP_CHECK	= FL_MENU_VALUE,
+  FL_PUP_RADIO	= FL_MENU_RADIO,
+  FL_PUP_INVISIBLE = FL_MENU_INVISIBLE,
+  FL_PUP_SUBMENU = FL_SUBMENU_POINTER
+};
+
+#endif
+
+//
+// End of "$Id: Fl_Menu_Item.H 12443 2017-09-11 18:54:10Z AlbrechtS $".
+//

+ 58 - 59
fltk/FL/Fl_Menu_Window.H

@@ -1,59 +1,58 @@
-//
-// "$Id: Fl_Menu_Window.H 9637 2012-07-24 04:37:22Z matt $"
-//
-// Menu window header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_Menu_Window widget . */
-
-#ifndef Fl_Menu_Window_H
-#define Fl_Menu_Window_H
-
-#include "Fl_Single_Window.H"
-
-/**
-  The Fl_Menu_Window widget is a window type used for menus. By
-  default the window is drawn in the hardware overlay planes if they are
-  available so that the menu don't force the rest of the window to
-  redraw.
-*/
-class FL_EXPORT Fl_Menu_Window : public Fl_Single_Window {
-public:
-  void show();
-  void erase();
-  void flush();
-  void hide();
-  /** Tells if hardware overlay mode is set */
-  unsigned int overlay() {return !(flags()&NO_OVERLAY);}
-  /** Tells FLTK to use hardware overlay planes if they are available.  */
-  void set_overlay() {clear_flag(NO_OVERLAY);}
-  /** Tells FLTK to use normal drawing planes instead of overlay planes.
-      This is usually necessary if your menu contains multi-color pixmaps. */
-  void clear_overlay() {set_flag(NO_OVERLAY);}
-  ~Fl_Menu_Window();
-  /** Creates a new Fl_Menu_Window widget using the given size, and label string. */
-  Fl_Menu_Window(int W, int H, const char *l = 0);
-  /** Creates a new Fl_Menu_Window widget using the given position, size, and label string. */
-  Fl_Menu_Window(int X, int Y, int W, int H, const char *l = 0);
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_Menu_Window, Fl_Single_Window)
-};
-
-#endif
-
-//
-// End of "$Id: Fl_Menu_Window.H 9637 2012-07-24 04:37:22Z matt $".
-//
+//
+// "$Id: Fl_Menu_Window.H 9637 2012-07-24 04:37:22Z matt $"
+//
+// Menu window header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2010 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_Menu_Window widget . */
+
+#ifndef Fl_Menu_Window_H
+#define Fl_Menu_Window_H
+
+#include "Fl_Single_Window.H"
+
+/**
+  The Fl_Menu_Window widget is a window type used for menus. By
+  default the window is drawn in the hardware overlay planes if they are
+  available so that the menu don't force the rest of the window to
+  redraw.
+*/
+class FL_EXPORT Fl_Menu_Window : public Fl_Single_Window {
+public:
+  void show();
+  void erase();
+  void flush();
+  void hide();
+  /** Tells if hardware overlay mode is set */
+  unsigned int overlay() {return !(flags()&NO_OVERLAY);}
+  /** Tells FLTK to use hardware overlay planes if they are available.  */
+  void set_overlay() {clear_flag(NO_OVERLAY);}
+  /** Tells FLTK to use normal drawing planes instead of overlay planes.
+      This is usually necessary if your menu contains multi-color pixmaps. */
+  void clear_overlay() {set_flag(NO_OVERLAY);}
+  ~Fl_Menu_Window();
+  /** Creates a new Fl_Menu_Window widget using the given size, and label string. */
+  Fl_Menu_Window(int W, int H, const char *l = 0);
+  /** Creates a new Fl_Menu_Window widget using the given position, size, and label string. */
+  Fl_Menu_Window(int X, int Y, int W, int H, const char *l = 0);
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_Menu_Window, Fl_Single_Window)
+};
+
+#endif
+
+//
+// End of "$Id: Fl_Menu_Window.H 9637 2012-07-24 04:37:22Z matt $".
+//

+ 55 - 54
fltk/FL/Fl_Multi_Browser.H

@@ -1,54 +1,55 @@
-//
-// "$Id: Fl_Multi_Browser.H 9637 2012-07-24 04:37:22Z matt $"
-//
-// Multi browser header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_Multi_Browser widget . */
-
-#ifndef Fl_Multi_Browser_H
-#define Fl_Multi_Browser_H
-
-#include "Fl_Browser.H"
-
-/**
-  The Fl_Multi_Browser class is a subclass of Fl_Browser
-  which lets the user select any set of the lines.  The user interface
-  is Macintosh style: clicking an item turns off all the others and
-  selects that one, dragging selects all the items the mouse moves over,
-  and shift + click toggles the items. This is different then how forms
-  did it.  Normally the callback is done when the user releases the
-  mouse, but you can change this with when().
-  <P>See Fl_Browser for methods to add and remove lines from the browser.
-*/
-class FL_EXPORT Fl_Multi_Browser : public Fl_Browser {
-public:
-  /**
-      Creates a new Fl_Multi_Browser widget using the given
-    position, size, and label string. The default boxtype is FL_DOWN_BOX.
-    The constructor specializes Fl_Browser() by setting the type to FL_MULTI_BROWSER.
-    The destructor destroys the widget and frees all memory that has been allocated.
-  */
-    Fl_Multi_Browser(int X,int Y,int W,int H,const char *L=0);
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_Multi_Browser, Fl_Browser)
-};
-
-#endif
-
-//
-// End of "$Id: Fl_Multi_Browser.H 9637 2012-07-24 04:37:22Z matt $".
-//
+//
+// "$Id: Fl_Multi_Browser.H 10882 2015-11-05 17:54:16Z manolo $"
+//
+// Multi browser header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2010 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_Multi_Browser widget . */
+
+#ifndef Fl_Multi_Browser_H
+#define Fl_Multi_Browser_H
+
+#include "Fl_Browser.H"
+
+/**
+  The Fl_Multi_Browser class is a subclass of Fl_Browser
+  which lets the user select any set of the lines.  The user interface
+  is Macintosh style: clicking an item turns off all the others and
+  selects that one, dragging selects all the items the mouse moves over,
+  and ctrl + click (Cmd+click on the Mac OS platform) toggles the items.  
+  Shift + click extends the selection until the clicked item.
+  This is different from how forms did it.  
+  Normally the callback is done when the user releases the
+  mouse, but you can change this with when().
+  <P>See Fl_Browser for methods to add and remove lines from the browser.
+*/
+class FL_EXPORT Fl_Multi_Browser : public Fl_Browser {
+public:
+  /**
+      Creates a new Fl_Multi_Browser widget using the given
+    position, size, and label string. The default boxtype is FL_DOWN_BOX.
+    The constructor specializes Fl_Browser() by setting the type to FL_MULTI_BROWSER.
+    The destructor destroys the widget and frees all memory that has been allocated.
+  */
+    Fl_Multi_Browser(int X,int Y,int W,int H,const char *L=0);
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_Multi_Browser, Fl_Browser)
+};
+
+#endif
+
+//
+// End of "$Id: Fl_Multi_Browser.H 10882 2015-11-05 17:54:16Z manolo $".
+//

+ 105 - 39
fltk/FL/Fl_Multi_Label.H

@@ -1,39 +1,105 @@
-//
-// "$Id: Fl_Multi_Label.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
-//
-// Multi-label header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-#ifndef Fl_Multi_Label_H
-#define Fl_Multi_Label_H
-
-class Fl_Widget;
-class Fl_Menu_Item;
-
-class FL_EXPORT Fl_Multi_Label {
-public:
-  const char* labela;
-  const char* labelb;
-  uchar typea;
-  uchar typeb;
-  void label(Fl_Widget*);
-  void label(Fl_Menu_Item*);
-};
-
-#endif
-
-//
-// End of "$Id: Fl_Multi_Label.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
-//
+//
+// "$Id: Fl_Multi_Label.H 12452 2017-09-12 20:12:21Z greg.ercolano $"
+//
+// Multi-label header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2015 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+#ifndef Fl_Multi_Label_H
+#define Fl_Multi_Label_H
+
+class Fl_Widget;
+struct Fl_Menu_Item;
+
+/** This struct allows multiple labels to be added to objects that might normally have only one label.
+
+    This struct allows a mixed text and/or graphics label to be applied to an object that
+    would normally only have a single (usually text only) label.
+
+    Most regular FLTK widgets now support the ability to associate both images and text
+    with a label but some special cases, notably the non-widget Fl_Menu_Item objects, do not.
+    Fl_Multi_Label may be used to create menu items that have an icon and text, which would
+    not normally be possible for an Fl_Menu_Item.
+    For example, Fl_Multi_Label is used in the New->Code submenu in fluid, and others.
+
+    \image html Fl_Multi_Label-menu-item.png "Menu items with icons using Fl_Multi_Label"
+    \image latex Fl_Multi_Label-menu-item.png "Menu items with icons using Fl_Multi_Label" width=4cm
+
+    Each Fl_Multi_Label holds two elements, labela and labelb; each may hold either a
+    text label (const char*) or an image (Fl_Image*). When displayed, labela is drawn first
+    and labelb is drawn immediately to its right.
+
+    More complex labels might be constructed by setting labelb as another Fl_Multi_Label and
+    thus chaining up a series of label elements.
+
+    When assigning a label element to one of labela or labelb, they should be explicitly cast
+    to (const char*) if they are not of that type already.
+
+    Example Use: Fl_Menu_Bar
+    \code
+      Fl_Pixmap *image = new Fl_Pixmap(..);	// image for menu item; any Fl_Image based widget
+      Fl_Menu_Bar *menu = new Fl_Menu_Bar(..);	// can be any Fl_Menu_ oriented widget (Fl_Choice, Fl_Menu_Button..)
+
+      // Create a menu item
+      int i = menu->add("File/New", ..);
+      Fl_Menu_Item *item = (Fl_Menu_Item*)&(menu->menu()[i]);
+
+      // Create a multi label, assign it an image + text
+      Fl_Multi_Label *ml = new Fl_Multi_Label;
+
+      // Left side of label is an image
+      ml->typea  = FL_IMAGE_LABEL;
+      ml->labela = (const char*)image;           // any Fl_Image widget: Fl_Pixmap, Fl_PNG_Image, etc..
+
+      // Right side of label is label text
+      ml->typeb  = FL_NORMAL_LABEL;
+      ml->labelb = item->label();
+
+      // Assign the multilabel to the menu item
+      ml->label(item);
+    \endcode
+
+    \see Fl_Label and Fl_Labeltype and examples/howto-menu-with-images.cxx
+ */
+struct FL_EXPORT Fl_Multi_Label {
+  /** Holds the "leftmost" of the two elements in the composite label.
+      Typically this would be assigned either a text string (const char*),
+      a (Fl_Image*) or a (Fl_Multi_Label*). */
+  const char* labela;
+  /** Holds the "rightmost" of the two elements in the composite label.
+      Typically this would be assigned either a text string (const char*),
+      a (Fl_Image*) or a (Fl_Multi_Label*). */
+  const char* labelb;
+  /** Holds the "type" of labela.
+    Typically this is set to FL_NORMAL_LABEL for a text label,
+    FL_IMAGE_LABEL for an image (based on Fl_image) or FL_MULTI_LABEL
+    if "chaining" multiple Fl_Multi_Label elements together. */
+  uchar typea;
+  /** Holds the "type" of labelb.
+    Typically this is set to FL_NORMAL_LABEL for a text label,
+    FL_IMAGE_LABEL for an image (based on Fl_image) or FL_MULTI_LABEL
+    if "chaining" multiple Fl_Multi_Label elements together. */
+  uchar typeb;
+
+  /** This method is used to associate a Fl_Multi_Label with a Fl_Widget. */
+  void label(Fl_Widget*);
+  /** This method is used to associate a Fl_Multi_Label with a Fl_Menu_Item. */
+  void label(Fl_Menu_Item*);
+};
+
+#endif
+
+//
+// End of "$Id: Fl_Multi_Label.H 12452 2017-09-12 20:12:21Z greg.ercolano $".
+//

+ 61 - 62
fltk/FL/Fl_Multiline_Input.H

@@ -1,62 +1,61 @@
-//
-// "$Id: Fl_Multiline_Input.H 9637 2012-07-24 04:37:22Z matt $"
-//
-// Multiline input header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2011 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_Multiline_Input widget . */
-
-#ifndef Fl_Multiline_Input_H
-#define Fl_Multiline_Input_H
-
-#include "Fl_Input.H"
-
-/**
-  This input field displays '\n' characters as new lines rather than ^J,
-  and accepts the Return, Tab, and up and down arrow keys.  This is for
-  editing multiline text.
-
-  This is far from the nirvana of text editors, and is probably only
-  good for small bits of text, 10 lines at most. Note that this widget
-  does not support scrollbars or per-character color control.
-
-  If you are presenting large amounts of text and need scrollbars
-  or full color control of characters, you probably want Fl_Text_Editor
-  instead.
-
-  In FLTK 1.3.x, the default behavior of the 'Tab' key was changed
-  to support consistent focus navigation. To get the older FLTK 1.1.x
-  behavior, set Fl_Input_::tab_nav() to 0. Newer programs should consider using
-  Fl_Text_Editor.
-*/
-class FL_EXPORT Fl_Multiline_Input : public Fl_Input {
-public:
-  /**
-    Creates a new Fl_Multiline_Input widget using the given
-    position, size, and label string. The default boxtype is FL_DOWN_BOX.
-
-    Inherited destructor destroys the widget and any value associated with it.
-  */
-  Fl_Multiline_Input(int X,int Y,int W,int H,const char *l = 0);
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_Multiline_Input, Fl_Input)
-};
-
-#endif
-
-//
-// End of "$Id: Fl_Multiline_Input.H 9637 2012-07-24 04:37:22Z matt $".
-//
+//
+// "$Id: Fl_Multiline_Input.H 10365 2014-10-09 11:45:02Z AlbrechtS $"
+//
+// Multiline input header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2011 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_Multiline_Input widget . */ 
+
+#ifndef Fl_Multiline_Input_H
+#define Fl_Multiline_Input_H
+
+#include "Fl_Input.H"
+
+/**
+  This input field displays '\\n' characters as new lines rather than ^J,
+  and accepts the Return, Tab, and up and down arrow keys.  This is for
+  editing multiline text.
+
+  This is far from the nirvana of text editors, and is probably only
+  good for small bits of text, 10 lines at most. Note that this widget
+  does not support scrollbars or per-character color control.
+
+  If you are presenting large amounts of text and need scrollbars
+  or full color control of characters, you probably want Fl_Text_Editor
+  instead.
+
+  In FLTK 1.3.x, the default behavior of the 'Tab' key was changed
+  to support consistent focus navigation. To get the older FLTK 1.1.x
+  behavior, set Fl_Input_::tab_nav() to 0. Newer programs should consider using
+  Fl_Text_Editor.
+*/
+class FL_EXPORT Fl_Multiline_Input : public Fl_Input {
+public:
+  /**
+    Creates a new Fl_Multiline_Input widget using the given
+    position, size, and label string. The default boxtype is FL_DOWN_BOX.
+
+    Inherited destructor destroys the widget and any value associated with it.
+  */
+  Fl_Multiline_Input(int X,int Y,int W,int H,const char *l = 0);
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_Multiline_Input, Fl_Input)
+};
+
+#endif
+
+//
+// End of "$Id: Fl_Multiline_Input.H 10365 2014-10-09 11:45:02Z AlbrechtS $".
+//

+ 57 - 58
fltk/FL/Fl_Multiline_Output.H

@@ -1,58 +1,57 @@
-//
-// "$Id: Fl_Multiline_Output.H 9637 2012-07-24 04:37:22Z matt $"
-//
-// Multi line output header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2011 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_Multiline_Output widget . */
-
-#ifndef Fl_Multiline_Output_H
-#define Fl_Multiline_Output_H
-
-#include "Fl_Output.H"
-
-/**
-  This widget is a subclass of Fl_Output that displays multiple
-  lines of text. It also displays tab characters as whitespace to the
-  next column.
-
-  Note that this widget does not support scrollbars, or per-character
-  color control.
-
-  If you are presenting large amounts of read-only text 
-  and need scrollbars, or full color control of characters,
-  then use Fl_Text_Display. If you want to display HTML text,
-  use Fl_Help_View.
-*/
-class FL_EXPORT Fl_Multiline_Output : public Fl_Output {
-public:
-
-  /**
-    Creates a new Fl_Multiline_Output widget using the given position,
-    size, and label string. The default boxtype is FL_DOWN_BOX.
-
-    Inherited destructor destroys the widget and any value associated with it.
-  */
-  Fl_Multiline_Output(int X,int Y,int W,int H,const char *l = 0);
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_Multiline_Output, Fl_Output)
-};
-
-#endif
-
-//
-// End of "$Id: Fl_Multiline_Output.H 9637 2012-07-24 04:37:22Z matt $".
-//
+//
+// "$Id: Fl_Multiline_Output.H 9637 2012-07-24 04:37:22Z matt $"
+//
+// Multi line output header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2011 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_Multiline_Output widget . */
+
+#ifndef Fl_Multiline_Output_H
+#define Fl_Multiline_Output_H
+
+#include "Fl_Output.H"
+
+/**
+  This widget is a subclass of Fl_Output that displays multiple
+  lines of text. It also displays tab characters as whitespace to the
+  next column.
+
+  Note that this widget does not support scrollbars, or per-character
+  color control.
+
+  If you are presenting large amounts of read-only text 
+  and need scrollbars, or full color control of characters,
+  then use Fl_Text_Display. If you want to display HTML text,
+  use Fl_Help_View.
+*/
+class FL_EXPORT Fl_Multiline_Output : public Fl_Output {
+public:
+
+  /**
+    Creates a new Fl_Multiline_Output widget using the given position,
+    size, and label string. The default boxtype is FL_DOWN_BOX.
+
+    Inherited destructor destroys the widget and any value associated with it.
+  */
+  Fl_Multiline_Output(int X,int Y,int W,int H,const char *l = 0);
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_Multiline_Output, Fl_Output)
+};
+
+#endif
+
+//
+// End of "$Id: Fl_Multiline_Output.H 9637 2012-07-24 04:37:22Z matt $".
+//

+ 220 - 295
fltk/FL/Fl_Native_File_Chooser.H

@@ -1,255 +1,226 @@
-//
-// "$Id: Fl_Native_File_Chooser.H 10186 2014-06-07 12:01:59Z manolo $"
-//
-// FLTK native OS file chooser widget
-//
-// Copyright 1998-2014 by Bill Spitzak and others.
-// Copyright 2004 Greg Ercolano.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/** \file
-   Fl_Native_File_Chooser widget. */
-
-#ifndef FL_NATIVE_FILE_CHOOSER_H
-#define FL_NATIVE_FILE_CHOOSER_H
-
-// Use Windows' chooser
-#ifdef WIN32
-// #define _WIN32_WINNT	0x0501	// needed for OPENFILENAME's 'FlagsEx'
-#  include <stdio.h>
-#  include <stdlib.h>		// malloc
-#  include <windows.h>
-#  include <commdlg.h>		// OPENFILENAME, GetOpenFileName()
-#  include <shlobj.h>		// BROWSEINFO, SHBrowseForFolder()
-#endif
-
-// Use Apple's chooser
-#ifdef __APPLE__
-#  define MAXFILTERS	80
-#endif
-
-// All else falls back to FLTK's own chooser
-#if ! defined(__APPLE__) && !defined(WIN32)
-#  include <FL/Fl_File_Chooser.H>
-#  include <unistd.h>		// _POSIX_NAME_MAX
-#else
-#  include <FL/filename.H>	// FL_EXPORT
-#endif
-
-class Fl_FLTK_File_Chooser;
-class Fl_GTK_File_Chooser;
-
-/**
- This class lets an FLTK application easily and consistently access 
- the operating system's native file chooser. Some operating systems 
- have very complex and specific file choosers that many users want 
- access to specifically, instead of FLTK's default file chooser(s). 
- 
- In cases where there is no native file browser, FLTK's own file browser
- is used instead.
- 
- To use this widget, use the following include in your code:
- \code
- #include <FL/Fl_Native_File_Chooser.H>
- \endcode
- 
- The following example shows how to pick a single file:
- \code
- // Create and post the local native file chooser
- #include <FL/Fl_Native_File_Chooser.H>
- [..]
- Fl_Native_File_Chooser fnfc;
- fnfc.title("Pick a file");
- fnfc.type(Fl_Native_File_Chooser::BROWSE_FILE);
- fnfc.filter("Text\t*.txt\n"
-             "C Files\t*.{cxx,h,c}");
- fnfc.directory("/var/tmp");           // default directory to use
- // Show native chooser
- switch ( fnfc.show() ) {
-   case -1: printf("ERROR: %s\n", fnfc.errmsg());    break;  // ERROR
-   case  1: printf("CANCEL\n");                      break;  // CANCEL
-   default: printf("PICKED: %s\n", fnfc.filename()); break;  // FILE CHOSEN
- }
- \endcode
+//
+// "$Id: Fl_Native_File_Chooser.H 11681 2016-04-23 06:27:31Z manolo $"
+//
+// FLTK native OS file chooser widget
+//
+// Copyright 1998-2016 by Bill Spitzak and others.
+// Copyright 2004 Greg Ercolano.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/** \file
+   Fl_Native_File_Chooser widget. */
+
+/* Implementation note:
+ 
+ class Fl_Native_File_Chooser  <== public API used by applications
+ 
+ class Fl_Native_File_Chooser_Driver   <== virtual API that a platform may implement
+                                           this API has a do-nothing default implementation
+ 
+        class Fl_Native_File_Chooser_FLTK_Driver   <== this API implementation is the default FLTK file chooser
+                class Fl_GTK_Native_File_Chooser_Driver  <== this API implementation runs a GTK file chooser
+                                        it is determined at run-time if the GTK dynamic libraries are available
+ 
+        class Fl_Quartz_Native_File_Chooser_Driver  <== this API implementation runs a Mac OS X file chooser
+
+        class Fl_WinAPI_Native_File_Chooser_Driver  <== this API implementation runs a MSWindows file chooser
+ 
+ 
+ Each platform must implement the constructor of the Fl_Native_File_Chooser class.
+ This particular implementation:
+ 
+ Fl_Native_File_Chooser::Fl_Native_File_Chooser(int val) {
+  platform_fnfc = new Fl_Native_File_Chooser_FLTK_Driver(val);
+ }
+ 
+ can be used by any platform. 
+ No more code is required. The cross-platform Fl_Native_File_Chooser_FLTK.cxx file must be compiled in libfltk,
+ and the default FLTK file chooser will be used.
+ 
+ This other implementation:
+ Fl_Native_File_Chooser::Fl_Native_File_Chooser(int val) {
+   platform_fnfc = 0;
+ }
+ can be used by a platform that needs no file chooser.
+ */
+
+#ifndef FL_NATIVE_FILE_CHOOSER_H
+#define FL_NATIVE_FILE_CHOOSER_H
+
+#include <FL/Fl_Export.H>
+#include <FL/Fl_File_Chooser.H>
+
+class Fl_Native_File_Chooser_Driver;
+
+/**
+ This class lets an FLTK application easily and consistently access 
+ the operating system's native file chooser. Some operating systems 
+ have very complex and specific file choosers that many users want 
+ access to specifically, instead of FLTK's default file chooser(s). 
+ 
+ In cases where there is no native file browser, FLTK's own file browser
+ is used instead.
+ 
+ To use this widget, use the following include in your code:
+ \code
+ #include <FL/Fl_Native_File_Chooser.H>
+ \endcode
+ 
+ The following example shows how to pick a single file:
+ \code
+ // Create and post the local native file chooser
+ #include <FL/Fl_Native_File_Chooser.H>
+ [..]
+ Fl_Native_File_Chooser fnfc;
+ fnfc.title("Pick a file");
+ fnfc.type(Fl_Native_File_Chooser::BROWSE_FILE);
+ fnfc.filter("Text\t*.txt\n"
+             "C Files\t*.{cxx,h,c}");
+ fnfc.directory("/var/tmp");           // default directory to use
+ // Show native chooser
+ switch ( fnfc.show() ) {
+   case -1: printf("ERROR: %s\n", fnfc.errmsg());    break;  // ERROR
+   case  1: printf("CANCEL\n");                      break;  // CANCEL
+   default: printf("PICKED: %s\n", fnfc.filename()); break;  // FILE CHOSEN
+ }
+ \endcode
  
  The Fl_Native_File_Chooser widget transmits UTF-8 encoded filenames to its user. It is
  recommended to open files that may have non-ASCII names with the fl_fopen() or
  fl_open() utility functions that handle these names in a cross-platform way 
  (whereas the standard fopen()/open() functions fail on the MSWindows platform 
  to open files with a non-ASCII name).
- 
- <B>Platform Specific Caveats</B>
- 
+ 
+ <B>Platform Specific Caveats</B>
+ 
  - Under X windows, and if Fl::OPTION_FNFC_USES_GTK has not been switched off,
  the widget attempts to use standard GTK file chooser dialogs if they are
  available at run-time on the platform, and falls back to use FLTK's Fl_File_Chooser if they are not.
  In the latter case, it's best if you call Fl_File_Icon::load_system_icons()
- at the start of main(), to enable the nicer looking file browser widgets.
- Use the static public attributes of class Fl_File_Chooser to localize
- the browser.
- - Some operating systems support certain OS specific options; see 
- Fl_Native_File_Chooser::options() for a list.
- 
- \image html Fl_Native_File_Chooser.png "The Fl_Native_File_Chooser on different platforms."
- \image latex Fl_Native_File_Chooser.png "The Fl_Native_File_Chooser on different platforms" width=14cm
- 
- */
-class FL_EXPORT Fl_Native_File_Chooser {
-public:
-  enum Type {
-    BROWSE_FILE = 0,			///< browse files (lets user choose one file)
-    BROWSE_DIRECTORY,			///< browse directories (lets user choose one directory)
-    BROWSE_MULTI_FILE,			///< browse files (lets user choose multiple files)
-    BROWSE_MULTI_DIRECTORY,		///< browse directories (lets user choose multiple directories)
-    BROWSE_SAVE_FILE,			///< browse to save a file
-    BROWSE_SAVE_DIRECTORY		///< browse to save a directory
-  };
-  enum Option {
-    NO_OPTIONS     = 0x0000,		///< no options enabled
+ at the start of main(), to enable the nicer looking file browser widgets.
+ Use the static public attributes of class Fl_File_Chooser to localize
+ the browser.
+ - Some operating systems support certain OS specific options; see 
+ Fl_Native_File_Chooser::options() for a list.
+ 
+ \image html Fl_Native_File_Chooser.png "The Fl_Native_File_Chooser on different platforms."
+ \image latex Fl_Native_File_Chooser.png "The Fl_Native_File_Chooser on different platforms" width=14cm
+ 
+ */
+class FL_EXPORT Fl_Native_File_Chooser {
+private:
+  Fl_Native_File_Chooser_Driver *platform_fnfc;
+public:
+  enum Type {
+    BROWSE_FILE = 0,			///< browse files (lets user choose one file)
+    BROWSE_DIRECTORY,			///< browse directories (lets user choose one directory)
+    BROWSE_MULTI_FILE,			///< browse files (lets user choose multiple files)
+    BROWSE_MULTI_DIRECTORY,		///< browse directories (lets user choose multiple directories)
+    BROWSE_SAVE_FILE,			///< browse to save a file
+    BROWSE_SAVE_DIRECTORY		///< browse to save a directory
+  };
+  enum Option {
+    NO_OPTIONS     = 0x0000,		///< no options enabled
     SAVEAS_CONFIRM = 0x0001,		///< Show native 'Save As' overwrite confirm dialog
-    NEW_FOLDER     = 0x0002,		///< Show 'New Folder' icon (if supported)
+    NEW_FOLDER     = 0x0002,		///< Show 'New Folder' icon (if supported)
     PREVIEW        = 0x0004,		///< enable preview mode (if supported)
     USE_FILTER_EXT = 0x0008		///< Chooser filter pilots the output file extension (if supported)
-  };
-  /** Localizable message */
-  static const char *file_exists_message;
-  
-public:
-  Fl_Native_File_Chooser(int val=BROWSE_FILE);
-  ~Fl_Native_File_Chooser();
-  
-  // Public methods
+  };
+  static const char *file_exists_message;
+  
+  /**
+   The constructor. Internally allocates the native widgets.
+   Optional \p val presets the type of browser this will be,
+   which can also be changed with type().
+   */
+  Fl_Native_File_Chooser(int val = BROWSE_FILE); // each platorm implements it
+  ~Fl_Native_File_Chooser();
   void type(int t);
   int type() const ;
   void options(int o);
-  int options() const;
-  int count() const;
+  int options() const;
+  int count() const;
   const char *filename() const ;
   const char *filename(int i) const ;
   void directory(const char *val) ;
-  const char *directory() const;
+  const char *directory() const;
   void title(const char *t);
-  const char* title() const;
+  const char* title() const;
   const char *filter() const ;
   void filter(const char *f);
   int filters() const ;
   void filter_value(int i) ;
   int filter_value() const ;
   void preset_file(const char*f) ;
-  const char* preset_file() const;
+  const char* preset_file() const;
   const char *errmsg() const ;
   int show() ;
-  
-#ifdef WIN32
-private:
-  int  _btype;			// kind-of browser to show()
-  int  _options;		// general options
-  OPENFILENAMEW _ofn;		// GetOpenFileName() & GetSaveFileName() struct
-  BROWSEINFOW   _binf;		// SHBrowseForFolder() struct
-  char  **_pathnames;		// array of pathnames
-  int     _tpathnames;		// total pathnames
-  char   *_directory;		// default pathname to use
-  char   *_title;		// title for window
-  char   *_filter;		// user-side search filter
-  char   *_parsedfilt;		// filter parsed for Windows dialog
-  int     _nfilters;		// number of filters parse_filter counted
-  char   *_preset_file;		// the file to preselect
-  char   *_errmsg;		// error message
-  
-  // Private methods
-  void errmsg(const char *msg);
-  
-  void clear_pathnames();
-  void set_single_pathname(const char *s);
-  void add_pathname(const char *s);
-  
-  void FreePIDL(LPITEMIDLIST pidl);
-  void ClearOFN();
-  void ClearBINF();
-  void Win2Unix(char *s);
-  void Unix2Win(char *s);
-  int showfile();
-  static int CALLBACK Dir_CB(HWND win, UINT msg, LPARAM param, LPARAM data);
-  int showdir();
-  
-  void parse_filter(const char *);
-  void clear_filters();
-  void add_filter(const char *, const char *);
-#endif
-
-#ifdef __APPLE__
-private:
-  int             _btype;		// kind-of browser to show()
-  int             _options;		// general options
-  void 	         *_panel;
-  char          **_pathnames;		// array of pathnames
-  int             _tpathnames;	        // total pathnames
-  char           *_directory;		// default pathname to use
-  char           *_title;		// title for window
-  char           *_preset_file;	        // the 'save as' filename
-  
-  char           *_filter;		// user-side search filter, eg:
-  // C Files\t*.[ch]\nText Files\t*.txt"
-  
-  char           *_filt_names;		// filter names (tab delimited)
-  // eg. "C Files\tText Files"
-  
-  char           *_filt_patt[MAXFILTERS];
-  // array of filter patterns, eg:
-  //     _filt_patt[0]="*.{cxx,h}"
-  //     _filt_patt[1]="*.txt"
-  
-  int             _filt_total;		// parse_filter() # of filters loaded
-  int             _filt_value;		// index of the selected filter
-  char           *_errmsg;		// error message
-  
-  // Private methods
-  void errmsg(const char *msg);
-  void clear_pathnames();
-  void set_single_pathname(const char *s);
-  int get_saveas_basename(void);
-  void clear_filters();
-  void add_filter(const char *, const char *);
-  void parse_filter(const char *from);
-  int post();
-  int runmodal();
-#endif
-
-#if ! defined(__APPLE__) && !defined(WIN32)
-private:
-#if FLTK_ABI_VERSION <= 10302
-  int   _btype;			// kind-of browser to show()
-  int   _options;		// general options
-  int   _nfilters;
-  char *_filter;		// user supplied filter
-  char *_parsedfilt;		// parsed filter
-  int   _filtvalue;		// selected filter
-  char *_preset_file;
-  char *_prevvalue;		// Returned filename
-  char *_directory;
-  char *_errmsg;		// error message
-#endif
-  static int have_looked_for_GTK_libs;
-  union {
-    Fl_FLTK_File_Chooser *_x11_file_chooser;
-    Fl_GTK_File_Chooser *_gtk_file_chooser;
   };
-#endif
+
+/** Represents the interface between FLTK and a native file chooser.
+ This class is only for internal use by the FLTK library.
+ A platform that wants to provide a native file chooser implements all virtual methods
+ of this class. Each platform supported by FLTK must also implement the constructor of the
+ Fl_Native_File_Chooser class.
+ */
+class Fl_Native_File_Chooser_Driver {
+protected:
+  static void chrcat(char *s, char c);
+  static char *strapp(char *s, const char *val);
+  static char *strfree(char *val);
+  static char *strnew(const char *val);
+public:
+  Fl_Native_File_Chooser_Driver(int val) {}
+  virtual ~Fl_Native_File_Chooser_Driver() {}
+  virtual void type(int t) {}
+  virtual int type() const  {return 0;}
+  virtual void options(int o) {}
+  virtual int options() const {return 0;}
+  virtual int count() const {return 0;}
+  virtual const char *filename() const  {return 0;}
+  virtual const char *filename(int i) const  {return 0;}
+  virtual void directory(const char *val)  {}
+  virtual const char *directory() const {return 0;}
+  virtual void title(const char *t) {}
+  virtual const char* title() const {return 0;}
+  virtual const char *filter() const  {return 0;}
+  virtual void filter(const char *f) {}
+  virtual int filters() const  {return 0;}
+  virtual void filter_value(int i)  {}
+  virtual int filter_value() const  {return 0;}
+  virtual void preset_file(const char*f)  {}
+  virtual const char* preset_file() const {return 0;}
+  virtual const char *errmsg() const  {return 0;}
+  virtual int show()  {return 1;}
 };
 
-#if !defined(__APPLE__) && !defined(WIN32)
-class Fl_FLTK_File_Chooser {
-  friend class Fl_Native_File_Chooser;
+/** A cross-platform implementation of Fl_Native_File_Chooser_Driver.
+ This implementation uses a Fl_File_Chooser object as file chooser.
+ 
+ Any platform can support the Fl_Native_File_Chooser class by implementing
+ its constructor as follows:
+ \code
+ Fl_Native_File_Chooser::Fl_Native_File_Chooser(int type) {
+   platform_fnfc = new Fl_Native_File_Chooser_FLTK_Driver(type);
+ }
+\endcode
+ */
+class Fl_Native_File_Chooser_FLTK_Driver : public Fl_Native_File_Chooser_Driver {
+private:
+  void errmsg(const char *msg);
+  int type_fl_file(int val);
+  int exist_dialog();
+  void parse_filter();
 protected:
   int   _btype;			// kind-of browser to show()
   int   _options;		// general options
@@ -261,81 +232,35 @@ protected:
   char *_prevvalue;		// Returned filename
   char *_directory;
   char *_errmsg;		// error message
-  Fl_FLTK_File_Chooser(int val);
-  virtual ~Fl_FLTK_File_Chooser();
-  void errmsg(const char *msg);
-  int type_fl_file(int);
-  void parse_filter();
-  void keeplocation();
-  int exist_dialog();
   Fl_File_Chooser *_file_chooser;
-  virtual void type(int);
-  int type() const;
-  void options(int);
-  int options() const;
+public:
+  Fl_Native_File_Chooser_FLTK_Driver(int val);
+  virtual ~Fl_Native_File_Chooser_FLTK_Driver();
+  virtual void type(int t);
+  virtual int type() const ;
+  virtual void options(int o);
+  virtual int options() const;
   virtual int count() const;
-  virtual const char *filename() const;
-  virtual const char *filename(int i) const;
-  void directory(const char *val);
-  const char *directory() const;
-  virtual void title(const char *);
+  virtual const char *filename() const ;
+  virtual const char *filename(int i) const ;
+  virtual void directory(const char *val) ;
+  virtual const char *directory() const;
+  virtual void title(const char *t);
   virtual const char* title() const;
-  const char *filter() const;
-  void filter(const char *);
-  int filters() const;
-  void filter_value(int i);
-  int filter_value() const;
-  void preset_file(const char*);
-  const char* preset_file() const;
-  const char *errmsg() const;
-  virtual int show();
-};
-
-
-class Fl_GTK_File_Chooser : public Fl_FLTK_File_Chooser {
-  friend class Fl_Native_File_Chooser;
-private:
-  typedef struct _GtkWidget GtkWidget;
-  typedef struct _GtkFileFilterInfo GtkFileFilterInfo;
-  struct pair {
-    Fl_GTK_File_Chooser* running; // the running Fl_GTK_File_Chooser
-    const char *filter; // a filter string of the chooser
-    pair(Fl_GTK_File_Chooser* c, const char *f) {
-      running = c; 
-      filter = strdup(f);
-    };
-    ~pair() {
-      free((char*)filter);
-    };
-  };
-  GtkWidget *gtkw_ptr; // used to hold a GtkWidget* without pulling GTK into everything...
-  void *gtkw_slist; // used to hold a GLib GSList...
-  unsigned gtkw_count; // number of files read back - if any
-  mutable char *gtkw_filename; // last name we read back
-  char *gtkw_title; // the title to be applied to the dialog
-  const char *previous_filter;
-  
-  int fl_gtk_chooser_wrapper(); // method that wraps the GTK widget
-  Fl_GTK_File_Chooser(int val);
-  virtual ~Fl_GTK_File_Chooser();
-  static int did_find_GTK_libs;
-  static void probe_for_GTK_libs(void);
-  virtual void type(int);
-  virtual int count() const;
-  virtual const char *filename() const;
-  virtual const char *filename(int i) const;
-  virtual void title(const char *);
-  virtual const char* title() const;
-  virtual int show();
-  void changed_output_type(const char *filter);
-  
-  static int custom_gtk_filter_function(const GtkFileFilterInfo*, Fl_GTK_File_Chooser::pair*);
-  static void free_pair(pair *p);
+  virtual const char *filter() const ;
+  virtual void filter(const char *f);
+  virtual int filters() const ;
+  virtual void filter_value(int i) ;
+  virtual int filter_value() const ;
+  virtual void preset_file(const char*f) ;
+  virtual const char* preset_file() const;
+  virtual const char *errmsg() const ;
+  virtual int show() ;
 };
-#endif // !defined(__APPLE__) && !defined(WIN32)
-
-#endif /*FL_NATIVE_FILE_CHOOSER_H*/
-
-//
-// End of "$Id: Fl_Native_File_Chooser.H 10186 2014-06-07 12:01:59Z manolo $".
-//
+
+
+#endif /*FL_NATIVE_FILE_CHOOSER_H*/
+
+//
+// End of "$Id: Fl_Native_File_Chooser.H 11681 2016-04-23 06:27:31Z manolo $".
+//

+ 37 - 38
fltk/FL/Fl_Nice_Slider.H

@@ -1,38 +1,37 @@
-//
-// "$Id: Fl_Nice_Slider.H 9637 2012-07-24 04:37:22Z matt $"
-//
-// "Nice" slider header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_Nice_Slider widget . */
-
-#ifndef Fl_Nice_Slider_H
-#define Fl_Nice_Slider_H
-
-#include "Fl_Slider.H"
-
-class FL_EXPORT Fl_Nice_Slider : public Fl_Slider {
-public:
-  Fl_Nice_Slider(int X,int Y,int W,int H,const char *L=0);
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_Nice_Slider, Fl_Slider)
-};
-
-#endif
-
-//
-// End of "$Id: Fl_Nice_Slider.H 9637 2012-07-24 04:37:22Z matt $".
-//
+//
+// "$Id: Fl_Nice_Slider.H 9637 2012-07-24 04:37:22Z matt $"
+//
+// "Nice" slider header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2010 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_Nice_Slider widget . */
+
+#ifndef Fl_Nice_Slider_H
+#define Fl_Nice_Slider_H
+
+#include "Fl_Slider.H"
+
+class FL_EXPORT Fl_Nice_Slider : public Fl_Slider {
+public:
+  Fl_Nice_Slider(int X,int Y,int W,int H,const char *L=0);
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_Nice_Slider, Fl_Slider)
+};
+
+#endif
+
+//
+// End of "$Id: Fl_Nice_Slider.H 9637 2012-07-24 04:37:22Z matt $".
+//

+ 27 - 27
fltk/FL/Fl_Object.H

@@ -1,27 +1,27 @@
-//
-// "$Id: Fl_Object.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
-//
-// Old Fl_Object header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-// This file is provided for back compatibility only.  Please use Fl_Widget
-#ifndef Fl_Object
-#define Fl_Object Fl_Widget
-#endif
-#include "Fl_Widget.H"
-
-//
-// End of "$Id: Fl_Object.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
-//
+//
+// "$Id: Fl_Object.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
+//
+// Old Fl_Object header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2010 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+// This file is provided for back compatibility only.  Please use Fl_Widget
+#ifndef Fl_Object
+#define Fl_Object Fl_Widget
+#endif
+#include "Fl_Widget.H"
+
+//
+// End of "$Id: Fl_Object.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
+//

+ 63 - 64
fltk/FL/Fl_Output.H

@@ -1,65 +1,64 @@
-//
-// "$Id: Fl_Output.H 9637 2012-07-24 04:37:22Z matt $"
-//
-// Output header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2011 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_Output widget . */
-
-#ifndef Fl_Output_H
-#define Fl_Output_H
-
-#include "Fl_Input.H"
-/**
-  This widget displays a piece of text.
-  
-  When you set the value() , Fl_Output does a strcpy() to its own storage,
-  which is useful for program-generated values.  The user may select
-  portions of the text using the mouse and paste the contents into other
-  fields or programs.
-
+//
+// "$Id: Fl_Output.H 9637 2012-07-24 04:37:22Z matt $"
+//
+// Output header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2011 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_Output widget . */
+
+#ifndef Fl_Output_H
+#define Fl_Output_H
+
+#include "Fl_Input.H"
+/**
+  This widget displays a piece of text.
+  
+  When you set the value() , Fl_Output does a strcpy() to its own storage,
+  which is useful for program-generated values.  The user may select
+  portions of the text using the mouse and paste the contents into other
+  fields or programs.
+
   <P align=CENTER>\image html text.png</P>
-  \image latex text.png "Fl_Output" width=8cm
-
-  There is a single subclass, Fl_Multiline_Output, which allows you to
-  display multiple lines of text. Fl_Multiline_Output does not provide
-  scroll bars. If a more complete text editing widget is needed, use
-  Fl_Text_Display instead.
-
-  The text may contain any characters except \\0, and will correctly
-  display anything, using ^X notation for unprintable control characters
-  and \\nnn notation for unprintable characters with the high bit set. It
-  assumes the font can draw any characters in the ISO-Latin1 character set.
-*/
-class FL_EXPORT Fl_Output : public Fl_Input {
-public:
-  /**
-    Creates a new Fl_Output widget using the given position,
-    size, and label string. The default boxtype is FL_DOWN_BOX.
-
-    Inherited destructor destroys the widget and any value associated with it.
-  */
-
-    Fl_Output(int X,int Y,int W,int H, const char *l = 0);
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_Output, Fl_Input)
-};
-
-#endif 
-
-//
-// End of "$Id: Fl_Output.H 9637 2012-07-24 04:37:22Z matt $".
-//
+  \image latex text.png "Fl_Output" width=8cm
+
+  There is a single subclass, Fl_Multiline_Output, which allows you to
+  display multiple lines of text. Fl_Multiline_Output does not provide
+  scroll bars. If a more complete text editing widget is needed, use
+  Fl_Text_Display instead.
+
+  The text may contain any characters except \\0, and will correctly
+  display anything, using ^X notation for unprintable control characters
+  and \\nnn notation for unprintable characters with the high bit set. It
+  assumes the font can draw any characters in the ISO-Latin1 character set.
+*/
+class FL_EXPORT Fl_Output : public Fl_Input {
+public:
+  /**
+    Creates a new Fl_Output widget using the given position,
+    size, and label string. The default boxtype is FL_DOWN_BOX.
+
+    Inherited destructor destroys the widget and any value associated with it.
+  */
+
+    Fl_Output(int X,int Y,int W,int H, const char *l = 0);
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_Output, Fl_Input)
+};
+
+#endif 
+
+//
+// End of "$Id: Fl_Output.H 9637 2012-07-24 04:37:22Z matt $".
+//

+ 79 - 78
fltk/FL/Fl_Overlay_Window.H

@@ -1,83 +1,84 @@
-//
-// "$Id: Fl_Overlay_Window.H 9637 2012-07-24 04:37:22Z matt $"
-//
-// Overlay window header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_Overlay_Window class . */
-
-#ifndef Fl_Overlay_Window_H
-#define Fl_Overlay_Window_H
-
-#include "Fl_Double_Window.H"
-
-/**
-  This window provides double buffering and also the ability to draw the
-  "overlay" which is another picture placed on top of the main image. The
-  overlay is designed to be a rapidly-changing but simple graphic such as
-  a mouse selection box. Fl_Overlay_Window uses the overlay
-  planes provided by your graphics hardware if they are available.
-  <P>If no hardware support is found the overlay is simulated by drawing
-  directly into the on-screen copy of the double-buffered window, and
-  "erased" by copying the backbuffer over it again.  This means the
-  overlay will blink if you change the image in the window.
-*/
-class FL_EXPORT Fl_Overlay_Window : public Fl_Double_Window {
-#ifndef FL_DOXYGEN
-  friend class _Fl_Overlay;
-#endif
-protected:
-  /**
-   You must subclass Fl_Overlay_Window and provide this method.
-   It is just like a draw() method, except it draws the overlay.
-   The overlay will have already been "cleared" when this is called.  You
-   can use any of the routines described in &lt;FL/fl_draw.H&gt;.
-   */
-  virtual void draw_overlay() = 0;
-private:
-  Fl_Window *overlay_;
-public:
-  void show();
-  void flush();
-  void hide();
-  void resize(int,int,int,int);
-  ~Fl_Overlay_Window();
-  /** Returns non-zero if there's hardware overlay support */
-  int can_do_overlay();
-  void redraw_overlay();
-protected:
-  /**
-   See Fl_Overlay_Window::Fl_Overlay_Window(int X, int Y, int W, int H, const char *l=0)
-   */
-  Fl_Overlay_Window(int W, int H, const char *l=0);
-  /**
+//
+// "$Id: Fl_Overlay_Window.H 11440 2016-03-27 06:58:54Z manolo $"
+//
+// Overlay window header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2010 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_Overlay_Window class . */
+
+#ifndef Fl_Overlay_Window_H
+#define Fl_Overlay_Window_H
+
+#include "Fl_Double_Window.H"
+
+/**
+  This window provides double buffering and also the ability to draw the
+  "overlay" which is another picture placed on top of the main image. The
+  overlay is designed to be a rapidly-changing but simple graphic such as
+  a mouse selection box. Fl_Overlay_Window uses the overlay
+  planes provided by your graphics hardware if they are available.
+  <P>If no hardware support is found the overlay is simulated by drawing
+  directly into the on-screen copy of the double-buffered window, and
+  "erased" by copying the backbuffer over it again.  This means the
+  overlay will blink if you change the image in the window.
+*/
+class FL_EXPORT Fl_Overlay_Window : public Fl_Double_Window {
+#ifndef FL_DOXYGEN
+  friend class _Fl_Overlay;
+  friend class Fl_Window_Driver;
+#endif
+public:
+  /**
+   You must subclass Fl_Overlay_Window and provide this method.
+   It is just like a draw() method, except it draws the overlay.
+   The overlay will have already been "cleared" when this is called.  You
+   can use any of the routines described in &lt;FL/fl_draw.H&gt;.
+   */
+  virtual void draw_overlay() = 0;
+private:
+  Fl_Window *overlay_;
+public:
+  void show();
+  void hide();
+  void flush();
+  void resize(int,int,int,int);
+  ~Fl_Overlay_Window();
+  /** Returns non-zero if there's hardware overlay support */
+  int can_do_overlay();
+  void redraw_overlay();
+protected:
+  /**
+   See Fl_Overlay_Window::Fl_Overlay_Window(int X, int Y, int W, int H, const char *l=0)
+   */
+  Fl_Overlay_Window(int W, int H, const char *l=0);
+  /**
    Creates a new Fl_Overlay_Window widget using the given
    position, size, and label (title) string. If the 
    positions (x,y) are not given, then the window manager
    will choose them.
    */
-  Fl_Overlay_Window(int X, int Y, int W, int H, const char *l=0);
-public:
-  void show(int a, char **b) {Fl_Double_Window::show(a,b);}
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_Overlay_Window, Fl_Double_Window)
-};
-
-#endif
-
-//
-// End of "$Id: Fl_Overlay_Window.H 9637 2012-07-24 04:37:22Z matt $".
-//
+  Fl_Overlay_Window(int X, int Y, int W, int H, const char *l=0);
+public:
+  void show(int a, char **b) {Fl_Double_Window::show(a,b);}
+  virtual Fl_Overlay_Window *as_overlay_window() {return this; }
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_Overlay_Window, Fl_Double_Window)
+};
+
+#endif
+
+//
+// End of "$Id: Fl_Overlay_Window.H 11440 2016-03-27 06:58:54Z manolo $".
+//

+ 48 - 49
fltk/FL/Fl_PNG_Image.H

@@ -1,49 +1,48 @@
-//
-// "$Id: Fl_PNG_Image.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
-//
-// PNG image header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_PNG_Image class . */
-
-#ifndef Fl_PNG_Image_H
-#define Fl_PNG_Image_H
-#  include "Fl_Image.H"
-
-/**
-  The Fl_PNG_Image class supports loading, caching,
-  and drawing of Portable Network Graphics (PNG) image files. The
-  class loads colormapped and full-color images and handles color-
-  and alpha-based transparency.
-*/
-class FL_EXPORT Fl_PNG_Image : public Fl_RGB_Image {
-
-public:
-
-  Fl_PNG_Image(const char* filename);
-  Fl_PNG_Image (const char *name_png, const unsigned char *buffer, int datasize);
-  static int encode(Fl_Image *img, unsigned char **outbuffer, int &outlen);
-private:
-  void load_png_(const char *name_png, const unsigned char *buffer_png, int datasize);
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_PNG_Image, Fl_RGB_Image)
-};
-
-#endif
-
-//
-// End of "$Id: Fl_PNG_Image.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
-//
+//
+// "$Id: Fl_PNG_Image.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
+//
+// PNG image header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2010 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_PNG_Image class . */
+
+#ifndef Fl_PNG_Image_H
+#define Fl_PNG_Image_H
+#  include "Fl_Image.H"
+
+/**
+  The Fl_PNG_Image class supports loading, caching,
+  and drawing of Portable Network Graphics (PNG) image files. The
+  class loads colormapped and full-color images and handles color-
+  and alpha-based transparency.
+*/
+class FL_EXPORT Fl_PNG_Image : public Fl_RGB_Image {
+
+public:
+
+  Fl_PNG_Image(const char* filename);
+  Fl_PNG_Image (const char *name_png, const unsigned char *buffer, int datasize);
+  static int encode(Fl_Image *img, unsigned char **outbuffer, int &outlen);
+private:
+  void load_png_(const char *name_png, const unsigned char *buffer_png, int datasize);
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_PNG_Image, Fl_RGB_Image)
+};
+
+#endif
+
+//
+// End of "$Id: Fl_PNG_Image.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
+//

+ 44 - 45
fltk/FL/Fl_PNM_Image.H

@@ -1,45 +1,44 @@
-//
-// "$Id: Fl_PNM_Image.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
-//
-// PNM image header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_PNM_Image class . */
-
-#ifndef Fl_PNM_Image_H
-#define Fl_PNM_Image_H
-#  include "Fl_Image.H"
-
-/**
-  The Fl_PNM_Image class supports loading, caching,
-  and drawing of Portable Anymap (PNM, PBM, PGM, PPM) image files. The class
-  loads bitmap, grayscale, and full-color images in both ASCII and
-  binary formats.
-*/
-class FL_EXPORT Fl_PNM_Image : public Fl_RGB_Image {
-
-  public:
-
-  Fl_PNM_Image(const char* filename);
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_PNM_Image, Fl_RGB_Image)
-};
-
-#endif
-
-//
-// End of "$Id: Fl_PNM_Image.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
-//
+//
+// "$Id: Fl_PNM_Image.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
+//
+// PNM image header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2010 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_PNM_Image class . */
+
+#ifndef Fl_PNM_Image_H
+#define Fl_PNM_Image_H
+#  include "Fl_Image.H"
+
+/**
+  The Fl_PNM_Image class supports loading, caching,
+  and drawing of Portable Anymap (PNM, PBM, PGM, PPM) image files. The class
+  loads bitmap, grayscale, and full-color images in both ASCII and
+  binary formats.
+*/
+class FL_EXPORT Fl_PNM_Image : public Fl_RGB_Image {
+
+  public:
+
+  Fl_PNM_Image(const char* filename);
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_PNM_Image, Fl_RGB_Image)
+};
+
+#endif
+
+//
+// End of "$Id: Fl_PNM_Image.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
+//

+ 79 - 80
fltk/FL/Fl_Pack.H

@@ -1,80 +1,79 @@
-//
-// "$Id: Fl_Pack.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
-//
-// Pack header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_Pack widget . */
-
-#ifndef Fl_Pack_H
-#define Fl_Pack_H
-
-#include <FL/Fl_Group.H>
-
-/**
-  This widget was designed to add the functionality of compressing and
-  aligning widgets.
-  <P>If type() is Fl_Pack::HORIZONTAL all the children are
-  resized to the height of the Fl_Pack, and are moved next to
-  each other horizontally. If type() is not Fl_Pack::HORIZONTAL
-  then the children are resized to the width and are stacked below each
-  other.  Then the Fl_Pack resizes itself to surround the child
-  widgets.
-  <P>This widget is needed for the Fl_Tabs.
-  In addition you may want to put the Fl_Pack inside an 
-  Fl_Scroll.
-
-  <P>The resizable for Fl_Pack is set to NULL by default.</p>
-  <P>See also: Fl_Group::resizable()
-*/
-class FL_EXPORT Fl_Pack : public Fl_Group {
-  int spacing_, with_label_;
-
-public:
-  enum { // values for type(int)
-    VERTICAL = 0,
-    HORIZONTAL = 1
-  };
-
-protected:
-  void draw();
-
-public:
-  Fl_Pack(int x,int y,int w ,int h,const char *l = 0);
-  /**
-    Gets the number of extra pixels of blank space that are added
-    between the children.
-  */
-  int spacing() const {return spacing_;}
-  /**
-    Sets the number of extra pixels of blank space that are added
-    between the children.
-  */
-  void spacing(int i) {spacing_ = i;}
-  /** Same as Fl_Group::type() */
-  uchar horizontal() const {return type();}
-
-  int with_label() { return with_label_;};
-  void with_label(int abool) {with_label_ = abool;};
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_Pack, Fl_Group)
-};
-
-#endif
-
-//
-// End of "$Id: Fl_Pack.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
-//
+//
+// "$Id: Fl_Pack.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
+//
+// Pack header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2010 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_Pack widget . */
+
+#ifndef Fl_Pack_H
+#define Fl_Pack_H
+
+#include <FL/Fl_Group.H>
+
+/**
+  This widget was designed to add the functionality of compressing and
+  aligning widgets.
+  <P>If type() is Fl_Pack::HORIZONTAL all the children are
+  resized to the height of the Fl_Pack, and are moved next to
+  each other horizontally. If type() is not Fl_Pack::HORIZONTAL
+  then the children are resized to the width and are stacked below each
+  other.  Then the Fl_Pack resizes itself to surround the child
+  widgets.
+  <P>This widget is needed for the Fl_Tabs.
+  In addition you may want to put the Fl_Pack inside an 
+  Fl_Scroll.
+
+  <P>The resizable for Fl_Pack is set to NULL by default.</p>
+  <P>See also: Fl_Group::resizable()
+*/
+class FL_EXPORT Fl_Pack : public Fl_Group {
+  int spacing_, with_label_;
+
+public:
+  enum { // values for type(int)
+    VERTICAL = 0,
+    HORIZONTAL = 1
+  };
+
+protected:
+  void draw();
+
+public:
+  Fl_Pack(int x,int y,int w ,int h,const char *l = 0);
+  /**
+    Gets the number of extra pixels of blank space that are added
+    between the children.
+  */
+  int spacing() const {return spacing_;}
+  /**
+    Sets the number of extra pixels of blank space that are added
+    between the children.
+  */
+  void spacing(int i) {spacing_ = i;}
+  /** Same as Fl_Group::type() */
+  uchar horizontal() const {return type();}
+  int with_label() { return with_label_;};
+  void with_label(int abool) {with_label_ = abool;};
+
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_Pack, Fl_Group)
+};
+
+#endif
+
+//
+// End of "$Id: Fl_Pack.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
+//

+ 128 - 153
fltk/FL/Fl_Paged_Device.H

@@ -1,153 +1,128 @@
-//
-// "$Id: Fl_Paged_Device.H 9706 2012-11-06 20:46:14Z matt $"
-//
-// Printing support for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/** \file Fl_Paged_Device.H
- \brief declaration of class Fl_Paged_Device.
- */
-
-#ifndef Fl_Paged_Device_H
-#define Fl_Paged_Device_H
-
-#include <FL/Fl_Device.H>
-#include <FL/Fl_Window.H>
-
-/** \brief Number of elements in enum Page_Format */
-#define NO_PAGE_FORMATS 30 /* MSVC6 compilation fix */
-
-/**
- \brief Represents page-structured drawing surfaces.
- *
- This class has no public constructor: don't instantiate it; use Fl_Printer
- or Fl_PostScript_File_Device instead.
- */
-class FL_EXPORT Fl_Paged_Device : public Fl_Surface_Device {
-public:
-  /**
-   \brief Possible page formats.
-
-   All paper formats with pre-defined width and height.
-   */
-  enum Page_Format {
-    A0 = 0, /**<  A0 format */
-    A1,
-    A2,
-    A3,
-    A4, /**<  A4 format */
-    A5,
-    A6,
-    A7,
-    A8,
-    A9,
-    B0,
-    B1,
-    B2,
-    B3,
-    B4,
-    B5,
-    B6,
-    B7,
-    B8,
-    B9,
-    B10,
-    C5E,
-    DLE,
-    EXECUTIVE,
-    FOLIO,
-    LEDGER,
-    LEGAL,
-    LETTER, /**<  Letter format */
-    TABLOID,
-    ENVELOPE,
-    MEDIA = 0x1000
-  };
-  /**
-   \brief Possible page layouts.
-   */
-  enum Page_Layout {
-    PORTRAIT = 0,  /**< Portrait orientation */
-    LANDSCAPE = 0x100,   /**< Landscape orientation */
-    REVERSED = 0x200,  /**< Reversed orientation */
-    ORIENTATION = 0x300 /**<  orientation */
-  };
-
-  /** \brief width, height and name of a page format
- */
-  typedef struct {
-    /** \brief width in points */
-    int width;
-    /** \brief height in points */
-    int height;
-    /** \brief format name */
-    const char *name;
-  } page_format;
-  /** \brief width, height and name of all elements of the enum \ref Page_Format.
-   */
-  static const page_format page_formats[NO_PAGE_FORMATS];
-private:
-  void traverse(Fl_Widget *widget); // finds subwindows of widget and prints them
-protected:
-  /** \brief horizontal offset to the origin of graphics coordinates */
-  int x_offset;
-  /** \brief vertical offset to the origin of graphics coordinates */
-  int y_offset;
-  /** \brief The constructor */
-  Fl_Paged_Device() : Fl_Surface_Device(NULL), x_offset(0), y_offset(0) {};
-  int ask_for_printer_;
-#if FLTK_ABI_VERSION >= 10301
-public:
-  /** \brief The destructor */
-  virtual ~Fl_Paged_Device() {};
-#else
-  /** \brief The destructor */
-  virtual ~Fl_Paged_Device() {};
-public:
-#endif // FLTK_ABI_VERSION
-  static const char *class_id;
-  const char *class_name() {return class_id;};
-  virtual int start_job(int pagecount, int *frompage = NULL, int *topage = NULL);
-  virtual int start_page(void);
-  virtual int printable_rect(int *w, int *h);
-  virtual void margins(int *left, int *top, int *right, int *bottom);
-  virtual void origin(int x, int y);
-  virtual void origin(int *x, int *y);
-  virtual void scale(float scale_x, float scale_y = 0.);
-  virtual void rotate(float angle);
-  virtual void translate(int x, int y);
-  virtual void untranslate(void);
-  virtual void print_widget(Fl_Widget* widget, int delta_x = 0, int delta_y = 0);
-  /** Prints a window with its title bar and frame if any.
-
-   \p x_offset and \p y_offset are optional coordinates of where to position the window top left.
-   Equivalent to print_widget() if \p win is a subwindow or has no border.
-   Use Fl_Window::decorated_w() and Fl_Window::decorated_h() to get the size of the
-   printed window.
-   */
-  void print_window(Fl_Window *win, int x_offset = 0, int y_offset = 0);
-  virtual void print_window_part(Fl_Window *win, int x, int y, int w, int h, int delta_x = 0, int delta_y = 0);
-  virtual int end_page (void);
-  virtual void end_job (void);
-  int ask_for_printer() {return ask_for_printer_;};
-  void ask_for_printer(int bmode) {ask_for_printer_ = bmode;};
-};
-
-#endif // Fl_Paged_Device_H
-
-//
-// End of "$Id: Fl_Paged_Device.H 9706 2012-11-06 20:46:14Z matt $"
-//
-
+//
+// "$Id: Fl_Paged_Device.H 11364 2016-03-18 18:20:11Z manolo $"
+//
+// Printing support for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 2010-2016 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/** \file Fl_Paged_Device.H 
+ \brief declaration of class Fl_Paged_Device.
+ */
+
+#ifndef Fl_Paged_Device_H
+#define Fl_Paged_Device_H
+
+#include <FL/Fl_Widget_Surface.H>
+
+
+/** \brief Number of elements in enum Page_Format */
+#define NO_PAGE_FORMATS 30 /* MSVC6 compilation fix */
+
+/**
+ \brief Represents page-structured drawing surfaces.
+ *
+ This class has no public constructor: don't instantiate it; use Fl_Printer 
+ or Fl_PostScript_File_Device instead.
+ */
+class FL_EXPORT Fl_Paged_Device : public Fl_Widget_Surface {
+protected:
+  /** \brief The constructor */
+  Fl_Paged_Device() : Fl_Widget_Surface(NULL) {};
+  /** A platform should implement this function to support printing via the Fl_Printer class. */
+  static Fl_Paged_Device* newPrinterDriver(void);
+public:
+  /**
+   \brief Possible page formats.
+   
+   All paper formats with pre-defined width and height.
+   */
+  enum Page_Format {
+    A0 = 0, /**<  A0 format */
+    A1,
+    A2,
+    A3,
+    A4, /**<  A4 format */
+    A5,
+    A6,
+    A7,
+    A8,
+    A9,
+    B0,
+    B1,
+    B2,
+    B3,
+    B4,
+    B5,
+    B6,
+    B7,
+    B8,
+    B9,
+    B10,
+    C5E,
+    DLE,
+    EXECUTIVE,
+    FOLIO,
+    LEDGER,
+    LEGAL,
+    LETTER, /**<  Letter format */
+    TABLOID,
+    ENVELOPE,
+    MEDIA = 0x1000
+  };
+  /**
+   \brief Possible page layouts.
+   */
+  enum Page_Layout {
+    PORTRAIT = 0,  /**< Portrait orientation */
+    LANDSCAPE = 0x100,   /**< Landscape orientation */
+    REVERSED = 0x200,  /**< Reversed orientation */
+    ORIENTATION = 0x300 /**<  orientation */
+  };
+
+  /** \brief width, height and name of a page format
+ */
+  typedef struct {
+    /** \brief width in points */
+    int width; 
+    /** \brief height in points */
+    int height; 
+    /** \brief format name */
+    const char *name; 
+  } page_format;
+  /** \brief width, height and name of all elements of the enum \ref Page_Format.
+   */
+  static const page_format page_formats[NO_PAGE_FORMATS];  
+  /** \brief The destructor */
+  virtual ~Fl_Paged_Device() {};
+  virtual int start_job(int pagecount, int *frompage = NULL, int *topage = NULL);
+  virtual int start_page(void);
+  virtual void margins(int *left, int *top, int *right, int *bottom);
+  virtual void scale(float scale_x, float scale_y = 0.);
+  virtual void rotate(float angle);
+  /** Synonym of draw(Fl_Widget*, int, int) */
+  void print_widget(Fl_Widget* widget, int delta_x = 0, int delta_y = 0) {draw(widget, delta_x, delta_y);}
+  /** Synonym of draw_decorated_window(Fl_Window*, int, int) */
+  void print_window(Fl_Window *win, int x_offset = 0, int y_offset = 0) {
+    draw_decorated_window(win, x_offset, y_offset);
+  }
+  virtual int end_page (void);
+  virtual void end_job (void);
+};
+
+#endif // Fl_Paged_Device_H
+
+//
+// End of "$Id: Fl_Paged_Device.H 11364 2016-03-18 18:20:11Z manolo $"
+//
+

+ 257 - 257
fltk/FL/Fl_Pdf.H

@@ -1,260 +1,260 @@
-//
-// "$Id: Fl_Pdf.H 7622 2010-05-27 17:50:51Z manolo $"
-//
-// Support for graphics output to PDF file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 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
-//
-/** \file Fl_Pdf.H
- \brief declaration of classes Fl_Pdf_Graphics_Driver, Fl_Pdf_File_Device.
- */
-
-
-#ifndef Fl_Pdf_H
-#define Fl_Pdf_H
-
-#include <FL/Fl_Paged_Device.H>
-#include <FL/fl_draw.H>
-#include "hpdf.h"
-
-/**
- \brief PDF graphical backend.
- *
- PDF text output is presently implemented only for the latin character set.
- FLTK's standard fonts are output using PDF's standard fonts: Helvetica, Courier,
- Times (and their bold, oblique, italic variants), Symbol, ZapfDingbats.
- */
-class Fl_Pdf_Graphics_Driver : public Fl_Graphics_Driver {
-
-#ifndef FL_DOXYGEN
-public:
-  enum SHAPE{NONE=0, LINE, LOOP, POLYGON, POINTS};
-
-typedef struct page_format {
-  int width;
-  int height;
-  const char *name;
-} page_format;
-
-class Clip {
-  public:
-    int x, y, w, h;
-    Clip *prev;
-  };
-  Clip * clip_;
-
-  int lang_level_;
-  HPDF_Font pdf_font_;
-  int gap_;
-  int pages_;
-
-  double width_;
-  double height_;
-
-  int shape_;
-  int linewidth_;// need for clipping, lang level 1-2
-  int linestyle_;//
-  int interpolate_; //interpolation of images
-  unsigned char cr_,cg_,cb_;
-  char  linedash_[256];//should be enough
-  void concat();  // transform ror scalable dradings...
-  void reconcat(); //invert
-  void recover(); //recovers the state after grestore (such as line styles...)
-  void reset();
-
-  uchar * mask;
-  int mx; // width of mask;
-  int my; // mask lines
-  //Fl_Color bg_;
-  int (*close_cmd_)(FILE *);
-  int page_policy_;
-  int nPages;
-  int orientation_;
-
-  float scale_x;
-  float scale_y;
-  float angle;
-  int left_margin;
-  int top_margin;
-
-  FILE *output;
-  double pw_, ph_;
-
-  uchar bg_r, bg_g, bg_b;
-  HPDF_Page pdf_page;
-  HPDF_Doc pdf;
-  char *text_buffer;
-  int text_buffer_size;
-  int start_PDF (int pagecount, enum Fl_Paged_Device::Page_Format format,
-                 enum Fl_Paged_Device::Page_Layout layout);
-  /*  int alpha_mask(const uchar * data, int w, int h, int D, int LD=0);
-   */
-  void draw(const char* s, int n, int x, int y) {transformed_draw(s,n,x,y); };
-  void draw(int angle, const char *str, int n, int x, int y);
-  void transformed_draw(const char* s, int n, double x, double y); //precise text placing
-  void transformed_draw(const char* s, double x, double y);
-  void rtl_draw(const char* str, int n, int x, int y);
-  int alpha_mask(const uchar * data, int w, int h, int D, int LD=0);
-  void draw_scaled_image(const uchar *data, double x, double y, double w, double h, int iw, int ih, int D=3, int LD=0);
-  void draw_scaled_image_mono(const uchar *data, double x, double y, double w, double h, int iw, int ih, int D=3, int LD=0);
-  void draw_scaled_image(Fl_Draw_Image_Cb call, void *data, double x, double y, double w, double h, int iw, int ih, int D);
-  void draw_scaled_image_mono(Fl_Draw_Image_Cb call, void *data, double x, double y, double w, double h, int iw, int ih, int D);
-
-  enum Fl_Paged_Device::Page_Format page_format_;
-  char *pdf_filename_;
-  // implementation of drawing methods
-  void color(Fl_Color c);
-  //void bg_color(Fl_Color bg);
-  void color(uchar r, uchar g, uchar b);
-
-  void push_clip(int x, int y, int w, int h);
-  int clip_box(int x, int y, int w, int h, int &X, int &Y, int &W, int &H);
-  int not_clipped(int x, int y, int w, int h);
-  void push_no_clip();
-  void pop_clip();
-
-  void line_style(int style, int width=0, char* dashes=0);
-
-  void rect(int x, int y, int w, int h);
-  void rectf(int x, int y, int w, int h);
-
-  void xyline(int x, int y, int x1);
-  void xyline(int x, int y, int x1, int y2);
-  void xyline(int x, int y, int x1, int y2, int x3);
-
-  void yxline(int x, int y, int y1);
-  void yxline(int x, int y, int y1, int x2);
-  void yxline(int x, int y, int y1, int x2, int y3);
-
-  void line(int x1, int y1, int x2, int y2);
-  void line(int x1, int y1, int x2, int y2, int x3, int y3);
-
-  void loop(int x0, int y0, int x1, int y1, int x2, int y2);
-  void loop(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3);
-  void polygon(int x0, int y0, int x1, int y1, int x2, int y2);
-  void polygon(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3);
-  void point(int x, int y);
-
-  void begin_points();
-  void begin_line();
-  void begin_loop();
-  void begin_polygon();
-  void vertex(double x, double y);
-  void curve(double x, double y, double x1, double y1, double x2, double y2, double x3, double y3);
-  void circle(double x, double y, double r);
-  void arc(double x, double y, double r, double start, double a);
-  void arc(int x, int y, int w, int h, double a1, double a2);
-  void pie(int x, int y, int w, int h, double a1, double a2);
-  void end_points();
-  void end_line();
-  void end_loop();
-  void end_polygon();
-  void begin_complex_polygon(){begin_polygon();};
-  void gap(){gap_=1;};
-  void end_complex_polygon(){end_polygon();};
-  void transformed_vertex(double x, double y);
-  void fl_rotate(double d) {Fl_Graphics_Driver::rotate(-d);};
-
-  void font(int face, int size);
-
-  double width(const char* s, int n);
-  int descent();
-  int height();
-
-  void draw_image(const uchar* d, int x,int y,int w,int h, int delta=3, int ldelta=0){draw_scaled_image(d,x,y,w,h,w,h,delta,ldelta);};
-  void draw_image_mono(const uchar* d, int x,int y,int w,int h, int delta=1, int ld=0){draw_scaled_image_mono(d,x,y,w,h,w,h,delta,ld);};
-  void draw_image(Fl_Draw_Image_Cb call, void* data, int x,int y, int w, int h, int delta=3){draw_scaled_image(call,data, x, y, w, h, w, h, delta);};
-  void draw_image_mono(Fl_Draw_Image_Cb call, void* data, int x,int y, int w, int h, int delta=1){draw_scaled_image_mono(call, data, x, y, w, h, w, h, delta);};
-
-  void draw(Fl_Pixmap * pxm,int XP, int YP, int WP, int HP, int cx, int cy);
-  void draw(Fl_RGB_Image * rgb,int XP, int YP, int WP, int HP, int cx, int cy);
-  void draw(Fl_Bitmap * bitmap,int XP, int YP, int WP, int HP, int cx, int cy);
-
-public:
-  static const char *class_id;
-  const char *class_name() {return class_id;};
-  void page_policy(int p);
-  int page_policy(){return page_policy_;};
-  void close_command( int (*cmd)(FILE *)){close_cmd_=cmd;};
-  FILE * file() {return output;};
-  //void orientation (int o);
-  //Fl_Pdf_Graphics_Driver(FILE *o, int lang_level, int pages = 0); // ps (also multi-page) constructor
-  //Fl_Pdf_Graphics_Driver(FILE *o, int lang_level, int x, int y, int w, int h); //eps constructor
-  void interpolate(int i){interpolate_=i;};
-  int interpolate(){return interpolate_;}
-
-  void page(double pw, double ph, int media = 0);
-  void page(int format);
-  void page();
-
-  void place(double x, double y, double tx, double ty, double scale = 1);
-#endif // FL_DOXYGEN
-  Fl_Pdf_Graphics_Driver();
+//
+// "$Id: Fl_Pdf.H 7622 2010-05-27 17:50:51Z manolo $"
+//
+// Support for graphics output to PDF file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 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
+//
+/** \file Fl_Pdf.H
+ \brief declaration of classes Fl_Pdf_Graphics_Driver, Fl_Pdf_File_Device.
+ */
+
+
+#ifndef Fl_Pdf_H
+#define Fl_Pdf_H
+
+#include <FL/Fl_Paged_Device.H>
+#include <FL/fl_draw.H>
+#include "hpdf.h"
+
+/**
+ \brief PDF graphical backend.
+ *
+ PDF text output is presently implemented only for the latin character set.
+ FLTK's standard fonts are output using PDF's standard fonts: Helvetica, Courier,
+ Times (and their bold, oblique, italic variants), Symbol, ZapfDingbats.
+ */
+class Fl_Pdf_Graphics_Driver : public Fl_Graphics_Driver {
+
+#ifndef FL_DOXYGEN
+public:
+  enum SHAPE{NONE=0, LINE, LOOP, POLYGON, POINTS};
+
+typedef struct page_format {
+  int width;
+  int height;
+  const char *name;
+} page_format;
+
+class Clip {
+  public:
+    int x, y, w, h;
+    Clip *prev;
+  };
+  Clip * clip_;
+
+  int lang_level_;
+  HPDF_Font pdf_font_;
+  int gap_;
+  int pages_;
+
+  double width_;
+  double height_;
+
+  int shape_;
+  int linewidth_;// need for clipping, lang level 1-2
+  int linestyle_;//
+  int interpolate_; //interpolation of images
+  unsigned char cr_,cg_,cb_;
+  char  linedash_[256];//should be enough
+  void concat();  // transform ror scalable dradings...
+  void reconcat(); //invert
+  void recover(); //recovers the state after grestore (such as line styles...)
+  void reset();
+
+  uchar * mask;
+  int mx; // width of mask;
+  int my; // mask lines
+  //Fl_Color bg_;
+  int (*close_cmd_)(FILE *);
+  int page_policy_;
+  int nPages;
+  int orientation_;
+
+  float scale_x;
+  float scale_y;
+  float angle;
+  int left_margin;
+  int top_margin;
+
+  FILE *output;
+  double pw_, ph_;
+
+  uchar bg_r, bg_g, bg_b;
+  HPDF_Page pdf_page;
+  HPDF_Doc pdf;
+  char *text_buffer;
+  int text_buffer_size;
+  int start_PDF (int pagecount, enum Fl_Paged_Device::Page_Format format,
+                 enum Fl_Paged_Device::Page_Layout layout);
+  /*  int alpha_mask(const uchar * data, int w, int h, int D, int LD=0);
+   */
+  void draw(const char* s, int n, int x, int y) {transformed_draw(s,n,x,y); };
+  void draw(int angle, const char *str, int n, int x, int y);
+  void transformed_draw(const char* s, int n, double x, double y); //precise text placing
+  void transformed_draw(const char* s, double x, double y);
+  void rtl_draw(const char* str, int n, int x, int y);
+  int alpha_mask(const uchar * data, int w, int h, int D, int LD=0);
+  void draw_scaled_image(const uchar *data, double x, double y, double w, double h, int iw, int ih, int D=3, int LD=0);
+  void draw_scaled_image_mono(const uchar *data, double x, double y, double w, double h, int iw, int ih, int D=3, int LD=0);
+  void draw_scaled_image(Fl_Draw_Image_Cb call, void *data, double x, double y, double w, double h, int iw, int ih, int D);
+  void draw_scaled_image_mono(Fl_Draw_Image_Cb call, void *data, double x, double y, double w, double h, int iw, int ih, int D);
+
+  enum Fl_Paged_Device::Page_Format page_format_;
+  char *pdf_filename_;
+  // implementation of drawing methods
+  void color(Fl_Color c);
+  //void bg_color(Fl_Color bg);
+  void color(uchar r, uchar g, uchar b);
+
+  void push_clip(int x, int y, int w, int h);
+  int clip_box(int x, int y, int w, int h, int &X, int &Y, int &W, int &H);
+  int not_clipped(int x, int y, int w, int h);
+  void push_no_clip();
+  void pop_clip();
+
+  void line_style(int style, int width=0, char* dashes=0);
+
+  void rect(int x, int y, int w, int h);
+  void rectf(int x, int y, int w, int h);
+
+  void xyline(int x, int y, int x1);
+  void xyline(int x, int y, int x1, int y2);
+  void xyline(int x, int y, int x1, int y2, int x3);
+
+  void yxline(int x, int y, int y1);
+  void yxline(int x, int y, int y1, int x2);
+  void yxline(int x, int y, int y1, int x2, int y3);
+
+  void line(int x1, int y1, int x2, int y2);
+  void line(int x1, int y1, int x2, int y2, int x3, int y3);
+
+  void loop(int x0, int y0, int x1, int y1, int x2, int y2);
+  void loop(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3);
+  void polygon(int x0, int y0, int x1, int y1, int x2, int y2);
+  void polygon(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3);
+  void point(int x, int y);
+
+  void begin_points();
+  void begin_line();
+  void begin_loop();
+  void begin_polygon();
+  void vertex(double x, double y);
+  void curve(double x, double y, double x1, double y1, double x2, double y2, double x3, double y3);
+  void circle(double x, double y, double r);
+  void arc(double x, double y, double r, double start, double a);
+  void arc(int x, int y, int w, int h, double a1, double a2);
+  void pie(int x, int y, int w, int h, double a1, double a2);
+  void end_points();
+  void end_line();
+  void end_loop();
+  void end_polygon();
+  void begin_complex_polygon(){begin_polygon();};
+  void gap(){gap_=1;};
+  void end_complex_polygon(){end_polygon();};
+  void transformed_vertex(double x, double y);
+  void fl_rotate(double d) {Fl_Graphics_Driver::rotate(-d);};
+
+  void font(int face, int size);
+
+  double width(const char* s, int n);
+  int descent();
+  int height();
+
+  void draw_image(const uchar* d, int x,int y,int w,int h, int delta=3, int ldelta=0){draw_scaled_image(d,x,y,w,h,w,h,delta,ldelta);};
+  void draw_image_mono(const uchar* d, int x,int y,int w,int h, int delta=1, int ld=0){draw_scaled_image_mono(d,x,y,w,h,w,h,delta,ld);};
+  void draw_image(Fl_Draw_Image_Cb call, void* data, int x,int y, int w, int h, int delta=3){draw_scaled_image(call,data, x, y, w, h, w, h, delta);};
+  void draw_image_mono(Fl_Draw_Image_Cb call, void* data, int x,int y, int w, int h, int delta=1){draw_scaled_image_mono(call, data, x, y, w, h, w, h, delta);};
+
+  void draw(Fl_Pixmap * pxm,int XP, int YP, int WP, int HP, int cx, int cy);
+  void draw(Fl_RGB_Image * rgb,int XP, int YP, int WP, int HP, int cx, int cy);
+  void draw(Fl_Bitmap * bitmap,int XP, int YP, int WP, int HP, int cx, int cy);
+
+public:
+  static const char *class_id;
+  const char *class_name() {return class_id;};
+  void page_policy(int p);
+  int page_policy(){return page_policy_;};
+  void close_command( int (*cmd)(FILE *)){close_cmd_=cmd;};
+  FILE * file() {return output;};
+  //void orientation (int o);
+  //Fl_Pdf_Graphics_Driver(FILE *o, int lang_level, int pages = 0); // ps (also multi-page) constructor
+  //Fl_Pdf_Graphics_Driver(FILE *o, int lang_level, int x, int y, int w, int h); //eps constructor
+  void interpolate(int i){interpolate_=i;};
+  int interpolate(){return interpolate_;}
+
+  void page(double pw, double ph, int media = 0);
+  void page(int format);
+  void page();
+
+  void place(double x, double y, double tx, double ty, double scale = 1);
+#endif // FL_DOXYGEN
+  Fl_Pdf_Graphics_Driver();
   ~Fl_Pdf_Graphics_Driver();
 
   int xdpi() {return 72;};
-  int ydpi() {return 72;};
-};
-
-/**
- \brief To send graphical output to a PDF file.
- */
-class Fl_Pdf_File_Device : public Fl_Paged_Device {
-#ifdef __APPLE__
-  CGContextRef gc;
-#endif
-protected:
-  Fl_Pdf_Graphics_Driver *driver();
-public:
-  static const char *class_id;
-  const char *class_name() {return class_id;};
-  Fl_Pdf_File_Device();
-  ~Fl_Pdf_File_Device();
-  void compress(int abool);
-  HPDF_Doc pdf_doc();
-  int start_job(int pagecount, enum Fl_Paged_Device::Page_Format format = Fl_Paged_Device::A4,
-		enum Fl_Paged_Device::Page_Layout layout = Fl_Paged_Device::PORTRAIT);
-  int start_job(const char *pdf_filename, int pagecount,
-        enum Fl_Paged_Device::Page_Format format = Fl_Paged_Device::A4,
-		enum Fl_Paged_Device::Page_Layout layout = Fl_Paged_Device::PORTRAIT);
-  int start_page (void);
-  int printable_rect(int *w, int *h);
-  void margins(int *left, int *top, int *right, int *bottom);
-  void origin(int x, int y);
-  void scale (float scale_x, float scale_y);
-  void rotate(float angle);
-  void translate(int x, int y);
-  void untranslate(void);
-  int end_page (void);
-  void end_job(void);
-#ifdef __APPLE__
-  void set_current() { fl_gc = gc; Fl_Paged_Device::set_current(); }
-#endif
-
-  static const char *file_chooser_title;
-};
-
-#endif // Fl_Pdf_H
-
-//
-// End of "$Id: Fl_Pdf.H 7622 2010-05-27 17:50:51Z manolo $"
-//
+  int ydpi() {return 72;};
+};
+
+/**
+ \brief To send graphical output to a PDF file.
+ */
+class Fl_Pdf_File_Device : public Fl_Paged_Device {
+#ifdef __APPLE__
+  CGContextRef gc;
+#endif
+protected:
+  Fl_Pdf_Graphics_Driver *driver();
+public:
+  static const char *class_id;
+  const char *class_name() {return class_id;};
+  Fl_Pdf_File_Device();
+  ~Fl_Pdf_File_Device();
+  void compress(int abool);
+  HPDF_Doc pdf_doc();
+  int start_job(int pagecount, enum Fl_Paged_Device::Page_Format format = Fl_Paged_Device::A4,
+		enum Fl_Paged_Device::Page_Layout layout = Fl_Paged_Device::PORTRAIT);
+  int start_job(const char *pdf_filename, int pagecount,
+        enum Fl_Paged_Device::Page_Format format = Fl_Paged_Device::A4,
+		enum Fl_Paged_Device::Page_Layout layout = Fl_Paged_Device::PORTRAIT);
+  int start_page (void);
+  int printable_rect(int *w, int *h);
+  void margins(int *left, int *top, int *right, int *bottom);
+  void origin(int x, int y);
+  void scale (float scale_x, float scale_y);
+  void rotate(float angle);
+  void translate(int x, int y);
+  void untranslate(void);
+  int end_page (void);
+  void end_job(void);
+#ifdef __APPLE__
+  void set_current() { fl_gc = gc; Fl_Paged_Device::set_current(); }
+#endif
+
+  static const char *file_chooser_title;
+};
+
+#endif // Fl_Pdf_H
+
+//
+// End of "$Id: Fl_Pdf.H 7622 2010-05-27 17:50:51Z manolo $"
+//

+ 88 - 104
fltk/FL/Fl_Pixmap.H

@@ -1,104 +1,88 @@
-//
-// "$Id: Fl_Pixmap.H 9706 2012-11-06 20:46:14Z matt $"
-//
-// Pixmap header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2012 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_Pixmap widget . */
-
-#ifndef Fl_Pixmap_H
-#define Fl_Pixmap_H
-#  include "Fl_Image.H"
-#if defined(WIN32)
-#  include "x.H"
-#endif
-
-class Fl_Widget;
-class Fl_Menu_Item;
-
-// Older C++ compilers don't support the explicit keyword... :(
-#  if defined(__sgi) && !defined(_COMPILER_VERSION)
-#    define explicit
-#  endif // __sgi && !_COMPILER_VERSION
-
-/**
-  The Fl_Pixmap class supports caching and drawing of colormap
-  (pixmap) images, including transparency.
-*/
-class FL_EXPORT Fl_Pixmap : public Fl_Image {
-  friend class Fl_Quartz_Graphics_Driver;
-  friend class Fl_GDI_Graphics_Driver;
-  friend class Fl_GDI_Printer_Graphics_Driver;
-  friend class Fl_Xlib_Graphics_Driver;
-  void copy_data();
-  void delete_data();
-  void set_data(const char * const *p);
-  int prepare(int XP, int YP, int WP, int HP, int &cx, int &cy,
-			 int &X, int &Y, int &W, int &H);
-
-  protected:
-
-  void measure();
-
-  public:
-
-  int alloc_data; // Non-zero if data was allocated
-  
-  private:
-
-#if defined(WIN32)
-#if FLTK_ABI_VERSION < 10301
-  static // a static member is needed for ABI compatibility
-#endif
-  UINT pixmap_bg_color; // RGB color used for pixmap background
-#endif // WIN32
-#if defined(__APPLE__) || defined(WIN32)
-  void *id_; // for internal use
-  void *mask_; // for internal use (mask bitmap)
-#else
-  unsigned id_; // for internal use
-  unsigned mask_; // for internal use (mask bitmap)
-#endif // __APPLE__ || WIN32
-  
-  public:
-
-  /**    The constructors create a new pixmap from the specified XPM data.  */
-  explicit Fl_Pixmap(char * const * D) : Fl_Image(-1,0,1), alloc_data(0), id_(0), mask_(0) {set_data((const char*const*)D); measure();}
-  /**    The constructors create a new pixmap from the specified XPM data.  */
-  explicit Fl_Pixmap(uchar* const * D) : Fl_Image(-1,0,1), alloc_data(0), id_(0), mask_(0) {set_data((const char*const*)D); measure();}
-  /**    The constructors create a new pixmap from the specified XPM data.  */
-  explicit Fl_Pixmap(const char * const * D) : Fl_Image(-1,0,1), alloc_data(0), id_(0), mask_(0) {set_data((const char*const*)D); measure();}
-  /**    The constructors create a new pixmap from the specified XPM data.  */
-  explicit Fl_Pixmap(const uchar* const * D) : Fl_Image(-1,0,1), alloc_data(0), id_(0), mask_(0) {set_data((const char*const*)D); measure();}
-  virtual ~Fl_Pixmap();
-  virtual Fl_Image *copy(int W, int H);
-  Fl_Image *copy() { return copy(w(), h()); }
-  virtual void color_average(Fl_Color c, float i);
-  virtual void desaturate();
-  virtual void draw(int X, int Y, int W, int H, int cx=0, int cy=0);
-  void draw(int X, int Y) {draw(X, Y, w(), h(), 0, 0);}
-  virtual void label(Fl_Widget*w);
-  virtual void label(Fl_Menu_Item*m);
-  virtual void uncache();
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_Pixmap, Fl_Image)
-};
-
-#endif
-
-//
-// End of "$Id: Fl_Pixmap.H 9706 2012-11-06 20:46:14Z matt $".
-//
+//
+// "$Id: Fl_Pixmap.H 12433 2017-09-09 12:35:06Z manolo $"
+//
+// Pixmap header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2017 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_Pixmap widget . */
+
+#ifndef Fl_Pixmap_H
+#define Fl_Pixmap_H
+#  include "Fl_Image.H"
+
+class Fl_Widget;
+struct Fl_Menu_Item;
+
+// Older C++ compilers don't support the explicit keyword... :(
+#  if defined(__sgi) && !defined(_COMPILER_VERSION)
+#    define explicit
+#  endif // __sgi && !_COMPILER_VERSION
+
+/**
+  The Fl_Pixmap class supports caching and drawing of colormap
+  (pixmap) images, including transparency.
+*/
+class FL_EXPORT Fl_Pixmap : public Fl_Image {
+  friend class Fl_Graphics_Driver;
+  void copy_data();
+  void delete_data();
+  void set_data(const char * const *p);
+  int prepare(int XP, int YP, int WP, int HP, int &cx, int &cy,
+			 int &X, int &Y, int &W, int &H);
+
+protected:
+  void measure();
+  virtual int draw_scaled(int X, int Y, int W, int H);
+
+public:
+
+  int alloc_data; // Non-zero if data was allocated
+  
+private:
+  // for internal use
+  fl_uintptr_t id_;
+  fl_uintptr_t mask_;
+  Fl_Color pixmap_bg_color;
+  float cache_scale_; // graphics scaling value when id_ was computed
+
+public:
+
+  /**    The constructors create a new pixmap from the specified XPM data.  */
+  explicit Fl_Pixmap(char * const * D) : Fl_Image(-1,0,1), alloc_data(0), id_(0), mask_(0) {set_data((const char*const*)D); measure();}
+  /**    The constructors create a new pixmap from the specified XPM data.  */
+  explicit Fl_Pixmap(uchar* const * D) : Fl_Image(-1,0,1), alloc_data(0), id_(0), mask_(0) {set_data((const char*const*)D); measure();}
+  /**    The constructors create a new pixmap from the specified XPM data.  */
+  explicit Fl_Pixmap(const char * const * D) : Fl_Image(-1,0,1), alloc_data(0), id_(0), mask_(0) {set_data((const char*const*)D); measure();}
+  /**    The constructors create a new pixmap from the specified XPM data.  */
+  explicit Fl_Pixmap(const uchar* const * D) : Fl_Image(-1,0,1), alloc_data(0), id_(0), mask_(0) {set_data((const char*const*)D); measure();}
+  virtual ~Fl_Pixmap();
+  virtual Fl_Image *copy(int W, int H);
+  Fl_Image *copy() { return copy(w(), h()); }
+  virtual void color_average(Fl_Color c, float i);
+  virtual void desaturate();
+  virtual void draw(int X, int Y, int W, int H, int cx=0, int cy=0);
+  void draw(int X, int Y) {draw(X, Y, w(), h(), 0, 0);}
+  virtual void label(Fl_Widget*w);
+  virtual void label(Fl_Menu_Item*m);
+  virtual void uncache();
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_Pixmap, Fl_Image)
+};
+
+#endif
+
+//
+// End of "$Id: Fl_Pixmap.H 12433 2017-09-09 12:35:06Z manolo $".
+//

+ 2 - 2
fltk/FL/Fl_Plugin.H

@@ -1,5 +1,5 @@
 //
-// "$Id: Fl_Plugin.H 6995 2010-01-12 08:48:55Z matt $"
+// "$Id: Fl_Plugin.H 12196 2017-03-13 23:31:38Z AlbrechtS $"
 //
 // A Plugin system for FLTK, implemented in Fl_Preferences.cxx.
 //
@@ -91,5 +91,5 @@ public:
 #endif // !Fl_Preferences_H
 
 //
-// End of "$Id: Fl_Preferences.H 6995 2010-01-12 08:48:55Z matt $".
+// End of "$Id: Fl_Plugin.H 12196 2017-03-13 23:31:38Z AlbrechtS $".
 //

+ 95 - 96
fltk/FL/Fl_Positioner.H

@@ -1,96 +1,95 @@
-//
-// "$Id: Fl_Positioner.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
-//
-// Positioner header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_Positioner widget . */
-
-#ifndef Fl_Positioner_H
-#define Fl_Positioner_H
-
-#ifndef Fl_Widget_H
-#include "Fl_Widget.H"
-#endif
-
-/**
-  This class is provided for Forms compatibility.  It provides 2D input.
-  It would be useful if this could be put atop another widget so that the
-  crosshairs are on top, but this is not implemented.  The color of the
-  crosshairs is selection_color().
-  <P ALIGN=CENTER>\image html  positioner.png </P> 
-  \image latex  positioner.png " Fl_Positioner" width=4cm
-*/
-class FL_EXPORT Fl_Positioner : public Fl_Widget {
-
-  double xmin, ymin;
-  double xmax, ymax;
-  double xvalue_, yvalue_;
-  double xstep_, ystep_;
-
-protected:
-
-  // these allow subclasses to put the dial in a smaller area:
-  void draw(int, int, int, int);
-  int handle(int, int, int, int, int);
-  void draw();
-
-public:
-
-  int handle(int);
-  /**
-    Creates a new Fl_Positioner widget using the given position,
-    size, and label string. The default boxtype is FL_NO_BOX.
-  */
-  Fl_Positioner(int x,int y,int w,int h, const char *l=0);
-  /** Gets the X axis coordinate.*/
-  double xvalue() const {return xvalue_;}
-  /** Gets the Y axis coordinate.*/
-  double yvalue() const {return yvalue_;}
-  int xvalue(double);
-  int yvalue(double);
-  int value(double,double);
-  void xbounds(double, double);
-  /** Gets the X axis minimum */
-  double xminimum() const {return xmin;}
-  /** Same as xbounds(a, xmaximum()) */
-  void xminimum(double a) {xbounds(a,xmax);}
-  /** Gets the X axis maximum */
-  double xmaximum() const {return xmax;}
-  /** Same as xbounds(xminimum(), a) */
-  void xmaximum(double a) {xbounds(xmin,a);}
-  void ybounds(double, double);
-  /** Gets the Y axis minimum */
-  double yminimum() const {return ymin;}
-  /** Same as ybounds(a, ymaximum()) */
-  void yminimum(double a) {ybounds(a, ymax);}
-  /** Gets the Y axis maximum */
-  double ymaximum() const {return ymax;}
-  /** Same as ybounds(ymininimum(), a) */
-  void ymaximum(double a) {ybounds(ymin, a);}
-  /** Sets the stepping value for the X axis.*/
-  void xstep(double a) {xstep_ = a;}
-  /** Sets the stepping value for the Y axis.*/
-  void ystep(double a) {ystep_ = a;}
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_Positioner, Fl_Widget)
-};
-
-#endif
-
-//
-// End of "$Id: Fl_Positioner.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
-//
+//
+// "$Id: Fl_Positioner.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
+//
+// Positioner header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2010 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_Positioner widget . */
+
+#ifndef Fl_Positioner_H
+#define Fl_Positioner_H
+
+#ifndef Fl_Widget_H
+#include "Fl_Widget.H"
+#endif
+
+/**
+  This class is provided for Forms compatibility.  It provides 2D input.
+  It would be useful if this could be put atop another widget so that the
+  crosshairs are on top, but this is not implemented.  The color of the
+  crosshairs is selection_color().
+  <P ALIGN=CENTER>\image html  positioner.png </P> 
+  \image latex  positioner.png " Fl_Positioner" width=4cm
+*/
+class FL_EXPORT Fl_Positioner : public Fl_Widget {
+
+  double xmin, ymin;
+  double xmax, ymax;
+  double xvalue_, yvalue_;
+  double xstep_, ystep_;
+
+protected:
+
+  // these allow subclasses to put the dial in a smaller area:
+  void draw(int, int, int, int);
+  int handle(int, int, int, int, int);
+  void draw();
+
+public:
+
+  int handle(int);
+  /**
+    Creates a new Fl_Positioner widget using the given position,
+    size, and label string. The default boxtype is FL_NO_BOX.
+  */
+  Fl_Positioner(int x,int y,int w,int h, const char *l=0);
+  /** Gets the X axis coordinate.*/
+  double xvalue() const {return xvalue_;}
+  /** Gets the Y axis coordinate.*/
+  double yvalue() const {return yvalue_;}
+  int xvalue(double);
+  int yvalue(double);
+  int value(double,double);
+  void xbounds(double, double);
+  /** Gets the X axis minimum */
+  double xminimum() const {return xmin;}
+  /** Same as xbounds(a, xmaximum()) */
+  void xminimum(double a) {xbounds(a,xmax);}
+  /** Gets the X axis maximum */
+  double xmaximum() const {return xmax;}
+  /** Same as xbounds(xminimum(), a) */
+  void xmaximum(double a) {xbounds(xmin,a);}
+  void ybounds(double, double);
+  /** Gets the Y axis minimum */
+  double yminimum() const {return ymin;}
+  /** Same as ybounds(a, ymaximum()) */
+  void yminimum(double a) {ybounds(a, ymax);}
+  /** Gets the Y axis maximum */
+  double ymaximum() const {return ymax;}
+  /** Same as ybounds(ymininimum(), a) */
+  void ymaximum(double a) {ybounds(ymin, a);}
+  /** Sets the stepping value for the X axis.*/
+  void xstep(double a) {xstep_ = a;}
+  /** Sets the stepping value for the Y axis.*/
+  void ystep(double a) {ystep_ = a;}
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_Positioner, Fl_Widget)
+};
+
+#endif
+
+//
+// End of "$Id: Fl_Positioner.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
+//

+ 272 - 229
fltk/FL/Fl_PostScript.H

@@ -1,40 +1,46 @@
-//
-// "$Id: Fl_PostScript.H 9993 2013-09-25 08:55:01Z manolo $"
-//
-// Support for graphics output to PostScript file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 2010-2011 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/** \file Fl_PostScript.H 
- \brief declaration of classes Fl_PostScript_Graphics_Driver, Fl_PostScript_File_Device.
- */
-
-#ifndef Fl_PostScript_H
-#define Fl_PostScript_H
-
-#include <FL/Fl_Paged_Device.H>
-#include <FL/fl_draw.H>
-
-/**
- \brief PostScript graphical backend.
- *
+//
+// "$Id: Fl_PostScript.H 11690 2016-04-24 16:22:38Z manolo $"
+//
+// Support for graphics output to PostScript file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 2010-2016 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/** \file Fl_PostScript.H 
+ \brief declaration of classes Fl_PostScript_Graphics_Driver, Fl_PostScript_File_Device.
+ */
+
+#ifndef Fl_PostScript_H
+#define Fl_PostScript_H
+
+#include <FL/Fl_Paged_Device.H>
+#include <FL/fl_draw.H>
+#include <stdarg.h>
+
+/* Signature of Fl_PostScript::close_command() functions passed as parameters. */
+extern "C" {
+  typedef int (Fl_PostScript_Close_Command)(FILE *);
+}
+
+/**
+ \brief PostScript graphical backend.
+ *
  PostScript text uses vectorial fonts when using the FLTK standard fonts  
  and the latin alphabet or a few other characters listed in the following table.
  The latin alphabet means all unicode characters between U+0020 and U+017F, or, in other words, 
  the ASCII, Latin-1 Supplement and Latin Extended-A charts.
- <table>
- <tr> <th>Char</th><th>Codepoint</th><th>Name</th>  <th>Char</th><th>Codepoint</th><th>Name</th> <th>Char</th><th>Codepoint</th><th>Name</th></tr>
+ <table>
+ <tr> <th>Char</th><th>Codepoint</th><th>Name</th>  <th>Char</th><th>Codepoint</th><th>Name</th> <th>Char</th><th>Codepoint</th><th>Name</th></tr>
  <tr><td>ƒ</td><td>U+0192</td><td>florin</td><td>‚</td><td>U+201A</td><td>quotesinglbase</td><td>™</td><td>U+2122</td><td>trademark</td></tr>
  <tr><td>ˆ</td><td>U+02C6</td><td>circumflex</td><td>“</td><td>U+201C</td><td>quotedblleft</td><td>∂</td><td>U+2202</td><td>partialdiff</td></tr>
  <tr><td>ˇ</td><td>U+02C7</td><td>caron</td><td>”</td><td>U+201D</td><td>quotedblright</td><td>Δ</td><td>U+2206</td><td>Delta</td></tr>
@@ -48,204 +54,241 @@
  <tr><td>—</td><td>U+2014</td><td>emdash</td><td>›</td><td>U+203A</td><td>guilsinglright</td><td>fi</td><td>U+FB01</td><td>fi</td></tr>
  <tr><td>‘</td><td>U+2018</td><td>quoteleft</td><td>/</td><td>U+2044</td><td>fraction</td><td>fl</td><td>U+FB02</td><td>fl</td></tr>
  <tr><td>’</td><td>U+2019</td><td>quoteright</td><td>€</td><td>U+20AC</td><td>Euro</td><td></td><td>U+F8FF</td><td>apple (Mac OS only)</td></tr>
- </table>
+ </table>
  <br> All other unicode characters or all other fonts (FL_FREE_FONT and above) are output as a bitmap.
  <br> FLTK standard fonts are output using the corresponding PostScript standard fonts.
- */
-
-/** Signature of Fl_PostScript::close_command() functions passed as parameters. */
-extern "C" {
-  typedef int (Fl_PostScript_Close_Command)(FILE *);
-}
-
-class FL_EXPORT Fl_PostScript_Graphics_Driver : public Fl_Graphics_Driver {
-public: 
-  static const char *class_id;
-  const char *class_name() {return class_id;};
-  Fl_PostScript_Graphics_Driver();
-#ifndef FL_DOXYGEN
-  enum SHAPE{NONE=0, LINE, LOOP, POLYGON, POINTS};
-  
-class Clip {
-  public:
-    int x, y, w, h;
-    Clip *prev;
-  };
-  Clip * clip_;
-  
-  int lang_level_;
-  int gap_;
-  int pages_;
-  
-  double width_;
-  double height_;
-  
-  int shape_;
-  int linewidth_;// need for clipping, lang level 1-2
-  int linestyle_;//
-  int interpolate_; //interpolation of images
-  unsigned char cr_,cg_,cb_;
-  char  linedash_[256];//should be enough
-  void concat();  // transform ror scalable dradings...
-  void reconcat(); //invert
-  void recover(); //recovers the state after grestore (such as line styles...)
-  void reset();
-  
-  uchar * mask;
-  int mx; // width of mask;
-  int my; // mask lines
-  //Fl_Color bg_;
+ */
+class FL_EXPORT Fl_PostScript_Graphics_Driver : public Fl_Graphics_Driver {
+private:
+  void transformed_draw_extra(const char* str, int n, double x, double y, int w, bool rtl);
+  void *prepare_rle85();
+  void write_rle85(uchar b, void *data);
+  void close_rle85(void *data);
+  void *prepare85();
+  void write85(void *data, const uchar *p, int len);
+  void close85(void *data);
+protected:
+  uchar **mask_bitmap() {return &mask;}
+  void mask_bitmap(uchar **value) { }
+public:
+  Fl_PostScript_Graphics_Driver();
+#ifndef FL_DOXYGEN
+  enum SHAPE{NONE=0, LINE, LOOP, POLYGON, POINTS};
+  
+class Clip {
+  public:
+    int x, y, w, h;
+    Clip *prev;
+  };
+  Clip * clip_;
+  
+  int lang_level_;
+  int gap_;
+  int pages_;
+  
+  double width_;
+  double height_;
+  
+  int shape_;
+  int linewidth_;// need for clipping, lang level 1-2
+  int linestyle_;//
+  int interpolate_; //interpolation of images
+  unsigned char cr_,cg_,cb_;
+  char  linedash_[256];//should be enough
+  void concat();  // transform ror scalable dradings...
+  void reconcat(); //invert
+  void recover(); //recovers the state after grestore (such as line styles...)
+  void reset();
+  
+  uchar * mask;
+  int mx; // width of mask;
+  int my; // mask lines
+  //Fl_Color bg_;
   Fl_PostScript_Close_Command* close_cmd_;
-  int page_policy_;
-  int nPages;
-  int orientation_;
-  
-  float scale_x;
-  float scale_y;
-  float angle;
-  int left_margin;
-  int top_margin;
- 
-  FILE *output;
-  double pw_, ph_;
-  
-  uchar bg_r, bg_g, bg_b;
-  int start_postscript (int pagecount, enum Fl_Paged_Device::Page_Format format, enum Fl_Paged_Device::Page_Layout layout);
-  /*  int alpha_mask(const uchar * data, int w, int h, int D, int LD=0);
-   */
-  void transformed_draw(const char* s, int n, double x, double y); //precise text placing
-  void transformed_draw(const char* s, double x, double y);
-  int alpha_mask(const uchar * data, int w, int h, int D, int LD=0);
-  
-  enum Fl_Paged_Device::Page_Format page_format_;
-  char *ps_filename_;
- 
-  void page_policy(int p);
-  int page_policy(){return page_policy_;};
+  int page_policy_;
+  int nPages;
+  int orientation_;
+  
+  float scale_x;
+  float scale_y;
+  float angle;
+  int left_margin;
+  int top_margin;
+ 
+  FILE *output;
+  double pw_, ph_;
+  
+  uchar bg_r, bg_g, bg_b;
+  int start_postscript (int pagecount, enum Fl_Paged_Device::Page_Format format, enum Fl_Paged_Device::Page_Layout layout);
+  /*  int alpha_mask(const uchar * data, int w, int h, int D, int LD=0);
+   */
+  void transformed_draw(const char* s, int n, double x, double y); //precise text placing
+  void transformed_draw(const char* s, double x, double y);
+  int alpha_mask(const uchar * data, int w, int h, int D, int LD=0);
+  
+  enum Fl_Paged_Device::Page_Format page_format_;
+  char *ps_filename_;
+ 
+  void page_policy(int p);
+  int page_policy(){return page_policy_;};
   void close_command(Fl_PostScript_Close_Command* cmd){close_cmd_=cmd;};
-  FILE * file() {return output;};
-  //void orientation (int o);
-  //Fl_PostScript_Graphics_Driver(FILE *o, int lang_level, int pages = 0); // ps (also multi-page) constructor
-  //Fl_PostScript_Graphics_Driver(FILE *o, int lang_level, int x, int y, int w, int h); //eps constructor
-  void interpolate(int i){interpolate_=i;};
-  int interpolate(){return interpolate_;}
-  
-  void page(double pw, double ph, int media = 0);
-  void page(int format);
-#endif // FL_DOXYGEN
-  
-  // implementation of drawing methods
-  void color(Fl_Color c);
-  void color(uchar r, uchar g, uchar b);
-  
-  void push_clip(int x, int y, int w, int h);
-  int clip_box(int x, int y, int w, int h, int &X, int &Y, int &W, int &H);
-  int not_clipped(int x, int y, int w, int h);
-  void push_no_clip();
-  void pop_clip();
-  
-  void line_style(int style, int width=0, char* dashes=0);
-  
-  void rect(int x, int y, int w, int h);
-  void rectf(int x, int y, int w, int h);
-  
-  void xyline(int x, int y, int x1);
-  void xyline(int x, int y, int x1, int y2);
-  void xyline(int x, int y, int x1, int y2, int x3);
-  
-  void yxline(int x, int y, int y1);
-  void yxline(int x, int y, int y1, int x2);
-  void yxline(int x, int y, int y1, int x2, int y3);
-  
-  void line(int x1, int y1, int x2, int y2);
-  void line(int x1, int y1, int x2, int y2, int x3, int y3);  
-  
-  void loop(int x0, int y0, int x1, int y1, int x2, int y2);
-  void loop(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3);
-  void polygon(int x0, int y0, int x1, int y1, int x2, int y2);
-  void polygon(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3);
-  void point(int x, int y);
-  
-  void begin_points();
-  void begin_line();
-  void begin_loop();
-  void begin_polygon();
-  void vertex(double x, double y);
-  void curve(double x, double y, double x1, double y1, double x2, double y2, double x3, double y3);
-  void circle(double x, double y, double r);
-  void arc(double x, double y, double r, double start, double a);
-  void arc(int x, int y, int w, int h, double a1, double a2);
-  void pie(int x, int y, int w, int h, double a1, double a2);
-  void end_points();
-  void end_line();
-  void end_loop();
-  void end_polygon();
-  void begin_complex_polygon(){begin_polygon();};
-  void gap(){gap_=1;};
-  void end_complex_polygon(){end_polygon();};
-  void transformed_vertex(double x, double y);
-    
-  void draw_image(const uchar* d, int x,int y,int w,int h, int delta=3, int ldelta=0);
-  void draw_image_mono(const uchar* d, int x,int y,int w,int h, int delta=1, int ld=0);
-  void draw_image(Fl_Draw_Image_Cb call, void* data, int x,int y, int w, int h, int delta=3);
-  void draw_image_mono(Fl_Draw_Image_Cb call, void* data, int x,int y, int w, int h, int delta=1);
-      
-  void draw(const char* s, int nBytes, int x, int y) {transformed_draw(s,nBytes,x,y); };
-#ifdef __APPLE__
-  void draw(const char* s, int nBytes, float x, float y) {transformed_draw(s,nBytes,x,y); };
-#endif
-  void draw(int angle, const char *str, int n, int x, int y);
-  void rtl_draw(const char* s, int n, int x, int y);
-  void font(int face, int size);
-  double width(const char *, int);
+  FILE * file() {return output;};
+  //void orientation (int o);
+  //Fl_PostScript_Graphics_Driver(FILE *o, int lang_level, int pages = 0); // ps (also multi-page) constructor
+  //Fl_PostScript_Graphics_Driver(FILE *o, int lang_level, int x, int y, int w, int h); //eps constructor
+  void interpolate(int i){interpolate_=i;};
+  int interpolate(){return interpolate_;}
+  
+  void page(double pw, double ph, int media = 0);
+  void page(int format);
+#endif // FL_DOXYGEN
+  
+  // implementation of drawing methods
+  void color(Fl_Color c);
+  void color(uchar r, uchar g, uchar b);
+  
+  void push_clip(int x, int y, int w, int h);
+  int clip_box(int x, int y, int w, int h, int &X, int &Y, int &W, int &H);
+  int not_clipped(int x, int y, int w, int h);
+  void push_no_clip();
+  void pop_clip();
+  
+  void line_style(int style, int width=0, char* dashes=0);
+  
+  void rect(int x, int y, int w, int h);
+  void rectf(int x, int y, int w, int h);
+  
+  void xyline(int x, int y, int x1);
+  void xyline(int x, int y, int x1, int y2);
+  void xyline(int x, int y, int x1, int y2, int x3);
+  
+  void yxline(int x, int y, int y1);
+  void yxline(int x, int y, int y1, int x2);
+  void yxline(int x, int y, int y1, int x2, int y3);
+  
+  void line(int x1, int y1, int x2, int y2);
+  void line(int x1, int y1, int x2, int y2, int x3, int y3);  
+  
+  void loop(int x0, int y0, int x1, int y1, int x2, int y2);
+  void loop(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3);
+  void polygon(int x0, int y0, int x1, int y1, int x2, int y2);
+  void polygon(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3);
+  void point(int x, int y);
+  
+  void begin_points();
+  void begin_line();
+  void begin_loop();
+  void begin_polygon();
+  void vertex(double x, double y);
+  void curve(double x, double y, double x1, double y1, double x2, double y2, double x3, double y3);
+  void circle(double x, double y, double r);
+  void arc(double x, double y, double r, double start, double a);
+  void arc(int x, int y, int w, int h, double a1, double a2);
+  void pie(int x, int y, int w, int h, double a1, double a2);
+  void end_points();
+  void end_line();
+  void end_loop();
+  void end_polygon();
+  void begin_complex_polygon(){begin_polygon();};
+  void gap(){gap_=1;};
+  void end_complex_polygon(){end_polygon();};
+  void transformed_vertex(double x, double y);
+    
+  void draw_image(const uchar* d, int x,int y,int w,int h, int delta=3, int ldelta=0);
+  void draw_image_mono(const uchar* d, int x,int y,int w,int h, int delta=1, int ld=0);
+  void draw_image(Fl_Draw_Image_Cb call, void* data, int x,int y, int w, int h, int delta=3);
+  void draw_image_mono(Fl_Draw_Image_Cb call, void* data, int x,int y, int w, int h, int delta=1);
+      
+  void draw(const char* s, int nBytes, int x, int y) {transformed_draw(s,nBytes,x,y); };
+  void draw(const char* s, int nBytes, float x, float y) {transformed_draw(s,nBytes,x,y); };
+  void draw(int angle, const char *str, int n, int x, int y);
+  void rtl_draw(const char* s, int n, int x, int y);
+  void font(int face, int size);
+  double width(const char *, int);
   double width(unsigned int u);
-  void text_extents(const char *c, int n, int &dx, int &dy, int &w, int &h);
-  int height();
-  int descent();
-  void draw(Fl_Pixmap * pxm,int XP, int YP, int WP, int HP, int cx, int cy);
-  void draw(Fl_Bitmap * bitmap,int XP, int YP, int WP, int HP, int cx, int cy);
-  void draw(Fl_RGB_Image * rgb,int XP, int YP, int WP, int HP, int cx, int cy);
-  ~Fl_PostScript_Graphics_Driver();
-};
-
-/**
- \brief To send graphical output to a PostScript file.
- */
-class FL_EXPORT Fl_PostScript_File_Device : public Fl_Paged_Device {
-#ifdef __APPLE__
-  CGContextRef gc;
-#endif
-protected:
-  Fl_PostScript_Graphics_Driver *driver();
-public:
-  static const char *class_id;
-  const char *class_name() {return class_id;};
-  Fl_PostScript_File_Device();
-  ~Fl_PostScript_File_Device();
-  int start_job(int pagecount, enum Fl_Paged_Device::Page_Format format = Fl_Paged_Device::A4, 
-		enum Fl_Paged_Device::Page_Layout layout = Fl_Paged_Device::PORTRAIT);
-  int start_job(FILE *ps_output, int pagecount, enum Fl_Paged_Device::Page_Format format = Fl_Paged_Device::A4, 
-		enum Fl_Paged_Device::Page_Layout layout = Fl_Paged_Device::PORTRAIT);
-  int start_page (void);
-  int printable_rect(int *w, int *h);
-  void margins(int *left, int *top, int *right, int *bottom);
-  void origin(int *x, int *y);
-  void origin(int x, int y);
-  void scale (float scale_x, float scale_y = 0.);
-  void rotate(float angle);
-  void translate(int x, int y);
-  void untranslate(void);
-  int end_page (void);    
-  void end_job(void);
-#ifdef __APPLE__
-  void set_current() { fl_gc = gc; Fl_Paged_Device::set_current(); }
-#endif
-  
-  static const char *file_chooser_title; 
-};
-
-#endif // Fl_PostScript_H
-
-//
-// End of "$Id: Fl_PostScript.H 9993 2013-09-25 08:55:01Z manolo $"
-//
+  void text_extents(const char *c, int n, int &dx, int &dy, int &w, int &h);
+  int height();
+  int descent();
+  void draw(Fl_Pixmap * pxm,int XP, int YP, int WP, int HP, int cx, int cy);
+  void draw(Fl_Bitmap * bitmap,int XP, int YP, int WP, int HP, int cx, int cy);
+  void draw(Fl_RGB_Image * rgb,int XP, int YP, int WP, int HP, int cx, int cy);
+  int draw_scaled(Fl_Image *img, int XP, int YP, int WP, int HP);
+  /** Shields output PostScript data from modifications of the current locale.
+   It typically avoids PostScript errors caused if the current locale uses comma instead of dot
+   as "decimal point".
+   \param format  directives controlling output PostScript data
+   \return value returned by vfprintf() call
+   */
+  int clocale_printf(const char *format, ...);
+  ~Fl_PostScript_Graphics_Driver();
+  // ---
+  Fl_Bitmask create_bitmask(int w, int h, const uchar *array) { return 0L; }
+  void delete_bitmask(Fl_Bitmask bm) { };
+  virtual int has_feature(driver_feature mask) { return mask & PRINTER; }
+};
+
+/**
+ To send graphical output to a PostScript file.
+ This class is used exactly as the Fl_Printer class except for the start_job() call,
+ two variants of which are usable and allow to specify what page format and layout are desired.
+ */
+class FL_EXPORT Fl_PostScript_File_Device : public Fl_Paged_Device {
+protected:
+  /**
+   \brief Returns the PostScript driver of this drawing surface.
+   */
+  Fl_PostScript_Graphics_Driver *driver();
+public:
+  /**
+   @brief The constructor.
+   */
+  Fl_PostScript_File_Device();
+  /**
+   @brief The destructor.
+   */
+  ~Fl_PostScript_File_Device();
+  /** Don't use with this class. */
+  int start_job(int pagecount, int* from, int* to);
+  /**
+   @brief Begins the session where all graphics requests will go to a local PostScript file.
+   *
+   Opens a file dialog entitled with Fl_PostScript_File_Device::file_chooser_title to select an output PostScript file.
+   @param pagecount The total number of pages to be created. Use 0 if this number is unknown when this function is called.
+   @param format Desired page format.
+   @param layout Desired page layout.
+   @return 0 if OK, 1 if user cancelled the file dialog, 2 if fopen failed on user-selected output file.
+   */
+  int start_job(int pagecount, enum Fl_Paged_Device::Page_Format format = Fl_Paged_Device::A4,
+		enum Fl_Paged_Device::Page_Layout layout = Fl_Paged_Device::PORTRAIT);
+  /**
+   @brief Begins the session where all graphics requests will go to FILE pointer.
+   *
+   @param ps_output A writable FILE pointer that will receive PostScript output and that should not be closed
+   until after end_job() has been called.
+   @param pagecount The total number of pages to be created. Use 0 if this number is unknown when this function is called.
+   @param format Desired page format.
+   @param layout Desired page layout.
+   @return always 0.
+   */
+  int start_job(FILE *ps_output, int pagecount, enum Fl_Paged_Device::Page_Format format = Fl_Paged_Device::A4,
+		enum Fl_Paged_Device::Page_Layout layout = Fl_Paged_Device::PORTRAIT);
+  int start_page (void);
+  int printable_rect(int *w, int *h);
+  void margins(int *left, int *top, int *right, int *bottom);
+  void origin(int *x, int *y);
+  void origin(int x, int y);
+  void scale (float scale_x, float scale_y = 0.);
+  void rotate(float angle);
+  void translate(int x, int y);
+  void untranslate(void);
+  int end_page (void);    
+  void end_job(void);  
+  /** \brief Label of the PostScript file chooser window */
+  static const char *file_chooser_title;
+};
+
+#endif // Fl_PostScript_H
+
+//
+// End of "$Id: Fl_PostScript.H 11690 2016-04-24 16:22:38Z manolo $"
+//

+ 262 - 261
fltk/FL/Fl_Preferences.H

@@ -1,269 +1,270 @@
-//
-// "$Id: Fl_Preferences.H 9978 2013-09-16 20:25:14Z greg.ercolano $"
-//
-// Preferences .
-//
-// Copyright 2002-2010 by Matthias Melcher.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_Preferences class . */
-
-#ifndef Fl_Preferences_H
-#  define Fl_Preferences_H
-
-#  include <stdio.h>
-#  include "Fl_Export.H" 
-
-/**
-   \brief Fl_Preferences provides methods to store user
-   settings between application starts. 
-
-   It is similar to the
-   Registry on WIN32 and Preferences on MacOS, and provides a
-   simple configuration mechanism for UNIX.
+//
+// "$Id: Fl_Preferences.H 12305 2017-07-07 21:00:17Z matt $"
+//
+// Preferences .
+//
+// Copyright 2002-2010 by Matthias Melcher.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
 
-   Fl_Preferences uses a hierarchy to store data. It
-   bundles similar data into groups and manages entries into those
-   groups as name/value pairs.
+/* \file
+   Fl_Preferences class . */
 
-   Preferences are stored in text files that can be edited
-   manually. The file format is easy to read and relatively
-   forgiving. Preferences files are the same on all platforms. User
-   comments in preference files are preserved. Filenames are unique
-   for each application by using a vendor/application naming
-   scheme. The user must provide default values for all entries to
-   ensure proper operation should preferences be corrupted or not
-   yet exist.
+#ifndef Fl_Preferences_H
+#  define Fl_Preferences_H
 
-   Entries can be of any length. However, the size of each
-   preferences file should be kept small for performance
-   reasons. One application can have multiple preferences files.
-   Extensive binary data however should be stored in separate
-   files: see getUserdataPath().
+#  include <stdio.h>
+#  include "Fl_Export.H" 
+
+/**
+   \brief Fl_Preferences provides methods to store user
+   settings between application starts.
+
+   It is similar to the
+   Registry on WIN32 and Preferences on MacOS, and provides a
+   simple configuration mechanism for UNIX.
+
+   Fl_Preferences uses a hierarchy to store data. It
+   bundles similar data into groups and manages entries into those
+   groups as name/value pairs.
+
+   Preferences are stored in text files that can be edited
+   manually. The file format is easy to read and relatively
+   forgiving. Preferences files are the same on all platforms. User
+   comments in preference files are preserved. Filenames are unique
+   for each application by using a vendor/application naming
+   scheme. The user must provide default values for all entries to
+   ensure proper operation should preferences be corrupted or not
+   yet exist.
+
+   Entries can be of any length. However, the size of each
+   preferences file should be kept small for performance
+   reasons. One application can have multiple preferences files.
+   Extensive binary data however should be stored in separate
+   files: see getUserdataPath().
 
    \note Starting with FLTK 1.3, preference databases are expected to
-   be in UTF-8 encoding. Previous databases were stored in the
-   current character set or code page which renders them incompatible
-   for text entries using international characters.
- */
-class FL_EXPORT Fl_Preferences {
-
-public: 
-  /**
-     Define the scope of the preferences.
-   */
-  enum Root { 
-    SYSTEM=0,   ///< Preferences are used system-wide
-    USER        ///< Preferences apply only to the current user
-  };
-  
-  /**
-   Every Fl_Preferences-Group has a uniqe ID.
-   
-   ID's can be retrieved from an Fl_Preferences-Group and can then be used
-   to create more Fl_Preference references to the same data set, as long as the 
-   database remains open.
-   */
-  typedef void *ID;
-  
-  static const char *newUUID();
-
-  Fl_Preferences( Root root, const char *vendor, const char *application );
-  Fl_Preferences( const char *path, const char *vendor, const char *application );
-  Fl_Preferences( Fl_Preferences &parent, const char *group );
-  Fl_Preferences( Fl_Preferences *parent, const char *group );
-  Fl_Preferences( Fl_Preferences &parent, int groupIndex );
-  Fl_Preferences( Fl_Preferences *parent, int groupIndex );
-  Fl_Preferences(const Fl_Preferences&);
-  Fl_Preferences( ID id );
-  virtual ~Fl_Preferences();
-  
-  /** Return an ID that can later be reused to open more references to this dataset.
-   */
-  ID id() { return (ID)node; }
-  
-  /** Remove the group with this ID from a database.
-   */
-  static char remove(ID id_) { return ((Node*)id_)->remove(); }
-
-  /** Return the name of this entry.
-   */
-  const char *name() { return node->name(); }
-  
-  /** Return the full path to this entry.
-   */
-  const char *path() { return node->path(); }
-  
-  int groups();
-  const char *group( int num_group );
-  char groupExists( const char *key );
-  char deleteGroup( const char *group );
-  char deleteAllGroups();
-
-  int entries();
-  const char *entry( int index );
-  char entryExists( const char *key );
-  char deleteEntry( const char *entry );
-  char deleteAllEntries();
-  
-  char clear();
-
-  char set( const char *entry, int value );
-  char set( const char *entry, float value );
-  char set( const char *entry, float value, int precision );
-  char set( const char *entry, double value );
-  char set( const char *entry, double value, int precision );
-  char set( const char *entry, const char *value );
-  char set( const char *entry, const void *value, int size ); 
-  
-  char get( const char *entry, int &value, int defaultValue );
-  char get( const char *entry, float &value,  float defaultValue );
-  char get( const char *entry, double &value, double defaultValue );
-  char get( const char *entry, char *&value,  const char *defaultValue );
-  char get( const char *entry, char *value,   const char *defaultValue, int maxSize );
-  char get( const char *entry, void *&value,  const void *defaultValue, int defaultSize );
-  char get( const char *entry, void *value,   const void *defaultValue, int defaultSize, int maxSize );
-
-  int size( const char *entry );
-
-  char getUserdataPath( char *path, int pathlen );
-
-  void flush();
-
-  // char export( const char *filename, Type fileFormat );
-  // char import( const char *filename );
-  
-  /**
+   be in UTF-8 encoding. Previous databases were stored in the
+   current character set or code page which renders them incompatible
+   for text entries using international characters.
+ */
+class FL_EXPORT Fl_Preferences {
+
+public: 
+  /**
+     Define the scope of the preferences.
+   */
+  enum Root { 
+    SYSTEM=0,   ///< Preferences are used system-wide
+    USER        ///< Preferences apply only to the current user
+  };
+  
+  /**
+   Every Fl_Preferences-Group has a uniqe ID.
+   
+   ID's can be retrieved from an Fl_Preferences-Group and can then be used
+   to create more Fl_Preference references to the same data set, as long as the 
+   database remains open.
+   */
+  typedef void *ID;
+  
+  static const char *newUUID();
+
+  Fl_Preferences( Root root, const char *vendor, const char *application );
+  Fl_Preferences( const char *path, const char *vendor, const char *application );
+  Fl_Preferences( Fl_Preferences &parent, const char *group );
+  Fl_Preferences( Fl_Preferences *parent, const char *group );
+  Fl_Preferences( Fl_Preferences &parent, int groupIndex );
+  Fl_Preferences( Fl_Preferences *parent, int groupIndex );
+  Fl_Preferences(const Fl_Preferences&);
+  Fl_Preferences( ID id );
+  virtual ~Fl_Preferences();
+  
+  /** Return an ID that can later be reused to open more references to this dataset.
+   */
+  ID id() { return (ID)node; }
+  
+  /** Remove the group with this ID from a database.
+   */
+  static char remove(ID id_) { return ((Node*)id_)->remove(); }
+
+  /** Return the name of this entry.
+   */
+  const char *name() { return node->name(); }
+  
+  /** Return the full path to this entry.
+   */
+  const char *path() { return node->path(); }
+  
+  int groups();
+  const char *group( int num_group );
+  char groupExists( const char *key );
+  char deleteGroup( const char *group );
+  char deleteAllGroups();
+
+  int entries();
+  const char *entry( int index );
+  char entryExists( const char *key );
+  char deleteEntry( const char *entry );
+  char deleteAllEntries();
+  
+  char clear();
+
+  char set( const char *entry, int value );
+  char set( const char *entry, float value );
+  char set( const char *entry, float value, int precision );
+  char set( const char *entry, double value );
+  char set( const char *entry, double value, int precision );
+  char set( const char *entry, const char *value );
+  char set( const char *entry, const void *value, int size ); 
+  
+  char get( const char *entry, int &value, int defaultValue );
+  char get( const char *entry, float &value,  float defaultValue );
+  char get( const char *entry, double &value, double defaultValue );
+  char get( const char *entry, char *&value,  const char *defaultValue );
+  char get( const char *entry, char *value,   const char *defaultValue, int maxSize );
+  char get( const char *entry, void *&value,  const void *defaultValue, int defaultSize );
+  char get( const char *entry, void *value,   const void *defaultValue, int defaultSize, int maxSize );
+
+  int size( const char *entry );
+
+  char getUserdataPath( char *path, int pathlen );
+
+  void flush();
+
+  // char export( const char *filename, Type fileFormat );
+  // char import( const char *filename );
+  
+  /**
      'Name' provides a simple method to create numerical or more complex
-     procedural names for entries and groups on the fly.
-     
+     procedural names for entries and groups on the fly.
+     
      Example: prefs.set(Fl_Preferences::Name("File%d",i),file[i]);.
-    
-     See test/preferences.cxx as a sample for writing arrays into preferences.
-
-     'Name' is actually implemented as a class inside Fl_Preferences. It casts
-     into const char* and gets automatically destroyed after the enclosing call
-     ends.
-   */
-  class FL_EXPORT Name {
-
-    char *data_;
-
-  public: 
-    Name( unsigned int n );
-    Name( const char *format, ... );
-
-    /**
-       Return the Name as a "C" string.
-       \internal
-     */
-    operator const char *() { return data_; }
-    ~Name();
-  };
-
-  /** \internal An entry associates a preference name to its corresponding value */
-  struct Entry {
-    char *name, *value;
-  };
-
-private: 
-  Fl_Preferences() : node(0), rootNode(0) { }
-  Fl_Preferences &operator=(const Fl_Preferences&);
-
-  static char nameBuffer[128];
-  static char uuidBuffer[40];
-  static Fl_Preferences *runtimePrefs;
-
+    
+     See test/preferences.cxx as a sample for writing arrays into preferences.
+
+     'Name' is actually implemented as a class inside Fl_Preferences. It casts
+     into const char* and gets automatically destroyed after the enclosing call
+     ends.
+   */
+  class FL_EXPORT Name {
+
+    char *data_;
+
+  public: 
+    Name( unsigned int n );
+    Name( const char *format, ... );
+
+    /**
+       Return the Name as a "C" string.
+       \internal
+     */
+    operator const char *() { return data_; }
+    ~Name();
+  };
+
+  /** \internal An entry associates a preference name to its corresponding value */
+  struct Entry {
+    char *name, *value;
+  };
+
+private: 
+  Fl_Preferences() : node(0), rootNode(0) { }
+  Fl_Preferences &operator=(const Fl_Preferences&);
+
+  static char nameBuffer[128];
+  static char uuidBuffer[40];
+  static Fl_Preferences *runtimePrefs;
+
 public:  // older Sun compilers need this (public definition of the following classes)
-  class RootNode;
-  
-  class FL_EXPORT Node {	// a node contains a list to all its entries 
-            			// and all means to manage the tree structure
-    Node *child_, *next_;
-    union { 			// these two are mutually exclusive
-      Node *parent_;   		// top_ bit clear
-      RootNode *root_; 		// top_ bit set
-    };
-    char *path_;
-    Entry *entry_;
-    int nEntry_, NEntry_;
-    unsigned char dirty_:1;
-    unsigned char top_:1;
-    unsigned char indexed_:1;
-    // indexing routines
-    Node **index_;
-    int nIndex_, NIndex_;
-    void createIndex();
-    void updateIndex();
-    void deleteIndex();
-  public:
-    static int lastEntrySet;
-  public:
-    Node( const char *path );
-    ~Node();
-    // node methods
-    int write( FILE *f );
-    const char *name();
-    const char *path() { return path_; }
-    Node *find( const char *path );
-    Node *search( const char *path, int offset=0 );
-    Node *childNode( int ix );
-    Node *addChild( const char *path );
-    void setParent( Node *parent );
-    Node *parent() { return top_?0L:parent_; }
-    void setRoot(RootNode *r) { root_ = r; top_ = 1; }
-    RootNode *findRoot();
-    char remove();
-    char dirty();
-    void deleteAllChildren();
-    // entry methods
-    int nChildren();
-    const char *child( int ix );
-    void set( const char *name, const char *value );
-    void set( const char *line );
-    void add( const char *line );
-    const char *get( const char *name );
-    int getEntry( const char *name );
-    char deleteEntry( const char *name );
-    void deleteAllEntries();
-    int nEntry() { return nEntry_; }
-    Entry &entry(int i) { return entry_[i]; }
-  };
-  friend class Node;
-
-  class FL_EXPORT RootNode {		// the root node manages file paths and basic reading and writing
-    Fl_Preferences *prefs_;
-    char *filename_;
-    char *vendor_, *application_;
-  public:
-    RootNode( Fl_Preferences *, Root root, const char *vendor, const char *application );
-    RootNode( Fl_Preferences *, const char *path, const char *vendor, const char *application );
-    RootNode( Fl_Preferences * );
-    ~RootNode();
-    int read();
-    int write();
-    char getPath( char *path, int pathlen );
-  };
-  friend class RootNode;
-
-protected:
-  Node *node;
-  RootNode *rootNode;
-};
-
-#endif // !Fl_Preferences_H
-
-//
-// End of "$Id: Fl_Preferences.H 9978 2013-09-16 20:25:14Z greg.ercolano $".
-//
+  class RootNode;
+  
+  class FL_EXPORT Node {	// a node contains a list to all its entries 
+            			// and all means to manage the tree structure
+    Node *child_, *next_;
+    union { 			// these two are mutually exclusive
+      Node *parent_;   		// top_ bit clear
+      RootNode *root_; 		// top_ bit set
+    };
+    char *path_;
+    Entry *entry_;
+    int nEntry_, NEntry_;
+    unsigned char dirty_:1;
+    unsigned char top_:1;
+    unsigned char indexed_:1;
+    // indexing routines
+    Node **index_;
+    int nIndex_, NIndex_;
+    void createIndex();
+    void updateIndex();
+    void deleteIndex();
+  public:
+    static int lastEntrySet;
+  public:
+    Node( const char *path );
+    ~Node();
+    // node methods
+    int write( FILE *f );
+    const char *name();
+    const char *path() { return path_; }
+    Node *find( const char *path );
+    Node *search( const char *path, int offset=0 );
+    Node *childNode( int ix );
+    Node *addChild( const char *path );
+    void setParent( Node *parent );
+    Node *parent() { return top_?0L:parent_; }
+    void setRoot(RootNode *r) { root_ = r; top_ = 1; }
+    RootNode *findRoot();
+    char remove();
+    char dirty();
+    void clearDirtyFlags();
+    void deleteAllChildren();
+    // entry methods
+    int nChildren();
+    const char *child( int ix );
+    void set( const char *name, const char *value );
+    void set( const char *line );
+    void add( const char *line );
+    const char *get( const char *name );
+    int getEntry( const char *name );
+    char deleteEntry( const char *name );
+    void deleteAllEntries();
+    int nEntry() { return nEntry_; }
+    Entry &entry(int i) { return entry_[i]; }
+  };
+  friend class Node;
+
+  class FL_EXPORT RootNode {		// the root node manages file paths and basic reading and writing
+    Fl_Preferences *prefs_;
+    char *filename_;
+    char *vendor_, *application_;
+  public:
+    RootNode( Fl_Preferences *, Root root, const char *vendor, const char *application );
+    RootNode( Fl_Preferences *, const char *path, const char *vendor, const char *application );
+    RootNode( Fl_Preferences * );
+    ~RootNode();
+    int read();
+    int write();
+    char getPath( char *path, int pathlen );
+  };
+  friend class RootNode;
+
+protected:
+  Node *node;
+  RootNode *rootNode;
+};
+
+#endif // !Fl_Preferences_H
+
+//
+// End of "$Id: Fl_Preferences.H 12305 2017-07-07 21:00:17Z matt $".
+//

+ 139 - 211
fltk/FL/Fl_Printer.H

@@ -1,213 +1,141 @@
-//
-// "$Id: Fl_Printer.H 9035 2011-09-14 15:17:32Z manolo $"
-//
-// Printing support for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 2010-2011 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/** \file Fl_Printer.H
- \brief declaration of classes Fl_Printer, Fl_System_Printer and Fl_PostScript_Printer.
- */
-
-#ifndef Fl_Printer_H
-#define Fl_Printer_H
-
-#include <FL/x.H>
-#include <FL/Fl_Paged_Device.H>
-#include <FL/fl_draw.H>
-#include <FL/Fl_Pixmap.H>
-#include <FL/Fl_RGB_Image.H>
-#include <FL/Fl_Bitmap.H>
-#include <stdio.h>
-#if !(defined(__APPLE__) || defined(WIN32))
-#include <FL/Fl_PostScript.H>
-#elif defined(WIN32)
-#include <commdlg.h>
-#endif
-
-#if defined(__APPLE__) || defined(WIN32) || defined(FL_DOXYGEN)
-/**
- Print support under MSWindows and Mac OS.
-
- Class Fl_System_Printer is implemented only on the MSWindows and Mac OS platforms.
- It has no public constructor.
- Use Fl_Printer instead that is cross-platform and has the same API.
- */
-class Fl_System_Printer : public Fl_Paged_Device {
-  friend class Fl_Printer;
-private:
-  /** \brief the printer's graphics context, if there's one, NULL otherwise */
-  void *gc;
-#ifdef __APPLE__
-  float scale_x;
-  float scale_y;
-  float angle; // rotation angle in radians
-  PMPrintSession  printSession;
-  PMPageFormat    pageFormat;
-  PMPrintSettings printSettings;
-#elif defined(WIN32)
-  int   abortPrint;
-  PRINTDLG      pd;
-  HDC           hPr;
-  int           prerr;
-  int left_margin;
-  int top_margin;
-  void absolute_printable_rect(int *x, int *y, int *w, int *h);
-#endif
-protected:
-  /** \brief The constructor */
-  Fl_System_Printer(void);
-public:
-  void set_current();
-  static const char *class_id;
-  const char *class_name() {return class_id;};
-  int start_job(int pagecount, int *frompage = NULL, int *topage = NULL);
-  int start_page (void);
-  int printable_rect(int *w, int *h);
-  void margins(int *left, int *top, int *right, int *bottom);
-  void origin(int *x, int *y);
-  void origin(int x, int y);
-  void scale (float scale_x, float scale_y = 0.);
-  void rotate(float angle);
-  void translate(int x, int y);
-  void untranslate(void);
-  int end_page (void);
-  void end_job (void);
-  /** \brief The destructor */
-  ~Fl_System_Printer(void);
-  int xdpi();
-  int ydpi();
-}; // class Fl_System_Printer
-
-#endif
-
-#if !(defined(__APPLE__) || defined(WIN32) )
-/**
- Print support under Unix/Linux.
-
- Class Fl_PostScript_Printer is implemented only on the Unix/Linux platform.
- It has no public constructor.
- Use Fl_Printer instead that is cross-platform and has the same API.
- */
-class Fl_PostScript_Printer : public Fl_PostScript_File_Device {
-  friend class Fl_Printer;
-protected:
-  /** The constructor */
-  Fl_PostScript_Printer(void) {};
-public:
-  static const char *class_id;
-  const char *class_name() {return class_id;};
-  int start_job(int pages, int *firstpage = NULL, int *lastpage = NULL);
+//
+// "$Id: Fl_Printer.H 11364 2016-03-18 18:20:11Z manolo $"
+//
+// Printing support for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 2010-2016 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
 
-  int xdpi() {return 72;};
-  int ydpi() {return 72;};
-};
-
-#endif
-
-/**
- * \brief OS-independent print support.
- *
- Fl_Printer allows to use all FLTK drawing, color, text, and clip functions, and to have them operate
- on printed page(s). There are two main, non exclusive, ways to use it.
- <ul><li>Print any widget (standard, custom, Fl_Window, Fl_Gl_Window) as it appears
- on screen, with optional translation, scaling and rotation. This is done by calling print_widget(),
- print_window() or print_window_part().
- <li>Use a series of FLTK graphics commands (e.g., font, text, lines, colors, clip, image) to
- compose a page appropriately shaped for printing.
- </ul>
- In both cases, begin by start_job(), start_page(), printable_rect() and origin() calls
- and finish by end_page() and end_job() calls.
- <p><b>Platform specifics</b>
- <ul>
- <li>Unix/Linux platforms:
- Class Fl_RGB_Image prints but loses its transparency if it has one.
- See class Fl_PostScript_Graphics_Driver for a description of how UTF-8 strings appear in print.
- Use the static public attributes of this class to set the print dialog to other languages
- than English. For example, the "Printer:" dialog item Fl_Printer::dialog_printer can be set to French with:
- \code
- Fl_Printer::dialog_printer = "Imprimante:";
- \endcode
- before creation of the Fl_Printer object.
- Use Fl_PostScript_File_Device::file_chooser_title to customize the title of the file chooser dialog that opens
- when using the "Print To File" option of the print dialog.
- <li>MSWindows platform: Transparent Fl_RGB_Image 's don't print with exact transparency on most printers.
- Fl_RGB_Image 's don't rotate() well.
- A workaround is to use the print_window_part() call.
- <li>Mac OS X platform: all graphics requests print as on display.
- </ul>
- */
-class FL_EXPORT Fl_Printer : public Fl_Paged_Device {
-public:
-  static const char *class_id;
-  const char *class_name() {return class_id;};
-  /** \brief The constructor */
-  Fl_Printer(void);
-  int start_job(int pagecount, int *frompage = NULL, int *topage = NULL);
-  int start_page(void);
-  int printable_rect(int *w, int *h);
-  void margins(int *left, int *top, int *right, int *bottom);
-  void origin(int *x, int *y);
-  void origin(int x, int y);
-  void scale(float scale_x, float scale_y = 0.);
-  void rotate(float angle);
-  void translate(int x, int y);
-  void untranslate(void);
-  int end_page (void);
-  void end_job (void);
-  void print_widget(Fl_Widget* widget, int delta_x=0, int delta_y=0);
-  void print_window_part(Fl_Window *win, int x, int y, int w, int h, int delta_x=0, int delta_y=0);
-  void set_current(void);
-  Fl_Graphics_Driver* driver(void);
-  /** \brief The destructor */
+/** \file Fl_Printer.H 
+ \brief declaration of class Fl_Printer.
+ */
+
+#ifndef Fl_Printer_H
+#define Fl_Printer_H
+
+#include <FL/Fl_Paged_Device.H>
+
+/**
+ * \brief OS-independent print support.
+ *
+ Fl_Printer allows to use all drawing, color, text, image, and clip FLTK functions, and to have them operate
+ on printed page(s). There are two main, non exclusive, ways to use it.
+ <ul><li>Print any widget (standard, custom, Fl_Window, Fl_Gl_Window) as it appears 
+ on screen, with optional translation, scaling and rotation. This is done by calling print_widget(), 
+ print_window() or print_window_part().
+ <li>Use a series of FLTK graphics commands (e.g., font, text, lines, colors, clip, image) to
+ compose a page appropriately shaped for printing. 
+ </ul>
+ In both cases, begin by start_job(), start_page(), printable_rect() and origin() calls
+ and finish by end_page() and end_job() calls.
+ <p>Example of use: print a widget centered in a page
+ \code
+ #include <FL/Fl_Printer.H>
+ #include <FL/fl_draw.H>
+ int width, height;
+ Fl_Widget *widget = ...  // a widget we want printed
+ Fl_Printer *printer = new Fl_Printer();
+ if (printer->start_job(1) == 0) {
+  printer->start_page();
+  printer->printable_rect(&width, &height);
+  fl_color(FL_BLACK);
+  fl_line_style(FL_SOLID, 2);
+  fl_rect(0, 0, width, height);
+  fl_font(FL_COURIER, 12);
+  time_t now; time(&now); fl_draw(ctime(&now), 0, fl_height());
+  printer->origin(width/2, height/2);
+  printer->print_widget(widget, -widget->w()/2, -widget->h()/2);
+  printer->end_page();
+  printer->end_job();
+ }
+ delete printer;
+ \endcode
+ <b>Platform specifics</b>
+ <ul>
+ <li>Unix/Linux platforms:
+ Unless it has been previously changed, the default paper size is A4.
+ To change that, press the "Properties" button of the "Print" dialog window
+ opened by an Fl_Printer::start_job() call. This opens a "Printer Properties" window where it's
+ possible to select the adequate paper size. Finally press the "Save" button therein to assign
+ the chosen paper size to the chosen printer for this and all further print operations.
+ <br>Class Fl_RGB_Image prints but loses its transparency if it has one.
+ See class Fl_PostScript_Graphics_Driver for a description of how UTF-8 strings appear in print.
+ Use the static public attributes of this class to set the print dialog to other languages 
+ than English. For example, the "Printer:" dialog item Fl_Printer::dialog_printer can be set to French with:
+ \code
+ Fl_Printer::dialog_printer = "Imprimante:";
+ \endcode
+ before creation of the Fl_Printer object.
+ Use Fl_PostScript_File_Device::file_chooser_title to customize the title of the file chooser dialog that opens
+ when using the "Print To File" option of the print dialog. 
+ <li>MSWindows platform: Transparent Fl_RGB_Image 's don't print with exact transparency on most printers
+ (a workaround is to use print_window_part() ).
+ Fl_RGB_Image 's don't rotate() well.
+ <li>Mac OS X platform: all graphics requests print as on display and accept rotation and scaling.
+ </ul>
+ */
+class FL_EXPORT Fl_Printer : public Fl_Paged_Device {
+private:
+  Fl_Paged_Device *printer;
+public:
+  /** The constructor */
+  Fl_Printer(void);
+  int start_job(int pagecount, int *frompage = NULL, int *topage = NULL);
+  int start_page(void);
+  int printable_rect(int *w, int *h);
+  void margins(int *left, int *top, int *right, int *bottom);
+  void origin(int *x, int *y);
+  void origin(int x, int y);
+  void scale(float scale_x, float scale_y = 0.);
+  void rotate(float angle);
+  void translate(int x, int y);
+  void untranslate(void);
+  int end_page (void);
+  void end_job (void);
+  void print_widget(Fl_Widget* widget, int delta_x=0, int delta_y=0);
+  void print_window_part(Fl_Window *win, int x, int y, int w, int h, int delta_x=0, int delta_y=0);
+  void draw_decorated_window(Fl_Window *win, int x_offset, int y_offset);
+  void set_current(void);
+ 
+  /** \name These attributes are useful for the Linux/Unix platform only.
+   \{
+   */  
+  static const char *dialog_title; 
+  static const char *dialog_printer; 
+  static const char *dialog_range; 
+  static const char *dialog_copies; 
+  static const char *dialog_all; 
+  static const char *dialog_pages;
+  static const char *dialog_from;
+  static const char *dialog_to;
+  static const char *dialog_properties;
+  static const char *dialog_copyNo;
+  static const char *dialog_print_button;
+  static const char *dialog_cancel_button;
+  static const char *dialog_print_to_file;
+  static const char *property_title;
+  static const char *property_pagesize;
+  static const char *property_mode;
+  static const char *property_use;
+  static const char *property_save;
+  static const char *property_cancel;
+  /** \} */ 
+  /** The destructor */
   ~Fl_Printer(void);
-  int xdpi();
-  int ydpi();
-
-  /** \name These attributes are effective under the Xlib platform only.
-   \{
-   */
-  static const char *dialog_title;
-  static const char *dialog_printer;
-  static const char *dialog_range;
-  static const char *dialog_copies;
-  static const char *dialog_all;
-  static const char *dialog_pages;
-  static const char *dialog_from;
-  static const char *dialog_to;
-  static const char *dialog_properties;
-  static const char *dialog_copyNo;
-  static const char *dialog_print_button;
-  static const char *dialog_cancel_button;
-  static const char *dialog_print_to_file;
-  static const char *property_title;
-  static const char *property_pagesize;
-  static const char *property_mode;
-  static const char *property_use;
-  static const char *property_save;
-  static const char *property_cancel;
-  /** \} */
-private:
-#if defined(WIN32) || defined(__APPLE__)
-  Fl_System_Printer *printer;
-#else
-  Fl_PostScript_Printer *printer;
-#endif
-};
-
-#endif // Fl_Printer_H
-
-//
-// End of "$Id: Fl_Printer.H 9035 2011-09-14 15:17:32Z manolo $"
-//
+};
+
+#endif // Fl_Printer_H
+
+//
+// End of "$Id: Fl_Printer.H 11364 2016-03-18 18:20:11Z manolo $"
+//

+ 73 - 74
fltk/FL/Fl_Progress.H

@@ -1,74 +1,73 @@
-//
-// "$Id: Fl_Progress.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
-//
-// Progress bar widget definitions.
-//
-// Copyright 2000-2010 by Michael Sweet.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_Progress widget . */
-
-#ifndef _Fl_Progress_H_
-#  define _Fl_Progress_H_
-
-//
-// Include necessary headers.
-//
-
-#include "Fl_Widget.H"
-
-
-//
-// Progress class...
-//
-/**
-    Displays a progress bar for the user.
-*/
-class FL_EXPORT Fl_Progress : public Fl_Widget {
-  
-  float	value_,
-	minimum_,
-	maximum_;
-
-  protected:
-
-  virtual void draw();
-
-  public:
-
-  Fl_Progress(int x, int y, int w, int h, const char *l = 0);
-
-  /** Sets the maximum value in the progress widget.  */
-  void	maximum(float v) { maximum_ = v; redraw(); }
-  /** Gets the maximum value in the progress widget.  */
-  float	maximum() const { return (maximum_); }
-
-  /** Sets the minimum value in the progress widget.  */
-  void	minimum(float v) { minimum_ = v; redraw(); }
-  /** Gets the minimum value in the progress widget.  */
-  float	minimum() const { return (minimum_); }
-
-  /** Sets the current value in the progress widget.  */
-  void	value(float v) { value_ = v; redraw(); }
-  /** Gets the current value in the progress widget.  */
-  float	value() const { return (value_); }
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_Progress, Fl_Widget)
-};
-
-#endif // !_Fl_Progress_H_
-
-//
-// End of "$Id: Fl_Progress.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
-//
+//
+// "$Id: Fl_Progress.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
+//
+// Progress bar widget definitions.
+//
+// Copyright 2000-2010 by Michael Sweet.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_Progress widget . */
+
+#ifndef _Fl_Progress_H_
+#  define _Fl_Progress_H_
+
+//
+// Include necessary headers.
+//
+
+#include "Fl_Widget.H"
+
+
+//
+// Progress class...
+//
+/**
+    Displays a progress bar for the user.
+*/
+class FL_EXPORT Fl_Progress : public Fl_Widget {
+  
+  float	value_,
+	minimum_,
+	maximum_;
+
+  protected:
+
+  virtual void draw();
+
+  public:
+
+  Fl_Progress(int x, int y, int w, int h, const char *l = 0);
+
+  /** Sets the maximum value in the progress widget.  */
+  void	maximum(float v) { maximum_ = v; redraw(); }
+  /** Gets the maximum value in the progress widget.  */
+  float	maximum() const { return (maximum_); }
+
+  /** Sets the minimum value in the progress widget.  */
+  void	minimum(float v) { minimum_ = v; redraw(); }
+  /** Gets the minimum value in the progress widget.  */
+  float	minimum() const { return (minimum_); }
+
+  /** Sets the current value in the progress widget.  */
+  void	value(float v) { value_ = v; redraw(); }
+  /** Gets the current value in the progress widget.  */
+  float	value() const { return (value_); }
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_Progress, Fl_Widget)
+};
+
+#endif // !_Fl_Progress_H_
+
+//
+// End of "$Id: Fl_Progress.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
+//

+ 26 - 26
fltk/FL/Fl_RGB_Image.H

@@ -1,26 +1,26 @@
-//
-// "$Id: Fl_RGB_Image.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
-//
-// RGB Image header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-#ifndef Fl_RGB_Image_H
-# define Fl_RGB_Image_H
-# include "Fl_Image.H"
-#endif // !Fl_RGB_Image_H
-
-//
-// End of "$Id: Fl_RGB_Image.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
-//
+//
+// "$Id: Fl_RGB_Image.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
+//
+// RGB Image header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2010 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+#ifndef Fl_RGB_Image_H
+# define Fl_RGB_Image_H
+# include "Fl_Image.H"
+#endif // !Fl_RGB_Image_H
+
+//
+// End of "$Id: Fl_RGB_Image.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
+//

+ 37 - 38
fltk/FL/Fl_Radio_Button.H

@@ -1,38 +1,37 @@
-//
-// "$Id: Fl_Radio_Button.H 9637 2012-07-24 04:37:22Z matt $"
-//
-// Radio button header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_Radio_Button widget . */
-
-#ifndef Fl_Radio_Button_H
-#define Fl_Radio_Button_H
-
-#include "Fl_Button.H"
-
-class FL_EXPORT Fl_Radio_Button : public Fl_Button {
-public:
-  Fl_Radio_Button(int X,int Y,int W,int H,const char *L=0);
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_Radio_Button, Fl_Button)
-};
-
-#endif
-
-//
-// End of "$Id: Fl_Radio_Button.H 9637 2012-07-24 04:37:22Z matt $".
-//
+//
+// "$Id: Fl_Radio_Button.H 10386 2014-10-19 20:17:17Z AlbrechtS $"
+//
+// Radio button header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2014 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file. If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_Radio_Button widget . */
+
+#ifndef Fl_Radio_Button_H
+#define Fl_Radio_Button_H
+
+#include "Fl_Button.H"
+
+class FL_EXPORT Fl_Radio_Button : public Fl_Button {
+public:
+  Fl_Radio_Button(int X,int Y,int W,int H,const char *L=0);
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_Radio_Button, Fl_Button)
+};
+
+#endif
+
+//
+// End of "$Id: Fl_Radio_Button.H 10386 2014-10-19 20:17:17Z AlbrechtS $".
+//

+ 37 - 38
fltk/FL/Fl_Radio_Light_Button.H

@@ -1,38 +1,37 @@
-//
-// "$Id: Fl_Radio_Light_Button.H 9637 2012-07-24 04:37:22Z matt $"
-//
-// Radio light button header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_Radio_Light_Button widget . */
-
-#ifndef Fl_Radio_Light_Button_H
-#define Fl_Radio_Light_Button_H
-
-#include "Fl_Light_Button.H"
-
-class FL_EXPORT Fl_Radio_Light_Button : public Fl_Light_Button {
-public:
-  Fl_Radio_Light_Button(int X,int Y,int W,int H,const char *l=0);
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_Radio_Light_Button, Fl_Light_Button)
-};
-
-#endif
-
-//
-// End of "$Id: Fl_Radio_Light_Button.H 9637 2012-07-24 04:37:22Z matt $".
-//
+//
+// "$Id: Fl_Radio_Light_Button.H 10386 2014-10-19 20:17:17Z AlbrechtS $"
+//
+// Radio light button header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2014 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file. If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_Radio_Light_Button widget . */
+
+#ifndef Fl_Radio_Light_Button_H
+#define Fl_Radio_Light_Button_H
+
+#include "Fl_Light_Button.H"
+
+class FL_EXPORT Fl_Radio_Light_Button : public Fl_Light_Button {
+public:
+  Fl_Radio_Light_Button(int X,int Y,int W,int H,const char *l=0);
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_Radio_Light_Button, Fl_Light_Button)
+};
+
+#endif
+
+//
+// End of "$Id: Fl_Radio_Light_Button.H 10386 2014-10-19 20:17:17Z AlbrechtS $".
+//

+ 37 - 38
fltk/FL/Fl_Radio_Round_Button.H

@@ -1,38 +1,37 @@
-//
-// "$Id: Fl_Radio_Round_Button.H 9637 2012-07-24 04:37:22Z matt $"
-//
-// Radio round button header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_Radio_Round_Button widget . */
-
-#ifndef Fl_Radio_Round_Button_H
-#define Fl_Radio_Round_Button_H
-
-#include "Fl_Round_Button.H"
-
-class FL_EXPORT Fl_Radio_Round_Button : public Fl_Round_Button {
-public:
-  Fl_Radio_Round_Button(int X,int Y,int W,int H,const char *L=0);
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_Radio_Round_Button, Fl_Round_Button)
-};
-
-#endif
-
-//
-// End of "$Id: Fl_Radio_Round_Button.H 9637 2012-07-24 04:37:22Z matt $".
-//
+//
+// "$Id: Fl_Radio_Round_Button.H 10386 2014-10-19 20:17:17Z AlbrechtS $"
+//
+// Radio round button header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2014 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file. If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_Radio_Round_Button widget . */
+
+#ifndef Fl_Radio_Round_Button_H
+#define Fl_Radio_Round_Button_H
+
+#include "Fl_Round_Button.H"
+
+class FL_EXPORT Fl_Radio_Round_Button : public Fl_Round_Button {
+public:
+  Fl_Radio_Round_Button(int X,int Y,int W,int H,const char *L=0);
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_Radio_Round_Button, Fl_Round_Button)
+};
+
+#endif
+
+//
+// End of "$Id: Fl_Radio_Round_Button.H 10386 2014-10-19 20:17:17Z AlbrechtS $".
+//

+ 82 - 0
fltk/FL/Fl_Rect.H

@@ -0,0 +1,82 @@
+//
+// "$Id: Fl_Rect.H 12260 2017-06-13 10:35:18Z AlbrechtS $"
+//
+// Fl_Rect header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2017 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+#ifndef Fl_Rect_H
+#define Fl_Rect_H
+
+#include <FL/Fl_Widget.H>	// for c'tor based on Fl_Widget
+
+/**
+  Rectangle with standard FLTK coordinates (X, Y, W, H).
+
+  This may be used internally, for overloaded widget contructors and other
+  overloaded methods like fl_measure(), fl_text_extents(), fl_rect(),
+  fl_rectf(), and maybe more.
+*/
+
+class FL_EXPORT Fl_Rect {
+
+  int x_;
+  int y_;
+  int w_;
+  int h_;
+
+public:
+
+  /** The default constructor creates an empty rectangle (x = y = w = h = 0). */
+  Fl_Rect()
+  : x_(0), y_(0), w_(0), h_(0) {}
+
+  /** This constructor creates a rectangle with x = y = 0 and
+    the given width and height. */
+  Fl_Rect(int W, int H)
+  : x_(0), y_(0), w_(W), h_(H) {}
+
+  /** This constructor creates a rectangle with the given x,y coordinates
+    and the given width and height. */
+  Fl_Rect(int X, int Y, int W, int H)
+  : x_(X), y_(Y), w_(W), h_(H) {}
+
+ /** This constructor creates a rectangle based on a widget's position and size. */
+  Fl_Rect (const Fl_Widget& widget)
+  : x_(widget.x()), y_(widget.y()), w_(widget.w()), h_(widget.h()) {}
+
+ /** This constructor creates a rectangle based on a widget's position and size. */
+  Fl_Rect (const Fl_Widget* const widget)
+  : x_(widget->x()), y_(widget->y()), w_(widget->w()), h_(widget->h()) {}
+
+  int x() const { return x_; }		///< gets the x coordinate (left edge)
+  int y() const { return y_; }		///< gets the y coordinate (top edge)
+  int w() const { return w_; }		///< gets the width
+  int h() const { return h_; }		///< gets the height
+
+  int r() const { return x_ + w_; }	///< gets the right edge (x + w)
+  int b() const { return y_ + h_; }	///< gets the bottom edge (y + h)
+
+  void x(int X) { x_ = X; }		///< sets the x coordinate (left edge)
+  void y(int Y) { y_ = Y; }		///< sets the y coordinate (top edge)
+  void w(int W) { w_ = W; }		///< sets the width
+  void h(int H) { h_ = H; }		///< sets the height
+
+}; // class Fl_Rect
+
+#endif // Fl_Rect_H
+
+//
+// End of "$Id: Fl_Rect.H 12260 2017-06-13 10:35:18Z AlbrechtS $".
+//

+ 55 - 56
fltk/FL/Fl_Repeat_Button.H

@@ -1,56 +1,55 @@
-//
-// "$Id: Fl_Repeat_Button.H 9637 2012-07-24 04:37:22Z matt $"
-//
-// Repeat button header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_Repeat_Button widget . */
-
-#ifndef Fl_Repeat_Button_H
-#define Fl_Repeat_Button_H
-#include "Fl.H"
-#include "Fl_Button.H"
-
-/**
-  The Fl_Repeat_Button is a subclass of Fl_Button that
-  generates a callback when it is pressed and then repeatedly generates
-  callbacks as long as it is held down.  The speed of the repeat is fixed
-  and depends on the implementation.
-*/
-class FL_EXPORT Fl_Repeat_Button : public Fl_Button {
-  static void repeat_callback(void *);
-public:
-  int handle(int);
-  /**
-    Creates a new Fl_Repeat_Button widget using the given
-    position, size, and label string. The default boxtype is FL_UP_BOX.
-    Deletes the button.
-  */
-  Fl_Repeat_Button(int X,int Y,int W,int H,const char *l=0);
-
-  void deactivate() {
-    Fl::remove_timeout(repeat_callback,this);
-    Fl_Button::deactivate();
-  }
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_Repeat_Button, Fl_Button)
-};
-
-#endif
-
-//
-// End of "$Id: Fl_Repeat_Button.H 9637 2012-07-24 04:37:22Z matt $".
-//
+//
+// "$Id: Fl_Repeat_Button.H 9637 2012-07-24 04:37:22Z matt $"
+//
+// Repeat button header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2010 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_Repeat_Button widget . */
+
+#ifndef Fl_Repeat_Button_H
+#define Fl_Repeat_Button_H
+#include "Fl.H"
+#include "Fl_Button.H"
+
+/**
+  The Fl_Repeat_Button is a subclass of Fl_Button that
+  generates a callback when it is pressed and then repeatedly generates
+  callbacks as long as it is held down.  The speed of the repeat is fixed
+  and depends on the implementation.
+*/
+class FL_EXPORT Fl_Repeat_Button : public Fl_Button {
+  static void repeat_callback(void *);
+public:
+  int handle(int);
+  /**
+    Creates a new Fl_Repeat_Button widget using the given
+    position, size, and label string. The default boxtype is FL_UP_BOX.
+    Deletes the button.
+  */
+  Fl_Repeat_Button(int X,int Y,int W,int H,const char *l=0);
+
+  void deactivate() {
+    Fl::remove_timeout(repeat_callback,this);
+    Fl_Button::deactivate();
+  }
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_Repeat_Button, Fl_Button)
+};
+
+#endif
+
+//
+// End of "$Id: Fl_Repeat_Button.H 9637 2012-07-24 04:37:22Z matt $".
+//

+ 51 - 52
fltk/FL/Fl_Return_Button.H

@@ -1,52 +1,51 @@
-//
-// "$Id: Fl_Return_Button.H 9637 2012-07-24 04:37:22Z matt $"
-//
-// Return button header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_Return_Button widget . */
-
-#ifndef Fl_Return_Button_H
-#define Fl_Return_Button_H
-#include "Fl_Button.H"
-
-/**
-  The Fl_Return_Button is a subclass of Fl_Button that
-  generates a callback when it is pressed or when the user presses the
-  Enter key.  A carriage-return symbol is drawn next to the button label.
-  <P ALIGN=CENTER>\image html Fl_Return_Button.png 
-  \image latex Fl_Return_Button.png "Fl_Return_Button" width=4cm
-*/
-class FL_EXPORT Fl_Return_Button : public Fl_Button {
-protected:
-  void draw();
-public:
-  int handle(int);
-  /**
-    Creates a new Fl_Return_Button widget using the given
-    position, size, and label string. The default boxtype is FL_UP_BOX.
-    <P> The inherited destructor deletes the button.
-  */
-  Fl_Return_Button(int X, int Y, int W, int H,const char *l=0);
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_Return_Button, Fl_Button)
-};
-
-#endif
-
-//
-// End of "$Id: Fl_Return_Button.H 9637 2012-07-24 04:37:22Z matt $".
-//
+//
+// "$Id: Fl_Return_Button.H 9637 2012-07-24 04:37:22Z matt $"
+//
+// Return button header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2010 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_Return_Button widget . */
+
+#ifndef Fl_Return_Button_H
+#define Fl_Return_Button_H
+#include "Fl_Button.H"
+
+/**
+  The Fl_Return_Button is a subclass of Fl_Button that
+  generates a callback when it is pressed or when the user presses the
+  Enter key.  A carriage-return symbol is drawn next to the button label.
+  <P ALIGN=CENTER>\image html Fl_Return_Button.png 
+  \image latex Fl_Return_Button.png "Fl_Return_Button" width=4cm
+*/
+class FL_EXPORT Fl_Return_Button : public Fl_Button {
+protected:
+  void draw();
+public:
+  int handle(int);
+  /**
+    Creates a new Fl_Return_Button widget using the given
+    position, size, and label string. The default boxtype is FL_UP_BOX.
+    <P> The inherited destructor deletes the button.
+  */
+  Fl_Return_Button(int X, int Y, int W, int H,const char *l=0);
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_Return_Button, Fl_Button)
+};
+
+#endif
+
+//
+// End of "$Id: Fl_Return_Button.H 9637 2012-07-24 04:37:22Z matt $".
+//

+ 48 - 49
fltk/FL/Fl_Roller.H

@@ -1,49 +1,48 @@
-//
-// "$Id: Fl_Roller.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
-//
-// Roller header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_Roller widget . */
-
-#ifndef Fl_Roller_H
-#define Fl_Roller_H
-
-#ifndef Fl_Valuator_H
-#include "Fl_Valuator.H"
-#endif
-
-/**
-  The Fl_Roller widget is a "dolly" control commonly used to
-  move 3D objects.
-  <P ALIGN=CENTER>\image html Fl_Roller.png 
-  \image latex Fl_Roller.png "Fl_Roller" width=4cm
-*/
-class FL_EXPORT Fl_Roller : public Fl_Valuator {
-protected:
-  void draw();
-public:
-  int handle(int);
-  Fl_Roller(int X,int Y,int W,int H,const char* L=0);
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_Roller, Fl_Valuator)
-};
-
-#endif
-
-//
-// End of "$Id: Fl_Roller.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
-//
+//
+// "$Id: Fl_Roller.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
+//
+// Roller header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2010 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_Roller widget . */
+
+#ifndef Fl_Roller_H
+#define Fl_Roller_H
+
+#ifndef Fl_Valuator_H
+#include "Fl_Valuator.H"
+#endif
+
+/**
+  The Fl_Roller widget is a "dolly" control commonly used to
+  move 3D objects.
+  <P ALIGN=CENTER>\image html Fl_Roller.png 
+  \image latex Fl_Roller.png "Fl_Roller" width=4cm
+*/
+class FL_EXPORT Fl_Roller : public Fl_Valuator {
+protected:
+  void draw();
+public:
+  int handle(int);
+  Fl_Roller(int X,int Y,int W,int H,const char* L=0);
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_Roller, Fl_Valuator)
+};
+
+#endif
+
+//
+// End of "$Id: Fl_Roller.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
+//

+ 45 - 49
fltk/FL/Fl_Round_Button.H

@@ -1,50 +1,46 @@
-//
-// "$Id: Fl_Round_Button.H 9031 2011-09-07 12:18:14Z ianmacarthur $"
-//
-// Round button header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_Round_Button widget . */
-
-#ifndef Fl_Round_Button_H
-#define Fl_Round_Button_H
-
-#include "Fl_Light_Button.H"
-
-/**
-  Buttons generate callbacks when they are clicked by the user.  You
-  control exactly when and how by changing the values for type()
-  and when().
+//
+// "$Id: Fl_Round_Button.H 10386 2014-10-19 20:17:17Z AlbrechtS $"
+//
+// Round button header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2014 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file. If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+#ifndef Fl_Round_Button_H
+#define Fl_Round_Button_H
+
+#include "Fl_Light_Button.H"
+
+/**
+  Buttons generate callbacks when they are clicked by the user.  You
+  control exactly when and how by changing the values for type()
+  and when().
   <P ALIGN=CENTER>\image html Fl_Round_Button.png</P>
-  \image latex  Fl_Round_Button.png " Fl_Round_Button" width=4cm
-  <P>The Fl_Round_Button subclass display the "on" state by
-  turning on a light, rather than drawing pushed in.  The shape of the
-  "light" is initially set to FL_ROUND_DOWN_BOX.  The color of the light
-  when on is controlled with selection_color(), which defaults to
-  FL_FOREGROUND_COLOR.
-*/
-class FL_EXPORT Fl_Round_Button : public Fl_Light_Button {
-public:
-  Fl_Round_Button(int x,int y,int w,int h,const char *l = 0);
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_Round_Button, Fl_Light_Button)
-};
-
-#endif
-
-//
-// End of "$Id: Fl_Round_Button.H 9031 2011-09-07 12:18:14Z ianmacarthur $".
-//
+  \image latex  Fl_Round_Button.png " Fl_Round_Button" width=4cm
+  <P>The Fl_Round_Button subclass display the "on" state by
+  turning on a light, rather than drawing pushed in.  The shape of the
+  "light" is initially set to FL_ROUND_DOWN_BOX.  The color of the light
+  when on is controlled with selection_color(), which defaults to
+  FL_FOREGROUND_COLOR.
+*/
+class FL_EXPORT Fl_Round_Button : public Fl_Light_Button {
+public:
+  Fl_Round_Button(int x,int y,int w,int h,const char *l = 0);
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_Round_Button, Fl_Light_Button)
+};
+
+#endif
+
+//
+// End of "$Id: Fl_Round_Button.H 10386 2014-10-19 20:17:17Z AlbrechtS $".
+//

+ 40 - 40
fltk/FL/Fl_Round_Clock.H

@@ -1,40 +1,40 @@
-//
-// "$Id: Fl_Round_Clock.H 9637 2012-07-24 04:37:22Z matt $"
-//
-// Round clock header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_Round_Clock widget . */
-
-#ifndef Fl_Round_Clock_H
-#define Fl_Round_Clock_H
-
-#include "Fl_Clock.H"
-
-/** A clock widget of type FL_ROUND_CLOCK. Has no box. */
-class FL_EXPORT Fl_Round_Clock : public Fl_Clock {
-public:
-    /** Creates the clock widget, setting his type and box. */
-    Fl_Round_Clock(int X,int Y,int W,int H, const char *L = 0);
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_Round_Clock, Fl_Clock)
-};
-
-#endif
-
-//
-// End of "$Id: Fl_Round_Clock.H 9637 2012-07-24 04:37:22Z matt $".
-//
+//
+// "$Id: Fl_Round_Clock.H 9637 2012-07-24 04:37:22Z matt $"
+//
+// Round clock header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2010 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_Round_Clock widget . */
+
+#ifndef Fl_Round_Clock_H
+#define Fl_Round_Clock_H
+
+#include "Fl_Clock.H"
+
+/** A clock widget of type FL_ROUND_CLOCK. Has no box. */
+class FL_EXPORT Fl_Round_Clock : public Fl_Clock {
+public:
+  /** Creates the clock widget, setting his type and box. */
+  Fl_Round_Clock(int X,int Y,int W,int H, const char *L = 0);
+
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_Round_Clock, Fl_Clock)
+};
+
+#endif
+
+//
+// End of "$Id: Fl_Round_Clock.H 9637 2012-07-24 04:37:22Z matt $".
+//

+ 140 - 0
fltk/FL/Fl_SVG_Image.H

@@ -0,0 +1,140 @@
+//
+// "$Id: Fl_SVG_Image.H 12620 2018-01-04 15:45:59Z manolo $"
+//
+// SVG Image header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 2017 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+#ifndef FL_SVG_IMAGE_H
+#define FL_SVG_IMAGE_H
+
+#include <FL/Fl_Image.H>
+
+struct NSVGimage;
+
+/** The Fl_SVG_Image class supports loading, caching and drawing of scalable vector graphics (SVG) images.
+ The FLTK library performs parsing and rasterization of SVG data using a modified version 
+ of the \c nanosvg software (https://github.com/memononen/nanosvg) © 2013-14 Mikko Mononen 
+ ([email protected]). The software modification allows the option to change the image ratio 
+ while performing rasterization.
+ 
+ Use Fl_Image::fail() to check if the Fl_SVG_Image failed to load. fail() returns ERR_FILE_ACCESS 
+ if the file could not be opened or read, and ERR_FORMAT if the SVG format could not be decoded. 
+ If the image has loaded correctly, w(), h(), and d() should return values greater than zero.
+ 
+ Rasterization is not done until the image is first drawn or resize() is called. Therefore, 
+ \ref array is NULL until then. The delayed rasterization ensures an Fl_Shared_Image based on
+ an SVG image and scaled to its display size by Fl_Shared_Image::scale() will be 
+ always rasterized to the exact screen resolution.
+ 
+ The Fl_SVG_Image class draws images computed by \c nanosvg: one known limitation is that text
+ within \c <text\></text\> blocks is not rendered.
+ 
+ The FLTK library can optionally be built without SVG support; in that case, 
+ class Fl_SVG_Image is unavailable.
+ Example of displaying a hard-coded svg file:
+ \code
+ #include <FL/Fl.H>
+ #include <FL/Fl_Window.H>
+ #include <FL/Fl_Box.H>
+ #include <FL/Fl_SVG_Image.H>
+
+ // A black rotated rectangle
+ const char *svg_data = "<svg viewBox=\"0 0 200 200\" version = \"1.1\">\n"
+                        "<rect x=\"25\" y=\"50\" width=\"150\" height=\"100\" fill=\"black\" "
+                        "transform=\"rotate(45 100 100)\"> </svg>\n";
+
+ int main(int argc, char **argv) {
+     Fl_SVG_Image *svg = new Fl_SVG_Image(0, svg_data);       // create SVG object
+     Fl_Window    *win = new Fl_Window(720, 486, "svg test");
+     Fl_Box       *box = new Fl_Box(0,0,win->w(),win->h());
+     box->image(svg);  // assign svg object to Fl_Box
+     win->end();
+     win->show(argc,argv);
+     return(Fl::run());
+ }
+ \endcode
+
+ Example of displaying an svg image from a file:
+ \code
+ #include <errno.h>   // errno
+ #include <string.h>  // strerror
+ #include <FL/Fl.H>
+ #include <FL/Fl_Window.H>
+ #include <FL/Fl_Box.H>
+ #include <FL/Fl_SVG_Image.H>
+ #include <FL/fl_message.H>
+ int main(int argc, char **argv) {
+     Fl_Window *win = new Fl_Window(720, 486, "svg test");
+     Fl_Box    *box = new Fl_Box(0,0,win->w(),win->h());
+ 
+     // Load svg image from disk, assign to a box
+     const char *svgpath = "/var/tmp/simple.svg";
+     Fl_SVG_Image *svg = new Fl_SVG_Image(svgpath);  // load SVG object from disk
+     switch ( svg->fail() ) {
+         case Fl_Image::ERR_FILE_ACCESS:
+            // File couldn't load? show path + os error to user
+            fl_alert("%s: %s", svgpath, strerror(errno));
+            return 1;
+         case Fl_Image::ERR_FORMAT:
+            // Parsing error
+            fl_alert("%s: couldn't decode image", svgpath);
+            return 1;
+     }
+     box->image(svg);  // assign svg object to box
+ 
+     win->end();
+     win->show(argc,argv);
+     return(Fl::run());
+ }
+ \endcode
+ */
+class FL_EXPORT Fl_SVG_Image : public Fl_RGB_Image {
+private:
+  typedef struct {
+    NSVGimage* svg_image;
+    int ref_count;
+  } counted_NSVGimage;
+  counted_NSVGimage* counted_svg_image_;
+  bool rasterized_;
+  int raster_w_, raster_h_;
+  bool to_desaturate_;
+  Fl_Color average_color_;
+  float average_weight_;
+  float svg_scaling_(int W, int H);
+  void rasterize_(int W, int H);
+  void init_(const char *filename, const char *filedata, Fl_SVG_Image *copy_source);
+  Fl_SVG_Image(Fl_SVG_Image *source);
+protected:
+  virtual int draw_scaled(int X, int Y, int W, int H);
+public:
+  /** Set this to \c false to allow image re-scaling that alters the image aspect ratio.
+   Upon object creation, proportional is set to \c true, and the aspect ratio is kept constant.*/
+  bool proportional;
+  Fl_SVG_Image(const char *filename, const char *svg_data = NULL);
+  virtual ~Fl_SVG_Image();
+  virtual Fl_Image *copy(int W, int H);
+  Fl_Image *copy() { return copy(w(), h()); }
+  void resize(int width, int height);
+  virtual void desaturate();
+  virtual void color_average(Fl_Color c, float i);
+  virtual void draw(int X, int Y, int W, int H, int cx = 0, int cy = 0);
+  void draw(int X, int Y) { draw(X, Y, w(), h(), 0, 0); }
+};
+
+#endif // FL_SVG_IMAGE_H
+
+//
+// End of "$Id: Fl_SVG_Image.H 12620 2018-01-04 15:45:59Z manolo $".
+//

+ 190 - 0
fltk/FL/Fl_Screen_Driver.H

@@ -0,0 +1,190 @@
+//
+// "$Id: Fl_Screen_Driver.H 12628 2018-01-09 07:26:49Z manolo $"
+//
+// All screen related calls in a driver style class.
+//
+// Copyright 1998-2017 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+#ifndef FL_SCREEN_DRIVER_H
+#define FL_SCREEN_DRIVER_H
+
+#include <FL/Fl_Device.H>
+#include <FL/fl_types.h>
+#include <FL/Fl.H> // for Fl_Timeout_Handler
+#include <FL/Fl_Text_Editor.H>
+
+
+// TODO: add text composition?
+// TODO: add Fl::display
+// TODO: add copy/paste, drag/drop?
+// TODO: get key/get mouse?
+// TODO: system colors/colormaps
+// TODO: system menu?
+// TODO: native filechooser
+// TODO: native message boxes
+// TODO: read screen to image
+// TODO: application shortcuts
+
+class Fl_Window;
+class Fl_RGB_Image;
+class Fl_Group;
+class Fl_Input;
+
+/** A base class describing the interface between FLTK and screen-related operations.
+This class is only for internal use by the FLTK library.
+Each supported platform implements several of the virtual methods of this class.
+*/
+class FL_EXPORT Fl_Screen_Driver {
+
+protected:
+  Fl_Screen_Driver();
+  virtual ~Fl_Screen_Driver();
+
+  static const int MAX_SCREENS = 16;
+
+  int num_screens;
+  static  float fl_intersection(int x1, int y1, int w1, int h1,
+                                      int x2, int y2, int w2, int h2);
+
+public:
+  static char bg_set;
+  static char bg2_set;
+  static char fg_set;
+
+public:
+  virtual float scale(int n) {return 1;}
+  virtual void scale(int n, float f) { }
+  static Fl_Screen_Driver *newScreenDriver();
+  // --- display management
+  virtual void display(const char *disp);
+  virtual int visual(int flags);
+  // --- screen configuration
+  virtual void init() = 0;
+  virtual int x() = 0;
+  virtual int y() = 0;
+  virtual int w() = 0;
+  virtual int h() = 0;
+  virtual int screen_count();
+  void screen_xywh(int &X, int &Y, int &W, int &H, int mx, int my);
+  virtual void screen_xywh(int &X, int &Y, int &W, int &H, int n) = 0;
+  void screen_xywh(int &X, int &Y, int &W, int &H, int mx, int my, int mw, int mh);
+  virtual int screen_num(int x, int y);
+  virtual int screen_num(int x, int y, int w, int h);
+  virtual void screen_dpi(float &h, float &v, int n=0) = 0;
+  void screen_work_area(int &X, int &Y, int &W, int &H, int mx, int my);
+  virtual void screen_work_area(int &X, int &Y, int &W, int &H, int n) = 0;
+  // --- audible output
+  virtual void beep(int type) = 0;
+  // --- global events
+  virtual void flush() = 0;
+  virtual double wait(double time_to_wait) = 0;
+  virtual int ready() = 0;
+  virtual void grab(Fl_Window* win) = 0;
+  // --- global colors
+  /* the default implementation of parse_color() may be enough */
+  virtual int parse_color(const char* p, uchar& r, uchar& g, uchar& b);
+  virtual void get_system_colors() = 0;
+  virtual const char *get_system_scheme();
+  // --- global timers
+  virtual void add_timeout(double time, Fl_Timeout_Handler cb, void *argp) = 0;
+  virtual void repeat_timeout(double time, Fl_Timeout_Handler cb, void *argp) = 0;
+  virtual int has_timeout(Fl_Timeout_Handler cb, void *argp) = 0;
+  virtual void remove_timeout(Fl_Timeout_Handler cb, void *argp) = 0;
+
+  static int secret_input_character;
+  /* Implement to indicate whether complex text input may involve marked text.
+   When it does, has_marked_text returns non zero and reset_marked_text() and
+   insertion_point_location() must also be implemented.
+   */
+  virtual int has_marked_text() { return 0; }
+  virtual void reset_marked_text() {}
+  virtual void insertion_point_location(int x, int y, int height) {}
+  // implement so text-editing widgets support dead keys
+  virtual int compose(int &del) {del = 0; return 0;}
+  // default implementation may be enough
+  virtual void compose_reset();
+  // implement to support drag-n-drop. use_selection = 1 means the GUI is welcome to display
+  // the selected text during the D&D operation
+  virtual int dnd(int use_selection = 0) {return 0;}
+  // null means no platform-specific key bindings for Fl_Text_Editor
+  Fl_Text_Editor::Key_Binding *text_editor_extra_key_bindings;
+  // default implementation may be enough
+  virtual int text_display_can_leak() { return 0; }
+
+  // read raw image from a window or an offscreen buffer
+#if defined(FL_PORTING)
+#  pragma message "FL_PORTING: implement code to read RGB data from screen"
+#endif
+  /* Both member functions read_image() and read_win_rectangle() support
+   the public function fl_read_image() which captures pixel data either from
+   the current window or from an offscreen buffer.
+
+   A platform re-implements either read_image() or read_win_rectangle().
+   In the 1st case and for capture from a window, the returned pixel array 
+   also contains data from any embedded sub-window.
+   In the 2nd case and for capture from a window, only data from the current 
+   window is collected, and read_image()'s default implementation captures 
+   pixels from any subwindow.
+   
+   A platform may also use its read_win_rectangle() implementation to capture
+   window decorations (e.g., title bar). In that case, it is called by
+   Fl_XXX_Window_Driver::capture_titlebar_and_borders().
+   */
+  virtual uchar *read_image(uchar *p, int x, int y, int w, int h, int alpha);
+  virtual Fl_RGB_Image *read_win_rectangle(uchar *p, int X, int Y, int w, int h, int alpha) {return NULL;}
+  static void write_image_inside(Fl_RGB_Image *to, Fl_RGB_Image *from, int to_x, int to_y);
+  static Fl_RGB_Image *traverse_to_gl_subwindows(Fl_Group *g, uchar *p, int x, int y, int w, int h, int alpha,
+                                                 Fl_RGB_Image *full_img);
+  // optional platform-specific key handling for Fl_Input widget
+  // the default implementation may be enough
+  virtual int input_widget_handle_key(int key, unsigned mods, unsigned shift, Fl_Input *input);
+  // implement to support Fl::get_mouse()
+  virtual int get_mouse(int &x, int &y) {return 0;}
+  // optional methods to enable/disable input methods for complex scripts
+  virtual void enable_im() {}
+  virtual void disable_im() {}
+  // calls open_display_platform() and then does platform-independent work
+  void open_display();
+  // implement to open access to the display
+  virtual void open_display_platform() {}
+  // optional method to close display access
+  virtual void close_display() {}
+  // compute dimensions of an Fl_Offscreen
+  virtual void offscreen_size(Fl_Offscreen off, int &width, int &height) {}
+  
+  void rescale_all_windows_from_screen(int screen, float f);
+  static void transient_scale_display(float f, int nscreen);
+  static int scale_handler(int event);
+  virtual void init_workarea() {}
+  virtual float desktop_scale_factor() {return 1;}
+  void use_startup_scale_factor();
+  enum APP_SCALING_CAPABILITY {
+    NO_APP_SCALING = 0, ///< The platform does not support rescaling.
+    SYSTEMWIDE_APP_SCALING, ///< The platform supports rescaling with the same factor for all screens.
+    PER_SCREEN_APP_SCALING ///< The platform supports rescaling with one factor for each screen.
+  };
+  /** Returns the platform's support for rescaling the application with ctrl-/+/-/0/ keys.
+   */
+  virtual APP_SCALING_CAPABILITY rescalable() { return NO_APP_SCALING; }
+  /* Number of pixels per drawing unit for the display.
+     The default implementation may be enough. */
+  virtual float retina_factor() { return 1; }
+};
+
+
+#endif // !FL_SCREEN_DRIVER_H
+
+//
+// End of "$Id: Fl_Screen_Driver.H 12628 2018-01-09 07:26:49Z manolo $".
+//

+ 206 - 192
fltk/FL/Fl_Scroll.H

@@ -1,192 +1,206 @@
-//
-// "$Id: Fl_Scroll.H 9126 2011-10-04 13:10:55Z manolo $"
-//
-// Scroll header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_Scroll widget . */
-
-#ifndef Fl_Scroll_H
-#define Fl_Scroll_H
-
-#include "Fl_Group.H"
-#include "Fl_Scrollbar.H"
-
-/**
-  This container widget lets you maneuver around a set of widgets much
-  larger than your window.  If the child widgets are larger than the size
-  of this object then scrollbars will appear so that you can scroll over
-  to them:
-  \image html Fl_Scroll.png
-  \image latex  Fl_Scroll.png "Fl_Scroll" width=4cm
-
-  If all of the child widgets are packed together into a solid
-  rectangle then you want to set box() to FL_NO_BOX or
-  one of the _FRAME types. This will result in the best output.
-  However, if the child widgets are a sparse arrangement you must
-  set box() to a real _BOX type. This can result in some
-  blinking during redrawing, but that can be solved by using a 
-  Fl_Double_Window.
-
-  By default you can scroll in both directions, and the scrollbars
-  disappear if the data will fit in the area of the scroll. 
-
-  Use Fl_Scroll::type() to change this as follows :
-  <UL>
-  <LI>0                            - No scrollbars </LI>
-  <LI>Fl_Scroll::HORIZONTAL        - Only a horizontal scrollbar. </LI>
-  <LI>Fl_Scroll::VERTICAL          - Only a vertical scrollbar. </LI>
-  <LI>Fl_Scroll::BOTH              - The default is both scrollbars. </LI>
-  <LI>Fl_Scroll::HORIZONTAL_ALWAYS - Horizontal scrollbar always on, vertical always off. </LI>
-  <LI>Fl_Scroll::VERTICAL_ALWAYS   - Vertical scrollbar always on, horizontal always off. </LI>
-  <LI>Fl_Scroll::BOTH_ALWAYS       - Both always on. </LI>
-  </UL>
-
-  Use <B> scrollbar.align(int) ( see void Fl_Widget::align(Fl_Align) ) :</B>
-  to change what side the scrollbars are drawn on.
-
-  If the FL_ALIGN_LEFT bit is on, the vertical scrollbar is on the left.
-  If the FL_ALIGN_TOP bit is on, the horizontal scrollbar is on
-  the top. Note that only the alignment flags in scrollbar are 
-  considered. The flags in hscrollbar however are ignored.
-
-  This widget can also be used to pan around a single child widget
-  "canvas".  This child widget should be of your own class, with a 
-  draw() method that draws the contents.  The scrolling is done by
-  changing the x() and y() of the widget, so this child
-  must use the x() and y() to position its drawing.
-  To speed up drawing it should test fl_push_clip().
-
-  Another very useful child is a single Fl_Pack, which is itself a group
-  that packs its children together and changes size to surround them.
-  Filling the Fl_Pack with Fl_Tabs groups (and then putting
-  normal widgets inside those) gives you a very powerful scrolling list
-  of individually-openable panels.
-
-  Fluid lets you create these, but you can only lay out objects that
-  fit inside the Fl_Scroll without scrolling.  Be sure to leave
-  space for the scrollbars, as Fluid won't show these either.
-
-  <I>You cannot use Fl_Window as a child of this since the
-  clipping is not conveyed to it when drawn, and it will draw over the
-  scrollbars and neighboring objects.</I>
-*/
-class FL_EXPORT Fl_Scroll : public Fl_Group {
-
-  int xposition_, yposition_;
-  int oldx, oldy;
-  int scrollbar_size_;
-  static void hscrollbar_cb(Fl_Widget*, void*);
-  static void scrollbar_cb(Fl_Widget*, void*);
-  void fix_scrollbar_order();
-  static void draw_clip(void*,int,int,int,int);
-
-private:
-
-  //
-  //  Structure to manage scrollbar and widget interior sizes.
-  //
-  //  Private for now -- we'd like to expose some of this at 
-  //  some point to solve STR#1895.)
-  //
-  typedef struct {
-      int scrollsize;							// the scrollsize (global|local)
-      int innerbox_x, innerbox_y, innerbox_w, innerbox_h;		// widget's inner box (excludes scrollbars)
-      int innerchild_x, innerchild_y, innerchild_w, innerchild_h;	// widget's inner box including scrollbars
-      int child_l, child_r, child_b, child_t;				// child bounding box: left/right/bottom/top
-      int hneeded, vneeded;						// hor + ver scrollbar visibility
-      int hscroll_x, hscroll_y, hscroll_w, hscroll_h;			// hor scrollbar size/position
-      int vscroll_x, vscroll_y, vscroll_w, vscroll_h;			// ver scrollbar size/position
-      int hpos, hsize, hfirst, htotal;					// hor scrollbar values (pos/size/first/total)
-      int vpos, vsize, vfirst, vtotal;					// ver scrollbar values (pos/size/first/total)
-  } ScrollInfo;
-  void recalc_scrollbars(ScrollInfo &si);
-
-protected:
-
-  void bbox(int&,int&,int&,int&);
-  void draw();
-
-public:
-
-  Fl_Scrollbar scrollbar;
-  Fl_Scrollbar hscrollbar;
-
-  void resize(int,int,int,int);
-  int handle(int);
-
-  Fl_Scroll(int X,int Y,int W,int H,const char*l=0);
-
-  enum { // values for type()
-    HORIZONTAL = 1,
-    VERTICAL = 2,
-    BOTH = 3,
-    ALWAYS_ON = 4,
-    HORIZONTAL_ALWAYS = 5,
-    VERTICAL_ALWAYS = 6,
-    BOTH_ALWAYS = 7
-  };
-
-  /**    Gets the current horizontal scrolling position.  */
-  int xposition() const {return xposition_;}
-  /**    Gets the current vertical scrolling position.  */
-  int yposition() const {return yposition_;}
-  void scroll_to(int, int);
-  void clear();
-  /**
-    Gets the current size of the scrollbars' troughs, in pixels.
-
-    If this value is zero (default), this widget will use the 
-    Fl::scrollbar_size() value as the scrollbar's width.
-  
-    \returns Scrollbar size in pixels, or 0 if the global Fl::scrollsize() is being used.
-    \see Fl::scrollbar_size(int)
-  */
-  int scrollbar_size() const {
-      return(scrollbar_size_);
-  }
-  /**
-    Sets the pixel size of the scrollbars' troughs to \p newSize, in pixels.
-
-    Normally you should not need this method, and should use
-    Fl::scrollbar_size(int) instead to manage the size of ALL 
-    your widgets' scrollbars. This ensures your application 
-    has a consistent UI, is the default behavior, and is normally
-    what you want.
-
-    Only use THIS method if you really need to override the global
-    scrollbar size. The need for this should be rare.
-    
-    Setting \p newSize to the special value of 0 causes the widget to
-    track the global Fl::scrollbar_size(), which is the default.
-    
-    \param[in] newSize Sets the scrollbar size in pixels.\n
-                    If 0 (default), scrollbar size tracks the global Fl::scrollbar_size()
-    \see Fl::scrollbar_size()
-  */
-  void scrollbar_size(int newSize) {
-      if ( newSize != scrollbar_size_ ) redraw();
-      scrollbar_size_ = newSize;
-  }
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_Scroll, Fl_Group)
-};
-
-#endif
-
-//
-// End of "$Id: Fl_Scroll.H 9126 2011-10-04 13:10:55Z manolo $".
-//
+//
+// "$Id: Fl_Scroll.H 11692 2016-04-24 19:39:27Z manolo $"
+//
+// Scroll header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2015 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_Scroll widget . */
+
+#ifndef Fl_Scroll_H
+#define Fl_Scroll_H
+
+#include "Fl_Group.H"
+#include "Fl_Scrollbar.H"
+
+/**
+  This container widget lets you maneuver around a set of widgets much
+  larger than your window.  If the child widgets are larger than the size
+  of this object then scrollbars will appear so that you can scroll over
+  to them:
+  \image html Fl_Scroll.png
+  \image latex  Fl_Scroll.png "Fl_Scroll" width=4cm
+
+  If all of the child widgets are packed together into a solid
+  rectangle then you want to set box() to FL_NO_BOX or
+  one of the _FRAME types. This will result in the best output.
+  However, if the child widgets are a sparse arrangement you must
+  set box() to a real _BOX type. This can result in some
+  blinking during redrawing, but that can be solved by using a
+  Fl_Double_Window.
+
+  By default you can scroll in both directions, and the scrollbars
+  disappear if the data will fit in the area of the scroll.
+
+  Use Fl_Scroll::type() to change this as follows :
+
+  - 0                            - No scrollbars
+  - Fl_Scroll::HORIZONTAL        - Only a horizontal scrollbar.
+  - Fl_Scroll::VERTICAL          - Only a vertical scrollbar.
+  - Fl_Scroll::BOTH              - The default is both scrollbars.
+  - Fl_Scroll::HORIZONTAL_ALWAYS - Horizontal scrollbar always on, vertical always off.
+  - Fl_Scroll::VERTICAL_ALWAYS   - Vertical scrollbar always on, horizontal always off.
+  - Fl_Scroll::BOTH_ALWAYS       - Both always on.
+
+  Use <B> scrollbar.align(int) ( see void Fl_Widget::align(Fl_Align) ) :</B>
+  to change what side the scrollbars are drawn on.
+
+  If the FL_ALIGN_LEFT bit is on, the vertical scrollbar is on the left.
+  If the FL_ALIGN_TOP bit is on, the horizontal scrollbar is on
+  the top. Note that only the alignment flags in scrollbar are
+  considered. The flags in hscrollbar however are ignored.
+
+  This widget can also be used to pan around a single child widget
+  "canvas".  This child widget should be of your own class, with a
+  draw() method that draws the contents.  The scrolling is done by
+  changing the x() and y() of the widget, so this child
+  must use the x() and y() to position its drawing.
+  To speed up drawing it should test fl_not_clipped(int x,int y,int w,int h)
+  to find out if a particular area of the widget must be drawn.
+
+  Another very useful child is a single Fl_Pack, which is itself a group
+  that packs its children together and changes size to surround them.
+  Filling the Fl_Pack with Fl_Tabs groups (and then putting
+  normal widgets inside those) gives you a very powerful scrolling list
+  of individually-openable panels.
+
+  Fluid lets you create these, but you can only lay out objects that
+  fit inside the Fl_Scroll without scrolling.  Be sure to leave
+  space for the scrollbars, as Fluid won't show these either.
+
+  <I>You cannot use Fl_Window as a child of this since the
+  clipping is not conveyed to it when drawn, and it will draw over the
+  scrollbars and neighboring objects.</I>
+*/
+class FL_EXPORT Fl_Scroll : public Fl_Group {
+
+  int xposition_, yposition_;
+  int oldx, oldy;
+  int scrollbar_size_;
+  static void hscrollbar_cb(Fl_Widget*, void*);
+  static void scrollbar_cb(Fl_Widget*, void*);
+  void fix_scrollbar_order();
+  static void draw_clip(void*,int,int,int,int);
+
+protected:	//  (STR#1895)
+  /**
+    Structure to manage scrollbar and widget interior sizes.
+    This is filled out by recalc_scrollbars() for use in calculations
+    that need to know the visible scroll area size, etc.
+    \version 1.3.3
+  */
+  typedef struct {
+    /// A local struct to manage a region defined by xywh
+    typedef struct { int x,y,w,h; } Fl_Region_XYWH;
+    /// A local struct to manage a region defined by left/right/top/bottom
+    typedef struct {
+      int l;			///< (l)eft "x" position, aka x1
+      int r;			///< (r)ight "x" position, aka x2
+      int t;			///< (t)op "y" position, aka y1
+      int b;			///< (b)ottom "y" position, aka y2
+    } Fl_Region_LRTB;
+    /// A local struct to manage a scrollbar's xywh region and tab values
+    typedef struct {
+      int x,y,w,h;
+      int pos;			///< scrollbar tab's "position of first line displayed"
+      int size;			///< scrollbar tab's "size of window in lines"
+      int first;		///< scrollbar tab's "number of first line"
+      int total;		///< scrollbar tab's "total number of lines"
+    } Fl_Scrollbar_Data;
+    int scrollsize;		///< the effective scrollbar thickness (local or global)
+    Fl_Region_XYWH innerbox;	///< widget's inner box, excluding scrollbars
+    Fl_Region_XYWH innerchild;	///< widget's inner box, including scrollbars
+    Fl_Region_LRTB child;	///< child bounding box: left/right/top/bottom
+    int hneeded;		///< horizontal scrollbar visibility
+    int vneeded;		///< vertical scrollbar visibility
+    Fl_Scrollbar_Data hscroll;	///< horizontal scrollbar region + values
+    Fl_Scrollbar_Data vscroll;	///< vertical scrollbar region + values
+  } ScrollInfo;
+  void recalc_scrollbars(ScrollInfo &si);
+
+protected:
+
+  void bbox(int&,int&,int&,int&);
+  void draw();
+
+public:
+
+  Fl_Scrollbar scrollbar;
+  Fl_Scrollbar hscrollbar;
+
+  void resize(int X, int Y, int W, int H);
+  int handle(int);
+
+  Fl_Scroll(int X,int Y,int W,int H,const char*l=0);
+
+  enum { // values for type()
+    HORIZONTAL = 1,
+    VERTICAL = 2,
+    BOTH = 3,
+    ALWAYS_ON = 4,
+    HORIZONTAL_ALWAYS = 5,
+    VERTICAL_ALWAYS = 6,
+    BOTH_ALWAYS = 7
+  };
+
+  /**    Gets the current horizontal scrolling position.  */
+  int xposition() const {return xposition_;}
+  /**    Gets the current vertical scrolling position.  */
+  int yposition() const {return yposition_;}
+  void scroll_to(int, int);
+  void clear();
+  /**
+    Gets the current size of the scrollbars' troughs, in pixels.
+
+    If this value is zero (default), this widget will use the
+    Fl::scrollbar_size() value as the scrollbar's width.
+
+    \returns Scrollbar size in pixels, or 0 if the global Fl::scrollbar_size() is being used.
+    \see Fl::scrollbar_size(int)
+  */
+  int scrollbar_size() const {
+      return(scrollbar_size_);
+  }
+  /**
+    Sets the pixel size of the scrollbars' troughs to \p newSize, in pixels.
+
+    Normally you should not need this method, and should use
+    Fl::scrollbar_size(int) instead to manage the size of ALL
+    your widgets' scrollbars. This ensures your application
+    has a consistent UI, is the default behavior, and is normally
+    what you want.
+
+    Only use THIS method if you really need to override the global
+    scrollbar size. The need for this should be rare.
+
+    Setting \p newSize to the special value of 0 causes the widget to
+    track the global Fl::scrollbar_size(), which is the default.
+
+    \param[in] newSize Sets the scrollbar size in pixels.\n
+                    If 0 (default), scrollbar size tracks the global Fl::scrollbar_size()
+    \see Fl::scrollbar_size()
+  */
+  void scrollbar_size(int newSize) {
+      if ( newSize != scrollbar_size_ ) redraw();
+      scrollbar_size_ = newSize;
+  }
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_Scroll, Fl_Group)
+};
+
+#endif
+
+//
+// End of "$Id: Fl_Scroll.H 11692 2016-04-24 19:39:27Z manolo $".
+//

+ 112 - 112
fltk/FL/Fl_Scrollbar.H

@@ -1,112 +1,112 @@
-//
-// "$Id: Fl_Scrollbar.H 9116 2011-10-02 06:25:13Z matt $"
-//
-// Scroll bar header file for the Fast Light Tool Kit (FLTK).
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software. Distribution and use rights are outlined in
-// the file "COPYING" which should have been included with this file.  If this
-// file is missing or damaged, see the license at:
-//
-//     http://www.fltk.org/COPYING.php
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
-
-/* \file
-   Fl_Scrollbar widget . */
-
-#ifndef Fl_Scrollbar_H
-#define Fl_Scrollbar_H
-
-#include "Fl_Slider.H"
-
-/**
-  The Fl_Scrollbar widget displays a slider with arrow buttons at
-  the ends of the scrollbar. Clicking on the arrows move up/left and
-  down/right by linesize(). Scrollbars also accept FL_SHORTCUT events:
-  the arrows move by linesize(), and vertical scrollbars take Page
-  Up/Down (they move by the page size minus linesize()) and Home/End
-  (they jump to the top or bottom).
-
-  Scrollbars have step(1) preset (they always return integers). If
-  desired you can set the step() to non-integer values. You will then
-  have to use casts to get at the floating-point versions of value()
-  from Fl_Slider.
-
-  \image html  scrollbar.png 
-  \image latex scrollbar.png "Fl_Scrollbar" width=4cm
-*/
-class FL_EXPORT Fl_Scrollbar : public Fl_Slider {
-
-  int linesize_;
-  int pushed_;
-  static void timeout_cb(void*);
-  void increment_cb();
-protected:
-  void draw();
-
-public:
-
-  Fl_Scrollbar(int X,int Y,int W,int H, const char *L = 0);
-  ~Fl_Scrollbar();
-  int handle(int);
-
-  /**
-    Gets the integer value (position) of the slider in the scrollbar.
-    You can get the floating point value with Fl_Slider::value().
-
-    \see Fl_Scrollbar::value(int p)
-    \see Fl_Scrollbar::value(int pos, int size, int first, int total)
-  */
-  int value() const {return int(Fl_Slider::value());}
-
-  /**
-    Sets the value (position) of the slider in the scrollbar.
-
-    \see Fl_Scrollbar::value()
-    \see Fl_Scrollbar::value(int pos, int size, int first, int total)
-  */
-  int value(int p) {return int(Fl_Slider::value((double)p));}
-
-  /**
-    Sets the position, size and range of the slider in the scrollbar.
-    \param[in] pos   position, first line displayed
-    \param[in] windowSize  number of lines displayed
-    \param[in] first number of first line
-    \param[in] total total number of lines
-
-    You should call this every time your window changes size, your data
-    changes size, or your scroll position changes (even if in response
-    to a callback from this scrollbar).
-    All necessary calls to redraw() are done.
-
-    Calls Fl_Slider::scrollvalue(int pos, int size, int first, int total).
-  */
-  int value(int pos, int windowSize, int first, int total) {
-    return scrollvalue(pos, windowSize, first, total);
-  }
-
-  /**
-    Get the size of step, in lines, that the arror keys move.
-  */
-  int linesize() const {return linesize_;}
-
-  /**
-    This number controls how big the steps are that the arrow keys do.
-    In addition page up/down move by the size last sent to value()
-    minus one linesize().  The default is 16.
-  */
-  void linesize(int i) {linesize_ = i;}
-
-DECLARE_CLASS_CHEAP_RTTI_2(Fl_Scrollbar, Fl_Slider)
-};
-
-#endif
-
-//
-// End of "$Id: Fl_Scrollbar.H 9116 2011-10-02 06:25:13Z matt $".
-//
+//
+// "$Id: Fl_Scrollbar.H 9116 2011-10-02 06:25:13Z matt $"
+//
+// Scroll bar header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2010 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+/* \file
+   Fl_Scrollbar widget . */
+
+#ifndef Fl_Scrollbar_H
+#define Fl_Scrollbar_H
+
+#include "Fl_Slider.H"
+
+/**
+  The Fl_Scrollbar widget displays a slider with arrow buttons at
+  the ends of the scrollbar. Clicking on the arrows move up/left and
+  down/right by linesize(). Scrollbars also accept FL_SHORTCUT events:
+  the arrows move by linesize(), and vertical scrollbars take Page
+  Up/Down (they move by the page size minus linesize()) and Home/End
+  (they jump to the top or bottom).
+
+  Scrollbars have step(1) preset (they always return integers). If
+  desired you can set the step() to non-integer values. You will then
+  have to use casts to get at the floating-point versions of value()
+  from Fl_Slider.
+
+  \image html  scrollbar.png 
+  \image latex scrollbar.png "Fl_Scrollbar" width=4cm
+*/
+class FL_EXPORT Fl_Scrollbar : public Fl_Slider {
+
+  int linesize_;
+  int pushed_;
+  static void timeout_cb(void*);
+  void increment_cb();
+protected:
+  void draw();
+
+public:
+
+  Fl_Scrollbar(int X,int Y,int W,int H, const char *L = 0);
+  ~Fl_Scrollbar();
+  int handle(int);
+
+  /**
+    Gets the integer value (position) of the slider in the scrollbar.
+    You can get the floating point value with Fl_Slider::value().
+
+    \see Fl_Scrollbar::value(int p)
+    \see Fl_Scrollbar::value(int pos, int size, int first, int total)
+  */
+  int value() const {return int(Fl_Slider::value());}
+
+  /**
+    Sets the value (position) of the slider in the scrollbar.
+
+    \see Fl_Scrollbar::value()
+    \see Fl_Scrollbar::value(int pos, int size, int first, int total)
+  */
+  int value(int p) {return int(Fl_Slider::value((double)p));}
+
+  /**
+    Sets the position, size and range of the slider in the scrollbar.
+    \param[in] pos   position, first line displayed
+    \param[in] windowSize  number of lines displayed
+    \param[in] first number of first line
+    \param[in] total total number of lines
+
+    You should call this every time your window changes size, your data
+    changes size, or your scroll position changes (even if in response
+    to a callback from this scrollbar).
+    All necessary calls to redraw() are done.
+
+    Calls Fl_Slider::scrollvalue(int pos, int size, int first, int total).
+  */
+  int value(int pos, int windowSize, int first, int total) {
+    return scrollvalue(pos, windowSize, first, total);
+  }
+
+  /**
+    Get the size of step, in lines, that the arror keys move.
+  */
+  int linesize() const {return linesize_;}
+
+  /**
+    This number controls how big the steps are that the arrow keys do.
+    In addition page up/down move by the size last sent to value()
+    minus one linesize().  The default is 16.
+  */
+  void linesize(int i) {linesize_ = i;}
+
+DECLARE_CLASS_CHEAP_RTTI_2(Fl_Scrollbar, Fl_Slider)
+};
+
+#endif
+
+//
+// End of "$Id: Fl_Scrollbar.H 9116 2011-10-02 06:25:13Z matt $".
+//

Some files were not shown because too many files changed in this diff